PageSourceSearch

https://www.macardo.ch/_nuxt/DfTnHdOY.js

js macardo.ch collected 2026-10-07 18:49:14 UTC 4,057 bytes, 1 lines download raw bytes

1import{d as Q,aW as W,b0 as A,a4 as G,k as D,n as c,p as t,C as v,D as J,t as d,s as o,T as u,F as C,x,i as g,O as M,Q as P}from"./C13IqGSq.js";import{u as U}from"./B2SpqUvC.js";const X={key:0},Y={class:"flex items-center border-b border-primary-50 pb-[12px] pt-[12px]"},Z=["id","checked","value","aria-label"],ee=["for"],te={class:"color-secondary-600"},re=["id","checked","value","aria-label"],ae=["for"],se={class:"color-secondary-600"},ue=Q({__name:"CmsElementCategoryFilterElement",setup(oe){const k=M(),R=P(),{getInitialListing:f}=W(),{setCurrentFilters:S,getCurrentFilters:w}=A();let b={listing:{categories:"Categories",button:{showCategories:"Show all categories",hideCategories:"Hide categories"}}};b=G(U(),b);const m=D(0),i=D(!1),F=async n=>{const s=n.target.value,l="wwCategoryFilter";let e=(k.query[l]||"").split("|").filter(Boolean);e.includes(s)?e=e.filter(p=>p!==s):e.push(s),m.value=e.length;const y={...k.query};e.length>0?y[l]=e.join("|"):delete y[l],await R.push({query:y}),S([{code:"wwCategoryFilter",value:e.join("|")}])},H=()=>{i.value=!i.value},h=(n,s)=>{const l=s.find(e=>e.key===n);return l?l.count:0};return(n,s)=>{var l,e,y;return g(),c("div",{class:u(["category-filter-block w-full",[i.value?"z-100 fixed bottom-0 pt-[24px] left-0 border-t border-primary-50 bg-white":"relative"]])},[t("h3",{class:u([i.value?"px-[16px]":""])},[v(d(o(b).listing.categories)+" ",1),m.value>0?(g(),c("span",X,"("+d(m.value)+")",1)):J("",!0)],2),t("div",{class:u(["h-[100vh] overflow-hidden md:h-[calc(100vh-190px)] overflow-y-auto",[i.value?"h-[calc(100vh-135px)] pb-[24px] px-[16px]":"h-[135px]"]])},[t("div",null,[(g(!0),c(C,null,x((y=(e=(l=o(f))==null?void 0:l.extensions)==null?void 0:e.wwCategoryTree)==null?void 0:y.tree,p=>{var _;return g(),c("div",{key:`${p.key}-${(_=n.selectedOptionIds)==null?void 0:_.includes(p.key)}`,class:"flex flex-col"},[(g(!0),c(C,null,x(p.children,r=>{var $,B,I,L,O,T;return g(),c("div",{key:`${r.category.id}-${($=n.selectedOptionIds)==null?void 0:$.includes(r.category.id)}`},[t("div",Y,[t("input",{id:`filter-wwCategoryFilter-${r.category.id}`,checked:(B=o(w))==null?void 0:B.wwCategoryFilter.includes(r.category.id),name:"wwCategoryFilter",value:r.category.id,"aria-label":`${p.name} filter`,type:"checkbox",class:"h-4 w-4 border-secondary-300 mr-[12px]",onChange:s[0]||(s[0]=a=>F(a))},null,40,Z),t("label",{for:`filter-wwCategoryFilter-${r.category.id}`,class:u(["inline-block text-base break-words hyphens-auto",[(I=o(w))!=null&&I.wwCategoryFilter.includes(r.category.id)?"font-semibold":"font-normal",n.errorClass]])},[v(d(r.category.name)+" ",1),t("span",te,"("+d(h(r.category.id,(T=(O=(L=o(f))==null?void 0:L.aggregations)==null?void 0:O.wwCategoryFilter)==null?void 0:T.buckets))+")",1)],10,ee)]),(g(!0),c(C,null,x(r.children,(a,ne,le)=>{var V,q,E,N,j,z;return g(),c("div",{key:`${a.category.id}-${(V=n.selectedOptionIds)==null?void 0:V.includes(a.category.id)}`,class:u(["flex items-center border-b border-primary-50 pb-[12px] pt-[12px] pl-[24px]"])},[t("input",{id:`filter-wwCategoryFilter-${a.category.id}`,checked:(q=o(w))==null?void 0:q.wwCategoryFilter.includes(a.category.id),name:"wwCategoryFilter",value:a.category.id,"aria-label":`${r.name} filter`,type:"checkbox",class:"h-4 w-4 border-secondary-300 mr-[12px]",onChange:s[1]||(s[1]=K=>F(K))},null,40,re),t("label",{for:`filter-wwCategoryFilter-${a.category.id}`,class:u(["inline-block text-base break-words hyphens-auto",[(E=o(w))!=null&&E.wwCategoryFilter.includes(a.category.id)?"font-semibold":"font-normal",n.errorClass]])},[v(d(a.category.name)+" ",1),t("span",se,"("+d(h(a.category.id,(z=(j=(N=o(f))==null?void 0:N.aggregations)==null?void 0:j.wwCategoryFilter)==null?void 0:z.buckets))+") ",1)],10,ae)])}),128))])}),128))])}),128))])],2),t("div",{class:u([i.value?"px-[16px]":""])},[t("button",{class:u(["btn btn-secondary text-base block md:hidden text-center my-[24px] w-full bg-white",[(i.value,"")]]),onClick:H},d(i.value?o(b).listing.button.hideCategories:o(b).listing.button.showCategories),3)],2)],2)}}});export{ue 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.