@ceed/ads 0.0.162 → 0.0.164-0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,7 +1,7 @@
1
1
  import React from "react";
2
2
  import { MotionProps } from "framer-motion";
3
3
  interface CurrencyInputProps {
4
- currency?: "usd" | "krw";
4
+ currency?: "USD" | "KRW";
5
5
  max?: number;
6
6
  value?: number;
7
7
  onChange?: (event: {
@@ -1,7 +1,8 @@
1
- export declare const useCurrencySetting: (currencyCode?: "usd" | "krw") => {
1
+ export declare const useCurrencySetting: (currencyCode?: "USD" | "KRW" | "BHD") => {
2
2
  symbol: string;
3
3
  thousandSeparator: string;
4
4
  decimalSeparator: string;
5
5
  placeholder: string;
6
6
  fixedDecimalScale: boolean;
7
+ decimalScale: number;
7
8
  };
@@ -1,23 +1,138 @@
1
1
  import React, { ComponentProps, ReactNode } from "react";
2
+ import { Link } from "@mui/joy";
2
3
  import { Table } from "../Table";
3
- export type ColumnDef<T extends Record<string, V>, V = unknown> = {
4
- type?: "number" | "string" | "date";
4
+ import CurrencyInput from "../CurrencyInput";
5
+ import DatePicker from "../DatePicker";
6
+ import Input from "../Input";
7
+ import Textarea from "../Textarea";
8
+ import Chip from "../Chip";
9
+ import Autocomplete from "../Autocomplete";
10
+ import Select from "../Select";
11
+ export type RenderCellHandler<T extends Record<string, V>, V = unknown> = (params: {
12
+ row: T;
13
+ value?: V;
14
+ id: string;
15
+ }) => ReactNode;
16
+ export type CellEditStartEvent<T extends Record<string, V>, V = unknown> = (params: {
17
+ originalRow: T;
18
+ row: T;
19
+ value?: V;
20
+ id: string;
21
+ }) => void;
22
+ export type CellEditStopEvent<T extends Record<string, V>, V = unknown> = (params: {
23
+ originalRow: T;
24
+ row: T;
25
+ value?: V;
26
+ id: string;
27
+ }) => void;
28
+ type BaseColumnDef<T extends Record<string, V>, V = unknown> = {
5
29
  field: keyof T;
6
30
  headerName?: string;
7
31
  width?: string;
8
32
  minWidth?: string;
9
33
  maxWidth?: string;
10
34
  resizable?: boolean;
11
- renderCell?: (params: {
35
+ renderCell?: RenderCellHandler<T, V>;
36
+ isCellEditable?: ((params: {
12
37
  row: T;
13
38
  value?: V;
14
39
  id: string;
15
- }) => ReactNode;
40
+ }) => boolean) | boolean;
41
+ isCellRequired?: boolean;
42
+ onCellEditStart?: CellEditStartEvent<T, V>;
43
+ onCellEditStop?: CellEditStopEvent<T, V>;
16
44
  };
45
+ type AutocompleteColumnDef<T extends Record<string, V>, V = unknown> = BaseColumnDef<T, V> & {
46
+ type: "autocomplete";
47
+ componentProps?: ComponentProps<typeof Autocomplete> | ((params: {
48
+ row: T;
49
+ value?: V;
50
+ id: string;
51
+ }) => ComponentProps<typeof Autocomplete>);
52
+ };
53
+ type CurrencyColumnDef<T extends Record<string, V>, V = unknown> = BaseColumnDef<T, V> & {
54
+ type: "currency";
55
+ componentProps?: ComponentProps<typeof CurrencyInput> | ((params: {
56
+ row: T;
57
+ value?: V;
58
+ id: string;
59
+ }) => ComponentProps<typeof CurrencyInput>);
60
+ };
61
+ type DateColumnDef<T extends Record<string, V>, V = unknown> = BaseColumnDef<T, V> & {
62
+ type: "date";
63
+ componentProps?: ComponentProps<typeof DatePicker> | ((params: {
64
+ row: T;
65
+ value?: V;
66
+ id: string;
67
+ }) => ComponentProps<typeof DatePicker>);
68
+ };
69
+ type NumberColumnDef<T extends Record<string, V>, V = unknown> = BaseColumnDef<T, V> & {
70
+ type: "number";
71
+ componentProps?: ComponentProps<typeof Input> | ((params: {
72
+ row: T;
73
+ value?: V;
74
+ id: string;
75
+ }) => ComponentProps<typeof Input>);
76
+ };
77
+ type TextColumnDef<T extends Record<string, V>, V = unknown> = BaseColumnDef<T, V> & {
78
+ type: "text";
79
+ componentProps?: ComponentProps<typeof Input> | ((params: {
80
+ row: T;
81
+ value?: V;
82
+ id: string;
83
+ }) => ComponentProps<typeof Input>);
84
+ };
85
+ type LongTextColumnDef<T extends Record<string, V>, V = unknown> = BaseColumnDef<T, V> & {
86
+ type: "longText";
87
+ componentProps?: ComponentProps<typeof Textarea> | ((params: {
88
+ row: T;
89
+ value?: V;
90
+ id: string;
91
+ }) => ComponentProps<typeof Textarea>);
92
+ };
93
+ type SelectColumnDef<T extends Record<string, V>, V = unknown> = BaseColumnDef<T, V> & {
94
+ type: "select";
95
+ componentProps?: ComponentProps<typeof Select<string, false>> | ((params: {
96
+ row: T;
97
+ value?: V;
98
+ id: string;
99
+ }) => ComponentProps<typeof Select<string, false>>);
100
+ };
101
+ type MultiSelectColumnDef<T extends Record<string, V>, V = unknown> = BaseColumnDef<T, V> & {
102
+ type: "multiSelect";
103
+ componentProps?: ComponentProps<typeof Select<string, true>> | ((params: {
104
+ row: T;
105
+ value?: V;
106
+ id: string;
107
+ }) => ComponentProps<typeof Select<string, true>>);
108
+ };
109
+ type LinkColumnDef<T extends Record<string, V>, V = unknown, C extends React.ElementType = typeof Link> = BaseColumnDef<T, V> & {
110
+ type: "link";
111
+ component?: C;
112
+ componentProps?: ComponentProps<C> | ((params: {
113
+ row: T;
114
+ value?: V;
115
+ id: string;
116
+ }) => ComponentProps<C>);
117
+ };
118
+ type ChipColumnDef<T extends Record<string, V>, V = unknown> = BaseColumnDef<T, V> & {
119
+ type: "chip";
120
+ componentProps?: ComponentProps<typeof Chip> | ((params: {
121
+ row: T;
122
+ value?: V;
123
+ id: string;
124
+ }) => ComponentProps<typeof Chip>);
125
+ };
126
+ type OtherColumnDef<T extends Record<string, V>, V = unknown> = BaseColumnDef<T, V> & {
127
+ type?: "string";
128
+ componentProps?: {};
129
+ };
130
+ export type ColumnDef<T extends Record<string, V>, V = unknown> = AutocompleteColumnDef<T, V> | CurrencyColumnDef<T, V> | DateColumnDef<T, V> | NumberColumnDef<T, V> | TextColumnDef<T, V> | LongTextColumnDef<T, V> | LinkColumnDef<T, V> | ChipColumnDef<T, V> | SelectColumnDef<T, V> | MultiSelectColumnDef<T, V> | OtherColumnDef<T, V>;
17
131
  export type DataTableProps<T extends Record<string, unknown>> = {
18
132
  rows: T[];
19
133
  checkboxSelection?: boolean;
20
134
  columns: ColumnDef<T>[];
135
+ editMode?: boolean;
21
136
  /**
22
137
  * 체크박스가 있는 경우, 체크박스를 클릭했을 때 선택된 row의 index를 지정한다.
23
138
  */
@@ -1,4 +1,9 @@
1
1
  import React from "react";
2
+ type UserUpload = {
3
+ id: string | number;
4
+ name: string;
5
+ size?: number;
6
+ };
2
7
  declare const Uploader: React.MemoExoticComponent<(props: {
3
8
  onChange?: ((event: {
4
9
  target: {
@@ -6,16 +11,20 @@ declare const Uploader: React.MemoExoticComponent<(props: {
6
11
  value: File[];
7
12
  };
8
13
  }) => void) | undefined;
14
+ onDelete?: ((deletedFile: UserUpload) => void) | undefined;
9
15
  name?: string | undefined;
10
16
  size?: "sm" | "md" | undefined;
11
17
  label?: string | undefined;
12
18
  helperText?: string | undefined;
13
19
  error?: boolean | undefined;
14
20
  accept?: string | undefined;
21
+ disabled?: boolean | undefined;
22
+ required?: boolean | undefined;
15
23
  maxCount?: number | undefined;
16
24
  /**
17
25
  * Maximum size per file in bytes
18
26
  */
19
27
  maxSize?: number | undefined;
28
+ uploaded?: UserUpload[] | undefined;
20
29
  }) => React.JSX.Element>;
21
30
  export { Uploader };
package/dist/index.js CHANGED
@@ -1 +1 @@
1
- import{useTheme as nh,useColorScheme as ah,useThemeProps as ih,alertClasses as lh,boxClasses as sh,buttonClasses as mh,checkboxClasses as ph,dividerClasses as dh,iconButtonClasses as ch,inputClasses as uh,menuClasses as gh,menuButtonClasses as fh,menuItemClasses as hh,optionClasses as bh,radioClasses as Ch,radioGroupClasses as yh,selectClasses as xh,switchClasses as vh,tableClasses as Mh,textareaClasses as kh,typographyClasses as Dh,formControlClasses as Ph,formLabelClasses as Th,formHelperTextClasses as wh,gridClasses as Ih,stackClasses as Ah,sheetClasses as Fh,modalClasses as Bh,modalCloseClasses as Nh,modalDialogClasses as Lh,modalOverflowClasses as Sh,dialogTitleClasses as Hh,dialogContentClasses as Eh,dialogActionsClasses as zh,tooltipClasses as Oh,tabsClasses as Vh,tabListClasses as Jh,tabPanelClasses as Yh,accordionClasses as $h,accordionDetailsClasses as qh,accordionGroupClasses as Wh,accordionSummaryClasses as Uh,AutocompleteListbox as Gh,AutocompleteOption as _h,autocompleteClasses as Rh,autocompleteListboxClasses as jh,autocompleteOptionClasses as Zh,Avatar as Xh,avatarClasses as Qh,AvatarGroup as Kh,avatarGroupClasses as eb,AspectRatio as ob,aspectRatioClasses as tb,Badge as rb,badgeClasses as nb,breadcrumbsClasses as ab,cardClasses as ib,cardActionsClasses as lb,cardContentClasses as sb,cardCoverClasses as mb,cardOverflowClasses as pb,chipClasses as db,CircularProgress as cb,circularProgressClasses as ub,Drawer as gb,drawerClasses as fb,LinearProgress as hb,linearProgressClasses as bb,List as Cb,listClasses as yb,ListDivider as xb,listDividerClasses as vb,ListItem as Mb,listItemClasses as kb,ListItemButton as Db,listItemButtonClasses as Pb,ListItemContent as Tb,listItemContentClasses as wb,ListItemDecorator as Ib,listItemDecoratorClasses as Ab,ListSubheader as Fb,listSubheaderClasses as Bb,Link as Nb,linkClasses as Lb,Slider as Sb,sliderClasses as Hb,Step as Eb,stepClasses as zb,StepButton as Ob,stepButtonClasses as Vb,StepIndicator as Jb,Stepper as Yb,stepperClasses as $b,Skeleton as qb,skeletonClasses as Wb}from"@mui/joy";import le from"react";import{AccordionGroup as ir,Accordion as lr,AccordionSummary as sr,AccordionDetails as mr}from"@mui/joy";import{motion as Ve}from"framer-motion";var pr=Ve(sr),Je=pr;Je.displayName="AccordionSummary";var dr=Ve(mr),Ye=dr;Ye.displayName="AccordionDetails";var cr=Ve(lr);function $e(e){let{summary:o,details:t,variant:n,color:i,...a}=e,r=n==="solid"?"solid":void 0;return le.createElement(cr,{variant:r,color:i,...a},le.createElement(Je,{variant:r,color:i},o),le.createElement(Ye,{variant:r,color:i},t))}$e.displayName="Accordion";var ur=Ve(ir);function lo(e){let{variant:o,color:t,items:n,...i}=e;return le.createElement(ur,{variant:o,color:t,...i},n.map((a,r)=>le.createElement($e,{key:r,summary:a.summary,details:a.details,index:r,variant:o,color:t})))}lo.displayName="Accordions";import qe from"react";import{Alert as vr,styled as Mr}from"@mui/joy";import{motion as kr}from"framer-motion";import gr from"react";import{Typography as fr}from"@mui/joy";import{motion as hr}from"framer-motion";var br=hr(fr),$=e=>gr.createElement(br,{...e});$.displayName="Typography";var Y=$;import{Stack as Cr}from"@mui/joy";import{motion as yr}from"framer-motion";var xr=yr(Cr),se=xr;se.displayName="Stack";var J=se;var Dr=Mr(kr(vr))({alignItems:"flex-start",fontWeight:"unset"});function so(e){let{title:o,content:t,actions:n,color:i="primary",...a}=e,r=e.invertedColors||e.variant==="solid";return qe.createElement(Dr,{...a,color:i,endDecorator:n,invertedColors:r},qe.createElement(J,null,o&&qe.createElement(Y,{level:"title-sm",color:i},o),qe.createElement(Y,{level:"body-sm",color:i},t)))}so.displayName="Alert";import L,{useCallback as Hr,useEffect as Er,useMemo as ce,useRef as zr,useState as Or}from"react";import{Autocomplete as Vr,AutocompleteOption as Jr,ListSubheader as Yr,AutocompleteListbox as $r,ListItemDecorator as it,CircularProgress as qr,styled as Wr}from"@mui/joy";import{useVirtualizer as Ur}from"@tanstack/react-virtual";import{Popper as Gr}from"@mui/base";import{FormControl as Pr,styled as Tr}from"@mui/joy";import{motion as wr}from"framer-motion";var Ir=Tr(wr(Pr))({width:"100%"}),me=Ir;me.displayName="FormControl";var B=me;import{FormLabel as Ar}from"@mui/joy";import{motion as Fr}from"framer-motion";var Br=Fr(Ar),pe=Br;pe.displayName="FormLabel";var N=pe;import{FormHelperText as Nr}from"@mui/joy";import{motion as Lr}from"framer-motion";var Sr=Lr(Nr),de=Sr;de.displayName="FormHelperText";var w=de;var _r=Wr(Gr,{name:"Autocomplete",slot:"Popper"})(({theme:e})=>({zIndex:e.zIndex.tooltip})),Rr=L.forwardRef((e,o)=>{let{anchorEl:t,open:n,modifiers:i,children:a,ownerState:{loading:r,size:l="md"},...m}=e,u=zr(null),g=a[0].every(h=>h.hasOwnProperty("group")),d=r?[a[1]]:a[0].length===0?[a[2]]:g?a[0].flatMap(h=>[L.createElement(Yr,{key:h.key,component:"li"},h.group),...h.children]):a[0],y=Ur({count:d.length,estimateSize:()=>36,getScrollElement:()=>u.current,overscan:5}),s=y.getVirtualItems();return Er(()=>{n&&y.measure()},[n]),L.createElement(_r,{ref:o,anchorEl:t,open:n,modifiers:i},L.createElement($r,{...m},L.createElement("div",{ref:u,style:{overflow:"auto"}},L.createElement("div",{style:{height:`${y.getTotalSize()}px`,position:"relative"}},s.map(({index:h,size:p,start:c,key:v})=>L.cloneElement(d[h],{key:v,style:{position:"absolute",top:0,left:0,width:"100%",fontSize:`var(--ceed-fontSize-${l})`,height:`${p}px`,transform:`translateY(${c}px)`,overflow:"visible"},children:L.createElement("div",{style:{textOverflow:"ellipsis",textWrap:"nowrap",overflow:"hidden",width:"100%"}},d[h].props.children)}))))))});function lt(e){let{label:o,error:t,helperText:n,color:i,size:a,disabled:r,required:l,onChange:m,onChangeComplete:u,...g}=e,[d,y]=Or(e.value||e.defaultValue),s=ce(()=>e.options.map(f=>typeof f!="object"?{value:f,label:f}:f),[e.options]),h=ce(()=>new Set(s.map(f=>f.value)),[e.options]),p=ce(()=>e.loading?{value:"",label:"",startDecorator:L.createElement(qr,{size:"sm",color:"neutral",variant:"plain",thickness:3})}:typeof d=="string"?s.find(f=>f.value===d)??d:d,[d,e.options,e.loading]),c=Hr(f=>L.isValidElement(f)&&!e.loading?L.cloneElement(f,{size:a}):f,[a,e.loading]),v=ce(()=>c(p?.startDecorator||e.startDecorator),[p,c]),D=ce(()=>c(p?.endDecorator||e.endDecorator),[p,c]),A=L.createElement(Vr,{...g,required:l,onChange:(f,b)=>{y(b);let T=b;m?.({...f,target:{...f.target,value:T?.value}}),h.has(T.value)&&u?.({...f,target:{...f.target,value:T?.value}})},color:i,value:p,options:s,size:a,disabled:r,startDecorator:v,endDecorator:D,getOptionLabel:f=>`${f.value??""}`,slots:{listbox:Rr},renderOption:(f,b)=>L.createElement(Jr,{...f},b.startDecorator&&L.createElement(it,{sx:T=>({marginInlineEnd:`var(--Input-gap, ${T.spacing(1)})`})},c(b.startDecorator)),c(b.label),b.endDecorator&&L.createElement(it,{sx:T=>({marginInlineStart:`var(--Input-gap, ${T.spacing(1)})`})},c(b.endDecorator))),renderGroup:f=>f});return o?L.createElement(B,{required:l,color:i,size:a,error:t,disabled:r},L.createElement(N,null,o),A,n&&L.createElement(w,null,n)):A}import{Box as jr}from"@mui/joy";import{motion as Zr}from"framer-motion";var Xr=Zr(jr),ue=Xr;ue.displayName="Box";var We=ue;import q from"react";import{Breadcrumbs as pt,Link as sn}from"@mui/joy";import mo from"react";import{Menu as Qr,MenuButton as Kr,MenuItem as en}from"@mui/joy";import{motion as po}from"framer-motion";var on=po(Qr),ge=e=>mo.createElement(on,{...e});ge.displayName="Menu";var tn=po(Kr),fe=e=>mo.createElement(tn,{...e});fe.displayName="MenuButton";var rn=po(en),he=e=>mo.createElement(rn,{...e});he.displayName="MenuItem";var st=ge;import{Dropdown as nn}from"@mui/joy";import{motion as an}from"framer-motion";var ln=an(nn),be=ln;be.displayName="Dropdown";var mt=be;function co(e){let{crumbs:o,size:t,startCrumbCount:n=1,endCrumbCount:i=3,slots:{link:a,...r}={link:sn},slotProps:{link:l,...m}={link:{color:"neutral"}},collapsed:u=!0,...g}=e,d=c=>c.type==="link"&&a?q.createElement(a,{to:c.linkHref,href:c.linkHref,...l},c.label):q.createElement(Y,null,c.label);if(!u)return q.createElement(pt,{size:t,slots:r,slotProps:m,...g},o.map(c=>q.createElement(d,{...c})));let y=Math.max(1,i),s=o.slice(0,n).map(c=>q.createElement(d,{...c})),h=(n+y>o.length?o.slice(n):o.slice(-y)).map(c=>q.createElement(d,{...c})),p=o.slice(n,-y).map(c=>q.createElement(he,null,q.createElement(d,{...c})));return q.createElement(pt,{size:t,slots:r,slotProps:m,...g},s,p.length&&q.createElement(mt,null,q.createElement(fe,{size:t,variant:"plain"},"..."),q.createElement(st,{size:t},p)),h)}co.displayName="Breadcrumbs";import mn,{forwardRef as pn}from"react";import{Button as dn}from"@mui/joy";import{motion as cn}from"framer-motion";var un=cn(dn),Ce=pn((e,o)=>mn.createElement(un,{ref:o,...e}));Ce.displayName="Button";var I=Ce;import x,{Fragment as xe,forwardRef as Mn,useMemo as Ct}from"react";import{styled as U}from"@mui/joy";import kn from"@mui/icons-material/esm/ChevronLeft.js";import Dn from"@mui/icons-material/esm/ChevronRight.js";import{AnimatePresence as yt,motion as Pn}from"framer-motion";var dt=e=>{let o=[],t=new Date(e.getFullYear(),e.getMonth(),1),n=new Date(e.getFullYear(),e.getMonth()+1,0),i=Math.ceil((t.getDay()+1)/7),a=Math.ceil((n.getDate()+t.getDay())/7),r=1;for(let l=1;l<=a;l++){let m=[];for(let u=1;u<=7;u++)l===i&&u<t.getDay()+1||r>n.getDate()?m.push(void 0):(m.push(r),r++);o.push(m)}return o},ct=(e,o)=>e.toLocaleString(o,{year:"numeric"}),uo=(e,o)=>e.toLocaleString(o,{year:"numeric",month:"long"}),ut=(e,o)=>new Date(0,e).toLocaleString(o,{month:"short"}),gt=e=>{let o=new Date().getDay(),t=new Date;return t.setDate(t.getDate()-o),Array.from({length:7}).map(()=>{let n=t.toLocaleString(e,{weekday:"short"});return t.setDate(t.getDate()+1),n})},ft=e=>{let o=new Date,t=new Date(e);return t.setHours(0,0,0,0),o.setHours(0,0,0,0),t.getTime()===o.getTime()},go=(e,o)=>{let t=new Date(e),n=new Date(o);return t.setHours(0,0,0,0),n.setHours(0,0,0,0),t.getTime()===n.getTime()},Z=(e,o,t)=>{let n=new Date(t);n.setHours(0,0,0,0);let i=new Date(Math.min(e.getTime(),o.getTime())),a=new Date(Math.max(e.getTime(),o.getTime()));return n>=i&&n<=a},Ue=(e,o)=>e.getFullYear()===o.getFullYear()&&e.getMonth()===o.getMonth();import gn from"react";import{IconButton as fn}from"@mui/joy";import{motion as hn}from"framer-motion";var bn=hn(fn),ye=e=>gn.createElement(bn,{...e});ye.displayName="IconButton";var V=ye;import{useCallback as Cn,useMemo as yn,useState as Ge}from"react";import{useThemeProps as xn}from"@mui/joy";var vn=(e,o)=>o.includes(e)?e:o[0],ht=e=>{let[o,t]=Ge(()=>vn(e.view||"day",e.views||["day","month"])),[n,i]=Ge(e.defaultValue),[a,r]=Ge(()=>{let p=new Date;return p.setDate(1),p.setHours(0,0,0,0),e.value?.[0]||e.defaultValue?.[0]||p}),[[l,m],u]=Ge([0,0]),g=e.view??o,d=p=>{u([l+p,p])},y=Cn(p=>{r(p),g==="month"?a.getFullYear()!==p.getFullYear()&&d(p>a?1:-1):d(p>a?1:-1),e.onMonthChange?.(p)},[e.onMonthChange,a,g]),s=xn({props:{locale:"default",views:["day","month"],view:g,value:e.value??n,...e,onChange:e.value?e.onChange:p=>{i(p),e.onChange?.(p)},onMonthChange:y,onViewChange:()=>{let p=g==="month"?"day":"month";!(!e.views||e.views.includes(p))||e.view===p||(e.onViewChange?e.onViewChange(p):t(p))}},name:"Calendar"}),h=yn(()=>({...s,viewMonth:a,direction:m}),[s,a,m]);return[s,h]};import{useCallback as ne,useState as bt}from"react";var _e=e=>{let[o,t]=bt(null),[n,i]=bt(null);return{calendarTitle:e.view==="month"?ct(e.viewMonth,e.locale||"default"):uo(e.viewMonth,e.locale||"default"),onPrev:ne(()=>{if(e.view==="day"){let a=new Date(e.viewMonth||new Date);a.setMonth(a.getMonth()-1),e.onMonthChange?.(a)}else if(e.view==="month"){let a=new Date(e.viewMonth||new Date);a.setFullYear(a.getFullYear()-1),e.onMonthChange?.(a)}},[e.onMonthChange,e.viewMonth,e.view]),onNext:ne(()=>{if(e.view==="day"){let a=new Date(e.viewMonth||new Date);a.setMonth(a.getMonth()+1),e.onMonthChange?.(a)}else if(e.view==="month"){let a=new Date(e.viewMonth||new Date);a.setFullYear(a.getFullYear()+1),e.onMonthChange?.(a)}},[e.onMonthChange,e.viewMonth,e.view]),getDayCellProps:ne(a=>{let r=new Date(e.viewMonth||new Date);r.setHours(0,0,0,0),r.setDate(a);let l=e.rangeSelection&&e.value&&e.value[0]&&(o&&Z(e.value[0],o,r)||e.value[1]&&Z(e.value[0],e.value[1],r));return{"aria-label":r.toLocaleDateString(),"aria-current":l?"date":void 0}},[e.rangeSelection,e.value,e.viewMonth,o]),getMonthCellProps:ne(a=>{let r=new Date(e.viewMonth||new Date);r.setDate(1),r.setHours(0,0,0,0),r.setMonth(a);let m=!e.views?.find(u=>u==="day")&&e.rangeSelection&&e.value&&e.value[0]&&(n&&Z(e.value[0],n,r)||e.value[1]&&Z(e.value[0],e.value[1],r));return{"aria-label":r.toLocaleDateString(),"aria-current":m?"date":void 0}},[e.rangeSelection,e.value,e.viewMonth,n]),getPickerDayProps:ne(a=>{let r=new Date(e.viewMonth||new Date);r.setHours(0,0,0,0),r.setDate(a);let l=!!e.value&&(go(r,e.value[0])||e.value[1]&&go(r,e.value[1])),m=e.rangeSelection&&e.value&&e.value[0]&&(o&&Z(e.value[0],o,r)||e.value[1]&&Z(e.value[0],e.value[1],r)),u=()=>{e.rangeSelection?e.value?e.value[0]&&!e.value[1]?e.onChange?.([new Date(Math.min(e.value[0].getTime(),r.getTime())),new Date(Math.max(e.value[0].getTime(),r.getTime()))]):e.onChange?.([r,void 0]):e.onChange?.([r,void 0]):e.onChange?.([r,void 0]),t(null)};return{isToday:ft(r),isSelected:l,onClick:u,onMouseEnter:e.rangeSelection&&e.value?.[0]&&!e.value?.[1]?()=>t(r):void 0,disabled:e.minDate&&r<e.minDate||e.maxDate&&r>e.maxDate||e.disableFuture&&r>new Date||e.disablePast&&r<(()=>{let g=new Date;return g.setHours(0,0,0,0),g})(),tabIndex:-1,"aria-label":r.toLocaleDateString(),"aria-selected":l?"true":void 0,"aria-current":m?"date":void 0}},[e.onChange,e.value,e.viewMonth,e.rangeSelection,e.minDate,e.maxDate,e.disableFuture,e.disablePast,o]),getPickerMonthProps:ne(a=>{let r=new Date(e.viewMonth||new Date);r.setDate(1),r.setHours(0,0,0,0),r.setMonth(a);let l=!e.views?.find(y=>y==="day"),m=l&&e.rangeSelection,u=!!e.value&&(Ue(r,e.value[0])||e.value[1]&&Ue(r,e.value[1])),g=m&&e.value&&e.value[0]&&(n&&Z(e.value[0],n,r)||e.value[1]&&Z(e.value[0],e.value[1],r)),d=()=>{m?e.value?e.value[0]&&!e.value[1]?e.onChange?.([new Date(Math.min(e.value[0].getTime(),r.getTime())),new Date(Math.max(e.value[0].getTime(),r.getTime()))]):e.onChange?.([r,void 0]):e.onChange?.([r,void 0]):l?e.onChange?.([r,void 0]):(e.onViewChange?.("day"),e.onMonthChange?.(r)),i(null)};return{isSelected:u,onMouseEnter:m&&e.value?.[0]&&!e.value?.[1]?()=>i(r):void 0,disabled:e.minDate&&(()=>{let y=new Date(r);return y.setMonth(y.getMonth()+1),y.setDate(0),y<e.minDate})()||e.maxDate&&(()=>{let y=new Date(r);return y.setDate(0),y>e.maxDate})()||e.disableFuture&&r>new Date||e.disablePast&&r<new Date&&!Ue(r,new Date),onClick:d,tabIndex:-1,"aria-label":uo(r,e.locale||"default"),"aria-selected":u?"true":void 0,"aria-current":g?"date":void 0}},[e.onMonthChange,e.onViewChange,e.onChange,e.viewMonth,e.locale,e.value,e.minDate,e.maxDate,e.disableFuture,e.disablePast,n])}};var Tn=U("div",{name:"Calendar",slot:"root"})({maxWidth:"264px"}),wn=U("div",{name:"Calendar",slot:"calendarHeader"})(({theme:e})=>({display:"flex",justifyContent:"space-between",alignItems:"center",padding:e.spacing(2)})),xt=U("div",{name:"Calendar",slot:"viewContainer"})(({theme:e,calendarType:o})=>({paddingLeft:e.spacing(2),paddingRight:e.spacing(2),position:"relative",overflow:"hidden",minHeight:o==="datePicker"?"250px":"unset"})),vt=U(Pn.table,{name:"Calendar",slot:"viewTable"})(({theme:e})=>({borderSpacing:0,"& td, & th":{padding:0},"& th":{paddingTop:e.spacing(2),paddingBottom:e.spacing(2)}})),In=U("thead",{name:"Calendar",slot:"weekHeaderContainer"})({}),An=U("tbody",{name:"Calendar",slot:"dayPickerContainer"})({}),Fn=U(I,{name:"Calendar",slot:"switchViewButton"})(({ownerState:e})=>[e.view==="month"&&{pointerEvents:"none"}]),Bn=U("td",{name:"Calendar",slot:"dayCell"})(({theme:e})=>({"&[aria-current=date]":{position:"relative","& button[aria-current=date]:not([aria-selected=true]):not(:hover):not(:active)":{backgroundColor:`rgb(${e.palette.primary.lightChannel})`},'& + td[aria-hidden] + td[aria-current="date"]::before':{content:'""',position:"absolute",top:0,left:"-10px",bottom:0,width:"16px",backgroundColor:`rgb(${e.palette.primary.lightChannel})`,zIndex:-1}}})),Nn=U("td",{name:"Calendar",slot:"monthCell"})(({theme:e})=>({"&[aria-current=date]":{position:"relative","& button[aria-current=date]:not([aria-selected=true]):not(:hover):not(:active)":{backgroundColor:`rgb(${e.palette.primary.lightChannel})`},'& + td[aria-hidden] + td[aria-current="date"]::before':{content:'""',position:"absolute",top:0,left:"-10px",bottom:0,width:"16px",backgroundColor:`rgb(${e.palette.primary.lightChannel})`,zIndex:-1}}})),Ln=U(I,{name:"Calendar",slot:"month"})(({theme:e,isSelected:o,disabled:t})=>[{width:"59px",textAlign:"center","&:hover":{color:e.palette.primary.softColor,backgroundColor:e.palette.primary.softHoverBg},"&:active":{color:e.palette.primary.softColor,backgroundColor:e.palette.primary.softActiveBg}},o&&{backgroundColor:e.palette.primary.solidBg,color:e.palette.primary.solidColor,"&:hover":{color:e.palette.primary.solidColor,backgroundColor:e.palette.primary.solidHoverBg},"&:active":{color:e.palette.primary.solidColor,backgroundColor:e.palette.primary.solidActiveBg}},t&&{color:e.palette.neutral.solidDisabledColor,backgroundColor:e.palette.neutral.solidDisabledBg}]),Sn=U(I,{name:"Calendar",slot:"day"})(({theme:e,isToday:o,isSelected:t,disabled:n})=>[{width:"32px",height:"32px",textAlign:"center","&:hover":{color:e.palette.primary.softColor,backgroundColor:e.palette.primary.softHoverBg},"&:active":{color:e.palette.primary.softColor,backgroundColor:e.palette.primary.softActiveBg}},o&&!t&&{"&:not([aria-current=date]):not(:hover)":{border:`1px solid ${e.palette.neutral.outlinedBorder}`}},t&&{backgroundColor:e.palette.primary.solidBg,color:e.palette.primary.solidColor,"&:hover":{color:e.palette.primary.solidColor,backgroundColor:e.palette.primary.solidHoverBg},"&:active":{color:e.palette.primary.solidColor,backgroundColor:e.palette.primary.solidActiveBg}},n&&{color:e.palette.neutral.solidDisabledColor,backgroundColor:e.palette.neutral.solidDisabledBg}]),Mt={enter:e=>({x:e>0?300:-300,opacity:0}),center:{position:"relative",zIndex:1,x:0,opacity:1},exit:e=>({position:"absolute",zIndex:0,x:e<0?300:-300,opacity:0})},Re=1e4,kt=(e,o)=>Math.abs(e)*o,Hn=e=>{let{ownerState:o}=e,{getPickerDayProps:t,getDayCellProps:n}=_e(o),i=Ct(()=>dt(o.viewMonth),[o.viewMonth]),a=Ct(()=>gt(o.locale||"default"),[o.locale]);return x.createElement(xt,{calendarType:"datePicker"},x.createElement(yt,{initial:!1,custom:o.direction},x.createElement(vt,{key:`${o.viewMonth.toString()}_${o.direction}`,custom:o.direction,variants:Mt,initial:"enter",animate:"center",exit:"exit",transition:{x:{type:"spring",stiffness:300,damping:30},opacity:{duration:.2}},drag:"x",dragConstraints:{left:0,right:0},dragElastic:1,onDragEnd:(r,{offset:l,velocity:m})=>{let u=kt(l.x,m.x);if(u<-Re){let g=new Date(o.viewMonth||new Date);g.setMonth(g.getMonth()+1),o.onMonthChange?.(g)}else if(u>Re){let g=new Date(o.viewMonth||new Date);g.setMonth(g.getMonth()-1),o.onMonthChange?.(g)}}},x.createElement(In,null,x.createElement("tr",null,a.map((r,l)=>x.createElement(x.Fragment,null,x.createElement("th",null,x.createElement(Y,{level:"body-xs",textAlign:"center"},r)),l<6&&x.createElement("th",{style:{width:4},"aria-hidden":"true","aria-description":"cell-gap"}))))),x.createElement(An,null,i.map((r,l)=>x.createElement(xe,{key:`${o.viewMonth}_${l}`},x.createElement("tr",null,r.map((m,u)=>m?x.createElement(xe,{key:u},x.createElement(Bn,{...n(m)},x.createElement(Sn,{size:"sm",variant:"plain",color:"neutral",...t(m)},m)),u<6&&x.createElement("td",{"aria-hidden":"true","aria-description":"cell-gap"})):x.createElement(xe,{key:u},x.createElement("td",null),u<6&&x.createElement("td",{"aria-hidden":"true","aria-description":"cell-gap"})))),l<i.length-1&&x.createElement("tr",{"aria-hidden":"true","aria-description":"row-gap"},x.createElement("td",{colSpan:13,style:{height:4}}))))))))},En=e=>{let{ownerState:o}=e,{getPickerMonthProps:t,getMonthCellProps:n}=_e(o),i=Array.from({length:12},(r,l)=>l).reduce((r,l)=>(r[r.length-1].length===4&&r.push([]),r[r.length-1].push(l),r),[[]]),a=!o.views?.find(r=>r==="day");return x.createElement(xt,{calendarType:a?"monthPicker":"datePicker"},x.createElement(yt,{initial:!1,custom:o.direction},x.createElement(vt,{key:`${o.viewMonth.getFullYear()}_${o.direction}`,custom:o.direction,variants:Mt,initial:"enter",animate:"center",exit:"exit",transition:{x:{type:"spring",stiffness:300,damping:30},opacity:{duration:.2}},drag:"x",dragConstraints:{left:0,right:0},dragElastic:1,onDragEnd:(r,{offset:l,velocity:m})=>{let u=kt(l.x,m.x);if(u<-Re){let g=new Date(o.viewMonth||new Date);g.setMonth(g.getMonth()+1),o.onMonthChange?.(g)}else if(u>Re){let g=new Date(o.viewMonth||new Date);g.setMonth(g.getMonth()-1),o.onMonthChange?.(g)}}},x.createElement("tbody",null,i.map((r,l)=>x.createElement(xe,{key:l},x.createElement("tr",null,r.map((m,u)=>x.createElement(xe,{key:m},x.createElement(Nn,{...n(m)},x.createElement(Ln,{size:"sm",variant:"plain",color:"neutral",...t(m)},ut(m,o.locale))),u<3&&x.createElement("td",{style:{width:4},"aria-hidden":"true","aria-description":"cell-gap"})))),l<i.length-1&&x.createElement("tr",{"aria-hidden":"true","aria-description":"row-gap"},x.createElement("td",{colSpan:7,style:{height:4}}))))))))},ve=Mn((e,o)=>{let[t,n]=ht(e),{value:i,defaultValue:a,onChange:r,locale:l,onViewChange:m,onMonthChange:u,view:g,views:d,rangeSelection:y,...s}=t,{calendarTitle:h,onPrev:p,onNext:c}=_e(n);return x.createElement(Tn,{ref:o,...s},x.createElement(wn,null,x.createElement(V,{size:"sm",onClick:p},x.createElement(kn,null)),x.createElement(Fn,{ownerState:n,variant:"plain",color:"neutral",onClick:m},h),x.createElement(V,{size:"sm",onClick:c},x.createElement(Dn,null))),g==="day"&&x.createElement(Hn,{ownerState:n}),g==="month"&&x.createElement(En,{ownerState:n}))});ve.displayName="Calendar";var K=ve;import{Card as zn,CardContent as On,CardCover as Vn,CardActions as Jn,CardOverflow as Yn}from"@mui/joy";import{motion as Me}from"framer-motion";var $n=Me(zn),ke=$n;ke.displayName="Card";var qn=Me(On),fo=qn;fo.displayName="CardContent";var Wn=Me(Vn),ho=Wn;ho.displayName="CardCover";var Un=Me(Jn),bo=Un;bo.displayName="CardActions";var Gn=Me(Yn),Co=Gn;Co.displayName="CardOverflow";import _n from"react";import{Checkbox as Rn}from"@mui/joy";import{motion as jn}from"framer-motion";var Zn=jn(Rn),De=e=>_n.createElement(Zn,{...e});De.displayName="Checkbox";var Pe=De;import{Chip as Xn}from"@mui/joy";import{motion as Qn}from"framer-motion";var Kn=Qn(Xn),yo=Kn;yo.displayName="Chip";import{styled as ea}from"@mui/joy";import oa,{forwardRef as ta}from"react";var ra=ea("div",{name:"Container",slot:"root",shouldForwardProp:e=>e!=="maxWidth"})(({theme:e,maxWidth:o="lg"})=>({width:"100%",marginLeft:"auto",boxSizing:"border-box",marginRight:"auto",display:"block",paddingLeft:e.spacing(4),paddingRight:e.spacing(4),...o==="sm"&&{[e.breakpoints.up("xs")]:{maxWidth:e.breakpoints.values.sm}},...o==="md"&&{[e.breakpoints.up("sm")]:{maxWidth:e.breakpoints.values.md}},...o==="lg"&&{[e.breakpoints.up("md")]:{maxWidth:e.breakpoints.values.lg}},...o==="xl"&&{[e.breakpoints.up("lg")]:{maxWidth:e.breakpoints.values.xl}}})),xo=ta(function(o,t){return oa.createElement(ra,{ref:t,...o})});xo.displayName="Container";import X,{useCallback as la,useMemo as sa,useState as Tt}from"react";import{IntlMessageFormat as ma}from"intl-messageformat";import{NumericFormat as pa}from"react-number-format";import da from"@mui/icons-material/esm/InfoOutlined.js";import Te from"react";import{Input as na}from"@mui/joy";import{motion as aa}from"framer-motion";var Dt=aa(na),we=e=>{let{label:o,helperText:t,error:n,style:i,size:a,color:r,disabled:l,required:m,...u}=e;return o?Te.createElement(B,{required:m,color:r,size:a,error:n,disabled:l},Te.createElement(N,null,o),Te.createElement(Dt,{...u}),t&&Te.createElement(w,null,t)):Te.createElement(Dt,{required:m,color:r,size:a,disabled:l,...u})};we.displayName="Input";var R=we;import ia from"intl-messageformat";var Pt=(e="usd")=>{let[o,t,n]=new ia(`{amount, number, ::currency/${e} unit-width-narrow}`).format({amount:1e3}).toString().replace(/\d/g,"").split("");return{symbol:`${o} `,thousandSeparator:t,decimalSeparator:n,placeholder:n?`${o} 0${n}00`:`${o} 0`,fixedDecimalScale:!!n}};var ca=X.forwardRef(function(o,t){let{onChange:n,...i}=o;return X.createElement(pa,{...i,onValueChange:({value:a})=>{n?.({target:{name:o.name,value:a}})},valueIsNumericString:!0,getInputRef:t,decimalScale:2})}),wt=X.forwardRef(function(o,t){let{currency:n="usd",max:i=1e5,name:a,onChange:r,label:l,error:m,helperText:u,required:g,disabled:d,useMinorUnit:y,...s}=o,{symbol:h,thousandSeparator:p,decimalSeparator:c,placeholder:v,fixedDecimalScale:D}=Pt(n),[k,A]=Tt(o.value),[f,b]=Tt(!!i&&!!o.value&&o.value>i),T=sa(()=>k&&y?k/100:k,[k,y]),M=la(O=>{let te=Number(y?O.target.value?.replace(c,""):O.target.value);A(te),r?.({...O,target:{name:a,value:te}}),i&&te>i?b(!0):b(!1)},[]),P=X.createElement(R,{...s,size:"sm",ref:t,value:T,placeholder:v,onChange:M,disabled:d,required:g,slotProps:{input:{component:ca,decimalSeparator:c,thousandSeparator:p,prefix:h,fixedDecimalScale:D}},sx:{fontFamily:"monospace"}});return l?X.createElement(B,{size:"sm",disabled:d,required:g,error:m||f},X.createElement(N,null,l),P,f?X.createElement(w,null,X.createElement(da,null),new ma(`limit: {amount, number, ::currency/${n} unit-width-narrow}`).format({amount:i})):u&&X.createElement(w,null,u)):P});import C,{useCallback as ae,useEffect as ko,useMemo as ie,useRef as ba,useState as Ca}from"react";import{styled as ya,LinearProgress as xa}from"@mui/joy";import va from"@mui/icons-material/esm/ChevronLeft.js";import Ma from"@mui/icons-material/esm/ChevronRight.js";import{Sheet as ua}from"@mui/joy";import{motion as ga}from"framer-motion";var fa=ga(ua),Ie=fa;Ie.displayName="Sheet";var W=Ie;import G from"react";import{Table as ha}from"@mui/joy";var Ae=e=>{let{children:o,...t}=e;return G.createElement(ha,{...t},o)};Ae.displayName="Table";function vo(e){let{headCells:o,showCheckbox:t,onCheckboxChange:n,slots:{checkbox:i=Pe}={},slotProps:{checkbox:a={}}={}}=e;return G.createElement("thead",null,G.createElement("tr",null,t&&G.createElement("th",{style:{width:"40px",textAlign:"center"}},G.createElement(i,{onChange:n,...a})),o.map(r=>G.createElement("th",{key:r.label,style:{width:r.width,minWidth:r.minWidth,maxWidth:r.maxWidth,textAlign:r.numeric?"right":"left"}},r.label))))}vo.displayName="TableHead";function Mo(e){let{rows:o,cellOrder:t,rowOptions:n,showCheckbox:i,onCheckboxChange:a,slots:{checkbox:r=Pe}={},slotProps:{checkbox:l={}}={}}=e;return G.createElement("tbody",null,o.map((m,u)=>G.createElement("tr",{key:u},i&&G.createElement("td",{style:{textAlign:"center"}},G.createElement(r,{onChange:g=>a?.(g,u),...l})),t.map(g=>G.createElement("td",{key:g,style:{textAlign:n?.[g]?.numeric?"right":"left"}},m[g])))))}Mo.displayName="TableBody";var It=ya("tr",{name:"DataTable",slot:"overlayWrapper"})({position:"sticky",top:"calc(var(--unstable_TableCell-height, 32px))",left:0,right:0,zIndex:1,"& > td":{height:0,padding:0,border:"none !important"}}),je=e=>"Intl"in window?new Intl.NumberFormat().format(e):e;function ka(e){let{paginationModel:{page:o,pageSize:t},rowCount:n,onPageChange:i}=e,a=1,r=Math.ceil(n/t),l=[o-2,o-1].filter(d=>d>1),m=[o+1,o+2].filter(d=>d<=r-1),u=r>1&&o<r-3,g=r>1&&o>4;return C.createElement(J,{direction:"row",spacing:1,sx:{pt:1,pb:1},justifyContent:"end",alignItems:"center"},C.createElement(J,{direction:"row",spacing:.5,alignItems:"center"},C.createElement(V,{size:"sm",variant:"plain",color:"neutral",onClick:()=>i(o-1),disabled:o===a,"aria-label":"Previous page"},C.createElement(va,null)),o!==a&&C.createElement(I,{size:"sm",variant:"plain",color:"neutral",onClick:()=>i(a)},a),g&&C.createElement(I,{size:"sm",variant:"plain",color:"neutral",onClick:()=>i(o-3)},"..."),l.map(d=>C.createElement(I,{key:d,size:"sm",variant:"plain",color:"neutral",onClick:()=>i(d)},d)),C.createElement(I,{variant:"soft",size:"sm"},o),m.map(d=>C.createElement(I,{key:d,size:"sm",variant:"plain",color:"neutral",onClick:()=>i(d)},d)),u&&C.createElement(I,{size:"sm",variant:"plain",color:"neutral",onClick:()=>i(o+3)},"..."),o!==r&&C.createElement(I,{size:"sm",variant:"plain",color:"neutral",onClick:()=>i(r)},r),C.createElement(V,{size:"sm",variant:"plain",color:"neutral",onClick:()=>i(o+1),disabled:o===r,"aria-label":"Next page"},C.createElement(Ma,null))))}var Da=e=>C.createElement(We,{sx:{position:"absolute",top:0,right:0,bottom:0,width:"4px",cursor:"col-resize"},onMouseDown:o=>{let t=o.clientX,n=e.current?.getBoundingClientRect().width,i=r=>{n&&t&&(e.current.style.width=`${n+(r.clientX-t)}px`)},a=()=>{document.removeEventListener("mousemove",i),document.removeEventListener("mouseup",a)};document.addEventListener("mousemove",i),document.addEventListener("mouseup",a)}}),Pa=e=>{let o=ba(null),t={width:e.width,minWidth:e.minWidth??"50px",maxWidth:e.maxWidth,textAlign:e.type==="number"?"end":"start",position:e.stickyHeader?void 0:"relative"},n=e.resizable??!0?Da(o):null;return C.createElement("th",{ref:o,key:e.field,style:t},e.headerName??e.field,n)};function Ta({rows:e,columns:o,rowCount:t,pagination:n,paginationMode:i,paginationModel:a,onPaginationModelChange:r,selectionModel:l=[],onSelectionModelChange:m,getId:u,isTotalSelected:g}){let[d,y]=Ca(a?.page||1),s=a?.pageSize||20,h=ae((f,b)=>u?.(f)??f?.id??`${(b||0)+(d-1)*s}`,[u??d,s]),p=ie(()=>new Set(l),[l]),c=ie(()=>!n||i==="server"?e:e.slice((d-1)*s,(d-1)*s+s),[e,d,s,i,n]),v=ie(()=>c.length>0&&c.every((f,b)=>p.has(h(f,b))),[c,p,d,s,h]),D=t||e.length,k=ie(()=>g??(D>0&&l.length===D),[g,l,D]),A=ae(f=>{y(f),r?.({page:f,pageSize:s})},[r]);return ko(()=>{A(1)},[D]),ko(()=>{let f=Math.max(1,Math.ceil(D/s));d>f&&A(f)},[d,D,s]),ko(()=>{m?.([])},[d]),{rowCount:D,page:d,pageSize:s,onPaginationModelChange:A,getId:h,HeadCell:Pa,dataInPage:c,isAllSelected:v,isTotalSelected:k,isSelectedRow:ae(f=>p.has(f),[p]),onAllCheckboxChange:ae(()=>{m?.(v?[]:c.map(h))},[v,c,m]),onCheckboxChange:ae((f,b)=>{if(p.has(b)){let T=l.filter(M=>M!==b);m?.(T)}else{let T=[...l,b];m?.(T)}},[l,m]),columns:ie(()=>o||Object.keys(e[0]||{}).map(f=>({field:f})),[e,o]),onTotalSelect:ae(()=>{m?.(k?[]:e.map(h),!k)},[k,e,m])}}function Do(e){let{rows:o,checkboxSelection:t,selectionModel:n,onSelectionModelChange:i,rowCount:a,columns:r,onPaginationModelChange:l,pagination:m,paginationMode:u,paginationModel:g,loading:d,slots:{checkbox:y=Pe,toolbar:s,footer:h,loadingOverlay:p=()=>C.createElement(xa,{value:8,variant:"plain"})}={},slotProps:{checkbox:c={},toolbar:v,background:D={}}={},...k}=e,{columns:A,isAllSelected:f,isSelectedRow:b,onAllCheckboxChange:T,onCheckboxChange:M,getId:P,rowCount:O,page:te,pageSize:io,onPaginationModelChange:or,dataInPage:tr,isTotalSelected:nt,onTotalSelect:at,HeadCell:rr}=Ta(e),nr=ie(()=>({page:te,pageSize:io}),[te,io]);return C.createElement(We,null,C.createElement(J,{direction:"row",sx:{pt:1,pb:1},justifyContent:"space-between",alignItems:"center"},!!t&&C.createElement(J,{direction:"row",spacing:1},!f&&C.createElement(Y,{level:"body-xs"},je(n?.length||0)," items selected"),f&&!nt&&C.createElement(J,{direction:"row",spacing:1,alignItems:"center"},C.createElement(Y,{level:"body-xs"},"All ",je(n?.length||0)," items on this page are selected."),C.createElement(I,{size:"sm",variant:"plain",onClick:at},"Select all ",je(O??o.length)," items")),nt&&C.createElement(J,{direction:"row",spacing:1,alignItems:"center"},C.createElement(Y,{level:"body-xs"},"All ",je(O??o.length)," items are selected."),C.createElement(I,{size:"sm",variant:"plain",color:"danger",onClick:at},"Cancel"))),s&&C.createElement(s,{...v||{}})),C.createElement(W,{variant:"outlined",sx:{overflow:"auto",width:"100%",boxShadow:"sm",borderRadius:"sm"},...D},C.createElement(Ae,{...k},C.createElement("thead",null,C.createElement("tr",null,t&&C.createElement("th",{style:{width:"40px",textAlign:"center"}},C.createElement(y,{onChange:T,checked:f,indeterminate:(n||[]).length>0&&!f,...c})),A.map(oe=>C.createElement(rr,{key:oe.field,stickyHeader:e.stickyHeader,...oe})))),C.createElement("tbody",null,C.createElement(It,null,!!d&&C.createElement("td",null,C.createElement(We,{sx:{position:"absolute",top:0,left:0,right:0}},C.createElement(p,null)))),C.createElement(It,null),tr.map((oe,ar)=>{let re=P(oe,ar);return C.createElement("tr",{key:re,role:t?"checkbox":void 0,tabIndex:t?-1:void 0,onClick:t?_=>M(_,re):void 0,"aria-checked":t?b(re):void 0},t&&C.createElement("th",{scope:"row",style:{textAlign:"center"}},C.createElement(y,{onChange:_=>M(_,re),checked:b(re),...c})),A.map(_=>C.createElement("td",{key:_.field,style:{textAlign:_.type&&["number","date"].includes(_.type)?"end":"start"}},_.renderCell?.({row:oe,value:oe[_.field],id:re})??oe[_.field])))})),h&&C.createElement(h,null))),io<O&&m&&C.createElement(ka,{paginationModel:nr,rowCount:O,onPageChange:or}))}Do.displayName="DataTable";import S,{forwardRef as Na,useCallback as At,useEffect as La,useImperativeHandle as Sa,useRef as Ha,useState as Ft}from"react";import{IMaskInput as Ea,IMask as Po}from"react-imask";import za from"@mui/icons-material/esm/CalendarToday.js";import{styled as To}from"@mui/joy";import{FocusTrap as Oa,ClickAwayListener as Va,Popper as Ja}from"@mui/base";import{DialogActions as wa,styled as Ia}from"@mui/joy";import{motion as Aa}from"framer-motion";var Fa=Aa(wa),Ba=Ia(Fa)(({theme:e})=>({padding:e.spacing(2),gap:e.spacing(2),flexDirection:"row",justifyContent:"flex-end"})),Fe=Ba;Fe.displayName="DialogActions";var j=Fe;var Ya=To(Ja,{name:"DatePicker",slot:"popper"})(({theme:e})=>({zIndex:e.zIndex.tooltip})),$a=To(W,{name:"DatePicker",slot:"sheet",overridesResolver:(e,o)=>o.root})(({theme:e})=>({width:"264px",boxShadow:e.shadow.md,borderRadius:e.radius.md})),qa=To("div",{name:"DatePicker",slot:"container"})({width:"100%"}),Bt=e=>{let o=`${e.getDate()}`,t=`${e.getMonth()+1}`,n=e.getFullYear();return Number(o)<10&&(o="0"+o),Number(t)<10&&(t="0"+t),[n,t,o].join("/")},Wa=S.forwardRef(function(o,t){let{onChange:n,...i}=o;return S.createElement(Ea,{...i,inputRef:t,onAccept:a=>n({target:{name:o.name,value:a}}),mask:Date,pattern:"Y/`m/`d",blocks:{d:{mask:Po.MaskedRange,from:1,to:31,maxLength:2},m:{mask:Po.MaskedRange,from:1,to:12,maxLength:2},Y:{mask:Po.MaskedRange,from:1900,to:9999}},format:Bt,parse:a=>{let r=a.split("/");return new Date(Number(r[0]),Number(r[1])-1,Number(r[2]))},autofix:"pad",overwrite:!0})}),Nt=Na((e,o)=>{let{onChange:t,disabled:n,label:i,error:a,helperText:r,minDate:l,maxDate:m,disableFuture:u,disablePast:g,required:d,...y}=e,s=Ha(null),[h,p]=Ft(e.value||""),[c,v]=Ft(null),D=!!c;La(()=>{p(e.value||"")},[e.value]),Sa(o,()=>s.current,[s.current]);let k=At(b=>{p(b.target.value),t?.(b)},[]),A=At(b=>{v(c?null:b.currentTarget),s.current?.focus()},[c,v,s]),f=S.createElement(qa,null,S.createElement(Oa,{open:!0},S.createElement(S.Fragment,null,S.createElement(R,{...y,ref:s,size:"sm",value:h,onChange:k,placeholder:"YYYY/MM/DD",disabled:n,required:d,slotProps:{input:{component:Wa,ref:s}},sx:{fontFamily:"monospace"},endDecorator:S.createElement(V,{variant:"plain",onClick:A},S.createElement(za,null))}),D&&S.createElement(Va,{onClickAway:()=>v(null)},S.createElement(Ya,{id:"date-picker-popper",open:!0,anchorEl:c,placement:"bottom-end",onMouseDown:b=>b.preventDefault(),modifiers:[{name:"offset",options:{offset:[4,4]}}]},S.createElement($a,{tabIndex:-1,role:"presentation"},S.createElement(K,{value:Number.isNaN(new Date(h).getTime())?void 0:[new Date(h),void 0],onChange:([b])=>{k({target:{name:e.name,value:Bt(b)}}),v(null),s.current?.blur()},minDate:l?new Date(l):void 0,maxDate:m?new Date(m):void 0,disableFuture:u,disablePast:g}),S.createElement(j,{sx:{p:1}},S.createElement(I,{size:"sm",variant:"plain",color:"neutral",onClick:()=>{k({target:{name:e.name,value:""}}),v(null),s.current?.blur()}},"Clear"))))))));return i?S.createElement(B,{required:d,disabled:n,error:a,size:"sm"},S.createElement(N,null,i),f,r&&S.createElement(w,null,r)):f});import H,{forwardRef as Ua,useCallback as wo,useEffect as Ga,useImperativeHandle as _a,useMemo as Ra,useRef as ja,useState as Lt}from"react";import{IMaskInput as Za,IMask as Io}from"react-imask";import Xa from"@mui/icons-material/esm/CalendarToday.js";import{styled as Ao}from"@mui/joy";import{FocusTrap as Qa,ClickAwayListener as Ka,Popper as ei}from"@mui/base";var oi=Ao(ei,{name:"DateRangePicker",slot:"popper"})(({theme:e})=>({zIndex:e.zIndex.tooltip})),ti=Ao(W,{name:"DateRangePicker",slot:"sheet",overridesResolver:(e,o)=>o.root})(({theme:e})=>({zIndex:e.zIndex.tooltip,width:"264px",boxShadow:e.shadow.md,borderRadius:e.radius.md})),ri=Ao("div",{name:"DateRangePicker",slot:"container"})({width:"100%"}),St=([e,o])=>{let t=n=>{let i=`${n.getDate()}`,a=`${n.getMonth()+1}`,r=n.getFullYear();return Number(i)<10&&(i="0"+i),Number(a)<10&&(a="0"+a),[r,a,i].join("/")};return[t(e),o?t(o):""].join(" - ")},Ht=e=>{let o=e.split(" - ")[0]||"",t=e.split(" - ")[1]||"",n=o.split("/"),i=t.split("/");return[new Date(Number(n[0]),Number(n[1])-1,Number(n[2])),new Date(Number(i[0]),Number(i[1])-1,Number(i[2]))]},ni=H.forwardRef(function(o,t){let{onChange:n,...i}=o;return H.createElement(Za,{...i,inputRef:t,onAccept:a=>n({target:{name:o.name,value:a}}),mask:Date,pattern:"Y/`m/`d - Y/`m/`d",blocks:{d:{mask:Io.MaskedRange,from:1,to:31,maxLength:2},m:{mask:Io.MaskedRange,from:1,to:12,maxLength:2},Y:{mask:Io.MaskedRange,from:1900,to:9999}},format:St,parse:Ht,autofix:"pad",overwrite:!0})}),Fo=Ua((e,o)=>{let{onChange:t,disabled:n,label:i,error:a,helperText:r,minDate:l,maxDate:m,disableFuture:u,disablePast:g,required:d,...y}=e,s=ja(null),[h,p]=Lt(e.value||""),[c,v]=Lt(null),D=!!c,k=Ra(()=>h?Ht(h):void 0,[h]);Ga(()=>{p(e.value||"")},[e.value]),_a(o,()=>s.current,[s.current]);let A=wo(M=>{p(M.target.value),t?.(M)},[t]),f=wo(M=>{v(c?null:M.currentTarget),s.current?.focus()},[c,v,s]),b=wo(([M,P])=>{!M||!P||(s.current?.blur(),p(St([M,P])),v(null))},[p,v,s]),T=H.createElement(ri,null,H.createElement(Qa,{open:!0},H.createElement(H.Fragment,null,H.createElement(R,{...y,ref:o,size:"sm",value:h,onChange:A,disabled:n,required:d,placeholder:"YYYY/MM/DD - YYYY/MM/DD",slotProps:{input:{component:ni,ref:s}},sx:{fontFamily:"monospace"},endDecorator:H.createElement(V,{variant:"plain",onClick:f},H.createElement(Xa,null))}),D&&H.createElement(Ka,{onClickAway:()=>v(null)},H.createElement(oi,{id:"date-range-picker-popper",open:!0,anchorEl:c,placement:"bottom-end",onMouseDown:M=>M.preventDefault(),modifiers:[{name:"offset",options:{offset:[4,4]}}]},H.createElement(ti,{tabIndex:-1,role:"presentation"},H.createElement(K,{rangeSelection:!0,defaultValue:k,onChange:b,minDate:l?new Date(l):void 0,maxDate:m?new Date(m):void 0,disableFuture:u,disablePast:g}),H.createElement(j,{sx:{p:1}},H.createElement(I,{size:"sm",variant:"plain",color:"neutral",onClick:()=>{p(""),v(null),s.current?.blur()}},"Clear"))))))));return i?H.createElement(B,{required:d,disabled:n,error:a,size:"sm"},H.createElement(N,null,i),T,r&&H.createElement(w,null,r)):T});Fo.displayName="DateRangePicker";import{DialogContent as ai,styled as ii}from"@mui/joy";import{motion as li}from"framer-motion";var si=li(ai),mi=ii(si)(({theme:e})=>({padding:e.spacing(0,6,5)})),Be=mi;Be.displayName="DialogContent";var Ze=Be;import{DialogTitle as pi,styled as di}from"@mui/joy";import{motion as ci}from"framer-motion";var ui=ci(pi),gi=di(ui)(({theme:e})=>({padding:e.spacing(4,6)})),Ne=gi;Ne.displayName="DialogTitle";var Xe=Ne;import Se from"react";import Qe from"react";import{Modal as fi,ModalDialog as hi,ModalClose as bi,ModalOverflow as Ci,styled as Et}from"@mui/joy";import{motion as Ke}from"framer-motion";var yi=Ke(fi),Bo=yi;Bo.displayName="Modal";var xi=Ke(hi),zt=Et(xi)({padding:0}),Le=zt;Le.displayName="ModalDialog";var vi=Et(Ke(bi))(({theme:e})=>({top:e.spacing(3),right:e.spacing(6)})),eo=vi;eo.displayName="ModalClose";var Mi=Ke(Ci),No=Mi;No.displayName="ModalOverflow";function Lo(e){let{title:o,children:t,...n}=e;return Qe.createElement(zt,{...n},Qe.createElement(eo,null),Qe.createElement(Xe,null,o),Qe.createElement(Ze,null,t))}Lo.displayName="ModalFrame";import{styled as ki}from"@mui/joy";var Di=ki(Le)(({theme:e})=>({padding:0})),So=Se.forwardRef((e,o)=>{let{title:t,children:n,actions:i,...a}=e;return Se.createElement(Di,{ref:o,...a},Se.createElement(Xe,null,t),Se.createElement(Ze,null,n),Se.createElement(j,null,i))});So.displayName="DialogFrame";import Pi from"react";import{Divider as Ti}from"@mui/joy";import{motion as wi}from"framer-motion";var Ii=wi(Ti),He=e=>Pi.createElement(Ii,{...e});He.displayName="Divider";import Ai from"react";import{Drawer as Fi}from"@mui/joy";import{motion as Bi}from"framer-motion";var Ni=Bi(Fi),Ho=e=>{let{children:o,...t}=e;return Ai.createElement(Ni,{...t,slotProps:{...t.slotProps,content:{...t.slotProps?.content,sx:{bgcolor:"transparent",p:{md:3,sm:0},boxShadow:"none"}}}},o)};Ho.displayName="InsetDrawer";import F,{useCallback as oo,useEffect as Li,useMemo as Ot,useRef as Vt,useState as Eo}from"react";import{styled as ee}from"@mui/joy";import Si from"@mui/icons-material/esm/InfoOutlined.js";import Hi from"@mui/icons-material/esm/CloudUploadRounded.js";import Ei from"@mui/icons-material/esm/UploadFileRounded.js";import zi from"@mui/icons-material/esm/ClearRounded.js";import{combine as Oi}from"@atlaskit/pragmatic-drag-and-drop/dist/esm/entry-point/combine.js";import{dropTargetForExternal as Vi,monitorForExternal as Ji}from"@atlaskit/pragmatic-drag-and-drop/dist/esm/entry-point/external/adapter.js";import{containsFiles as Jt,getFiles as Yi}from"@atlaskit/pragmatic-drag-and-drop/dist/esm/entry-point/external/file.js";import{preventUnhandled as Yt}from"@atlaskit/pragmatic-drag-and-drop/dist/esm/entry-point/prevent-unhandled.js";var $i=ee("input")({width:"1px",height:"1px",overflow:"hidden",whiteSpace:"nowrap",clip:"rect(0 0 0 0)",clipPath:"inset(50%)",position:"absolute"}),qi=ee(J,{name:"Uploader",slot:"PreviewRoot"})({}),Wi=ee(ke,{name:"Uploader",slot:"UploadCard"})(({theme:e})=>({padding:e.spacing(2.5),border:`1px solid ${e.palette.neutral.outlinedBorder}`})),Ui=ee(Ei,{name:"Uploader",slot:"UploadFileIcon"})(({theme:e})=>({color:e.palette.neutral[400],width:"32px",height:"32px"})),Gi=ee(zi,{name:"Uploader",slot:"ClearIcon"})(({theme:e})=>({color:e.palette.neutral.plainColor,width:"18px",height:"18px"})),_i=["byte","kilobyte","megabyte","gigabyte","terabyte","petabyte"],$t=e=>{let o=e==0?0:Math.floor(Math.log(e)/Math.log(1024)),t=e/Math.pow(1024,o),n=_i[o];return Intl.NumberFormat("en-us",{style:"unit",unit:n,unitDisplay:"narrow"}).format(t)},Ri=e=>{let{files:o,onDelete:t}=e;return F.createElement(qi,{gap:1},o.map(n=>F.createElement(Wi,{key:n.name,size:"sm",color:"neutral"},F.createElement(J,{direction:"row",alignItems:"center",gap:2},F.createElement(Ui,null),F.createElement(J,{flex:"1"},F.createElement(Y,{level:"body-sm",textColor:"common.black"},n.name),F.createElement(Y,{level:"body-xs",fontWeight:"300",lineHeight:"1.33",textColor:"text.tertiary"},$t(n.size))),F.createElement(V,{onClick:()=>t?.(n)},F.createElement(Gi,null))))))},ji=ee(J,{name:"Uploader",slot:"root"})(({theme:e})=>({gap:e.spacing(2)})),Zi=ee(W,{name:"Uploader",slot:"dropZone"})(({theme:e,state:o,error:t})=>({width:"100%",display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center",padding:e.spacing(5),gap:e.spacing(4),cursor:"pointer",backgroundColor:e.palette.background.surface,border:t?`1px solid ${e.palette.danger.outlinedBorder}`:o==="idle"?`1px solid ${e.palette.neutral.outlinedBorder}`:`1px solid ${e.palette.primary.outlinedBorder}`})),Xi=ee(Hi,{name:"Uploader",slot:"iconContainer"})(({theme:e,state:o,error:t})=>({color:t?`rgba(${e.vars.palette.danger.mainChannel} / 0.6)`:o==="over"?`rgba(${e.palette.primary.mainChannel} / 0.6)`:e.palette.neutral.softActiveBg,width:"32px",height:"32px"})),zo=F.memo(e=>{let{accept:o,maxCount:t,name:n,size:i,maxSize:a,onChange:r,label:l,helperText:m}=e,u=Vt(null),g=Vt(null),[d,y]=Eo(),[s,h]=Eo([]),[p,c]=Eo("idle"),v=Ot(()=>!!d||e.error,[e.error,d]),D=Ot(()=>!t||t&&s.length!==t,[s,t]),k=oo(M=>{try{a&&M.forEach(O=>{if(O.size>a)throw new Error(`File size exceeds the limit: ${$t(a)}`)});let P=[...s,...M];if(t&&P.length>t)throw new Error(`File count exceeds the limit: ${t}`);r?.({target:{name:n,value:P}}),h(P)}catch(P){y(P.message)}},[s]);Li(()=>{let M=u.current;if(M)return Oi(Vi({element:M,canDrop:Jt,onDragEnter:()=>c("over"),onDragLeave:()=>c("potential"),onDrop:async({source:P})=>{let O=await Yi({source:P});k(O)}}),Ji({canMonitor:Jt,onDragStart:()=>{c("potential"),Yt.start()},onDrop:()=>{c("idle"),Yt.stop()}}))});let A=oo(M=>{let P=Array.from(M.target.files||[]);k(P)},[k]),f=oo(M=>{h(P=>(r?.({target:{name:n,value:P.filter(O=>O!==M)}}),P.filter(O=>O!==M)))},[]),b=oo(()=>{g.current?.click()},[]);return F.createElement(ji,null,D&&F.createElement(B,{size:i,error:!!v},l&&F.createElement(N,null,l),F.createElement(Zi,{state:p,error:v,ref:u,onClick:b},F.createElement(J,{alignItems:"center",gap:1},F.createElement(Xi,{state:p,error:v})),F.createElement($i,{type:"file",onChange:A,multiple:!0,accept:o,ref:g})),d?F.createElement(w,null,F.createElement(Si,null),d):m&&F.createElement(w,null,m)),s.length>0&&F.createElement(Ri,{files:s,onDelete:f}))});zo.displayName="Uploader";import{Grid as Qi}from"@mui/joy";import{motion as Ki}from"framer-motion";var el=Ki(Qi),Oo=el;Oo.displayName="Grid";import Q from"react";import ol from"react-markdown";import{Link as tl}from"@mui/joy";var Vo=e=>{let{children:o,color:t,textColor:n,defaultLevel:i="body-md",markdownOptions:a,...r}=e;return Q.createElement($,{color:t,textColor:n,...r},Q.createElement(ol,{...a,children:o,components:{h1:({children:l})=>Q.createElement($,{color:t,textColor:n,level:"h1"},l),h2:({children:l})=>Q.createElement($,{color:t,textColor:n,level:"h2"},l),h3:({children:l})=>Q.createElement($,{color:t,textColor:n,level:"h3"},l),h4:({children:l})=>Q.createElement($,{color:t,textColor:n,level:"h4"},l),p:({children:l})=>Q.createElement($,{color:t,textColor:n,level:i},l),a:({children:l,href:m})=>Q.createElement(tl,{href:m},l),hr:()=>Q.createElement(He,null),...a?.components}}))};Vo.displayName="Markdown";import E,{forwardRef as rl,useCallback as qt,useEffect as nl,useImperativeHandle as al,useRef as il,useState as Wt}from"react";import{IMaskInput as ll,IMask as Ut}from"react-imask";import sl from"@mui/icons-material/esm/CalendarToday.js";import{styled as Yo}from"@mui/joy";import{FocusTrap as ml,ClickAwayListener as pl,Popper as dl}from"@mui/base";var cl=Yo(dl,{name:"MonthPicker",slot:"popper"})(({theme:e})=>({zIndex:e.zIndex.tooltip})),ul=Yo(W,{name:"MonthPicker",slot:"sheet",overridesResolver:(e,o)=>o.root})(({theme:e})=>({width:"264px",boxShadow:e.shadow.md,borderRadius:e.radius.md})),gl=Yo("div",{name:"MonthPicker",slot:"container"})({width:"100%"}),Gt=e=>{let o=`${e.getMonth()+1}`,t=e.getFullYear();return Number(o)<10&&(o="0"+o),[t,o].join("/")},Jo=e=>(t=>{if(!/^\d\d\d\d\/(0[1-9]|1[012])(\/(0[1-9]|[23][0-9]))?$/.test(t))return t;let n=t.split("/"),i=new Date(Number(n[0]),Number(n[1])-1);return Gt(i)})(e),_t=e=>e.split(" - ")[0]||"",fl=E.forwardRef(function(o,t){let{onChange:n,...i}=o;return E.createElement(ll,{...i,inputRef:t,onAccept:a=>n({target:{name:o.name,value:a}}),mask:Date,pattern:"Y/m",blocks:{m:{mask:Ut.MaskedRange,from:1,to:12,maxLength:2},Y:{mask:Ut.MaskedRange,from:1900,to:9999}},format:Jo,parse:_t})}),Rt=rl((e,o)=>{let{onChange:t,disabled:n,label:i,error:a,helperText:r,minDate:l,maxDate:m,disableFuture:u,disablePast:g,required:d,...y}=e,s=il(null),[h,p]=Wt(e.value||""),[c,v]=Wt(null),D=!!c;nl(()=>{p(e.value?Jo(_t(e.value)):"")},[e.value]),al(o,()=>s.current,[s.current]);let k=qt(b=>{p(b.target.value),t?.(b)},[]),A=qt(b=>{v(c?null:b.currentTarget),s.current?.focus()},[c,v,s]),f=E.createElement(gl,null,E.createElement(ml,{open:!0},E.createElement(E.Fragment,null,E.createElement(R,{...y,ref:s,size:"sm",value:h,onChange:k,placeholder:"YYYY/MM",disabled:n,required:d,slotProps:{input:{component:fl,ref:s}},sx:{fontFamily:"monospace"},endDecorator:E.createElement(V,{variant:"plain",onClick:A},E.createElement(sl,null))}),D&&E.createElement(pl,{onClickAway:()=>v(null)},E.createElement(cl,{id:"date-picker-popper",open:!0,anchorEl:c,placement:"bottom-end",onMouseDown:b=>b.preventDefault(),modifiers:[{name:"offset",options:{offset:[4,4]}}]},E.createElement(ul,{tabIndex:-1,role:"presentation"},E.createElement(K,{view:"month",views:["month"],value:Number.isNaN(new Date(h).getTime())?void 0:[new Date(h),void 0],onChange:([b])=>{k({target:{name:e.name,value:Jo(Gt(b))}}),v(null),s.current?.blur()},minDate:l?new Date(l):void 0,maxDate:m?new Date(m):void 0,disableFuture:u,disablePast:g}),E.createElement(j,{sx:{p:1}},E.createElement(I,{size:"sm",variant:"plain",color:"neutral",onClick:()=>{k({target:{name:e.name,value:""}}),v(null),s.current?.blur()}},"Clear"))))))));return i?E.createElement(B,{required:d,disabled:n,error:a,size:"sm"},E.createElement(N,null,i),f,r&&E.createElement(w,null,r)):f});import z,{forwardRef as hl,useCallback as $o,useEffect as bl,useImperativeHandle as Cl,useMemo as yl,useRef as xl,useState as jt}from"react";import{IMaskInput as vl,IMask as Zt}from"react-imask";import Ml from"@mui/icons-material/esm/CalendarToday.js";import{styled as Go}from"@mui/joy";import{FocusTrap as kl,ClickAwayListener as Dl,Popper as Pl}from"@mui/base";var Tl=Go(Pl,{name:"MonthRangePicker",slot:"popper"})(({theme:e})=>({zIndex:e.zIndex.tooltip})),wl=Go(W,{name:"MonthRangePicker",slot:"sheet",overridesResolver:(e,o)=>o.root})(({theme:e})=>({zIndex:e.zIndex.tooltip,width:"264px",boxShadow:e.shadow.md,borderRadius:e.radius.md})),Il=Go("div",{name:"MonthRangePicker",slot:"container"})({width:"100%"}),qo=e=>{let o=`${e.getMonth()+1}`,t=e.getFullYear();return Number(o)<10&&(o="0"+o),[t,o].join("/")},Wo=([e,o])=>{let t=n=>{if(!/^\d\d\d\d\/(0[1-9]|1[012])(\/(0[1-9]|[23][0-9]))?$/.test(n))return n;let i=n.split("/"),a=new Date(Number(i[0]),Number(i[1])-1);return qo(a)};return[t(e),t(o)].join(" - ")},Uo=e=>{let o=e.split(" - ")[0]||"",t=e.split(" - ")[1]||"";return[o,t]},Al=z.forwardRef(function(o,t){let{onChange:n,...i}=o;return z.createElement(vl,{...i,inputRef:t,onAccept:a=>n({target:{name:o.name,value:a}}),mask:Date,pattern:"Y/m - Y/m",blocks:{m:{mask:Zt.MaskedRange,from:1,to:12,maxLength:2},Y:{mask:Zt.MaskedRange,from:1900,to:9999}},format:Wo,parse:Uo})}),_o=hl((e,o)=>{let{onChange:t,disabled:n,label:i,error:a,helperText:r,minDate:l,maxDate:m,disableFuture:u,disablePast:g,required:d,...y}=e,s=xl(null),[h,p]=jt(""),[c,v]=jt(null),D=!!c,k=yl(()=>h?Uo(h).map(M=>new Date(M)):void 0,[h]);bl(()=>{p(e.value?Wo(Uo(e.value)):"")},[e.value]),Cl(o,()=>s.current,[s.current]);let A=$o(M=>{p(M.target.value),t?.(M)},[t]),f=$o(M=>{v(c?null:M.currentTarget),s.current?.focus()},[c,v,s]),b=$o(([M,P])=>{!M||!P||(p(Wo([qo(M),qo(P)])),v(null),s.current?.blur())},[p,v,s]),T=z.createElement(Il,null,z.createElement(kl,{open:!0},z.createElement(z.Fragment,null,z.createElement(R,{...y,ref:o,size:"sm",value:h,onChange:A,disabled:n,required:d,placeholder:"YYYY/MM - YYYY/MM",slotProps:{input:{component:Al,ref:s}},sx:{fontFamily:"monospace"},endDecorator:z.createElement(V,{variant:"plain",onClick:f},z.createElement(Ml,null))}),D&&z.createElement(Dl,{onClickAway:()=>v(null)},z.createElement(Tl,{id:"date-range-picker-popper",open:!0,anchorEl:c,placement:"bottom-end",onMouseDown:M=>M.preventDefault(),modifiers:[{name:"offset",options:{offset:[4,4]}}]},z.createElement(wl,{tabIndex:-1,role:"presentation"},z.createElement(K,{view:"month",views:["month"],rangeSelection:!0,defaultValue:k,onChange:b,minDate:l?new Date(l):void 0,maxDate:m?new Date(m):void 0,disableFuture:u,disablePast:g}),z.createElement(j,{sx:{p:1}},z.createElement(I,{size:"sm",variant:"plain",color:"neutral",onClick:()=>{p(""),v(null),s.current?.blur()}},"Clear"))))))));return i?z.createElement(B,{required:d,disabled:n,error:a,size:"sm"},z.createElement(N,null,i),T,r&&z.createElement(w,null,r)):T});_o.displayName="MonthRangePicker";import{Radio as Fl,RadioGroup as Bl}from"@mui/joy";import{motion as Xt}from"framer-motion";var Nl=Xt(Fl),Ee=Nl;Ee.displayName="Radio";var Ll=Xt(Bl),ze=Ll;ze.displayName="RadioGroup";import Qt from"react";function Ro(e){let{items:o,...t}=e;return Qt.createElement(ze,{...t},o.map(n=>Qt.createElement(Ee,{key:`${n.value}`,value:n.value,label:n.label})))}Ro.displayName="RadioList";import Oe,{useMemo as Sl}from"react";import{Select as Hl,Option as El}from"@mui/joy";import{motion as zl}from"framer-motion";var Ol=zl(El),to=Ol;to.displayName="Option";function jo(e){let{label:o,helperText:t,error:n,size:i,color:a,disabled:r,required:l,onChange:m,...u}=e,g=Sl(()=>e.options.map(s=>typeof s!="object"?{value:s,label:s}:s),[e.options]),y=Oe.createElement(Hl,{...u,required:l,disabled:r,size:i,color:a,onChange:(s,h)=>{let p=s||{target:{}},c={...p,target:{name:p.target?.name||e.name,value:h||void 0}};m?.(c)}},g.map(s=>Oe.createElement(to,{key:s.value,value:s.value},s.label)));return o?Oe.createElement(B,{required:l,disabled:r,size:i,color:a,error:n},Oe.createElement(N,null,o),y,t&&Oe.createElement(w,null,t)):y}jo.displayName="Select";import Kt from"react";import{Switch as Vl,styled as Jl,switchClasses as Yl}from"@mui/joy";import{motion as er}from"framer-motion";var $l=er(Vl),ql=Jl(er.div)({"--Icon-fontSize":"calc(var(--Switch-thumbSize) * 0.75)",display:"inline-flex",justifyContent:"center",alignItems:"center",position:"absolute",left:"var(--Switch-thumbOffset)",width:"var(--Switch-thumbWidth)",height:"var(--Switch-thumbSize)",borderRadius:"var(--Switch-thumbRadius)",boxShadow:"var(--Switch-thumbShadow)",color:"var(--Switch-thumbColor)",backgroundColor:"var(--Switch-thumbBackground)",[`&.${Yl.checked}`]:{left:"unset",right:"var(--Switch-thumbOffset)"}}),Wl=e=>Kt.createElement(ql,{...e,layout:!0,transition:Ul}),Ul={type:"spring",stiffness:700,damping:30},Zo=e=>Kt.createElement($l,{...e,slots:{thumb:Wl,...e.slots}});Zo.displayName="Switch";import{Tabs as Gl,Tab as _l,TabList as Rl,TabPanel as jl,styled as Zl,tabClasses as Xl}from"@mui/joy";import{motion as ro}from"framer-motion";var Ql=ro(Gl),Xo=Ql;Xo.displayName="Tabs";var Kl=Zl(ro(_l))(({theme:e})=>({[`&:not(.${Xl.selected})`]:{color:e.palette.neutral[700]}})),Qo=Kl;Qo.displayName="Tab";var es=ro(Rl),Ko=es;Ko.displayName="TabList";var os=ro(jl),et=os;et.displayName="TabPanel";import no from"react";import{Textarea as ts}from"@mui/joy";import{motion as rs}from"framer-motion";var ns=rs(ts),ot=e=>{let{label:o,error:t,helperText:n,color:i,size:a,disabled:r,required:l,...m}=e,u=no.createElement(ns,{required:l,disabled:r,color:i,size:a,...m});return o?no.createElement(B,{required:l,disabled:r,color:i,size:a,error:t},no.createElement(N,null,o),u,n&&no.createElement(w,null,n)):u};ot.displayName="Textarea";import ao from"react";import{CssBaseline as as,CssVarsProvider as is,checkboxClasses as ls,extendTheme as ss}from"@mui/joy";var ms=ss({cssVarPrefix:"ceed",spacing:4,zIndex:{popup:1500},components:{JoyTable:{defaultProps:{size:"sm",borderAxis:"bothBetween"},styleOverrides:{root:({theme:e})=>({"--TableRow-stripeBackground":e.palette.background.level1,"--TableCell-selectedBackground":e.palette.background.level2,"--TableRow-hoverBackground":e.palette.background.level3,"& tbody tr[aria-checked=false] th":{"--TableCell-headBackground":"transparent"},"& tbody tr[aria-checked=true]:hover th":{"--TableCell-headBackground":"var(--TableRow-hoverBackground)"},"& tbody tr[aria-checked=true]:not(:hover) th":{"--TableCell-headBackground":"var(--TableCell-selectedBackground)"},"& tbody tr[aria-checked=true]:not(:hover) td":{"--TableCell-dataBackground":"var(--TableCell-selectedBackground)"},[`& .${ls.root}`]:{verticalAlign:"middle"}})}},JoyTooltip:{defaultProps:{size:"sm",placement:"top"}}}});function tt(e){return ao.createElement(ao.Fragment,null,ao.createElement(is,{theme:ms},ao.createElement(as,null),e.children))}tt.displayName="ThemeProvider";import ps from"react";import{Tooltip as ds}from"@mui/joy";import{motion as cs}from"framer-motion";var us=cs(ds),rt=e=>ps.createElement(us,{...e});rt.displayName="Tooltip";export{$e as Accordion,Ye as AccordionDetails,Je as AccordionSummary,lo as Accordions,so as Alert,ob as AspectRatio,lt as Autocomplete,Gh as AutocompleteListbox,_h as AutocompleteOption,Xh as Avatar,Kh as AvatarGroup,rb as Badge,ue as Box,co as Breadcrumbs,Ce as Button,ve as Calendar,ke as Card,bo as CardActions,fo as CardContent,ho as CardCover,Co as CardOverflow,De as Checkbox,yo as Chip,cb as CircularProgress,xo as Container,wt as CurrencyInput,Do as DataTable,Nt as DatePicker,Fo as DateRangePicker,Fe as DialogActions,Be as DialogContent,So as DialogFrame,Ne as DialogTitle,He as Divider,gb as Drawer,be as Dropdown,me as FormControl,de as FormHelperText,pe as FormLabel,Oo as Grid,ye as IconButton,we as Input,Ho as InsetDrawer,hb as LinearProgress,Nb as Link,Cb as List,xb as ListDivider,Mb as ListItem,Db as ListItemButton,Tb as ListItemContent,Ib as ListItemDecorator,Fb as ListSubheader,Vo as Markdown,ge as Menu,fe as MenuButton,he as MenuItem,Bo as Modal,eo as ModalClose,Le as ModalDialog,Lo as ModalFrame,No as ModalOverflow,Rt as MonthPicker,_o as MonthRangePicker,to as Option,Ee as Radio,ze as RadioGroup,Ro as RadioList,jo as Select,Ie as Sheet,qb as Skeleton,Sb as Slider,se as Stack,Eb as Step,Ob as StepButton,Jb as StepIndicator,Yb as Stepper,Zo as Switch,Qo as Tab,Ko as TabList,et as TabPanel,Ae as Table,Mo as TableBody,vo as TableHead,Xo as Tabs,ot as Textarea,tt as ThemeProvider,rt as Tooltip,$ as Typography,zo as Uploader,$h as accordionClasses,qh as accordionDetailsClasses,Uh as accordionSummaryClasses,Wh as accordionsClasses,lh as alertClasses,tb as aspectRatioClasses,Rh as autocompleteClasses,jh as autocompleteListboxClasses,Zh as autocompleteOptionClasses,Qh as avatarClasses,eb as avatarGroupClasses,nb as badgeClasses,sh as boxClasses,ab as breadcrumbsClasses,mh as buttonClasses,lb as cardActionsClasses,ib as cardClasses,sb as cardContentClasses,mb as cardCoverClasses,pb as cardOverflowClasses,ph as checkboxClasses,db as chipClasses,ub as circularProgressClasses,zh as dialogActionsClasses,Eh as dialogContentClasses,Hh as dialogTitleClasses,dh as dividerClasses,fb as drawerClasses,Ph as formControlClasses,wh as formHelperTextClasses,Th as formLabelClasses,Ih as gridClasses,ch as iconButtonClasses,uh as inputClasses,bb as linearProgressClasses,Lb as linkClasses,yb as listClasses,vb as listDividerClasses,Pb as listItemButtonClasses,kb as listItemClasses,wb as listItemContentClasses,Ab as listItemDecoratorClasses,Bb as listSubheaderClasses,fh as menuButtonClasses,gh as menuClasses,hh as menuItemClasses,Bh as modalClasses,Nh as modalCloseClasses,Lh as modalDialogClasses,Sh as modalOverflowClasses,bh as optionClasses,Ch as radioClasses,yh as radioGroupClasses,xh as selectClasses,Fh as sheetClasses,Wb as skeletonClasses,Hb as sliderClasses,Ah as stackClasses,Vb as stepButtonClasses,zb as stepClasses,$b as stepperClasses,vh as switchClasses,Jh as tabListClasses,Yh as tabPanelClasses,Mh as tableClasses,Vh as tabsClasses,kh as textareaClasses,Oh as tooltipClasses,Dh as typographyClasses,ah as useColorScheme,nh as useTheme,ih as useThemeProps};
1
+ import{useTheme as Jh,useColorScheme as Uh,useThemeProps as $h,alertClasses as Gh,boxClasses as Wh,buttonClasses as qh,checkboxClasses as _h,dividerClasses as Kh,iconButtonClasses as jh,inputClasses as Zh,menuClasses as Xh,menuButtonClasses as Qh,menuItemClasses as eC,optionClasses as oC,radioClasses as tC,radioGroupClasses as rC,selectClasses as nC,switchClasses as aC,tableClasses as iC,textareaClasses as lC,typographyClasses as sC,formControlClasses as pC,formLabelClasses as mC,formHelperTextClasses as dC,gridClasses as cC,stackClasses as uC,sheetClasses as gC,modalClasses as fC,modalCloseClasses as hC,modalDialogClasses as CC,modalOverflowClasses as yC,dialogTitleClasses as bC,dialogContentClasses as xC,dialogActionsClasses as vC,tooltipClasses as DC,tabsClasses as MC,tabListClasses as kC,tabPanelClasses as TC,accordionClasses as PC,accordionDetailsClasses as wC,accordionGroupClasses as AC,accordionSummaryClasses as IC,AutocompleteListbox as FC,AutocompleteOption as BC,autocompleteClasses as SC,autocompleteListboxClasses as NC,autocompleteOptionClasses as LC,Avatar as VC,avatarClasses as EC,AvatarGroup as HC,avatarGroupClasses as OC,AspectRatio as zC,aspectRatioClasses as RC,Badge as YC,badgeClasses as JC,breadcrumbsClasses as UC,cardClasses as $C,cardActionsClasses as GC,cardContentClasses as WC,cardCoverClasses as qC,cardOverflowClasses as _C,chipClasses as KC,CircularProgress as jC,circularProgressClasses as ZC,Drawer as XC,drawerClasses as QC,LinearProgress as ey,linearProgressClasses as oy,List as ty,listClasses as ry,ListDivider as ny,listDividerClasses as ay,ListItem as iy,listItemClasses as ly,ListItemButton as sy,listItemButtonClasses as py,ListItemContent as my,listItemContentClasses as dy,ListItemDecorator as cy,listItemDecoratorClasses as uy,ListSubheader as gy,listSubheaderClasses as fy,Link as hy,linkClasses as Cy,Slider as yy,sliderClasses as by,Step as xy,stepClasses as vy,StepButton as Dy,stepButtonClasses as My,StepIndicator as ky,Stepper as Ty,stepperClasses as Py,Skeleton as wy,skeletonClasses as Ay}from"@mui/joy";import me from"react";import{AccordionGroup as xr,Accordion as vr,AccordionSummary as Dr,AccordionDetails as Mr}from"@mui/joy";import{motion as Ge}from"framer-motion";var kr=Ge(Dr),We=kr;We.displayName="AccordionSummary";var Tr=Ge(Mr),qe=Tr;qe.displayName="AccordionDetails";var Pr=Ge(vr);function _e(e){let{summary:o,details:t,variant:n,color:i,...a}=e,r=n==="solid"?"solid":void 0;return me.createElement(Pr,{variant:r,color:i,...a},me.createElement(We,{variant:r,color:i},o),me.createElement(qe,{variant:r,color:i},t))}_e.displayName="Accordion";var wr=Ge(xr);function bo(e){let{variant:o,color:t,items:n,...i}=e;return me.createElement(wr,{variant:o,color:t,...i},n.map((a,r)=>me.createElement(_e,{key:r,summary:a.summary,details:a.details,index:r,variant:o,color:t})))}bo.displayName="Accordions";import Ke from"react";import{Alert as Vr,styled as Er}from"@mui/joy";import{motion as Hr}from"framer-motion";import Ar from"react";import{Typography as Ir}from"@mui/joy";import{motion as Fr}from"framer-motion";var Br=Fr(Ir),G=e=>Ar.createElement(Br,{...e});G.displayName="Typography";var Y=G;import{Stack as Sr}from"@mui/joy";import{motion as Nr}from"framer-motion";var Lr=Nr(Sr),de=Lr;de.displayName="Stack";var R=de;var Or=Er(Hr(Vr))({alignItems:"flex-start",fontWeight:"unset"});function xo(e){let{title:o,content:t,actions:n,color:i="primary",...a}=e,r=e.invertedColors||e.variant==="solid";return Ke.createElement(Or,{...a,color:i,endDecorator:n,invertedColors:r},Ke.createElement(R,null,o&&Ke.createElement(Y,{level:"title-sm",color:i},o),Ke.createElement(Y,{level:"body-sm",color:i},t)))}xo.displayName="Alert";import S,{useCallback as Kr,useEffect as jr,useMemo as fe,useRef as Zr,useState as Xr}from"react";import{Autocomplete as Qr,AutocompleteOption as en,ListSubheader as on,AutocompleteListbox as tn,ListItemDecorator as gt,CircularProgress as rn,styled as nn}from"@mui/joy";import{useVirtualizer as an}from"@tanstack/react-virtual";import{Popper as ln}from"@mui/base";import{FormControl as zr,styled as Rr}from"@mui/joy";import{motion as Yr}from"framer-motion";var Jr=Rr(Yr(zr))({width:"100%"}),ce=Jr;ce.displayName="FormControl";var F=ce;import{FormLabel as Ur}from"@mui/joy";import{motion as $r}from"framer-motion";var Gr=$r(Ur),ue=Gr;ue.displayName="FormLabel";var B=ue;import{FormHelperText as Wr}from"@mui/joy";import{motion as qr}from"framer-motion";var _r=qr(Wr),ge=_r;ge.displayName="FormHelperText";var w=ge;var sn=nn(ln,{name:"Autocomplete",slot:"Popper"})(({theme:e})=>({zIndex:e.zIndex.tooltip})),pn=S.forwardRef((e,o)=>{let{anchorEl:t,open:n,modifiers:i,children:a,ownerState:{loading:r,size:l="md"},...p}=e,d=Zr(null),g=a[0].every(y=>y.hasOwnProperty("group")),u=r?[a[1]]:a[0].length===0?[a[2]]:g?a[0].flatMap(y=>[S.createElement(on,{key:y.key,component:"li"},y.group),...y.children]):a[0],C=an({count:u.length,estimateSize:()=>36,getScrollElement:()=>d.current,overscan:5}),m=C.getVirtualItems();return jr(()=>{n&&C.measure()},[n]),S.createElement(sn,{ref:o,anchorEl:t,open:n,modifiers:i},S.createElement(tn,{...p},S.createElement("div",{ref:d,style:{overflow:"auto"}},S.createElement("div",{style:{height:`${C.getTotalSize()}px`,position:"relative"}},m.map(({index:y,size:s,start:c,key:v})=>S.cloneElement(u[y],{key:v,style:{position:"absolute",top:0,left:0,width:"100%",fontSize:`var(--ceed-fontSize-${l})`,height:`${s}px`,transform:`translateY(${c}px)`,overflow:"visible"},children:S.createElement("div",{style:{textOverflow:"ellipsis",textWrap:"nowrap",overflow:"hidden",width:"100%"}},u[y].props.children)}))))))});function je(e){let{label:o,error:t,helperText:n,color:i,size:a,disabled:r,required:l,onChange:p,onChangeComplete:d,...g}=e,[u,C]=Xr(e.value||e.defaultValue),m=fe(()=>e.options.map(h=>typeof h!="object"?{value:h,label:h}:h),[e.options]),y=fe(()=>new Set(m.map(h=>h.value)),[e.options]),s=fe(()=>e.loading?{value:"",label:"",startDecorator:S.createElement(rn,{size:"sm",color:"neutral",variant:"plain",thickness:3})}:typeof u=="string"?m.find(h=>h.value===u)??u:u,[u,e.options,e.loading]),c=Kr(h=>S.isValidElement(h)&&!e.loading?S.cloneElement(h,{size:a}):h,[a,e.loading]),v=fe(()=>c(s?.startDecorator||e.startDecorator),[s,c]),M=fe(()=>c(s?.endDecorator||e.endDecorator),[s,c]),P=S.createElement(Qr,{...g,required:l,onChange:(h,b)=>{C(b);let k=b;p?.({...h,target:{...h.target,value:k?.value}}),y.has(k.value)&&d?.({...h,target:{...h.target,value:k?.value}})},color:i,value:s,options:m,size:a,disabled:r,startDecorator:v,endDecorator:M,getOptionLabel:h=>`${h.value??""}`,slots:{listbox:pn},renderOption:(h,b)=>S.createElement(en,{...h},b.startDecorator&&S.createElement(gt,{sx:k=>({marginInlineEnd:`var(--Input-gap, ${k.spacing(1)})`})},c(b.startDecorator)),c(b.label),b.endDecorator&&S.createElement(gt,{sx:k=>({marginInlineStart:`var(--Input-gap, ${k.spacing(1)})`})},c(b.endDecorator))),renderGroup:h=>h});return o?S.createElement(F,{required:l,color:i,size:a,error:t,disabled:r},S.createElement(B,null,o),P,n&&S.createElement(w,null,n)):P}var ft=je;import{Box as mn}from"@mui/joy";import{motion as dn}from"framer-motion";var cn=dn(mn),he=cn;he.displayName="Box";var Ze=he;import W from"react";import{Breadcrumbs as yt,Link as Dn}from"@mui/joy";import vo from"react";import{Menu as un,MenuButton as gn,MenuItem as fn}from"@mui/joy";import{motion as Do}from"framer-motion";var hn=Do(un),Ce=e=>vo.createElement(hn,{...e});Ce.displayName="Menu";var Cn=Do(gn),ye=e=>vo.createElement(Cn,{...e});ye.displayName="MenuButton";var yn=Do(fn),be=e=>vo.createElement(yn,{...e});be.displayName="MenuItem";var ht=Ce;import{Dropdown as bn}from"@mui/joy";import{motion as xn}from"framer-motion";var vn=xn(bn),xe=vn;xe.displayName="Dropdown";var Ct=xe;function Mo(e){let{crumbs:o,size:t,startCrumbCount:n=1,endCrumbCount:i=3,slots:{link:a,...r}={link:Dn},slotProps:{link:l,...p}={link:{color:"neutral"}},collapsed:d=!0,...g}=e,u=c=>c.type==="link"&&a?W.createElement(a,{to:c.linkHref,href:c.linkHref,...l},c.label):W.createElement(Y,null,c.label);if(!d)return W.createElement(yt,{size:t,slots:r,slotProps:p,...g},o.map(c=>W.createElement(u,{...c})));let C=Math.max(1,i),m=o.slice(0,n).map(c=>W.createElement(u,{...c})),y=(n+C>o.length?o.slice(n):o.slice(-C)).map(c=>W.createElement(u,{...c})),s=o.slice(n,-C).map(c=>W.createElement(be,null,W.createElement(u,{...c})));return W.createElement(yt,{size:t,slots:r,slotProps:p,...g},m,s.length&&W.createElement(Ct,null,W.createElement(ye,{size:t,variant:"plain"},"..."),W.createElement(ht,{size:t},s)),y)}Mo.displayName="Breadcrumbs";import Mn,{forwardRef as kn}from"react";import{Button as Tn}from"@mui/joy";import{motion as Pn}from"framer-motion";var wn=Pn(Tn),ve=kn((e,o)=>Mn.createElement(wn,{ref:o,...e}));ve.displayName="Button";var A=ve;import x,{Fragment as Me,forwardRef as En,useMemo as Pt}from"react";import{styled as K}from"@mui/joy";import Hn from"@mui/icons-material/esm/ChevronLeft.js";import On from"@mui/icons-material/esm/ChevronRight.js";import{AnimatePresence as wt,motion as zn}from"framer-motion";var bt=e=>{let o=[],t=new Date(e.getFullYear(),e.getMonth(),1),n=new Date(e.getFullYear(),e.getMonth()+1,0),i=Math.ceil((t.getDay()+1)/7),a=Math.ceil((n.getDate()+t.getDay())/7),r=1;for(let l=1;l<=a;l++){let p=[];for(let d=1;d<=7;d++)l===i&&d<t.getDay()+1||r>n.getDate()?p.push(void 0):(p.push(r),r++);o.push(p)}return o},xt=(e,o)=>e.toLocaleString(o,{year:"numeric"}),ko=(e,o)=>e.toLocaleString(o,{year:"numeric",month:"long"}),vt=(e,o)=>new Date(0,e).toLocaleString(o,{month:"short"}),Dt=e=>{let o=new Date().getDay(),t=new Date;return t.setDate(t.getDate()-o),Array.from({length:7}).map(()=>{let n=t.toLocaleString(e,{weekday:"short"});return t.setDate(t.getDate()+1),n})},Mt=e=>{let o=new Date,t=new Date(e);return t.setHours(0,0,0,0),o.setHours(0,0,0,0),t.getTime()===o.getTime()},To=(e,o)=>{let t=new Date(e),n=new Date(o);return t.setHours(0,0,0,0),n.setHours(0,0,0,0),t.getTime()===n.getTime()},Q=(e,o,t)=>{let n=new Date(t);n.setHours(0,0,0,0);let i=new Date(Math.min(e.getTime(),o.getTime())),a=new Date(Math.max(e.getTime(),o.getTime()));return n>=i&&n<=a},Xe=(e,o)=>e.getFullYear()===o.getFullYear()&&e.getMonth()===o.getMonth();import An from"react";import{IconButton as In}from"@mui/joy";import{motion as Fn}from"framer-motion";var Bn=Fn(In),De=e=>An.createElement(Bn,{...e});De.displayName="IconButton";var z=De;import{useCallback as Sn,useMemo as Nn,useState as Qe}from"react";import{useThemeProps as Ln}from"@mui/joy";var Vn=(e,o)=>o.includes(e)?e:o[0],kt=e=>{let[o,t]=Qe(()=>Vn(e.view||"day",e.views||["day","month"])),[n,i]=Qe(e.defaultValue),[a,r]=Qe(()=>{let s=new Date;return s.setDate(1),s.setHours(0,0,0,0),e.value?.[0]||e.defaultValue?.[0]||s}),[[l,p],d]=Qe([0,0]),g=e.view??o,u=s=>{d([l+s,s])},C=Sn(s=>{r(s),g==="month"?a.getFullYear()!==s.getFullYear()&&u(s>a?1:-1):u(s>a?1:-1),e.onMonthChange?.(s)},[e.onMonthChange,a,g]),m=Ln({props:{locale:"default",views:["day","month"],view:g,value:e.value??n,...e,onChange:e.value?e.onChange:s=>{i(s),e.onChange?.(s)},onMonthChange:C,onViewChange:()=>{let s=g==="month"?"day":"month";!(!e.views||e.views.includes(s))||e.view===s||(e.onViewChange?e.onViewChange(s):t(s))}},name:"Calendar"}),y=Nn(()=>({...m,viewMonth:a,direction:p}),[m,a,p]);return[m,y]};import{useCallback as se,useState as Tt}from"react";var eo=e=>{let[o,t]=Tt(null),[n,i]=Tt(null);return{calendarTitle:e.view==="month"?xt(e.viewMonth,e.locale||"default"):ko(e.viewMonth,e.locale||"default"),onPrev:se(()=>{if(e.view==="day"){let a=new Date(e.viewMonth||new Date);a.setMonth(a.getMonth()-1),e.onMonthChange?.(a)}else if(e.view==="month"){let a=new Date(e.viewMonth||new Date);a.setFullYear(a.getFullYear()-1),e.onMonthChange?.(a)}},[e.onMonthChange,e.viewMonth,e.view]),onNext:se(()=>{if(e.view==="day"){let a=new Date(e.viewMonth||new Date);a.setMonth(a.getMonth()+1),e.onMonthChange?.(a)}else if(e.view==="month"){let a=new Date(e.viewMonth||new Date);a.setFullYear(a.getFullYear()+1),e.onMonthChange?.(a)}},[e.onMonthChange,e.viewMonth,e.view]),getDayCellProps:se(a=>{let r=new Date(e.viewMonth||new Date);r.setHours(0,0,0,0),r.setDate(a);let l=e.rangeSelection&&e.value&&e.value[0]&&(o&&Q(e.value[0],o,r)||e.value[1]&&Q(e.value[0],e.value[1],r));return{"aria-label":r.toLocaleDateString(),"aria-current":l?"date":void 0}},[e.rangeSelection,e.value,e.viewMonth,o]),getMonthCellProps:se(a=>{let r=new Date(e.viewMonth||new Date);r.setDate(1),r.setHours(0,0,0,0),r.setMonth(a);let p=!e.views?.find(d=>d==="day")&&e.rangeSelection&&e.value&&e.value[0]&&(n&&Q(e.value[0],n,r)||e.value[1]&&Q(e.value[0],e.value[1],r));return{"aria-label":r.toLocaleDateString(),"aria-current":p?"date":void 0}},[e.rangeSelection,e.value,e.viewMonth,n]),getPickerDayProps:se(a=>{let r=new Date(e.viewMonth||new Date);r.setHours(0,0,0,0),r.setDate(a);let l=!!e.value&&(To(r,e.value[0])||e.value[1]&&To(r,e.value[1])),p=e.rangeSelection&&e.value&&e.value[0]&&(o&&Q(e.value[0],o,r)||e.value[1]&&Q(e.value[0],e.value[1],r)),d=()=>{e.rangeSelection?e.value?e.value[0]&&!e.value[1]?e.onChange?.([new Date(Math.min(e.value[0].getTime(),r.getTime())),new Date(Math.max(e.value[0].getTime(),r.getTime()))]):e.onChange?.([r,void 0]):e.onChange?.([r,void 0]):e.onChange?.([r,void 0]),t(null)};return{isToday:Mt(r),isSelected:l,onClick:d,onMouseEnter:e.rangeSelection&&e.value?.[0]&&!e.value?.[1]?()=>t(r):void 0,disabled:e.minDate&&r<e.minDate||e.maxDate&&r>e.maxDate||e.disableFuture&&r>new Date||e.disablePast&&r<(()=>{let g=new Date;return g.setHours(0,0,0,0),g})(),tabIndex:-1,"aria-label":r.toLocaleDateString(),"aria-selected":l?"true":void 0,"aria-current":p?"date":void 0}},[e.onChange,e.value,e.viewMonth,e.rangeSelection,e.minDate,e.maxDate,e.disableFuture,e.disablePast,o]),getPickerMonthProps:se(a=>{let r=new Date(e.viewMonth||new Date);r.setDate(1),r.setHours(0,0,0,0),r.setMonth(a);let l=!e.views?.find(C=>C==="day"),p=l&&e.rangeSelection,d=!!e.value&&(Xe(r,e.value[0])||e.value[1]&&Xe(r,e.value[1])),g=p&&e.value&&e.value[0]&&(n&&Q(e.value[0],n,r)||e.value[1]&&Q(e.value[0],e.value[1],r)),u=()=>{p?e.value?e.value[0]&&!e.value[1]?e.onChange?.([new Date(Math.min(e.value[0].getTime(),r.getTime())),new Date(Math.max(e.value[0].getTime(),r.getTime()))]):e.onChange?.([r,void 0]):e.onChange?.([r,void 0]):l?e.onChange?.([r,void 0]):(e.onViewChange?.("day"),e.onMonthChange?.(r)),i(null)};return{isSelected:d,onMouseEnter:p&&e.value?.[0]&&!e.value?.[1]?()=>i(r):void 0,disabled:e.minDate&&(()=>{let C=new Date(r);return C.setMonth(C.getMonth()+1),C.setDate(0),C<e.minDate})()||e.maxDate&&(()=>{let C=new Date(r);return C.setDate(0),C>e.maxDate})()||e.disableFuture&&r>new Date||e.disablePast&&r<new Date&&!Xe(r,new Date),onClick:u,tabIndex:-1,"aria-label":ko(r,e.locale||"default"),"aria-selected":d?"true":void 0,"aria-current":g?"date":void 0}},[e.onMonthChange,e.onViewChange,e.onChange,e.viewMonth,e.locale,e.value,e.minDate,e.maxDate,e.disableFuture,e.disablePast,n])}};var Rn=K("div",{name:"Calendar",slot:"root"})({maxWidth:"264px"}),Yn=K("div",{name:"Calendar",slot:"calendarHeader"})(({theme:e})=>({display:"flex",justifyContent:"space-between",alignItems:"center",padding:e.spacing(2)})),At=K("div",{name:"Calendar",slot:"viewContainer"})(({theme:e,calendarType:o})=>({paddingLeft:e.spacing(2),paddingRight:e.spacing(2),position:"relative",overflow:"hidden",minHeight:o==="datePicker"?"250px":"unset"})),It=K(zn.table,{name:"Calendar",slot:"viewTable"})(({theme:e})=>({borderSpacing:0,"& td, & th":{padding:0},"& th":{paddingTop:e.spacing(2),paddingBottom:e.spacing(2)}})),Jn=K("thead",{name:"Calendar",slot:"weekHeaderContainer"})({}),Un=K("tbody",{name:"Calendar",slot:"dayPickerContainer"})({}),$n=K(A,{name:"Calendar",slot:"switchViewButton"})(({ownerState:e})=>[e.view==="month"&&{pointerEvents:"none"}]),Gn=K("td",{name:"Calendar",slot:"dayCell"})(({theme:e})=>({"&[aria-current=date]":{position:"relative","& button[aria-current=date]:not([aria-selected=true]):not(:hover):not(:active)":{backgroundColor:`rgb(${e.palette.primary.lightChannel})`},'& + td[aria-hidden] + td[aria-current="date"]::before':{content:'""',position:"absolute",top:0,left:"-10px",bottom:0,width:"16px",backgroundColor:`rgb(${e.palette.primary.lightChannel})`,zIndex:-1}}})),Wn=K("td",{name:"Calendar",slot:"monthCell"})(({theme:e})=>({"&[aria-current=date]":{position:"relative","& button[aria-current=date]:not([aria-selected=true]):not(:hover):not(:active)":{backgroundColor:`rgb(${e.palette.primary.lightChannel})`},'& + td[aria-hidden] + td[aria-current="date"]::before':{content:'""',position:"absolute",top:0,left:"-10px",bottom:0,width:"16px",backgroundColor:`rgb(${e.palette.primary.lightChannel})`,zIndex:-1}}})),qn=K(A,{name:"Calendar",slot:"month"})(({theme:e,isSelected:o,disabled:t})=>[{width:"59px",textAlign:"center","&:hover":{color:e.palette.primary.softColor,backgroundColor:e.palette.primary.softHoverBg},"&:active":{color:e.palette.primary.softColor,backgroundColor:e.palette.primary.softActiveBg}},o&&{backgroundColor:e.palette.primary.solidBg,color:e.palette.primary.solidColor,"&:hover":{color:e.palette.primary.solidColor,backgroundColor:e.palette.primary.solidHoverBg},"&:active":{color:e.palette.primary.solidColor,backgroundColor:e.palette.primary.solidActiveBg}},t&&{color:e.palette.neutral.solidDisabledColor,backgroundColor:e.palette.neutral.solidDisabledBg}]),_n=K(A,{name:"Calendar",slot:"day"})(({theme:e,isToday:o,isSelected:t,disabled:n})=>[{width:"32px",height:"32px",textAlign:"center","&:hover":{color:e.palette.primary.softColor,backgroundColor:e.palette.primary.softHoverBg},"&:active":{color:e.palette.primary.softColor,backgroundColor:e.palette.primary.softActiveBg}},o&&!t&&{"&:not([aria-current=date]):not(:hover)":{border:`1px solid ${e.palette.neutral.outlinedBorder}`}},t&&{backgroundColor:e.palette.primary.solidBg,color:e.palette.primary.solidColor,"&:hover":{color:e.palette.primary.solidColor,backgroundColor:e.palette.primary.solidHoverBg},"&:active":{color:e.palette.primary.solidColor,backgroundColor:e.palette.primary.solidActiveBg}},n&&{color:e.palette.neutral.solidDisabledColor,backgroundColor:e.palette.neutral.solidDisabledBg}]),Ft={enter:e=>({x:e>0?300:-300,opacity:0}),center:{position:"relative",zIndex:1,x:0,opacity:1},exit:e=>({position:"absolute",zIndex:0,x:e<0?300:-300,opacity:0})},oo=1e4,Bt=(e,o)=>Math.abs(e)*o,Kn=e=>{let{ownerState:o}=e,{getPickerDayProps:t,getDayCellProps:n}=eo(o),i=Pt(()=>bt(o.viewMonth),[o.viewMonth]),a=Pt(()=>Dt(o.locale||"default"),[o.locale]);return x.createElement(At,{calendarType:"datePicker"},x.createElement(wt,{initial:!1,custom:o.direction},x.createElement(It,{key:`${o.viewMonth.toString()}_${o.direction}`,custom:o.direction,variants:Ft,initial:"enter",animate:"center",exit:"exit",transition:{x:{type:"spring",stiffness:300,damping:30},opacity:{duration:.2}},drag:"x",dragConstraints:{left:0,right:0},dragElastic:1,onDragEnd:(r,{offset:l,velocity:p})=>{let d=Bt(l.x,p.x);if(d<-oo){let g=new Date(o.viewMonth||new Date);g.setMonth(g.getMonth()+1),o.onMonthChange?.(g)}else if(d>oo){let g=new Date(o.viewMonth||new Date);g.setMonth(g.getMonth()-1),o.onMonthChange?.(g)}}},x.createElement(Jn,null,x.createElement("tr",null,a.map((r,l)=>x.createElement(x.Fragment,null,x.createElement("th",null,x.createElement(Y,{level:"body-xs",textAlign:"center"},r)),l<6&&x.createElement("th",{style:{width:4},"aria-hidden":"true","aria-description":"cell-gap"}))))),x.createElement(Un,null,i.map((r,l)=>x.createElement(Me,{key:`${o.viewMonth}_${l}`},x.createElement("tr",null,r.map((p,d)=>p?x.createElement(Me,{key:d},x.createElement(Gn,{...n(p)},x.createElement(_n,{size:"sm",variant:"plain",color:"neutral",...t(p)},p)),d<6&&x.createElement("td",{"aria-hidden":"true","aria-description":"cell-gap"})):x.createElement(Me,{key:d},x.createElement("td",null),d<6&&x.createElement("td",{"aria-hidden":"true","aria-description":"cell-gap"})))),l<i.length-1&&x.createElement("tr",{"aria-hidden":"true","aria-description":"row-gap"},x.createElement("td",{colSpan:13,style:{height:4}}))))))))},jn=e=>{let{ownerState:o}=e,{getPickerMonthProps:t,getMonthCellProps:n}=eo(o),i=Array.from({length:12},(r,l)=>l).reduce((r,l)=>(r[r.length-1].length===4&&r.push([]),r[r.length-1].push(l),r),[[]]),a=!o.views?.find(r=>r==="day");return x.createElement(At,{calendarType:a?"monthPicker":"datePicker"},x.createElement(wt,{initial:!1,custom:o.direction},x.createElement(It,{key:`${o.viewMonth.getFullYear()}_${o.direction}`,custom:o.direction,variants:Ft,initial:"enter",animate:"center",exit:"exit",transition:{x:{type:"spring",stiffness:300,damping:30},opacity:{duration:.2}},drag:"x",dragConstraints:{left:0,right:0},dragElastic:1,onDragEnd:(r,{offset:l,velocity:p})=>{let d=Bt(l.x,p.x);if(d<-oo){let g=new Date(o.viewMonth||new Date);g.setMonth(g.getMonth()+1),o.onMonthChange?.(g)}else if(d>oo){let g=new Date(o.viewMonth||new Date);g.setMonth(g.getMonth()-1),o.onMonthChange?.(g)}}},x.createElement("tbody",null,i.map((r,l)=>x.createElement(Me,{key:l},x.createElement("tr",null,r.map((p,d)=>x.createElement(Me,{key:p},x.createElement(Wn,{...n(p)},x.createElement(qn,{size:"sm",variant:"plain",color:"neutral",...t(p)},vt(p,o.locale))),d<3&&x.createElement("td",{style:{width:4},"aria-hidden":"true","aria-description":"cell-gap"})))),l<i.length-1&&x.createElement("tr",{"aria-hidden":"true","aria-description":"row-gap"},x.createElement("td",{colSpan:7,style:{height:4}}))))))))},ke=En((e,o)=>{let[t,n]=kt(e),{value:i,defaultValue:a,onChange:r,locale:l,onViewChange:p,onMonthChange:d,view:g,views:u,rangeSelection:C,...m}=t,{calendarTitle:y,onPrev:s,onNext:c}=eo(n);return x.createElement(Rn,{ref:o,...m},x.createElement(Yn,null,x.createElement(z,{size:"sm",onClick:s},x.createElement(Hn,null)),x.createElement($n,{ownerState:n,variant:"plain",color:"neutral",onClick:p},y),x.createElement(z,{size:"sm",onClick:c},x.createElement(On,null))),g==="day"&&x.createElement(Kn,{ownerState:n}),g==="month"&&x.createElement(jn,{ownerState:n}))});ke.displayName="Calendar";var te=ke;import{Card as Zn,CardContent as Xn,CardCover as Qn,CardActions as ea,CardOverflow as oa}from"@mui/joy";import{motion as Te}from"framer-motion";var ta=Te(Zn),Pe=ta;Pe.displayName="Card";var ra=Te(Xn),Po=ra;Po.displayName="CardContent";var na=Te(Qn),wo=na;wo.displayName="CardCover";var aa=Te(ea),Ao=aa;Ao.displayName="CardActions";var ia=Te(oa),Io=ia;Io.displayName="CardOverflow";import la from"react";import{Checkbox as sa}from"@mui/joy";import{motion as pa}from"framer-motion";var ma=pa(sa),we=e=>la.createElement(ma,{...e});we.displayName="Checkbox";var Ae=we;import{Chip as da}from"@mui/joy";import{motion as ca}from"framer-motion";var ua=ca(da),Ie=ua;Ie.displayName="Chip";var St=Ie;import{styled as ga}from"@mui/joy";import fa,{forwardRef as ha}from"react";var Ca=ga("div",{name:"Container",slot:"root",shouldForwardProp:e=>e!=="maxWidth"})(({theme:e,maxWidth:o="lg"})=>({width:"100%",marginLeft:"auto",boxSizing:"border-box",marginRight:"auto",display:"block",paddingLeft:e.spacing(4),paddingRight:e.spacing(4),...o==="sm"&&{[e.breakpoints.up("xs")]:{maxWidth:e.breakpoints.values.sm}},...o==="md"&&{[e.breakpoints.up("sm")]:{maxWidth:e.breakpoints.values.md}},...o==="lg"&&{[e.breakpoints.up("md")]:{maxWidth:e.breakpoints.values.lg}},...o==="xl"&&{[e.breakpoints.up("lg")]:{maxWidth:e.breakpoints.values.xl}}})),Fo=ha(function(o,t){return fa.createElement(Ca,{ref:t,...o})});Fo.displayName="Container";import ee,{useCallback as Da,useMemo as Ma,useState as Vt}from"react";import{IntlMessageFormat as ka}from"intl-messageformat";import{NumericFormat as Ta}from"react-number-format";import Pa from"@mui/icons-material/esm/InfoOutlined.js";import Fe from"react";import{Input as ya}from"@mui/joy";import{motion as ba}from"framer-motion";var Nt=ba(ya),Be=e=>{let{label:o,helperText:t,error:n,style:i,size:a,color:r,disabled:l,required:p,...d}=e;return o?Fe.createElement(F,{required:p,color:r,size:a,error:n,disabled:l},Fe.createElement(B,null,o),Fe.createElement(Nt,{...d}),t&&Fe.createElement(w,null,t)):Fe.createElement(Nt,{required:p,color:r,size:a,disabled:l,...d})};Be.displayName="Input";var J=Be;import xa from"intl-messageformat";var va={AED:2,ALL:2,AMD:2,ANG:2,AOA:2,ARS:2,AUD:2,AWG:2,AZN:2,BAM:2,BBD:2,BDT:2,BGN:2,BHD:3,BMD:2,BND:2,BOB:2,BRL:2,BSD:2,BWP:2,BYN:2,BZD:2,CAD:2,CHF:2,CLP:2,CNH:2,CNY:2,COP:2,CRC:2,CUP:2,CVE:0,CZK:2,DJF:0,DKK:2,DOP:2,DZD:2,EGP:2,ETB:2,EUR:2,FJD:2,FKP:2,GBP:2,GEL:2,GHS:2,GIP:2,GMD:2,GNF:0,GTQ:2,GYD:2,HKD:2,HNL:2,HTG:2,HUF:2,IDR:0,ILS:2,INR:2,IQD:3,ISK:2,JMD:2,JOD:3,JPY:0,KES:2,KGS:2,KHR:2,KMF:0,KRW:0,KWD:3,KYD:2,KZT:2,LAK:2,LBP:2,LKR:2,LYD:3,MAD:2,MDL:2,MKD:2,MMK:2,MNT:2,MOP:2,MRU:2,MUR:2,MVR:2,MWK:2,MXN:2,MYR:2,MZN:2,NAD:2,NGN:2,NIO:2,NOK:2,NPR:2,NZD:2,OMR:3,PAB:2,PEN:2,PGK:2,PHP:2,PKR:2,PLN:2,PYG:0,QAR:2,RON:2,RSD:2,RUB:2,RWF:0,SAR:2,SBD:2,SCR:2,SEK:2,SGD:2,SHP:2,SLE:2,SOS:2,SRD:2,STN:2,SVC:2,SZL:2,THB:2,TND:3,TOP:2,TRY:2,TTD:2,TWD:2,TZS:2,UAH:2,UGX:0,USD:2,UYU:2,UZS:2,VEF:2,VND:0,VUV:0,WST:2,XAF:0,XCD:2,XOF:0,XPF:0,YER:2,ZAR:2,ZMW:2},Lt=(e="USD")=>{let[o,t,n,...i]=new xa(`{amount, number, ::currency/${e} unit-width-narrow}`).format({amount:1e3}).toString().replace(/\d/g,"").split(""),a=va[e];return console.log(a),{symbol:`${o} `,thousandSeparator:t,decimalSeparator:n,placeholder:n?`${o} 0${n}${Array.from(Array(a)).map(()=>0).join("")}`:`${o} 0`,fixedDecimalScale:!!n,decimalScale:a}};var wa=ee.forwardRef(function(o,t){let{onChange:n,...i}=o;return ee.createElement(Ta,{...i,onValueChange:({value:a})=>{n?.({target:{name:o.name,value:a}})},valueIsNumericString:!0,getInputRef:t})}),to=ee.forwardRef(function(o,t){let{currency:n="USD",max:i=1e5,name:a,onChange:r,label:l,error:p,helperText:d,required:g,disabled:u,useMinorUnit:C,...m}=o,{symbol:y,thousandSeparator:s,decimalSeparator:c,placeholder:v,fixedDecimalScale:M,decimalScale:T}=Lt(n),[P,h]=Vt(o.value),[b,k]=Vt(!!i&&!!o.value&&o.value>i),D=Ma(()=>P&&C?P/Math.pow(10,T):P,[P,C]),U=Da(Z=>{let ne=Number(C?Z.target.value?.replace(c,""):Z.target.value);h(ne),r?.({...Z,target:{name:a,value:ne}}),i&&ne>i?k(!0):k(!1)},[]),ie=ee.createElement(J,{...m,size:"sm",ref:t,value:D,placeholder:v,onChange:U,disabled:u,required:g,slotProps:{input:{component:wa,decimalSeparator:c,thousandSeparator:s,prefix:y,fixedDecimalScale:M,decimalScale:T}},sx:{fontFamily:"monospace"}});return l?ee.createElement(F,{size:"sm",disabled:u,required:g,error:p||b},ee.createElement(B,null,l),ie,b?ee.createElement(w,null,ee.createElement(Pa,null),new ka(`limit: {amount, number, ::currency/${n} unit-width-narrow}`).format({amount:i})):d&&ee.createElement(w,null,d)):ie});var Et=to;import f,{useCallback as ae,useEffect as lo,useMemo as _,useRef as ri,useState as Eo}from"react";import{styled as $t,LinearProgress as ni,Link as ai}from"@mui/joy";import ii from"@mui/icons-material/esm/ChevronLeft.js";import li from"@mui/icons-material/esm/ChevronRight.js";import{Sheet as Aa}from"@mui/joy";import{motion as Ia}from"framer-motion";var Fa=Ia(Aa),Se=Fa;Se.displayName="Sheet";var q=Se;import j from"react";import{Table as Ba}from"@mui/joy";var Ne=e=>{let{children:o,...t}=e;return j.createElement(Ba,{...t},o)};Ne.displayName="Table";function Bo(e){let{headCells:o,showCheckbox:t,onCheckboxChange:n,slots:{checkbox:i=Ae}={},slotProps:{checkbox:a={}}={}}=e;return j.createElement("thead",null,j.createElement("tr",null,t&&j.createElement("th",{style:{width:"40px",textAlign:"center"}},j.createElement(i,{onChange:n,...a})),o.map(r=>j.createElement("th",{key:r.label,style:{width:r.width,minWidth:r.minWidth,maxWidth:r.maxWidth,textAlign:r.numeric?"right":"left"}},r.label))))}Bo.displayName="TableHead";function So(e){let{rows:o,cellOrder:t,rowOptions:n,showCheckbox:i,onCheckboxChange:a,slots:{checkbox:r=Ae}={},slotProps:{checkbox:l={}}={}}=e;return j.createElement("tbody",null,o.map((p,d)=>j.createElement("tr",{key:d},i&&j.createElement("td",{style:{textAlign:"center"}},j.createElement(r,{onChange:g=>a?.(g,d),...l})),t.map(g=>j.createElement("td",{key:g,style:{textAlign:n?.[g]?.numeric?"right":"left"}},p[g])))))}So.displayName="TableBody";import N,{forwardRef as Ha,useCallback as Ht,useEffect as Ot,useImperativeHandle as Oa,useRef as za,useState as zt}from"react";import{IMaskInput as Ra,IMask as No}from"react-imask";import Ya from"@mui/icons-material/esm/CalendarToday.js";import{styled as Lo}from"@mui/joy";import{FocusTrap as Ja,ClickAwayListener as Ua,Popper as $a}from"@mui/base";import{DialogActions as Sa,styled as Na}from"@mui/joy";import{motion as La}from"framer-motion";var Va=La(Sa),Ea=Na(Va)(({theme:e})=>({padding:e.spacing(2),gap:e.spacing(2),flexDirection:"row",justifyContent:"flex-end"})),Le=Ea;Le.displayName="DialogActions";var X=Le;var Ga=Lo($a,{name:"DatePicker",slot:"popper"})(({theme:e})=>({zIndex:e.zIndex.tooltip})),Wa=Lo(q,{name:"DatePicker",slot:"sheet",overridesResolver:(e,o)=>o.root})(({theme:e})=>({width:"264px",boxShadow:e.shadow.md,borderRadius:e.radius.md})),qa=Lo("div",{name:"DatePicker",slot:"container"})({width:"100%"}),Rt=e=>{let o=`${e.getDate()}`,t=`${e.getMonth()+1}`,n=e.getFullYear();return Number(o)<10&&(o="0"+o),Number(t)<10&&(t="0"+t),[n,t,o].join("/")},_a=N.forwardRef(function(o,t){let{onChange:n,...i}=o;return N.createElement(Ra,{...i,inputRef:t,onAccept:a=>n({target:{name:o.name,value:a}}),mask:Date,pattern:"Y/`m/`d",blocks:{d:{mask:No.MaskedRange,from:1,to:31,maxLength:2},m:{mask:No.MaskedRange,from:1,to:12,maxLength:2},Y:{mask:No.MaskedRange,from:1900,to:9999}},format:Rt,parse:a=>{let r=a.split("/");return new Date(Number(r[0]),Number(r[1])-1,Number(r[2]))},autofix:"pad",overwrite:!0})}),ro=Ha((e,o)=>{let{onChange:t,disabled:n,label:i,error:a,helperText:r,minDate:l,maxDate:p,disableFuture:d,disablePast:g,required:u,...C}=e,m=za(null),[y,s]=zt(e.value||""),[c,v]=zt(null),M=!!c;Ot(()=>{s(e.value||"")},[e.value]),Ot(()=>{c||m.current?.blur()},[c,m]),Oa(o,()=>m.current,[m.current]);let T=Ht(b=>{s(b.target.value),t?.(b)},[]),P=Ht(b=>{v(c?null:b.currentTarget),setTimeout(()=>{m.current?.focus()},0)},[c,v,m]),h=N.createElement(qa,null,N.createElement(Ja,{open:!0},N.createElement(N.Fragment,null,N.createElement(J,{...C,ref:m,size:"sm",value:y,onChange:T,placeholder:"YYYY/MM/DD",disabled:n,required:u,slotProps:{input:{component:_a,ref:m}},sx:{fontFamily:"monospace"},endDecorator:N.createElement(z,{variant:"plain",onClick:P},N.createElement(Ya,null))}),M&&N.createElement(Ua,{onClickAway:()=>v(null)},N.createElement(Ga,{id:"date-picker-popper",open:!0,anchorEl:c,placement:"bottom-end",onMouseDown:b=>b.preventDefault(),modifiers:[{name:"offset",options:{offset:[4,4]}}]},N.createElement(Wa,{tabIndex:-1,role:"presentation"},N.createElement(te,{value:Number.isNaN(new Date(y).getTime())?void 0:[new Date(y),void 0],onChange:([b])=>{T({target:{name:e.name,value:Rt(b)}}),v(null)},minDate:l?new Date(l):void 0,maxDate:p?new Date(p):void 0,disableFuture:d,disablePast:g}),N.createElement(X,{sx:{p:1}},N.createElement(A,{size:"sm",variant:"plain",color:"neutral",onClick:()=>{T({target:{name:e.name,value:""}}),v(null)}},"Clear"))))))));return i?N.createElement(F,{required:u,disabled:n,error:a,size:"sm"},N.createElement(B,null,i),h,r&&N.createElement(w,null,r)):h});var Yt=ro;import no from"react";import{Textarea as Ka}from"@mui/joy";import{motion as ja}from"framer-motion";var Za=ja(Ka),Ve=e=>{let{label:o,error:t,helperText:n,color:i,size:a,disabled:r,required:l,...p}=e,d=no.createElement(Za,{required:l,disabled:r,color:i,size:a,...p});return o?no.createElement(F,{required:l,disabled:r,color:i,size:a,error:t},no.createElement(B,null,o),d,n&&no.createElement(w,null,n)):d};Ve.displayName="Textarea";var Jt=Ve;import Ee,{useMemo as Xa}from"react";import{Select as Qa,Option as ei}from"@mui/joy";import{motion as oi}from"framer-motion";var ti=oi(ei),ao=ti;ao.displayName="Option";function He(e){let{label:o,helperText:t,error:n,size:i,color:a,disabled:r,required:l,onChange:p,...d}=e,g=Xa(()=>e.options.map(m=>typeof m!="object"?{value:m,label:m}:m),[e.options]),C=Ee.createElement(Qa,{...d,required:l,disabled:r,size:i,color:a,onChange:(m,y)=>{let s=m||{target:{}},c={...s,target:{name:s.target?.name||e.name,value:y||void 0}};p?.(c)}},g.map(m=>Ee.createElement(ao,{key:m.value,value:m.value},m.label)));return o?Ee.createElement(F,{required:l,disabled:r,size:i,color:a,error:n},Ee.createElement(B,null,o),C,t&&Ee.createElement(w,null,t)):C}He.displayName="Select";var Vo=He;var Ut=$t("tr",{name:"DataTable",slot:"overlayWrapper"})({position:"sticky",top:"calc(var(--unstable_TableCell-height, 32px))",left:0,right:0,zIndex:1,"& > td":{height:0,padding:0,border:"none !important"}}),io=e=>"Intl"in window?new Intl.NumberFormat().format(e):e;function si(e){let{paginationModel:{page:o,pageSize:t},rowCount:n,onPageChange:i}=e,a=1,r=Math.ceil(n/t),l=[o-2,o-1].filter(u=>u>1),p=[o+1,o+2].filter(u=>u<=r-1),d=r>1&&o<r-3,g=r>1&&o>4;return f.createElement(R,{direction:"row",spacing:1,sx:{pt:1,pb:1},justifyContent:"end",alignItems:"center"},f.createElement(R,{direction:"row",spacing:.5,alignItems:"center"},f.createElement(z,{size:"sm",variant:"plain",color:"neutral",onClick:()=>i(o-1),disabled:o===a,"aria-label":"Previous page"},f.createElement(ii,null)),o!==a&&f.createElement(A,{size:"sm",variant:"plain",color:"neutral",onClick:()=>i(a)},a),g&&f.createElement(A,{size:"sm",variant:"plain",color:"neutral",onClick:()=>i(o-3)},"..."),l.map(u=>f.createElement(A,{key:u,size:"sm",variant:"plain",color:"neutral",onClick:()=>i(u)},u)),f.createElement(A,{variant:"soft",size:"sm"},o),p.map(u=>f.createElement(A,{key:u,size:"sm",variant:"plain",color:"neutral",onClick:()=>i(u)},u)),d&&f.createElement(A,{size:"sm",variant:"plain",color:"neutral",onClick:()=>i(o+3)},"..."),o!==r&&f.createElement(A,{size:"sm",variant:"plain",color:"neutral",onClick:()=>i(r)},r),f.createElement(z,{size:"sm",variant:"plain",color:"neutral",onClick:()=>i(o+1),disabled:o===r,"aria-label":"Next page"},f.createElement(li,null))))}var pi=e=>f.createElement(Ze,{sx:{position:"absolute",top:0,right:0,bottom:0,width:"4px",cursor:"col-resize"},onMouseDown:o=>{let t=o.clientX,n=e.current?.getBoundingClientRect().width,i=r=>{n&&t&&(e.current.style.width=`${n+(r.clientX-t)}px`)},a=()=>{document.removeEventListener("mousemove",i),document.removeEventListener("mouseup",a)};document.addEventListener("mousemove",i),document.addEventListener("mouseup",a)}}),mi=$t("span",{name:"DataTable",slot:"headCellAsterisk"})(({theme:e})=>({color:"var(--ceed-palette-danger-500)",marginLeft:e.spacing(.5)})),di=e=>{let o=ri(null),t={width:e.width,minWidth:e.minWidth??"50px",maxWidth:e.maxWidth,textAlign:e.type==="number"?"end":"start",position:e.stickyHeader?void 0:"relative"},n=e.resizable??!0?pi(o):null;return f.createElement("th",{ref:o,key:e.field,style:t},e.headerName??e.field,e.editMode&&e.isCellRequired&&f.createElement(mi,null,"*"),n)},ci=e=>{let{field:o,type:t,renderCell:n,isCellEditable:i,row:a,rowId:r}=e,[l,p]=Eo(a[o]),d=_(()=>({row:a,value:l,id:r}),[a,o,r,l]),g=_(()=>!!((typeof i=="function"&&i(d)||typeof i=="boolean"&&i)&&e.editMode),[e.editMode,i,a]),u=_(()=>({...typeof e.componentProps=="function"?e.componentProps(d):e.componentProps||{},size:"sm"}),[l,e.componentProps,d]),C=_(()=>({...u,onChange:s=>{u.onChange?.(s),p(s.target.value),t&&["select","multiSelect"].includes(t)&&e.onCellEditStop?.({...d,originalRow:a,row:{...d.row,[o]:s.target.value},value:s.target.value})},onFocus:s=>{u.onFocus?.(s),e.onCellEditStart?.({...d,originalRow:a,row:{...d.row,value:l},value:l})},onBlur:s=>{u.onBlur?.(s),t&&["number","text","longText","currency","date"].includes(t)&&e.onCellEditStop?.({...d,originalRow:a,row:{...d.row,[o]:l},value:l})},...t==="autocomplete"&&{onChangeComplete:s=>{u.onChangeComplete?.(s),p(s.target.value),e.onCellEditStop?.({...d,originalRow:a,row:{...d.row,[o]:s.target.value},value:s.target.value})}}}),[l,u]),m=_(()=>({date:f.createElement(Yt,{...C,value:l}),currency:f.createElement(Et,{...C,value:l}),number:f.createElement(J,{...C,value:l,type:"number"}),text:f.createElement(J,{...C,value:l,type:"text"}),longText:f.createElement(Jt,{...C,value:l}),autocomplete:f.createElement(ft,{...C,value:l,options:C.options||[l]}),select:f.createElement(Vo,{...C,value:l,options:C.options||[l]}),multiSelect:f.createElement(Vo,{...C,value:Array.isArray(l)?l:[l],options:C.options||[l],multiple:!0})})[t||"text"],[l,u]),y=_(()=>{if(n)return n(d);let s=l;return{chip:f.createElement(St,{color:"primary",children:s,...u}),link:f.createElement(e.component||ai,{children:s,...u})}[t||"text"]||s},[l,n,a]);return lo(()=>{p(a[o])},[a]),f.createElement("td",{key:o,style:{textAlign:t&&["number","date","currency"].includes(t)?"end":"start"}},g&&m?m:y)},ui=e=>{let{columns:o,rowId:t,editMode:n}=e,[i,a]=Eo(e.row),r=ae(({row:l})=>{a(l)},[]);return f.createElement(f.Fragment,null,o.map(l=>f.createElement(ci,{...l,row:i,rowId:t,editMode:n,onCellEditStop:p=>{l.onCellEditStop?.(p),r(p)}})))};function gi({rows:e,columns:o,rowCount:t,pagination:n,paginationMode:i,paginationModel:a,onPaginationModelChange:r,selectionModel:l=[],onSelectionModelChange:p,getId:d,isTotalSelected:g}){let[u,C]=Eo(a?.page||1),m=a?.pageSize||20,y=ae((h,b)=>d?.(h)??h?.id??`${(b||0)+(u-1)*m}`,[d??u,m]),s=_(()=>new Set(l),[l]),c=_(()=>!n||i==="server"?e:e.slice((u-1)*m,(u-1)*m+m),[e,u,m,i,n]),v=_(()=>c.length>0&&c.every((h,b)=>s.has(y(h,b))),[c,s,u,m,y]),M=t||e.length,T=_(()=>g??(M>0&&l.length===M),[g,l,M]),P=ae(h=>{C(h),r?.({page:h,pageSize:m})},[r]);return lo(()=>{P(1)},[M]),lo(()=>{let h=Math.max(1,Math.ceil(M/m));u>h&&P(h)},[u,M,m]),lo(()=>{p?.([])},[u]),{rowCount:M,page:u,pageSize:m,onPaginationModelChange:P,getId:y,HeadCell:di,BodyRow:ui,dataInPage:c,isAllSelected:v,isTotalSelected:T,isSelectedRow:ae(h=>s.has(h),[s]),onAllCheckboxChange:ae(()=>{p?.(v?[]:c.map(y))},[v,c,p]),onCheckboxChange:ae((h,b)=>{if(s.has(b)){let k=l.filter(D=>D!==b);p?.(k)}else{let k=[...l,b];p?.(k)}},[l,p]),columns:_(()=>o||Object.keys(e[0]||{}).map(h=>({field:h})),[e,o]),onTotalSelect:ae(()=>{p?.(T?[]:e.map(y),!T)},[T,e,p])}}function Ho(e){let{rows:o,checkboxSelection:t,editMode:n,selectionModel:i,onSelectionModelChange:a,rowCount:r,columns:l,onPaginationModelChange:p,pagination:d,paginationMode:g,paginationModel:u,loading:C,slots:{checkbox:m=Ae,toolbar:y,footer:s,loadingOverlay:c=()=>f.createElement(ni,{value:8,variant:"plain"})}={},slotProps:{checkbox:v={},toolbar:M,background:T={}}={},...P}=e,{columns:h,isAllSelected:b,isSelectedRow:k,onAllCheckboxChange:D,onCheckboxChange:U,getId:ie,rowCount:Z,page:ne,pageSize:H,onPaginationModelChange:O,dataInPage:$,isTotalSelected:ct,onTotalSelect:ut,HeadCell:hr,BodyRow:Cr}=gi(e),yr=_(()=>({page:ne,pageSize:H}),[ne,H]);return f.createElement(Ze,null,f.createElement(R,{direction:"row",sx:{pt:1,pb:1},justifyContent:"space-between",alignItems:"center"},!!t&&f.createElement(R,{direction:"row",spacing:1},!b&&f.createElement(Y,{level:"body-xs"},io(i?.length||0)," items selected"),b&&!ct&&f.createElement(R,{direction:"row",spacing:1,alignItems:"center"},f.createElement(Y,{level:"body-xs"},"All ",io(i?.length||0)," items on this page are selected."),f.createElement(A,{size:"sm",variant:"plain",onClick:ut},"Select all ",io(Z??o.length)," items")),ct&&f.createElement(R,{direction:"row",spacing:1,alignItems:"center"},f.createElement(Y,{level:"body-xs"},"All ",io(Z??o.length)," items are selected."),f.createElement(A,{size:"sm",variant:"plain",color:"danger",onClick:ut},"Cancel"))),y&&f.createElement(y,{...M||{}})),f.createElement(q,{variant:"outlined",sx:{overflow:"auto",width:"100%",boxShadow:"sm",borderRadius:"sm"},...T},f.createElement(Ne,{...P},f.createElement("thead",null,f.createElement("tr",null,t&&f.createElement("th",{style:{width:"40px",textAlign:"center"}},f.createElement(m,{onChange:D,checked:b,indeterminate:(i||[]).length>0&&!b,...v})),h.map(pe=>f.createElement(hr,{key:pe.field,stickyHeader:e.stickyHeader,editMode:n,...pe})))),f.createElement("tbody",null,f.createElement(Ut,null,!!C&&f.createElement("td",null,f.createElement(Ze,{sx:{position:"absolute",top:0,left:0,right:0}},f.createElement(c,null)))),f.createElement(Ut,null),$.map((pe,br)=>{let le=ie(pe,br);return f.createElement("tr",{key:le,role:t?"checkbox":void 0,tabIndex:t?-1:void 0,onClick:t?yo=>U(yo,le):void 0,"aria-checked":t?k(le):void 0},t&&f.createElement("th",{scope:"row",style:{textAlign:"center"}},f.createElement(m,{onChange:yo=>U(yo,le),checked:k(le),...v})),f.createElement(Cr,{columns:h,row:pe,rowId:le,editMode:n}))})),s&&f.createElement(s,null))),H<Z&&d&&f.createElement(si,{paginationModel:yr,rowCount:Z,onPageChange:O}))}Ho.displayName="DataTable";import L,{forwardRef as fi,useCallback as Oo,useEffect as Gt,useImperativeHandle as hi,useMemo as Ci,useRef as yi,useState as Wt}from"react";import{IMaskInput as bi,IMask as zo}from"react-imask";import xi from"@mui/icons-material/esm/CalendarToday.js";import{styled as Ro}from"@mui/joy";import{FocusTrap as vi,ClickAwayListener as Di,Popper as Mi}from"@mui/base";var ki=Ro(Mi,{name:"DateRangePicker",slot:"popper"})(({theme:e})=>({zIndex:e.zIndex.tooltip})),Ti=Ro(q,{name:"DateRangePicker",slot:"sheet",overridesResolver:(e,o)=>o.root})(({theme:e})=>({zIndex:e.zIndex.tooltip,width:"264px",boxShadow:e.shadow.md,borderRadius:e.radius.md})),Pi=Ro("div",{name:"DateRangePicker",slot:"container"})({width:"100%"}),qt=([e,o])=>{let t=n=>{let i=`${n.getDate()}`,a=`${n.getMonth()+1}`,r=n.getFullYear();return Number(i)<10&&(i="0"+i),Number(a)<10&&(a="0"+a),[r,a,i].join("/")};return[t(e),o?t(o):""].join(" - ")},_t=e=>{let o=e.split(" - ")[0]||"",t=e.split(" - ")[1]||"",n=o.split("/"),i=t.split("/");return[new Date(Number(n[0]),Number(n[1])-1,Number(n[2])),new Date(Number(i[0]),Number(i[1])-1,Number(i[2]))]},wi=L.forwardRef(function(o,t){let{onChange:n,...i}=o;return L.createElement(bi,{...i,inputRef:t,onAccept:a=>n({target:{name:o.name,value:a}}),mask:Date,pattern:"Y/`m/`d - Y/`m/`d",blocks:{d:{mask:zo.MaskedRange,from:1,to:31,maxLength:2},m:{mask:zo.MaskedRange,from:1,to:12,maxLength:2},Y:{mask:zo.MaskedRange,from:1900,to:9999}},format:qt,parse:_t,autofix:"pad",overwrite:!0})}),Yo=fi((e,o)=>{let{onChange:t,disabled:n,label:i,error:a,helperText:r,minDate:l,maxDate:p,disableFuture:d,disablePast:g,required:u,...C}=e,m=yi(null),[y,s]=Wt(e.value||""),[c,v]=Wt(null),M=!!c,T=Ci(()=>y?_t(y):void 0,[y]);Gt(()=>{s(e.value||"")},[e.value]),Gt(()=>{c||m.current?.blur()},[c,m]),hi(o,()=>m.current,[m.current]);let P=Oo(D=>{s(D.target.value),t?.(D)},[t]),h=Oo(D=>{v(c?null:D.currentTarget),m.current?.focus()},[c,v,m]),b=Oo(([D,U])=>{!D||!U||(s(qt([D,U])),v(null))},[s,v,m]),k=L.createElement(Pi,null,L.createElement(vi,{open:!0},L.createElement(L.Fragment,null,L.createElement(J,{...C,ref:o,size:"sm",value:y,onChange:P,disabled:n,required:u,placeholder:"YYYY/MM/DD - YYYY/MM/DD",slotProps:{input:{component:wi,ref:m}},sx:{fontFamily:"monospace"},endDecorator:L.createElement(z,{variant:"plain",onClick:h},L.createElement(xi,null))}),M&&L.createElement(Di,{onClickAway:()=>v(null)},L.createElement(ki,{id:"date-range-picker-popper",open:!0,anchorEl:c,placement:"bottom-end",onMouseDown:D=>D.preventDefault(),modifiers:[{name:"offset",options:{offset:[4,4]}}]},L.createElement(Ti,{tabIndex:-1,role:"presentation"},L.createElement(te,{rangeSelection:!0,defaultValue:T,onChange:b,minDate:l?new Date(l):void 0,maxDate:p?new Date(p):void 0,disableFuture:d,disablePast:g}),L.createElement(X,{sx:{p:1}},L.createElement(A,{size:"sm",variant:"plain",color:"neutral",onClick:()=>{s(""),v(null)}},"Clear"))))))));return i?L.createElement(F,{required:u,disabled:n,error:a,size:"sm"},L.createElement(B,null,i),k,r&&L.createElement(w,null,r)):k});Yo.displayName="DateRangePicker";import{DialogContent as Ai,styled as Ii}from"@mui/joy";import{motion as Fi}from"framer-motion";var Bi=Fi(Ai),Si=Ii(Bi)(({theme:e})=>({padding:e.spacing(0,6,5)})),Oe=Si;Oe.displayName="DialogContent";var so=Oe;import{DialogTitle as Ni,styled as Li}from"@mui/joy";import{motion as Vi}from"framer-motion";var Ei=Vi(Ni),Hi=Li(Ei)(({theme:e})=>({padding:e.spacing(4,6)})),ze=Hi;ze.displayName="DialogTitle";var po=ze;import Ye from"react";import mo from"react";import{Modal as Oi,ModalDialog as zi,ModalClose as Ri,ModalOverflow as Yi,styled as Kt}from"@mui/joy";import{motion as co}from"framer-motion";var Ji=co(Oi),Jo=Ji;Jo.displayName="Modal";var Ui=co(zi),jt=Kt(Ui)({padding:0}),Re=jt;Re.displayName="ModalDialog";var $i=Kt(co(Ri))(({theme:e})=>({top:e.spacing(3),right:e.spacing(6)})),uo=$i;uo.displayName="ModalClose";var Gi=co(Yi),Uo=Gi;Uo.displayName="ModalOverflow";function $o(e){let{title:o,children:t,...n}=e;return mo.createElement(jt,{...n},mo.createElement(uo,null),mo.createElement(po,null,o),mo.createElement(so,null,t))}$o.displayName="ModalFrame";import{styled as Wi}from"@mui/joy";var qi=Wi(Re)(({theme:e})=>({padding:0})),Go=Ye.forwardRef((e,o)=>{let{title:t,children:n,actions:i,...a}=e;return Ye.createElement(qi,{ref:o,...a},Ye.createElement(po,null,t),Ye.createElement(so,null,n),Ye.createElement(X,null,i))});Go.displayName="DialogFrame";import _i from"react";import{Divider as Ki}from"@mui/joy";import{motion as ji}from"framer-motion";var Zi=ji(Ki),Je=e=>_i.createElement(Zi,{...e});Je.displayName="Divider";import Xi from"react";import{Drawer as Qi}from"@mui/joy";import{motion as el}from"framer-motion";var ol=el(Qi),Wo=e=>{let{children:o,...t}=e;return Xi.createElement(ol,{...t,slotProps:{...t.slotProps,content:{...t.slotProps?.content,sx:{bgcolor:"transparent",p:{md:3,sm:0},boxShadow:"none"}}}},o)};Wo.displayName="InsetDrawer";import I,{useCallback as go,useEffect as tl,useMemo as Zt,useRef as Xt,useState as fo}from"react";import{styled as re}from"@mui/joy";import rl from"@mui/icons-material/esm/InfoOutlined.js";import nl from"@mui/icons-material/esm/CloudUploadRounded.js";import al from"@mui/icons-material/esm/UploadFileRounded.js";import il from"@mui/icons-material/esm/ClearRounded.js";import{combine as ll}from"@atlaskit/pragmatic-drag-and-drop/dist/esm/entry-point/combine.js";import{dropTargetForExternal as sl,monitorForExternal as pl}from"@atlaskit/pragmatic-drag-and-drop/dist/esm/entry-point/external/adapter.js";import{containsFiles as Qt,getFiles as ml}from"@atlaskit/pragmatic-drag-and-drop/dist/esm/entry-point/external/file.js";import{preventUnhandled as er}from"@atlaskit/pragmatic-drag-and-drop/dist/esm/entry-point/prevent-unhandled.js";var dl=re("input")({width:"1px",height:"1px",overflow:"hidden",whiteSpace:"nowrap",clip:"rect(0 0 0 0)",clipPath:"inset(50%)",position:"absolute"}),cl=re(R,{name:"Uploader",slot:"PreviewRoot"})({}),ul=re(Pe,{name:"Uploader",slot:"UploadCard"})(({theme:e})=>({padding:e.spacing(2.5),border:`1px solid ${e.palette.neutral.outlinedBorder}`})),gl=re(al,{name:"Uploader",slot:"UploadFileIcon"})(({theme:e})=>({color:e.palette.neutral[400],width:"32px",height:"32px"})),fl=re(il,{name:"Uploader",slot:"ClearIcon"})(({theme:e})=>({color:e.palette.neutral.plainColor,width:"18px",height:"18px"})),hl=["byte","kilobyte","megabyte","gigabyte","terabyte","petabyte"],or=e=>{let o=e==0?0:Math.floor(Math.log(e)/Math.log(1024)),t=e/Math.pow(1024,o),n=hl[o];return Intl.NumberFormat("en-us",{style:"unit",unit:n,unitDisplay:"narrow"}).format(t)},Cl=e=>{let{files:o,uploaded:t,onDelete:n}=e;return I.createElement(cl,{gap:1},[...t,...o].map(i=>I.createElement(ul,{key:i.name,size:"sm",color:"neutral"},I.createElement(R,{direction:"row",alignItems:"center",gap:2},I.createElement(gl,null),I.createElement(R,{flex:"1"},I.createElement(Y,{level:"body-sm",textColor:"common.black"},i.name),i.size&&I.createElement(Y,{level:"body-xs",fontWeight:"300",lineHeight:"1.33",textColor:"text.tertiary"},or(i.size))),I.createElement(z,{onClick:()=>n?.(i)},I.createElement(fl,null))))))},yl=re(R,{name:"Uploader",slot:"root"})(({theme:e})=>({gap:e.spacing(2)})),bl=re(q,{name:"Uploader",slot:"dropZone"})(({theme:e,state:o,error:t})=>({width:"100%",display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center",padding:e.spacing(5),gap:e.spacing(4),cursor:"pointer",backgroundColor:e.palette.background.surface,border:t?`1px solid ${e.palette.danger.outlinedBorder}`:o==="idle"?`1px solid ${e.palette.neutral.outlinedBorder}`:`1px solid ${e.palette.primary.outlinedBorder}`})),xl=re(nl,{name:"Uploader",slot:"iconContainer"})(({theme:e,state:o,error:t})=>({color:t?`rgba(${e.vars.palette.danger.mainChannel} / 0.6)`:o==="over"?`rgba(${e.palette.primary.mainChannel} / 0.6)`:e.palette.neutral.softActiveBg,width:"32px",height:"32px"})),qo=I.memo(e=>{let{accept:o,maxCount:t,name:n,size:i,maxSize:a,onChange:r,label:l,helperText:p,disabled:d,required:g,onDelete:u}=e,C=Xt(null),m=Xt(null),[y,s]=fo(),[c,v]=fo([]),[M,T]=fo(e.uploaded||[]),[P,h]=fo("idle"),b=Zt(()=>!!y||e.error,[e.error,y]),k=Zt(()=>!t||t&&[...M,...c].length!==t,[c,t,M]),D=go(H=>{try{a&&H.forEach($=>{if($.size>a)throw new Error(`File size exceeds the limit: ${or(a)}`)});let O=[...c,...H];if(t&&[...M,...O].length>t)throw new Error(`File count exceeds the limit: ${t}`);r?.({target:{name:n,value:O}}),v(O),s(void 0)}catch(O){s(O.message)}},[c,M]);tl(()=>{let H=C.current;if(H)return ll(sl({element:H,canDrop:Qt,onDragEnter:()=>h("over"),onDragLeave:()=>h("potential"),onDrop:async({source:O})=>{let $=await ml({source:O});D($)}}),pl({canMonitor:Qt,onDragStart:()=>{h("potential"),er.start()},onDrop:()=>{h("idle"),er.stop()}}))});let U=go(H=>{let O=Array.from(H.target.files||[]);D(O)},[D]),ie=go(H=>{H instanceof File?v(O=>(r?.({target:{name:n,value:O.filter($=>$!==H)}}),O.filter($=>$!==H))):(T(O=>O.filter($=>$.id!==H.id)),u?.(H)),s(void 0)},[]),Z=go(()=>{m.current?.click()},[]);return I.createElement(yl,null,k&&I.createElement(F,{size:i,error:!!b,disabled:d,required:g},l&&I.createElement(B,null,l),I.createElement(bl,{state:P,error:b,ref:C,onClick:Z},I.createElement(R,{alignItems:"center",gap:1},I.createElement(xl,{state:P,error:b})),I.createElement(dl,{type:"file",onChange:U,multiple:!0,accept:o,disabled:d,required:g,ref:m})),y?I.createElement(w,null,I.createElement(rl,null),y):p&&I.createElement(w,null,p)),[...M,...c].length>0&&I.createElement(Cl,{files:c,uploaded:M,onDelete:ie}))});qo.displayName="Uploader";import{Grid as vl}from"@mui/joy";import{motion as Dl}from"framer-motion";var Ml=Dl(vl),_o=Ml;_o.displayName="Grid";import oe from"react";import kl from"react-markdown";import{Link as Tl}from"@mui/joy";var Ko=e=>{let{children:o,color:t,textColor:n,defaultLevel:i="body-md",markdownOptions:a,...r}=e;return oe.createElement(G,{color:t,textColor:n,...r},oe.createElement(kl,{...a,children:o,components:{h1:({children:l})=>oe.createElement(G,{color:t,textColor:n,level:"h1"},l),h2:({children:l})=>oe.createElement(G,{color:t,textColor:n,level:"h2"},l),h3:({children:l})=>oe.createElement(G,{color:t,textColor:n,level:"h3"},l),h4:({children:l})=>oe.createElement(G,{color:t,textColor:n,level:"h4"},l),p:({children:l})=>oe.createElement(G,{color:t,textColor:n,level:i},l),a:({children:l,href:p})=>oe.createElement(Tl,{href:p},l),hr:()=>oe.createElement(Je,null),...a?.components}}))};Ko.displayName="Markdown";import V,{forwardRef as Pl,useCallback as tr,useEffect as rr,useImperativeHandle as wl,useRef as Al,useState as nr}from"react";import{IMaskInput as Il,IMask as ar}from"react-imask";import Fl from"@mui/icons-material/esm/CalendarToday.js";import{styled as Zo}from"@mui/joy";import{FocusTrap as Bl,ClickAwayListener as Sl,Popper as Nl}from"@mui/base";var Ll=Zo(Nl,{name:"MonthPicker",slot:"popper"})(({theme:e})=>({zIndex:e.zIndex.tooltip})),Vl=Zo(q,{name:"MonthPicker",slot:"sheet",overridesResolver:(e,o)=>o.root})(({theme:e})=>({width:"264px",boxShadow:e.shadow.md,borderRadius:e.radius.md})),El=Zo("div",{name:"MonthPicker",slot:"container"})({width:"100%"}),ir=e=>{let o=`${e.getMonth()+1}`,t=e.getFullYear();return Number(o)<10&&(o="0"+o),[t,o].join("/")},jo=e=>(t=>{if(!/^\d\d\d\d\/(0[1-9]|1[012])(\/(0[1-9]|[23][0-9]))?$/.test(t))return t;let n=t.split("/"),i=new Date(Number(n[0]),Number(n[1])-1);return ir(i)})(e),lr=e=>e.split(" - ")[0]||"",Hl=V.forwardRef(function(o,t){let{onChange:n,...i}=o;return V.createElement(Il,{...i,inputRef:t,onAccept:a=>n({target:{name:o.name,value:a}}),mask:Date,pattern:"Y/m",blocks:{m:{mask:ar.MaskedRange,from:1,to:12,maxLength:2},Y:{mask:ar.MaskedRange,from:1900,to:9999}},format:jo,parse:lr})}),sr=Pl((e,o)=>{let{onChange:t,disabled:n,label:i,error:a,helperText:r,minDate:l,maxDate:p,disableFuture:d,disablePast:g,required:u,...C}=e,m=Al(null),[y,s]=nr(e.value||""),[c,v]=nr(null),M=!!c;rr(()=>{s(e.value?jo(lr(e.value)):"")},[e.value]),rr(()=>{c||m.current?.blur()},[c,m]),wl(o,()=>m.current,[m.current]);let T=tr(b=>{s(b.target.value),t?.(b)},[]),P=tr(b=>{v(c?null:b.currentTarget),m.current?.focus()},[c,v,m]),h=V.createElement(El,null,V.createElement(Bl,{open:!0},V.createElement(V.Fragment,null,V.createElement(J,{...C,ref:m,size:"sm",value:y,onChange:T,placeholder:"YYYY/MM",disabled:n,required:u,slotProps:{input:{component:Hl,ref:m}},sx:{fontFamily:"monospace"},endDecorator:V.createElement(z,{variant:"plain",onClick:P},V.createElement(Fl,null))}),M&&V.createElement(Sl,{onClickAway:()=>v(null)},V.createElement(Ll,{id:"date-picker-popper",open:!0,anchorEl:c,placement:"bottom-end",onMouseDown:b=>b.preventDefault(),modifiers:[{name:"offset",options:{offset:[4,4]}}]},V.createElement(Vl,{tabIndex:-1,role:"presentation"},V.createElement(te,{view:"month",views:["month"],value:Number.isNaN(new Date(y).getTime())?void 0:[new Date(y),void 0],onChange:([b])=>{T({target:{name:e.name,value:jo(ir(b))}}),v(null)},minDate:l?new Date(l):void 0,maxDate:p?new Date(p):void 0,disableFuture:d,disablePast:g}),V.createElement(X,{sx:{p:1}},V.createElement(A,{size:"sm",variant:"plain",color:"neutral",onClick:()=>{T({target:{name:e.name,value:""}}),v(null)}},"Clear"))))))));return i?V.createElement(F,{required:u,disabled:n,error:a,size:"sm"},V.createElement(B,null,i),h,r&&V.createElement(w,null,r)):h});import E,{forwardRef as Ol,useCallback as Xo,useEffect as pr,useImperativeHandle as zl,useMemo as Rl,useRef as Yl,useState as mr}from"react";import{IMaskInput as Jl,IMask as dr}from"react-imask";import Ul from"@mui/icons-material/esm/CalendarToday.js";import{styled as tt}from"@mui/joy";import{FocusTrap as $l,ClickAwayListener as Gl,Popper as Wl}from"@mui/base";var ql=tt(Wl,{name:"MonthRangePicker",slot:"popper"})(({theme:e})=>({zIndex:e.zIndex.tooltip})),_l=tt(q,{name:"MonthRangePicker",slot:"sheet",overridesResolver:(e,o)=>o.root})(({theme:e})=>({zIndex:e.zIndex.tooltip,width:"264px",boxShadow:e.shadow.md,borderRadius:e.radius.md})),Kl=tt("div",{name:"MonthRangePicker",slot:"container"})({width:"100%"}),Qo=e=>{let o=`${e.getMonth()+1}`,t=e.getFullYear();return Number(o)<10&&(o="0"+o),[t,o].join("/")},et=([e,o])=>{let t=n=>{if(!/^\d\d\d\d\/(0[1-9]|1[012])(\/(0[1-9]|[23][0-9]))?$/.test(n))return n;let i=n.split("/"),a=new Date(Number(i[0]),Number(i[1])-1);return Qo(a)};return[t(e),t(o)].join(" - ")},ot=e=>{let o=e.split(" - ")[0]||"",t=e.split(" - ")[1]||"";return[o,t]},jl=E.forwardRef(function(o,t){let{onChange:n,...i}=o;return E.createElement(Jl,{...i,inputRef:t,onAccept:a=>n({target:{name:o.name,value:a}}),mask:Date,pattern:"Y/m - Y/m",blocks:{m:{mask:dr.MaskedRange,from:1,to:12,maxLength:2},Y:{mask:dr.MaskedRange,from:1900,to:9999}},format:et,parse:ot})}),rt=Ol((e,o)=>{let{onChange:t,disabled:n,label:i,error:a,helperText:r,minDate:l,maxDate:p,disableFuture:d,disablePast:g,required:u,...C}=e,m=Yl(null),[y,s]=mr(""),[c,v]=mr(null),M=!!c,T=Rl(()=>y?ot(y).map(D=>new Date(D)):void 0,[y]);pr(()=>{s(e.value?et(ot(e.value)):"")},[e.value]),pr(()=>{c||m.current?.blur()},[c,m]),zl(o,()=>m.current,[m.current]);let P=Xo(D=>{s(D.target.value),t?.(D)},[t]),h=Xo(D=>{v(c?null:D.currentTarget),m.current?.focus()},[c,v,m]),b=Xo(([D,U])=>{!D||!U||(s(et([Qo(D),Qo(U)])),v(null))},[s,v,m]),k=E.createElement(Kl,null,E.createElement($l,{open:!0},E.createElement(E.Fragment,null,E.createElement(J,{...C,ref:o,size:"sm",value:y,onChange:P,disabled:n,required:u,placeholder:"YYYY/MM - YYYY/MM",slotProps:{input:{component:jl,ref:m}},sx:{fontFamily:"monospace"},endDecorator:E.createElement(z,{variant:"plain",onClick:h},E.createElement(Ul,null))}),M&&E.createElement(Gl,{onClickAway:()=>v(null)},E.createElement(ql,{id:"date-range-picker-popper",open:!0,anchorEl:c,placement:"bottom-end",onMouseDown:D=>D.preventDefault(),modifiers:[{name:"offset",options:{offset:[4,4]}}]},E.createElement(_l,{tabIndex:-1,role:"presentation"},E.createElement(te,{view:"month",views:["month"],rangeSelection:!0,defaultValue:T,onChange:b,minDate:l?new Date(l):void 0,maxDate:p?new Date(p):void 0,disableFuture:d,disablePast:g}),E.createElement(X,{sx:{p:1}},E.createElement(A,{size:"sm",variant:"plain",color:"neutral",onClick:()=>{s(""),v(null)}},"Clear"))))))));return i?E.createElement(F,{required:u,disabled:n,error:a,size:"sm"},E.createElement(B,null,i),k,r&&E.createElement(w,null,r)):k});rt.displayName="MonthRangePicker";import{Radio as Zl,RadioGroup as Xl}from"@mui/joy";import{motion as cr}from"framer-motion";var Ql=cr(Zl),Ue=Ql;Ue.displayName="Radio";var es=cr(Xl),$e=es;$e.displayName="RadioGroup";import ur from"react";function nt(e){let{items:o,...t}=e;return ur.createElement($e,{...t},o.map(n=>ur.createElement(Ue,{key:`${n.value}`,value:n.value,label:n.label})))}nt.displayName="RadioList";import gr from"react";import{Switch as os,styled as ts,switchClasses as rs}from"@mui/joy";import{motion as fr}from"framer-motion";var ns=fr(os),as=ts(fr.div)({"--Icon-fontSize":"calc(var(--Switch-thumbSize) * 0.75)",display:"inline-flex",justifyContent:"center",alignItems:"center",position:"absolute",left:"var(--Switch-thumbOffset)",width:"var(--Switch-thumbWidth)",height:"var(--Switch-thumbSize)",borderRadius:"var(--Switch-thumbRadius)",boxShadow:"var(--Switch-thumbShadow)",color:"var(--Switch-thumbColor)",backgroundColor:"var(--Switch-thumbBackground)",[`&.${rs.checked}`]:{left:"unset",right:"var(--Switch-thumbOffset)"}}),is=e=>gr.createElement(as,{...e,layout:!0,transition:ls}),ls={type:"spring",stiffness:700,damping:30},at=e=>gr.createElement(ns,{...e,slots:{thumb:is,...e.slots}});at.displayName="Switch";import{Tabs as ss,Tab as ps,TabList as ms,TabPanel as ds,styled as cs,tabClasses as us}from"@mui/joy";import{motion as ho}from"framer-motion";var gs=ho(ss),it=gs;it.displayName="Tabs";var fs=cs(ho(ps))(({theme:e})=>({[`&:not(.${us.selected})`]:{color:e.palette.neutral[700]}})),lt=fs;lt.displayName="Tab";var hs=ho(ms),st=hs;st.displayName="TabList";var Cs=ho(ds),pt=Cs;pt.displayName="TabPanel";import Co from"react";import{CssBaseline as ys,CssVarsProvider as bs,checkboxClasses as xs,extendTheme as vs}from"@mui/joy";var Ds=vs({cssVarPrefix:"ceed",spacing:4,zIndex:{popup:1500},components:{JoyTable:{defaultProps:{size:"sm",borderAxis:"bothBetween"},styleOverrides:{root:({theme:e})=>({"--TableRow-stripeBackground":e.palette.background.level1,"--TableCell-selectedBackground":e.palette.background.level2,"--TableRow-hoverBackground":e.palette.background.level3,"& tbody tr[aria-checked=false] th":{"--TableCell-headBackground":"transparent"},"& tbody tr[aria-checked=true]:hover th":{"--TableCell-headBackground":"var(--TableRow-hoverBackground)"},"& tbody tr[aria-checked=true]:not(:hover) th":{"--TableCell-headBackground":"var(--TableCell-selectedBackground)"},"& tbody tr[aria-checked=true]:not(:hover) td":{"--TableCell-dataBackground":"var(--TableCell-selectedBackground)"},[`& .${xs.root}`]:{verticalAlign:"middle"}})}},JoyTooltip:{defaultProps:{size:"sm",placement:"top"}}}});function mt(e){return Co.createElement(Co.Fragment,null,Co.createElement(bs,{theme:Ds},Co.createElement(ys,null),e.children))}mt.displayName="ThemeProvider";import Ms from"react";import{Tooltip as ks}from"@mui/joy";import{motion as Ts}from"framer-motion";var Ps=Ts(ks),dt=e=>Ms.createElement(Ps,{...e});dt.displayName="Tooltip";export{_e as Accordion,qe as AccordionDetails,We as AccordionSummary,bo as Accordions,xo as Alert,zC as AspectRatio,je as Autocomplete,FC as AutocompleteListbox,BC as AutocompleteOption,VC as Avatar,HC as AvatarGroup,YC as Badge,he as Box,Mo as Breadcrumbs,ve as Button,ke as Calendar,Pe as Card,Ao as CardActions,Po as CardContent,wo as CardCover,Io as CardOverflow,we as Checkbox,Ie as Chip,jC as CircularProgress,Fo as Container,to as CurrencyInput,Ho as DataTable,ro as DatePicker,Yo as DateRangePicker,Le as DialogActions,Oe as DialogContent,Go as DialogFrame,ze as DialogTitle,Je as Divider,XC as Drawer,xe as Dropdown,ce as FormControl,ge as FormHelperText,ue as FormLabel,_o as Grid,De as IconButton,Be as Input,Wo as InsetDrawer,ey as LinearProgress,hy as Link,ty as List,ny as ListDivider,iy as ListItem,sy as ListItemButton,my as ListItemContent,cy as ListItemDecorator,gy as ListSubheader,Ko as Markdown,Ce as Menu,ye as MenuButton,be as MenuItem,Jo as Modal,uo as ModalClose,Re as ModalDialog,$o as ModalFrame,Uo as ModalOverflow,sr as MonthPicker,rt as MonthRangePicker,ao as Option,Ue as Radio,$e as RadioGroup,nt as RadioList,He as Select,Se as Sheet,wy as Skeleton,yy as Slider,de as Stack,xy as Step,Dy as StepButton,ky as StepIndicator,Ty as Stepper,at as Switch,lt as Tab,st as TabList,pt as TabPanel,Ne as Table,So as TableBody,Bo as TableHead,it as Tabs,Ve as Textarea,mt as ThemeProvider,dt as Tooltip,G as Typography,qo as Uploader,PC as accordionClasses,wC as accordionDetailsClasses,IC as accordionSummaryClasses,AC as accordionsClasses,Gh as alertClasses,RC as aspectRatioClasses,SC as autocompleteClasses,NC as autocompleteListboxClasses,LC as autocompleteOptionClasses,EC as avatarClasses,OC as avatarGroupClasses,JC as badgeClasses,Wh as boxClasses,UC as breadcrumbsClasses,qh as buttonClasses,GC as cardActionsClasses,$C as cardClasses,WC as cardContentClasses,qC as cardCoverClasses,_C as cardOverflowClasses,_h as checkboxClasses,KC as chipClasses,ZC as circularProgressClasses,vC as dialogActionsClasses,xC as dialogContentClasses,bC as dialogTitleClasses,Kh as dividerClasses,QC as drawerClasses,pC as formControlClasses,dC as formHelperTextClasses,mC as formLabelClasses,cC as gridClasses,jh as iconButtonClasses,Zh as inputClasses,oy as linearProgressClasses,Cy as linkClasses,ry as listClasses,ay as listDividerClasses,py as listItemButtonClasses,ly as listItemClasses,dy as listItemContentClasses,uy as listItemDecoratorClasses,fy as listSubheaderClasses,Qh as menuButtonClasses,Xh as menuClasses,eC as menuItemClasses,fC as modalClasses,hC as modalCloseClasses,CC as modalDialogClasses,yC as modalOverflowClasses,oC as optionClasses,tC as radioClasses,rC as radioGroupClasses,nC as selectClasses,gC as sheetClasses,Ay as skeletonClasses,by as sliderClasses,uC as stackClasses,My as stepButtonClasses,vy as stepClasses,Py as stepperClasses,aC as switchClasses,kC as tabListClasses,TC as tabPanelClasses,iC as tableClasses,MC as tabsClasses,lC as textareaClasses,DC as tooltipClasses,sC as typographyClasses,Uh as useColorScheme,Jh as useTheme,$h as useThemeProps};