ikon-react-components-lib 1.0.1 → 1.0.2

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"),Yn=require("@radix-ui/react-accordion"),Jn=require("clsx"),Xn=require("tailwind-merge"),Qn=require("@radix-ui/react-alert-dialog"),G=require("class-variance-authority"),Zn=require("@radix-ui/react-aspect-ratio"),es=require("@radix-ui/react-avatar"),ts=require("@radix-ui/react-checkbox"),as=require("@radix-ui/react-dialog"),rs=require("@radix-ui/react-dropdown-menu"),ns=require("@radix-ui/react-hover-card"),ss=require("@radix-ui/react-label"),os=require("@radix-ui/react-navigation-menu"),is=require("@radix-ui/react-popover"),ls=require("@radix-ui/react-progress"),cs=require("@radix-ui/react-radio-group"),ds=require("@radix-ui/react-scroll-area"),us=require("@radix-ui/react-select"),ms=require("@radix-ui/react-separator"),fs=require("@radix-ui/react-slider"),Ut=require("@radix-ui/react-slot"),xs=require("@radix-ui/react-switch"),ps=require("@radix-ui/react-tabs"),gs=require("@radix-ui/react-toggle"),hs=require("@radix-ui/react-toggle-group"),bs=require("@radix-ui/react-tooltip"),m=require("react"),kt=require("react-day-picker"),Fe=require("cmdk"),vs=require("next-themes"),pa=require("sonner");require("react-dom");const ke=require("vaul"),Ue=require("react-hook-form"),ga=require("input-otp"),B=require("@tanstack/react-table"),De=require("echarts"),ot=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"),de=require("react-router-dom"),ha=require("axios"),Vt=require("js-cookie"),Cs=require("jwt-decode"),ze=require("@tanstack/react-query"),ba=require("react-cropper"),R=require("@assistant-ui/react"),ks=require("motion/react-m"),It=require("@assistant-ui/react-markdown"),Is=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(Yn),be=F(Qn),Ts=F(Zn),qt=F(es),oa=F(ts),L=F(as),q=F(rs),ct=F(ns),Ps=F(ss),Ie=F(os),Ye=F(is),ia=F(ls),St=F(cs),He=F(ds),$=F(us),Ds=F(ms),rt=F(fs),ve=F(Ut),la=F(xs),xt=F(ps),_s=F(gs),va=F(hs),Be=F(bs),I=F(m),Rs=F(Ns),At=F(ks);function i(...t){return Xn.twMerge(Jn.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=nt(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=nt(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=nt(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=nt(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 nt(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 pt="Collapsible",[Zs]=Ls(pt),[eo,Gt]=Zs(pt),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:pt});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=pt;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",ka=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})})});ka.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 dt=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 _({className:t,variant:a="default",size:r="default",asChild:n=!1,...s}){const o=n?ve.Root:"button";return e.jsx(o,{"data-slot":"button","data-variant":a,"data-size":r,className:i(dt({variant:a,size:r,className:t})),...s})}function Ia({...t}){return e.jsx(be.Root,{"data-slot":"alert-dialog",...t})}function ro({...t}){return e.jsx(be.Trigger,{"data-slot":"alert-dialog-trigger",...t})}function Sa({...t}){return e.jsx(be.Portal,{"data-slot":"alert-dialog-portal",...t})}function Aa({className:t,...a}){return e.jsx(be.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(be.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 _a({className:t,...a}){return e.jsx(be.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 Ra({className:t,...a}){return e.jsx(be.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(_,{variant:a,size:r,asChild:!0,children:e.jsx(be.Action,{"data-slot":"alert-dialog-action",className:i(t),...n})})}function za({className:t,variant:a="outline",size:r="default",...n}){return e.jsx(_,{variant:a,size:r,asChild:!0,children:e.jsx(be.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 it({className:t,variant:a="default",asChild:r=!1,...n}){const s=r?ve.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=kt.getDefaultClassNames();return e.jsx(kt.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(dt({variant:s}),"size-(--cell-size) aria-disabled:opacity-50 p-0 select-none",d.button_previous),button_next:i(dt({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=kt.getDefaultClassNames(),o=I.useRef(null);return I.useEffect(()=>{r.focused&&o.current?.focus()},[r.focused]),e.jsx(_,{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 ut({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 gt({...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 ht({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(_,{variant:"outline",children:"Close"})})]})}function bt({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(gt,{...o,children:[e.jsxs(Kt,{className:"sr-only",children:[e.jsx(bt,{children:t}),e.jsx($a,{children:a})]}),e.jsx(ht,{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 Se({...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 Ae({...t}){return e.jsx(q.Trigger,{"data-slot":"dropdown-menu-trigger",...t})}function Te({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 vt({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 ko({...t}){return e.jsx(ct.Root,{"data-slot":"hover-card",...t})}function Io({...t}){return e.jsx(ct.Trigger,{"data-slot":"hover-card-trigger",...t})}function So({className:t,align:a="center",sideOffset:r=4,...n}){return e.jsx(ct.Portal,{"data-slot":"hover-card-portal",children:e.jsx(ct.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 H({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 ge({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(Ie.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(Ie.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(Ie.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(Ie.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 _o({className:t,...a}){return e.jsx(Ie.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(Ie.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 Ro({className:t,...a}){return e.jsx(Ie.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(Ie.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 jt({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($.Root,{"data-slot":"select",...t})}function Vo({...t}){return e.jsx($.Group,{"data-slot":"select-group",...t})}function ar({...t}){return e.jsx($.Value,{"data-slot":"select-value",...t})}function rr({className:t,size:a="default",children:r,...n}){return e.jsxs($.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($.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($.Portal,{children:e.jsxs($.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($.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($.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($.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($.ItemIndicator,{children:e.jsx(g.CheckIcon,{className:"size-4"})})}),e.jsx($.ItemText,{children:a})]})}function Wo({className:t,...a}){return e.jsx($.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($.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($.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 wt({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 Nt(){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 Re({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=Nt(),[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(_,{"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(H,{"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(wt,{"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?ve.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?ve.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?ve.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?ve.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(Re,{className:"size-4 rounded-md","data-sidebar":"menu-skeleton-icon"}),e.jsx(Re,{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?ve.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(rt.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(rt.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(rt.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(rt.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 ui=({...t})=>{const{theme:a="system"}=vs.useTheme();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 kr({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 Ir({className:t,...a}){return e.jsx("thead",{"data-slot":"table-header",className:i("[&_tr]:border-b",t),...a})}function Sr({className:t,...a}){return e.jsx("tbody",{"data-slot":"table-body",className:i("[&_tr:last-child]:border-0",t),...a})}function Ar({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 _t({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 Tr({className:t,orientation:a="horizontal",...r}){return e.jsx(xt.Root,{"data-slot":"tabs","data-orientation":a,orientation:a,className:i("group/tabs flex gap-2 data-[orientation=horizontal]:flex-col",t),...r})}const Pr=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 Dr({className:t,variant:a="default",...r}){return e.jsx(xt.List,{"data-slot":"tabs-list","data-variant":a,className:i(Pr({variant:a}),t),...r})}function _r({className:t,...a}){return e.jsx(xt.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 Rt({className:t,...a}){return e.jsx(xt.Content,{"data-slot":"tabs-content",className:i("flex-1 outline-none",t),...a})}function Rr({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 zr({...t}){return e.jsx("nav",{"aria-label":"breadcrumb","data-slot":"breadcrumb",...t})}function Mr({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?ve.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 lt({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 Fr({...t}){return e.jsx(ao,{"data-slot":"collapsible",...t})}function Er({...t}){return e.jsx(Ca,{"data-slot":"collapsible-trigger",...t})}function Or({...t}){return e.jsx(ka,{"data-slot":"collapsible-content",...t})}function Lr({...t}){return e.jsx(ke.Drawer.Root,{"data-slot":"drawer",...t})}function Br({...t}){return e.jsx(ke.Drawer.Trigger,{"data-slot":"drawer-trigger",...t})}function Ur({...t}){return e.jsx(ke.Drawer.Portal,{"data-slot":"drawer-portal",...t})}function Vr({...t}){return e.jsx(ke.Drawer.Close,{"data-slot":"drawer-close",...t})}function qr({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 Wr({className:t,children:a,...r}){return e.jsxs(Ur,{"data-slot":"drawer-portal",children:[e.jsx(qr,{}),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 Gr({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 $r({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 Hr({className:t,...a}){return e.jsx(ke.Drawer.Title,{"data-slot":"drawer-title",className:i("text-foreground font-semibold",t),...a})}function Kr({className:t,...a}){return e.jsx(ke.Drawer.Description,{"data-slot":"drawer-description",className:i("text-muted-foreground text-sm",t),...a})}const Yr=Ue.FormProvider,Jr=I.createContext({}),ue=({...t})=>e.jsx(Jr.Provider,{value:{name:t.name},children:e.jsx(Ue.Controller,{...t})}),Ze=()=>{const t=I.useContext(Jr),a=I.useContext(Xr),{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}},Xr=I.createContext({});function me({className:t,...a}){const r=I.useId();return e.jsx(Xr.Provider,{value:{id:r},children:e.jsx("div",{"data-slot":"form-item",className:i("grid gap-2",t),...a})})}function je({className:t,...a}){const{error:r,formItemId:n}=Ze();return e.jsx(ge,{"data-slot":"form-label","data-error":!!r,className:i("data-[error=true]:text-destructive",t),htmlFor:n,...a})}function fe({...t}){const{error:a,formItemId:r,formDescriptionId:n,formMessageId:s}=Ze();return e.jsx(ve.Root,{"data-slot":"form-control",id:r,"aria-describedby":a?`${n} ${s}`:`${n}`,"aria-invalid":!!a,...t})}function we({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 xe({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 Qr({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 Zr({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(_s.Root,{"data-slot":"toggle",className:i(ea({variant:a,size:r,className:t})),...n})}const en=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(en.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(en);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(_,{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(_,{variant:a||"outline",size:n||"sm",...s,asChild:r,children:t})}function tn({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 an({children:t,variant:a,size:r,asChild:n=!1,...s}){return e.jsx(_,{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(an,{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(vt,{},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(Se,{children:[e.jsx(Ae,{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(Te,{className:"w-56",align:"end",children:r(t)})]})}const rn=({title:t,description:a,fontSize:r="text-base",cancelText:n="",confirmText:s="",thirdOptionText:o="",onCancel:l,onConfirm:c,onThird:d})=>e.jsx(Ia,{open:!0,children:e.jsxs(Ta,{children:[e.jsxs(Pa,{children:[e.jsx(_a,{className:r,children:t}),e.jsx(Ra,{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})]})]})}),nn=m.createContext(void 0),hi=()=>{const t=m.useContext(nn);if(!t)throw new Error("useDialog must be used within a DialogProvider");return t},sn=({children:t})=>{const[a,r]=m.useState(null),n=o=>r(o),s=()=>r(null);return e.jsxs(nn.Provider,{value:{openDialog:n,closeDialog:s},children:[t,a&&e.jsx(rn,{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(_,{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 he=t=>t?.columnDef?.title||t?.columnDef?.header&&typeof t.columnDef.header=="string"&&t?.columnDef?.header||t.id;function on({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:he(a),children:he(a)})]},a.id)})})]})]})})]})}function ln({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(tn,{variant:"dashed",tooltipContent:he(t),children:[r?.size>0?e.jsx(g.X,{}):e.jsx(g.Plus,{}),he(t),r?.size>0&&e.jsxs(e.Fragment,{children:[e.jsx(wt,{orientation:"vertical",className:"mx-2 h-4"}),e.jsx(it,{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(it,{variant:"secondary",className:"rounded-sm px-1 font-normal",children:[r.size," selected"]}):n.filter(s=>r.has(s)).map(s=>e.jsx(it,{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:he(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 cn({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:he(n),children:he(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(ln,{column:s},n)})})]})}const dn=async t=>{const a=await t.arrayBuffer(),r=btoa(String.fromCharCode(...new Uint8Array(a)));return{message:"File processed successfully",fileName:t.name,size:t.size,type:t.type,lastModified:t.lastModified,base64:r}};function vi({label:t="Upload File",isDrag:a=!1,onFileSelect:r}){const[n,s]=m.useState(!1),o=async f=>{if(!f)return;const h=await dn(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"),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"),kt=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"),De=require("echarts"),ot=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-dom"),ha=require("axios"),Vt=require("js-cookie"),Cs=require("jwt-decode"),ze=require("@tanstack/react-query"),ba=require("react-cropper"),_=require("@assistant-ui/react"),ks=require("motion/react-m"),It=require("@assistant-ui/react-markdown"),Is=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),ct=F(ss),Ps=F(os),Ie=F(is),Ye=F(ls),ia=F(cs),St=F(ds),He=F(us),H=F(ms),Ds=F(fs),rt=F(xs),we=F(Ut),la=F(ps),xt=F(gs),Rs=F(hs),va=F(bs),Be=F(vs),k=F(m),_s=F(Ns),At=F(ks);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=k.createContext(l),d=r.length;r=[...r,l];const u=h=>{const{scope:w,children:C,...v}=h,N=w?.[t]?.[d]||c,b=k.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=k.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=>k.createContext(l));return function(c){const d=c?.[t]||o;return k.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 k.useMemo(()=>({[`__scope${a.scopeName}`]:l}),[l])}};return r.scopeName=a.scopeName,r}var Je=globalThis?.document?k.useLayoutEffect:()=>{},Us=k[" 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=k.useRef(t!==void 0);k.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=k.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]=k.useState(t),s=k.useRef(r),o=k.useRef(a);return Us(()=>{o.current=a},[a]),k.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 k.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=k.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 k.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}):k.Children.only(r),o=ja(n.ref,Ys(s));return typeof r=="function"||n.isPresent?k.cloneElement(s,{ref:o}):null};wa.displayName="Presence";function Ks(t){const[a,r]=k.useState(),n=k.useRef(null),s=k.useRef(t),o=k.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 k.useEffect(()=>{const u=nt(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=nt(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=nt(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=nt(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:k.useCallback(u=>{n.current=u?getComputedStyle(u):null,r(u)},[])}}function nt(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=k[" useId ".trim().toString()]||(()=>{}),Xs=0;function Qs(t){const[a,r]=k.useState(Js());return Je(()=>{r(n=>n??String(Xs++))},[t]),t||(a?`radix-${a}`:"")}var pt="Collapsible",[Zs]=Ls(pt),[eo,Gt]=Zs(pt),Na=k.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:pt});return e.jsx(eo,{scope:r,disabled:o,contentId:Qs(),open:d,onOpenToggle:k.useCallback(()=>u(f=>!f),[u]),children:e.jsx(Wt.div,{"data-state":Ht(d),"data-disabled":o?"":void 0,...c,ref:a})})});Na.displayName=pt;var ya="CollapsibleTrigger",Ca=k.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",ka=k.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})})});ka.displayName=$t;var to=k.forwardRef((t,a)=>{const{__scopeCollapsible:r,present:n,children:s,...o}=t,l=Gt($t,r),[c,d]=k.useState(n),u=k.useRef(null),f=ja(a,u),h=k.useRef(0),w=h.current,C=k.useRef(0),v=C.current,N=l.open||c,b=k.useRef(N),y=k.useRef(void 0);return k.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 I=x.getBoundingClientRect();h.current=I.height,C.current=I.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 dt=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(dt({variant:a,size:r,className:t})),...s})}function Ia({...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 it({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=kt.getDefaultClassNames();return e.jsx(kt.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(dt({variant:s}),"size-(--cell-size) aria-disabled:opacity-50 p-0 select-none",d.button_previous),button_next:i(dt({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=kt.getDefaultClassNames(),o=k.useRef(null);return k.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 ut({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 gt({...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 ht({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 bt({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(gt,{...o,children:[e.jsxs(Kt,{className:"sr-only",children:[e.jsx(bt,{children:t}),e.jsx($a,{children:a})]}),e.jsx(ht,{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 Se({...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 Ae({...t}){return e.jsx(q.Trigger,{"data-slot":"dropdown-menu-trigger",...t})}function Te({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 vt({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 ko({...t}){return e.jsx(ct.Root,{"data-slot":"hover-card",...t})}function Io({...t}){return e.jsx(ct.Trigger,{"data-slot":"hover-card-trigger",...t})}function So({className:t,align:a="center",sideOffset:r=4,...n}){return e.jsx(ct.Portal,{"data-slot":"hover-card-portal",children:e.jsx(ct.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(Ie.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(Ie.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(Ie.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(Ie.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(Ie.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(Ie.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(Ie.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(Ie.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 jt({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 wt({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 Nt(){const[t,a]=k.useState(void 0);return k.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 _e({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=k.createContext(null);function Qe(){const t=k.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=Nt(),[d,u]=k.useState(!1),[f,h]=k.useState(t),w=a??f,C=k.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=k.useCallback(()=>c?u(y=>!y):C(y=>!y),[c,C,u]);k.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=k.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(wt,{"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=k.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(_e,{className:"size-4 rounded-md","data-sidebar":"menu-skeleton-icon"}),e.jsx(_e,{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=k.useMemo(()=>Array.isArray(r)?r:Array.isArray(a)?a:[n,s],[r,a,n,s]);return e.jsxs(rt.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(rt.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(rt.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(rt.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 kr=k.createContext(void 0),Ir=({children:t})=>{const a=()=>typeof window>"u"?"light":window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light",[r,n]=k.useState(()=>typeof window>"u"?"system":localStorage.getItem("theme")||"system"),[s,o]=k.useState(()=>r==="system"?a():r),l=k.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)},[]);k.useEffect(()=>{l(r),localStorage.setItem("theme",r)},[r,l]),k.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=k.useMemo(()=>({theme:r,setTheme:n,resolvedTheme:s}),[r,s]);return e.jsx(kr.Provider,{value:c,children:t})},Sr=()=>{const t=k.useContext(kr);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(xt.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(xt.List,{"data-slot":"tabs-list","data-variant":a,className:i(_r({variant:a}),t),...r})}function Mr({className:t,...a}){return e.jsx(xt.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(xt.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 lt({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(ka,{"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=k.createContext({}),ce=({...t})=>e.jsx(Zr.Provider,{value:{name:t.name},children:e.jsx(Ue.Controller,{...t})}),Ze=()=>{const t=k.useContext(Zr),a=k.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=k.createContext({});function de({className:t,...a}){const r=k.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=k.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=k.createContext({size:"default",variant:"default",spacing:0});function Re({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=k.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(vt,{},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(Se,{children:[e.jsx(Ae,{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(Te,{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(Ia,{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=k.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(wt,{orientation:"vertical",className:"mx-2 h-4"}),e.jsx(it,{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(it,{variant:"secondary",className:"rounded-sm px-1 font-normal",children:[r.size," selected"]}):n.filter(s=>r.has(s)).map(s=>e.jsx(it,{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
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"})]})]})}function ji(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)}const wi=[15,20,30,40,50,100];function un({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 mn({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(H,{className:G.cx("pl-8 h-8",t),...a})]})}function fn({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(mn,{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(cn,{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(on,{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:he(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()},pe=T=>{const P=S.filter(z=>z.id!==T);A(()=>[...P]);const V=p.getColumn(T);V&&V.getToggleGroupingHandler()()},[Ee,Pe]=m.useState(!1);return m.useEffect(()=>{Ee||Pe(!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(fn,{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:()=>pe(T.id),children:e.jsx(g.X,{size:15})})]},T.id))}),e.jsx("div",{className:"flex-grow overflow-hidden",children:e.jsxs(kr,{className:"border-t whitespace-nowrap bg-card-new",children:[(r?.header==null||r.header)&&e.jsx(Ir,{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(_t,{colSpan:S.length,className:G.cx("w-36 ","text-left")},P.id):e.jsx(_t,{...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(Sr,{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(_,{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(Ar,{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(un,{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?De.getInstanceByDom(h.current):null,setOption:(v,N)=>{if(!h.current)return;De.getInstanceByDom(h.current)?.setOption(v,N)},resize:(v=0)=>{if(!h.current)return;const N=De.getInstanceByDom(h.current);N?.resize(),v&&setTimeout(()=>N?.resize(),v)},loadingVisible:v=>{if(!h.current)return;const N=De.getInstanceByDom(h.current);v?N?.showLoading():N?.hideLoading()},dispose:()=>{if(!h.current)return;De.getInstanceByDom(h.current)?.dispose()},on:(v,N)=>{if(!h.current)return;De.getInstanceByDom(h.current)?.on(v,N)}})),m.useEffect(()=>{h.current&&(w.current=De.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 xn({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:(...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 ki=(({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,Pe=O+Ee;ot.animate(O,Pe,{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 mt({name:t,...a}){const r=As[t];return r?e.jsx(r,{...a}):(console.warn(`Icon "${t}" not found in lucide-react`),null)}const Ii=({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(_,{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(jt,{value:r,className:n()})})},da=({code:t})=>{const a=Rs[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(_,{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 pn({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(_,{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 _i({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(ut,{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 gn({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=Nt(),[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(Tr,{value:y,onValueChange:k,className:"w-full h-full flex flex-col",children:[e.jsxs(Dr,{className:`flex justify-between items-center ${n}`,children:[e.jsxs("div",{className:`flex w-full ${s}`,children:[C.map(p=>e.jsx(_r,{value:p.tabId,className:o,children:p.tabName},p.tabId)),N.length>0&&e.jsxs(Se,{children:[e.jsx(Ae,{asChild:!0,children:e.jsx(et,{variant:"outline",size:"sm",className:"mt-1",children:e.jsx(g.EllipsisVertical,{})})}),e.jsx(Te,{children:N.map(p=>e.jsx(ie,{onClick:()=>j(p),children:p.tabName},p.tabId))})]})]}),c&&e.jsx("div",{children:c})]}),t?e.jsx(Rt,{value:y,className:`mt-3 flex-grow overflow-auto h-full w-full ${l}`,children:e.jsx(ut,{className:"h-full w-full p-3",children:t})}):a.map(p=>e.jsx(Rt,{value:p.tabId,className:`mt-3 flex-grow overflow-auto h-full w-full ${l}`,children:e.jsx(ut,{className:"h-full w-full p-3",children:p?.tabContent})},p.tabId))]})}const hn=I.createContext(void 0),bn=({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(hn.Provider,{value:c,children:t})},Ri=()=>{const t=I.useContext(hn);if(!t)throw new Error("useTheme must be used within ThemeProvider");return t};function vn(){const{setTheme:t,theme:a,resolvedTheme:r}=Ri(),[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(Se,{children:[e.jsx(Ae,{asChild:!0,children:e.jsx(_,{variant:"outline",size:"icon","aria-label":"Change theme",title:`Theme: ${a==="system"?`system (${r})`:a}`,children:h})}),e.jsxs(Te,{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 zi({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(jt,{value:a,className:"w-full mt-2 "+(c??"")})]})}function Mi({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(_,{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 Fi({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(_,{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(mt,{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(_,{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(mt,{name:n.iconName})})]},n.id))})]})}function Ei({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 Oi({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 Li={"en-US":ys.enUS},Bi=W.dateFnsLocalizer({format:qe.format,parse:qe.parse,startOfWeek:qe.startOfWeek,getDay:qe.getDay,locales:Li});function Ui({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:Bi,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(Oi,{event:c.event,extraParamsEvent:a}),toolbar:c=>e.jsx(Ei,{...c,extraTools:r,view:n})},style:{height:a?.height||"100%",margin:a?.margin||"0px"}})}const jn=m.createContext(void 0);function wn({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(jn.Provider,{value:{breadcrumbItems:a,addBreadcrumb:n,backBreadcrumb:o,addBreadcrumbItems:s,clearBreadcrumb:l},children:t})}function aa(){const t=m.useContext(jn);if(!t)throw new Error("useBreadcrumb must be used within a BreadcrumbProvider");return t}function Nn(){const{breadcrumbItems:t,backBreadcrumb:a}=aa(),[r,n]=m.useState(!1),[s,o]=m.useState(2),l=Nt(),c=de.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(zr,{children:e.jsxs(Mr,{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(lt,{},"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(Lr,{open:r,onOpenChange:n,children:[e.jsx(Br,{"aria-label":"Toggle Menu",children:e.jsx(Ft,{className:"h-4 w-4"})}),e.jsxs(Wr,{children:[e.jsxs(Gr,{className:"text-left",children:[e.jsx(Hr,{children:"Navigate to"}),e.jsx(Kr,{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(de.Link,{to:u.href?u.href:"#",className:"py-1 text-sm",children:u.title})},f))}),e.jsx($r,{className:"pt-4",children:e.jsx(Vr,{asChild:!0,children:e.jsx(_,{variant:"outline",children:"Close"})})})]})]}):e.jsxs(Se,{open:r,onOpenChange:n,children:[e.jsx(Ae,{className:"flex items-center gap-1","aria-label":"Toggle menu",children:e.jsx(Ft,{className:"h-4 w-4"})}),e.jsx(Te,{align:"start",children:d.hiddenBreadcrumbList.map((u,f)=>e.jsx(ie,{children:u.href?e.jsx(de.Link,{to:u.href?u.href:"#",children:u.title}):e.jsx("span",{children:u.title})},f))})]})}),!l&&e.jsx(lt,{})]}):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(lt,{},"lastsep"+f)]},"last"+f))]},"BreadcrumbList1")},"Breadcrumb1")}function Vi({breadcrumb:t}){const{addBreadcrumb:a}=aa();return m.useEffect(()=>{a(t)},[t]),e.jsx(e.Fragment,{})}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(ue,{control:t,name:a,render:({field:d})=>e.jsxs(me,{className:"",children:[r&&e.jsx(e.Fragment,{children:e.jsx(je,{children:r})}),e.jsxs(J,{children:[e.jsx(X,{asChild:!0,className:"w-full",children:e.jsx(fe,{children:e.jsxs(_,{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(we,{children:s}),e.jsx(xe,{})]})})})}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(ue,{control:t.formControl,name:t.name,render:({field:n})=>e.jsxs(me,{className:"",children:[t.label&&e.jsxs(e.Fragment,{children:[e.jsx(je,{children:t.label}),e.jsx("br",{})]}),e.jsxs(J,{children:[e.jsx(X,{asChild:!0,className:"w-full",children:e.jsx(fe,{children:e.jsxs(_,{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(we,{children:t.formDescription}),e.jsx(xe,{})]})})}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(ue,{control:t,name:a,render:({field:d})=>e.jsxs(me,{children:[r&&e.jsx(e.Fragment,{children:e.jsx(je,{children:r})}),e.jsxs(J,{children:[e.jsx(X,{asChild:!0,className:"w-full",children:e.jsx(fe,{children:e.jsxs(_,{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(we,{children:l}),e.jsx(xe,{})]})})})}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(ue,{control:t,name:s,render:({field:l})=>e.jsxs(me,{children:[a&&e.jsx(je,{children:a}),e.jsx(fe,{children:e.jsx(H,{...l,...o})}),n&&n(l.value),r&&e.jsx(we,{children:r}),e.jsx(xe,{})]})})})}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(ue,{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 pe=O.offsetWidth+4;if(D+pe<=A)D+=pe,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(me,{children:[r&&e.jsx(je,{children:r}),e.jsxs(J,{children:[e.jsx(X,{asChild:!0,className:"w-full",children:e.jsx(fe,{children:e.jsxs(_,{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(we,{children:s}),e.jsx(xe,{})]})}})}function Yi({formControl:t,label:a,formDescription:r,extraFormComponent:n,name:s,...o}){return e.jsx(e.Fragment,{children:e.jsx(ue,{control:t,name:s,render:({field:l})=>e.jsxs(me,{children:[a&&e.jsx(je,{children:a}),e.jsx(fe,{children:e.jsx(Qr,{maxLength:4,...l,children:e.jsxs(Zr,{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(we,{children:r}),e.jsx(xe,{})]})})})}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(ue,{control:t,name:a,render:({field:l})=>e.jsxs(me,{className:n,children:[r&&e.jsx(je,{children:r}),e.jsx(fe,{children:e.jsx(Rr,{...l,...o})}),s&&e.jsx(we,{children:s}),e.jsx(xe,{})]})})})}function Qi({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(Re,{className:"h-8 w-64 rounded-md"}),e.jsx(Re,{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(Re,{className:"h-8 w-full"})},n))})]})}function Zi({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(Re,{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 yn(){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(jt,{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(Yr,{...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(ue,{name:"text",render:({field:b})=>e.jsxs(me,{children:[e.jsx(fe,{children:e.jsx(H,{id:"text-input",type:"text",value:a,onChange:y=>r(y.target.value),placeholder:"Type something..."})}),e.jsx(xe,{})]})})}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(ge,{htmlFor:"file-upload",className:"sr-only",children:"Upload Files"}),e.jsx(_,{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(H,{id:"file-upload",type:"file",multiple:!0,onChange:v,className:"hidden"})]}),e.jsx(_,{variant:"outline",type:"submit",disabled:h,children:e.jsx(g.Send,{})})]})})})})]})})}const Cn=m.createContext(void 0);function kn({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 yt(){const t=m.useContext(Cn);if(!t)throw new Error("useSidebarNav must be used within a SidebarNavProvider");return t}function In(){const{navItems:t}=yt();return e.jsx(jr,{children:e.jsx(wr,{children:t.map(a=>a.items&&a.items.length>0?e.jsx(Fr,{asChild:!0,defaultOpen:a.isActive,className:"group/collapsible",children:e.jsxs(Pt,{children:[e.jsx(Er,{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(Or,{children:e.jsx(Nr,{children:a.items.map(r=>e.jsx(yr,{children:e.jsx(Cr,{asChild:!0,children:e.jsx(de.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(de.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 Sn({...t}){const{navItems:a,header:r,footer:n}=yt();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(In,{})}),n&&e.jsx(br,{children:n}),e.jsx(pr,{})]})}function An(){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:""},el=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`},ce=()=>Z;function Tn(){const{navItems:t}=yt(),{IKON_PLATFORM_UI_URL:a}=ce();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(wt,{orientation:"vertical",className:"mr-2 data-[orientation=vertical]:h-4"}),e.jsx(Nn,{})]}),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(vn,{}),e.jsx(de.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 ft(t){return Vt.get(ra+t)}function Lt(t){Vt.remove(ra+t)}async function tl(){}async function at(t){const a=ft("accessToken"),r=ft("refreshToken");if(a)return a;if(r){const n=await Pn(r,t?.isSetToken);if(n)return n}return null}async function Pn(t,a){try{const r=await fetch(`${ce().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=ce().LOGIN_PAGE_URL)}const Me=ha.create();Me.interceptors.request.use(async t=>{const a=await at();return a&&t.headers&&(t.headers.Authorization=`Bearer ${a}`),t},t=>Promise.reject(t instanceof Error?t:new Error(String(t))));Me.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 at({isSetToken:!0});if(r&&a.headers)return a.headers.Authorization=`Bearer ${r}`,Me(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 al(t){return ze.useQuery({queryKey:["profile",t],queryFn:async()=>{if(!t)throw new Error("No userId");return(await Me.get(`${ce().IKON_USER_API_URL}/${t}`)).data},enabled:!!t})}function rl(){const t=ze.useQueryClient();return ze.useMutation({mutationFn:async a=>{await Me.post(`${ce().IKON_AUTH_API_URL}/switch-account`,{targetAccountId:a})},onSuccess:()=>{t.invalidateQueries({queryKey:["accounts"]}),t.invalidateQueries({queryKey:["profile"]})}})}function nl(){return ze.useQuery({queryKey:["accountMembership"],queryFn:async()=>{const{data:t}=await Me.get(`${ce().IKON_BASE_API_URL}/platform/user/account-membership`);return t}})}function sl(){return ze.useQuery({queryKey:["softwares"],queryFn:async()=>{const{data:t}=await Me.get(`${ce().IKON_BASE_API_URL}/platform/software/accessible/user`);return t}})}const Dn=m.createContext(void 0);function ol({children:t}){const[a,r]=m.useState(null);m.useEffect(()=>{const c=ft("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}=al(n);m.useEffect(()=>{o&&s&&r(c=>({...c,...s}))},[o,s]);const l=c=>{r(d=>({...d,accountName:c}))};return e.jsx(Dn.Provider,{value:{user:a,setUser:r,setAccountName:l},children:t})}function _n(){const t=m.useContext(Dn);if(!t)throw new Error("useUser must be used within a UserProvider");return t}function il(){const{user:t,setUser:a}=_n();return e.jsxs(Se,{children:[e.jsx(Ae,{asChild:!0,children:e.jsx(_,{variant:"ghost",size:"icon",className:"h-10 w-10",children:e.jsx(g.CircleUserRound,{className:"h-8 w-8"})})}),e.jsxs(Te,{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(vt,{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 ll(){const{data:t}=nl(),{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}=rl(),o=async l=>{await s(l.accountId),r(l.accountName)};return e.jsxs(Se,{children:[e.jsx(Ae,{asChild:!0,children:e.jsx(_,{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(Te,{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 cl(){const{IKON_PLATFORM_UI_URL:t}=ce(),{data:a}=sl();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(_,{variant:"ghost",size:"icon",className:"h-10 w-10",asChild:!0,children:e.jsxs(de.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(_,{variant:"ghost",size:"icon",className:"h-10 w-10",asChild:!0,children:e.jsxs(de.Link,{to:n.url??"#",children:[s?e.jsx(mt,{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 Rn=()=>{const{IKON_PLATFORM_UI_URL:t}=ce();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(ll,{}),e.jsx(cl,{}),e.jsxs(te,{children:[e.jsx(ae,{asChild:!0,className:"h-8 w-8",children:e.jsx(_,{variant:"ghost",className:"h-10 w-10",asChild:!0,children:e.jsxs(de.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(il,{})]})})};function zn({children:t}){return e.jsxs(e.Fragment,{children:[e.jsx(Rn,{}),e.jsx(mr,{children:e.jsx(sn,{children:e.jsxs(kn,{children:[e.jsx(Sn,{}),e.jsxs(gr,{className:"flex flex-col h-screen",children:[e.jsx(Tn,{}),e.jsx("div",{className:"flex flex-col gap-4 p-4 pt-0 ml-12 grow overflow-auto scrollbar-hidden",children:t}),e.jsx(An,{})]})]})})})]})}const Mn=m.createContext(void 0);function Fn({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(Mn.Provider,{value:o,children:t})}const dl=()=>{const t=m.useContext(Mn);if(t===void 0)throw new Error("useFont must be used within a FontProvider");return t},En=m.createContext(void 0);function On({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(En.Provider,{value:o,children:t})}const ul=()=>{const t=m.useContext(En);if(t===void 0)throw new Error("useRadius must be used within a RadiusProvider");return t},Ln=m.createContext(void 0);function ml({children:t}){const[a,r]=m.useState(0),n=m.useCallback(()=>{r(s=>s+1)},[]);return e.jsx(Ln.Provider,{value:{refresh:n,refreshCounter:a},children:t})}function fl(){const t=m.useContext(Ln);if(t===void 0)throw new Error("useRefresh must be used within a RefreshProvider");return t}const xl=new ze.QueryClient;function pl({children:t}){return e.jsx(ze.QueryClientProvider,{client:xl,children:t})}function gl({children:t}){const a=ce();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(pl,{children:e.jsx(ol,{children:e.jsx(bn,{children:e.jsx(Fn,{children:e.jsx(On,{children:e.jsx(wn,{children:e.jsx(ml,{children:e.jsx(de.BrowserRouter,{children:e.jsx(zn,{children:t})})})})})})})})})}function hl({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(yn,{})}];return e.jsx(pn,{buttonText:"",buttonIcon:e.jsx(g.AlignJustify,{}),sheetTitle:"",sheetContent:e.jsx(gn,{tabArray:a,tabListClass:""}),closeButton:!0})}const bl=({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})},Bn=m.memo(bl),ua={landscape:4/3,portrait:3/4,icon:1/1};function vl({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(ge,{htmlFor:"imageName",children:"Image Name"}),e.jsx(xn,{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(ge,{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(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(Bn,{src:N,onCroppedImage:l,aspectRatio:ua[c||"icon"],rotationAngle:u,zoomLevel:h,moveDirection:C}):e.jsxs("div",{className:"text-center",children:[e.jsx(ge,{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 Un=m.memo(vl);function Vn({open:t,onOpenChange:a,onCropperChange:r}){const{originalImage:n,aspectRatioWiseImages:s}=na();return e.jsx(gt,{modal:!0,open:t,onOpenChange:o=>{a(o)},children:e.jsxs(ht,{className:"max-w-full lg:max-w-5xl max-h-full overflow-auto",children:[e.jsx(Kt,{children:e.jsx(bt,{children:"Image to upload"})}),e.jsx(Un,{}),e.jsx(Ga,{children:e.jsx(et,{onClick:()=>{r(n,s),a(!1)},children:"Save Changes"})})]})})}async function st(t,a=""){if(!t||!t.resourceId)return null;try{return`${ce().IKON_BASE_API_URL}/platform/file-resource/download/${a}/${t.resourceId}`}catch(r){return console.error("Error getting resource URL:",r),null}}async function jl(t){if(!t)return null;const a=t.originalImageInfo?await st(t.originalImageInfo):null,r=t.landscapeImageInfo?await st(t.landscapeImageInfo):null,n=t.portraitImageInfo?await st(t.portraitImageInfo):null,s=t.iconImageInfo?await st(t.iconImageInfo):null;return{originalImage:{image:a,name:t.imageName,description:t.imageDescription},aspectRatioWiseImages:{landscape:r,portrait:n,icon:s}}}const qn=m.createContext(void 0);function wl({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 jl(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(qn.Provider,{value:{originalImage:c,setOriginalImage:d,aspectRatioWiseImages:o,setAspectRatioWiseImages:l},children:[t,n&&s&&e.jsx(Vn,{open:n,onOpenChange:s,onCropperChange:r})]})}const na=()=>{const t=m.useContext(qn);if(!t)throw new Error("useImageCropper must be used within a ImageCropperProvider");return t},Wn=({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})},Nl=({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})},pe=()=>{b(z=>{const E=z+.2;return E<=2?E:z})},Ee=()=>{b(z=>{const E=z-.2;return E>=.2?E:z})},Pe=(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:`
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({}),[I,j]=m.useState({});t=t.map(T=>(T?.filterFn||(T.filterFn="arrIncludesSome"),T)),m.useEffect(()=>{r?.checkBoxColumnCallback&&r.checkBoxColumnCallback(p.getFilteredSelectedRowModel().rows)},[I]),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:I,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,Pe]=m.useState(!1);return m.useEffect(()=>{Ee||Pe(!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?De.getInstanceByDom(h.current):null,setOption:(v,N)=>{if(!h.current)return;De.getInstanceByDom(h.current)?.setOption(v,N)},resize:(v=0)=>{if(!h.current)return;const N=De.getInstanceByDom(h.current);N?.resize(),v&&setTimeout(()=>N?.resize(),v)},loadingVisible:v=>{if(!h.current)return;const N=De.getInstanceByDom(h.current);v?N?.showLoading():N?.hideLoading()},dispose:()=>{if(!h.current)return;De.getInstanceByDom(h.current)?.dispose()},on:(v,N)=>{if(!h.current)return;De.getInstanceByDom(h.current)?.on(v,N)}})),m.useEffect(()=>{h.current&&(w.current=De.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 ki=(({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:I}=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+I*.5],A=Math.hypot(j-S[0],p-S[1]),D=.5*Math.min(x,I)*a;if(A<D){N.style.setProperty("--active","0");return}const M=j>b-r&&j<b+x+r&&p>y-r&&p<y+I+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,Pe=O+Ee;ot.animate(O,Pe,{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 mt({name:t,...a}){const r=As[t];return r?e.jsx(r,{...a}):(console.warn(`Icon "${t}" not found in lucide-react`),null)}const Ii=({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,I)=>(x?.label??"").localeCompare(I?.label??"")),C=x=>{const I=x.currentTarget;I.scrollTop+=x.deltaY,x.preventDefault()},v=x=>{const I=o.includes(x)?o.filter(j=>j!==x):[...o,x];l(I)},[N,b]=m.useState(o.length),y=m.useCallback(()=>{const x=u.current;if(!x)return N;const I=Array.from(x.children),j=x.offsetWidth;let p=0,S=0;for(const A of I){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 I=null;const j=()=>{I&&cancelAnimationFrame(I),I=requestAnimationFrame(()=>{const S=y();b(A=>A!==S?S:A)})},p=new ResizeObserver(j);return p.observe(x),I=requestAnimationFrame(j),()=>{I&&cancelAnimationFrame(I),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 I=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:I,children:[e.jsx("span",{className:"truncate max-w-[120px]",children:I}),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(I=>I.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 I=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:I,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(jt,{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(ut,{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=Nt(),[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 I=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]}),I(p.tabId)};return e.jsxs(Rr,{value:y,onValueChange:I,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(Se,{children:[e.jsx(Ae,{asChild:!0,children:e.jsx(et,{variant:"outline",size:"sm",className:"mt-1",children:e.jsx(g.EllipsisVertical,{})})}),e.jsx(Te,{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(ut,{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(ut,{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,I,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*I+.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(Se,{children:[e.jsx(Ae,{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(Te,{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(jt,{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]=k.useState(!1),[d,u]=k.useState(""),{flatTree:f,itemMap:h}=t,w=k.useMemo(()=>{const b=new Map,y=new Set(a);return[...f].reverse().forEach(x=>{const I=h[x.id];if(!I||!x.treatAsParent||I.childrenIds.length===0)y.has(x.id)&&b.set(x.id,"checked");else{const j=I.childrenIds.map(A=>b.get(A)),p=j.filter(A=>A==="checked").length,S=j.filter(A=>A==="indeterminate").length;p===I.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),I=!(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))}I?(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=k.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),I=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=>{I(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(mt,{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(mt,{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(Re,{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(Re,{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=Nt(),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(lt,{},"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(Se,{open:r,onOpenChange:n,children:[e.jsx(Ae,{className:"flex items-center gap-1","aria-label":"Toggle menu",children:e.jsx(Ft,{className:"h-4 w-4"})}),e.jsx(Te,{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(lt,{})]}):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(lt,{},"lastsep"+f)]},"last"+f))]},"BreadcrumbList1")},"Breadcrumb1")}function Ui({breadcrumb:t}){const{addBreadcrumb:a}=aa();return m.useEffect(()=>{a(t)},[t]),e.jsx(e.Fragment,{})}function Vi({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 qi(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 Wi({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 Gi(){return e.jsx(e.Fragment,{})}function $i({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 Hi({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 I=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:()=>I(p.value),className:"flex items-center space-x-2 justify-start",children:[e.jsx(Xe,{checked:S,onCheckedChange:()=>I(p.value),onClick:A=>A.stopPropagation()}),e.jsx("span",{children:p.label})]},p.value)})})]})]})})]}),s&&e.jsx(ge,{children:s}),e.jsx(me,{})]})}})}function Ki({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 Yi(){return e.jsx("div",{children:"FormPhoneInput"})}function Ji({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 Xi({formControl:t,label:a,formDescription:r,extraFormComponent:n,name:s,...o}){const[l,c]=k.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 Qi({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(_e,{className:"h-8 w-64 rounded-md"}),e.jsx(_e,{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(_e,{className:"h-8 w-full"})},n))})]})}function Zi({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(_e,{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 Cn(){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 I=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:I.data.url,progress:100}:p))}catch(I){console.error("Upload failed:",I)}};m.useEffect(()=>{const b=new Date,y=String(b.getDate()).padStart(2,"0"),x=String(b.getMonth()+1).padStart(2,"0"),I=b.getFullYear();d(`${y}-${x}-${I}`)},[]),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,I)=>I!==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(jt,{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,I)=>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})},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: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,{})})]})})})})]})})}const kn=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(kn.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 yt(){const t=m.useContext(kn);if(!t)throw new Error("useSidebarNav must be used within a SidebarNavProvider");return t}function Sn(){const{navItems:t}=yt();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 An({...t}){const{navItems:a,header:r,footer:n}=yt();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(Sn,{})}),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:""},el=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}=yt(),{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(wt,{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 ft(t){return Vt.get(ra+t)}function Lt(t){Vt.remove(ra+t)}async function tl(){}async function at(t){const a=ft("accessToken"),r=ft("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 Me=ha.create();Me.interceptors.request.use(async t=>{const a=await at();return a&&t.headers&&(t.headers.Authorization=`Bearer ${a}`),t},t=>Promise.reject(t instanceof Error?t:new Error(String(t))));Me.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 at({isSetToken:!0});if(r&&a.headers)return a.headers.Authorization=`Bearer ${r}`,Me(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 al(t){return ze.useQuery({queryKey:["profile",t],queryFn:async()=>{if(!t)throw new Error("No userId");return(await Me.get(`${fe().IKON_USER_API_URL}/${t}`)).data},enabled:!!t})}function rl(){const t=ze.useQueryClient();return ze.useMutation({mutationFn:async a=>{await Me.post(`${fe().IKON_AUTH_API_URL}/switch-account`,{targetAccountId:a})},onSuccess:()=>{t.invalidateQueries({queryKey:["accounts"]}),t.invalidateQueries({queryKey:["profile"]})}})}function nl(){return ze.useQuery({queryKey:["accountMembership"],queryFn:async()=>{const{data:t}=await Me.get(`${fe().IKON_BASE_API_URL}/platform/user/account-membership`);return t}})}function sl(){return ze.useQuery({queryKey:["softwares"],queryFn:async()=>{const{data:t}=await Me.get(`${fe().IKON_BASE_API_URL}/platform/software/accessible/user`);return t}})}const Rn=m.createContext(void 0);function ol({children:t}){const[a,r]=m.useState(null);m.useEffect(()=>{const c=ft("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}=al(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 il(){const{user:t,setUser:a}=_n();return e.jsxs(Se,{children:[e.jsx(Ae,{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(Te,{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(vt,{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 ll(){const{data:t}=nl(),{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}=rl(),o=async l=>{await s(l.accountId),r(l.accountName)};return e.jsxs(Se,{children:[e.jsx(Ae,{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(Te,{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 cl(){const{IKON_PLATFORM_UI_URL:t}=fe(),{data:a}=sl();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(mt,{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(ll,{}),e.jsx(cl,{}),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(il,{})]})})};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 dl=()=>{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 ul=()=>{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 ml({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 fl(){const t=m.useContext(Bn);if(t===void 0)throw new Error("useRefresh must be used within a RefreshProvider");return t}const xl=new ze.QueryClient;function pl({children:t}){return e.jsx(ze.QueryClientProvider,{client:xl,children:t})}function gl({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(pl,{children:e.jsx(ol,{children:e.jsx(Ir,{children:e.jsx(En,{children:e.jsx(Ln,{children:e.jsx(Nn,{children:e.jsx(ml,{children:e.jsx(xe.BrowserRouter,{children:e.jsx(Mn,{children:t})})})})})})})})})}function hl({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(Cn,{})}];return e.jsx(bn,{buttonText:"",buttonIcon:e.jsx(g.AlignJustify,{}),sheetTitle:"",sheetContent:e.jsx(vn,{tabArray:a,tabListClass:""}),closeButton:!0})}const bl=({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(bl),ua={landscape:4/3,portrait:3/4,icon:1/1};function vl({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 I=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(Re,{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(Re,{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(Re,{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(Re,{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:I("landscape")}),e.jsx("div",{className:"w-4/5",children:I("portrait")}),e.jsx("div",{className:"w-3/5",children:I("icon")})]})]})]})})}const Vn=m.memo(vl);function qn({open:t,onOpenChange:a,onCropperChange:r}){const{originalImage:n,aspectRatioWiseImages:s}=na();return e.jsx(gt,{modal:!0,open:t,onOpenChange:o=>{a(o)},children:e.jsxs(ht,{className:"max-w-full lg:max-w-5xl max-h-full overflow-auto",children:[e.jsx(Kt,{children:e.jsx(bt,{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 st(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 jl(t){if(!t)return null;const a=t.originalImageInfo?await st(t.originalImageInfo):null,r=t.landscapeImageInfo?await st(t.landscapeImageInfo):null,n=t.portraitImageInfo?await st(t.portraitImageInfo):null,s=t.iconImageInfo?await st(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 wl({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 jl(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})},Nl=({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}),[I,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})},Pe=(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
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(ge,{htmlFor:"imageName",children:"Image Name"}),e.jsx(H,{id:"imageName",placeholder:"Enter image name",value:k,onChange:z=>j(z.target.value)})]}),e.jsxs("div",{className:"self-end",children:[e.jsx(_,{variant:"outline",onClick:()=>document.getElementById("inputImage1")?.click(),children:e.jsx(g.Upload,{})}),e.jsx(H,{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(Kn=>Kn||E.name)},Ve.readAsDataURL(E),d({first:null,second:null,third:null})}}})]}),e.jsxs("div",{className:"flex-1",children:[e.jsx(ge,{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:P,onDragOver:z=>z.preventDefault(),children:n?e.jsx(Wn,{imageSrc:n,onCroppedImage:l,aspectRatio:u,rotationAngle:C,zoomLevel:N,moveDirection:y,currentState:h}):e.jsxs("div",{className:"text-center",children:[e.jsx(ge,{htmlFor:"inputImage",children:"Drag and drop an image here"}),e.jsxs("div",{className:"mt-4",children:[e.jsx(_,{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 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(_,{variant:"outline",onClick:()=>Pe(4/3,"first"),children:e.jsx(g.ImageIcon,{})}),e.jsx(_,{variant:"outline",onClick:()=>Pe(3/4,"second"),children:e.jsx(g.FileImage,{})}),e.jsx(_,{variant:"outline",onClick:()=>Pe(1/1,"third"),children:e.jsx(g.Square,{})})]}),e.jsxs("div",{children:[e.jsx(_,{onClick:()=>S(90),variant:"outline",children:e.jsx(g.RotateCw,{})}),e.jsx(_,{onClick:()=>S(-90),variant:"outline",children:e.jsx(g.RotateCcw,{})})]}),e.jsxs("div",{children:[e.jsx(_,{onClick:()=>pe(),variant:"outline",children:e.jsx(g.ZoomIn,{})}),e.jsx(_,{onClick:()=>Ee(),variant:"outline",children:e.jsx(g.ZoomOut,{})})]}),e.jsxs("div",{children:[e.jsx(_,{onClick:A,variant:"outline",children:e.jsx(g.ArrowUp,{})}),e.jsx(_,{onClick:D,variant:"outline",children:e.jsx(g.ArrowDown,{})}),e.jsx(_,{onClick:M,variant:"outline",children:e.jsx(g.ArrowLeft,{})}),e.jsx(_,{onClick:O,variant:"outline",children:e.jsx(g.ArrowRight,{})})]})]}),e.jsx("div",{className:"w-2/5 flex flex-row-reverse",children:e.jsx(_,{onClick:p,children:"Save"})})]})]})},yl=m.memo(Nl);function Cl(){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(ue,{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(pe=>pe.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(me,{className:i(c),children:[r&&e.jsxs(e.Fragment,{children:[e.jsx(je,{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(fe,{children:e.jsxs(_,{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(H,{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(_,{size:"sm",variant:"ghost",onClick:()=>{x(!1),j("")},className:"h-8",children:"Cancel"}),e.jsx(_,{size:"sm",variant:"default",onClick:A,className:"h-8",disabled:!k.trim()||N.some(D=>D.value===k.trim()),children:"Add"})]}):e.jsxs(_,{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(we,{children:u}),e.jsx(xe,{})]})}})}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(_,{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 Il=()=>e.jsx(It.MarkdownTextPrimitive,{remarkPlugins:[Is],className:"aui-md",components:Pl}),Sl=m.memo(Il),Al=({language:t,code:a})=>{const{isCopied:r,copyToClipboard:n}=Tl(),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,{})]})]})},Tl=({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)})}}},Pl=It.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=It.useIsMarkdownCodeBlock();return e.jsx("code",{className:i(!n&&"aui-md-inline-code rounded border bg-muted font-semibold",a),...r})},CodeHeader:Al}),Dl=({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(_,{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 Rl(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 zl(t){const a=m.useRef(void 0);return r=>{const n=t(r);return Rl(a.current,n)?a.current:a.current=n}}const Ml=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},Gn=()=>{const{file:t,src:a}=R.useAssistantState(zl(({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 Ml(t)??a},Fl=({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"})},El=({children:t})=>{const a=Gn();return a?e.jsxs(gt,{children:[e.jsx(Va,{className:"aui-attachment-preview-trigger cursor-pointer transition-colors hover:bg-accent/50",asChild:!0,children:t}),e.jsxs(ht,{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(bt,{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(Fl,{src:a})})]})]}):t},Ol=()=>{const t=R.useAssistantState(({attachment:r})=>r.type==="image"),a=Gn();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"})})]})},$n=()=>{const a=R.useAssistantApi().attachment.source==="composer",r=R.useAssistantState(({attachment:s})=>s.type==="image"),n=R.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(R.AttachmentPrimitive.Root,{className:i("aui-attachment-root relative",r&&"aui-attachment-root-composer only:[&>#attachment-tile]:size-24"),children:[e.jsx(El,{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(Ol,{})})})}),a&&e.jsx(Ll,{})]}),e.jsx(re,{side:"top",children:e.jsx(R.AttachmentPrimitive.Name,{})})]})},Ll=()=>e.jsx(R.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]"})})}),Bl=()=>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(R.MessagePrimitive.Attachments,{components:{Attachment:$n}})}),Ul=()=>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(R.ComposerPrimitive.Attachments,{components:{Attachment:$n}})}),Vl=()=>e.jsx(R.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]"})})}),ql=({agents:t,selectedAgent:a,onSelectAgent:r,className:n,triggerClassName:s})=>{const[o,l]=m.useState(!1),c=a||null;return e.jsxs(Se,{open:o,onOpenChange:l,children:[e.jsx(Ae,{asChild:!0,children:e.jsxs(_,{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(Te,{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(vt,{}),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"})})]})},Wl=({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(ot.LazyMotion,{features:ot.domAnimation,children:e.jsx(ot.MotionConfig,{reducedMotion:"user",children:e.jsx(R.ThreadPrimitive.Root,{className:"aui-root aui-thread-root @container flex h-full flex-col bg-background",style:{"--thread-max-width":"44rem"},children:e.jsxs(R.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(R.ThreadPrimitive.If,{empty:!0,children:e.jsx($l,{currentUserDetails:t})}),e.jsx(R.ThreadPrimitive.Messages,{components:{UserMessage:Zl,EditComposer:tc,AssistantMessage:Xl}}),e.jsxs(R.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(Gl,{}),e.jsx(Kl,{agents:a,selectedAgent:o,onSelectAgent:c=>{l(c),s?.(c)}})]})]})})})})},Gl=()=>e.jsx(R.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,{})})}),$l=({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(Hl,{})]})},Hl=()=>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(R.ThreadPrimitive.Suggestion,{prompt:t.action,send:!0,asChild:!0,children:e.jsxs(_,{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}`))}),Kl=({agents:t=[],selectedAgent:a,onSelectAgent:r})=>e.jsx(R.ComposerPrimitive.Root,{className:"aui-composer-root relative flex w-full flex-col",children:e.jsxs(R.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(Ul,{}),e.jsx(R.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(Yl,{agents:t,selectedAgent:a,onSelectAgent:r})]})}),Yl=({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(Vl,{}),e.jsxs("div",{className:"flex gap-3",children:[t.length>0&&e.jsx(ql,{agents:t,selectedAgent:a,onSelectAgent:r??(()=>{}),triggerClassName:"h-9 text-xs"}),e.jsx(R.ThreadPrimitive.If,{running:!1,children:e.jsx(R.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(R.ThreadPrimitive.If,{running:!0,children:e.jsx(R.ComposerPrimitive.Cancel,{asChild:!0,children:e.jsx(_,{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"})})})})]})]}),Jl=()=>e.jsx(R.MessagePrimitive.Error,{children:e.jsx(R.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(R.ErrorPrimitive.Message,{className:"aui-message-error-message line-clamp-2"})})}),Xl=()=>e.jsxs(R.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(R.MessagePrimitive.Parts,{components:{Text:Sl,tools:{Fallback:Dl}}}),e.jsx(Jl,{})]}),e.jsxs("div",{className:"aui-assistant-message-footer mt-2 ml-2 flex",children:[e.jsx(Hn,{}),e.jsx(Ql,{})]})]}),Ql=()=>e.jsxs(R.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(R.ActionBarPrimitive.Copy,{asChild:!0,children:e.jsxs(le,{tooltip:"Copy",children:[e.jsx(R.MessagePrimitive.If,{copied:!0,children:e.jsx(g.CheckIcon,{})}),e.jsx(R.MessagePrimitive.If,{copied:!1,children:e.jsx(g.CopyIcon,{})})]})}),e.jsx(R.ActionBarPrimitive.Reload,{asChild:!0,children:e.jsx(le,{tooltip:"Refresh",children:e.jsx(g.RefreshCwIcon,{})})})]}),Zl=()=>e.jsxs(R.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(Bl,{}),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(R.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(ec,{})})]}),e.jsx(Hn,{className:"aui-user-branch-picker col-span-full col-start-1 row-start-3 -mr-1 justify-end"})]}),ec=()=>e.jsx(R.ActionBarPrimitive.Root,{hideWhenRunning:!0,autohide:"not-last",className:"aui-user-action-bar-root flex flex-col items-end",children:e.jsx(R.ActionBarPrimitive.Edit,{asChild:!0,children:e.jsx(le,{tooltip:"Edit",className:"aui-user-action-edit p-4",children:e.jsx(g.PencilIcon,{})})})}),tc=()=>e.jsx(R.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(R.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(R.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(R.ComposerPrimitive.Cancel,{asChild:!0,children:e.jsx(_,{variant:"ghost",size:"sm","aria-label":"Cancel edit",children:"Cancel"})}),e.jsx(R.ComposerPrimitive.Send,{asChild:!0,children:e.jsx(_,{size:"sm","aria-label":"Update message",children:"Update"})})]})]})}),Hn=({className:t,...a})=>e.jsxs(R.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(R.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(R.BranchPickerPrimitive.Number,{})," / ",e.jsx(R.BranchPickerPrimitive.Count,{})]}),e.jsx(R.BranchPickerPrimitive.Next,{asChild:!0,children:e.jsx(le,{tooltip:"Next",children:e.jsx(g.ChevronRightIcon,{})})})]});class ac{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 at()}`,...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 rc=({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 ac({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 at(),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(R.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(Wl,{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=hl;exports.Alert=oo;exports.AlertDescription=lo;exports.AlertDialog=Ia;exports.AlertDialogAction=Tt;exports.AlertDialogCancel=za;exports.AlertDialogContent=Ta;exports.AlertDialogDescription=Ra;exports.AlertDialogFooter=Da;exports.AlertDialogHeader=Pa;exports.AlertDialogMedia=no;exports.AlertDialogOverlay=Aa;exports.AlertDialogPortal=Sa;exports.AlertDialogTitle=_a;exports.AlertDialogTrigger=ro;exports.AlertTitle=io;exports.AppBreadcrumb=Nn;exports.AppSidebar=Sn;exports.AspectRatio=zt;exports.AssistantComponent=rc;exports.Avatar=Ma;exports.AvatarBadge=co;exports.AvatarFallback=Ea;exports.AvatarGroup=uo;exports.AvatarGroupCount=mo;exports.AvatarImage=Fa;exports.Badge=it;exports.BigCalendar=Ui;exports.Breadcrumb=zr;exports.BreadcrumbEllipsis=Ft;exports.BreadcrumbItem=Le;exports.BreadcrumbLink=Mt;exports.BreadcrumbList=Mr;exports.BreadcrumbPage=Ge;exports.BreadcrumbProvider=wn;exports.BreadcrumbSeparator=lt;exports.Button=_;exports.Calendar=La;exports.CalendarDayButton=Ba;exports.Card=ut;exports.CardAction=go;exports.CardContent=Ua;exports.CardDescription=po;exports.CardFooter=ho;exports.CardHeader=fo;exports.CardTitle=xo;exports.Checkbox=Xe;exports.Collapsible=Fr;exports.CollapsibleContent=Or;exports.CollapsibleTrigger=Er;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=Un;exports.CropperFormWithModal=Vn;exports.CustomAlertDialog=rn;exports.CustomComboboxInput=kl;exports.CustomTabs=gn;exports.DataTable=Ni;exports.DataTableColumnFilter=on;exports.DataTableFacetedFilter=ln;exports.DataTableFilterMenu=cn;exports.DataTablePagination=un;exports.DataTableToolbar=fn;exports.Dialog=gt;exports.DialogClose=bo;exports.DialogContent=ht;exports.DialogDescription=$a;exports.DialogFooter=Ga;exports.DialogHeader=Kt;exports.DialogOverlay=Wa;exports.DialogPortal=qa;exports.DialogProvider=sn;exports.DialogTitle=bt;exports.DialogTrigger=Va;exports.Drawer=Lr;exports.DrawerClose=Vr;exports.DrawerContent=Wr;exports.DrawerDescription=Kr;exports.DrawerFooter=$r;exports.DrawerHeader=Gr;exports.DrawerOverlay=qr;exports.DrawerPortal=Ur;exports.DrawerTitle=Hr;exports.DrawerTrigger=Br;exports.DropdownMenu=Se;exports.DropdownMenuCheckboxItem=wo;exports.DropdownMenuContent=Te;exports.DropdownMenuGroup=Yt;exports.DropdownMenuItem=ie;exports.DropdownMenuLabel=Jt;exports.DropdownMenuPortal=Ka;exports.DropdownMenuRadioGroup=No;exports.DropdownMenuRadioItem=yo;exports.DropdownMenuSeparator=vt;exports.DropdownMenuShortcut=Co;exports.DropdownMenuSub=Ya;exports.DropdownMenuSubContent=Xa;exports.DropdownMenuSubTrigger=Ja;exports.DropdownMenuTrigger=Ae;exports.EChart=Ci;exports.FileInput=xn;exports.FileUploader=vi;exports.FontProvider=Fn;exports.Footer=An;exports.Form=Yr;exports.FormComboboxInput=qi;exports.FormComboboxInputWithValue=Wi;exports.FormControl=fe;exports.FormDateInput=Gi;exports.FormDescription=we;exports.FormField=ue;exports.FormFileInput=$i;exports.FormInput=Hi;exports.FormItem=me;exports.FormLabel=je;exports.FormMessage=xe;exports.FormMultiComboboxInput=Ki;exports.FormOtpInput=Yi;exports.FormPhoneInput=Ji;exports.FormTextarea=Xi;exports.FrameworkItemDropdown=Mi;exports.GlowingEffect=ki;exports.GradeTableLoader=Qi;exports.Header=Tn;exports.HoverCard=ko;exports.HoverCardContent=So;exports.HoverCardTrigger=Io;exports.Icon=mt;exports.IconButton=an;exports.IconButtonWithTooltip=Ne;exports.IconTextButton=tt;exports.IconTextButtonWithTooltip=tn;exports.ImageCropper=Bn;exports.ImageCropperProvider=wl;exports.Input=H;exports.InputOTP=Qr;exports.InputOTPGroup=Zr;exports.InputOTPSeparator=xi;exports.InputOTPSlot=$e;exports.Label=ge;exports.LoadingSpinner=Ii;exports.MainLayout=zn;exports.MainSidebar=Rn;exports.MultiCombobox=Si;exports.NavMain=In;exports.NavigationMenu=Ao;exports.NavigationMenuContent=_o;exports.NavigationMenuIndicator=zo;exports.NavigationMenuItem=Po;exports.NavigationMenuLink=Ro;exports.NavigationMenuList=To;exports.NavigationMenuTrigger=Do;exports.NavigationMenuViewport=Za;exports.NewCropperImg=Wn;exports.NewImageForm=yl;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=jt;exports.ProviderWrapper=gl;exports.RadioGroup=Lo;exports.RadioGroupItem=Bo;exports.RadiusProvider=On;exports.RenderAppBreadcrumb=Vi;exports.ScrollArea=Uo;exports.ScrollBar=er;exports.SearchInput=mn;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=wt;exports.Sheet=Xt;exports.SheetClose=Go;exports.SheetComponent=pn;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=kn;exports.SidebarProvider=mr;exports.SidebarRail=pr;exports.SidebarSeparator=ai;exports.SidebarTrigger=xr;exports.SimpleWidget=_i;exports.Skeleton=Re;exports.SkeletonWidget=Zi;exports.Slider=di;exports.Switch=mi;exports.Table=kr;exports.TableBody=Sr;exports.TableCaption=fi;exports.TableCell=We;exports.TableFooter=Ar;exports.TableHead=_t;exports.TableHeader=Ir;exports.TableRow=Oe;exports.Tabs=Tr;exports.TabsContent=Rt;exports.TabsList=Dr;exports.TabsTrigger=_r;exports.TextButton=et;exports.TextButtonWithTooltip=gi;exports.Textarea=Rr;exports.ThemeProvider=bn;exports.ThemeToggleBtn=vn;exports.TitleProgress=zi;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=yn;exports.Widgets=Fi;exports.WorkInProgress=Cl;exports.badgeVariants=Oa;exports.buttonVariants=dt;exports.clearAllCookieSession=tl;exports.clearCookieSession=Lt;exports.cn=i;exports.convertFileToObject=dn;exports.getCookieSession=ft;exports.getDataTableColumnTitle=he;exports.getImageFromObject=ji;exports.getValidAccessToken=at;exports.navigationMenuTriggerStyle=Qa;exports.refreshAccessToken=Pn;exports.setCookieSession=Ot;exports.setIkonConfig=el;exports.tabsListVariants=Pr;exports.toggleVariants=ea;exports.useBreadcrumb=aa;exports.useDialog=hi;exports.useFont=dl;exports.useFormField=Ze;exports.useImageCropper=na;exports.useIsMobile=Nt;exports.useRadius=ul;exports.useRefresh=fl;exports.useSidebar=Qe;exports.useSidebarNav=yt;
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:I,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:()=>Pe(4/3,"first"),children:e.jsx(g.ImageIcon,{})}),e.jsx(R,{variant:"outline",onClick:()=>Pe(3/4,"second"),children:e.jsx(g.FileImage,{})}),e.jsx(R,{variant:"outline",onClick:()=>Pe(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"})})]})]})},yl=m.memo(Nl);function Cl(){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]=k.useState(!1),[C,v]=k.useState(""),[N,b]=k.useState(n),[y,x]=k.useState(!1),[I,j]=k.useState("");return k.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=I.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:I,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:!I.trim()||N.some(D=>D.value===I.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 Il=()=>e.jsx(It.MarkdownTextPrimitive,{remarkPlugins:[Is],className:"aui-md",components:Pl}),Sl=m.memo(Il),Al=({language:t,code:a})=>{const{isCopied:r,copyToClipboard:n}=Tl(),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,{})]})]})},Tl=({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)})}}},Pl=It.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=It.useIsMarkdownCodeBlock();return e.jsx("code",{className:i(!n&&"aui-md-inline-code rounded border bg-muted font-semibold",a),...r})},CodeHeader:Al}),Dl=({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},Rl=(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 _l(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):Rl(t,a):xa({entries:()=>Object.entries(t)},{entries:()=>Object.entries(a)})}function zl(t){const a=m.useRef(void 0);return r=>{const n=t(r);return _l(a.current,n)?a.current:a.current=n}}const Ml=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(zl(({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 Ml(t)??a},Fl=({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"})},El=({children:t})=>{const a=$n();return a?e.jsxs(gt,{children:[e.jsx(Va,{className:"aui-attachment-preview-trigger cursor-pointer transition-colors hover:bg-accent/50",asChild:!0,children:t}),e.jsxs(ht,{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(bt,{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(Fl,{src:a})})]})]}):t},Ol=()=>{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(El,{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(Ol,{})})})}),a&&e.jsx(Ll,{})]}),e.jsx(re,{side:"top",children:e.jsx(_.AttachmentPrimitive.Name,{})})]})},Ll=()=>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]"})})}),Bl=()=>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}})}),Ul=()=>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}})}),Vl=()=>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]"})})}),ql=({agents:t,selectedAgent:a,onSelectAgent:r,className:n,triggerClassName:s})=>{const[o,l]=m.useState(!1),c=a||null;return e.jsxs(Se,{open:o,onOpenChange:l,children:[e.jsx(Ae,{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(Te,{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(vt,{}),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"})})]})},Wl=({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(ot.LazyMotion,{features:ot.domAnimation,children:e.jsx(ot.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($l,{currentUserDetails:t})}),e.jsx(_.ThreadPrimitive.Messages,{components:{UserMessage:Zl,EditComposer:tc,AssistantMessage:Xl}}),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(Gl,{}),e.jsx(Kl,{agents:a,selectedAgent:o,onSelectAgent:c=>{l(c),s?.(c)}})]})]})})})})},Gl=()=>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,{})})}),$l=({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(Hl,{})]})},Hl=()=>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}`))}),Kl=({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(Ul,{}),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(Yl,{agents:t,selectedAgent:a,onSelectAgent:r})]})}),Yl=({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(Vl,{}),e.jsxs("div",{className:"flex gap-3",children:[t.length>0&&e.jsx(ql,{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"})})})})]})]}),Jl=()=>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"})})}),Xl=()=>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:Sl,tools:{Fallback:Dl}}}),e.jsx(Jl,{})]}),e.jsxs("div",{className:"aui-assistant-message-footer mt-2 ml-2 flex",children:[e.jsx(Kn,{}),e.jsx(Ql,{})]})]}),Ql=()=>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,{})})})]}),Zl=()=>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(Bl,{}),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(ec,{})})]}),e.jsx(Kn,{className:"aui-user-branch-picker col-span-full col-start-1 row-start-3 -mr-1 justify-end"})]}),ec=()=>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,{})})})}),tc=()=>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 ac{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 at()}`,...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 I=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})),I={type:"text-delta",delta:j.content,id:f})}else if(x.type==="tool"){const j=x.toolCall;j&&(I={type:"tool-input-available",toolCallId:j.callId,toolName:j.name,input:j.result})}I&&l.push(I)}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 rc=({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 ac({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 I=await at(),j=await fetch(`${c}/api/agent/${u}`,{method:"GET",headers:{"Content-Type":"application/json",Authorization:`Bearer ${I}`}});if(!j.ok)throw new Error(`HTTP error! status: ${j.status}`);const p=await j.json();console.log("Agent Data:",p),w(p)}catch(I){console.error("Error while fetching agents with the specific appId",I)}};m.useEffect(()=>{y()},[u,c]);const x=I=>{v(I),console.log("Agent changed to:",I.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(Wl,{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=hl;exports.Alert=oo;exports.AlertDescription=lo;exports.AlertDialog=Ia;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=rc;exports.Avatar=Ma;exports.AvatarBadge=co;exports.AvatarFallback=Ea;exports.AvatarGroup=uo;exports.AvatarGroupCount=mo;exports.AvatarImage=Fa;exports.Badge=it;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=lt;exports.Button=R;exports.Calendar=La;exports.CalendarDayButton=Ba;exports.Card=ut;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=gt;exports.DialogClose=bo;exports.DialogContent=ht;exports.DialogDescription=$a;exports.DialogFooter=Ga;exports.DialogHeader=Kt;exports.DialogOverlay=Wa;exports.DialogPortal=qa;exports.DialogProvider=cn;exports.DialogTitle=bt;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=Se;exports.DropdownMenuCheckboxItem=wo;exports.DropdownMenuContent=Te;exports.DropdownMenuGroup=Yt;exports.DropdownMenuItem=ie;exports.DropdownMenuLabel=Jt;exports.DropdownMenuPortal=Ka;exports.DropdownMenuRadioGroup=No;exports.DropdownMenuRadioItem=yo;exports.DropdownMenuSeparator=vt;exports.DropdownMenuShortcut=Co;exports.DropdownMenuSub=Ya;exports.DropdownMenuSubContent=Xa;exports.DropdownMenuSubTrigger=Ja;exports.DropdownMenuTrigger=Ae;exports.EChart=Ci;exports.FileInput=hn;exports.FileUploader=ji;exports.FontProvider=En;exports.Footer=Tn;exports.Form=Qr;exports.FormComboboxInput=Vi;exports.FormComboboxInputWithValue=qi;exports.FormControl=ue;exports.FormDateInput=Wi;exports.FormDescription=ge;exports.FormField=ce;exports.FormFileInput=Gi;exports.FormInput=$i;exports.FormItem=de;exports.FormLabel=pe;exports.FormMessage=me;exports.FormMultiComboboxInput=Hi;exports.FormOtpInput=Ki;exports.FormPasswordInput=Xi;exports.FormPhoneInput=Yi;exports.FormTextarea=Ji;exports.FrameworkItemDropdown=zi;exports.GlowingEffect=ki;exports.GradeTableLoader=Qi;exports.Header=Pn;exports.HoverCard=ko;exports.HoverCardContent=So;exports.HoverCardTrigger=Io;exports.Icon=mt;exports.IconButton=sn;exports.IconButtonWithTooltip=Ne;exports.IconTextButton=tt;exports.IconTextButtonWithTooltip=nn;exports.ImageCropper=Un;exports.ImageCropperProvider=wl;exports.Input=$;exports.InputOTP=tn;exports.InputOTPGroup=an;exports.InputOTPSeparator=xi;exports.InputOTPSlot=$e;exports.Label=be;exports.LoadingSpinner=Ii;exports.MainLayout=Mn;exports.MainSidebar=zn;exports.MultiCombobox=Si;exports.NavMain=Sn;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=yl;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=jt;exports.ProviderWrapper=gl;exports.RadioGroup=Lo;exports.RadioGroupItem=Bo;exports.RadiusProvider=Ln;exports.RenderAppBreadcrumb=Ui;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=wt;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=_e;exports.SkeletonWidget=Zi;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=Ir;exports.ThemeToggleBtn=jn;exports.TitleProgress=_i;exports.Toaster=ui;exports.Toggle=pi;exports.ToggleGroup=Re;exports.ToggleGroupItem=U;exports.Tooltip=te;exports.TooltipComponent=Ce;exports.TooltipContent=re;exports.TooltipProvider=ye;exports.TooltipTrigger=ae;exports.UploadTab=Cn;exports.Widgets=Mi;exports.WorkInProgress=Cl;exports.badgeVariants=Oa;exports.buttonVariants=dt;exports.clearAllCookieSession=tl;exports.clearCookieSession=Lt;exports.cn=i;exports.convertFileToObject=fn;exports.getCookieSession=ft;exports.getDataTableColumnTitle=ve;exports.getImageFromObject=vi;exports.getValidAccessToken=at;exports.navigationMenuTriggerStyle=Qa;exports.refreshAccessToken=Dn;exports.setCookieSession=Ot;exports.setIkonConfig=el;exports.tabsListVariants=_r;exports.toggleVariants=ea;exports.useBreadcrumb=aa;exports.useDialog=hi;exports.useFont=dl;exports.useFormField=Ze;exports.useImageCropper=na;exports.useIsMobile=Nt;exports.useRadius=ul;exports.useRefresh=fl;exports.useSidebar=Qe;exports.useSidebarNav=yt;