1import{_ as b,C as w,$ as m,t as g}from"./app.js";import"./swiper.js";const y={name:"SoylentTopFive",components:{CmmsResponsiveImage:w},data:function(){return{observer:null,itemRefs:[]}},props:["element"],methods:{setItemRef(e){this.itemRefs.push(e)},getHeadline:function(e){return e.headline?e.headline:g(e.post.title,80)},getSubline:function(e){return this.element.data.layout==="user_select"&&e.data.subline?e.data.subline:e.post.kicker},getSublineClasses(e){return"subline"},playVideo:function(e){const t=e.querySelector("video");t&&(t.innerHTML='<source src="'.concat(t.getAttribute("data-src"),'" type="video/mp4">'),t.play())},stopVideo:function(e){const t=e.querySelector("video");t&&t.pause()},addItemEventListeners:function(){this.itemRefs.length<=0||this.itemRefs.forEach(e=>{e.addEventListener("touchstart",()=>{e.classList.contains("--active")||(m([".element","."+this.element.type,"."+this.element.subtype,".focus"].join("")).forEach(t=>{t.classList.remove("focus"),t.classList.remove("focus")}),m([".element","."+this.element.type,"."+this.element.subtype].join("")+" .item.--active").forEach(t=>{t.classList.remove("--active")}),e.classList.add("--active"),this.itemRefs.topFiveElement.classList.add("focus"))}),e.addEventListener("mouseenter",()=>{e.classList.add("--active")}),e.addEventListener("mouseleave",()=>{e.classList.remove("--active")}),this.observer.observe(e,{attributes:!0,attributeOldValue:!0,attributeFilter:["class"]})})},removeItemEventListeners:function(){this.itemRefs.forEach(e=>{e.removeEventListener("touchstart",()=>{}),e.removeEventListener("mouseenter",()=>{}),e.removeEventListener("mouseleave",()=>{})})},itemClassChange:function(e,t,n){const u=e.target,d=t.split(" "),a=n.split(" ");d.includes("--active")?this.playVideo(u):a.includes("--active")&&this.stopVideo(u)}},beforeUpdate(){this.itemRefs=[]},mounted(){this.$nextTick(()=>{this.observer=new MutationObserver(e=>{for(const t of e){const n=t.target.getAttribute(t.attributeName);this.$nextTick(()=>{this.itemClassChange(t,n,t.oldValue)})}}),this.addItemEventListeners()})},beforeUnmount(){this.itemRefs=[],this.observer.disconnect(),this.removeItemEventListeners()}},V=window.Vue.renderList,L=window.Vue.Fragment,o=window.Vue.openBlock,r=window.Vue.createElementBlock,v=window.Vue.resolveComponent,k=window.Vue.createBlock,l=window.Vue.createCommentVNode,i=window.Vue.createElementVNode,c=window.Vue.toDisplayString,h=window.Vue.normalizeClass,C=window.Vue.withCtx,E=window.Vue.createVNode,R={class:"thumbnail"},S=["data-src"],I={key:0,class:"rank"},x={class:"entry"},F={key:0,class:"zone-label"},N={class:"headline"},B={class:"button-wrapper"},T={class:"content-icon iconSet"};function z(e,t,n,u,d,a){const _=v("CmmsResponsiveImage"),f=v("router-link");return o(),r("div",{ref:"topFiveElement",class:h(["element",n.element.type,n.element.subtype,"--"+n.element.data.layout])},[(o(!0),r(L,null,V(n.element.data.items,(s,p)=>(o(),r("div",{ref_for:!0,ref:a.setItemRef,class:"item",key:s.post.post_id},[i("span",R,[s.post.image?(o(),k(_,{key:0,image:s.post.image,fill:!0},null,8,["image"])):l("",!0),s.preview?(o(),r("video",{key:1,class:"video",muted:"",playsinline:"","data-src":s.preview},null,8,S)):l("",!0)]),n.element.data.layout==="most_viewed"?(o(),r("span",I,c(p+1),1)):l("",!0),i("div",x,[s.post.show_ad_label?(o(),r("span",F,"Anzeige")):l("",!0),a.getSubline(s)?(o(),r("h3",{key:1,class:h(a.getSublineClasses(s))},c(a.getSubline(s)),3)):l("",!0),i("h2",N,c(a.getHeadline(s)),1),i("div",B,[E(f,{tag:"a",class:"button",href:s.post.url,to:e.$routerLink(s.post.url)},{default:C(()=>[...t[0]||(t[0]=[i("span",{class:"button__label"},[i("span",{class:"button__icon iconSet"},"notes"),i("span",{class:"button__text"},"Mehr erfahren")],-1)])]),_:1},8,["href","to"]),i("div",T,c(s.post.category_icon),1)])])]))),128))],2)}const M=b(y,[["render",z]]);export{M as default};
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.