var y=Object.defineProperty;var x=Object.getOwnPropertySymbols;var B=Object.prototype.hasOwnProperty,D=Object.prototype.propertyIsEnumerable;var N=(l,r,t)=>r in l?y(l,r,{enumerable:!0,configurable:!0,writable:!0,value:t}):l[r]=t,m=(l,r)=>{for(var t in r||(r={}))B.call(r,t)&&N(l,t,r[t]);if(x)for(var t of x(r))D.call(r,t)&&N(l,t,r[t]);return l};import{jsx as i,jsxs as s}from"react/jsx-runtime";import{a as F,S as O,b as Q,B as c,d as _,e as A,Z as w,a6 as b,a7 as L,a8 as S}from"./ui-components-B24mpb8o.js";import{u as G}from"./use-screen-CJI_WQZy.js";import{L as H}from"./landing-layout-D335TIc1.js";import{g as R}from"./route-D0xh7FtZ.js";import{usePage as Z,router as q}from"@inertiajs/react";import{ListFilter as E,Grid as I,List as J}from"lucide-react";import{useState as K}from"react";import T from"./course-filter-BFkDmqJt.js";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";import"./index-CUpX7x90.js";import"./app-logo-CAnM-q9p.js";import"lucide-react/dynamic";import"./main-Cv60h411.js";import"./theme-colors-CLpwvDr4.js";import"./use-auth-cj50aT3v.js";import"./appearance-zLWEcDPI.js";import"./language-79bZLpyc.js";import"./notification-BBQVVMqD.js";import"date-fns";import"./profile-toggle-E46Ne1rK.js";import"nanoid";import"./search-input-Cc2brlhX.js";import"./debounce-CWHP_ANh.js";const Ii=({children:l})=>{var v;const{url:r,props:t}=Z(),{category:e,categoryChild:o,translate:z}=t,{frontend:a}=z,[C,d]=K(!1),u=R(r),h=(v=u.view)!=null?v:"grid",{screen:f}=G(),P=(n,j,k)=>{const p=m({},u);return"search"in p&&delete p.search,route("category.courses",m(m({category:j,category_child:k},p),n))},g=n=>{q.get(P({view:n},(e==null?void 0:e.slug)||"all",o==null?void 0:o.slug))};return i(H,{customizable:!1,children:s("div",{className:"container flex items-start gap-6 py-6",children:[f>768&&i(F,{className:"sticky top-24 w-64 p-4",children:i(T,{})}),s("div",{className:"flex-1",children:[s("div",{className:"mb-6 flex items-center justify-between",children:[s("div",{className:"flex items-center gap-2",children:[f<768&&s(O,{open:C,onOpenChange:d,children:[i(Q,{asChild:!0,children:i(c,{size:"icon",variant:"outline",children:i(E,{className:"h-5 w-5"})})}),i(_,{side:"left",className:"border-border w-[220px]",children:i(A,{className:"h-full",children:i(T,{setOpen:d})})})]}),s("div",{children:[s("h2",{className:"text-2xl font-bold capitalize",children:[e||o?(e==null?void 0:e.title)||(o==null?void 0:o.title):a.all," ",a.courses]}),(e&&e.description||o&&o.description)&&i("p",{className:"text-muted-foreground mt-1 text-sm",children:(e==null?void 0:e.description)||(o==null?void 0:o.description)})]})]}),s("div",{className:"flex gap-2",children:[i(w,{delayDuration:0,children:s(b,{children:[i(L,{asChild:!0,children:i(c,{size:"icon",variant:h==="grid"?"default":"outline",onClick:()=>g("grid"),children:i(I,{className:"h-4 w-4"})})}),i(S,{children:i("p",{children:a.grid_view})})]})}),i(w,{delayDuration:0,children:s(b,{children:[i(L,{asChild:!0,children:i(c,{size:"icon",variant:h==="list"?"default":"outline",onClick:()=>g("list"),children:i(J,{className:"h-4 w-4"})})}),i(S,{children:i("p",{children:a.list_view})})]})})]})]}),l]})]})})};export{Ii as default};
