import{_ as T,i as C,G as H,I,j as w,x as k,k as y,m as x,r as s,o as n,a as h,w as r,l as a,p as l,b as c,q as _,n as A,e as M,h as O,F as B}from"./main-DtyiNRRn.js";import{A as L}from"./AccordionItemFi-HOsaqSN7.js";import S from"./ImageFi-DGynArhi.js";import z from"./SectionDividerFi-DDwt5OTB.js";import D from"./TextOneColumnFi-Ci0NCsXn.js";import E from"./TextTwoColumnFi-BvqsibXX.js";import"./containerPaddings-D8eaMhv2.js";const G={name:"AccordionFi",components:{AccordionItemFi:L,ComponentWrapper:C,GridContainerFi:H,SectionDividerFi:z,IconFi:I,ImageFi:S,TextOneColumnFi:D,TextTwoColumnFi:E,TextMediaFi:w,SlideUpDown:k},mixins:[y],inject:["fields"],data(){var e;return{isOpen:!!((e=this.fields.initialOpen)!=null&&e.value)}},computed:{...x({headerHeight:"layout/getHeaderHeight"}),contentItems(){return this.fields.accordionContentItems}},methods:{component(e){switch(e){case"AccordionImageItem":return"ImageFi";default:return null}},toggleAccordion(){var e;this.isOpen=!this.isOpen,this.isOpen&&((e=this.fields)!=null&&e.scrollTo)&&this.$smoothScroll({scrollTo:this.$refs.accordionHeader,updateHistory:!1,offset:-this.headerHeight})}}},N=["innerHTML"],V=["innerHTML"],b={class:"accordion-fi__content"};function j(e,t,$,q,m,i){const v=s("icon-fi"),f=s("grid-container-fi"),g=s("slide-up-down"),F=s("component-wrapper");return n(),h(F,{class:"accordion-fi"},{default:r(()=>[a(f,null,{default:r(()=>{var o;return[l("div",{ref:"accordionHeader",class:"accordion-fi__header",onClick:t[0]||(t[0]=(...d)=>i.toggleAccordion&&i.toggleAccordion(...d))},[e.isEditMode?(n(),c("div",{key:0,class:"accordion-fi__header__text",innerHTML:i.fields.title.editable},null,8,N)):_("",!0),!e.isEditMode&&((o=i.fields.title)!=null&&o.value)?(n(),c("div",{key:1,class:"accordion-fi__header__text",innerHTML:i.fields.title.value},null,8,V)):_("",!0),a(v,{class:A({"accordion-fi__header__icon":!0,"accordion-fi__header__icon--active":m.isOpen}),icon:"chevron-down",size:e.isSM?"2":"1"},null,8,["class","size"])],512)]}),_:1}),a(g,{"model-value":m.isOpen,duration:700},{default:r(()=>[l("div",b,[(n(!0),c(B,null,M(i.contentItems,(o,d)=>{var u,p;return n(),c("div",{key:`item-${d}`,class:"accordion-fi__content__item"},[(p=(u=o.fields)==null?void 0:u.itemType)!=null&&p.value?(n(),h(O(o.fields.itemType.value),{key:0,fields:o.fields},null,8,["fields"])):_("",!0)])}),128))])]),_:1},8,["model-value"]),a(f,null,{default:r(()=>t[1]||(t[1]=[l("div",{class:"accordion-fi__hr"},null,-1)])),_:1})]),_:1})}const X=T(G,[["render",j],["__scopeId","data-v-541eea40"]]);export{X as default};