1import{F as Zt,T as ss,M as ns,L as os,H as is,_ as ls,a as as}from"./filter.2e33d5fb.js";import{R as rs,_ as us,c as fs,t as ds,u as hs,a as gs,D as vs,b as ps,g as wc,e as xc,w as Cc,y as _t,A as R,a5 as Lc,a6 as _s,i as bs,G as Oc,r as ms,n as ks}from"./entry.9cd9620d.js";import Is from"./archive-list.d5f92b60.js";import{a as se,Z as yc,k as $s,w as rt,n as Ne,A as Es,J as x,K as y,I as Le,a5 as Ct,X as Lt,Y as te,a4 as Ot,u as v,S as z,M as P,H as ae,a6 as Ie,O as Re,_ as bt,a8 as yt,N as Vt,b as As,al as ws,a2 as xs,a3 as Cs}from"./swiper-vue.946ccc41.js";import{D as Ls}from"./download.fffd1b3b.js";import"./download-documentation.b08af9cf.js";const Os=rs("archive",{state:()=>({history:{}}),getters:{getHistory:Te=>Te.history},actions:{setHistory(Te){this.history={...this.history,...Te}},resetHistory(){this.history={}}}});function xe(Te=""){if(!Te||typeof Te!="string")return"";const tt=[{base:"o",letters:["ó"]},{base:"e",letters:["é","Ã","è"]},{base:"i",letters:["î"]},{base:"ae",letters:["ä"]}],Ye={};for(const ze of tt)for(const Qe of ze.letters)Ye[Qe]=ze.base;const Fe=new RegExp(Object.keys(Ye).join("|"),"g");return Te.replace(Fe,ze=>Ye[ze])}const ys=Te=>(xs("data-v-1c7298b0"),Te=Te(),Cs(),Te),Ss={id:"main-content",class:"container","data-archive-version":"2"},js={key:0,class:"row text-intro"},Ts={class:"col-12"},Ms={class:"small-font text-half-primary my-4"},Ps=["id"],Us={key:0,class:"col-12 d-block d-md-none"},Rs={class:"small-font float-end",type:"button","data-bs-toggle":"offcanvas","data-bs-target":"#offcanvasResponsive","aria-controls":"offcanvasResponsive"},Hs={class:"ps-2"},Ns={key:1,class:"col-md-3 offcanvas-md offcanvas-bottom",tabindex:"-1",id:"offcanvasResponsive","aria-labelledby":"offcanvasResponsiveLabel"},Fs={id:"filters-menu",class:"mt-0 mt-lg-3"},Bs={class:"offcanvas-header px-3 d-flex d-md-none"},Js={class:"mb-0"},Ws={class:"ps-2 small-font"},qs=ys(()=>P("button",{type:"button",class:"btn-close text-reset d-md-none","data-bs-toggle":"offcanvas","data-bs-target":"#offcanvasResponsive","aria-controls":"offcanvasResponsive"},null,-1)),zs={id:"icon-filter",class:"small-font mb-3 ps-2 pt-2 p-lg-0 d-none d-md-block"},Qs={class:"ps-2"},Ds={class:"active-filters px-3 px-md-2 px-lg-0 mb-3"},Gs={class:"small-font"},Xs={class:"px-3 px-md-2 px-lg-0"},Ys=["onClick","data-test"],Zs=["innerHTML"],Vs=["onClick"],Ks={key:0,class:"accordion accordion-small",id:"product-filters"},en={style:{display:"flex","flex-direction":"column-reverse"}},tn={class:"accordion-item"},cn=["id"],sn=["innerHTML","data-bs-target","aria-controls"],nn=["id","aria-labelledby"],on={class:"accordion-body"},ln=["name","value","id","onUpdate:modelValue","onClick"],an=["innerHTML","for"],rn=["id"],un=["innerHTML","data-bs-target","aria-controls","aria-expanded"],fn=["id","aria-labelledby"],dn=["name","id","value","onUpdate:modelValue","data-test","onClick"],hn=["innerHTML","for"],gn={key:0,class:"mt-2 mb-2"},vn=["name","id","value","onUpdate:modelValue","onClick"],pn=["innerHTML","for"],_n=["onClick"],bn={key:0},mn={key:1},kn={key:1,class:"accordion-item"},In=["id"],$n=["innerHTML","data-bs-target","aria-controls"],En=["id","aria-labelledby"],An={class:"accordion-body"},wn=["name","id","value","onUpdate:modelValue","data-test"],xn=["innerHTML","for"],Cn={key:0,class:"d-flex justify-content-start"},Ln=["id"],On={class:"toolbar row row-cols-auto col-12 px-0 mx-auto justify-content-between d-flex"},yn={key:0,class:"toolbar__filters tab-filters col-12 d-none d-lg-block"},Sn=["onClick"],jn={key:1,class:"col-12 px-0 toolbar__general"},Tn={class:"row mx-0 row-cols-auto justify-content-between w-100"},Mn={key:0,class:"fs-sm-14 ps-md-3"},Pn={key:1,class:"fs-sm-14 ps-md-3"},Un={value:"default"},Rn={value:"reverse"},Hn={key:0,value:"custom"},Nn={value:"default"},Fn={value:"reverse"},Bn={key:0,class:"ps-md-3 text-uppercase mb-3"},Jn={key:0,class:"my-3"},Wn={key:1,class:"ps-3 text-uppercase mb-3"},qn={key:2,class:"ps-3 text-uppercase mb-3"},zn={key:3,id:"pagination"},Qn={key:4},Sc=6,Dn={__name:"archive-v2",props:{data:Object,defaultSlug:String},async setup(Te){var mc,kc,Ic,$c,Ec;let tt,Ye;const Fe=Te,ze=bs(),Qe=ze.public.SITE_NAME||"",jc=ze.public.ACTIVE_MARKET||"",Kt=ze.public.SITE_URL||"",Ze=Os(),Tc=fs();ds(Tc);const A=hs(),{locale:ct,t:st}=gs();vs();const St=ps(Qe+"-cookie_analytical"),Mc=((mc=A==null?void 0:A.params)==null?void 0:mc.slugs)||["","",""],De=()=>{var t;const e=(t=A==null?void 0:A.query)==null?void 0:t.page;if(e){const c=parseInt(e);if(typeof c=="number")return c}return 1},mt=se((Fe==null?void 0:Fe.defaultSlug)||""),jt=se(mt.value),kt=se(mt.value==="forage-inoculants"),Tt=se(mt.value==="animal-environment"),Mt=se(mt.value==="process-aids");se(A.hash);const B=((kc=Fe==null?void 0:Fe.data)==null?void 0:kc.data)||{},ec=(B==null?void 0:B.content_archive_custom_order)||!1,tc=((Ic=Fe==null?void 0:Fe.data)==null?void 0:Ic.anchor)||"",ut=se(!1),ce=(B==null?void 0:B.content_archive_type)||"resource",Pc=(B==null?void 0:B.content_archive_display)||"list",Pt=(B==null?void 0:B.content_archive_pagination)??!0?Number((B==null?void 0:B.content_archive_perpage)??10):99999999,ne=se(Pt),Me=se(De()),Ve=se(0),ft=se([]),dt=se(0),cc=se(0),sc=se([]),Uc=se(""),nt=se(null),ht=se(null),Be=se({}),Rc=()=>
1ec?"custom":ce==="post"||ce==="resource"?"reverse":"default",Pe=se((()=>Pc==="grid"?"card":"list")()),Je=se(Rc()),ot=se(!!(($c=A==null?void 0:A.query)!=null&&$c.s)),It=se((Ec=A==null?void 0:A.query)!=null&&Ec.s?A.query.s:null),$t=se([]),nc=se(!0),Et=se(null),Hc=se(null),Ut=se(""),Nc=(St==null?void 0:St.value)===!0,At=()=>{if(ce==="event"){const{past:e,upcoming:t}=(B==null?void 0:B.content_archive_items)||{};return[{past:[...e]},{upcoming:[...t]}]}return(B==null?void 0:B.content_archive_items)||[]},gt=()=>jc!=="false",oc=()=>{if(gt()){const e=A==null?void 0:A.params;return(e==null?void 0:e.market)||"europe"}return""},Fc=(e,t)=>e==="product-crop"&&(t!=null&&t.subfilters)?Object.entries(t.subfilters).sort((c,u)=>{const o=lt(t.id,c[1],c[0]).toLowerCase(),l=lt(t.id,u[1],u[0]).toLowerCase();return o.localeCompare(l)}):Object.entries((t==null?void 0:t.subfilters)||{}),Ge=(B==null?void 0:B.content_archive_filters)||[],Rt=wc("layout",gt(),ct.value,"",oc()),{data:it}=xc(Rt);it.value||([tt,Ye]=yc(()=>Cc(Rt,{key:Rt,default:()=>it.value},"$pzs9NQ0L3x")),await tt,Ye());const Ke=()=>{var c;const e=A==null?void 0:A.params,t=e==null?void 0:e.slugs;if(ot.value&&(c=it==null?void 0:it.value)!=null&&c.search_page_slug)return it.value.search_page_slug;if((t==null?void 0:t.length)>0&>()){const u=(t==null?void 0:t.length)||0;let o=t[u-1];return`${o||t[u-2]}`}if(!gt()&&(t==null?void 0:t.length)>0){const u=t.filter(o=>o!=="");if(u.length>0)return u[u.length-1];if(e.market&&!e.market.includes("robot")&&!e.market.includes("robots"))return e.market}return"homepage"};let Ht=wc("content",gt(),ct.value,Ke(),oc());const{data:We}=xc(Ht);We.value||([tt,Ye]=yc(()=>Cc(Ht,{key:Ht,default:()=>We.value},"$h9UMSwTBgC")),await tt,Ye());const ic=()=>{var e,t,c,u;return Ve.value>1?((t=(e=We==null?void 0:We.value)==null?void 0:e.seo)==null?void 0:t.title)+" | "+st("type_page")+" "+De():(u=(c=We==null?void 0:We.value)==null?void 0:c.seo)==null?void 0:u.title},Bc=(e=null)=>{if(ce==="event")return[...At()];const t=[...At()];if(Je.value==="custom")return B==null?void 0:B.content_archive_items;if(!ot.value){const c=t.sort((u,o)=>{var d,i,_,g,b,E,$,k;let l,r;if(ce==="product"?(l=(d=u==null?void 0:u.content_archive_item_data)==null?void 0:d.content_archive_item_product_base,r=(i=o==null?void 0:o.content_archive_item_data)==null?void 0:i.content_archive_item_product_base,l==null&&(l=(_=u==null?void 0:u.content_archive_item_data)==null?void 0:_.content_archive_item_slug),r==null&&(r=(g=o==null?void 0:o.content_archive_item_data)==null?void 0:g.content_archive_item_slug)):(l=(b=u==null?void 0:u.content_archive_item_data)==null?void 0:b.content_archive_item_date,r=(E=o==null?void 0:o.content_archive_item_data)==null?void 0:E.content_archive_item_date,l==null&&(l=($=u==null?void 0:u.content_archive_item_data)==null?void 0:$.content_archive_item_title),r==null&&(r=(k=o==null?void 0:o.content_archive_item_data)==null?void 0:k.content_archive_item_title)),l&&r)return l.localeCompare(r,ct.value,{numeric:!0,ignorePunctuation:!0})});return(Je==null?void 0:Je.value)!=="default"?c.reverse():c}return ot.value?(()=>{const u=[...t].filter(l=>{var r,d;return((d=(r=l==null?void 0:l.content_archive_item_filters)==null?void 0:r["search-type"])==null?void 0:d.toLowerCase())==="products"})||[],o=[...t].filter(l=>{var r,d;return((d=(r=l==null?void 0:l.content_archive_item_filters)==null?void 0:r["search-type"])==null?void 0:d.toLowerCase())!=="products"});return(Je==null?void 0:Je.value)==="default"?[...u,...o]:[...u,...o].reverse()})():t},vt=(e={})=>{var r,d,i,_,g,b,E,$;const t=[...Bc()];let c=[],u="";e!=null&&e.query&&(u=e.query),e!=null&&e.query||(u=A.query);let o={};Object.keys(u).forEach(function(k,s){const a=u[k],C=Object.fromEntries(new URLSearchParams(a));k==="filter"&&Object.keys(C)&&(o.filter=C),k==="page"&&Object.keys(C)&&(o.page=C)});const l=qc(h,u);if(He()){let k={},s=!1;const a=((d=(r=h==null?void 0:h.value)==null?void 0:r["product-category"])==null?void 0:d.subfilters)||{};Object.keys(a).forEach(function(C,I){var O;if(I===0){const m=encodeURIComponent(C),p=a[m];(O=p==null?void 0:p.subfilters)!=null&&O.choices&&Object.keys(p.subfilters.choices).forEac
1h(function(L,S){const n=p.subfilters.choices[L];n.active&&(s=!0,k[L]={...n})})}}),s||(c=t),s&&(c=t.filter(I=>{var j,J,W,M;const O=(I==null?void 0:I.content_archive_item_filters)||{},m=(O==null?void 0:O["product-species"])||(O==null?void 0:O.species)||{},p=(O==null?void 0:O["product-category"])||{},L=()=>{if(kt.value){let H={};return Object.keys(m).forEach(function(T,f){const ue=m[T],G=ue==null?void 0:ue.subfields;G&&(G==null?void 0:G.ident)==="subcategories"&&(H=ue)}),H}return m==null?void 0:m[gc()[gc().length-1]]},S=()=>{if(Mt.value){let H={};return Object.keys(p).forEach(function(T,f){const ue=p[T];ue==null||ue.subfields,H=ue}),H}return{}};let n=!1;if(L()){const H=((J=(j=L())==null?void 0:j.subfields)==null?void 0:J.choices)||{};Object.keys(k).forEach(function(T,f){H[T]&&(n=!0)})}if(!L()&&S()){const H=((M=(W=S())==null?void 0:W.subfields)==null?void 0:M.choices)||{},f=R((()=>{var G;let ue="";return(G=Object.keys(H))==null||G.forEach(function(ge,X){const q=H[ge];X===0&&(ue=(q==null?void 0:q.label)||"")}),ue})());k[f]&&(n=!0)}return n})),vc(c),((i=re==null?void 0:re.value)==null?void 0:i.length)===0?ut.value=!0:ut.value=!1,Ne(()=>{Nt(c),xt()});return}if(ce==="event"){c=[...t];let k={},s={};if(re.value={},[...c].forEach(S=>{let n=null,j=null;S!=null&&S.past&&(k.past=[...S.past].sort(function(J,W){var M,H,T,f;return n=(H=(M=J==null?void 0:J.content_archive_item_data)==null?void 0:M.content_archive_item_date)==null?void 0:H.toUpperCase(),j=(f=(T=W==null?void 0:W.content_archive_item_data)==null?void 0:T.content_archive_item_date)==null?void 0:f.toUpperCase(),n>j?-1:n<j?1:0})),S!=null&&S.upcoming&&(k.upcoming=[...S.upcoming].sort(function(J,W){var M,H,T,f;return n=(H=(M=J==null?void 0:J.content_archive_item_data)==null?void 0:M.content_archive_item_date)==null?void 0:H.toUpperCase(),j=(f=(T=W==null?void 0:W.content_archive_item_data)==null?void 0:T.content_archive_item_date)==null?void 0:f.toUpperCase(),n<j?-1:n>j?1:0}))}),l){const S=(h==null?void 0:h.value)||{},n=[];Object.keys(S).forEach(function(j,J){const W=S[j],M=(W==null?void 0:W.subfilters)||{};Object.keys(M).forEach(function(H,T){var f;(f=M==null?void 0:M[H])!=null&&f.active&&n.push(M[H].label)})}),Object.keys(k).forEach(function(j,J){const W=k[j];(W==null?void 0:W.length)>0&&(s[j]=W.filter(M=>{var f;let H=!1;const T=(M==null?void 0:M.content_archive_item_filters)||{};return((f=Object.keys(T))==null?void 0:f.length)>0&&Object.keys(T).forEach((ue,G)=>{const ge=T[ue],X=(o==null?void 0:o.filter)||{};Object.keys(X).forEach((q,Q)=>{if(q===ue&&(typeof ge=="string"&&!n.includes(ge)&&!H&&(H=!0),typeof ge=="object")){const _e=Object.values(ge);if((_e==null?void 0:_e.length)>0){const me=()=>n.some(ee=>_e.includes(R(ee)));me(),!me()&&!H&&(H=!0)}}})}),!H}))})}l||(s={...k});const a=()=>{var n,j;let S=0;return((n=s==null?void 0:s.past)==null?void 0:n.length)>0&&(S=S+s.past.length),((j=s==null?void 0:s.upcoming)==null?void 0:j.length)>0&&(S=S+s.upcoming.length),S},C=Math.ceil(a()/ne.value);Ve.value=C;const I=ne.value*(Me.value-1),O=I+ne.value,m=((_=s==null?void 0:s.upcoming)==null?void 0:_.length)||0,p=((g=s==null?void 0:s.past)==null?void 0:g.length)||0;let L={};if(Me.value===1){if(m<=ne.value){const S=ne.value-m,n=((b=s==null?void 0:s.past)==null?void 0:b.length)>0?s.past.slice(0,S):[];L.upcoming=(s==null?void 0:s.upcoming)||[],L.past=[...n]}if(m>ne.value){const S=s.upcoming.slice(0,ne.value);L.upcoming=[...S]}}if(Me.value>1&&Me.value!==C){if(m<=I){L={},L.upcoming=[],L.past=[];const S=[...s.past].slice(I-m,I-m+ne.value);L.past=[...S]}if(m>I){const S=()=>{if(m<=O)return m;if(m>O)return O},n=s.upcoming.slice(I,S());L.upcoming=[...n];const j=ne.value-n.length;if(j>0&&((E=s==null?void 0:s.past)==null?void 0:E.length)>0){const J=s.past.slice(0,j);L.past=[...J]}}}if(Me.value===C&&C>1&&p>0){p>=ne.value&&(L.past=s.past.slice(0,p),L.upcoming=[]),p<ne.value&&(L.upcoming=[],L.past=[...s.past]);const n=a()%ne.value-L.past.length;n>0&&(L.upcoming=[...s.upcoming.slice(-n)])}dt.value=a(),re.value={...L},Ne(()=>{Nt(c),xt()})}if(ce!=="event"&&!He()){const k=Ke()===(($=A==null?void 0:A.query)==null?void 0:$.filter);if(l||(c=[...t],D.value={}),l){const s=h==null?void 0:h.value,a=rc(s,u);c=[...t.filter((I,O)=>{let m=!1,p=!0,L=!0;const S=I.content_archive_item_data,n=I.content_archive_item_filters;return S!=null&&S.content_archive_item_title,Object.keys(a).forEac
1h(function(j,J){const W=a[j];Object.keys(W).forEach(function(M,H){var ge,X,q,Q,_e,me,ee,Oe,ye,Se,Ee;const T=W[M],f=T.id,ue=ce==="resource"||ce==="post"||ce==="search"||ce==="download"||ce==="recipe"||ce==="technical-paper"||ce==="external-resource",G=f==="resources-category"||f==="post_tag"||f==="download-category"||f==="product-category"||f==="recipe-category"||f==="flour"||f==="allergen"||f==="retailer-marketing-category";if(ue||ce!=="product"){const U=T.subfilters;Object.keys(U).forEach(function(F,oe){var ie,fe,ve,Y,je,de,Ae,Ue,we;const w=U[F],V=()=>{var he,$e,Z,le,K;return!!(((he=o==null?void 0:o.filter)==null?void 0:he[f])===F||(($e=n==null?void 0:n[f])==null?void 0:$e.length)>0&&f!=="dates"&&f!=="post_categories"&&(Z=n==null?void 0:n[f])!=null&&Z.includes(F)||f==="resources-category"&&(((le=o==null?void 0:o.filter)==null?void 0:le[f])===R((n==null?void 0:n.categories)||"")||((K=o==null?void 0:o.filter)==null?void 0:K[f])===R((n==null?void 0:n.categories)||"")))};if((w==null?void 0:w.active)||V()){const he=()=>{const Z=()=>{let le=null;if((w==null?void 0:w.label)!==null){const K=xe(w.label);le=R(K)}return le};return Z()!==null&&Z()!==""?Z():w!=null&&w.label?xe(w==null?void 0:w.label):""},$e=()=>{if(w!=null&&w.key)return w.key;if(w!=null&&w.termID)return w.termID};if(f==="product_base"){const Z=n["product-bases"]||[],le=R(w.label);Z.includes(le)?m=!0:p=!1}if(f==="resources-category"&&(n.categories.replace("-","")===he().replace(" ","")||n.categories.replace("-","")===((ie=w==null?void 0:w.label)==null?void 0:ie.toLowerCase().replace(" ",""))||n.categories===((fe=R(w==null?void 0:w.label))==null?void 0:fe.toLowerCase().replace(" ","-"))||n.categories===(o==null?void 0:o.filter[f])||n.categories===R(w==null?void 0:w.label)||R(n.categories)===R(w==null?void 0:w.label)?m=!0:p=!1),f==="post_tag"||f==="oen_tag"||f==="product-tag"){const Z=()=>{if(f==="post_tag")return"tags";if(f==="oen_tag")return"oen_tags"};n!=null&&n[Z()];let le=!1;((ve=n==null?void 0:n[Z()])==null?void 0:ve.length)>0&&(le=n==null?void 0:n[Z()].some(K=>{const ke=decodeURIComponent(K),pe=K!==null?R(K.replace(/<[^>]+>/g,"")):null,Ce=()=>{if(w!=null&&w.label){const Xe=w.label.replace("é","e").replace("è","e").replace("î","i").replace("û","u");return R(Xe)}return""};return he().replace("-","")===ke.replace(" ","")||(w==null?void 0:w.label.replace("-",""))===ke.replace(" ","")||K.includes(he())||pe===he()||pe===Ce()})),le?m=!0:m=!1}if(f==="search-type"&&((()=>{var ke,pe,Ce,Xe;const le=((ke=n[f])==null?void 0:ke.toLowerCase())===((pe=he())==null?void 0:pe.toLowerCase()),K=xe((Ce=n[f])==null?void 0:Ce.toLowerCase())===xe(((Xe=w==null?void 0:w.label)==null?void 0:Xe.toLowerCase())||"");return le||K})()?(p=!0,m=!0,L=!0):m=!1),f==="search-date"&&(((Y=n[f])==null?void 0:Y.toLowerCase())===((je=he())==null?void 0:je.toLowerCase())?m=!0:m=!1),(f==="download-category"||f==="product-category"||f==="recipe-category"||f==="flour"||f==="allergen"||f==="retailer-marketing-category"||f==="product-application"||f==="product-brand"||f==="product-type"||f==="product-production"||f==="packaging-parts"||f==="packaging-formats"||f==="production-sites"||f==="category"&&Qe==="lbi")&&((()=>{var le;return(le=n[f])==null?void 0:le.some(K=>K.toString()==$e().toString())})()?m=!0:p=!1),f==="dates"&&n.dates===(w==null?void 0:w.label)&&(p=!0,m=!0,L=!0),!G&&f!=="search-type"&&!m&&f!=="dates"){let Z=!1;typeof(n==null?void 0:n[f])=="string"&&((de=n==null?void 0:n[f])==null?void 0:de.toLowerCase())===((Ae=he())==null?void 0:Ae.toLowerCase())&&(Z=!0),typeof(n==null?void 0:n[f])=="object"&&((Ue=n==null?void 0:n[f])!=null&&Ue[$e()]||(we=n==null?void 0:n[f])!=null&&we[he()])&&(Z=!0),f==="post_categories"&&(Z=(K=>{var pe;let ke=!1;return((pe=Object.keys(U))==null?void 0:pe.length)>0&&Object.keys(U).forEach((Ce,Xe)=>{const be=U[Ce];if((be==null?void 0:be.active)===!0){const et=R(be.label);K.includes(et)&&(ke=!0)}}),ke}
1)(n==null?void 0:n.post_categories)),f==="types"&&(Z=(K=>{var pe;let ke=!1;return((pe=Object.keys(U))==null?void 0:pe.length)>0&&Object.keys(U).forEach((Ce,Xe)=>{var et;const be=U[Ce];if((be==null?void 0:be.active)===!0){const Xt=R(xe(be.label));((et=Object.keys(K))==null?void 0:et.length)>0&&Object.keys(K).forEach((Yt,cs)=>{const Ac=K[Yt];xe(Ac)===Xt&&(ke=!0)})}}),ke})(n==null?void 0:n.types)),f==="applications"&&(Z=(K=>{var pe;let ke=!1;return((pe=Object.keys(U))==null?void 0:pe.length)>0&&Object.keys(U).forEach((Ce,Xe)=>{var et;const be=U[Ce];if((be==null?void 0:be.active)===!0){const Xt=R(xe(be.label));((et=Object.keys(K))==null?void 0:et.length)>0&&Object.keys(K).forEach((Yt,cs)=>{K[Yt]===Xt&&(ke=!0)})}}),ke})(n==null?void 0:n.applications)),Z?m=!0:m=!1}}})}if(ce==="product"&&!ue){if(f==="product-species"||f==="species"){const U=()=>{var oe;if((oe=n==null?void 0:n[j])!=null&&oe[M])return n[j][M];let F;return n!=null&&n[j]&&Object.keys(n[j]).forEach(function(w){R(xe(w))===M&&(F=n[j][w])}),F};if(U()){m=!0;let F={};Object.keys(T.subfilters).forEach(function(oe,w){var ie;const V=(ie=T==null?void 0:T.subfilters)==null?void 0:ie[oe];((V==null?void 0:V.active)||!1)&&(V!=null&&V.subfilters)&&(F[V.subfilters.id]={...V.subfilters.choices})}),((ge=Object.keys(F))==null?void 0:ge.length)===0&&(m=!0),((X=Object.keys(F))==null?void 0:X.length)>0&&(m=!0,Object.keys(F).forEach(function(oe,w){var fe,ve;const V=F[oe];let N={},ie=!1;log,Object.keys(V).forEach(function(Y,je){var he,$e,Z;const de=V[Y],Ae=(($e=(he=U())==null?void 0:he.subfields)==null?void 0:$e.choices)||{},we=(((Z=o==null?void 0:o.filter)==null?void 0:Z[oe])||"").split(",");(de!=null&&de.active||we.includes(Y))&&(ie=!0,N[Y]={...de},Ae[Y]||(m=!1))}),log,((fe=Object.keys(N))==null?void 0:fe.length)===0&&(m=!0),((ve=Object.keys(N))==null?void 0:ve.length)>0&&(m=!1,Object.keys(N).forEach(function(Y,je){var Ae,Ue,we,he,$e,Z;const de=(Ue=(Ae=U==null?void 0:U.subfields)==null?void 0:Ae.choices)==null?void 0:Ue[Y];if(de){m=!0;const le=(we=N==null?void 0:N[Y])==null?void 0:we.subfields,K=((he=N==null?void 0:N[Y])==null?void 0:he.active)||!1;if(le&&K||ie){p=!1;const ke=(le==null?void 0:le.choices)||{};let pe={};Object.keys(ke).forEach(function(Ce,Xe){const be=ke[Ce];((be==null?void 0:be.active)||!1)&&(pe[Ce]={...be})}),(($e=Object.keys(pe))==null?void 0:$e.length)===0&&(m=!0,p=!0),((Z=Object.keys(pe))==null?void 0:Z.length)>0&&(m=!1,p=!1,Object.keys(pe).forEach(function(Ce,Xe){var be,at;(at=(be=de==null?void 0:de.subfields)==null?void 0:be.choices)!=null&&at[Ce]&&(m=!0,p=!0)}))}}else m=!1,p=!1,ie=!1}))}))}else p=!1}if(f==="product-category"||f==="recipe-category"||f==="flour"||f==="allergen"||f==="product-application-method"||f==="product-type"||f==="packaging-parts"||f==="packaging-formats"||f==="production-sites"||f==="product-production"){const U=()=>{let F={};return Object.keys(T.subfilters).forEach(function(oe,w){const V=T.subfilters[oe];V!=null&&V.active&&(F[oe]={...V})}),F};if(U()){let F=!1;Object.keys(U()).forEach(function(oe,w){var ie;const V=((ie=U())==null?void 0:ie[oe])||{};let N=!1;Object.keys(n[f]).forEach(function(fe,ve){var de,Ae,Ue,we;const Y=n[f][fe];if((V.key===Y.toString()||V.termID===Y.toString()||V.termID===fe.toString())&&(N=!0,F=!0,(de=o==null?void 0:o.filter)!=null&&de.subcategories)){const he=((Ae=o==null?void 0:o.filter)==null?void 0:Ae.subcategories)||{};if(N=!1,F=!1,(Ue=Y==null?void 0:Y.subfields)!=null&&Ue.choices){const $e=(we=Y==null?void 0:Y.subfields)==null?void 0:we.choices;Object.keys($e).forEach(function(Z,le){const K=$e[Z];he.includes(R(K==null?void 0:K.label))&&(N=!0,F=!0)})}}}),m=F,N&&(F=!0),F||(L=!1)})}}if(f==="product-crop"||f==="product-formulation"||f==="product-pest"){const U=f==="post_tag"?"product-crop":f;!((q=n==null?void 0:n[U])!=null&&q.length)<1&&(m=!1);const F=()=>{var N;return((N=Object.keys(T.subfilters))==null?void 0:N.length)>0},oe=()=>{let N=[];return F()&&Object.keys(T.subfilters).forEach((ie,fe)=>{var Y,je;const ve=T.subfilters[ie];if(ve.active||((Y=o==null?void 0:o.filter)==null?void 0:Y[f])==ve.termID){const de=((je=ve.subfilters)==null?void 0:je.choices)||{};Object.keys(de).forEach((Ae,Ue)=>{var he;const we=de[Ae];(we.active||((he=o==null?void 0:o.filter)==null?void 0:he.subcategories)==we.id)&&N.push(Ae)})}}),N},w=()=>{let N=[];
1return Object.keys(T.subfilters).forEach(function(ie,fe){var Y;const ve=T.subfilters[ie];((Y=o==null?void 0:o.filter)==null?void 0:Y[f])==ve.termID&&(N=[...N,ve.termID])}),N};(()=>{var ie;let N=[];return((ie=Object.keys((n==null?void 0:n[U])||{}))==null?void 0:ie.length)>0&&Object.keys(n[U]).forEach(function(fe,ve){const Y=n[U][fe];N=[...N,Y]}),N.some(fe=>w().includes(fe))})()&&(m=!0),((Q=oe())==null?void 0:Q.length)>0&&(m=!1,(()=>{let ie=!1;return Object.keys(n[U]).forEach(function(fe,ve){const Y=n[U][fe];oe().includes(Y.toString())&&(ie=!0)}),ie})()&&(m=!0))}if(f==="product-tag"){const U=((me=(_e=o==null?void 0:o.filter)==null?void 0:_e[f])==null?void 0:me.split(","))||[];m=U.length>0&&U.every(F=>{var oe;return(oe=n==null?void 0:n[f])==null?void 0:oe[F]})}if(f!=="product-species"&&f!=="species"&&f!=="recipe-category"&&f!=="flour"&&f!=="allergen"&&f!=="product-category"&&f!=="product-application-method"&&f!=="product-type"&&f!=="product-production"&&f!=="packaging-parts"&&f!=="packaging-formats"&&f!=="production-sites"&&f!=="product-crop"&&f!=="product-formulation"&&f!=="product-tag"){const U=((ye=(Oe=(ee=n==null?void 0:n["product-species"])==null?void 0:ee[jt.value])==null?void 0:Oe.subfields)==null?void 0:ye.ident)===j;(()=>{var w;n!=null&&n.species&&((w=Object.keys(n.species))==null?void 0:w.length)>0&&Object.keys(n.species).forEach(function(V){var fe;const N=n.species[V],ie=R(xe(N));u!=null&&u.filter&&u.filter.includes("species=")&&u.filter.includes(`${ie}`)&&(n!=null&&n[j]&&((fe=Object.keys(n[j]))==null?void 0:fe.length)>0?Object.keys(n[j]).forEach(function(ve){const Y=n[j][ve],je=R(xe(Y));u.filter.includes(`${j}=${je}`)||u.filter.includes(`${j}=${ve.toLowerCase()}`)||(p=!1)}):p=!1)})})();const oe=()=>{var w;return((w=n==null?void 0:n[j])==null?void 0:w[M])||!1};if(U){const w=((Se=n==null?void 0:n["product-species"])==null?void 0:Se[jt.value])||((Ee=n==null?void 0:n.species)==null?void 0:Ee[jt.value]);if(w){let V={};Object.keys((T==null?void 0:T.subfilters)||{}).forEach(function(N,ie){var fe;(fe=T.subfilters[N])!=null&&fe.active&&(V[N]={...T.subfilters[N]})}),Object.keys(V).forEach(function(N,ie){var ve,Y,je,de,Ae,Ue,we,he,$e;const fe=V[N];if((Y=(ve=w==null?void 0:w.subfields)==null?void 0:ve.choices)!=null&&Y[N]){const Z=((je=fe==null?void 0:fe.subfilters)==null?void 0:je.choices)||{};let le={};if(Object.keys(Z).forEach(function(K,ke){var pe;(pe=Z[K])!=null&&pe.active&&(le[K]={...Z[K]})}),((de=Object.keys(le))==null?void 0:de.length)===0&&(m=!0),((Ae=Object.keys(le))==null?void 0:Ae.length)>0){const K=(($e=(he=(we=(Ue=w==null?void 0:w.subfields)==null?void 0:Ue.choices)==null?void 0:we[N])==null?void 0:he.subfields)==null?void 0:$e.choices)||{};Object.keys(le).forEach(function(ke,pe){K[ke]&&(m=!0)})}}})}}oe()&&(m=!0)}}})}),p&&m&&L})]}k&&(c=[...t]),(u==null?void 0:u.filter)==="resources-category=all"&&(c=[...t]),Ne(()=>{var s;vc(c),Nt(c),xt(),((s=re==null?void 0:re.value)==null?void 0:s.length)===0?ut.value=!0:ut.value=!1})}},wt=(e,t)=>{var o;A==null||A.query.filter,Ke();let c={};if(Object.keys(e).forEach(function(l,r){var g;const d=e[l],i=(d==null?void 0:d.subfilters)||{},_=(d==null?void 0:d.label)==="Tags"&&!1;((g=Object.keys(i))==null?void 0:g.length)>
10&&Object.keys(i).forEach(function(b,E){var C,I;const $=i[b],k=$.active,s=b==="acidification"&&!1;_&&s&&(console.log(" "),console.log("firstSubfilterKey: ",b),console.log("firstGroup.id: ",d.id));const a=()=>k;if(_&&s&&(console.log(" "),console.log("firstSubfilterItem: ",$),console.log("firstSubfilterItemIsActive: ",k)),k&&a()){const O=()=>$.label?$.label:b,m=()=>$.key?$.key:$.termID,p=$==null?void 0:$.subfilters,L=(p==null?void 0:p.choices)||{};let S={};((C=Object.keys(L))==null?void 0:C.length)>0&&Object.keys(L).forEach(function(j){var M;const J=L[j];(J==null?void 0:J.active)&&(((M=S==null?void 0:S[b])==null?void 0:M.length)>0?S[b].push(j):S[b]=[j])});const n=d==null?void 0:d.id;c[n]&&((n==="product-species"||n==="species")&&O()===(nt==null?void 0:nt.value)&&(c[n]={},c[n]={[m()]:O()}),n!=="product-species"&&n!=="species"&&(c[n]={...c[n],[m()]:O()})),c[n]||(c={...c,[n]:{[m()]:O()}}),(p==null?void 0:p.id)==="targets"&&(c[n]={[m()]:$==null?void 0:$.termID}),((I=Object.keys(S))==null?void 0:I.length)>0&&(p==null?void 0:p.id)!=="targets"&&Object.keys(S).forEach(function(j){const J=S[j];c.subcategories?c.subcategories={...c.subcategories,[m()]:J}:c.subcategories={[m()]:J}})}})}),((o=Object.keys(D==null?void 0:D.value))==null?void 0:o.length)>0){const l=JSON.parse(JSON.stringify({...D.value}));Object.keys(l).forEach(function(r,d){const i=l[r];
1Object.keys(i).forEach(function(_,g){const b=i[_];Object.keys(b).forEach(function(E,$){var a;const k=b[E],s=(k==null?void 0:k.subfilters)||{};((a=Object.keys(s))==null?void 0:a.length)>0&&E!=="lifestages"&&Object.keys(s).forEach(function(C,I){const O=s[C];if((ht==null?void 0:ht.value)===C&&(c[E]=[C]),C!=="lifestages"){const{active:m}=O,p=k==null?void 0:k.id;m&&(c[p]||(c[p]={[C]:E}),c[p]&&(c[p]={...c[p],[C]:E}))}})})})})}if(He()){const l=e==null?void 0:e["product-category"];if(l!=null&&l.subfilters){const r=(l==null?void 0:l.subfilters)||{};Object.keys(r).forEach(function(d){const i=r[d],_=i==null?void 0:i.subfilters;if(_!=null&&_.id){const g=_.id,b=(_==null?void 0:_.choices)||{};Object.keys(b).forEach(function(E){const $=b[E];($==null?void 0:$.active)&&(c[g]&&(c[g]=[...c[g],E]),c[g]||(c[g]=[E]))})}})}}return(()=>{var r;let l="";return Object.keys(c).forEach(function(d,i){const _=c[d];let g="";if(Tt.value&&(_.forEach(function(b,E){g+=`${b},`}),l+=`${d}=${pt(g,",")}&`),kt.value&&(_.forEach(function(b,E){g+=`${b},`}),l+=`${d}=${pt(g,",")}&`),Mt.value&&(_.forEach(function(b,E){g+=`${b},`}),l+=`${d}=${pt(g,",")}&`),d!=="subcategories"&&d!=="dates"&&!He()){const b=Object.keys(_);b.length>0&&(["product-crop","product-pest","product-formulation"].includes(d)?l+=`${d}=${b[0]}&`:l+=`${d}=${b.join(",")}&`)}d==="dates"&&!He()&&(Object.keys(_).forEach(function(b,E){g+=`${b},`}),l+=`${d}=${pt(g,",")}&`),d==="subcategories"&&!He()&&Object.keys(_).forEach(function(b){b.toString()!==_[b]&&(l+=`${d}=${String(_[b])}&`),b.toString()===_[b]&&(l+=`${d}=${String(_[b])}&`)}),ot.value&&It.value&&(l+=`s=${It.value}&`)}),Object.keys(c).length===0&&((r=A==null?void 0:A.query)!=null&&r.filter),pt(l,"&")})()},Jc=(e=null,t=null)=>{if(e&&t){const c=t==null?void 0:t.ident,u=t==null?void 0:t.label,o=t==null?void 0:t.choices;return{id:c,label:u,isValid:!0,choices:{...(()=>{let d={};return Object.keys(o).forEach(function(i,_){const g=o[i];d[i]={id:i,active:!1,isValid:!0,label:g,...g}}),d})()}}}return null},Wc=(e=null)=>{var t;if(!!((t=Object.keys(e))!=null&&t.length)>0){let c={};return Object.keys(e).forEach(function(u,o){const l=e[u],r=typeof l;if(r==="string"&&(c[u]={active:!1,isValid:!0,key:u,label:l}),r==="object"){const d=(l==null?void 0:l.term_id)||u,i=(l==null?void 0:l.hide_children)||!1,_=(l==null?void 0:l.subfields)||null,g=_?Jc(u,_):null;c[u]={active:!1,isValid:!0,termID:d,hideChildren:i,subfilters:g}}}),c}return null},lc=(e=!1)=>{if((Ge==null?void 0:Ge.length)>0){const{query:t}=A,c=Ge.map(r=>{const d=r==null?void 0:r.content_archive_filters_ident,i=r==null?void 0:r.content_archive_filters_label,_=r==null?void 0:r.content_archive_filters_order,g=(r==null?void 0:r.content_archive_filters_choices)||null;return{id:d,label:i,order:_,expanded:!1,subfilters:Wc(g)}});let o={...(()=>{let r={};return c.forEach((d,i)=>{r[d.id]={active:!0,isValid:!0,...d}}),r})()},l={};if(e)return JSON.parse(JSON.stringify({...o}));if(Object.keys(t).forEach(function(r,d){const i=t[r],_=Object.fromEntries(new URLSearchParams(i));r==="filter"&&Object.keys(_)&&(l.filter=_),r==="page"&&Object.keys(_)&&(l.page=_)}),Object.keys(l).forEach(function(r){const d=l[r];r==="filter"&&Object.keys(d).forEach(function(i){const g=d[i].split(","),b=o[i],E=(b==null?void 0:b.subfilters)||{};let $=!0;
1(i==="product-species"||i==="species")&&Object.keys(E).forEach(function(k){var O;const s=E==null?void 0:E[k],a=(s==null?void 0:s.termID)||(s==null?void 0:s.label)||"",C=(s==null?void 0:s.key)||"",I=(s==null?void 0:s.subfilters)||{};if(s.active=!1,(g[0].toString()===a.toString()||g[0].toString()===R(xe(a))||g[0].toString()===R(xe(C)))&&(s.active=!0),((O=Object.keys((I==null?void 0:I.choices)||{}))==null?void 0:O.length)>0){const m=I.choices;Object.keys(m).forEach(function(p){var J,W,M;const L=m[p],S=L.active,n=((J=L==null?void 0:L.subfields)==null?void 0:J.choices)||{},j=((W=L==null?void 0:L.subfields)==null?void 0:W.ident)||"";S&&((M=l==null?void 0:l.filter)!=null&&M[j]||Object.keys(n).forEach(function(H){n[H].active=!1}))})}}),i!=="product-species"&&i!=="species"&&($=!1,Object.keys(E).forEach(function(k){var O;const s=E==null?void 0:E[k];s!=null&&s.termID||s!=null&&s.label;const a=(s==null?void 0:s.key)||"",C=R(a),I=(O=l==null?void 0:l.filter)==null?void 0:O[i];I.includes(a)&&!E[k].active&&(o[i].expanded=!0,E[k].active=!0),I.includes(k)&&!E[k].active&&(E[k].active=!0),I.includes(C)&&!E[k].active&&(E[k].active=!0)})),i!=="product-species"&&i!=="species"&&!b&&!He()&&$&&Object.keys(o).forEach(function(k){const s=o[k],a=(s==null?void 0:s.subfilters)||{};Object.keys(a).forEach(function(C){var m,p,L,S,n;const I=a[C],O=(I==null?void 0:I.termID)||"";if(O.toString()===i.toString()||(I==null?void 0:I.active)===!0){const j=(m=I==null?void 0:I.subfilters)==null?void 0:m.choices;g.forEach(J=>{const W=(j==null?void 0:j[J])||!1;if(W){W.active=!0;const M=(W==null?void 0:W.subfields)||{};if(M){const H=M.ident;if(d[H]){const T=(M==null?void 0:M.choices)||{};Object.keys(T).forEach(function(f,ue){var G,ge,X,q,Q,_e,me,ee,Oe,ye,Se,Ee;T[f],d[H]===f?{...(_e=(Q=(q=(X=(ge=(G=o[k].subfilters[C])==null?void 0:G.subfilters)==null?void 0:ge.choices)==null?void 0:X[J])==null?void 0:q.subfields)==null?void 0:Q.choices)==null?void 0:_e[f]}:{...(Ee=(Se=(ye=(Oe=(ee=(me=o[k].subfilters[C])==null?void 0:me.subfilters)==null?void 0:ee.choices)==null?void 0:Oe[J])==null?void 0:ye.subfields)==null?void 0:Se.choices)==null?void 0:Ee[f]}})}}}})}if(g.includes(O.toString())&&(p=a==null?void 0:a[O])!=null&&p.active&&(a[O].active=!0),O.toString()!==i.toString()&&!g.includes(O.toString())&&((S=Object.keys(((L=I==null?void 0:I.subfilters)==null?void 0:L.choices)||{}))==null?void 0:S.length)>0){const j=(n=I==null?void 0:I.subfilters)==null?void 0:n.choices;Object.keys(j).forEach(function(J){var H;const W=j[J];g.includes(J.toString())&&(j[J].active=!0);const M=((H=W==null?void 0:W.subfields)==null?void 0:H.choices)||{};Object.keys(M).forEach(function(T){g.includes(T.toString())?M[T].active=!0:M[T].active=!1})})}})})})}),He()){const r=o==null?void 0:o["product-category"];if(r!=null&&r.subfilters){const d=(r==null?void 0:r.subfilters)||{};Object.keys(d).forEach(function(i){var b;const _=d[i],g=_==null?void 0:_.subfilters;if(g!=null&&g.id){const E=g.id,$=(g==null?void 0:g.choices)||{};(b=l==null?void 0:l.filter)!=null&&b[E]&&Object.keys($).forEach(function(k){const s=$[k],a=l.filter[E].split(",");l.filter[E]===k||a.includes(k)?s.active=!0:s.active=!1})}})}}return JSON.parse(JSON.stringify({...o}))}return JSON.parse(JSON.stringify({}))},Nt=(e=null,t=!1)=>{const c=(h==null?void 0:h.value)||{},{query:u}=A;let o={};Object.keys(u).forEach(function(i,_){const g=u[i],b=Object.fromEntries(new URLSearchParams(g));i==="filter"&&Object.keys(b)&&(o.filter=b),i==="page"&&Object.keys(b)&&(o.page=b)}),Object.keys(c).forEach(function(i,_){const g=c[i],b=g==null?void 0:g.subfilters,E=g==null?void 0:g.id,$=i==="product-pest"&&!1;$&&(console.log(" "),console.log("---- ",i," ----"),console.log("filterFirstLevel: ",g),console.log("filterFirstLevelSubfilters: ",b),console.log("filterFirstLevelID: ",E),console.log(" ")),Object.keys(b).forEach(function(k,s){var n,j,J,W;const a=b[k],C=(a==null?void 0:a.termID)||0,I=((n=o==null?void 0:o.filter)==null?void 0:n[E])||"",O=I.split(","),m=k==="maladie"&&!1;$&&m&&(console.log(" "),console.log("---- ",k," ----"),console.log("firstKey: ",i),console.log("filterFirstLevel: ",g),console.log("subFilter: ",a),console.log("subFilterTermID: ",C),console.log("filterQueryMatch: ",I),console.log("filterQueryMatchArray: ",O),console.log(" "));const p=()=>{var T,f;if((i==="product-species"||i==="species")&&(R(A.path)===A.query.filter&&(a.active=!1),((T=o==null?void 0:o.filter)==null?void 0:T["product-species"])===C.toString()||((f=o==null?void 0:o.filter)==null?void 0:f.species)===C.toString()))return a.active=!0,!0;const M=R((a==null?void 0:a.label)||"");return(M==null?void 0:M.length)>0&&M===I||(()=>!!(O.includes(k)||O.includes(R(k))||C&&O.includes(R(C.toString()))&&i!=="resources-category"&&i!=="post_tag"&&i!=="dates"&&i!=="post_categories"&&i!=="search-type"))()?(a.active=!0,!0):(a.active=!1,!1)};p()?a.active=!0:a.active=!1;const L=a==null?void 0:a.active;L||p();const S=()=>{var H;const M=(H=a==null?void 0:a.subfilters)==null?void 0:H.id;return typeof M!="string"?!1:M!=="subcategories"};if($&&m&&(console.log("subFilterIsActiveWithUrlQuery(): ",p()),console.log("subFilterIsActive: ",L),console.log("hasFirstLevelDynamicFilters(): ",S())),L||p()){const M=(j=a==null?void 0:a.subfilters)==null?void 0:j.id,H=(J=a==null?void 0:a.subfilters)==null?void 0:J.label,T=((W=a==null?void 0:a.subfilters)==null?void 0:W.choices)||{};if($&&m&&(console.log(" "),console.log("id: ",M),console.log("label: ",H),console.log("choices: ",T),console.log("choices: ",T),console.log("hasFirstLevelDynamicFilters(): ",S())),S()){const ue=()=>{var ge;const G=(ge=a==null?void 0:a.subfilters)==null?void 0:ge.id;return typeof G!="string"?!1:G!=="subcategories"};Object.keys(T).forEach(function(G){var Q;const ge=T[G],q=(((Q=o==null?void 0:o.filter)==null?void 0:Q[M])||"").split(",");M!=="lifestages"&&(q.includes(G)?ge.active=!0:ge.active=!1)}),D.value[i]={...D.value[i]},D.value[i][k]={...D.value[i][k]},D.value[i][k][M]={active:!0,id:M,label:H,subfilters:{...T}},ue()&&Object.keys(T).forEach(function(G,ge){var _e,me,ee,Oe,ye,Se;const X=T[G],q=(X==null?void 0:X.products)||null,Q=((_e=X==null?void 0:X.subfields)==null?void 0:_e.ident)||"";if(X.active&&!q){const Ee=X==null?void 0:X.subfields.ident,U=X==null?void 0:X.subfields.label,F=((me=X==null?void 0:X.subfields)==null?void 0:me.choices)||{};let oe={...D.value};
1Object.keys(F).forEach(function(w){const V=F[w];console.log(" "),console.log("k1: ",w),console.log("c: ",V)}),oe[i][k][G]={active:!1,id:Ee,label:U,subfilters:{...F}},D.value={...oe}}if(((ee=o.filter)==null?void 0:ee[Q])===!1||((Oe=o.filter)==null?void 0:Oe[Q])===void 0){const Ee=((ye=X==null?void 0:X.subfields)==null?void 0:ye.choices)||{};Object.keys(Ee).forEach(function(U){const F=Ee[U];F.active=!1})}M==="lifestages"&&((Se=o.filter)==null?void 0:Se.subcategories)===void 0&&(X.active=!1),X.active||delete D.value[i][k][G]})}(()=>{var ue;((ue=a==null?void 0:a.subfilters)==null?void 0:ue.id)==="subcategories"&&Object.keys(T).forEach(function(G,ge){var ye,Se,Ee,U,F;const X=T[G],_e=(((ye=o==null?void 0:o.filter)==null?void 0:ye[M])||"").split(",").includes(G),me=G=="2894"&&!1;me&&(console.log(" "),console.log(" "),console.log("-- subSecondKey: ",G),console.log("currentChoice: ",X),console.log("filterQueryObj: ",o),console.log("label: ",H),console.log("id: ",M),console.log("hasMatchWithQuery: ",_e),console.log("dynamicFiltersObj.value: ",D.value),console.log("choices: ",T),console.log("choices[subSecondKey]: ",T[G])),_e&&(T[G].active=!0),_e||(T[G].active=!1);const ee=T[G],Oe=ee==null?void 0:ee.active;if(me&&console.log("subChoiceIsActive: ",Oe),Oe||_e){const oe=(Se=ee==null?void 0:ee.subfields)==null?void 0:Se.ident,w=(Ee=ee==null?void 0:ee.subfields)==null?void 0:Ee.label,V=(U=ee==null?void 0:ee.subfields)==null?void 0:U.choices,N=ee==null?void 0:ee.active,ie=!!((F=Object.keys(V||[]))!=null&&F.length)>0;if(k==="poultry"&&G==="broiler"&&(console.log(" "),console.log("subId: ",oe),console.log("subLabel: ",w),console.log("subChoiceChoices: ",V),console.log("subIsActive: ",N),console.log("hasSecondLevelDynamicBlock: ",ie)),ie&&N){const fe=D.value[i];D.value[i]={...fe};let ve={};Object.keys(ee).forEach(function(Y,je){const de=ee[Y];ve={active:!0,id:de.ident,label:de.label,subfilters:{...de==null?void 0:de.choices}}}),D.value[i][k]={},D.value[i][k][G]={...ve}}}})})()}})});const l=e||(re==null?void 0:re.value)||[],r=l!=null&&l.length?l==null?void 0:l.reduce((i,_)=>{const g=(_==null?void 0:_.content_archive_item_filters)||{};return Object.keys(g).forEach(function(b,E){i[b]||(i[b]=[])}),Object.keys(g).forEach(function(b,E){var s;const $=g[b],k=typeof $;k==="string"&&i[b].push($),k==="object"&&($!=null&&$.length&&$.forEach(a=>{i[b].push(a)}),!!((s=Object.keys($))!=null&&s.length)>0&&Object.keys($).forEach(function(a,C){const I=$[a];I!=null&&I.label&&i[b].push((I==null?void 0:I.label)||"")}))}),i},{}):[],d=()=>{let i={};return Object.keys(r).forEach(function(_,g){const b=r[_],E=()=>{let $=[...new Set(b)];return _!=="product-species"&&_!=="species"&&($=$.sort()),$};i[_]=E()}),i};if(d()&&e){const i=(h==null?void 0:h.value)||{};
1Object.keys(i).forEach(function(_,g){var s,a;i[_];const b=()=>_==="resources-category"?"categories":_==="post_tag"?"tags":_==="product-production"?"post_tag":_,E=_==="product-category"&&!1,$=(s=d())==null?void 0:s[b()],k=i==null?void 0:i[_];if($||k&&(i!=null&&i[b()]),$&&k){k.isValid=!0,($==null?void 0:$.length)===0&&Object.keys((k==null?void 0:k.subfilters)||{}).forEach(function(O,m){const p=k==null?void 0:k.subfilters[O];!p.active&&p.isValid&&(p.isValid=!1)});const C=(k==null?void 0:k.subfilters)||{};let I={};Object.keys(C).forEach(function(O,m){const p=C[O];p.active&&(I[O]={...p})}),E&&(console.log(" "),console.log("filtersObjValueFirstLevelSubfields: ",C),console.log("activeFirstLevelSubfields: ",I)),((a=Object.keys(I))==null?void 0:a.length)>0?Object.keys(C).forEach(function(O,m){const p=C[O],L=$.find(n=>p.key===n.toString()),S=()=>{var J;const n=R(xe((p==null?void 0:p.key)||"")),j=((J=o.filter)==null?void 0:J[_])||!1;return(n==null?void 0:n.length)>0&&j?n===j:!1};E&&(console.log(" "),console.log(" "),console.log("v: ",p),console.log("matchUnique: ",L),console.log("matchFilterQuery(): ",S())),L&&S()&&(p.isValid=!0,p.active=!0),(!L||!S()||!p.active)&&(p.isValid=!1),E&&console.log("after v: ",p)}):Object.keys(C).forEach(function(O,m){const p=C[O];p.isValid=!0})}})}},Ft=(e=null)=>{var t;if(e!==null&&typeof e=="string"){const c=((t=h==null?void 0:h.value)==null?void 0:t.post_tag)||{};Object.keys(c.subfilters).forEach(function(u,o){const l=c.subfilters[u],r=(l==null?void 0:l.label)||"";((()=>{const i=R(u)||null;return i!==null&&i!==""?i:u||""})()===e||r===e)&&(l.active=!0)})}},ac=()=>{var e,t,c,u;return(((t=(e=re.value)==null?void 0:e.upcoming)==null?void 0:t.length)||0)+(((u=(c=re.value)==null?void 0:c.past)==null?void 0:u.length)||0)},qc=(e,t={})=>{const c=typeof e,u=(o,l)=>{var d,i;return!!(((d=t==null?void 0:t.filter)==null?void 0:d.includes(`${o}=`))&&(i=t==null?void 0:t.filter)!=null&&i.includes(`${l}`))};if(c==="object"){let o=!1;if(e.value)return Object.keys(e.value).forEach(function(l,r){const d=e.value[l],i=(d==null?void 0:d.subfilters)||{};
1Object.keys(i).forEach(function(_,g){var k,s;const b=i[_],E=R(xe(_));(u(l,R((b==null?void 0:b.label)||""))||b.active||(k=t==null?void 0:t.filter)!=null&&k.includes(l)&&((s=t==null?void 0:t.filter)!=null&&s.includes(E)))&&(o=!0)})}),o}},rc=(e,t={})=>{const c=typeof e;let u={};if(c==="object")return Object.keys(e).forEach(function(o,l){const r=e[o],d=(r==null?void 0:r.subfilters)||{};Object.keys(d).forEach(function(i,_){var $;const g=d[i],b=R(xe(i)),E=R(xe((g==null?void 0:g.label)||""));g.active&&(u[o]||(u[o]={}),u[o][i]={...r}),(((($=A==null?void 0:A.query)==null?void 0:$.filter)||"").includes(`${o}=${i}`)||((t==null?void 0:t.filter)||"").includes(`${o}=${b}`)||((t==null?void 0:t.filter)||"").includes(`${o}=${E}`))&&(u[o]||(u[o]={}),u[o][b]={...r})})}),u},zc=(e,t=!1)=>{const c=(h==null?void 0:h.value[e])||{};let u=[],o=!0;if(e==="product-species"||e==="species"){const l=(c==null?void 0:c.subfilters)||{};Object.keys(l).forEach(function(r,d){const i=(l==null?void 0:l[r])||!1;if((i==null?void 0:i.active)||!1){const g=lt(e,i);u.push({label:g,key:r})}})}if(e==="product-crop"||e==="product-formulation"||e==="product-pest"||e==="packaging-parts"||e==="packaging-formats"||e==="production-sites"){const l=(c==null?void 0:c.subfilters)||{};Object.keys(l).forEach(function(r,d){var g;const i=(l==null?void 0:l[r])||!1;if(i==null?void 0:i.active){const b=i.label,E=Ge.find($=>{var k;if((k=$==null?void 0:$.content_archive_filters_choices)!=null&&k[r])return $})||r;o=!1,u.push({label:b||((g=E==null?void 0:E.content_archive_filters_choices)==null?void 0:g[r].label),key:r,id:(i==null?void 0:i.termID)||null})}})}if(e!=="product-species"&&e!=="species"&&o){const l=(c==null?void 0:c.subfilters)||{};Object.keys(l).forEach(function(r,d){var g;const i=(l==null?void 0:l[r])||!1;if(i==null?void 0:i.active){const b=i.label,E=Ge.find($=>{var k;if((k=$==null?void 0:$.content_archive_filters_choices)!=null&&k[r])return $})||r;u.push({label:b||((g=E==null?void 0:E.content_archive_filters_choices)==null?void 0:g[r].label),key:r})}})}return u},Bt=e=>Qc(e)||e==="post_tag",Qc=e=>{var t,c,u;return(t=h==null?void 0:h.value)!=null&&t[e]?((u=(c=h==null?void 0:h.value)==null?void 0:c[e])==null?void 0:u.order)===1:!1},Dc=(e=null,t=!0)=>{var c;if(ce==="resource"&&(t=!1),typeof e=="string"&&e!==null&&ce!=="event"){const u=((c=e==null?void 0:e.replace(" ","-"))==null?void 0:c.toLowerCase())||"",o=t?re==null?void 0:re.value:At();return((o==null?void 0:o.filter((r,d)=>(()=>{if(r.content_archive_item_filters.categories===u||r.content_archive_item_filters.categories===R(u)||R(r.content_archive_item_filters.categories)===R(u))return!0})()))||[]).length}return 0},uc=(e=null)=>{var t,c,u;if(e!==null&&typeof e=="string"){if(e==="All"){const _={...(((t=h==null?void 0:h.value)==null?void 0:t["resources-category"])||{}).subfilters};let g=!0;return(c=Object.keys(_))==null||c.forEach(function(b,E){_[b].active&&(g=!1)}),g}const l={...(((u=h==null?void 0:h.value)==null?void 0:u["resources-category"])||{}).subfilters};let r=!1,d=null;return Object.keys(l).forEach(function(i,_){const g=l[i];(g==null?void 0:g.label)===e&&(d=g)}),d&&(r=(d==null?void 0:d.active)|!1),r}},fc=(e=null)=>{var t;if(e!==null&&typeof e=="object"){const u={...(((t=h==null?void 0:h.value)==null?void 0:t["resources-category"])||{}).subfilters};Object.keys(u).forEach(function(o,l){const r=u[o],d=()=>{var E;const g=encodeURIComponent(r==null?void 0:r.label),b=((E=R(g))==null?void 0:E.replace("-",""))||null;return b!==null&&b!==""?decodeURIComponent(b):g||""},i=r.label.replace(" ","").toLowerCase();e.includes(d())||e.includes(r.label.toLowerCase())||e.includes(i)?(r.active=!0,r.isValid=!0,Jt({key:"resources-category",subKey:o,label:d()})):(r.active=!1,r.isValid=!1)})}},Jt=({key:e,subKey:t,label:c,state:u,parent:o=null})=>{var l;if(Me.value=1,(l=o==null?void 0:o.subfilters)!=null&&l.choices&&setTimeout(()=>{const r=`${Kt}${A.href}`;Oc({force:!0,path:`${r}`})},100),(e==="product-species"||e==="species")&&(nt.value=t),e==="resources-category"&&(Be.value||(Be.value={}),Be.value[e]=t),e==="download-category"&&(Be.value||(Be.value={}),Be.value[e]=t),(e==="product-crop"||e==="product-formulation"||e==="product-pest"||e==="packaging-parts"||e==="packaging-formats"||e==="production-sites")&&(Be.value||(Be.value={}),Be.value[e]=t),Nc&&ts(c),(c==null?void 0:c.length)>0&&(Ut.value=R(c)),A.hash)return _t({path:A.path,hash:"#products",replace:!1})},dc=(e,t,c,u=!1)=>{var l;if(u)return!(D!=null&&D.value["product-species"][e][t])&&ht.value?"non-valid":"";if((e==="product-species"||e==="species")&&!(h!=null&&h.value[e].subfilters[t].active)&&nt.value)return"non-valid";if(e==="resources-category"){if(Ke()===((l=A==null?void 0:A.query)==null?void 0:l.filter)||(()=>{var i,_,g,b;let d=0;(_=(i=h==null?void 0:h.value)==null?void 0:i[e])!=null&&_.subfilters;{const E=((b=(g=h==null?void 0:h.value)==null?void 0:g[e])==null?void 0:b.subfilters)||{};
1Object.keys(E).forEach(function($,k){const s=E[$];s!=null&&s.active&&(d=d+1)})}return d})()===0)return"";if(!(h!=null&&h.value[e].subfilters[t].active)&&Be.value[e])return"d-none"}if((()=>{let r=!1;return e!=="product-species"&&e!=="species"&&e!=="resources-category"&&(r=!0),Qe==="oeno"&&e==="product-tag"&&(r=!1),r})()&&!c.isValid&&!c.active)return"d-none"},hc=()=>{Ne(()=>{const e=(A==null?void 0:A.hash)||"";Ke();const t=`${Kt}${A.path}`.replace(`//${ct.value}`,`/${ct.value}${e}`);Oc({force:!0,path:t})})},Gc=(e=null,t=null,c=null)=>{var r,d;const o=A.query.filter.replace(`${e}=${t}`,"").replace(`${e}=${c}`,""),l=Yc(o);if(["product-crop","product-pest","product-formulation","packaging-parts","packaging-formats","production-sites"].includes(e)){const i=((d=(r=h==null?void 0:h.value)==null?void 0:r[e])==null?void 0:d.subfilters)||{};if(Be.value=null,i!=null&&i[t]){const _=i[t];((_==null?void 0:_.termID)===c||(_==null?void 0:_.id)===c)&&(_.active=!1)}}if(e==="product-species"||e==="species"){const i=(h==null?void 0:h.value[e])||{},_=(i==null?void 0:i.subfilters)||{};Object.keys(_).forEach(function(g,b){var k,s;const E=(_==null?void 0:_[g])||!1;((E==null?void 0:E.active)||!1)&&((s=(k=D==null?void 0:D.value)==null?void 0:k[e])!=null&&s[g])&&delete D.value[e][g]})}return _t({path:`${A.path}`,query:{filter:l,page:Me.value},hash:A.hash})},Xc=(e=null,t=null,c=null,u=null)=>{var r,d,i,_;const o=(D==null?void 0:D.value)||{},l=(_=(i=(d=(r=o==null?void 0:o[e])==null?void 0:r[t])==null?void 0:d[c])==null?void 0:i.subfilters)==null?void 0:_[u];l!=null&&l.active&&(l.active=!1)},lt=(e,t,c=null)=>{var o,l;if(e==="product-species")return((o=B==null?void 0:B.content_archive_species[t==null?void 0:t.termID])==null?void 0:o.label)||"N/A";const u=()=>Ge==null?void 0:Ge.find(d=>(d.content_archive_filters_ident,d.content_archive_filters_ident===e));if(u()){const r=((l=u())==null?void 0:l.content_archive_filters_choices)||{},d=r==null?void 0:r[c];if(d!=null&&d.label)return st(d.label,d.label);if(c&&!(t!=null&&t.label))return st(c,c)||"N/A"}return st((t==null?void 0:t.label)||"",(t==null?void 0:t.label)||"")||"N/A"},Wt=e=>{var t;return B!=null&&B.content_archive_species?(t=B==null?void 0:B.content_archive_species)==null?void 0:t[e]:null},xt=e=>{Ne(()=>{var t;cc.value=((t=$t==null?void 0:$t.value)==null?void 0:t.length)||0})},qe=e=>{let t={};const c=e==null?void 0:e.subfilters;return Object.keys(c).forEach(function(u,o){o===0&&(t=c[u])}),t},qt=e=>{let t="";const c=e==null?void 0:e.subfilters;return Object.keys(c).forEach(function(u,o){o===0&&(t=u)}),t},gc=()=>Mc.filter(e=>e!==""),zt=()=>{var t,c,u;if(((t=B==null?void 0:B.content_archive_filters)==null?void 0:t.length)===0)return!1;let e=!0;return He()&&(e=!1,Object.keys(h.value).forEach(function(o,l){var i;const r=h.value[o],d=(r==null?void 0:r.subfilters)||[];((i=Object.keys(d))==null?void 0:i.length)>0&&Object.keys(d).forEach(function(_,g){var $;const b=d[_],E=(b==null?void 0:b.subfilters)||[];(($=Object.keys(E))==null?void 0:$.length)>0&&(e=!0)})})),He()||((((c=h==null?void 0:h.value)==null?void 0:c.length)===0||(h==null?void 0:h.value)===void 0)&&(e=!1),((u=Object.keys((h==null?void 0:h.value)||{}))==null?void 0:u.length)>0&&(Object.keys(h.value).forEach(function(o,l){var _,g;const r=h.value[o],d=(r==null?void 0:r.subfilters)||{},i=((_=Object.keys(d))==null?void 0:_.length)===1;((g=Object.keys(d))==null?void 0:g.length)>0&&Object.keys(d).forEach(function(b,E){var a;const $=d[b],k=($==null?void 0:$.subfilters)||[],s=(k==null?void 0:k.choices)||{};((a=Object.keys(s))==null?void 0:a.length)<2&&i&&(e=!1)})}),ot.value&&(e=!0))),e};$s(()=>{var e;return((e=We==null?void 0:We.seo)==null?void 0:e.title)+" | "+st("type_page")+" "+De()});const pt=(e="",t="")=>{let c=e;return c.length>0&&c[c.length-1]===t&&(c=c.substring(0,c.length-1)+c.substring(c.length)),c};function Yc(e){let t=String(e||"");return t.length===0?"":(t.startsWith("&")&&(t=t.substring(1)),t.length>0&&t.endsWith("&")&&(t=t.substring(0,t.length-1)),t)}const Qt=(e=null)=>{let t=!1;return ce==="resource"&&e=="post_tag"&&(t=!0),t},vc=(e=[])=>{re.value=[];const t=e.length;Ve.value=Math.ceil(t/ne.value),dt.value=t,ft.value=e;const c=ne.value*(De()-1),u=()=>c+ne.value>t?t:c+ne.value,o=e.slice(c,u());Ne(()=>{re.value=[...o]})},Zc=e=>{Me.value=e,Ne(()=>{{let t=(document==null?void 0:document.getElementById("main-content"))||null;t&&t.scrollIntoView()}})},pc=()=>`${Ke()}-${Ut.value}`,Dt=(e=null)=>{const t=(B==null?void 0:B.content_archive_downloads)||null;return t?e!==null?(t==null?void 0:t[e])||null:t:null},Vc=async()=>{const e=await $fetch(`/api/secure-download?downloadurl=${Et.value.url}`,{method:"GET",headers:{Accept:"*/*","Content-Disposition":"attachment","Content-Type":"application/octet-stream"},responsetype:"blob"});if((e==null?void 0:e.size)>1){pc();const t=window.URL.createObjectURL(e);let c=document.createElement("a");c.href=t,c.download=`${pc()}.zip`,document.body.appendChild(c),c.click(),setTimeout(()=>{c.remove()},250)}},_c=(e="list")=>{typeof e=="string"&&(Pe.value=e)},Gt=()=>(Pe==null?void 0:Pe.value)||"list",He=()=>kt.value||Tt.value||Mt.value,bc=e=>{{const t=window.innerWidth,c=ne.value%2===0;e==="card"&&t>1199&&c&&(ne.value=ne.value-1,h.value={...h.value},Ne(()=>{vt()})),e==="list"&&ne.value!==Pt&&(ne.value=Pt)}};function Kc(){}const h=se(lc()),D=se({}),re=se([]);se(null);const es=Qe==="plantcare";rt(h,(e,t)=>{var o,l;const c=wt(e);if(Dt()){const r=rc(e);Et.value=null,((o=Object.keys(r))==null?void 0:o.length)>0&&Object.keys(r).forEach((d,i)=>{var b;const _=(r==null?void 0:r[d])||{},g=((b=Object.keys(_))==null?void 0:b[0])||null;if(g){const E=Dt(g);Hc.value=g,E&&(Et.value={url:E})}})}Uc.value=c;let u={};return(c==null?void 0:c.length)>0&&(u={filter:c}),u={...u,page:Me.value},(l=A.query)!=null&&l.s&&(u={...u,s:A.query.s}),_t({path:`${A.path}`,query:{...u},hash:A.hash,replace:es})},{deep:!0}),rt(Je,(e,t)=>{Me.value=1,vt()},{deep:!0}),rt(nt,(e,t)=>{t!==null&&e!==t&&Object.keys((h==null?void 0:h.value)||{}
1).forEach(function(c,u){const o=h==null?void 0:h.value[c];if(c!=="product-species"&&c!=="species"){const l=(o==null?void 0:o.subfilters)||{};Object.keys(l).forEach(function(r,d){const i=l[r];i.active&&(i.active=!1)})}})}),rt(Me,(e,t)=>{Ne(()=>{var u;let c={};return((u=wt(h.value))==null?void 0:u.length)>0&&(c={filter:wt(h.value)}),c={...c,page:e},_t({path:`${A.path}`,query:{...c},hash:A.hash,replace:!0})})},{deep:!0}),rt(A,(e,t)=>{wt((h==null?void 0:h.value)||{}),Ne(()=>{var c,u;if((c=Ze.getHistory)!=null&&c[A.query.filter])h.value={...Ze.getHistory[A.query.filter].filter},D.value={...Ze.getHistory[A.query.filter].dynamic},Ne(()=>{vt({})});else{const o=JSON.parse(JSON.stringify(lc())),l={filter:{...o},dynamic:JSON.parse(JSON.stringify({...D.value}))};Ze.setHistory({[((u=A==null?void 0:A.query)==null?void 0:u.filter)||Ke()]:JSON.parse(JSON.stringify(l))}),h.value={...o},Ne(()=>{vt({})})}})},{deep:!0}),rt(Pe,(e,t)=>{bc(e)},{deep:!0}),ot.value&&(nc.value=!1),vt(),Es(()=>{var e;if(Qe==="oeno"&&bc(Pe.value),A.query.filter){(e=Ze.getHistory)!=null&&e[A.query.filter]&&(h.value={...Ze.getHistory[A.query.filter].filter},D.value={...Ze.getHistory[A.query.filter].dynamic});const t=A.query.filter.split("=");if((t==null?void 0:t.length)>0&&(Ut.value=t[1]),xt(),A.hash){const c=document.querySelector(A.hash);c&&c.scrollIntoView()}}if(!A.query.filter){let t={page:1};It.value&&(t={...t,s:It.value});const c=`${A.path}`;return _t({path:c,query:{...t},hash:A.hash,replace:!0})}});const ts=e=>{let t={},c={};t.event="filter_click",c={filter_value:R(e)};const u={data:{...t,...c}};ms(u)};return(e,t)=>{var g,b,E,$,k;const c=ss,u=ns,o=os,l=is,r=ks,d=ls,i=Is,_=as;return x(),y("div",Ss,[Le(l,null,{default:Ct(()=>[Le(c,null,{default:Ct(()=>[Lt(te(ic()),1)]),_:1}),Le(u,{name:"description",content:ic()},null,8,["content"]),parseInt(De())>1?(x(),Ot(o,{key:0,rel:"prev",href:`${v(ze).public.SITE_URL}${v(A).path}?page=${De()-1}`},null,8,["href"])):z("",!0),parseInt(De())!==parseInt(v(Ve))?(x(),Ot(o,{key:1,rel:"next",href:`${v(ze).public.SITE_URL}${v(A).path}?page=${De()+1}`},null,8,["href"])):z("",!0)]),_:1}),v(ce)==="product"?(x(),y("div",js,[P("div",Ts,[P("p",Ms,te(e.$t("product_market_notice")),1)])])):z("",!0),P("div",{id:`${v(tc)?v(tc):"row"}`,class:"row py-4 align-items-start"},[zt()?(x(),y("div",Us,[P("div",Rs,[Le(Zt),P("span",Hs,te(e.$t("filter_by")),1)])])):z("",!0),zt()?(x(),y("div",Ns,[P("div",Fs,[P("div",Bs,[P("p",{class:"small-font text-half-primary cursor-pointer mb-0",onClick:hc},te(e.$t("clear_all")),1),P("p",Js,[Le(Zt),P("span",Ws,te(e.$t("filter_by")),1)]),qs]),P("div",zs,[Le(Zt),P("span",Qs,te(e.$t("filter_by")),1)]),P("div",Ds,[P("span",Gs,te(e.$t("n_active_filters",{nbr:v(cc)+((g=v(sc))==null?void 0:g.length)})),1),P("span",{class:"small-font text-right cursor-pointer d-none d-md-block",onClick:hc},te(e.$t("clear_all")),1)]),P("div",Xs,[(x(!0),y(ae,null,Ie(v(h),(s,a)=>(x(),y(ae,{key:v(R)(a)},[(x(!0),y(ae,null,Ie(zc(a,!0),(C,I)=>(x(),y("span",{class:"btn btn-sm btn-primary btn-icon icon-end py-1 me-2 mb-2",onClick:O=>Gc(a,C.key,(C==null?void 0:C.id)||null),"data-test":a+" "+C.key,ref_for:!0,ref_key:"filterPils",ref:$t},[P("span",{innerHTML:e.$t(C.label,C.label)},null,8,Zs),Le(Lc)],8,Ys))),256))],64))),128)),v(D)?(x(!0),y(ae,{key:0},Ie(v(D),(s,a)=>(x(),y(ae,{key:v(R)(a)},[s?(x(!0),y(ae,{key:0},Ie(s,(C,I)=>(x(),y(ae,{key:v(R)(I)},[C?(x(!0),y(ae,{key:0},Ie(C,(O,m)=>{var p;return x(),y(ae,{key:v(R)(m)},[!!((p=Object.keys((O==null?void 0:O.subfilters)||{}))!=null&&p.length)>0?(x(!0),y(ae,{key:0},Ie(O.subfilters,(L,S)=>(x(),y(ae,{key:S},[L!=null&&L.active?(x(),y("span",{key:0,onClick:n=>Xc(a,I,m,S),class:"btn btn-sm btn-primary btn-icon icon-end py-1 me-2 mb-2 js-dynamic-filter-button",ref_for:!0,ref_key:"dynItemFilterItems",ref:sc},[P("span",null,te(L==null?void 0:L.label),1),Le(Lc)],8,Vs)):z("",!0)],64))),128)):z("",!0)],64)}),128)):z("",!0)],64))),128)):z("",!0)],64))),128)):z("",!0)]),v(h)?(x(),y("div",Ks,[!!((b=Object.keys(v(D)))!=null&&b.length)>0?(x(!0),y(ae,{key:0},Ie(v(D),(s,a)=>(x(),y(ae,null,[(x(!0),y(ae,null,Ie(s,(C,I)=>(x(),y("div",en,[(x(!0),y(ae,null,Ie(C,(O,m)=>(x(),y("div",tn,[P("p",{class:"accordion-header h2",id:`heading-${I}-${m}`},[P("button",{innerHTML:O==null?void 0:O.label,class:"accordion-button",type:"button","data-bs-toggle":"collapse","data-bs-target":`#collapse-${I}-${m}`,"aria-controls":`collapse-${I}-${m}`,"aria-expanded":"true"},null,8,sn)],8,cn),O.subfilters?(x(),y("div",{key:0,id:`collapse-${I}-${m}`,class:"accordion-collapse show","aria-labelledby":`heading-${I}-${m}`,"data-bs-parent":"#product-filters"},[P("div",on,[(x(!0),y(ae,null,Ie(O.subfilters,(p,L)=>(x(),y("div",{key:L,class:Re(["form-check mb-2 ms-1",[`${m==="lifestages"?dc(I,L,p,!0):""}`]])},[bt(P("input",{class:"form-check-input",type:"checkbox",name:L,value:L,id:`checkbox-${I}-${m}-${L}`,"onUpdate:modelValue":S=>v(D)[a][I][m].subfilters[L].active=S,onClick:S=>m==="lifestages"?ht.value=L:Kc},null,8,ln),[[yt,v(D)[a][I][m].subfilters[L].active]]),P("label",{innerHTML:e.$t(p==null?void 0:p.label,p==null?void 0:p.label),for:`checkbox-${I}-${m}-${L}`,class:"form-check-label"},null,8,an)],2))),128))])],8,nn)):z("",!0)]))),256))]))),256))],64))),256)):z("",!0),!!((E=Object.keys(v(h)
1))!=null&&E.length)>0?(x(!0),y(ae,{key:1},Ie(v(h),(s,a)=>{var C,I,O,m,p,L,S,n,j,J,W,M,H,T,f,ue,G,ge,X;return x(),y(ae,{key:a},[s!=null&&s.active&&!He()?(x(),y("div",{key:0,class:Re(["accordion-item",[`${(C=v(h)[a])!=null&&C.expanded?"is-expanded":""}`,`${Qt(a)?"base-filter":""}`]])},[P("p",{class:"accordion-header h2",id:`heading-${s.id}`},[P("button",{innerHTML:v(st)(s==null?void 0:s.label,s==null?void 0:s.label),class:Re(["accordion-button",`${Bt(a)?"":"collapsed"}`]),type:"button","data-bs-toggle":"collapse","data-bs-target":`#collapse-${s.id}`,"aria-controls":`collapse-${s.id}`,"aria-expanded":`${!!Bt(a)}`},null,10,un)],8,rn),s!=null&&s.subfilters?(x(),y("div",{key:0,id:`collapse-${s==null?void 0:s.id}`,class:Re(["accordion-collapse",[Bt(a)?"show":"collapse",(s==null?void 0:s.id)==="species"&&v(Qe)==="brewing"?"is-specie":""]]),"aria-labelledby":`heading-${s==null?void 0:s.id}`,"data-bs-parent":"#product-filters"},[P("div",{class:Re(["accordion-body",[`${Qt(a)&&((I=Object.keys(s==null?void 0:s.subfilters))==null?void 0:I.length)>Sc&&!((O=v(h)[a])!=null&&O.expanded)?"has-overflow":""}`]])},[(x(!0),y(ae,null,Ie(Fc(a,s),([q,Q],_e)=>{var me,ee,Oe,ye,Se,Ee;return x(),y("div",{key:q,class:Re(["form-check mb-2 ms-1",[`${Q!=null&&Q.hideChildren&&!v(kt)&&!v(Tt)?"d-none":""}`,dc(a,q,Q)]])},[P("div",null,[bt(P("input",{class:"form-check-input",type:"checkbox",name:q,id:`checkbox-${a}-${q}`,value:Q.termID?Q.termID:q,"onUpdate:modelValue":U=>v(h)[a].subfilters[q].active=U,"data-test":`${a}, ${q}`,onClick:U=>Jt({key:a,subKey:q,label:lt(s.id,Q,q),state:v(h)[a].subfilters[q].active})},null,8,dn),[[yt,v(h)[a].subfilters[q].active]]),P("label",{innerHTML:lt(s.id,Q,q),class:"form-check-label",for:`checkbox-${a}-${q}`,style:{"text-transform":"capitalize"}},null,8,hn),(ye=(Oe=(ee=(me=v(h))==null?void 0:me[a])==null?void 0:ee.subfilters)==null?void 0:Oe[q])!=null&&ye.active&&((Se=Q==null?void 0:Q.subfilters)==null?void 0:Se.id)==="subcategories"?(x(),y("div",gn,[(x(!0),y(ae,null,Ie((Ee=Q==null?void 0:Q.subfilters)==null?void 0:Ee.choices,(U,F)=>(x(),y("div",{key:F,class:"form-check mb-2"},[bt(P("input",{class:"form-check-input",type:"checkbox",name:v(R)(U.label),id:`checkbox-${a}-${q}-${F}`,value:v(R)(U.label),"onUpdate:modelValue":oe=>v(h)[a].subfilters[q].subfilters.choices[F].active=oe,onClick:oe=>Jt({key:a,subKey:q,subSubKey:F,label:lt(s.id,Q,q),state:v(h)[a].subfilters[q].subfilters.choices[F].active,parent:v(h)[a].subfilters[q]})},null,8,vn),[[yt,v(h)[a].subfilters[q].subfilters.choices[F].active]]),P("label",{innerHTML:U==null?void 0:U.label,class:"form-check-label",for:`checkbox-${a}-${q}-${F}`},null,8,pn)]))),128))])):z("",!0)])],2)}),128))],2)],10,fn)):z("",!0),Qt(a)&&((m=Object.keys(s==null?void 0:s.subfilters))==null?void 0:m.length)>Sc?(x(),y("button",{key:1,class:"expand-accordion-button",type:"button",onClick:()=>{v(h)[a].expanded=!v(h)[a].expanded}},[v(h)[a].expanded?z("",!0):(x(),y("span",bn,te(e.$t("show_more")),1)),v(h)[a].expanded?(x(),y("span",mn,te(e.$t("show_less")),1)):z("",!0)],8,_n)):z("",!0)],2)):z("",!0),s!=null&&s.active&&He()&&a==="product-category"&&((L=(p=qe(s))==null?void 0:p.subfilters)!=null&&L.choices)?(x(),y("div",kn,[P("h2",{class:"accordion-header",id:`heading-${(S=qe(s))==null?void 0:S.termID}`},[P("button",{innerHTML:(j=(n=qe(s))==null?void 0:n.subfilters)==null?void 0:j.label,class:"accordion-button",type:"button","data-bs-toggle":"collapse","data-bs-target":`#collapse-${(J=qe(s))==null?void 0:J.termID}`,"aria-controls":`collapse-${(W=qe(s))==null?void 0:W.termID}`,"aria-expanded":!0},null,8,$n)],8,In),(H=(M=qe(s))==null?void 0:M.subfilters)!=null&&H.choices?(x(),y("div",{key:0,id:`collapse-${(T=qe(s))==null?void 0:T.termID}`,class:Re(["accordion-collapse","show"]),"aria-labelledby":`heading-${(f=qe(s))==null?void 0:f.termID}`,"data-bs-parent":"#product-filters"},[P("div",An,[(G=(ue=qe(s))==null?void 0:ue.subfilters)!=null&&G.choices?(x(!0),y(ae,{key:0},Ie((X=(ge=qe(s))==null?void 0:ge.subfilters)==null?void 0:X.choices,(q,Q)=>{var _e,me;return x(),y("div",{key:Q,class:"form-check mb-2 ms-1"}
1,[(me=(_e=qe(s))==null?void 0:_e.subfilters)!=null&&me.choices[Q]?bt((x(),y("input",{key:0,class:"form-check-input",type:"checkbox",name:Q,id:`checkbox-${a}-${Q}`,value:Q,"onUpdate:modelValue":ee=>v(h)[a].subfilters[qt(s)].subfilters.choices[Q].active=ee,"data-test":v(h)[a].subfilters[qt(s)].subfilters.choices[Q]},null,8,wn)),[[yt,v(h)[a].subfilters[qt(s)].subfilters.choices[Q].active]]):z("",!0),P("label",{innerHTML:q.label,class:"form-check-label",for:`checkbox-${a}-${Q}`},null,8,xn)])}),128)):z("",!0)])],8,En)):z("",!0)])):z("",!0)],64)}),128)):z("",!0)])):z("",!0)]),Le(r,null,{default:Ct(()=>{var s;return[Dt()&&((s=v(Et))!=null&&s.url)?(x(),y("div",Cn,[P("button",{class:"btn btn-sm btn-primary d-flex align-items-center gap-2 mt-3",type:"button",onClick:Vc},[Lt(te(e.$t("download_all"))+" ",1),Le(Ls)])])):z("",!0)]}),_:1})])):z("",!0),P("div",{id:`${v(Pe)==="list"?"archive-list":"products-list"}`,class:Re(["row mx-auto col-12",[`${v(Pe)==="list"?"products-list":"products-cards"}`,`${zt()||v(Pe)==="list"?"col-md-8 offset-md-1 col-lg-8 offset-lg-1":"no-filters"}`]])},[Le(r,null,{default:Ct(()=>{var s,a,C,I,O,m;return[P("div",On,[!!((C=Object.keys(((a=(s=v(h))==null?void 0:s["resources-category"])==null?void 0:a.subfilters)||[]))!=null&&C.length)>0?(x(),y("div",yn,[P("span",{class:Re(["pe-2 pb-2 position-relative",{"active-item":uc("All")}]),role:"button",onClick:t[0]||(t[0]=p=>fc(["all"]))},te(e.$t("all"))+" ("+te((I=At())==null?void 0:I.length)+") ",3),(x(!0),y(ae,null,Ie(v(h)["resources-category"].subfilters,(p,L)=>(x(),y("span",{key:L,class:Re(["pe-2 pb-2 position-relative",{"active-item":uc(p.label)}]),role:"button",onClick:S=>{var n,j;return fc([(j=(n=p==null?void 0:p.label)==null?void 0:n.replace(" ",""))==null?void 0:j.toLowerCase()])}},te(p.label)+" ("+te(Dc(p==null?void 0:p.label))+") ",11,Sn))),128))])):z("",!0),v(Qe)!=="corpo"||v(ce)!=="applications"?(x(),y("div",jn,[P("div",Tn,[P("div",{class:"col-6 col-lg-4 toolbar__general--colStart",style:Vt(["padding: 0 calc(var(--bs-gutter-x) * 0.5)!mportant"])},[v(ct)=="ja"?(x(),y("span",Mn,[Lt(te(v(ce)==="event"?ac():((O=v(ft))==null?void 0:O.length)<v(ne)?v(ft).length:v(ne))+" "+te(e.$t("showing"))+" ",1),P("span",null,te(v(dt))+" "+te(e.$t("of")),1)])):(x(),y("span",Pn,[Lt(te(e.$t("showing"))+" "+te(v(ce)==="event"?ac():((m=v(ft))==null?void 0:m.length)<v(ne)?v(ft).length:v(ne))+" ",1),P("span",null,te(e.$t("of"))+" "+te(v(dt)),1)]))],4),v(ce)!=="event"?(x(),y("div",{key:0,class:"col-6 col-lg-8 text-end toolbar__general--colEnd",style:Vt(["padding: 0 calc(var(--bs-gutter-x) * 0.5)!mportant;"])},[v(nc)?bt((x(),y("select",{key:0,"onUpdate:modelValue":t[1]||(t[1]=p=>As(Je)?Je.value=p:null),class:"form-select filter-select me-3 d-none d-lg-inline","aria-label":"Default select example",id:"select"},[v(ce)==="post"||v(ce)==="resource"?(x(),y(ae,{key:0},[P("option",Un,te(e.$t("sort_name_oldest")),1),P("option",Rn,"Â "+te(e.$t("sort_name_newest")),1)],64)):(x(),y(ae,{key:1},[v(ec)?(x(),y("option",Hn,te(e.$t("sort_name_default")),1)):z("",!0),P("option",Nn,te(e.$t("sort_name_az")),1),P("option",Fn,"Â "+te(e.$t("sort_name_za")),1)],64))],512)),[[ws,v(Je)]]):z("",!0),P("span",{id:"vue-cards",class:Re(["vue-cards me-2 cursor-pointer",{"active-vue":v(Pe)=="card"}]),onClick:t[2]||(t[2]=p=>_c("card"))},[Le(_s)],2),P("span",{id:"vue-list",class:Re(["vue-list cursor-pointer",{"active-vue":v(Pe)=="list"}]),onClick:t[3]||(t[3]=p=>_c("list"))},[Le(d)],2)],4)):z("",!0)])])):z("",!0)])]}),_:1}),v(ce)=="event"?(x(),y("div",{key:v(re)},[v(Me)==1?(x(),y(ae,{key:0},[((k=($=v(re))==null?void 0:$.upcoming)==null?void 0:k.length)>0?(x(),y("h2",Bn,te(e.$t("upcoming_events")),1)):z("",!0)],64)):z("",!0),(x(!0),y(ae,null,Ie(v(re),(s,a)=>(x(),y("div",{class:Re(a),style:Vt(`order: ${a==="upcoming"?0:1}`),key:a},[(x(!0),y(ae,null,Ie(s,(C,I)=>{var O,m,p;return x(),y("div",{key:I},[I==0?(x(),y("hr",Jn)):z("",!0),a==="past"&&I===0?(x(),y("h2",Wn,te(e.$t("past_events")),1)):z("",!0),a==="upcoming"&&((m=(O=v(re))==null?void 0:O.upcoming)==null?void 0:m.length)>0&&v(Me)===v(Ve)&&v(Ve)>1&&I===0?(x(),y("h2",qn,te(e.$t("upcoming_events")),1)):z("",!0),Le(i,{data:C,postType:v(ce),index:I,getSpecies:Wt,view:Gt(),isLast:(I+1)%v(ne)===0||I+1===((p=v(re))==null?void 0:p.length),onFilter:Ft},null,8,["data","postType","index","view","isLast"])])}
1),128))],6))),128))])):z("",!0),v(Pe)==="card"&&v(ce)!=="event"?(x(!0),y(ae,{key:1},Ie(v(re),(s,a)=>{var C;return x(),Ot(i,{data:s,postType:v(ce),key:`post-${v(R)(s.content_archive_item_data.content_archive_item_title)}-${a}`,view:Gt(),index:a,getSpecies:Wt,isLast:(a+1)%v(ne)===0||a+1===((C=v(re))==null?void 0:C.length),onFilter:Ft},null,8,["data","postType","view","index","isLast"])}),128)):z("",!0),v(Pe)==="list"&&v(ce)!=="event"?(x(!0),y(ae,{key:2},Ie(v(re),(s,a)=>{var C;return x(),Ot(i,{data:s,postType:v(ce),key:`post-${v(R)(s.content_archive_item_data.content_archive_item_title)}-${a}`,view:Gt(),index:a,getSpecies:Wt,isLast:(a+1)%v(ne)===0||a+1===((C=v(re))==null?void 0:C.length),onFilter:Ft},null,8,["data","postType","view","index","isLast"])}),128)):z("",!0),v(dt)>v(ne)?(x(),y("div",zn,[Le(_,{totalPage:v(Ve),currentPage:De(),changePage:Zc},null,8,["totalPage","currentPage"])])):z("",!0),v(ut)&&v(re).length===0?(x(),y("div",Qn,[P("p",null,te(e.$t("no_result_found")),1)])):z("",!0)],10,Ln)],8,Ps)])}}},co=us(Dn,[["__scopeId","data-v-1c7298b0"]]);export{co 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.