UNPKG

@ferdiunal/refinedev-shadcn-ui

Version:
1 lines 72.2 kB
var xa=Object.defineProperty;var mt=(e,t)=>{for(var o in t)xa(e,o,{get:t[o],enumerable:!0})};import{matchResourceFromRoute as vi,useBreadcrumb as gi,useRefineContext as bi,useResource as hi}from"@refinedev/core";import{HomeIcon as yi}from"lucide-react";var Er={};mt(Er,{Avatar:()=>Ko,AvatarFallback:()=>jo,AvatarImage:()=>Jo,Badge:()=>ye,Button:()=>c,Calendar:()=>Bt,Card:()=>Se,CardContent:()=>Me,CardDescription:()=>pr,CardFooter:()=>vt,CardHeader:()=>dr,CardTitle:()=>cr,Checkbox:()=>kt,Command:()=>X,CommandDialog:()=>ai,CommandEmpty:()=>ce,CommandGroup:()=>K,CommandInput:()=>Be,CommandItem:()=>xe,CommandList:()=>Et,CommandSeparator:()=>Ft,CommandShortcut:()=>Cr,Dialog:()=>qe,DialogClose:()=>to,DialogContent:()=>Fe,DialogDescription:()=>Tt,DialogFooter:()=>Rt,DialogHeader:()=>xt,DialogOverlay:()=>oo,DialogPortal:()=>vr,DialogTitle:()=>Ct,DialogTrigger:()=>Wa,DropdownMenu:()=>be,DropdownMenuCheckboxItem:()=>ct,DropdownMenuContent:()=>ie,DropdownMenuGroup:()=>Ma,DropdownMenuItem:()=>ne,DropdownMenuLabel:()=>pt,DropdownMenuPortal:()=>ka,DropdownMenuRadioGroup:()=>Fa,DropdownMenuRadioItem:()=>rr,DropdownMenuSeparator:()=>ut,DropdownMenuShortcut:()=>ar,DropdownMenuSub:()=>Ea,DropdownMenuSubContent:()=>or,DropdownMenuSubTrigger:()=>tr,DropdownMenuTrigger:()=>We,FormControl:()=>de,FormDescription:()=>Dt,FormField:()=>io,FormItem:()=>wt,FormLabel:()=>Nt,FormMessage:()=>St,FormUI:()=>ao,Input:()=>Mt,Label:()=>Pt,Link:()=>P,Popover:()=>O,PopoverContent:()=>I,PopoverTrigger:()=>U,ScrollArea:()=>At,ScrollBar:()=>co,Select:()=>Ke,SelectContent:()=>Ie,SelectGroup:()=>fi,SelectItem:()=>He,SelectLabel:()=>Sr,SelectSeparator:()=>Mr,SelectTrigger:()=>Le,SelectValue:()=>Je,Separator:()=>J,Sheet:()=>Kt,SheetClose:()=>La,SheetContent:()=>ft,SheetDescription:()=>mr,SheetFooter:()=>sr,SheetHeader:()=>nr,SheetOverlay:()=>jt,SheetPortal:()=>ir,SheetTitle:()=>lr,SheetTrigger:()=>Jt,Table:()=>gt,TableBody:()=>ht,TableCaption:()=>fr,TableCell:()=>$e,TableFooter:()=>ur,TableHead:()=>yt,TableHeader:()=>bt,TableRow:()=>Ee,Textarea:()=>Dr,badgeVariants:()=>Rr,buttonVariants:()=>_e,useFormField:()=>Ye});import*as Q from"@radix-ui/react-avatar";import*as dt from"react";var Xo={};mt(Xo,{cn:()=>a});import{clsx as Ra}from"clsx";import{twMerge as Ca}from"tailwind-merge";function a(...e){return Ca(Ra(e))}import{jsx as Yt}from"react/jsx-runtime";var Ko=dt.forwardRef(({className:e,...t},o)=>Yt(Q.Root,{ref:o,className:a("relative flex h-10 w-10 shrink-0 overflow-hidden rounded-full",e),...t}));Ko.displayName=Q.Root.displayName;var Jo=dt.forwardRef(({className:e,...t},o)=>Yt(Q.Image,{ref:o,className:a("aspect-square h-full w-full",e),...t}));Jo.displayName=Q.Image.displayName;var jo=dt.forwardRef(({className:e,...t},o)=>Yt(Q.Fallback,{ref:o,className:a("flex h-full w-full items-center justify-center rounded-full bg-muted",e),...t}));jo.displayName=Q.Fallback.displayName;import{Slot as Ta}from"@radix-ui/react-slot";import{cva as Pa}from"class-variance-authority";import*as er from"react";import{jsx as wa}from"react/jsx-runtime";var _e=Pa("select-none inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50",{variants:{variant:{default:"bg-primary text-primary-foreground shadow hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground shadow-sm hover:bg-destructive/90",outline:"border border-input bg-transparent shadow-sm hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground shadow-sm hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2",sm:"h-8 rounded-md px-3 text-xs",lg:"h-10 rounded-md px-8",icon:"h-9 w-9"}},defaultVariants:{variant:"default",size:"default"}}),c=er.forwardRef(({className:e,variant:t,size:o,asChild:r=!1,...i},n)=>wa(r?Ta:"button",{className:a(_e({variant:t,size:o,className:e})),ref:n,...i}));c.displayName="Button";import*as q from"react";import*as p from"@radix-ui/react-dropdown-menu";import{CheckIcon as Na,ChevronRightIcon as Da,DotFilledIcon as Sa}from"@radix-ui/react-icons";import{jsx as D,jsxs as Zt}from"react/jsx-runtime";var be=p.Root,We=p.Trigger,Ma=p.Group,ka=p.Portal,Ea=p.Sub,Fa=p.RadioGroup,tr=q.forwardRef(({className:e,inset:t,children:o,...r},i)=>Zt(p.SubTrigger,{ref:i,className:a("flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent data-[state=open]:bg-accent",t&&"pl-8",e),...r,children:[o,D(Da,{className:"ml-auto h-4 w-4"})]}));tr.displayName=p.SubTrigger.displayName;var or=q.forwardRef(({className:e,...t},o)=>D(p.SubContent,{ref:o,className:a("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...t}));or.displayName=p.SubContent.displayName;var ie=q.forwardRef(({className:e,sideOffset:t=4,...o},r)=>D(p.Portal,{children:D(p.Content,{ref:r,sideOffset:t,className:a("z-50 min-w-[8rem] overflow-hidden rounded-md border border-border bg-popover p-1 text-popover-foreground shadow-md","data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...o})}));ie.displayName=p.Content.displayName;var ne=q.forwardRef(({className:e,inset:t,...o},r)=>D(p.Item,{ref:r,className:a("relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",t&&"pl-8",e),...o}));ne.displayName=p.Item.displayName;var ct=q.forwardRef(({className:e,children:t,checked:o,...r},i)=>Zt(p.CheckboxItem,{ref:i,className:a("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),checked:o,...r,children:[D("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:D(p.ItemIndicator,{children:D(Na,{className:"h-4 w-4"})})}),t]}));ct.displayName=p.CheckboxItem.displayName;var rr=q.forwardRef(({className:e,children:t,...o},r)=>Zt(p.RadioItem,{ref:r,className:a("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...o,children:[D("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:D(p.ItemIndicator,{children:D(Sa,{className:"h-4 w-4 fill-current"})})}),t]}));rr.displayName=p.RadioItem.displayName;var pt=q.forwardRef(({className:e,inset:t,...o},r)=>D(p.Label,{ref:r,className:a("px-2 py-1.5 text-sm font-semibold",t&&"pl-8",e),...o}));pt.displayName=p.Label.displayName;var ut=q.forwardRef(({className:e,...t},o)=>D(p.Separator,{ref:o,className:a("-mx-1 my-1 h-px bg-muted",e),...t}));ut.displayName=p.Separator.displayName;var ar=({className:e,...t})=>D("span",{className:a("ml-auto text-xs tracking-widest opacity-60",e),...t});ar.displayName="DropdownMenuShortcut";import*as y from"@radix-ui/react-dialog";import{Cross2Icon as Ba}from"@radix-ui/react-icons";import{cva as Aa}from"class-variance-authority";import*as Ge from"react";import{jsx as se,jsxs as Xt}from"react/jsx-runtime";var Kt=y.Root,Jt=y.Trigger,La=y.Close,ir=y.Portal,jt=Ge.forwardRef(({className:e,...t},o)=>se(y.Overlay,{className:a("fixed inset-0 z-50 bg-background/95 backdrop-blur supports-[backdrop-filter]:bg-background/60 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...t,ref:o}));jt.displayName=y.Overlay.displayName;var Ia=Aa("fixed z-50 gap-4 bg-background p-6 shadow-lg transition ease-in-out data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:duration-300 data-[state=open]:duration-500",{variants:{side:{top:"inset-x-0 top-0 border-b data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top",bottom:"inset-x-0 bottom-0 border-t data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom",left:"inset-y-0 left-0 h-full w-3/4 border-border border-r data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left sm:max-w-sm",right:"inset-y-0 right-0 h-full w-3/4 border-l data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right sm:max-w-sm"}},defaultVariants:{side:"right"}}),ft=Ge.forwardRef(({side:e="right",className:t,children:o,...r},i)=>Xt(ir,{children:[se(jt,{}),Xt(y.Content,{ref:i,className:a(Ia({side:e}),t),...r,children:[o,Xt(y.Close,{className:"absolute right-4 top-4 text-foreground rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-secondary",children:[se(Ba,{className:"h-4 w-4"}),se("span",{className:"sr-only",children:"Close"})]})]})]}));ft.displayName=y.Content.displayName;var nr=({className:e,...t})=>se("div",{className:a("flex flex-col space-y-2 text-center sm:text-left",e),...t});nr.displayName="SheetHeader";var sr=({className:e,...t})=>se("div",{className:a("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});sr.displayName="SheetFooter";var lr=Ge.forwardRef(({className:e,...t},o)=>se(y.Title,{ref:o,className:a("text-lg font-semibold text-foreground",e),...t}));lr.displayName=y.Title.displayName;var mr=Ge.forwardRef(({className:e,...t},o)=>se(y.Description,{ref:o,className:a("text-sm text-muted-foreground",e),...t}));mr.displayName=y.Description.displayName;import*as he from"react";import{jsx as ke}from"react/jsx-runtime";var Se=he.forwardRef(({className:e,...t},o)=>ke("div",{ref:o,className:a("border border-border bg-card text-card-foreground shadow",e),...t}));Se.displayName="Card";var dr=he.forwardRef(({className:e,...t},o)=>ke("div",{ref:o,className:a("flex flex-col space-y-1.5 p-6",e),...t}));dr.displayName="CardHeader";var cr=he.forwardRef(({className:e,...t},o)=>ke("h3",{ref:o,className:a("font-semibold leading-none tracking-tight",e),...t}));cr.displayName="CardTitle";var pr=he.forwardRef(({className:e,...t},o)=>ke("p",{ref:o,className:a("text-sm text-muted-foreground",e),...t}));pr.displayName="CardDescription";var Me=he.forwardRef(({className:e,...t},o)=>ke("div",{ref:o,className:a("p-6 pt-0",e),...t}));Me.displayName="CardContent";var vt=he.forwardRef(({className:e,...t},o)=>ke("div",{ref:o,className:a("flex items-center p-6 pt-0",e),...t}));vt.displayName="CardFooter";import{useLink as Ha,useRouterContext as Va,useRouterType as za}from"@refinedev/core";import{forwardRef as Oa}from"react";import{jsx as Ua}from"react/jsx-runtime";var P=Oa(({children:e,...t},o)=>{let r=za(),i=Ha(),{Link:n}=Va();return Ua(r==="legacy"?n:i,{ref:o,...t,children:e})});P.displayName="Link";import*as Z from"react";import{jsx as Y}from"react/jsx-runtime";var gt=Z.forwardRef(({className:e,...t},o)=>Y("div",{className:"relative w-full overflow-auto",children:Y("table",{ref:o,className:a("w-full caption-bottom text-sm",e),...t})}));gt.displayName="Table";var bt=Z.forwardRef(({className:e,...t},o)=>Y("thead",{ref:o,className:a("[&_tr]:border-b border-border",e),...t}));bt.displayName="TableHeader";var ht=Z.forwardRef(({className:e,...t},o)=>Y("tbody",{ref:o,className:a("[&_tr:last-child]:border-0",e),...t}));ht.displayName="TableBody";var ur=Z.forwardRef(({className:e,...t},o)=>Y("tfoot",{ref:o,className:a("bg-primary font-medium text-primary-foreground",e),...t}));ur.displayName="TableFooter";var Ee=Z.forwardRef(({className:e,...t},o)=>Y("tr",{ref:o,className:a("border-b border-border transition-colors hover:bg-muted/50 data-[state=selected]:bg-muted",e),...t}));Ee.displayName="TableRow";var yt=Z.forwardRef(({className:e,...t},o)=>Y("th",{ref:o,className:a("h-10 [&:has([role=checkbox])]:leading-[0] px-2 text-left align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0 [&:has([role=checkbox])]:pl-4 [&>[role=checkbox]]:translate-y-[2px]",e),...t}));yt.displayName="TableHead";var $e=Z.forwardRef(({className:e,...t},o)=>Y("td",{ref:o,className:a("p-2 [&:has([role=checkbox])]:leading-[0] align-middle [&:has([role=checkbox])]:pr-0 [&:has([role=checkbox])]:pl-4 [&>[role=checkbox]]:translate-y-[2px]",e),...t}));$e.displayName="TableCell";var fr=Z.forwardRef(({className:e,...t},o)=>Y("caption",{ref:o,className:a("mt-4 text-sm text-muted-foreground",e),...t}));fr.displayName="TableCaption";import*as Qe from"react";import*as x from"@radix-ui/react-dialog";import{Cross2Icon as _a}from"@radix-ui/react-icons";import{jsx as le,jsxs as eo}from"react/jsx-runtime";var qe=x.Root,Wa=x.Trigger,vr=x.Portal,to=x.Close,oo=Qe.forwardRef(({className:e,...t},o)=>le(x.Overlay,{ref:o,className:a("fixed inset-0 z-50 bg-background/80 backdrop-blur-sm data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...t}));oo.displayName=x.Overlay.displayName;var Fe=Qe.forwardRef(({className:e,children:t,...o},r)=>eo(vr,{children:[le(oo,{}),eo(x.Content,{ref:r,className:a("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border border-border text-card-foreground bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg md:w-full",e),...o,children:[t,eo(x.Close,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground",children:[le(_a,{className:"h-4 w-4"}),le("span",{className:"sr-only",children:"Close"})]})]})]}));Fe.displayName=x.Content.displayName;var xt=({className:e,...t})=>le("div",{className:a("flex flex-col space-y-1.5 text-center sm:text-left",e),...t});xt.displayName="DialogHeader";var Rt=({className:e,...t})=>le("div",{className:a("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});Rt.displayName="DialogFooter";var Ct=Qe.forwardRef(({className:e,...t},o)=>le(x.Title,{ref:o,className:a("text-lg font-semibold leading-none tracking-tight",e),...t}));Ct.displayName=x.Title.displayName;var Tt=Qe.forwardRef(({className:e,...t},o)=>le(x.Description,{ref:o,className:a("text-sm text-muted-foreground",e),...t}));Tt.displayName=x.Description.displayName;import*as S from"react";import{Slot as qa}from"@radix-ui/react-slot";import{Controller as Ya,FormProvider as Za,useFormContext as Xa}from"react-hook-form";import*as gr from"react";import*as ro from"@radix-ui/react-label";import{cva as Ga}from"class-variance-authority";import{jsx as Qa}from"react/jsx-runtime";var $a=Ga("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),Pt=gr.forwardRef(({className:e,...t},o)=>Qa(ro.Root,{ref:o,className:a($a(),e),...t}));Pt.displayName=ro.Root.displayName;import{jsx as me}from"react/jsx-runtime";var ao=Za,br=S.createContext({}),io=({...e})=>me(br.Provider,{value:{name:e.name},children:me(Ya,{...e})}),Ye=()=>{let e=S.useContext(br),t=S.useContext(hr),{getFieldState:o,formState:r}=Xa(),i=o(e.name,r);if(!e)throw new Error("useFormField should be used within <FormField>");let{id:n}=t;return{id:n,name:e.name,formItemId:`${n}-form-item`,formDescriptionId:`${n}-form-item-description`,formMessageId:`${n}-form-item-message`,...i}},hr=S.createContext({}),wt=S.forwardRef(({className:e,...t},o)=>{let r=S.useId();return me(hr.Provider,{value:{id:r},children:me("div",{ref:o,className:a("space-y-2",e),...t})})});wt.displayName="FormItem";var Nt=S.forwardRef(({className:e,...t},o)=>{let{error:r,formItemId:i}=Ye();return me(Pt,{ref:o,className:a(r&&"text-destructive",e),htmlFor:i,...t})});Nt.displayName="FormLabel";var de=S.forwardRef(({...e},t)=>{let{error:o,formItemId:r,formDescriptionId:i,formMessageId:n}=Ye();return me(qa,{ref:t,id:r,"aria-describedby":o?`${i} ${n}`:`${i}`,"aria-invalid":!!o,...e})});de.displayName="FormControl";var Dt=S.forwardRef(({className:e,...t},o)=>{let{formDescriptionId:r}=Ye();return me("p",{ref:o,id:r,className:a("text-[0.8rem] text-muted-foreground",e),...t})});Dt.displayName="FormDescription";var St=S.forwardRef(({className:e,children:t,...o},r)=>{let{error:i,formMessageId:n}=Ye(),s=i?String(i?.message):t;return s?me("p",{ref:r,id:n,className:a("text-[0.8rem] font-medium text-destructive",e),...o,children:s}):null});St.displayName="FormMessage";import*as yr from"react";import{jsx as Ka}from"react/jsx-runtime";var Mt=yr.forwardRef(({className:e,type:t,...o},r)=>Ka("input",{type:t,className:a("flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-sm shadow-sm transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50",e),ref:r,...o}));Mt.displayName="Input";import*as xr from"react";import*as Ze from"@radix-ui/react-checkbox";import{CheckIcon as Ja}from"lucide-react";import{DividerHorizontalIcon as ja}from"@radix-ui/react-icons";import{jsx as no,jsxs as ei}from"react/jsx-runtime";var kt=xr.forwardRef(({className:e,...t},o)=>no(Ze.Root,{ref:o,className:a("peer relative h-4 w-4 shrink-0 rounded-sm border border-primary shadow focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground",e),...t,children:ei(Ze.Indicator,{className:a("flex items-center justify-center text-current absolute top-0 left-0 right-0 bottom-0"),children:[t.checked==="indeterminate"&&no(ja,{}),t.checked===!0&&no(Ja,{className:"h-4 w-4"})]})}));kt.displayName=Ze.Root.displayName;import{cva as ti}from"class-variance-authority";import{jsx as oi}from"react/jsx-runtime";var Rr=ti("inline-flex items-center rounded-md border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground shadow hover:bg-primary/80",secondary:"border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80",destructive:"border-transparent bg-destructive text-destructive-foreground shadow hover:bg-destructive/80",outline:"text-foreground"}},defaultVariants:{variant:"default"}});function ye({className:e,variant:t,...o}){return oi("div",{className:a(Rr({variant:t}),e),...o})}import*as L from"react";import{MagnifyingGlassIcon as ri}from"@radix-ui/react-icons";import{Command as M}from"cmdk";import{jsx as A,jsxs as ii}from"react/jsx-runtime";var X=L.forwardRef(({className:e,...t},o)=>A(M,{ref:o,className:a("flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground",e),...t}));X.displayName=M.displayName;var ai=({children:e,...t})=>A(qe,{...t,children:A(Fe,{className:"overflow-hidden p-0",children:A(X,{className:"[&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground [&_[cmdk-group]:not([hidden])_~[cmdk-group]]:pt-0 [&_[cmdk-group]]:px-2 [&_[cmdk-input-wrapper]_svg]:h-5 [&_[cmdk-input-wrapper]_svg]:w-5 [&_[cmdk-input]]:h-12 [&_[cmdk-item]]:px-2 [&_[cmdk-item]]:py-3 [&_[cmdk-item]_svg]:h-5 [&_[cmdk-item]_svg]:w-5",children:e})})}),Be=L.forwardRef(({className:e,...t},o)=>{let r=L.useRef(null);return L.useEffect(()=>{r.current&&r.current.setAttribute("cmdk-input-wrapper","")},[r]),ii("div",{className:"flex items-center border-border border-b px-3",ref:r,children:[A(ri,{className:"mr-2 h-4 w-4 shrink-0 opacity-50"}),A(M.Input,{ref:o,className:a("flex h-10 w-full rounded-md bg-transparent py-3 text-sm outline-none placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50",e),...t})]})});Be.displayName=M.Input.displayName;var Et=L.forwardRef(({className:e,...t},o)=>A(M.List,{ref:o,className:a("max-h-[300px] overflow-y-auto overflow-x-hidden",e),...t}));Et.displayName=M.List.displayName;var ce=L.forwardRef((e,t)=>A(M.Empty,{ref:t,className:"py-6 text-center text-sm",...e}));ce.displayName=M.Empty.displayName;var K=L.forwardRef(({className:e,...t},o)=>A(M.Group,{ref:o,className:a("overflow-hidden p-1 text-foreground [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground",e),...t}));K.displayName=M.Group.displayName;var Ft=L.forwardRef(({className:e,...t},o)=>A(M.Separator,{ref:o,className:a("-mx-1 h-px bg-border",e),...t}));Ft.displayName=M.Separator.displayName;var xe=L.forwardRef(({className:e,...t},o)=>A(M.Item,{ref:o,className:a("relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none aria-selected:bg-accent aria-selected:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...t}));xe.displayName=M.Item.displayName;var Cr=({className:e,...t})=>A("span",{className:a("ml-auto text-xs tracking-widest text-muted-foreground",e),...t});Cr.displayName="CommandShortcut";import*as Tr from"react";import*as so from"@radix-ui/react-separator";import{jsx as ni}from"react/jsx-runtime";var J=Tr.forwardRef(({className:e,orientation:t="horizontal",decorative:o=!0,...r},i)=>ni(so.Root,{ref:i,decorative:o,orientation:t,className:a("shrink-0 bg-border",t==="horizontal"?"h-[1px] w-full":"h-full w-[1px]",e),...r}));J.displayName=so.Root.displayName;import*as wr from"react";import*as j from"@radix-ui/react-popover";import{jsx as Pr}from"react/jsx-runtime";var O=j.Root,U=j.Trigger,I=wr.forwardRef(({className:e,align:t="center",sideOffset:o=4,...r},i)=>Pr(j.Portal,{children:Pr(j.Content,{ref:i,align:t,sideOffset:o,className:a("z-50 w-72 rounded-md border border-border bg-popover p-4 text-popover-foreground shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...r})}));I.displayName=j.Content.displayName;import{ChevronLeftIcon as si,ChevronRightIcon as li}from"@radix-ui/react-icons";import{DayPicker as mi}from"react-day-picker";import{jsx as lo}from"react/jsx-runtime";function Bt({className:e,classNames:t,showOutsideDays:o=!0,...r}){return lo(mi,{showOutsideDays:o,className:a("p-3",e),classNames:{months:"flex flex-col sm:flex-row space-y-4 sm:space-x-4 sm:space-y-0",month:"space-y-4",caption:"flex justify-center pt-1 relative items-center",caption_label:"text-sm font-medium",nav:"space-x-1 flex items-center",nav_button:a(_e({variant:"outline"}),"h-7 w-7 bg-transparent p-0 opacity-50 hover:opacity-100"),nav_button_previous:"absolute left-1",nav_button_next:"absolute right-1",table:"w-full border-collapse space-y-1",head_row:"flex",head_cell:"text-muted-foreground rounded-md w-8 font-normal text-[0.8rem]",row:"flex w-full mt-2",cell:a("relative p-0 text-center text-sm focus-within:relative focus-within:z-20 [&:has([aria-selected])]:bg-accent",r.mode==="range"?"[&:has(>.day-range-end)]:rounded-r-md [&:has(>.day-range-start)]:rounded-l-md first:[&:has([aria-selected])]:rounded-l-md last:[&:has([aria-selected])]:rounded-r-md":"[&:has([aria-selected])]:rounded-md"),day:a(_e({variant:"ghost"}),"h-8 w-8 p-0 font-normal aria-selected:opacity-100"),day_range_start:"day-range-start",day_range_end:"day-range-end",day_selected:"bg-primary text-primary-foreground hover:bg-primary hover:text-primary-foreground focus:bg-primary focus:text-primary-foreground",day_today:"bg-accent text-accent-foreground",day_outside:"text-muted-foreground opacity-50",day_disabled:"text-muted-foreground opacity-50",day_range_middle:"aria-selected:bg-accent aria-selected:text-accent-foreground",day_hidden:"invisible",...t},components:{IconLeft:()=>lo(si,{className:"h-4 w-4"}),IconRight:()=>lo(li,{className:"h-4 w-4"})},...r})}Bt.displayName="Calendar";import*as Nr from"react";import{jsx as di}from"react/jsx-runtime";var Dr=Nr.forwardRef(({className:e,...t},o)=>di("textarea",{className:a("flex min-h-[60px] w-full rounded-md border border-input bg-transparent px-3 py-2 text-sm shadow-sm placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50",e),ref:o,...t}));Dr.displayName="Textarea";import*as H from"@radix-ui/react-scroll-area";import*as mo from"react";import{jsx as Xe,jsxs as ci}from"react/jsx-runtime";var At=mo.forwardRef(({className:e,children:t,...o},r)=>ci(H.Root,{ref:r,className:a("relative overflow-hidden",e),...o,children:[Xe(H.Viewport,{className:"h-full w-full rounded-[inherit]",children:t}),Xe(co,{}),Xe(H.Corner,{})]}));At.displayName=H.Root.displayName;var co=mo.forwardRef(({className:e,orientation:t="vertical",...o},r)=>Xe(H.ScrollAreaScrollbar,{ref:r,orientation:t,className:a("flex touch-none select-none transition-colors",t==="vertical"&&"h-full w-2.5 border-l border-l-transparent p-[1px]",t==="horizontal"&&"h-2.5 flex-col border-t border-t-transparent p-[1px]",e),...o,children:Xe(H.ScrollAreaThumb,{className:a("relative rounded-full bg-border",t==="vertical"&&"flex-1")})}));co.displayName=H.ScrollAreaScrollbar.displayName;import*as Ae from"react";import{CaretSortIcon as pi,CheckIcon as ui}from"@radix-ui/react-icons";import*as f from"@radix-ui/react-select";import{jsx as _,jsxs as kr}from"react/jsx-runtime";var Ke=f.Root,fi=f.Group,Je=f.Value,Le=Ae.forwardRef(({className:e,children:t,...o},r)=>kr(f.Trigger,{ref:r,className:a("flex h-9 w-full items-center justify-between rounded-md border border-input bg-transparent px-3 py-2 text-sm shadow-sm placeholder:text-muted-foreground focus:outline-none disabled:cursor-not-allowed disabled:opacity-50",e),...o,children:[t,_(f.Icon,{asChild:!0,children:_(pi,{className:"h-4 w-4 opacity-50"})})]}));Le.displayName=f.Trigger.displayName;var Ie=Ae.forwardRef(({className:e,children:t,position:o="popper",...r},i)=>_(f.Portal,{children:_(f.Content,{ref:i,className:a("relative z-50 min-w-[8rem] overflow-hidden rounded-md border border-border bg-popover text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",o==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",e),position:o,...r,children:_(f.Viewport,{className:a("p-1",o==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:t})})}));Ie.displayName=f.Content.displayName;var Sr=Ae.forwardRef(({className:e,...t},o)=>_(f.Label,{ref:o,className:a("px-2 py-1.5 text-sm font-semibold",e),...t}));Sr.displayName=f.Label.displayName;var He=Ae.forwardRef(({className:e,children:t,...o},r)=>kr(f.Item,{ref:r,className:a("relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-2 pr-8 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...o,children:[_("span",{className:"absolute right-2 flex h-3.5 w-3.5 items-center justify-center",children:_(f.ItemIndicator,{children:_(ui,{className:"h-4 w-4"})})}),_(f.ItemText,{children:t})]}));He.displayName=f.Item.displayName;var Mr=Ae.forwardRef(({className:e,...t},o)=>_(f.Separator,{ref:o,className:a("-mx-1 my-1 h-px bg-muted",e),...t}));Mr.displayName=f.Separator.displayName;import{jsx as $,jsxs as po}from"react/jsx-runtime";var pe=({showHome:e=!0,hideIcons:t=!1,meta:o})=>{let{breadcrumbs:r}=gi({meta:o}),{hasDashboard:i}=bi(),{resources:n}=hi(),s=vi("/",n),l=()=>t?null:$("svg",{className:"h-5 w-5 flex-shrink-0 text-gray-400",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",children:$("path",{fillRule:"evenodd",d:"M7.21 14.77a.75.75 0 01.02-1.06L11.168 10 7.23 6.29a.75.75 0 111.04-1.08l4.5 4.25a.75.75 0 010 1.08l-4.5 4.25a.75.75 0 01-1.06-.02z",clipRule:"evenodd"})}),m=r.map(({label:d,href:u},v)=>$("li",{children:po("div",{className:"flex items-center",children:[l(),u?$(P,{to:u,title:d,className:"ml-4 text-sm font-medium",children:d}):$("span",{className:"ml-4",children:d})]})},v));return $("nav",{className:"flex","aria-label":"Breadcrumb",children:po("ol",{role:"list",className:"flex items-center space-x-4",children:[e||i||s.found?$("li",{children:$("div",{children:po(P,{to:"/",title:"Home",children:[s?.resource?.meta?.icon??$(yi,{size:16}),$("span",{className:"sr-only",children:"Home"})]})})}):null,m]})})};import{useRefineContext as xi,useResource as Ri,useTranslate as Ci,useUserFriendlyName as Ti}from"@refinedev/core";import{Fragment as uo,jsx as Ve,jsxs as wi}from"react/jsx-runtime";var Pi=({title:e,resource:t,breadcrumb:o,extra:r,children:i})=>{let n=Ci(),{options:{breadcrumb:s}={}}=xi(),l=Ti(),{resource:m,identifier:d}=Ri(t),u=typeof o>"u"?s:o;return wi(uo,{children:[Ve(ue,{title:e??n(`${d}.titles.List`,`Create ${l(m?.meta?.label??m?.options?.label??m?.label??d,"singular")}`),isBack:!0,breadcrumb:typeof u<"u"?Ve(uo,{children:u})??void 0:Ve(pe,{}),extra:r??Ve(uo,{children:Ve(fo,{resource:t})})}),Ve("div",{className:"relative pt-4 !mt-0",children:i})]})};import{useRefineContext as Rn,useResource as Cn,useTranslate as Tn,useUserFriendlyName as Pn}from"@refinedev/core";var zr={};mt(zr,{DeleteContext:()=>Oe,DeleteProvider:()=>Ce,ViteDarkModeProvider:()=>en,notificationProvider:()=>Vr,useNotificationProvider:()=>xn});import{createContext as pn,useState as un}from"react";import{useTranslate as nn}from"@refinedev/core";import{AlertTriangleIcon as sn,Trash2 as ln}from"lucide-react";import{useCallback as mn,useContext as dn}from"react";import{DotsHorizontalIcon as Ni}from"@radix-ui/react-icons";import{Fragment as Di,jsx as Re,jsxs as Lt}from"react/jsx-runtime";var fe=e=>Re(ne,{disabled:e.disabled,asChild:!(!e.to||!e.to&&!e.children),onClick:e.onClick,children:e.asChild?e.children:e.to?Lt(P,{disabled:e.disabled,replace:!1,to:e.to,title:e.title,children:[e.icon?Re("span",{className:"mr-2",children:e.icon}):null,e.title]}):Lt(Di,{children:[e.icon?Re("span",{className:"mr-2",children:e.icon}):null,e.title]})});function Fr({children:e}){return Lt(be,{children:[Re(We,{asChild:!0,children:Lt(c,{variant:"ghost",className:"flex h-8 w-8 p-0 data-[state=open]:bg-muted",children:[Re(Ni,{className:"h-4 w-4"}),Re("span",{className:"sr-only",children:"Open menu"})]})}),Re(ie,{align:"end",className:"w-[160px]",children:e})]})}var Ar={};mt(Ar,{useDarkMode:()=>ho,useDeleteHelper:()=>ze,useGetEditUrl:()=>vo,useGetShowUrl:()=>go,useOnBack:()=>bo});import{AccessControlContext as Si,useCan as Mi,useNavigation as ki,useResource as Ei,useTranslate as Fi}from"@refinedev/core";import{useContext as Bi}from"react";var vo=(e,t,o)=>{let r=Bi(Si),i=r.options.buttons.enableAccessControl,n=r.options.buttons.hideIfUnauthorized,{editUrl:s}=ki(),{id:l,resource:m}=Ei(e),{data:d}=Mi({resource:e,action:"edit",params:{id:t,resource:m},queryOptions:{enabled:i}}),u=Fi(),v=()=>d?.can?"":d?.reason?d.reason:u("buttons.notAccessTitle","You don't have permission to access"),R=e&&(t??l)?s(e,t??l,o):"";return{can:!(i&&n&&!d?.can),reason:v(),url:R}};import{AccessControlContext as Ai,useCan as Li,useNavigation as Ii,useResource as Hi,useTranslate as Vi}from"@refinedev/core";import{useContext as zi}from"react";var go=(e,t,o)=>{let r=zi(Ai),i=r.options.buttons.enableAccessControl,n=r.options.buttons.hideIfUnauthorized,{showUrl:s}=Ii(),{id:l,resource:m}=Hi(e),{data:d}=Li({resource:e,action:"show",params:{id:t,resource:m},queryOptions:{enabled:i}}),u=Vi(),v=()=>d?.can?"":d?.reason?d.reason:u("buttons.notAccessTitle","You don't have permission to access"),R=e&&(t||l)?s(e,t??l,o):"";return{can:!(i&&n&&!d?.can),reason:v(),url:R}};import{AccessControlContext as Oi,pickNotDeprecated as Br,useCan as Ui,useDelete as _i,useMutationMode as Wi,useResource as Gi,useTranslate as $i,useWarnAboutChange as Qi}from"@refinedev/core";import{useContext as qi}from"react";var ze=(e,t,o)=>{let r=qi(Oi),i=r.options.buttons.enableAccessControl,n=r.options.buttons.hideIfUnauthorized,s=$i(),{id:l,resource:m,identifier:d}=Gi(e),{mutationMode:u}=Wi(),{mutate:v,isLoading:R}=_i(),{data:g}=Ui({resource:m?.name,action:"delete",params:{id:t??l,resource:m},queryOptions:{enabled:i}}),h=()=>g?.can?"":g?.reason?g.reason:s("buttons.notAccessTitle","You don't have permission to access"),{setWarnWhen:w}=Qi(),b=N=>{if(!(i&&n&&!g?.can)&&(t??l)&&d)return w(!1),v({id:t??l??"",resource:d,mutationMode:u,meta:Br(o),metaData:Br(o)},N)};return{can:!(i&&n&&!g?.can),reason:h(),mutate:b,isLoading:R}};import{useBack as Yi,useNavigation as Zi,useResource as Xi,useRouterType as Ki}from"@refinedev/core";var bo=()=>{let e=Ki(),t=Yi(),{goBack:o}=Zi(),{action:r}=Xi();return r!=="list"||typeof r<"u"?e==="legacy"?o:t:void 0};import{createContext as on}from"react";import{useEffect as Ji,useState as ji}from"react";import{jsx as tn}from"react/jsx-runtime";function en({children:e,defaultDarkMode:t="system",storageKey:o="vite-ui-theme",...r}){let[i,n]=ji(()=>localStorage.getItem(o)||t);Ji(()=>{let l=window.document.documentElement,m=window.matchMedia("(prefers-color-scheme: dark)");(()=>{if(l.classList.remove("light","dark"),i==="system"){let v=m.matches?"dark":"light";l.classList.add(v);return}l.classList.add(i)})();let u=v=>{if(i==="system"&&(l.classList.remove("light","dark"),v.matches)){let R=v.matches?"dark":"light";l.classList.add(R)}};return m.addEventListener("change",u),()=>m.removeEventListener("change",u)},[i]);let s={theme:i,setDarkMode:l=>{localStorage.setItem(o,l),n(l)}};return tn(It.Provider,{...r,value:s,children:e})}var rn={theme:"system",setDarkMode:()=>null},It=on(rn);import{useContext as an}from"react";var ho=()=>{let e=an(It);if(e===void 0)throw new Error("useDarkMode must be used within a DarkModeProvider");return e};import{ReloadIcon as cn}from"@radix-ui/react-icons";import{jsx as ee,jsxs as je}from"react/jsx-runtime";function Lr(e){let t=bo(),{can:o,isLoading:r,mutate:i}=ze(e.data?.resource,e.data?.row?.id),n=nn(),s=mn(()=>{if(o)return i({onSuccess(){let l=e?.data?.redirectBack??!1;e?.updateData({toogle:!1,row:void 0,resource:"",redirectBack:!1}),l&&t?.()}})},[i,o]);return ee(qe,{open:o&&e?.data?.toogle,onOpenChange:()=>{r||e?.updateData({toogle:!1,row:void 0,resource:""})},children:je(Fe,{onPointerDownOutside:l=>l.preventDefault(),children:[je(xt,{children:[je(Ct,{className:"inline-flex flex-row items-center gap-x-2",children:[ee(sn,{}),n("actions.delete.title","Are you sure absolutely sure?")]}),ee(Tt,{children:n("actions.delete.title","If this action can be undone later, this data will be temporarily deleted.")})]}),ee(Rt,{className:"sm:justify-end",children:je("div",{className:"flex flex-col sm:flex-row gap-x-3",children:[ee(to,{asChild:!0,children:ee(c,{disabled:r,type:"button",variant:"secondary",children:"Cancel"})}),je(c,{type:"button",variant:"destructive",onClick:s,disabled:r,children:[r?ee(cn,{className:"mr-2 h-4 w-4 animate-spin"}):ee(ln,{size:16,className:"mr-2"}),"Delete"]})]})})]})})}function yo({row:e,resource:t,title:o,disabled:r,withForceDelete:i,...n}){let{can:s,reason:l}=ze(t,e.id),m=dn(Oe);return ee(fe,{...n,disabled:!s,title:s?o:l,onClick:()=>m?.updateData({row:e,resource:t,toogle:!0})})}yo.displayName="DeleteAction";import{jsx as fn,jsxs as vn}from"react/jsx-runtime";var Oe=pn(void 0),Ce=({children:e})=>{let[t,o]=un({row:void 0,resource:"",toogle:!1}),r=i=>{o(i)};return vn(Oe.Provider,{value:{data:t,updateData:r},children:[e,fn(Lr,{data:t,updateData:r})]})};import*as Ot from"react";var gn=5,bn=3e3;var xo=0;function hn(){return xo=(xo+1)%Number.MAX_VALUE,xo.toString()}var Ro=new Map,Ir=e=>{if(Ro.has(e))return;let t=setTimeout(()=>{Ro.delete(e),et({type:"REMOVE_TOAST",toastId:e})},bn);Ro.set(e,t)},yn=(e,t)=>{switch(t.type){case"ADD_TOAST":return{...e,toasts:[t.toast,...e.toasts].slice(0,gn)};case"UPDATE_TOAST":return{...e,toasts:e.toasts.map(o=>o.id===t.toast.id?{...o,...t.toast}:o)};case"DISMISS_TOAST":{let{toastId:o}=t;return o?Ir(o):e.toasts.forEach(r=>{Ir(r.id)}),{...e,toasts:e.toasts.map(r=>r.id===o||o===void 0?{...r,open:!1}:r)}}case"REMOVE_TOAST":return t.toastId===void 0?{...e,toasts:[]}:{...e,toasts:e.toasts.filter(o=>o.id!==t.toastId)}}},Ht=[],Vt={toasts:[]};function et(e){Vt=yn(Vt,e),Ht.forEach(t=>{t(Vt)})}var zt=e=>et({type:"DISMISS_TOAST",toastId:e});function Co({...e}){let t=e.id+"_"+hn(),o=r=>et({type:"UPDATE_TOAST",toast:{...r,id:t}});return et({type:"ADD_TOAST",toast:{...e,id:t,open:!0,onOpenChange:r=>{r||zt(t)}}}),{id:t,dismiss:zt,update:o}}function Hr(){let[e,t]=Ot.useState(Vt);return Ot.useEffect(()=>(Ht.push(t),()=>{let o=Ht.indexOf(t);o>-1&&Ht.splice(o,1)}),[e]),{...e,toast:Co,dismiss:o=>et({type:"DISMISS_TOAST",toastId:o})}}var Vr={open:({key:e,message:t,description:o,type:r})=>Co({id:e,description:o,title:t,variant:r==="error"?"destructive":"default"}),close:e=>zt(e)},xn=()=>Vr;import{Fragment as Nn,jsx as Ue,jsxs as Or}from"react/jsx-runtime";var wn=({title:e,resource:t,extra:o,breadcrumb:r,children:i})=>{let n=Tn(),{options:{breadcrumb:s}={}}=Rn(),l=Pn(),{resource:m,action:d,identifier:u}=Cn(t),v=typeof r>"u"?s:r;return Or(Ce,{children:[Ue(ue,{title:e??n(`${u}.titles.List`,`Edit ${l(m?.meta?.label??m?.options?.label??m?.label??u,"plural")}`),isBack:!0,breadcrumb:typeof v<"u"?Ue(Nn,{children:v})??void 0:Ue(pe,{}),extra:o??Or("div",{className:"inline-flex flex-row items-center gap-x-2",children:[Ue(To,{resource:t}),Ue(tt,{resource:t})]})}),Ue("div",{className:"relative pt-4",children:i})]})};import{useRefineContext as Mn,useResource as kn,useTranslate as En,useUserFriendlyName as Fn}from"@refinedev/core";import{Fragment as Sn,jsx as Ut,jsxs as Dn}from"react/jsx-runtime";var Ur=({title:e,content:t})=>Ut(Sn,{children:Ut("dl",{className:"flex flex-wrap",children:Dn("div",{className:"flex-auto pl-6 pt-6",children:[Ut("dt",{className:"scroll-m-20 text-lg font-semibold tracking-tight",children:e}),Ut("dd",{className:"mt-1 text-base font-normal text-foreground leading-7",children:t})]})})});import{Fragment as Bn,jsx as ve,jsxs as _r}from"react/jsx-runtime";var Wr=({title:e,resource:t,breadcrumb:o,extra:r,children:i})=>{let n=En(),{options:{breadcrumb:s}={}}=Mn(),l=Fn(),{resource:m,identifier:d}=kn(t),u=typeof o>"u"?s:o;return _r(Ce,{children:[ve(ue,{title:e??n(`${d}.titles.List`,`Show ${l(m?.meta?.label??m?.options?.label??m?.label??d,"singular")}`),breadcrumb:typeof u<"u"?ve(Bn,{children:u})??void 0:ve(pe,{}),isBack:!0,extra:r??_r("div",{className:"inline-flex items-center gap-x-2",children:[ve(Po,{resource:t}),ve(tt,{resource:t})]})}),ve("div",{className:"relative pt-4 !mt-0",children:ve(Se,{children:ve(Me,{children:i})})})]})};Wr.Row=Ur;import{useRefineContext as An,useResource as Ln,useTranslate as In,useUserFriendlyName as Hn}from"@refinedev/core";import{Fragment as wo,jsx as ge,jsxs as zn}from"react/jsx-runtime";var Vn=({title:e,resource:t,breadcrumb:o,createButtonProps:r,extra:i,children:n})=>{let s=In(),{options:{breadcrumb:l}={}}=An(),m=Hn(),{resource:d,identifier:u}=Ln(t),v=typeof o>"u"?l:o;return zn(wo,{children:[ge(ue,{title:e??s(`${u}.titles.List`,`List ${m(d?.meta?.label??d?.options?.label??d?.label??u,"plural")}`),breadcrumb:typeof v<"u"?ge(wo,{children:v})??void 0:ge(pe,{}),extra:i??ge(wo,{children:ge("div",{className:"inline-flex flex-row gap-4",children:ge(No,{...r,resource:r?.resource??u})})})}),ge(Ce,{children:ge("div",{className:"relative pt-2 sm:pt-4 !mt-0",children:n})})]})};import{AccessControlContext as On,useCan as Un,useNavigation as _n,useResource as Wn,useTranslate as Gn}from"@refinedev/core";import{useContext as $n}from"react";import{RefineButtonClassNames as Qn,RefineButtonTestIds as qn}from"@refinedev/ui-types";import{PlusSquare as Yn}from"lucide-react";import{jsx as Gr,jsxs as Zn}from"react/jsx-runtime";var No=({resource:e,resourceNameOrRouteName:t,hideText:o=!1,accessControl:r,meta:i,children:n,onClick:s,...l})=>{let m=$n(On),d=r?.enabled??m.options.buttons.enableAccessControl,u=r?.hideIfUnauthorized??m.options.buttons.hideIfUnauthorized,v=Gn(),{createUrl:R}=_n(),{resource:g}=Wn(e??t),{data:h}=Un({resource:g?.name,action:"create",queryOptions:{enabled:d},params:{resource:g}}),w=()=>h?.can?"":h?.reason?h.reason:v("buttons.notAccessTitle","You don't have permission to access"),b=g?R(g,i):"";return d&&u&&!h?.can?null:Gr(c,{asChild:!0,disabled:h?.can===!1,"data-testid":qn.CreateButton,className:Qn.CreateButton,...l,children:Zn(P,{onClick:N=>{if(h?.can===!1){N.preventDefault();return}s&&(N.preventDefault(),s(N))},to:b,replace:!1,title:w(),children:[Gr(Yn,{className:a(o?"":"mr-2"),size:16}),!o&&(n??v("buttons.create","Create"))]})})};import{AccessControlContext as Xn,useCan as Kn,useNavigation as Jn,useResource as jn,useTranslate as es}from"@refinedev/core";import{RefineButtonClassNames as ts,RefineButtonTestIds as os}from"@refinedev/ui-types";import{useContext as rs}from"react";import{Edit as as}from"lucide-react";import{jsx as $r,jsxs as is}from"react/jsx-runtime";var Po=({resource:e,resourceNameOrRouteName:t,recordItemId:o,hideText:r=!1,accessControl:i,meta:n,children:s,onClick:l,...m})=>{let d=rs(Xn),u=i?.enabled??d.options.buttons.enableAccessControl,v=i?.hideIfUnauthorized??d.options.buttons.hideIfUnauthorized,R=es(),{editUrl:g}=Jn(),{id:h,resource:w}=jn(e??t),{data:b}=Kn({resource:w?.name,action:"edit",params:{id:o??h,resource:w},queryOptions:{enabled:u}}),N=()=>b?.can?"":b?.reason?b.reason:R("buttons.notAccessTitle","You don't have permission to access"),ae=w&&(o??h)?g(w,o??h,n):"";return u&&v&&!b?.can?null:$r(c,{asChild:!0,disabled:b?.can===!1,title:N(),"data-testid":os.EditButton,className:ts.EditButton,size:r?"icon":m.size??"default",onClick:E=>{if(b?.can===!1){E.preventDefault();return}l&&(E.preventDefault(),l(E))},...m,children:is(P,{to:ae,replace:!1,children:[$r(as,{className:a(r?"":"mr-2"),size:16}),!r&&(s??R("buttons.edit","Edit"))]})})};import{AccessControlContext as ns,useTranslate as ss}from"@refinedev/core";import{RefineButtonClassNames as ls,RefineButtonTestIds as ms}from"@refinedev/ui-types";import{useContext as Qr}from"react";import{Trash2 as ds}from"lucide-react";import{jsx as cs,jsxs as ps}from"react/jsx-runtime";var tt=({resource:e,resourceNameOrRouteName:t,recordItemId:o,onSuccess:r,mutationMode:i,children:n,successNotification:s,errorNotification:l,hideText:m=!1,accessControl:d,metaData:u,meta:v,dataProviderName:R,confirmTitle:g,confirmOkText:h,confirmCancelText:w,invalidates:b,...N})=>{let ae=Qr(ns),E=d?.enabled??ae.options.buttons.enableAccessControl,ga=d?.hideIfUnauthorized??ae.options.buttons.hideIfUnauthorized,ba=ss(),{can:Zo,reason:ha}=ze(e,o),ya=Qr(Oe);return E&&ga&&Zo?null:ps(c,{title:ha,disabled:Zo===!1,"data-testid":ms.DeleteButton,variant:"destructive",className:ls.DeleteButton,size:m?"icon":N.size??"default",onClick:()=>{ya?.updateData({toogle:!0,row:{id:o},redirectBack:!0,resource:e})},...N,children:[cs(ds,{className:a(m?"":"mr-2"),size:16}),!m&&(n??ba("buttons.delete","Delete"))]})};import{AccessControlContext as us,useCan as fs,useNavigation as vs,useResource as gs,useTranslate as bs}from"@refinedev/core";import{RefineButtonClassNames as hs,RefineButtonTestIds as ys}from"@refinedev/ui-types";import{useContext as xs}from"react";import{EyeIcon as Rs}from"lucide-react";import{jsx as qr,jsxs as Cs}from"react/jsx-runtime";var To=({resource:e,resourceNameOrRouteName:t,recordItemId:o,hideText:r=!1,accessControl:i,meta:n,children:s,onClick:l,...m})=>{let d=xs(us),u=i?.enabled??d.options.buttons.enableAccessControl,v=i?.hideIfUnauthorized??d.options.buttons.hideIfUnauthorized,{showUrl:R}=vs(),g=bs(),{id:h,resource:w}=gs(e??t),{data:b}=fs({resource:w?.name,action:"show",params:{id:o??h,resource:w},queryOptions:{enabled:u}}),N=()=>b?.can?"":b?.reason?b.reason:g("buttons.notAccessTitle","You don't have permission to access"),ae=w&&(o||h)?R(w,o??h,n):"";return u&&v&&!b?.can?null:qr(c,{asChild:!0,disabled:b?.can===!1,title:N(),"data-testid":ys.ShowButton,className:hs.ShowButton,...m,children:Cs(P,{to:ae,replace:!1,onClick:E=>{if(b?.can===!1){E.preventDefault();return}l&&(E.preventDefault(),l(E))},children:[qr(Rs,{size:16,className:"mr-2"}),!r&&(s??g("buttons.show","Show"))]})})};import{AccessControlContext as Ts,pickNotDeprecated as Ps,useCan as ws,useNavigation as Ns,useResource as Ds,useTranslate as Ss,useUserFriendlyName as Ms}from"@refinedev/core";import{RefineButtonClassNames as ks,RefineButtonTestIds as Es}from"@refinedev/ui-types";import{useContext as Fs}from"react";import{List as Bs}from"lucide-react";import{jsx as Yr,jsxs as As}from"react/jsx-runtime";var fo=({resource:e,resourceNameOrRouteName:t,hideText:o=!1,accessControl:r,meta:i,children:n,onClick:s,...l})=>{let m=Fs(Ts),d=r?.enabled??m.options.buttons.enableAccessControl,u=r?.hideIfUnauthorized??m.options.buttons.hideIfUnauthorized,{listUrl:v}=Ns(),R=Ss(),{resource:g,identifier:h}=Ds(e??t),w=Ms(),{data:b}=ws({resource:g?.name,action:"list",queryOptions:{enabled:d},params:{resource:g}}),N=()=>b?.can?"":b?.reason?b.reason:R("buttons.notAccessTitle","You don't have permission to access"),ae=g?v(g,i):"";return d&&u&&!b?.can?null:Yr(c,{disabled:b?.can===!1,asChild:!0,title:N(),"data-testid":Es.ListButton,className:ks.ListButton,...l,children:As(P,{to:ae,replace:!1,onClick:E=>{if(b?.can===!1){E.preventDefault();return}s&&(E.preventDefault(),s(E))},children:[Yr(Bs,{size:16,className:"mr-2"}),!o&&(n??R(`${h??e??t}.titles.list`,w(g?.meta?.label??g?.label??h??Ps(e,t),"plural")))]})})};import{useTranslate as Ls}from"@refinedev/core";import{RefineButtonClassNames as Is,RefineButtonTestIds as Hs}from"@refinedev/ui-types";import{Save as Vs}from"lucide-react";import{ReloadIcon as zs}from"@radix-ui/react-icons";import{jsx as Zr,jsxs as Os}from"react/jsx-runtime";var Do=({hideText:e=!1,children:t,loading:o,...r})=>{let i=Ls();return Os(c,{"data-testid":Hs.SaveButton,className:Is.SaveButton,size:e?"icon":r.size??"default",...r,children:[o?Zr(zs,{className:"mr-2 h-4 w-4 animate-spin"}):Zr(Vs,{className:"mr-2",size:16}),!e&&(t??i("buttons.save","Save"))]})};import{jsx as _t,jsxs as So}from"react/jsx-runtime";var ue=({extra:e,...t})=>So("div",{className:a("flex h-20 items-end lg:justify-between",t.className),children:[So("div",{className:"min-w-0 flex-1",children:[t.breadcrumb,_t("div",{className:"inline-flex flex-row items-center gap-x-4 mt-3",children:So("div",{className:"inline-flex flex-col",children:[_t("h2",{className:"text-2xl font-bold leading-7 text-black dark:text-white sm:truncate sm:text-3xl sm:tracking-tight",children:t.title}),t.subTitle&&_t("div",{className:"mt-2 flex items-center text-sm text-gray-300",children:t.subTitle})]})})]}),_t("div",{className:"flex lg:ml-4 lg:mt-0",children:e})]});import{useMemo as il}from"react";import{Moon as Us,Sun as _s}from"lucide-react";import{jsx as Te,jsxs as Mo}from"react/jsx-runtime";var Xr=()=>{let{setDarkMode:e}=ho();return Mo(be,{children:[Te(We,{asChild:!0,children:Mo(c,{variant:"outline",size:"icon",children:[Te(_s,{className:"h-[1.2rem] w-[1.2rem] rotate-0 scale-100 transition-all dark:-rotate-90 dark:scale-0"}),Te(Us,{className:"absolute h-[1.2rem] w-[1.2rem] rotate-90 scale-0 transition-all dark:rotate-0 dark:scale-100"}),Te("span",{className:"sr-only",children:"Toggle theme"})]})}),Mo(ie,{align:"end",children:[Te(ne,{onClick:()=>e("light"),children:"Light"}),Te(ne,{onClick:()=>e("dark"),children:"Dark"}),Te(ne,{onClick:()=>e("system"),children:"System"})]})]})};import{jsx as Gs,jsxs as $s}from"react/jsx-runtime";var Ws=({children:e,darkMode:t})=>$s("nav",{className:"flex flex-1 items-center justify-end gap-x-4 self-stretch lg:gap-x-6",children:[e,t&&Gs(Xr,{})]}),Kr=Ws;import{CanAccess as Qs,useMenu as qs}from"@refinedev/core";import{List as Ys}from"lucide-react";import{useMemo as Wt}from"react";import{jsx as k,jsxs as Gt}from"react/jsx-runtime";var Zs=({resource:e,selectedKey:t,asChild:o=!1,children:r})=>{let i=Wt(()=>e.key===t,[e,t]),n=Wt(()=>String(e.label??e.meta?.label),[e]),s=Wt(()=>String(e.route),[e]);return k(Qs,{resource:e.name.toString(),action:"list",params:{resource:e},children:k("li",{children:k(c,{variant:"ghost",size:"lg",asChild:!0,className:a(i?"bg-accent-foreground text-accent":"","gap-x-3 w-full justify-start p-0 pl-2.5"),children:Gt(P,{to:s,title:n,className:"inline-flex flex-row gap-x-2