ikon-react-components-lib 1.0.3 → 1.0.5

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,6 +1,6 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),g=require("lucide-react"),Jn=require("@radix-ui/react-accordion"),Xn=require("clsx"),Qn=require("tailwind-merge"),Zn=require("@radix-ui/react-alert-dialog"),G=require("class-variance-authority"),es=require("@radix-ui/react-aspect-ratio"),ts=require("@radix-ui/react-avatar"),as=require("@radix-ui/react-checkbox"),rs=require("@radix-ui/react-dialog"),ns=require("@radix-ui/react-dropdown-menu"),ss=require("@radix-ui/react-hover-card"),os=require("@radix-ui/react-label"),is=require("@radix-ui/react-navigation-menu"),ls=require("@radix-ui/react-popover"),cs=require("@radix-ui/react-progress"),ds=require("@radix-ui/react-radio-group"),us=require("@radix-ui/react-scroll-area"),ms=require("@radix-ui/react-select"),fs=require("@radix-ui/react-separator"),xs=require("@radix-ui/react-slider"),Ut=require("@radix-ui/react-slot"),ps=require("@radix-ui/react-switch"),gs=require("@radix-ui/react-tabs"),hs=require("@radix-ui/react-toggle"),bs=require("@radix-ui/react-toggle-group"),vs=require("@radix-ui/react-tooltip"),m=require("react"),It=require("react-day-picker"),Fe=require("cmdk"),pa=require("sonner");require("react-dom");const ke=require("vaul"),Ue=require("react-hook-form"),ga=require("input-otp"),B=require("@tanstack/react-table"),Re=require("echarts"),it=require("motion/react"),js=require("zxcvbn"),ws=require("countries-list"),Ns=require("country-flag-icons/react/3x2"),qe=require("date-fns"),W=require("react-big-calendar");require("react-big-calendar/lib/css/react-big-calendar.css");const ys=require("date-fns/locale"),xe=require("react-router"),ha=require("axios"),Vt=require("js-cookie"),Cs=require("jwt-decode"),Me=require("@tanstack/react-query"),ba=require("react-cropper"),_=require("@assistant-ui/react"),Is=require("motion/react-m"),kt=require("@assistant-ui/react-markdown"),ks=require("remark-gfm"),Ss=require("@assistant-ui/react-ai-sdk"),sa=require("uuid");function F(t){const a=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const r in t)if(r!=="default"){const n=Object.getOwnPropertyDescriptor(t,r);Object.defineProperty(a,r,n.get?n:{enumerable:!0,get:()=>t[r]})}}return a.default=t,Object.freeze(a)}const As=F(g),Ke=F(Jn),je=F(Zn),Ts=F(es),qt=F(ts),oa=F(as),L=F(rs),q=F(ns),dt=F(ss),Ps=F(os),Se=F(is),Ye=F(ls),ia=F(cs),St=F(ds),He=F(us),H=F(ms),Ds=F(fs),nt=F(xs),we=F(Ut),la=F(ps),pt=F(gs),Rs=F(hs),va=F(bs),Be=F(vs),I=F(m),_s=F(Ns),At=F(Is);function i(...t){return Qn.twMerge(Xn.clsx(t))}function zs({...t}){return e.jsx(Ke.Root,{"data-slot":"accordion",...t})}function Ms({className:t,...a}){return e.jsx(Ke.Item,{"data-slot":"accordion-item",className:i("border-b last:border-b-0",t),...a})}function Fs({className:t,children:a,...r}){return e.jsx(Ke.Header,{className:"flex",children:e.jsxs(Ke.Trigger,{"data-slot":"accordion-trigger",className:i("focus-visible:border-ring focus-visible:ring-ring/50 flex flex-1 items-start justify-between gap-4 rounded-md py-4 text-left text-sm font-medium transition-all outline-none hover:underline focus-visible:ring-[3px] disabled:pointer-events-none disabled:opacity-50 [&[data-state=open]>svg]:rotate-180",t),...r,children:[a,e.jsx(g.ChevronDownIcon,{className:"text-muted-foreground pointer-events-none size-4 shrink-0 translate-y-0.5 transition-transform duration-200"})]})})}function Es({className:t,children:a,...r}){return e.jsx(Ke.Content,{"data-slot":"accordion-content",className:"data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down overflow-hidden text-sm",...r,children:e.jsx("div",{className:i("pt-0 pb-4",t),children:a})})}function Os(t,a,{checkForDefaultPrevented:r=!0}={}){return function(s){if(t?.(s),r===!1||!s.defaultPrevented)return a?.(s)}}function Ls(t,a=[]){let r=[];function n(o,l){const c=I.createContext(l),d=r.length;r=[...r,l];const u=h=>{const{scope:w,children:C,...v}=h,N=w?.[t]?.[d]||c,b=I.useMemo(()=>v,Object.values(v));return e.jsx(N.Provider,{value:b,children:C})};u.displayName=o+"Provider";function f(h,w){const C=w?.[t]?.[d]||c,v=I.useContext(C);if(v)return v;if(l!==void 0)return l;throw new Error(`\`${h}\` must be used within \`${o}\``)}return[u,f]}const s=()=>{const o=r.map(l=>I.createContext(l));return function(c){const d=c?.[t]||o;return I.useMemo(()=>({[`__scope${t}`]:{...c,[t]:d}}),[c,d])}};return s.scopeName=t,[n,Bs(s,...a)]}function Bs(...t){const a=t[0];if(t.length===1)return a;const r=()=>{const n=t.map(s=>({useScope:s(),scopeName:s.scopeName}));return function(o){const l=n.reduce((c,{useScope:d,scopeName:u})=>{const h=d(o)[`__scope${u}`];return{...c,...h}},{});return I.useMemo(()=>({[`__scope${a.scopeName}`]:l}),[l])}};return r.scopeName=a.scopeName,r}var Je=globalThis?.document?I.useLayoutEffect:()=>{},Us=I[" useInsertionEffect ".trim().toString()]||Je;function Vs({prop:t,defaultProp:a,onChange:r=()=>{},caller:n}){const[s,o,l]=qs({defaultProp:a,onChange:r}),c=t!==void 0,d=c?t:s;{const f=I.useRef(t!==void 0);I.useEffect(()=>{const h=f.current;h!==c&&console.warn(`${n} is changing from ${h?"controlled":"uncontrolled"} to ${c?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),f.current=c},[c,n])}const u=I.useCallback(f=>{if(c){const h=Ws(f)?f(t):f;h!==t&&l.current?.(h)}else o(f)},[c,t,o,l]);return[d,u]}function qs({defaultProp:t,onChange:a}){const[r,n]=I.useState(t),s=I.useRef(r),o=I.useRef(a);return Us(()=>{o.current=a},[a]),I.useEffect(()=>{s.current!==r&&(o.current?.(r),s.current=r)},[r,s]),[r,n,o]}function Ws(t){return typeof t=="function"}function ca(t,a){if(typeof t=="function")return t(a);t!=null&&(t.current=a)}function Gs(...t){return a=>{let r=!1;const n=t.map(s=>{const o=ca(s,a);return!r&&typeof o=="function"&&(r=!0),o});if(r)return()=>{for(let s=0;s<n.length;s++){const o=n[s];typeof o=="function"?o():ca(t[s],null)}}}}function ja(...t){return I.useCallback(Gs(...t),t)}var $s=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Wt=$s.reduce((t,a)=>{const r=Ut.createSlot(`Primitive.${a}`),n=I.forwardRef((s,o)=>{const{asChild:l,...c}=s,d=l?r:a;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),e.jsx(d,{...c,ref:o})});return n.displayName=`Primitive.${a}`,{...t,[a]:n}},{});function Hs(t,a){return I.useReducer((r,n)=>a[r][n]??r,t)}var wa=t=>{const{present:a,children:r}=t,n=Ks(a),s=typeof r=="function"?r({present:n.isPresent}):I.Children.only(r),o=ja(n.ref,Ys(s));return typeof r=="function"||n.isPresent?I.cloneElement(s,{ref:o}):null};wa.displayName="Presence";function Ks(t){const[a,r]=I.useState(),n=I.useRef(null),s=I.useRef(t),o=I.useRef("none"),l=t?"mounted":"unmounted",[c,d]=Hs(l,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return I.useEffect(()=>{const u=st(n.current);o.current=c==="mounted"?u:"none"},[c]),Je(()=>{const u=n.current,f=s.current;if(f!==t){const w=o.current,C=st(u);t?d("MOUNT"):C==="none"||u?.display==="none"?d("UNMOUNT"):d(f&&w!==C?"ANIMATION_OUT":"UNMOUNT"),s.current=t}},[t,d]),Je(()=>{if(a){let u;const f=a.ownerDocument.defaultView??window,h=C=>{const N=st(n.current).includes(CSS.escape(C.animationName));if(C.target===a&&N&&(d("ANIMATION_END"),!s.current)){const b=a.style.animationFillMode;a.style.animationFillMode="forwards",u=f.setTimeout(()=>{a.style.animationFillMode==="forwards"&&(a.style.animationFillMode=b)})}},w=C=>{C.target===a&&(o.current=st(n.current))};return a.addEventListener("animationstart",w),a.addEventListener("animationcancel",h),a.addEventListener("animationend",h),()=>{f.clearTimeout(u),a.removeEventListener("animationstart",w),a.removeEventListener("animationcancel",h),a.removeEventListener("animationend",h)}}else d("ANIMATION_END")},[a,d]),{isPresent:["mounted","unmountSuspended"].includes(c),ref:I.useCallback(u=>{n.current=u?getComputedStyle(u):null,r(u)},[])}}function st(t){return t?.animationName||"none"}function Ys(t){let a=Object.getOwnPropertyDescriptor(t.props,"ref")?.get,r=a&&"isReactWarning"in a&&a.isReactWarning;return r?t.ref:(a=Object.getOwnPropertyDescriptor(t,"ref")?.get,r=a&&"isReactWarning"in a&&a.isReactWarning,r?t.props.ref:t.props.ref||t.ref)}var Js=I[" useId ".trim().toString()]||(()=>{}),Xs=0;function Qs(t){const[a,r]=I.useState(Js());return Je(()=>{r(n=>n??String(Xs++))},[t]),t||(a?`radix-${a}`:"")}var gt="Collapsible",[Zs]=Ls(gt),[eo,Gt]=Zs(gt),Na=I.forwardRef((t,a)=>{const{__scopeCollapsible:r,open:n,defaultOpen:s,disabled:o,onOpenChange:l,...c}=t,[d,u]=Vs({prop:n,defaultProp:s??!1,onChange:l,caller:gt});return e.jsx(eo,{scope:r,disabled:o,contentId:Qs(),open:d,onOpenToggle:I.useCallback(()=>u(f=>!f),[u]),children:e.jsx(Wt.div,{"data-state":Ht(d),"data-disabled":o?"":void 0,...c,ref:a})})});Na.displayName=gt;var ya="CollapsibleTrigger",Ca=I.forwardRef((t,a)=>{const{__scopeCollapsible:r,...n}=t,s=Gt(ya,r);return e.jsx(Wt.button,{type:"button","aria-controls":s.contentId,"aria-expanded":s.open||!1,"data-state":Ht(s.open),"data-disabled":s.disabled?"":void 0,disabled:s.disabled,...n,ref:a,onClick:Os(t.onClick,s.onOpenToggle)})});Ca.displayName=ya;var $t="CollapsibleContent",Ia=I.forwardRef((t,a)=>{const{forceMount:r,...n}=t,s=Gt($t,t.__scopeCollapsible);return e.jsx(wa,{present:r||s.open,children:({present:o})=>e.jsx(to,{...n,ref:a,present:o})})});Ia.displayName=$t;var to=I.forwardRef((t,a)=>{const{__scopeCollapsible:r,present:n,children:s,...o}=t,l=Gt($t,r),[c,d]=I.useState(n),u=I.useRef(null),f=ja(a,u),h=I.useRef(0),w=h.current,C=I.useRef(0),v=C.current,N=l.open||c,b=I.useRef(N),y=I.useRef(void 0);return I.useEffect(()=>{const x=requestAnimationFrame(()=>b.current=!1);return()=>cancelAnimationFrame(x)},[]),Je(()=>{const x=u.current;if(x){y.current=y.current||{transitionDuration:x.style.transitionDuration,animationName:x.style.animationName},x.style.transitionDuration="0s",x.style.animationName="none";const k=x.getBoundingClientRect();h.current=k.height,C.current=k.width,b.current||(x.style.transitionDuration=y.current.transitionDuration,x.style.animationName=y.current.animationName),d(n)}},[l.open,n]),e.jsx(Wt.div,{"data-state":Ht(l.open),"data-disabled":l.disabled?"":void 0,id:l.contentId,hidden:!N,...o,ref:f,style:{"--radix-collapsible-content-height":w?`${w}px`:void 0,"--radix-collapsible-content-width":v?`${v}px`:void 0,...t.style},children:N&&s})});function Ht(t){return t?"open":"closed"}var ao=Na;const ut=G.cva("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive text-white hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",outline:"border bg-background shadow-xs hover:bg-accent hover:text-accent-foreground dark:bg-input/30 dark:border-input dark:hover:bg-input/50",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50",dashed:"border border-dashed bg-background shadow-sm hover:bg-accent hover:text-accent-foreground ",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2 has-[>svg]:px-3",xs:"h-6 gap-1 rounded-md px-2 text-xs has-[>svg]:px-1.5 [&_svg:not([class*='size-'])]:size-3",sm:"h-8 rounded-md gap-1.5 px-3 has-[>svg]:px-2.5",lg:"h-10 rounded-md px-6 has-[>svg]:px-4",icon:"size-9","icon-xs":"size-6 rounded-md [&_svg:not([class*='size-'])]:size-3","icon-sm":"size-8","icon-lg":"size-10"}},defaultVariants:{variant:"default",size:"default"}});function R({className:t,variant:a="default",size:r="default",asChild:n=!1,...s}){const o=n?we.Root:"button";return e.jsx(o,{"data-slot":"button","data-variant":a,"data-size":r,className:i(ut({variant:a,size:r,className:t})),...s})}function ka({...t}){return e.jsx(je.Root,{"data-slot":"alert-dialog",...t})}function ro({...t}){return e.jsx(je.Trigger,{"data-slot":"alert-dialog-trigger",...t})}function Sa({...t}){return e.jsx(je.Portal,{"data-slot":"alert-dialog-portal",...t})}function Aa({className:t,...a}){return e.jsx(je.Overlay,{"data-slot":"alert-dialog-overlay",className:i("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50",t),...a})}function Ta({className:t,size:a="default",...r}){return e.jsxs(Sa,{children:[e.jsx(Aa,{}),e.jsx(je.Content,{"data-slot":"alert-dialog-content","data-size":a,className:i("bg-background data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 group/alert-dialog-content fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border p-6 shadow-lg duration-200 data-[size=sm]:max-w-xs data-[size=default]:sm:max-w-lg",t),...r})]})}function Pa({className:t,...a}){return e.jsx("div",{"data-slot":"alert-dialog-header",className:i("grid grid-rows-[auto_1fr] place-items-center gap-1.5 text-center has-data-[slot=alert-dialog-media]:grid-rows-[auto_auto_1fr] has-data-[slot=alert-dialog-media]:gap-x-6 sm:group-data-[size=default]/alert-dialog-content:place-items-start sm:group-data-[size=default]/alert-dialog-content:text-left sm:group-data-[size=default]/alert-dialog-content:has-data-[slot=alert-dialog-media]:grid-rows-[auto_1fr]",t),...a})}function Da({className:t,...a}){return e.jsx("div",{"data-slot":"alert-dialog-footer",className:i("flex flex-col-reverse gap-2 group-data-[size=sm]/alert-dialog-content:grid group-data-[size=sm]/alert-dialog-content:grid-cols-2 sm:flex-row sm:justify-end",t),...a})}function Ra({className:t,...a}){return e.jsx(je.Title,{"data-slot":"alert-dialog-title",className:i("text-lg font-semibold sm:group-data-[size=default]/alert-dialog-content:group-has-data-[slot=alert-dialog-media]/alert-dialog-content:col-start-2",t),...a})}function _a({className:t,...a}){return e.jsx(je.Description,{"data-slot":"alert-dialog-description",className:i("text-muted-foreground text-sm",t),...a})}function no({className:t,...a}){return e.jsx("div",{"data-slot":"alert-dialog-media",className:i("bg-muted mb-2 inline-flex size-16 items-center justify-center rounded-md sm:group-data-[size=default]/alert-dialog-content:row-span-2 *:[svg:not([class*='size-'])]:size-8",t),...a})}function Tt({className:t,variant:a="default",size:r="default",...n}){return e.jsx(R,{variant:a,size:r,asChild:!0,children:e.jsx(je.Action,{"data-slot":"alert-dialog-action",className:i(t),...n})})}function za({className:t,variant:a="outline",size:r="default",...n}){return e.jsx(R,{variant:a,size:r,asChild:!0,children:e.jsx(je.Cancel,{"data-slot":"alert-dialog-cancel",className:i(t),...n})})}const so=G.cva("relative w-full rounded-lg border px-4 py-3 text-sm grid has-[>svg]:grid-cols-[calc(var(--spacing)*4)_1fr] grid-cols-[0_1fr] has-[>svg]:gap-x-3 gap-y-0.5 items-start [&>svg]:size-4 [&>svg]:translate-y-0.5 [&>svg]:text-current",{variants:{variant:{default:"bg-card text-card-foreground",destructive:"text-destructive bg-card [&>svg]:text-current *:data-[slot=alert-description]:text-destructive/90"}},defaultVariants:{variant:"default"}});function oo({className:t,variant:a,...r}){return e.jsx("div",{"data-slot":"alert",role:"alert",className:i(so({variant:a}),t),...r})}function io({className:t,...a}){return e.jsx("div",{"data-slot":"alert-title",className:i("col-start-2 line-clamp-1 min-h-4 font-medium tracking-tight",t),...a})}function lo({className:t,...a}){return e.jsx("div",{"data-slot":"alert-description",className:i("text-muted-foreground col-start-2 grid justify-items-start gap-1 text-sm [&_p]:leading-relaxed",t),...a})}function Ma({className:t,size:a="default",...r}){return e.jsx(qt.Root,{"data-slot":"avatar","data-size":a,className:i("group/avatar relative flex size-8 shrink-0 overflow-hidden rounded-full select-none data-[size=lg]:size-10 data-[size=sm]:size-6",t),...r})}function Fa({className:t,...a}){return e.jsx(qt.Image,{"data-slot":"avatar-image",className:i("aspect-square size-full",t),...a})}function Ea({className:t,...a}){return e.jsx(qt.Fallback,{"data-slot":"avatar-fallback",className:i("bg-muted text-muted-foreground flex size-full items-center justify-center rounded-full text-sm group-data-[size=sm]/avatar:text-xs",t),...a})}function co({className:t,...a}){return e.jsx("span",{"data-slot":"avatar-badge",className:i("bg-primary text-primary-foreground ring-background absolute right-0 bottom-0 z-10 inline-flex items-center justify-center rounded-full ring-2 select-none","group-data-[size=sm]/avatar:size-2 group-data-[size=sm]/avatar:[&>svg]:hidden","group-data-[size=default]/avatar:size-2.5 group-data-[size=default]/avatar:[&>svg]:size-2","group-data-[size=lg]/avatar:size-3 group-data-[size=lg]/avatar:[&>svg]:size-2",t),...a})}function uo({className:t,...a}){return e.jsx("div",{"data-slot":"avatar-group",className:i("*:data-[slot=avatar]:ring-background group/avatar-group flex -space-x-2 *:data-[slot=avatar]:ring-2",t),...a})}function mo({className:t,...a}){return e.jsx("div",{"data-slot":"avatar-group-count",className:i("bg-muted text-muted-foreground ring-background relative flex size-8 shrink-0 items-center justify-center rounded-full text-sm ring-2 group-has-data-[size=lg]/avatar-group:size-10 group-has-data-[size=sm]/avatar-group:size-6 [&>svg]:size-4 group-has-data-[size=lg]/avatar-group:[&>svg]:size-5 group-has-data-[size=sm]/avatar-group:[&>svg]:size-3",t),...a})}const Oa=G.cva("inline-flex items-center justify-center rounded-full border border-transparent px-2 py-0.5 text-xs font-medium w-fit whitespace-nowrap shrink-0 [&>svg]:size-3 gap-1 [&>svg]:pointer-events-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive transition-[color,box-shadow] overflow-hidden",{variants:{variant:{default:"bg-primary text-primary-foreground [a&]:hover:bg-primary/90",secondary:"bg-secondary text-secondary-foreground [a&]:hover:bg-secondary/90",destructive:"bg-destructive text-white [a&]:hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",outline:"border-border text-foreground [a&]:hover:bg-accent [a&]:hover:text-accent-foreground",ghost:"[a&]:hover:bg-accent [a&]:hover:text-accent-foreground",link:"text-primary underline-offset-4 [a&]:hover:underline"}},defaultVariants:{variant:"default"}});function lt({className:t,variant:a="default",asChild:r=!1,...n}){const s=r?we.Root:"span";return e.jsx(s,{"data-slot":"badge","data-variant":a,className:i(Oa({variant:a}),t),...n})}function La({className:t,classNames:a,showOutsideDays:r=!0,captionLayout:n="label",buttonVariant:s="ghost",formatters:o,components:l,...c}){const d=It.getDefaultClassNames();return e.jsx(It.DayPicker,{showOutsideDays:r,className:i("bg-background group/calendar p-3 [--cell-size:--spacing(8)] [[data-slot=card-content]_&]:bg-transparent [[data-slot=popover-content]_&]:bg-transparent",String.raw`rtl:**:[.rdp-button\_next>svg]:rotate-180`,String.raw`rtl:**:[.rdp-button\_previous>svg]:rotate-180`,t),captionLayout:n,formatters:{formatMonthDropdown:u=>u.toLocaleString("default",{month:"short"}),...o},classNames:{root:i("w-fit",d.root),months:i("flex gap-4 flex-col md:flex-row relative",d.months),month:i("flex flex-col w-full gap-4",d.month),nav:i("flex items-center gap-1 w-full absolute top-0 inset-x-0 justify-between",d.nav),button_previous:i(ut({variant:s}),"size-(--cell-size) aria-disabled:opacity-50 p-0 select-none",d.button_previous),button_next:i(ut({variant:s}),"size-(--cell-size) aria-disabled:opacity-50 p-0 select-none",d.button_next),month_caption:i("flex items-center justify-center h-(--cell-size) w-full px-(--cell-size)",d.month_caption),dropdowns:i("w-full flex items-center text-sm font-medium justify-center h-(--cell-size) gap-1.5",d.dropdowns),dropdown_root:i("relative has-focus:border-ring border border-input shadow-xs has-focus:ring-ring/50 has-focus:ring-[3px] rounded-md",d.dropdown_root),dropdown:i("absolute bg-popover inset-0 opacity-0",d.dropdown),caption_label:i("select-none font-medium",n==="label"?"text-sm":"rounded-md pl-2 pr-1 flex items-center gap-1 text-sm h-8 [&>svg]:text-muted-foreground [&>svg]:size-3.5",d.caption_label),table:"w-full border-collapse",weekdays:i("flex",d.weekdays),weekday:i("text-muted-foreground rounded-md flex-1 font-normal text-[0.8rem] select-none",d.weekday),week:i("flex w-full mt-2",d.week),week_number_header:i("select-none w-(--cell-size)",d.week_number_header),week_number:i("text-[0.8rem] select-none text-muted-foreground",d.week_number),day:i("relative w-full h-full p-0 text-center [&:last-child[data-selected=true]_button]:rounded-r-md group/day aspect-square select-none",c.showWeekNumber?"[&:nth-child(2)[data-selected=true]_button]:rounded-l-md":"[&:first-child[data-selected=true]_button]:rounded-l-md",d.day),range_start:i("rounded-l-md bg-accent",d.range_start),range_middle:i("rounded-none",d.range_middle),range_end:i("rounded-r-md bg-accent",d.range_end),today:i("bg-accent text-accent-foreground rounded-md data-[selected=true]:rounded-none",d.today),outside:i("text-muted-foreground aria-selected:text-muted-foreground",d.outside),disabled:i("text-muted-foreground opacity-50",d.disabled),hidden:i("invisible",d.hidden),...a},components:{Root:({className:u,rootRef:f,...h})=>e.jsx("div",{"data-slot":"calendar",ref:f,className:i(u),...h}),Chevron:({className:u,orientation:f,...h})=>f==="left"?e.jsx(g.ChevronLeftIcon,{className:i("size-4",u),...h}):f==="right"?e.jsx(g.ChevronRightIcon,{className:i("size-4",u),...h}):e.jsx(g.ChevronDownIcon,{className:i("size-4",u),...h}),DayButton:Ba,WeekNumber:({children:u,...f})=>e.jsx("td",{...f,children:e.jsx("div",{className:"flex size-(--cell-size) items-center justify-center text-center",children:u})}),...l},...c})}function Ba({className:t,day:a,modifiers:r,...n}){const s=It.getDefaultClassNames(),o=I.useRef(null);return I.useEffect(()=>{r.focused&&o.current?.focus()},[r.focused]),e.jsx(R,{ref:o,variant:"ghost",size:"icon","data-day":a.date.toLocaleDateString(),"data-selected-single":r.selected&&!r.range_start&&!r.range_end&&!r.range_middle,"data-range-start":r.range_start,"data-range-end":r.range_end,"data-range-middle":r.range_middle,className:i("data-[selected-single=true]:bg-primary data-[selected-single=true]:text-primary-foreground data-[range-middle=true]:bg-accent data-[range-middle=true]:text-accent-foreground data-[range-start=true]:bg-primary data-[range-start=true]:text-primary-foreground data-[range-end=true]:bg-primary data-[range-end=true]:text-primary-foreground group-data-[focused=true]/day:border-ring group-data-[focused=true]/day:ring-ring/50 dark:hover:text-accent-foreground flex aspect-square size-auto w-full min-w-(--cell-size) flex-col gap-1 leading-none font-normal group-data-[focused=true]/day:relative group-data-[focused=true]/day:z-10 group-data-[focused=true]/day:ring-[3px] data-[range-end=true]:rounded-md data-[range-end=true]:rounded-r-md data-[range-middle=true]:rounded-none data-[range-start=true]:rounded-md data-[range-start=true]:rounded-l-md [&>span]:text-xs [&>span]:opacity-70",s.day,t),...n})}function mt({className:t,...a}){return e.jsx("div",{"data-slot":"card",className:i("bg-card text-card-foreground flex flex-col gap-6 rounded-xl border py-6 shadow-sm",t),...a})}function fo({className:t,...a}){return e.jsx("div",{"data-slot":"card-header",className:i("@container/card-header grid auto-rows-min grid-rows-[auto_auto] items-start gap-2 px-6 has-data-[slot=card-action]:grid-cols-[1fr_auto] [.border-b]:pb-6",t),...a})}function xo({className:t,...a}){return e.jsx("div",{"data-slot":"card-title",className:i("leading-none font-semibold",t),...a})}function po({className:t,...a}){return e.jsx("div",{"data-slot":"card-description",className:i("text-muted-foreground text-sm",t),...a})}function go({className:t,...a}){return e.jsx("div",{"data-slot":"card-action",className:i("col-start-2 row-span-2 row-start-1 self-start justify-self-end",t),...a})}function Ua({className:t,...a}){return e.jsx("div",{"data-slot":"card-content",className:i("px-6",t),...a})}function ho({className:t,...a}){return e.jsx("div",{"data-slot":"card-footer",className:i("flex items-center px-6 [.border-t]:pt-6",t),...a})}function Xe({className:t,...a}){return e.jsx(oa.Root,{"data-slot":"checkbox",className:i("peer border-input dark:bg-input/30 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground dark:data-[state=checked]:bg-primary data-[state=checked]:border-primary focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive size-4 shrink-0 rounded-[4px] border shadow-xs transition-shadow outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50",t),...a,children:e.jsx(oa.Indicator,{"data-slot":"checkbox-indicator",className:"grid place-content-center text-current transition-none",children:e.jsx(g.CheckIcon,{className:"size-3.5"})})})}function ht({...t}){return e.jsx(L.Root,{"data-slot":"dialog",...t})}function Va({...t}){return e.jsx(L.Trigger,{"data-slot":"dialog-trigger",...t})}function qa({...t}){return e.jsx(L.Portal,{"data-slot":"dialog-portal",...t})}function bo({...t}){return e.jsx(L.Close,{"data-slot":"dialog-close",...t})}function Wa({className:t,...a}){return e.jsx(L.Overlay,{"data-slot":"dialog-overlay",className:i("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50",t),...a})}function bt({className:t,children:a,showCloseButton:r=!0,...n}){return e.jsxs(qa,{"data-slot":"dialog-portal",children:[e.jsx(Wa,{}),e.jsxs(L.Content,{"data-slot":"dialog-content",className:i("bg-background data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border p-6 shadow-lg duration-200 outline-none sm:max-w-lg",t),...n,children:[a,r&&e.jsxs(L.Close,{"data-slot":"dialog-close",className:"ring-offset-background focus:ring-ring data-[state=open]:bg-accent data-[state=open]:text-muted-foreground absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",children:[e.jsx(g.XIcon,{}),e.jsx("span",{className:"sr-only",children:"Close"})]})]})]})}function Kt({className:t,...a}){return e.jsx("div",{"data-slot":"dialog-header",className:i("flex flex-col gap-2 text-center sm:text-left",t),...a})}function Ga({className:t,showCloseButton:a=!1,children:r,...n}){return e.jsxs("div",{"data-slot":"dialog-footer",className:i("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",t),...n,children:[r,a&&e.jsx(L.Close,{asChild:!0,children:e.jsx(R,{variant:"outline",children:"Close"})})]})}function vt({className:t,...a}){return e.jsx(L.Title,{"data-slot":"dialog-title",className:i("text-lg leading-none font-semibold",t),...a})}function $a({className:t,...a}){return e.jsx(L.Description,{"data-slot":"dialog-description",className:i("text-muted-foreground text-sm",t),...a})}function Y({className:t,...a}){return e.jsx(Fe.Command,{"data-slot":"command",className:i("bg-popover text-popover-foreground flex h-full w-full flex-col overflow-hidden rounded-md",t),...a})}function vo({title:t="Command Palette",description:a="Search for a command to run...",children:r,className:n,showCloseButton:s=!0,...o}){return e.jsxs(ht,{...o,children:[e.jsxs(Kt,{className:"sr-only",children:[e.jsx(vt,{children:t}),e.jsx($a,{children:a})]}),e.jsx(bt,{className:i("overflow-hidden p-0",n),showCloseButton:s,children:e.jsx(Y,{className:"[&_[cmdk-group-heading]]:text-muted-foreground **:data-[slot=command-input-wrapper]:h-12 [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group]]:px-2 [&_[cmdk-group]:not([hidden])_~[cmdk-group]]:pt-0 [&_[cmdk-input-wrapper]_svg]:h-5 [&_[cmdk-input-wrapper]_svg]:w-5 [&_[cmdk-input]]:h-12 [&_[cmdk-item]]:px-2 [&_[cmdk-item]]:py-3 [&_[cmdk-item]_svg]:h-5 [&_[cmdk-item]_svg]:w-5",children:r})})]})}function ne({className:t,...a}){return e.jsxs("div",{"data-slot":"command-input-wrapper",className:"flex h-9 items-center gap-2 border-b px-3",children:[e.jsx(g.SearchIcon,{className:"size-4 shrink-0 opacity-50"}),e.jsx(Fe.Command.Input,{"data-slot":"command-input",className:i("placeholder:text-muted-foreground flex h-10 w-full rounded-md bg-transparent py-3 text-sm outline-hidden disabled:cursor-not-allowed disabled:opacity-50",t),...a})]})}function se({className:t,...a}){return e.jsx(Fe.Command.List,{"data-slot":"command-list",className:i("max-h-[300px] scroll-py-1 overflow-x-hidden overflow-y-auto",t),...a})}function oe({...t}){return e.jsx(Fe.Command.Empty,{"data-slot":"command-empty",className:"py-6 text-center text-sm",...t})}function ee({className:t,...a}){return e.jsx(Fe.Command.Group,{"data-slot":"command-group",className:i("text-foreground [&_[cmdk-group-heading]]:text-muted-foreground overflow-hidden p-1 [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium",t),...a})}function Ha({className:t,...a}){return e.jsx(Fe.Command.Separator,{"data-slot":"command-separator",className:i("bg-border -mx-1 h-px",t),...a})}function K({className:t,...a}){return e.jsx(Fe.Command.Item,{"data-slot":"command-item",className:i("data-[selected=true]:bg-accent data-[selected=true]:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",t),...a})}function jo({className:t,...a}){return e.jsx("span",{"data-slot":"command-shortcut",className:i("text-muted-foreground ml-auto text-xs tracking-widest",t),...a})}function Ae({...t}){return e.jsx(q.Root,{"data-slot":"dropdown-menu",...t})}function Ka({...t}){return e.jsx(q.Portal,{"data-slot":"dropdown-menu-portal",...t})}function Te({...t}){return e.jsx(q.Trigger,{"data-slot":"dropdown-menu-trigger",...t})}function Pe({className:t,sideOffset:a=4,...r}){return e.jsx(q.Portal,{children:e.jsx(q.Content,{"data-slot":"dropdown-menu-content",sideOffset:a,className:i("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 max-h-(--radix-dropdown-menu-content-available-height) min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border p-1 shadow-md",t),...r})})}function Yt({...t}){return e.jsx(q.Group,{"data-slot":"dropdown-menu-group",...t})}function ie({className:t,inset:a,variant:r="default",...n}){return e.jsx(q.Item,{"data-slot":"dropdown-menu-item","data-inset":a,"data-variant":r,className:i("focus:bg-accent focus:text-accent-foreground data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 dark:data-[variant=destructive]:focus:bg-destructive/20 data-[variant=destructive]:focus:text-destructive data-[variant=destructive]:*:[svg]:!text-destructive [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",t),...n})}function wo({className:t,children:a,checked:r,...n}){return e.jsxs(q.CheckboxItem,{"data-slot":"dropdown-menu-checkbox-item",className:i("focus:bg-accent focus:text-accent-foreground relative flex cursor-default items-center gap-2 rounded-sm py-1.5 pr-2 pl-8 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",t),checked:r,...n,children:[e.jsx("span",{className:"pointer-events-none absolute left-2 flex size-3.5 items-center justify-center",children:e.jsx(q.ItemIndicator,{children:e.jsx(g.CheckIcon,{className:"size-4"})})}),a]})}function No({...t}){return e.jsx(q.RadioGroup,{"data-slot":"dropdown-menu-radio-group",...t})}function yo({className:t,children:a,...r}){return e.jsxs(q.RadioItem,{"data-slot":"dropdown-menu-radio-item",className:i("focus:bg-accent focus:text-accent-foreground relative flex cursor-default items-center gap-2 rounded-sm py-1.5 pr-2 pl-8 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",t),...r,children:[e.jsx("span",{className:"pointer-events-none absolute left-2 flex size-3.5 items-center justify-center",children:e.jsx(q.ItemIndicator,{children:e.jsx(g.CircleIcon,{className:"size-2 fill-current"})})}),a]})}function Jt({className:t,inset:a,...r}){return e.jsx(q.Label,{"data-slot":"dropdown-menu-label","data-inset":a,className:i("px-2 py-1.5 text-sm font-medium data-[inset]:pl-8",t),...r})}function jt({className:t,...a}){return e.jsx(q.Separator,{"data-slot":"dropdown-menu-separator",className:i("bg-border -mx-1 my-1 h-px",t),...a})}function Co({className:t,...a}){return e.jsx("span",{"data-slot":"dropdown-menu-shortcut",className:i("text-muted-foreground ml-auto text-xs tracking-widest",t),...a})}function Ya({...t}){return e.jsx(q.Sub,{"data-slot":"dropdown-menu-sub",...t})}function Ja({className:t,inset:a,children:r,...n}){return e.jsxs(q.SubTrigger,{"data-slot":"dropdown-menu-sub-trigger","data-inset":a,className:i("focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",t),...n,children:[r,e.jsx(g.ChevronRightIcon,{className:"ml-auto size-4"})]})}function Xa({className:t,...a}){return e.jsx(q.SubContent,{"data-slot":"dropdown-menu-sub-content",className:i("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-hidden rounded-md border p-1 shadow-lg",t),...a})}function Io({...t}){return e.jsx(dt.Root,{"data-slot":"hover-card",...t})}function ko({...t}){return e.jsx(dt.Trigger,{"data-slot":"hover-card-trigger",...t})}function So({className:t,align:a="center",sideOffset:r=4,...n}){return e.jsx(dt.Portal,{"data-slot":"hover-card-portal",children:e.jsx(dt.Content,{"data-slot":"hover-card-content",align:a,sideOffset:r,className:i("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-64 origin-(--radix-hover-card-content-transform-origin) rounded-md border p-4 shadow-md outline-hidden",t),...n})})}function $({className:t,type:a,...r}){return e.jsx("input",{type:a,"data-slot":"input",className:i("file:text-foreground placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground dark:bg-input/30 border-input h-9 w-full min-w-0 rounded-md border bg-transparent px-3 py-1 text-base shadow-xs transition-[color,box-shadow] outline-none file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm","focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]","aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",t),...r})}function be({className:t,...a}){return e.jsx(Ps.Root,{"data-slot":"label",className:i("flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50",t),...a})}function Ao({className:t,children:a,viewport:r=!0,...n}){return e.jsxs(Se.Root,{"data-slot":"navigation-menu","data-viewport":r,className:i("group/navigation-menu relative flex max-w-max flex-1 items-center justify-center",t),...n,children:[a,r&&e.jsx(Za,{})]})}function To({className:t,...a}){return e.jsx(Se.List,{"data-slot":"navigation-menu-list",className:i("group flex flex-1 list-none items-center justify-center gap-1",t),...a})}function Po({className:t,...a}){return e.jsx(Se.Item,{"data-slot":"navigation-menu-item",className:i("relative",t),...a})}const Qa=G.cva("group inline-flex h-9 w-max items-center justify-center rounded-md bg-background px-4 py-2 text-sm font-medium hover:bg-accent hover:text-accent-foreground focus:bg-accent focus:text-accent-foreground disabled:pointer-events-none disabled:opacity-50 data-[state=open]:hover:bg-accent data-[state=open]:text-accent-foreground data-[state=open]:focus:bg-accent data-[state=open]:bg-accent/50 focus-visible:ring-ring/50 outline-none transition-[color,box-shadow] focus-visible:ring-[3px] focus-visible:outline-1");function Do({className:t,children:a,...r}){return e.jsxs(Se.Trigger,{"data-slot":"navigation-menu-trigger",className:i(Qa(),"group",t),...r,children:[a," ",e.jsx(g.ChevronDownIcon,{className:"relative top-[1px] ml-1 size-3 transition duration-300 group-data-[state=open]:rotate-180","aria-hidden":"true"})]})}function Ro({className:t,...a}){return e.jsx(Se.Content,{"data-slot":"navigation-menu-content",className:i("data-[motion^=from-]:animate-in data-[motion^=to-]:animate-out data-[motion^=from-]:fade-in data-[motion^=to-]:fade-out data-[motion=from-end]:slide-in-from-right-52 data-[motion=from-start]:slide-in-from-left-52 data-[motion=to-end]:slide-out-to-right-52 data-[motion=to-start]:slide-out-to-left-52 top-0 left-0 w-full p-2 pr-2.5 md:absolute md:w-auto","group-data-[viewport=false]/navigation-menu:bg-popover group-data-[viewport=false]/navigation-menu:text-popover-foreground group-data-[viewport=false]/navigation-menu:data-[state=open]:animate-in group-data-[viewport=false]/navigation-menu:data-[state=closed]:animate-out group-data-[viewport=false]/navigation-menu:data-[state=closed]:zoom-out-95 group-data-[viewport=false]/navigation-menu:data-[state=open]:zoom-in-95 group-data-[viewport=false]/navigation-menu:data-[state=open]:fade-in-0 group-data-[viewport=false]/navigation-menu:data-[state=closed]:fade-out-0 group-data-[viewport=false]/navigation-menu:top-full group-data-[viewport=false]/navigation-menu:mt-1.5 group-data-[viewport=false]/navigation-menu:overflow-hidden group-data-[viewport=false]/navigation-menu:rounded-md group-data-[viewport=false]/navigation-menu:border group-data-[viewport=false]/navigation-menu:shadow group-data-[viewport=false]/navigation-menu:duration-200 **:data-[slot=navigation-menu-link]:focus:ring-0 **:data-[slot=navigation-menu-link]:focus:outline-none",t),...a})}function Za({className:t,...a}){return e.jsx("div",{className:i("absolute top-full left-0 isolate z-50 flex justify-center"),children:e.jsx(Se.Viewport,{"data-slot":"navigation-menu-viewport",className:i("origin-top-center bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-90 relative mt-1.5 h-[var(--radix-navigation-menu-viewport-height)] w-full overflow-hidden rounded-md border shadow md:w-[var(--radix-navigation-menu-viewport-width)]",t),...a})})}function _o({className:t,...a}){return e.jsx(Se.Link,{"data-slot":"navigation-menu-link",className:i("data-[active=true]:focus:bg-accent data-[active=true]:hover:bg-accent data-[active=true]:bg-accent/50 data-[active=true]:text-accent-foreground hover:bg-accent hover:text-accent-foreground focus:bg-accent focus:text-accent-foreground focus-visible:ring-ring/50 [&_svg:not([class*='text-'])]:text-muted-foreground flex flex-col gap-1 rounded-sm p-2 text-sm transition-all outline-none focus-visible:ring-[3px] focus-visible:outline-1 [&_svg:not([class*='size-'])]:size-4",t),...a})}function zo({className:t,...a}){return e.jsx(Se.Indicator,{"data-slot":"navigation-menu-indicator",className:i("data-[state=visible]:animate-in data-[state=hidden]:animate-out data-[state=hidden]:fade-out data-[state=visible]:fade-in top-full z-[1] flex h-1.5 items-end justify-center overflow-hidden",t),...a,children:e.jsx("div",{className:"bg-border relative top-[60%] h-2 w-2 rotate-45 rounded-tl-sm shadow-md"})})}function J({...t}){return e.jsx(Ye.Root,{"data-slot":"popover",...t})}function X({...t}){return e.jsx(Ye.Trigger,{"data-slot":"popover-trigger",...t})}function Q({className:t,align:a="center",sideOffset:r=4,...n}){return e.jsx(Ye.Portal,{children:e.jsx(Ye.Content,{"data-slot":"popover-content",align:a,sideOffset:r,className:i("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-72 origin-(--radix-popover-content-transform-origin) rounded-md border p-4 shadow-md outline-hidden",t),...n})})}function Mo({...t}){return e.jsx(Ye.Anchor,{"data-slot":"popover-anchor",...t})}function Fo({className:t,...a}){return e.jsx("div",{"data-slot":"popover-header",className:i("flex flex-col gap-1 text-sm",t),...a})}function Eo({className:t,...a}){return e.jsx("div",{"data-slot":"popover-title",className:i("font-medium",t),...a})}function Oo({className:t,...a}){return e.jsx("p",{"data-slot":"popover-description",className:i("text-muted-foreground",t),...a})}function wt({className:t,value:a,...r}){return e.jsx(ia.Root,{"data-slot":"progress",className:i("bg-primary/20 relative h-2 w-full overflow-hidden rounded-full",t),...r,children:e.jsx(ia.Indicator,{"data-slot":"progress-indicator",className:"bg-primary h-full w-full flex-1 transition-all",style:{transform:`translateX(-${100-(a||0)}%)`}})})}function Lo({className:t,...a}){return e.jsx(St.Root,{"data-slot":"radio-group",className:i("grid gap-3",t),...a})}function Bo({className:t,...a}){return e.jsx(St.Item,{"data-slot":"radio-group-item",className:i("border-input text-primary focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 aspect-square size-4 shrink-0 rounded-full border shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50",t),...a,children:e.jsx(St.Indicator,{"data-slot":"radio-group-indicator",className:"relative flex items-center justify-center",children:e.jsx(g.CircleIcon,{className:"fill-primary absolute top-1/2 left-1/2 size-2 -translate-x-1/2 -translate-y-1/2"})})})}function Uo({className:t,children:a,...r}){return e.jsxs(He.Root,{"data-slot":"scroll-area",className:i("relative",t),...r,children:[e.jsx(He.Viewport,{"data-slot":"scroll-area-viewport",className:"focus-visible:ring-ring/50 size-full rounded-[inherit] transition-[color,box-shadow] outline-none focus-visible:ring-[3px] focus-visible:outline-1",children:a}),e.jsx(er,{}),e.jsx(He.Corner,{})]})}function er({className:t,orientation:a="vertical",...r}){return e.jsx(He.ScrollAreaScrollbar,{"data-slot":"scroll-area-scrollbar",orientation:a,className:i("flex touch-none p-px transition-colors select-none",a==="vertical"&&"h-full w-2.5 border-l border-l-transparent",a==="horizontal"&&"h-2.5 flex-col border-t border-t-transparent",t),...r,children:e.jsx(He.ScrollAreaThumb,{"data-slot":"scroll-area-thumb",className:"bg-border relative flex-1 rounded-full"})})}function tr({...t}){return e.jsx(H.Root,{"data-slot":"select",...t})}function Vo({...t}){return e.jsx(H.Group,{"data-slot":"select-group",...t})}function ar({...t}){return e.jsx(H.Value,{"data-slot":"select-value",...t})}function rr({className:t,size:a="default",children:r,...n}){return e.jsxs(H.Trigger,{"data-slot":"select-trigger","data-size":a,className:i("border-input data-[placeholder]:text-muted-foreground [&_svg:not([class*='text-'])]:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 dark:hover:bg-input/50 flex w-fit items-center justify-between gap-2 rounded-md border bg-transparent px-3 py-2 text-sm whitespace-nowrap shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 data-[size=default]:h-9 data-[size=sm]:h-8 *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-2 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",t),...n,children:[r,e.jsx(H.Icon,{asChild:!0,children:e.jsx(g.ChevronDownIcon,{className:"size-4 opacity-50"})})]})}function nr({className:t,children:a,position:r="item-aligned",align:n="center",...s}){return e.jsx(H.Portal,{children:e.jsxs(H.Content,{"data-slot":"select-content",className:i("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 relative z-50 max-h-(--radix-select-content-available-height) min-w-[8rem] origin-(--radix-select-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border shadow-md",r==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",t),position:r,align:n,...s,children:[e.jsx(or,{}),e.jsx(H.Viewport,{className:i("p-1",r==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)] scroll-my-1"),children:a}),e.jsx(ir,{})]})})}function qo({className:t,...a}){return e.jsx(H.Label,{"data-slot":"select-label",className:i("text-muted-foreground px-2 py-1.5 text-xs",t),...a})}function sr({className:t,children:a,...r}){return e.jsxs(H.Item,{"data-slot":"select-item",className:i("focus:bg-accent focus:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground relative flex w-full cursor-default items-center gap-2 rounded-sm py-1.5 pr-8 pl-2 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2",t),...r,children:[e.jsx("span",{"data-slot":"select-item-indicator",className:"absolute right-2 flex size-3.5 items-center justify-center",children:e.jsx(H.ItemIndicator,{children:e.jsx(g.CheckIcon,{className:"size-4"})})}),e.jsx(H.ItemText,{children:a})]})}function Wo({className:t,...a}){return e.jsx(H.Separator,{"data-slot":"select-separator",className:i("bg-border pointer-events-none -mx-1 my-1 h-px",t),...a})}function or({className:t,...a}){return e.jsx(H.ScrollUpButton,{"data-slot":"select-scroll-up-button",className:i("flex cursor-default items-center justify-center py-1",t),...a,children:e.jsx(g.ChevronUpIcon,{className:"size-4"})})}function ir({className:t,...a}){return e.jsx(H.ScrollDownButton,{"data-slot":"select-scroll-down-button",className:i("flex cursor-default items-center justify-center py-1",t),...a,children:e.jsx(g.ChevronDownIcon,{className:"size-4"})})}function Nt({className:t,orientation:a="horizontal",decorative:r=!0,...n}){return e.jsx(Ds.Root,{"data-slot":"separator",decorative:r,orientation:a,className:i("bg-border shrink-0 data-[orientation=horizontal]:h-px data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-px",t),...n})}function Xt({...t}){return e.jsx(L.Root,{"data-slot":"sheet",...t})}function lr({...t}){return e.jsx(L.Trigger,{"data-slot":"sheet-trigger",...t})}function Go({...t}){return e.jsx(L.Close,{"data-slot":"sheet-close",...t})}function $o({...t}){return e.jsx(L.Portal,{"data-slot":"sheet-portal",...t})}function Ho({className:t,...a}){return e.jsx(L.Overlay,{"data-slot":"sheet-overlay",className:i("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50",t),...a})}function Qt({className:t,children:a,side:r="right",showCloseButton:n=!0,...s}){return e.jsxs($o,{children:[e.jsx(Ho,{}),e.jsxs(L.Content,{"data-slot":"sheet-content",className:i("bg-background data-[state=open]:animate-in data-[state=closed]:animate-out fixed z-50 flex flex-col gap-4 shadow-lg transition ease-in-out data-[state=closed]:duration-300 data-[state=open]:duration-500",r==="right"&&"data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right inset-y-0 right-0 h-full w-3/4 border-l sm:max-w-sm",r==="left"&&"data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left inset-y-0 left-0 h-full w-3/4 border-r sm:max-w-sm",r==="top"&&"data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top inset-x-0 top-0 h-auto border-b",r==="bottom"&&"data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom inset-x-0 bottom-0 h-auto border-t",t),...s,children:[a,n&&e.jsxs(L.Close,{className:"ring-offset-background focus:ring-ring data-[state=open]:bg-secondary absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none",children:[e.jsx(g.XIcon,{className:"size-4"}),e.jsx("span",{className:"sr-only",children:"Close"})]})]})]})}function cr({className:t,...a}){return e.jsx("div",{"data-slot":"sheet-header",className:i("flex flex-col gap-1.5 p-4",t),...a})}function Ko({className:t,...a}){return e.jsx("div",{"data-slot":"sheet-footer",className:i("mt-auto flex flex-col gap-2 p-4",t),...a})}function Zt({className:t,...a}){return e.jsx(L.Title,{"data-slot":"sheet-title",className:i("text-foreground font-semibold",t),...a})}function dr({className:t,...a}){return e.jsx(L.Description,{"data-slot":"sheet-description",className:i("text-muted-foreground text-sm",t),...a})}const Ct=768;function yt(){const[t,a]=I.useState(void 0);return I.useEffect(()=>{const r=window.matchMedia(`(max-width: ${Ct-1}px)`),n=()=>{a(window.innerWidth<Ct)};return r.addEventListener("change",n),a(window.innerWidth<Ct),()=>r.removeEventListener("change",n)},[]),!!t}function ze({className:t,...a}){return e.jsx("div",{"data-slot":"skeleton",className:i("bg-accent animate-pulse rounded-md",t),...a})}function ye({delayDuration:t=0,...a}){return e.jsx(Be.Provider,{"data-slot":"tooltip-provider",delayDuration:t,...a})}function te({...t}){return e.jsx(Be.Root,{"data-slot":"tooltip",...t})}function ae({...t}){return e.jsx(Be.Trigger,{"data-slot":"tooltip-trigger",...t})}function re({className:t,sideOffset:a=0,children:r,...n}){return e.jsx(Be.Portal,{children:e.jsxs(Be.Content,{"data-slot":"tooltip-content",sideOffset:a,className:i("bg-foreground text-background animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-fit origin-(--radix-tooltip-content-transform-origin) rounded-md px-3 py-1.5 text-xs text-balance",t),...n,children:[r,e.jsx(Be.Arrow,{className:"bg-foreground fill-foreground z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px]"})]})})}const Yo="sidebar_state",Jo=3600*24*7,Xo="16rem",Qo="18rem",Zo="3rem",ei="b",ur=I.createContext(null);function Qe(){const t=I.useContext(ur);if(!t)throw new Error("useSidebar must be used within a SidebarProvider.");return t}function mr({defaultOpen:t=!0,open:a,onOpenChange:r,className:n,style:s,children:o,...l}){const c=yt(),[d,u]=I.useState(!1),[f,h]=I.useState(t),w=a??f,C=I.useCallback(y=>{const x=typeof y=="function"?y(w):y;r?r(x):h(x),document.cookie=`${Yo}=${x}; path=/; max-age=${Jo}`},[r,w]),v=I.useCallback(()=>c?u(y=>!y):C(y=>!y),[c,C,u]);I.useEffect(()=>{const y=x=>{x.key===ei&&(x.metaKey||x.ctrlKey)&&(x.preventDefault(),v())};return window.addEventListener("keydown",y),()=>window.removeEventListener("keydown",y)},[v]);const N=w?"expanded":"collapsed",b=I.useMemo(()=>({state:N,open:w,setOpen:C,isMobile:c,openMobile:d,setOpenMobile:u,toggleSidebar:v}),[N,w,C,c,d,u,v]);return e.jsx(ur.Provider,{value:b,children:e.jsx(ye,{delayDuration:0,children:e.jsx("div",{"data-slot":"sidebar-wrapper",style:{"--sidebar-width":Xo,"--sidebar-width-icon":Zo,...s},className:i("group/sidebar-wrapper has-data-[variant=inset]:bg-sidebar flex min-h-svh w-full",n),...l,children:o})})})}function fr({side:t="left",variant:a="sidebar",collapsible:r="offcanvas",className:n,children:s,...o}){const{isMobile:l,state:c,openMobile:d,setOpenMobile:u}=Qe();return r==="none"?e.jsx("div",{"data-slot":"sidebar",className:i("bg-sidebar text-sidebar-foreground flex h-full w-(--sidebar-width) flex-col",n),...o,children:s}):l?e.jsx(Xt,{open:d,onOpenChange:u,...o,children:e.jsxs(Qt,{"data-sidebar":"sidebar","data-slot":"sidebar","data-mobile":"true",className:"bg-sidebar text-sidebar-foreground w-(--sidebar-width) p-0 [&>button]:hidden",style:{"--sidebar-width":Qo},side:t,children:[e.jsxs(cr,{className:"sr-only",children:[e.jsx(Zt,{children:"Sidebar"}),e.jsx(dr,{children:"Displays the mobile sidebar."})]}),e.jsx("div",{className:"flex h-full w-full flex-col",children:s})]})}):e.jsxs("div",{className:"group peer text-sidebar-foreground hidden md:block","data-state":c,"data-collapsible":c==="collapsed"?r:"","data-variant":a,"data-side":t,"data-slot":"sidebar",children:[e.jsx("div",{"data-slot":"sidebar-gap",className:i("relative w-(--sidebar-width) bg-transparent transition-[width] duration-200 ease-linear","group-data-[collapsible=offcanvas]:w-0","group-data-[side=right]:rotate-180",a==="floating"||a==="inset"?"group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4)))]":"group-data-[collapsible=icon]:w-(--sidebar-width-icon)")}),e.jsx("div",{"data-slot":"sidebar-container",className:i("fixed inset-y-0 z-10 hidden h-svh w-(--sidebar-width) transition-[left,right,width] duration-200 ease-linear md:flex",t==="left"?"left-0 group-data-[collapsible=offcanvas]:left-[calc(var(--sidebar-width)*-1)]":"right-0 group-data-[collapsible=offcanvas]:right-[calc(var(--sidebar-width)*-1)]",a==="floating"||a==="inset"?"p-2 group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4))+2px)]":"group-data-[collapsible=icon]:w-(--sidebar-width-icon) group-data-[side=left]:border-r group-data-[side=right]:border-l",n),...o,children:e.jsx("div",{"data-sidebar":"sidebar","data-slot":"sidebar-inner",className:"bg-sidebar group-data-[variant=floating]:border-sidebar-border flex h-full w-full flex-col group-data-[variant=floating]:rounded-lg group-data-[variant=floating]:border group-data-[variant=floating]:shadow-sm",children:s})})]})}function xr({className:t,onClick:a,...r}){const{toggleSidebar:n}=Qe();return e.jsxs(R,{"data-sidebar":"trigger","data-slot":"sidebar-trigger",variant:"ghost",size:"icon",className:i("size-7",t),onClick:s=>{a?.(s),n()},...r,children:[e.jsx(g.PanelLeftIcon,{}),e.jsx("span",{className:"sr-only",children:"Toggle Sidebar"})]})}function pr({className:t,...a}){const{toggleSidebar:r}=Qe();return e.jsx("button",{"data-sidebar":"rail","data-slot":"sidebar-rail","aria-label":"Toggle Sidebar",tabIndex:-1,onClick:r,title:"Toggle Sidebar",className:i("hover:after:bg-sidebar-border absolute inset-y-0 z-20 hidden w-4 -translate-x-1/2 transition-all ease-linear group-data-[side=left]:-right-4 group-data-[side=right]:left-0 after:absolute after:inset-y-0 after:left-1/2 after:w-[2px] sm:flex","in-data-[side=left]:cursor-w-resize in-data-[side=right]:cursor-e-resize","[[data-side=left][data-state=collapsed]_&]:cursor-e-resize [[data-side=right][data-state=collapsed]_&]:cursor-w-resize","hover:group-data-[collapsible=offcanvas]:bg-sidebar group-data-[collapsible=offcanvas]:translate-x-0 group-data-[collapsible=offcanvas]:after:left-full","[[data-side=left][data-collapsible=offcanvas]_&]:-right-2","[[data-side=right][data-collapsible=offcanvas]_&]:-left-2",t),...a})}function gr({className:t,...a}){return e.jsx("main",{"data-slot":"sidebar-inset",className:i("bg-background relative flex w-full flex-1 flex-col","md:peer-data-[variant=inset]:m-2 md:peer-data-[variant=inset]:ml-0 md:peer-data-[variant=inset]:rounded-xl md:peer-data-[variant=inset]:shadow-sm md:peer-data-[variant=inset]:peer-data-[state=collapsed]:ml-2",t),...a})}function ti({className:t,...a}){return e.jsx($,{"data-slot":"sidebar-input","data-sidebar":"input",className:i("bg-background h-8 w-full shadow-none",t),...a})}function hr({className:t,...a}){return e.jsx("div",{"data-slot":"sidebar-header","data-sidebar":"header",className:i("flex flex-col gap-2 p-2",t),...a})}function br({className:t,...a}){return e.jsx("div",{"data-slot":"sidebar-footer","data-sidebar":"footer",className:i("flex flex-col gap-2 p-2",t),...a})}function ai({className:t,...a}){return e.jsx(Nt,{"data-slot":"sidebar-separator","data-sidebar":"separator",className:i("bg-sidebar-border mx-2 w-auto",t),...a})}function vr({className:t,...a}){return e.jsx("div",{"data-slot":"sidebar-content","data-sidebar":"content",className:i("flex min-h-0 flex-1 flex-col gap-2 overflow-auto group-data-[collapsible=icon]:overflow-hidden",t),...a})}function jr({className:t,...a}){return e.jsx("div",{"data-slot":"sidebar-group","data-sidebar":"group",className:i("relative flex w-full min-w-0 flex-col p-2",t),...a})}function ri({className:t,asChild:a=!1,...r}){const n=a?we.Root:"div";return e.jsx(n,{"data-slot":"sidebar-group-label","data-sidebar":"group-label",className:i("text-sidebar-foreground/70 ring-sidebar-ring flex h-8 shrink-0 items-center rounded-md px-2 text-xs font-medium outline-hidden transition-[margin,opacity] duration-200 ease-linear focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0","group-data-[collapsible=icon]:-mt-8 group-data-[collapsible=icon]:opacity-0",t),...r})}function ni({className:t,asChild:a=!1,...r}){const n=a?we.Root:"button";return e.jsx(n,{"data-slot":"sidebar-group-action","data-sidebar":"group-action",className:i("text-sidebar-foreground ring-sidebar-ring hover:bg-sidebar-accent hover:text-sidebar-accent-foreground absolute top-3.5 right-3 flex aspect-square w-5 items-center justify-center rounded-md p-0 outline-hidden transition-transform focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0","after:absolute after:-inset-2 md:after:hidden","group-data-[collapsible=icon]:hidden",t),...r})}function si({className:t,...a}){return e.jsx("div",{"data-slot":"sidebar-group-content","data-sidebar":"group-content",className:i("w-full text-sm",t),...a})}function wr({className:t,...a}){return e.jsx("ul",{"data-slot":"sidebar-menu","data-sidebar":"menu",className:i("flex w-full min-w-0 flex-col gap-1",t),...a})}function Pt({className:t,...a}){return e.jsx("li",{"data-slot":"sidebar-menu-item","data-sidebar":"menu-item",className:i("group/menu-item relative",t),...a})}const oi=G.cva("peer/menu-button flex w-full items-center gap-2 overflow-hidden rounded-md p-2 text-left text-sm outline-hidden ring-sidebar-ring transition-[width,height,padding] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 active:bg-sidebar-accent active:text-sidebar-accent-foreground disabled:pointer-events-none disabled:opacity-50 group-has-data-[sidebar=menu-action]/menu-item:pr-8 aria-disabled:pointer-events-none aria-disabled:opacity-50 data-[active=true]:bg-sidebar-accent data-[active=true]:font-medium data-[active=true]:text-sidebar-accent-foreground data-[state=open]:hover:bg-sidebar-accent data-[state=open]:hover:text-sidebar-accent-foreground group-data-[collapsible=icon]:size-8! group-data-[collapsible=icon]:p-2! [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0",{variants:{variant:{default:"hover:bg-sidebar-accent hover:text-sidebar-accent-foreground",outline:"bg-background shadow-[0_0_0_1px_hsl(var(--sidebar-border))] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground hover:shadow-[0_0_0_1px_hsl(var(--sidebar-accent))]"},size:{default:"h-8 text-sm",sm:"h-7 text-xs",lg:"h-12 text-sm group-data-[collapsible=icon]:p-0!"}},defaultVariants:{variant:"default",size:"default"}});function Dt({asChild:t=!1,isActive:a=!1,variant:r="default",size:n="default",tooltip:s,className:o,...l}){const c=t?we.Root:"button",{isMobile:d,state:u}=Qe(),f=e.jsx(c,{"data-slot":"sidebar-menu-button","data-sidebar":"menu-button","data-size":n,"data-active":a,className:i(oi({variant:r,size:n}),o),...l});return s?(typeof s=="string"&&(s={children:s}),e.jsxs(te,{children:[e.jsx(ae,{asChild:!0,children:f}),e.jsx(re,{side:"right",align:"center",hidden:u!=="collapsed"||d,...s})]})):f}function ii({className:t,asChild:a=!1,showOnHover:r=!1,...n}){const s=a?we.Root:"button";return e.jsx(s,{"data-slot":"sidebar-menu-action","data-sidebar":"menu-action",className:i("text-sidebar-foreground ring-sidebar-ring hover:bg-sidebar-accent hover:text-sidebar-accent-foreground peer-hover/menu-button:text-sidebar-accent-foreground absolute top-1.5 right-1 flex aspect-square w-5 items-center justify-center rounded-md p-0 outline-hidden transition-transform focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0","after:absolute after:-inset-2 md:after:hidden","peer-data-[size=sm]/menu-button:top-1","peer-data-[size=default]/menu-button:top-1.5","peer-data-[size=lg]/menu-button:top-2.5","group-data-[collapsible=icon]:hidden",r&&"peer-data-[active=true]/menu-button:text-sidebar-accent-foreground group-focus-within/menu-item:opacity-100 group-hover/menu-item:opacity-100 data-[state=open]:opacity-100 md:opacity-0",t),...n})}function li({className:t,...a}){return e.jsx("div",{"data-slot":"sidebar-menu-badge","data-sidebar":"menu-badge",className:i("text-sidebar-foreground pointer-events-none absolute right-1 flex h-5 min-w-5 items-center justify-center rounded-md px-1 text-xs font-medium tabular-nums select-none","peer-hover/menu-button:text-sidebar-accent-foreground peer-data-[active=true]/menu-button:text-sidebar-accent-foreground","peer-data-[size=sm]/menu-button:top-1","peer-data-[size=default]/menu-button:top-1.5","peer-data-[size=lg]/menu-button:top-2.5","group-data-[collapsible=icon]:hidden",t),...a})}function ci({className:t,showIcon:a=!1,...r}){const n=I.useMemo(()=>`${Math.floor(Math.random()*40)+50}%`,[]);return e.jsxs("div",{"data-slot":"sidebar-menu-skeleton","data-sidebar":"menu-skeleton",className:i("flex h-8 items-center gap-2 rounded-md px-2",t),...r,children:[a&&e.jsx(ze,{className:"size-4 rounded-md","data-sidebar":"menu-skeleton-icon"}),e.jsx(ze,{className:"h-4 max-w-(--skeleton-width) flex-1","data-sidebar":"menu-skeleton-text",style:{"--skeleton-width":n}})]})}function Nr({className:t,...a}){return e.jsx("ul",{"data-slot":"sidebar-menu-sub","data-sidebar":"menu-sub",className:i("border-sidebar-border mx-3.5 flex min-w-0 translate-x-px flex-col gap-1 border-l px-2.5 py-0.5","group-data-[collapsible=icon]:hidden",t),...a})}function yr({className:t,...a}){return e.jsx("li",{"data-slot":"sidebar-menu-sub-item","data-sidebar":"menu-sub-item",className:i("group/menu-sub-item relative",t),...a})}function Cr({asChild:t=!1,size:a="md",isActive:r=!1,className:n,...s}){const o=t?we.Root:"a";return e.jsx(o,{"data-slot":"sidebar-menu-sub-button","data-sidebar":"menu-sub-button","data-size":a,"data-active":r,className:i("text-sidebar-foreground ring-sidebar-ring hover:bg-sidebar-accent hover:text-sidebar-accent-foreground active:bg-sidebar-accent active:text-sidebar-accent-foreground [&>svg]:text-sidebar-accent-foreground flex h-7 min-w-0 -translate-x-px items-center gap-2 overflow-hidden rounded-md px-2 outline-hidden focus-visible:ring-2 disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0","data-[active=true]:bg-sidebar-accent data-[active=true]:text-sidebar-accent-foreground",a==="sm"&&"text-xs",a==="md"&&"text-sm","group-data-[collapsible=icon]:hidden",n),...s})}function di({className:t,defaultValue:a,value:r,min:n=0,max:s=100,...o}){const l=I.useMemo(()=>Array.isArray(r)?r:Array.isArray(a)?a:[n,s],[r,a,n,s]);return e.jsxs(nt.Root,{"data-slot":"slider",defaultValue:a,value:r,min:n,max:s,className:i("relative flex w-full touch-none items-center select-none data-[disabled]:opacity-50 data-[orientation=vertical]:h-full data-[orientation=vertical]:min-h-44 data-[orientation=vertical]:w-auto data-[orientation=vertical]:flex-col",t),...o,children:[e.jsx(nt.Track,{"data-slot":"slider-track",className:i("bg-muted relative grow overflow-hidden rounded-full data-[orientation=horizontal]:h-1.5 data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-1.5"),children:e.jsx(nt.Range,{"data-slot":"slider-range",className:i("bg-primary absolute data-[orientation=horizontal]:h-full data-[orientation=vertical]:w-full")})}),Array.from({length:l.length},(c,d)=>e.jsx(nt.Thumb,{"data-slot":"slider-thumb",className:"border-primary ring-ring/50 block size-4 shrink-0 rounded-full border bg-white shadow-sm transition-[color,box-shadow] hover:ring-4 focus-visible:ring-4 focus-visible:outline-hidden disabled:pointer-events-none disabled:opacity-50"},d))]})}const Ir=I.createContext(void 0),kr=({children:t})=>{const a=()=>typeof window>"u"?"light":window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light",[r,n]=I.useState(()=>typeof window>"u"?"system":localStorage.getItem("theme")||"system"),[s,o]=I.useState(()=>r==="system"?a():r),l=I.useCallback(d=>{const u=document.documentElement;u.classList.remove("dark","blue-dark");let f;d==="system"?f=a():f=d,f==="dark"&&u.classList.add("dark"),f==="blue-dark"&&u.classList.add("blue-dark"),o(f)},[]);I.useEffect(()=>{l(r),localStorage.setItem("theme",r)},[r,l]),I.useEffect(()=>{if(r!=="system")return;const d=window.matchMedia("(prefers-color-scheme: dark)"),u=()=>{l("system")};return d.addEventListener("change",u),()=>d.removeEventListener("change",u)},[r,l]);const c=I.useMemo(()=>({theme:r,setTheme:n,resolvedTheme:s}),[r,s]);return e.jsx(Ir.Provider,{value:c,children:t})},Sr=()=>{const t=I.useContext(Ir);if(!t)throw new Error("useTheme must be used within ThemeProvider");return t},ui=({...t})=>{const{theme:a="system"}=Sr();return e.jsx(pa.Toaster,{theme:a,className:"toaster group",icons:{success:e.jsx(g.CircleCheckIcon,{className:"size-4"}),info:e.jsx(g.InfoIcon,{className:"size-4"}),warning:e.jsx(g.TriangleAlertIcon,{className:"size-4"}),error:e.jsx(g.OctagonXIcon,{className:"size-4"}),loading:e.jsx(g.Loader2Icon,{className:"size-4 animate-spin"})},style:{"--normal-bg":"var(--popover)","--normal-text":"var(--popover-foreground)","--normal-border":"var(--border)","--border-radius":"var(--radius)"},...t})};function mi({className:t,size:a="default",...r}){return e.jsx(la.Root,{"data-slot":"switch","data-size":a,className:i("peer data-[state=checked]:bg-primary data-[state=unchecked]:bg-input focus-visible:border-ring focus-visible:ring-ring/50 dark:data-[state=unchecked]:bg-input/80 group/switch inline-flex shrink-0 items-center rounded-full border border-transparent shadow-xs transition-all outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 data-[size=default]:h-[1.15rem] data-[size=default]:w-8 data-[size=sm]:h-3.5 data-[size=sm]:w-6",t),...r,children:e.jsx(la.Thumb,{"data-slot":"switch-thumb",className:i("bg-background dark:data-[state=unchecked]:bg-foreground dark:data-[state=checked]:bg-primary-foreground pointer-events-none block rounded-full ring-0 transition-transform group-data-[size=default]/switch:size-4 group-data-[size=sm]/switch:size-3 data-[state=checked]:translate-x-[calc(100%-2px)] data-[state=unchecked]:translate-x-0")})})}function Ar({className:t,...a}){return e.jsx("div",{"data-slot":"table-container",className:"relative w-full overflow-x-auto",children:e.jsx("table",{"data-slot":"table",className:i("w-full caption-bottom text-sm",t),...a})})}function Tr({className:t,...a}){return e.jsx("thead",{"data-slot":"table-header",className:i("[&_tr]:border-b",t),...a})}function Pr({className:t,...a}){return e.jsx("tbody",{"data-slot":"table-body",className:i("[&_tr:last-child]:border-0",t),...a})}function Dr({className:t,...a}){return e.jsx("tfoot",{"data-slot":"table-footer",className:i("bg-muted/50 border-t font-medium [&>tr]:last:border-b-0",t),...a})}function Oe({className:t,...a}){return e.jsx("tr",{"data-slot":"table-row",className:i("hover:bg-muted/50 data-[state=selected]:bg-muted border-b transition-colors",t),...a})}function Rt({className:t,...a}){return e.jsx("th",{"data-slot":"table-head",className:i("text-foreground h-10 px-2 text-left align-middle font-medium whitespace-nowrap [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",t),...a})}function We({className:t,...a}){return e.jsx("td",{"data-slot":"table-cell",className:i("p-2 align-middle whitespace-nowrap [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",t),...a})}function fi({className:t,...a}){return e.jsx("caption",{"data-slot":"table-caption",className:i("text-muted-foreground mt-4 text-sm",t),...a})}function Rr({className:t,orientation:a="horizontal",...r}){return e.jsx(pt.Root,{"data-slot":"tabs","data-orientation":a,orientation:a,className:i("group/tabs flex gap-2 data-[orientation=horizontal]:flex-col",t),...r})}const _r=G.cva("rounded-lg p-[3px] group-data-[orientation=horizontal]/tabs:h-9 data-[variant=line]:rounded-none group/tabs-list text-muted-foreground inline-flex w-fit items-center justify-center group-data-[orientation=vertical]/tabs:h-fit group-data-[orientation=vertical]/tabs:flex-col",{variants:{variant:{default:"bg-muted",line:"gap-1 bg-transparent"}},defaultVariants:{variant:"default"}});function zr({className:t,variant:a="default",...r}){return e.jsx(pt.List,{"data-slot":"tabs-list","data-variant":a,className:i(_r({variant:a}),t),...r})}function Mr({className:t,...a}){return e.jsx(pt.Trigger,{"data-slot":"tabs-trigger",className:i("focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:outline-ring text-foreground/60 hover:text-foreground dark:text-muted-foreground dark:hover:text-foreground relative inline-flex h-[calc(100%-1px)] flex-1 items-center justify-center gap-1.5 rounded-md border border-transparent px-2 py-1 text-sm font-medium whitespace-nowrap transition-all group-data-[orientation=vertical]/tabs:w-full group-data-[orientation=vertical]/tabs:justify-start focus-visible:ring-[3px] focus-visible:outline-1 disabled:pointer-events-none disabled:opacity-50 group-data-[variant=default]/tabs-list:data-[state=active]:shadow-sm group-data-[variant=line]/tabs-list:data-[state=active]:shadow-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4","group-data-[variant=line]/tabs-list:bg-transparent group-data-[variant=line]/tabs-list:data-[state=active]:bg-transparent dark:group-data-[variant=line]/tabs-list:data-[state=active]:border-transparent dark:group-data-[variant=line]/tabs-list:data-[state=active]:bg-transparent","data-[state=active]:bg-background dark:data-[state=active]:text-foreground dark:data-[state=active]:border-input dark:data-[state=active]:bg-input/30 data-[state=active]:text-foreground","after:bg-foreground after:absolute after:opacity-0 after:transition-opacity group-data-[orientation=horizontal]/tabs:after:inset-x-0 group-data-[orientation=horizontal]/tabs:after:bottom-[-5px] group-data-[orientation=horizontal]/tabs:after:h-0.5 group-data-[orientation=vertical]/tabs:after:inset-y-0 group-data-[orientation=vertical]/tabs:after:-right-1 group-data-[orientation=vertical]/tabs:after:w-0.5 group-data-[variant=line]/tabs-list:data-[state=active]:after:opacity-100",t),...a})}function _t({className:t,...a}){return e.jsx(pt.Content,{"data-slot":"tabs-content",className:i("flex-1 outline-none",t),...a})}function Fr({className:t,...a}){return e.jsx("textarea",{"data-slot":"textarea",className:i("border-input placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 flex field-sizing-content min-h-16 w-full rounded-md border bg-transparent px-3 py-2 text-base shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",t),...a})}function zt({...t}){return e.jsx(Ts.Root,{"data-slot":"aspect-ratio",...t})}function Er({...t}){return e.jsx("nav",{"aria-label":"breadcrumb","data-slot":"breadcrumb",...t})}function Or({className:t,...a}){return e.jsx("ol",{"data-slot":"breadcrumb-list",className:i("text-muted-foreground flex flex-wrap items-center gap-1.5 text-sm break-words sm:gap-2.5",t),...a})}function Le({className:t,...a}){return e.jsx("li",{"data-slot":"breadcrumb-item",className:i("inline-flex items-center gap-1.5",t),...a})}function Mt({asChild:t,className:a,...r}){const n=t?we.Root:"a";return e.jsx(n,{"data-slot":"breadcrumb-link",className:i("hover:text-foreground transition-colors",a),...r})}function Ge({className:t,...a}){return e.jsx("span",{"data-slot":"breadcrumb-page",role:"link","aria-disabled":"true","aria-current":"page",className:i("text-foreground font-normal",t),...a})}function ct({children:t,className:a,...r}){return e.jsx("li",{"data-slot":"breadcrumb-separator",role:"presentation","aria-hidden":"true",className:i("[&>svg]:size-3.5",a),...r,children:t??e.jsx(g.ChevronRight,{})})}function Ft({className:t,...a}){return e.jsxs("span",{"data-slot":"breadcrumb-ellipsis",role:"presentation","aria-hidden":"true",className:i("flex size-9 items-center justify-center",t),...a,children:[e.jsx(g.MoreHorizontal,{className:"size-4"}),e.jsx("span",{className:"sr-only",children:"More"})]})}function Lr({...t}){return e.jsx(ao,{"data-slot":"collapsible",...t})}function Br({...t}){return e.jsx(Ca,{"data-slot":"collapsible-trigger",...t})}function Ur({...t}){return e.jsx(Ia,{"data-slot":"collapsible-content",...t})}function Vr({...t}){return e.jsx(ke.Drawer.Root,{"data-slot":"drawer",...t})}function qr({...t}){return e.jsx(ke.Drawer.Trigger,{"data-slot":"drawer-trigger",...t})}function Wr({...t}){return e.jsx(ke.Drawer.Portal,{"data-slot":"drawer-portal",...t})}function Gr({...t}){return e.jsx(ke.Drawer.Close,{"data-slot":"drawer-close",...t})}function $r({className:t,...a}){return e.jsx(ke.Drawer.Overlay,{"data-slot":"drawer-overlay",className:i("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50",t),...a})}function Hr({className:t,children:a,...r}){return e.jsxs(Wr,{"data-slot":"drawer-portal",children:[e.jsx($r,{}),e.jsxs(ke.Drawer.Content,{"data-slot":"drawer-content",className:i("group/drawer-content bg-background fixed z-50 flex h-auto flex-col","data-[vaul-drawer-direction=top]:inset-x-0 data-[vaul-drawer-direction=top]:top-0 data-[vaul-drawer-direction=top]:mb-24 data-[vaul-drawer-direction=top]:max-h-[80vh] data-[vaul-drawer-direction=top]:rounded-b-lg data-[vaul-drawer-direction=top]:border-b","data-[vaul-drawer-direction=bottom]:inset-x-0 data-[vaul-drawer-direction=bottom]:bottom-0 data-[vaul-drawer-direction=bottom]:mt-24 data-[vaul-drawer-direction=bottom]:max-h-[80vh] data-[vaul-drawer-direction=bottom]:rounded-t-lg data-[vaul-drawer-direction=bottom]:border-t","data-[vaul-drawer-direction=right]:inset-y-0 data-[vaul-drawer-direction=right]:right-0 data-[vaul-drawer-direction=right]:w-3/4 data-[vaul-drawer-direction=right]:border-l data-[vaul-drawer-direction=right]:sm:max-w-sm","data-[vaul-drawer-direction=left]:inset-y-0 data-[vaul-drawer-direction=left]:left-0 data-[vaul-drawer-direction=left]:w-3/4 data-[vaul-drawer-direction=left]:border-r data-[vaul-drawer-direction=left]:sm:max-w-sm",t),...r,children:[e.jsx("div",{className:"bg-muted mx-auto mt-4 hidden h-2 w-[100px] shrink-0 rounded-full group-data-[vaul-drawer-direction=bottom]/drawer-content:block"}),a]})]})}function Kr({className:t,...a}){return e.jsx("div",{"data-slot":"drawer-header",className:i("flex flex-col gap-0.5 p-4 group-data-[vaul-drawer-direction=bottom]/drawer-content:text-center group-data-[vaul-drawer-direction=top]/drawer-content:text-center md:gap-1.5 md:text-left",t),...a})}function Yr({className:t,...a}){return e.jsx("div",{"data-slot":"drawer-footer",className:i("mt-auto flex flex-col gap-2 p-4",t),...a})}function Jr({className:t,...a}){return e.jsx(ke.Drawer.Title,{"data-slot":"drawer-title",className:i("text-foreground font-semibold",t),...a})}function Xr({className:t,...a}){return e.jsx(ke.Drawer.Description,{"data-slot":"drawer-description",className:i("text-muted-foreground text-sm",t),...a})}const Qr=Ue.FormProvider,Zr=I.createContext({}),ce=({...t})=>e.jsx(Zr.Provider,{value:{name:t.name},children:e.jsx(Ue.Controller,{...t})}),Ze=()=>{const t=I.useContext(Zr),a=I.useContext(en),{getFieldState:r}=Ue.useFormContext(),n=Ue.useFormState({name:t.name}),s=r(t.name,n);if(!t)throw new Error("useFormField should be used within <FormField>");const{id:o}=a;return{id:o,name:t.name,formItemId:`${o}-form-item`,formDescriptionId:`${o}-form-item-description`,formMessageId:`${o}-form-item-message`,...s}},en=I.createContext({});function de({className:t,...a}){const r=I.useId();return e.jsx(en.Provider,{value:{id:r},children:e.jsx("div",{"data-slot":"form-item",className:i("grid gap-2",t),...a})})}function pe({className:t,...a}){const{error:r,formItemId:n}=Ze();return e.jsx(be,{"data-slot":"form-label","data-error":!!r,className:i("data-[error=true]:text-destructive",t),htmlFor:n,...a})}function ue({...t}){const{error:a,formItemId:r,formDescriptionId:n,formMessageId:s}=Ze();return e.jsx(we.Root,{"data-slot":"form-control",id:r,"aria-describedby":a?`${n} ${s}`:`${n}`,"aria-invalid":!!a,...t})}function ge({className:t,...a}){const{formDescriptionId:r}=Ze();return e.jsx("p",{"data-slot":"form-description",id:r,className:i("text-muted-foreground text-sm",t),...a})}function me({className:t,...a}){const{error:r,formMessageId:n}=Ze(),s=r?String(r?.message??""):a.children;return s?e.jsx("p",{"data-slot":"form-message",id:n,className:i("text-destructive text-sm",t),...a,children:s}):null}function tn({className:t,containerClassName:a,...r}){return e.jsx(ga.OTPInput,{"data-slot":"input-otp",containerClassName:i("flex items-center gap-2 has-disabled:opacity-50",a),className:i("disabled:cursor-not-allowed",t),...r})}function an({className:t,...a}){return e.jsx("div",{"data-slot":"input-otp-group",className:i("flex items-center",t),...a})}function $e({index:t,className:a,...r}){const n=I.useContext(ga.OTPInputContext),{char:s,hasFakeCaret:o,isActive:l}=n?.slots[t]??{};return e.jsxs("div",{"data-slot":"input-otp-slot","data-active":l,className:i("data-[active=true]:border-ring data-[active=true]:ring-ring/50 data-[active=true]:aria-invalid:ring-destructive/20 dark:data-[active=true]:aria-invalid:ring-destructive/40 aria-invalid:border-destructive data-[active=true]:aria-invalid:border-destructive dark:bg-input/30 border-input relative flex h-9 w-9 items-center justify-center border-y border-r text-sm shadow-xs transition-all outline-none first:rounded-l-md first:border-l last:rounded-r-md data-[active=true]:z-10 data-[active=true]:ring-[3px]",a),...r,children:[s,o&&e.jsx("div",{className:"pointer-events-none absolute inset-0 flex items-center justify-center",children:e.jsx("div",{className:"animate-caret-blink bg-foreground h-4 w-px duration-1000"})})]})}function xi({...t}){return e.jsx("div",{"data-slot":"input-otp-separator",role:"separator",...t,children:e.jsx(g.MinusIcon,{})})}const ea=G.cva("inline-flex items-center justify-center gap-2 rounded-md text-sm font-medium hover:bg-muted hover:text-muted-foreground disabled:pointer-events-none disabled:opacity-50 data-[state=on]:bg-accent data-[state=on]:text-accent-foreground [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 [&_svg]:shrink-0 focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] outline-none transition-[color,box-shadow] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive whitespace-nowrap",{variants:{variant:{default:"bg-transparent",outline:"border border-input bg-transparent shadow-xs hover:bg-accent hover:text-accent-foreground"},size:{default:"h-9 px-2 min-w-9",sm:"h-8 px-1.5 min-w-8",lg:"h-10 px-2.5 min-w-10"}},defaultVariants:{variant:"default",size:"default"}});function pi({className:t,variant:a,size:r,...n}){return e.jsx(Rs.Root,{"data-slot":"toggle",className:i(ea({variant:a,size:r,className:t})),...n})}const rn=I.createContext({size:"default",variant:"default",spacing:0});function _e({className:t,variant:a,size:r,spacing:n=0,children:s,...o}){return e.jsx(va.Root,{"data-slot":"toggle-group","data-variant":a,"data-size":r,"data-spacing":n,style:{"--gap":n},className:i("group/toggle-group flex w-fit items-center gap-[--spacing(var(--gap))] rounded-md data-[spacing=default]:data-[variant=outline]:shadow-xs",t),...o,children:e.jsx(rn.Provider,{value:{variant:a,size:r,spacing:n},children:s})})}function U({className:t,children:a,variant:r,size:n,...s}){const o=I.useContext(rn);return e.jsx(va.Item,{"data-slot":"toggle-group-item","data-variant":o.variant||r,"data-size":o.size||n,"data-spacing":o.spacing,className:i(ea({variant:o.variant||r,size:o.size||n}),"w-auto min-w-0 shrink-0 px-3 focus:z-10 focus-visible:z-10","data-[spacing=0]:rounded-none data-[spacing=0]:shadow-none data-[spacing=0]:first:rounded-l-md data-[spacing=0]:last:rounded-r-md data-[spacing=0]:data-[variant=outline]:border-l-0 data-[spacing=0]:data-[variant=outline]:first:border-l",t),...s,children:a})}function Ce({tooltipContent:t,children:a}){return e.jsx(ye,{children:e.jsxs(te,{children:[e.jsx(ae,{asChild:!0,children:a}),e.jsx(re,{children:t})]})})}function et({children:t,variant:a,asChild:r=!1,size:n,...s}){return e.jsx(R,{variant:a,size:n,...s,asChild:r,children:t})}function gi({children:t,variant:a,asChild:r=!1,size:n,tooltipContent:s,...o}){return e.jsx(Ce,{tooltipContent:s,children:e.jsx(et,{variant:a,size:n,...o,asChild:r,children:t})})}function tt({children:t,variant:a,asChild:r=!1,size:n,...s}){return e.jsx(R,{variant:a||"outline",size:n||"sm",...s,asChild:r,children:t})}function nn({children:t,variant:a,size:r,asChild:n=!1,tooltipContent:s,...o}){return e.jsx(Ce,{tooltipContent:s,children:e.jsx(tt,{variant:a,size:r,...o,asChild:n,children:t})})}function sn({children:t,variant:a,size:r,asChild:n=!1,...s}){return e.jsx(R,{variant:a||"outline",size:r||"icon",...s,asChild:n,children:t})}function Ne({children:t,tooltipContent:a,asChild:r=!1,variant:n,size:s,...o}){return e.jsx(Ce,{tooltipContent:a,children:e.jsx(sn,{variant:n,size:s,...o,asChild:r,children:t})})}function Et({actionMenus:t,extraActionParams:a}){const r=n=>(n=n.filter(s=>s?.visibility===void 0||s.visibility===!0||s.visibility&&s.visibility(...a?.arguments||[])),n.length===0?e.jsx(ie,{className:"text-center",children:"No action available."}):n.map((s,o)=>{if(s.type==="label")return e.jsx(Jt,{children:String(s.label)},o);if(s.type==="separator")return e.jsx(jt,{},o);if(s.type==="group"&&s.items)return e.jsx(Yt,{children:r(s.items)},o);if(s.items)return e.jsxs(Ya,{children:[e.jsx(Ja,{children:String(s.label)}),e.jsx(Ka,{children:e.jsx(Xa,{children:r(s.items)})})]},o);let l="";return typeof s.label=="function"?l=s.label(...a?.arguments||[]):l=s.label,e.jsxs(ie,{disabled:s.disabled,onClick:()=>s.onClick&&s.onClick(...a?.arguments||[]),children:[s.icon&&e.jsx(s.icon,{}),l]},o)}));return e.jsxs(Ae,{children:[e.jsx(Te,{asChild:!0,children:e.jsx(Ne,{variant:"ghost",tooltipContent:"Actions",className:"h-8 w-8 p-0 border-0 bg-transparent text-foreground keross:text-white elevation-0 shadow-none hover:bg-transparent",children:e.jsx(g.MoreHorizontal,{})})}),e.jsx(Pe,{className:"w-56",align:"end",children:r(t)})]})}const on=({title:t,description:a,fontSize:r="text-base",cancelText:n="",confirmText:s="",thirdOptionText:o="",onCancel:l,onConfirm:c,onThird:d})=>e.jsx(ka,{open:!0,children:e.jsxs(Ta,{children:[e.jsxs(Pa,{children:[e.jsx(Ra,{className:r,children:t}),e.jsx(_a,{className:r,children:a})]}),e.jsxs(Da,{children:[n!=""&&e.jsx(za,{onClick:()=>{l&&l()},children:n}),o!=""&&e.jsx(Tt,{className:"bg-blue-500",color:"black",onClick:()=>{d&&d()},children:o}),s!=""&&e.jsx(Tt,{onClick:()=>{c&&c()},children:s})]})]})}),ln=m.createContext(void 0),hi=()=>{const t=m.useContext(ln);if(!t)throw new Error("useDialog must be used within a DialogProvider");return t},cn=({children:t})=>{const[a,r]=m.useState(null),n=o=>r(o),s=()=>r(null);return e.jsxs(ln.Provider,{value:{openDialog:n,closeDialog:s},children:[t,a&&e.jsx(on,{title:a.title,description:a.description,fontSize:a.fontSize||"text-base",cancelText:a.cancelText||"",confirmText:a.confirmText||"",thirdOptionText:a.thirdOptionText||"",onConfirm:()=>{a.onConfirm&&a.onConfirm(),s()},onCancel:()=>{a.onCancel&&a.onCancel(),s()},onThird:()=>{a.onThird&&a.onThird(),s()}})]})};function bi({placeholder:t,items:a,disabled:r,onSelect:n,defaultValue:s}){const[o,l]=m.useState(s??"");return e.jsxs(J,{children:[e.jsx(X,{asChild:!0,className:"w-full",children:e.jsxs(R,{variant:"outline",role:"combobox",className:i("justify-between",!o&&"text-muted-foreground","bg-secondary"),disabled:r===!0||typeof r=="function"&&r(),children:[o?a.find(c=>c.value===o)?.label||o:t,e.jsx(g.ChevronsUpDown,{className:"opacity-50"})]})}),e.jsx(Q,{className:"p-0",align:"start",children:e.jsxs(Y,{children:[e.jsx(ne,{placeholder:"Search..."}),e.jsxs(se,{children:[e.jsx(oe,{children:"No items found."}),e.jsx(ee,{children:a.map(c=>e.jsxs(K,{value:c.value,disabled:c.disabled===!0||typeof c.disabled=="function"&&c.disabled(c),onSelect:d=>{const u=a.find(f=>f.value.toLowerCase()===d.toLowerCase())?.value??d;l(u),n?.(u)},children:[c?.label||c.value,e.jsx(g.Check,{className:i("ml-auto",c.value===o?"opacity-100":"opacity-0")})]},c.value))})]})]})})]})}const ve=t=>t?.columnDef?.title||t?.columnDef?.header&&typeof t.columnDef.header=="string"&&t?.columnDef?.header||t.id;function dn({table:t}){return e.jsxs(J,{children:[e.jsx(Ce,{tooltipContent:"Column View",children:e.jsx(X,{asChild:!0,children:e.jsxs(tt,{children:[e.jsx(g.Settings2,{}),"View"]})})}),e.jsx(Q,{className:"w-[220px] p-0",align:"end",children:e.jsxs(Y,{children:[e.jsx(ne,{placeholder:"Search..."}),e.jsxs(se,{children:[e.jsx(oe,{children:"No results found."}),e.jsx(ee,{children:t.getAllColumns().filter(a=>typeof a.accessorFn<"u"&&a.getCanHide()).map(a=>{const r=a.getIsVisible();return e.jsxs(K,{onSelect:()=>{a.toggleVisibility(!r)},disabled:a.getIsGrouped(),children:[e.jsx("div",{className:i("mr-2 flex h-4 w-4 items-center justify-center rounded-sm border border-black dark:border-white",r?"bg-black dark:bg-white text-white dark:text-black":"opacity-50 [&_svg]:invisible"),children:e.jsx(g.Check,{})}),e.jsx("span",{className:"overflow-hidden text-ellipsis",title:ve(a),children:ve(a)})]},a.id)})})]})]})})]})}function un({column:t}){const a=t?.getFacetedUniqueValues(),r=new Set(t?.getFilterValue()),n=I.useMemo(()=>Array.from(t.getFacetedUniqueValues().keys()).sort().slice(0,5e3),[t.getFacetedUniqueValues()]);return e.jsxs(J,{children:[e.jsx(X,{asChild:!0,children:e.jsxs(nn,{variant:"dashed",tooltipContent:ve(t),children:[r?.size>0?e.jsx(g.X,{}):e.jsx(g.Plus,{}),ve(t),r?.size>0&&e.jsxs(e.Fragment,{children:[e.jsx(Nt,{orientation:"vertical",className:"mx-2 h-4"}),e.jsx(lt,{variant:"secondary",className:"rounded-sm px-1 font-normal lg:hidden",children:r.size}),e.jsx("div",{className:"hidden space-x-1 lg:flex",children:r.size>2?e.jsxs(lt,{variant:"secondary",className:"rounded-sm px-1 font-normal",children:[r.size," selected"]}):n.filter(s=>r.has(s)).map(s=>e.jsx(lt,{variant:"secondary",className:"rounded-sm px-1 font-normal",children:s},s))})]})]})}),e.jsx(Q,{className:"max-w-[250px] p-0",align:"start",children:e.jsxs(Y,{children:[e.jsx(ne,{placeholder:ve(t)}),e.jsxs(se,{children:[e.jsx(oe,{children:"No results found."}),e.jsx(ee,{children:n.map(s=>{const o=r.has(s);return e.jsxs(K,{onSelect:()=>{o?r.delete(s):r.add(s);const l=Array.from(r);t?.setFilterValue(l.length?l:void 0)},children:[e.jsx("div",{className:i("mr-2 flex h-4 w-4 items-center justify-center rounded-sm border border-black dark:border-white",o?"bg-black dark:bg-white text-white dark:text-black":"opacity-50 [&_svg]:invisible"),children:e.jsx(g.Check,{})}),e.jsx("span",{className:"overflow-hidden text-ellipsis",title:s,children:s}),a?.get(s)&&e.jsx("span",{className:"ml-auto flex h-4 w-4 items-center justify-center font-mono text-xs",children:a.get(s)})]},s)})})]}),r.size>0&&e.jsxs(e.Fragment,{children:[e.jsx(Ha,{}),e.jsx(ee,{children:e.jsx(K,{onSelect:()=>t?.setFilterValue(void 0),className:"justify-center text-center",children:"Clear filters"})})]})]})})]})}function mn({table:t}){const[a,r]=m.useState([]);return e.jsxs("div",{className:"flex-grow flex gap-3 items-center overflow-hidden",children:[e.jsxs(J,{children:[e.jsx(Ce,{tooltipContent:"Filter",children:e.jsx(X,{asChild:!0,children:e.jsxs(tt,{children:[e.jsx(g.Filter,{}),"Filter"]})})}),e.jsx(Q,{className:"w-[220px] p-0",align:"start",children:e.jsxs(Y,{children:[e.jsx(ne,{placeholder:"Search..."}),e.jsxs(se,{children:[e.jsx(oe,{children:"No results found."}),e.jsx(ee,{children:t.getAllColumns().filter(n=>typeof n.accessorFn<"u"&&n.getCanHide()).map(n=>{const s=new Set(a),o=s.has(n.id);return e.jsxs(K,{onSelect:()=>{o?s.delete(n.id):s.add(n.id),r([...s])},children:[e.jsx("div",{className:i("mr-2 flex h-4 w-4 items-center justify-center rounded-sm border border-black dark:border-white",o?"bg-black dark:bg-white text-white dark:text-black":"opacity-50 [&_svg]:invisible"),children:e.jsx(g.Check,{})}),e.jsx("span",{className:"overflow-hidden text-ellipsis",title:ve(n),children:ve(n)})]},n.id)})})]})]})})]}),e.jsx("div",{className:"flex-grow flex gap-3 items-center overflow-auto",children:a.map(n=>{const s=t.getColumn(n);if(s)return e.jsx(un,{column:s},n)})})]})}const fn=async t=>new Promise((a,r)=>{const n=new FileReader;n.onload=()=>{const o=n.result.split(",")[1];a({message:"File processed successfully",fileName:t.name,size:t.size,type:t.type,lastModified:t.lastModified,base64:o})},n.onerror=()=>r(n.error),n.readAsDataURL(t)});function vi(t){const a=atob(t.base64),r=new Array(a.length).fill(0).map((o,l)=>a.charCodeAt(l)),n=new Uint8Array(r),s=new Blob([n],{type:t.type});return URL.createObjectURL(s)}function ji({label:t="Upload File",isDrag:a=!1,onFileSelect:r}){const[n,s]=m.useState(!1),o=async f=>{if(!f)return;const h=await fn(f);await r(h)},l=f=>{if(!a)return;f.preventDefault(),s(!1);const h=f.dataTransfer.files?.[0];h&&o(h)},c=f=>{a&&(f.preventDefault(),s(!0))},d=()=>{a&&s(!1)},u=f=>{const h=f.target.files?.[0];h&&o(h)};return e.jsxs("div",{className:"flex flex-col gap-2 w-full",children:[e.jsx("label",{className:"text-sm font-medium",children:t}),e.jsx("input",{type:"file",id:"fileInput",className:"hidden",onChange:u}),a?e.jsx("div",{className:`border-2 border-dashed rounded-lg p-6 text-center cursor-pointer transition
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),f=require("lucide-react"),ns=require("@radix-ui/react-accordion"),ss=require("clsx"),os=require("tailwind-merge"),is=require("@radix-ui/react-alert-dialog"),W=require("class-variance-authority"),ls=require("@radix-ui/react-aspect-ratio"),ds=require("@radix-ui/react-avatar"),cs=require("@radix-ui/react-checkbox"),us=require("@radix-ui/react-dialog"),ms=require("@radix-ui/react-dropdown-menu"),xs=require("@radix-ui/react-hover-card"),fs=require("@radix-ui/react-label"),gs=require("@radix-ui/react-navigation-menu"),ps=require("@radix-ui/react-popover"),hs=require("@radix-ui/react-progress"),bs=require("@radix-ui/react-radio-group"),vs=require("@radix-ui/react-scroll-area"),js=require("@radix-ui/react-select"),ws=require("@radix-ui/react-separator"),Ns=require("@radix-ui/react-slider"),Yt=require("@radix-ui/react-slot"),ys=require("@radix-ui/react-switch"),Cs=require("@radix-ui/react-tabs"),Ss=require("@radix-ui/react-toggle"),ks=require("@radix-ui/react-toggle-group"),Is=require("@radix-ui/react-tooltip"),m=require("react"),zt=require("react-day-picker"),$e=require("cmdk"),Ca=require("sonner");require("react-dom");const Me=require("vaul"),Ke=require("react-hook-form"),Sa=require("input-otp"),E=require("@tanstack/react-table"),Le=require("echarts"),pt=require("motion/react"),Ds=require("zxcvbn"),As=require("countries-list"),Ps=require("country-flag-icons/react/3x2"),Xe=require("date-fns"),q=require("react-big-calendar");require("react-big-calendar/lib/css/react-big-calendar.css");const Ts=require("date-fns/locale"),be=require("react-router"),ka=require("axios"),Qt=require("js-cookie"),Rs=require("jwt-decode"),Ue=require("@tanstack/react-query"),Ia=require("react-cropper"),_=require("@assistant-ui/react"),_s=require("motion/react-m"),Ft=require("@assistant-ui/react-markdown"),zs=require("remark-gfm"),Fs=require("@assistant-ui/react-ai-sdk"),fa=require("uuid"),Ms=require("xlsx"),ae=require("react-router-dom"),Es=require("use-debounce");function L(t){const a=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const r in t)if(r!=="default"){const n=Object.getOwnPropertyDescriptor(t,r);Object.defineProperty(a,r,n.get?n:{enumerable:!0,get:()=>t[r]})}}return a.default=t,Object.freeze(a)}const Ls=L(f),et=L(ns),Ie=L(is),Os=L(ls),Jt=L(ds),ga=L(cs),U=L(us),$=L(ms),vt=L(xs),Bs=L(fs),Ee=L(gs),tt=L(ps),pa=L(hs),Mt=L(bs),Ze=L(vs),K=L(js),Us=L(ws),mt=L(Ns),De=L(Yt),ha=L(ys),Ct=L(Cs),Vs=L(Ss),Da=L(ks),He=L(Is),D=L(m),$s=L(Ps),Et=L(_s),xt=L(Ms);function l(...t){return os.twMerge(ss.clsx(t))}function Gs({...t}){return e.jsx(et.Root,{"data-slot":"accordion",...t})}function qs({className:t,...a}){return e.jsx(et.Item,{"data-slot":"accordion-item",className:l("border-b last:border-b-0",t),...a})}function Ws({className:t,children:a,...r}){return e.jsx(et.Header,{className:"flex",children:e.jsxs(et.Trigger,{"data-slot":"accordion-trigger",className:l("focus-visible:border-ring focus-visible:ring-ring/50 flex flex-1 items-start justify-between gap-4 rounded-md py-4 text-left text-sm font-medium transition-all outline-none hover:underline focus-visible:ring-[3px] disabled:pointer-events-none disabled:opacity-50 [&[data-state=open]>svg]:rotate-180",t),...r,children:[a,e.jsx(f.ChevronDownIcon,{className:"text-muted-foreground pointer-events-none size-4 shrink-0 translate-y-0.5 transition-transform duration-200"})]})})}function Hs({className:t,children:a,...r}){return e.jsx(et.Content,{"data-slot":"accordion-content",className:"data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down overflow-hidden text-sm",...r,children:e.jsx("div",{className:l("pt-0 pb-4",t),children:a})})}function Ks(t,a,{checkForDefaultPrevented:r=!0}={}){return function(s){if(t?.(s),r===!1||!s.defaultPrevented)return a?.(s)}}function Xs(t,a=[]){let r=[];function n(o,i){const d=D.createContext(i),u=r.length;r=[...r,i];const c=g=>{const{scope:w,children:N,...v}=g,C=w?.[t]?.[u]||d,b=D.useMemo(()=>v,Object.values(v));return e.jsx(C.Provider,{value:b,children:N})};c.displayName=o+"Provider";function x(g,w){const N=w?.[t]?.[u]||d,v=D.useContext(N);if(v)return v;if(i!==void 0)return i;throw new Error(`\`${g}\` must be used within \`${o}\``)}return[c,x]}const s=()=>{const o=r.map(i=>D.createContext(i));return function(d){const u=d?.[t]||o;return D.useMemo(()=>({[`__scope${t}`]:{...d,[t]:u}}),[d,u])}};return s.scopeName=t,[n,Ys(s,...a)]}function Ys(...t){const a=t[0];if(t.length===1)return a;const r=()=>{const n=t.map(s=>({useScope:s(),scopeName:s.scopeName}));return function(o){const i=n.reduce((d,{useScope:u,scopeName:c})=>{const g=u(o)[`__scope${c}`];return{...d,...g}},{});return D.useMemo(()=>({[`__scope${a.scopeName}`]:i}),[i])}};return r.scopeName=a.scopeName,r}var at=globalThis?.document?D.useLayoutEffect:()=>{},Qs=D[" useInsertionEffect ".trim().toString()]||at;function Js({prop:t,defaultProp:a,onChange:r=()=>{},caller:n}){const[s,o,i]=Zs({defaultProp:a,onChange:r}),d=t!==void 0,u=d?t:s;{const x=D.useRef(t!==void 0);D.useEffect(()=>{const g=x.current;g!==d&&console.warn(`${n} is changing from ${g?"controlled":"uncontrolled"} to ${d?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),x.current=d},[d,n])}const c=D.useCallback(x=>{if(d){const g=eo(x)?x(t):x;g!==t&&i.current?.(g)}else o(x)},[d,t,o,i]);return[u,c]}function Zs({defaultProp:t,onChange:a}){const[r,n]=D.useState(t),s=D.useRef(r),o=D.useRef(a);return Qs(()=>{o.current=a},[a]),D.useEffect(()=>{s.current!==r&&(o.current?.(r),s.current=r)},[r,s]),[r,n,o]}function eo(t){return typeof t=="function"}function ba(t,a){if(typeof t=="function")return t(a);t!=null&&(t.current=a)}function to(...t){return a=>{let r=!1;const n=t.map(s=>{const o=ba(s,a);return!r&&typeof o=="function"&&(r=!0),o});if(r)return()=>{for(let s=0;s<n.length;s++){const o=n[s];typeof o=="function"?o():ba(t[s],null)}}}}function Aa(...t){return D.useCallback(to(...t),t)}var ao=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Zt=ao.reduce((t,a)=>{const r=Yt.createSlot(`Primitive.${a}`),n=D.forwardRef((s,o)=>{const{asChild:i,...d}=s,u=i?r:a;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),e.jsx(u,{...d,ref:o})});return n.displayName=`Primitive.${a}`,{...t,[a]:n}},{});function ro(t,a){return D.useReducer((r,n)=>a[r][n]??r,t)}var Pa=t=>{const{present:a,children:r}=t,n=no(a),s=typeof r=="function"?r({present:n.isPresent}):D.Children.only(r),o=Aa(n.ref,so(s));return typeof r=="function"||n.isPresent?D.cloneElement(s,{ref:o}):null};Pa.displayName="Presence";function no(t){const[a,r]=D.useState(),n=D.useRef(null),s=D.useRef(t),o=D.useRef("none"),i=t?"mounted":"unmounted",[d,u]=ro(i,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return D.useEffect(()=>{const c=ft(n.current);o.current=d==="mounted"?c:"none"},[d]),at(()=>{const c=n.current,x=s.current;if(x!==t){const w=o.current,N=ft(c);t?u("MOUNT"):N==="none"||c?.display==="none"?u("UNMOUNT"):u(x&&w!==N?"ANIMATION_OUT":"UNMOUNT"),s.current=t}},[t,u]),at(()=>{if(a){let c;const x=a.ownerDocument.defaultView??window,g=N=>{const C=ft(n.current).includes(CSS.escape(N.animationName));if(N.target===a&&C&&(u("ANIMATION_END"),!s.current)){const b=a.style.animationFillMode;a.style.animationFillMode="forwards",c=x.setTimeout(()=>{a.style.animationFillMode==="forwards"&&(a.style.animationFillMode=b)})}},w=N=>{N.target===a&&(o.current=ft(n.current))};return a.addEventListener("animationstart",w),a.addEventListener("animationcancel",g),a.addEventListener("animationend",g),()=>{x.clearTimeout(c),a.removeEventListener("animationstart",w),a.removeEventListener("animationcancel",g),a.removeEventListener("animationend",g)}}else u("ANIMATION_END")},[a,u]),{isPresent:["mounted","unmountSuspended"].includes(d),ref:D.useCallback(c=>{n.current=c?getComputedStyle(c):null,r(c)},[])}}function ft(t){return t?.animationName||"none"}function so(t){let a=Object.getOwnPropertyDescriptor(t.props,"ref")?.get,r=a&&"isReactWarning"in a&&a.isReactWarning;return r?t.ref:(a=Object.getOwnPropertyDescriptor(t,"ref")?.get,r=a&&"isReactWarning"in a&&a.isReactWarning,r?t.props.ref:t.props.ref||t.ref)}var oo=D[" useId ".trim().toString()]||(()=>{}),io=0;function lo(t){const[a,r]=D.useState(oo());return at(()=>{r(n=>n??String(io++))},[t]),t||(a?`radix-${a}`:"")}var St="Collapsible",[co]=Xs(St),[uo,ea]=co(St),Ta=D.forwardRef((t,a)=>{const{__scopeCollapsible:r,open:n,defaultOpen:s,disabled:o,onOpenChange:i,...d}=t,[u,c]=Js({prop:n,defaultProp:s??!1,onChange:i,caller:St});return e.jsx(uo,{scope:r,disabled:o,contentId:lo(),open:u,onOpenToggle:D.useCallback(()=>c(x=>!x),[c]),children:e.jsx(Zt.div,{"data-state":aa(u),"data-disabled":o?"":void 0,...d,ref:a})})});Ta.displayName=St;var Ra="CollapsibleTrigger",_a=D.forwardRef((t,a)=>{const{__scopeCollapsible:r,...n}=t,s=ea(Ra,r);return e.jsx(Zt.button,{type:"button","aria-controls":s.contentId,"aria-expanded":s.open||!1,"data-state":aa(s.open),"data-disabled":s.disabled?"":void 0,disabled:s.disabled,...n,ref:a,onClick:Ks(t.onClick,s.onOpenToggle)})});_a.displayName=Ra;var ta="CollapsibleContent",za=D.forwardRef((t,a)=>{const{forceMount:r,...n}=t,s=ea(ta,t.__scopeCollapsible);return e.jsx(Pa,{present:r||s.open,children:({present:o})=>e.jsx(mo,{...n,ref:a,present:o})})});za.displayName=ta;var mo=D.forwardRef((t,a)=>{const{__scopeCollapsible:r,present:n,children:s,...o}=t,i=ea(ta,r),[d,u]=D.useState(n),c=D.useRef(null),x=Aa(a,c),g=D.useRef(0),w=g.current,N=D.useRef(0),v=N.current,C=i.open||d,b=D.useRef(C),S=D.useRef(void 0);return D.useEffect(()=>{const p=requestAnimationFrame(()=>b.current=!1);return()=>cancelAnimationFrame(p)},[]),at(()=>{const p=c.current;if(p){S.current=S.current||{transitionDuration:p.style.transitionDuration,animationName:p.style.animationName},p.style.transitionDuration="0s",p.style.animationName="none";const I=p.getBoundingClientRect();g.current=I.height,N.current=I.width,b.current||(p.style.transitionDuration=S.current.transitionDuration,p.style.animationName=S.current.animationName),u(n)}},[i.open,n]),e.jsx(Zt.div,{"data-state":aa(i.open),"data-disabled":i.disabled?"":void 0,id:i.contentId,hidden:!C,...o,ref:x,style:{"--radix-collapsible-content-height":w?`${w}px`:void 0,"--radix-collapsible-content-width":v?`${v}px`:void 0,...t.style},children:C&&s})});function aa(t){return t?"open":"closed"}var xo=Ta;const jt=W.cva("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive text-white hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",outline:"border bg-background shadow-xs hover:bg-accent hover:text-accent-foreground dark:bg-input/30 dark:border-input dark:hover:bg-input/50",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50",dashed:"border border-dashed bg-background shadow-sm hover:bg-accent hover:text-accent-foreground ",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2 has-[>svg]:px-3",xs:"h-6 gap-1 rounded-md px-2 text-xs has-[>svg]:px-1.5 [&_svg:not([class*='size-'])]:size-3",sm:"h-8 rounded-md gap-1.5 px-3 has-[>svg]:px-2.5",lg:"h-10 rounded-md px-6 has-[>svg]:px-4",icon:"size-9","icon-xs":"size-6 rounded-md [&_svg:not([class*='size-'])]:size-3","icon-sm":"size-8","icon-lg":"size-10"}},defaultVariants:{variant:"default",size:"default"}});function T({className:t,variant:a="default",size:r="default",asChild:n=!1,...s}){const o=n?De.Root:"button";return e.jsx(o,{"data-slot":"button","data-variant":a,"data-size":r,className:l(jt({variant:a,size:r,className:t})),...s})}function Fa({...t}){return e.jsx(Ie.Root,{"data-slot":"alert-dialog",...t})}function fo({...t}){return e.jsx(Ie.Trigger,{"data-slot":"alert-dialog-trigger",...t})}function Ma({...t}){return e.jsx(Ie.Portal,{"data-slot":"alert-dialog-portal",...t})}function Ea({className:t,...a}){return e.jsx(Ie.Overlay,{"data-slot":"alert-dialog-overlay",className:l("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50",t),...a})}function La({className:t,size:a="default",...r}){return e.jsxs(Ma,{children:[e.jsx(Ea,{}),e.jsx(Ie.Content,{"data-slot":"alert-dialog-content","data-size":a,className:l("bg-background data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 group/alert-dialog-content fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border p-6 shadow-lg duration-200 data-[size=sm]:max-w-xs data-[size=default]:sm:max-w-lg",t),...r})]})}function Oa({className:t,...a}){return e.jsx("div",{"data-slot":"alert-dialog-header",className:l("grid grid-rows-[auto_1fr] place-items-center gap-1.5 text-center has-data-[slot=alert-dialog-media]:grid-rows-[auto_auto_1fr] has-data-[slot=alert-dialog-media]:gap-x-6 sm:group-data-[size=default]/alert-dialog-content:place-items-start sm:group-data-[size=default]/alert-dialog-content:text-left sm:group-data-[size=default]/alert-dialog-content:has-data-[slot=alert-dialog-media]:grid-rows-[auto_1fr]",t),...a})}function Ba({className:t,...a}){return e.jsx("div",{"data-slot":"alert-dialog-footer",className:l("flex flex-col-reverse gap-2 group-data-[size=sm]/alert-dialog-content:grid group-data-[size=sm]/alert-dialog-content:grid-cols-2 sm:flex-row sm:justify-end",t),...a})}function Ua({className:t,...a}){return e.jsx(Ie.Title,{"data-slot":"alert-dialog-title",className:l("text-lg font-semibold sm:group-data-[size=default]/alert-dialog-content:group-has-data-[slot=alert-dialog-media]/alert-dialog-content:col-start-2",t),...a})}function Va({className:t,...a}){return e.jsx(Ie.Description,{"data-slot":"alert-dialog-description",className:l("text-muted-foreground text-sm",t),...a})}function go({className:t,...a}){return e.jsx("div",{"data-slot":"alert-dialog-media",className:l("bg-muted mb-2 inline-flex size-16 items-center justify-center rounded-md sm:group-data-[size=default]/alert-dialog-content:row-span-2 *:[svg:not([class*='size-'])]:size-8",t),...a})}function Lt({className:t,variant:a="default",size:r="default",...n}){return e.jsx(T,{variant:a,size:r,asChild:!0,children:e.jsx(Ie.Action,{"data-slot":"alert-dialog-action",className:l(t),...n})})}function $a({className:t,variant:a="outline",size:r="default",...n}){return e.jsx(T,{variant:a,size:r,asChild:!0,children:e.jsx(Ie.Cancel,{"data-slot":"alert-dialog-cancel",className:l(t),...n})})}const po=W.cva("relative w-full rounded-lg border px-4 py-3 text-sm grid has-[>svg]:grid-cols-[calc(var(--spacing)*4)_1fr] grid-cols-[0_1fr] has-[>svg]:gap-x-3 gap-y-0.5 items-start [&>svg]:size-4 [&>svg]:translate-y-0.5 [&>svg]:text-current",{variants:{variant:{default:"bg-card text-card-foreground",destructive:"text-destructive bg-card [&>svg]:text-current *:data-[slot=alert-description]:text-destructive/90"}},defaultVariants:{variant:"default"}});function ho({className:t,variant:a,...r}){return e.jsx("div",{"data-slot":"alert",role:"alert",className:l(po({variant:a}),t),...r})}function bo({className:t,...a}){return e.jsx("div",{"data-slot":"alert-title",className:l("col-start-2 line-clamp-1 min-h-4 font-medium tracking-tight",t),...a})}function vo({className:t,...a}){return e.jsx("div",{"data-slot":"alert-description",className:l("text-muted-foreground col-start-2 grid justify-items-start gap-1 text-sm [&_p]:leading-relaxed",t),...a})}function Ga({className:t,size:a="default",...r}){return e.jsx(Jt.Root,{"data-slot":"avatar","data-size":a,className:l("group/avatar relative flex size-8 shrink-0 overflow-hidden rounded-full select-none data-[size=lg]:size-10 data-[size=sm]:size-6",t),...r})}function qa({className:t,...a}){return e.jsx(Jt.Image,{"data-slot":"avatar-image",className:l("aspect-square size-full",t),...a})}function Wa({className:t,...a}){return e.jsx(Jt.Fallback,{"data-slot":"avatar-fallback",className:l("bg-muted text-muted-foreground flex size-full items-center justify-center rounded-full text-sm group-data-[size=sm]/avatar:text-xs",t),...a})}function jo({className:t,...a}){return e.jsx("span",{"data-slot":"avatar-badge",className:l("bg-primary text-primary-foreground ring-background absolute right-0 bottom-0 z-10 inline-flex items-center justify-center rounded-full ring-2 select-none","group-data-[size=sm]/avatar:size-2 group-data-[size=sm]/avatar:[&>svg]:hidden","group-data-[size=default]/avatar:size-2.5 group-data-[size=default]/avatar:[&>svg]:size-2","group-data-[size=lg]/avatar:size-3 group-data-[size=lg]/avatar:[&>svg]:size-2",t),...a})}function wo({className:t,...a}){return e.jsx("div",{"data-slot":"avatar-group",className:l("*:data-[slot=avatar]:ring-background group/avatar-group flex -space-x-2 *:data-[slot=avatar]:ring-2",t),...a})}function No({className:t,...a}){return e.jsx("div",{"data-slot":"avatar-group-count",className:l("bg-muted text-muted-foreground ring-background relative flex size-8 shrink-0 items-center justify-center rounded-full text-sm ring-2 group-has-data-[size=lg]/avatar-group:size-10 group-has-data-[size=sm]/avatar-group:size-6 [&>svg]:size-4 group-has-data-[size=lg]/avatar-group:[&>svg]:size-5 group-has-data-[size=sm]/avatar-group:[&>svg]:size-3",t),...a})}const Ha=W.cva("inline-flex items-center justify-center rounded-full border border-transparent px-2 py-0.5 text-xs font-medium w-fit whitespace-nowrap shrink-0 [&>svg]:size-3 gap-1 [&>svg]:pointer-events-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive transition-[color,box-shadow] overflow-hidden",{variants:{variant:{default:"bg-primary text-primary-foreground [a&]:hover:bg-primary/90",secondary:"bg-secondary text-secondary-foreground [a&]:hover:bg-secondary/90",destructive:"bg-destructive text-white [a&]:hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",outline:"border-border text-foreground [a&]:hover:bg-accent [a&]:hover:text-accent-foreground",ghost:"[a&]:hover:bg-accent [a&]:hover:text-accent-foreground",link:"text-primary underline-offset-4 [a&]:hover:underline"}},defaultVariants:{variant:"default"}});function ht({className:t,variant:a="default",asChild:r=!1,...n}){const s=r?De.Root:"span";return e.jsx(s,{"data-slot":"badge","data-variant":a,className:l(Ha({variant:a}),t),...n})}function Ka({className:t,classNames:a,showOutsideDays:r=!0,captionLayout:n="label",buttonVariant:s="ghost",formatters:o,components:i,...d}){const u=zt.getDefaultClassNames();return e.jsx(zt.DayPicker,{showOutsideDays:r,className:l("bg-background group/calendar p-3 [--cell-size:--spacing(8)] [[data-slot=card-content]_&]:bg-transparent [[data-slot=popover-content]_&]:bg-transparent",String.raw`rtl:**:[.rdp-button\_next>svg]:rotate-180`,String.raw`rtl:**:[.rdp-button\_previous>svg]:rotate-180`,t),captionLayout:n,formatters:{formatMonthDropdown:c=>c.toLocaleString("default",{month:"short"}),...o},classNames:{root:l("w-fit",u.root),months:l("flex gap-4 flex-col md:flex-row relative",u.months),month:l("flex flex-col w-full gap-4",u.month),nav:l("flex items-center gap-1 w-full absolute top-0 inset-x-0 justify-between",u.nav),button_previous:l(jt({variant:s}),"size-(--cell-size) aria-disabled:opacity-50 p-0 select-none",u.button_previous),button_next:l(jt({variant:s}),"size-(--cell-size) aria-disabled:opacity-50 p-0 select-none",u.button_next),month_caption:l("flex items-center justify-center h-(--cell-size) w-full px-(--cell-size)",u.month_caption),dropdowns:l("w-full flex items-center text-sm font-medium justify-center h-(--cell-size) gap-1.5",u.dropdowns),dropdown_root:l("relative has-focus:border-ring border border-input shadow-xs has-focus:ring-ring/50 has-focus:ring-[3px] rounded-md",u.dropdown_root),dropdown:l("absolute bg-popover inset-0 opacity-0",u.dropdown),caption_label:l("select-none font-medium",n==="label"?"text-sm":"rounded-md pl-2 pr-1 flex items-center gap-1 text-sm h-8 [&>svg]:text-muted-foreground [&>svg]:size-3.5",u.caption_label),table:"w-full border-collapse",weekdays:l("flex",u.weekdays),weekday:l("text-muted-foreground rounded-md flex-1 font-normal text-[0.8rem] select-none",u.weekday),week:l("flex w-full mt-2",u.week),week_number_header:l("select-none w-(--cell-size)",u.week_number_header),week_number:l("text-[0.8rem] select-none text-muted-foreground",u.week_number),day:l("relative w-full h-full p-0 text-center [&:last-child[data-selected=true]_button]:rounded-r-md group/day aspect-square select-none",d.showWeekNumber?"[&:nth-child(2)[data-selected=true]_button]:rounded-l-md":"[&:first-child[data-selected=true]_button]:rounded-l-md",u.day),range_start:l("rounded-l-md bg-accent",u.range_start),range_middle:l("rounded-none",u.range_middle),range_end:l("rounded-r-md bg-accent",u.range_end),today:l("bg-accent text-accent-foreground rounded-md data-[selected=true]:rounded-none",u.today),outside:l("text-muted-foreground aria-selected:text-muted-foreground",u.outside),disabled:l("text-muted-foreground opacity-50",u.disabled),hidden:l("invisible",u.hidden),...a},components:{Root:({className:c,rootRef:x,...g})=>e.jsx("div",{"data-slot":"calendar",ref:x,className:l(c),...g}),Chevron:({className:c,orientation:x,...g})=>x==="left"?e.jsx(f.ChevronLeftIcon,{className:l("size-4",c),...g}):x==="right"?e.jsx(f.ChevronRightIcon,{className:l("size-4",c),...g}):e.jsx(f.ChevronDownIcon,{className:l("size-4",c),...g}),DayButton:Xa,WeekNumber:({children:c,...x})=>e.jsx("td",{...x,children:e.jsx("div",{className:"flex size-(--cell-size) items-center justify-center text-center",children:c})}),...i},...d})}function Xa({className:t,day:a,modifiers:r,...n}){const s=zt.getDefaultClassNames(),o=D.useRef(null);return D.useEffect(()=>{r.focused&&o.current?.focus()},[r.focused]),e.jsx(T,{ref:o,variant:"ghost",size:"icon","data-day":a.date.toLocaleDateString(),"data-selected-single":r.selected&&!r.range_start&&!r.range_end&&!r.range_middle,"data-range-start":r.range_start,"data-range-end":r.range_end,"data-range-middle":r.range_middle,className:l("data-[selected-single=true]:bg-primary data-[selected-single=true]:text-primary-foreground data-[range-middle=true]:bg-accent data-[range-middle=true]:text-accent-foreground data-[range-start=true]:bg-primary data-[range-start=true]:text-primary-foreground data-[range-end=true]:bg-primary data-[range-end=true]:text-primary-foreground group-data-[focused=true]/day:border-ring group-data-[focused=true]/day:ring-ring/50 dark:hover:text-accent-foreground flex aspect-square size-auto w-full min-w-(--cell-size) flex-col gap-1 leading-none font-normal group-data-[focused=true]/day:relative group-data-[focused=true]/day:z-10 group-data-[focused=true]/day:ring-[3px] data-[range-end=true]:rounded-md data-[range-end=true]:rounded-r-md data-[range-middle=true]:rounded-none data-[range-start=true]:rounded-md data-[range-start=true]:rounded-l-md [&>span]:text-xs [&>span]:opacity-70",s.day,t),...n})}function wt({className:t,...a}){return e.jsx("div",{"data-slot":"card",className:l("bg-card text-card-foreground flex flex-col gap-6 rounded-xl border py-6 shadow-sm",t),...a})}function yo({className:t,...a}){return e.jsx("div",{"data-slot":"card-header",className:l("@container/card-header grid auto-rows-min grid-rows-[auto_auto] items-start gap-2 px-6 has-data-[slot=card-action]:grid-cols-[1fr_auto] [.border-b]:pb-6",t),...a})}function Co({className:t,...a}){return e.jsx("div",{"data-slot":"card-title",className:l("leading-none font-semibold",t),...a})}function So({className:t,...a}){return e.jsx("div",{"data-slot":"card-description",className:l("text-muted-foreground text-sm",t),...a})}function ko({className:t,...a}){return e.jsx("div",{"data-slot":"card-action",className:l("col-start-2 row-span-2 row-start-1 self-start justify-self-end",t),...a})}function Ya({className:t,...a}){return e.jsx("div",{"data-slot":"card-content",className:l("px-6",t),...a})}function Io({className:t,...a}){return e.jsx("div",{"data-slot":"card-footer",className:l("flex items-center px-6 [.border-t]:pt-6",t),...a})}function Ve({className:t,...a}){return e.jsx(ga.Root,{"data-slot":"checkbox",className:l("peer border-input dark:bg-input/30 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground dark:data-[state=checked]:bg-primary data-[state=checked]:border-primary focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive size-4 shrink-0 rounded-[4px] border shadow-xs transition-shadow outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50",t),...a,children:e.jsx(ga.Indicator,{"data-slot":"checkbox-indicator",className:"grid place-content-center text-current transition-none",children:e.jsx(f.CheckIcon,{className:"size-3.5"})})})}function kt({...t}){return e.jsx(U.Root,{"data-slot":"dialog",...t})}function Qa({...t}){return e.jsx(U.Trigger,{"data-slot":"dialog-trigger",...t})}function Ja({...t}){return e.jsx(U.Portal,{"data-slot":"dialog-portal",...t})}function Do({...t}){return e.jsx(U.Close,{"data-slot":"dialog-close",...t})}function Za({className:t,...a}){return e.jsx(U.Overlay,{"data-slot":"dialog-overlay",className:l("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50",t),...a})}function It({className:t,children:a,showCloseButton:r=!0,...n}){return e.jsxs(Ja,{"data-slot":"dialog-portal",children:[e.jsx(Za,{}),e.jsxs(U.Content,{"data-slot":"dialog-content",className:l("bg-background data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border p-6 shadow-lg duration-200 outline-none sm:max-w-lg",t),...n,children:[a,r&&e.jsxs(U.Close,{"data-slot":"dialog-close",className:"ring-offset-background focus:ring-ring data-[state=open]:bg-accent data-[state=open]:text-muted-foreground absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",children:[e.jsx(f.XIcon,{}),e.jsx("span",{className:"sr-only",children:"Close"})]})]})]})}function ra({className:t,...a}){return e.jsx("div",{"data-slot":"dialog-header",className:l("flex flex-col gap-2 text-center sm:text-left",t),...a})}function er({className:t,showCloseButton:a=!1,children:r,...n}){return e.jsxs("div",{"data-slot":"dialog-footer",className:l("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",t),...n,children:[r,a&&e.jsx(U.Close,{asChild:!0,children:e.jsx(T,{variant:"outline",children:"Close"})})]})}function Dt({className:t,...a}){return e.jsx(U.Title,{"data-slot":"dialog-title",className:l("text-lg leading-none font-semibold",t),...a})}function tr({className:t,...a}){return e.jsx(U.Description,{"data-slot":"dialog-description",className:l("text-muted-foreground text-sm",t),...a})}function Y({className:t,...a}){return e.jsx($e.Command,{"data-slot":"command",className:l("bg-popover text-popover-foreground flex h-full w-full flex-col overflow-hidden rounded-md",t),...a})}function Ao({title:t="Command Palette",description:a="Search for a command to run...",children:r,className:n,showCloseButton:s=!0,...o}){return e.jsxs(kt,{...o,children:[e.jsxs(ra,{className:"sr-only",children:[e.jsx(Dt,{children:t}),e.jsx(tr,{children:a})]}),e.jsx(It,{className:l("overflow-hidden p-0",n),showCloseButton:s,children:e.jsx(Y,{className:"[&_[cmdk-group-heading]]:text-muted-foreground **:data-[slot=command-input-wrapper]:h-12 [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group]]:px-2 [&_[cmdk-group]:not([hidden])_~[cmdk-group]]:pt-0 [&_[cmdk-input-wrapper]_svg]:h-5 [&_[cmdk-input-wrapper]_svg]:w-5 [&_[cmdk-input]]:h-12 [&_[cmdk-item]]:px-2 [&_[cmdk-item]]:py-3 [&_[cmdk-item]_svg]:h-5 [&_[cmdk-item]_svg]:w-5",children:r})})]})}function ie({className:t,...a}){return e.jsxs("div",{"data-slot":"command-input-wrapper",className:"flex h-9 items-center gap-2 border-b px-3",children:[e.jsx(f.SearchIcon,{className:"size-4 shrink-0 opacity-50"}),e.jsx($e.Command.Input,{"data-slot":"command-input",className:l("placeholder:text-muted-foreground flex h-10 w-full rounded-md bg-transparent py-3 text-sm outline-hidden disabled:cursor-not-allowed disabled:opacity-50",t),...a})]})}function le({className:t,...a}){return e.jsx($e.Command.List,{"data-slot":"command-list",className:l("max-h-[300px] scroll-py-1 overflow-x-hidden overflow-y-auto",t),...a})}function de({...t}){return e.jsx($e.Command.Empty,{"data-slot":"command-empty",className:"py-6 text-center text-sm",...t})}function re({className:t,...a}){return e.jsx($e.Command.Group,{"data-slot":"command-group",className:l("text-foreground [&_[cmdk-group-heading]]:text-muted-foreground overflow-hidden p-1 [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium",t),...a})}function ar({className:t,...a}){return e.jsx($e.Command.Separator,{"data-slot":"command-separator",className:l("bg-border -mx-1 h-px",t),...a})}function X({className:t,...a}){return e.jsx($e.Command.Item,{"data-slot":"command-item",className:l("data-[selected=true]:bg-accent data-[selected=true]:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",t),...a})}function Po({className:t,...a}){return e.jsx("span",{"data-slot":"command-shortcut",className:l("text-muted-foreground ml-auto text-xs tracking-widest",t),...a})}function ve({...t}){return e.jsx($.Root,{"data-slot":"dropdown-menu",...t})}function rr({...t}){return e.jsx($.Portal,{"data-slot":"dropdown-menu-portal",...t})}function je({...t}){return e.jsx($.Trigger,{"data-slot":"dropdown-menu-trigger",...t})}function we({className:t,sideOffset:a=4,...r}){return e.jsx($.Portal,{children:e.jsx($.Content,{"data-slot":"dropdown-menu-content",sideOffset:a,className:l("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 max-h-(--radix-dropdown-menu-content-available-height) min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border p-1 shadow-md",t),...r})})}function na({...t}){return e.jsx($.Group,{"data-slot":"dropdown-menu-group",...t})}function ue({className:t,inset:a,variant:r="default",...n}){return e.jsx($.Item,{"data-slot":"dropdown-menu-item","data-inset":a,"data-variant":r,className:l("focus:bg-accent focus:text-accent-foreground data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 dark:data-[variant=destructive]:focus:bg-destructive/20 data-[variant=destructive]:focus:text-destructive data-[variant=destructive]:*:[svg]:!text-destructive [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",t),...n})}function To({className:t,children:a,checked:r,...n}){return e.jsxs($.CheckboxItem,{"data-slot":"dropdown-menu-checkbox-item",className:l("focus:bg-accent focus:text-accent-foreground relative flex cursor-default items-center gap-2 rounded-sm py-1.5 pr-2 pl-8 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",t),checked:r,...n,children:[e.jsx("span",{className:"pointer-events-none absolute left-2 flex size-3.5 items-center justify-center",children:e.jsx($.ItemIndicator,{children:e.jsx(f.CheckIcon,{className:"size-4"})})}),a]})}function Ro({...t}){return e.jsx($.RadioGroup,{"data-slot":"dropdown-menu-radio-group",...t})}function _o({className:t,children:a,...r}){return e.jsxs($.RadioItem,{"data-slot":"dropdown-menu-radio-item",className:l("focus:bg-accent focus:text-accent-foreground relative flex cursor-default items-center gap-2 rounded-sm py-1.5 pr-2 pl-8 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",t),...r,children:[e.jsx("span",{className:"pointer-events-none absolute left-2 flex size-3.5 items-center justify-center",children:e.jsx($.ItemIndicator,{children:e.jsx(f.CircleIcon,{className:"size-2 fill-current"})})}),a]})}function At({className:t,inset:a,...r}){return e.jsx($.Label,{"data-slot":"dropdown-menu-label","data-inset":a,className:l("px-2 py-1.5 text-sm font-medium data-[inset]:pl-8",t),...r})}function rt({className:t,...a}){return e.jsx($.Separator,{"data-slot":"dropdown-menu-separator",className:l("bg-border -mx-1 my-1 h-px",t),...a})}function zo({className:t,...a}){return e.jsx("span",{"data-slot":"dropdown-menu-shortcut",className:l("text-muted-foreground ml-auto text-xs tracking-widest",t),...a})}function nr({...t}){return e.jsx($.Sub,{"data-slot":"dropdown-menu-sub",...t})}function sr({className:t,inset:a,children:r,...n}){return e.jsxs($.SubTrigger,{"data-slot":"dropdown-menu-sub-trigger","data-inset":a,className:l("focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",t),...n,children:[r,e.jsx(f.ChevronRightIcon,{className:"ml-auto size-4"})]})}function or({className:t,...a}){return e.jsx($.SubContent,{"data-slot":"dropdown-menu-sub-content",className:l("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-hidden rounded-md border p-1 shadow-lg",t),...a})}function Fo({...t}){return e.jsx(vt.Root,{"data-slot":"hover-card",...t})}function Mo({...t}){return e.jsx(vt.Trigger,{"data-slot":"hover-card-trigger",...t})}function Eo({className:t,align:a="center",sideOffset:r=4,...n}){return e.jsx(vt.Portal,{"data-slot":"hover-card-portal",children:e.jsx(vt.Content,{"data-slot":"hover-card-content",align:a,sideOffset:r,className:l("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-64 origin-(--radix-hover-card-content-transform-origin) rounded-md border p-4 shadow-md outline-hidden",t),...n})})}function H({className:t,type:a,...r}){return e.jsx("input",{type:a,"data-slot":"input",className:l("file:text-foreground placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground dark:bg-input/30 border-input h-9 w-full min-w-0 rounded-md border bg-transparent px-3 py-1 text-base shadow-xs transition-[color,box-shadow] outline-none file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm","focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]","aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",t),...r})}function Se({className:t,...a}){return e.jsx(Bs.Root,{"data-slot":"label",className:l("flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50",t),...a})}function Lo({className:t,children:a,viewport:r=!0,...n}){return e.jsxs(Ee.Root,{"data-slot":"navigation-menu","data-viewport":r,className:l("group/navigation-menu relative flex max-w-max flex-1 items-center justify-center",t),...n,children:[a,r&&e.jsx(lr,{})]})}function Oo({className:t,...a}){return e.jsx(Ee.List,{"data-slot":"navigation-menu-list",className:l("group flex flex-1 list-none items-center justify-center gap-1",t),...a})}function Bo({className:t,...a}){return e.jsx(Ee.Item,{"data-slot":"navigation-menu-item",className:l("relative",t),...a})}const ir=W.cva("group inline-flex h-9 w-max items-center justify-center rounded-md bg-background px-4 py-2 text-sm font-medium hover:bg-accent hover:text-accent-foreground focus:bg-accent focus:text-accent-foreground disabled:pointer-events-none disabled:opacity-50 data-[state=open]:hover:bg-accent data-[state=open]:text-accent-foreground data-[state=open]:focus:bg-accent data-[state=open]:bg-accent/50 focus-visible:ring-ring/50 outline-none transition-[color,box-shadow] focus-visible:ring-[3px] focus-visible:outline-1");function Uo({className:t,children:a,...r}){return e.jsxs(Ee.Trigger,{"data-slot":"navigation-menu-trigger",className:l(ir(),"group",t),...r,children:[a," ",e.jsx(f.ChevronDownIcon,{className:"relative top-[1px] ml-1 size-3 transition duration-300 group-data-[state=open]:rotate-180","aria-hidden":"true"})]})}function Vo({className:t,...a}){return e.jsx(Ee.Content,{"data-slot":"navigation-menu-content",className:l("data-[motion^=from-]:animate-in data-[motion^=to-]:animate-out data-[motion^=from-]:fade-in data-[motion^=to-]:fade-out data-[motion=from-end]:slide-in-from-right-52 data-[motion=from-start]:slide-in-from-left-52 data-[motion=to-end]:slide-out-to-right-52 data-[motion=to-start]:slide-out-to-left-52 top-0 left-0 w-full p-2 pr-2.5 md:absolute md:w-auto","group-data-[viewport=false]/navigation-menu:bg-popover group-data-[viewport=false]/navigation-menu:text-popover-foreground group-data-[viewport=false]/navigation-menu:data-[state=open]:animate-in group-data-[viewport=false]/navigation-menu:data-[state=closed]:animate-out group-data-[viewport=false]/navigation-menu:data-[state=closed]:zoom-out-95 group-data-[viewport=false]/navigation-menu:data-[state=open]:zoom-in-95 group-data-[viewport=false]/navigation-menu:data-[state=open]:fade-in-0 group-data-[viewport=false]/navigation-menu:data-[state=closed]:fade-out-0 group-data-[viewport=false]/navigation-menu:top-full group-data-[viewport=false]/navigation-menu:mt-1.5 group-data-[viewport=false]/navigation-menu:overflow-hidden group-data-[viewport=false]/navigation-menu:rounded-md group-data-[viewport=false]/navigation-menu:border group-data-[viewport=false]/navigation-menu:shadow group-data-[viewport=false]/navigation-menu:duration-200 **:data-[slot=navigation-menu-link]:focus:ring-0 **:data-[slot=navigation-menu-link]:focus:outline-none",t),...a})}function lr({className:t,...a}){return e.jsx("div",{className:l("absolute top-full left-0 isolate z-50 flex justify-center"),children:e.jsx(Ee.Viewport,{"data-slot":"navigation-menu-viewport",className:l("origin-top-center bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-90 relative mt-1.5 h-[var(--radix-navigation-menu-viewport-height)] w-full overflow-hidden rounded-md border shadow md:w-[var(--radix-navigation-menu-viewport-width)]",t),...a})})}function $o({className:t,...a}){return e.jsx(Ee.Link,{"data-slot":"navigation-menu-link",className:l("data-[active=true]:focus:bg-accent data-[active=true]:hover:bg-accent data-[active=true]:bg-accent/50 data-[active=true]:text-accent-foreground hover:bg-accent hover:text-accent-foreground focus:bg-accent focus:text-accent-foreground focus-visible:ring-ring/50 [&_svg:not([class*='text-'])]:text-muted-foreground flex flex-col gap-1 rounded-sm p-2 text-sm transition-all outline-none focus-visible:ring-[3px] focus-visible:outline-1 [&_svg:not([class*='size-'])]:size-4",t),...a})}function Go({className:t,...a}){return e.jsx(Ee.Indicator,{"data-slot":"navigation-menu-indicator",className:l("data-[state=visible]:animate-in data-[state=hidden]:animate-out data-[state=hidden]:fade-out data-[state=visible]:fade-in top-full z-[1] flex h-1.5 items-end justify-center overflow-hidden",t),...a,children:e.jsx("div",{className:"bg-border relative top-[60%] h-2 w-2 rotate-45 rounded-tl-sm shadow-md"})})}function Q({...t}){return e.jsx(tt.Root,{"data-slot":"popover",...t})}function J({...t}){return e.jsx(tt.Trigger,{"data-slot":"popover-trigger",...t})}function Z({className:t,align:a="center",sideOffset:r=4,...n}){return e.jsx(tt.Portal,{children:e.jsx(tt.Content,{"data-slot":"popover-content",align:a,sideOffset:r,className:l("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-72 origin-(--radix-popover-content-transform-origin) rounded-md border p-4 shadow-md outline-hidden",t),...n})})}function qo({...t}){return e.jsx(tt.Anchor,{"data-slot":"popover-anchor",...t})}function Wo({className:t,...a}){return e.jsx("div",{"data-slot":"popover-header",className:l("flex flex-col gap-1 text-sm",t),...a})}function Ho({className:t,...a}){return e.jsx("div",{"data-slot":"popover-title",className:l("font-medium",t),...a})}function Ko({className:t,...a}){return e.jsx("p",{"data-slot":"popover-description",className:l("text-muted-foreground",t),...a})}function Pt({className:t,value:a,...r}){return e.jsx(pa.Root,{"data-slot":"progress",className:l("bg-primary/20 relative h-2 w-full overflow-hidden rounded-full",t),...r,children:e.jsx(pa.Indicator,{"data-slot":"progress-indicator",className:"bg-primary h-full w-full flex-1 transition-all",style:{transform:`translateX(-${100-(a||0)}%)`}})})}function Xo({className:t,...a}){return e.jsx(Mt.Root,{"data-slot":"radio-group",className:l("grid gap-3",t),...a})}function Yo({className:t,...a}){return e.jsx(Mt.Item,{"data-slot":"radio-group-item",className:l("border-input text-primary focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 aspect-square size-4 shrink-0 rounded-full border shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50",t),...a,children:e.jsx(Mt.Indicator,{"data-slot":"radio-group-indicator",className:"relative flex items-center justify-center",children:e.jsx(f.CircleIcon,{className:"fill-primary absolute top-1/2 left-1/2 size-2 -translate-x-1/2 -translate-y-1/2"})})})}function Qo({className:t,children:a,...r}){return e.jsxs(Ze.Root,{"data-slot":"scroll-area",className:l("relative",t),...r,children:[e.jsx(Ze.Viewport,{"data-slot":"scroll-area-viewport",className:"focus-visible:ring-ring/50 size-full rounded-[inherit] transition-[color,box-shadow] outline-none focus-visible:ring-[3px] focus-visible:outline-1",children:a}),e.jsx(dr,{}),e.jsx(Ze.Corner,{})]})}function dr({className:t,orientation:a="vertical",...r}){return e.jsx(Ze.ScrollAreaScrollbar,{"data-slot":"scroll-area-scrollbar",orientation:a,className:l("flex touch-none p-px transition-colors select-none",a==="vertical"&&"h-full w-2.5 border-l border-l-transparent",a==="horizontal"&&"h-2.5 flex-col border-t border-t-transparent",t),...r,children:e.jsx(Ze.ScrollAreaThumb,{"data-slot":"scroll-area-thumb",className:"bg-border relative flex-1 rounded-full"})})}function cr({...t}){return e.jsx(K.Root,{"data-slot":"select",...t})}function Jo({...t}){return e.jsx(K.Group,{"data-slot":"select-group",...t})}function ur({...t}){return e.jsx(K.Value,{"data-slot":"select-value",...t})}function mr({className:t,size:a="default",children:r,...n}){return e.jsxs(K.Trigger,{"data-slot":"select-trigger","data-size":a,className:l("border-input data-[placeholder]:text-muted-foreground [&_svg:not([class*='text-'])]:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 dark:hover:bg-input/50 flex w-fit items-center justify-between gap-2 rounded-md border bg-transparent px-3 py-2 text-sm whitespace-nowrap shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 data-[size=default]:h-9 data-[size=sm]:h-8 *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-2 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",t),...n,children:[r,e.jsx(K.Icon,{asChild:!0,children:e.jsx(f.ChevronDownIcon,{className:"size-4 opacity-50"})})]})}function xr({className:t,children:a,position:r="item-aligned",align:n="center",...s}){return e.jsx(K.Portal,{children:e.jsxs(K.Content,{"data-slot":"select-content",className:l("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 relative z-50 max-h-(--radix-select-content-available-height) min-w-[8rem] origin-(--radix-select-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border shadow-md",r==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",t),position:r,align:n,...s,children:[e.jsx(gr,{}),e.jsx(K.Viewport,{className:l("p-1",r==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)] scroll-my-1"),children:a}),e.jsx(pr,{})]})})}function Zo({className:t,...a}){return e.jsx(K.Label,{"data-slot":"select-label",className:l("text-muted-foreground px-2 py-1.5 text-xs",t),...a})}function fr({className:t,children:a,...r}){return e.jsxs(K.Item,{"data-slot":"select-item",className:l("focus:bg-accent focus:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground relative flex w-full cursor-default items-center gap-2 rounded-sm py-1.5 pr-8 pl-2 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2",t),...r,children:[e.jsx("span",{"data-slot":"select-item-indicator",className:"absolute right-2 flex size-3.5 items-center justify-center",children:e.jsx(K.ItemIndicator,{children:e.jsx(f.CheckIcon,{className:"size-4"})})}),e.jsx(K.ItemText,{children:a})]})}function ei({className:t,...a}){return e.jsx(K.Separator,{"data-slot":"select-separator",className:l("bg-border pointer-events-none -mx-1 my-1 h-px",t),...a})}function gr({className:t,...a}){return e.jsx(K.ScrollUpButton,{"data-slot":"select-scroll-up-button",className:l("flex cursor-default items-center justify-center py-1",t),...a,children:e.jsx(f.ChevronUpIcon,{className:"size-4"})})}function pr({className:t,...a}){return e.jsx(K.ScrollDownButton,{"data-slot":"select-scroll-down-button",className:l("flex cursor-default items-center justify-center py-1",t),...a,children:e.jsx(f.ChevronDownIcon,{className:"size-4"})})}function Tt({className:t,orientation:a="horizontal",decorative:r=!0,...n}){return e.jsx(Us.Root,{"data-slot":"separator",decorative:r,orientation:a,className:l("bg-border shrink-0 data-[orientation=horizontal]:h-px data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-px",t),...n})}function sa({...t}){return e.jsx(U.Root,{"data-slot":"sheet",...t})}function hr({...t}){return e.jsx(U.Trigger,{"data-slot":"sheet-trigger",...t})}function ti({...t}){return e.jsx(U.Close,{"data-slot":"sheet-close",...t})}function ai({...t}){return e.jsx(U.Portal,{"data-slot":"sheet-portal",...t})}function ri({className:t,...a}){return e.jsx(U.Overlay,{"data-slot":"sheet-overlay",className:l("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50",t),...a})}function oa({className:t,children:a,side:r="right",showCloseButton:n=!0,...s}){return e.jsxs(ai,{children:[e.jsx(ri,{}),e.jsxs(U.Content,{"data-slot":"sheet-content",className:l("bg-background data-[state=open]:animate-in data-[state=closed]:animate-out fixed z-50 flex flex-col gap-4 shadow-lg transition ease-in-out data-[state=closed]:duration-300 data-[state=open]:duration-500",r==="right"&&"data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right inset-y-0 right-0 h-full w-3/4 border-l sm:max-w-sm",r==="left"&&"data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left inset-y-0 left-0 h-full w-3/4 border-r sm:max-w-sm",r==="top"&&"data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top inset-x-0 top-0 h-auto border-b",r==="bottom"&&"data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom inset-x-0 bottom-0 h-auto border-t",t),...s,children:[a,n&&e.jsxs(U.Close,{className:"ring-offset-background focus:ring-ring data-[state=open]:bg-secondary absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none",children:[e.jsx(f.XIcon,{className:"size-4"}),e.jsx("span",{className:"sr-only",children:"Close"})]})]})]})}function br({className:t,...a}){return e.jsx("div",{"data-slot":"sheet-header",className:l("flex flex-col gap-1.5 p-4",t),...a})}function ni({className:t,...a}){return e.jsx("div",{"data-slot":"sheet-footer",className:l("mt-auto flex flex-col gap-2 p-4",t),...a})}function ia({className:t,...a}){return e.jsx(U.Title,{"data-slot":"sheet-title",className:l("text-foreground font-semibold",t),...a})}function vr({className:t,...a}){return e.jsx(U.Description,{"data-slot":"sheet-description",className:l("text-muted-foreground text-sm",t),...a})}const _t=768;function Rt(){const[t,a]=D.useState(void 0);return D.useEffect(()=>{const r=window.matchMedia(`(max-width: ${_t-1}px)`),n=()=>{a(window.innerWidth<_t)};return r.addEventListener("change",n),a(window.innerWidth<_t),()=>r.removeEventListener("change",n)},[]),!!t}function Be({className:t,...a}){return e.jsx("div",{"data-slot":"skeleton",className:l("bg-accent animate-pulse rounded-md",t),...a})}function _e({delayDuration:t=0,...a}){return e.jsx(He.Provider,{"data-slot":"tooltip-provider",delayDuration:t,...a})}function ne({...t}){return e.jsx(He.Root,{"data-slot":"tooltip",...t})}function se({...t}){return e.jsx(He.Trigger,{"data-slot":"tooltip-trigger",...t})}function oe({className:t,sideOffset:a=0,children:r,...n}){return e.jsx(He.Portal,{children:e.jsxs(He.Content,{"data-slot":"tooltip-content",sideOffset:a,className:l("bg-foreground text-background animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-fit origin-(--radix-tooltip-content-transform-origin) rounded-md px-3 py-1.5 text-xs text-balance",t),...n,children:[r,e.jsx(He.Arrow,{className:"bg-foreground fill-foreground z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px]"})]})})}const si="sidebar_state",oi=3600*24*7,ii="16rem",li="18rem",di="3rem",ci="b",jr=D.createContext(null);function nt(){const t=D.useContext(jr);if(!t)throw new Error("useSidebar must be used within a SidebarProvider.");return t}function wr({defaultOpen:t=!0,open:a,onOpenChange:r,className:n,style:s,children:o,...i}){const d=Rt(),[u,c]=D.useState(!1),[x,g]=D.useState(t),w=a??x,N=D.useCallback(S=>{const p=typeof S=="function"?S(w):S;r?r(p):g(p),document.cookie=`${si}=${p}; path=/; max-age=${oi}`},[r,w]),v=D.useCallback(()=>d?c(S=>!S):N(S=>!S),[d,N,c]);D.useEffect(()=>{const S=p=>{p.key===ci&&(p.metaKey||p.ctrlKey)&&(p.preventDefault(),v())};return window.addEventListener("keydown",S),()=>window.removeEventListener("keydown",S)},[v]);const C=w?"expanded":"collapsed",b=D.useMemo(()=>({state:C,open:w,setOpen:N,isMobile:d,openMobile:u,setOpenMobile:c,toggleSidebar:v}),[C,w,N,d,u,c,v]);return e.jsx(jr.Provider,{value:b,children:e.jsx(_e,{delayDuration:0,children:e.jsx("div",{"data-slot":"sidebar-wrapper",style:{"--sidebar-width":ii,"--sidebar-width-icon":di,...s},className:l("group/sidebar-wrapper has-data-[variant=inset]:bg-sidebar flex min-h-svh w-full",n),...i,children:o})})})}function Nr({side:t="left",variant:a="sidebar",collapsible:r="offcanvas",className:n,children:s,...o}){const{isMobile:i,state:d,openMobile:u,setOpenMobile:c}=nt();return r==="none"?e.jsx("div",{"data-slot":"sidebar",className:l("bg-sidebar text-sidebar-foreground flex h-full w-(--sidebar-width) flex-col",n),...o,children:s}):i?e.jsx(sa,{open:u,onOpenChange:c,...o,children:e.jsxs(oa,{"data-sidebar":"sidebar","data-slot":"sidebar","data-mobile":"true",className:"bg-sidebar text-sidebar-foreground w-(--sidebar-width) p-0 [&>button]:hidden",style:{"--sidebar-width":li},side:t,children:[e.jsxs(br,{className:"sr-only",children:[e.jsx(ia,{children:"Sidebar"}),e.jsx(vr,{children:"Displays the mobile sidebar."})]}),e.jsx("div",{className:"flex h-full w-full flex-col",children:s})]})}):e.jsxs("div",{className:"group peer text-sidebar-foreground hidden md:block","data-state":d,"data-collapsible":d==="collapsed"?r:"","data-variant":a,"data-side":t,"data-slot":"sidebar",children:[e.jsx("div",{"data-slot":"sidebar-gap",className:l("relative w-(--sidebar-width) bg-transparent transition-[width] duration-200 ease-linear","group-data-[collapsible=offcanvas]:w-0","group-data-[side=right]:rotate-180",a==="floating"||a==="inset"?"group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4)))]":"group-data-[collapsible=icon]:w-(--sidebar-width-icon)")}),e.jsx("div",{"data-slot":"sidebar-container",className:l("fixed inset-y-0 z-10 hidden h-svh w-(--sidebar-width) transition-[left,right,width] duration-200 ease-linear md:flex",t==="left"?"left-0 group-data-[collapsible=offcanvas]:left-[calc(var(--sidebar-width)*-1)]":"right-0 group-data-[collapsible=offcanvas]:right-[calc(var(--sidebar-width)*-1)]",a==="floating"||a==="inset"?"p-2 group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4))+2px)]":"group-data-[collapsible=icon]:w-(--sidebar-width-icon) group-data-[side=left]:border-r group-data-[side=right]:border-l",n),...o,children:e.jsx("div",{"data-sidebar":"sidebar","data-slot":"sidebar-inner",className:"bg-sidebar group-data-[variant=floating]:border-sidebar-border flex h-full w-full flex-col group-data-[variant=floating]:rounded-lg group-data-[variant=floating]:border group-data-[variant=floating]:shadow-sm",children:s})})]})}function yr({className:t,onClick:a,...r}){const{toggleSidebar:n}=nt();return e.jsxs(T,{"data-sidebar":"trigger","data-slot":"sidebar-trigger",variant:"ghost",size:"icon",className:l("size-7",t),onClick:s=>{a?.(s),n()},...r,children:[e.jsx(f.PanelLeftIcon,{}),e.jsx("span",{className:"sr-only",children:"Toggle Sidebar"})]})}function Cr({className:t,...a}){const{toggleSidebar:r}=nt();return e.jsx("button",{"data-sidebar":"rail","data-slot":"sidebar-rail","aria-label":"Toggle Sidebar",tabIndex:-1,onClick:r,title:"Toggle Sidebar",className:l("hover:after:bg-sidebar-border absolute inset-y-0 z-20 hidden w-4 -translate-x-1/2 transition-all ease-linear group-data-[side=left]:-right-4 group-data-[side=right]:left-0 after:absolute after:inset-y-0 after:left-1/2 after:w-[2px] sm:flex","in-data-[side=left]:cursor-w-resize in-data-[side=right]:cursor-e-resize","[[data-side=left][data-state=collapsed]_&]:cursor-e-resize [[data-side=right][data-state=collapsed]_&]:cursor-w-resize","hover:group-data-[collapsible=offcanvas]:bg-sidebar group-data-[collapsible=offcanvas]:translate-x-0 group-data-[collapsible=offcanvas]:after:left-full","[[data-side=left][data-collapsible=offcanvas]_&]:-right-2","[[data-side=right][data-collapsible=offcanvas]_&]:-left-2",t),...a})}function Sr({className:t,...a}){return e.jsx("main",{"data-slot":"sidebar-inset",className:l("bg-background relative flex w-full flex-1 flex-col","md:peer-data-[variant=inset]:m-2 md:peer-data-[variant=inset]:ml-0 md:peer-data-[variant=inset]:rounded-xl md:peer-data-[variant=inset]:shadow-sm md:peer-data-[variant=inset]:peer-data-[state=collapsed]:ml-2",t),...a})}function ui({className:t,...a}){return e.jsx(H,{"data-slot":"sidebar-input","data-sidebar":"input",className:l("bg-background h-8 w-full shadow-none",t),...a})}function kr({className:t,...a}){return e.jsx("div",{"data-slot":"sidebar-header","data-sidebar":"header",className:l("flex flex-col gap-2 p-2",t),...a})}function Ir({className:t,...a}){return e.jsx("div",{"data-slot":"sidebar-footer","data-sidebar":"footer",className:l("flex flex-col gap-2 p-2",t),...a})}function mi({className:t,...a}){return e.jsx(Tt,{"data-slot":"sidebar-separator","data-sidebar":"separator",className:l("bg-sidebar-border mx-2 w-auto",t),...a})}function Dr({className:t,...a}){return e.jsx("div",{"data-slot":"sidebar-content","data-sidebar":"content",className:l("flex min-h-0 flex-1 flex-col gap-2 overflow-auto group-data-[collapsible=icon]:overflow-hidden",t),...a})}function Ar({className:t,...a}){return e.jsx("div",{"data-slot":"sidebar-group","data-sidebar":"group",className:l("relative flex w-full min-w-0 flex-col p-2",t),...a})}function xi({className:t,asChild:a=!1,...r}){const n=a?De.Root:"div";return e.jsx(n,{"data-slot":"sidebar-group-label","data-sidebar":"group-label",className:l("text-sidebar-foreground/70 ring-sidebar-ring flex h-8 shrink-0 items-center rounded-md px-2 text-xs font-medium outline-hidden transition-[margin,opacity] duration-200 ease-linear focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0","group-data-[collapsible=icon]:-mt-8 group-data-[collapsible=icon]:opacity-0",t),...r})}function fi({className:t,asChild:a=!1,...r}){const n=a?De.Root:"button";return e.jsx(n,{"data-slot":"sidebar-group-action","data-sidebar":"group-action",className:l("text-sidebar-foreground ring-sidebar-ring hover:bg-sidebar-accent hover:text-sidebar-accent-foreground absolute top-3.5 right-3 flex aspect-square w-5 items-center justify-center rounded-md p-0 outline-hidden transition-transform focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0","after:absolute after:-inset-2 md:after:hidden","group-data-[collapsible=icon]:hidden",t),...r})}function gi({className:t,...a}){return e.jsx("div",{"data-slot":"sidebar-group-content","data-sidebar":"group-content",className:l("w-full text-sm",t),...a})}function Pr({className:t,...a}){return e.jsx("ul",{"data-slot":"sidebar-menu","data-sidebar":"menu",className:l("flex w-full min-w-0 flex-col gap-1",t),...a})}function Ot({className:t,...a}){return e.jsx("li",{"data-slot":"sidebar-menu-item","data-sidebar":"menu-item",className:l("group/menu-item relative",t),...a})}const pi=W.cva("peer/menu-button flex w-full items-center gap-2 overflow-hidden rounded-md p-2 text-left text-sm outline-hidden ring-sidebar-ring transition-[width,height,padding] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 active:bg-sidebar-accent active:text-sidebar-accent-foreground disabled:pointer-events-none disabled:opacity-50 group-has-data-[sidebar=menu-action]/menu-item:pr-8 aria-disabled:pointer-events-none aria-disabled:opacity-50 data-[active=true]:bg-sidebar-accent data-[active=true]:font-medium data-[active=true]:text-sidebar-accent-foreground data-[state=open]:hover:bg-sidebar-accent data-[state=open]:hover:text-sidebar-accent-foreground group-data-[collapsible=icon]:size-8! group-data-[collapsible=icon]:p-2! [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0",{variants:{variant:{default:"hover:bg-sidebar-accent hover:text-sidebar-accent-foreground",outline:"bg-background shadow-[0_0_0_1px_hsl(var(--sidebar-border))] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground hover:shadow-[0_0_0_1px_hsl(var(--sidebar-accent))]"},size:{default:"h-8 text-sm",sm:"h-7 text-xs",lg:"h-12 text-sm group-data-[collapsible=icon]:p-0!"}},defaultVariants:{variant:"default",size:"default"}});function Bt({asChild:t=!1,isActive:a=!1,variant:r="default",size:n="default",tooltip:s,className:o,...i}){const d=t?De.Root:"button",{isMobile:u,state:c}=nt(),x=e.jsx(d,{"data-slot":"sidebar-menu-button","data-sidebar":"menu-button","data-size":n,"data-active":a,className:l(pi({variant:r,size:n}),o),...i});return s?(typeof s=="string"&&(s={children:s}),e.jsxs(ne,{children:[e.jsx(se,{asChild:!0,children:x}),e.jsx(oe,{side:"right",align:"center",hidden:c!=="collapsed"||u,...s})]})):x}function hi({className:t,asChild:a=!1,showOnHover:r=!1,...n}){const s=a?De.Root:"button";return e.jsx(s,{"data-slot":"sidebar-menu-action","data-sidebar":"menu-action",className:l("text-sidebar-foreground ring-sidebar-ring hover:bg-sidebar-accent hover:text-sidebar-accent-foreground peer-hover/menu-button:text-sidebar-accent-foreground absolute top-1.5 right-1 flex aspect-square w-5 items-center justify-center rounded-md p-0 outline-hidden transition-transform focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0","after:absolute after:-inset-2 md:after:hidden","peer-data-[size=sm]/menu-button:top-1","peer-data-[size=default]/menu-button:top-1.5","peer-data-[size=lg]/menu-button:top-2.5","group-data-[collapsible=icon]:hidden",r&&"peer-data-[active=true]/menu-button:text-sidebar-accent-foreground group-focus-within/menu-item:opacity-100 group-hover/menu-item:opacity-100 data-[state=open]:opacity-100 md:opacity-0",t),...n})}function bi({className:t,...a}){return e.jsx("div",{"data-slot":"sidebar-menu-badge","data-sidebar":"menu-badge",className:l("text-sidebar-foreground pointer-events-none absolute right-1 flex h-5 min-w-5 items-center justify-center rounded-md px-1 text-xs font-medium tabular-nums select-none","peer-hover/menu-button:text-sidebar-accent-foreground peer-data-[active=true]/menu-button:text-sidebar-accent-foreground","peer-data-[size=sm]/menu-button:top-1","peer-data-[size=default]/menu-button:top-1.5","peer-data-[size=lg]/menu-button:top-2.5","group-data-[collapsible=icon]:hidden",t),...a})}function vi({className:t,showIcon:a=!1,...r}){const n=D.useMemo(()=>`${Math.floor(Math.random()*40)+50}%`,[]);return e.jsxs("div",{"data-slot":"sidebar-menu-skeleton","data-sidebar":"menu-skeleton",className:l("flex h-8 items-center gap-2 rounded-md px-2",t),...r,children:[a&&e.jsx(Be,{className:"size-4 rounded-md","data-sidebar":"menu-skeleton-icon"}),e.jsx(Be,{className:"h-4 max-w-(--skeleton-width) flex-1","data-sidebar":"menu-skeleton-text",style:{"--skeleton-width":n}})]})}function Tr({className:t,...a}){return e.jsx("ul",{"data-slot":"sidebar-menu-sub","data-sidebar":"menu-sub",className:l("border-sidebar-border mx-3.5 flex min-w-0 translate-x-px flex-col gap-1 border-l px-2.5 py-0.5","group-data-[collapsible=icon]:hidden",t),...a})}function Rr({className:t,...a}){return e.jsx("li",{"data-slot":"sidebar-menu-sub-item","data-sidebar":"menu-sub-item",className:l("group/menu-sub-item relative",t),...a})}function _r({asChild:t=!1,size:a="md",isActive:r=!1,className:n,...s}){const o=t?De.Root:"a";return e.jsx(o,{"data-slot":"sidebar-menu-sub-button","data-sidebar":"menu-sub-button","data-size":a,"data-active":r,className:l("text-sidebar-foreground ring-sidebar-ring hover:bg-sidebar-accent hover:text-sidebar-accent-foreground active:bg-sidebar-accent active:text-sidebar-accent-foreground [&>svg]:text-sidebar-accent-foreground flex h-7 min-w-0 -translate-x-px items-center gap-2 overflow-hidden rounded-md px-2 outline-hidden focus-visible:ring-2 disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0","data-[active=true]:bg-sidebar-accent data-[active=true]:text-sidebar-accent-foreground",a==="sm"&&"text-xs",a==="md"&&"text-sm","group-data-[collapsible=icon]:hidden",n),...s})}function ji({className:t,defaultValue:a,value:r,min:n=0,max:s=100,...o}){const i=D.useMemo(()=>Array.isArray(r)?r:Array.isArray(a)?a:[n,s],[r,a,n,s]);return e.jsxs(mt.Root,{"data-slot":"slider",defaultValue:a,value:r,min:n,max:s,className:l("relative flex w-full touch-none items-center select-none data-[disabled]:opacity-50 data-[orientation=vertical]:h-full data-[orientation=vertical]:min-h-44 data-[orientation=vertical]:w-auto data-[orientation=vertical]:flex-col",t),...o,children:[e.jsx(mt.Track,{"data-slot":"slider-track",className:l("bg-muted relative grow overflow-hidden rounded-full data-[orientation=horizontal]:h-1.5 data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-1.5"),children:e.jsx(mt.Range,{"data-slot":"slider-range",className:l("bg-primary absolute data-[orientation=horizontal]:h-full data-[orientation=vertical]:w-full")})}),Array.from({length:i.length},(d,u)=>e.jsx(mt.Thumb,{"data-slot":"slider-thumb",className:"border-primary ring-ring/50 block size-4 shrink-0 rounded-full border bg-white shadow-sm transition-[color,box-shadow] hover:ring-4 focus-visible:ring-4 focus-visible:outline-hidden disabled:pointer-events-none disabled:opacity-50"},u))]})}const zr=D.createContext(void 0),Fr=({children:t})=>{const a=()=>typeof window>"u"?"light":window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light",[r,n]=D.useState(()=>typeof window>"u"?"system":localStorage.getItem("theme")||"system"),[s,o]=D.useState(()=>r==="system"?a():r),i=D.useCallback(u=>{const c=document.documentElement;c.classList.remove("dark","blue-dark");let x;u==="system"?x=a():x=u,x==="dark"&&c.classList.add("dark"),x==="blue-dark"&&c.classList.add("blue-dark"),o(x)},[]);D.useEffect(()=>{i(r),localStorage.setItem("theme",r)},[r,i]),D.useEffect(()=>{if(r!=="system")return;const u=window.matchMedia("(prefers-color-scheme: dark)"),c=()=>{i("system")};return u.addEventListener("change",c),()=>u.removeEventListener("change",c)},[r,i]);const d=D.useMemo(()=>({theme:r,setTheme:n,resolvedTheme:s}),[r,s]);return e.jsx(zr.Provider,{value:d,children:t})},Mr=()=>{const t=D.useContext(zr);if(!t)throw new Error("useTheme must be used within ThemeProvider");return t},wi=({...t})=>{const{theme:a="system"}=Mr();return e.jsx(Ca.Toaster,{theme:a,className:"toaster group",icons:{success:e.jsx(f.CircleCheckIcon,{className:"size-4"}),info:e.jsx(f.InfoIcon,{className:"size-4"}),warning:e.jsx(f.TriangleAlertIcon,{className:"size-4"}),error:e.jsx(f.OctagonXIcon,{className:"size-4"}),loading:e.jsx(f.Loader2Icon,{className:"size-4 animate-spin"})},style:{"--normal-bg":"var(--popover)","--normal-text":"var(--popover-foreground)","--normal-border":"var(--border)","--border-radius":"var(--radius)"},...t})};function Ni({className:t,size:a="default",...r}){return e.jsx(ha.Root,{"data-slot":"switch","data-size":a,className:l("peer data-[state=checked]:bg-primary data-[state=unchecked]:bg-input focus-visible:border-ring focus-visible:ring-ring/50 dark:data-[state=unchecked]:bg-input/80 group/switch inline-flex shrink-0 items-center rounded-full border border-transparent shadow-xs transition-all outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 data-[size=default]:h-[1.15rem] data-[size=default]:w-8 data-[size=sm]:h-3.5 data-[size=sm]:w-6",t),...r,children:e.jsx(ha.Thumb,{"data-slot":"switch-thumb",className:l("bg-background dark:data-[state=unchecked]:bg-foreground dark:data-[state=checked]:bg-primary-foreground pointer-events-none block rounded-full ring-0 transition-transform group-data-[size=default]/switch:size-4 group-data-[size=sm]/switch:size-3 data-[state=checked]:translate-x-[calc(100%-2px)] data-[state=unchecked]:translate-x-0")})})}function Er({className:t,...a}){return e.jsx("div",{"data-slot":"table-container",className:"relative w-full overflow-x-auto",children:e.jsx("table",{"data-slot":"table",className:l("w-full caption-bottom text-sm",t),...a})})}function Lr({className:t,...a}){return e.jsx("thead",{"data-slot":"table-header",className:l("[&_tr]:border-b",t),...a})}function Or({className:t,...a}){return e.jsx("tbody",{"data-slot":"table-body",className:l("[&_tr:last-child]:border-0",t),...a})}function Br({className:t,...a}){return e.jsx("tfoot",{"data-slot":"table-footer",className:l("bg-muted/50 border-t font-medium [&>tr]:last:border-b-0",t),...a})}function qe({className:t,...a}){return e.jsx("tr",{"data-slot":"table-row",className:l("hover:bg-muted/50 data-[state=selected]:bg-muted border-b transition-colors",t),...a})}function Ut({className:t,...a}){return e.jsx("th",{"data-slot":"table-head",className:l("text-foreground h-10 px-2 text-left align-middle font-medium whitespace-nowrap [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",t),...a})}function Ye({className:t,...a}){return e.jsx("td",{"data-slot":"table-cell",className:l("p-2 align-middle whitespace-nowrap [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",t),...a})}function yi({className:t,...a}){return e.jsx("caption",{"data-slot":"table-caption",className:l("text-muted-foreground mt-4 text-sm",t),...a})}function Ur({className:t,orientation:a="horizontal",...r}){return e.jsx(Ct.Root,{"data-slot":"tabs","data-orientation":a,orientation:a,className:l("group/tabs flex gap-2 data-[orientation=horizontal]:flex-col",t),...r})}const Vr=W.cva("rounded-lg p-[3px] group-data-[orientation=horizontal]/tabs:h-9 data-[variant=line]:rounded-none group/tabs-list text-muted-foreground inline-flex w-fit items-center justify-center group-data-[orientation=vertical]/tabs:h-fit group-data-[orientation=vertical]/tabs:flex-col",{variants:{variant:{default:"bg-muted",line:"gap-1 bg-transparent"}},defaultVariants:{variant:"default"}});function $r({className:t,variant:a="default",...r}){return e.jsx(Ct.List,{"data-slot":"tabs-list","data-variant":a,className:l(Vr({variant:a}),t),...r})}function Gr({className:t,...a}){return e.jsx(Ct.Trigger,{"data-slot":"tabs-trigger",className:l("focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:outline-ring text-foreground/60 hover:text-foreground dark:text-muted-foreground dark:hover:text-foreground relative inline-flex h-[calc(100%-1px)] flex-1 items-center justify-center gap-1.5 rounded-md border border-transparent px-2 py-1 text-sm font-medium whitespace-nowrap transition-all group-data-[orientation=vertical]/tabs:w-full group-data-[orientation=vertical]/tabs:justify-start focus-visible:ring-[3px] focus-visible:outline-1 disabled:pointer-events-none disabled:opacity-50 group-data-[variant=default]/tabs-list:data-[state=active]:shadow-sm group-data-[variant=line]/tabs-list:data-[state=active]:shadow-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4","group-data-[variant=line]/tabs-list:bg-transparent group-data-[variant=line]/tabs-list:data-[state=active]:bg-transparent dark:group-data-[variant=line]/tabs-list:data-[state=active]:border-transparent dark:group-data-[variant=line]/tabs-list:data-[state=active]:bg-transparent","data-[state=active]:bg-background dark:data-[state=active]:text-foreground dark:data-[state=active]:border-input dark:data-[state=active]:bg-input/30 data-[state=active]:text-foreground","after:bg-foreground after:absolute after:opacity-0 after:transition-opacity group-data-[orientation=horizontal]/tabs:after:inset-x-0 group-data-[orientation=horizontal]/tabs:after:bottom-[-5px] group-data-[orientation=horizontal]/tabs:after:h-0.5 group-data-[orientation=vertical]/tabs:after:inset-y-0 group-data-[orientation=vertical]/tabs:after:-right-1 group-data-[orientation=vertical]/tabs:after:w-0.5 group-data-[variant=line]/tabs-list:data-[state=active]:after:opacity-100",t),...a})}function Vt({className:t,...a}){return e.jsx(Ct.Content,{"data-slot":"tabs-content",className:l("flex-1 outline-none",t),...a})}function qr({className:t,...a}){return e.jsx("textarea",{"data-slot":"textarea",className:l("border-input placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 flex field-sizing-content min-h-16 w-full rounded-md border bg-transparent px-3 py-2 text-base shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",t),...a})}function $t({...t}){return e.jsx(Os.Root,{"data-slot":"aspect-ratio",...t})}function Wr({...t}){return e.jsx("nav",{"aria-label":"breadcrumb","data-slot":"breadcrumb",...t})}function Hr({className:t,...a}){return e.jsx("ol",{"data-slot":"breadcrumb-list",className:l("text-muted-foreground flex flex-wrap items-center gap-1.5 text-sm break-words sm:gap-2.5",t),...a})}function We({className:t,...a}){return e.jsx("li",{"data-slot":"breadcrumb-item",className:l("inline-flex items-center gap-1.5",t),...a})}function Gt({asChild:t,className:a,...r}){const n=t?De.Root:"a";return e.jsx(n,{"data-slot":"breadcrumb-link",className:l("hover:text-foreground transition-colors",a),...r})}function Qe({className:t,...a}){return e.jsx("span",{"data-slot":"breadcrumb-page",role:"link","aria-disabled":"true","aria-current":"page",className:l("text-foreground font-normal",t),...a})}function bt({children:t,className:a,...r}){return e.jsx("li",{"data-slot":"breadcrumb-separator",role:"presentation","aria-hidden":"true",className:l("[&>svg]:size-3.5",a),...r,children:t??e.jsx(f.ChevronRight,{})})}function qt({className:t,...a}){return e.jsxs("span",{"data-slot":"breadcrumb-ellipsis",role:"presentation","aria-hidden":"true",className:l("flex size-9 items-center justify-center",t),...a,children:[e.jsx(f.MoreHorizontal,{className:"size-4"}),e.jsx("span",{className:"sr-only",children:"More"})]})}function Kr({...t}){return e.jsx(xo,{"data-slot":"collapsible",...t})}function Xr({...t}){return e.jsx(_a,{"data-slot":"collapsible-trigger",...t})}function Yr({...t}){return e.jsx(za,{"data-slot":"collapsible-content",...t})}function Qr({...t}){return e.jsx(Me.Drawer.Root,{"data-slot":"drawer",...t})}function Jr({...t}){return e.jsx(Me.Drawer.Trigger,{"data-slot":"drawer-trigger",...t})}function Zr({...t}){return e.jsx(Me.Drawer.Portal,{"data-slot":"drawer-portal",...t})}function en({...t}){return e.jsx(Me.Drawer.Close,{"data-slot":"drawer-close",...t})}function tn({className:t,...a}){return e.jsx(Me.Drawer.Overlay,{"data-slot":"drawer-overlay",className:l("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50",t),...a})}function an({className:t,children:a,...r}){return e.jsxs(Zr,{"data-slot":"drawer-portal",children:[e.jsx(tn,{}),e.jsxs(Me.Drawer.Content,{"data-slot":"drawer-content",className:l("group/drawer-content bg-background fixed z-50 flex h-auto flex-col","data-[vaul-drawer-direction=top]:inset-x-0 data-[vaul-drawer-direction=top]:top-0 data-[vaul-drawer-direction=top]:mb-24 data-[vaul-drawer-direction=top]:max-h-[80vh] data-[vaul-drawer-direction=top]:rounded-b-lg data-[vaul-drawer-direction=top]:border-b","data-[vaul-drawer-direction=bottom]:inset-x-0 data-[vaul-drawer-direction=bottom]:bottom-0 data-[vaul-drawer-direction=bottom]:mt-24 data-[vaul-drawer-direction=bottom]:max-h-[80vh] data-[vaul-drawer-direction=bottom]:rounded-t-lg data-[vaul-drawer-direction=bottom]:border-t","data-[vaul-drawer-direction=right]:inset-y-0 data-[vaul-drawer-direction=right]:right-0 data-[vaul-drawer-direction=right]:w-3/4 data-[vaul-drawer-direction=right]:border-l data-[vaul-drawer-direction=right]:sm:max-w-sm","data-[vaul-drawer-direction=left]:inset-y-0 data-[vaul-drawer-direction=left]:left-0 data-[vaul-drawer-direction=left]:w-3/4 data-[vaul-drawer-direction=left]:border-r data-[vaul-drawer-direction=left]:sm:max-w-sm",t),...r,children:[e.jsx("div",{className:"bg-muted mx-auto mt-4 hidden h-2 w-[100px] shrink-0 rounded-full group-data-[vaul-drawer-direction=bottom]/drawer-content:block"}),a]})]})}function rn({className:t,...a}){return e.jsx("div",{"data-slot":"drawer-header",className:l("flex flex-col gap-0.5 p-4 group-data-[vaul-drawer-direction=bottom]/drawer-content:text-center group-data-[vaul-drawer-direction=top]/drawer-content:text-center md:gap-1.5 md:text-left",t),...a})}function nn({className:t,...a}){return e.jsx("div",{"data-slot":"drawer-footer",className:l("mt-auto flex flex-col gap-2 p-4",t),...a})}function sn({className:t,...a}){return e.jsx(Me.Drawer.Title,{"data-slot":"drawer-title",className:l("text-foreground font-semibold",t),...a})}function on({className:t,...a}){return e.jsx(Me.Drawer.Description,{"data-slot":"drawer-description",className:l("text-muted-foreground text-sm",t),...a})}const ln=Ke.FormProvider,dn=D.createContext({}),xe=({...t})=>e.jsx(dn.Provider,{value:{name:t.name},children:e.jsx(Ke.Controller,{...t})}),st=()=>{const t=D.useContext(dn),a=D.useContext(cn),{getFieldState:r}=Ke.useFormContext(),n=Ke.useFormState({name:t.name}),s=r(t.name,n);if(!t)throw new Error("useFormField should be used within <FormField>");const{id:o}=a;return{id:o,name:t.name,formItemId:`${o}-form-item`,formDescriptionId:`${o}-form-item-description`,formMessageId:`${o}-form-item-message`,...s}},cn=D.createContext({});function fe({className:t,...a}){const r=D.useId();return e.jsx(cn.Provider,{value:{id:r},children:e.jsx("div",{"data-slot":"form-item",className:l("grid gap-2",t),...a})})}function Ne({className:t,...a}){const{error:r,formItemId:n}=st();return e.jsx(Se,{"data-slot":"form-label","data-error":!!r,className:l("data-[error=true]:text-destructive",t),htmlFor:n,...a})}function ge({...t}){const{error:a,formItemId:r,formDescriptionId:n,formMessageId:s}=st();return e.jsx(De.Root,{"data-slot":"form-control",id:r,"aria-describedby":a?`${n} ${s}`:`${n}`,"aria-invalid":!!a,...t})}function ye({className:t,...a}){const{formDescriptionId:r}=st();return e.jsx("p",{"data-slot":"form-description",id:r,className:l("text-muted-foreground text-sm",t),...a})}function pe({className:t,...a}){const{error:r,formMessageId:n}=st(),s=r?String(r?.message??""):a.children;return s?e.jsx("p",{"data-slot":"form-message",id:n,className:l("text-destructive text-sm",t),...a,children:s}):null}function un({className:t,containerClassName:a,...r}){return e.jsx(Sa.OTPInput,{"data-slot":"input-otp",containerClassName:l("flex items-center gap-2 has-disabled:opacity-50",a),className:l("disabled:cursor-not-allowed",t),...r})}function mn({className:t,...a}){return e.jsx("div",{"data-slot":"input-otp-group",className:l("flex items-center",t),...a})}function Je({index:t,className:a,...r}){const n=D.useContext(Sa.OTPInputContext),{char:s,hasFakeCaret:o,isActive:i}=n?.slots[t]??{};return e.jsxs("div",{"data-slot":"input-otp-slot","data-active":i,className:l("data-[active=true]:border-ring data-[active=true]:ring-ring/50 data-[active=true]:aria-invalid:ring-destructive/20 dark:data-[active=true]:aria-invalid:ring-destructive/40 aria-invalid:border-destructive data-[active=true]:aria-invalid:border-destructive dark:bg-input/30 border-input relative flex h-9 w-9 items-center justify-center border-y border-r text-sm shadow-xs transition-all outline-none first:rounded-l-md first:border-l last:rounded-r-md data-[active=true]:z-10 data-[active=true]:ring-[3px]",a),...r,children:[s,o&&e.jsx("div",{className:"pointer-events-none absolute inset-0 flex items-center justify-center",children:e.jsx("div",{className:"animate-caret-blink bg-foreground h-4 w-px duration-1000"})})]})}function Ci({...t}){return e.jsx("div",{"data-slot":"input-otp-separator",role:"separator",...t,children:e.jsx(f.MinusIcon,{})})}const la=W.cva("inline-flex items-center justify-center gap-2 rounded-md text-sm font-medium hover:bg-muted hover:text-muted-foreground disabled:pointer-events-none disabled:opacity-50 data-[state=on]:bg-accent data-[state=on]:text-accent-foreground [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 [&_svg]:shrink-0 focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] outline-none transition-[color,box-shadow] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive whitespace-nowrap",{variants:{variant:{default:"bg-transparent",outline:"border border-input bg-transparent shadow-xs hover:bg-accent hover:text-accent-foreground"},size:{default:"h-9 px-2 min-w-9",sm:"h-8 px-1.5 min-w-8",lg:"h-10 px-2.5 min-w-10"}},defaultVariants:{variant:"default",size:"default"}});function Si({className:t,variant:a,size:r,...n}){return e.jsx(Vs.Root,{"data-slot":"toggle",className:l(la({variant:a,size:r,className:t})),...n})}const xn=D.createContext({size:"default",variant:"default",spacing:0});function Oe({className:t,variant:a,size:r,spacing:n=0,children:s,...o}){return e.jsx(Da.Root,{"data-slot":"toggle-group","data-variant":a,"data-size":r,"data-spacing":n,style:{"--gap":n},className:l("group/toggle-group flex w-fit items-center gap-[--spacing(var(--gap))] rounded-md data-[spacing=default]:data-[variant=outline]:shadow-xs",t),...o,children:e.jsx(xn.Provider,{value:{variant:a,size:r,spacing:n},children:s})})}function V({className:t,children:a,variant:r,size:n,...s}){const o=D.useContext(xn);return e.jsx(Da.Item,{"data-slot":"toggle-group-item","data-variant":o.variant||r,"data-size":o.size||n,"data-spacing":o.spacing,className:l(la({variant:o.variant||r,size:o.size||n}),"w-auto min-w-0 shrink-0 px-3 focus:z-10 focus-visible:z-10","data-[spacing=0]:rounded-none data-[spacing=0]:shadow-none data-[spacing=0]:first:rounded-l-md data-[spacing=0]:last:rounded-r-md data-[spacing=0]:data-[variant=outline]:border-l-0 data-[spacing=0]:data-[variant=outline]:first:border-l",t),...s,children:a})}function ze({tooltipContent:t,children:a}){return e.jsx(_e,{children:e.jsxs(ne,{children:[e.jsx(se,{asChild:!0,children:a}),e.jsx(oe,{children:t})]})})}function ot({children:t,variant:a,asChild:r=!1,size:n,...s}){return e.jsx(T,{variant:a,size:n,...s,asChild:r,children:t})}function ki({children:t,variant:a,asChild:r=!1,size:n,tooltipContent:s,...o}){return e.jsx(ze,{tooltipContent:s,children:e.jsx(ot,{variant:a,size:n,...o,asChild:r,children:t})})}function it({children:t,variant:a,asChild:r=!1,size:n,...s}){return e.jsx(T,{variant:a||"outline",size:n||"sm",...s,asChild:r,children:t})}function fn({children:t,variant:a,size:r,asChild:n=!1,tooltipContent:s,...o}){return e.jsx(ze,{tooltipContent:s,children:e.jsx(it,{variant:a,size:r,...o,asChild:n,children:t})})}function gn({children:t,variant:a,size:r,asChild:n=!1,...s}){return e.jsx(T,{variant:a||"outline",size:r||"icon",...s,asChild:n,children:t})}function Re({children:t,tooltipContent:a,asChild:r=!1,variant:n,size:s,...o}){return e.jsx(ze,{tooltipContent:a,children:e.jsx(gn,{variant:n,size:s,...o,asChild:r,children:t})})}function Wt({actionMenus:t,extraActionParams:a}){const r=n=>(n=n.filter(s=>s?.visibility===void 0||s.visibility===!0||s.visibility&&s.visibility(...a?.arguments||[])),n.length===0?e.jsx(ue,{className:"text-center",children:"No action available."}):n.map((s,o)=>{if(s.type==="label")return e.jsx(At,{children:String(s.label)},o);if(s.type==="separator")return e.jsx(rt,{},o);if(s.type==="group"&&s.items)return e.jsx(na,{children:r(s.items)},o);if(s.items)return e.jsxs(nr,{children:[e.jsx(sr,{children:String(s.label)}),e.jsx(rr,{children:e.jsx(or,{children:r(s.items)})})]},o);let i="";return typeof s.label=="function"?i=s.label(...a?.arguments||[]):i=s.label,e.jsxs(ue,{disabled:s.disabled,onClick:()=>s.onClick&&s.onClick(...a?.arguments||[]),children:[s.icon&&e.jsx(s.icon,{}),i]},o)}));return e.jsxs(ve,{children:[e.jsx(je,{asChild:!0,children:e.jsx(Re,{variant:"ghost",tooltipContent:"Actions",className:"h-8 w-8 p-0 border-0 bg-transparent text-foreground keross:text-white elevation-0 shadow-none hover:bg-transparent",children:e.jsx(f.MoreHorizontal,{})})}),e.jsx(we,{className:"w-56",align:"end",children:r(t)})]})}const pn=({title:t,description:a,fontSize:r="text-base",cancelText:n="",confirmText:s="",thirdOptionText:o="",onCancel:i,onConfirm:d,onThird:u})=>e.jsx(Fa,{open:!0,children:e.jsxs(La,{children:[e.jsxs(Oa,{children:[e.jsx(Ua,{className:r,children:t}),e.jsx(Va,{className:r,children:a})]}),e.jsxs(Ba,{children:[n!=""&&e.jsx($a,{onClick:()=>{i&&i()},children:n}),o!=""&&e.jsx(Lt,{className:"bg-blue-500",color:"black",onClick:()=>{u&&u()},children:o}),s!=""&&e.jsx(Lt,{onClick:()=>{d&&d()},children:s})]})]})}),hn=m.createContext(void 0),Ii=()=>{const t=m.useContext(hn);if(!t)throw new Error("useDialog must be used within a DialogProvider");return t},bn=({children:t})=>{const[a,r]=m.useState(null),n=o=>r(o),s=()=>r(null);return e.jsxs(hn.Provider,{value:{openDialog:n,closeDialog:s},children:[t,a&&e.jsx(pn,{title:a.title,description:a.description,fontSize:a.fontSize||"text-base",cancelText:a.cancelText||"",confirmText:a.confirmText||"",thirdOptionText:a.thirdOptionText||"",onConfirm:()=>{a.onConfirm&&a.onConfirm(),s()},onCancel:()=>{a.onCancel&&a.onCancel(),s()},onThird:()=>{a.onThird&&a.onThird(),s()}})]})};function Di({placeholder:t,items:a,disabled:r,onSelect:n,defaultValue:s}){const[o,i]=m.useState(s??"");return e.jsxs(Q,{children:[e.jsx(J,{asChild:!0,className:"w-full",children:e.jsxs(T,{variant:"outline",role:"combobox",className:l("justify-between",!o&&"text-muted-foreground","bg-secondary"),disabled:r===!0||typeof r=="function"&&r(),children:[o?a.find(d=>d.value===o)?.label||o:t,e.jsx(f.ChevronsUpDown,{className:"opacity-50"})]})}),e.jsx(Z,{className:"p-0",align:"start",children:e.jsxs(Y,{children:[e.jsx(ie,{placeholder:"Search..."}),e.jsxs(le,{children:[e.jsx(de,{children:"No items found."}),e.jsx(re,{children:a.map(d=>e.jsxs(X,{value:d.value,disabled:d.disabled===!0||typeof d.disabled=="function"&&d.disabled(d),onSelect:u=>{const c=a.find(x=>x.value.toLowerCase()===u.toLowerCase())?.value??u;i(c),n?.(c)},children:[d?.label||d.value,e.jsx(f.Check,{className:l("ml-auto",d.value===o?"opacity-100":"opacity-0")})]},d.value))})]})]})})]})}const ke=t=>t?.columnDef?.title||t?.columnDef?.header&&typeof t.columnDef.header=="string"&&t?.columnDef?.header||t.id;function vn({table:t}){return e.jsxs(Q,{children:[e.jsx(ze,{tooltipContent:"Column View",children:e.jsx(J,{asChild:!0,children:e.jsxs(it,{children:[e.jsx(f.Settings2,{}),"View"]})})}),e.jsx(Z,{className:"w-[220px] p-0",align:"end",children:e.jsxs(Y,{children:[e.jsx(ie,{placeholder:"Search..."}),e.jsxs(le,{children:[e.jsx(de,{children:"No results found."}),e.jsx(re,{children:t.getAllColumns().filter(a=>typeof a.accessorFn<"u"&&a.getCanHide()).map(a=>{const r=a.getIsVisible();return e.jsxs(X,{onSelect:()=>{a.toggleVisibility(!r)},disabled:a.getIsGrouped(),children:[e.jsx("div",{className:l("mr-2 flex h-4 w-4 items-center justify-center rounded-sm border border-black dark:border-white",r?"bg-black dark:bg-white text-white dark:text-black":"opacity-50 [&_svg]:invisible"),children:e.jsx(f.Check,{})}),e.jsx("span",{className:"overflow-hidden text-ellipsis",title:ke(a),children:ke(a)})]},a.id)})})]})]})})]})}function jn({column:t}){const a=t?.getFacetedUniqueValues(),r=new Set(t?.getFilterValue()),n=D.useMemo(()=>Array.from(t.getFacetedUniqueValues().keys()).sort().slice(0,5e3),[t.getFacetedUniqueValues()]);return e.jsxs(Q,{children:[e.jsx(J,{asChild:!0,children:e.jsxs(fn,{variant:"dashed",tooltipContent:ke(t),children:[r?.size>0?e.jsx(f.X,{}):e.jsx(f.Plus,{}),ke(t),r?.size>0&&e.jsxs(e.Fragment,{children:[e.jsx(Tt,{orientation:"vertical",className:"mx-2 h-4"}),e.jsx(ht,{variant:"secondary",className:"rounded-sm px-1 font-normal lg:hidden",children:r.size}),e.jsx("div",{className:"hidden space-x-1 lg:flex",children:r.size>2?e.jsxs(ht,{variant:"secondary",className:"rounded-sm px-1 font-normal",children:[r.size," selected"]}):n.filter(s=>r.has(s)).map(s=>e.jsx(ht,{variant:"secondary",className:"rounded-sm px-1 font-normal",children:s},s))})]})]})}),e.jsx(Z,{className:"max-w-[250px] p-0",align:"start",children:e.jsxs(Y,{children:[e.jsx(ie,{placeholder:ke(t)}),e.jsxs(le,{children:[e.jsx(de,{children:"No results found."}),e.jsx(re,{children:n.map(s=>{const o=r.has(s);return e.jsxs(X,{onSelect:()=>{o?r.delete(s):r.add(s);const i=Array.from(r);t?.setFilterValue(i.length?i:void 0)},children:[e.jsx("div",{className:l("mr-2 flex h-4 w-4 items-center justify-center rounded-sm border border-black dark:border-white",o?"bg-black dark:bg-white text-white dark:text-black":"opacity-50 [&_svg]:invisible"),children:e.jsx(f.Check,{})}),e.jsx("span",{className:"overflow-hidden text-ellipsis",title:s,children:s}),a?.get(s)&&e.jsx("span",{className:"ml-auto flex h-4 w-4 items-center justify-center font-mono text-xs",children:a.get(s)})]},s)})})]}),r.size>0&&e.jsxs(e.Fragment,{children:[e.jsx(ar,{}),e.jsx(re,{children:e.jsx(X,{onSelect:()=>t?.setFilterValue(void 0),className:"justify-center text-center",children:"Clear filters"})})]})]})})]})}function wn({table:t}){const[a,r]=m.useState([]);return e.jsxs("div",{className:"flex-grow flex gap-3 items-center overflow-hidden",children:[e.jsxs(Q,{children:[e.jsx(ze,{tooltipContent:"Filter",children:e.jsx(J,{asChild:!0,children:e.jsxs(it,{children:[e.jsx(f.Filter,{}),"Filter"]})})}),e.jsx(Z,{className:"w-[220px] p-0",align:"start",children:e.jsxs(Y,{children:[e.jsx(ie,{placeholder:"Search..."}),e.jsxs(le,{children:[e.jsx(de,{children:"No results found."}),e.jsx(re,{children:t.getAllColumns().filter(n=>typeof n.accessorFn<"u"&&n.getCanHide()).map(n=>{const s=new Set(a),o=s.has(n.id);return e.jsxs(X,{onSelect:()=>{o?s.delete(n.id):s.add(n.id),r([...s])},children:[e.jsx("div",{className:l("mr-2 flex h-4 w-4 items-center justify-center rounded-sm border border-black dark:border-white",o?"bg-black dark:bg-white text-white dark:text-black":"opacity-50 [&_svg]:invisible"),children:e.jsx(f.Check,{})}),e.jsx("span",{className:"overflow-hidden text-ellipsis",title:ke(n),children:ke(n)})]},n.id)})})]})]})})]}),e.jsx("div",{className:"flex-grow flex gap-3 items-center overflow-auto",children:a.map(n=>{const s=t.getColumn(n);if(s)return e.jsx(jn,{column:s},n)})})]})}const Nn=async t=>new Promise((a,r)=>{const n=new FileReader;n.onload=()=>{const o=n.result.split(",")[1];a({message:"File processed successfully",fileName:t.name,size:t.size,type:t.type,lastModified:t.lastModified,base64:o})},n.onerror=()=>r(n.error),n.readAsDataURL(t)});function Ai(t){const a=atob(t.base64),r=new Array(a.length).fill(0).map((o,i)=>a.charCodeAt(i)),n=new Uint8Array(r),s=new Blob([n],{type:t.type});return URL.createObjectURL(s)}function Pi({label:t="Upload File",isDrag:a=!1,onFileSelect:r}){const[n,s]=m.useState(!1),o=async x=>{if(!x)return;const g=await Nn(x);await r(g)},i=x=>{if(!a)return;x.preventDefault(),s(!1);const g=x.dataTransfer.files?.[0];g&&o(g)},d=x=>{a&&(x.preventDefault(),s(!0))},u=()=>{a&&s(!1)},c=x=>{const g=x.target.files?.[0];g&&o(g)};return e.jsxs("div",{className:"flex flex-col gap-2 w-full",children:[e.jsx("label",{className:"text-sm font-medium",children:t}),e.jsx("input",{type:"file",id:"fileInput",className:"hidden",onChange:c}),a?e.jsx("div",{className:`border-2 border-dashed rounded-lg p-6 text-center cursor-pointer transition
2
2
  ${n?"border-blue-600 bg-blue-50":"border-gray-300"}
3
- `,onDragOver:c,onDragLeave:d,onDrop:l,onClick:()=>document.getElementById("fileInput")?.click(),children:e.jsxs("div",{className:"flex flex-col items-center gap-3",children:[e.jsx(g.UploadCloud,{className:"w-10 h-10 text-blue-600"}),e.jsxs("p",{className:"text-gray-600",children:["Drag & drop your file here or"," ",e.jsx("span",{className:"text-blue-600 underline",children:"browse"})]})]})}):e.jsxs("div",{className:"border rounded-lg p-4 flex flex-col items-center gap-2 cursor-pointer text-center",onClick:()=>document.getElementById("fileInput")?.click(),children:[e.jsx(g.FileUp,{className:"w-8 h-8 text-blue-600"}),e.jsx("span",{className:"text-blue-600 underline",children:"Browse File"})]})]})}const wi=[15,20,30,40,50,100];function xn({table:t,extraParams:a}){return e.jsxs("div",{className:"flex flex-col md:flex-row items-start md:items-center justify-between ",children:[e.jsx("small",{className:"flex-1 px-2 text-gray-600 dark:text-gray-400",children:(a?.numberOfRows==null||a?.numberOfRows)&&a?.checkBoxColumn?e.jsxs(e.Fragment,{children:[t.getFilteredSelectedRowModel().rows.length," of"," ",t.getFilteredRowModel().rows.length," row(s) selected."]}):e.jsxs(e.Fragment,{children:["Total ",t.getFilteredRowModel().rows.length," no(s) of rows."]})}),(a?.pagination==null||a.pagination)&&e.jsxs("div",{className:"flex items-start md:items-center gap-3 flex-col md:flex-row ",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("small",{className:"text-gray-600 dark:text-gray-400",children:"Rows per page"}),(a?.rowsPerPage==null||a.rowsPerPage)&&e.jsxs(tr,{value:`${t.getState().pagination.pageSize}`,onValueChange:r=>{t.setPageSize(Number(r))},children:[e.jsx(rr,{className:"w-[70px] h-8",children:e.jsx(ar,{placeholder:t.getState().pagination.pageSize})}),e.jsx(nr,{side:"top",children:(a?.pageSizeArray||wi).map(r=>e.jsx(sr,{value:`${r}`,children:r},r))})]})]}),e.jsxs(e.Fragment,{children:[e.jsxs("small",{className:"flex w-[100px] items-center justify-center text-gray-600 dark:text-gray-400",children:["Page ",t.getState().pagination.pageIndex+1," of"," ",t.getPageCount()]}),e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(Ne,{tooltipContent:"Go to first page",size:"icon-sm",className:"dark:bg-accent dark:text-accent-foreground keross:bg-card keross:text-foreground",onClick:()=>t.setPageIndex(0),disabled:!t.getCanPreviousPage(),children:e.jsx(g.ChevronsLeft,{})}),e.jsx(Ne,{tooltipContent:"Go to previous page",size:"icon-sm",className:"dark:bg-accent dark:text-accent-foreground keross:bg-card keross:text-foreground",onClick:()=>t.previousPage(),disabled:!t.getCanPreviousPage(),children:e.jsx(g.ChevronLeft,{})}),e.jsx(Ne,{tooltipContent:"Go to next page",size:"icon-sm",className:"dark:bg-accent dark:text-accent-foreground keross:bg-card keross:text-foreground",onClick:()=>t.nextPage(),disabled:!t.getCanNextPage(),children:e.jsx(g.ChevronRight,{})}),e.jsx(Ne,{tooltipContent:"Go to last page",size:"icon-sm",className:"dark:bg-accent dark:text-accent-foreground keross:bg-card keross:text-foreground",onClick:()=>t.setPageIndex(t.getPageCount()-1),disabled:!t.getCanNextPage(),children:e.jsx(g.ChevronsRight,{})})]})]})]})]})}function pn({className:t,...a}){return e.jsxs("div",{className:"relative w-auto flex items-center",children:[e.jsx(g.Search,{className:"absolute left-2 mr-2 h-4 w-4 shrink-0 opacity-50"}),e.jsx($,{className:G.cx("pl-8 h-8",t),...a})]})}function gn({table:t,extraParams:a}){return e.jsxs("div",{className:"flex items-center justify-between gap-3",children:[e.jsxs("div",{className:"flex-grow flex items-center justify-between gap-3 overflow-hidden",children:[(a?.defaultTools==null||a?.defaultTools==!0||Array.isArray(a?.defaultTools)&&a?.defaultTools?.includes("search"))&&e.jsx(pn,{placeholder:"Search ...",onChange:r=>t.setGlobalFilter(r.target.value),className:"max-w-sm"}),(a?.defaultTools==null||a?.defaultTools==!0||Array.isArray(a?.defaultTools)&&a?.defaultTools?.includes("filter"))&&e.jsx(mn,{table:t})]}),e.jsxs("div",{className:"flex gap-3",children:[a?.extraTools?.map((r,n)=>e.jsx(m.Fragment,{children:r},n)),(a?.defaultTools==null||a?.defaultTools==!0||Array.isArray(a?.defaultTools)&&a?.defaultTools?.includes("columnFilter"))&&e.jsx(dn,{table:t})]})]})}const Ni=m.forwardRef(({columns:t,data:a,extraParams:r,onTableReady:n},s)=>{const[o,l]=m.useState([]),[c,d]=m.useState(""),[u,f]=m.useState([]),[h,w]=m.useState({pageIndex:r?.pageIndex||0,pageSize:r?.pageSize||15}),[C,v]=m.useState({}),[N,b]=m.useState([]),[y,x]=m.useState({}),[k,j]=m.useState({});t=t.map(T=>(T?.filterFn||(T.filterFn="arrIncludesSome"),T)),m.useEffect(()=>{r?.checkBoxColumnCallback&&r.checkBoxColumnCallback(p.getFilteredSelectedRowModel().rows)},[k]),r?.checkBoxColumn&&t.splice(0,0,{id:"checkBoxColumn",header:({table:T})=>e.jsx(Xe,{checked:T.getIsAllPageRowsSelected()||T.getIsSomePageRowsSelected()&&"indeterminate",onCheckedChange:P=>T.toggleAllPageRowsSelected(!!P),"aria-label":"Select all"}),cell:({row:T})=>e.jsx(e.Fragment,{children:e.jsx(Xe,{checked:T.getIsSelected(),onCheckedChange:P=>T.toggleSelected(!!P),"aria-label":"Select row"})}),enableSorting:!1,enableHiding:!1}),(r?.actionMenu||r?.groupActionMenu)&&t.push({id:"DTActions",accessorKey:"Actions",header:()=>e.jsx("div",{className:"text-center",children:"Action"}),size:20,headerClassName:"text-center",cell:({row:T})=>T.getIsGrouped()?r?.groupActionMenu?e.jsx("div",{className:"text-end",children:e.jsx(Et,{actionMenus:r.groupActionMenu.items,extraActionParams:{arguments:[T.original,...r.groupActionMenu.extraArguments||[]]}})}):null:r?.actionMenu?e.jsx("div",{className:"text-center",children:e.jsx(Et,{actionMenus:r.actionMenu.items,extraActionParams:{arguments:[T.original,...r.actionMenu.extraArguments||[]]}})}):null,enableSorting:!1,enableHiding:!1}),m.useEffect(()=>{r?.onPaginationChange?.(h)},[h]);const p=B.useReactTable({data:a,columns:t,state:{sorting:o,globalFilter:c,columnFilters:u,columnVisibility:C,rowSelection:k,grouping:N,expanded:y,pagination:h},onPaginationChange:w,onSortingChange:l,onExpandedChange:x,onColumnFiltersChange:f,onColumnVisibilityChange:v,onGroupingChange:b,onGlobalFilterChange:d,onRowSelectionChange:j,getCoreRowModel:B.getCoreRowModel(),getPaginationRowModel:B.getPaginationRowModel(),getSortedRowModel:B.getSortedRowModel(),getFilteredRowModel:B.getFilteredRowModel(),getGroupedRowModel:B.getGroupedRowModel(),getExpandedRowModel:B.getExpandedRowModel(),getFacetedRowModel:B.getFacetedRowModel(),getFacetedUniqueValues:B.getFacetedUniqueValues(),getFacetedMinMaxValues:B.getFacetedMinMaxValues(),manualPagination:r?.pagination==null||r?.pagination==!0?void 0:!0});m.useImperativeHandle(s,()=>p);const[S,A]=m.useState([]),D=(T,P)=>{const V={id:P.id,title:ve(P.column)};T.dataTransfer.setData("headerObj",JSON.stringify(V)),T.dataTransfer.effectAllowed="move"},M=T=>{T.preventDefault();const P=JSON.parse(T.dataTransfer.getData("headerObj"));if(!S.find(V=>V.id==P.id)){A(z=>[...z,P]);const V=p.getColumn(P.id);V&&V.getToggleGroupingHandler()()}},O=T=>{T.preventDefault()},he=T=>{const P=S.filter(z=>z.id!==T);A(()=>[...P]);const V=p.getColumn(T);V&&V.getToggleGroupingHandler()()},[Ee,De]=m.useState(!1);return m.useEffect(()=>{Ee||De(!0),r?.defaultGroups&&p.setGrouping(r?.defaultGroups)},[]),m.useEffect(()=>{n&&n(p)},[n,p]),Ee&&e.jsxs("div",{className:"w-full h-full flex flex-col gap-3 justify-between",children:[e.jsxs("div",{className:"flex-grow flex flex-col gap-3 overflow-hidden",children:[(r?.defaultTools==null||r.defaultTools||r.extraTools)&&e.jsx(gn,{table:p,extraParams:r}),e.jsxs("div",{className:"flex-grow flex flex-col overflow-hidden",children:[(r?.grouping==null||r.grouping)&&e.jsx("div",{className:"w-full border-t min-h-10 px-2 py-1 flex gap-3 items-center text-sm bg-card-new",onDrop:M,onDragOver:O,children:S.length===0?"Drag a column header here to group its column":S.map((T,P)=>e.jsxs("div",{className:"rounded-md px-2 py-1 bg-muted text-muted-foreground flex gap-3 items-center",children:[T.title,e.jsx("span",{onClick:()=>he(T.id),children:e.jsx(g.X,{size:15})})]},T.id))}),e.jsx("div",{className:"flex-grow overflow-hidden",children:e.jsxs(Ar,{className:"border-t whitespace-nowrap bg-card-new",children:[(r?.header==null||r.header)&&e.jsx(Tr,{className:"sticky top-0 z-10 border-t bg-card-new",children:p.getHeaderGroups().map(T=>e.jsx(Oe,{className:G.cx(""),children:T.headers.map(P=>P.column.getIsGrouped()?P.column.getGroupedIndex()<S.length-1?null:e.jsx(Rt,{colSpan:S.length,className:G.cx("w-36 ","text-left")},P.id):e.jsx(Rt,{...r?.grouping==null||r.grouping?{onDragStart:V=>D(V,P),draggable:!0}:{},className:G.cx("text-left"),children:P.isPlaceholder?null:(r?.sorting==null||r.sorting)&&P.column.getCanSort()?e.jsxs("div",{onClick:P.column.getToggleSortingHandler(),className:G.cx("-mx-2 inline-flex cursor-pointer select-none items-center gap-2 rounded-md px-2 py-1 hover:bg-muted"),children:[e.jsx("div",{children:B.flexRender(P.column.columnDef.header,P.getContext())}),P.column.getCanSort()?e.jsxs("div",{className:"-space-y-2",children:[e.jsx(g.ChevronUp,{className:G.cx("size-3.5 text-foreground",P.column.getIsSorted()==="desc"?"opacity-30":""),"aria-hidden":"true"}),e.jsx(g.ChevronDown,{className:G.cx("size-3.5 text-foreground",P.column.getIsSorted()==="asc"?"opacity-30":""),"aria-hidden":"true"})]}):null]}):B.flexRender(P.column.columnDef.header,P.getContext())},P.id))},T.id))}),e.jsx(Pr,{children:p.getRowModel().rows.length?p.getRowModel().rows.map(T=>T.getIsGrouped()?e.jsx(Oe,{children:T.getVisibleCells().map(P=>P.column.getIndex()<T.depth?null:e.jsx(We,{colSpan:P.column.getIndex()==T.depth?T.depth+1:void 0,className:P.column.getIndex()==T.depth?"w-36":"",children:P.getIsGrouped()?e.jsxs(R,{variant:"link",onClick:T.getToggleExpandedHandler(),className:"text-right text-foreground",style:{marginLeft:T.depth+"rem"},children:[T.getIsExpanded()?e.jsx(g.ChevronDown,{}):e.jsx(g.ChevronRight,{})," ",B.flexRender(P.column.columnDef.cell,P.getContext())," ","(",T.subRows.length,")"]}):P.column.id=="DTActions"?B.flexRender(P.column.columnDef.cell,P.getContext()):P.getIsAggregated()?B.flexRender(P.column.columnDef.aggregatedCell??P.column.columnDef.cell,P.getContext()):P.getIsPlaceholder()?null:B.flexRender(P.column.columnDef.cell,P.getContext())},P.id))},T.id):e.jsx(Oe,{className:G.cx(T.getIsSelected()?"bg-accent/10":""),...r?.checkBoxColumn&&{onClick:()=>T.toggleSelected(!T.getIsSelected())},children:T.getVisibleCells().map((P,V)=>e.jsxs(We,{className:G.cx(T.getIsSelected()?"relative":"",!(r?.actionMenu||r?.groupActionMenu)&&"py-2"),children:[V===0&&T.getIsSelected()&&e.jsx("div",{className:"absolute inset-y-0 left-0 w-0.5 bg-primary"}),P.getIsPlaceholder()?null:B.flexRender(P.column.columnDef.cell,P.getContext())]},P.id))},T.id)):e.jsx(Oe,{children:e.jsx(We,{colSpan:t.length,className:"h-24 text-center",children:"No results."})})}),r?.footer&&e.jsx(Dr,{className:"sticky bottom-0 bg-background text-foreground",children:p.getFooterGroups().map(T=>e.jsx(Oe,{children:T.headers.map(P=>e.jsx(We,{children:P.isPlaceholder?null:e.jsx("div",{className:"flex items-center",children:B.flexRender(P.column.columnDef.footer,P.getContext())})}))}))})]})})]})]}),(r?.paginationBar==null||r.paginationBar)&&e.jsx(xn,{table:p,extraParams:r})]})});function yi(t){(t==null||typeof t!="object")&&(t={});const a={...t};return(a.toolbox===void 0||a.toolbox===null||typeof a.toolbox!="object")&&(a.toolbox={}),(a.toolbox.feature===void 0||a.toolbox.feature===null||typeof a.toolbox.feature!="object")&&(a.toolbox.feature={}),a}const Ci=m.forwardRef(({parentDivProps:t={},option:a={},style:r={},settings:n={},loading:s=!0,theme:o,isConfigurable:l=!1,resizeKey:c,onClick:d=()=>{},onConfigure:u=()=>{}},f)=>{const h=m.useRef(null),w=m.useRef(null),C=yi(a);return l&&(C.toolbox.feature={...C.toolbox.feature,myConfigureChartTool:{show:!0,title:"Configure Chart",icon:"image://data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxNiIgaGVpZ2h0PSIxNiIgdmlld0JveD0iMCAwIDI0IDI0IiBmaWxsPSJub25lIiBzdHJva2U9ImN1cnJlbnRDb2xvciIgc3Ryb2tlLXdpZHRoPSIxIiBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiIGNsYXNzPSJsdWNpZGUgbHVjaWRlLXNldHRpbmdzLTIiPjxwYXRoIGQ9Ik0yMCA3aC05Ii8+PHBhdGggZD0iTTE0IDE3SDUiLz48Y2lyY2xlIGN4PSIxNyIgY3k9IjE3IiByPSIzIi8+PGNpcmNsZSBjeD0iNyIgY3k9IjciIHI9IjMiLz48L3N2Zz4=",onclick:()=>u?.()}}),m.useImperativeHandle(f,()=>({getChartObject:()=>h.current?Re.getInstanceByDom(h.current):null,setOption:(v,N)=>{if(!h.current)return;Re.getInstanceByDom(h.current)?.setOption(v,N)},resize:(v=0)=>{if(!h.current)return;const N=Re.getInstanceByDom(h.current);N?.resize(),v&&setTimeout(()=>N?.resize(),v)},loadingVisible:v=>{if(!h.current)return;const N=Re.getInstanceByDom(h.current);v?N?.showLoading():N?.hideLoading()},dispose:()=>{if(!h.current)return;Re.getInstanceByDom(h.current)?.dispose()},on:(v,N)=>{if(!h.current)return;Re.getInstanceByDom(h.current)?.on(v,N)}})),m.useEffect(()=>{h.current&&(w.current=Re.init(h.current,o));const v=()=>w.current?.resize?.();return window.addEventListener("resize",v),()=>{w.current&&(w.current.dispose(),w.current=null),window.removeEventListener("resize",v)}},[o]),m.useEffect(()=>{w.current&&w.current.setOption(C,n),w.current&&w.current.on("click",d)},[a,n,o]),m.useEffect(()=>{w.current&&w.current.resize()},[c]),m.useEffect(()=>{w.current&&setTimeout(()=>{w.current?.resize()},500)},[]),e.jsx("div",{ref:h,...t,style:{width:"100%",height:"100%",...r}})});function hn({tooltipContent:t,fileNamePlaceholder:a,fileName:r,onFileNameChange:n,...s}){const o=m.useRef(null);return e.jsx(e.Fragment,{children:e.jsxs("div",{className:"flex",children:[e.jsx($,{ref:o,type:"file",className:"hidden",...s}),e.jsx("div",{className:"mx-1"}),e.jsx($,{className:"rounded-e-none",placeholder:a,onChange:(...l)=>n?.(...l),value:r}),e.jsx(Ne,{tooltipContent:t||"Browse File",onClick:()=>o?.current?.click(),className:"border-s-0 rounded-s-none",children:e.jsx(g.Upload,{})})]})})}const Ii=(({blur:t=0,inactiveZone:a=.7,proximity:r=0,spread:n=20,variant:s="default",glow:o=!1,className:l,movementDuration:c=2,borderWidth:d=1,disabled:u=!0})=>{const f=m.useRef(null),h=m.useRef({x:0,y:0}),w=m.useRef(0),C=m.useCallback(v=>{f.current&&(w.current&&cancelAnimationFrame(w.current),w.current=requestAnimationFrame(()=>{const N=f.current;if(!N)return;const{left:b,top:y,width:x,height:k}=N.getBoundingClientRect(),j=v?.x??h.current.x,p=v?.y??h.current.y;v&&(h.current={x:j,y:p});const S=[b+x*.5,y+k*.5],A=Math.hypot(j-S[0],p-S[1]),D=.5*Math.min(x,k)*a;if(A<D){N.style.setProperty("--active","0");return}const M=j>b-r&&j<b+x+r&&p>y-r&&p<y+k+r;if(N.style.setProperty("--active",M?"1":"0"),!M)return;const O=parseFloat(N.style.getPropertyValue("--start"))||0,Ee=(180*Math.atan2(p-S[1],j-S[0])/Math.PI+90-O+180)%360-180,De=O+Ee;it.animate(O,De,{duration:c,ease:[.16,1,.3,1],onUpdate:T=>{N.style.setProperty("--start",String(T))}})}))},[a,r,c]);return m.useEffect(()=>{if(u)return;const v=()=>C(),N=b=>C(b);return window.addEventListener("scroll",v,{passive:!0}),document.body.addEventListener("pointermove",N,{passive:!0}),()=>{w.current&&cancelAnimationFrame(w.current),window.removeEventListener("scroll",v),document.body.removeEventListener("pointermove",N)}},[C,u]),e.jsxs(e.Fragment,{children:[e.jsx("div",{className:i("pointer-events-none absolute -inset-px hidden rounded-[inherit] border opacity-0 transition-opacity",o&&"opacity-100",s==="white"&&"border-white",u&&"!block")}),e.jsx("div",{ref:f,style:{"--blur":`${t}px`,"--spread":n,"--start":"0","--active":"0","--glowingeffect-border-width":`${d}px`,"--repeating-conic-gradient-times":"5","--gradient":s==="white"?"repeating-conic-gradient(from 236.84deg at 50% 50%,var(--black),var(--black) calc(25% / var(--repeating-conic-gradient-times)))":"linear-gradient(54.29deg, #00A5E9 22.93%, #A020F0 32.97%, #55C8FF 52.28%, #A020F0 73.13%, #071182 88.57%)"},className:i("pointer-events-none absolute inset-0 rounded-[inherit] opacity-100 transition-opacity",o&&"opacity-100",t>0&&"blur-[var(--blur)] ",l,u&&"!hidden"),children:e.jsx("div",{className:i("glow","rounded-[inherit]",'after:content-[""] after:rounded-[inherit] after:absolute after:inset-[calc(-1*var(--glowingeffect-border-width))]',"after:[border:var(--glowingeffect-border-width)_solid_transparent]","after:[background:var(--gradient)] after:[background-attachment:fixed]","after:opacity-[var(--active)] after:transition-opacity after:duration-300","after:[mask-clip:padding-box,border-box]","after:[mask-composite:intersect]","after:[mask-image:linear-gradient(#0000,#0000),conic-gradient(from_calc((var(--start)-var(--spread))*1deg),#00000000_0deg,#fff,#00000000_calc(var(--spread)*2deg))]")})})]})});function ft({name:t,...a}){const r=As[t];return r?e.jsx(r,{...a}):(console.warn(`Icon "${t}" not found in lucide-react`),null)}const ki=({size:t=48,className:a,visible:r=!0,...n})=>r?e.jsx("div",{className:"h-full w-full",children:e.jsx("div",{className:"absolute inset-0 flex justify-center items-center z-50",children:e.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:t,height:t,...n,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:i("animate-spin",a),children:e.jsx("path",{d:"M21 12a9 9 0 1 1-6.219-8.56"})})})}):null;function Si({placeholder:t,items:a,onValueChange:r,defaultValue:n,defaultOptions:s=2}){const[o,l]=m.useState(n||[]),[c,d]=m.useState(""),u=m.useRef(null),[f,h]=m.useState(!1);m.useEffect(()=>{r(o)},[o,r]);const w=a.filter(x=>(x.label||x.value).toLowerCase().includes(c.toLowerCase())).sort((x,k)=>(x?.label??"").localeCompare(k?.label??"")),C=x=>{const k=x.currentTarget;k.scrollTop+=x.deltaY,x.preventDefault()},v=x=>{const k=o.includes(x)?o.filter(j=>j!==x):[...o,x];l(k)},[N,b]=m.useState(o.length),y=m.useCallback(()=>{const x=u.current;if(!x)return N;const k=Array.from(x.children),j=x.offsetWidth;let p=0,S=0;for(const A of k){const D=A.offsetWidth+4;if(p+D<=j)p+=D,S++;else break}return S},[N]);return m.useEffect(()=>{const x=u.current;if(!x)return;let k=null;const j=()=>{k&&cancelAnimationFrame(k),k=requestAnimationFrame(()=>{const S=y();b(A=>A!==S?S:A)})},p=new ResizeObserver(j);return p.observe(x),k=requestAnimationFrame(j),()=>{k&&cancelAnimationFrame(k),p.disconnect()}},[y]),e.jsxs(J,{open:f,onOpenChange:h,children:[e.jsx(X,{asChild:!0,className:"w-full",children:e.jsxs(R,{variant:"outline",role:"combobox",className:i("justify-between px-3 py-2 h-10",o.length===0&&"text-foreground/50","bg-secondary"),onClick:()=>h(x=>!x),children:[o.length>0?e.jsx(ye,{children:e.jsxs("div",{ref:u,className:"flex flex-wrap gap-2 items-center overflow-hidden flex-1",children:[o.slice(0,s).map(x=>{const k=a.find(j=>j.value===x)?.label||x;return e.jsxs("span",{className:"flex items-center px-2 py-1 bg-secondary text-secondary-foreground rounded-md truncate max-w-full",title:k,children:[e.jsx("span",{className:"truncate max-w-[120px]",children:k}),e.jsx("span",{role:"button",tabIndex:0,onClick:j=>{j.stopPropagation(),v(x)},onKeyDown:j=>{(j.key==="Enter"||j.key===" ")&&(j.preventDefault(),j.stopPropagation(),v(x))},className:"ml-1 text-muted-foreground hover:text-destructive cursor-pointer outline-none",children:e.jsx(g.X,{className:"w-3 h-3 ml-1"})})]},x)}),o.length>s&&e.jsxs(te,{children:[e.jsx(ae,{asChild:!0,children:e.jsxs("span",{className:"px-2 py-1 bg-secondary text-secondary-foreground dark:bg-secondary dark:text-secondary-foreground keross:bg-secondary keross:text-secondary-foreground rounded-md cursor-pointer",children:["+",o.length-s," more"]})}),e.jsx(re,{className:"max-w-xs break-words",children:e.jsx("div",{onWheel:C,className:"flex flex-col gap-1 max-h-[200px] overflow-auto",children:o.slice(s).map(x=>e.jsx("span",{className:"text-sm",children:a.find(k=>k.value===x)?.label||x},x))})})]})]})}):e.jsx("span",{className:"flex-1 text-left truncate",children:t}),e.jsx(g.ChevronsUpDown,{className:"ml-2 h-4 w-4 shrink-0 opacity-50"})]})}),e.jsx(Q,{className:"p-0 min-w-[var(--radix-popover-trigger-width)]",style:{width:"max-content",maxWidth:"min(500px, 90vw)"},align:"start",children:e.jsxs(Y,{onMouseDown:x=>x.preventDefault(),children:[e.jsx(ne,{placeholder:"Search...",value:c,onValueChange:d}),e.jsxs(se,{onWheel:C,className:"max-h-60 overflow-auto",children:[e.jsx(oe,{children:"No items found."}),e.jsx(ee,{children:w.map(x=>{const k=o.includes(x.value),j=x.disabled===!0||typeof x.disabled=="function"&&x.disabled(x);return e.jsxs(K,{value:x.label||x.value,disabled:j,onPointerDown:p=>{p.preventDefault(),p.stopPropagation()},onSelect:()=>{j||v(x.value)},className:i("flex items-center justify-between space-x-2",j&&"opacity-50 cursor-not-allowed"),children:[e.jsx(Xe,{checked:k,onCheckedChange:()=>{j||v(x.value)},onClick:p=>p.stopPropagation(),disabled:j}),e.jsx("span",{className:"flex-grow text-left",children:x?.label||x.value})]},x.value)})})]})]})})]})}function ta({text:t}){return e.jsxs("div",{className:"flex flex-col h-full justify-center text-center gap-2",children:[e.jsx(g.CircleAlert,{className:"text-muted-foreground mx-auto",size:36}),e.jsx("p",{className:"text-muted-foreground",children:t||"No Data Available"})]})}function Ai({title:t,subtitle:a,tools:r,children:n}){return t=t??"",a=a??"",e.jsxs("div",{className:"flex flex-col gap-4 h-full",children:[e.jsxs("div",{className:"flex items-center justify-between gap-4",children:[e.jsxs("div",{className:"grid grid-cols-1 gap-1",children:[t&&e.jsx("h1",{className:"text-2xl font-semibold",children:t}),a&&e.jsx("p",{className:"text-muted-foreground/60",children:a})]}),e.jsx("div",{children:r})]}),n]})}const Ti=({value:t})=>{const a=js(t),r=a.score*100/4,n=()=>{switch(a.score){case 0:return"#828282";case 1:return"#EA1111";case 2:return"#FFAD00";case 3:return"#9bc158";case 4:return"#00b500";default:return""}};return e.jsx(e.Fragment,{children:e.jsx(wt,{value:r,className:n()})})},da=({code:t})=>{const a=_s[t];return e.jsx(a,{})};function Pi({className:t,...a}){const[r,n]=m.useState(!1),[s,o]=m.useState(""),[l,c]=m.useState("");return e.jsxs(J,{open:r,onOpenChange:n,children:[e.jsx(X,{asChild:!0,children:e.jsxs(R,{variant:"outline",role:"combobox","aria-expanded":r,className:"justify-between bg-secondary",children:[l?e.jsx(da,{code:l}):"...",e.jsx(g.ChevronsUpDown,{className:"opacity-50"})]})}),e.jsx(Q,{className:"p-0",align:"start",children:e.jsxs(Y,{filter:(d,u,f=[])=>(d.toLowerCase()+" "+f.join(" ").toLowerCase()).includes(u.toLowerCase())?1:0,children:[e.jsx(ne,{placeholder:"Search ...",className:"h-9"}),e.jsxs(se,{children:[e.jsx(oe,{children:"No country found."}),e.jsx(ee,{children:Object.entries(ws.countries).map(([d,u])=>u.phone.map(f=>e.jsxs(K,{value:`${f}`,keywords:[u.name,"+"+f.toString(),d],onSelect:h=>{o(h===s?"":h),c(d),n(!1)},children:[e.jsx(da,{code:d})," ",u.name," +",f]},f)))})]})]})})]})}function bn({buttonText:t,buttonIcon:a,buttonStyle:r,sheetContent:n,sheetDescription:s,sheetTitle:o,closeButton:l}){return e.jsxs(Xt,{children:[e.jsx(lr,{asChild:!0,children:e.jsxs(R,{variant:"outline",className:r,size:"icon-sm",children:[t,a]})}),e.jsxs(Qt,{className:"p-4",children:[e.jsx(Zt,{children:o}),n]})]})}const Di=g.icons;function Ri({title:t,iconName:a,iconSize:r,iconClass:n,primaryText:s,secondaryText:o,mainClassName:l="",loading:c,loadingMessage:d}){let u=null;return a&&(u=Di[a]),r=r===void 0?20:r,n=n??"",d=d??"Loading...",e.jsx(mt,{className:l,children:e.jsxs(Ua,{className:"p-5",children:[e.jsxs("div",{className:"flex items-center justify-between gap-4",children:[e.jsx("span",{children:t}),c?e.jsx(g.LoaderCircle,{size:r,className:"animate-spin "+n}):u&&e.jsx(u,{size:r,className:n})]}),e.jsx("div",{className:"mt-6 text-2xl font-semibold",children:c?"...":s}),o&&e.jsx("small",{className:"mt-2 text-gray-400",children:c?d:o})]})})}function vn({children:t,tabArray:a,pathName:r,tabListClass:n="",tabListInnerClass:s="",tabListButtonClass:o="",tabContentClass:l="",headerEndComponent:c,onTabChange:d,isSeperatePage:u=!1}){const[f,h]=m.useState(5),w=yt(),[C,v]=m.useState([]),[N,b]=m.useState([]),[y,x]=m.useState(a.find(p=>p.default)?.tabId||a[0]?.tabId||"");m.useEffect(()=>{h(w?2:5)},[w]),m.useEffect(()=>{if(r&&u){const p=r.split("/").pop()||"";x(p)}},[r,u]),m.useEffect(()=>{v(a.slice(0,f)),b(a.slice(f))},[a,f]);const k=p=>{x(p),d?.(p)},j=p=>{v(S=>{const A=[...S],D=A.pop();return D&&b(M=>[...M.filter(O=>O.tabId!==p.tabId),D]),[...A,p]}),k(p.tabId)};return e.jsxs(Rr,{value:y,onValueChange:k,className:"w-full h-full flex flex-col",children:[e.jsxs(zr,{className:`flex justify-between items-center ${n}`,children:[e.jsxs("div",{className:`flex w-full ${s}`,children:[C.map(p=>e.jsx(Mr,{value:p.tabId,className:o,children:p.tabName},p.tabId)),N.length>0&&e.jsxs(Ae,{children:[e.jsx(Te,{asChild:!0,children:e.jsx(et,{variant:"outline",size:"sm",className:"mt-1",children:e.jsx(g.EllipsisVertical,{})})}),e.jsx(Pe,{children:N.map(p=>e.jsx(ie,{onClick:()=>j(p),children:p.tabName},p.tabId))})]})]}),c&&e.jsx("div",{children:c})]}),t?e.jsx(_t,{value:y,className:`mt-3 flex-grow overflow-auto h-full w-full ${l}`,children:e.jsx(mt,{className:"h-full w-full p-3",children:t})}):a.map(p=>e.jsx(_t,{value:p.tabId,className:`mt-3 flex-grow overflow-auto h-full w-full ${l}`,children:e.jsx(mt,{className:"h-full w-full p-3",children:p?.tabContent})},p.tabId))]})}function jn(){const{setTheme:t,theme:a,resolvedTheme:r}=Sr(),[n,s]=m.useState(!1);m.useEffect(()=>{s(!0)},[]);const o=a==="system"?r:a,l=C=>{const v=parseInt(C.slice(1),16),N=v>>16&255,b=v>>8&255,y=v>>0&255,[x,k,j]=[N,b,y].map(p=>(p=p/255,p<=.03928?p/12.92:Math.pow((p+.055)/1.055,2.4)));return .2126*x+.7152*k+.0722*j},c=C=>l(C)>.25?"#000000":"#ffffff",d=m.useCallback(()=>{const C=localStorage.getItem("primary")||"#0f172b",v=localStorage.getItem("secondary")||"#1b2336",N=localStorage.getItem("tertiary")||"#1f3aba",b=localStorage.getItem("primaryChart")||"#00bc7d",y=localStorage.getItem("secondaryChart")||"#fd9a00",x=localStorage.getItem("tertiaryChart")||"#ad46ff";document.documentElement.style.setProperty("--background",C),document.documentElement.style.setProperty("--secondary",v),document.documentElement.style.setProperty("--card",v),document.documentElement.style.setProperty("--popover",v),document.documentElement.style.setProperty("--muted",v),document.documentElement.style.setProperty("--sidebar",v),document.documentElement.style.setProperty("--btn-secondary",v),document.documentElement.style.setProperty("--accent",N),document.documentElement.style.setProperty("--sidebar-primary",N),document.documentElement.style.setProperty("--sidebar-accent",N),document.documentElement.style.setProperty("--foreground",c(C)),document.documentElement.style.setProperty("--secondary-foreground",c(v)),document.documentElement.style.setProperty("--card-foreground",c(v)),document.documentElement.style.setProperty("--popover-foreground",c(v)),document.documentElement.style.setProperty("--muted-foreground",c(v)),document.documentElement.style.setProperty("--sidebar-foreground",c(v)),document.documentElement.style.setProperty("--accent-foreground",c(N)),document.documentElement.style.setProperty("--sidebar-primary-foreground",c(N)),document.documentElement.style.setProperty("--sidebar-accent-foreground",c(N)),document.documentElement.style.setProperty("--chart-1",b),document.documentElement.style.setProperty("--chart-2",y),document.documentElement.style.setProperty("--chart-3",x),document.documentElement.style.setProperty("--chart-4",b),document.documentElement.style.setProperty("--chart-5",y)},[]),u=m.useCallback(()=>{document.documentElement.style.removeProperty("--background"),document.documentElement.style.removeProperty("--secondary"),document.documentElement.style.removeProperty("--card"),document.documentElement.style.removeProperty("--popover"),document.documentElement.style.removeProperty("--muted"),document.documentElement.style.removeProperty("--sidebar"),document.documentElement.style.removeProperty("--btn-secondary"),document.documentElement.style.removeProperty("--accent"),document.documentElement.style.removeProperty("--sidebar-primary"),document.documentElement.style.removeProperty("--sidebar-accent"),document.documentElement.style.removeProperty("--foreground"),document.documentElement.style.removeProperty("--secondary-foreground"),document.documentElement.style.removeProperty("--card-foreground"),document.documentElement.style.removeProperty("--popover-foreground"),document.documentElement.style.removeProperty("--muted-foreground"),document.documentElement.style.removeProperty("--sidebar-foreground"),document.documentElement.style.removeProperty("--accent-foreground"),document.documentElement.style.removeProperty("--sidebar-primary-foreground"),document.documentElement.style.removeProperty("--sidebar-accent-foreground"),document.documentElement.style.removeProperty("--chart-1"),document.documentElement.style.removeProperty("--chart-2"),document.documentElement.style.removeProperty("--chart-3"),document.documentElement.style.removeProperty("--chart-4"),document.documentElement.style.removeProperty("--chart-5")},[]);m.useEffect(()=>{n&&o==="blue-dark"&&(document.documentElement.classList.add("blue-dark"),d())},[n,o,d]);const f=m.useCallback(C=>{t(C),(C==="light"||C==="dark")&&(document.documentElement.classList.remove("blue-dark"),u()),C==="blue-dark"&&(document.documentElement.classList.add("blue-dark"),d())},[t,d,u]);if(!n)return null;const h=o==="blue-dark"?e.jsx(g.Waves,{className:"h-5 w-5"}):o==="dark"?e.jsx(g.Moon,{className:"h-5 w-5"}):o==="light"?e.jsx(g.Sun,{className:"h-5 w-5"}):e.jsx(g.Laptop,{className:"h-5 w-5"}),w=C=>o===C;return e.jsxs(Ae,{children:[e.jsx(Te,{asChild:!0,children:e.jsx(R,{variant:"outline",size:"icon","aria-label":"Change theme",title:`Theme: ${a==="system"?`system (${r})`:a}`,children:h})}),e.jsxs(Pe,{align:"end",sideOffset:8,children:[e.jsxs(ie,{onClick:()=>f("light"),className:"flex items-center justify-between gap-2",children:[e.jsxs("div",{className:"flex items-center",children:[e.jsx(g.Sun,{className:"mr-2 h-4 w-4"})," Light"]}),w("light")&&e.jsx(g.Check,{className:"h-4 w-4"})]}),e.jsxs(ie,{onClick:()=>f("dark"),className:"flex items-center justify-between gap-2",children:[e.jsxs("div",{className:"flex items-center",children:[e.jsx(g.Moon,{className:"mr-2 h-4 w-4"})," Dark"]}),w("dark")&&e.jsx(g.Check,{className:"h-4 w-4"})]}),e.jsxs(ie,{onClick:()=>f("blue-dark"),className:"flex items-center justify-between gap-2",children:[e.jsxs("div",{className:"flex items-center",children:[e.jsx(g.Waves,{className:"mr-2 h-4 w-4"})," Custom"]}),w("blue-dark")&&e.jsx(g.Check,{className:"h-4 w-4"})]})]})]})}function _i({title:t,value:a,valueText:r,isPercent:n=!0,className:s,titleClassName:o,valueClassName:l,progressClassName:c}){let d=a.toFixed(2);const u=d.split(".");return u[1]==="00"&&(d=u[0]),e.jsxs("div",{className:"w-full "+(s??""),children:[e.jsxs("div",{className:"flex items-center justify-between gap-4",children:[e.jsx("div",{className:"text-muted-foreground text-sm "+(o??""),children:t}),e.jsx("div",{className:"text-sm "+(l??""),children:r??`${d}${n?"%":""}`})]}),e.jsx(wt,{value:a,className:"w-full mt-2 "+(c??"")})]})}function zi({processedData:t,value:a,onChange:r,placeholder:n="Select items...",searchPlaceholder:s="Search...",className:o}){const[l,c]=I.useState(!1),[d,u]=I.useState(""),{flatTree:f,itemMap:h}=t,w=I.useMemo(()=>{const b=new Map,y=new Set(a);return[...f].reverse().forEach(x=>{const k=h[x.id];if(!k||!x.treatAsParent||k.childrenIds.length===0)y.has(x.id)&&b.set(x.id,"checked");else{const j=k.childrenIds.map(A=>b.get(A)),p=j.filter(A=>A==="checked").length,S=j.filter(A=>A==="indeterminate").length;p===k.childrenIds.length?b.set(x.id,"checked"):(p>0||S>0)&&b.set(x.id,"indeterminate")}}),b},[a,f,h]),C=b=>{const y=new Set(a),x=w.get(b.id),k=!(x==="checked"||x==="indeterminate"),j=new Set,p=[...h[b.id]?.childrenIds||[]];for(;p.length>0;){const A=p.shift();j.add(A),(h[A]?.childrenIds||[]).forEach(M=>p.push(M))}k?(y.add(b.id),j.forEach(A=>y.add(A))):(y.delete(b.id),j.forEach(A=>y.delete(A)));let S=h[b.id]?.parentId;for(;S;){const A=h[S];A&&A.childrenIds.length>0&&(A.childrenIds.every(M=>y.has(M))?y.add(S):y.delete(S)),S=A?.parentId}r(Array.from(y))},v=I.useMemo(()=>{if(!d)return f.slice();const b=d.toLowerCase(),y=new Set;f.forEach(p=>{(p.title.toLowerCase().includes(b)||p.description.toLowerCase().includes(b)||p.index.toLowerCase().includes(b))&&y.add(p.id)});const x=new Set(y),k=p=>{let S=p;for(;S;){const A=h[S]?.parentId;if(A&&!x.has(A))x.add(A),S=A;else break}},j=p=>{const S=h[p]?.childrenIds||[];for(const A of S)x.has(A)||(x.add(A),j(A))};return y.forEach(p=>{k(p),j(p)}),f.filter(p=>x.has(p.id))},[d,f,h]),N=()=>{const b=a.filter(y=>{const x=h[y];return!x||x.childrenIds.length===0});if(b.length===0)return e.jsx("span",{className:"text-muted-foreground",children:n});if(b.length===1){const y=f.find(x=>x.id===b[0]);return y?y.index:n}return`${b.length} items selected`};return e.jsxs(J,{open:l,onOpenChange:c,children:[e.jsx(X,{asChild:!0,children:e.jsxs(R,{variant:"outline",role:"combobox","aria-expanded":l,className:i("w-full justify-between transition-all duration-150 ease-in-out border hover:border-primary hover:shadow-sm bg-secondary cursor-pointer",o),children:[e.jsx("span",{className:"truncate",children:N()}),e.jsx(g.ChevronsUpDown,{className:i("ml-2 h-4 w-4 shrink-0 transition-transform duration-200",l&&"rotate-180")})]})}),e.jsx(Q,{className:"w-[--radix-popover-trigger-width] p-0 max-h-[400px] overflow-y-auto",children:e.jsxs(Y,{children:[e.jsx(ne,{placeholder:s,value:d,onValueChange:u}),e.jsxs(se,{className:"transition-all duration-200 ease-in-out",children:[e.jsx(oe,{children:"No results found."}),v.map(b=>e.jsxs(K,{value:`${b.index} ${b.title} ${b.description}`,onSelect:()=>C(b),className:"flex items-start cursor-pointer gap-2",style:{paddingLeft:`${b.level*1.5+.75}rem`},children:[e.jsx("input",{type:"checkbox",className:"mt-1 h-4 w-4 accent-primary border rounded",checked:w.get(b.id)==="checked",ref:y=>{y&&(y.indeterminate=w.get(b.id)==="indeterminate")},readOnly:!0}),e.jsxs("div",{className:"flex flex-col",children:[e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx("span",{className:"text-xs font-mono text-muted-foreground bg-muted px-1.5 py-0.5 rounded",children:b.index}),e.jsx("span",{className:"font-medium",children:b.title})]}),e.jsx("p",{className:"text-sm text-muted-foreground",children:b.description})]})]},b.id))]})]})})]})}function Mi({widgetData:t}){const a=t.slice(0,4),r=t.slice(4);return e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsx("div",{className:"flex flex-col md:flex-row gap-2",children:a.map(n=>e.jsxs("div",{className:"flex flex-1 flex-row justify-between border rounded-md p-2 border-l-4 border-l-primary",children:[e.jsxs("div",{className:"flex flex-col",children:[e.jsx(ye,{children:e.jsxs(te,{children:[e.jsx(ae,{className:"cursor-default select-text",children:e.jsx("p",{className:"font-medium max-w-[240px] truncate",children:n.widgetText})}),e.jsx(re,{children:e.jsx("p",{children:n.widgetText})})]})}),e.jsx("div",{children:n.onButtonClickfunc?e.jsx(R,{className:"px-0",variant:"link",onClick:()=>n.onButtonClickfunc?.({id:n.id}),children:n.widgetNumber}):e.jsx("p",{className:"inline-flex items-center justify-center px-0 py-2 text-sm font-medium border border-transparent rounded-md",children:n.widgetNumber})})]}),e.jsx("div",{className:"flex justify-end items-center",children:n.iconName&&e.jsx(ft,{name:n.iconName})})]},n.id))}),r.length>0&&e.jsx("div",{className:"flex flex-col md:flex-row gap-2",children:r.map(n=>e.jsxs("div",{className:"flex flex-1 flex-row justify-between border rounded-md p-2 border-l-4 border-l-primary",children:[e.jsxs("div",{className:"flex flex-col",children:[e.jsx(ye,{children:e.jsxs(te,{children:[e.jsx(ae,{className:"cursor-default select-text",children:e.jsx("p",{className:"font-medium max-w-[240px] truncate",children:n.widgetText})}),e.jsx(re,{children:e.jsx("p",{children:n.widgetText})})]})}),e.jsx("div",{children:n.onButtonClickfunc?e.jsx(R,{className:"px-0",variant:"link",onClick:()=>n.onButtonClickfunc?.({id:n.id}),children:n.widgetNumber}):e.jsx("p",{className:"inline-flex items-center justify-center px-0 py-2 text-sm font-medium border border-transparent rounded-md",children:n.widgetNumber})})]}),e.jsx("div",{className:"flex justify-end items-center",children:n.iconName&&e.jsx(ft,{name:n.iconName})})]},n.id))})]})}function Fi({onNavigate:t,onView:a,label:r,extraTools:n,view:s}){const[o,l]=m.useState(s===W.Views.DAY?"DAY":s===W.Views.WEEK?"WEEK":"MONTH");return e.jsx(e.Fragment,{children:e.jsxs("div",{className:"flex flex-col md:flex-row justify-between items-start md:items-center mb-3",children:[e.jsxs(_e,{type:"single",variant:"outline",onValueChange:c=>{switch(c){case"PREV":t("PREV");break;case"NEXT":t("NEXT");break;case"TODAY":t("TODAY");break}},children:[e.jsx(U,{className:"rounded-e-none",value:"PREV",children:e.jsx(g.ChevronLeft,{size:16})}),e.jsx(U,{className:"rounded-none border-x",value:"NEXT",children:e.jsx(g.ChevronRight,{size:16})}),e.jsx(U,{className:"rounded-s-none",value:"TODAY",children:"Today"})]}),e.jsx("span",{className:"rbc-toolbar-label",children:r}),e.jsxs("div",{className:"flex flex-row gap-2",children:[e.jsxs(_e,{type:"single",variant:"outline",value:o,onValueChange:c=>{switch(l(c),c){case"DAY":a(W.Views.DAY);break;case"WEEK":a(W.Views.WEEK);break;case"MONTH":a(W.Views.MONTH);break}},children:[e.jsx(U,{className:"rounded-e-none",value:"MONTH",children:"Month"}),e.jsx(U,{className:"rounded-none border-x-0",value:"WEEK",children:"Week"}),e.jsx(U,{className:"rounded-s-none",value:"DAY",children:"Day"})]}),n?.map((c,d)=>e.jsx(m.Fragment,{children:c},d))]})]})})}function Ei({event:t,extraParamsEvent:a}){return e.jsxs("div",{className:"custom-event flex flex-row justify-between",children:[e.jsx("span",{className:"truncate w-auto",children:t.title}),e.jsxs("span",{className:"flex flex-row gap-1",children:[(a?.isEditableAll||t.isEditable)&&e.jsx(Ce,{tooltipContent:"Edit",children:e.jsx("button",{className:"event-edit-button w-fit px-1",onClick:r=>{r.stopPropagation(),a?.onEditEventClick?.(t)},children:e.jsx(g.SquarePen,{size:16})})}),e.jsx(Ce,{tooltipContent:"View",children:e.jsx("button",{className:"event-view-button w-fit px-1",onClick:r=>{r.stopPropagation(),a?.onViewEventClick?.(t)},children:e.jsx(g.Eye,{size:16})})})]})]})}const Oi={"en-US":ys.enUS},Li=W.dateFnsLocalizer({format:qe.format,parse:qe.parse,startOfWeek:qe.startOfWeek,getDay:qe.getDay,locales:Oi});function Bi({events:t,extraParamsEvent:a,extraTools:r}){const[n,s]=m.useState(a?.defaultView==="day"?W.Views.DAY:a?.defaultView==="week"?W.Views.WEEK:a?.defaultView==="month"?W.Views.MONTH:a?.defaultView==="work week"?W.Views.WORK_WEEK:a?.defaultView==="agenda"?W.Views.AGENDA:W.Views.MONTH),[o,l]=m.useState(new Date);return e.jsx(W.Calendar,{localizer:Li,events:t||[],startAccessor:"start",endAccessor:"end",views:[W.Views.DAY,W.Views.WEEK,W.Views.MONTH],view:n,onView:c=>s(c),date:o,onNavigate:c=>l(c),components:{event:c=>e.jsx(Ei,{event:c.event,extraParamsEvent:a}),toolbar:c=>e.jsx(Fi,{...c,extraTools:r,view:n})},style:{height:a?.height||"100%",margin:a?.margin||"0px"}})}const wn=m.createContext(void 0);function Nn({children:t}){const[a,r]=m.useState([]),n=c=>{r(d=>[...d.filter(f=>f.level<c.level),c])},s=(c,d)=>{r(d?c:u=>[...u,...c])},o=c=>{r(d=>[...d.filter(f=>f.level<=c.level)])},l=()=>{r([])};return e.jsx(wn.Provider,{value:{breadcrumbItems:a,addBreadcrumb:n,backBreadcrumb:o,addBreadcrumbItems:s,clearBreadcrumb:l},children:t})}function aa(){const t=m.useContext(wn);if(!t)throw new Error("useBreadcrumb must be used within a BreadcrumbProvider");return t}function yn(){const{breadcrumbItems:t,backBreadcrumb:a}=aa(),[r,n]=m.useState(!1),[s,o]=m.useState(2),l=yt(),c=xe.useNavigate();m.useEffect(()=>{o(l?2:4)},[l]);const d=m.useMemo(()=>({firstVisibleBreadcrumbList:t.slice(0,2),hiddenBreadcrumbList:l?t.slice(2):t.slice(2,s),lastVisibleBreadcrumbList:t.length>2?t.slice(2-(t.length<s?t.length:s)):[]}),[t,s,l]);return!d||l==null||s==null?null:e.jsx(Er,{children:e.jsxs(Or,{children:[d.firstVisibleBreadcrumbList.map((u,f)=>f<t.length-1?e.jsxs(m.Fragment,{children:[e.jsx(Le,{children:u.href?e.jsx(Mt,{className:"max-w-20 truncate md:max-w-none cursor-pointer",onClick:()=>{a(u),u.href&&c(u.href)},children:u.title}):e.jsx(Ge,{className:"max-w-20 truncate md:max-w-none",children:u.title})}),e.jsx(ct,{},"firstsep"+f)]},"first"+f):e.jsx(Le,{children:e.jsx(Ge,{className:"max-w-20 truncate md:max-w-none",children:u.title})},"first"+f)),t.length>s?e.jsxs(e.Fragment,{children:[e.jsx(Le,{children:l?e.jsxs(Vr,{open:r,onOpenChange:n,children:[e.jsx(qr,{"aria-label":"Toggle Menu",children:e.jsx(Ft,{className:"h-4 w-4"})}),e.jsxs(Hr,{children:[e.jsxs(Kr,{className:"text-left",children:[e.jsx(Jr,{children:"Navigate to"}),e.jsx(Xr,{children:"Select a page to navigate to."})]}),e.jsx("div",{className:"grid gap-1 px-2 lg:px-4",children:d.hiddenBreadcrumbList.map((u,f)=>e.jsx("div",{children:u.clickable==!1?e.jsx("span",{className:"py-1 text-sm",children:u.title}):e.jsx(xe.Link,{to:u.href?u.href:"#",className:"py-1 text-sm",children:u.title})},f))}),e.jsx(Yr,{className:"pt-4",children:e.jsx(Gr,{asChild:!0,children:e.jsx(R,{variant:"outline",children:"Close"})})})]})]}):e.jsxs(Ae,{open:r,onOpenChange:n,children:[e.jsx(Te,{className:"flex items-center gap-1","aria-label":"Toggle menu",children:e.jsx(Ft,{className:"h-4 w-4"})}),e.jsx(Pe,{align:"start",children:d.hiddenBreadcrumbList.map((u,f)=>e.jsx(ie,{children:u.href?e.jsx(xe.Link,{to:u.href?u.href:"#",children:u.title}):e.jsx("span",{children:u.title})},f))})]})}),!l&&e.jsx(ct,{})]}):null,!l&&d.lastVisibleBreadcrumbList.map((u,f)=>f==d.lastVisibleBreadcrumbList.length-1?e.jsx(Le,{children:e.jsx(Ge,{className:"max-w-20 truncate md:max-w-none cursor-pointer",children:u.title})},"last"+f):e.jsxs(m.Fragment,{children:[e.jsx(Le,{children:u.href?e.jsx(Mt,{className:"max-w-20 truncate md:max-w-none cursor-pointer",onClick:()=>{a(u),u.href&&c(u.href)},children:u.title}):e.jsx(Ge,{className:"max-w-20 truncate md:max-w-none",children:u.title})}),e.jsx(ct,{},"lastsep"+f)]},"last"+f))]},"BreadcrumbList1")},"Breadcrumb1")}function Ui({breadcrumb:t}){const{addBreadcrumb:a}=aa();return m.useEffect(()=>{a(t)},[t]),e.jsx(e.Fragment,{})}const Cn=m.createContext(void 0);function In({children:t}){const[a,r]=m.useState([]),[n,s]=m.useState(null),[o,l]=m.useState(null),c=C=>{r(v=>v.some(b=>b.title===C.title)?v.map(b=>b.title===C.title?{...b,...C}:b):[...v,C])},d=C=>{r(v=>v.filter(N=>N.title!==C))},u=(C,v)=>{r(N=>N.map(b=>b.title===C?{...b,...v}:b))},f=C=>{s(C)},h=C=>{l(C)},w=()=>{r([])};return e.jsx(Cn.Provider,{value:{navItems:a,header:n,footer:o,setNavItems:r,addNavItem:c,removeNavItem:d,updateNavItem:u,clearNavItems:w,setSidebarHeader:f,setSidebarFooter:h},children:t})}function at(){const t=m.useContext(Cn);if(!t)throw new Error("useSidebarNav must be used within a SidebarNavProvider");return t}function kn(){const{navItems:t}=at();return e.jsx(jr,{children:e.jsx(wr,{children:t.map(a=>a.items&&a.items.length>0?e.jsx(Lr,{asChild:!0,defaultOpen:a.isActive,className:"group/collapsible",children:e.jsxs(Pt,{children:[e.jsx(Br,{asChild:!0,children:e.jsxs(Dt,{tooltip:a.title,children:[a.icon&&e.jsx(a.icon,{}),e.jsx("span",{children:a.title}),e.jsx(g.ChevronRight,{className:"ml-auto transition-transform duration-200 group-data-[state=open]/collapsible:rotate-90"})]})}),e.jsx(Ur,{children:e.jsx(Nr,{children:a.items.map(r=>e.jsx(yr,{children:e.jsx(Cr,{asChild:!0,children:e.jsx(xe.Link,{to:r.url,children:e.jsx("span",{children:r.title})})})},r.title))})})]})},a.title):e.jsx(Pt,{children:e.jsx(Dt,{asChild:!0,tooltip:a.title,children:e.jsxs(xe.Link,{to:a.url,className:"flex items-center gap-2 w-full",children:[a.icon&&e.jsx(a.icon,{}),e.jsx("span",{children:a.title})]})})},a.title))})})}function Vi({items:t,sidebarHeader:a,sidebarFooter:r}){const{setNavItems:n,setSidebarHeader:s,setSidebarFooter:o}=at();return m.useEffect(()=>{n(t),s(a),o(r)},[t,a,r,n,s,o]),null}function qi({formControl:t,name:a,label:r,placeholder:n,formDescription:s,items:o,disabled:l,onSelect:c}){return e.jsx(e.Fragment,{children:e.jsx(ce,{control:t,name:a,render:({field:d})=>e.jsxs(de,{className:"",children:[r&&e.jsx(e.Fragment,{children:e.jsx(pe,{children:r})}),e.jsxs(J,{children:[e.jsx(X,{asChild:!0,className:"w-full",children:e.jsx(ue,{children:e.jsxs(R,{variant:"outline",role:"combobox",className:i("justify-between",!d.value&&"text-muted-foreground"),disabled:l==!0||l&&l(...arguments),children:[d.value?o.find(u=>u.value===d.value)?.label||d.value:n,e.jsx(g.ChevronsUpDown,{className:"opacity-50"})]})})}),e.jsx(Q,{className:"p-0",align:"start",children:e.jsxs(Y,{children:[e.jsx(ne,{placeholder:"Search..."}),e.jsxs(se,{children:[e.jsx(oe,{children:"No items found."}),e.jsx(ee,{children:o.map(u=>e.jsxs(K,{value:u.value,disabled:u.disabled==!0||u.disabled&&u.disabled(u),onSelect:f=>{d.onChange(f),c&&c(f)},children:[u?.label||u.value,e.jsx(g.Check,{className:i("ml-auto",u.value===d.value?"opacity-100":"opacity-0")})]},u.value))})]})]})})]}),s&&e.jsx(ge,{children:s}),e.jsx(me,{})]})})})}function Wi(t){const{field:a}=Ue.useController({name:t.name,control:t.formControl}),r=t.value!==void 0?t.value:a.value;return e.jsx(ce,{control:t.formControl,name:t.name,render:({field:n})=>e.jsxs(de,{className:"",children:[t.label&&e.jsxs(e.Fragment,{children:[e.jsx(pe,{children:t.label}),e.jsx("br",{})]}),e.jsxs(J,{children:[e.jsx(X,{asChild:!0,className:"w-full",children:e.jsx(ue,{children:e.jsxs(R,{variant:"outline",role:"combobox",className:i("justify-between",!r&&"text-muted-foreground"),disabled:typeof t.disabled=="function"?t.disabled():t.disabled,children:[r?t.items.find(s=>s.value===r)?.label||r:t.placeholder,e.jsx(g.ChevronsUpDown,{className:"opacity-50"})]})})}),e.jsx(Q,{className:"p-0",align:"start",children:e.jsxs(Y,{children:[e.jsx(ne,{placeholder:"Search..."}),e.jsxs(se,{children:[e.jsx(oe,{children:"No items found."}),e.jsx(ee,{children:t.items.map(s=>e.jsxs(K,{value:s.value,disabled:typeof s.disabled=="function"?s.disabled(s):s.disabled,onSelect:o=>{n.onChange(o),t.onSelect&&t.onSelect(o),t.onChange&&t.onChange(o)},children:[s?.label||s.value,e.jsx(g.Check,{className:i("ml-auto",s.value===r?"opacity-100":"opacity-0")})]},s.value))})]})]})})]}),t.formDescription&&e.jsx(ge,{children:t.formDescription}),e.jsx(me,{})]})})}function Gi({formControl:t,name:a,label:r,placeholder:n,dateFormat:s,calendarDateDisabled:o,formDescription:l,disabled:c}){return e.jsx(e.Fragment,{children:e.jsx(ce,{control:t,name:a,render:({field:d})=>e.jsxs(de,{children:[r&&e.jsx(e.Fragment,{children:e.jsx(pe,{children:r})}),e.jsxs(J,{children:[e.jsx(X,{asChild:!0,className:"w-full",children:e.jsx(ue,{children:e.jsxs(R,{variant:"outline",className:i(!d.value&&"text-foreground/50"),disabled:c,children:[d.value?qe.format(d.value,s||"PPP"):e.jsx("span",{children:n||"Pick a date"}),e.jsx(g.CalendarIcon,{className:"ml-auto h-4 w-4 opacity-50"})]})})}),e.jsx(Q,{className:"w-auto p-0",align:"start",children:e.jsx(La,{mode:"single",selected:d.value,onSelect:d.onChange,disabled:o,captionLayout:"dropdown",autoFocus:!0})})]}),l&&e.jsx(ge,{children:l}),e.jsx(me,{})]})})})}function $i(){return e.jsx(e.Fragment,{})}function Hi({formControl:t,label:a,formDescription:r,extraFormComponent:n,name:s,...o}){return e.jsx(e.Fragment,{children:e.jsx(ce,{control:t,name:s,render:({field:l})=>e.jsxs(de,{children:[a&&e.jsx(pe,{children:a}),e.jsx(ue,{children:e.jsx($,{...l,...o})}),n&&n(l.value),r&&e.jsx(ge,{children:r}),e.jsx(me,{})]})})})}function Ki({formControl:t,name:a,label:r,placeholder:n,formDescription:s,items:o=[],disabled:l,onSelect:c,defaultValue:d=[],defaultOptions:u=2}){const[f,h]=m.useState(""),w=m.useRef(null),C=o.filter(v=>v.label?.toLowerCase().includes(f.toLowerCase())).sort((v,N)=>(v?.label??"").localeCompare(N?.label??""));return e.jsx(ce,{control:t,name:a,render:({field:v})=>{m.useEffect(()=>{(v.value===void 0||v.value===null)&&d.length>0&&v.onChange(d)},[d,v]);const N=v.value||[],[b,y]=m.useState(N.length),x=m.useCallback(()=>{const p=w.current;if(!p)return b;const S=Array.from(p.children);let A=p.offsetWidth,D=0,M=0;for(const O of S){const he=O.offsetWidth+4;if(D+he<=A)D+=he,M++;else break}return M},[b]);m.useEffect(()=>{const p=w.current;if(!p)return;let S=null;const A=new ResizeObserver(()=>{S&&cancelAnimationFrame(S),S=requestAnimationFrame(()=>{const D=x();y(M=>M!==D?D:M)})});return A.observe(p),y(x()),()=>{S&&cancelAnimationFrame(S),A.disconnect()}},[x]);const k=p=>{let S;N.includes(p)?S=N.filter(A=>A!==p):S=[...N,p],v.onChange(S),c&&c(S)},j=p=>{const S=p.currentTarget;S.scrollTop+=p.deltaY,p.preventDefault()};return e.jsxs(de,{children:[r&&e.jsx(pe,{children:r}),e.jsxs(J,{children:[e.jsx(X,{asChild:!0,className:"w-full",children:e.jsx(ue,{children:e.jsxs(R,{variant:"outline",role:"combobox",className:i("justify-between",!N.length&&"text-foreground/50"),disabled:l===!0||l&&l(...arguments),children:[N.length>0?e.jsx(ye,{children:e.jsxs("div",{ref:w,className:"flex flex-wrap gap-2 items-center overflow-hidden",children:[N.slice(0,u).map(p=>{const S=o.find(A=>A.value===p)?.label||p;return e.jsxs("span",{className:"flex items-center px-2 py-1 bg-secondary text-secondary-foreground rounded-md truncate max-w-full",title:S,children:[e.jsx("span",{className:"truncate max-w-[120px]",children:S}),e.jsx("span",{role:"button",tabIndex:0,onClick:A=>{A.stopPropagation();const D=N.filter(M=>M!==p);v.onChange(D),c&&c(D)},onKeyDown:A=>{if(A.key==="Enter"||A.key===" "){A.preventDefault(),A.stopPropagation();const D=N.filter(M=>M!==p);v.onChange(D),c&&c(D)}},className:"ml-1 text-muted-foreground hover:text-destructive cursor-pointer outline-none",children:e.jsx(g.X,{className:"w-3 h-3 ml-1"})})]},p)}),N.length>u&&e.jsxs(te,{children:[e.jsx(ae,{asChild:!0,children:e.jsxs("span",{className:"px-2 py-1 bg-secondary text-secondary-foreground rounded-md cursor-pointer",children:["+",N.length-u," more"]})}),e.jsx(re,{className:"max-w-xs break-words",children:e.jsx("div",{onWheel:j,className:"flex flex-col gap-1 max-h-[200px] overflow-auto",children:N.slice(u).map(p=>e.jsx("span",{className:"text-sm",children:o.find(S=>S.value===p)?.label||p},p))})})]})]})}):n,e.jsx(g.ChevronsUpDown,{className:"opacity-50"})]})})}),e.jsx(Q,{id:"multiSelectPopover",className:"p-0 min-w-[--radix-popover-trigger-width]",style:{width:"max-content",maxWidth:"min(500px, 90vw)"},align:"start",children:e.jsxs(Y,{id:"commandPopover",children:[e.jsx(ne,{placeholder:"Search...",value:f,onValueChange:h,autoFocus:!0}),e.jsxs(se,{className:"max-h-60 overflow-auto",onWheel:j,children:[e.jsx(oe,{children:"No items found."}),e.jsx(ee,{children:C.map(p=>{const S=N.includes(p.value);return e.jsxs(K,{value:p.label??"",onSelect:()=>k(p.value),className:"flex items-center space-x-2 justify-start",children:[e.jsx(Xe,{checked:S,onCheckedChange:()=>k(p.value),onClick:A=>A.stopPropagation()}),e.jsx("span",{children:p.label})]},p.value)})})]})]})})]}),s&&e.jsx(ge,{children:s}),e.jsx(me,{})]})}})}function Yi({formControl:t,label:a,formDescription:r,extraFormComponent:n,name:s,...o}){return e.jsx(e.Fragment,{children:e.jsx(ce,{control:t,name:s,render:({field:l})=>e.jsxs(de,{children:[a&&e.jsx(pe,{children:a}),e.jsx(ue,{children:e.jsx(tn,{maxLength:4,...l,children:e.jsxs(an,{children:[e.jsx($e,{index:0}),e.jsx($e,{index:1}),e.jsx($e,{index:2}),e.jsx($e,{index:3})]})})}),n&&n(l.value),r&&e.jsx(ge,{children:r}),e.jsx(me,{})]})})})}function Ji(){return e.jsx("div",{children:"FormPhoneInput"})}function Xi({formControl:t,name:a,label:r,formItemClass:n,formDescription:s,...o}){return e.jsx(e.Fragment,{children:e.jsx(ce,{control:t,name:a,render:({field:l})=>e.jsxs(de,{className:n,children:[r&&e.jsx(pe,{children:r}),e.jsx(ue,{children:e.jsx(Fr,{...l,...o})}),s&&e.jsx(ge,{children:s}),e.jsx(me,{})]})})})}function Qi({formControl:t,label:a,formDescription:r,extraFormComponent:n,name:s,...o}){const[l,c]=I.useState(!1),d=()=>c(!l);return e.jsx(e.Fragment,{children:e.jsx(ce,{control:t,name:s,render:({field:u})=>e.jsxs(de,{children:[a&&e.jsx(pe,{children:a}),e.jsxs("div",{className:"relative",children:[e.jsx(ue,{children:e.jsx($,{type:l?"text":"password",...u,...o,className:`${o.className||""} pr-10`})}),e.jsx(R,{type:"button",variant:"ghost",size:"icon",className:"absolute right-0 top-0 h-full px-3 py-2 text-muted-foreground hover:bg-transparent!",onClick:d,children:l?e.jsx(g.EyeOff,{className:"h-4 w-4"}):e.jsx(g.Eye,{className:"h-4 w-4"})})]}),n&&n(u.value),r&&e.jsx(ge,{children:r}),e.jsx(me,{})]})})})}function Zi({rowCount:t=6,showToolbar:a=!0}){return e.jsxs("div",{className:"space-y-4",children:[a&&e.jsxs("div",{className:"flex justify-between",children:[e.jsx(ze,{className:"h-8 w-64 rounded-md"}),e.jsx(ze,{className:"h-8 w-32 rounded-md"})]}),e.jsx("div",{className:"space-y-4",children:[...Array(t)].map((r,n)=>e.jsx("div",{className:"grid gap-4 items-center",children:e.jsx(ze,{className:"h-8 w-full"})},n))})]})}function el({count:t}){return e.jsx("div",{className:"flex flex-row gap-3 w-full",children:t>0&&Array.from({length:t}).map((a,r)=>e.jsx(ze,{className:"w-1/"+t+" flex flex-col md:flex-row gap-2 h-20",children:e.jsx("div",{className:"flex flex-1 flex-row justify-between border rounded-md p-2 bg-card-new"})},"widget_"+r))})}function Sn(){const t=Ue.useForm({defaultValues:{text:"",fileNames:[]}}),[a,r]=m.useState(""),[n,s]=m.useState([]),[o,l]=m.useState([]),[c,d]=m.useState(""),[u,f]=m.useState(!0),h=o.some(b=>b.progress<100),w=async(b,y)=>{const x=new FormData;x.append("file",y.file);try{const k=await ha.post("UPLOAD_ENDPOINT_URL",x,{onUploadProgress:j=>{const p=Math.round(j.loaded*100/(j.total||1));l(S=>S.map((A,D)=>D===b?{...A,progress:p}:A))}});l(j=>j.map((p,S)=>S===b?{...p,url:k.data.url,progress:100}:p))}catch(k){console.error("Upload failed:",k)}};m.useEffect(()=>{const b=new Date,y=String(b.getDate()).padStart(2,"0"),x=String(b.getMonth()+1).padStart(2,"0"),k=b.getFullYear();d(`${y}-${x}-${k}`)},[]),m.useEffect(()=>{o.forEach((b,y)=>{b.progress===0&&w(y,b)})},[o]);const C=()=>{if(a.trim()||o.length>0){const b={text:a.trim(),fileNames:o.map(y=>y.name)};s([b,...n]),r(""),l([]),f(!1)}},v=b=>{if(b.target.files){const y=Array.from(b.target.files).map(x=>({name:x.name,url:"",progress:0,file:x}));l(x=>[...x,...y]),f(!1)}},N=b=>{const y=o.filter((x,k)=>k!==b);l(y),y.length===0&&n.length===0&&f(!0)};return e.jsx(e.Fragment,{children:e.jsxs("div",{className:"flex flex-col h-full w-full gap-3",children:[e.jsxs("div",{className:"flex-grow overflow-auto flex flex-col-reverse gap-2",children:[u&&e.jsx(ta,{text:"No files uploaded"}),o.length>0&&e.jsxs("div",{className:"p-2 my-1 rounded-md border",children:[e.jsx("p",{className:"font-bold",children:"Selected Files:"}),o.map((b,y)=>e.jsxs("div",{className:"flex flex-col mb-2",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("a",{href:b.url,download:b.name,className:"text-sm text-blue-600 underline cursor-pointer",children:b.name}),e.jsx("button",{onClick:()=>N(y),className:"text-red-500 hover:text-red-800",children:e.jsx(g.X,{className:"w-4 h-4"})})]}),e.jsx(wt,{value:b.progress}),e.jsxs("p",{className:"text-xs text-gray-500",children:[b.progress,"% uploaded"]})]},y))]}),n.map((b,y)=>e.jsxs("div",{className:"border-b text-sm pb-2",children:[b.fileNames.map((x,k)=>e.jsx("p",{children:e.jsx("a",{href:o.find(j=>j.name===x)?.url||"#",download:x,className:"text-sm text-blue-500 underline cursor-pointer",children:x})},k)),e.jsx("p",{children:b.text||"(No Text)"}),e.jsxs("div",{className:"flex justify-between",children:[e.jsx("p",{children:"John Doe"}),e.jsx("p",{children:c})]})]},y))]}),e.jsx(Qr,{...t,children:e.jsx("form",{onSubmit:t.handleSubmit(()=>C()),children:e.jsx("div",{className:"flex flex-col",children:e.jsxs("div",{className:"flex items-center justify-center gap-2",children:[e.jsx("div",{className:"flex-1",children:e.jsx(ce,{name:"text",render:({field:b})=>e.jsxs(de,{children:[e.jsx(ue,{children:e.jsx($,{id:"text-input",type:"text",value:a,onChange:y=>r(y.target.value),placeholder:"Type something..."})}),e.jsx(me,{})]})})}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(be,{htmlFor:"file-upload",className:"sr-only",children:"Upload Files"}),e.jsx(R,{variant:"outline",asChild:!0,children:e.jsx("label",{htmlFor:"file-upload",className:"cursor-pointer",children:e.jsx(g.UploadIcon,{className:"w-5 h-5"})})}),e.jsx($,{id:"file-upload",type:"file",multiple:!0,onChange:v,className:"hidden"})]}),e.jsx(R,{variant:"outline",type:"submit",disabled:h,children:e.jsx(g.Send,{})})]})})})})]})})}function An({...t}){const{navItems:a,header:r,footer:n}=at();return!a||a.length===0?null:e.jsxs(fr,{className:"ml-12",collapsible:"offcanvas",...t,children:[r&&e.jsx(hr,{children:r}),e.jsx(vr,{children:e.jsx(kn,{})}),n&&e.jsx(br,{children:n}),e.jsx(pr,{})]})}function Tn(){return e.jsx("footer",{className:"ml-12 flex border-t px-4 py-2 justify-center lg:justify-start",children:e.jsxs("div",{className:"flex gap-2 items-center",children:[e.jsx(g.Copyright,{className:"size-4"}),e.jsx("span",{children:"Powered By"}),e.jsx("a",{href:"https://keross.com",target:"_blank",children:"Keross"}),e.jsx("span",{className:"",children:"|"}),e.jsx("span",{id:"txtCopyrightYear",className:"",children:new Date().getFullYear()})]})})}const Z={IKON_ACCOUNT_API_URL:"",IKON_AUTH_API_URL:"",IKON_BASE_API_URL:"",IKON_PLATFORM_API_URL:"",IKON_PLATFORM_PROFILE_URL:"",IKON_PLATFORM_UI_URL:"",IKON_USER_API_URL:"",LOGIN_PAGE_URL:""},tl=t=>{Z.IKON_BASE_API_URL=t.IKON_BASE_API_URL,Z.IKON_PLATFORM_API_URL=`${t.IKON_BASE_API_URL}/platform`,Z.IKON_AUTH_API_URL=`${Z.IKON_PLATFORM_API_URL}/auth`,Z.IKON_USER_API_URL=`${Z.IKON_PLATFORM_API_URL}/user`,Z.IKON_ACCOUNT_API_URL=`${Z.IKON_PLATFORM_API_URL}/account`,Z.LOGIN_PAGE_URL=t.LOGIN_PAGE_URL,Z.IKON_PLATFORM_UI_URL=t.IKON_PLATFORM_UI_URL,Z.IKON_PLATFORM_PROFILE_URL=`${t.IKON_PLATFORM_UI_URL}/setting/profile`},fe=()=>Z;function Pn(){const{navItems:t}=at(),{IKON_PLATFORM_UI_URL:a}=fe();return e.jsx("header",{className:"ml-12 flex h-12 border-b shrink-0 items-center gap-2 transition-[width,height] ease-linear group-has-data-[collapsible=icon]/sidebar-wrapper:h-12",children:e.jsxs("div",{className:"flex items-center justify-between gap-2 px-4 w-full",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[!t||t.length===0?e.jsx("div",{}):e.jsx(xr,{className:"-ml-1"}),!t||t.length===0?e.jsx("div",{}):e.jsx(Nt,{orientation:"vertical",className:"mr-2 data-[orientation=vertical]:h-4"}),e.jsx(yn,{})]}),e.jsxs("div",{className:"ml-auto flex gap-4",children:[e.jsx(Ne,{className:"px-2!",tooltipContent:"Notifications",children:e.jsx(g.Bell,{})}),e.jsx(jn,{}),e.jsx(xe.Link,{to:`${a}/app-store`,children:e.jsxs(tt,{variant:"default",children:[e.jsx(g.Play,{}),"App Store"]})})]})]})})}const ra="ikoncloud_next_";function Ot(t,a,r){let n=r?.expires;!n&&r?.maxAge&&(n=r.maxAge/86400),Vt.set(ra+t,a,{httpOnly:!1,sameSite:"lax",expires:n})}function xt(t){return Vt.get(ra+t)}function Lt(t){Vt.remove(ra+t)}async function al(){}async function rt(t){const a=xt("accessToken"),r=xt("refreshToken");if(a)return a;if(r){const n=await Dn(r,t?.isSetToken);if(n)return n}return null}async function Dn(t,a){try{const r=await fetch(`${fe().IKON_AUTH_API_URL}/refresh-token`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({refreshToken:t})});if(r.ok){const s=await r.json(),{accessToken:o,refreshToken:l,expiresIn:c,refreshExpiresIn:d}=s;if(a==null||a)try{Ot("accessToken",o,{maxAge:c}),Ot("refreshToken",l,{maxAge:d})}catch(u){console.error(u)}return o}}catch(r){console.error("Failed to refresh access token:",r)}return null}function Bt(){Lt("accessToken"),Lt("refreshToken"),typeof window<"u"&&(window.location.href=fe().LOGIN_PAGE_URL)}const Ie=ha.create();Ie.interceptors.request.use(async t=>{const a=await rt();return a&&t.headers&&(t.headers.Authorization=`Bearer ${a}`),t},t=>Promise.reject(t instanceof Error?t:new Error(String(t))));Ie.interceptors.response.use(t=>t,async t=>{const a=t.config;if(t.response?.status===401&&a&&!a._retry){a._retry=!0;try{const r=await rt({isSetToken:!0});if(r&&a.headers)return a.headers.Authorization=`Bearer ${r}`,Ie(a);Bt()}catch(r){return Bt(),Promise.reject(r instanceof Error?r:new Error(String(r)))}}return Promise.reject(t instanceof Error?t:new Error(String(t)))});function rl(t){return Me.useQuery({queryKey:["profile",t],queryFn:async()=>{if(!t)throw new Error("No userId");return(await Ie.get(`${fe().IKON_USER_API_URL}/${t}`)).data},enabled:!!t})}function nl(){const t=Me.useQueryClient();return Me.useMutation({mutationFn:async a=>{await Ie.post(`${fe().IKON_AUTH_API_URL}/switch-account`,{targetAccountId:a})},onSuccess:()=>{t.invalidateQueries({queryKey:["accounts"]}),t.invalidateQueries({queryKey:["profile"]})}})}function sl(){return Me.useQuery({queryKey:["accountMembership"],queryFn:async()=>{const{data:t}=await Ie.get(`${fe().IKON_BASE_API_URL}/platform/user/account-membership`);return t}})}function ol(){return Me.useQuery({queryKey:["softwares"],queryFn:async()=>{const{data:t}=await Ie.get(`${fe().IKON_BASE_API_URL}/platform/software/accessible/user`);return t}})}const Rn=m.createContext(void 0);function il({children:t}){const[a,r]=m.useState(null);m.useEffect(()=>{const c=xt("accessToken");if(c)try{const d=Cs.jwtDecode(c);r(u=>({...u,userId:d.sub,primaryAccountId:d.primaryAccountId,activeAccountId:d.activeAccountId,roles:d.platformAccess?.roles??[]}))}catch{r(null)}},[]);const n=a?.userId??"",{data:s,isSuccess:o}=rl(n);m.useEffect(()=>{o&&s&&r(c=>({...c,...s}))},[o,s]);const l=c=>{r(d=>({...d,accountName:c}))};return e.jsx(Rn.Provider,{value:{user:a,setUser:r,setAccountName:l},children:t})}function _n(){const t=m.useContext(Rn);if(!t)throw new Error("useUser must be used within a UserProvider");return t}function ll(){const{user:t,setUser:a}=_n();return e.jsxs(Ae,{children:[e.jsx(Te,{asChild:!0,children:e.jsx(R,{variant:"ghost",size:"icon",className:"h-10 w-10",children:e.jsx(g.CircleUserRound,{className:"h-8 w-8"})})}),e.jsxs(Pe,{className:"w-55 p-0",side:"right",sideOffset:8,children:[e.jsxs("div",{className:"flex items-start gap-3 p-4 bg-card",children:[e.jsx(g.CircleUserRound,{className:"h-8 w-8"}),e.jsxs("div",{className:"flex flex-col gap-0.5 flex-1 min-w-0",children:[e.jsx("p",{className:"text-sm font-bold text-foreground blue-dark:text-muted-foreground truncate",children:t?.userName}),e.jsx("p",{className:"text-xs text-muted-foreground truncate",children:t?.userEmail}),e.jsx("p",{className:"text-sm text-muted-foreground font-semibold"})]})]}),e.jsx(jt,{className:"my-0"}),e.jsxs(ie,{onClick:async()=>{Bt()},className:"flex items-center gap-2 px-4 py-3 cursor-pointer focus:bg-destructive dark:focus:bg-destructive blue-dark:focus:bg-destructive",children:[e.jsx(g.LogOut,{className:"h-4 w-4 text-foreground"}),e.jsx("span",{children:"Log out"})]})]})]})}function cl(){const{data:t}=sl(),{user:a,setAccountName:r}=_n(),n=l=>l?l.split(" ").map(c=>c[0]).join("").toUpperCase().slice(0,2):"UN";m.useEffect(()=>{const l=t?.find(c=>c.accountId===a?.activeAccountId);r(l?.accountName||"")},[t]);const{mutateAsync:s}=nl(),o=async l=>{await s(l.accountId),r(l.accountName)};return e.jsxs(Ae,{children:[e.jsx(Te,{asChild:!0,children:e.jsx(R,{variant:"default",className:"mb-4 h-8 w-8 rounded-lg p-0",disabled:!a?.accountName,children:e.jsx("span",{className:"text-base font-medium text-accent-background",children:a?n(a.accountName):"..."})})}),e.jsxs(Pe,{className:"w-55",side:"right",sideOffset:8,align:"start",children:[e.jsx("div",{className:"px-2 py-1.5 text-xs font-semibold text-foreground",children:"Accounts"}),t?.map(l=>e.jsxs(ie,{className:"flex items-center justify-between cursor-pointer",onClick:async()=>{try{await o(l),window.location.reload()}catch(c){console.error("Switch account failed",c)}},children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("div",{className:"h-6 w-6 rounded bg-primary/10 flex items-center justify-center",children:e.jsx("span",{className:"text-xs font-medium text-primary",children:n(l.accountName)})}),e.jsx("span",{className:"text-sm",children:l.accountName})]}),a?.activeAccountId===l.accountId&&e.jsx(g.Check,{className:"h-4 w-4 text-primary"})]},l.accountId))]})]})}function dl(){const{IKON_PLATFORM_UI_URL:t}=fe(),{data:a}=ol();function r(n){return n.split("-").map(s=>s.charAt(0).toUpperCase()+s.slice(1)).join("")}return e.jsxs(e.Fragment,{children:[" ",e.jsx("nav",{className:"flex flex-col gap-1",children:e.jsxs(te,{children:[e.jsx(ae,{asChild:!0,className:"h-8 w-8",children:e.jsx(R,{variant:"ghost",size:"icon",className:"h-10 w-10",asChild:!0,children:e.jsxs(xe.Link,{to:`${t}/home`,children:[e.jsx(g.Home,{className:"h-8 w-8"}),e.jsx("span",{className:"sr-only",children:"Home"})]})})}),e.jsx(re,{side:"right",sideOffset:5,children:"Home"})]},"home")}),e.jsx("nav",{className:"flex flex-col gap-1 flex-1",children:a?.map(n=>{if(!n.visible)return null;const s=!!(n.icon&&n.icon.trim()!=="");return e.jsxs(te,{children:[e.jsx(ae,{asChild:!0,className:"h-8 w-8",children:e.jsx(R,{variant:"ghost",size:"icon",className:"h-10 w-10",asChild:!0,children:e.jsxs(xe.Link,{to:n.url??"#",children:[s?e.jsx(ft,{name:r(n.icon??""),className:"h-8 w-8"}):e.jsx(g.FolderCode,{className:"h-8 w-8"}),e.jsx("span",{className:"sr-only",children:n.softwareName})]})})}),e.jsx(re,{side:"right",sideOffset:5,children:n.softwareName})]},n.softwareName)})})]})}const zn=()=>{const{IKON_PLATFORM_UI_URL:t}=fe();return e.jsx(ye,{delayDuration:0,children:e.jsxs("aside",{className:"fixed left-0 top-0 z-20 h-screen w-12 border-r border-border bg-sidebar text-sidebar-foreground flex flex-col items-center py-4 ",children:[e.jsx(cl,{}),e.jsx(dl,{}),e.jsxs(te,{children:[e.jsx(ae,{asChild:!0,className:"h-8 w-8",children:e.jsx(R,{variant:"ghost",className:"h-10 w-10",asChild:!0,children:e.jsxs(xe.Link,{to:`${t}/settings`,children:[e.jsx(g.Settings,{className:"h-8 w-8"}),e.jsx("span",{className:"sr-only",children:"Settings"})]})})}),e.jsx(re,{side:"right",sideOffset:5,children:"Settings"})]},"settings"),e.jsx(ll,{})]})})};function Mn({children:t}){return e.jsxs(e.Fragment,{children:[e.jsx(zn,{}),e.jsx(mr,{children:e.jsx(cn,{children:e.jsxs(In,{children:[e.jsx(An,{}),e.jsxs(gr,{className:"flex flex-col h-screen",children:[e.jsx(Pn,{}),e.jsx("div",{className:"flex flex-col gap-4 p-4 pt-0 ml-12 grow overflow-auto scrollbar-hidden",children:t}),e.jsx(Tn,{})]})]})})})]})}const Fn=m.createContext(void 0);function En({children:t}){const[a,r]=m.useState("Poppins"),[n,s]=m.useState(!1);m.useEffect(()=>{s(!0);const l=localStorage.getItem("app-font");l&&["Poppins","Oswald","Outfit"].includes(l)&&r(l)},[]),m.useEffect(()=>{if(!n)return;const l={Poppins:"var(--font-poppins)",Oswald:"var(--font-oswald)",Outfit:"var(--font-outfit)"};document.body.style.fontFamily=l[a],document.documentElement.style.fontFamily=l[a],localStorage.setItem("app-font",a),console.log("Font changed to:",a,l[a])},[a,n]);const o=m.useMemo(()=>({font:a,setFont:r}),[a]);return e.jsx(Fn.Provider,{value:o,children:t})}const ul=()=>{const t=m.useContext(Fn);if(t===void 0)throw new Error("useFont must be used within a FontProvider");return t},On=m.createContext(void 0);function Ln({children:t}){const[a,r]=m.useState(.5),[n,s]=m.useState(!1);m.useEffect(()=>{s(!0);const l=localStorage.getItem("app-radius");if(l){const c=parseFloat(l);[0,.25,.5,.75,1].includes(c)&&r(c)}},[]),m.useEffect(()=>{if(!n)return;const l=a===0?"0rem":`${a}rem`;document.documentElement.style.setProperty("--radius",l),localStorage.setItem("app-radius",a.toString()),console.log("Radius changed to:",a,l)},[a,n]);const o=m.useMemo(()=>({radius:a,setRadius:r}),[a]);return e.jsx(On.Provider,{value:o,children:t})}const ml=()=>{const t=m.useContext(On);if(t===void 0)throw new Error("useRadius must be used within a RadiusProvider");return t},Bn=m.createContext(void 0);function fl({children:t}){const[a,r]=m.useState(0),n=m.useCallback(()=>{r(s=>s+1)},[]);return e.jsx(Bn.Provider,{value:{refresh:n,refreshCounter:a},children:t})}function xl(){const t=m.useContext(Bn);if(t===void 0)throw new Error("useRefresh must be used within a RefreshProvider");return t}const pl=new Me.QueryClient;function gl({children:t}){return e.jsx(Me.QueryClientProvider,{client:pl,children:t})}function hl({children:t}){const a=fe();if(!a.IKON_BASE_API_URL||!a.IKON_PLATFORM_UI_URL||!a.LOGIN_PAGE_URL)throw new Error("[IKON] ProviderWrapper: Ikon config not set. Please call setIkonConfig() before rendering ProviderWrapper.");return e.jsx(gl,{children:e.jsx(il,{children:e.jsx(kr,{children:e.jsx(En,{children:e.jsx(Ln,{children:e.jsx(Nn,{children:e.jsx(fl,{children:e.jsx(xe.BrowserRouter,{children:e.jsx(Mn,{children:t})})})})})})})})})}function bl({activityLogs:t=[]}){const a=[{tabName:"Activity",tabId:"tab-activity",default:!0,tabContent:e.jsx("div",{className:"overflow-auto flex flex-col gap-2 h-full",children:t.length>0?t.map(r=>e.jsxs("div",{className:"border-b text-sm pb-2",children:[e.jsx("p",{className:"font-medium pb-1",children:r.activity}),e.jsxs("p",{className:"text-gray-500 pb-1",children:["Updated On:"," ",e.jsx("span",{className:"text-gray-700",children:new Date(r.updatedOn).toLocaleString()})]}),e.jsxs("p",{className:"text-gray-500 pb-1",children:["Updated By: ",e.jsx("span",{className:"text-gray-700",children:r.updatedBy})]})]},r.id)):e.jsx(ta,{text:"No Activity Logs Available"})})},{tabName:"File Upload",tabId:"tab-upload",default:!1,tabContent:e.jsx(Sn,{})}];return e.jsx(bn,{buttonText:"",buttonIcon:e.jsx(g.AlignJustify,{}),sheetTitle:"",sheetContent:e.jsx(vn,{tabArray:a,tabListClass:""}),closeButton:!0})}const vl=({src:t,onCroppedImage:a,aspectRatio:r,rotationAngle:n,zoomLevel:s,moveDirection:o})=>{const l=m.useRef(null);function c(d){const u=l.current?.cropper;if(u){const h=u.getCroppedCanvas().toDataURL("image/webp");a(h)}else console.log("Cropper instance is not available.")}return m.useEffect(()=>{const d=l.current?.cropper;d&&d.rotate(n)},[n]),m.useEffect(()=>{const d=l.current?.cropper;d&&d.getCropBoxData().width&&(console.log("Inside cropper scale"),d.scale(s))},[s]),m.useEffect(()=>{const d=l.current?.cropper;if(d&&d.getCropBoxData().width){const{x:f,y:h}=o;typeof f=="number"&&typeof h=="number"&&d.move(f,h)}},[o]),m.useEffect(()=>{const d=l.current?.cropper;if(d&&(d.setAspectRatio(r),r===1)){const u=d.getCanvasData(),f=u.width,h=u.height,w=u.left,C=u.top,v=200,N=100,b=w+(f-v)/2,y=C+(h-N)/2;d.setCropBoxData({left:b,top:y,width:v,height:N})}},[r]),e.jsx(ba,{src:t,style:{height:"100%",width:"100%",objectFit:"contain"},guides:!0,crop:c,ref:l,dragMode:"move",movable:!0,zoomable:!0,scalable:!0,cropBoxMovable:!0,cropBoxResizable:!1})},Un=m.memo(vl),ua={landscape:4/3,portrait:3/4,icon:1/1};function jl({onNewFileUpload:t}){const{originalImage:a,setOriginalImage:r,aspectRatioWiseImages:n,setAspectRatioWiseImages:s}=na(),[o,l]=m.useState(null),[c,d]=m.useState(),[u,f]=m.useState(0),[h,w]=m.useState(1),[C,v]=m.useState({x:0,y:0}),[N,b]=m.useState(null),y=j=>{j.preventDefault(),x(j.dataTransfer.files[0])},x=j=>{if(typeof j=="string")b(j);else if(j?.type?.startsWith("image/")){t?.();const p=new FileReader;p.onloadend=()=>{b(p.result),d(void 0)},p.readAsDataURL(j),r({...a,image:j,name:j.name})}else pa.toast.error("Please select a valid image file.")};m.useEffect(()=>{a.image&&x(a.image)},[a.image]);const k=j=>{const p=o&&c===j?o:n[j];return e.jsxs(e.Fragment,{children:[e.jsx("h3",{className:"mb-3",children:j}),e.jsx(zt,{ratio:ua[j],className:"bg-muted",children:p&&e.jsx("img",{src:p,alt:`Preview ${j}`,className:"absolute inset-0 w-full h-full object-contain"})})]})};return m.useEffect(()=>{o&&s(c?{...n,[c]:o}:{landscape:o,portrait:o,icon:o})},[o]),e.jsx(e.Fragment,{children:e.jsxs("div",{className:"flex flex-col gap-3 h-full overflow-auto",children:[e.jsxs("div",{className:"flex flex-col lg:flex-row gap-3 justify-between",children:[e.jsxs("div",{className:"w-full flex flex-col gap-4",children:[e.jsx(be,{htmlFor:"imageName",children:"Image Name"}),e.jsx(hn,{id:"inputImage",accept:"image/*",fileNamePlaceholder:"Enter image name",fileName:a?.name||"",onChange:j=>{const p=j.target.files?.[0];p&&x(p)},onFileNameChange:j=>{r({...a,name:j.target.value})}})]}),e.jsxs("div",{className:"w-full flex flex-col gap-4",children:[e.jsx(be,{htmlFor:"imageDescription",children:"Image Description"}),e.jsx($,{id:"imageDescription",placeholder:"Enter image Description",value:a?.description||"",onChange:j=>r({...a,description:j.target.value})})]})]}),e.jsxs("div",{className:"flex flex-col lg:flex-row gap-3",children:[e.jsxs("div",{className:"flex-grow flex flex-col gap-3",children:[e.jsxs("div",{children:[e.jsx("h3",{className:"mb-3",children:"Original Image"}),e.jsx(zt,{ratio:4/3,className:"flex justify-center items-center bg-muted text-muted-foreground",onDrop:y,onDragOver:j=>j.preventDefault(),children:N?e.jsx(Un,{src:N,onCroppedImage:l,aspectRatio:ua[c||"icon"],rotationAngle:u,zoomLevel:h,moveDirection:C}):e.jsxs("div",{className:"text-center",children:[e.jsx(be,{htmlFor:"inputImage",children:"Drag and drop an image here"}),e.jsx("div",{className:"mt-3",children:e.jsx(et,{variant:"outline",onClick:()=>document.getElementById("inputImage")?.click(),children:"Browse Image"})})]})})]}),e.jsxs("div",{className:"flex flex-col lg:flex-row gap-3 justify-between",children:[e.jsx("div",{children:e.jsxs(_e,{type:"single",variant:"outline",value:c,onValueChange:j=>d(j),children:[e.jsx(U,{className:"rounded-e-none",value:"landscape",children:e.jsx(g.ImageIcon,{})}),e.jsx(U,{className:"rounded-none border-x-0",value:"portrait",children:e.jsx(g.FileImage,{})}),e.jsx(U,{className:"rounded-s-none",value:"icon",children:e.jsx(g.Square,{})})]})}),e.jsxs("div",{className:"flex flex-col lg:flex-row gap-3 justify-between",children:[e.jsxs(_e,{type:"single",variant:"outline",value:"",onValueChange:j=>f(parseInt(j)),children:[e.jsx(U,{className:"rounded-e-none",value:"90",children:e.jsx(g.RotateCw,{})}),e.jsx(U,{className:"rounded-s-none border-s-0",value:"-90",children:e.jsx(g.RotateCcw,{})})]}),e.jsxs(_e,{type:"single",variant:"outline",value:"",children:[e.jsx(U,{className:"rounded-e-none",value:"up",onClick:()=>v({x:0,y:-5}),children:e.jsx(g.ArrowUp,{})}),e.jsx(U,{className:"rounded-none border-x-0",value:"down",onClick:()=>v({x:0,y:5}),children:e.jsx(g.ArrowDown,{})}),e.jsx(U,{className:"rounded-none border-e-0",value:"left",onClick:()=>v({x:-5,y:0}),children:e.jsx(g.ArrowLeft,{})}),e.jsx(U,{className:"rounded-s-none",value:"right",onClick:()=>v({x:5,y:0}),children:e.jsx(g.ArrowRight,{})})]}),e.jsxs(_e,{type:"single",variant:"outline",value:"",onValueChange:j=>w(p=>p+parseFloat(j)),children:[e.jsx(U,{className:"rounded-e-none",value:"0.1",children:e.jsx(g.ZoomIn,{})}),e.jsx(U,{className:"rounded-s-none border-s-0",value:"-0.1",children:e.jsx(g.ZoomOut,{})})]})]})]})]}),e.jsxs("div",{className:"flex flex-row lg:flex-col gap-3 w-full lg:w-48",children:[e.jsx("div",{className:"w-5/5",children:k("landscape")}),e.jsx("div",{className:"w-4/5",children:k("portrait")}),e.jsx("div",{className:"w-3/5",children:k("icon")})]})]})]})})}const Vn=m.memo(jl);function qn({open:t,onOpenChange:a,onCropperChange:r}){const{originalImage:n,aspectRatioWiseImages:s}=na();return e.jsx(ht,{modal:!0,open:t,onOpenChange:o=>{a(o)},children:e.jsxs(bt,{className:"max-w-full lg:max-w-5xl max-h-full overflow-auto",children:[e.jsx(Kt,{children:e.jsx(vt,{children:"Image to upload"})}),e.jsx(Vn,{}),e.jsx(Ga,{children:e.jsx(et,{onClick:()=>{r(n,s),a(!1)},children:"Save Changes"})})]})})}async function ot(t,a=""){if(!t||!t.resourceId)return null;try{return`${fe().IKON_BASE_API_URL}/platform/file-resource/download/${a}/${t.resourceId}`}catch(r){return console.error("Error getting resource URL:",r),null}}async function wl(t){if(!t)return null;const a=t.originalImageInfo?await ot(t.originalImageInfo):null,r=t.landscapeImageInfo?await ot(t.landscapeImageInfo):null,n=t.portraitImageInfo?await ot(t.portraitImageInfo):null,s=t.iconImageInfo?await ot(t.iconImageInfo):null;return{originalImage:{image:a,name:t.imageName,description:t.imageDescription},aspectRatioWiseImages:{landscape:r,portrait:n,icon:s}}}const Wn=m.createContext(void 0);function Nl({children:t,uploadedImages:a,onCropperChange:r,modalOpen:n,onModalOpenChange:s}){const[o,l]=m.useState({landscape:null,portrait:null,icon:null}),[c,d]=m.useState({image:null,name:"",description:""});return m.useEffect(()=>{async function u(){if(a)try{const f=await wl(a);f&&(d(h=>JSON.stringify(h)===JSON.stringify(f.originalImage)?h:f.originalImage),l(h=>JSON.stringify(h)===JSON.stringify(f.aspectRatioWiseImages)?h:f.aspectRatioWiseImages))}catch(f){console.error("Error processing uploaded images:",f)}}u()},[a]),e.jsxs(Wn.Provider,{value:{originalImage:c,setOriginalImage:d,aspectRatioWiseImages:o,setAspectRatioWiseImages:l},children:[t,n&&s&&e.jsx(qn,{open:n,onOpenChange:s,onCropperChange:r})]})}const na=()=>{const t=m.useContext(Wn);if(!t)throw new Error("useImageCropper must be used within a ImageCropperProvider");return t},Gn=({imageSrc:t,onCroppedImage:a,aspectRatio:r,rotationAngle:n,zoomLevel:s,moveDirection:o,currentState:l})=>{const c=m.useRef(null),d=()=>{const u=c.current?.cropper;if(u){u.setDragMode("move");const h=u.getCroppedCanvas().toDataURL();a(h)}else console.log("Cropper instance is not available.")};return m.useEffect(()=>{const u=c.current?.cropper;u&&u.rotate(n)},[n]),m.useEffect(()=>{const u=c.current?.cropper;u&&u.getCropBoxData().width&&(console.log("Inside cropper scale"),u.scale(s))},[s]),m.useEffect(()=>{const u=c.current?.cropper;if(u&&u.getCropBoxData().width){const{x:h,y:w}=o;typeof h=="number"&&typeof w=="number"&&u.move(h,w)}},[o]),m.useEffect(()=>{const u=c.current?.cropper;if(u&&(u.setAspectRatio(r),r===1)){const f=u.getCanvasData(),h=f.width,w=f.height,C=f.left,v=f.top,N=200,b=100,y=C+(h-N)/2,x=v+(w-b)/2;u.setCropBoxData({left:y,top:x,width:N,height:b})}},[r]),e.jsx(ba,{src:t,style:{height:"100%",width:"100%",objectFit:"contain"},guides:!0,crop:d,ref:c,dragMode:"move",movable:!0,zoomable:!0,scalable:!0,cropBoxMovable:!0,cropBoxResizable:!1})},yl=({open:t,setOpen:a,onImageSubmit:r})=>{const[n,s]=m.useState(null),[o,l]=m.useState(null),[c,d]=m.useState({first:null,second:null,third:null}),[u,f]=m.useState(4/3),[h,w]=m.useState("first"),[C,v]=m.useState(0),[N,b]=m.useState(1),[y,x]=m.useState({x:0,y:0}),[k,j]=m.useState(""),p=()=>{console.log("Image Submit Button is pressed"),console.log(c),r(c.third),a(!1)},S=z=>{v(E=>E+z)},A=()=>{x({x:0,y:-5})},D=()=>{x({x:0,y:5})},M=()=>{x({x:-5,y:0})},O=()=>{x({x:5,y:0})},he=()=>{b(z=>{const E=z+.2;return E<=2?E:z})},Ee=()=>{b(z=>{const E=z-.2;return E>=.2?E:z})},De=(z,E)=>{f(z),w(E)},T=z=>{if(z.type.startsWith("image/")){const E=new FileReader;E.onloadend=()=>{s(E.result),j(Ve=>Ve||z.name)},E.readAsDataURL(z)}else alert("Please drop a valid image file.")},P=z=>{z.preventDefault(),T(z.dataTransfer.files[0])},V=z=>{const E=o&&h===z?o:c[z];return E?e.jsx("div",{className:`
4
- ${z==="first"?"relative w-3/5 h-[200px] bg-slate-400":z==="second"?"relative w-1/2 h-[220px] bg-slate-400":"relative w-1/3 h-[120px] bg-slate-400"}`,children:e.jsx("img",{src:E,alt:`Preview ${z}`,className:"absolute inset-0 w-full h-full object-contain"})}):e.jsx("div",{className:`
5
- ${z==="first"?"relative w-3/5 h-[200px] bg-slate-400":z==="second"?"relative w-1/2 h-[220px] bg-slate-400":"relative w-1/3 h-[120px] bg-slate-400"}`})};return m.useEffect(()=>{o&&(c.first===null||c.second===null||c.third===null?d({first:o,second:o,third:o}):d(z=>({...z,[h]:o})))},[o]),e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"flex flex-row gap-2",children:[e.jsxs("div",{className:"flex-1",children:[e.jsx(be,{htmlFor:"imageName",children:"Image Name"}),e.jsx($,{id:"imageName",placeholder:"Enter image name",value:k,onChange:z=>j(z.target.value)})]}),e.jsxs("div",{className:"self-end",children:[e.jsx(R,{variant:"outline",onClick:()=>document.getElementById("inputImage1")?.click(),children:e.jsx(g.Upload,{})}),e.jsx($,{id:"inputImage1",type:"file",accept:"image/png, image/jpeg",className:"hidden",onChange:z=>{const E=z.target.files?.[0];if(E&&E.type.startsWith("image/")){const Ve=new FileReader;Ve.onloadend=()=>{s(Ve.result),j(Yn=>Yn||E.name)},Ve.readAsDataURL(E),d({first:null,second:null,third:null})}}})]}),e.jsxs("div",{className:"flex-1",children:[e.jsx(be,{htmlFor:"imageDesc",children:"Image Description"}),e.jsx($,{id:"imageDesc",placeholder:"Describe your image"})]})]}),e.jsxs("div",{className:"flex flex-row gap-2",children:[e.jsx("div",{className:"w-3/5 flex justify-center items-center border-2 border-dashed border-gray-400 bg-gray-100",style:{height:"70vh"},onDrop:P,onDragOver:z=>z.preventDefault(),children:n?e.jsx(Gn,{imageSrc:n,onCroppedImage:l,aspectRatio:u,rotationAngle:C,zoomLevel:N,moveDirection:y,currentState:h}):e.jsxs("div",{className:"text-center",children:[e.jsx(be,{htmlFor:"inputImage",children:"Drag and drop an image here"}),e.jsxs("div",{className:"mt-4",children:[e.jsx(R,{variant:"outline",onClick:()=>document.getElementById("inputImage")?.click(),children:"Upload Image"}),e.jsx($,{id:"inputImage",type:"file",accept:"image/png, image/jpeg",className:"hidden",onChange:z=>{const E=z.target.files?.[0];E&&T(E)}})]})]})}),e.jsxs("div",{className:"w-2/5 flex flex-col gap-2",children:[e.jsx("h3",{children:"Landscape"}),V("first"),e.jsx("h3",{children:"Potrait"}),V("second"),e.jsx("h3",{children:"Icon"}),V("third")]})]}),e.jsxs("div",{className:"flex flex-row gap-1",children:[e.jsxs("div",{className:"w-3/5 flex flex-row justify-between",children:[e.jsxs("div",{children:[e.jsx(R,{variant:"outline",onClick:()=>De(4/3,"first"),children:e.jsx(g.ImageIcon,{})}),e.jsx(R,{variant:"outline",onClick:()=>De(3/4,"second"),children:e.jsx(g.FileImage,{})}),e.jsx(R,{variant:"outline",onClick:()=>De(1/1,"third"),children:e.jsx(g.Square,{})})]}),e.jsxs("div",{children:[e.jsx(R,{onClick:()=>S(90),variant:"outline",children:e.jsx(g.RotateCw,{})}),e.jsx(R,{onClick:()=>S(-90),variant:"outline",children:e.jsx(g.RotateCcw,{})})]}),e.jsxs("div",{children:[e.jsx(R,{onClick:()=>he(),variant:"outline",children:e.jsx(g.ZoomIn,{})}),e.jsx(R,{onClick:()=>Ee(),variant:"outline",children:e.jsx(g.ZoomOut,{})})]}),e.jsxs("div",{children:[e.jsx(R,{onClick:A,variant:"outline",children:e.jsx(g.ArrowUp,{})}),e.jsx(R,{onClick:D,variant:"outline",children:e.jsx(g.ArrowDown,{})}),e.jsx(R,{onClick:M,variant:"outline",children:e.jsx(g.ArrowLeft,{})}),e.jsx(R,{onClick:O,variant:"outline",children:e.jsx(g.ArrowRight,{})})]})]}),e.jsx("div",{className:"w-2/5 flex flex-row-reverse",children:e.jsx(R,{onClick:p,children:"Save"})})]})]})},Cl=m.memo(yl);function Il(){return e.jsx("div",{className:"flex h-full items-center justify-center",children:e.jsxs("div",{className:"bg-background text-forefround rounded-xl p-6 text-center max-w-md",children:[e.jsx("div",{className:"text-3xl font-bold mb-2 animate-pulse",children:"🚧 Work in Progress"}),e.jsx("p",{className:"text-muted-foreground",children:"We’re currently working on this section. Check back soon!"})]})})}function kl({formControl:t,name:a,label:r,options:n,placeholder:s="Select an option",emptyMessage:o="No options found.",onValueChange:l,className:c,addNewPlaceholder:d="Add custom value...",formDescription:u,disabled:f}){const[h,w]=I.useState(!1),[C,v]=I.useState(""),[N,b]=I.useState(n),[y,x]=I.useState(!1),[k,j]=I.useState("");return I.useEffect(()=>{b(n)},[n]),e.jsx(ce,{control:t,name:a,render:({field:p})=>{const S=N.find(D=>D.value===p.value),A=()=>{const D=k.trim();if(!D)return;if(N.some(O=>O.value===D)){const O=N.find(he=>he.value===D);O&&(p.onChange(O.value),l?.(O.value),j(""),x(!1),w(!1),v(""));return}const M={value:D,label:D,disabled:!0};b(O=>[...O,M]),p.onChange(D),l?.(D),j(""),x(!1),w(!1),v("")};return e.jsxs(de,{className:i(c),children:[r&&e.jsxs(e.Fragment,{children:[e.jsx(pe,{children:r}),e.jsx("br",{})]}),e.jsxs(J,{open:h,onOpenChange:D=>{w(D),D||(v(""),x(!1),j(""))},children:[e.jsx(X,{asChild:!0,children:e.jsx(ue,{children:e.jsxs(R,{variant:"outline",role:"combobox","aria-expanded":h,className:i("w-full justify-between",!p.value&&"text-foreground/50",c),disabled:f||p.disabled,children:[e.jsx("span",{className:"line-clamp-1 text-left",children:p.value?S?S.label:p.value:s}),e.jsx(g.ChevronsUpDown,{className:"ml-2 h-4 w-4 shrink-0 opacity-50"})]})})}),e.jsx(Q,{className:"p-0 w-[--radix-popover-trigger-width]",align:"start",children:e.jsxs(Y,{shouldFilter:!0,children:[e.jsx(ne,{placeholder:"Search...",value:C,onValueChange:v}),e.jsxs(se,{children:[e.jsx(oe,{children:C&&N.length>0?"No results found.":o}),e.jsx(ee,{children:N.filter(D=>D.label.toLowerCase().includes(C.toLowerCase())||D.value.toLowerCase().includes(C.toLowerCase())).map(D=>e.jsxs(K,{value:D.value,onSelect:M=>{p.onChange(M),l?.(M),w(!1),v("")},className:"cursor-pointer",disabled:D?.disabled,children:[e.jsx(g.Check,{className:i("mr-2 h-4 w-4",p.value===D.value?"opacity-100":"opacity-0")}),D.label]},D.value))})]}),e.jsx("div",{className:"border-t p-2",children:y?e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx($,{placeholder:d,value:k,onChange:D=>j(D.target.value),onKeyDown:D=>{D.key==="Enter"&&(D.preventDefault(),A()),D.key==="Escape"&&(x(!1),j(""))},autoFocus:!0,className:"h-8"}),e.jsx(R,{size:"sm",variant:"ghost",onClick:()=>{x(!1),j("")},className:"h-8",children:"Cancel"}),e.jsx(R,{size:"sm",variant:"default",onClick:A,className:"h-8",disabled:!k.trim()||N.some(D=>D.value===k.trim()),children:"Add"})]}):e.jsxs(R,{variant:"outline",className:"w-full justify-start",onClick:()=>x(!0),children:[e.jsx(g.Plus,{className:"mr-2 h-4 w-4"}),"Add new option"]})})]})})]}),u&&e.jsx(ge,{children:u}),e.jsx(me,{})]})}})}const le=m.forwardRef(({children:t,tooltip:a,side:r="bottom",className:n,...s},o)=>e.jsxs(te,{children:[e.jsx(ae,{asChild:!0,children:e.jsxs(R,{variant:"ghost",size:"icon",...s,className:i("aui-button-icon size-6 p-1",n),ref:o,children:[e.jsx(Ut.Slottable,{children:t}),e.jsx("span",{className:"aui-sr-only sr-only",children:a})]})}),e.jsx(re,{side:r,children:a})]}));le.displayName="TooltipIconButton";const Sl=()=>e.jsx(kt.MarkdownTextPrimitive,{remarkPlugins:[ks],className:"aui-md",components:Dl}),Al=m.memo(Sl),Tl=({language:t,code:a})=>{const{isCopied:r,copyToClipboard:n}=Pl(),s=()=>{!a||r||n(a)};return e.jsxs("div",{className:"aui-code-header-root mt-4 flex items-center justify-between gap-4 rounded-t-lg bg-muted-foreground/15 px-4 py-2 font-semibold text-foreground text-sm dark:bg-muted-foreground/20",children:[e.jsx("span",{className:"aui-code-header-language lowercase [&>span]:text-xs",children:t}),e.jsxs(le,{tooltip:"Copy",onClick:s,children:[!r&&e.jsx(g.CopyIcon,{}),r&&e.jsx(g.CheckIcon,{})]})]})},Pl=({copiedDuration:t=3e3}={})=>{const[a,r]=m.useState(!1);return{isCopied:a,copyToClipboard:s=>{s&&navigator.clipboard.writeText(s).then(()=>{r(!0),setTimeout(()=>r(!1),t)})}}},Dl=kt.unstable_memoizeMarkdownComponents({h1:({className:t,...a})=>e.jsx("h1",{className:i("aui-md-h1 mb-8 scroll-m-20 font-extrabold text-4xl tracking-tight last:mb-0",t),...a}),h2:({className:t,...a})=>e.jsx("h2",{className:i("aui-md-h2 mt-8 mb-4 scroll-m-20 font-semibold text-3xl tracking-tight first:mt-0 last:mb-0",t),...a}),h3:({className:t,...a})=>e.jsx("h3",{className:i("aui-md-h3 mt-6 mb-4 scroll-m-20 font-semibold text-2xl tracking-tight first:mt-0 last:mb-0",t),...a}),h4:({className:t,...a})=>e.jsx("h4",{className:i("aui-md-h4 mt-6 mb-4 scroll-m-20 font-semibold text-xl tracking-tight first:mt-0 last:mb-0",t),...a}),h5:({className:t,...a})=>e.jsx("h5",{className:i("aui-md-h5 my-4 font-semibold text-lg first:mt-0 last:mb-0",t),...a}),h6:({className:t,...a})=>e.jsx("h6",{className:i("aui-md-h6 my-4 font-semibold first:mt-0 last:mb-0",t),...a}),p:({className:t,...a})=>e.jsx("p",{className:i("aui-md-p mt-5 mb-5 leading-7 first:mt-0 last:mb-0",t),...a}),a:({className:t,...a})=>e.jsx("a",{className:i("aui-md-a font-medium text-primary underline underline-offset-4",t),...a}),blockquote:({className:t,...a})=>e.jsx("blockquote",{className:i("aui-md-blockquote border-l-2 pl-6 italic",t),...a}),ul:({className:t,...a})=>e.jsx("ul",{className:i("aui-md-ul my-5 ml-6 list-disc [&>li]:mt-2",t),...a}),ol:({className:t,...a})=>e.jsx("ol",{className:i("aui-md-ol my-5 ml-6 list-decimal [&>li]:mt-2",t),...a}),hr:({className:t,...a})=>e.jsx("hr",{className:i("aui-md-hr my-5 border-b",t),...a}),table:({className:t,...a})=>e.jsx("table",{className:i("aui-md-table my-5 w-full border-separate border-spacing-0 overflow-y-auto",t),...a}),th:({className:t,...a})=>e.jsx("th",{className:i("aui-md-th bg-muted px-4 py-2 text-left font-bold first:rounded-tl-lg last:rounded-tr-lg [[align=center]]:text-center [[align=right]]:text-right",t),...a}),td:({className:t,...a})=>e.jsx("td",{className:i("aui-md-td border-b border-l px-4 py-2 text-left last:border-r [[align=center]]:text-center [[align=right]]:text-right",t),...a}),tr:({className:t,...a})=>e.jsx("tr",{className:i("aui-md-tr m-0 border-b p-0 first:border-t [&:last-child>td:first-child]:rounded-bl-lg [&:last-child>td:last-child]:rounded-br-lg",t),...a}),sup:({className:t,...a})=>e.jsx("sup",{className:i("aui-md-sup [&>a]:text-xs [&>a]:no-underline",t),...a}),pre:({className:t,...a})=>e.jsx("pre",{className:i("aui-md-pre overflow-x-auto rounded-t-none!rounded-b-lg bg-black p-4 text-white",t),...a}),code:function({className:a,...r}){const n=kt.useIsMarkdownCodeBlock();return e.jsx("code",{className:i(!n&&"aui-md-inline-code rounded border bg-muted font-semibold",a),...r})},CodeHeader:Tl}),Rl=({toolName:t,argsText:a,result:r,status:n})=>{const[s,o]=m.useState(!0),l=n?.type==="incomplete"&&n.reason==="cancelled",c=l&&n.error?typeof n.error=="string"?n.error:JSON.stringify(n.error):null;return e.jsxs("div",{className:i("aui-tool-fallback-root mb-4 flex w-full flex-col gap-3 rounded-lg border py-3",l&&"border-muted-foreground/30 bg-muted/30"),children:[e.jsxs("div",{className:"aui-tool-fallback-header flex items-center gap-2 px-4",children:[l?e.jsx(g.XCircleIcon,{className:"aui-tool-fallback-icon size-4 text-muted-foreground"}):e.jsx(g.CheckIcon,{className:"aui-tool-fallback-icon size-4"}),e.jsxs("p",{className:i("aui-tool-fallback-title grow",l&&"text-muted-foreground line-through"),children:[l?"Cancelled tool: ":"Used tool: ",e.jsx("b",{children:t})]}),e.jsx(R,{onClick:()=>o(!s),children:s?e.jsx(g.ChevronUpIcon,{}):e.jsx(g.ChevronDownIcon,{})})]}),!s&&e.jsxs("div",{className:"aui-tool-fallback-content flex flex-col gap-2 border-t pt-2",children:[c&&e.jsxs("div",{className:"aui-tool-fallback-cancelled-root px-4",children:[e.jsx("p",{className:"aui-tool-fallback-cancelled-header font-semibold text-muted-foreground",children:"Cancelled reason:"}),e.jsx("p",{className:"aui-tool-fallback-cancelled-reason text-muted-foreground",children:c})]}),e.jsx("div",{className:i("aui-tool-fallback-args-root px-4",l&&"opacity-60"),children:e.jsx("pre",{className:"aui-tool-fallback-args-value whitespace-pre-wrap",children:a})}),!l&&r!==void 0&&e.jsxs("div",{className:"aui-tool-fallback-result-root border-t border-dashed px-4 pt-2",children:[e.jsx("p",{className:"aui-tool-fallback-result-header font-semibold",children:"Result:"}),e.jsx("pre",{className:"aui-tool-fallback-result-content whitespace-pre-wrap",children:typeof r=="string"?r:JSON.stringify(r,null,2)})]})]})]})},ma=t=>Symbol.iterator in t,fa=t=>"entries"in t,xa=(t,a)=>{const r=t instanceof Map?t:new Map(t.entries()),n=a instanceof Map?a:new Map(a.entries());if(r.size!==n.size)return!1;for(const[s,o]of r)if(!n.has(s)||!Object.is(o,n.get(s)))return!1;return!0},_l=(t,a)=>{const r=t[Symbol.iterator](),n=a[Symbol.iterator]();let s=r.next(),o=n.next();for(;!s.done&&!o.done;){if(!Object.is(s.value,o.value))return!1;s=r.next(),o=n.next()}return!!s.done&&!!o.done};function zl(t,a){return Object.is(t,a)?!0:typeof t!="object"||t===null||typeof a!="object"||a===null||Object.getPrototypeOf(t)!==Object.getPrototypeOf(a)?!1:ma(t)&&ma(a)?fa(t)&&fa(a)?xa(t,a):_l(t,a):xa({entries:()=>Object.entries(t)},{entries:()=>Object.entries(a)})}function Ml(t){const a=m.useRef(void 0);return r=>{const n=t(r);return zl(a.current,n)?a.current:a.current=n}}const Fl=t=>{const[a,r]=m.useState(void 0);return m.useEffect(()=>{if(!t){r(void 0);return}const n=URL.createObjectURL(t);return r(n),()=>{URL.revokeObjectURL(n)}},[t]),a},$n=()=>{const{file:t,src:a}=_.useAssistantState(Ml(({attachment:r})=>{if(r.type!=="image")return{};if(r.file)return{file:r.file};const n=r.content?.filter(s=>s.type==="image")[0]?.image;return n?{src:n}:{}}));return Fl(t)??a},El=({src:t})=>{const[a,r]=m.useState(!1);return e.jsx("img",{src:t,alt:"Image Preview",width:1,height:1,className:a?"aui-attachment-preview-image-loaded block h-auto max-h-[80vh] w-auto max-w-full object-contain":"aui-attachment-preview-image-loading hidden",onLoad:()=>r(!0),loading:"lazy"})},Ol=({children:t})=>{const a=$n();return a?e.jsxs(ht,{children:[e.jsx(Va,{className:"aui-attachment-preview-trigger cursor-pointer transition-colors hover:bg-accent/50",asChild:!0,children:t}),e.jsxs(bt,{className:"aui-attachment-preview-dialog-content p-2 sm:max-w-3xl [&>button]:rounded-full [&>button]:bg-foreground/60 [&>button]:p-1 [&>button]:opacity-100 [&>button]:ring-0! [&_svg]:text-background [&>button]:hover:[&_svg]:text-destructive",children:[e.jsx(vt,{className:"aui-sr-only sr-only",children:"Image Attachment Preview"}),e.jsx("div",{className:"aui-attachment-preview relative mx-auto flex max-h-[80dvh] w-full items-center justify-center overflow-hidden bg-background",children:e.jsx(El,{src:a})})]})]}):t},Ll=()=>{const t=_.useAssistantState(({attachment:r})=>r.type==="image"),a=$n();return e.jsxs(Ma,{className:"aui-attachment-tile-avatar h-full w-full rounded-none",children:[e.jsx(Fa,{src:a,alt:"Attachment preview",className:"aui-attachment-tile-image object-cover"}),e.jsx(Ea,{delayMs:t?200:0,children:e.jsx(g.FileText,{className:"aui-attachment-tile-fallback-icon size-8 text-muted-foreground"})})]})},Hn=()=>{const a=_.useAssistantApi().attachment.source==="composer",r=_.useAssistantState(({attachment:s})=>s.type==="image"),n=_.useAssistantState(({attachment:s})=>{const o=s.type;switch(o){case"image":return"Image";case"document":return"Document";case"file":return"File";default:{const l=o;throw new Error(`Unknown attachment type: ${l}`)}}});return e.jsxs(te,{children:[e.jsxs(_.AttachmentPrimitive.Root,{className:i("aui-attachment-root relative",r&&"aui-attachment-root-composer only:[&>#attachment-tile]:size-24"),children:[e.jsx(Ol,{children:e.jsx(ae,{asChild:!0,children:e.jsx("div",{className:i("aui-attachment-tile size-14 cursor-pointer overflow-hidden rounded-[14px] border bg-muted transition-opacity hover:opacity-75",a&&"aui-attachment-tile-composer border-foreground/20"),role:"button",id:"attachment-tile","aria-label":`${n} attachment`,children:e.jsx(Ll,{})})})}),a&&e.jsx(Bl,{})]}),e.jsx(re,{side:"top",children:e.jsx(_.AttachmentPrimitive.Name,{})})]})},Bl=()=>e.jsx(_.AttachmentPrimitive.Remove,{asChild:!0,children:e.jsx(le,{tooltip:"Remove file",className:"aui-attachment-tile-remove absolute top-1.5 right-1.5 size-3.5 rounded-full bg-white text-muted-foreground opacity-100 shadow-sm hover:bg-white! [&_svg]:text-black hover:[&_svg]:text-destructive",side:"top",children:e.jsx(g.XIcon,{className:"aui-attachment-remove-icon size-3 dark:stroke-[2.5px]"})})}),Ul=()=>e.jsx("div",{className:"aui-user-message-attachments-end col-span-full col-start-1 row-start-1 flex w-full flex-row justify-end gap-2",children:e.jsx(_.MessagePrimitive.Attachments,{components:{Attachment:Hn}})}),Vl=()=>e.jsx("div",{className:"aui-composer-attachments mb-2 flex w-full flex-row items-center gap-2 overflow-x-auto px-1.5 pt-0.5 pb-1 empty:hidden",children:e.jsx(_.ComposerPrimitive.Attachments,{components:{Attachment:Hn}})}),ql=()=>e.jsx(_.ComposerPrimitive.AddAttachment,{asChild:!0,children:e.jsx(le,{tooltip:"Add Attachment",side:"bottom",variant:"ghost",size:"icon",className:"aui-composer-add-attachment size-8.5 rounded-full p-1 font-semibold text-xs hover:bg-muted-foreground/15 dark:border-muted-foreground/15 dark:hover:bg-muted-foreground/30","aria-label":"Add Attachment",children:e.jsx(g.PlusIcon,{className:"aui-attachment-add-icon size-5 stroke-[1.5px]"})})}),Wl=({agents:t,selectedAgent:a,onSelectAgent:r,className:n,triggerClassName:s})=>{const[o,l]=m.useState(!1),c=a||null;return e.jsxs(Ae,{open:o,onOpenChange:l,children:[e.jsx(Te,{asChild:!0,children:e.jsxs(R,{variant:"outline",className:i("gap-2 px-3 py-2 text-sm font-medium rounded-2xl",s),children:[e.jsx("span",{className:"truncate",children:c?.agentName||"Select Agent"}),e.jsx(g.ChevronDownIcon,{className:"size-4 shrink-0 opacity-50"})]})}),e.jsx(Pe,{align:"end",className:i("min-w-[200px]",n),children:t.length>0?e.jsxs(e.Fragment,{children:[e.jsx(Jt,{className:"px-2 py-1.5 text-xs font-semibold text-muted-foreground",children:"Agents"}),e.jsx(jt,{}),e.jsx(Yt,{children:t.map(d=>e.jsxs(ie,{onClick:()=>{r(d),l(!1)},className:i("cursor-pointer flex flex-col gap-1",c?.agentID===d.agentID&&"bg-accent"),children:[e.jsx("div",{className:"font-medium text-sm",children:d.agentName}),d.agentDescription&&e.jsx("div",{className:"text-xs text-muted-foreground truncate",children:d.agentDescription})]},d.agentID))})]}):e.jsx("div",{className:"px-2 py-1.5 text-sm text-muted-foreground text-center",children:"No agents available"})})]})},Gl=({currentUserDetails:t,agents:a=[],initialAgentId:r="default-agent",initialAgentName:n="Default Agent",onAgentChange:s})=>{const[o,l]=m.useState(a.find(c=>c.agentID===r));return e.jsx(it.LazyMotion,{features:it.domAnimation,children:e.jsx(it.MotionConfig,{reducedMotion:"user",children:e.jsx(_.ThreadPrimitive.Root,{className:"aui-root aui-thread-root @container flex h-full flex-col bg-background",style:{"--thread-max-width":"44rem"},children:e.jsxs(_.ThreadPrimitive.Viewport,{turnAnchor:"top",className:"aui-thread-viewport relative flex flex-1 flex-col overflow-x-auto overflow-y-scroll scroll-smooth px-4 pt-4",children:[e.jsx(_.ThreadPrimitive.If,{empty:!0,children:e.jsx(Hl,{currentUserDetails:t})}),e.jsx(_.ThreadPrimitive.Messages,{components:{UserMessage:ec,EditComposer:ac,AssistantMessage:Ql}}),e.jsxs(_.ThreadPrimitive.ViewportFooter,{className:"aui-thread-viewport-footer sticky bottom-0 mx-auto mt-4 flex w-full max-w-[var(--thread-max-width)] flex-col gap-4 overflow-visible rounded-t-3xl bg-background pb-4 md:pb-6",children:[e.jsx($l,{}),e.jsx(Yl,{agents:a,selectedAgent:o,onSelectAgent:c=>{l(c),s?.(c)}})]})]})})})})},$l=()=>e.jsx(_.ThreadPrimitive.ScrollToBottom,{asChild:!0,children:e.jsx(le,{tooltip:"Scroll to bottom",variant:"outline",className:"aui-thread-scroll-to-bottom absolute -top-12 z-10 self-center rounded-full p-4 disabled:invisible dark:bg-background dark:hover:bg-accent",children:e.jsx(g.ArrowDownIcon,{})})}),Hl=({currentUserDetails:t})=>{const r=new Date().getHours();let n="";return r>=5&&r<12?n="Good Morning":r>=12&&r<17?n="Good Afternoon":r>=17&&r<21?n="Good Evening":n="Good Night",console.log(n),e.jsxs("div",{className:"aui-thread-welcome-root mx-auto my-auto flex w-full max-w-[var(--thread-max-width)] flex-grow flex-col",children:[e.jsx("div",{className:"aui-thread-welcome-center flex w-full flex-grow flex-col items-center justify-center",children:e.jsxs("div",{className:"aui-thread-welcome-message flex size-full flex-col justify-center px-8",children:[e.jsx(At.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},exit:{opacity:0,y:10},className:"aui-thread-welcome-message-motion-1 text-2xl font-semibold",children:`${n} ${t.userName.split(" ")[0]}`}),e.jsx(At.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},exit:{opacity:0,y:10},transition:{delay:.1},className:"aui-thread-welcome-message-motion-2 text-2xl text-muted-foreground/65",children:"How can I help you today?"})]})}),e.jsx(Kl,{})]})},Kl=()=>e.jsx("div",{className:"aui-thread-welcome-suggestions grid w-full gap-2 pb-4 @md:grid-cols-2",children:[{title:"What's the weather",label:"in San Francisco?",action:"What's the weather in San Francisco?"},{title:"Explain React hooks",label:"like useState and useEffect",action:"Explain React hooks like useState and useEffect"},{title:"Write a SQL query",label:"to find top customers",action:"Write a SQL query to find top customers"},{title:"Create a meal plan",label:"for healthy weight loss",action:"Create a meal plan for healthy weight loss"}].map((t,a)=>e.jsx(At.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},exit:{opacity:0,y:20},transition:{delay:.05*a},className:"aui-thread-welcome-suggestion-display [&:nth-child(n+3)]:hidden @md:[&:nth-child(n+3)]:block",children:e.jsx(_.ThreadPrimitive.Suggestion,{prompt:t.action,send:!0,asChild:!0,children:e.jsxs(R,{variant:"ghost",className:"aui-thread-welcome-suggestion h-auto w-full flex-1 flex-wrap items-start justify-start gap-1 rounded-3xl border px-5 py-4 text-left text-sm @md:flex-col dark:hover:bg-accent/60","aria-label":t.action,children:[e.jsx("span",{className:"aui-thread-welcome-suggestion-text-1 font-medium",children:t.title}),e.jsx("span",{className:"aui-thread-welcome-suggestion-text-2 text-muted-foreground",children:t.label})]})})},`suggested-action-${t.title}-${a}`))}),Yl=({agents:t=[],selectedAgent:a,onSelectAgent:r})=>e.jsx(_.ComposerPrimitive.Root,{className:"aui-composer-root relative flex w-full flex-col",children:e.jsxs(_.ComposerPrimitive.AttachmentDropzone,{className:"aui-composer-attachment-dropzone group/input-group flex w-full flex-col rounded-3xl border border-input bg-background px-1 pt-2 shadow-xs transition-[color,box-shadow] outline-none has-[textarea:focus-visible]:border-ring has-[textarea:focus-visible]:ring-[3px] has-[textarea:focus-visible]:ring-ring/50 data-[dragging=true]:border-dashed data-[dragging=true]:border-ring data-[dragging=true]:bg-accent/50 dark:bg-background",children:[e.jsx(Vl,{}),e.jsx(_.ComposerPrimitive.Input,{placeholder:"Send a message...",className:"aui-composer-input mb-1 max-h-32 min-h-16 w-full resize-none bg-transparent px-3.5 pt-1.5 pb-3 text-base outline-none placeholder:text-muted-foreground focus-visible:ring-0",rows:1,autoFocus:!0,"aria-label":"Message input"}),e.jsx(Jl,{agents:t,selectedAgent:a,onSelectAgent:r})]})}),Jl=({agents:t=[],selectedAgent:a,onSelectAgent:r})=>e.jsxs("div",{className:"aui-composer-action-wrapper relative mx-1 mt-2 mb-2 flex items-center justify-between",children:[e.jsx(ql,{}),e.jsxs("div",{className:"flex gap-3",children:[t.length>0&&e.jsx(Wl,{agents:t,selectedAgent:a,onSelectAgent:r??(()=>{}),triggerClassName:"h-9 text-xs"}),e.jsx(_.ThreadPrimitive.If,{running:!1,children:e.jsx(_.ComposerPrimitive.Send,{asChild:!0,children:e.jsx(le,{tooltip:"Send message",side:"bottom",type:"submit",variant:"default",size:"icon",className:"aui-composer-send size-[34px] rounded-full p-1","aria-label":"Send message",children:e.jsx(g.ArrowUpIcon,{className:"aui-composer-send-icon size-5"})})})}),e.jsx(_.ThreadPrimitive.If,{running:!0,children:e.jsx(_.ComposerPrimitive.Cancel,{asChild:!0,children:e.jsx(R,{type:"button",variant:"default",size:"icon",className:"aui-composer-cancel size-[34px] rounded-full border border-muted-foreground/60 hover:bg-primary/75 dark:border-muted-foreground/90","aria-label":"Stop generating",children:e.jsx(g.Square,{className:"aui-composer-cancel-icon size-3.5 fill-white dark:fill-black"})})})})]})]}),Xl=()=>e.jsx(_.MessagePrimitive.Error,{children:e.jsx(_.ErrorPrimitive.Root,{className:"aui-message-error-root mt-2 rounded-md border border-destructive bg-destructive/10 p-3 text-sm text-destructive dark:bg-destructive/5 dark:text-red-200",children:e.jsx(_.ErrorPrimitive.Message,{className:"aui-message-error-message line-clamp-2"})})}),Ql=()=>e.jsxs(_.MessagePrimitive.Root,{className:"aui-assistant-message-root relative mx-auto w-full max-w-[var(--thread-max-width)] animate-in py-4 duration-150 ease-out fade-in slide-in-from-bottom-1","data-role":"assistant",children:[e.jsxs("div",{className:"aui-assistant-message-content mx-2 leading-7 break-words text-foreground",children:[e.jsx(_.MessagePrimitive.Parts,{components:{Text:Al,tools:{Fallback:Rl}}}),e.jsx(Xl,{})]}),e.jsxs("div",{className:"aui-assistant-message-footer mt-2 ml-2 flex",children:[e.jsx(Kn,{}),e.jsx(Zl,{})]})]}),Zl=()=>e.jsxs(_.ActionBarPrimitive.Root,{hideWhenRunning:!0,autohide:"not-last",autohideFloat:"single-branch",className:"aui-assistant-action-bar-root col-start-3 row-start-2 -ml-1 flex gap-1 text-muted-foreground data-floating:absolute data-floating:rounded-md data-floating:border data-floating:bg-background data-floating:p-1 data-floating:shadow-sm",children:[e.jsx(_.ActionBarPrimitive.Copy,{asChild:!0,children:e.jsxs(le,{tooltip:"Copy",children:[e.jsx(_.MessagePrimitive.If,{copied:!0,children:e.jsx(g.CheckIcon,{})}),e.jsx(_.MessagePrimitive.If,{copied:!1,children:e.jsx(g.CopyIcon,{})})]})}),e.jsx(_.ActionBarPrimitive.Reload,{asChild:!0,children:e.jsx(le,{tooltip:"Refresh",children:e.jsx(g.RefreshCwIcon,{})})})]}),ec=()=>e.jsxs(_.MessagePrimitive.Root,{className:"aui-user-message-root mx-auto grid w-full max-w-[var(--thread-max-width)] animate-in auto-rows-auto grid-cols-[minmax(72px,1fr)_auto] content-start gap-y-2 px-2 py-4 duration-150 ease-out fade-in slide-in-from-bottom-1 [&:where(>*)]:col-start-2","data-role":"user",children:[e.jsx(Ul,{}),e.jsxs("div",{className:"aui-user-message-content-wrapper relative col-start-2 min-w-0",children:[e.jsx("div",{className:"aui-user-message-content rounded-3xl bg-muted px-5 py-2.5 break-words text-foreground",children:e.jsx(_.MessagePrimitive.Parts,{})}),e.jsx("div",{className:"aui-user-action-bar-wrapper absolute top-1/2 left-0 -translate-x-full -translate-y-1/2 pr-2",children:e.jsx(tc,{})})]}),e.jsx(Kn,{className:"aui-user-branch-picker col-span-full col-start-1 row-start-3 -mr-1 justify-end"})]}),tc=()=>e.jsx(_.ActionBarPrimitive.Root,{hideWhenRunning:!0,autohide:"not-last",className:"aui-user-action-bar-root flex flex-col items-end",children:e.jsx(_.ActionBarPrimitive.Edit,{asChild:!0,children:e.jsx(le,{tooltip:"Edit",className:"aui-user-action-edit p-4",children:e.jsx(g.PencilIcon,{})})})}),ac=()=>e.jsx(_.MessagePrimitive.Root,{className:"aui-edit-composer-wrapper mx-auto flex w-full max-w-[var(--thread-max-width)] flex-col gap-4 px-2",children:e.jsxs(_.ComposerPrimitive.Root,{className:"aui-edit-composer-root ml-auto flex w-full max-w-7/8 flex-col rounded-xl bg-muted",children:[e.jsx(_.ComposerPrimitive.Input,{className:"aui-edit-composer-input flex min-h-[60px] w-full resize-none bg-transparent p-4 text-foreground outline-none",autoFocus:!0}),e.jsxs("div",{className:"aui-edit-composer-footer mx-3 mb-3 flex items-center justify-center gap-2 self-end",children:[e.jsx(_.ComposerPrimitive.Cancel,{asChild:!0,children:e.jsx(R,{variant:"ghost",size:"sm","aria-label":"Cancel edit",children:"Cancel"})}),e.jsx(_.ComposerPrimitive.Send,{asChild:!0,children:e.jsx(R,{size:"sm","aria-label":"Update message",children:"Update"})})]})]})}),Kn=({className:t,...a})=>e.jsxs(_.BranchPickerPrimitive.Root,{hideWhenSingleBranch:!0,className:i("aui-branch-picker-root mr-2 -ml-2 inline-flex items-center text-xs text-muted-foreground",t),...a,children:[e.jsx(_.BranchPickerPrimitive.Previous,{asChild:!0,children:e.jsx(le,{tooltip:"Previous",children:e.jsx(g.ChevronLeftIcon,{})})}),e.jsxs("span",{className:"aui-branch-picker-state font-medium",children:[e.jsx(_.BranchPickerPrimitive.Number,{})," / ",e.jsx(_.BranchPickerPrimitive.Count,{})]}),e.jsx(_.BranchPickerPrimitive.Next,{asChild:!0,children:e.jsx(le,{tooltip:"Next",children:e.jsx(g.ChevronRightIcon,{})})})]});class rc{agentConfig;baseUrl;chatIdMap=new Map;constructor(a){this.agentConfig=a,this.baseUrl=a.baseUrl||""}updateAgentConfig(a){this.agentConfig={...this.agentConfig,...a}}getChatId(a){return this.chatIdMap.has(a)?this.chatIdMap.get(a):sa.v4()}async sendMessages(a){const{messages:r,chatId:n,abortSignal:s,headers:o,body:l}=a;console.log("sendMessages called with chatId:",n,"trigger:",a.trigger);const c=this.getChatId(n);console.log("Using server chatId:",c);const u={messages:r.map(w=>{const C=w.parts.filter(v=>v.type==="text").map(v=>v.text).join("");return{role:w.role,content:w.role==="user"&&this.agentConfig.additionalReferenceInfo&&Object.keys(this.agentConfig.additionalReferenceInfo).length>0?C+JSON.stringify(this.agentConfig.additionalReferenceInfo):C}}),provider:this.agentConfig.provider,model:this.agentConfig.model,agentId:this.agentConfig.agentId,agentName:this.agentConfig.agentName,temperature:this.agentConfig.temperature??.7,maxTokens:this.agentConfig.maxTokens??2048,stream:!0,useVoice:!1,...l},h={"Content-Type":"application/json",Authorization:`Bearer ${await rt()}`,...o instanceof Headers?Object.fromEntries(o.entries()):o||{}};try{const w=await fetch(`${this.baseUrl}/api/chat/completions/${c}`,{method:"POST",headers:h,body:JSON.stringify(u),signal:s,cache:"no-store"});if(!w.ok)throw new Error(`HTTP error! status: ${w.status}`);if(!w.body)throw new Error("Response body is null");return this.processResponseStream(w.body)}catch(w){throw console.error("Error in sendMessages:",w),w}}async reconnectToStream(a){return null}processResponseStream(a){const r=new TextDecoder;let n="",s=null,o=!1,l=[],c=!1,d="",u=!1,f="";return new ReadableStream({async start(h){s=a.getReader()},async pull(h){if(!(!s||o)){if(l.length>0){h.enqueue(l.shift());return}try{const{done:w,value:C}=await s.read();if(w){if(c&&d)for(u&&f&&l.push({type:"text-end",id:f}),l.push({type:"finish",finishReason:"stop"});l.length>0;)h.enqueue(l.shift());o||(o=!0,h.close());return}n+=r.decode(C,{stream:!0});const v=n.split(`
6
- `);n=v.pop()||"";for(const N of v){const b=N.trim();if(b&&b.startsWith("data:")){const y=b.slice(5).trim();if(!y)continue;try{const x=JSON.parse(y);if(o)return;x.id&&!d&&(d=x.id,c=!0,l.push({type:"start"}));let k=null;if(x.type==="ai"){const j=x.messages?.[0];j?.content&&(f||(f=sa.v4()),u||(u=!0,l.push({type:"text-start",id:f})),k={type:"text-delta",delta:j.content,id:f})}else if(x.type==="tool"){const j=x.toolCall;j&&(k={type:"tool-input-available",toolCallId:j.callId,toolName:j.name,input:j.result})}k&&l.push(k)}catch{}}}l.length>0&&h.enqueue(l.shift())}catch(w){o||(o=!0,h.error(w))}}},cancel(){o=!0,l=[],s&&(s.releaseLock(),s=null)}})}}const nc=({provider:t="openai",model:a="gpt-4o-mini",agentId:r="default-agent",agentName:n="Default Agent",temperature:s=.7,maxTokens:o=2048,className:l,baseUrl:c="http://localhost:3000",additionalReferenceInfo:d={},appId:u="",currentUserDetails:f})=>{const[h,w]=m.useState([]),[C,v]=m.useState(),N=m.useMemo(()=>new rc({provider:t,model:a,agentId:C?C.agentID:r,agentName:C?C.agentName:n,temperature:s,maxTokens:o,baseUrl:c,additionalReferenceInfo:d}),[t,a,C,r,n,s,o,c,d]),b=Ss.useChatRuntime({transport:N}),y=async()=>{try{const k=await rt(),j=await fetch(`${c}/api/agent/${u}`,{method:"GET",headers:{"Content-Type":"application/json",Authorization:`Bearer ${k}`}});if(!j.ok)throw new Error(`HTTP error! status: ${j.status}`);const p=await j.json();console.log("Agent Data:",p),w(p)}catch(k){console.error("Error while fetching agents with the specific appId",k)}};m.useEffect(()=>{y()},[u,c]);const x=k=>{v(k),console.log("Agent changed to:",k.agentName)};return e.jsx(_.AssistantRuntimeProvider,{runtime:b,children:e.jsx("div",{className:l,children:e.jsx("div",{className:`flex flex-col h-full border rounded-lg overflow-hidden ${l}`,children:e.jsx(Gl,{currentUserDetails:f,agents:h,initialAgentId:r,initialAgentName:n,onAgentChange:x})})})})};exports.Accordion=zs;exports.AccordionContent=Es;exports.AccordionItem=Ms;exports.AccordionTrigger=Fs;exports.ActionMenu=Et;exports.ActivitySheet=bl;exports.Alert=oo;exports.AlertDescription=lo;exports.AlertDialog=ka;exports.AlertDialogAction=Tt;exports.AlertDialogCancel=za;exports.AlertDialogContent=Ta;exports.AlertDialogDescription=_a;exports.AlertDialogFooter=Da;exports.AlertDialogHeader=Pa;exports.AlertDialogMedia=no;exports.AlertDialogOverlay=Aa;exports.AlertDialogPortal=Sa;exports.AlertDialogTitle=Ra;exports.AlertDialogTrigger=ro;exports.AlertTitle=io;exports.AppBreadcrumb=yn;exports.AppSidebar=An;exports.AspectRatio=zt;exports.AssistantComponent=nc;exports.Avatar=Ma;exports.AvatarBadge=co;exports.AvatarFallback=Ea;exports.AvatarGroup=uo;exports.AvatarGroupCount=mo;exports.AvatarImage=Fa;exports.Badge=lt;exports.BigCalendar=Bi;exports.Breadcrumb=Er;exports.BreadcrumbEllipsis=Ft;exports.BreadcrumbItem=Le;exports.BreadcrumbLink=Mt;exports.BreadcrumbList=Or;exports.BreadcrumbPage=Ge;exports.BreadcrumbProvider=Nn;exports.BreadcrumbSeparator=ct;exports.Button=R;exports.Calendar=La;exports.CalendarDayButton=Ba;exports.Card=mt;exports.CardAction=go;exports.CardContent=Ua;exports.CardDescription=po;exports.CardFooter=ho;exports.CardHeader=fo;exports.CardTitle=xo;exports.Checkbox=Xe;exports.Collapsible=Lr;exports.CollapsibleContent=Ur;exports.CollapsibleTrigger=Br;exports.ComboboxInput=bi;exports.Command=Y;exports.CommandDialog=vo;exports.CommandEmpty=oe;exports.CommandGroup=ee;exports.CommandInput=ne;exports.CommandItem=K;exports.CommandList=se;exports.CommandSeparator=Ha;exports.CommandShortcut=jo;exports.CropperForm=Vn;exports.CropperFormWithModal=qn;exports.CustomAlertDialog=on;exports.CustomComboboxInput=kl;exports.CustomTabs=vn;exports.DataTable=Ni;exports.DataTableColumnFilter=dn;exports.DataTableFacetedFilter=un;exports.DataTableFilterMenu=mn;exports.DataTablePagination=xn;exports.DataTableToolbar=gn;exports.Dialog=ht;exports.DialogClose=bo;exports.DialogContent=bt;exports.DialogDescription=$a;exports.DialogFooter=Ga;exports.DialogHeader=Kt;exports.DialogOverlay=Wa;exports.DialogPortal=qa;exports.DialogProvider=cn;exports.DialogTitle=vt;exports.DialogTrigger=Va;exports.Drawer=Vr;exports.DrawerClose=Gr;exports.DrawerContent=Hr;exports.DrawerDescription=Xr;exports.DrawerFooter=Yr;exports.DrawerHeader=Kr;exports.DrawerOverlay=$r;exports.DrawerPortal=Wr;exports.DrawerTitle=Jr;exports.DrawerTrigger=qr;exports.DropdownMenu=Ae;exports.DropdownMenuCheckboxItem=wo;exports.DropdownMenuContent=Pe;exports.DropdownMenuGroup=Yt;exports.DropdownMenuItem=ie;exports.DropdownMenuLabel=Jt;exports.DropdownMenuPortal=Ka;exports.DropdownMenuRadioGroup=No;exports.DropdownMenuRadioItem=yo;exports.DropdownMenuSeparator=jt;exports.DropdownMenuShortcut=Co;exports.DropdownMenuSub=Ya;exports.DropdownMenuSubContent=Xa;exports.DropdownMenuSubTrigger=Ja;exports.DropdownMenuTrigger=Te;exports.EChart=Ci;exports.FileInput=hn;exports.FileUploader=ji;exports.FontProvider=En;exports.Footer=Tn;exports.Form=Qr;exports.FormComboboxInput=qi;exports.FormComboboxInputWithValue=Wi;exports.FormControl=ue;exports.FormDateInput=Gi;exports.FormDescription=ge;exports.FormField=ce;exports.FormFileInput=$i;exports.FormInput=Hi;exports.FormItem=de;exports.FormLabel=pe;exports.FormMessage=me;exports.FormMultiComboboxInput=Ki;exports.FormOtpInput=Yi;exports.FormPasswordInput=Qi;exports.FormPhoneInput=Ji;exports.FormTextarea=Xi;exports.FrameworkItemDropdown=zi;exports.GlowingEffect=Ii;exports.GradeTableLoader=Zi;exports.Header=Pn;exports.HoverCard=Io;exports.HoverCardContent=So;exports.HoverCardTrigger=ko;exports.Icon=ft;exports.IconButton=sn;exports.IconButtonWithTooltip=Ne;exports.IconTextButton=tt;exports.IconTextButtonWithTooltip=nn;exports.ImageCropper=Un;exports.ImageCropperProvider=Nl;exports.Input=$;exports.InputOTP=tn;exports.InputOTPGroup=an;exports.InputOTPSeparator=xi;exports.InputOTPSlot=$e;exports.Label=be;exports.LoadingSpinner=ki;exports.MainLayout=Mn;exports.MainSidebar=zn;exports.MultiCombobox=Si;exports.NavMain=kn;exports.NavigationMenu=Ao;exports.NavigationMenuContent=Ro;exports.NavigationMenuIndicator=zo;exports.NavigationMenuItem=Po;exports.NavigationMenuLink=_o;exports.NavigationMenuList=To;exports.NavigationMenuTrigger=Do;exports.NavigationMenuViewport=Za;exports.NewCropperImg=Gn;exports.NewImageForm=Cl;exports.NoDataComponent=ta;exports.PageWrapper=Ai;exports.PasswordStrengthMeter=Ti;exports.PhoneInput=Pi;exports.Popover=J;exports.PopoverAnchor=Mo;exports.PopoverContent=Q;exports.PopoverDescription=Oo;exports.PopoverHeader=Fo;exports.PopoverTitle=Eo;exports.PopoverTrigger=X;exports.Progress=wt;exports.ProviderWrapper=hl;exports.RadioGroup=Lo;exports.RadioGroupItem=Bo;exports.RadiusProvider=Ln;exports.RenderAppBreadcrumb=Ui;exports.RenderSidebarNav=Vi;exports.ScrollArea=Uo;exports.ScrollBar=er;exports.SearchInput=pn;exports.Select=tr;exports.SelectContent=nr;exports.SelectGroup=Vo;exports.SelectItem=sr;exports.SelectLabel=qo;exports.SelectScrollDownButton=ir;exports.SelectScrollUpButton=or;exports.SelectSeparator=Wo;exports.SelectTrigger=rr;exports.SelectValue=ar;exports.Separator=Nt;exports.Sheet=Xt;exports.SheetClose=Go;exports.SheetComponent=bn;exports.SheetContent=Qt;exports.SheetDescription=dr;exports.SheetFooter=Ko;exports.SheetHeader=cr;exports.SheetTitle=Zt;exports.SheetTrigger=lr;exports.Sidebar=fr;exports.SidebarContent=vr;exports.SidebarFooter=br;exports.SidebarGroup=jr;exports.SidebarGroupAction=ni;exports.SidebarGroupContent=si;exports.SidebarGroupLabel=ri;exports.SidebarHeader=hr;exports.SidebarInput=ti;exports.SidebarInset=gr;exports.SidebarMenu=wr;exports.SidebarMenuAction=ii;exports.SidebarMenuBadge=li;exports.SidebarMenuButton=Dt;exports.SidebarMenuItem=Pt;exports.SidebarMenuSkeleton=ci;exports.SidebarMenuSub=Nr;exports.SidebarMenuSubButton=Cr;exports.SidebarMenuSubItem=yr;exports.SidebarNavProvider=In;exports.SidebarProvider=mr;exports.SidebarRail=pr;exports.SidebarSeparator=ai;exports.SidebarTrigger=xr;exports.SimpleWidget=Ri;exports.Skeleton=ze;exports.SkeletonWidget=el;exports.Slider=di;exports.Switch=mi;exports.Table=Ar;exports.TableBody=Pr;exports.TableCaption=fi;exports.TableCell=We;exports.TableFooter=Dr;exports.TableHead=Rt;exports.TableHeader=Tr;exports.TableRow=Oe;exports.Tabs=Rr;exports.TabsContent=_t;exports.TabsList=zr;exports.TabsTrigger=Mr;exports.TextButton=et;exports.TextButtonWithTooltip=gi;exports.Textarea=Fr;exports.ThemeProvider=kr;exports.ThemeToggleBtn=jn;exports.TitleProgress=_i;exports.Toaster=ui;exports.Toggle=pi;exports.ToggleGroup=_e;exports.ToggleGroupItem=U;exports.Tooltip=te;exports.TooltipComponent=Ce;exports.TooltipContent=re;exports.TooltipProvider=ye;exports.TooltipTrigger=ae;exports.UploadTab=Sn;exports.Widgets=Mi;exports.WorkInProgress=Il;exports.axiosInstance=Ie;exports.badgeVariants=Oa;exports.buttonVariants=ut;exports.clearAllCookieSession=al;exports.clearCookieSession=Lt;exports.cn=i;exports.convertFileToObject=fn;exports.getCookieSession=xt;exports.getDataTableColumnTitle=ve;exports.getImageFromObject=vi;exports.getValidAccessToken=rt;exports.navigationMenuTriggerStyle=Qa;exports.refreshAccessToken=Dn;exports.setCookieSession=Ot;exports.setIkonConfig=tl;exports.tabsListVariants=_r;exports.toggleVariants=ea;exports.useBreadcrumb=aa;exports.useDialog=hi;exports.useFont=ul;exports.useFormField=Ze;exports.useImageCropper=na;exports.useIsMobile=yt;exports.useRadius=ml;exports.useRefresh=xl;exports.useSidebar=Qe;exports.useSidebarNav=at;
3
+ `,onDragOver:d,onDragLeave:u,onDrop:i,onClick:()=>document.getElementById("fileInput")?.click(),children:e.jsxs("div",{className:"flex flex-col items-center gap-3",children:[e.jsx(f.UploadCloud,{className:"w-10 h-10 text-blue-600"}),e.jsxs("p",{className:"text-gray-600",children:["Drag & drop your file here or"," ",e.jsx("span",{className:"text-blue-600 underline",children:"browse"})]})]})}):e.jsxs("div",{className:"border rounded-lg p-4 flex flex-col items-center gap-2 cursor-pointer text-center",onClick:()=>document.getElementById("fileInput")?.click(),children:[e.jsx(f.FileUp,{className:"w-8 h-8 text-blue-600"}),e.jsx("span",{className:"text-blue-600 underline",children:"Browse File"})]})]})}const Ti=[15,20,30,40,50,100];function yn({table:t,extraParams:a}){return e.jsxs("div",{className:"flex flex-col md:flex-row items-start md:items-center justify-between ",children:[e.jsx("small",{className:"flex-1 px-2 text-gray-600 dark:text-gray-400",children:(a?.numberOfRows==null||a?.numberOfRows)&&a?.checkBoxColumn?e.jsxs(e.Fragment,{children:[t.getFilteredSelectedRowModel().rows.length," of"," ",t.getFilteredRowModel().rows.length," row(s) selected."]}):e.jsxs(e.Fragment,{children:["Total ",t.getFilteredRowModel().rows.length," no(s) of rows."]})}),(a?.pagination==null||a.pagination)&&e.jsxs("div",{className:"flex items-start md:items-center gap-3 flex-col md:flex-row ",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("small",{className:"text-gray-600 dark:text-gray-400",children:"Rows per page"}),(a?.rowsPerPage==null||a.rowsPerPage)&&e.jsxs(cr,{value:`${t.getState().pagination.pageSize}`,onValueChange:r=>{t.setPageSize(Number(r))},children:[e.jsx(mr,{className:"w-[70px] h-8",children:e.jsx(ur,{placeholder:t.getState().pagination.pageSize})}),e.jsx(xr,{side:"top",children:(a?.pageSizeArray||Ti).map(r=>e.jsx(fr,{value:`${r}`,children:r},r))})]})]}),e.jsxs(e.Fragment,{children:[e.jsxs("small",{className:"flex w-[100px] items-center justify-center text-gray-600 dark:text-gray-400",children:["Page ",t.getState().pagination.pageIndex+1," of"," ",t.getPageCount()]}),e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(Re,{tooltipContent:"Go to first page",size:"icon-sm",className:"dark:bg-accent dark:text-accent-foreground keross:bg-card keross:text-foreground",onClick:()=>t.setPageIndex(0),disabled:!t.getCanPreviousPage(),children:e.jsx(f.ChevronsLeft,{})}),e.jsx(Re,{tooltipContent:"Go to previous page",size:"icon-sm",className:"dark:bg-accent dark:text-accent-foreground keross:bg-card keross:text-foreground",onClick:()=>t.previousPage(),disabled:!t.getCanPreviousPage(),children:e.jsx(f.ChevronLeft,{})}),e.jsx(Re,{tooltipContent:"Go to next page",size:"icon-sm",className:"dark:bg-accent dark:text-accent-foreground keross:bg-card keross:text-foreground",onClick:()=>t.nextPage(),disabled:!t.getCanNextPage(),children:e.jsx(f.ChevronRight,{})}),e.jsx(Re,{tooltipContent:"Go to last page",size:"icon-sm",className:"dark:bg-accent dark:text-accent-foreground keross:bg-card keross:text-foreground",onClick:()=>t.setPageIndex(t.getPageCount()-1),disabled:!t.getCanNextPage(),children:e.jsx(f.ChevronsRight,{})})]})]})]})]})}function da({className:t,...a}){return e.jsxs("div",{className:"relative w-auto flex items-center",children:[e.jsx(f.Search,{className:"absolute left-2 mr-2 h-4 w-4 shrink-0 opacity-50"}),e.jsx(H,{className:W.cx("pl-8 h-8",t),...a})]})}function Cn({table:t,extraParams:a}){return e.jsxs("div",{className:"flex items-center justify-between gap-3",children:[e.jsxs("div",{className:"flex-grow flex items-center justify-between gap-3 overflow-hidden",children:[(a?.defaultTools==null||a?.defaultTools==!0||Array.isArray(a?.defaultTools)&&a?.defaultTools?.includes("search"))&&e.jsx(da,{placeholder:"Search ...",onChange:r=>t.setGlobalFilter(r.target.value),className:"max-w-sm"}),(a?.defaultTools==null||a?.defaultTools==!0||Array.isArray(a?.defaultTools)&&a?.defaultTools?.includes("filter"))&&e.jsx(wn,{table:t})]}),e.jsxs("div",{className:"flex gap-3",children:[a?.extraTools?.map((r,n)=>e.jsx(m.Fragment,{children:r},n)),(a?.defaultTools==null||a?.defaultTools==!0||Array.isArray(a?.defaultTools)&&a?.defaultTools?.includes("columnFilter"))&&e.jsx(vn,{table:t})]})]})}const Ri=m.forwardRef(({columns:t,data:a,extraParams:r,onTableReady:n},s)=>{const[o,i]=m.useState([]),[d,u]=m.useState(""),[c,x]=m.useState([]),[g,w]=m.useState({pageIndex:r?.pageIndex||0,pageSize:r?.pageSize||15}),[N,v]=m.useState({}),[C,b]=m.useState([]),[S,p]=m.useState({}),[I,j]=m.useState({});t=t.map(y=>(y?.filterFn||(y.filterFn="arrIncludesSome"),y)),m.useEffect(()=>{r?.checkBoxColumnCallback&&r.checkBoxColumnCallback(h.getFilteredSelectedRowModel().rows)},[I]),r?.checkBoxColumn&&t.splice(0,0,{id:"checkBoxColumn",header:({table:y})=>e.jsx(Ve,{checked:y.getIsAllPageRowsSelected()||y.getIsSomePageRowsSelected()&&"indeterminate",onCheckedChange:k=>y.toggleAllPageRowsSelected(!!k),"aria-label":"Select all"}),cell:({row:y})=>e.jsx(e.Fragment,{children:e.jsx(Ve,{checked:y.getIsSelected(),onCheckedChange:k=>y.toggleSelected(!!k),"aria-label":"Select row"})}),enableSorting:!1,enableHiding:!1}),(r?.actionMenu||r?.groupActionMenu)&&t.push({id:"DTActions",accessorKey:"Actions",header:()=>e.jsx("div",{className:"text-center",children:"Action"}),size:20,headerClassName:"text-center",cell:({row:y})=>y.getIsGrouped()?r?.groupActionMenu?e.jsx("div",{className:"text-end",children:e.jsx(Wt,{actionMenus:r.groupActionMenu.items,extraActionParams:{arguments:[y.original,...r.groupActionMenu.extraArguments||[]]}})}):null:r?.actionMenu?e.jsx("div",{className:"text-center",children:e.jsx(Wt,{actionMenus:r.actionMenu.items,extraActionParams:{arguments:[y.original,...r.actionMenu.extraArguments||[]]}})}):null,enableSorting:!1,enableHiding:!1}),m.useEffect(()=>{r?.onPaginationChange?.(g)},[g]);const h=E.useReactTable({data:a,columns:t,state:{sorting:o,globalFilter:d,columnFilters:c,columnVisibility:N,rowSelection:I,grouping:C,expanded:S,pagination:g},onPaginationChange:w,onSortingChange:i,onExpandedChange:p,onColumnFiltersChange:x,onColumnVisibilityChange:v,onGroupingChange:b,onGlobalFilterChange:u,onRowSelectionChange:j,getCoreRowModel:E.getCoreRowModel(),getPaginationRowModel:E.getPaginationRowModel(),getSortedRowModel:E.getSortedRowModel(),getFilteredRowModel:E.getFilteredRowModel(),getGroupedRowModel:E.getGroupedRowModel(),getExpandedRowModel:E.getExpandedRowModel(),getFacetedRowModel:E.getFacetedRowModel(),getFacetedUniqueValues:E.getFacetedUniqueValues(),getFacetedMinMaxValues:E.getFacetedMinMaxValues(),manualPagination:r?.pagination==null||r?.pagination==!0?void 0:!0});m.useImperativeHandle(s,()=>h);const[A,P]=m.useState([]),R=(y,k)=>{const B={id:k.id,title:ke(k.column)};y.dataTransfer.setData("headerObj",JSON.stringify(B)),y.dataTransfer.effectAllowed="move"},M=y=>{y.preventDefault();const k=JSON.parse(y.dataTransfer.getData("headerObj"));if(!A.find(B=>B.id==k.id)){P(z=>[...z,k]);const B=h.getColumn(k.id);B&&B.getToggleGroupingHandler()()}},F=y=>{y.preventDefault()},ce=y=>{const k=A.filter(z=>z.id!==y);P(()=>[...k]);const B=h.getColumn(y);B&&B.getToggleGroupingHandler()()},[Ae,Ce]=m.useState(!1);return m.useEffect(()=>{Ae||Ce(!0),r?.defaultGroups&&h.setGrouping(r?.defaultGroups)},[]),m.useEffect(()=>{n&&n(h)},[n,h]),Ae&&e.jsxs("div",{className:"w-full h-full flex flex-col gap-3 justify-between",children:[e.jsxs("div",{className:"flex-grow flex flex-col gap-3 overflow-hidden",children:[(r?.defaultTools==null||r.defaultTools||r.extraTools)&&e.jsx(Cn,{table:h,extraParams:r}),e.jsxs("div",{className:"flex-grow flex flex-col overflow-hidden",children:[(r?.grouping==null||r.grouping)&&e.jsx("div",{className:"w-full border-t min-h-10 px-2 py-1 flex gap-3 items-center text-sm bg-card-new",onDrop:M,onDragOver:F,children:A.length===0?"Drag a column header here to group its column":A.map((y,k)=>e.jsxs("div",{className:"rounded-md px-2 py-1 bg-muted text-muted-foreground flex gap-3 items-center",children:[y.title,e.jsx("span",{onClick:()=>ce(y.id),children:e.jsx(f.X,{size:15})})]},y.id))}),e.jsx("div",{className:"flex-grow overflow-hidden",children:e.jsxs(Er,{className:"border-t whitespace-nowrap bg-card-new",children:[(r?.header==null||r.header)&&e.jsx(Lr,{className:"sticky top-0 z-10 border-t bg-card-new",children:h.getHeaderGroups().map(y=>e.jsx(qe,{className:W.cx(""),children:y.headers.map(k=>k.column.getIsGrouped()?k.column.getGroupedIndex()<A.length-1?null:e.jsx(Ut,{colSpan:A.length,className:W.cx("w-36 ","text-left")},k.id):e.jsx(Ut,{...r?.grouping==null||r.grouping?{onDragStart:B=>R(B,k),draggable:!0}:{},className:W.cx("text-left"),children:k.isPlaceholder?null:(r?.sorting==null||r.sorting)&&k.column.getCanSort()?e.jsxs("div",{onClick:k.column.getToggleSortingHandler(),className:W.cx("-mx-2 inline-flex cursor-pointer select-none items-center gap-2 rounded-md px-2 py-1 hover:bg-muted"),children:[e.jsx("div",{children:E.flexRender(k.column.columnDef.header,k.getContext())}),k.column.getCanSort()?e.jsxs("div",{className:"-space-y-2",children:[e.jsx(f.ChevronUp,{className:W.cx("size-3.5 text-foreground",k.column.getIsSorted()==="desc"?"opacity-30":""),"aria-hidden":"true"}),e.jsx(f.ChevronDown,{className:W.cx("size-3.5 text-foreground",k.column.getIsSorted()==="asc"?"opacity-30":""),"aria-hidden":"true"})]}):null]}):E.flexRender(k.column.columnDef.header,k.getContext())},k.id))},y.id))}),e.jsx(Or,{children:h.getRowModel().rows.length?h.getRowModel().rows.map(y=>y.getIsGrouped()?e.jsx(qe,{children:y.getVisibleCells().map(k=>k.column.getIndex()<y.depth?null:e.jsx(Ye,{colSpan:k.column.getIndex()==y.depth?y.depth+1:void 0,className:k.column.getIndex()==y.depth?"w-36":"",children:k.getIsGrouped()?e.jsxs(T,{variant:"link",onClick:y.getToggleExpandedHandler(),className:"text-right text-foreground",style:{marginLeft:y.depth+"rem"},children:[y.getIsExpanded()?e.jsx(f.ChevronDown,{}):e.jsx(f.ChevronRight,{})," ",E.flexRender(k.column.columnDef.cell,k.getContext())," ","(",y.subRows.length,")"]}):k.column.id=="DTActions"?E.flexRender(k.column.columnDef.cell,k.getContext()):k.getIsAggregated()?E.flexRender(k.column.columnDef.aggregatedCell??k.column.columnDef.cell,k.getContext()):k.getIsPlaceholder()?null:E.flexRender(k.column.columnDef.cell,k.getContext())},k.id))},y.id):e.jsx(qe,{className:W.cx(y.getIsSelected()?"bg-accent/10":""),...r?.checkBoxColumn&&{onClick:()=>y.toggleSelected(!y.getIsSelected())},children:y.getVisibleCells().map((k,B)=>e.jsxs(Ye,{className:W.cx(y.getIsSelected()?"relative":"",!(r?.actionMenu||r?.groupActionMenu)&&"py-2"),children:[B===0&&y.getIsSelected()&&e.jsx("div",{className:"absolute inset-y-0 left-0 w-0.5 bg-primary"}),k.getIsPlaceholder()?null:E.flexRender(k.column.columnDef.cell,k.getContext())]},k.id))},y.id)):e.jsx(qe,{children:e.jsx(Ye,{colSpan:t.length,className:"h-24 text-center",children:"No results."})})}),r?.footer&&e.jsx(Br,{className:"sticky bottom-0 bg-background text-foreground",children:h.getFooterGroups().map(y=>e.jsx(qe,{children:y.headers.map(k=>e.jsx(Ye,{children:k.isPlaceholder?null:e.jsx("div",{className:"flex items-center",children:E.flexRender(k.column.columnDef.footer,k.getContext())})}))}))})]})})]})]}),(r?.paginationBar==null||r.paginationBar)&&e.jsx(yn,{table:h,extraParams:r})]})});function Sn({isLoading:t,onReload:a,errorMessage:r}){return!t&&!r?null:e.jsx("div",{className:"absolute inset-0 z-50 flex items-center justify-center bg-background/60 backdrop-blur-md rounded-lg transition-all duration-300",children:e.jsx("div",{className:"flex flex-col items-center gap-4",children:t?e.jsx("div",{className:"bg-background/80 p-6 rounded-2xl shadow-xl border border-border/50 backdrop-blur-xl animate-in fade-in zoom-in duration-300",children:e.jsx(f.Loader2,{size:48,className:"text-primary animate-spin"})}):e.jsx("div",{className:"bg-background/80 p-4 rounded-full shadow-lg border border-border/50 backdrop-blur-xl animate-in fade-in zoom-in duration-300",children:e.jsx("button",{onClick:a,className:"p-3 rounded-full bg-primary/10 hover:bg-primary/20 transition-all text-primary hover:scale-110 active:scale-95",title:r||"Reload Data",children:e.jsx(f.RotateCcw,{className:"w-6 h-6"})})})})})}function _i(t){(t==null||typeof t!="object")&&(t={});const a={...t};return(a.toolbox===void 0||a.toolbox===null||typeof a.toolbox!="object")&&(a.toolbox={}),(a.toolbox.feature===void 0||a.toolbox.feature===null||typeof a.toolbox.feature!="object")&&(a.toolbox.feature={}),a}const zi=m.forwardRef(({parentDivProps:t={},option:a={},style:r={},settings:n={},loading:s=!0,theme:o,isConfigurable:i=!1,resizeKey:d,onClick:u=()=>{},onConfigure:c=()=>{}},x)=>{const g=m.useRef(null),w=m.useRef(null),N=_i(a);return i&&(N.toolbox.feature={...N.toolbox.feature,myConfigureChartTool:{show:!0,title:"Configure Chart",icon:"image://data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxNiIgaGVpZ2h0PSIxNiIgdmlld0JveD0iMCAwIDI0IDI0IiBmaWxsPSJub25lIiBzdHJva2U9ImN1cnJlbnRDb2xvciIgc3Ryb2tlLXdpZHRoPSIxIiBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiIGNsYXNzPSJsdWNpZGUgbHVjaWRlLXNldHRpbmdzLTIiPjxwYXRoIGQ9Ik0yMCA3aC05Ii8+PHBhdGggZD0iTTE0IDE3SDUiLz48Y2lyY2xlIGN4PSIxNyIgY3k9IjE3IiByPSIzIi8+PGNpcmNsZSBjeD0iNyIgY3k9IjciIHI9IjMiLz48L3N2Zz4=",onclick:()=>c?.()}}),m.useImperativeHandle(x,()=>({getChartObject:()=>g.current?Le.getInstanceByDom(g.current):null,setOption:(v,C)=>{if(!g.current)return;Le.getInstanceByDom(g.current)?.setOption(v,C)},resize:(v=0)=>{if(!g.current)return;const C=Le.getInstanceByDom(g.current);C?.resize(),v&&setTimeout(()=>C?.resize(),v)},loadingVisible:v=>{if(!g.current)return;const C=Le.getInstanceByDom(g.current);v?C?.showLoading():C?.hideLoading()},dispose:()=>{if(!g.current)return;Le.getInstanceByDom(g.current)?.dispose()},on:(v,C)=>{if(!g.current)return;Le.getInstanceByDom(g.current)?.on(v,C)}})),m.useEffect(()=>{g.current&&(w.current=Le.init(g.current,o));const v=()=>w.current?.resize?.();return window.addEventListener("resize",v),()=>{w.current&&(w.current.dispose(),w.current=null),window.removeEventListener("resize",v)}},[o]),m.useEffect(()=>{w.current&&w.current.setOption(N,n),w.current&&w.current.on("click",u)},[a,n,o]),m.useEffect(()=>{w.current&&w.current.resize()},[d]),m.useEffect(()=>{w.current&&setTimeout(()=>{w.current?.resize()},500)},[]),e.jsx("div",{ref:g,...t,style:{width:"100%",height:"100%",...r}})});function kn({tooltipContent:t,fileNamePlaceholder:a,fileName:r,onFileNameChange:n,...s}){const o=m.useRef(null);return e.jsx(e.Fragment,{children:e.jsxs("div",{className:"flex",children:[e.jsx(H,{ref:o,type:"file",className:"hidden",...s}),e.jsx("div",{className:"mx-1"}),e.jsx(H,{className:"rounded-e-none",placeholder:a,onChange:(...i)=>n?.(...i),value:r}),e.jsx(Re,{tooltipContent:t||"Browse File",onClick:()=>o?.current?.click(),className:"border-s-0 rounded-s-none",children:e.jsx(f.Upload,{})})]})})}const Fi=(({blur:t=0,inactiveZone:a=.7,proximity:r=0,spread:n=20,variant:s="default",glow:o=!1,className:i,movementDuration:d=2,borderWidth:u=1,disabled:c=!0})=>{const x=m.useRef(null),g=m.useRef({x:0,y:0}),w=m.useRef(0),N=m.useCallback(v=>{x.current&&(w.current&&cancelAnimationFrame(w.current),w.current=requestAnimationFrame(()=>{const C=x.current;if(!C)return;const{left:b,top:S,width:p,height:I}=C.getBoundingClientRect(),j=v?.x??g.current.x,h=v?.y??g.current.y;v&&(g.current={x:j,y:h});const A=[b+p*.5,S+I*.5],P=Math.hypot(j-A[0],h-A[1]),R=.5*Math.min(p,I)*a;if(P<R){C.style.setProperty("--active","0");return}const M=j>b-r&&j<b+p+r&&h>S-r&&h<S+I+r;if(C.style.setProperty("--active",M?"1":"0"),!M)return;const F=parseFloat(C.style.getPropertyValue("--start"))||0,Ae=(180*Math.atan2(h-A[1],j-A[0])/Math.PI+90-F+180)%360-180,Ce=F+Ae;pt.animate(F,Ce,{duration:d,ease:[.16,1,.3,1],onUpdate:y=>{C.style.setProperty("--start",String(y))}})}))},[a,r,d]);return m.useEffect(()=>{if(c)return;const v=()=>N(),C=b=>N(b);return window.addEventListener("scroll",v,{passive:!0}),document.body.addEventListener("pointermove",C,{passive:!0}),()=>{w.current&&cancelAnimationFrame(w.current),window.removeEventListener("scroll",v),document.body.removeEventListener("pointermove",C)}},[N,c]),e.jsxs(e.Fragment,{children:[e.jsx("div",{className:l("pointer-events-none absolute -inset-px hidden rounded-[inherit] border opacity-0 transition-opacity",o&&"opacity-100",s==="white"&&"border-white",c&&"!block")}),e.jsx("div",{ref:x,style:{"--blur":`${t}px`,"--spread":n,"--start":"0","--active":"0","--glowingeffect-border-width":`${u}px`,"--repeating-conic-gradient-times":"5","--gradient":s==="white"?"repeating-conic-gradient(from 236.84deg at 50% 50%,var(--black),var(--black) calc(25% / var(--repeating-conic-gradient-times)))":"linear-gradient(54.29deg, #00A5E9 22.93%, #A020F0 32.97%, #55C8FF 52.28%, #A020F0 73.13%, #071182 88.57%)"},className:l("pointer-events-none absolute inset-0 rounded-[inherit] opacity-100 transition-opacity",o&&"opacity-100",t>0&&"blur-[var(--blur)] ",i,c&&"!hidden"),children:e.jsx("div",{className:l("glow","rounded-[inherit]",'after:content-[""] after:rounded-[inherit] after:absolute after:inset-[calc(-1*var(--glowingeffect-border-width))]',"after:[border:var(--glowingeffect-border-width)_solid_transparent]","after:[background:var(--gradient)] after:[background-attachment:fixed]","after:opacity-[var(--active)] after:transition-opacity after:duration-300","after:[mask-clip:padding-box,border-box]","after:[mask-composite:intersect]","after:[mask-image:linear-gradient(#0000,#0000),conic-gradient(from_calc((var(--start)-var(--spread))*1deg),#00000000_0deg,#fff,#00000000_calc(var(--spread)*2deg))]")})})]})});function Nt({name:t,...a}){const r=Ls[t];return r?e.jsx(r,{...a}):(console.warn(`Icon "${t}" not found in lucide-react`),null)}const Mi=({size:t=48,className:a,visible:r=!0,...n})=>r?e.jsx("div",{className:"h-full w-full",children:e.jsx("div",{className:"absolute inset-0 flex justify-center items-center z-50",children:e.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:t,height:t,...n,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:l("animate-spin",a),children:e.jsx("path",{d:"M21 12a9 9 0 1 1-6.219-8.56"})})})}):null;function Ei({placeholder:t,items:a,onValueChange:r,defaultValue:n,defaultOptions:s=2}){const[o,i]=m.useState(n||[]),[d,u]=m.useState(""),c=m.useRef(null),[x,g]=m.useState(!1);m.useEffect(()=>{r(o)},[o,r]);const w=a.filter(p=>(p.label||p.value).toLowerCase().includes(d.toLowerCase())).sort((p,I)=>(p?.label??"").localeCompare(I?.label??"")),N=p=>{const I=p.currentTarget;I.scrollTop+=p.deltaY,p.preventDefault()},v=p=>{const I=o.includes(p)?o.filter(j=>j!==p):[...o,p];i(I)},[C,b]=m.useState(o.length),S=m.useCallback(()=>{const p=c.current;if(!p)return C;const I=Array.from(p.children),j=p.offsetWidth;let h=0,A=0;for(const P of I){const R=P.offsetWidth+4;if(h+R<=j)h+=R,A++;else break}return A},[C]);return m.useEffect(()=>{const p=c.current;if(!p)return;let I=null;const j=()=>{I&&cancelAnimationFrame(I),I=requestAnimationFrame(()=>{const A=S();b(P=>P!==A?A:P)})},h=new ResizeObserver(j);return h.observe(p),I=requestAnimationFrame(j),()=>{I&&cancelAnimationFrame(I),h.disconnect()}},[S]),e.jsxs(Q,{open:x,onOpenChange:g,children:[e.jsx(J,{asChild:!0,className:"w-full",children:e.jsxs(T,{variant:"outline",role:"combobox",className:l("justify-between px-3 py-2 h-10",o.length===0&&"text-foreground/50","bg-secondary"),onClick:()=>g(p=>!p),children:[o.length>0?e.jsx(_e,{children:e.jsxs("div",{ref:c,className:"flex flex-wrap gap-2 items-center overflow-hidden flex-1",children:[o.slice(0,s).map(p=>{const I=a.find(j=>j.value===p)?.label||p;return e.jsxs("span",{className:"flex items-center px-2 py-1 bg-secondary text-secondary-foreground rounded-md truncate max-w-full",title:I,children:[e.jsx("span",{className:"truncate max-w-[120px]",children:I}),e.jsx("span",{role:"button",tabIndex:0,onClick:j=>{j.stopPropagation(),v(p)},onKeyDown:j=>{(j.key==="Enter"||j.key===" ")&&(j.preventDefault(),j.stopPropagation(),v(p))},className:"ml-1 text-muted-foreground hover:text-destructive cursor-pointer outline-none",children:e.jsx(f.X,{className:"w-3 h-3 ml-1"})})]},p)}),o.length>s&&e.jsxs(ne,{children:[e.jsx(se,{asChild:!0,children:e.jsxs("span",{className:"px-2 py-1 bg-secondary text-secondary-foreground dark:bg-secondary dark:text-secondary-foreground keross:bg-secondary keross:text-secondary-foreground rounded-md cursor-pointer",children:["+",o.length-s," more"]})}),e.jsx(oe,{className:"max-w-xs break-words",children:e.jsx("div",{onWheel:N,className:"flex flex-col gap-1 max-h-[200px] overflow-auto",children:o.slice(s).map(p=>e.jsx("span",{className:"text-sm",children:a.find(I=>I.value===p)?.label||p},p))})})]})]})}):e.jsx("span",{className:"flex-1 text-left truncate",children:t}),e.jsx(f.ChevronsUpDown,{className:"ml-2 h-4 w-4 shrink-0 opacity-50"})]})}),e.jsx(Z,{className:"p-0 min-w-[var(--radix-popover-trigger-width)]",style:{width:"max-content",maxWidth:"min(500px, 90vw)"},align:"start",children:e.jsxs(Y,{onMouseDown:p=>p.preventDefault(),children:[e.jsx(ie,{placeholder:"Search...",value:d,onValueChange:u}),e.jsxs(le,{onWheel:N,className:"max-h-60 overflow-auto",children:[e.jsx(de,{children:"No items found."}),e.jsx(re,{children:w.map(p=>{const I=o.includes(p.value),j=p.disabled===!0||typeof p.disabled=="function"&&p.disabled(p);return e.jsxs(X,{value:p.label||p.value,disabled:j,onPointerDown:h=>{h.preventDefault(),h.stopPropagation()},onSelect:()=>{j||v(p.value)},className:l("flex items-center justify-between space-x-2",j&&"opacity-50 cursor-not-allowed"),children:[e.jsx(Ve,{checked:I,onCheckedChange:()=>{j||v(p.value)},onClick:h=>h.stopPropagation(),disabled:j}),e.jsx("span",{className:"flex-grow text-left",children:p?.label||p.value})]},p.value)})})]})]})})]})}function ca({text:t}){return e.jsxs("div",{className:"flex flex-col h-full justify-center text-center gap-2",children:[e.jsx(f.CircleAlert,{className:"text-muted-foreground mx-auto",size:36}),e.jsx("p",{className:"text-muted-foreground",children:t||"No Data Available"})]})}function Li({title:t,subtitle:a,tools:r,children:n}){return t=t??"",a=a??"",e.jsxs("div",{className:"flex flex-col gap-4 h-full",children:[e.jsxs("div",{className:"flex items-center justify-between gap-4",children:[e.jsxs("div",{className:"grid grid-cols-1 gap-1",children:[t&&e.jsx("h1",{className:"text-2xl font-semibold",children:t}),a&&e.jsx("p",{className:"text-muted-foreground/60",children:a})]}),e.jsx("div",{children:r})]}),n]})}const Oi=({value:t})=>{const a=Ds(t),r=a.score*100/4,n=()=>{switch(a.score){case 0:return"#828282";case 1:return"#EA1111";case 2:return"#FFAD00";case 3:return"#9bc158";case 4:return"#00b500";default:return""}};return e.jsx(e.Fragment,{children:e.jsx(Pt,{value:r,className:n()})})},va=({code:t})=>{const a=$s[t];return e.jsx(a,{})};function Bi({className:t,...a}){const[r,n]=m.useState(!1),[s,o]=m.useState(""),[i,d]=m.useState("");return e.jsxs(Q,{open:r,onOpenChange:n,children:[e.jsx(J,{asChild:!0,children:e.jsxs(T,{variant:"outline",role:"combobox","aria-expanded":r,className:"justify-between bg-secondary",children:[i?e.jsx(va,{code:i}):"...",e.jsx(f.ChevronsUpDown,{className:"opacity-50"})]})}),e.jsx(Z,{className:"p-0",align:"start",children:e.jsxs(Y,{filter:(u,c,x=[])=>(u.toLowerCase()+" "+x.join(" ").toLowerCase()).includes(c.toLowerCase())?1:0,children:[e.jsx(ie,{placeholder:"Search ...",className:"h-9"}),e.jsxs(le,{children:[e.jsx(de,{children:"No country found."}),e.jsx(re,{children:Object.entries(As.countries).map(([u,c])=>c.phone.map(x=>e.jsxs(X,{value:`${x}`,keywords:[c.name,"+"+x.toString(),u],onSelect:g=>{o(g===s?"":g),d(u),n(!1)},children:[e.jsx(va,{code:u})," ",c.name," +",x]},x)))})]})]})})]})}function In({buttonText:t,buttonIcon:a,buttonStyle:r,sheetContent:n,sheetDescription:s,sheetTitle:o,closeButton:i}){return e.jsxs(sa,{children:[e.jsx(hr,{asChild:!0,children:e.jsxs(T,{variant:"outline",className:r,size:"icon-sm",children:[t,a]})}),e.jsxs(oa,{className:"p-4",children:[e.jsx(ia,{children:o}),n]})]})}const Ui=f.icons;function Vi({title:t,iconName:a,iconSize:r,iconClass:n,primaryText:s,secondaryText:o,mainClassName:i="",loading:d,loadingMessage:u}){let c=null;return a&&(c=Ui[a]),r=r===void 0?20:r,n=n??"",u=u??"Loading...",e.jsx(wt,{className:i,children:e.jsxs(Ya,{className:"p-5",children:[e.jsxs("div",{className:"flex items-center justify-between gap-4",children:[e.jsx("span",{children:t}),d?e.jsx(f.LoaderCircle,{size:r,className:"animate-spin "+n}):c&&e.jsx(c,{size:r,className:n})]}),e.jsx("div",{className:"mt-6 text-2xl font-semibold",children:d?"...":s}),o&&e.jsx("small",{className:"mt-2 text-gray-400",children:d?u:o})]})})}function Dn({children:t,tabArray:a,pathName:r,tabListClass:n="",tabListInnerClass:s="",tabListButtonClass:o="",tabContentClass:i="",headerEndComponent:d,onTabChange:u,isSeperatePage:c=!1}){const[x,g]=m.useState(5),w=Rt(),[N,v]=m.useState([]),[C,b]=m.useState([]),[S,p]=m.useState(a.find(h=>h.default)?.tabId||a[0]?.tabId||"");m.useEffect(()=>{g(w?2:5)},[w]),m.useEffect(()=>{if(r&&c){const h=r.split("/").pop()||"";p(h)}},[r,c]),m.useEffect(()=>{v(a.slice(0,x)),b(a.slice(x))},[a,x]);const I=h=>{p(h),u?.(h)},j=h=>{v(A=>{const P=[...A],R=P.pop();return R&&b(M=>[...M.filter(F=>F.tabId!==h.tabId),R]),[...P,h]}),I(h.tabId)};return e.jsxs(Ur,{value:S,onValueChange:I,className:"w-full h-full flex flex-col",children:[e.jsxs($r,{className:`flex justify-between items-center ${n}`,children:[e.jsxs("div",{className:`flex w-full ${s}`,children:[N.map(h=>e.jsx(Gr,{value:h.tabId,className:o,children:h.tabName},h.tabId)),C.length>0&&e.jsxs(ve,{children:[e.jsx(je,{asChild:!0,children:e.jsx(ot,{variant:"outline",size:"sm",className:"mt-1",children:e.jsx(f.EllipsisVertical,{})})}),e.jsx(we,{children:C.map(h=>e.jsx(ue,{onClick:()=>j(h),children:h.tabName},h.tabId))})]})]}),d&&e.jsx("div",{children:d})]}),t?e.jsx(Vt,{value:S,className:`mt-3 flex-grow overflow-auto h-full w-full ${i}`,children:e.jsx(wt,{className:"h-full w-full p-3",children:t})}):a.map(h=>e.jsx(Vt,{value:h.tabId,className:`mt-3 flex-grow overflow-auto h-full w-full ${i}`,children:e.jsx(wt,{className:"h-full w-full p-3",children:h?.tabContent})},h.tabId))]})}function An(){const{setTheme:t,theme:a,resolvedTheme:r}=Mr(),[n,s]=m.useState(!1);m.useEffect(()=>{s(!0)},[]);const o=a==="system"?r:a,i=N=>{const v=parseInt(N.slice(1),16),C=v>>16&255,b=v>>8&255,S=v>>0&255,[p,I,j]=[C,b,S].map(h=>(h=h/255,h<=.03928?h/12.92:Math.pow((h+.055)/1.055,2.4)));return .2126*p+.7152*I+.0722*j},d=N=>i(N)>.25?"#000000":"#ffffff",u=m.useCallback(()=>{const N=localStorage.getItem("primary")||"#0f172b",v=localStorage.getItem("secondary")||"#1b2336",C=localStorage.getItem("tertiary")||"#1f3aba",b=localStorage.getItem("primaryChart")||"#00bc7d",S=localStorage.getItem("secondaryChart")||"#fd9a00",p=localStorage.getItem("tertiaryChart")||"#ad46ff";document.documentElement.style.setProperty("--background",N),document.documentElement.style.setProperty("--secondary",v),document.documentElement.style.setProperty("--card",v),document.documentElement.style.setProperty("--popover",v),document.documentElement.style.setProperty("--muted",v),document.documentElement.style.setProperty("--sidebar",v),document.documentElement.style.setProperty("--btn-secondary",v),document.documentElement.style.setProperty("--accent",C),document.documentElement.style.setProperty("--sidebar-primary",C),document.documentElement.style.setProperty("--sidebar-accent",C),document.documentElement.style.setProperty("--foreground",d(N)),document.documentElement.style.setProperty("--secondary-foreground",d(v)),document.documentElement.style.setProperty("--card-foreground",d(v)),document.documentElement.style.setProperty("--popover-foreground",d(v)),document.documentElement.style.setProperty("--muted-foreground",d(v)),document.documentElement.style.setProperty("--sidebar-foreground",d(v)),document.documentElement.style.setProperty("--accent-foreground",d(C)),document.documentElement.style.setProperty("--sidebar-primary-foreground",d(C)),document.documentElement.style.setProperty("--sidebar-accent-foreground",d(C)),document.documentElement.style.setProperty("--chart-1",b),document.documentElement.style.setProperty("--chart-2",S),document.documentElement.style.setProperty("--chart-3",p),document.documentElement.style.setProperty("--chart-4",b),document.documentElement.style.setProperty("--chart-5",S)},[]),c=m.useCallback(()=>{document.documentElement.style.removeProperty("--background"),document.documentElement.style.removeProperty("--secondary"),document.documentElement.style.removeProperty("--card"),document.documentElement.style.removeProperty("--popover"),document.documentElement.style.removeProperty("--muted"),document.documentElement.style.removeProperty("--sidebar"),document.documentElement.style.removeProperty("--btn-secondary"),document.documentElement.style.removeProperty("--accent"),document.documentElement.style.removeProperty("--sidebar-primary"),document.documentElement.style.removeProperty("--sidebar-accent"),document.documentElement.style.removeProperty("--foreground"),document.documentElement.style.removeProperty("--secondary-foreground"),document.documentElement.style.removeProperty("--card-foreground"),document.documentElement.style.removeProperty("--popover-foreground"),document.documentElement.style.removeProperty("--muted-foreground"),document.documentElement.style.removeProperty("--sidebar-foreground"),document.documentElement.style.removeProperty("--accent-foreground"),document.documentElement.style.removeProperty("--sidebar-primary-foreground"),document.documentElement.style.removeProperty("--sidebar-accent-foreground"),document.documentElement.style.removeProperty("--chart-1"),document.documentElement.style.removeProperty("--chart-2"),document.documentElement.style.removeProperty("--chart-3"),document.documentElement.style.removeProperty("--chart-4"),document.documentElement.style.removeProperty("--chart-5")},[]);m.useEffect(()=>{n&&o==="blue-dark"&&(document.documentElement.classList.add("blue-dark"),u())},[n,o,u]);const x=m.useCallback(N=>{t(N),(N==="light"||N==="dark")&&(document.documentElement.classList.remove("blue-dark"),c()),N==="blue-dark"&&(document.documentElement.classList.add("blue-dark"),u())},[t,u,c]);if(!n)return null;const g=o==="blue-dark"?e.jsx(f.Waves,{className:"h-5 w-5"}):o==="dark"?e.jsx(f.Moon,{className:"h-5 w-5"}):o==="light"?e.jsx(f.Sun,{className:"h-5 w-5"}):e.jsx(f.Laptop,{className:"h-5 w-5"}),w=N=>o===N;return e.jsxs(ve,{children:[e.jsx(je,{asChild:!0,children:e.jsx(T,{variant:"outline",size:"icon","aria-label":"Change theme",title:`Theme: ${a==="system"?`system (${r})`:a}`,children:g})}),e.jsxs(we,{align:"end",sideOffset:8,children:[e.jsxs(ue,{onClick:()=>x("light"),className:"flex items-center justify-between gap-2",children:[e.jsxs("div",{className:"flex items-center",children:[e.jsx(f.Sun,{className:"mr-2 h-4 w-4"})," Light"]}),w("light")&&e.jsx(f.Check,{className:"h-4 w-4"})]}),e.jsxs(ue,{onClick:()=>x("dark"),className:"flex items-center justify-between gap-2",children:[e.jsxs("div",{className:"flex items-center",children:[e.jsx(f.Moon,{className:"mr-2 h-4 w-4"})," Dark"]}),w("dark")&&e.jsx(f.Check,{className:"h-4 w-4"})]}),e.jsxs(ue,{onClick:()=>x("blue-dark"),className:"flex items-center justify-between gap-2",children:[e.jsxs("div",{className:"flex items-center",children:[e.jsx(f.Waves,{className:"mr-2 h-4 w-4"})," Custom"]}),w("blue-dark")&&e.jsx(f.Check,{className:"h-4 w-4"})]})]})]})}function $i({title:t,value:a,valueText:r,isPercent:n=!0,className:s,titleClassName:o,valueClassName:i,progressClassName:d}){let u=a.toFixed(2);const c=u.split(".");return c[1]==="00"&&(u=c[0]),e.jsxs("div",{className:"w-full "+(s??""),children:[e.jsxs("div",{className:"flex items-center justify-between gap-4",children:[e.jsx("div",{className:"text-muted-foreground text-sm "+(o??""),children:t}),e.jsx("div",{className:"text-sm "+(i??""),children:r??`${u}${n?"%":""}`})]}),e.jsx(Pt,{value:a,className:"w-full mt-2 "+(d??"")})]})}function Gi({processedData:t,value:a,onChange:r,placeholder:n="Select items...",searchPlaceholder:s="Search...",className:o}){const[i,d]=D.useState(!1),[u,c]=D.useState(""),{flatTree:x,itemMap:g}=t,w=D.useMemo(()=>{const b=new Map,S=new Set(a);return[...x].reverse().forEach(p=>{const I=g[p.id];if(!I||!p.treatAsParent||I.childrenIds.length===0)S.has(p.id)&&b.set(p.id,"checked");else{const j=I.childrenIds.map(P=>b.get(P)),h=j.filter(P=>P==="checked").length,A=j.filter(P=>P==="indeterminate").length;h===I.childrenIds.length?b.set(p.id,"checked"):(h>0||A>0)&&b.set(p.id,"indeterminate")}}),b},[a,x,g]),N=b=>{const S=new Set(a),p=w.get(b.id),I=!(p==="checked"||p==="indeterminate"),j=new Set,h=[...g[b.id]?.childrenIds||[]];for(;h.length>0;){const P=h.shift();j.add(P),(g[P]?.childrenIds||[]).forEach(M=>h.push(M))}I?(S.add(b.id),j.forEach(P=>S.add(P))):(S.delete(b.id),j.forEach(P=>S.delete(P)));let A=g[b.id]?.parentId;for(;A;){const P=g[A];P&&P.childrenIds.length>0&&(P.childrenIds.every(M=>S.has(M))?S.add(A):S.delete(A)),A=P?.parentId}r(Array.from(S))},v=D.useMemo(()=>{if(!u)return x.slice();const b=u.toLowerCase(),S=new Set;x.forEach(h=>{(h.title.toLowerCase().includes(b)||h.description.toLowerCase().includes(b)||h.index.toLowerCase().includes(b))&&S.add(h.id)});const p=new Set(S),I=h=>{let A=h;for(;A;){const P=g[A]?.parentId;if(P&&!p.has(P))p.add(P),A=P;else break}},j=h=>{const A=g[h]?.childrenIds||[];for(const P of A)p.has(P)||(p.add(P),j(P))};return S.forEach(h=>{I(h),j(h)}),x.filter(h=>p.has(h.id))},[u,x,g]),C=()=>{const b=a.filter(S=>{const p=g[S];return!p||p.childrenIds.length===0});if(b.length===0)return e.jsx("span",{className:"text-muted-foreground",children:n});if(b.length===1){const S=x.find(p=>p.id===b[0]);return S?S.index:n}return`${b.length} items selected`};return e.jsxs(Q,{open:i,onOpenChange:d,children:[e.jsx(J,{asChild:!0,children:e.jsxs(T,{variant:"outline",role:"combobox","aria-expanded":i,className:l("w-full justify-between transition-all duration-150 ease-in-out border hover:border-primary hover:shadow-sm bg-secondary cursor-pointer",o),children:[e.jsx("span",{className:"truncate",children:C()}),e.jsx(f.ChevronsUpDown,{className:l("ml-2 h-4 w-4 shrink-0 transition-transform duration-200",i&&"rotate-180")})]})}),e.jsx(Z,{className:"w-[--radix-popover-trigger-width] p-0 max-h-[400px] overflow-y-auto",children:e.jsxs(Y,{children:[e.jsx(ie,{placeholder:s,value:u,onValueChange:c}),e.jsxs(le,{className:"transition-all duration-200 ease-in-out",children:[e.jsx(de,{children:"No results found."}),v.map(b=>e.jsxs(X,{value:`${b.index} ${b.title} ${b.description}`,onSelect:()=>N(b),className:"flex items-start cursor-pointer gap-2",style:{paddingLeft:`${b.level*1.5+.75}rem`},children:[e.jsx("input",{type:"checkbox",className:"mt-1 h-4 w-4 accent-primary border rounded",checked:w.get(b.id)==="checked",ref:S=>{S&&(S.indeterminate=w.get(b.id)==="indeterminate")},readOnly:!0}),e.jsxs("div",{className:"flex flex-col",children:[e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx("span",{className:"text-xs font-mono text-muted-foreground bg-muted px-1.5 py-0.5 rounded",children:b.index}),e.jsx("span",{className:"font-medium",children:b.title})]}),e.jsx("p",{className:"text-sm text-muted-foreground",children:b.description})]})]},b.id))]})]})})]})}function qi({widgetData:t}){const a=t.slice(0,4),r=t.slice(4);return e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsx("div",{className:"flex flex-col md:flex-row gap-2",children:a.map(n=>e.jsxs("div",{className:"flex flex-1 flex-row justify-between border rounded-md p-2 border-l-4 border-l-primary",children:[e.jsxs("div",{className:"flex flex-col",children:[e.jsx(_e,{children:e.jsxs(ne,{children:[e.jsx(se,{className:"cursor-default select-text",children:e.jsx("p",{className:"font-medium max-w-[240px] truncate",children:n.widgetText})}),e.jsx(oe,{children:e.jsx("p",{children:n.widgetText})})]})}),e.jsx("div",{children:n.onButtonClickfunc?e.jsx(T,{className:"px-0",variant:"link",onClick:()=>n.onButtonClickfunc?.({id:n.id}),children:n.widgetNumber}):e.jsx("p",{className:"inline-flex items-center justify-center px-0 py-2 text-sm font-medium border border-transparent rounded-md",children:n.widgetNumber})})]}),e.jsx("div",{className:"flex justify-end items-center",children:n.iconName&&e.jsx(Nt,{name:n.iconName})})]},n.id))}),r.length>0&&e.jsx("div",{className:"flex flex-col md:flex-row gap-2",children:r.map(n=>e.jsxs("div",{className:"flex flex-1 flex-row justify-between border rounded-md p-2 border-l-4 border-l-primary",children:[e.jsxs("div",{className:"flex flex-col",children:[e.jsx(_e,{children:e.jsxs(ne,{children:[e.jsx(se,{className:"cursor-default select-text",children:e.jsx("p",{className:"font-medium max-w-[240px] truncate",children:n.widgetText})}),e.jsx(oe,{children:e.jsx("p",{children:n.widgetText})})]})}),e.jsx("div",{children:n.onButtonClickfunc?e.jsx(T,{className:"px-0",variant:"link",onClick:()=>n.onButtonClickfunc?.({id:n.id}),children:n.widgetNumber}):e.jsx("p",{className:"inline-flex items-center justify-center px-0 py-2 text-sm font-medium border border-transparent rounded-md",children:n.widgetNumber})})]}),e.jsx("div",{className:"flex justify-end items-center",children:n.iconName&&e.jsx(Nt,{name:n.iconName})})]},n.id))})]})}function Wi({onNavigate:t,onView:a,label:r,extraTools:n,view:s}){const[o,i]=m.useState(s===q.Views.DAY?"DAY":s===q.Views.WEEK?"WEEK":"MONTH");return e.jsx(e.Fragment,{children:e.jsxs("div",{className:"flex flex-col md:flex-row justify-between items-start md:items-center mb-3",children:[e.jsxs(Oe,{type:"single",variant:"outline",onValueChange:d=>{switch(d){case"PREV":t("PREV");break;case"NEXT":t("NEXT");break;case"TODAY":t("TODAY");break}},children:[e.jsx(V,{className:"rounded-e-none",value:"PREV",children:e.jsx(f.ChevronLeft,{size:16})}),e.jsx(V,{className:"rounded-none border-x",value:"NEXT",children:e.jsx(f.ChevronRight,{size:16})}),e.jsx(V,{className:"rounded-s-none",value:"TODAY",children:"Today"})]}),e.jsx("span",{className:"rbc-toolbar-label",children:r}),e.jsxs("div",{className:"flex flex-row gap-2",children:[e.jsxs(Oe,{type:"single",variant:"outline",value:o,onValueChange:d=>{switch(i(d),d){case"DAY":a(q.Views.DAY);break;case"WEEK":a(q.Views.WEEK);break;case"MONTH":a(q.Views.MONTH);break}},children:[e.jsx(V,{className:"rounded-e-none",value:"MONTH",children:"Month"}),e.jsx(V,{className:"rounded-none border-x-0",value:"WEEK",children:"Week"}),e.jsx(V,{className:"rounded-s-none",value:"DAY",children:"Day"})]}),n?.map((d,u)=>e.jsx(m.Fragment,{children:d},u))]})]})})}function Hi({event:t,extraParamsEvent:a}){return e.jsxs("div",{className:"custom-event flex flex-row justify-between",children:[e.jsx("span",{className:"truncate w-auto",children:t.title}),e.jsxs("span",{className:"flex flex-row gap-1",children:[(a?.isEditableAll||t.isEditable)&&e.jsx(ze,{tooltipContent:"Edit",children:e.jsx("button",{className:"event-edit-button w-fit px-1",onClick:r=>{r.stopPropagation(),a?.onEditEventClick?.(t)},children:e.jsx(f.SquarePen,{size:16})})}),e.jsx(ze,{tooltipContent:"View",children:e.jsx("button",{className:"event-view-button w-fit px-1",onClick:r=>{r.stopPropagation(),a?.onViewEventClick?.(t)},children:e.jsx(f.Eye,{size:16})})})]})]})}const Ki={"en-US":Ts.enUS},Xi=q.dateFnsLocalizer({format:Xe.format,parse:Xe.parse,startOfWeek:Xe.startOfWeek,getDay:Xe.getDay,locales:Ki});function Yi({events:t,extraParamsEvent:a,extraTools:r}){const[n,s]=m.useState(a?.defaultView==="day"?q.Views.DAY:a?.defaultView==="week"?q.Views.WEEK:a?.defaultView==="month"?q.Views.MONTH:a?.defaultView==="work week"?q.Views.WORK_WEEK:a?.defaultView==="agenda"?q.Views.AGENDA:q.Views.MONTH),[o,i]=m.useState(new Date);return e.jsx(q.Calendar,{localizer:Xi,events:t||[],startAccessor:"start",endAccessor:"end",views:[q.Views.DAY,q.Views.WEEK,q.Views.MONTH],view:n,onView:d=>s(d),date:o,onNavigate:d=>i(d),components:{event:d=>e.jsx(Hi,{event:d.event,extraParamsEvent:a}),toolbar:d=>e.jsx(Wi,{...d,extraTools:r,view:n})},style:{height:a?.height||"100%",margin:a?.margin||"0px"}})}const Pn=m.createContext(void 0);function Tn({children:t}){const[a,r]=m.useState([]),n=d=>{r(u=>[...u.filter(x=>x.level<d.level),d])},s=(d,u)=>{r(u?d:c=>[...c,...d])},o=d=>{r(u=>[...u.filter(x=>x.level<=d.level)])},i=()=>{r([])};return e.jsx(Pn.Provider,{value:{breadcrumbItems:a,addBreadcrumb:n,backBreadcrumb:o,addBreadcrumbItems:s,clearBreadcrumb:i},children:t})}function ua(){const t=m.useContext(Pn);if(!t)throw new Error("useBreadcrumb must be used within a BreadcrumbProvider");return t}function Rn(){const{breadcrumbItems:t,backBreadcrumb:a}=ua(),[r,n]=m.useState(!1),[s,o]=m.useState(2),i=Rt(),d=be.useNavigate();m.useEffect(()=>{o(i?2:4)},[i]);const u=m.useMemo(()=>({firstVisibleBreadcrumbList:t.slice(0,2),hiddenBreadcrumbList:i?t.slice(2):t.slice(2,s),lastVisibleBreadcrumbList:t.length>2?t.slice(2-(t.length<s?t.length:s)):[]}),[t,s,i]);return!u||i==null||s==null?null:e.jsx(Wr,{children:e.jsxs(Hr,{children:[u.firstVisibleBreadcrumbList.map((c,x)=>x<t.length-1?e.jsxs(m.Fragment,{children:[e.jsx(We,{children:c.href?e.jsx(Gt,{className:"max-w-20 truncate md:max-w-none cursor-pointer",onClick:()=>{a(c),c.href&&d(c.href)},children:c.title}):e.jsx(Qe,{className:"max-w-20 truncate md:max-w-none",children:c.title})}),e.jsx(bt,{},"firstsep"+x)]},"first"+x):e.jsx(We,{children:e.jsx(Qe,{className:"max-w-20 truncate md:max-w-none",children:c.title})},"first"+x)),t.length>s?e.jsxs(e.Fragment,{children:[e.jsx(We,{children:i?e.jsxs(Qr,{open:r,onOpenChange:n,children:[e.jsx(Jr,{"aria-label":"Toggle Menu",children:e.jsx(qt,{className:"h-4 w-4"})}),e.jsxs(an,{children:[e.jsxs(rn,{className:"text-left",children:[e.jsx(sn,{children:"Navigate to"}),e.jsx(on,{children:"Select a page to navigate to."})]}),e.jsx("div",{className:"grid gap-1 px-2 lg:px-4",children:u.hiddenBreadcrumbList.map((c,x)=>e.jsx("div",{children:c.clickable==!1?e.jsx("span",{className:"py-1 text-sm",children:c.title}):e.jsx(be.Link,{to:c.href?c.href:"#",className:"py-1 text-sm",children:c.title})},x))}),e.jsx(nn,{className:"pt-4",children:e.jsx(en,{asChild:!0,children:e.jsx(T,{variant:"outline",children:"Close"})})})]})]}):e.jsxs(ve,{open:r,onOpenChange:n,children:[e.jsx(je,{className:"flex items-center gap-1","aria-label":"Toggle menu",children:e.jsx(qt,{className:"h-4 w-4"})}),e.jsx(we,{align:"start",children:u.hiddenBreadcrumbList.map((c,x)=>e.jsx(ue,{children:c.href?e.jsx(be.Link,{to:c.href?c.href:"#",children:c.title}):e.jsx("span",{children:c.title})},x))})]})}),!i&&e.jsx(bt,{})]}):null,!i&&u.lastVisibleBreadcrumbList.map((c,x)=>x==u.lastVisibleBreadcrumbList.length-1?e.jsx(We,{children:e.jsx(Qe,{className:"max-w-20 truncate md:max-w-none cursor-pointer",children:c.title})},"last"+x):e.jsxs(m.Fragment,{children:[e.jsx(We,{children:c.href?e.jsx(Gt,{className:"max-w-20 truncate md:max-w-none cursor-pointer",onClick:()=>{a(c),c.href&&d(c.href)},children:c.title}):e.jsx(Qe,{className:"max-w-20 truncate md:max-w-none",children:c.title})}),e.jsx(bt,{},"lastsep"+x)]},"last"+x))]},"BreadcrumbList1")},"Breadcrumb1")}function Qi({breadcrumb:t}){const{addBreadcrumb:a}=ua();return m.useEffect(()=>{a(t)},[t]),e.jsx(e.Fragment,{})}const _n=m.createContext(void 0);function zn({children:t}){const[a,r]=m.useState([]),[n,s]=m.useState(null),[o,i]=m.useState(null),d=N=>{r(v=>v.some(b=>b.title===N.title)?v.map(b=>b.title===N.title?{...b,...N}:b):[...v,N])},u=N=>{r(v=>v.filter(C=>C.title!==N))},c=(N,v)=>{r(C=>C.map(b=>b.title===N?{...b,...v}:b))},x=N=>{s(N)},g=N=>{i(N)},w=()=>{r([])};return e.jsx(_n.Provider,{value:{navItems:a,header:n,footer:o,setNavItems:r,addNavItem:d,removeNavItem:u,updateNavItem:c,clearNavItems:w,setSidebarHeader:x,setSidebarFooter:g},children:t})}function lt(){const t=m.useContext(_n);if(!t)throw new Error("useSidebarNav must be used within a SidebarNavProvider");return t}function Fn(){const{navItems:t}=lt();return e.jsx(Ar,{children:e.jsx(Pr,{children:t.map(a=>a.items&&a.items.length>0?e.jsx(Kr,{asChild:!0,defaultOpen:a.isActive,className:"group/collapsible",children:e.jsxs(Ot,{children:[e.jsx(Xr,{asChild:!0,children:e.jsxs(Bt,{tooltip:a.title,children:[a.icon&&e.jsx(a.icon,{}),e.jsx("span",{children:a.title}),e.jsx(f.ChevronRight,{className:"ml-auto transition-transform duration-200 group-data-[state=open]/collapsible:rotate-90"})]})}),e.jsx(Yr,{children:e.jsx(Tr,{children:a.items.map(r=>e.jsx(Rr,{children:e.jsx(_r,{asChild:!0,children:e.jsx(be.Link,{to:r.url,children:e.jsx("span",{children:r.title})})})},r.title))})})]})},a.title):e.jsx(Ot,{children:e.jsx(Bt,{asChild:!0,tooltip:a.title,children:e.jsxs(be.Link,{to:a.url,className:"flex items-center gap-2 w-full",children:[a.icon&&e.jsx(a.icon,{}),e.jsx("span",{children:a.title})]})})},a.title))})})}function Ji({items:t,sidebarHeader:a,sidebarFooter:r}){const{setNavItems:n,setSidebarHeader:s,setSidebarFooter:o}=lt();return m.useEffect(()=>{n(t),s(a),o(r)},[t,a,r,n,s,o]),null}function Zi({formControl:t,name:a,label:r,placeholder:n,formDescription:s,items:o,disabled:i,onSelect:d}){return e.jsx(e.Fragment,{children:e.jsx(xe,{control:t,name:a,render:({field:u})=>e.jsxs(fe,{className:"",children:[r&&e.jsx(e.Fragment,{children:e.jsx(Ne,{children:r})}),e.jsxs(Q,{children:[e.jsx(J,{asChild:!0,className:"w-full",children:e.jsx(ge,{children:e.jsxs(T,{variant:"outline",role:"combobox",className:l("justify-between",!u.value&&"text-muted-foreground"),disabled:i==!0||i&&i(...arguments),children:[u.value?o.find(c=>c.value===u.value)?.label||u.value:n,e.jsx(f.ChevronsUpDown,{className:"opacity-50"})]})})}),e.jsx(Z,{className:"p-0",align:"start",children:e.jsxs(Y,{children:[e.jsx(ie,{placeholder:"Search..."}),e.jsxs(le,{children:[e.jsx(de,{children:"No items found."}),e.jsx(re,{children:o.map(c=>e.jsxs(X,{value:c.value,disabled:c.disabled==!0||c.disabled&&c.disabled(c),onSelect:x=>{u.onChange(x),d&&d(x)},children:[c?.label||c.value,e.jsx(f.Check,{className:l("ml-auto",c.value===u.value?"opacity-100":"opacity-0")})]},c.value))})]})]})})]}),s&&e.jsx(ye,{children:s}),e.jsx(pe,{})]})})})}function el(t){const{field:a}=Ke.useController({name:t.name,control:t.formControl}),r=t.value!==void 0?t.value:a.value;return e.jsx(xe,{control:t.formControl,name:t.name,render:({field:n})=>e.jsxs(fe,{className:"",children:[t.label&&e.jsxs(e.Fragment,{children:[e.jsx(Ne,{children:t.label}),e.jsx("br",{})]}),e.jsxs(Q,{children:[e.jsx(J,{asChild:!0,className:"w-full",children:e.jsx(ge,{children:e.jsxs(T,{variant:"outline",role:"combobox",className:l("justify-between",!r&&"text-muted-foreground"),disabled:typeof t.disabled=="function"?t.disabled():t.disabled,children:[r?t.items.find(s=>s.value===r)?.label||r:t.placeholder,e.jsx(f.ChevronsUpDown,{className:"opacity-50"})]})})}),e.jsx(Z,{className:"p-0",align:"start",children:e.jsxs(Y,{children:[e.jsx(ie,{placeholder:"Search..."}),e.jsxs(le,{children:[e.jsx(de,{children:"No items found."}),e.jsx(re,{children:t.items.map(s=>e.jsxs(X,{value:s.value,disabled:typeof s.disabled=="function"?s.disabled(s):s.disabled,onSelect:o=>{n.onChange(o),t.onSelect&&t.onSelect(o),t.onChange&&t.onChange(o)},children:[s?.label||s.value,e.jsx(f.Check,{className:l("ml-auto",s.value===r?"opacity-100":"opacity-0")})]},s.value))})]})]})})]}),t.formDescription&&e.jsx(ye,{children:t.formDescription}),e.jsx(pe,{})]})})}function tl({formControl:t,name:a,label:r,placeholder:n,dateFormat:s,calendarDateDisabled:o,formDescription:i,disabled:d}){return e.jsx(e.Fragment,{children:e.jsx(xe,{control:t,name:a,render:({field:u})=>e.jsxs(fe,{children:[r&&e.jsx(e.Fragment,{children:e.jsx(Ne,{children:r})}),e.jsxs(Q,{children:[e.jsx(J,{asChild:!0,className:"w-full",children:e.jsx(ge,{children:e.jsxs(T,{variant:"outline",className:l(!u.value&&"text-foreground/50"),disabled:d,children:[u.value?Xe.format(u.value,s||"PPP"):e.jsx("span",{children:n||"Pick a date"}),e.jsx(f.CalendarIcon,{className:"ml-auto h-4 w-4 opacity-50"})]})})}),e.jsx(Z,{className:"w-auto p-0",align:"start",children:e.jsx(Ka,{mode:"single",selected:u.value,onSelect:u.onChange,disabled:o,captionLayout:"dropdown",autoFocus:!0})})]}),i&&e.jsx(ye,{children:i}),e.jsx(pe,{})]})})})}function al(){return e.jsx(e.Fragment,{})}function rl({formControl:t,label:a,formDescription:r,extraFormComponent:n,name:s,...o}){return e.jsx(e.Fragment,{children:e.jsx(xe,{control:t,name:s,render:({field:i})=>e.jsxs(fe,{children:[a&&e.jsx(Ne,{children:a}),e.jsx(ge,{children:e.jsx(H,{...i,...o})}),n&&n(i.value),r&&e.jsx(ye,{children:r}),e.jsx(pe,{})]})})})}function nl({formControl:t,name:a,label:r,placeholder:n,formDescription:s,items:o=[],disabled:i,onSelect:d,defaultValue:u=[],defaultOptions:c=2}){const[x,g]=m.useState(""),w=m.useRef(null),N=o.filter(v=>v.label?.toLowerCase().includes(x.toLowerCase())).sort((v,C)=>(v?.label??"").localeCompare(C?.label??""));return e.jsx(xe,{control:t,name:a,render:({field:v})=>{m.useEffect(()=>{(v.value===void 0||v.value===null)&&u.length>0&&v.onChange(u)},[u,v]);const C=v.value||[],[b,S]=m.useState(C.length),p=m.useCallback(()=>{const h=w.current;if(!h)return b;const A=Array.from(h.children);let P=h.offsetWidth,R=0,M=0;for(const F of A){const ce=F.offsetWidth+4;if(R+ce<=P)R+=ce,M++;else break}return M},[b]);m.useEffect(()=>{const h=w.current;if(!h)return;let A=null;const P=new ResizeObserver(()=>{A&&cancelAnimationFrame(A),A=requestAnimationFrame(()=>{const R=p();S(M=>M!==R?R:M)})});return P.observe(h),S(p()),()=>{A&&cancelAnimationFrame(A),P.disconnect()}},[p]);const I=h=>{let A;C.includes(h)?A=C.filter(P=>P!==h):A=[...C,h],v.onChange(A),d&&d(A)},j=h=>{const A=h.currentTarget;A.scrollTop+=h.deltaY,h.preventDefault()};return e.jsxs(fe,{children:[r&&e.jsx(Ne,{children:r}),e.jsxs(Q,{children:[e.jsx(J,{asChild:!0,className:"w-full",children:e.jsx(ge,{children:e.jsxs(T,{variant:"outline",role:"combobox",className:l("justify-between",!C.length&&"text-foreground/50"),disabled:i===!0||i&&i(...arguments),children:[C.length>0?e.jsx(_e,{children:e.jsxs("div",{ref:w,className:"flex flex-wrap gap-2 items-center overflow-hidden",children:[C.slice(0,c).map(h=>{const A=o.find(P=>P.value===h)?.label||h;return e.jsxs("span",{className:"flex items-center px-2 py-1 bg-secondary text-secondary-foreground rounded-md truncate max-w-full",title:A,children:[e.jsx("span",{className:"truncate max-w-[120px]",children:A}),e.jsx("span",{role:"button",tabIndex:0,onClick:P=>{P.stopPropagation();const R=C.filter(M=>M!==h);v.onChange(R),d&&d(R)},onKeyDown:P=>{if(P.key==="Enter"||P.key===" "){P.preventDefault(),P.stopPropagation();const R=C.filter(M=>M!==h);v.onChange(R),d&&d(R)}},className:"ml-1 text-muted-foreground hover:text-destructive cursor-pointer outline-none",children:e.jsx(f.X,{className:"w-3 h-3 ml-1"})})]},h)}),C.length>c&&e.jsxs(ne,{children:[e.jsx(se,{asChild:!0,children:e.jsxs("span",{className:"px-2 py-1 bg-secondary text-secondary-foreground rounded-md cursor-pointer",children:["+",C.length-c," more"]})}),e.jsx(oe,{className:"max-w-xs break-words",children:e.jsx("div",{onWheel:j,className:"flex flex-col gap-1 max-h-[200px] overflow-auto",children:C.slice(c).map(h=>e.jsx("span",{className:"text-sm",children:o.find(A=>A.value===h)?.label||h},h))})})]})]})}):n,e.jsx(f.ChevronsUpDown,{className:"opacity-50"})]})})}),e.jsx(Z,{id:"multiSelectPopover",className:"p-0 min-w-[--radix-popover-trigger-width]",style:{width:"max-content",maxWidth:"min(500px, 90vw)"},align:"start",children:e.jsxs(Y,{id:"commandPopover",children:[e.jsx(ie,{placeholder:"Search...",value:x,onValueChange:g,autoFocus:!0}),e.jsxs(le,{className:"max-h-60 overflow-auto",onWheel:j,children:[e.jsx(de,{children:"No items found."}),e.jsx(re,{children:N.map(h=>{const A=C.includes(h.value);return e.jsxs(X,{value:h.label??"",onSelect:()=>I(h.value),className:"flex items-center space-x-2 justify-start",children:[e.jsx(Ve,{checked:A,onCheckedChange:()=>I(h.value),onClick:P=>P.stopPropagation()}),e.jsx("span",{children:h.label})]},h.value)})})]})]})})]}),s&&e.jsx(ye,{children:s}),e.jsx(pe,{})]})}})}function sl({formControl:t,label:a,formDescription:r,extraFormComponent:n,name:s,...o}){return e.jsx(e.Fragment,{children:e.jsx(xe,{control:t,name:s,render:({field:i})=>e.jsxs(fe,{children:[a&&e.jsx(Ne,{children:a}),e.jsx(ge,{children:e.jsx(un,{maxLength:4,...i,children:e.jsxs(mn,{children:[e.jsx(Je,{index:0}),e.jsx(Je,{index:1}),e.jsx(Je,{index:2}),e.jsx(Je,{index:3})]})})}),n&&n(i.value),r&&e.jsx(ye,{children:r}),e.jsx(pe,{})]})})})}function ol(){return e.jsx("div",{children:"FormPhoneInput"})}function il({formControl:t,name:a,label:r,formItemClass:n,formDescription:s,...o}){return e.jsx(e.Fragment,{children:e.jsx(xe,{control:t,name:a,render:({field:i})=>e.jsxs(fe,{className:n,children:[r&&e.jsx(Ne,{children:r}),e.jsx(ge,{children:e.jsx(qr,{...i,...o})}),s&&e.jsx(ye,{children:s}),e.jsx(pe,{})]})})})}function ll({formControl:t,label:a,formDescription:r,extraFormComponent:n,name:s,...o}){const[i,d]=D.useState(!1),u=()=>d(!i);return e.jsx(e.Fragment,{children:e.jsx(xe,{control:t,name:s,render:({field:c})=>e.jsxs(fe,{children:[a&&e.jsx(Ne,{children:a}),e.jsxs("div",{className:"relative",children:[e.jsx(ge,{children:e.jsx(H,{type:i?"text":"password",...c,...o,className:`${o.className||""} pr-10`})}),e.jsx(T,{type:"button",variant:"ghost",size:"icon",className:"absolute right-0 top-0 h-full px-3 py-2 text-muted-foreground hover:bg-transparent!",onClick:u,children:i?e.jsx(f.EyeOff,{className:"h-4 w-4"}):e.jsx(f.Eye,{className:"h-4 w-4"})})]}),n&&n(c.value),r&&e.jsx(ye,{children:r}),e.jsx(pe,{})]})})})}function dl({rowCount:t=6,showToolbar:a=!0}){return e.jsxs("div",{className:"space-y-4",children:[a&&e.jsxs("div",{className:"flex justify-between",children:[e.jsx(Be,{className:"h-8 w-64 rounded-md"}),e.jsx(Be,{className:"h-8 w-32 rounded-md"})]}),e.jsx("div",{className:"space-y-4",children:[...Array(t)].map((r,n)=>e.jsx("div",{className:"grid gap-4 items-center",children:e.jsx(Be,{className:"h-8 w-full"})},n))})]})}function cl({count:t}){return e.jsx("div",{className:"flex flex-row gap-3 w-full",children:t>0&&Array.from({length:t}).map((a,r)=>e.jsx(Be,{className:"w-1/"+t+" flex flex-col md:flex-row gap-2 h-20",children:e.jsx("div",{className:"flex flex-1 flex-row justify-between border rounded-md p-2 bg-card-new"})},"widget_"+r))})}function Mn(){const t=Ke.useForm({defaultValues:{text:"",fileNames:[]}}),[a,r]=m.useState(""),[n,s]=m.useState([]),[o,i]=m.useState([]),[d,u]=m.useState(""),[c,x]=m.useState(!0),g=o.some(b=>b.progress<100),w=async(b,S)=>{const p=new FormData;p.append("file",S.file);try{const I=await ka.post("UPLOAD_ENDPOINT_URL",p,{onUploadProgress:j=>{const h=Math.round(j.loaded*100/(j.total||1));i(A=>A.map((P,R)=>R===b?{...P,progress:h}:P))}});i(j=>j.map((h,A)=>A===b?{...h,url:I.data.url,progress:100}:h))}catch(I){console.error("Upload failed:",I)}};m.useEffect(()=>{const b=new Date,S=String(b.getDate()).padStart(2,"0"),p=String(b.getMonth()+1).padStart(2,"0"),I=b.getFullYear();u(`${S}-${p}-${I}`)},[]),m.useEffect(()=>{o.forEach((b,S)=>{b.progress===0&&w(S,b)})},[o]);const N=()=>{if(a.trim()||o.length>0){const b={text:a.trim(),fileNames:o.map(S=>S.name)};s([b,...n]),r(""),i([]),x(!1)}},v=b=>{if(b.target.files){const S=Array.from(b.target.files).map(p=>({name:p.name,url:"",progress:0,file:p}));i(p=>[...p,...S]),x(!1)}},C=b=>{const S=o.filter((p,I)=>I!==b);i(S),S.length===0&&n.length===0&&x(!0)};return e.jsx(e.Fragment,{children:e.jsxs("div",{className:"flex flex-col h-full w-full gap-3",children:[e.jsxs("div",{className:"flex-grow overflow-auto flex flex-col-reverse gap-2",children:[c&&e.jsx(ca,{text:"No files uploaded"}),o.length>0&&e.jsxs("div",{className:"p-2 my-1 rounded-md border",children:[e.jsx("p",{className:"font-bold",children:"Selected Files:"}),o.map((b,S)=>e.jsxs("div",{className:"flex flex-col mb-2",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("a",{href:b.url,download:b.name,className:"text-sm text-blue-600 underline cursor-pointer",children:b.name}),e.jsx("button",{onClick:()=>C(S),className:"text-red-500 hover:text-red-800",children:e.jsx(f.X,{className:"w-4 h-4"})})]}),e.jsx(Pt,{value:b.progress}),e.jsxs("p",{className:"text-xs text-gray-500",children:[b.progress,"% uploaded"]})]},S))]}),n.map((b,S)=>e.jsxs("div",{className:"border-b text-sm pb-2",children:[b.fileNames.map((p,I)=>e.jsx("p",{children:e.jsx("a",{href:o.find(j=>j.name===p)?.url||"#",download:p,className:"text-sm text-blue-500 underline cursor-pointer",children:p})},I)),e.jsx("p",{children:b.text||"(No Text)"}),e.jsxs("div",{className:"flex justify-between",children:[e.jsx("p",{children:"John Doe"}),e.jsx("p",{children:d})]})]},S))]}),e.jsx(ln,{...t,children:e.jsx("form",{onSubmit:t.handleSubmit(()=>N()),children:e.jsx("div",{className:"flex flex-col",children:e.jsxs("div",{className:"flex items-center justify-center gap-2",children:[e.jsx("div",{className:"flex-1",children:e.jsx(xe,{name:"text",render:({field:b})=>e.jsxs(fe,{children:[e.jsx(ge,{children:e.jsx(H,{id:"text-input",type:"text",value:a,onChange:S=>r(S.target.value),placeholder:"Type something..."})}),e.jsx(pe,{})]})})}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(Se,{htmlFor:"file-upload",className:"sr-only",children:"Upload Files"}),e.jsx(T,{variant:"outline",asChild:!0,children:e.jsx("label",{htmlFor:"file-upload",className:"cursor-pointer",children:e.jsx(f.UploadIcon,{className:"w-5 h-5"})})}),e.jsx(H,{id:"file-upload",type:"file",multiple:!0,onChange:v,className:"hidden"})]}),e.jsx(T,{variant:"outline",type:"submit",disabled:g,children:e.jsx(f.Send,{})})]})})})})]})})}function En({...t}){const{navItems:a,header:r,footer:n}=lt();return!a||a.length===0?null:e.jsxs(Nr,{className:"ml-12",collapsible:"offcanvas",...t,children:[r&&e.jsx(kr,{children:r}),e.jsx(Dr,{children:e.jsx(Fn,{})}),n&&e.jsx(Ir,{children:n}),e.jsx(Cr,{})]})}function Ln(){return e.jsx("footer",{className:"ml-12 flex border-t px-4 py-2 justify-center lg:justify-start",children:e.jsxs("div",{className:"flex gap-2 items-center",children:[e.jsx(f.Copyright,{className:"size-4"}),e.jsx("span",{children:"Powered By"}),e.jsx("a",{href:"https://keross.com",target:"_blank",children:"Keross"}),e.jsx("span",{className:"",children:"|"}),e.jsx("span",{id:"txtCopyrightYear",className:"",children:new Date().getFullYear()})]})})}const te={IKON_ACCOUNT_API_URL:"",IKON_AUTH_API_URL:"",IKON_BASE_API_URL:"",IKON_PLATFORM_API_URL:"",IKON_PLATFORM_PROFILE_URL:"",IKON_PLATFORM_UI_URL:"",IKON_USER_API_URL:"",LOGIN_PAGE_URL:""},ul=t=>{te.IKON_BASE_API_URL=t.IKON_BASE_API_URL,te.IKON_PLATFORM_API_URL=`${t.IKON_BASE_API_URL}/platform`,te.IKON_AUTH_API_URL=`${te.IKON_PLATFORM_API_URL}/auth`,te.IKON_USER_API_URL=`${te.IKON_PLATFORM_API_URL}/user`,te.IKON_ACCOUNT_API_URL=`${te.IKON_PLATFORM_API_URL}/account`,te.LOGIN_PAGE_URL=t.LOGIN_PAGE_URL,te.IKON_PLATFORM_UI_URL=t.IKON_PLATFORM_UI_URL,te.IKON_PLATFORM_PROFILE_URL=`${t.IKON_PLATFORM_UI_URL}/setting/profile`},he=()=>te;function On(){const{navItems:t}=lt(),{IKON_PLATFORM_UI_URL:a}=he();return e.jsx("header",{className:"ml-12 flex h-12 border-b shrink-0 items-center gap-2 transition-[width,height] ease-linear group-has-data-[collapsible=icon]/sidebar-wrapper:h-12",children:e.jsxs("div",{className:"flex items-center justify-between gap-2 px-4 w-full",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[!t||t.length===0?e.jsx("div",{}):e.jsx(yr,{className:"-ml-1"}),!t||t.length===0?e.jsx("div",{}):e.jsx(Tt,{orientation:"vertical",className:"mr-2 data-[orientation=vertical]:h-4"}),e.jsx(Rn,{})]}),e.jsxs("div",{className:"ml-auto flex gap-4",children:[e.jsx(Re,{className:"px-2!",tooltipContent:"Notifications",children:e.jsx(f.Bell,{})}),e.jsx(An,{}),e.jsx(be.Link,{to:`${a}/app-store`,children:e.jsxs(it,{variant:"default",children:[e.jsx(f.Play,{}),"App Store"]})})]})]})})}const ma="ikoncloud_next_";function Ht(t,a,r){let n=r?.expires;!n&&r?.maxAge&&(n=r.maxAge/86400),Qt.set(ma+t,a,{httpOnly:!1,sameSite:"lax",expires:n})}function yt(t){return Qt.get(ma+t)}function Kt(t){Qt.remove(ma+t)}async function ml(){}async function dt(t){const a=yt("accessToken"),r=yt("refreshToken");if(a)return a;if(r){const n=await Bn(r,t?.isSetToken);if(n)return n}return null}async function Bn(t,a){try{const r=await fetch(`${he().IKON_AUTH_API_URL}/refresh-token`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({refreshToken:t})});if(r.ok){const s=await r.json(),{accessToken:o,refreshToken:i,expiresIn:d,refreshExpiresIn:u}=s;if(a==null||a)try{Ht("accessToken",o,{maxAge:d}),Ht("refreshToken",i,{maxAge:u})}catch(c){console.error(c)}return o}}catch(r){console.error("Failed to refresh access token:",r)}return null}function Xt(){Kt("accessToken"),Kt("refreshToken"),typeof window<"u"&&(window.location.href=he().LOGIN_PAGE_URL)}const Fe=ka.create();Fe.interceptors.request.use(async t=>{const a=await dt();return a&&t.headers&&(t.headers.Authorization=`Bearer ${a}`),t},t=>Promise.reject(t instanceof Error?t:new Error(String(t))));Fe.interceptors.response.use(t=>t,async t=>{const a=t.config;if(t.response?.status===401&&a&&!a._retry){a._retry=!0;try{const r=await dt({isSetToken:!0});if(r&&a.headers)return a.headers.Authorization=`Bearer ${r}`,Fe(a);Xt()}catch(r){return Xt(),Promise.reject(r instanceof Error?r:new Error(String(r)))}}return Promise.reject(t instanceof Error?t:new Error(String(t)))});function xl(t){return Ue.useQuery({queryKey:["profile",t],queryFn:async()=>{if(!t)throw new Error("No userId");return(await Fe.get(`${he().IKON_USER_API_URL}/${t}`)).data},enabled:!!t})}function fl(){const t=Ue.useQueryClient();return Ue.useMutation({mutationFn:async a=>{await Fe.post(`${he().IKON_AUTH_API_URL}/switch-account`,{targetAccountId:a})},onSuccess:()=>{t.invalidateQueries({queryKey:["accounts"]}),t.invalidateQueries({queryKey:["profile"]})}})}function gl(){return Ue.useQuery({queryKey:["accountMembership"],queryFn:async()=>{const{data:t}=await Fe.get(`${he().IKON_BASE_API_URL}/platform/user/account-membership`);return t}})}function pl(){return Ue.useQuery({queryKey:["softwares"],queryFn:async()=>{const{data:t}=await Fe.get(`${he().IKON_BASE_API_URL}/platform/software/accessible/user`);return t}})}const Un=m.createContext(void 0);function hl({children:t}){const[a,r]=m.useState(null);m.useEffect(()=>{const d=yt("accessToken");if(d)try{const u=Rs.jwtDecode(d);r(c=>({...c,userId:u.sub,primaryAccountId:u.primaryAccountId,activeAccountId:u.activeAccountId,roles:u.platformAccess?.roles??[]}))}catch{r(null)}},[]);const n=a?.userId??"",{data:s,isSuccess:o}=xl(n);m.useEffect(()=>{o&&s&&r(d=>({...d,...s}))},[o,s]);const i=d=>{r(u=>({...u,accountName:d}))};return e.jsx(Un.Provider,{value:{user:a,setUser:r,setAccountName:i},children:t})}function Vn(){const t=m.useContext(Un);if(!t)throw new Error("useUser must be used within a UserProvider");return t}function bl(){const{user:t,setUser:a}=Vn();return e.jsxs(ve,{children:[e.jsx(je,{asChild:!0,children:e.jsx(T,{variant:"ghost",size:"icon",className:"h-10 w-10",children:e.jsx(f.CircleUserRound,{className:"h-8 w-8"})})}),e.jsxs(we,{className:"w-55 p-0",side:"right",sideOffset:8,children:[e.jsxs("div",{className:"flex items-start gap-3 p-4 bg-card",children:[e.jsx(f.CircleUserRound,{className:"h-8 w-8"}),e.jsxs("div",{className:"flex flex-col gap-0.5 flex-1 min-w-0",children:[e.jsx("p",{className:"text-sm font-bold text-foreground blue-dark:text-muted-foreground truncate",children:t?.userName}),e.jsx("p",{className:"text-xs text-muted-foreground truncate",children:t?.userEmail}),e.jsx("p",{className:"text-sm text-muted-foreground font-semibold"})]})]}),e.jsx(rt,{className:"my-0"}),e.jsxs(ue,{onClick:async()=>{Xt()},className:"flex items-center gap-2 px-4 py-3 cursor-pointer focus:bg-destructive dark:focus:bg-destructive blue-dark:focus:bg-destructive",children:[e.jsx(f.LogOut,{className:"h-4 w-4 text-foreground"}),e.jsx("span",{children:"Log out"})]})]})]})}function vl(){const{data:t}=gl(),{user:a,setAccountName:r}=Vn(),n=i=>i?i.split(" ").map(d=>d[0]).join("").toUpperCase().slice(0,2):"UN";m.useEffect(()=>{const i=t?.find(d=>d.accountId===a?.activeAccountId);r(i?.accountName||"")},[t]);const{mutateAsync:s}=fl(),o=async i=>{await s(i.accountId),r(i.accountName)};return e.jsxs(ve,{children:[e.jsx(je,{asChild:!0,children:e.jsx(T,{variant:"default",className:"mb-4 h-8 w-8 rounded-lg p-0",disabled:!a?.accountName,children:e.jsx("span",{className:"text-base font-medium text-accent-background",children:a?n(a.accountName):"..."})})}),e.jsxs(we,{className:"w-55",side:"right",sideOffset:8,align:"start",children:[e.jsx("div",{className:"px-2 py-1.5 text-xs font-semibold text-foreground",children:"Accounts"}),t?.map(i=>e.jsxs(ue,{className:"flex items-center justify-between cursor-pointer",onClick:async()=>{try{await o(i),window.location.reload()}catch(d){console.error("Switch account failed",d)}},children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("div",{className:"h-6 w-6 rounded bg-primary/10 flex items-center justify-center",children:e.jsx("span",{className:"text-xs font-medium text-primary",children:n(i.accountName)})}),e.jsx("span",{className:"text-sm",children:i.accountName})]}),a?.activeAccountId===i.accountId&&e.jsx(f.Check,{className:"h-4 w-4 text-primary"})]},i.accountId))]})]})}function jl(){const{IKON_PLATFORM_UI_URL:t}=he(),{data:a}=pl();function r(n){return n.split("-").map(s=>s.charAt(0).toUpperCase()+s.slice(1)).join("")}return e.jsxs(e.Fragment,{children:[" ",e.jsx("nav",{className:"flex flex-col gap-1",children:e.jsxs(ne,{children:[e.jsx(se,{asChild:!0,className:"h-8 w-8",children:e.jsx(T,{variant:"ghost",size:"icon",className:"h-10 w-10",asChild:!0,children:e.jsxs(be.Link,{to:`${t}/home`,children:[e.jsx(f.Home,{className:"h-8 w-8"}),e.jsx("span",{className:"sr-only",children:"Home"})]})})}),e.jsx(oe,{side:"right",sideOffset:5,children:"Home"})]},"home")}),e.jsx("nav",{className:"flex flex-col gap-1 flex-1",children:a?.map(n=>{if(!n.visible)return null;const s=!!(n.icon&&n.icon.trim()!=="");return e.jsxs(ne,{children:[e.jsx(se,{asChild:!0,className:"h-8 w-8",children:e.jsx(T,{variant:"ghost",size:"icon",className:"h-10 w-10",asChild:!0,children:e.jsxs(be.Link,{to:n.url??"#",children:[s?e.jsx(Nt,{name:r(n.icon??""),className:"h-8 w-8"}):e.jsx(f.FolderCode,{className:"h-8 w-8"}),e.jsx("span",{className:"sr-only",children:n.softwareName})]})})}),e.jsx(oe,{side:"right",sideOffset:5,children:n.softwareName})]},n.softwareName)})})]})}const $n=()=>{const{IKON_PLATFORM_UI_URL:t}=he();return e.jsx(_e,{delayDuration:0,children:e.jsxs("aside",{className:"fixed left-0 top-0 z-20 h-screen w-12 border-r border-border bg-sidebar text-sidebar-foreground flex flex-col items-center py-4 ",children:[e.jsx(vl,{}),e.jsx(jl,{}),e.jsxs(ne,{children:[e.jsx(se,{asChild:!0,className:"h-8 w-8",children:e.jsx(T,{variant:"ghost",className:"h-10 w-10",asChild:!0,children:e.jsxs(be.Link,{to:`${t}/settings`,children:[e.jsx(f.Settings,{className:"h-8 w-8"}),e.jsx("span",{className:"sr-only",children:"Settings"})]})})}),e.jsx(oe,{side:"right",sideOffset:5,children:"Settings"})]},"settings"),e.jsx(bl,{})]})})};function Gn({children:t}){return e.jsxs(e.Fragment,{children:[e.jsx($n,{}),e.jsx(wr,{children:e.jsx(bn,{children:e.jsxs(zn,{children:[e.jsx(En,{}),e.jsxs(Sr,{className:"flex flex-col h-screen",children:[e.jsx(On,{}),e.jsx("div",{className:"flex flex-col gap-4 p-4 pt-0 ml-12 grow overflow-auto scrollbar-hidden",children:t}),e.jsx(Ln,{})]})]})})})]})}const qn=m.createContext(void 0);function Wn({children:t}){const[a,r]=m.useState("Poppins"),[n,s]=m.useState(!1);m.useEffect(()=>{s(!0);const i=localStorage.getItem("app-font");i&&["Poppins","Oswald","Outfit"].includes(i)&&r(i)},[]),m.useEffect(()=>{if(!n)return;const i={Poppins:"var(--font-poppins)",Oswald:"var(--font-oswald)",Outfit:"var(--font-outfit)"};document.body.style.fontFamily=i[a],document.documentElement.style.fontFamily=i[a],localStorage.setItem("app-font",a),console.log("Font changed to:",a,i[a])},[a,n]);const o=m.useMemo(()=>({font:a,setFont:r}),[a]);return e.jsx(qn.Provider,{value:o,children:t})}const wl=()=>{const t=m.useContext(qn);if(t===void 0)throw new Error("useFont must be used within a FontProvider");return t},Hn=m.createContext(void 0);function Kn({children:t}){const[a,r]=m.useState(.5),[n,s]=m.useState(!1);m.useEffect(()=>{s(!0);const i=localStorage.getItem("app-radius");if(i){const d=parseFloat(i);[0,.25,.5,.75,1].includes(d)&&r(d)}},[]),m.useEffect(()=>{if(!n)return;const i=a===0?"0rem":`${a}rem`;document.documentElement.style.setProperty("--radius",i),localStorage.setItem("app-radius",a.toString()),console.log("Radius changed to:",a,i)},[a,n]);const o=m.useMemo(()=>({radius:a,setRadius:r}),[a]);return e.jsx(Hn.Provider,{value:o,children:t})}const Nl=()=>{const t=m.useContext(Hn);if(t===void 0)throw new Error("useRadius must be used within a RadiusProvider");return t},Xn=m.createContext(void 0);function yl({children:t}){const[a,r]=m.useState(0),n=m.useCallback(()=>{r(s=>s+1)},[]);return e.jsx(Xn.Provider,{value:{refresh:n,refreshCounter:a},children:t})}function Cl(){const t=m.useContext(Xn);if(t===void 0)throw new Error("useRefresh must be used within a RefreshProvider");return t}const Sl=new Ue.QueryClient;function kl({children:t}){return e.jsx(Ue.QueryClientProvider,{client:Sl,children:t})}function Il({children:t}){const a=he();if(!a.IKON_BASE_API_URL||!a.IKON_PLATFORM_UI_URL||!a.LOGIN_PAGE_URL)throw new Error("[IKON] ProviderWrapper: Ikon config not set. Please call setIkonConfig() before rendering ProviderWrapper.");return e.jsx(kl,{children:e.jsx(hl,{children:e.jsx(Fr,{children:e.jsx(Wn,{children:e.jsx(Kn,{children:e.jsx(Tn,{children:e.jsx(yl,{children:e.jsx(be.BrowserRouter,{children:e.jsx(Gn,{children:t})})})})})})})})})}function Dl({activityLogs:t=[]}){const a=[{tabName:"Activity",tabId:"tab-activity",default:!0,tabContent:e.jsx("div",{className:"overflow-auto flex flex-col gap-2 h-full",children:t.length>0?t.map(r=>e.jsxs("div",{className:"border-b text-sm pb-2",children:[e.jsx("p",{className:"font-medium pb-1",children:r.activity}),e.jsxs("p",{className:"text-gray-500 pb-1",children:["Updated On:"," ",e.jsx("span",{className:"text-gray-700",children:new Date(r.updatedOn).toLocaleString()})]}),e.jsxs("p",{className:"text-gray-500 pb-1",children:["Updated By: ",e.jsx("span",{className:"text-gray-700",children:r.updatedBy})]})]},r.id)):e.jsx(ca,{text:"No Activity Logs Available"})})},{tabName:"File Upload",tabId:"tab-upload",default:!1,tabContent:e.jsx(Mn,{})}];return e.jsx(In,{buttonText:"",buttonIcon:e.jsx(f.AlignJustify,{}),sheetTitle:"",sheetContent:e.jsx(Dn,{tabArray:a,tabListClass:""}),closeButton:!0})}const Al=({src:t,onCroppedImage:a,aspectRatio:r,rotationAngle:n,zoomLevel:s,moveDirection:o})=>{const i=m.useRef(null);function d(u){const c=i.current?.cropper;if(c){const g=c.getCroppedCanvas().toDataURL("image/webp");a(g)}else console.log("Cropper instance is not available.")}return m.useEffect(()=>{const u=i.current?.cropper;u&&u.rotate(n)},[n]),m.useEffect(()=>{const u=i.current?.cropper;u&&u.getCropBoxData().width&&(console.log("Inside cropper scale"),u.scale(s))},[s]),m.useEffect(()=>{const u=i.current?.cropper;if(u&&u.getCropBoxData().width){const{x,y:g}=o;typeof x=="number"&&typeof g=="number"&&u.move(x,g)}},[o]),m.useEffect(()=>{const u=i.current?.cropper;if(u&&(u.setAspectRatio(r),r===1)){const c=u.getCanvasData(),x=c.width,g=c.height,w=c.left,N=c.top,v=200,C=100,b=w+(x-v)/2,S=N+(g-C)/2;u.setCropBoxData({left:b,top:S,width:v,height:C})}},[r]),e.jsx(Ia,{src:t,style:{height:"100%",width:"100%",objectFit:"contain"},guides:!0,crop:d,ref:i,dragMode:"move",movable:!0,zoomable:!0,scalable:!0,cropBoxMovable:!0,cropBoxResizable:!1})},Yn=m.memo(Al),ja={landscape:4/3,portrait:3/4,icon:1/1};function Pl({onNewFileUpload:t}){const{originalImage:a,setOriginalImage:r,aspectRatioWiseImages:n,setAspectRatioWiseImages:s}=xa(),[o,i]=m.useState(null),[d,u]=m.useState(),[c,x]=m.useState(0),[g,w]=m.useState(1),[N,v]=m.useState({x:0,y:0}),[C,b]=m.useState(null),S=j=>{j.preventDefault(),p(j.dataTransfer.files[0])},p=j=>{if(typeof j=="string")b(j);else if(j?.type?.startsWith("image/")){t?.();const h=new FileReader;h.onloadend=()=>{b(h.result),u(void 0)},h.readAsDataURL(j),r({...a,image:j,name:j.name})}else Ca.toast.error("Please select a valid image file.")};m.useEffect(()=>{a.image&&p(a.image)},[a.image]);const I=j=>{const h=o&&d===j?o:n[j];return e.jsxs(e.Fragment,{children:[e.jsx("h3",{className:"mb-3",children:j}),e.jsx($t,{ratio:ja[j],className:"bg-muted",children:h&&e.jsx("img",{src:h,alt:`Preview ${j}`,className:"absolute inset-0 w-full h-full object-contain"})})]})};return m.useEffect(()=>{o&&s(d?{...n,[d]:o}:{landscape:o,portrait:o,icon:o})},[o]),e.jsx(e.Fragment,{children:e.jsxs("div",{className:"flex flex-col gap-3 h-full overflow-auto",children:[e.jsxs("div",{className:"flex flex-col lg:flex-row gap-3 justify-between",children:[e.jsxs("div",{className:"w-full flex flex-col gap-4",children:[e.jsx(Se,{htmlFor:"imageName",children:"Image Name"}),e.jsx(kn,{id:"inputImage",accept:"image/*",fileNamePlaceholder:"Enter image name",fileName:a?.name||"",onChange:j=>{const h=j.target.files?.[0];h&&p(h)},onFileNameChange:j=>{r({...a,name:j.target.value})}})]}),e.jsxs("div",{className:"w-full flex flex-col gap-4",children:[e.jsx(Se,{htmlFor:"imageDescription",children:"Image Description"}),e.jsx(H,{id:"imageDescription",placeholder:"Enter image Description",value:a?.description||"",onChange:j=>r({...a,description:j.target.value})})]})]}),e.jsxs("div",{className:"flex flex-col lg:flex-row gap-3",children:[e.jsxs("div",{className:"flex-grow flex flex-col gap-3",children:[e.jsxs("div",{children:[e.jsx("h3",{className:"mb-3",children:"Original Image"}),e.jsx($t,{ratio:4/3,className:"flex justify-center items-center bg-muted text-muted-foreground",onDrop:S,onDragOver:j=>j.preventDefault(),children:C?e.jsx(Yn,{src:C,onCroppedImage:i,aspectRatio:ja[d||"icon"],rotationAngle:c,zoomLevel:g,moveDirection:N}):e.jsxs("div",{className:"text-center",children:[e.jsx(Se,{htmlFor:"inputImage",children:"Drag and drop an image here"}),e.jsx("div",{className:"mt-3",children:e.jsx(ot,{variant:"outline",onClick:()=>document.getElementById("inputImage")?.click(),children:"Browse Image"})})]})})]}),e.jsxs("div",{className:"flex flex-col lg:flex-row gap-3 justify-between",children:[e.jsx("div",{children:e.jsxs(Oe,{type:"single",variant:"outline",value:d,onValueChange:j=>u(j),children:[e.jsx(V,{className:"rounded-e-none",value:"landscape",children:e.jsx(f.ImageIcon,{})}),e.jsx(V,{className:"rounded-none border-x-0",value:"portrait",children:e.jsx(f.FileImage,{})}),e.jsx(V,{className:"rounded-s-none",value:"icon",children:e.jsx(f.Square,{})})]})}),e.jsxs("div",{className:"flex flex-col lg:flex-row gap-3 justify-between",children:[e.jsxs(Oe,{type:"single",variant:"outline",value:"",onValueChange:j=>x(parseInt(j)),children:[e.jsx(V,{className:"rounded-e-none",value:"90",children:e.jsx(f.RotateCw,{})}),e.jsx(V,{className:"rounded-s-none border-s-0",value:"-90",children:e.jsx(f.RotateCcw,{})})]}),e.jsxs(Oe,{type:"single",variant:"outline",value:"",children:[e.jsx(V,{className:"rounded-e-none",value:"up",onClick:()=>v({x:0,y:-5}),children:e.jsx(f.ArrowUp,{})}),e.jsx(V,{className:"rounded-none border-x-0",value:"down",onClick:()=>v({x:0,y:5}),children:e.jsx(f.ArrowDown,{})}),e.jsx(V,{className:"rounded-none border-e-0",value:"left",onClick:()=>v({x:-5,y:0}),children:e.jsx(f.ArrowLeft,{})}),e.jsx(V,{className:"rounded-s-none",value:"right",onClick:()=>v({x:5,y:0}),children:e.jsx(f.ArrowRight,{})})]}),e.jsxs(Oe,{type:"single",variant:"outline",value:"",onValueChange:j=>w(h=>h+parseFloat(j)),children:[e.jsx(V,{className:"rounded-e-none",value:"0.1",children:e.jsx(f.ZoomIn,{})}),e.jsx(V,{className:"rounded-s-none border-s-0",value:"-0.1",children:e.jsx(f.ZoomOut,{})})]})]})]})]}),e.jsxs("div",{className:"flex flex-row lg:flex-col gap-3 w-full lg:w-48",children:[e.jsx("div",{className:"w-5/5",children:I("landscape")}),e.jsx("div",{className:"w-4/5",children:I("portrait")}),e.jsx("div",{className:"w-3/5",children:I("icon")})]})]})]})})}const Qn=m.memo(Pl);function Jn({open:t,onOpenChange:a,onCropperChange:r}){const{originalImage:n,aspectRatioWiseImages:s}=xa();return e.jsx(kt,{modal:!0,open:t,onOpenChange:o=>{a(o)},children:e.jsxs(It,{className:"max-w-full lg:max-w-5xl max-h-full overflow-auto",children:[e.jsx(ra,{children:e.jsx(Dt,{children:"Image to upload"})}),e.jsx(Qn,{}),e.jsx(er,{children:e.jsx(ot,{onClick:()=>{r(n,s),a(!1)},children:"Save Changes"})})]})})}async function gt(t,a=""){if(!t||!t.resourceId)return null;try{return`${he().IKON_BASE_API_URL}/platform/file-resource/download/${a}/${t.resourceId}`}catch(r){return console.error("Error getting resource URL:",r),null}}async function Tl(t){if(!t)return null;const a=t.originalImageInfo?await gt(t.originalImageInfo):null,r=t.landscapeImageInfo?await gt(t.landscapeImageInfo):null,n=t.portraitImageInfo?await gt(t.portraitImageInfo):null,s=t.iconImageInfo?await gt(t.iconImageInfo):null;return{originalImage:{image:a,name:t.imageName,description:t.imageDescription},aspectRatioWiseImages:{landscape:r,portrait:n,icon:s}}}const Zn=m.createContext(void 0);function Rl({children:t,uploadedImages:a,onCropperChange:r,modalOpen:n,onModalOpenChange:s}){const[o,i]=m.useState({landscape:null,portrait:null,icon:null}),[d,u]=m.useState({image:null,name:"",description:""});return m.useEffect(()=>{async function c(){if(a)try{const x=await Tl(a);x&&(u(g=>JSON.stringify(g)===JSON.stringify(x.originalImage)?g:x.originalImage),i(g=>JSON.stringify(g)===JSON.stringify(x.aspectRatioWiseImages)?g:x.aspectRatioWiseImages))}catch(x){console.error("Error processing uploaded images:",x)}}c()},[a]),e.jsxs(Zn.Provider,{value:{originalImage:d,setOriginalImage:u,aspectRatioWiseImages:o,setAspectRatioWiseImages:i},children:[t,n&&s&&e.jsx(Jn,{open:n,onOpenChange:s,onCropperChange:r})]})}const xa=()=>{const t=m.useContext(Zn);if(!t)throw new Error("useImageCropper must be used within a ImageCropperProvider");return t},es=({imageSrc:t,onCroppedImage:a,aspectRatio:r,rotationAngle:n,zoomLevel:s,moveDirection:o,currentState:i})=>{const d=m.useRef(null),u=()=>{const c=d.current?.cropper;if(c){c.setDragMode("move");const g=c.getCroppedCanvas().toDataURL();a(g)}else console.log("Cropper instance is not available.")};return m.useEffect(()=>{const c=d.current?.cropper;c&&c.rotate(n)},[n]),m.useEffect(()=>{const c=d.current?.cropper;c&&c.getCropBoxData().width&&(console.log("Inside cropper scale"),c.scale(s))},[s]),m.useEffect(()=>{const c=d.current?.cropper;if(c&&c.getCropBoxData().width){const{x:g,y:w}=o;typeof g=="number"&&typeof w=="number"&&c.move(g,w)}},[o]),m.useEffect(()=>{const c=d.current?.cropper;if(c&&(c.setAspectRatio(r),r===1)){const x=c.getCanvasData(),g=x.width,w=x.height,N=x.left,v=x.top,C=200,b=100,S=N+(g-C)/2,p=v+(w-b)/2;c.setCropBoxData({left:S,top:p,width:C,height:b})}},[r]),e.jsx(Ia,{src:t,style:{height:"100%",width:"100%",objectFit:"contain"},guides:!0,crop:u,ref:d,dragMode:"move",movable:!0,zoomable:!0,scalable:!0,cropBoxMovable:!0,cropBoxResizable:!1})},_l=({open:t,setOpen:a,onImageSubmit:r})=>{const[n,s]=m.useState(null),[o,i]=m.useState(null),[d,u]=m.useState({first:null,second:null,third:null}),[c,x]=m.useState(4/3),[g,w]=m.useState("first"),[N,v]=m.useState(0),[C,b]=m.useState(1),[S,p]=m.useState({x:0,y:0}),[I,j]=m.useState(""),h=()=>{console.log("Image Submit Button is pressed"),console.log(d),r(d.third),a(!1)},A=z=>{v(O=>O+z)},P=()=>{p({x:0,y:-5})},R=()=>{p({x:0,y:5})},M=()=>{p({x:-5,y:0})},F=()=>{p({x:5,y:0})},ce=()=>{b(z=>{const O=z+.2;return O<=2?O:z})},Ae=()=>{b(z=>{const O=z-.2;return O>=.2?O:z})},Ce=(z,O)=>{x(z),w(O)},y=z=>{if(z.type.startsWith("image/")){const O=new FileReader;O.onloadend=()=>{s(O.result),j(Pe=>Pe||z.name)},O.readAsDataURL(z)}else alert("Please drop a valid image file.")},k=z=>{z.preventDefault(),y(z.dataTransfer.files[0])},B=z=>{const O=o&&g===z?o:d[z];return O?e.jsx("div",{className:`
4
+ ${z==="first"?"relative w-3/5 h-[200px] bg-slate-400":z==="second"?"relative w-1/2 h-[220px] bg-slate-400":"relative w-1/3 h-[120px] bg-slate-400"}`,children:e.jsx("img",{src:O,alt:`Preview ${z}`,className:"absolute inset-0 w-full h-full object-contain"})}):e.jsx("div",{className:`
5
+ ${z==="first"?"relative w-3/5 h-[200px] bg-slate-400":z==="second"?"relative w-1/2 h-[220px] bg-slate-400":"relative w-1/3 h-[120px] bg-slate-400"}`})};return m.useEffect(()=>{o&&(d.first===null||d.second===null||d.third===null?u({first:o,second:o,third:o}):u(z=>({...z,[g]:o})))},[o]),e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"flex flex-row gap-2",children:[e.jsxs("div",{className:"flex-1",children:[e.jsx(Se,{htmlFor:"imageName",children:"Image Name"}),e.jsx(H,{id:"imageName",placeholder:"Enter image name",value:I,onChange:z=>j(z.target.value)})]}),e.jsxs("div",{className:"self-end",children:[e.jsx(T,{variant:"outline",onClick:()=>document.getElementById("inputImage1")?.click(),children:e.jsx(f.Upload,{})}),e.jsx(H,{id:"inputImage1",type:"file",accept:"image/png, image/jpeg",className:"hidden",onChange:z=>{const O=z.target.files?.[0];if(O&&O.type.startsWith("image/")){const Pe=new FileReader;Pe.onloadend=()=>{s(Pe.result),j(ee=>ee||O.name)},Pe.readAsDataURL(O),u({first:null,second:null,third:null})}}})]}),e.jsxs("div",{className:"flex-1",children:[e.jsx(Se,{htmlFor:"imageDesc",children:"Image Description"}),e.jsx(H,{id:"imageDesc",placeholder:"Describe your image"})]})]}),e.jsxs("div",{className:"flex flex-row gap-2",children:[e.jsx("div",{className:"w-3/5 flex justify-center items-center border-2 border-dashed border-gray-400 bg-gray-100",style:{height:"70vh"},onDrop:k,onDragOver:z=>z.preventDefault(),children:n?e.jsx(es,{imageSrc:n,onCroppedImage:i,aspectRatio:c,rotationAngle:N,zoomLevel:C,moveDirection:S,currentState:g}):e.jsxs("div",{className:"text-center",children:[e.jsx(Se,{htmlFor:"inputImage",children:"Drag and drop an image here"}),e.jsxs("div",{className:"mt-4",children:[e.jsx(T,{variant:"outline",onClick:()=>document.getElementById("inputImage")?.click(),children:"Upload Image"}),e.jsx(H,{id:"inputImage",type:"file",accept:"image/png, image/jpeg",className:"hidden",onChange:z=>{const O=z.target.files?.[0];O&&y(O)}})]})]})}),e.jsxs("div",{className:"w-2/5 flex flex-col gap-2",children:[e.jsx("h3",{children:"Landscape"}),B("first"),e.jsx("h3",{children:"Potrait"}),B("second"),e.jsx("h3",{children:"Icon"}),B("third")]})]}),e.jsxs("div",{className:"flex flex-row gap-1",children:[e.jsxs("div",{className:"w-3/5 flex flex-row justify-between",children:[e.jsxs("div",{children:[e.jsx(T,{variant:"outline",onClick:()=>Ce(4/3,"first"),children:e.jsx(f.ImageIcon,{})}),e.jsx(T,{variant:"outline",onClick:()=>Ce(3/4,"second"),children:e.jsx(f.FileImage,{})}),e.jsx(T,{variant:"outline",onClick:()=>Ce(1/1,"third"),children:e.jsx(f.Square,{})})]}),e.jsxs("div",{children:[e.jsx(T,{onClick:()=>A(90),variant:"outline",children:e.jsx(f.RotateCw,{})}),e.jsx(T,{onClick:()=>A(-90),variant:"outline",children:e.jsx(f.RotateCcw,{})})]}),e.jsxs("div",{children:[e.jsx(T,{onClick:()=>ce(),variant:"outline",children:e.jsx(f.ZoomIn,{})}),e.jsx(T,{onClick:()=>Ae(),variant:"outline",children:e.jsx(f.ZoomOut,{})})]}),e.jsxs("div",{children:[e.jsx(T,{onClick:P,variant:"outline",children:e.jsx(f.ArrowUp,{})}),e.jsx(T,{onClick:R,variant:"outline",children:e.jsx(f.ArrowDown,{})}),e.jsx(T,{onClick:M,variant:"outline",children:e.jsx(f.ArrowLeft,{})}),e.jsx(T,{onClick:F,variant:"outline",children:e.jsx(f.ArrowRight,{})})]})]}),e.jsx("div",{className:"w-2/5 flex flex-row-reverse",children:e.jsx(T,{onClick:h,children:"Save"})})]})]})},zl=m.memo(_l);function Fl(){return e.jsx("div",{className:"flex h-full items-center justify-center",children:e.jsxs("div",{className:"bg-background text-forefround rounded-xl p-6 text-center max-w-md",children:[e.jsx("div",{className:"text-3xl font-bold mb-2 animate-pulse",children:"🚧 Work in Progress"}),e.jsx("p",{className:"text-muted-foreground",children:"We’re currently working on this section. Check back soon!"})]})})}function Ml({formControl:t,name:a,label:r,options:n,placeholder:s="Select an option",emptyMessage:o="No options found.",onValueChange:i,className:d,addNewPlaceholder:u="Add custom value...",formDescription:c,disabled:x}){const[g,w]=D.useState(!1),[N,v]=D.useState(""),[C,b]=D.useState(n),[S,p]=D.useState(!1),[I,j]=D.useState("");return D.useEffect(()=>{b(n)},[n]),e.jsx(xe,{control:t,name:a,render:({field:h})=>{const A=C.find(R=>R.value===h.value),P=()=>{const R=I.trim();if(!R)return;if(C.some(F=>F.value===R)){const F=C.find(ce=>ce.value===R);F&&(h.onChange(F.value),i?.(F.value),j(""),p(!1),w(!1),v(""));return}const M={value:R,label:R,disabled:!0};b(F=>[...F,M]),h.onChange(R),i?.(R),j(""),p(!1),w(!1),v("")};return e.jsxs(fe,{className:l(d),children:[r&&e.jsxs(e.Fragment,{children:[e.jsx(Ne,{children:r}),e.jsx("br",{})]}),e.jsxs(Q,{open:g,onOpenChange:R=>{w(R),R||(v(""),p(!1),j(""))},children:[e.jsx(J,{asChild:!0,children:e.jsx(ge,{children:e.jsxs(T,{variant:"outline",role:"combobox","aria-expanded":g,className:l("w-full justify-between",!h.value&&"text-foreground/50",d),disabled:x||h.disabled,children:[e.jsx("span",{className:"line-clamp-1 text-left",children:h.value?A?A.label:h.value:s}),e.jsx(f.ChevronsUpDown,{className:"ml-2 h-4 w-4 shrink-0 opacity-50"})]})})}),e.jsx(Z,{className:"p-0 w-[--radix-popover-trigger-width]",align:"start",children:e.jsxs(Y,{shouldFilter:!0,children:[e.jsx(ie,{placeholder:"Search...",value:N,onValueChange:v}),e.jsxs(le,{children:[e.jsx(de,{children:N&&C.length>0?"No results found.":o}),e.jsx(re,{children:C.filter(R=>R.label.toLowerCase().includes(N.toLowerCase())||R.value.toLowerCase().includes(N.toLowerCase())).map(R=>e.jsxs(X,{value:R.value,onSelect:M=>{h.onChange(M),i?.(M),w(!1),v("")},className:"cursor-pointer",disabled:R?.disabled,children:[e.jsx(f.Check,{className:l("mr-2 h-4 w-4",h.value===R.value?"opacity-100":"opacity-0")}),R.label]},R.value))})]}),e.jsx("div",{className:"border-t p-2",children:S?e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(H,{placeholder:u,value:I,onChange:R=>j(R.target.value),onKeyDown:R=>{R.key==="Enter"&&(R.preventDefault(),P()),R.key==="Escape"&&(p(!1),j(""))},autoFocus:!0,className:"h-8"}),e.jsx(T,{size:"sm",variant:"ghost",onClick:()=>{p(!1),j("")},className:"h-8",children:"Cancel"}),e.jsx(T,{size:"sm",variant:"default",onClick:P,className:"h-8",disabled:!I.trim()||C.some(R=>R.value===I.trim()),children:"Add"})]}):e.jsxs(T,{variant:"outline",className:"w-full justify-start",onClick:()=>p(!0),children:[e.jsx(f.Plus,{className:"mr-2 h-4 w-4"}),"Add new option"]})})]})})]}),c&&e.jsx(ye,{children:c}),e.jsx(pe,{})]})}})}const me=m.forwardRef(({children:t,tooltip:a,side:r="bottom",className:n,...s},o)=>e.jsxs(ne,{children:[e.jsx(se,{asChild:!0,children:e.jsxs(T,{variant:"ghost",size:"icon",...s,className:l("aui-button-icon size-6 p-1",n),ref:o,children:[e.jsx(Yt.Slottable,{children:t}),e.jsx("span",{className:"aui-sr-only sr-only",children:a})]})}),e.jsx(oe,{side:r,children:a})]}));me.displayName="TooltipIconButton";const El=()=>e.jsx(Ft.MarkdownTextPrimitive,{remarkPlugins:[zs],className:"aui-md",components:Ul}),Ll=m.memo(El),Ol=({language:t,code:a})=>{const{isCopied:r,copyToClipboard:n}=Bl(),s=()=>{!a||r||n(a)};return e.jsxs("div",{className:"aui-code-header-root mt-4 flex items-center justify-between gap-4 rounded-t-lg bg-muted-foreground/15 px-4 py-2 font-semibold text-foreground text-sm dark:bg-muted-foreground/20",children:[e.jsx("span",{className:"aui-code-header-language lowercase [&>span]:text-xs",children:t}),e.jsxs(me,{tooltip:"Copy",onClick:s,children:[!r&&e.jsx(f.CopyIcon,{}),r&&e.jsx(f.CheckIcon,{})]})]})},Bl=({copiedDuration:t=3e3}={})=>{const[a,r]=m.useState(!1);return{isCopied:a,copyToClipboard:s=>{s&&navigator.clipboard.writeText(s).then(()=>{r(!0),setTimeout(()=>r(!1),t)})}}},Ul=Ft.unstable_memoizeMarkdownComponents({h1:({className:t,...a})=>e.jsx("h1",{className:l("aui-md-h1 mb-8 scroll-m-20 font-extrabold text-4xl tracking-tight last:mb-0",t),...a}),h2:({className:t,...a})=>e.jsx("h2",{className:l("aui-md-h2 mt-8 mb-4 scroll-m-20 font-semibold text-3xl tracking-tight first:mt-0 last:mb-0",t),...a}),h3:({className:t,...a})=>e.jsx("h3",{className:l("aui-md-h3 mt-6 mb-4 scroll-m-20 font-semibold text-2xl tracking-tight first:mt-0 last:mb-0",t),...a}),h4:({className:t,...a})=>e.jsx("h4",{className:l("aui-md-h4 mt-6 mb-4 scroll-m-20 font-semibold text-xl tracking-tight first:mt-0 last:mb-0",t),...a}),h5:({className:t,...a})=>e.jsx("h5",{className:l("aui-md-h5 my-4 font-semibold text-lg first:mt-0 last:mb-0",t),...a}),h6:({className:t,...a})=>e.jsx("h6",{className:l("aui-md-h6 my-4 font-semibold first:mt-0 last:mb-0",t),...a}),p:({className:t,...a})=>e.jsx("p",{className:l("aui-md-p mt-5 mb-5 leading-7 first:mt-0 last:mb-0",t),...a}),a:({className:t,...a})=>e.jsx("a",{className:l("aui-md-a font-medium text-primary underline underline-offset-4",t),...a}),blockquote:({className:t,...a})=>e.jsx("blockquote",{className:l("aui-md-blockquote border-l-2 pl-6 italic",t),...a}),ul:({className:t,...a})=>e.jsx("ul",{className:l("aui-md-ul my-5 ml-6 list-disc [&>li]:mt-2",t),...a}),ol:({className:t,...a})=>e.jsx("ol",{className:l("aui-md-ol my-5 ml-6 list-decimal [&>li]:mt-2",t),...a}),hr:({className:t,...a})=>e.jsx("hr",{className:l("aui-md-hr my-5 border-b",t),...a}),table:({className:t,...a})=>e.jsx("table",{className:l("aui-md-table my-5 w-full border-separate border-spacing-0 overflow-y-auto",t),...a}),th:({className:t,...a})=>e.jsx("th",{className:l("aui-md-th bg-muted px-4 py-2 text-left font-bold first:rounded-tl-lg last:rounded-tr-lg [[align=center]]:text-center [[align=right]]:text-right",t),...a}),td:({className:t,...a})=>e.jsx("td",{className:l("aui-md-td border-b border-l px-4 py-2 text-left last:border-r [[align=center]]:text-center [[align=right]]:text-right",t),...a}),tr:({className:t,...a})=>e.jsx("tr",{className:l("aui-md-tr m-0 border-b p-0 first:border-t [&:last-child>td:first-child]:rounded-bl-lg [&:last-child>td:last-child]:rounded-br-lg",t),...a}),sup:({className:t,...a})=>e.jsx("sup",{className:l("aui-md-sup [&>a]:text-xs [&>a]:no-underline",t),...a}),pre:({className:t,...a})=>e.jsx("pre",{className:l("aui-md-pre overflow-x-auto rounded-t-none!rounded-b-lg bg-black p-4 text-white",t),...a}),code:function({className:a,...r}){const n=Ft.useIsMarkdownCodeBlock();return e.jsx("code",{className:l(!n&&"aui-md-inline-code rounded border bg-muted font-semibold",a),...r})},CodeHeader:Ol}),Vl=({toolName:t,argsText:a,result:r,status:n})=>{const[s,o]=m.useState(!0),i=n?.type==="incomplete"&&n.reason==="cancelled",d=i&&n.error?typeof n.error=="string"?n.error:JSON.stringify(n.error):null;return e.jsxs("div",{className:l("aui-tool-fallback-root mb-4 flex w-full flex-col gap-3 rounded-lg border py-3",i&&"border-muted-foreground/30 bg-muted/30"),children:[e.jsxs("div",{className:"aui-tool-fallback-header flex items-center gap-2 px-4",children:[i?e.jsx(f.XCircleIcon,{className:"aui-tool-fallback-icon size-4 text-muted-foreground"}):e.jsx(f.CheckIcon,{className:"aui-tool-fallback-icon size-4"}),e.jsxs("p",{className:l("aui-tool-fallback-title grow",i&&"text-muted-foreground line-through"),children:[i?"Cancelled tool: ":"Used tool: ",e.jsx("b",{children:t})]}),e.jsx(T,{onClick:()=>o(!s),children:s?e.jsx(f.ChevronUpIcon,{}):e.jsx(f.ChevronDownIcon,{})})]}),!s&&e.jsxs("div",{className:"aui-tool-fallback-content flex flex-col gap-2 border-t pt-2",children:[d&&e.jsxs("div",{className:"aui-tool-fallback-cancelled-root px-4",children:[e.jsx("p",{className:"aui-tool-fallback-cancelled-header font-semibold text-muted-foreground",children:"Cancelled reason:"}),e.jsx("p",{className:"aui-tool-fallback-cancelled-reason text-muted-foreground",children:d})]}),e.jsx("div",{className:l("aui-tool-fallback-args-root px-4",i&&"opacity-60"),children:e.jsx("pre",{className:"aui-tool-fallback-args-value whitespace-pre-wrap",children:a})}),!i&&r!==void 0&&e.jsxs("div",{className:"aui-tool-fallback-result-root border-t border-dashed px-4 pt-2",children:[e.jsx("p",{className:"aui-tool-fallback-result-header font-semibold",children:"Result:"}),e.jsx("pre",{className:"aui-tool-fallback-result-content whitespace-pre-wrap",children:typeof r=="string"?r:JSON.stringify(r,null,2)})]})]})]})},wa=t=>Symbol.iterator in t,Na=t=>"entries"in t,ya=(t,a)=>{const r=t instanceof Map?t:new Map(t.entries()),n=a instanceof Map?a:new Map(a.entries());if(r.size!==n.size)return!1;for(const[s,o]of r)if(!n.has(s)||!Object.is(o,n.get(s)))return!1;return!0},$l=(t,a)=>{const r=t[Symbol.iterator](),n=a[Symbol.iterator]();let s=r.next(),o=n.next();for(;!s.done&&!o.done;){if(!Object.is(s.value,o.value))return!1;s=r.next(),o=n.next()}return!!s.done&&!!o.done};function Gl(t,a){return Object.is(t,a)?!0:typeof t!="object"||t===null||typeof a!="object"||a===null||Object.getPrototypeOf(t)!==Object.getPrototypeOf(a)?!1:wa(t)&&wa(a)?Na(t)&&Na(a)?ya(t,a):$l(t,a):ya({entries:()=>Object.entries(t)},{entries:()=>Object.entries(a)})}function ql(t){const a=m.useRef(void 0);return r=>{const n=t(r);return Gl(a.current,n)?a.current:a.current=n}}const Wl=t=>{const[a,r]=m.useState(void 0);return m.useEffect(()=>{if(!t){r(void 0);return}const n=URL.createObjectURL(t);return r(n),()=>{URL.revokeObjectURL(n)}},[t]),a},ts=()=>{const{file:t,src:a}=_.useAssistantState(ql(({attachment:r})=>{if(r.type!=="image")return{};if(r.file)return{file:r.file};const n=r.content?.filter(s=>s.type==="image")[0]?.image;return n?{src:n}:{}}));return Wl(t)??a},Hl=({src:t})=>{const[a,r]=m.useState(!1);return e.jsx("img",{src:t,alt:"Image Preview",width:1,height:1,className:a?"aui-attachment-preview-image-loaded block h-auto max-h-[80vh] w-auto max-w-full object-contain":"aui-attachment-preview-image-loading hidden",onLoad:()=>r(!0),loading:"lazy"})},Kl=({children:t})=>{const a=ts();return a?e.jsxs(kt,{children:[e.jsx(Qa,{className:"aui-attachment-preview-trigger cursor-pointer transition-colors hover:bg-accent/50",asChild:!0,children:t}),e.jsxs(It,{className:"aui-attachment-preview-dialog-content p-2 sm:max-w-3xl [&>button]:rounded-full [&>button]:bg-foreground/60 [&>button]:p-1 [&>button]:opacity-100 [&>button]:ring-0! [&_svg]:text-background [&>button]:hover:[&_svg]:text-destructive",children:[e.jsx(Dt,{className:"aui-sr-only sr-only",children:"Image Attachment Preview"}),e.jsx("div",{className:"aui-attachment-preview relative mx-auto flex max-h-[80dvh] w-full items-center justify-center overflow-hidden bg-background",children:e.jsx(Hl,{src:a})})]})]}):t},Xl=()=>{const t=_.useAssistantState(({attachment:r})=>r.type==="image"),a=ts();return e.jsxs(Ga,{className:"aui-attachment-tile-avatar h-full w-full rounded-none",children:[e.jsx(qa,{src:a,alt:"Attachment preview",className:"aui-attachment-tile-image object-cover"}),e.jsx(Wa,{delayMs:t?200:0,children:e.jsx(f.FileText,{className:"aui-attachment-tile-fallback-icon size-8 text-muted-foreground"})})]})},as=()=>{const a=_.useAssistantApi().attachment.source==="composer",r=_.useAssistantState(({attachment:s})=>s.type==="image"),n=_.useAssistantState(({attachment:s})=>{const o=s.type;switch(o){case"image":return"Image";case"document":return"Document";case"file":return"File";default:{const i=o;throw new Error(`Unknown attachment type: ${i}`)}}});return e.jsxs(ne,{children:[e.jsxs(_.AttachmentPrimitive.Root,{className:l("aui-attachment-root relative",r&&"aui-attachment-root-composer only:[&>#attachment-tile]:size-24"),children:[e.jsx(Kl,{children:e.jsx(se,{asChild:!0,children:e.jsx("div",{className:l("aui-attachment-tile size-14 cursor-pointer overflow-hidden rounded-[14px] border bg-muted transition-opacity hover:opacity-75",a&&"aui-attachment-tile-composer border-foreground/20"),role:"button",id:"attachment-tile","aria-label":`${n} attachment`,children:e.jsx(Xl,{})})})}),a&&e.jsx(Yl,{})]}),e.jsx(oe,{side:"top",children:e.jsx(_.AttachmentPrimitive.Name,{})})]})},Yl=()=>e.jsx(_.AttachmentPrimitive.Remove,{asChild:!0,children:e.jsx(me,{tooltip:"Remove file",className:"aui-attachment-tile-remove absolute top-1.5 right-1.5 size-3.5 rounded-full bg-white text-muted-foreground opacity-100 shadow-sm hover:bg-white! [&_svg]:text-black hover:[&_svg]:text-destructive",side:"top",children:e.jsx(f.XIcon,{className:"aui-attachment-remove-icon size-3 dark:stroke-[2.5px]"})})}),Ql=()=>e.jsx("div",{className:"aui-user-message-attachments-end col-span-full col-start-1 row-start-1 flex w-full flex-row justify-end gap-2",children:e.jsx(_.MessagePrimitive.Attachments,{components:{Attachment:as}})}),Jl=()=>e.jsx("div",{className:"aui-composer-attachments mb-2 flex w-full flex-row items-center gap-2 overflow-x-auto px-1.5 pt-0.5 pb-1 empty:hidden",children:e.jsx(_.ComposerPrimitive.Attachments,{components:{Attachment:as}})}),Zl=()=>e.jsx(_.ComposerPrimitive.AddAttachment,{asChild:!0,children:e.jsx(me,{tooltip:"Add Attachment",side:"bottom",variant:"ghost",size:"icon",className:"aui-composer-add-attachment size-8.5 rounded-full p-1 font-semibold text-xs hover:bg-muted-foreground/15 dark:border-muted-foreground/15 dark:hover:bg-muted-foreground/30","aria-label":"Add Attachment",children:e.jsx(f.PlusIcon,{className:"aui-attachment-add-icon size-5 stroke-[1.5px]"})})}),ed=({agents:t,selectedAgent:a,onSelectAgent:r,className:n,triggerClassName:s})=>{const[o,i]=m.useState(!1),d=a||null;return e.jsxs(ve,{open:o,onOpenChange:i,children:[e.jsx(je,{asChild:!0,children:e.jsxs(T,{variant:"outline",className:l("gap-2 px-3 py-2 text-sm font-medium rounded-2xl",s),children:[e.jsx("span",{className:"truncate",children:d?.agentName||"Select Agent"}),e.jsx(f.ChevronDownIcon,{className:"size-4 shrink-0 opacity-50"})]})}),e.jsx(we,{align:"end",className:l("min-w-[200px]",n),children:t.length>0?e.jsxs(e.Fragment,{children:[e.jsx(At,{className:"px-2 py-1.5 text-xs font-semibold text-muted-foreground",children:"Agents"}),e.jsx(rt,{}),e.jsx(na,{children:t.map(u=>e.jsxs(ue,{onClick:()=>{r(u),i(!1)},className:l("cursor-pointer flex flex-col gap-1",d?.agentID===u.agentID&&"bg-accent"),children:[e.jsx("div",{className:"font-medium text-sm",children:u.agentName}),u.agentDescription&&e.jsx("div",{className:"text-xs text-muted-foreground truncate",children:u.agentDescription})]},u.agentID))})]}):e.jsx("div",{className:"px-2 py-1.5 text-sm text-muted-foreground text-center",children:"No agents available"})})]})},td=({currentUserDetails:t,agents:a=[],initialAgentId:r="default-agent",initialAgentName:n="Default Agent",onAgentChange:s})=>{const[o,i]=m.useState(a.find(d=>d.agentID===r));return e.jsx(pt.LazyMotion,{features:pt.domAnimation,children:e.jsx(pt.MotionConfig,{reducedMotion:"user",children:e.jsx(_.ThreadPrimitive.Root,{className:"aui-root aui-thread-root @container flex h-full flex-col bg-background",style:{"--thread-max-width":"44rem"},children:e.jsxs(_.ThreadPrimitive.Viewport,{turnAnchor:"top",className:"aui-thread-viewport relative flex flex-1 flex-col overflow-x-auto overflow-y-scroll scroll-smooth px-4 pt-4",children:[e.jsx(_.ThreadPrimitive.If,{empty:!0,children:e.jsx(rd,{currentUserDetails:t})}),e.jsx(_.ThreadPrimitive.Messages,{components:{UserMessage:cd,EditComposer:md,AssistantMessage:ld}}),e.jsxs(_.ThreadPrimitive.ViewportFooter,{className:"aui-thread-viewport-footer sticky bottom-0 mx-auto mt-4 flex w-full max-w-[var(--thread-max-width)] flex-col gap-4 overflow-visible rounded-t-3xl bg-background pb-4 md:pb-6",children:[e.jsx(ad,{}),e.jsx(sd,{agents:a,selectedAgent:o,onSelectAgent:d=>{i(d),s?.(d)}})]})]})})})})},ad=()=>e.jsx(_.ThreadPrimitive.ScrollToBottom,{asChild:!0,children:e.jsx(me,{tooltip:"Scroll to bottom",variant:"outline",className:"aui-thread-scroll-to-bottom absolute -top-12 z-10 self-center rounded-full p-4 disabled:invisible dark:bg-background dark:hover:bg-accent",children:e.jsx(f.ArrowDownIcon,{})})}),rd=({currentUserDetails:t})=>{const r=new Date().getHours();let n="";return r>=5&&r<12?n="Good Morning":r>=12&&r<17?n="Good Afternoon":r>=17&&r<21?n="Good Evening":n="Good Night",console.log(n),e.jsxs("div",{className:"aui-thread-welcome-root mx-auto my-auto flex w-full max-w-[var(--thread-max-width)] flex-grow flex-col",children:[e.jsx("div",{className:"aui-thread-welcome-center flex w-full flex-grow flex-col items-center justify-center",children:e.jsxs("div",{className:"aui-thread-welcome-message flex size-full flex-col justify-center px-8",children:[e.jsx(Et.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},exit:{opacity:0,y:10},className:"aui-thread-welcome-message-motion-1 text-2xl font-semibold",children:`${n} ${t.userName.split(" ")[0]}`}),e.jsx(Et.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},exit:{opacity:0,y:10},transition:{delay:.1},className:"aui-thread-welcome-message-motion-2 text-2xl text-muted-foreground/65",children:"How can I help you today?"})]})}),e.jsx(nd,{})]})},nd=()=>e.jsx("div",{className:"aui-thread-welcome-suggestions grid w-full gap-2 pb-4 @md:grid-cols-2",children:[{title:"What's the weather",label:"in San Francisco?",action:"What's the weather in San Francisco?"},{title:"Explain React hooks",label:"like useState and useEffect",action:"Explain React hooks like useState and useEffect"},{title:"Write a SQL query",label:"to find top customers",action:"Write a SQL query to find top customers"},{title:"Create a meal plan",label:"for healthy weight loss",action:"Create a meal plan for healthy weight loss"}].map((t,a)=>e.jsx(Et.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},exit:{opacity:0,y:20},transition:{delay:.05*a},className:"aui-thread-welcome-suggestion-display [&:nth-child(n+3)]:hidden @md:[&:nth-child(n+3)]:block",children:e.jsx(_.ThreadPrimitive.Suggestion,{prompt:t.action,send:!0,asChild:!0,children:e.jsxs(T,{variant:"ghost",className:"aui-thread-welcome-suggestion h-auto w-full flex-1 flex-wrap items-start justify-start gap-1 rounded-3xl border px-5 py-4 text-left text-sm @md:flex-col dark:hover:bg-accent/60","aria-label":t.action,children:[e.jsx("span",{className:"aui-thread-welcome-suggestion-text-1 font-medium",children:t.title}),e.jsx("span",{className:"aui-thread-welcome-suggestion-text-2 text-muted-foreground",children:t.label})]})})},`suggested-action-${t.title}-${a}`))}),sd=({agents:t=[],selectedAgent:a,onSelectAgent:r})=>e.jsx(_.ComposerPrimitive.Root,{className:"aui-composer-root relative flex w-full flex-col",children:e.jsxs(_.ComposerPrimitive.AttachmentDropzone,{className:"aui-composer-attachment-dropzone group/input-group flex w-full flex-col rounded-3xl border border-input bg-background px-1 pt-2 shadow-xs transition-[color,box-shadow] outline-none has-[textarea:focus-visible]:border-ring has-[textarea:focus-visible]:ring-[3px] has-[textarea:focus-visible]:ring-ring/50 data-[dragging=true]:border-dashed data-[dragging=true]:border-ring data-[dragging=true]:bg-accent/50 dark:bg-background",children:[e.jsx(Jl,{}),e.jsx(_.ComposerPrimitive.Input,{placeholder:"Send a message...",className:"aui-composer-input mb-1 max-h-32 min-h-16 w-full resize-none bg-transparent px-3.5 pt-1.5 pb-3 text-base outline-none placeholder:text-muted-foreground focus-visible:ring-0",rows:1,autoFocus:!0,"aria-label":"Message input"}),e.jsx(od,{agents:t,selectedAgent:a,onSelectAgent:r})]})}),od=({agents:t=[],selectedAgent:a,onSelectAgent:r})=>e.jsxs("div",{className:"aui-composer-action-wrapper relative mx-1 mt-2 mb-2 flex items-center justify-between",children:[e.jsx(Zl,{}),e.jsxs("div",{className:"flex gap-3",children:[t.length>0&&e.jsx(ed,{agents:t,selectedAgent:a,onSelectAgent:r??(()=>{}),triggerClassName:"h-9 text-xs"}),e.jsx(_.ThreadPrimitive.If,{running:!1,children:e.jsx(_.ComposerPrimitive.Send,{asChild:!0,children:e.jsx(me,{tooltip:"Send message",side:"bottom",type:"submit",variant:"default",size:"icon",className:"aui-composer-send size-[34px] rounded-full p-1","aria-label":"Send message",children:e.jsx(f.ArrowUpIcon,{className:"aui-composer-send-icon size-5"})})})}),e.jsx(_.ThreadPrimitive.If,{running:!0,children:e.jsx(_.ComposerPrimitive.Cancel,{asChild:!0,children:e.jsx(T,{type:"button",variant:"default",size:"icon",className:"aui-composer-cancel size-[34px] rounded-full border border-muted-foreground/60 hover:bg-primary/75 dark:border-muted-foreground/90","aria-label":"Stop generating",children:e.jsx(f.Square,{className:"aui-composer-cancel-icon size-3.5 fill-white dark:fill-black"})})})})]})]}),id=()=>e.jsx(_.MessagePrimitive.Error,{children:e.jsx(_.ErrorPrimitive.Root,{className:"aui-message-error-root mt-2 rounded-md border border-destructive bg-destructive/10 p-3 text-sm text-destructive dark:bg-destructive/5 dark:text-red-200",children:e.jsx(_.ErrorPrimitive.Message,{className:"aui-message-error-message line-clamp-2"})})}),ld=()=>e.jsxs(_.MessagePrimitive.Root,{className:"aui-assistant-message-root relative mx-auto w-full max-w-[var(--thread-max-width)] animate-in py-4 duration-150 ease-out fade-in slide-in-from-bottom-1","data-role":"assistant",children:[e.jsxs("div",{className:"aui-assistant-message-content mx-2 leading-7 break-words text-foreground",children:[e.jsx(_.MessagePrimitive.Parts,{components:{Text:Ll,tools:{Fallback:Vl}}}),e.jsx(id,{})]}),e.jsxs("div",{className:"aui-assistant-message-footer mt-2 ml-2 flex",children:[e.jsx(rs,{}),e.jsx(dd,{})]})]}),dd=()=>e.jsxs(_.ActionBarPrimitive.Root,{hideWhenRunning:!0,autohide:"not-last",autohideFloat:"single-branch",className:"aui-assistant-action-bar-root col-start-3 row-start-2 -ml-1 flex gap-1 text-muted-foreground data-floating:absolute data-floating:rounded-md data-floating:border data-floating:bg-background data-floating:p-1 data-floating:shadow-sm",children:[e.jsx(_.ActionBarPrimitive.Copy,{asChild:!0,children:e.jsxs(me,{tooltip:"Copy",children:[e.jsx(_.MessagePrimitive.If,{copied:!0,children:e.jsx(f.CheckIcon,{})}),e.jsx(_.MessagePrimitive.If,{copied:!1,children:e.jsx(f.CopyIcon,{})})]})}),e.jsx(_.ActionBarPrimitive.Reload,{asChild:!0,children:e.jsx(me,{tooltip:"Refresh",children:e.jsx(f.RefreshCwIcon,{})})})]}),cd=()=>e.jsxs(_.MessagePrimitive.Root,{className:"aui-user-message-root mx-auto grid w-full max-w-[var(--thread-max-width)] animate-in auto-rows-auto grid-cols-[minmax(72px,1fr)_auto] content-start gap-y-2 px-2 py-4 duration-150 ease-out fade-in slide-in-from-bottom-1 [&:where(>*)]:col-start-2","data-role":"user",children:[e.jsx(Ql,{}),e.jsxs("div",{className:"aui-user-message-content-wrapper relative col-start-2 min-w-0",children:[e.jsx("div",{className:"aui-user-message-content rounded-3xl bg-muted px-5 py-2.5 break-words text-foreground",children:e.jsx(_.MessagePrimitive.Parts,{})}),e.jsx("div",{className:"aui-user-action-bar-wrapper absolute top-1/2 left-0 -translate-x-full -translate-y-1/2 pr-2",children:e.jsx(ud,{})})]}),e.jsx(rs,{className:"aui-user-branch-picker col-span-full col-start-1 row-start-3 -mr-1 justify-end"})]}),ud=()=>e.jsx(_.ActionBarPrimitive.Root,{hideWhenRunning:!0,autohide:"not-last",className:"aui-user-action-bar-root flex flex-col items-end",children:e.jsx(_.ActionBarPrimitive.Edit,{asChild:!0,children:e.jsx(me,{tooltip:"Edit",className:"aui-user-action-edit p-4",children:e.jsx(f.PencilIcon,{})})})}),md=()=>e.jsx(_.MessagePrimitive.Root,{className:"aui-edit-composer-wrapper mx-auto flex w-full max-w-[var(--thread-max-width)] flex-col gap-4 px-2",children:e.jsxs(_.ComposerPrimitive.Root,{className:"aui-edit-composer-root ml-auto flex w-full max-w-7/8 flex-col rounded-xl bg-muted",children:[e.jsx(_.ComposerPrimitive.Input,{className:"aui-edit-composer-input flex min-h-[60px] w-full resize-none bg-transparent p-4 text-foreground outline-none",autoFocus:!0}),e.jsxs("div",{className:"aui-edit-composer-footer mx-3 mb-3 flex items-center justify-center gap-2 self-end",children:[e.jsx(_.ComposerPrimitive.Cancel,{asChild:!0,children:e.jsx(T,{variant:"ghost",size:"sm","aria-label":"Cancel edit",children:"Cancel"})}),e.jsx(_.ComposerPrimitive.Send,{asChild:!0,children:e.jsx(T,{size:"sm","aria-label":"Update message",children:"Update"})})]})]})}),rs=({className:t,...a})=>e.jsxs(_.BranchPickerPrimitive.Root,{hideWhenSingleBranch:!0,className:l("aui-branch-picker-root mr-2 -ml-2 inline-flex items-center text-xs text-muted-foreground",t),...a,children:[e.jsx(_.BranchPickerPrimitive.Previous,{asChild:!0,children:e.jsx(me,{tooltip:"Previous",children:e.jsx(f.ChevronLeftIcon,{})})}),e.jsxs("span",{className:"aui-branch-picker-state font-medium",children:[e.jsx(_.BranchPickerPrimitive.Number,{})," / ",e.jsx(_.BranchPickerPrimitive.Count,{})]}),e.jsx(_.BranchPickerPrimitive.Next,{asChild:!0,children:e.jsx(me,{tooltip:"Next",children:e.jsx(f.ChevronRightIcon,{})})})]});class xd{agentConfig;baseUrl;chatIdMap=new Map;constructor(a){this.agentConfig=a,this.baseUrl=a.baseUrl||""}updateAgentConfig(a){this.agentConfig={...this.agentConfig,...a}}getChatId(a){return this.chatIdMap.has(a)?this.chatIdMap.get(a):fa.v4()}async sendMessages(a){const{messages:r,chatId:n,abortSignal:s,headers:o,body:i}=a;console.log("sendMessages called with chatId:",n,"trigger:",a.trigger);const d=this.getChatId(n);console.log("Using server chatId:",d);const c={messages:r.map(w=>{const N=w.parts.filter(v=>v.type==="text").map(v=>v.text).join("");return{role:w.role,content:w.role==="user"&&this.agentConfig.additionalReferenceInfo&&Object.keys(this.agentConfig.additionalReferenceInfo).length>0?N+JSON.stringify(this.agentConfig.additionalReferenceInfo):N}}),provider:this.agentConfig.provider,model:this.agentConfig.model,agentId:this.agentConfig.agentId,agentName:this.agentConfig.agentName,temperature:this.agentConfig.temperature??.7,maxTokens:this.agentConfig.maxTokens??2048,stream:!0,useVoice:!1,...i},g={"Content-Type":"application/json",Authorization:`Bearer ${await dt()}`,...o instanceof Headers?Object.fromEntries(o.entries()):o||{}};try{const w=await fetch(`${this.baseUrl}/api/chat/completions/${d}`,{method:"POST",headers:g,body:JSON.stringify(c),signal:s,cache:"no-store"});if(!w.ok)throw new Error(`HTTP error! status: ${w.status}`);if(!w.body)throw new Error("Response body is null");return this.processResponseStream(w.body)}catch(w){throw console.error("Error in sendMessages:",w),w}}async reconnectToStream(a){return null}processResponseStream(a){const r=new TextDecoder;let n="",s=null,o=!1,i=[],d=!1,u="",c=!1,x="";return new ReadableStream({async start(g){s=a.getReader()},async pull(g){if(!(!s||o)){if(i.length>0){g.enqueue(i.shift());return}try{const{done:w,value:N}=await s.read();if(w){if(d&&u)for(c&&x&&i.push({type:"text-end",id:x}),i.push({type:"finish",finishReason:"stop"});i.length>0;)g.enqueue(i.shift());o||(o=!0,g.close());return}n+=r.decode(N,{stream:!0});const v=n.split(`
6
+ `);n=v.pop()||"";for(const C of v){const b=C.trim();if(b&&b.startsWith("data:")){const S=b.slice(5).trim();if(!S)continue;try{const p=JSON.parse(S);if(o)return;p.id&&!u&&(u=p.id,d=!0,i.push({type:"start"}));let I=null;if(p.type==="ai"){const j=p.messages?.[0];j?.content&&(x||(x=fa.v4()),c||(c=!0,i.push({type:"text-start",id:x})),I={type:"text-delta",delta:j.content,id:x})}else if(p.type==="tool"){const j=p.toolCall;j&&(I={type:"tool-input-available",toolCallId:j.callId,toolName:j.name,input:j.result})}I&&i.push(I)}catch{}}}i.length>0&&g.enqueue(i.shift())}catch(w){o||(o=!0,g.error(w))}}},cancel(){o=!0,i=[],s&&(s.releaseLock(),s=null)}})}}const fd=({provider:t="openai",model:a="gpt-4o-mini",agentId:r="default-agent",agentName:n="Default Agent",temperature:s=.7,maxTokens:o=2048,className:i,baseUrl:d="http://localhost:3000",additionalReferenceInfo:u={},appId:c="",currentUserDetails:x})=>{const[g,w]=m.useState([]),[N,v]=m.useState(),C=m.useMemo(()=>new xd({provider:t,model:a,agentId:N?N.agentID:r,agentName:N?N.agentName:n,temperature:s,maxTokens:o,baseUrl:d,additionalReferenceInfo:u}),[t,a,N,r,n,s,o,d,u]),b=Fs.useChatRuntime({transport:C}),S=async()=>{try{const I=await dt(),j=await fetch(`${d}/api/agent/${c}`,{method:"GET",headers:{"Content-Type":"application/json",Authorization:`Bearer ${I}`}});if(!j.ok)throw new Error(`HTTP error! status: ${j.status}`);const h=await j.json();console.log("Agent Data:",h),w(h)}catch(I){console.error("Error while fetching agents with the specific appId",I)}};m.useEffect(()=>{S()},[c,d]);const p=I=>{v(I),console.log("Agent changed to:",I.agentName)};return e.jsx(_.AssistantRuntimeProvider,{runtime:b,children:e.jsx("div",{className:i,children:e.jsx("div",{className:`flex flex-col h-full border rounded-lg overflow-hidden ${i}`,children:e.jsx(td,{currentUserDetails:x,agents:g,initialAgentId:r,initialAgentName:n,onAgentChange:p})})})})};function gd(){const t=ae.useNavigate(),{pathname:a}=ae.useLocation(),[r]=ae.useSearchParams(),[n,s]=m.useState(r.get("search")||""),[o]=Es.useDebounce(n,500);return m.useEffect(()=>{const i=new URLSearchParams(r.toString());o?i.set("search",o):i.delete("search"),i.get("search")!==r.get("search")&&(i.set("page","1"),t(`${a}?${i.toString()}`,{replace:!0}))},[o,a,t,r]),m.useEffect(()=>{const i=r.get("search")||"";i!==n&&s(i)},[r]),e.jsxs("div",{className:"relative max-w-sm min-w-[10%]",children:[e.jsx(f.Search,{className:"absolute left-2.5 top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground"}),e.jsx("input",{type:"text",placeholder:"Search ...",value:n,onChange:i=>s(i.target.value),className:"flex h-9 w-full rounded-md border border-border bg-transparent pl-9 pr-3 py-1 text-sm shadow-sm transition-colors text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-primary"})]})}function pd(){const t=ae.useNavigate(),{pathname:a}=ae.useLocation(),[r]=ae.useSearchParams(),n=r.get("size")||"10",s=o=>{const i=new URLSearchParams(r.toString());i.set("size",o.target.value),i.set("page","1"),t(`${a}?${i.toString()}`)};return e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"text-sm text-muted-foreground",children:"Rows per page:"}),e.jsxs("select",{className:"h-9 rounded-md border border-border bg-background text-foreground px-2 py-1 text-sm focus:outline-none focus:ring-2 focus:ring-primary",value:n,onChange:s,children:[e.jsx("option",{value:"10",children:"10"}),e.jsx("option",{value:"20",children:"20"}),e.jsx("option",{value:"50",children:"50"}),e.jsx("option",{value:"100",children:"100"})]})]})}function hd({totalPages:t,currentPage:a}){const r=ae.useNavigate(),{pathname:n}=ae.useLocation(),[s]=ae.useSearchParams(),o=i=>{const d=new URLSearchParams(s.toString());d.set("page",i.toString()),r(`${n}?${d.toString()}`)};return e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx("button",{type:"button",onClick:()=>o(a-1),disabled:a<=1,className:"h-9 px-3 py-1 text-sm font-medium border border-border rounded-md bg-background text-foreground hover:bg-muted disabled:opacity-50 disabled:cursor-not-allowed transition-colors",children:"Previous"}),e.jsxs("span",{className:"text-sm text-muted-foreground px-2",children:["Page ",e.jsx("span",{className:"font-semibold",children:a})," of"," ",e.jsx("span",{className:"font-semibold",children:Math.max(t??1,1)})]}),e.jsx("button",{type:"button",onClick:()=>o(a+1),disabled:t===void 0?void 0:a>=t,className:"h-9 px-3 py-1 text-sm font-medium border border-border rounded-md bg-background text-foreground hover:bg-muted disabled:opacity-50 disabled:cursor-not-allowed transition-colors",children:"Next"})]})}function bd({table:t}){const[a,r]=m.useState(!1),[n,s]=m.useState(""),o=m.useRef(null),i=t.getState().columnFilters,u=t.getAllLeafColumns().filter(c=>c.getCanFilter()).filter(c=>c.id.toLowerCase().includes(n.toLowerCase()));return m.useEffect(()=>{const c=x=>{o.current&&!o.current.contains(x.target)&&r(!1)};return document.addEventListener("mousedown",c),()=>document.removeEventListener("mousedown",c)},[]),e.jsx("div",{className:"flex items-center gap-3 ",children:e.jsxs(ve,{children:[e.jsx(je,{asChild:!0,children:e.jsxs(T,{variant:"outline",size:"sm",className:" gap-2",children:[e.jsx(f.ListFilter,{className:"w-4 h-4"}),"Filter"]})}),e.jsxs(we,{align:"end",className:"w-64 p-2",children:[e.jsx(At,{className:"text-center",children:"Filter"}),e.jsxs("div",{className:"p-2",children:[e.jsxs("div",{className:"relative mb-2",children:[e.jsx(f.Search,{className:"absolute left-2 top-2.5 h-3.5 w-3.5 text-muted-foreground"}),e.jsx(da,{placeholder:"Search columns...",value:n,onChange:c=>s(c.target.value)})]}),e.jsx("div",{className:"max-h-50 overflow-auto space-y-1 scroll-m-1",children:u.map(c=>{const x=i.some(g=>g.id===c.id);return e.jsxs("div",{className:"flex items-center space-x-2 p-2 hover:bg-muted rounded-sm transition-colors cursor-pointer",children:[e.jsx(Ve,{id:c.id,checked:x,onCheckedChange:g=>{g?c.setFilterValue([]):c.setFilterValue(void 0)}}),e.jsx("label",{htmlFor:c.id,className:"text-sm font-medium leading-none cursor-pointer flex-1",children:typeof c.columnDef.header=="string"?c.columnDef.header:c.id})]},c.id)})})]}),e.jsx(rt,{}),e.jsx("div",{className:"flex gap-2 p-1",children:e.jsxs(T,{size:"sm",className:"flex-1 h-8",onClick:()=>t.resetColumnFilters(),children:[e.jsx(f.RotateCcw,{className:"mr-2 h-3 w-3"})," Reset"]})})]})]})})}function vd({activeFilters:t,table:a}){return e.jsx("div",{className:"flex flex-wrap gap-2 min-w-max max-w-[70%] overflow-y-auto",children:t.map(r=>e.jsx(jd,{filter:r,table:a},r.id))})}function jd({filter:t,table:a}){debugger;const[r,n]=m.useState(!1),[s,o]=m.useState(t.value||[]),i=m.useRef(null),d=a.getColumn(t.id);m.useEffect(()=>{o(t.value||[])},[t.value]);const u=m.useMemo(()=>{const g=new Set;return a.getPreFilteredRowModel().flatRows.forEach(w=>{const N=w.getValue(t.id);N!=null&&g.add(N)}),Array.from(g).sort()},[a.getPreFilteredRowModel().flatRows,t.id]);m.useEffect(()=>{const g=w=>{i.current&&!i.current.contains(w.target)&&n(!1)};return document.addEventListener("mousedown",g),()=>document.removeEventListener("mousedown",g)},[]);const c=()=>{d.setFilterValue(s.length>0?s:void 0),n(!1)},x=()=>{o([]),d.setFilterValue(void 0),n(!1)};return e.jsxs("div",{className:"flex items-center gap-1 ",ref:i,children:[e.jsxs(ve,{children:[e.jsx(je,{asChild:!0,children:e.jsxs(T,{variant:"outline",size:"sm",className:"h-7 rounded-full px-3 text-xs border border-dashed",children:[e.jsxs("span",{className:"font-bold uppercase text-muted-foreground mr-1",children:[typeof d.columnDef.header=="string"?d.columnDef.header:t.id,":"]}),e.jsx("span",{className:"text-primary font-semibold",children:t.value?.length?`${t.value.length} Selected`:"All"}),e.jsx(f.ChevronDown,{className:"ml-1 h-3 w-3 opacity-50"})]})}),e.jsxs(we,{className:"w-56 p-0",align:"start",children:[e.jsx("div",{className:"p-2 max-h-48 overflow-y-auto",children:u.map(g=>e.jsxs("div",{className:"flex items-center space-x-2 p-2 hover:bg-muted rounded-sm transition-colors cursor-pointer",children:[e.jsx(Ve,{id:`${t.id}-${g}`,checked:s.includes(g),onCheckedChange:w=>{o(N=>w?[...N,g]:N.filter(v=>v!==g))}}),e.jsx("label",{htmlFor:`${t.id}-${g}`,className:"text-xs flex-1 truncate cursor-pointer",children:String(g).trim()===""?"N/A":String(g)})]},g))}),e.jsxs("div",{className:"p-2 border-t bg-muted/50 flex gap-2",children:[e.jsx(T,{size:"sm",className:"flex-1 h-7 text-[10px]",onClick:()=>c(),children:"Apply"}),e.jsx(T,{size:"sm",variant:"outline",className:"flex-1 h-7 text-[10px]",onClick:()=>{x()},children:"Clear"})]})]})]}),e.jsx(T,{variant:"ghost",size:"icon",className:"h-6 w-6 rounded-full hover:text-destructive",onClick:()=>d.setFilterValue(void 0),children:e.jsx(f.X,{className:"h-3 w-3"})})]})}function wd({table:t}){const[a,r]=m.useState(!1),n=m.useRef(null);return m.useEffect(()=>{function s(o){n.current&&!n.current.contains(o.target)&&r(!1)}return document.addEventListener("mousedown",s),()=>document.removeEventListener("mousedown",s)},[]),e.jsxs("div",{className:"relative",ref:n,children:[e.jsxs("button",{type:"button",className:`flex items-center gap-2 px-3 h-9 border rounded-md bg-background transition-colors text-sm font-medium ${a?"border-primary bg-muted":"border-border hover:bg-muted"}`,onClick:()=>r(!a),children:[e.jsx(f.Settings2,{className:"w-4 h-4"}),"Columns"]}),a&&e.jsxs("div",{className:"absolute right-0 mt-2 w-56 z-50 bg-background border border-border rounded-md shadow-lg p-2 animate-in fade-in zoom-in duration-100",children:[e.jsx("div",{className:"px-2 py-1.5 text-xs font-semibold text-muted-foreground border-b mb-1",children:"Toggle Columns"}),e.jsx("div",{className:"max-h-64 overflow-y-auto",children:t.getAllLeafColumns().map(s=>s.getCanHide()?e.jsxs("label",{className:"flex items-center gap-2 px-2 py-1.5 hover:bg-muted rounded cursor-pointer text-sm capitalize",children:[e.jsx("input",{type:"checkbox",checked:s.getIsVisible(),onChange:s.getToggleVisibilityHandler(),className:"h-4 w-4 rounded border-gray-300 text-primary focus:ring-primary"}),e.jsx("span",{className:"truncate",children:typeof s.columnDef.header=="string"?s.columnDef.header:s.id})]},s.id):null)}),e.jsx("div",{className:"border-t mt-1 pt-1",children:e.jsx("button",{type:"button",onClick:()=>t.toggleAllColumnsVisible(!0),className:"w-full text-left px-2 py-1.5 text-xs hover:bg-muted hover:text-primary rounded",children:"Show All"})})]})]})}function Nd({data:t,columns:a,extraTools:r}){const[n,s]=m.useState("list"),o=ae.useNavigate(),{pathname:i}=ae.useLocation(),[d]=ae.useSearchParams(),u=Number(d.get("page")||"1")-1,[c,x]=m.useState({pageIndex:0,pageSize:10}),[g,w]=m.useState(""),[N,v]=m.useState([]),[C,b]=m.useState([]),[S,p]=m.useState({}),[I,j]=m.useState({}),[h,A]=m.useState({}),[P,R]=m.useState([]),M=r?.hiddenColumns||[];for(const y of a)y.filterFn===void 0&&(y.filterFns="multiSelect"),y.draggable===void 0&&(y.draggable=!0);const F=E.useReactTable({data:t,columns:a,pageCount:r?.totalPages,meta:{footerLabel:r?.footerLabel},state:{pagination:c,globalFilter:g,sorting:N,grouping:C,expanded:S,rowSelection:I,columnVisibility:h,columnFilters:P},onSortingChange:v,onGroupingChange:b,onExpandedChange:p,onRowSelectionChange:j,onGlobalFilterChange:w,onPaginationChange:x,onColumnVisibilityChange:A,onColumnFiltersChange:R,manualPagination:!1,manualFiltering:!1,getCoreRowModel:E.getCoreRowModel(),getPaginationRowModel:E.getPaginationRowModel(),getSortedRowModel:E.getSortedRowModel(),getFilteredRowModel:E.getFilteredRowModel(),getGroupedRowModel:E.getGroupedRowModel(),getExpandedRowModel:E.getExpandedRowModel(),filterFns:{multiSelect:(y,k,B)=>{debugger;return B.length?B.includes(String(y.getValue(k))):!0}}});m.useEffect(()=>{debugger;F.getAllLeafColumns().map(y=>{M?.includes(y.id)&&y.toggleVisibility(!1)})},[M,F]);const ce=(y,k)=>{y.dataTransfer.setData("headerId",k)},Ae=y=>{debugger;y.preventDefault();const k=y.dataTransfer.getData("headerId");k&&!C.includes(k)&&F.getColumn(k)?.getCanGroup()&&F.getColumn(k)?.toggleGrouping()};m.useEffect(()=>{debugger;F.setGlobalFilter(d.get("search")||"")},[d,o,i]),m.useEffect(()=>{F.setPageSize(Number(d.get("size")||"10")),F.setPageIndex(Number(d.get("page")||"1")-1)},[d,o,i]);const Ce=()=>{const y=F.getVisibleLeafColumns().filter(ee=>ee.id!=="select"&&ee.id!=="actions"),k=(ee,Te=0)=>ee.flatMap(G=>{if(G.getIsGrouped()){const Ge=String(G.id.replaceAll(`${y[0].id}:`,"")).trim()===""||G.id.replaceAll(`${G.parentId?`${G.parentId}>`:""}`,"").replaceAll(`${G.groupingColumnId}>`,"").replaceAll(`${y[0].id}:`,"").trim()===void 0?"N/A":G.id.replaceAll(`${G.parentId?`${G.parentId}>`:""}`,"").replaceAll(`${y[0].id}:`,"").trim();return[{[y[0].id]:`${" ".repeat(Te)} ${Ge} (${G.subRows.length})`},...k(G.subRows,Te+1)]}else{let Ge={};return y.forEach(ct=>{const ut=G.getValue(ct.id);Ge[ct.id]=ct.id===y[0].id||ut==="Actions"||ut==="actions"?" ":ut===void 0?"N/A":ut}),[Ge]}}),B=F.getState().grouping.length>0?k(F.getGroupedRowModel().rows):F.getFilteredRowModel().rows.map(ee=>{let Te={};return y.forEach(G=>Te[G.id]=ee.getValue(G.id)),Te}),z=xt.utils.json_to_sheet(B),O=y.map(ee=>{const Te=typeof ee.columnDef.header=="string"?ee.columnDef.header:ee.id;return{wch:Math.max(Te.length,...B.map(Ge=>String(Ge[Te]).length))+3}});z["!cols"]=O;const Pe=xt.utils.book_new();xt.utils.book_append_sheet(Pe,z,"Data"),xt.writeFile(Pe,`${r?.fileName}.xlsx`)};return e.jsxs("div",{className:"space-y-2",children:[e.jsxs("div",{className:"flex items-center justify-between gap-2",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(gd,{}),e.jsx(vd,{activeFilters:F.getState().columnFilters,table:F})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[r?.actionNode&&r?.actionNode,e.jsx(wd,{table:F}),e.jsx(bd,{table:F}),e.jsx(T,{variant:"outline",size:"sm",className:" gap-2",onClick:()=>Ce(),children:e.jsx(f.Download,{className:"w-4 h-4"})}),r?.toggleViewMode&&e.jsxs("div",{className:"flex items-center border border-border rounded-md bg-background overflow-hidden h-9",children:[e.jsx("button",{onClick:()=>s("list"),className:`px-2.5 h-full flex items-center justify-center transition-colors ${n==="list"?"bg-muted text-foreground":"text-muted-foreground hover:bg-muted/50"}`,title:"List View",children:e.jsx(f.List,{className:"w-4 h-4"})}),e.jsx("button",{onClick:()=>s("grid"),className:`px-2.5 h-full flex items-center justify-center transition-colors ${n==="grid"?"bg-muted text-foreground":"text-muted-foreground hover:bg-muted/50"}`,title:"Grid View",children:e.jsx(f.LayoutGrid,{className:"w-4 h-4"})})]})]})]}),n==="list"?e.jsxs(e.Fragment,{children:[e.jsx("div",{onDragOver:y=>y.preventDefault(),onDrop:Ae,className:"w-full border border-dashed rounded-md h-10 p-2 flex gap-2 items-center text-sm bg-muted/20 ",children:C.length===0?e.jsx("span",{className:"text-muted-foreground",children:"Drag a column header here to group"}):C.map(y=>e.jsxs("div",{className:"flex items-center gap-1 bg-background border px-2 py-1 rounded shadow-sm",children:[y,e.jsx(f.X,{size:14,className:"cursor-pointer",onClick:()=>F.getColumn(y)?.toggleGrouping()})]},y))}),e.jsx("div",{className:"rounded-md border border-border bg-background overflow-x-auto",children:e.jsxs("table",{className:"w-full text-sm",children:[e.jsx("thead",{className:"bg-muted/50 border-b border-border sticky top-0",children:F.getHeaderGroups().map(y=>e.jsx("tr",{children:y.headers.map(k=>e.jsx("th",{className:"px-4 py-3 text-left font-medium cursor-pointer select-none",draggable:!0,onDragStart:B=>ce(B,k.id),children:e.jsxs("div",{className:"flex items-center gap-2",onClick:k.column.getToggleSortingHandler(),children:[E.flexRender(k.column.columnDef.header,k.getContext()),{asc:e.jsx(f.ChevronUp,{size:14}),desc:e.jsx(f.ChevronDown,{size:14})}[k.column.getIsSorted()]??null]})},k.id))},y.id))}),e.jsx("tbody",{className:"divide-y divide-border",children:F.getRowModel().rows.map(y=>e.jsx("tr",{className:`hover:bg-muted/30 transition-colors ${y.getIsSelected()?"bg-accent/20":""}`,children:y.getVisibleCells().map(k=>e.jsx("td",{className:"px-4 py-3",children:k.getIsGrouped()?e.jsxs("button",{onClick:y.getToggleExpandedHandler(),className:"flex items-center gap-2 font-semibold",children:[y.getIsExpanded()?e.jsx(f.ChevronDown,{size:16}):e.jsx(f.ChevronRight,{size:16}),E.flexRender(k.column.columnDef.cell,k.getContext())," (",y.subRows.length,")"]}):k.getIsAggregated()?E.flexRender(k.column.columnDef.aggregatedCell??k.column.columnDef.cell,k.getContext()):k.getIsPlaceholder()?null:E.flexRender(k.column.columnDef.cell,k.getContext())},k.id))},y.id))}),r?.showFooter&&e.jsx("tfoot",{className:"bg-muted/30 border-t-2 border-border font-bold",children:F.getFooterGroups().map(y=>e.jsx("tr",{children:y.headers.map(k=>e.jsx("td",{className:"px-4 py-3 text-left",children:k.isPlaceholder?null:E.flexRender(k.column.columnDef.footer,k.getContext())},k.id))},y.id))})]})}),e.jsxs("div",{className:"flex items-center justify-between pt-2 border-t border-border",children:[e.jsx(pd,{}),e.jsx(hd,{totalPages:r?.totalPages,currentPage:u+1})]})]}):r?.gridComponent?r.gridComponent(t):e.jsx("div",{className:"p-12 text-center text-muted-foreground border border-border border-dashed rounded-md bg-muted/20",children:"Grid view not implemented for this component yet."})]})}function yd({data:t,columns:a,extraTools:r}){return e.jsx("div",{className:"space-y-6",children:e.jsxs("div",{className:"relative min-h-[300px]",children:[e.jsx(Sn,{isLoading:r?.isLoading,onReload:r?.onReload||(()=>window.location.reload())}),e.jsx("div",{className:`transition-all duration-300 ${r?.isLoading?"opacity-50 pointer-events-none":""}`,children:e.jsx(Nd,{data:t,columns:a,extraTools:r})})]})})}exports.Accordion=Gs;exports.AccordionContent=Hs;exports.AccordionItem=qs;exports.AccordionTrigger=Ws;exports.ActionMenu=Wt;exports.ActivitySheet=Dl;exports.Alert=ho;exports.AlertDescription=vo;exports.AlertDialog=Fa;exports.AlertDialogAction=Lt;exports.AlertDialogCancel=$a;exports.AlertDialogContent=La;exports.AlertDialogDescription=Va;exports.AlertDialogFooter=Ba;exports.AlertDialogHeader=Oa;exports.AlertDialogMedia=go;exports.AlertDialogOverlay=Ea;exports.AlertDialogPortal=Ma;exports.AlertDialogTitle=Ua;exports.AlertDialogTrigger=fo;exports.AlertTitle=bo;exports.AppBreadcrumb=Rn;exports.AppSidebar=En;exports.AspectRatio=$t;exports.AssistantComponent=fd;exports.Avatar=Ga;exports.AvatarBadge=jo;exports.AvatarFallback=Wa;exports.AvatarGroup=wo;exports.AvatarGroupCount=No;exports.AvatarImage=qa;exports.Badge=ht;exports.BigCalendar=Yi;exports.Breadcrumb=Wr;exports.BreadcrumbEllipsis=qt;exports.BreadcrumbItem=We;exports.BreadcrumbLink=Gt;exports.BreadcrumbList=Hr;exports.BreadcrumbPage=Qe;exports.BreadcrumbProvider=Tn;exports.BreadcrumbSeparator=bt;exports.Button=T;exports.Calendar=Ka;exports.CalendarDayButton=Xa;exports.Card=wt;exports.CardAction=ko;exports.CardContent=Ya;exports.CardDescription=So;exports.CardFooter=Io;exports.CardHeader=yo;exports.CardTitle=Co;exports.Checkbox=Ve;exports.Collapsible=Kr;exports.CollapsibleContent=Yr;exports.CollapsibleTrigger=Xr;exports.ComboboxInput=Di;exports.Command=Y;exports.CommandDialog=Ao;exports.CommandEmpty=de;exports.CommandGroup=re;exports.CommandInput=ie;exports.CommandItem=X;exports.CommandList=le;exports.CommandSeparator=ar;exports.CommandShortcut=Po;exports.CropperForm=Qn;exports.CropperFormWithModal=Jn;exports.CustomAlertDialog=pn;exports.CustomComboboxInput=Ml;exports.CustomTabs=Dn;exports.DataTable=Ri;exports.DataTableColumnFilter=vn;exports.DataTableFacetedFilter=jn;exports.DataTableFilterMenu=wn;exports.DataTableLayout=yd;exports.DataTablePagination=yn;exports.DataTableToolbar=Cn;exports.Dialog=kt;exports.DialogClose=Do;exports.DialogContent=It;exports.DialogDescription=tr;exports.DialogFooter=er;exports.DialogHeader=ra;exports.DialogOverlay=Za;exports.DialogPortal=Ja;exports.DialogProvider=bn;exports.DialogTitle=Dt;exports.DialogTrigger=Qa;exports.Drawer=Qr;exports.DrawerClose=en;exports.DrawerContent=an;exports.DrawerDescription=on;exports.DrawerFooter=nn;exports.DrawerHeader=rn;exports.DrawerOverlay=tn;exports.DrawerPortal=Zr;exports.DrawerTitle=sn;exports.DrawerTrigger=Jr;exports.DropdownMenu=ve;exports.DropdownMenuCheckboxItem=To;exports.DropdownMenuContent=we;exports.DropdownMenuGroup=na;exports.DropdownMenuItem=ue;exports.DropdownMenuLabel=At;exports.DropdownMenuPortal=rr;exports.DropdownMenuRadioGroup=Ro;exports.DropdownMenuRadioItem=_o;exports.DropdownMenuSeparator=rt;exports.DropdownMenuShortcut=zo;exports.DropdownMenuSub=nr;exports.DropdownMenuSubContent=or;exports.DropdownMenuSubTrigger=sr;exports.DropdownMenuTrigger=je;exports.EChart=zi;exports.FileInput=kn;exports.FileUploader=Pi;exports.FontProvider=Wn;exports.Footer=Ln;exports.Form=ln;exports.FormComboboxInput=Zi;exports.FormComboboxInputWithValue=el;exports.FormControl=ge;exports.FormDateInput=tl;exports.FormDescription=ye;exports.FormField=xe;exports.FormFileInput=al;exports.FormInput=rl;exports.FormItem=fe;exports.FormLabel=Ne;exports.FormMessage=pe;exports.FormMultiComboboxInput=nl;exports.FormOtpInput=sl;exports.FormPasswordInput=ll;exports.FormPhoneInput=ol;exports.FormTextarea=il;exports.FrameworkItemDropdown=Gi;exports.GlowingEffect=Fi;exports.GradeTableLoader=dl;exports.Header=On;exports.HoverCard=Fo;exports.HoverCardContent=Eo;exports.HoverCardTrigger=Mo;exports.Icon=Nt;exports.IconButton=gn;exports.IconButtonWithTooltip=Re;exports.IconTextButton=it;exports.IconTextButtonWithTooltip=fn;exports.ImageCropper=Yn;exports.ImageCropperProvider=Rl;exports.Input=H;exports.InputOTP=un;exports.InputOTPGroup=mn;exports.InputOTPSeparator=Ci;exports.InputOTPSlot=Je;exports.Label=Se;exports.LoadingSpinner=Mi;exports.MainLayout=Gn;exports.MainSidebar=$n;exports.MultiCombobox=Ei;exports.NavMain=Fn;exports.NavigationMenu=Lo;exports.NavigationMenuContent=Vo;exports.NavigationMenuIndicator=Go;exports.NavigationMenuItem=Bo;exports.NavigationMenuLink=$o;exports.NavigationMenuList=Oo;exports.NavigationMenuTrigger=Uo;exports.NavigationMenuViewport=lr;exports.NewCropperImg=es;exports.NewImageForm=zl;exports.NoDataComponent=ca;exports.PageWrapper=Li;exports.PasswordStrengthMeter=Oi;exports.PhoneInput=Bi;exports.Popover=Q;exports.PopoverAnchor=qo;exports.PopoverContent=Z;exports.PopoverDescription=Ko;exports.PopoverHeader=Wo;exports.PopoverTitle=Ho;exports.PopoverTrigger=J;exports.Progress=Pt;exports.ProviderWrapper=Il;exports.RadioGroup=Xo;exports.RadioGroupItem=Yo;exports.RadiusProvider=Kn;exports.Reload=Sn;exports.RenderAppBreadcrumb=Qi;exports.RenderSidebarNav=Ji;exports.ScrollArea=Qo;exports.ScrollBar=dr;exports.SearchInput=da;exports.Select=cr;exports.SelectContent=xr;exports.SelectGroup=Jo;exports.SelectItem=fr;exports.SelectLabel=Zo;exports.SelectScrollDownButton=pr;exports.SelectScrollUpButton=gr;exports.SelectSeparator=ei;exports.SelectTrigger=mr;exports.SelectValue=ur;exports.Separator=Tt;exports.Sheet=sa;exports.SheetClose=ti;exports.SheetComponent=In;exports.SheetContent=oa;exports.SheetDescription=vr;exports.SheetFooter=ni;exports.SheetHeader=br;exports.SheetTitle=ia;exports.SheetTrigger=hr;exports.Sidebar=Nr;exports.SidebarContent=Dr;exports.SidebarFooter=Ir;exports.SidebarGroup=Ar;exports.SidebarGroupAction=fi;exports.SidebarGroupContent=gi;exports.SidebarGroupLabel=xi;exports.SidebarHeader=kr;exports.SidebarInput=ui;exports.SidebarInset=Sr;exports.SidebarMenu=Pr;exports.SidebarMenuAction=hi;exports.SidebarMenuBadge=bi;exports.SidebarMenuButton=Bt;exports.SidebarMenuItem=Ot;exports.SidebarMenuSkeleton=vi;exports.SidebarMenuSub=Tr;exports.SidebarMenuSubButton=_r;exports.SidebarMenuSubItem=Rr;exports.SidebarNavProvider=zn;exports.SidebarProvider=wr;exports.SidebarRail=Cr;exports.SidebarSeparator=mi;exports.SidebarTrigger=yr;exports.SimpleWidget=Vi;exports.Skeleton=Be;exports.SkeletonWidget=cl;exports.Slider=ji;exports.Switch=Ni;exports.Table=Er;exports.TableBody=Or;exports.TableCaption=yi;exports.TableCell=Ye;exports.TableFooter=Br;exports.TableHead=Ut;exports.TableHeader=Lr;exports.TableRow=qe;exports.Tabs=Ur;exports.TabsContent=Vt;exports.TabsList=$r;exports.TabsTrigger=Gr;exports.TextButton=ot;exports.TextButtonWithTooltip=ki;exports.Textarea=qr;exports.ThemeProvider=Fr;exports.ThemeToggleBtn=An;exports.TitleProgress=$i;exports.Toaster=wi;exports.Toggle=Si;exports.ToggleGroup=Oe;exports.ToggleGroupItem=V;exports.Tooltip=ne;exports.TooltipComponent=ze;exports.TooltipContent=oe;exports.TooltipProvider=_e;exports.TooltipTrigger=se;exports.UploadTab=Mn;exports.Widgets=qi;exports.WorkInProgress=Fl;exports.axiosInstance=Fe;exports.badgeVariants=Ha;exports.buttonVariants=jt;exports.clearAllCookieSession=ml;exports.clearCookieSession=Kt;exports.cn=l;exports.convertFileToObject=Nn;exports.getCookieSession=yt;exports.getDataTableColumnTitle=ke;exports.getImageFromObject=Ai;exports.getValidAccessToken=dt;exports.navigationMenuTriggerStyle=ir;exports.refreshAccessToken=Bn;exports.setCookieSession=Ht;exports.setIkonConfig=ul;exports.tabsListVariants=Vr;exports.toggleVariants=la;exports.useBreadcrumb=ua;exports.useDialog=Ii;exports.useFont=wl;exports.useFormField=st;exports.useImageCropper=xa;exports.useIsMobile=Rt;exports.useRadius=Nl;exports.useRefresh=Cl;exports.useSidebar=nt;exports.useSidebarNav=lt;