var G=Object.defineProperty;var g=Object.getOwnPropertySymbols;var I=Object.prototype.hasOwnProperty,Q=Object.prototype.propertyIsEnumerable;var x=(r,m,e)=>m in r?G(r,m,{enumerable:!0,configurable:!0,writable:!0,value:e}):r[m]=e,h=(r,m)=>{for(var e in m||(m={}))I.call(m,e)&&x(r,e,m[e]);if(g)for(var e of g(m))Q.call(m,e)&&x(r,e,m[e]);return r};import{jsxs as o,jsx as s}from"react/jsx-runtime";import{S}from"./search-input-Cc2brlhX.js";import{R as b,f as c}from"./ui-components-B24mpb8o.js";import{g as _}from"./route-D0xh7FtZ.js";import{usePage as $,router as L,Link as n}from"@inertiajs/react";import"./debounce-CWHP_ANh.js";import"lucide-react";import"react";import"next-themes";import"sonner";import"@radix-ui/react-label";import"class-variance-authority";import"@radix-ui/react-checkbox";import"@radix-ui/react-avatar";import"@radix-ui/react-dropdown-menu";import"@radix-ui/react-scroll-area";import"@radix-ui/react-popover";import"@radix-ui/react-radio-group";import"@radix-ui/react-dialog";import"@radix-ui/react-slot";import"clsx";import"@radix-ui/react-separator";import"@radix-ui/react-tooltip";import"@radix-ui/react-tabs";import"@radix-ui/react-accordion";import"@radix-ui/react-progress";import"@radix-ui/react-select";import"cmdk";import"@radix-ui/react-switch";import"react-day-picker";import"@radix-ui/react-slider";import"embla-carousel-react";import"@radix-ui/react-toggle-group";import"vaul";import"tailwind-merge";const Nl=({setOpen:r})=>{const m=$(),e=_(m.url),{levels:P,prices:R,categories:k,category:i,categoryChild:a,translate:z}=m.props,{frontend:d,common:f}=z,t=(l,N,p)=>{const u=h({},e);return"search"in u&&delete u.search,route("category.courses",h(h({category:N,category_child:p},u),l))};return o("div",{className:"space-y-6",children:[s(S,{onChangeValue:l=>L.get(route("category.courses",{category:"all",search:l}))}),o("div",{children:[s("h3",{className:"mb-3 font-semibold",children:f.categories}),o(b,{value:a?a==null?void 0:a.slug:(i==null?void 0:i.slug)||"all",children:[o(n,{className:"flex items-center",href:t({},"all"),children:[s(c,{className:"cursor-pointer",id:"category",value:"all"}),s("label",{htmlFor:"category",className:"cursor-pointer pl-2",children:d.all})]}),k.map((l,N)=>{var u;const p=`category${N}`;return l.slug==="default"?null:o("div",{className:"capitalize",children:[o(n,{className:"flex items-center",href:t({},l.slug),onFinish:()=>!e.search&&r&&r(!1),children:[s(c,{className:"cursor-pointer",id:p,value:l.slug}),s("label",{htmlFor:p,className:"cursor-pointer pl-2",children:l.title})]}),(u=l.category_children)==null?void 0:u.map((v,j)=>{const F=`category_child${j}`;return o(n,{className:"mt-2 flex items-center pl-3",href:t({},l.slug,v.slug),onFinish:()=>!e.search&&r&&r(!1),children:[s(c,{className:"cursor-pointer",id:F,value:v.slug}),s("label",{htmlFor:F,className:"cursor-pointer pl-2",children:v.title})]},F)})]},p)})]})]}),o("div",{children:[s("h3",{className:"mb-3 font-semibold",children:f.price}),o(b,{value:e.price||"all",children:[o(n,{className:"flex items-center",href:t({price:"all"},(i==null?void 0:i.slug)||"all",a==null?void 0:a.slug),onFinish:()=>!e.search&&r&&r(!1),children:[s(c,{className:"cursor-pointer",id:"price",value:"all"}),s("label",{htmlFor:"price",className:"cursor-pointer pl-2",children:d.all})]}),R.map(l=>o(n,{className:"flex items-center capitalize",href:t({price:l},(i==null?void 0:i.slug)||"all",a==null?void 0:a.slug),onFinish:()=>!e.search&&r&&r(!1),children:[s(c,{className:"cursor-pointer",value:l,id:l}),s("label",{htmlFor:l,className:"cursor-pointer pl-2",children:l})]},l))]})]}),o("div",{children:[s("h3",{className:"mb-3 font-semibold",children:f.level}),o(b,{value:e.level||"all",children:[o(n,{className:"flex items-center",href:t({level:"all"},(i==null?void 0:i.slug)||"all",a==null?void 0:a.slug),onFinish:()=>!e.search&&r&&r(!1),children:[s(c,{className:"cursor-pointer",id:"level",value:"all"}),s("label",{htmlFor:"level",className:"cursor-pointer pl-2",children:d.all})]}),P.map(l=>o(n,{className:"flex items-center capitalize",href:t({level:l},(i==null?void 0:i.slug)||"all",a==null?void 0:a.slug),onFinish:()=>!e.search&&r&&r(!1),children:[s(c,{className:"cursor-pointer",value:l,id:l}),s("label",{htmlFor:l,className:"cursor-pointer pl-2",children:l})]},l))]})]})]})};export{Nl as default};
