var z=Object.defineProperty;var v=Object.getOwnPropertySymbols;var S=Object.prototype.hasOwnProperty,_=Object.prototype.propertyIsEnumerable;var F=(e,c,r)=>c in e?z(e,c,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[c]=r,h=(e,c)=>{for(var r in c||(c={}))S.call(c,r)&&F(e,r,c[r]);if(v)for(var r of v(c))_.call(c,r)&&F(e,r,c[r]);return e};import{aT as G,j as s,aX as I,aS as o}from"./react-vendor-xYZnmIII.js";import{S as Q}from"./search-input-BXgStIKS.js";import{R as N,f as m}from"./ui-components-CQM92IK3.js";import{g as $}from"./route-D0xh7FtZ.js";import"./inertia-vendor-cBbDTmhJ.js";import"./ui-vendor-Ds9iwIxa.js";import"./debounce-CWHP_ANh.js";import"./interactive-vendor-B1OgcAgP.js";const D=({setOpen:e})=>{const c=G(),r=$(c.url),{levels:b,prices:g,categories:R,category:i,categoryChild:a,translate:P}=c.props,{frontend:x,common:d}=P,n=(l,p,t)=>{const u=h({},r);return"search"in u&&delete u.search,route("category.courses",h(h({category:p,category_child:t},u),l))};return s.jsxs("div",{className:"space-y-6",children:[s.jsx(Q,{onChangeValue:l=>I.get(route("category.courses",{category:"all",search:l}))}),s.jsxs("div",{children:[s.jsx("h3",{className:"mb-3 font-semibold",children:d.categories}),s.jsxs(N,{value:a?a==null?void 0:a.slug:(i==null?void 0:i.slug)||"all",children:[s.jsxs(o,{className:"flex items-center",href:n({},"all"),children:[s.jsx(m,{className:"cursor-pointer",id:"category",value:"all"}),s.jsx("label",{htmlFor:"category",className:"cursor-pointer pl-2",children:x.all})]}),R.map((l,p)=>{var u;const t=`category${p}`;return l.slug==="default"?null:s.jsxs("div",{className:"capitalize",children:[s.jsxs(o,{className:"flex items-center",href:n({},l.slug),onFinish:()=>!r.search&&e&&e(!1),children:[s.jsx(m,{className:"cursor-pointer",id:t,value:l.slug}),s.jsx("label",{htmlFor:t,className:"cursor-pointer pl-2",children:l.title})]}),(u=l.category_children)==null?void 0:u.map((j,k)=>{const f=`category_child${k}`;return s.jsxs(o,{className:"mt-2 flex items-center pl-3",href:n({},l.slug,j.slug),onFinish:()=>!r.search&&e&&e(!1),children:[s.jsx(m,{className:"cursor-pointer",id:f,value:j.slug}),s.jsx("label",{htmlFor:f,className:"cursor-pointer pl-2",children:j.title})]},f)})]},t)})]})]}),s.jsxs("div",{children:[s.jsx("h3",{className:"mb-3 font-semibold",children:d.price}),s.jsxs(N,{value:r.price||"all",children:[s.jsxs(o,{className:"flex items-center",href:n({price:"all"},(i==null?void 0:i.slug)||"all",a==null?void 0:a.slug),onFinish:()=>!r.search&&e&&e(!1),children:[s.jsx(m,{className:"cursor-pointer",id:"price",value:"all"}),s.jsx("label",{htmlFor:"price",className:"cursor-pointer pl-2",children:x.all})]}),g.map(l=>s.jsxs(o,{className:"flex items-center capitalize",href:n({price:l},(i==null?void 0:i.slug)||"all",a==null?void 0:a.slug),onFinish:()=>!r.search&&e&&e(!1),children:[s.jsx(m,{className:"cursor-pointer",value:l,id:l}),s.jsx("label",{htmlFor:l,className:"cursor-pointer pl-2",children:l})]},l))]})]}),s.jsxs("div",{children:[s.jsx("h3",{className:"mb-3 font-semibold",children:d.level}),s.jsxs(N,{value:r.level||"all",children:[s.jsxs(o,{className:"flex items-center",href:n({level:"all"},(i==null?void 0:i.slug)||"all",a==null?void 0:a.slug),onFinish:()=>!r.search&&e&&e(!1),children:[s.jsx(m,{className:"cursor-pointer",id:"level",value:"all"}),s.jsx("label",{htmlFor:"level",className:"cursor-pointer pl-2",children:x.all})]}),b.map(l=>s.jsxs(o,{className:"flex items-center capitalize",href:n({level:l},(i==null?void 0:i.slug)||"all",a==null?void 0:a.slug),onFinish:()=>!r.search&&e&&e(!1),children:[s.jsx(m,{className:"cursor-pointer",value:l,id:l}),s.jsx("label",{htmlFor:l,className:"cursor-pointer pl-2",children:l})]},l))]})]})]})};export{D as default};
