1import{G as $,j as F,aY as A,N as T,Q as _,L as h,P as O,a1 as P,O as I,a2 as E,E as U,c1 as N,c2 as H,c3 as L,_ as R,r as g,o as l,c as f,U as m,l as k,w as y,F as B,e as S,$ as j,g as V,t as W,h as M}from"./index-D-iuxWOd.js";import{c as z,s as G,a as q,b as K,v as Q}from"./sliderInteractionTracking-DrZBjYMs.js";import{B as X}from"./BlockVisibilityTracker.component-qQ6l5Y2Y.js";var Y=Object.defineProperty,J=Object.getOwnPropertyDescriptor,d=(i,e,t,n)=>{for(var o=n>1?void 0:n?J(e,t):e,p=i.length-1,a;p>=0;p--)(a=i[p])&&(o=(n?a(e,t,o):a(o))||o);return n&&o&&Y(e,t,o),o};const D=$("edition"),Z=8;let s=class extends F(A,T,X,_){constructor(){super(...arguments),this.emits=["onClickOfContentBlockElement"]}handleItemsChanged(){var e,t;(t=(e=this.$refs.cardSlider)==null?void 0:e.updateSlider)==null||t.call(e)}get displayedItems(){var e;return((e=this.items)==null?void 0:e.slice(0,Z))||[]}get shouldDisplayItems(){return this.displayedItems.length>=this.minItems}getFieldsDescription(e){var n;if(!("fields"in e))return;const t=(n=e.fields)==null?void 0:n.description;if(typeof t=="string")return t}isRawPianoArticle(e){return"click_url"in e}isPianoSectionTagFragment(e){return"clickUrl"in e}getSectionConfigurationDescription(e){if(h(e,"sectionConfiguration")&&h(e.sectionConfiguration,"fields")){const{fields:t}=e.sectionConfiguration;if(h(t,"description")&&typeof t.description=="string")return t.description;if(h(t,"ogDescription")&&typeof t.ogDescription=="string")return t.ogDescription}}getSectionDescription(e){if(this.isRawPianoArticle(e))return e["vrm-description"]??"";if(this.isPianoSectionTagFragment(e))return e.vrmDescription??"";const t=this.getSectionConfigurationDescription(e);return t||("description"in e&&e.description?e.description:"teaser"in e&&e.teaser&&typeof e.teaser=="string"?e.teaser:this.getFieldsDescription(e)||"")}get headline(){return this.$t("sectionsBlock.headline").toString()}getSectionTitle(e){return"fields"in e&&e.fields&&"title"in e.fields?e.fields.title||"":"title"in e&&e.title&&e.title||""}goTo(e){e&&this.navigate(e)}handleButtonClick(e,t){const{url:n}=this.buildFavoriteFromEntry(e);z(t+1,this.displayedItems.length,n,this.headline);const o=this.extractClickUrl(e);this.onClickOnContentBlockElement(n,t,o),this.navigate(n)}extractClickUrl(e){const t=["click_url","clickUrl"];for(const n of t)if(Object.prototype.hasOwnProperty.call(e,n)&&typeof e[n]=="string")return e[n]}onClickOnContentBlockElement(e,t,n){this.$emit("onClickOnContentBlockElement",{url:e,index:t,totalAmountOfStories:this.displayedItems.length,clickUrl:n})}toggleCurrentFavorite(e){const t=this.buildFavoriteFromEntry(e);this.toggleFavorite(t)}buildUrl(e){return this.buildUrlFromEntry(e)}toggleAction(e){var u;const t=this.buildFavoriteFromEntry(e);let n="";"fields"in e&&e.fields&&"category"in e.fields&&e.fields.category&&(n=e.fields.category);const o=this.isFavorite(t),a=((u=t==null?void 0:t.url)==null?void 0:u.includes("/lokales"))?"place":"topic",C={type:this.$t(`sectionsBlock.${n||a}`)};return{icon:{name:"heart",style:o?"solid":"regular"},text:o?`${this.$t("sectionsBlock.unfollow")}`:`${this.$t("sectionsBlock.follow",C)}`}}observationCallBack(){var e;this.shouldDisplayItems&&(G(this.headline),(e=this.observer)==null||e.unobserve(this.$el))}rightArrowClickHandle(){q(this.headline)}leftArrowClickHandle(){K(this.headline)}sliderChangeHandle(e){Q(e+1,this.displayedItems.length,this.headline)}};d([O({required:!0})],s.prototype,"items",2);d([O({default:3})],s.prototype,"minItems",2);d([P("items")],s.prototype,"handleItemsChanged",1);d([D.Getter("getEdition")],s.prototype,"edition",2);d([D.Getter("isReichweitenportal")],s.prototype,"isReichweitenportal",2);s=d([I({name:"SectionsBlock",components:{DnmCardSlider:E,DnmContentWrapper:U,DnmHorizontalList:N,DnmSectionCard:H,DnmTagButton:L}})],s);const x={class:"sectionsBlock","data-testid":"sectionsBlock-container"},ee={key:0,"data-testid":"sectionsBlock-inner-container"},te={class:"sectionsBlock_tagButtonsContainer"};function ie(i,e,t,n,o,p){const a=g("DnmSectionCard"),C=g("DnmCardSlider"),u=g("DnmTagButton"),w=g("DnmContentWrapper");return l(),f("section",x,[i.shouldDisplayItems?(l(),f("div",ee,[m(i.$slots,"headline",{},void 0,!0),i.isReichweitenportal?(l(),k(w,{key:1,size:"large"},{default:y(()=>[j("div",te,[(l(!0),f(B,null,S(i.displayedItems,(r,c)=>(l(),k(u,{onOnClick:v=>i.goTo(i.buildUrl(r)),"data-testid":`sections-block-dnm-tag-button-${c}`,key:c,title:i.getSectionTitle(r),url:i.buildUrl(r)},{default:y(()=>[V(W(i.getSectionTitle(r)),1)]),_:2},1032,["onOnClick","data-testid","title","url"]))),128))])]),_:1})):(l(),k(C,{key:0,onOnRightArrowClick:i.rightArrowClickHandle,onOnLeftArrowClick:i.leftArrowClickHandle,onOnSliderChange:i.sliderChangeHandle,"content-wrapper-size":"large","data-testid":"sectionsBlock-cardSli
1der-container",ref:"cardSlider"},{default:y(()=>[(l(!0),f(B,null,S(i.displayedItems,(r,c)=>(l(),k(a,{onOnButtonClick:v=>i.handleButtonClick(r,c),onOnLinkClick:v=>i.toggleCurrentFavorite(r),"button-url":i.buildUrl(r),"button-text":i.$t("sectionsBlock.buttonText"),"data-testid":`sectionsBlock-cardSlider-card-${c}`,description:i.getSectionDescription(r),headline:i.getSectionTitle(r),key:c,"secondary-action":!i.edition.disableMyNews&&i.isWebApp?i.toggleAction(r):null,"element-track-visibility":i.extractClickUrl(r),"full-width":"",stretch:""},null,8,["onOnButtonClick","onOnLinkClick","button-url","button-text","data-testid","description","headline","secondary-action","element-track-visibility"]))),128))]),_:1},8,["onOnRightArrowClick","onOnLeftArrowClick","onOnSliderChange"])),m(i.$slots,"divider",{},void 0,!0)])):M("",!0)])}const le=R(s,[["render",ie],["__scopeId","data-v-ebd99b0c"]]);var b;try{"__c"in s&&((b=s.__c).componentFileName??(b.componentFileName=Object.create(null)),Object.defineProperty(s.__c,"componentFileName",{value:"app/components/sectionsBlock/SectionsBlock.vue"}))}catch(i){console.error("injectFileNamePlugin",i)}export{le as S};
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.