1import{cF as w,bs as W,m as _,aV as X,b6 as J,cG as K,bD as Q,cH as Y,c as u,g as M,h as O,C as Z,q as H,s as ee,F as R,y as te,E as ne,G as $,U as oe,j as G,ak as se,bf as re,bg as j,W as ae,u as ce,bS as ie,p as V}from"./CelG4gE-.js";import{a as le}from"./D7KYvsfC.js";function ue(){const{getIntegrations:c}=w(),i=W("pageHasSegmentation",()=>!1),C=p=>p?.some(v=>{const{segmentation:g,children:h}=v||{};return g?.trim()?!0:h&&C(h)});return{hasSegmentation:C,pageHasSegmentation:i,onNewCmsPageDataAvailable:p=>{i.value=C(p)},filterBasedOnSegmentation:p=>{try{const g=c().getFilters?.()?.segmentationFilters??[];return g.length===0?p:p?.filter(h=>g.every(m=>m(h)))}catch(v){return console.error("Error processing segmentation on page:",v),p}}}}const pe=["fep-grid","fep-grid-cell","fep-container","fep-heading","fep-divider","fep-faq","fep-faq-item","fep-rich-text","fep-list","fep-list-ordered","fep-list-item","fep-list-links","inspiration-content-carousel"],de=["inspiration-top-tasks","inspiration-content-carousel-card"];function fe(c){const{enableAnalytics:i,isRoot:C,genericComponents:b=pe,excludedFromGenericClicks:k=de}=c,{getIntegrations:p}=w(),v=(o,e)=>{const r=p();r.emitAnalyticsEvent&&r.emitAnalyticsEvent(o,e)},g=C?_([]):null,h=C?null:X("impressionCollector"),m=g||h;C&&m&&J("impressionCollector",m);const y=new Set,P=(o,e,r)=>{const{title:s,text:n,link:l,href:F,altText:x,alt:B,linkUrl:T}=o?.properties||{},S=e[1]!==void 0?e[1]+1:null,t=e[2]!==void 0?e[2]+1:null;v("contentBlock",{eventName:r,contentBlock:[{contentCategory:o.type,contentPosition:S,contentSubPosition:t,contentTitle:s??n??x??B??null,clickUrl:l??F??T??null}]})},A=(o,e)=>{!i||b.includes(o.type)||k.includes(o.type)||P(o,e,"contentBlockClick")},E=(o,e,r)=>{if(!i||!o||!(o instanceof Element)||b.includes(e.type))return;const{stop:s}=Y(o,n=>{const l=n[0];l&&l.isIntersecting&&(m?.value.push({component:e,path:r}),s(),y.delete(s))},{threshold:.5});y.add(s)};if(C&&m&&i){let o=0;K(()=>m.value.length,e=>{if(e>o){const r=m.value.slice(o);v("contentBlock",{eventName:"contentBlockImpressions",contentBlock:r.map(({component:s,path:n})=>{const{title:l,text:F,link:x,href:B,altText:T,alt:S,linkUrl:t}=s?.properties||{};return{contentCategory:s.type,contentPosition:n[1]!==void 0?n[1]+1:null,contentSubPosition:null,contentTitle:l??F??T??S??null,clickUrl:x??B??t??null}})}),o=e}},{debounce:300})}return Q(()=>{y.size&&(y.forEach(o=>o()),y.clear())}),{sendClickEvent:A,createImpressionObserver:E}}const ge={__name:"CmsComponent",props:{components:{type:Array,required:!0},parentPath:{type:Array,default:()=>[]},enableAnalytics:{type:Boolean,default:!1}},setup(c){const i=c,b=j().public.fepCms?.componentTypeMapping||{},{filterBasedOnSegmentation:k}=ue(),p=u(()=>k(i.components)),v=e=>b[e]||e,g=new Map,h=e=>{if(g.has(e)){const n=g.get(e);if(n!==void 0)return n}const r=v(e),s=ae(r);return s===r&&console.error(`Could not render a component from CMS, component ${e} does not exist on page ${ce().path}.`),g.set(e,s),s},m=e=>e&&e.replace(/\bxs:u-margin-/g,"u-margin-"),y=u(()=>p.value.map((e,r)=>{const s=[...i.parentPath,r],n=e._uid||s.join("-"),l={...e,attributes:{...e.attributes,class:m(e.attributes?.class)}};return{comp:l,path:s,key:n,resolvedComponent:h(e.type),mergedProps:{...P(l),...e.properties}}})),P=e=>{const{is:r,...s}=e.attributes||{};return s},A=u(()=>i.parentPath.length===0),{sendClickEvent:E,createImpressionObserver:o}=fe({enableAnalytics:i.enableAnalytics,isRoot:A.value});return(e,r)=>{const s=ge;return M(!0),O(R,null,Z(y.value,n=>(M(),H(re(n.resolvedComponent),oe({key:n.key,ref_for:!0},n.mergedProps,{"parent-path":n.path,class:n.comp?.attributes?.class,onClick:se(()=>G(E)(n.comp,n.path),["stop"]),onVnodeMounted:({el:l})=>G(o)(l,n.comp,n.path)}),{default:ee(()=>[n.comp?.attributes?.innerHTML?(M(),O(R,{key:0},[te(ne(n.comp?.attributes?.innerHTML),1)],64)):$("",!0),n.comp?.children?.length?(M(),H(s,{key:1,components:n.comp.children,"parent-path":n.path,"enable-analytics":c.enableAnalytics},null,8,["components","parent-path","enable-analytics"])):$("",!0)]),_:2},1040,["parent-path","class","onClick","onVnodeMounted"]))),128)}}};function ve(){const c=_(null),i=_(null),C=u(()=>c.value?.data||[]),b=u(()=>c.value?.tags||[]),k=u(()=>c.value?.meta||[]),p=u(()=>c.value?.link||[]),v=u(()=>c.value?.title),g=u(()=>c.value?.navigationTitle),h=u(()=>c.value?.pattern),m=u(()=>c.value?.redirectTarget),y=u(()=>k.value?.find(t=>t.name==="layout")?.content??"default"),P=u(()=>k.value?.map(t=>({...t,key:t.name}))),A=u(()=>[...p.value?.filter(t=>t?.rel!=="canonical")||[]]),E=u(()=>b.value.reduce((t,a)=>({...t,[a.key]:a.value}),{})),{getIntegrations:o}=w(),r=j().public.fepCms,s=r?.csBaseUrl,n=r?.appName,l=t=>{const a=o();a.errorHandler?a.errorHandler(t):console.error("[CMS Error]",t.title,t.error)},F=()=>{const a=o().getFilters?.();return[...a?.typeFilters??[],...a?.visibilityFilters??[]]},x=(t,a)=>t.map(d=>({...d,_uid:`cmp-${a.value++}`,children:d.children?x(d.children,a):[]})),B=(t,a)=>t.filter(d=>a.every(U=>U(d))).map(d=>({...d,children:d.children?B(d.children,a):[]})),T=t=>{const a=t.lastIndexOf("."),d=t.lastIndexOf("/");return a>d||a===0};return{getPage:async(t,a=!0)=>{T(t)&&l({title:`Could not fetch page structure for page: ${t}`,type:404});const d=le(encodeURIComponent(t).replace(/%2F/g,"/"),{baseUrl:s,appName:n}),{data:U,error:q,refresh:D,status:N}=await ie(d,()=>$fetch(d,{}),{transform(f){const I={value:0},z=x(f.data,I),L=F();return{...f,data:B(z,L)}},getCachedData(f,I){return I.payload.data[f]||I.static.data[f]},deep:!1,lazy:r?.lazyFetch??!1,immediate:!0});return a&&V(q,f=>{f&&(i.value=f,f.statusCode===404?l({title:`Could not fetch page structure for page: ${t}`,type:404}):l({title:`Could not fetch page structure for page: ${t}`,type:500,error:f,retry:async()=>await D()}))},{immediate:!0}),V(U,f=>{f&&(c.value=f)},{immediate:!0}),{data:c.value,error:i,refresh:D,status:N}},page:c,error:i,components:C,tags:b,meta:k,link:p,title:v,navigationTitle:g,pattern:h,redirectTarget:m,cmsCampaignData:E,headLink:A,headMeta:P,layout:y}}export{ge as _,ve as a,ue as u};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.