import{I as N,G as H,R,C as P,aN as F,k as V,aZ as A,m as q,a_ as x,a$ as z,_ as D,r as c,o as s,a as I,w as S,p as l,n as m,b as n,l as h,q as g,F as p,e as W,f as G}from"./main-DtyiNRRn.js";const j={name:"TeaserBigImageElementFi",components:{IconFi:N,GridContainerFi:H,RichtextFi:R,CloudImageFi:P,VideoPlayerFi:F},mixins:[V,A],props:{fields:{type:Object,default:()=>({})},isSliderElement:{type:Boolean,default:!1},pauseVideo:{type:Boolean,default:!1},image:{type:Object,default:null},imagePosRight:{type:Boolean,default:null},bgColor:{type:String,default:null}},data(){return{wrapperClassName:"teaser-big-image-element-fi__truncate-wrapper",throttledResizeListener:null}},computed:{...q({windowDimensions:"layout/getWindowDimensions"}),isImageSrc(){var t,i,e;return(t=this.image)!=null&&t.src?!0:(e=(i=this.fields.image)==null?void 0:i.value)==null?void 0:e.src},isBigImage(){var t,i;return!!((i=(t=this.fields)==null?void 0:t.bigImageSize)!=null&&i.value)},isImagePosRight(){var t,i;return this.imagePosRight?this.imagePosRight:!!((i=(t=this.fields)==null?void 0:t.imagePosRight)!=null&&i.value)},innovationAwards(){var t,i;return(i=(t=this.fields)==null?void 0:t.teaserBigImageInnovationAwards)!=null&&i.length?this.fields.teaserBigImageInnovationAwards:[]},background(){var t,i,e;return(t=this.fields.darkBackground)!=null&&t.value?"dark":(i=this.fields.lightBackground)!=null&&i.value?"light":(e=this.fields.whiteBackground)!=null&&e.value?"white":this.bgColor?this.bgColor:"brand"},imageParams(){return this.isMD?"func=crop&org_if_sml=0":"aspect_ratio=16:9&org_if_sml=0"}},watch:{windowDimensions:{deep:!0,handler(){this.throttledResizeListener()}}},async mounted(){this.isEditMode||(await this.prepareContent(),this.$refs.rteContent&&x(this.$refs.rteContent.$el),this.throttledResizeListener=z(800,()=>this.truncateContent()),await this.$nextTick(),await this.truncateContent())},methods:{async prepareContent(){const t=this.isEditMode&&!this.isSliderElement?this.$refs.rteContent.querySelector(".scWebEditInput"):this.$refs.rteContent.$el.childNodes[0],i=this.isEditMode?t==null?void 0:t.childNodes:this.$refs.rteContent.$el.childNodes[0].childNodes,e=i==null?void 0:i[0];if(!e)return;const r=document.createElement("div");r.classList.add(this.wrapperClassName),t.insertBefore(r,e),await this.$nextTick();const o=t.querySelector(`.${this.wrapperClassName}`);Array.from(i).splice(1).forEach(a=>{var f;(f=a.classList)!=null&&f.contains("button-fi")||o.appendChild(a)})},async truncateContent(){if(!this.$refs.rteContent)return;const i=(this.isEditMode&&!this.isSliderElement?this.$refs.rteContent.querySelector(".scWebEditInput"):this.$refs.rteContent.$el).querySelector(`.${this.wrapperClassName}`);if(!i)return;i.style["-webkit-line-clamp"]="unset",await this.$nextTick();const e=parseInt(getComputedStyle(this.$refs.content).paddingTop,10)+parseInt(getComputedStyle(this.$refs.content).paddingBottom,10);let r=this.$refs.content.childNodes[0].offsetHeight+e,o=15;const a=async()=>{i.style["-webkit-line-clamp"]=o,await this.$nextTick(),o-=1,r=this.$refs.content.childNodes[0].offsetHeight+e,!(r<=this.$refs.contentContainer.offsetHeight||o===0)&&a()};r>this.$refs.contentContainer.offsetHeight&&a()}}},O={class:"fi-col-start-1 fi-col-span-12"},Y={class:"teaser-big-image-element-fi__column teaser-big-image-element-fi__image-container"},Z={key:0,class:"video-player-fi__overlay"},J={class:"video-player-fi__play-button"},K=["innerHTML"],Q={key:2},U=["src"],X={key:3,class:"teaser-big-image-element-fi__image"},$={key:4,class:"teaser-big-image-element-fi__video"},ee={key:5,class:"teaser-big-image-element-fi__innovation-awards"},te=["innerHTML"],ie={key:1,class:"teaser-big-image-element-fi__award-img"},ae={ref:"contentContainer",class:"teaser-big-image-element-fi__column teaser-big-image-element-fi__details-container"},se={ref:"content",class:"teaser-big-image-element-fi__details"},ne=["innerHTML"],re=["innerHTML"];function le(t,i,e,r,o,a){const f=c("icon-fi"),u=c("cloud-image-fi"),M=c("video-player-fi"),B=c("richtext-fi"),T=c("grid-container-fi");return s(),I(T,{class:m(["teaser-big-image-element-fi",{"teaser-big-image-element-fi--slider-element":e.isSliderElement}]),container:!1},{default:S(()=>{var _,b,v,k,y,C;return[l("div",O,[l("div",{class:m(["teaser-big-image-element-fi__container",[{"teaser-big-image-element-fi__container--dark":a.background==="dark"},{"teaser-big-image-element-fi__container--light":a.background==="light"},{"teaser-big-image-element-fi__container--white":a.background==="white"},{"teaser-big-image-element-fi__container--big-image":a.isBigImage},{"teaser-big-image-element-fi__container--image-pos-right":a.isImagePosRight}]])},[l("div",Y,[t.isEditMode&&t.isVideo(e.fields)?(s(),n("div",Z,[l("div",J,[h(f,{icon:"play"})])])):g("",!0),!e.isSliderElement&&t.isEditMode&&e.fields.image?(s(),n("div",{key:1,class:"teaser-big-image-element-fi__image--editor",innerHTML:e.fields.image.editable},null,8,K)):g("",!0),e.isSliderElement&&t.isEditMode&&e.fields.image?(s(),n("div",Q,[l("img",{src:(_=e.fields.image)==null?void 0:_.value.src},null,8,U)])):!t.isEditMode&&a.isImageSrc&&!t.isVideo(e.fields)?(s(),n("div",X,[h(u,{src:((b=e.fields.image)==null?void 0:b.value.src)||((v=e.image)==null?void 0:v.src),alt:((k=e.fields.image)==null?void 0:k.value.alt)||((y=e.image)==null?void 0:y.alt),params:a.imageParams,"full-height":""},null,8,["src","alt","params"])])):!t.isEditMode&&a.isImageSrc&&t.isVideo(e.fields)?(s(),n("div",$,[h(M,{class:"teaser-big-image-element-fi__video-player",fields:e.fields,"pause-video":e.pauseVideo,"preview-params":"func=crop&org_if_sml=0"},null,8,["fields","pause-video"])])):g("",!0),(C=a.innovationAwards)!=null&&C.length?(s(),n("div",ee,[(s(!0),n(p,null,W(a.innovationAwards,(d,L)=>{var w,E;return s(),n("div",{key:L,class:"teaser-big-image-element-fi__award"},[t.isEditMode&&!e.isSliderElement&&d.fields.image?(s(),n("div",{key:0,class:"teaser-big-image-element-fi__image",innerHTML:d.fields.image.editable},null,8,te)):!t.isEditMode&&((E=(w=d.fields.image)==null?void 0:w.value)!=null&&E.src)?(s(),n("div",ie,[h(u,{src:d.fields.image.value.src,alt:d.fields.image.value.alt,params:"func=crop&org_if_sml=0","full-height":""},null,8,["src","alt"])])):g("",!0)])}),128))])):g("",!0)]),l("div",ae,[l("div",se,[t.isEditMode&&e.fields.content?(s(),n(p,{key:0},[!e.isSliderElement&&e.fields.content.editable?(s(),n("div",{key:0,ref:"rteContent",class:m({"teaser-big-image-element-fi__content richtext-fi":!0,"richtext-fi--light":a.background==="brand"||a.background==="dark"}),innerHTML:e.fields.content.editable},null,10,ne)):(s(),n("div",{key:1,ref:"rteContent",class:m({"teaser-big-image-element-fi__content richtext-fi":!0,"richtext-fi--light":a.background==="brand"||a.background==="dark"}),innerHTML:e.fields.content.value},null,10,re))],64)):(s(),I(B,{key:1,ref:"rteContent",class:m({"teaser-big-image-element-fi__content":!0,"richtext-fi--light":a.background==="brand"||a.background==="dark"}),"is-theme-light":a.background==="brand"||a.background==="dark","html-content":e.fields.content?e.fields.content:null},{default:S(()=>[G(t.$slots,"content",{},void 0,!0)]),_:3},8,["class","is-theme-light","html-content"]))],512)],512)],2)])]}),_:3},8,["class"])}const de=D(j,[["render",le],["__scopeId","data-v-8c1a4013"]]);export{de as T};