import{_ as ce}from"./WebContentItem-Lqu7iVHP.mjs";import{_ as de,a1 as re,bx as U,o as n,c as l,a as I,F as V,x as $,y as S,d as q,p as W,u as ue,R as ye,W as G,af as he,S as ge,by as H,l as h,b as me,k as i,t as j,bz as R,q as fe,r as pe,f as Se}from"./D6ipka4G.js";import{_ as be}from"./WebImage-NuAmKOMh.mjs";import{u as ve}from"./useImageUrl-1XbeiwSF.mjs";const ke={props:{data:{type:Object,default(){return{items:[]}}},imagePosition:{type:String,default:"above"},imageShaping:{type:String,default:"crop"},rowLayout:{type:String},numberOfColumns:{type:Number,default:1},showSummary:{type:Boolean,default:!0},hidePrimarySection:{type:Boolean},hidePublishedDate:{type:Boolean,default:!1},hideCompanyDate:{type:Boolean,default:!1},showDate:{type:Boolean,default:!0},displayFullHeadlines:{type:Boolean,default:!1},breadcrumbTextTransform:{type:String},nativeAdSlotIndex:{type:[String,Number],default:0},nativeType:{type:String,default:"list"},itemMask:{type:Boolean,default:!1},pageCompanyName:{type:String,default:""},titleColor:{type:String},injectNativeAd:{type:Boolean,default:!1},showUpcomingIndicator:{type:Boolean,default:!1},loadFirstImageNonLazy:{type:Boolean,default:!1}},emits:["item-click"],data(){return{id:re()}},computed:{cssVars(){let e="";for(let a=0;a<this.numCols;a++)e=`${e} 1fr`;return{"--four-columns":this.numCols>=4?"1fr 1fr 1fr 1fr":e,"--three-columns":this.numCols>=3?"1fr 1fr 1fr":e,"--two-columns":this.numCols>=2?"1fr 1fr":e}},imageSide(){return!(this.imagePosition==="above"||this.imagePosition==="behind"||this.imagePosition==="none")},numCols(){return this.numberOfColumns??1},itemsWithAd(){var a,t;const e=[...((a=this==null?void 0:this.data)==null?void 0:a.items)??[]];return!this.nativeAdSlotIndex||this.nativeAdSlotIndex<1||!((t=this.nativeAd)!=null&&t.nativeTitle)?e:this.injectNativeAd?(e.splice(this.nativeAdSlotIndex-1,0,this.nativeAd),e):(e[this.nativeAdSlotIndex-1]=this.nativeAd,e)},nativeAd(){return this.nativeType==="list"?U().value.listItems[this.id]:U().value.body},someItemsHaveImages(){return this.itemsWithAd.some(e=>e.primaryImage!==null)}},created(){this.nativeType==="list"&&this.nativeAdSlotIndex>0&&U.registerContentList(this.id)},methods:{checkPageCompanyName(e){var a;return((a=e.company)==null?void 0:a.name)!==this.pageCompanyName}}},Ie={ref:"content_list",class:"items-wrapper"},Ae=["onClick"];function Ce(e,a,t,g,P,r){const m=ce;return n(),l("div",{class:S(["content-list",[t.imagePosition,r.numCols>1?"grid":""]]),style:W(r.cssVars)},[I("div",Ie,[(n(!0),l(V,null,$(r.itemsWithAd,(f,o)=>(n(),l("div",{key:f.id,class:S(["item",e.$ss.contentStyle.itemVerticalSpacing?e.$ss.contentStyle.itemVerticalSpacing:"small"]),onClick:()=>{e.$emit("item-click",f)}},[q(m,{class:"content-item",item:f,"title-font-size":16,"title-color":t.titleColor,"show-summary":t.showSummary,"show-upcoming-indicator":t.showUpcomingIndicator,"hide-primary-section":t.hidePrimarySection,"hide-published-date":t.hidePublishedDate,"hide-company-date":t.hideCompanyDate,"show-date":t.showDate,"display-full-headline":t.displayFullHeadlines,"image-position":t.imagePosition,"image-shaping":t.imageShaping,"page-company-name":t.pageCompanyName,"item-mask":t.itemMask,"lazy-load-image":!t.loadFirstImageNonLazy||o>0,"some-items-have-images":r.someItemsHaveImages},null,8,["item","title-color","show-summary","show-upcoming-indicator","hide-primary-section","hide-published-date","hide-company-date","show-date","display-full-headline","image-position","image-shaping","page-company-name","item-mask","lazy-load-image","some-items-have-images"])],10,Ae))),128))],512)],6)}const we=de(ke,[["render",Ce],["__scopeId","data-v-836d1e34"]]),$e=Object.freeze(Object.defineProperty({__proto__:null,default:we},Symbol.toStringTag,{value:"Module"})),Pe={key:0,class:"mask"},De={key:2,class:"image-wrapper"},Ne={class:"text-box"},xe={key:0,class:"section-and-label"},Be=["target"],Le=["href","target","rel"],Te=["innerHTML"],ze={key:1,class:"date-wrapper"},We=["innerHTML"],Ue={key:3,class:"date"},Me={__name:"WebContentItemNew",props:{imagePosition:{type:String,default:"none"},item:{type:Object,required:!0},teaserDisplay:{type:String,default:"truncated"},hidePrimarySectionAndLabel:{type:Boolean},hidePublishedDate:{type:[String,Boolean],default:!1},hideCompanyDate:{type:Boolean,default:!1},displayFullHeadline:{type:Boolean,default:!1},itemMask:{type:Boolean,default:!1},lazyLoadImage:{type:Boolean,default:!0},showUpcomingIndicator:{type:Boolean,default:!1},textAlignment:{type:String,default:"left"},scale:{type:String,default:"small"},imageAspectRatio:{type:[Number,String],default:"1.3"},colorScheme:{type:String,default:"default"}},setup(e){var y,J,K,Q,X,Y,Z,_,ee,te,ae;const a=e,{$ss:t}=ue(),g=ye(""),P=new Date().getTime(),r=a.showUpcomingIndicator&&a.item.startDate>P,m=G(()=>{var v,k;if((v=a.item)!=null&&v.nativeImagePath)return a.item.nativeImagePath;const{src:s,isLogo:D}=((k=a.item)==null?void 0:k.primaryImage)??{};return s?ve(s,"crop",D):""}),f=((J=(y=a.item)==null?void 0:y.primarySection)==null?void 0:J.alias)??"",o=(!f.startsWith("http")&&!f.startsWith("/")?"/":"")+((Q=(K=a.item)==null?void 0:K.primarySection)==null?void 0:Q.alias),c=((X=a.item)==null?void 0:X.nativeUrl)??((Z=(Y=a.item)==null?void 0:Y.siteContext)==null?void 0:Z.path)??((_=a.item)==null?void 0:_.alias)??`/${a.item.id}`,u=(c.startsWith(`https://www.${t.general.rootDomain}`)||c.startsWith("/"))&&(((ee=a.item)==null?void 0:ee.layoutOverride)===null||((ae=(te=a.item)==null?void 0:te.layoutOverride)==null?void 0:ae.hideSiteShell)===!1)?"_self":"_blank",d=he().getStyles(a.colorScheme),p=d.textColor??t.colors.primary.main,b=d.textColor??t.colors.primary.main;return ge(async()=>{var D,v,k,N,x,B,L;const s=await H.membershipSystemActive();if((v=(D=a.item)==null?void 0:D.membership)!=null&&v.length&&s&&!a.hidePrimarySectionAndLabel){const M=s?H.isLoggedIn():!1;let A=!1;if(s&&((N=(k=a.item)==null?void 0:k.membership)!=null&&N.length)){const C=await H.getUserInfo();A=(M?(x=C==null?void 0:C.memberships)==null?void 0:x.filter(O=>{var T,z;const w=(z=(T=a.item)==null?void 0:T.membership)==null?void 0:z.map(F=>F.id);return w==null?void 0:w.includes(O)}):[]).length===0}await H.hasSiteLicenseCompany()&&(A=!1),g.value=A?"lock":"lock-open-right"}else g.value=((L=(B=a.item)==null?void 0:B.gating)==null?void 0:L.surveyType)==="omeda"?"lock":""}),(s,D)=>{var x,B,L,M,A,C,E,O,w,T,z,F,ie,ne,le,se;const v=pe,k=be,N=Se;return n(),l("div",{ref:"item",class:S(["content-item-new",i(m)?"image-"+e.imagePosition:"",e.textAlignment,`scale-${e.scale??"small"}`,e.colorScheme,i(g)?"gated":""]),style:W({display:e.imagePosition==="above"?"block":"flex",flexDirection:e.imagePosition==="right"?"row-reverse":"row"})},[e.itemMask?(n(),l("div",Pe)):h("",!0),(x=e.item)!=null&&x.nativeImpressionTrackerUrl?(n(),me(v,{key:1,href:e.item.nativeImpressionTrackerUrl},null,8,["href"])):h("",!0),e.imagePosition!=="none"&&i(m)?(n(),l("div",De,[q(k,{image:i(m),alt:((L=(B=e.item)==null?void 0:B.primaryImage)==null?void 0:L.alt)??((M=e.item)==null?void 0:M.name),credit:e.item.primaryImage?e.item.primaryImage.credit:"","credit-position":"top","content-type":e.item.contentType||e.item.type,"image-link":i(c),target:i(u),"lazy-load":e.lazyLoadImage,"aspect-ratio":e.imageAspectRatio},null,8,["image","alt","credit","content-type","image-link","target","lazy-load","aspect-ratio"])])):h("",!0),I("div",Ne,[!e.hidePrimarySectionAndLabel&&((C=(A=e.item)==null?void 0:A.primarySection)!=null&&C.name||(O=(E=e.item)==null?void 0:E.labels)!=null&&O.length)?(n(),l("div",xe,[i(g)?(n(),me(N,{key:0,icon:`material-symbols:${i(g)}`,class:"lock","icon-color":i(p),width:18},null,8,["icon","icon-color"])):h("",!0),(n(!0),l(V,null,$((w=e.item)==null?void 0:w.labels,oe=>(n(),l("div",{key:oe,class:"labels",style:W({fontFamily:"var(--primary-font-family)",color:i(b)})},[I("span",null,j(oe),1)],4))),128)),(z=(T=e.item)==null?void 0:T.primarySection)!=null&&z.name&&!((ie=(F=e.item)==null?void 0:F.labels)!=null&&ie.length)?(n(),l("a",{key:1,class:"section-name",href:o,target:o.startsWith("http")?"_blank":"_self",style:W({color:i(b)})},j((ne=e.item)==null?void 0:ne.primarySection.name),13,Be)):h("",!0)])):h("",!0),I("a",{href:i(c),target:i(u),class:"title-wrapper",rel:(se=(le=e.item)==null?void 0:le.labels)!=null&&se.includes("Sponsored")?"sponsored":null},[I("h3",{class:S(["title-text-wrapper",[e.displayFullHeadline?"":"clamp-headline"]]),style:{fontFamily:"var(--primary-font-family)"}},[I("div",{class:S(["title-text",!i(m)&&e.imagePosition!=="above"?"items-with-images":""]),innerHTML:e.item.nativeTitle??e.item.shortName??e.item.name},null,10,Te)],2)],8,Le),("useApStylePubDate"in s?s.useApStylePubDate:i(R))(e.item)&&!e.hidePublishedDate&&i(r)?(n(),l("div",ze,[I("div",{class:S(["date","upcoming"]),style:W({backgroundColor:i(r)?i(t).colors.primary.main:"inherit"})},[q(N,{icon:"mdi:clock-outline","icon-color":"white"}),fe(" "+j(("useApStylePubDate"in s?s.useApStylePubDate:i(R))(e.item))+" - Upcoming ",1)],4)])):h("",!0),e.teaserDisplay&&e.teaserDisplay!=="none"?(n(),l("div",{key:2,class:"teaser-text",innerHTML:e.item.nativeSummary??e.item.teaser},null,8,We)):h("",!0),("useApStylePubDate"in s?s.useApStylePubDate:i(R))(e.item)&&!e.hidePublishedDate&&!i(r)?(n(),l("div",Ue,j(("useApStylePubDate"in s?s.useApStylePubDate:i(R))(e.item)),1)):h("",!0)])],6)}}},Oe=["onClick"],Fe={__name:"WebContentListNew",props:{data:{type:Object,default(){return{items:[]}}},imagePosition:{type:String,default:"above"},imageShaping:{type:String,default:"crop"},rowLayout:{type:String},numberOfColumns:{type:Number,default:1},teaserDisplay:{type:String,default:"truncated"},hidePrimarySectionAndLabel:{type:Boolean},hidePublishedDate:{type:[String,Boolean],default:!1},hideCompanyDate:{type:Boolean,default:!1},displayFullHeadlines:{type:Boolean,default:!1},breadcrumbTextTransform:{type:String},nativeAdSlotIndex:{type:[String,Number],default:0},nativeType:{type:String,default:"list"},itemMask:{type:Boolean,default:!1},pageCompanyName:{type:String,default:""},injectNativeAd:{type:Boolean,default:!1},showUpcomingIndicator:{type:Boolean,default:!1},loadFirstImageNonLazy:{type:Boolean,default:!1},textAlignment:{type:String,default:"left"},scale:{type:String,default:"small"},imageAspectRatio:{type:[Number,String],default:"1.8"},colorScheme:{type:String,default:"default"}},emits:["item-click"],setup(e,{emit:a}){const t=e,g=a,P=re(),r=U(),m=G(()=>t.nativeType==="list"?r.value.listItems[P]:r.value.body),f=G(()=>{var p,b;const o=[...((p=t==null?void 0:t.data)==null?void 0:p.items)??[]];(b=m==null?void 0:m.value)!=null&&b.nativeTitle&&t.nativeAdSlotIndex>0&&(t.injectNativeAd?o.splice(t.nativeAdSlotIndex-1,0,m.value):o[t.nativeAdSlotIndex-1]=m.value);const c=[];let u=0,d=0;for(let y=0;y<o.length;y++)u>t.numberOfColumns-1&&(d++,u=0),c[d]||(c[d]=[]),c[d][u]=o[y],u++;return c});return t.nativeType==="list"&&t.nativeAdSlotIndex>0&&U.registerContentList(P),(o,c)=>{const u=Me;return n(),l("div",{class:S(["content-list",[e.imagePosition,e.numberOfColumns>1?"multi-col":"",`columns-${e.numberOfColumns}`,e.colorScheme]])},[(n(!0),l(V,null,$(i(f),d=>(n(),l("div",{key:d,class:"item-row"},[(n(!0),l(V,null,$(d,(p,b)=>{var y;return n(),l("div",{key:p,class:S(["item",(y=o.$ss)!=null&&y.useNewDesign?"":o.$ss.contentStyle.itemVerticalSpacing?o.$ss.contentStyle.itemVerticalSpacing:"small"]),onClick:()=>{g("item-click",p)}},[q(u,{class:"content-item",item:p,scale:e.scale,"title-font-size":16,"show-upcoming-indicator":e.showUpcomingIndicator,"teaser-display":e.teaserDisplay,"hide-primary-section-and-label":e.hidePrimarySectionAndLabel,"hide-published-date":e.hidePublishedDate,"hide-company-date":e.hideCompanyDate,"display-full-headline":e.displayFullHeadlines,"image-position":e.imagePosition,"image-shaping":"crop","image-aspect-ratio":e.imageAspectRatio,"page-company-name":e.pageCompanyName,"text-alignment":e.textAlignment,"item-mask":e.itemMask,"color-scheme":e.colorScheme??"default","lazy-load-image":!e.loadFirstImageNonLazy||b>0},null,8,["item","scale","show-upcoming-indicator","teaser-display","hide-primary-section-and-label","hide-published-date","hide-company-date","display-full-headline","image-position","image-aspect-ratio","page-company-name","text-alignment","item-mask","color-scheme","lazy-load-image"])],10,Oe)}),128))]))),128))],2)}}},qe=Object.freeze(Object.defineProperty({__proto__:null,default:Fe},Symbol.toStringTag,{value:"Module"}));export{$e as W,we as _,Fe as a,qe as b};