@ferdiunal/refinedev-shadcn-ui
Version:
theme for refine.dev with shadcn-ui
1 lines • 91.7 kB
JavaScript
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { newObj[key] = obj[key]; } } } newObj.default = obj; return newObj; } } function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }var xa=Object.defineProperty;var mt=(e,t)=>{for(var o in t)xa(e,o,{get:t[o],enumerable:!0})};var _core = require('@refinedev/core');var _lucidereact = require('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});var _reactavatar = require('@radix-ui/react-avatar'); var Q = _interopRequireWildcard(_reactavatar);var _react = require('react'); var dt = _interopRequireWildcard(_react); var er = _interopRequireWildcard(_react); var q = _interopRequireWildcard(_react); var Ge = _interopRequireWildcard(_react); var he = _interopRequireWildcard(_react); var Z = _interopRequireWildcard(_react); var Qe = _interopRequireWildcard(_react); var S = _interopRequireWildcard(_react); var gr = _interopRequireWildcard(_react); var yr = _interopRequireWildcard(_react); var xr = _interopRequireWildcard(_react); var L = _interopRequireWildcard(_react); var Tr = _interopRequireWildcard(_react); var wr = _interopRequireWildcard(_react); var Nr = _interopRequireWildcard(_react); var mo = _interopRequireWildcard(_react); var Ae = _interopRequireWildcard(_react); var Ot = _interopRequireWildcard(_react); var we = _interopRequireWildcard(_react);var Xo={};mt(Xo,{cn:()=>a});var _clsx = require('clsx');var _tailwindmerge = require('tailwind-merge');function a(...e){return _tailwindmerge.twMerge.call(void 0, _clsx.clsx.call(void 0, e))}var _jsxruntime = require('react/jsx-runtime');var Ko=dt.forwardRef(({className:e,...t},o)=>_jsxruntime.jsx.call(void 0, 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)=>_jsxruntime.jsx.call(void 0, 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)=>_jsxruntime.jsx.call(void 0, 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;var _reactslot = require('@radix-ui/react-slot');var _classvarianceauthority = require('class-variance-authority');var _e=_classvarianceauthority.cva.call(void 0, "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)=>_jsxruntime.jsx.call(void 0, r?_reactslot.Slot:"button",{className:a(_e({variant:t,size:o,className:e})),ref:n,...i}));c.displayName="Button";var _reactdropdownmenu = require('@radix-ui/react-dropdown-menu'); var p = _interopRequireWildcard(_reactdropdownmenu);var _reacticons = require('@radix-ui/react-icons');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)=>_jsxruntime.jsxs.call(void 0, 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,_jsxruntime.jsx.call(void 0, _reacticons.ChevronRightIcon,{className:"ml-auto h-4 w-4"})]}));tr.displayName=p.SubTrigger.displayName;var or=q.forwardRef(({className:e,...t},o)=>_jsxruntime.jsx.call(void 0, 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)=>_jsxruntime.jsx.call(void 0, p.Portal,{children:_jsxruntime.jsx.call(void 0, 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)=>_jsxruntime.jsx.call(void 0, 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)=>_jsxruntime.jsxs.call(void 0, 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:[_jsxruntime.jsx.call(void 0, "span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:_jsxruntime.jsx.call(void 0, p.ItemIndicator,{children:_jsxruntime.jsx.call(void 0, _reacticons.CheckIcon,{className:"h-4 w-4"})})}),t]}));ct.displayName=p.CheckboxItem.displayName;var rr=q.forwardRef(({className:e,children:t,...o},r)=>_jsxruntime.jsxs.call(void 0, 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:[_jsxruntime.jsx.call(void 0, "span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:_jsxruntime.jsx.call(void 0, p.ItemIndicator,{children:_jsxruntime.jsx.call(void 0, _reacticons.DotFilledIcon,{className:"h-4 w-4 fill-current"})})}),t]}));rr.displayName=p.RadioItem.displayName;var pt=q.forwardRef(({className:e,inset:t,...o},r)=>_jsxruntime.jsx.call(void 0, 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)=>_jsxruntime.jsx.call(void 0, 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})=>_jsxruntime.jsx.call(void 0, "span",{className:a("ml-auto text-xs tracking-widest opacity-60",e),...t});ar.displayName="DropdownMenuShortcut";var _reactdialog = require('@radix-ui/react-dialog'); var y = _interopRequireWildcard(_reactdialog); var x = _interopRequireWildcard(_reactdialog);var Kt=y.Root,Jt=y.Trigger,La=y.Close,ir=y.Portal,jt=Ge.forwardRef(({className:e,...t},o)=>_jsxruntime.jsx.call(void 0, 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=_classvarianceauthority.cva.call(void 0, "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)=>_jsxruntime.jsxs.call(void 0, ir,{children:[_jsxruntime.jsx.call(void 0, jt,{}),_jsxruntime.jsxs.call(void 0, y.Content,{ref:i,className:a(Ia({side:e}),t),...r,children:[o,_jsxruntime.jsxs.call(void 0, 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:[_jsxruntime.jsx.call(void 0, _reacticons.Cross2Icon,{className:"h-4 w-4"}),_jsxruntime.jsx.call(void 0, "span",{className:"sr-only",children:"Close"})]})]})]}));ft.displayName=y.Content.displayName;var nr=({className:e,...t})=>_jsxruntime.jsx.call(void 0, "div",{className:a("flex flex-col space-y-2 text-center sm:text-left",e),...t});nr.displayName="SheetHeader";var sr=({className:e,...t})=>_jsxruntime.jsx.call(void 0, "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)=>_jsxruntime.jsx.call(void 0, 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)=>_jsxruntime.jsx.call(void 0, y.Description,{ref:o,className:a("text-sm text-muted-foreground",e),...t}));mr.displayName=y.Description.displayName;var Se=he.forwardRef(({className:e,...t},o)=>_jsxruntime.jsx.call(void 0, "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)=>_jsxruntime.jsx.call(void 0, "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)=>_jsxruntime.jsx.call(void 0, "h3",{ref:o,className:a("font-semibold leading-none tracking-tight",e),...t}));cr.displayName="CardTitle";var pr=he.forwardRef(({className:e,...t},o)=>_jsxruntime.jsx.call(void 0, "p",{ref:o,className:a("text-sm text-muted-foreground",e),...t}));pr.displayName="CardDescription";var Me=he.forwardRef(({className:e,...t},o)=>_jsxruntime.jsx.call(void 0, "div",{ref:o,className:a("p-6 pt-0",e),...t}));Me.displayName="CardContent";var vt=he.forwardRef(({className:e,...t},o)=>_jsxruntime.jsx.call(void 0, "div",{ref:o,className:a("flex items-center p-6 pt-0",e),...t}));vt.displayName="CardFooter";var P=_react.forwardRef.call(void 0, ({children:e,...t},o)=>{let r=_core.useRouterType.call(void 0, ),i=_core.useLink.call(void 0, ),{Link:n}=_core.useRouterContext.call(void 0, );return _jsxruntime.jsx.call(void 0, r==="legacy"?n:i,{ref:o,...t,children:e})});P.displayName="Link";var gt=Z.forwardRef(({className:e,...t},o)=>_jsxruntime.jsx.call(void 0, "div",{className:"relative w-full overflow-auto",children:_jsxruntime.jsx.call(void 0, "table",{ref:o,className:a("w-full caption-bottom text-sm",e),...t})}));gt.displayName="Table";var bt=Z.forwardRef(({className:e,...t},o)=>_jsxruntime.jsx.call(void 0, "thead",{ref:o,className:a("[&_tr]:border-b border-border",e),...t}));bt.displayName="TableHeader";var ht=Z.forwardRef(({className:e,...t},o)=>_jsxruntime.jsx.call(void 0, "tbody",{ref:o,className:a("[&_tr:last-child]:border-0",e),...t}));ht.displayName="TableBody";var ur=Z.forwardRef(({className:e,...t},o)=>_jsxruntime.jsx.call(void 0, "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)=>_jsxruntime.jsx.call(void 0, "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)=>_jsxruntime.jsx.call(void 0, "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)=>_jsxruntime.jsx.call(void 0, "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)=>_jsxruntime.jsx.call(void 0, "caption",{ref:o,className:a("mt-4 text-sm text-muted-foreground",e),...t}));fr.displayName="TableCaption";var qe=x.Root,Wa=x.Trigger,vr=x.Portal,to=x.Close,oo=Qe.forwardRef(({className:e,...t},o)=>_jsxruntime.jsx.call(void 0, 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)=>_jsxruntime.jsxs.call(void 0, vr,{children:[_jsxruntime.jsx.call(void 0, oo,{}),_jsxruntime.jsxs.call(void 0, 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,_jsxruntime.jsxs.call(void 0, 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:[_jsxruntime.jsx.call(void 0, _reacticons.Cross2Icon,{className:"h-4 w-4"}),_jsxruntime.jsx.call(void 0, "span",{className:"sr-only",children:"Close"})]})]})]}));Fe.displayName=x.Content.displayName;var xt=({className:e,...t})=>_jsxruntime.jsx.call(void 0, "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})=>_jsxruntime.jsx.call(void 0, "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)=>_jsxruntime.jsx.call(void 0, 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)=>_jsxruntime.jsx.call(void 0, x.Description,{ref:o,className:a("text-sm text-muted-foreground",e),...t}));Tt.displayName=x.Description.displayName;var _reacthookform = require('react-hook-form');var _reactlabel = require('@radix-ui/react-label'); var ro = _interopRequireWildcard(_reactlabel);var $a=_classvarianceauthority.cva.call(void 0, "text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),Pt=gr.forwardRef(({className:e,...t},o)=>_jsxruntime.jsx.call(void 0, ro.Root,{ref:o,className:a($a(),e),...t}));Pt.displayName=ro.Root.displayName;var ao=_reacthookform.FormProvider,br=S.createContext({}),io=({...e})=>_jsxruntime.jsx.call(void 0, br.Provider,{value:{name:e.name},children:_jsxruntime.jsx.call(void 0, _reacthookform.Controller,{...e})}),Ye=()=>{let e=S.useContext(br),t=S.useContext(hr),{getFieldState:o,formState:r}=_reacthookform.useFormContext.call(void 0, ),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 _jsxruntime.jsx.call(void 0, hr.Provider,{value:{id:r},children:_jsxruntime.jsx.call(void 0, "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 _jsxruntime.jsx.call(void 0, 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 _jsxruntime.jsx.call(void 0, _reactslot.Slot,{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 _jsxruntime.jsx.call(void 0, "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(_optionalChain([i, 'optionalAccess', _2 => _2.message])):t;return s?_jsxruntime.jsx.call(void 0, "p",{ref:r,id:n,className:a("text-[0.8rem] font-medium text-destructive",e),...o,children:s}):null});St.displayName="FormMessage";var Mt=yr.forwardRef(({className:e,type:t,...o},r)=>_jsxruntime.jsx.call(void 0, "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";var _reactcheckbox = require('@radix-ui/react-checkbox'); var Ze = _interopRequireWildcard(_reactcheckbox);var kt=xr.forwardRef(({className:e,...t},o)=>_jsxruntime.jsx.call(void 0, 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:_jsxruntime.jsxs.call(void 0, Ze.Indicator,{className:a("flex items-center justify-center text-current absolute top-0 left-0 right-0 bottom-0"),children:[t.checked==="indeterminate"&&_jsxruntime.jsx.call(void 0, _reacticons.DividerHorizontalIcon,{}),t.checked===!0&&_jsxruntime.jsx.call(void 0, _lucidereact.CheckIcon,{className:"h-4 w-4"})]})}));kt.displayName=Ze.Root.displayName;var Rr=_classvarianceauthority.cva.call(void 0, "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 _jsxruntime.jsx.call(void 0, "div",{className:a(Rr({variant:t}),e),...o})}var _cmdk = require('cmdk');var X=L.forwardRef(({className:e,...t},o)=>_jsxruntime.jsx.call(void 0, _cmdk.Command,{ref:o,className:a("flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground",e),...t}));X.displayName=_cmdk.Command.displayName;var ai=({children:e,...t})=>_jsxruntime.jsx.call(void 0, qe,{...t,children:_jsxruntime.jsx.call(void 0, Fe,{className:"overflow-hidden p-0",children:_jsxruntime.jsx.call(void 0, 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]),_jsxruntime.jsxs.call(void 0, "div",{className:"flex items-center border-border border-b px-3",ref:r,children:[_jsxruntime.jsx.call(void 0, _reacticons.MagnifyingGlassIcon,{className:"mr-2 h-4 w-4 shrink-0 opacity-50"}),_jsxruntime.jsx.call(void 0, _cmdk.Command.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=_cmdk.Command.Input.displayName;var Et=L.forwardRef(({className:e,...t},o)=>_jsxruntime.jsx.call(void 0, _cmdk.Command.List,{ref:o,className:a("max-h-[300px] overflow-y-auto overflow-x-hidden",e),...t}));Et.displayName=_cmdk.Command.List.displayName;var ce=L.forwardRef((e,t)=>_jsxruntime.jsx.call(void 0, _cmdk.Command.Empty,{ref:t,className:"py-6 text-center text-sm",...e}));ce.displayName=_cmdk.Command.Empty.displayName;var K=L.forwardRef(({className:e,...t},o)=>_jsxruntime.jsx.call(void 0, _cmdk.Command.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=_cmdk.Command.Group.displayName;var Ft=L.forwardRef(({className:e,...t},o)=>_jsxruntime.jsx.call(void 0, _cmdk.Command.Separator,{ref:o,className:a("-mx-1 h-px bg-border",e),...t}));Ft.displayName=_cmdk.Command.Separator.displayName;var xe=L.forwardRef(({className:e,...t},o)=>_jsxruntime.jsx.call(void 0, _cmdk.Command.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=_cmdk.Command.Item.displayName;var Cr=({className:e,...t})=>_jsxruntime.jsx.call(void 0, "span",{className:a("ml-auto text-xs tracking-widest text-muted-foreground",e),...t});Cr.displayName="CommandShortcut";var _reactseparator = require('@radix-ui/react-separator'); var so = _interopRequireWildcard(_reactseparator);var J=Tr.forwardRef(({className:e,orientation:t="horizontal",decorative:o=!0,...r},i)=>_jsxruntime.jsx.call(void 0, 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;var _reactpopover = require('@radix-ui/react-popover'); var j = _interopRequireWildcard(_reactpopover);var O=j.Root,U=j.Trigger,I=wr.forwardRef(({className:e,align:t="center",sideOffset:o=4,...r},i)=>_jsxruntime.jsx.call(void 0, j.Portal,{children:_jsxruntime.jsx.call(void 0, 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;var _reactdaypicker = require('react-day-picker');function Bt({className:e,classNames:t,showOutsideDays:o=!0,...r}){return _jsxruntime.jsx.call(void 0, _reactdaypicker.DayPicker,{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:()=>_jsxruntime.jsx.call(void 0, _reacticons.ChevronLeftIcon,{className:"h-4 w-4"}),IconRight:()=>_jsxruntime.jsx.call(void 0, _reacticons.ChevronRightIcon,{className:"h-4 w-4"})},...r})}Bt.displayName="Calendar";var Dr=Nr.forwardRef(({className:e,...t},o)=>_jsxruntime.jsx.call(void 0, "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";var _reactscrollarea = require('@radix-ui/react-scroll-area'); var H = _interopRequireWildcard(_reactscrollarea);var At=mo.forwardRef(({className:e,children:t,...o},r)=>_jsxruntime.jsxs.call(void 0, H.Root,{ref:r,className:a("relative overflow-hidden",e),...o,children:[_jsxruntime.jsx.call(void 0, H.Viewport,{className:"h-full w-full rounded-[inherit]",children:t}),_jsxruntime.jsx.call(void 0, co,{}),_jsxruntime.jsx.call(void 0, H.Corner,{})]}));At.displayName=H.Root.displayName;var co=mo.forwardRef(({className:e,orientation:t="vertical",...o},r)=>_jsxruntime.jsx.call(void 0, 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:_jsxruntime.jsx.call(void 0, H.ScrollAreaThumb,{className:a("relative rounded-full bg-border",t==="vertical"&&"flex-1")})}));co.displayName=H.ScrollAreaScrollbar.displayName;var _reactselect = require('@radix-ui/react-select'); var f = _interopRequireWildcard(_reactselect);var Ke=f.Root,fi=f.Group,Je=f.Value,Le=Ae.forwardRef(({className:e,children:t,...o},r)=>_jsxruntime.jsxs.call(void 0, 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,_jsxruntime.jsx.call(void 0, f.Icon,{asChild:!0,children:_jsxruntime.jsx.call(void 0, _reacticons.CaretSortIcon,{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)=>_jsxruntime.jsx.call(void 0, f.Portal,{children:_jsxruntime.jsx.call(void 0, 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:_jsxruntime.jsx.call(void 0, 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)=>_jsxruntime.jsx.call(void 0, 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)=>_jsxruntime.jsxs.call(void 0, 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:[_jsxruntime.jsx.call(void 0, "span",{className:"absolute right-2 flex h-3.5 w-3.5 items-center justify-center",children:_jsxruntime.jsx.call(void 0, f.ItemIndicator,{children:_jsxruntime.jsx.call(void 0, _reacticons.CheckIcon,{className:"h-4 w-4"})})}),_jsxruntime.jsx.call(void 0, f.ItemText,{children:t})]}));He.displayName=f.Item.displayName;var Mr=Ae.forwardRef(({className:e,...t},o)=>_jsxruntime.jsx.call(void 0, f.Separator,{ref:o,className:a("-mx-1 my-1 h-px bg-muted",e),...t}));Mr.displayName=f.Separator.displayName;var pe=({showHome:e=!0,hideIcons:t=!1,meta:o})=>{let{breadcrumbs:r}=_core.useBreadcrumb.call(void 0, {meta:o}),{hasDashboard:i}=_core.useRefineContext.call(void 0, ),{resources:n}=_core.useResource.call(void 0, ),s=_core.matchResourceFromRoute.call(void 0, "/",n),l=()=>t?null:_jsxruntime.jsx.call(void 0, "svg",{className:"h-5 w-5 flex-shrink-0 text-gray-400",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",children:_jsxruntime.jsx.call(void 0, "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)=>_jsxruntime.jsx.call(void 0, "li",{children:_jsxruntime.jsxs.call(void 0, "div",{className:"flex items-center",children:[l(),u?_jsxruntime.jsx.call(void 0, P,{to:u,title:d,className:"ml-4 text-sm font-medium",children:d}):_jsxruntime.jsx.call(void 0, "span",{className:"ml-4",children:d})]})},v));return _jsxruntime.jsx.call(void 0, "nav",{className:"flex","aria-label":"Breadcrumb",children:_jsxruntime.jsxs.call(void 0, "ol",{role:"list",className:"flex items-center space-x-4",children:[e||i||s.found?_jsxruntime.jsx.call(void 0, "li",{children:_jsxruntime.jsx.call(void 0, "div",{children:_jsxruntime.jsxs.call(void 0, P,{to:"/",title:"Home",children:[_nullishCoalesce(_optionalChain([s, 'optionalAccess', _3 => _3.resource, 'optionalAccess', _4 => _4.meta, 'optionalAccess', _5 => _5.icon]), () => (_jsxruntime.jsx.call(void 0, _lucidereact.HomeIcon,{size:16}))),_jsxruntime.jsx.call(void 0, "span",{className:"sr-only",children:"Home"})]})})}):null,m]})})};var Pi=({title:e,resource:t,breadcrumb:o,extra:r,children:i})=>{let n=_core.useTranslate.call(void 0, ),{options:{breadcrumb:s}={}}=_core.useRefineContext.call(void 0, ),l=_core.useUserFriendlyName.call(void 0, ),{resource:m,identifier:d}=_core.useResource.call(void 0, t),u=typeof o>"u"?s:o;return _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment,{children:[_jsxruntime.jsx.call(void 0, ue,{title:_nullishCoalesce(e, () => (n(`${d}.titles.List`,`Create ${l(_nullishCoalesce(_nullishCoalesce(_nullishCoalesce(_optionalChain([m, 'optionalAccess', _6 => _6.meta, 'optionalAccess', _7 => _7.label]), () => (_optionalChain([m, 'optionalAccess', _8 => _8.options, 'optionalAccess', _9 => _9.label]))), () => (_optionalChain([m, 'optionalAccess', _10 => _10.label]))), () => (d)),"singular")}`))),isBack:!0,breadcrumb:typeof u<"u"?_nullishCoalesce(_jsxruntime.jsx.call(void 0, _jsxruntime.Fragment,{children:u}), () => (void 0)):_jsxruntime.jsx.call(void 0, pe,{}),extra:_nullishCoalesce(r, () => (_jsxruntime.jsx.call(void 0, _jsxruntime.Fragment,{children:_jsxruntime.jsx.call(void 0, fo,{resource:t})})))}),_jsxruntime.jsx.call(void 0, "div",{className:"relative pt-4 !mt-0",children:i})]})};var zr={};mt(zr,{DeleteContext:()=>Oe,DeleteProvider:()=>Ce,ViteDarkModeProvider:()=>en,notificationProvider:()=>Vr,useNotificationProvider:()=>xn});var fe=e=>_jsxruntime.jsx.call(void 0, ne,{disabled:e.disabled,asChild:!(!e.to||!e.to&&!e.children),onClick:e.onClick,children:e.asChild?e.children:e.to?_jsxruntime.jsxs.call(void 0, P,{disabled:e.disabled,replace:!1,to:e.to,title:e.title,children:[e.icon?_jsxruntime.jsx.call(void 0, "span",{className:"mr-2",children:e.icon}):null,e.title]}):_jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment,{children:[e.icon?_jsxruntime.jsx.call(void 0, "span",{className:"mr-2",children:e.icon}):null,e.title]})});function Fr({children:e}){return _jsxruntime.jsxs.call(void 0, be,{children:[_jsxruntime.jsx.call(void 0, We,{asChild:!0,children:_jsxruntime.jsxs.call(void 0, c,{variant:"ghost",className:"flex h-8 w-8 p-0 data-[state=open]:bg-muted",children:[_jsxruntime.jsx.call(void 0, _reacticons.DotsHorizontalIcon,{className:"h-4 w-4"}),_jsxruntime.jsx.call(void 0, "span",{className:"sr-only",children:"Open menu"})]})}),_jsxruntime.jsx.call(void 0, ie,{align:"end",className:"w-[160px]",children:e})]})}var Ar={};mt(Ar,{useDarkMode:()=>ho,useDeleteHelper:()=>ze,useGetEditUrl:()=>vo,useGetShowUrl:()=>go,useOnBack:()=>bo});var vo=(e,t,o)=>{let r=_react.useContext.call(void 0, _core.AccessControlContext),i=r.options.buttons.enableAccessControl,n=r.options.buttons.hideIfUnauthorized,{editUrl:s}=_core.useNavigation.call(void 0, ),{id:l,resource:m}=_core.useResource.call(void 0, e),{data:d}=_core.useCan.call(void 0, {resource:e,action:"edit",params:{id:t,resource:m},queryOptions:{enabled:i}}),u=_core.useTranslate.call(void 0, ),v=()=>_optionalChain([d, 'optionalAccess', _11 => _11.can])?"":_optionalChain([d, 'optionalAccess', _12 => _12.reason])?d.reason:u("buttons.notAccessTitle","You don't have permission to access"),R=e&&(_nullishCoalesce(t, () => (l)))?s(e,_nullishCoalesce(t, () => (l)),o):"";return{can:!(i&&n&&!_optionalChain([d, 'optionalAccess', _13 => _13.can])),reason:v(),url:R}};var go=(e,t,o)=>{let r=_react.useContext.call(void 0, _core.AccessControlContext),i=r.options.buttons.enableAccessControl,n=r.options.buttons.hideIfUnauthorized,{showUrl:s}=_core.useNavigation.call(void 0, ),{id:l,resource:m}=_core.useResource.call(void 0, e),{data:d}=_core.useCan.call(void 0, {resource:e,action:"show",params:{id:t,resource:m},queryOptions:{enabled:i}}),u=_core.useTranslate.call(void 0, ),v=()=>_optionalChain([d, 'optionalAccess', _14 => _14.can])?"":_optionalChain([d, 'optionalAccess', _15 => _15.reason])?d.reason:u("buttons.notAccessTitle","You don't have permission to access"),R=e&&(t||l)?s(e,_nullishCoalesce(t, () => (l)),o):"";return{can:!(i&&n&&!_optionalChain([d, 'optionalAccess', _16 => _16.can])),reason:v(),url:R}};var ze=(e,t,o)=>{let r=_react.useContext.call(void 0, _core.AccessControlContext),i=r.options.buttons.enableAccessControl,n=r.options.buttons.hideIfUnauthorized,s=_core.useTranslate.call(void 0, ),{id:l,resource:m,identifier:d}=_core.useResource.call(void 0, e),{mutationMode:u}=_core.useMutationMode.call(void 0, ),{mutate:v,isLoading:R}=_core.useDelete.call(void 0, ),{data:g}=_core.useCan.call(void 0, {resource:_optionalChain([m, 'optionalAccess', _17 => _17.name]),action:"delete",params:{id:_nullishCoalesce(t, () => (l)),resource:m},queryOptions:{enabled:i}}),h=()=>_optionalChain([g, 'optionalAccess', _18 => _18.can])?"":_optionalChain([g, 'optionalAccess', _19 => _19.reason])?g.reason:s("buttons.notAccessTitle","You don't have permission to access"),{setWarnWhen:w}=_core.useWarnAboutChange.call(void 0, ),b=N=>{if(!(i&&n&&!_optionalChain([g, 'optionalAccess', _20 => _20.can]))&&(_nullishCoalesce(t, () => (l)))&&d)return w(!1),v({id:_nullishCoalesce(_nullishCoalesce(t, () => (l)), () => ("")),resource:d,mutationMode:u,meta:_core.pickNotDeprecated.call(void 0, o),metaData:_core.pickNotDeprecated.call(void 0, o)},N)};return{can:!(i&&n&&!_optionalChain([g, 'optionalAccess', _21 => _21.can])),reason:h(),mutate:b,isLoading:R}};var bo=()=>{let e=_core.useRouterType.call(void 0, ),t=_core.useBack.call(void 0, ),{goBack:o}=_core.useNavigation.call(void 0, ),{action:r}=_core.useResource.call(void 0, );return r!=="list"||typeof r<"u"?e==="legacy"?o:t:void 0};function en({children:e,defaultDarkMode:t="system",storageKey:o="vite-ui-theme",...r}){let[i,n]=_react.useState.call(void 0, ()=>localStorage.getItem(o)||t);_react.useEffect.call(void 0, ()=>{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 _jsxruntime.jsx.call(void 0, It.Provider,{...r,value:s,children:e})}var rn={theme:"system",setDarkMode:()=>null},It=_react.createContext.call(void 0, rn);var ho=()=>{let e=_react.useContext.call(void 0, It);if(e===void 0)throw new Error("useDarkMode must be used within a DarkModeProvider");return e};function Lr(e){let t=bo(),{can:o,isLoading:r,mutate:i}=ze(_optionalChain([e, 'access', _22 => _22.data, 'optionalAccess', _23 => _23.resource]),_optionalChain([e, 'access', _24 => _24.data, 'optionalAccess', _25 => _25.row, 'optionalAccess', _26 => _26.id])),n=_core.useTranslate.call(void 0, ),s=_react.useCallback.call(void 0, ()=>{if(o)return i({onSuccess(){let l=_nullishCoalesce(_optionalChain([e, 'optionalAccess', _27 => _27.data, 'optionalAccess', _28 => _28.redirectBack]), () => (!1));_optionalChain([e, 'optionalAccess', _29 => _29.updateData, 'call', _30 => _30({toogle:!1,row:void 0,resource:"",redirectBack:!1})]),l&&_optionalChain([t, 'optionalCall', _31 => _31()])}})},[i,o]);return _jsxruntime.jsx.call(void 0, qe,{open:o&&_optionalChain([e, 'optionalAccess', _32 => _32.data, 'optionalAccess', _33 => _33.toogle]),onOpenChange:()=>{r||_optionalChain([e, 'optionalAccess', _34 => _34.updateData, 'call', _35 => _35({toogle:!1,row:void 0,resource:""})])},children:_jsxruntime.jsxs.call(void 0, Fe,{onPointerDownOutside:l=>l.preventDefault(),children:[_jsxruntime.jsxs.call(void 0, xt,{children:[_jsxruntime.jsxs.call(void 0, Ct,{className:"inline-flex flex-row items-center gap-x-2",children:[_jsxruntime.jsx.call(void 0, _lucidereact.AlertTriangleIcon,{}),n("actions.delete.title","Are you sure absolutely sure?")]}),_jsxruntime.jsx.call(void 0, Tt,{children:n("actions.delete.title","If this action can be undone later, this data will be temporarily deleted.")})]}),_jsxruntime.jsx.call(void 0, Rt,{className:"sm:justify-end",children:_jsxruntime.jsxs.call(void 0, "div",{className:"flex flex-col sm:flex-row gap-x-3",children:[_jsxruntime.jsx.call(void 0, to,{asChild:!0,children:_jsxruntime.jsx.call(void 0, c,{disabled:r,type:"button",variant:"secondary",children:"Cancel"})}),_jsxruntime.jsxs.call(void 0, c,{type:"button",variant:"destructive",onClick:s,disabled:r,children:[r?_jsxruntime.jsx.call(void 0, _reacticons.ReloadIcon,{className:"mr-2 h-4 w-4 animate-spin"}):_jsxruntime.jsx.call(void 0, _lucidereact.Trash2,{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=_react.useContext.call(void 0, Oe);return _jsxruntime.jsx.call(void 0, fe,{...n,disabled:!s,title:s?o:l,onClick:()=>_optionalChain([m, 'optionalAccess', _36 => _36.updateData, 'call', _37 => _37({row:e,resource:t,toogle:!0})])})}yo.displayName="DeleteAction";var Oe=_react.createContext.call(void 0, void 0),Ce=({children:e})=>{let[t,o]=_react.useState.call(void 0, {row:void 0,resource:"",toogle:!1}),r=i=>{o(i)};return _jsxruntime.jsxs.call(void 0, Oe.Provider,{value:{data:t,updateData:r},children:[e,_jsxruntime.jsx.call(void 0, Lr,{data:t,updateData:r})]})};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;var wn=({title:e,resource:t,extra:o,breadcrumb:r,children:i})=>{let n=_core.useTranslate.call(void 0, ),{options:{breadcrumb:s}={}}=_core.useRefineContext.call(void 0, ),l=_core.useUserFriendlyName.call(void 0, ),{resource:m,action:d,identifier:u}=_core.useResource.call(void 0, t),v=typeof r>"u"?s:r;return _jsxruntime.jsxs.call(void 0, Ce,{children:[_jsxruntime.jsx.call(void 0, ue,{title:_nullishCoalesce(e, () => (n(`${u}.titles.List`,`Edit ${l(_nullishCoalesce(_nullishCoalesce(_nullishCoalesce(_optionalChain([m, 'optionalAccess', _38 => _38.meta, 'optionalAccess', _39 => _39.label]), () => (_optionalChain([m, 'optionalAccess', _40 => _40.options, 'optionalAccess', _41 => _41.label]))), () => (_optionalChain([m, 'optionalAccess', _42 => _42.label]))), () => (u)),"plural")}`))),isBack:!0,breadcrumb:typeof v<"u"?_nullishCoalesce(_jsxruntime.jsx.call(void 0, _jsxruntime.Fragment,{children:v}), () => (void 0)):_jsxruntime.jsx.call(void 0, pe,{}),extra:_nullishCoalesce(o, () => (_jsxruntime.jsxs.call(void 0, "div",{className:"inline-flex flex-row items-center gap-x-2",children:[_jsxruntime.jsx.call(void 0, To,{resource:t}),_jsxruntime.jsx.call(void 0, tt,{resource:t})]})))}),_jsxruntime.jsx.call(void 0, "div",{className:"relative pt-4",children:i})]})};var Ur=({title:e,content:t})=>_jsxruntime.jsx.call(void 0, _jsxruntime.Fragment,{children:_jsxruntime.jsx.call(void 0, "dl",{className:"flex flex-wrap",children:_jsxruntime.jsxs.call(void 0, "div",{className:"flex-auto pl-6 pt-6",children:[_jsxruntime.jsx.call(void 0, "dt",{className:"scroll-m-20 text-lg font-semibold tracking-tight",children:e}),_jsxruntime.jsx.call(void 0, "dd",{className:"mt-1 text-base font-normal text-foreground leading-7",children:t})]})})});var Wr=({title:e,resource:t,breadcrumb:o,extra:r,children:i})=>{let n=_core.useTranslate.call(void 0, ),{options:{breadcrumb:s}={}}=_core.useRefineContext.call(void 0, ),l=_core.useUserFriendlyName.call(void 0, ),{resource:m,identifier:d}=_core.useResource.call(void 0, t),u=typeof o>"u"?s:o;return _jsxruntime.jsxs.call(void 0, Ce,{children:[_jsxruntime.jsx.call(void 0, ue,{title:_nullishCoalesce(e, () => (n(`${d}.titles.List`,`Show ${l(_nullishCoalesce(_nullishCoalesce(_nullishCoalesce(_optionalChain([m, 'optionalAccess', _43 => _43.meta, 'optionalAccess', _44 => _44.label]), () => (_optionalChain([m, 'optionalAccess', _45 => _45.options, 'optionalAccess', _46 => _46.label]))), () => (_optionalChain([m, 'optionalAccess', _47 => _47.label]))), () => (d)),"singular")}`))),breadcrumb:typeof u<"u"?_nullishCoalesce(_jsxruntime.jsx.call(void 0, _jsxruntime.Fragment,{children:u}), () => (void 0)):_jsxruntime.jsx.call(void 0, pe,{}),isBack:!0,extra:_nullishCoalesce(r, () => (_jsxruntime.jsxs.call(void 0, "div",{className:"inline-flex items-center gap-x-2",children:[_jsxruntime.jsx.call(void 0, Po,{resource:t}),_jsxruntime.jsx.call(void 0, tt,{resource:t})]})))}),_jsxruntime.jsx.call(void 0, "div",{className:"relative pt-4 !mt-0",children:_jsxruntime.jsx.call(void 0, Se,{children:_jsxruntime.jsx.call(void 0, Me,{children:i})})})]})};Wr.Row=Ur;var Vn=({title:e,resource:t,breadcrumb:o,createButtonProps:r,extra:i,children:n})=>{let s=_core.useTranslate.call(void 0, ),{options:{breadcrumb:l}={}}=_core.useRefineContext.call(void 0, ),m=_core.useUserFriendlyName.call(void 0, ),{resource:d,identifier:u}=_core.useResource.call(void 0, t),v=typeof o>"u"?l:o;return _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment,{children:[_jsxruntime.jsx.call(void 0, ue,{title:_nullishCoalesce(e, () => (s(`${u}.titles.List`,`List ${m(_nullishCoalesce(_nullishCoalesce(_nullishCoalesce(_optionalChain([d, 'optionalAccess', _48 => _48.meta, 'optionalAccess', _49 => _49.label]), () => (_optionalChain([d, 'optionalAccess', _50 => _50.options, 'optionalAccess', _51 => _51.label]))), () => (_optionalChain([d, 'optionalAccess', _52 => _52.label]))), () => (u)),"plural")}`))),breadcrumb:typeof v<"u"?_nullishCoalesce(_jsxruntime.jsx.call(void 0, _jsxruntime.Fragment,{children:v}), () => (void 0)):_jsxruntime.jsx.call(void 0, pe,{}),extra:_nullishCoalesce(i, () => (_jsxruntime.jsx.call(void 0, _jsxruntime.Fragment,{children:_jsxruntime.jsx.call(void 0, "div",{className:"inline-flex flex-row gap-4",children:_jsxruntime.jsx.call(void 0, No,{...r,resource:_nullishCoalesce(_optionalChain([r, 'optionalAccess', _53 => _53.resource]), () => (u))})})})))}),_jsxruntime.jsx.call(void 0, Ce,{children:_jsxruntime.jsx.call(void 0, "div",{c