import{u as _,j as s,e as R,L as n}from"./vendor-BKmmeuxg.js";import{S as P}from"./search-input-D2aHQefO.js";import{R as j,a as m}from"./radio-group-C0C2vfl-.js";import{g as k}from"./route-B4ZMN77y.js";import"./debounce-CWHP_ANh.js";import"./utils-DxSsnXxD.js";const S=({setOpen:r})=>{const f=_(),i=k(f.url),{levels:N,prices:v,categories:g,category:a,categoryChild:e,translate:F}=f.props,{frontend:u,common:h}=F,c=(l,x,t)=>{const o={...i};return"search"in o&&delete o.search,route("category.exams",{category:x,category_child:t,...o,...l})};return s.jsxs("div",{className:"space-y-6",children:[s.jsx(P,{onChangeValue:l=>R.get(route("category.exams",{category:"all",search:l}))}),s.jsxs("div",{children:[s.jsx("h3",{className:"mb-3 font-semibold",children:h.categories}),s.jsxs(j,{value:e?e==null?void 0:e.slug:(a==null?void 0:a.slug)||"all",children:[s.jsxs(n,{className:"flex items-center",href:c({},"all"),children:[s.jsx(m,{className:"cursor-pointer",id:"category",value:"all"}),s.jsx("label",{htmlFor:"category",className:"cursor-pointer pl-2",children:u.all})]}),g.map((l,x)=>{var o;const t=`category${x}`;return l.slug==="default"?null:s.jsxs("div",{className:"capitalize",children:[s.jsxs(n,{className:"flex items-center",href:c({},l.slug),onFinish:()=>!i.search&&r&&r(!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})]}),(o=l.category_children)==null?void 0:o.map((d,b)=>{const p=`category_child${b}`;return s.jsxs(n,{className:"mt-2 flex items-center pl-3",href:c({},l.slug,d.slug),onFinish:()=>!i.search&&r&&r(!1),children:[s.jsx(m,{className:"cursor-pointer",id:p,value:d.slug}),s.jsx("label",{htmlFor:p,className:"cursor-pointer pl-2",children:d.title})]},p)})]},t)})]})]}),s.jsxs("div",{children:[s.jsx("h3",{className:"mb-3 font-semibold",children:h.price}),s.jsxs(j,{value:i.pricing_type||"all",children:[s.jsxs(n,{className:"flex items-center",href:c({pricing_type:"all"},(a==null?void 0:a.slug)||"all",e==null?void 0:e.slug),onFinish:()=>!i.search&&r&&r(!1),children:[s.jsx(m,{className:"cursor-pointer",id:"price",value:"all"}),s.jsx("label",{htmlFor:"price",className:"cursor-pointer pl-2",children:u.all})]}),v.map(l=>s.jsxs(n,{className:"flex items-center capitalize",href:c({pricing_type:l},(a==null?void 0:a.slug)||"all",e==null?void 0:e.slug),onFinish:()=>!i.search&&r&&r(!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:h.level}),s.jsxs(j,{value:i.level||"all",children:[s.jsxs(n,{className:"flex items-center",href:c({level:"all"},(a==null?void 0:a.slug)||"all",e==null?void 0:e.slug),onFinish:()=>!i.search&&r&&r(!1),children:[s.jsx(m,{className:"cursor-pointer",id:"level",value:"all"}),s.jsx("label",{htmlFor:"level",className:"cursor-pointer pl-2",children:u.all})]}),N.map(l=>s.jsxs(n,{className:"flex items-center capitalize",href:c({level:l},(a==null?void 0:a.slug)||"all",e==null?void 0:e.slug),onFinish:()=>!i.search&&r&&r(!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{S as default};
