import{b as l,c as r,B as n,X as F,p,E as g,O as Q,k as R,aR as Y,$ as q,a0 as A,m as w,l as a,aG as te,r as $,q as V,t as k,C as se,au as oe,v as ae,V as X,Z as re,a1 as ue,U as Z,av as J,aA as G,aO as K,Y as D,a9 as ie,N as W,n as ee,at as ce,ay as de,aC as me}from"./DLeNnjfg.js";import{_ as pe,a as he,b as ve}from"./CofNE0IM.js";import{u as fe,a as be}from"./CA4OmUY3.js";import{u as ye}from"./DuUgDHZl.js";import{_ as ge}from"./Dfxq-6fo.js";import"./D0f3BpDz.js";import"./D8RycAuk.js";import"./z5gBg8Qm.js";import"./BgWXDPZs.js";import"./CMv1G0vV.js";const xe=["for"],_e={class:"relative"},ke=["id","placeholder","name","value"],we={__name:"InputText",props:{id:{type:[String,Number]},label:{type:String,default:void 0},placeholder:{type:String,default:void 0},name:{type:String,default:void 0},modelValue:{type:String,default:void 0},showLabel:{type:Boolean,default:!0}},emits:["update:modelValue"],setup(t,{emit:v}){const m=v;function i(o){m("update:modelValue",o)}return(o,f)=>(l(),r("div",{class:g(["c-input-text",`c-input-text--${t.name}`])},[t.showLabel?(l(),r("label",{key:0,for:t.id,class:"form-label w-full block text-header-xxs font-headline font-bold mb-xs mt-sm"},[n("span",null,F(t.label),1)],8,xe)):p("",!0),n("div",_e,[n("input",{id:t.id,class:g("c-input-text__input relative text-black flex-shrink-0 flex-grow w-12col >=960:w-10col >=1200:w-6col block pl-28 py-15 pr-45 border-1"),placeholder:t.placeholder,name:t.name,type:"text",value:t.modelValue,onInput:f[0]||(f[0]=s=>i(s.target.value))},null,40,ke),Q(o.$slots,"icon")])],2))}},$e=["id"],Ve={key:0,class:"text-header-xxs font-headline font-bold mb-xs mt-sm"},Le={class:"flex gap-30 flex-wrap justify-center"},Se={__name:"InputCheckboxList",props:{id:String,items:Array,label:String,name:String,checked:Boolean,modelValue:{type:String,default:void 0}},emits:["change","update:modelValue"],setup(t,{emit:v}){const m=t,i=R(()=>m.id&&typeof m.id=="string"?m.id:typeof m.id=="number"?`checkbox-list-${m.id}`:`checkbox-list-${Y()}`),o=v;function f(s,b){var z;const x=m.items||[];[...((z=document.getElementById(i.value))==null?void 0:z.querySelectorAll("input"))??[]].forEach((y,S)=>{const N=x[S];N&&(N.checked=y.checked)});const I=[...new Set(x.filter(y=>y.checked).map(y=>y.value))].join(",");o("update:modelValue",I),o("change",s,b)}return(s,b)=>{const x=te;return l(),r("div",{id:a(i),class:g(["c-input-checkbox-list",`c-input-checkbox-list--${t.name}`])},[t.label?(l(),r("div",Ve,F(t.label),1)):p("",!0),n("div",Le,[(l(!0),r(q,null,A(t.items,c=>(l(),w(x,{key:c.value,modelValue:c.checked,"onUpdate:modelValue":L=>c.checked=L,item:c,name:t.name,onUpdateSearch:f},null,8,["modelValue","onUpdate:modelValue","item","name"]))),128))])],10,$e)}}},Ce={key:0,class:"c-input-dropdown relative w-fit"},Be={key:0,class:"text-header-xxs font-headline font-bold mb-xs mt-sm"},Ue={class:"c-dropdown__wrapper"},Te={__name:"InputDropdown",props:{items:Array,label:String,buttonClasses:String,defaultPortionSize:{type:Number,default:void 0},name:{type:String,default:void 0},modelValue:{type:String,default:""}},emits:["change","update:modelValue"],setup(t,{emit:v}){const m=t,i=v,o=$(!1),f=()=>{o.value=!o.value},s=$(null),b=c=>{s.value=c,o.value=!1,i("update:modelValue",s.value.value),i("change",s.value)},x=Y();return m.modelValue?s.value=m.items.find(c=>c.value===m.modelValue):s.value=m.items[0],(c,L)=>{const I=pe,z=he,y=ve;return t.items&&a(s)!==null?(l(),r("div",Ce,[t.label?(l(),r("div",Be,F(t.label),1)):p("",!0),V(I,{"aria-owns":`dropdown-option-list-${a(x)}`,class:g(["c-dropdown__button text-left font-bold w-full >=375:w-fit flex gap-x-12 items-center border-1 px-20 py-12 cursor-pointer",t.buttonClasses]),onClick:L[0]||(L[0]=S=>f())},{default:k(()=>[Q(c.$slots,"button-icon-before"),n("span",null,F(a(s).label),1),Q(c.$slots,"button-icon-after")]),_:3},8,["aria-owns","class"]),n("div",Ue,[V(y,{id:`dropdown-option-list-${a(x)}`},{default:k(()=>[(l(!0),r(q,null,A(t.items,(S,N)=>(l(),w(z,se({id:`dropdown-option-${N}`,key:S.value,"data-value":S.value,ref_for:!0},S,{class:["px-24 py-16 last-of-type:pb-20",[{"c-dropdown__option--selected pointer-events-none":a(s).value===S.value}]],onClick:P=>b(S)}),{default:k(()=>[n("span",null,F(S.label),1)]),_:2},1040,["id","data-value","class","onClick"]))),128))]),_:1},8,["id"])])])):p("",!0)}}},Fe=["id"],Ie={key:0,class:"text-header-xxs font-headline font-bold mb-xs mt-sm"},Oe={class:"flex gap-30 flex-wrap"},Ne={__name:"InputRadioList",props:{items:Array,label:String,name:String,checked:Boolean,modelValue:{type:String,default:void 0}},emits:["change","update:modelValue"],setup(t,{emit:v}){const m=t,i=R(()=>m.id&&typeof m.id=="string"?m.id:typeof m.id=="number"?`radio-list-${m.id}`:`radio-list-${Y()}`),o=v;function f(s,b){o("update:modelValue",b),o("change",s,b)}return(s,b)=>{const x=te;return l(),r("div",{id:a(i),class:g(["c-input-radio-list",`c-input-radio-list--${t.name}`])},[t.label?(l(),r("div",Ie,F(t.label),1)):p("",!0),n("div",Oe,[(l(!0),r(q,null,A(t.items,c=>(l(),w(x,{id:`radio-input--${c.value}`,key:c.value,modelValue:c.checked,"onUpdate:modelValue":L=>c.checked=L,type:"radio",item:c,name:t.name,onUpdateSearch:f},null,8,["id","modelValue","onUpdate:modelValue","item","name"]))),128))])],10,Fe)}}},Ee={class:"relative w-full flex flex-col text-current-primary"},ze={class:"flex flex-col group-hover:opacity-50 duration-500 ease-in-out"},De={key:0,class:"text-header-sm mb-8"},qe=["innerHTML"],Me={__name:"FilterCard",props:{ratio:Number,image:Object,url:String,id:String,target:String,title:String,teaser:String,parentTheme:String,validUrls:Array},setup(t){const v=t;oe();const m=ae(),i=fe(v.validUrls,m.fullPath),o=ye(v.parentTheme);return(f,s)=>{const b=re,x=ue;return l(),w(x,{to:a(i).currentDomainUrl!==""?a(i).currentDomainUrl:t.url,target:t.target,class:"c-filter-card group overflow-hidden"},{default:k(()=>{var c;return[n("div",Ee,[n("div",{class:"relative mb-16 overflow-hidden",style:X(`aspect-ratio: ${t.ratio}; background-color: ${a(o)}`)},[(c=t.image)!=null&&c.cropUrl&&t.image.cropUrl.length>0?(l(),w(b,{key:0,class:"w-fit h-auto group-hover:scale-[1.07] duration-500 ease-in-out",src:t.image.cropUrl,width:1024,fit:"cover",ratio:t.ratio,sizes:"300px >=375:450px >=960:600px >=1200:460px",loading:"eager"},null,8,["src","ratio"])):(l(),r("div",{key:1,class:"w-fit h-auto",style:X(`aspect-ratio: ${t.ratio}`)},null,4))],4),n("div",ze,[t.title?(l(),r("h3",De,F(t.title),1)):p("",!0),t.teaser?(l(),r("div",{key:1,class:"text-body-sm mb-12",innerHTML:t.teaser},null,8,qe)):p("",!0)])])]}),_:1},8,["to","target"])}}},Ae={class:"d-filter-list"},je={class:"pb-md"},Re={class:"flex flex-col w-12col >=1024:w-8col >=1200:w-6col mx-auto"},Pe={class:"absolute isolate top-29 left-full -translate-y-1/2 -translate-x-full -ml-10 z-20 pointer-events-none"},He={class:"relative w-40 h-40"},Ge={class:"overflow-hidden text-center"},Qe={class:"overflow-hidden"},Xe={class:"absolute isolate top-29 left-full -translate-y-1/2 -translate-x-full -ml-10 z-20 pointer-events-none"},Ye={class:"relative w-40 h-40"},Ze={class:"overflow-hidden"},Je={class:"relative"},Ke={key:0,class:"flex justify-center gap-20 mt-42 pt-10 border-t-1"},We={class:"text-body-sm-regular"},et={class:"c-search-manager__results mt-42 grid grid-cols-1 >=605:grid-cols-2 >=960:grid-cols-3 >=1440:grid-cols-4 justify-center w-full gap-y-64 gap-x-layout-gutter max-w-layout-max mx-auto"},dt={__name:"FilterList",props:{hero:Object,umbMeta:Object,algoliaFilters:Object,brands:Array,isError:{type:Boolean,default:!1}},setup(t){const v=t,m=ae(),i=$(null),o=$(be(v.algoliaFilters,{populateFromQuery:!0})),f=$(!1),s=$(!1),b=$(!1),x=()=>{b.value=!0,s.value=!s.value,setTimeout(()=>{b.value=!1},300)},c=R(()=>o.value.fields.filter(u=>u.type!=="hidden")),L=$(""),I=$(!1),z=$(null);function y(){I.value=!0,i.value.page=0,setTimeout(()=>{ee(()=>{var u,_,O;f.value||(i==null||i.value.limboSearch.submit(),(O=(_=(u=i==null?void 0:i.value)==null?void 0:u.limboSearch)==null?void 0:_.state)!=null&&O.isLoading||(L.value="",L.value=o.value.fieldByName.query.value),z.value=ce(()=>{var C,B,U;(U=(B=(C=i==null?void 0:i.value)==null?void 0:C.limboSearch)==null?void 0:B.state)!=null&&U.isLoading||(clearInterval(z.value),I.value=!1)},2e3))})},300)}const S=R(()=>{var _,O,C,B;let u=!1;return(O=(_=o.value.fieldsByType)==null?void 0:_.checkboxList)==null||O.forEach(U=>{u=u||U.items.some(T=>T.checked)}),(B=(C=o.value.fieldsByType)==null?void 0:C.customTabs)==null||B.forEach(U=>{u=u||U.items.some(T=>T.checked)}),o.value.fieldByName.query.value&&o.value.fieldByName.query.value!==""&&(u=!0),u}),N=(u,_=!1)=>{var O,C,B,U;f.value=!0,o.value.fieldByName.query.value="",(C=(O=o.value.fieldsByType)==null?void 0:O.checkboxList)==null||C.forEach(T=>{T.items.forEach(M=>{M.checked=!1}),T.value=""}),(U=(B=o.value.fieldsByType)==null?void 0:B.customTabs)==null||U.forEach(T=>{T.items.forEach(M=>{M.checked=!1}),T.value=""}),ee(()=>{f.value=!1,y()})},P=$("");P.value=Z(v.umbMeta,"FilterOverview");const H=$("");return H.value=Z(v.umbMeta,"FilterOverviewBody"),(u,_)=>{const O=de,C=me,B=we,U=Se,T=Te,M=Ne,le=Me,ne=ge;return l(),r("div",Ae,[V(O,{"umb-meta":t.umbMeta,content:t.hero,theme:a(P),"layout-type":"filterList"},null,8,["umb-meta","content","theme"]),n("div",{class:g(`${a(H)} z-20 relative d-filter-list__content text-current-primary c-block-list__separator-padding c-block-list__separator-line <960:px-layout-margin pb-md2 bg-current-color min-h-[75vh]`)},[n("div",je,[n("div",Re,[(l(!0),r(q,null,A(a(c),(e,d)=>{var E;return l(),r(q,null,[e.name==="query"?(l(),r("div",{key:e.name},[e.type==="text"?(l(),w(B,{key:e.name,modelValue:e.value,"onUpdate:modelValue":h=>e.value=h,name:e.name,label:e.label,placeholder:e.placeholder,"show-label":e.name!=="query",class:g({"-mt-29 z-20 relative":e.name==="query"}),onChange:y},{icon:k(()=>[n("div",Pe,[n("div",He,[V(J,{name:"t-search-state-fade"},{default:k(()=>{var h;return[((h=e.value)==null?void 0:h.length)>0&&!a(I)?(l(),r("button",{key:0,class:"absolute top-1/2 -translate-y-1/2 left-1/2 -translate-x-1/2 pointer-events-auto",onClick:_[0]||(_[0]=j=>N(!0))},[V(a(G),{class:"w-24 >=605:w-30 flex-shrink-0"})])):p("",!0),a(I)?(l(),w(C,{key:1,size:"small",class:"absolute top-1/2 -translate-y-1/2 left-1/2 -translate-x-1/2"})):p("",!0)]}),_:2},1024)])])]),_:2},1032,["modelValue","onUpdate:modelValue","name","label","placeholder","show-label","class"])):p("",!0)])):p("",!0),e.type==="checkboxList"?(l(),r("div",{key:e.name,class:g(["grid duration-500 ease-in-out",[d>1&&!a(s)?"grid-rows-[0fr]":"grid-rows-[1fr]"]])},[n("div",Ge,[e.type==="checkboxList"?(l(),w(U,{key:e.name,modelValue:e.value,"onUpdate:modelValue":h=>e.value=h,name:e.name,label:e.label,items:e.items,onChange:y},null,8,["modelValue","onUpdate:modelValue","name","label","items"])):p("",!0)])],2)):p("",!0),e.type==="text"&&e.name!=="query"?(l(),r("div",{key:e.name,class:g(["grid duration-500 ease-in-out",[d>1&&!a(s)?"grid-rows-[0fr]":"grid-rows-[1fr]"]])},[n("div",Qe,[e.type==="text"?(l(),w(B,{key:e.name,modelValue:e.value,"onUpdate:modelValue":h=>e.value=h,name:e.name,label:e.label,placeholder:e.placeholder,"show-label":!0,onChange:y},{icon:k(()=>[n("div",Xe,[n("div",Ye,[V(J,{name:"t-search-state-fade"},{default:k(()=>{var h;return[((h=e.value)==null?void 0:h.length)>0&&!a(I)?(l(),r("button",{key:0,class:"absolute top-1/2 -translate-y-1/2 left-1/2 -translate-x-1/2 pointer-events-auto",onClick:_[1]||(_[1]=j=>N(!0))},[V(a(G),{class:"w-24 >=605:w-30 flex-shrink-0"})])):p("",!0),a(I)?(l(),w(C,{key:1,size:"small",class:"absolute top-1/2 -translate-y-1/2 left-1/2 -translate-x-1/2"})):p("",!0)]}),_:2},1024)])])]),_:2},1032,["modelValue","onUpdate:modelValue","name","label","placeholder"])):p("",!0)])],2)):p("",!0),e.type==="dropdownList"?(l(),r("div",{key:e.name,class:g(["grid duration-500 ease-in-out",[d>1&&!a(s)?"grid-rows-[0fr]":"grid-rows-[1fr]"]])},[n("div",{class:g(d>1&&!a(s)||a(b)?"overflow-hidden":"")},[V(T,{modelValue:e.value,"onUpdate:modelValue":h=>e.value=h,name:e.name,placeholder:(E=e.items.find(h=>h.value===""))==null?void 0:E.label,label:e.label,items:e.items,onChange:y},{"button-icon-after":k(()=>[V(a(K),{class:"flex-shrink-0 h-24 duration-300 ease-in-out"})]),_:2},1032,["modelValue","onUpdate:modelValue","name","placeholder","label","items"])],2)],2)):p("",!0),e.type==="radioList"||e.type==="radio"?(l(),r("div",{key:e.name,class:g(["grid duration-500 ease-in-out",[d>1&&!a(s)?"grid-rows-[0fr]":"grid-rows-[1fr]"]])},[n("div",Ze,[V(M,{modelValue:e.value,"onUpdate:modelValue":h=>e.value=h,name:e.name,label:e.label,items:e.items,onChange:y},null,8,["modelValue","onUpdate:modelValue","name","label","items"])])],2)):p("",!0)],64)}),256)),n("div",Je,[a(c).length>2?(l(),r("div",Ke,[n("button",{class:"bg-current-color text-current-primary border-current-primary font-bold flex gap-x-12 items-center px-20 py-12 cursor-pointer",onClick:x},[n("span",null,F(a(s)?("useLabel"in u?u.useLabel:a(D))("filterListHideFilters").value:("useLabel"in u?u.useLabel:a(D))("filterListShowFilters").value),1),n("span",null,[V(a(K),{class:g(["flex-shrink-0 h-24 duration-300 ease-in-out",a(s)?"transform rotate-180":"transform rotate-0"])},null,8,["class"])])])])):p("",!0),n("button",{class:g(["absolute left-1/2 -translate-x-1/2 flex gap-10 pt-20 items-center ease-in-out",[a(S)?"opacity-100 delay-200 duration-300":"opacity-0 duration-200"]]),onClick:_[2]||(_[2]=e=>N())},[V(a(G),{class:"w-30 bg-danger text-white p-5 rounded-full"}),n("span",We,F(("useLabel"in u?u.useLabel:a(D))("clearSearch").value),1)],2)])])]),(l(),w(ne,{ref_key:"limboSearch",ref:i,key:a(m).path,"search-filters":a(o),delaysearch:a(f),class:"z-1 relative",theme:a(H)},{results:k(({data:e})=>[n("div",et,[(l(!0),r(q,null,A(e,(d,E)=>(l(),w(ie,{key:`${a(L)}-${E}-${d==null?void 0:d.id}`,name:"t-filter-list-result--fade-in",appear:""},{default:k(()=>[d?(l(),w(le,{id:d.id,key:d.id,ratio:414/464,"parent-theme":"theme",title:d.title,teaser:d.description,url:d==null?void 0:d.url,image:d.image,style:X({transitionDelay:`${E*50}ms`})},null,8,["id","title","teaser","url","image","style"])):p("",!0)]),_:2},1024))),128))])]),loadMore:k(({limit:e,offset:d,total:E})=>{var h,j;return[W(F(E-d-e<=24?(h=("useLabel"in u?u.useLabel:a(D))("filterListLoadMoreCount").value)==null?void 0:h.replace("${1}",E-d-e):(j=("useLabel"in u?u.useLabel:a(D))("filterListLoadMoreCount").value)==null?void 0:j.replace("${1}",e)),1)]}),loadAll:k(({total:e})=>{var d;return[W(F((d=("useLabel"in u?u.useLabel:a(D))("filterListLoadAllCount").value)==null?void 0:d.replace("${1}",e)),1)]}),_:1},8,["search-filters","delaysearch","theme"]))],2)])}}};export{dt as default};