ikon-react-components-lib 1.0.6 → 1.0.7

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"),f=require("lucide-react"),ns=require("@radix-ui/react-accordion"),ss=require("clsx"),os=require("tailwind-merge"),is=require("@radix-ui/react-alert-dialog"),W=require("class-variance-authority"),ls=require("@radix-ui/react-aspect-ratio"),ds=require("@radix-ui/react-avatar"),cs=require("@radix-ui/react-checkbox"),us=require("@radix-ui/react-dialog"),ms=require("@radix-ui/react-dropdown-menu"),xs=require("@radix-ui/react-hover-card"),fs=require("@radix-ui/react-label"),gs=require("@radix-ui/react-navigation-menu"),ps=require("@radix-ui/react-popover"),hs=require("@radix-ui/react-progress"),bs=require("@radix-ui/react-radio-group"),vs=require("@radix-ui/react-scroll-area"),js=require("@radix-ui/react-select"),ws=require("@radix-ui/react-separator"),Ns=require("@radix-ui/react-slider"),Yt=require("@radix-ui/react-slot"),ys=require("@radix-ui/react-switch"),Cs=require("@radix-ui/react-tabs"),Ss=require("@radix-ui/react-toggle"),ks=require("@radix-ui/react-toggle-group"),Is=require("@radix-ui/react-tooltip"),m=require("react"),zt=require("react-day-picker"),$e=require("cmdk"),Ca=require("sonner");require("react-dom");const Me=require("vaul"),Ke=require("react-hook-form"),Sa=require("input-otp"),E=require("@tanstack/react-table"),Le=require("echarts"),pt=require("motion/react"),As=require("zxcvbn"),Ds=require("countries-list"),Ps=require("country-flag-icons/react/3x2"),Xe=require("date-fns"),q=require("react-big-calendar");require("react-big-calendar/lib/css/react-big-calendar.css");const Ts=require("date-fns/locale"),ue=require("react-router"),ka=require("axios"),Qt=require("js-cookie"),Rs=require("jwt-decode"),Ue=require("@tanstack/react-query"),Ia=require("react-cropper"),_=require("@assistant-ui/react"),_s=require("motion/react-m"),Ft=require("@assistant-ui/react-markdown"),zs=require("remark-gfm"),Fs=require("@assistant-ui/react-ai-sdk"),fa=require("uuid"),Ms=require("xlsx"),ae=require("react-router-dom"),Es=require("use-debounce");function L(t){const a=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const r in t)if(r!=="default"){const n=Object.getOwnPropertyDescriptor(t,r);Object.defineProperty(a,r,n.get?n:{enumerable:!0,get:()=>t[r]})}}return a.default=t,Object.freeze(a)}const Ls=L(f),et=L(ns),Ie=L(is),Os=L(ls),Jt=L(ds),ga=L(cs),U=L(us),$=L(ms),vt=L(xs),Bs=L(fs),Ee=L(gs),tt=L(ps),pa=L(hs),Mt=L(bs),Ze=L(vs),K=L(js),Us=L(ws),mt=L(Ns),Ae=L(Yt),ha=L(ys),Ct=L(Cs),Vs=L(Ss),Aa=L(ks),He=L(Is),A=L(m),$s=L(Ps),Et=L(_s),xt=L(Ms);function l(...t){return os.twMerge(ss.clsx(t))}function Gs({...t}){return e.jsx(et.Root,{"data-slot":"accordion",...t})}function qs({className:t,...a}){return e.jsx(et.Item,{"data-slot":"accordion-item",className:l("border-b last:border-b-0",t),...a})}function Ws({className:t,children:a,...r}){return e.jsx(et.Header,{className:"flex",children:e.jsxs(et.Trigger,{"data-slot":"accordion-trigger",className:l("focus-visible:border-ring focus-visible:ring-ring/50 flex flex-1 items-start justify-between gap-4 rounded-md py-4 text-left text-sm font-medium transition-all outline-none hover:underline focus-visible:ring-[3px] disabled:pointer-events-none disabled:opacity-50 [&[data-state=open]>svg]:rotate-180",t),...r,children:[a,e.jsx(f.ChevronDownIcon,{className:"text-muted-foreground pointer-events-none size-4 shrink-0 translate-y-0.5 transition-transform duration-200"})]})})}function Hs({className:t,children:a,...r}){return e.jsx(et.Content,{"data-slot":"accordion-content",className:"data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down overflow-hidden text-sm",...r,children:e.jsx("div",{className:l("pt-0 pb-4",t),children:a})})}function Ks(t,a,{checkForDefaultPrevented:r=!0}={}){return function(s){if(t?.(s),r===!1||!s.defaultPrevented)return a?.(s)}}function Xs(t,a=[]){let r=[];function n(o,i){const d=A.createContext(i),u=r.length;r=[...r,i];const c=g=>{const{scope:w,children:N,...v}=g,C=w?.[t]?.[u]||d,b=A.useMemo(()=>v,Object.values(v));return e.jsx(C.Provider,{value:b,children:N})};c.displayName=o+"Provider";function x(g,w){const N=w?.[t]?.[u]||d,v=A.useContext(N);if(v)return v;if(i!==void 0)return i;throw new Error(`\`${g}\` must be used within \`${o}\``)}return[c,x]}const s=()=>{const o=r.map(i=>A.createContext(i));return function(d){const u=d?.[t]||o;return A.useMemo(()=>({[`__scope${t}`]:{...d,[t]:u}}),[d,u])}};return s.scopeName=t,[n,Ys(s,...a)]}function Ys(...t){const a=t[0];if(t.length===1)return a;const r=()=>{const n=t.map(s=>({useScope:s(),scopeName:s.scopeName}));return function(o){const i=n.reduce((d,{useScope:u,scopeName:c})=>{const g=u(o)[`__scope${c}`];return{...d,...g}},{});return A.useMemo(()=>({[`__scope${a.scopeName}`]:i}),[i])}};return r.scopeName=a.scopeName,r}var at=globalThis?.document?A.useLayoutEffect:()=>{},Qs=A[" useInsertionEffect ".trim().toString()]||at;function Js({prop:t,defaultProp:a,onChange:r=()=>{},caller:n}){const[s,o,i]=Zs({defaultProp:a,onChange:r}),d=t!==void 0,u=d?t:s;{const x=A.useRef(t!==void 0);A.useEffect(()=>{const g=x.current;g!==d&&console.warn(`${n} is changing from ${g?"controlled":"uncontrolled"} to ${d?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),x.current=d},[d,n])}const c=A.useCallback(x=>{if(d){const g=eo(x)?x(t):x;g!==t&&i.current?.(g)}else o(x)},[d,t,o,i]);return[u,c]}function Zs({defaultProp:t,onChange:a}){const[r,n]=A.useState(t),s=A.useRef(r),o=A.useRef(a);return Qs(()=>{o.current=a},[a]),A.useEffect(()=>{s.current!==r&&(o.current?.(r),s.current=r)},[r,s]),[r,n,o]}function eo(t){return typeof t=="function"}function ba(t,a){if(typeof t=="function")return t(a);t!=null&&(t.current=a)}function to(...t){return a=>{let r=!1;const n=t.map(s=>{const o=ba(s,a);return!r&&typeof o=="function"&&(r=!0),o});if(r)return()=>{for(let s=0;s<n.length;s++){const o=n[s];typeof o=="function"?o():ba(t[s],null)}}}}function Da(...t){return A.useCallback(to(...t),t)}var ao=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Zt=ao.reduce((t,a)=>{const r=Yt.createSlot(`Primitive.${a}`),n=A.forwardRef((s,o)=>{const{asChild:i,...d}=s,u=i?r:a;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),e.jsx(u,{...d,ref:o})});return n.displayName=`Primitive.${a}`,{...t,[a]:n}},{});function ro(t,a){return A.useReducer((r,n)=>a[r][n]??r,t)}var Pa=t=>{const{present:a,children:r}=t,n=no(a),s=typeof r=="function"?r({present:n.isPresent}):A.Children.only(r),o=Da(n.ref,so(s));return typeof r=="function"||n.isPresent?A.cloneElement(s,{ref:o}):null};Pa.displayName="Presence";function no(t){const[a,r]=A.useState(),n=A.useRef(null),s=A.useRef(t),o=A.useRef("none"),i=t?"mounted":"unmounted",[d,u]=ro(i,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return A.useEffect(()=>{const c=ft(n.current);o.current=d==="mounted"?c:"none"},[d]),at(()=>{const c=n.current,x=s.current;if(x!==t){const w=o.current,N=ft(c);t?u("MOUNT"):N==="none"||c?.display==="none"?u("UNMOUNT"):u(x&&w!==N?"ANIMATION_OUT":"UNMOUNT"),s.current=t}},[t,u]),at(()=>{if(a){let c;const x=a.ownerDocument.defaultView??window,g=N=>{const C=ft(n.current).includes(CSS.escape(N.animationName));if(N.target===a&&C&&(u("ANIMATION_END"),!s.current)){const b=a.style.animationFillMode;a.style.animationFillMode="forwards",c=x.setTimeout(()=>{a.style.animationFillMode==="forwards"&&(a.style.animationFillMode=b)})}},w=N=>{N.target===a&&(o.current=ft(n.current))};return a.addEventListener("animationstart",w),a.addEventListener("animationcancel",g),a.addEventListener("animationend",g),()=>{x.clearTimeout(c),a.removeEventListener("animationstart",w),a.removeEventListener("animationcancel",g),a.removeEventListener("animationend",g)}}else u("ANIMATION_END")},[a,u]),{isPresent:["mounted","unmountSuspended"].includes(d),ref:A.useCallback(c=>{n.current=c?getComputedStyle(c):null,r(c)},[])}}function ft(t){return t?.animationName||"none"}function so(t){let a=Object.getOwnPropertyDescriptor(t.props,"ref")?.get,r=a&&"isReactWarning"in a&&a.isReactWarning;return r?t.ref:(a=Object.getOwnPropertyDescriptor(t,"ref")?.get,r=a&&"isReactWarning"in a&&a.isReactWarning,r?t.props.ref:t.props.ref||t.ref)}var oo=A[" useId ".trim().toString()]||(()=>{}),io=0;function lo(t){const[a,r]=A.useState(oo());return at(()=>{r(n=>n??String(io++))},[t]),t||(a?`radix-${a}`:"")}var St="Collapsible",[co]=Xs(St),[uo,ea]=co(St),Ta=A.forwardRef((t,a)=>{const{__scopeCollapsible:r,open:n,defaultOpen:s,disabled:o,onOpenChange:i,...d}=t,[u,c]=Js({prop:n,defaultProp:s??!1,onChange:i,caller:St});return e.jsx(uo,{scope:r,disabled:o,contentId:lo(),open:u,onOpenToggle:A.useCallback(()=>c(x=>!x),[c]),children:e.jsx(Zt.div,{"data-state":aa(u),"data-disabled":o?"":void 0,...d,ref:a})})});Ta.displayName=St;var Ra="CollapsibleTrigger",_a=A.forwardRef((t,a)=>{const{__scopeCollapsible:r,...n}=t,s=ea(Ra,r);return e.jsx(Zt.button,{type:"button","aria-controls":s.contentId,"aria-expanded":s.open||!1,"data-state":aa(s.open),"data-disabled":s.disabled?"":void 0,disabled:s.disabled,...n,ref:a,onClick:Ks(t.onClick,s.onOpenToggle)})});_a.displayName=Ra;var ta="CollapsibleContent",za=A.forwardRef((t,a)=>{const{forceMount:r,...n}=t,s=ea(ta,t.__scopeCollapsible);return e.jsx(Pa,{present:r||s.open,children:({present:o})=>e.jsx(mo,{...n,ref:a,present:o})})});za.displayName=ta;var mo=A.forwardRef((t,a)=>{const{__scopeCollapsible:r,present:n,children:s,...o}=t,i=ea(ta,r),[d,u]=A.useState(n),c=A.useRef(null),x=Da(a,c),g=A.useRef(0),w=g.current,N=A.useRef(0),v=N.current,C=i.open||d,b=A.useRef(C),S=A.useRef(void 0);return A.useEffect(()=>{const p=requestAnimationFrame(()=>b.current=!1);return()=>cancelAnimationFrame(p)},[]),at(()=>{const p=c.current;if(p){S.current=S.current||{transitionDuration:p.style.transitionDuration,animationName:p.style.animationName},p.style.transitionDuration="0s",p.style.animationName="none";const I=p.getBoundingClientRect();g.current=I.height,N.current=I.width,b.current||(p.style.transitionDuration=S.current.transitionDuration,p.style.animationName=S.current.animationName),u(n)}},[i.open,n]),e.jsx(Zt.div,{"data-state":aa(i.open),"data-disabled":i.disabled?"":void 0,id:i.contentId,hidden:!C,...o,ref:x,style:{"--radix-collapsible-content-height":w?`${w}px`:void 0,"--radix-collapsible-content-width":v?`${v}px`:void 0,...t.style},children:C&&s})});function aa(t){return t?"open":"closed"}var xo=Ta;const jt=W.cva("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive text-white hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",outline:"border bg-background shadow-xs hover:bg-accent hover:text-accent-foreground dark:bg-input/30 dark:border-input dark:hover:bg-input/50",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50",dashed:"border border-dashed bg-background shadow-sm hover:bg-accent hover:text-accent-foreground ",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2 has-[>svg]:px-3",xs:"h-6 gap-1 rounded-md px-2 text-xs has-[>svg]:px-1.5 [&_svg:not([class*='size-'])]:size-3",sm:"h-8 rounded-md gap-1.5 px-3 has-[>svg]:px-2.5",lg:"h-10 rounded-md px-6 has-[>svg]:px-4",icon:"size-9","icon-xs":"size-6 rounded-md [&_svg:not([class*='size-'])]:size-3","icon-sm":"size-8","icon-lg":"size-10"}},defaultVariants:{variant:"default",size:"default"}});function T({className:t,variant:a="default",size:r="default",asChild:n=!1,...s}){const o=n?Ae.Root:"button";return e.jsx(o,{"data-slot":"button","data-variant":a,"data-size":r,className:l(jt({variant:a,size:r,className:t})),...s})}function Fa({...t}){return e.jsx(Ie.Root,{"data-slot":"alert-dialog",...t})}function fo({...t}){return e.jsx(Ie.Trigger,{"data-slot":"alert-dialog-trigger",...t})}function Ma({...t}){return e.jsx(Ie.Portal,{"data-slot":"alert-dialog-portal",...t})}function Ea({className:t,...a}){return e.jsx(Ie.Overlay,{"data-slot":"alert-dialog-overlay",className:l("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50",t),...a})}function La({className:t,size:a="default",...r}){return e.jsxs(Ma,{children:[e.jsx(Ea,{}),e.jsx(Ie.Content,{"data-slot":"alert-dialog-content","data-size":a,className:l("bg-background data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 group/alert-dialog-content fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border p-6 shadow-lg duration-200 data-[size=sm]:max-w-xs data-[size=default]:sm:max-w-lg",t),...r})]})}function Oa({className:t,...a}){return e.jsx("div",{"data-slot":"alert-dialog-header",className:l("grid grid-rows-[auto_1fr] place-items-center gap-1.5 text-center has-data-[slot=alert-dialog-media]:grid-rows-[auto_auto_1fr] has-data-[slot=alert-dialog-media]:gap-x-6 sm:group-data-[size=default]/alert-dialog-content:place-items-start sm:group-data-[size=default]/alert-dialog-content:text-left sm:group-data-[size=default]/alert-dialog-content:has-data-[slot=alert-dialog-media]:grid-rows-[auto_1fr]",t),...a})}function Ba({className:t,...a}){return e.jsx("div",{"data-slot":"alert-dialog-footer",className:l("flex flex-col-reverse gap-2 group-data-[size=sm]/alert-dialog-content:grid group-data-[size=sm]/alert-dialog-content:grid-cols-2 sm:flex-row sm:justify-end",t),...a})}function Ua({className:t,...a}){return e.jsx(Ie.Title,{"data-slot":"alert-dialog-title",className:l("text-lg font-semibold sm:group-data-[size=default]/alert-dialog-content:group-has-data-[slot=alert-dialog-media]/alert-dialog-content:col-start-2",t),...a})}function Va({className:t,...a}){return e.jsx(Ie.Description,{"data-slot":"alert-dialog-description",className:l("text-muted-foreground text-sm",t),...a})}function go({className:t,...a}){return e.jsx("div",{"data-slot":"alert-dialog-media",className:l("bg-muted mb-2 inline-flex size-16 items-center justify-center rounded-md sm:group-data-[size=default]/alert-dialog-content:row-span-2 *:[svg:not([class*='size-'])]:size-8",t),...a})}function Lt({className:t,variant:a="default",size:r="default",...n}){return e.jsx(T,{variant:a,size:r,asChild:!0,children:e.jsx(Ie.Action,{"data-slot":"alert-dialog-action",className:l(t),...n})})}function $a({className:t,variant:a="outline",size:r="default",...n}){return e.jsx(T,{variant:a,size:r,asChild:!0,children:e.jsx(Ie.Cancel,{"data-slot":"alert-dialog-cancel",className:l(t),...n})})}const po=W.cva("relative w-full rounded-lg border px-4 py-3 text-sm grid has-[>svg]:grid-cols-[calc(var(--spacing)*4)_1fr] grid-cols-[0_1fr] has-[>svg]:gap-x-3 gap-y-0.5 items-start [&>svg]:size-4 [&>svg]:translate-y-0.5 [&>svg]:text-current",{variants:{variant:{default:"bg-card text-card-foreground",destructive:"text-destructive bg-card [&>svg]:text-current *:data-[slot=alert-description]:text-destructive/90"}},defaultVariants:{variant:"default"}});function ho({className:t,variant:a,...r}){return e.jsx("div",{"data-slot":"alert",role:"alert",className:l(po({variant:a}),t),...r})}function bo({className:t,...a}){return e.jsx("div",{"data-slot":"alert-title",className:l("col-start-2 line-clamp-1 min-h-4 font-medium tracking-tight",t),...a})}function vo({className:t,...a}){return e.jsx("div",{"data-slot":"alert-description",className:l("text-muted-foreground col-start-2 grid justify-items-start gap-1 text-sm [&_p]:leading-relaxed",t),...a})}function Ga({className:t,size:a="default",...r}){return e.jsx(Jt.Root,{"data-slot":"avatar","data-size":a,className:l("group/avatar relative flex size-8 shrink-0 overflow-hidden rounded-full select-none data-[size=lg]:size-10 data-[size=sm]:size-6",t),...r})}function qa({className:t,...a}){return e.jsx(Jt.Image,{"data-slot":"avatar-image",className:l("aspect-square size-full",t),...a})}function Wa({className:t,...a}){return e.jsx(Jt.Fallback,{"data-slot":"avatar-fallback",className:l("bg-muted text-muted-foreground flex size-full items-center justify-center rounded-full text-sm group-data-[size=sm]/avatar:text-xs",t),...a})}function jo({className:t,...a}){return e.jsx("span",{"data-slot":"avatar-badge",className:l("bg-primary text-primary-foreground ring-background absolute right-0 bottom-0 z-10 inline-flex items-center justify-center rounded-full ring-2 select-none","group-data-[size=sm]/avatar:size-2 group-data-[size=sm]/avatar:[&>svg]:hidden","group-data-[size=default]/avatar:size-2.5 group-data-[size=default]/avatar:[&>svg]:size-2","group-data-[size=lg]/avatar:size-3 group-data-[size=lg]/avatar:[&>svg]:size-2",t),...a})}function wo({className:t,...a}){return e.jsx("div",{"data-slot":"avatar-group",className:l("*:data-[slot=avatar]:ring-background group/avatar-group flex -space-x-2 *:data-[slot=avatar]:ring-2",t),...a})}function No({className:t,...a}){return e.jsx("div",{"data-slot":"avatar-group-count",className:l("bg-muted text-muted-foreground ring-background relative flex size-8 shrink-0 items-center justify-center rounded-full text-sm ring-2 group-has-data-[size=lg]/avatar-group:size-10 group-has-data-[size=sm]/avatar-group:size-6 [&>svg]:size-4 group-has-data-[size=lg]/avatar-group:[&>svg]:size-5 group-has-data-[size=sm]/avatar-group:[&>svg]:size-3",t),...a})}const Ha=W.cva("inline-flex items-center justify-center rounded-full border border-transparent px-2 py-0.5 text-xs font-medium w-fit whitespace-nowrap shrink-0 [&>svg]:size-3 gap-1 [&>svg]:pointer-events-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive transition-[color,box-shadow] overflow-hidden",{variants:{variant:{default:"bg-primary text-primary-foreground [a&]:hover:bg-primary/90",secondary:"bg-secondary text-secondary-foreground [a&]:hover:bg-secondary/90",destructive:"bg-destructive text-white [a&]:hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",outline:"border-border text-foreground [a&]:hover:bg-accent [a&]:hover:text-accent-foreground",ghost:"[a&]:hover:bg-accent [a&]:hover:text-accent-foreground",link:"text-primary underline-offset-4 [a&]:hover:underline"}},defaultVariants:{variant:"default"}});function ht({className:t,variant:a="default",asChild:r=!1,...n}){const s=r?Ae.Root:"span";return e.jsx(s,{"data-slot":"badge","data-variant":a,className:l(Ha({variant:a}),t),...n})}function Ka({className:t,classNames:a,showOutsideDays:r=!0,captionLayout:n="label",buttonVariant:s="ghost",formatters:o,components:i,...d}){const u=zt.getDefaultClassNames();return e.jsx(zt.DayPicker,{showOutsideDays:r,className:l("bg-background group/calendar p-3 [--cell-size:--spacing(8)] [[data-slot=card-content]_&]:bg-transparent [[data-slot=popover-content]_&]:bg-transparent",String.raw`rtl:**:[.rdp-button\_next>svg]:rotate-180`,String.raw`rtl:**:[.rdp-button\_previous>svg]:rotate-180`,t),captionLayout:n,formatters:{formatMonthDropdown:c=>c.toLocaleString("default",{month:"short"}),...o},classNames:{root:l("w-fit",u.root),months:l("flex gap-4 flex-col md:flex-row relative",u.months),month:l("flex flex-col w-full gap-4",u.month),nav:l("flex items-center gap-1 w-full absolute top-0 inset-x-0 justify-between",u.nav),button_previous:l(jt({variant:s}),"size-(--cell-size) aria-disabled:opacity-50 p-0 select-none",u.button_previous),button_next:l(jt({variant:s}),"size-(--cell-size) aria-disabled:opacity-50 p-0 select-none",u.button_next),month_caption:l("flex items-center justify-center h-(--cell-size) w-full px-(--cell-size)",u.month_caption),dropdowns:l("w-full flex items-center text-sm font-medium justify-center h-(--cell-size) gap-1.5",u.dropdowns),dropdown_root:l("relative has-focus:border-ring border border-input shadow-xs has-focus:ring-ring/50 has-focus:ring-[3px] rounded-md",u.dropdown_root),dropdown:l("absolute bg-popover inset-0 opacity-0",u.dropdown),caption_label:l("select-none font-medium",n==="label"?"text-sm":"rounded-md pl-2 pr-1 flex items-center gap-1 text-sm h-8 [&>svg]:text-muted-foreground [&>svg]:size-3.5",u.caption_label),table:"w-full border-collapse",weekdays:l("flex",u.weekdays),weekday:l("text-muted-foreground rounded-md flex-1 font-normal text-[0.8rem] select-none",u.weekday),week:l("flex w-full mt-2",u.week),week_number_header:l("select-none w-(--cell-size)",u.week_number_header),week_number:l("text-[0.8rem] select-none text-muted-foreground",u.week_number),day:l("relative w-full h-full p-0 text-center [&:last-child[data-selected=true]_button]:rounded-r-md group/day aspect-square select-none",d.showWeekNumber?"[&:nth-child(2)[data-selected=true]_button]:rounded-l-md":"[&:first-child[data-selected=true]_button]:rounded-l-md",u.day),range_start:l("rounded-l-md bg-accent",u.range_start),range_middle:l("rounded-none",u.range_middle),range_end:l("rounded-r-md bg-accent",u.range_end),today:l("bg-accent text-accent-foreground rounded-md data-[selected=true]:rounded-none",u.today),outside:l("text-muted-foreground aria-selected:text-muted-foreground",u.outside),disabled:l("text-muted-foreground opacity-50",u.disabled),hidden:l("invisible",u.hidden),...a},components:{Root:({className:c,rootRef:x,...g})=>e.jsx("div",{"data-slot":"calendar",ref:x,className:l(c),...g}),Chevron:({className:c,orientation:x,...g})=>x==="left"?e.jsx(f.ChevronLeftIcon,{className:l("size-4",c),...g}):x==="right"?e.jsx(f.ChevronRightIcon,{className:l("size-4",c),...g}):e.jsx(f.ChevronDownIcon,{className:l("size-4",c),...g}),DayButton:Xa,WeekNumber:({children:c,...x})=>e.jsx("td",{...x,children:e.jsx("div",{className:"flex size-(--cell-size) items-center justify-center text-center",children:c})}),...i},...d})}function Xa({className:t,day:a,modifiers:r,...n}){const s=zt.getDefaultClassNames(),o=A.useRef(null);return A.useEffect(()=>{r.focused&&o.current?.focus()},[r.focused]),e.jsx(T,{ref:o,variant:"ghost",size:"icon","data-day":a.date.toLocaleDateString(),"data-selected-single":r.selected&&!r.range_start&&!r.range_end&&!r.range_middle,"data-range-start":r.range_start,"data-range-end":r.range_end,"data-range-middle":r.range_middle,className:l("data-[selected-single=true]:bg-primary data-[selected-single=true]:text-primary-foreground data-[range-middle=true]:bg-accent data-[range-middle=true]:text-accent-foreground data-[range-start=true]:bg-primary data-[range-start=true]:text-primary-foreground data-[range-end=true]:bg-primary data-[range-end=true]:text-primary-foreground group-data-[focused=true]/day:border-ring group-data-[focused=true]/day:ring-ring/50 dark:hover:text-accent-foreground flex aspect-square size-auto w-full min-w-(--cell-size) flex-col gap-1 leading-none font-normal group-data-[focused=true]/day:relative group-data-[focused=true]/day:z-10 group-data-[focused=true]/day:ring-[3px] data-[range-end=true]:rounded-md data-[range-end=true]:rounded-r-md data-[range-middle=true]:rounded-none data-[range-start=true]:rounded-md data-[range-start=true]:rounded-l-md [&>span]:text-xs [&>span]:opacity-70",s.day,t),...n})}function wt({className:t,...a}){return e.jsx("div",{"data-slot":"card",className:l("bg-card text-card-foreground flex flex-col gap-6 rounded-xl border py-6 shadow-sm",t),...a})}function yo({className:t,...a}){return e.jsx("div",{"data-slot":"card-header",className:l("@container/card-header grid auto-rows-min grid-rows-[auto_auto] items-start gap-2 px-6 has-data-[slot=card-action]:grid-cols-[1fr_auto] [.border-b]:pb-6",t),...a})}function Co({className:t,...a}){return e.jsx("div",{"data-slot":"card-title",className:l("leading-none font-semibold",t),...a})}function So({className:t,...a}){return e.jsx("div",{"data-slot":"card-description",className:l("text-muted-foreground text-sm",t),...a})}function ko({className:t,...a}){return e.jsx("div",{"data-slot":"card-action",className:l("col-start-2 row-span-2 row-start-1 self-start justify-self-end",t),...a})}function Ya({className:t,...a}){return e.jsx("div",{"data-slot":"card-content",className:l("px-6",t),...a})}function Io({className:t,...a}){return e.jsx("div",{"data-slot":"card-footer",className:l("flex items-center px-6 [.border-t]:pt-6",t),...a})}function Ve({className:t,...a}){return e.jsx(ga.Root,{"data-slot":"checkbox",className:l("peer border-input dark:bg-input/30 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground dark:data-[state=checked]:bg-primary data-[state=checked]:border-primary focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive size-4 shrink-0 rounded-[4px] border shadow-xs transition-shadow outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50",t),...a,children:e.jsx(ga.Indicator,{"data-slot":"checkbox-indicator",className:"grid place-content-center text-current transition-none",children:e.jsx(f.CheckIcon,{className:"size-3.5"})})})}function kt({...t}){return e.jsx(U.Root,{"data-slot":"dialog",...t})}function Qa({...t}){return e.jsx(U.Trigger,{"data-slot":"dialog-trigger",...t})}function Ja({...t}){return e.jsx(U.Portal,{"data-slot":"dialog-portal",...t})}function Ao({...t}){return e.jsx(U.Close,{"data-slot":"dialog-close",...t})}function Za({className:t,...a}){return e.jsx(U.Overlay,{"data-slot":"dialog-overlay",className:l("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50",t),...a})}function It({className:t,children:a,showCloseButton:r=!0,...n}){return e.jsxs(Ja,{"data-slot":"dialog-portal",children:[e.jsx(Za,{}),e.jsxs(U.Content,{"data-slot":"dialog-content",className:l("bg-background data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border p-6 shadow-lg duration-200 outline-none sm:max-w-lg",t),...n,children:[a,r&&e.jsxs(U.Close,{"data-slot":"dialog-close",className:"ring-offset-background focus:ring-ring data-[state=open]:bg-accent data-[state=open]:text-muted-foreground absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",children:[e.jsx(f.XIcon,{}),e.jsx("span",{className:"sr-only",children:"Close"})]})]})]})}function ra({className:t,...a}){return e.jsx("div",{"data-slot":"dialog-header",className:l("flex flex-col gap-2 text-center sm:text-left",t),...a})}function er({className:t,showCloseButton:a=!1,children:r,...n}){return e.jsxs("div",{"data-slot":"dialog-footer",className:l("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",t),...n,children:[r,a&&e.jsx(U.Close,{asChild:!0,children:e.jsx(T,{variant:"outline",children:"Close"})})]})}function At({className:t,...a}){return e.jsx(U.Title,{"data-slot":"dialog-title",className:l("text-lg leading-none font-semibold",t),...a})}function tr({className:t,...a}){return e.jsx(U.Description,{"data-slot":"dialog-description",className:l("text-muted-foreground text-sm",t),...a})}function Y({className:t,...a}){return e.jsx($e.Command,{"data-slot":"command",className:l("bg-popover text-popover-foreground flex h-full w-full flex-col overflow-hidden rounded-md",t),...a})}function Do({title:t="Command Palette",description:a="Search for a command to run...",children:r,className:n,showCloseButton:s=!0,...o}){return e.jsxs(kt,{...o,children:[e.jsxs(ra,{className:"sr-only",children:[e.jsx(At,{children:t}),e.jsx(tr,{children:a})]}),e.jsx(It,{className:l("overflow-hidden p-0",n),showCloseButton:s,children:e.jsx(Y,{className:"[&_[cmdk-group-heading]]:text-muted-foreground **:data-[slot=command-input-wrapper]:h-12 [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group]]:px-2 [&_[cmdk-group]:not([hidden])_~[cmdk-group]]:pt-0 [&_[cmdk-input-wrapper]_svg]:h-5 [&_[cmdk-input-wrapper]_svg]:w-5 [&_[cmdk-input]]:h-12 [&_[cmdk-item]]:px-2 [&_[cmdk-item]]:py-3 [&_[cmdk-item]_svg]:h-5 [&_[cmdk-item]_svg]:w-5",children:r})})]})}function ie({className:t,...a}){return e.jsxs("div",{"data-slot":"command-input-wrapper",className:"flex h-9 items-center gap-2 border-b px-3",children:[e.jsx(f.SearchIcon,{className:"size-4 shrink-0 opacity-50"}),e.jsx($e.Command.Input,{"data-slot":"command-input",className:l("placeholder:text-muted-foreground flex h-10 w-full rounded-md bg-transparent py-3 text-sm outline-hidden disabled:cursor-not-allowed disabled:opacity-50",t),...a})]})}function le({className:t,...a}){return e.jsx($e.Command.List,{"data-slot":"command-list",className:l("max-h-[300px] scroll-py-1 overflow-x-hidden overflow-y-auto",t),...a})}function de({...t}){return e.jsx($e.Command.Empty,{"data-slot":"command-empty",className:"py-6 text-center text-sm",...t})}function re({className:t,...a}){return e.jsx($e.Command.Group,{"data-slot":"command-group",className:l("text-foreground [&_[cmdk-group-heading]]:text-muted-foreground overflow-hidden p-1 [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium",t),...a})}function ar({className:t,...a}){return e.jsx($e.Command.Separator,{"data-slot":"command-separator",className:l("bg-border -mx-1 h-px",t),...a})}function X({className:t,...a}){return e.jsx($e.Command.Item,{"data-slot":"command-item",className:l("data-[selected=true]:bg-accent data-[selected=true]:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",t),...a})}function Po({className:t,...a}){return e.jsx("span",{"data-slot":"command-shortcut",className:l("text-muted-foreground ml-auto text-xs tracking-widest",t),...a})}function ve({...t}){return e.jsx($.Root,{"data-slot":"dropdown-menu",...t})}function rr({...t}){return e.jsx($.Portal,{"data-slot":"dropdown-menu-portal",...t})}function je({...t}){return e.jsx($.Trigger,{"data-slot":"dropdown-menu-trigger",...t})}function we({className:t,sideOffset:a=4,...r}){return e.jsx($.Portal,{children:e.jsx($.Content,{"data-slot":"dropdown-menu-content",sideOffset:a,className:l("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 max-h-(--radix-dropdown-menu-content-available-height) min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border p-1 shadow-md",t),...r})})}function na({...t}){return e.jsx($.Group,{"data-slot":"dropdown-menu-group",...t})}function me({className:t,inset:a,variant:r="default",...n}){return e.jsx($.Item,{"data-slot":"dropdown-menu-item","data-inset":a,"data-variant":r,className:l("focus:bg-accent focus:text-accent-foreground data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 dark:data-[variant=destructive]:focus:bg-destructive/20 data-[variant=destructive]:focus:text-destructive data-[variant=destructive]:*:[svg]:!text-destructive [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",t),...n})}function To({className:t,children:a,checked:r,...n}){return e.jsxs($.CheckboxItem,{"data-slot":"dropdown-menu-checkbox-item",className:l("focus:bg-accent focus:text-accent-foreground relative flex cursor-default items-center gap-2 rounded-sm py-1.5 pr-2 pl-8 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",t),checked:r,...n,children:[e.jsx("span",{className:"pointer-events-none absolute left-2 flex size-3.5 items-center justify-center",children:e.jsx($.ItemIndicator,{children:e.jsx(f.CheckIcon,{className:"size-4"})})}),a]})}function Ro({...t}){return e.jsx($.RadioGroup,{"data-slot":"dropdown-menu-radio-group",...t})}function _o({className:t,children:a,...r}){return e.jsxs($.RadioItem,{"data-slot":"dropdown-menu-radio-item",className:l("focus:bg-accent focus:text-accent-foreground relative flex cursor-default items-center gap-2 rounded-sm py-1.5 pr-2 pl-8 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",t),...r,children:[e.jsx("span",{className:"pointer-events-none absolute left-2 flex size-3.5 items-center justify-center",children:e.jsx($.ItemIndicator,{children:e.jsx(f.CircleIcon,{className:"size-2 fill-current"})})}),a]})}function Dt({className:t,inset:a,...r}){return e.jsx($.Label,{"data-slot":"dropdown-menu-label","data-inset":a,className:l("px-2 py-1.5 text-sm font-medium data-[inset]:pl-8",t),...r})}function rt({className:t,...a}){return e.jsx($.Separator,{"data-slot":"dropdown-menu-separator",className:l("bg-border -mx-1 my-1 h-px",t),...a})}function zo({className:t,...a}){return e.jsx("span",{"data-slot":"dropdown-menu-shortcut",className:l("text-muted-foreground ml-auto text-xs tracking-widest",t),...a})}function nr({...t}){return e.jsx($.Sub,{"data-slot":"dropdown-menu-sub",...t})}function sr({className:t,inset:a,children:r,...n}){return e.jsxs($.SubTrigger,{"data-slot":"dropdown-menu-sub-trigger","data-inset":a,className:l("focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",t),...n,children:[r,e.jsx(f.ChevronRightIcon,{className:"ml-auto size-4"})]})}function or({className:t,...a}){return e.jsx($.SubContent,{"data-slot":"dropdown-menu-sub-content",className:l("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-hidden rounded-md border p-1 shadow-lg",t),...a})}function Fo({...t}){return e.jsx(vt.Root,{"data-slot":"hover-card",...t})}function Mo({...t}){return e.jsx(vt.Trigger,{"data-slot":"hover-card-trigger",...t})}function Eo({className:t,align:a="center",sideOffset:r=4,...n}){return e.jsx(vt.Portal,{"data-slot":"hover-card-portal",children:e.jsx(vt.Content,{"data-slot":"hover-card-content",align:a,sideOffset:r,className:l("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-64 origin-(--radix-hover-card-content-transform-origin) rounded-md border p-4 shadow-md outline-hidden",t),...n})})}function H({className:t,type:a,...r}){return e.jsx("input",{type:a,"data-slot":"input",className:l("file:text-foreground placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground dark:bg-input/30 border-input h-9 w-full min-w-0 rounded-md border bg-transparent px-3 py-1 text-base shadow-xs transition-[color,box-shadow] outline-none file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm","focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]","aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",t),...r})}function Se({className:t,...a}){return e.jsx(Bs.Root,{"data-slot":"label",className:l("flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50",t),...a})}function Lo({className:t,children:a,viewport:r=!0,...n}){return e.jsxs(Ee.Root,{"data-slot":"navigation-menu","data-viewport":r,className:l("group/navigation-menu relative flex max-w-max flex-1 items-center justify-center",t),...n,children:[a,r&&e.jsx(lr,{})]})}function Oo({className:t,...a}){return e.jsx(Ee.List,{"data-slot":"navigation-menu-list",className:l("group flex flex-1 list-none items-center justify-center gap-1",t),...a})}function Bo({className:t,...a}){return e.jsx(Ee.Item,{"data-slot":"navigation-menu-item",className:l("relative",t),...a})}const ir=W.cva("group inline-flex h-9 w-max items-center justify-center rounded-md bg-background px-4 py-2 text-sm font-medium hover:bg-accent hover:text-accent-foreground focus:bg-accent focus:text-accent-foreground disabled:pointer-events-none disabled:opacity-50 data-[state=open]:hover:bg-accent data-[state=open]:text-accent-foreground data-[state=open]:focus:bg-accent data-[state=open]:bg-accent/50 focus-visible:ring-ring/50 outline-none transition-[color,box-shadow] focus-visible:ring-[3px] focus-visible:outline-1");function Uo({className:t,children:a,...r}){return e.jsxs(Ee.Trigger,{"data-slot":"navigation-menu-trigger",className:l(ir(),"group",t),...r,children:[a," ",e.jsx(f.ChevronDownIcon,{className:"relative top-[1px] ml-1 size-3 transition duration-300 group-data-[state=open]:rotate-180","aria-hidden":"true"})]})}function Vo({className:t,...a}){return e.jsx(Ee.Content,{"data-slot":"navigation-menu-content",className:l("data-[motion^=from-]:animate-in data-[motion^=to-]:animate-out data-[motion^=from-]:fade-in data-[motion^=to-]:fade-out data-[motion=from-end]:slide-in-from-right-52 data-[motion=from-start]:slide-in-from-left-52 data-[motion=to-end]:slide-out-to-right-52 data-[motion=to-start]:slide-out-to-left-52 top-0 left-0 w-full p-2 pr-2.5 md:absolute md:w-auto","group-data-[viewport=false]/navigation-menu:bg-popover group-data-[viewport=false]/navigation-menu:text-popover-foreground group-data-[viewport=false]/navigation-menu:data-[state=open]:animate-in group-data-[viewport=false]/navigation-menu:data-[state=closed]:animate-out group-data-[viewport=false]/navigation-menu:data-[state=closed]:zoom-out-95 group-data-[viewport=false]/navigation-menu:data-[state=open]:zoom-in-95 group-data-[viewport=false]/navigation-menu:data-[state=open]:fade-in-0 group-data-[viewport=false]/navigation-menu:data-[state=closed]:fade-out-0 group-data-[viewport=false]/navigation-menu:top-full group-data-[viewport=false]/navigation-menu:mt-1.5 group-data-[viewport=false]/navigation-menu:overflow-hidden group-data-[viewport=false]/navigation-menu:rounded-md group-data-[viewport=false]/navigation-menu:border group-data-[viewport=false]/navigation-menu:shadow group-data-[viewport=false]/navigation-menu:duration-200 **:data-[slot=navigation-menu-link]:focus:ring-0 **:data-[slot=navigation-menu-link]:focus:outline-none",t),...a})}function lr({className:t,...a}){return e.jsx("div",{className:l("absolute top-full left-0 isolate z-50 flex justify-center"),children:e.jsx(Ee.Viewport,{"data-slot":"navigation-menu-viewport",className:l("origin-top-center bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-90 relative mt-1.5 h-[var(--radix-navigation-menu-viewport-height)] w-full overflow-hidden rounded-md border shadow md:w-[var(--radix-navigation-menu-viewport-width)]",t),...a})})}function $o({className:t,...a}){return e.jsx(Ee.Link,{"data-slot":"navigation-menu-link",className:l("data-[active=true]:focus:bg-accent data-[active=true]:hover:bg-accent data-[active=true]:bg-accent/50 data-[active=true]:text-accent-foreground hover:bg-accent hover:text-accent-foreground focus:bg-accent focus:text-accent-foreground focus-visible:ring-ring/50 [&_svg:not([class*='text-'])]:text-muted-foreground flex flex-col gap-1 rounded-sm p-2 text-sm transition-all outline-none focus-visible:ring-[3px] focus-visible:outline-1 [&_svg:not([class*='size-'])]:size-4",t),...a})}function Go({className:t,...a}){return e.jsx(Ee.Indicator,{"data-slot":"navigation-menu-indicator",className:l("data-[state=visible]:animate-in data-[state=hidden]:animate-out data-[state=hidden]:fade-out data-[state=visible]:fade-in top-full z-[1] flex h-1.5 items-end justify-center overflow-hidden",t),...a,children:e.jsx("div",{className:"bg-border relative top-[60%] h-2 w-2 rotate-45 rounded-tl-sm shadow-md"})})}function Q({...t}){return e.jsx(tt.Root,{"data-slot":"popover",...t})}function J({...t}){return e.jsx(tt.Trigger,{"data-slot":"popover-trigger",...t})}function Z({className:t,align:a="center",sideOffset:r=4,...n}){return e.jsx(tt.Portal,{children:e.jsx(tt.Content,{"data-slot":"popover-content",align:a,sideOffset:r,className:l("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-72 origin-(--radix-popover-content-transform-origin) rounded-md border p-4 shadow-md outline-hidden",t),...n})})}function qo({...t}){return e.jsx(tt.Anchor,{"data-slot":"popover-anchor",...t})}function Wo({className:t,...a}){return e.jsx("div",{"data-slot":"popover-header",className:l("flex flex-col gap-1 text-sm",t),...a})}function Ho({className:t,...a}){return e.jsx("div",{"data-slot":"popover-title",className:l("font-medium",t),...a})}function Ko({className:t,...a}){return e.jsx("p",{"data-slot":"popover-description",className:l("text-muted-foreground",t),...a})}function Pt({className:t,value:a,...r}){return e.jsx(pa.Root,{"data-slot":"progress",className:l("bg-primary/20 relative h-2 w-full overflow-hidden rounded-full",t),...r,children:e.jsx(pa.Indicator,{"data-slot":"progress-indicator",className:"bg-primary h-full w-full flex-1 transition-all",style:{transform:`translateX(-${100-(a||0)}%)`}})})}function Xo({className:t,...a}){return e.jsx(Mt.Root,{"data-slot":"radio-group",className:l("grid gap-3",t),...a})}function Yo({className:t,...a}){return e.jsx(Mt.Item,{"data-slot":"radio-group-item",className:l("border-input text-primary focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 aspect-square size-4 shrink-0 rounded-full border shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50",t),...a,children:e.jsx(Mt.Indicator,{"data-slot":"radio-group-indicator",className:"relative flex items-center justify-center",children:e.jsx(f.CircleIcon,{className:"fill-primary absolute top-1/2 left-1/2 size-2 -translate-x-1/2 -translate-y-1/2"})})})}function Qo({className:t,children:a,...r}){return e.jsxs(Ze.Root,{"data-slot":"scroll-area",className:l("relative",t),...r,children:[e.jsx(Ze.Viewport,{"data-slot":"scroll-area-viewport",className:"focus-visible:ring-ring/50 size-full rounded-[inherit] transition-[color,box-shadow] outline-none focus-visible:ring-[3px] focus-visible:outline-1",children:a}),e.jsx(dr,{}),e.jsx(Ze.Corner,{})]})}function dr({className:t,orientation:a="vertical",...r}){return e.jsx(Ze.ScrollAreaScrollbar,{"data-slot":"scroll-area-scrollbar",orientation:a,className:l("flex touch-none p-px transition-colors select-none",a==="vertical"&&"h-full w-2.5 border-l border-l-transparent",a==="horizontal"&&"h-2.5 flex-col border-t border-t-transparent",t),...r,children:e.jsx(Ze.ScrollAreaThumb,{"data-slot":"scroll-area-thumb",className:"bg-border relative flex-1 rounded-full"})})}function cr({...t}){return e.jsx(K.Root,{"data-slot":"select",...t})}function Jo({...t}){return e.jsx(K.Group,{"data-slot":"select-group",...t})}function ur({...t}){return e.jsx(K.Value,{"data-slot":"select-value",...t})}function mr({className:t,size:a="default",children:r,...n}){return e.jsxs(K.Trigger,{"data-slot":"select-trigger","data-size":a,className:l("border-input data-[placeholder]:text-muted-foreground [&_svg:not([class*='text-'])]:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 dark:hover:bg-input/50 flex w-fit items-center justify-between gap-2 rounded-md border bg-transparent px-3 py-2 text-sm whitespace-nowrap shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 data-[size=default]:h-9 data-[size=sm]:h-8 *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-2 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",t),...n,children:[r,e.jsx(K.Icon,{asChild:!0,children:e.jsx(f.ChevronDownIcon,{className:"size-4 opacity-50"})})]})}function xr({className:t,children:a,position:r="item-aligned",align:n="center",...s}){return e.jsx(K.Portal,{children:e.jsxs(K.Content,{"data-slot":"select-content",className:l("bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 relative z-50 max-h-(--radix-select-content-available-height) min-w-[8rem] origin-(--radix-select-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border shadow-md",r==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",t),position:r,align:n,...s,children:[e.jsx(gr,{}),e.jsx(K.Viewport,{className:l("p-1",r==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)] scroll-my-1"),children:a}),e.jsx(pr,{})]})})}function Zo({className:t,...a}){return e.jsx(K.Label,{"data-slot":"select-label",className:l("text-muted-foreground px-2 py-1.5 text-xs",t),...a})}function fr({className:t,children:a,...r}){return e.jsxs(K.Item,{"data-slot":"select-item",className:l("focus:bg-accent focus:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground relative flex w-full cursor-default items-center gap-2 rounded-sm py-1.5 pr-8 pl-2 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2",t),...r,children:[e.jsx("span",{"data-slot":"select-item-indicator",className:"absolute right-2 flex size-3.5 items-center justify-center",children:e.jsx(K.ItemIndicator,{children:e.jsx(f.CheckIcon,{className:"size-4"})})}),e.jsx(K.ItemText,{children:a})]})}function ei({className:t,...a}){return e.jsx(K.Separator,{"data-slot":"select-separator",className:l("bg-border pointer-events-none -mx-1 my-1 h-px",t),...a})}function gr({className:t,...a}){return e.jsx(K.ScrollUpButton,{"data-slot":"select-scroll-up-button",className:l("flex cursor-default items-center justify-center py-1",t),...a,children:e.jsx(f.ChevronUpIcon,{className:"size-4"})})}function pr({className:t,...a}){return e.jsx(K.ScrollDownButton,{"data-slot":"select-scroll-down-button",className:l("flex cursor-default items-center justify-center py-1",t),...a,children:e.jsx(f.ChevronDownIcon,{className:"size-4"})})}function Tt({className:t,orientation:a="horizontal",decorative:r=!0,...n}){return e.jsx(Us.Root,{"data-slot":"separator",decorative:r,orientation:a,className:l("bg-border shrink-0 data-[orientation=horizontal]:h-px data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-px",t),...n})}function sa({...t}){return e.jsx(U.Root,{"data-slot":"sheet",...t})}function hr({...t}){return e.jsx(U.Trigger,{"data-slot":"sheet-trigger",...t})}function ti({...t}){return e.jsx(U.Close,{"data-slot":"sheet-close",...t})}function ai({...t}){return e.jsx(U.Portal,{"data-slot":"sheet-portal",...t})}function ri({className:t,...a}){return e.jsx(U.Overlay,{"data-slot":"sheet-overlay",className:l("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50",t),...a})}function oa({className:t,children:a,side:r="right",showCloseButton:n=!0,...s}){return e.jsxs(ai,{children:[e.jsx(ri,{}),e.jsxs(U.Content,{"data-slot":"sheet-content",className:l("bg-background data-[state=open]:animate-in data-[state=closed]:animate-out fixed z-50 flex flex-col gap-4 shadow-lg transition ease-in-out data-[state=closed]:duration-300 data-[state=open]:duration-500",r==="right"&&"data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right inset-y-0 right-0 h-full w-3/4 border-l sm:max-w-sm",r==="left"&&"data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left inset-y-0 left-0 h-full w-3/4 border-r sm:max-w-sm",r==="top"&&"data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top inset-x-0 top-0 h-auto border-b",r==="bottom"&&"data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom inset-x-0 bottom-0 h-auto border-t",t),...s,children:[a,n&&e.jsxs(U.Close,{className:"ring-offset-background focus:ring-ring data-[state=open]:bg-secondary absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none",children:[e.jsx(f.XIcon,{className:"size-4"}),e.jsx("span",{className:"sr-only",children:"Close"})]})]})]})}function br({className:t,...a}){return e.jsx("div",{"data-slot":"sheet-header",className:l("flex flex-col gap-1.5 p-4",t),...a})}function ni({className:t,...a}){return e.jsx("div",{"data-slot":"sheet-footer",className:l("mt-auto flex flex-col gap-2 p-4",t),...a})}function ia({className:t,...a}){return e.jsx(U.Title,{"data-slot":"sheet-title",className:l("text-foreground font-semibold",t),...a})}function vr({className:t,...a}){return e.jsx(U.Description,{"data-slot":"sheet-description",className:l("text-muted-foreground text-sm",t),...a})}const _t=768;function Rt(){const[t,a]=A.useState(void 0);return A.useEffect(()=>{const r=window.matchMedia(`(max-width: ${_t-1}px)`),n=()=>{a(window.innerWidth<_t)};return r.addEventListener("change",n),a(window.innerWidth<_t),()=>r.removeEventListener("change",n)},[]),!!t}function Be({className:t,...a}){return e.jsx("div",{"data-slot":"skeleton",className:l("bg-accent animate-pulse rounded-md",t),...a})}function _e({delayDuration:t=0,...a}){return e.jsx(He.Provider,{"data-slot":"tooltip-provider",delayDuration:t,...a})}function ne({...t}){return e.jsx(He.Root,{"data-slot":"tooltip",...t})}function se({...t}){return e.jsx(He.Trigger,{"data-slot":"tooltip-trigger",...t})}function oe({className:t,sideOffset:a=0,children:r,...n}){return e.jsx(He.Portal,{children:e.jsxs(He.Content,{"data-slot":"tooltip-content",sideOffset:a,className:l("bg-foreground text-background animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-fit origin-(--radix-tooltip-content-transform-origin) rounded-md px-3 py-1.5 text-xs text-balance",t),...n,children:[r,e.jsx(He.Arrow,{className:"bg-foreground fill-foreground z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px]"})]})})}const si="sidebar_state",oi=3600*24*7,ii="16rem",li="18rem",di="3rem",ci="b",jr=A.createContext(null);function nt(){const t=A.useContext(jr);if(!t)throw new Error("useSidebar must be used within a SidebarProvider.");return t}function wr({defaultOpen:t=!0,open:a,onOpenChange:r,className:n,style:s,children:o,...i}){const d=Rt(),[u,c]=A.useState(!1),[x,g]=A.useState(t),w=a??x,N=A.useCallback(S=>{const p=typeof S=="function"?S(w):S;r?r(p):g(p),document.cookie=`${si}=${p}; path=/; max-age=${oi}`},[r,w]),v=A.useCallback(()=>d?c(S=>!S):N(S=>!S),[d,N,c]);A.useEffect(()=>{const S=p=>{p.key===ci&&(p.metaKey||p.ctrlKey)&&(p.preventDefault(),v())};return window.addEventListener("keydown",S),()=>window.removeEventListener("keydown",S)},[v]);const C=w?"expanded":"collapsed",b=A.useMemo(()=>({state:C,open:w,setOpen:N,isMobile:d,openMobile:u,setOpenMobile:c,toggleSidebar:v}),[C,w,N,d,u,c,v]);return e.jsx(jr.Provider,{value:b,children:e.jsx(_e,{delayDuration:0,children:e.jsx("div",{"data-slot":"sidebar-wrapper",style:{"--sidebar-width":ii,"--sidebar-width-icon":di,...s},className:l("group/sidebar-wrapper has-data-[variant=inset]:bg-sidebar flex min-h-svh w-full",n),...i,children:o})})})}function Nr({side:t="left",variant:a="sidebar",collapsible:r="offcanvas",className:n,children:s,...o}){const{isMobile:i,state:d,openMobile:u,setOpenMobile:c}=nt();return r==="none"?e.jsx("div",{"data-slot":"sidebar",className:l("bg-sidebar text-sidebar-foreground flex h-full w-(--sidebar-width) flex-col",n),...o,children:s}):i?e.jsx(sa,{open:u,onOpenChange:c,...o,children:e.jsxs(oa,{"data-sidebar":"sidebar","data-slot":"sidebar","data-mobile":"true",className:"bg-sidebar text-sidebar-foreground w-(--sidebar-width) p-0 [&>button]:hidden",style:{"--sidebar-width":li},side:t,children:[e.jsxs(br,{className:"sr-only",children:[e.jsx(ia,{children:"Sidebar"}),e.jsx(vr,{children:"Displays the mobile sidebar."})]}),e.jsx("div",{className:"flex h-full w-full flex-col",children:s})]})}):e.jsxs("div",{className:"group peer text-sidebar-foreground hidden md:block","data-state":d,"data-collapsible":d==="collapsed"?r:"","data-variant":a,"data-side":t,"data-slot":"sidebar",children:[e.jsx("div",{"data-slot":"sidebar-gap",className:l("relative w-(--sidebar-width) bg-transparent transition-[width] duration-200 ease-linear","group-data-[collapsible=offcanvas]:w-0","group-data-[side=right]:rotate-180",a==="floating"||a==="inset"?"group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4)))]":"group-data-[collapsible=icon]:w-(--sidebar-width-icon)")}),e.jsx("div",{"data-slot":"sidebar-container",className:l("fixed inset-y-0 z-10 hidden h-svh w-(--sidebar-width) transition-[left,right,width] duration-200 ease-linear md:flex",t==="left"?"left-0 group-data-[collapsible=offcanvas]:left-[calc(var(--sidebar-width)*-1)]":"right-0 group-data-[collapsible=offcanvas]:right-[calc(var(--sidebar-width)*-1)]",a==="floating"||a==="inset"?"p-2 group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4))+2px)]":"group-data-[collapsible=icon]:w-(--sidebar-width-icon) group-data-[side=left]:border-r group-data-[side=right]:border-l",n),...o,children:e.jsx("div",{"data-sidebar":"sidebar","data-slot":"sidebar-inner",className:"bg-sidebar group-data-[variant=floating]:border-sidebar-border flex h-full w-full flex-col group-data-[variant=floating]:rounded-lg group-data-[variant=floating]:border group-data-[variant=floating]:shadow-sm",children:s})})]})}function yr({className:t,onClick:a,...r}){const{toggleSidebar:n}=nt();return e.jsxs(T,{"data-sidebar":"trigger","data-slot":"sidebar-trigger",variant:"ghost",size:"icon",className:l("size-7",t),onClick:s=>{a?.(s),n()},...r,children:[e.jsx(f.PanelLeftIcon,{}),e.jsx("span",{className:"sr-only",children:"Toggle Sidebar"})]})}function Cr({className:t,...a}){const{toggleSidebar:r}=nt();return e.jsx("button",{"data-sidebar":"rail","data-slot":"sidebar-rail","aria-label":"Toggle Sidebar",tabIndex:-1,onClick:r,title:"Toggle Sidebar",className:l("hover:after:bg-sidebar-border absolute inset-y-0 z-20 hidden w-4 -translate-x-1/2 transition-all ease-linear group-data-[side=left]:-right-4 group-data-[side=right]:left-0 after:absolute after:inset-y-0 after:left-1/2 after:w-[2px] sm:flex","in-data-[side=left]:cursor-w-resize in-data-[side=right]:cursor-e-resize","[[data-side=left][data-state=collapsed]_&]:cursor-e-resize [[data-side=right][data-state=collapsed]_&]:cursor-w-resize","hover:group-data-[collapsible=offcanvas]:bg-sidebar group-data-[collapsible=offcanvas]:translate-x-0 group-data-[collapsible=offcanvas]:after:left-full","[[data-side=left][data-collapsible=offcanvas]_&]:-right-2","[[data-side=right][data-collapsible=offcanvas]_&]:-left-2",t),...a})}function Sr({className:t,...a}){return e.jsx("main",{"data-slot":"sidebar-inset",className:l("bg-background relative flex w-full flex-1 flex-col","md:peer-data-[variant=inset]:m-2 md:peer-data-[variant=inset]:ml-0 md:peer-data-[variant=inset]:rounded-xl md:peer-data-[variant=inset]:shadow-sm md:peer-data-[variant=inset]:peer-data-[state=collapsed]:ml-2",t),...a})}function ui({className:t,...a}){return e.jsx(H,{"data-slot":"sidebar-input","data-sidebar":"input",className:l("bg-background h-8 w-full shadow-none",t),...a})}function kr({className:t,...a}){return e.jsx("div",{"data-slot":"sidebar-header","data-sidebar":"header",className:l("flex flex-col gap-2 p-2",t),...a})}function Ir({className:t,...a}){return e.jsx("div",{"data-slot":"sidebar-footer","data-sidebar":"footer",className:l("flex flex-col gap-2 p-2",t),...a})}function mi({className:t,...a}){return e.jsx(Tt,{"data-slot":"sidebar-separator","data-sidebar":"separator",className:l("bg-sidebar-border mx-2 w-auto",t),...a})}function Ar({className:t,...a}){return e.jsx("div",{"data-slot":"sidebar-content","data-sidebar":"content",className:l("flex min-h-0 flex-1 flex-col gap-2 overflow-auto group-data-[collapsible=icon]:overflow-hidden",t),...a})}function Dr({className:t,...a}){return e.jsx("div",{"data-slot":"sidebar-group","data-sidebar":"group",className:l("relative flex w-full min-w-0 flex-col p-2",t),...a})}function xi({className:t,asChild:a=!1,...r}){const n=a?Ae.Root:"div";return e.jsx(n,{"data-slot":"sidebar-group-label","data-sidebar":"group-label",className:l("text-sidebar-foreground/70 ring-sidebar-ring flex h-8 shrink-0 items-center rounded-md px-2 text-xs font-medium outline-hidden transition-[margin,opacity] duration-200 ease-linear focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0","group-data-[collapsible=icon]:-mt-8 group-data-[collapsible=icon]:opacity-0",t),...r})}function fi({className:t,asChild:a=!1,...r}){const n=a?Ae.Root:"button";return e.jsx(n,{"data-slot":"sidebar-group-action","data-sidebar":"group-action",className:l("text-sidebar-foreground ring-sidebar-ring hover:bg-sidebar-accent hover:text-sidebar-accent-foreground absolute top-3.5 right-3 flex aspect-square w-5 items-center justify-center rounded-md p-0 outline-hidden transition-transform focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0","after:absolute after:-inset-2 md:after:hidden","group-data-[collapsible=icon]:hidden",t),...r})}function gi({className:t,...a}){return e.jsx("div",{"data-slot":"sidebar-group-content","data-sidebar":"group-content",className:l("w-full text-sm",t),...a})}function Pr({className:t,...a}){return e.jsx("ul",{"data-slot":"sidebar-menu","data-sidebar":"menu",className:l("flex w-full min-w-0 flex-col gap-1",t),...a})}function Ot({className:t,...a}){return e.jsx("li",{"data-slot":"sidebar-menu-item","data-sidebar":"menu-item",className:l("group/menu-item relative",t),...a})}const pi=W.cva("peer/menu-button flex w-full items-center gap-2 overflow-hidden rounded-md p-2 text-left text-sm outline-hidden ring-sidebar-ring transition-[width,height,padding] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 active:bg-sidebar-accent active:text-sidebar-accent-foreground disabled:pointer-events-none disabled:opacity-50 group-has-data-[sidebar=menu-action]/menu-item:pr-8 aria-disabled:pointer-events-none aria-disabled:opacity-50 data-[active=true]:bg-sidebar-accent data-[active=true]:font-medium data-[active=true]:text-sidebar-accent-foreground data-[state=open]:hover:bg-sidebar-accent data-[state=open]:hover:text-sidebar-accent-foreground group-data-[collapsible=icon]:size-8! group-data-[collapsible=icon]:p-2! [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0",{variants:{variant:{default:"hover:bg-sidebar-accent hover:text-sidebar-accent-foreground",outline:"bg-background shadow-[0_0_0_1px_hsl(var(--sidebar-border))] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground hover:shadow-[0_0_0_1px_hsl(var(--sidebar-accent))]"},size:{default:"h-8 text-sm",sm:"h-7 text-xs",lg:"h-12 text-sm group-data-[collapsible=icon]:p-0!"}},defaultVariants:{variant:"default",size:"default"}});function Bt({asChild:t=!1,isActive:a=!1,variant:r="default",size:n="default",tooltip:s,className:o,...i}){const d=t?Ae.Root:"button",{isMobile:u,state:c}=nt(),x=e.jsx(d,{"data-slot":"sidebar-menu-button","data-sidebar":"menu-button","data-size":n,"data-active":a,className:l(pi({variant:r,size:n}),o),...i});return s?(typeof s=="string"&&(s={children:s}),e.jsxs(ne,{children:[e.jsx(se,{asChild:!0,children:x}),e.jsx(oe,{side:"right",align:"center",hidden:c!=="collapsed"||u,...s})]})):x}function hi({className:t,asChild:a=!1,showOnHover:r=!1,...n}){const s=a?Ae.Root:"button";return e.jsx(s,{"data-slot":"sidebar-menu-action","data-sidebar":"menu-action",className:l("text-sidebar-foreground ring-sidebar-ring hover:bg-sidebar-accent hover:text-sidebar-accent-foreground peer-hover/menu-button:text-sidebar-accent-foreground absolute top-1.5 right-1 flex aspect-square w-5 items-center justify-center rounded-md p-0 outline-hidden transition-transform focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0","after:absolute after:-inset-2 md:after:hidden","peer-data-[size=sm]/menu-button:top-1","peer-data-[size=default]/menu-button:top-1.5","peer-data-[size=lg]/menu-button:top-2.5","group-data-[collapsible=icon]:hidden",r&&"peer-data-[active=true]/menu-button:text-sidebar-accent-foreground group-focus-within/menu-item:opacity-100 group-hover/menu-item:opacity-100 data-[state=open]:opacity-100 md:opacity-0",t),...n})}function bi({className:t,...a}){return e.jsx("div",{"data-slot":"sidebar-menu-badge","data-sidebar":"menu-badge",className:l("text-sidebar-foreground pointer-events-none absolute right-1 flex h-5 min-w-5 items-center justify-center rounded-md px-1 text-xs font-medium tabular-nums select-none","peer-hover/menu-button:text-sidebar-accent-foreground peer-data-[active=true]/menu-button:text-sidebar-accent-foreground","peer-data-[size=sm]/menu-button:top-1","peer-data-[size=default]/menu-button:top-1.5","peer-data-[size=lg]/menu-button:top-2.5","group-data-[collapsible=icon]:hidden",t),...a})}function vi({className:t,showIcon:a=!1,...r}){const n=A.useMemo(()=>`${Math.floor(Math.random()*40)+50}%`,[]);return e.jsxs("div",{"data-slot":"sidebar-menu-skeleton","data-sidebar":"menu-skeleton",className:l("flex h-8 items-center gap-2 rounded-md px-2",t),...r,children:[a&&e.jsx(Be,{className:"size-4 rounded-md","data-sidebar":"menu-skeleton-icon"}),e.jsx(Be,{className:"h-4 max-w-(--skeleton-width) flex-1","data-sidebar":"menu-skeleton-text",style:{"--skeleton-width":n}})]})}function Tr({className:t,...a}){return e.jsx("ul",{"data-slot":"sidebar-menu-sub","data-sidebar":"menu-sub",className:l("border-sidebar-border mx-3.5 flex min-w-0 translate-x-px flex-col gap-1 border-l px-2.5 py-0.5","group-data-[collapsible=icon]:hidden",t),...a})}function Rr({className:t,...a}){return e.jsx("li",{"data-slot":"sidebar-menu-sub-item","data-sidebar":"menu-sub-item",className:l("group/menu-sub-item relative",t),...a})}function _r({asChild:t=!1,size:a="md",isActive:r=!1,className:n,...s}){const o=t?Ae.Root:"a";return e.jsx(o,{"data-slot":"sidebar-menu-sub-button","data-sidebar":"menu-sub-button","data-size":a,"data-active":r,className:l("text-sidebar-foreground ring-sidebar-ring hover:bg-sidebar-accent hover:text-sidebar-accent-foreground active:bg-sidebar-accent active:text-sidebar-accent-foreground [&>svg]:text-sidebar-accent-foreground flex h-7 min-w-0 -translate-x-px items-center gap-2 overflow-hidden rounded-md px-2 outline-hidden focus-visible:ring-2 disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0","data-[active=true]:bg-sidebar-accent data-[active=true]:text-sidebar-accent-foreground",a==="sm"&&"text-xs",a==="md"&&"text-sm","group-data-[collapsible=icon]:hidden",n),...s})}function ji({className:t,defaultValue:a,value:r,min:n=0,max:s=100,...o}){const i=A.useMemo(()=>Array.isArray(r)?r:Array.isArray(a)?a:[n,s],[r,a,n,s]);return e.jsxs(mt.Root,{"data-slot":"slider",defaultValue:a,value:r,min:n,max:s,className:l("relative flex w-full touch-none items-center select-none data-[disabled]:opacity-50 data-[orientation=vertical]:h-full data-[orientation=vertical]:min-h-44 data-[orientation=vertical]:w-auto data-[orientation=vertical]:flex-col",t),...o,children:[e.jsx(mt.Track,{"data-slot":"slider-track",className:l("bg-muted relative grow overflow-hidden rounded-full data-[orientation=horizontal]:h-1.5 data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-1.5"),children:e.jsx(mt.Range,{"data-slot":"slider-range",className:l("bg-primary absolute data-[orientation=horizontal]:h-full data-[orientation=vertical]:w-full")})}),Array.from({length:i.length},(d,u)=>e.jsx(mt.Thumb,{"data-slot":"slider-thumb",className:"border-primary ring-ring/50 block size-4 shrink-0 rounded-full border bg-white shadow-sm transition-[color,box-shadow] hover:ring-4 focus-visible:ring-4 focus-visible:outline-hidden disabled:pointer-events-none disabled:opacity-50"},u))]})}const zr=A.createContext(void 0),Fr=({children:t})=>{const a=()=>typeof window>"u"?"light":window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light",[r,n]=A.useState(()=>typeof window>"u"?"system":localStorage.getItem("theme")||"system"),[s,o]=A.useState(()=>r==="system"?a():r),i=A.useCallback(u=>{const c=document.documentElement;c.classList.remove("dark","blue-dark");let x;u==="system"?x=a():x=u,x==="dark"&&c.classList.add("dark"),x==="blue-dark"&&c.classList.add("blue-dark"),o(x)},[]);A.useEffect(()=>{i(r),localStorage.setItem("theme",r)},[r,i]),A.useEffect(()=>{if(r!=="system")return;const u=window.matchMedia("(prefers-color-scheme: dark)"),c=()=>{i("system")};return u.addEventListener("change",c),()=>u.removeEventListener("change",c)},[r,i]);const d=A.useMemo(()=>({theme:r,setTheme:n,resolvedTheme:s}),[r,s]);return e.jsx(zr.Provider,{value:d,children:t})},Mr=()=>{const t=A.useContext(zr);if(!t)throw new Error("useTheme must be used within ThemeProvider");return t},wi=({...t})=>{const{theme:a="system"}=Mr();return e.jsx(Ca.Toaster,{theme:a,className:"toaster group",icons:{success:e.jsx(f.CircleCheckIcon,{className:"size-4"}),info:e.jsx(f.InfoIcon,{className:"size-4"}),warning:e.jsx(f.TriangleAlertIcon,{className:"size-4"}),error:e.jsx(f.OctagonXIcon,{className:"size-4"}),loading:e.jsx(f.Loader2Icon,{className:"size-4 animate-spin"})},style:{"--normal-bg":"var(--popover)","--normal-text":"var(--popover-foreground)","--normal-border":"var(--border)","--border-radius":"var(--radius)"},...t})};function Ni({className:t,size:a="default",...r}){return e.jsx(ha.Root,{"data-slot":"switch","data-size":a,className:l("peer data-[state=checked]:bg-primary data-[state=unchecked]:bg-input focus-visible:border-ring focus-visible:ring-ring/50 dark:data-[state=unchecked]:bg-input/80 group/switch inline-flex shrink-0 items-center rounded-full border border-transparent shadow-xs transition-all outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 data-[size=default]:h-[1.15rem] data-[size=default]:w-8 data-[size=sm]:h-3.5 data-[size=sm]:w-6",t),...r,children:e.jsx(ha.Thumb,{"data-slot":"switch-thumb",className:l("bg-background dark:data-[state=unchecked]:bg-foreground dark:data-[state=checked]:bg-primary-foreground pointer-events-none block rounded-full ring-0 transition-transform group-data-[size=default]/switch:size-4 group-data-[size=sm]/switch:size-3 data-[state=checked]:translate-x-[calc(100%-2px)] data-[state=unchecked]:translate-x-0")})})}function Er({className:t,...a}){return e.jsx("div",{"data-slot":"table-container",className:"relative w-full overflow-x-auto",children:e.jsx("table",{"data-slot":"table",className:l("w-full caption-bottom text-sm",t),...a})})}function Lr({className:t,...a}){return e.jsx("thead",{"data-slot":"table-header",className:l("[&_tr]:border-b",t),...a})}function Or({className:t,...a}){return e.jsx("tbody",{"data-slot":"table-body",className:l("[&_tr:last-child]:border-0",t),...a})}function Br({className:t,...a}){return e.jsx("tfoot",{"data-slot":"table-footer",className:l("bg-muted/50 border-t font-medium [&>tr]:last:border-b-0",t),...a})}function qe({className:t,...a}){return e.jsx("tr",{"data-slot":"table-row",className:l("hover:bg-muted/50 data-[state=selected]:bg-muted border-b transition-colors",t),...a})}function Ut({className:t,...a}){return e.jsx("th",{"data-slot":"table-head",className:l("text-foreground h-10 px-2 text-left align-middle font-medium whitespace-nowrap [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",t),...a})}function Ye({className:t,...a}){return e.jsx("td",{"data-slot":"table-cell",className:l("p-2 align-middle whitespace-nowrap [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",t),...a})}function yi({className:t,...a}){return e.jsx("caption",{"data-slot":"table-caption",className:l("text-muted-foreground mt-4 text-sm",t),...a})}function Ur({className:t,orientation:a="horizontal",...r}){return e.jsx(Ct.Root,{"data-slot":"tabs","data-orientation":a,orientation:a,className:l("group/tabs flex gap-2 data-[orientation=horizontal]:flex-col",t),...r})}const Vr=W.cva("rounded-lg p-[3px] group-data-[orientation=horizontal]/tabs:h-9 data-[variant=line]:rounded-none group/tabs-list text-muted-foreground inline-flex w-fit items-center justify-center group-data-[orientation=vertical]/tabs:h-fit group-data-[orientation=vertical]/tabs:flex-col",{variants:{variant:{default:"bg-muted",line:"gap-1 bg-transparent"}},defaultVariants:{variant:"default"}});function $r({className:t,variant:a="default",...r}){return e.jsx(Ct.List,{"data-slot":"tabs-list","data-variant":a,className:l(Vr({variant:a}),t),...r})}function Gr({className:t,...a}){return e.jsx(Ct.Trigger,{"data-slot":"tabs-trigger",className:l("focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:outline-ring text-foreground/60 hover:text-foreground dark:text-muted-foreground dark:hover:text-foreground relative inline-flex h-[calc(100%-1px)] flex-1 items-center justify-center gap-1.5 rounded-md border border-transparent px-2 py-1 text-sm font-medium whitespace-nowrap transition-all group-data-[orientation=vertical]/tabs:w-full group-data-[orientation=vertical]/tabs:justify-start focus-visible:ring-[3px] focus-visible:outline-1 disabled:pointer-events-none disabled:opacity-50 group-data-[variant=default]/tabs-list:data-[state=active]:shadow-sm group-data-[variant=line]/tabs-list:data-[state=active]:shadow-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4","group-data-[variant=line]/tabs-list:bg-transparent group-data-[variant=line]/tabs-list:data-[state=active]:bg-transparent dark:group-data-[variant=line]/tabs-list:data-[state=active]:border-transparent dark:group-data-[variant=line]/tabs-list:data-[state=active]:bg-transparent","data-[state=active]:bg-background dark:data-[state=active]:text-foreground dark:data-[state=active]:border-input dark:data-[state=active]:bg-input/30 data-[state=active]:text-foreground","after:bg-foreground after:absolute after:opacity-0 after:transition-opacity group-data-[orientation=horizontal]/tabs:after:inset-x-0 group-data-[orientation=horizontal]/tabs:after:bottom-[-5px] group-data-[orientation=horizontal]/tabs:after:h-0.5 group-data-[orientation=vertical]/tabs:after:inset-y-0 group-data-[orientation=vertical]/tabs:after:-right-1 group-data-[orientation=vertical]/tabs:after:w-0.5 group-data-[variant=line]/tabs-list:data-[state=active]:after:opacity-100",t),...a})}function Vt({className:t,...a}){return e.jsx(Ct.Content,{"data-slot":"tabs-content",className:l("flex-1 outline-none",t),...a})}function qr({className:t,...a}){return e.jsx("textarea",{"data-slot":"textarea",className:l("border-input placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 flex field-sizing-content min-h-16 w-full rounded-md border bg-transparent px-3 py-2 text-base shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",t),...a})}function $t({...t}){return e.jsx(Os.Root,{"data-slot":"aspect-ratio",...t})}function Wr({...t}){return e.jsx("nav",{"aria-label":"breadcrumb","data-slot":"breadcrumb",...t})}function Hr({className:t,...a}){return e.jsx("ol",{"data-slot":"breadcrumb-list",className:l("text-muted-foreground flex flex-wrap items-center gap-1.5 text-sm break-words sm:gap-2.5",t),...a})}function We({className:t,...a}){return e.jsx("li",{"data-slot":"breadcrumb-item",className:l("inline-flex items-center gap-1.5",t),...a})}function Gt({asChild:t,className:a,...r}){const n=t?Ae.Root:"a";return e.jsx(n,{"data-slot":"breadcrumb-link",className:l("hover:text-foreground transition-colors",a),...r})}function Qe({className:t,...a}){return e.jsx("span",{"data-slot":"breadcrumb-page",role:"link","aria-disabled":"true","aria-current":"page",className:l("text-foreground font-normal",t),...a})}function bt({children:t,className:a,...r}){return e.jsx("li",{"data-slot":"breadcrumb-separator",role:"presentation","aria-hidden":"true",className:l("[&>svg]:size-3.5",a),...r,children:t??e.jsx(f.ChevronRight,{})})}function qt({className:t,...a}){return e.jsxs("span",{"data-slot":"breadcrumb-ellipsis",role:"presentation","aria-hidden":"true",className:l("flex size-9 items-center justify-center",t),...a,children:[e.jsx(f.MoreHorizontal,{className:"size-4"}),e.jsx("span",{className:"sr-only",children:"More"})]})}function Kr({...t}){return e.jsx(xo,{"data-slot":"collapsible",...t})}function Xr({...t}){return e.jsx(_a,{"data-slot":"collapsible-trigger",...t})}function Yr({...t}){return e.jsx(za,{"data-slot":"collapsible-content",...t})}function Qr({...t}){return e.jsx(Me.Drawer.Root,{"data-slot":"drawer",...t})}function Jr({...t}){return e.jsx(Me.Drawer.Trigger,{"data-slot":"drawer-trigger",...t})}function Zr({...t}){return e.jsx(Me.Drawer.Portal,{"data-slot":"drawer-portal",...t})}function en({...t}){return e.jsx(Me.Drawer.Close,{"data-slot":"drawer-close",...t})}function tn({className:t,...a}){return e.jsx(Me.Drawer.Overlay,{"data-slot":"drawer-overlay",className:l("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50",t),...a})}function an({className:t,children:a,...r}){return e.jsxs(Zr,{"data-slot":"drawer-portal",children:[e.jsx(tn,{}),e.jsxs(Me.Drawer.Content,{"data-slot":"drawer-content",className:l("group/drawer-content bg-background fixed z-50 flex h-auto flex-col","data-[vaul-drawer-direction=top]:inset-x-0 data-[vaul-drawer-direction=top]:top-0 data-[vaul-drawer-direction=top]:mb-24 data-[vaul-drawer-direction=top]:max-h-[80vh] data-[vaul-drawer-direction=top]:rounded-b-lg data-[vaul-drawer-direction=top]:border-b","data-[vaul-drawer-direction=bottom]:inset-x-0 data-[vaul-drawer-direction=bottom]:bottom-0 data-[vaul-drawer-direction=bottom]:mt-24 data-[vaul-drawer-direction=bottom]:max-h-[80vh] data-[vaul-drawer-direction=bottom]:rounded-t-lg data-[vaul-drawer-direction=bottom]:border-t","data-[vaul-drawer-direction=right]:inset-y-0 data-[vaul-drawer-direction=right]:right-0 data-[vaul-drawer-direction=right]:w-3/4 data-[vaul-drawer-direction=right]:border-l data-[vaul-drawer-direction=right]:sm:max-w-sm","data-[vaul-drawer-direction=left]:inset-y-0 data-[vaul-drawer-direction=left]:left-0 data-[vaul-drawer-direction=left]:w-3/4 data-[vaul-drawer-direction=left]:border-r data-[vaul-drawer-direction=left]:sm:max-w-sm",t),...r,children:[e.jsx("div",{className:"bg-muted mx-auto mt-4 hidden h-2 w-[100px] shrink-0 rounded-full group-data-[vaul-drawer-direction=bottom]/drawer-content:block"}),a]})]})}function rn({className:t,...a}){return e.jsx("div",{"data-slot":"drawer-header",className:l("flex flex-col gap-0.5 p-4 group-data-[vaul-drawer-direction=bottom]/drawer-content:text-center group-data-[vaul-drawer-direction=top]/drawer-content:text-center md:gap-1.5 md:text-left",t),...a})}function nn({className:t,...a}){return e.jsx("div",{"data-slot":"drawer-footer",className:l("mt-auto flex flex-col gap-2 p-4",t),...a})}function sn({className:t,...a}){return e.jsx(Me.Drawer.Title,{"data-slot":"drawer-title",className:l("text-foreground font-semibold",t),...a})}function on({className:t,...a}){return e.jsx(Me.Drawer.Description,{"data-slot":"drawer-description",className:l("text-muted-foreground text-sm",t),...a})}const ln=Ke.FormProvider,dn=A.createContext({}),fe=({...t})=>e.jsx(dn.Provider,{value:{name:t.name},children:e.jsx(Ke.Controller,{...t})}),st=()=>{const t=A.useContext(dn),a=A.useContext(cn),{getFieldState:r}=Ke.useFormContext(),n=Ke.useFormState({name:t.name}),s=r(t.name,n);if(!t)throw new Error("useFormField should be used within <FormField>");const{id:o}=a;return{id:o,name:t.name,formItemId:`${o}-form-item`,formDescriptionId:`${o}-form-item-description`,formMessageId:`${o}-form-item-message`,...s}},cn=A.createContext({});function ge({className:t,...a}){const r=A.useId();return e.jsx(cn.Provider,{value:{id:r},children:e.jsx("div",{"data-slot":"form-item",className:l("grid gap-2",t),...a})})}function Ne({className:t,...a}){const{error:r,formItemId:n}=st();return e.jsx(Se,{"data-slot":"form-label","data-error":!!r,className:l("data-[error=true]:text-destructive",t),htmlFor:n,...a})}function pe({...t}){const{error:a,formItemId:r,formDescriptionId:n,formMessageId:s}=st();return e.jsx(Ae.Root,{"data-slot":"form-control",id:r,"aria-describedby":a?`${n} ${s}`:`${n}`,"aria-invalid":!!a,...t})}function ye({className:t,...a}){const{formDescriptionId:r}=st();return e.jsx("p",{"data-slot":"form-description",id:r,className:l("text-muted-foreground text-sm",t),...a})}function he({className:t,...a}){const{error:r,formMessageId:n}=st(),s=r?String(r?.message??""):a.children;return s?e.jsx("p",{"data-slot":"form-message",id:n,className:l("text-destructive text-sm",t),...a,children:s}):null}function un({className:t,containerClassName:a,...r}){return e.jsx(Sa.OTPInput,{"data-slot":"input-otp",containerClassName:l("flex items-center gap-2 has-disabled:opacity-50",a),className:l("disabled:cursor-not-allowed",t),...r})}function mn({className:t,...a}){return e.jsx("div",{"data-slot":"input-otp-group",className:l("flex items-center",t),...a})}function Je({index:t,className:a,...r}){const n=A.useContext(Sa.OTPInputContext),{char:s,hasFakeCaret:o,isActive:i}=n?.slots[t]??{};return e.jsxs("div",{"data-slot":"input-otp-slot","data-active":i,className:l("data-[active=true]:border-ring data-[active=true]:ring-ring/50 data-[active=true]:aria-invalid:ring-destructive/20 dark:data-[active=true]:aria-invalid:ring-destructive/40 aria-invalid:border-destructive data-[active=true]:aria-invalid:border-destructive dark:bg-input/30 border-input relative flex h-9 w-9 items-center justify-center border-y border-r text-sm shadow-xs transition-all outline-none first:rounded-l-md first:border-l last:rounded-r-md data-[active=true]:z-10 data-[active=true]:ring-[3px]",a),...r,children:[s,o&&e.jsx("div",{className:"pointer-events-none absolute inset-0 flex items-center justify-center",children:e.jsx("div",{className:"animate-caret-blink bg-foreground h-4 w-px duration-1000"})})]})}function Ci({...t}){return e.jsx("div",{"data-slot":"input-otp-separator",role:"separator",...t,children:e.jsx(f.MinusIcon,{})})}const la=W.cva("inline-flex items-center justify-center gap-2 rounded-md text-sm font-medium hover:bg-muted hover:text-muted-foreground disabled:pointer-events-none disabled:opacity-50 data-[state=on]:bg-accent data-[state=on]:text-accent-foreground [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 [&_svg]:shrink-0 focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] outline-none transition-[color,box-shadow] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive whitespace-nowrap",{variants:{variant:{default:"bg-transparent",outline:"border border-input bg-transparent shadow-xs hover:bg-accent hover:text-accent-foreground"},size:{default:"h-9 px-2 min-w-9",sm:"h-8 px-1.5 min-w-8",lg:"h-10 px-2.5 min-w-10"}},defaultVariants:{variant:"default",size:"default"}});function Si({className:t,variant:a,size:r,...n}){return e.jsx(Vs.Root,{"data-slot":"toggle",className:l(la({variant:a,size:r,className:t})),...n})}const xn=A.createContext({size:"default",variant:"default",spacing:0});function Oe({className:t,variant:a,size:r,spacing:n=0,children:s,...o}){return e.jsx(Aa.Root,{"data-slot":"toggle-group","data-variant":a,"data-size":r,"data-spacing":n,style:{"--gap":n},className:l("group/toggle-group flex w-fit items-center gap-[--spacing(var(--gap))] rounded-md data-[spacing=default]:data-[variant=outline]:shadow-xs",t),...o,children:e.jsx(xn.Provider,{value:{variant:a,size:r,spacing:n},children:s})})}function V({className:t,children:a,variant:r,size:n,...s}){const o=A.useContext(xn);return e.jsx(Aa.Item,{"data-slot":"toggle-group-item","data-variant":o.variant||r,"data-size":o.size||n,"data-spacing":o.spacing,className:l(la({variant:o.variant||r,size:o.size||n}),"w-auto min-w-0 shrink-0 px-3 focus:z-10 focus-visible:z-10","data-[spacing=0]:rounded-none data-[spacing=0]:shadow-none data-[spacing=0]:first:rounded-l-md data-[spacing=0]:last:rounded-r-md data-[spacing=0]:data-[variant=outline]:border-l-0 data-[spacing=0]:data-[variant=outline]:first:border-l",t),...s,children:a})}function ze({tooltipContent:t,children:a}){return e.jsx(_e,{children:e.jsxs(ne,{children:[e.jsx(se,{asChild:!0,children:a}),e.jsx(oe,{children:t})]})})}function ot({children:t,variant:a,asChild:r=!1,size:n,...s}){return e.jsx(T,{variant:a,size:n,...s,asChild:r,children:t})}function ki({children:t,variant:a,asChild:r=!1,size:n,tooltipContent:s,...o}){return e.jsx(ze,{tooltipContent:s,children:e.jsx(ot,{variant:a,size:n,...o,asChild:r,children:t})})}function it({children:t,variant:a,asChild:r=!1,size:n,...s}){return e.jsx(T,{variant:a||"outline",size:n||"sm",...s,asChild:r,children:t})}function fn({children:t,variant:a,size:r,asChild:n=!1,tooltipContent:s,...o}){return e.jsx(ze,{tooltipContent:s,children:e.jsx(it,{variant:a,size:r,...o,asChild:n,children:t})})}function gn({children:t,variant:a,size:r,asChild:n=!1,...s}){return e.jsx(T,{variant:a||"outline",size:r||"icon",...s,asChild:n,children:t})}function Re({children:t,tooltipContent:a,asChild:r=!1,variant:n,size:s,...o}){return e.jsx(ze,{tooltipContent:a,children:e.jsx(gn,{variant:n,size:s,...o,asChild:r,children:t})})}function Wt({actionMenus:t,extraActionParams:a}){const r=n=>(n=n.filter(s=>s?.visibility===void 0||s.visibility===!0||s.visibility&&s.visibility(...a?.arguments||[])),n.length===0?e.jsx(me,{className:"text-center",children:"No action available."}):n.map((s,o)=>{if(s.type==="label")return e.jsx(Dt,{children:String(s.label)},o);if(s.type==="separator")return e.jsx(rt,{},o);if(s.type==="group"&&s.items)return e.jsx(na,{children:r(s.items)},o);if(s.items)return e.jsxs(nr,{children:[e.jsx(sr,{children:String(s.label)}),e.jsx(rr,{children:e.jsx(or,{children:r(s.items)})})]},o);let i="";return typeof s.label=="function"?i=s.label(...a?.arguments||[]):i=s.label,e.jsxs(me,{disabled:s.disabled,onClick:()=>s.onClick&&s.onClick(...a?.arguments||[]),children:[s.icon&&e.jsx(s.icon,{}),i]},o)}));return e.jsxs(ve,{children:[e.jsx(je,{asChild:!0,children:e.jsx(Re,{variant:"ghost",tooltipContent:"Actions",className:"h-8 w-8 p-0 border-0 bg-transparent text-foreground keross:text-white elevation-0 shadow-none hover:bg-transparent",children:e.jsx(f.MoreHorizontal,{})})}),e.jsx(we,{className:"w-56",align:"end",children:r(t)})]})}const pn=({title:t,description:a,fontSize:r="text-base",cancelText:n="",confirmText:s="",thirdOptionText:o="",onCancel:i,onConfirm:d,onThird:u})=>e.jsx(Fa,{open:!0,children:e.jsxs(La,{children:[e.jsxs(Oa,{children:[e.jsx(Ua,{className:r,children:t}),e.jsx(Va,{className:r,children:a})]}),e.jsxs(Ba,{children:[n!=""&&e.jsx($a,{onClick:()=>{i&&i()},children:n}),o!=""&&e.jsx(Lt,{className:"bg-blue-500",color:"black",onClick:()=>{u&&u()},children:o}),s!=""&&e.jsx(Lt,{onClick:()=>{d&&d()},children:s})]})]})}),hn=m.createContext(void 0),Ii=()=>{const t=m.useContext(hn);if(!t)throw new Error("useDialog must be used within a DialogProvider");return t},bn=({children:t})=>{const[a,r]=m.useState(null),n=o=>r(o),s=()=>r(null);return e.jsxs(hn.Provider,{value:{openDialog:n,closeDialog:s},children:[t,a&&e.jsx(pn,{title:a.title,description:a.description,fontSize:a.fontSize||"text-base",cancelText:a.cancelText||"",confirmText:a.confirmText||"",thirdOptionText:a.thirdOptionText||"",onConfirm:()=>{a.onConfirm&&a.onConfirm(),s()},onCancel:()=>{a.onCancel&&a.onCancel(),s()},onThird:()=>{a.onThird&&a.onThird(),s()}})]})};function Ai({placeholder:t,items:a,disabled:r,onSelect:n,defaultValue:s}){const[o,i]=m.useState(s??"");return e.jsxs(Q,{children:[e.jsx(J,{asChild:!0,className:"w-full",children:e.jsxs(T,{variant:"outline",role:"combobox",className:l("justify-between",!o&&"text-muted-foreground","bg-secondary"),disabled:r===!0||typeof r=="function"&&r(),children:[o?a.find(d=>d.value===o)?.label||o:t,e.jsx(f.ChevronsUpDown,{className:"opacity-50"})]})}),e.jsx(Z,{className:"p-0",align:"start",children:e.jsxs(Y,{children:[e.jsx(ie,{placeholder:"Search..."}),e.jsxs(le,{children:[e.jsx(de,{children:"No items found."}),e.jsx(re,{children:a.map(d=>e.jsxs(X,{value:d.value,disabled:d.disabled===!0||typeof d.disabled=="function"&&d.disabled(d),onSelect:u=>{const c=a.find(x=>x.value.toLowerCase()===u.toLowerCase())?.value??u;i(c),n?.(c)},children:[d?.label||d.value,e.jsx(f.Check,{className:l("ml-auto",d.value===o?"opacity-100":"opacity-0")})]},d.value))})]})]})})]})}const ke=t=>t?.columnDef?.title||t?.columnDef?.header&&typeof t.columnDef.header=="string"&&t?.columnDef?.header||t.id;function vn({table:t}){return e.jsxs(Q,{children:[e.jsx(ze,{tooltipContent:"Column View",children:e.jsx(J,{asChild:!0,children:e.jsxs(it,{children:[e.jsx(f.Settings2,{}),"View"]})})}),e.jsx(Z,{className:"w-[220px] p-0",align:"end",children:e.jsxs(Y,{children:[e.jsx(ie,{placeholder:"Search..."}),e.jsxs(le,{children:[e.jsx(de,{children:"No results found."}),e.jsx(re,{children:t.getAllColumns().filter(a=>typeof a.accessorFn<"u"&&a.getCanHide()).map(a=>{const r=a.getIsVisible();return e.jsxs(X,{onSelect:()=>{a.toggleVisibility(!r)},disabled:a.getIsGrouped(),children:[e.jsx("div",{className:l("mr-2 flex h-4 w-4 items-center justify-center rounded-sm border border-black dark:border-white",r?"bg-black dark:bg-white text-white dark:text-black":"opacity-50 [&_svg]:invisible"),children:e.jsx(f.Check,{})}),e.jsx("span",{className:"overflow-hidden text-ellipsis",title:ke(a),children:ke(a)})]},a.id)})})]})]})})]})}function jn({column:t}){const a=t?.getFacetedUniqueValues(),r=new Set(t?.getFilterValue()),n=A.useMemo(()=>Array.from(t.getFacetedUniqueValues().keys()).sort().slice(0,5e3),[t.getFacetedUniqueValues()]);return e.jsxs(Q,{children:[e.jsx(J,{asChild:!0,children:e.jsxs(fn,{variant:"dashed",tooltipContent:ke(t),children:[r?.size>0?e.jsx(f.X,{}):e.jsx(f.Plus,{}),ke(t),r?.size>0&&e.jsxs(e.Fragment,{children:[e.jsx(Tt,{orientation:"vertical",className:"mx-2 h-4"}),e.jsx(ht,{variant:"secondary",className:"rounded-sm px-1 font-normal lg:hidden",children:r.size}),e.jsx("div",{className:"hidden space-x-1 lg:flex",children:r.size>2?e.jsxs(ht,{variant:"secondary",className:"rounded-sm px-1 font-normal",children:[r.size," selected"]}):n.filter(s=>r.has(s)).map(s=>e.jsx(ht,{variant:"secondary",className:"rounded-sm px-1 font-normal",children:s},s))})]})]})}),e.jsx(Z,{className:"max-w-[250px] p-0",align:"start",children:e.jsxs(Y,{children:[e.jsx(ie,{placeholder:ke(t)}),e.jsxs(le,{children:[e.jsx(de,{children:"No results found."}),e.jsx(re,{children:n.map(s=>{const o=r.has(s);return e.jsxs(X,{onSelect:()=>{o?r.delete(s):r.add(s);const i=Array.from(r);t?.setFilterValue(i.length?i:void 0)},children:[e.jsx("div",{className:l("mr-2 flex h-4 w-4 items-center justify-center rounded-sm border border-black dark:border-white",o?"bg-black dark:bg-white text-white dark:text-black":"opacity-50 [&_svg]:invisible"),children:e.jsx(f.Check,{})}),e.jsx("span",{className:"overflow-hidden text-ellipsis",title:s,children:s}),a?.get(s)&&e.jsx("span",{className:"ml-auto flex h-4 w-4 items-center justify-center font-mono text-xs",children:a.get(s)})]},s)})})]}),r.size>0&&e.jsxs(e.Fragment,{children:[e.jsx(ar,{}),e.jsx(re,{children:e.jsx(X,{onSelect:()=>t?.setFilterValue(void 0),className:"justify-center text-center",children:"Clear filters"})})]})]})})]})}function wn({table:t}){const[a,r]=m.useState([]);return e.jsxs("div",{className:"flex-grow flex gap-3 items-center overflow-hidden",children:[e.jsxs(Q,{children:[e.jsx(ze,{tooltipContent:"Filter",children:e.jsx(J,{asChild:!0,children:e.jsxs(it,{children:[e.jsx(f.Filter,{}),"Filter"]})})}),e.jsx(Z,{className:"w-[220px] p-0",align:"start",children:e.jsxs(Y,{children:[e.jsx(ie,{placeholder:"Search..."}),e.jsxs(le,{children:[e.jsx(de,{children:"No results found."}),e.jsx(re,{children:t.getAllColumns().filter(n=>typeof n.accessorFn<"u"&&n.getCanHide()).map(n=>{const s=new Set(a),o=s.has(n.id);return e.jsxs(X,{onSelect:()=>{o?s.delete(n.id):s.add(n.id),r([...s])},children:[e.jsx("div",{className:l("mr-2 flex h-4 w-4 items-center justify-center rounded-sm border border-black dark:border-white",o?"bg-black dark:bg-white text-white dark:text-black":"opacity-50 [&_svg]:invisible"),children:e.jsx(f.Check,{})}),e.jsx("span",{className:"overflow-hidden text-ellipsis",title:ke(n),children:ke(n)})]},n.id)})})]})]})})]}),e.jsx("div",{className:"flex-grow flex gap-3 items-center overflow-auto",children:a.map(n=>{const s=t.getColumn(n);if(s)return e.jsx(jn,{column:s},n)})})]})}const Nn=async t=>new Promise((a,r)=>{const n=new FileReader;n.onload=()=>{const o=n.result.split(",")[1];a({message:"File processed successfully",fileName:t.name,size:t.size,type:t.type,lastModified:t.lastModified,base64:o})},n.onerror=()=>r(n.error),n.readAsDataURL(t)});function Di(t){const a=atob(t.base64),r=new Array(a.length).fill(0).map((o,i)=>a.charCodeAt(i)),n=new Uint8Array(r),s=new Blob([n],{type:t.type});return URL.createObjectURL(s)}function Pi({label:t="Upload File",isDrag:a=!1,onFileSelect:r}){const[n,s]=m.useState(!1),o=async x=>{if(!x)return;const g=await Nn(x);await r(g)},i=x=>{if(!a)return;x.preventDefault(),s(!1);const g=x.dataTransfer.files?.[0];g&&o(g)},d=x=>{a&&(x.preventDefault(),s(!0))},u=()=>{a&&s(!1)},c=x=>{const g=x.target.files?.[0];g&&o(g)};return e.jsxs("div",{className:"flex flex-col gap-2 w-full",children:[e.jsx("label",{className:"text-sm font-medium",children:t}),e.jsx("input",{type:"file",id:"fileInput",className:"hidden",onChange:c}),a?e.jsx("div",{className:`border-2 border-dashed rounded-lg p-6 text-center cursor-pointer transition
2
- ${n?"border-blue-600 bg-blue-50":"border-gray-300"}
3
- `,onDragOver:d,onDragLeave:u,onDrop:i,onClick:()=>document.getElementById("fileInput")?.click(),children:e.jsxs("div",{className:"flex flex-col items-center gap-3",children:[e.jsx(f.UploadCloud,{className:"w-10 h-10 text-blue-600"}),e.jsxs("p",{className:"text-gray-600",children:["Drag & drop your file here or"," ",e.jsx("span",{className:"text-blue-600 underline",children:"browse"})]})]})}):e.jsxs("div",{className:"border rounded-lg p-4 flex flex-col items-center gap-2 cursor-pointer text-center",onClick:()=>document.getElementById("fileInput")?.click(),children:[e.jsx(f.FileUp,{className:"w-8 h-8 text-blue-600"}),e.jsx("span",{className:"text-blue-600 underline",children:"Browse File"})]})]})}const Ti=[15,20,30,40,50,100];function yn({table:t,extraParams:a}){return e.jsxs("div",{className:"flex flex-col md:flex-row items-start md:items-center justify-between ",children:[e.jsx("small",{className:"flex-1 px-2 text-gray-600 dark:text-gray-400",children:(a?.numberOfRows==null||a?.numberOfRows)&&a?.checkBoxColumn?e.jsxs(e.Fragment,{children:[t.getFilteredSelectedRowModel().rows.length," of"," ",t.getFilteredRowModel().rows.length," row(s) selected."]}):e.jsxs(e.Fragment,{children:["Total ",t.getFilteredRowModel().rows.length," no(s) of rows."]})}),(a?.pagination==null||a.pagination)&&e.jsxs("div",{className:"flex items-start md:items-center gap-3 flex-col md:flex-row ",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("small",{className:"text-gray-600 dark:text-gray-400",children:"Rows per page"}),(a?.rowsPerPage==null||a.rowsPerPage)&&e.jsxs(cr,{value:`${t.getState().pagination.pageSize}`,onValueChange:r=>{t.setPageSize(Number(r))},children:[e.jsx(mr,{className:"w-[70px] h-8",children:e.jsx(ur,{placeholder:t.getState().pagination.pageSize})}),e.jsx(xr,{side:"top",children:(a?.pageSizeArray||Ti).map(r=>e.jsx(fr,{value:`${r}`,children:r},r))})]})]}),e.jsxs(e.Fragment,{children:[e.jsxs("small",{className:"flex w-[100px] items-center justify-center text-gray-600 dark:text-gray-400",children:["Page ",t.getState().pagination.pageIndex+1," of"," ",t.getPageCount()]}),e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(Re,{tooltipContent:"Go to first page",size:"icon-sm",className:"dark:bg-accent dark:text-accent-foreground keross:bg-card keross:text-foreground",onClick:()=>t.setPageIndex(0),disabled:!t.getCanPreviousPage(),children:e.jsx(f.ChevronsLeft,{})}),e.jsx(Re,{tooltipContent:"Go to previous page",size:"icon-sm",className:"dark:bg-accent dark:text-accent-foreground keross:bg-card keross:text-foreground",onClick:()=>t.previousPage(),disabled:!t.getCanPreviousPage(),children:e.jsx(f.ChevronLeft,{})}),e.jsx(Re,{tooltipContent:"Go to next page",size:"icon-sm",className:"dark:bg-accent dark:text-accent-foreground keross:bg-card keross:text-foreground",onClick:()=>t.nextPage(),disabled:!t.getCanNextPage(),children:e.jsx(f.ChevronRight,{})}),e.jsx(Re,{tooltipContent:"Go to last page",size:"icon-sm",className:"dark:bg-accent dark:text-accent-foreground keross:bg-card keross:text-foreground",onClick:()=>t.setPageIndex(t.getPageCount()-1),disabled:!t.getCanNextPage(),children:e.jsx(f.ChevronsRight,{})})]})]})]})]})}function da({className:t,...a}){return e.jsxs("div",{className:"relative w-auto flex items-center",children:[e.jsx(f.Search,{className:"absolute left-2 mr-2 h-4 w-4 shrink-0 opacity-50"}),e.jsx(H,{className:W.cx("pl-8 h-8",t),...a})]})}function Cn({table:t,extraParams:a}){return e.jsxs("div",{className:"flex items-center justify-between gap-3",children:[e.jsxs("div",{className:"flex-grow flex items-center justify-between gap-3 overflow-hidden",children:[(a?.defaultTools==null||a?.defaultTools==!0||Array.isArray(a?.defaultTools)&&a?.defaultTools?.includes("search"))&&e.jsx(da,{placeholder:"Search ...",onChange:r=>t.setGlobalFilter(r.target.value),className:"max-w-sm"}),(a?.defaultTools==null||a?.defaultTools==!0||Array.isArray(a?.defaultTools)&&a?.defaultTools?.includes("filter"))&&e.jsx(wn,{table:t})]}),e.jsxs("div",{className:"flex gap-3",children:[a?.extraTools?.map((r,n)=>e.jsx(m.Fragment,{children:r},n)),(a?.defaultTools==null||a?.defaultTools==!0||Array.isArray(a?.defaultTools)&&a?.defaultTools?.includes("columnFilter"))&&e.jsx(vn,{table:t})]})]})}const Ri=m.forwardRef(({columns:t,data:a,extraParams:r,onTableReady:n},s)=>{const[o,i]=m.useState([]),[d,u]=m.useState(""),[c,x]=m.useState([]),[g,w]=m.useState({pageIndex:r?.pageIndex||0,pageSize:r?.pageSize||15}),[N,v]=m.useState({}),[C,b]=m.useState([]),[S,p]=m.useState({}),[I,j]=m.useState({});t=t.map(y=>(y?.filterFn||(y.filterFn="arrIncludesSome"),y)),m.useEffect(()=>{r?.checkBoxColumnCallback&&r.checkBoxColumnCallback(h.getFilteredSelectedRowModel().rows)},[I]),r?.checkBoxColumn&&t.splice(0,0,{id:"checkBoxColumn",header:({table:y})=>e.jsx(Ve,{checked:y.getIsAllPageRowsSelected()||y.getIsSomePageRowsSelected()&&"indeterminate",onCheckedChange:k=>y.toggleAllPageRowsSelected(!!k),"aria-label":"Select all"}),cell:({row:y})=>e.jsx(e.Fragment,{children:e.jsx(Ve,{checked:y.getIsSelected(),onCheckedChange:k=>y.toggleSelected(!!k),"aria-label":"Select row"})}),enableSorting:!1,enableHiding:!1}),(r?.actionMenu||r?.groupActionMenu)&&t.push({id:"DTActions",accessorKey:"Actions",header:()=>e.jsx("div",{className:"text-center",children:"Action"}),size:20,headerClassName:"text-center",cell:({row:y})=>y.getIsGrouped()?r?.groupActionMenu?e.jsx("div",{className:"text-end",children:e.jsx(Wt,{actionMenus:r.groupActionMenu.items,extraActionParams:{arguments:[y.original,...r.groupActionMenu.extraArguments||[]]}})}):null:r?.actionMenu?e.jsx("div",{className:"text-center",children:e.jsx(Wt,{actionMenus:r.actionMenu.items,extraActionParams:{arguments:[y.original,...r.actionMenu.extraArguments||[]]}})}):null,enableSorting:!1,enableHiding:!1}),m.useEffect(()=>{r?.onPaginationChange?.(g)},[g]);const h=E.useReactTable({data:a,columns:t,state:{sorting:o,globalFilter:d,columnFilters:c,columnVisibility:N,rowSelection:I,grouping:C,expanded:S,pagination:g},onPaginationChange:w,onSortingChange:i,onExpandedChange:p,onColumnFiltersChange:x,onColumnVisibilityChange:v,onGroupingChange:b,onGlobalFilterChange:u,onRowSelectionChange:j,getCoreRowModel:E.getCoreRowModel(),getPaginationRowModel:E.getPaginationRowModel(),getSortedRowModel:E.getSortedRowModel(),getFilteredRowModel:E.getFilteredRowModel(),getGroupedRowModel:E.getGroupedRowModel(),getExpandedRowModel:E.getExpandedRowModel(),getFacetedRowModel:E.getFacetedRowModel(),getFacetedUniqueValues:E.getFacetedUniqueValues(),getFacetedMinMaxValues:E.getFacetedMinMaxValues(),manualPagination:r?.pagination==null||r?.pagination==!0?void 0:!0});m.useImperativeHandle(s,()=>h);const[D,P]=m.useState([]),R=(y,k)=>{const B={id:k.id,title:ke(k.column)};y.dataTransfer.setData("headerObj",JSON.stringify(B)),y.dataTransfer.effectAllowed="move"},M=y=>{y.preventDefault();const k=JSON.parse(y.dataTransfer.getData("headerObj"));if(!D.find(B=>B.id==k.id)){P(z=>[...z,k]);const B=h.getColumn(k.id);B&&B.getToggleGroupingHandler()()}},F=y=>{y.preventDefault()},ce=y=>{const k=D.filter(z=>z.id!==y);P(()=>[...k]);const B=h.getColumn(y);B&&B.getToggleGroupingHandler()()},[De,Ce]=m.useState(!1);return m.useEffect(()=>{De||Ce(!0),r?.defaultGroups&&h.setGrouping(r?.defaultGroups)},[]),m.useEffect(()=>{n&&n(h)},[n,h]),De&&e.jsxs("div",{className:"w-full h-full flex flex-col gap-3 justify-between",children:[e.jsxs("div",{className:"flex-grow flex flex-col gap-3 overflow-hidden",children:[(r?.defaultTools==null||r.defaultTools||r.extraTools)&&e.jsx(Cn,{table:h,extraParams:r}),e.jsxs("div",{className:"flex-grow flex flex-col overflow-hidden",children:[(r?.grouping==null||r.grouping)&&e.jsx("div",{className:"w-full border-t min-h-10 px-2 py-1 flex gap-3 items-center text-sm bg-card-new",onDrop:M,onDragOver:F,children:D.length===0?"Drag a column header here to group its column":D.map((y,k)=>e.jsxs("div",{className:"rounded-md px-2 py-1 bg-muted text-muted-foreground flex gap-3 items-center",children:[y.title,e.jsx("span",{onClick:()=>ce(y.id),children:e.jsx(f.X,{size:15})})]},y.id))}),e.jsx("div",{className:"flex-grow overflow-hidden",children:e.jsxs(Er,{className:"border-t whitespace-nowrap bg-card-new",children:[(r?.header==null||r.header)&&e.jsx(Lr,{className:"sticky top-0 z-10 border-t bg-card-new",children:h.getHeaderGroups().map(y=>e.jsx(qe,{className:W.cx(""),children:y.headers.map(k=>k.column.getIsGrouped()?k.column.getGroupedIndex()<D.length-1?null:e.jsx(Ut,{colSpan:D.length,className:W.cx("w-36 ","text-left")},k.id):e.jsx(Ut,{...r?.grouping==null||r.grouping?{onDragStart:B=>R(B,k),draggable:!0}:{},className:W.cx("text-left"),children:k.isPlaceholder?null:(r?.sorting==null||r.sorting)&&k.column.getCanSort()?e.jsxs("div",{onClick:k.column.getToggleSortingHandler(),className:W.cx("-mx-2 inline-flex cursor-pointer select-none items-center gap-2 rounded-md px-2 py-1 hover:bg-muted"),children:[e.jsx("div",{children:E.flexRender(k.column.columnDef.header,k.getContext())}),k.column.getCanSort()?e.jsxs("div",{className:"-space-y-2",children:[e.jsx(f.ChevronUp,{className:W.cx("size-3.5 text-foreground",k.column.getIsSorted()==="desc"?"opacity-30":""),"aria-hidden":"true"}),e.jsx(f.ChevronDown,{className:W.cx("size-3.5 text-foreground",k.column.getIsSorted()==="asc"?"opacity-30":""),"aria-hidden":"true"})]}):null]}):E.flexRender(k.column.columnDef.header,k.getContext())},k.id))},y.id))}),e.jsx(Or,{children:h.getRowModel().rows.length?h.getRowModel().rows.map(y=>y.getIsGrouped()?e.jsx(qe,{children:y.getVisibleCells().map(k=>k.column.getIndex()<y.depth?null:e.jsx(Ye,{colSpan:k.column.getIndex()==y.depth?y.depth+1:void 0,className:k.column.getIndex()==y.depth?"w-36":"",children:k.getIsGrouped()?e.jsxs(T,{variant:"link",onClick:y.getToggleExpandedHandler(),className:"text-right text-foreground",style:{marginLeft:y.depth+"rem"},children:[y.getIsExpanded()?e.jsx(f.ChevronDown,{}):e.jsx(f.ChevronRight,{})," ",E.flexRender(k.column.columnDef.cell,k.getContext())," ","(",y.subRows.length,")"]}):k.column.id=="DTActions"?E.flexRender(k.column.columnDef.cell,k.getContext()):k.getIsAggregated()?E.flexRender(k.column.columnDef.aggregatedCell??k.column.columnDef.cell,k.getContext()):k.getIsPlaceholder()?null:E.flexRender(k.column.columnDef.cell,k.getContext())},k.id))},y.id):e.jsx(qe,{className:W.cx(y.getIsSelected()?"bg-accent/10":""),...r?.checkBoxColumn&&{onClick:()=>y.toggleSelected(!y.getIsSelected())},children:y.getVisibleCells().map((k,B)=>e.jsxs(Ye,{className:W.cx(y.getIsSelected()?"relative":"",!(r?.actionMenu||r?.groupActionMenu)&&"py-2"),children:[B===0&&y.getIsSelected()&&e.jsx("div",{className:"absolute inset-y-0 left-0 w-0.5 bg-primary"}),k.getIsPlaceholder()?null:E.flexRender(k.column.columnDef.cell,k.getContext())]},k.id))},y.id)):e.jsx(qe,{children:e.jsx(Ye,{colSpan:t.length,className:"h-24 text-center",children:"No results."})})}),r?.footer&&e.jsx(Br,{className:"sticky bottom-0 bg-background text-foreground",children:h.getFooterGroups().map(y=>e.jsx(qe,{children:y.headers.map(k=>e.jsx(Ye,{children:k.isPlaceholder?null:e.jsx("div",{className:"flex items-center",children:E.flexRender(k.column.columnDef.footer,k.getContext())})}))}))})]})})]})]}),(r?.paginationBar==null||r.paginationBar)&&e.jsx(yn,{table:h,extraParams:r})]})});function Sn({isLoading:t,onReload:a,errorMessage:r}){return!t&&!r?null:e.jsx("div",{className:"absolute inset-0 z-50 flex items-center justify-center bg-background/60 backdrop-blur-md rounded-lg transition-all duration-300",children:e.jsx("div",{className:"flex flex-col items-center gap-4",children:t?e.jsx("div",{className:"bg-background/80 p-6 rounded-2xl shadow-xl border border-border/50 backdrop-blur-xl animate-in fade-in zoom-in duration-300",children:e.jsx(f.Loader2,{size:48,className:"text-primary animate-spin"})}):e.jsx("div",{className:"bg-background/80 p-4 rounded-full shadow-lg border border-border/50 backdrop-blur-xl animate-in fade-in zoom-in duration-300",children:e.jsx("button",{onClick:a,className:"p-3 rounded-full bg-primary/10 hover:bg-primary/20 transition-all text-primary hover:scale-110 active:scale-95",title:r||"Reload Data",children:e.jsx(f.RotateCcw,{className:"w-6 h-6"})})})})})}function _i(t){(t==null||typeof t!="object")&&(t={});const a={...t};return(a.toolbox===void 0||a.toolbox===null||typeof a.toolbox!="object")&&(a.toolbox={}),(a.toolbox.feature===void 0||a.toolbox.feature===null||typeof a.toolbox.feature!="object")&&(a.toolbox.feature={}),a}const zi=m.forwardRef(({parentDivProps:t={},option:a={},style:r={},settings:n={},loading:s=!0,theme:o,isConfigurable:i=!1,resizeKey:d,onClick:u=()=>{},onConfigure:c=()=>{}},x)=>{const g=m.useRef(null),w=m.useRef(null),N=_i(a);return i&&(N.toolbox.feature={...N.toolbox.feature,myConfigureChartTool:{show:!0,title:"Configure Chart",icon:"image://data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxNiIgaGVpZ2h0PSIxNiIgdmlld0JveD0iMCAwIDI0IDI0IiBmaWxsPSJub25lIiBzdHJva2U9ImN1cnJlbnRDb2xvciIgc3Ryb2tlLXdpZHRoPSIxIiBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiIGNsYXNzPSJsdWNpZGUgbHVjaWRlLXNldHRpbmdzLTIiPjxwYXRoIGQ9Ik0yMCA3aC05Ii8+PHBhdGggZD0iTTE0IDE3SDUiLz48Y2lyY2xlIGN4PSIxNyIgY3k9IjE3IiByPSIzIi8+PGNpcmNsZSBjeD0iNyIgY3k9IjciIHI9IjMiLz48L3N2Zz4=",onclick:()=>c?.()}}),m.useImperativeHandle(x,()=>({getChartObject:()=>g.current?Le.getInstanceByDom(g.current):null,setOption:(v,C)=>{if(!g.current)return;Le.getInstanceByDom(g.current)?.setOption(v,C)},resize:(v=0)=>{if(!g.current)return;const C=Le.getInstanceByDom(g.current);C?.resize(),v&&setTimeout(()=>C?.resize(),v)},loadingVisible:v=>{if(!g.current)return;const C=Le.getInstanceByDom(g.current);v?C?.showLoading():C?.hideLoading()},dispose:()=>{if(!g.current)return;Le.getInstanceByDom(g.current)?.dispose()},on:(v,C)=>{if(!g.current)return;Le.getInstanceByDom(g.current)?.on(v,C)}})),m.useEffect(()=>{g.current&&(w.current=Le.init(g.current,o));const v=()=>w.current?.resize?.();return window.addEventListener("resize",v),()=>{w.current&&(w.current.dispose(),w.current=null),window.removeEventListener("resize",v)}},[o]),m.useEffect(()=>{w.current&&w.current.setOption(N,n),w.current&&w.current.on("click",u)},[a,n,o]),m.useEffect(()=>{w.current&&w.current.resize()},[d]),m.useEffect(()=>{w.current&&setTimeout(()=>{w.current?.resize()},500)},[]),e.jsx("div",{ref:g,...t,style:{width:"100%",height:"100%",...r}})});function kn({tooltipContent:t,fileNamePlaceholder:a,fileName:r,onFileNameChange:n,...s}){const o=m.useRef(null);return e.jsx(e.Fragment,{children:e.jsxs("div",{className:"flex",children:[e.jsx(H,{ref:o,type:"file",className:"hidden",...s}),e.jsx("div",{className:"mx-1"}),e.jsx(H,{className:"rounded-e-none",placeholder:a,onChange:(...i)=>n?.(...i),value:r}),e.jsx(Re,{tooltipContent:t||"Browse File",onClick:()=>o?.current?.click(),className:"border-s-0 rounded-s-none",children:e.jsx(f.Upload,{})})]})})}const Fi=(({blur:t=0,inactiveZone:a=.7,proximity:r=0,spread:n=20,variant:s="default",glow:o=!1,className:i,movementDuration:d=2,borderWidth:u=1,disabled:c=!0})=>{const x=m.useRef(null),g=m.useRef({x:0,y:0}),w=m.useRef(0),N=m.useCallback(v=>{x.current&&(w.current&&cancelAnimationFrame(w.current),w.current=requestAnimationFrame(()=>{const C=x.current;if(!C)return;const{left:b,top:S,width:p,height:I}=C.getBoundingClientRect(),j=v?.x??g.current.x,h=v?.y??g.current.y;v&&(g.current={x:j,y:h});const D=[b+p*.5,S+I*.5],P=Math.hypot(j-D[0],h-D[1]),R=.5*Math.min(p,I)*a;if(P<R){C.style.setProperty("--active","0");return}const M=j>b-r&&j<b+p+r&&h>S-r&&h<S+I+r;if(C.style.setProperty("--active",M?"1":"0"),!M)return;const F=parseFloat(C.style.getPropertyValue("--start"))||0,De=(180*Math.atan2(h-D[1],j-D[0])/Math.PI+90-F+180)%360-180,Ce=F+De;pt.animate(F,Ce,{duration:d,ease:[.16,1,.3,1],onUpdate:y=>{C.style.setProperty("--start",String(y))}})}))},[a,r,d]);return m.useEffect(()=>{if(c)return;const v=()=>N(),C=b=>N(b);return window.addEventListener("scroll",v,{passive:!0}),document.body.addEventListener("pointermove",C,{passive:!0}),()=>{w.current&&cancelAnimationFrame(w.current),window.removeEventListener("scroll",v),document.body.removeEventListener("pointermove",C)}},[N,c]),e.jsxs(e.Fragment,{children:[e.jsx("div",{className:l("pointer-events-none absolute -inset-px hidden rounded-[inherit] border opacity-0 transition-opacity",o&&"opacity-100",s==="white"&&"border-white",c&&"!block")}),e.jsx("div",{ref:x,style:{"--blur":`${t}px`,"--spread":n,"--start":"0","--active":"0","--glowingeffect-border-width":`${u}px`,"--repeating-conic-gradient-times":"5","--gradient":s==="white"?"repeating-conic-gradient(from 236.84deg at 50% 50%,var(--black),var(--black) calc(25% / var(--repeating-conic-gradient-times)))":"linear-gradient(54.29deg, #00A5E9 22.93%, #A020F0 32.97%, #55C8FF 52.28%, #A020F0 73.13%, #071182 88.57%)"},className:l("pointer-events-none absolute inset-0 rounded-[inherit] opacity-100 transition-opacity",o&&"opacity-100",t>0&&"blur-[var(--blur)] ",i,c&&"!hidden"),children:e.jsx("div",{className:l("glow","rounded-[inherit]",'after:content-[""] after:rounded-[inherit] after:absolute after:inset-[calc(-1*var(--glowingeffect-border-width))]',"after:[border:var(--glowingeffect-border-width)_solid_transparent]","after:[background:var(--gradient)] after:[background-attachment:fixed]","after:opacity-[var(--active)] after:transition-opacity after:duration-300","after:[mask-clip:padding-box,border-box]","after:[mask-composite:intersect]","after:[mask-image:linear-gradient(#0000,#0000),conic-gradient(from_calc((var(--start)-var(--spread))*1deg),#00000000_0deg,#fff,#00000000_calc(var(--spread)*2deg))]")})})]})});function Nt({name:t,...a}){const r=Ls[t];return r?e.jsx(r,{...a}):(console.warn(`Icon "${t}" not found in lucide-react`),null)}const Mi=({size:t=48,className:a,visible:r=!0,...n})=>r?e.jsx("div",{className:"h-full w-full",children:e.jsx("div",{className:"absolute inset-0 flex justify-center items-center z-50",children:e.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:t,height:t,...n,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:l("animate-spin",a),children:e.jsx("path",{d:"M21 12a9 9 0 1 1-6.219-8.56"})})})}):null;function Ei({placeholder:t,items:a,onValueChange:r,defaultValue:n,defaultOptions:s=2}){const[o,i]=m.useState(n||[]),[d,u]=m.useState(""),c=m.useRef(null),[x,g]=m.useState(!1);m.useEffect(()=>{r(o)},[o,r]);const w=a.filter(p=>(p.label||p.value).toLowerCase().includes(d.toLowerCase())).sort((p,I)=>(p?.label??"").localeCompare(I?.label??"")),N=p=>{const I=p.currentTarget;I.scrollTop+=p.deltaY,p.preventDefault()},v=p=>{const I=o.includes(p)?o.filter(j=>j!==p):[...o,p];i(I)},[C,b]=m.useState(o.length),S=m.useCallback(()=>{const p=c.current;if(!p)return C;const I=Array.from(p.children),j=p.offsetWidth;let h=0,D=0;for(const P of I){const R=P.offsetWidth+4;if(h+R<=j)h+=R,D++;else break}return D},[C]);return m.useEffect(()=>{const p=c.current;if(!p)return;let I=null;const j=()=>{I&&cancelAnimationFrame(I),I=requestAnimationFrame(()=>{const D=S();b(P=>P!==D?D:P)})},h=new ResizeObserver(j);return h.observe(p),I=requestAnimationFrame(j),()=>{I&&cancelAnimationFrame(I),h.disconnect()}},[S]),e.jsxs(Q,{open:x,onOpenChange:g,children:[e.jsx(J,{asChild:!0,className:"w-full",children:e.jsxs(T,{variant:"outline",role:"combobox",className:l("justify-between px-3 py-2 h-10",o.length===0&&"text-foreground/50","bg-secondary"),onClick:()=>g(p=>!p),children:[o.length>0?e.jsx(_e,{children:e.jsxs("div",{ref:c,className:"flex flex-wrap gap-2 items-center overflow-hidden flex-1",children:[o.slice(0,s).map(p=>{const I=a.find(j=>j.value===p)?.label||p;return e.jsxs("span",{className:"flex items-center px-2 py-1 bg-secondary text-secondary-foreground rounded-md truncate max-w-full",title:I,children:[e.jsx("span",{className:"truncate max-w-[120px]",children:I}),e.jsx("span",{role:"button",tabIndex:0,onClick:j=>{j.stopPropagation(),v(p)},onKeyDown:j=>{(j.key==="Enter"||j.key===" ")&&(j.preventDefault(),j.stopPropagation(),v(p))},className:"ml-1 text-muted-foreground hover:text-destructive cursor-pointer outline-none",children:e.jsx(f.X,{className:"w-3 h-3 ml-1"})})]},p)}),o.length>s&&e.jsxs(ne,{children:[e.jsx(se,{asChild:!0,children:e.jsxs("span",{className:"px-2 py-1 bg-secondary text-secondary-foreground dark:bg-secondary dark:text-secondary-foreground keross:bg-secondary keross:text-secondary-foreground rounded-md cursor-pointer",children:["+",o.length-s," more"]})}),e.jsx(oe,{className:"max-w-xs break-words",children:e.jsx("div",{onWheel:N,className:"flex flex-col gap-1 max-h-[200px] overflow-auto",children:o.slice(s).map(p=>e.jsx("span",{className:"text-sm",children:a.find(I=>I.value===p)?.label||p},p))})})]})]})}):e.jsx("span",{className:"flex-1 text-left truncate",children:t}),e.jsx(f.ChevronsUpDown,{className:"ml-2 h-4 w-4 shrink-0 opacity-50"})]})}),e.jsx(Z,{className:"p-0 min-w-[var(--radix-popover-trigger-width)]",style:{width:"max-content",maxWidth:"min(500px, 90vw)"},align:"start",children:e.jsxs(Y,{onMouseDown:p=>p.preventDefault(),children:[e.jsx(ie,{placeholder:"Search...",value:d,onValueChange:u}),e.jsxs(le,{onWheel:N,className:"max-h-60 overflow-auto",children:[e.jsx(de,{children:"No items found."}),e.jsx(re,{children:w.map(p=>{const I=o.includes(p.value),j=p.disabled===!0||typeof p.disabled=="function"&&p.disabled(p);return e.jsxs(X,{value:p.label||p.value,disabled:j,onPointerDown:h=>{h.preventDefault(),h.stopPropagation()},onSelect:()=>{j||v(p.value)},className:l("flex items-center justify-between space-x-2",j&&"opacity-50 cursor-not-allowed"),children:[e.jsx(Ve,{checked:I,onCheckedChange:()=>{j||v(p.value)},onClick:h=>h.stopPropagation(),disabled:j}),e.jsx("span",{className:"flex-grow text-left",children:p?.label||p.value})]},p.value)})})]})]})})]})}function ca({text:t}){return e.jsxs("div",{className:"flex flex-col h-full justify-center text-center gap-2",children:[e.jsx(f.CircleAlert,{className:"text-muted-foreground mx-auto",size:36}),e.jsx("p",{className:"text-muted-foreground",children:t||"No Data Available"})]})}function Li({title:t,subtitle:a,tools:r,children:n}){return t=t??"",a=a??"",e.jsxs("div",{className:"flex flex-col gap-4 h-full",children:[e.jsxs("div",{className:"flex items-center justify-between gap-4",children:[e.jsxs("div",{className:"grid grid-cols-1 gap-1",children:[t&&e.jsx("h1",{className:"text-2xl font-semibold",children:t}),a&&e.jsx("p",{className:"text-muted-foreground/60",children:a})]}),e.jsx("div",{children:r})]}),n]})}const Oi=({value:t})=>{const a=As(t),r=a.score*100/4,n=()=>{switch(a.score){case 0:return"#828282";case 1:return"#EA1111";case 2:return"#FFAD00";case 3:return"#9bc158";case 4:return"#00b500";default:return""}};return e.jsx(e.Fragment,{children:e.jsx(Pt,{value:r,className:n()})})},va=({code:t})=>{const a=$s[t];return e.jsx(a,{})};function Bi({className:t,...a}){const[r,n]=m.useState(!1),[s,o]=m.useState(""),[i,d]=m.useState("");return e.jsxs(Q,{open:r,onOpenChange:n,children:[e.jsx(J,{asChild:!0,children:e.jsxs(T,{variant:"outline",role:"combobox","aria-expanded":r,className:"justify-between bg-secondary",children:[i?e.jsx(va,{code:i}):"...",e.jsx(f.ChevronsUpDown,{className:"opacity-50"})]})}),e.jsx(Z,{className:"p-0",align:"start",children:e.jsxs(Y,{filter:(u,c,x=[])=>(u.toLowerCase()+" "+x.join(" ").toLowerCase()).includes(c.toLowerCase())?1:0,children:[e.jsx(ie,{placeholder:"Search ...",className:"h-9"}),e.jsxs(le,{children:[e.jsx(de,{children:"No country found."}),e.jsx(re,{children:Object.entries(Ds.countries).map(([u,c])=>c.phone.map(x=>e.jsxs(X,{value:`${x}`,keywords:[c.name,"+"+x.toString(),u],onSelect:g=>{o(g===s?"":g),d(u),n(!1)},children:[e.jsx(va,{code:u})," ",c.name," +",x]},x)))})]})]})})]})}function In({buttonText:t,buttonIcon:a,buttonStyle:r,sheetContent:n,sheetDescription:s,sheetTitle:o,closeButton:i}){return e.jsxs(sa,{children:[e.jsx(hr,{asChild:!0,children:e.jsxs(T,{variant:"outline",className:r,size:"icon-sm",children:[t,a]})}),e.jsxs(oa,{className:"p-4",children:[e.jsx(ia,{children:o}),n]})]})}const Ui=f.icons;function Vi({title:t,iconName:a,iconSize:r,iconClass:n,primaryText:s,secondaryText:o,mainClassName:i="",loading:d,loadingMessage:u}){let c=null;return a&&(c=Ui[a]),r=r===void 0?20:r,n=n??"",u=u??"Loading...",e.jsx(wt,{className:i,children:e.jsxs(Ya,{className:"p-5",children:[e.jsxs("div",{className:"flex items-center justify-between gap-4",children:[e.jsx("span",{children:t}),d?e.jsx(f.LoaderCircle,{size:r,className:"animate-spin "+n}):c&&e.jsx(c,{size:r,className:n})]}),e.jsx("div",{className:"mt-6 text-2xl font-semibold",children:d?"...":s}),o&&e.jsx("small",{className:"mt-2 text-gray-400",children:d?u:o})]})})}function An({children:t,tabArray:a,pathName:r,tabListClass:n="",tabListInnerClass:s="",tabListButtonClass:o="",tabContentClass:i="",headerEndComponent:d,onTabChange:u,isSeperatePage:c=!1}){const[x,g]=m.useState(5),w=Rt(),[N,v]=m.useState([]),[C,b]=m.useState([]),[S,p]=m.useState(a.find(h=>h.default)?.tabId||a[0]?.tabId||"");m.useEffect(()=>{g(w?2:5)},[w]),m.useEffect(()=>{if(r&&c){const h=r.split("/").pop()||"";p(h)}},[r,c]),m.useEffect(()=>{v(a.slice(0,x)),b(a.slice(x))},[a,x]);const I=h=>{p(h),u?.(h)},j=h=>{v(D=>{const P=[...D],R=P.pop();return R&&b(M=>[...M.filter(F=>F.tabId!==h.tabId),R]),[...P,h]}),I(h.tabId)};return e.jsxs(Ur,{value:S,onValueChange:I,className:"w-full h-full flex flex-col",children:[e.jsxs($r,{className:`flex justify-between items-center ${n}`,children:[e.jsxs("div",{className:`flex w-full ${s}`,children:[N.map(h=>e.jsx(Gr,{value:h.tabId,className:o,children:h.tabName},h.tabId)),C.length>0&&e.jsxs(ve,{children:[e.jsx(je,{asChild:!0,children:e.jsx(ot,{variant:"outline",size:"sm",className:"mt-1",children:e.jsx(f.EllipsisVertical,{})})}),e.jsx(we,{children:C.map(h=>e.jsx(me,{onClick:()=>j(h),children:h.tabName},h.tabId))})]})]}),d&&e.jsx("div",{children:d})]}),t?e.jsx(Vt,{value:S,className:`mt-3 flex-grow overflow-auto h-full w-full ${i}`,children:e.jsx(wt,{className:"h-full w-full p-3",children:t})}):a.map(h=>e.jsx(Vt,{value:h.tabId,className:`mt-3 flex-grow overflow-auto h-full w-full ${i}`,children:e.jsx(wt,{className:"h-full w-full p-3",children:h?.tabContent})},h.tabId))]})}function Dn(){const{setTheme:t,theme:a,resolvedTheme:r}=Mr(),[n,s]=m.useState(!1);m.useEffect(()=>{s(!0)},[]);const o=a==="system"?r:a,i=N=>{const v=parseInt(N.slice(1),16),C=v>>16&255,b=v>>8&255,S=v>>0&255,[p,I,j]=[C,b,S].map(h=>(h=h/255,h<=.03928?h/12.92:Math.pow((h+.055)/1.055,2.4)));return .2126*p+.7152*I+.0722*j},d=N=>i(N)>.25?"#000000":"#ffffff",u=m.useCallback(()=>{const N=localStorage.getItem("primary")||"#0f172b",v=localStorage.getItem("secondary")||"#1b2336",C=localStorage.getItem("tertiary")||"#1f3aba",b=localStorage.getItem("primaryChart")||"#00bc7d",S=localStorage.getItem("secondaryChart")||"#fd9a00",p=localStorage.getItem("tertiaryChart")||"#ad46ff";document.documentElement.style.setProperty("--background",N),document.documentElement.style.setProperty("--secondary",v),document.documentElement.style.setProperty("--card",v),document.documentElement.style.setProperty("--popover",v),document.documentElement.style.setProperty("--muted",v),document.documentElement.style.setProperty("--sidebar",v),document.documentElement.style.setProperty("--btn-secondary",v),document.documentElement.style.setProperty("--accent",C),document.documentElement.style.setProperty("--sidebar-primary",C),document.documentElement.style.setProperty("--sidebar-accent",C),document.documentElement.style.setProperty("--foreground",d(N)),document.documentElement.style.setProperty("--secondary-foreground",d(v)),document.documentElement.style.setProperty("--card-foreground",d(v)),document.documentElement.style.setProperty("--popover-foreground",d(v)),document.documentElement.style.setProperty("--muted-foreground",d(v)),document.documentElement.style.setProperty("--sidebar-foreground",d(v)),document.documentElement.style.setProperty("--accent-foreground",d(C)),document.documentElement.style.setProperty("--sidebar-primary-foreground",d(C)),document.documentElement.style.setProperty("--sidebar-accent-foreground",d(C)),document.documentElement.style.setProperty("--chart-1",b),document.documentElement.style.setProperty("--chart-2",S),document.documentElement.style.setProperty("--chart-3",p),document.documentElement.style.setProperty("--chart-4",b),document.documentElement.style.setProperty("--chart-5",S)},[]),c=m.useCallback(()=>{document.documentElement.style.removeProperty("--background"),document.documentElement.style.removeProperty("--secondary"),document.documentElement.style.removeProperty("--card"),document.documentElement.style.removeProperty("--popover"),document.documentElement.style.removeProperty("--muted"),document.documentElement.style.removeProperty("--sidebar"),document.documentElement.style.removeProperty("--btn-secondary"),document.documentElement.style.removeProperty("--accent"),document.documentElement.style.removeProperty("--sidebar-primary"),document.documentElement.style.removeProperty("--sidebar-accent"),document.documentElement.style.removeProperty("--foreground"),document.documentElement.style.removeProperty("--secondary-foreground"),document.documentElement.style.removeProperty("--card-foreground"),document.documentElement.style.removeProperty("--popover-foreground"),document.documentElement.style.removeProperty("--muted-foreground"),document.documentElement.style.removeProperty("--sidebar-foreground"),document.documentElement.style.removeProperty("--accent-foreground"),document.documentElement.style.removeProperty("--sidebar-primary-foreground"),document.documentElement.style.removeProperty("--sidebar-accent-foreground"),document.documentElement.style.removeProperty("--chart-1"),document.documentElement.style.removeProperty("--chart-2"),document.documentElement.style.removeProperty("--chart-3"),document.documentElement.style.removeProperty("--chart-4"),document.documentElement.style.removeProperty("--chart-5")},[]);m.useEffect(()=>{n&&o==="blue-dark"&&(document.documentElement.classList.add("blue-dark"),u())},[n,o,u]);const x=m.useCallback(N=>{t(N),(N==="light"||N==="dark")&&(document.documentElement.classList.remove("blue-dark"),c()),N==="blue-dark"&&(document.documentElement.classList.add("blue-dark"),u())},[t,u,c]);if(!n)return null;const g=o==="blue-dark"?e.jsx(f.Waves,{className:"h-5 w-5"}):o==="dark"?e.jsx(f.Moon,{className:"h-5 w-5"}):o==="light"?e.jsx(f.Sun,{className:"h-5 w-5"}):e.jsx(f.Laptop,{className:"h-5 w-5"}),w=N=>o===N;return e.jsxs(ve,{children:[e.jsx(je,{asChild:!0,children:e.jsx(T,{variant:"outline",size:"icon","aria-label":"Change theme",title:`Theme: ${a==="system"?`system (${r})`:a}`,children:g})}),e.jsxs(we,{align:"end",sideOffset:8,children:[e.jsxs(me,{onClick:()=>x("light"),className:"flex items-center justify-between gap-2",children:[e.jsxs("div",{className:"flex items-center",children:[e.jsx(f.Sun,{className:"mr-2 h-4 w-4"})," Light"]}),w("light")&&e.jsx(f.Check,{className:"h-4 w-4"})]}),e.jsxs(me,{onClick:()=>x("dark"),className:"flex items-center justify-between gap-2",children:[e.jsxs("div",{className:"flex items-center",children:[e.jsx(f.Moon,{className:"mr-2 h-4 w-4"})," Dark"]}),w("dark")&&e.jsx(f.Check,{className:"h-4 w-4"})]}),e.jsxs(me,{onClick:()=>x("blue-dark"),className:"flex items-center justify-between gap-2",children:[e.jsxs("div",{className:"flex items-center",children:[e.jsx(f.Waves,{className:"mr-2 h-4 w-4"})," Custom"]}),w("blue-dark")&&e.jsx(f.Check,{className:"h-4 w-4"})]})]})]})}function $i({title:t,value:a,valueText:r,isPercent:n=!0,className:s,titleClassName:o,valueClassName:i,progressClassName:d}){let u=a.toFixed(2);const c=u.split(".");return c[1]==="00"&&(u=c[0]),e.jsxs("div",{className:"w-full "+(s??""),children:[e.jsxs("div",{className:"flex items-center justify-between gap-4",children:[e.jsx("div",{className:"text-muted-foreground text-sm "+(o??""),children:t}),e.jsx("div",{className:"text-sm "+(i??""),children:r??`${u}${n?"%":""}`})]}),e.jsx(Pt,{value:a,className:"w-full mt-2 "+(d??"")})]})}function Gi({processedData:t,value:a,onChange:r,placeholder:n="Select items...",searchPlaceholder:s="Search...",className:o}){const[i,d]=A.useState(!1),[u,c]=A.useState(""),{flatTree:x,itemMap:g}=t,w=A.useMemo(()=>{const b=new Map,S=new Set(a);return[...x].reverse().forEach(p=>{const I=g[p.id];if(!I||!p.treatAsParent||I.childrenIds.length===0)S.has(p.id)&&b.set(p.id,"checked");else{const j=I.childrenIds.map(P=>b.get(P)),h=j.filter(P=>P==="checked").length,D=j.filter(P=>P==="indeterminate").length;h===I.childrenIds.length?b.set(p.id,"checked"):(h>0||D>0)&&b.set(p.id,"indeterminate")}}),b},[a,x,g]),N=b=>{const S=new Set(a),p=w.get(b.id),I=!(p==="checked"||p==="indeterminate"),j=new Set,h=[...g[b.id]?.childrenIds||[]];for(;h.length>0;){const P=h.shift();j.add(P),(g[P]?.childrenIds||[]).forEach(M=>h.push(M))}I?(S.add(b.id),j.forEach(P=>S.add(P))):(S.delete(b.id),j.forEach(P=>S.delete(P)));let D=g[b.id]?.parentId;for(;D;){const P=g[D];P&&P.childrenIds.length>0&&(P.childrenIds.every(M=>S.has(M))?S.add(D):S.delete(D)),D=P?.parentId}r(Array.from(S))},v=A.useMemo(()=>{if(!u)return x.slice();const b=u.toLowerCase(),S=new Set;x.forEach(h=>{(h.title.toLowerCase().includes(b)||h.description.toLowerCase().includes(b)||h.index.toLowerCase().includes(b))&&S.add(h.id)});const p=new Set(S),I=h=>{let D=h;for(;D;){const P=g[D]?.parentId;if(P&&!p.has(P))p.add(P),D=P;else break}},j=h=>{const D=g[h]?.childrenIds||[];for(const P of D)p.has(P)||(p.add(P),j(P))};return S.forEach(h=>{I(h),j(h)}),x.filter(h=>p.has(h.id))},[u,x,g]),C=()=>{const b=a.filter(S=>{const p=g[S];return!p||p.childrenIds.length===0});if(b.length===0)return e.jsx("span",{className:"text-muted-foreground",children:n});if(b.length===1){const S=x.find(p=>p.id===b[0]);return S?S.index:n}return`${b.length} items selected`};return e.jsxs(Q,{open:i,onOpenChange:d,children:[e.jsx(J,{asChild:!0,children:e.jsxs(T,{variant:"outline",role:"combobox","aria-expanded":i,className:l("w-full justify-between transition-all duration-150 ease-in-out border hover:border-primary hover:shadow-sm bg-secondary cursor-pointer",o),children:[e.jsx("span",{className:"truncate",children:C()}),e.jsx(f.ChevronsUpDown,{className:l("ml-2 h-4 w-4 shrink-0 transition-transform duration-200",i&&"rotate-180")})]})}),e.jsx(Z,{className:"w-[--radix-popover-trigger-width] p-0 max-h-[400px] overflow-y-auto",children:e.jsxs(Y,{children:[e.jsx(ie,{placeholder:s,value:u,onValueChange:c}),e.jsxs(le,{className:"transition-all duration-200 ease-in-out",children:[e.jsx(de,{children:"No results found."}),v.map(b=>e.jsxs(X,{value:`${b.index} ${b.title} ${b.description}`,onSelect:()=>N(b),className:"flex items-start cursor-pointer gap-2",style:{paddingLeft:`${b.level*1.5+.75}rem`},children:[e.jsx("input",{type:"checkbox",className:"mt-1 h-4 w-4 accent-primary border rounded",checked:w.get(b.id)==="checked",ref:S=>{S&&(S.indeterminate=w.get(b.id)==="indeterminate")},readOnly:!0}),e.jsxs("div",{className:"flex flex-col",children:[e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx("span",{className:"text-xs font-mono text-muted-foreground bg-muted px-1.5 py-0.5 rounded",children:b.index}),e.jsx("span",{className:"font-medium",children:b.title})]}),e.jsx("p",{className:"text-sm text-muted-foreground",children:b.description})]})]},b.id))]})]})})]})}function qi({widgetData:t}){const a=t.slice(0,4),r=t.slice(4);return e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsx("div",{className:"flex flex-col md:flex-row gap-2",children:a.map(n=>e.jsxs("div",{className:"flex flex-1 flex-row justify-between border rounded-md p-2 border-l-4 border-l-primary",children:[e.jsxs("div",{className:"flex flex-col",children:[e.jsx(_e,{children:e.jsxs(ne,{children:[e.jsx(se,{className:"cursor-default select-text",children:e.jsx("p",{className:"font-medium max-w-[240px] truncate",children:n.widgetText})}),e.jsx(oe,{children:e.jsx("p",{children:n.widgetText})})]})}),e.jsx("div",{children:n.onButtonClickfunc?e.jsx(T,{className:"px-0",variant:"link",onClick:()=>n.onButtonClickfunc?.({id:n.id}),children:n.widgetNumber}):e.jsx("p",{className:"inline-flex items-center justify-center px-0 py-2 text-sm font-medium border border-transparent rounded-md",children:n.widgetNumber})})]}),e.jsx("div",{className:"flex justify-end items-center",children:n.iconName&&e.jsx(Nt,{name:n.iconName})})]},n.id))}),r.length>0&&e.jsx("div",{className:"flex flex-col md:flex-row gap-2",children:r.map(n=>e.jsxs("div",{className:"flex flex-1 flex-row justify-between border rounded-md p-2 border-l-4 border-l-primary",children:[e.jsxs("div",{className:"flex flex-col",children:[e.jsx(_e,{children:e.jsxs(ne,{children:[e.jsx(se,{className:"cursor-default select-text",children:e.jsx("p",{className:"font-medium max-w-[240px] truncate",children:n.widgetText})}),e.jsx(oe,{children:e.jsx("p",{children:n.widgetText})})]})}),e.jsx("div",{children:n.onButtonClickfunc?e.jsx(T,{className:"px-0",variant:"link",onClick:()=>n.onButtonClickfunc?.({id:n.id}),children:n.widgetNumber}):e.jsx("p",{className:"inline-flex items-center justify-center px-0 py-2 text-sm font-medium border border-transparent rounded-md",children:n.widgetNumber})})]}),e.jsx("div",{className:"flex justify-end items-center",children:n.iconName&&e.jsx(Nt,{name:n.iconName})})]},n.id))})]})}function Wi({onNavigate:t,onView:a,label:r,extraTools:n,view:s}){const[o,i]=m.useState(s===q.Views.DAY?"DAY":s===q.Views.WEEK?"WEEK":"MONTH");return e.jsx(e.Fragment,{children:e.jsxs("div",{className:"flex flex-col md:flex-row justify-between items-start md:items-center mb-3",children:[e.jsxs(Oe,{type:"single",variant:"outline",onValueChange:d=>{switch(d){case"PREV":t("PREV");break;case"NEXT":t("NEXT");break;case"TODAY":t("TODAY");break}},children:[e.jsx(V,{className:"rounded-e-none",value:"PREV",children:e.jsx(f.ChevronLeft,{size:16})}),e.jsx(V,{className:"rounded-none border-x",value:"NEXT",children:e.jsx(f.ChevronRight,{size:16})}),e.jsx(V,{className:"rounded-s-none",value:"TODAY",children:"Today"})]}),e.jsx("span",{className:"rbc-toolbar-label",children:r}),e.jsxs("div",{className:"flex flex-row gap-2",children:[e.jsxs(Oe,{type:"single",variant:"outline",value:o,onValueChange:d=>{switch(i(d),d){case"DAY":a(q.Views.DAY);break;case"WEEK":a(q.Views.WEEK);break;case"MONTH":a(q.Views.MONTH);break}},children:[e.jsx(V,{className:"rounded-e-none",value:"MONTH",children:"Month"}),e.jsx(V,{className:"rounded-none border-x-0",value:"WEEK",children:"Week"}),e.jsx(V,{className:"rounded-s-none",value:"DAY",children:"Day"})]}),n?.map((d,u)=>e.jsx(m.Fragment,{children:d},u))]})]})})}function Hi({event:t,extraParamsEvent:a}){return e.jsxs("div",{className:"custom-event flex flex-row justify-between",children:[e.jsx("span",{className:"truncate w-auto",children:t.title}),e.jsxs("span",{className:"flex flex-row gap-1",children:[(a?.isEditableAll||t.isEditable)&&e.jsx(ze,{tooltipContent:"Edit",children:e.jsx("button",{className:"event-edit-button w-fit px-1",onClick:r=>{r.stopPropagation(),a?.onEditEventClick?.(t)},children:e.jsx(f.SquarePen,{size:16})})}),e.jsx(ze,{tooltipContent:"View",children:e.jsx("button",{className:"event-view-button w-fit px-1",onClick:r=>{r.stopPropagation(),a?.onViewEventClick?.(t)},children:e.jsx(f.Eye,{size:16})})})]})]})}const Ki={"en-US":Ts.enUS},Xi=q.dateFnsLocalizer({format:Xe.format,parse:Xe.parse,startOfWeek:Xe.startOfWeek,getDay:Xe.getDay,locales:Ki});function Yi({events:t,extraParamsEvent:a,extraTools:r}){const[n,s]=m.useState(a?.defaultView==="day"?q.Views.DAY:a?.defaultView==="week"?q.Views.WEEK:a?.defaultView==="month"?q.Views.MONTH:a?.defaultView==="work week"?q.Views.WORK_WEEK:a?.defaultView==="agenda"?q.Views.AGENDA:q.Views.MONTH),[o,i]=m.useState(new Date);return e.jsx(q.Calendar,{localizer:Xi,events:t||[],startAccessor:"start",endAccessor:"end",views:[q.Views.DAY,q.Views.WEEK,q.Views.MONTH],view:n,onView:d=>s(d),date:o,onNavigate:d=>i(d),components:{event:d=>e.jsx(Hi,{event:d.event,extraParamsEvent:a}),toolbar:d=>e.jsx(Wi,{...d,extraTools:r,view:n})},style:{height:a?.height||"100%",margin:a?.margin||"0px"}})}const Pn=m.createContext(void 0);function Tn({children:t}){const[a,r]=m.useState([]),n=d=>{r(u=>[...u.filter(x=>x.level<d.level),d])},s=(d,u)=>{r(u?d:c=>[...c,...d])},o=d=>{r(u=>[...u.filter(x=>x.level<=d.level)])},i=()=>{r([])};return e.jsx(Pn.Provider,{value:{breadcrumbItems:a,addBreadcrumb:n,backBreadcrumb:o,addBreadcrumbItems:s,clearBreadcrumb:i},children:t})}function ua(){const t=m.useContext(Pn);if(!t)throw new Error("useBreadcrumb must be used within a BreadcrumbProvider");return t}function Rn(){const{breadcrumbItems:t,backBreadcrumb:a}=ua(),[r,n]=m.useState(!1),[s,o]=m.useState(2),i=Rt(),d=ue.useNavigate();m.useEffect(()=>{o(i?2:4)},[i]);const u=m.useMemo(()=>({firstVisibleBreadcrumbList:t.slice(0,2),hiddenBreadcrumbList:i?t.slice(2):t.slice(2,s),lastVisibleBreadcrumbList:t.length>2?t.slice(2-(t.length<s?t.length:s)):[]}),[t,s,i]);return!u||i==null||s==null?null:e.jsx(Wr,{children:e.jsxs(Hr,{children:[u.firstVisibleBreadcrumbList.map((c,x)=>x<t.length-1?e.jsxs(m.Fragment,{children:[e.jsx(We,{children:c.href?e.jsx(Gt,{className:"max-w-20 truncate md:max-w-none cursor-pointer",onClick:()=>{a(c),c.href&&d(c.href)},children:c.title}):e.jsx(Qe,{className:"max-w-20 truncate md:max-w-none",children:c.title})}),e.jsx(bt,{},"firstsep"+x)]},"first"+x):e.jsx(We,{children:e.jsx(Qe,{className:"max-w-20 truncate md:max-w-none",children:c.title})},"first"+x)),t.length>s?e.jsxs(e.Fragment,{children:[e.jsx(We,{children:i?e.jsxs(Qr,{open:r,onOpenChange:n,children:[e.jsx(Jr,{"aria-label":"Toggle Menu",children:e.jsx(qt,{className:"h-4 w-4"})}),e.jsxs(an,{children:[e.jsxs(rn,{className:"text-left",children:[e.jsx(sn,{children:"Navigate to"}),e.jsx(on,{children:"Select a page to navigate to."})]}),e.jsx("div",{className:"grid gap-1 px-2 lg:px-4",children:u.hiddenBreadcrumbList.map((c,x)=>e.jsx("div",{children:c.clickable==!1?e.jsx("span",{className:"py-1 text-sm",children:c.title}):e.jsx(ue.Link,{to:c.href?c.href:"#",className:"py-1 text-sm",children:c.title})},x))}),e.jsx(nn,{className:"pt-4",children:e.jsx(en,{asChild:!0,children:e.jsx(T,{variant:"outline",children:"Close"})})})]})]}):e.jsxs(ve,{open:r,onOpenChange:n,children:[e.jsx(je,{className:"flex items-center gap-1","aria-label":"Toggle menu",children:e.jsx(qt,{className:"h-4 w-4"})}),e.jsx(we,{align:"start",children:u.hiddenBreadcrumbList.map((c,x)=>e.jsx(me,{children:c.href?e.jsx(ue.Link,{to:c.href?c.href:"#",children:c.title}):e.jsx("span",{children:c.title})},x))})]})}),!i&&e.jsx(bt,{})]}):null,!i&&u.lastVisibleBreadcrumbList.map((c,x)=>x==u.lastVisibleBreadcrumbList.length-1?e.jsx(We,{children:e.jsx(Qe,{className:"max-w-20 truncate md:max-w-none cursor-pointer",children:c.title})},"last"+x):e.jsxs(m.Fragment,{children:[e.jsx(We,{children:c.href?e.jsx(Gt,{className:"max-w-20 truncate md:max-w-none cursor-pointer",onClick:()=>{a(c),c.href&&d(c.href)},children:c.title}):e.jsx(Qe,{className:"max-w-20 truncate md:max-w-none",children:c.title})}),e.jsx(bt,{},"lastsep"+x)]},"last"+x))]},"BreadcrumbList1")},"Breadcrumb1")}function Qi({breadcrumb:t}){const{addBreadcrumb:a}=ua();return m.useEffect(()=>{a(t)},[t]),e.jsx(e.Fragment,{})}const _n=m.createContext(void 0);function zn({children:t}){const[a,r]=m.useState([]),[n,s]=m.useState(null),[o,i]=m.useState(null),d=N=>{r(v=>v.some(b=>b.title===N.title)?v.map(b=>b.title===N.title?{...b,...N}:b):[...v,N])},u=N=>{r(v=>v.filter(C=>C.title!==N))},c=(N,v)=>{r(C=>C.map(b=>b.title===N?{...b,...v}:b))},x=N=>{s(N)},g=N=>{i(N)},w=()=>{r([])};return e.jsx(_n.Provider,{value:{navItems:a,header:n,footer:o,setNavItems:r,addNavItem:d,removeNavItem:u,updateNavItem:c,clearNavItems:w,setSidebarHeader:x,setSidebarFooter:g},children:t})}function lt(){const t=m.useContext(_n);if(!t)throw new Error("useSidebarNav must be used within a SidebarNavProvider");return t}function Fn(){const{navItems:t}=lt(),{pathname:a}=ue.useLocation();return e.jsx(Dr,{children:e.jsx(Pr,{children:t.map(r=>r.items&&r.items.length>0?e.jsx(Kr,{asChild:!0,defaultOpen:r.isActive,className:"group/collapsible",children:e.jsxs(Ot,{children:[e.jsx(Xr,{asChild:!0,children:e.jsxs(Bt,{asChild:!0,tooltip:r.title,isActive:a===r.url||a.startsWith(`${r.url}/`),children:[r.icon&&e.jsx(r.icon,{}),e.jsx("span",{children:r.title}),e.jsx(f.ChevronRight,{className:"ml-auto transition-transform duration-200 group-data-[state=open]/collapsible:rotate-90"})]})}),e.jsx(Yr,{children:e.jsx(Tr,{children:r.items.map(n=>e.jsx(Rr,{children:e.jsx(_r,{asChild:!0,isActive:a===n.url||a.startsWith(`${n.url}/`),children:e.jsx(ue.Link,{to:n.url,children:e.jsx("span",{children:n.title})})})},n.title))})})]})},r.title):e.jsx(Ot,{children:e.jsx(Bt,{asChild:!0,tooltip:r.title,isActive:a===r.url||a.startsWith(`${r.url}/`),children:e.jsxs(ue.Link,{to:r.url,className:"flex items-center gap-2 w-full",children:[r.icon&&e.jsx(r.icon,{}),e.jsx("span",{children:r.title})]})})},r.title))})})}function Ji({items:t,sidebarHeader:a,sidebarFooter:r}){const{setNavItems:n,setSidebarHeader:s,setSidebarFooter:o}=lt();return m.useEffect(()=>{n(t),s(a),o(r)},[t,a,r,n,s,o]),null}function Zi({formControl:t,name:a,label:r,placeholder:n,formDescription:s,items:o,disabled:i,onSelect:d}){return e.jsx(e.Fragment,{children:e.jsx(fe,{control:t,name:a,render:({field:u})=>e.jsxs(ge,{className:"",children:[r&&e.jsx(e.Fragment,{children:e.jsx(Ne,{children:r})}),e.jsxs(Q,{children:[e.jsx(J,{asChild:!0,className:"w-full",children:e.jsx(pe,{children:e.jsxs(T,{variant:"outline",role:"combobox",className:l("justify-between",!u.value&&"text-muted-foreground"),disabled:i==!0||i&&i(...arguments),children:[u.value?o.find(c=>c.value===u.value)?.label||u.value:n,e.jsx(f.ChevronsUpDown,{className:"opacity-50"})]})})}),e.jsx(Z,{className:"p-0",align:"start",children:e.jsxs(Y,{children:[e.jsx(ie,{placeholder:"Search..."}),e.jsxs(le,{children:[e.jsx(de,{children:"No items found."}),e.jsx(re,{children:o.map(c=>e.jsxs(X,{value:c.value,disabled:c.disabled==!0||c.disabled&&c.disabled(c),onSelect:x=>{u.onChange(x),d&&d(x)},children:[c?.label||c.value,e.jsx(f.Check,{className:l("ml-auto",c.value===u.value?"opacity-100":"opacity-0")})]},c.value))})]})]})})]}),s&&e.jsx(ye,{children:s}),e.jsx(he,{})]})})})}function el(t){const{field:a}=Ke.useController({name:t.name,control:t.formControl}),r=t.value!==void 0?t.value:a.value;return e.jsx(fe,{control:t.formControl,name:t.name,render:({field:n})=>e.jsxs(ge,{className:"",children:[t.label&&e.jsxs(e.Fragment,{children:[e.jsx(Ne,{children:t.label}),e.jsx("br",{})]}),e.jsxs(Q,{children:[e.jsx(J,{asChild:!0,className:"w-full",children:e.jsx(pe,{children:e.jsxs(T,{variant:"outline",role:"combobox",className:l("justify-between",!r&&"text-muted-foreground"),disabled:typeof t.disabled=="function"?t.disabled():t.disabled,children:[r?t.items.find(s=>s.value===r)?.label||r:t.placeholder,e.jsx(f.ChevronsUpDown,{className:"opacity-50"})]})})}),e.jsx(Z,{className:"p-0",align:"start",children:e.jsxs(Y,{children:[e.jsx(ie,{placeholder:"Search..."}),e.jsxs(le,{children:[e.jsx(de,{children:"No items found."}),e.jsx(re,{children:t.items.map(s=>e.jsxs(X,{value:s.value,disabled:typeof s.disabled=="function"?s.disabled(s):s.disabled,onSelect:o=>{n.onChange(o),t.onSelect&&t.onSelect(o),t.onChange&&t.onChange(o)},children:[s?.label||s.value,e.jsx(f.Check,{className:l("ml-auto",s.value===r?"opacity-100":"opacity-0")})]},s.value))})]})]})})]}),t.formDescription&&e.jsx(ye,{children:t.formDescription}),e.jsx(he,{})]})})}function tl({formControl:t,name:a,label:r,placeholder:n,dateFormat:s,calendarDateDisabled:o,formDescription:i,disabled:d}){return e.jsx(e.Fragment,{children:e.jsx(fe,{control:t,name:a,render:({field:u})=>e.jsxs(ge,{children:[r&&e.jsx(e.Fragment,{children:e.jsx(Ne,{children:r})}),e.jsxs(Q,{children:[e.jsx(J,{asChild:!0,className:"w-full",children:e.jsx(pe,{children:e.jsxs(T,{variant:"outline",className:l(!u.value&&"text-foreground/50"),disabled:d,children:[u.value?Xe.format(u.value,s||"PPP"):e.jsx("span",{children:n||"Pick a date"}),e.jsx(f.CalendarIcon,{className:"ml-auto h-4 w-4 opacity-50"})]})})}),e.jsx(Z,{className:"w-auto p-0",align:"start",children:e.jsx(Ka,{mode:"single",selected:u.value,onSelect:u.onChange,disabled:o,captionLayout:"dropdown",autoFocus:!0})})]}),i&&e.jsx(ye,{children:i}),e.jsx(he,{})]})})})}function al(){return e.jsx(e.Fragment,{})}function rl({formControl:t,label:a,formDescription:r,extraFormComponent:n,name:s,...o}){return e.jsx(e.Fragment,{children:e.jsx(fe,{control:t,name:s,render:({field:i})=>e.jsxs(ge,{children:[a&&e.jsx(Ne,{children:a}),e.jsx(pe,{children:e.jsx(H,{...i,...o})}),n&&n(i.value),r&&e.jsx(ye,{children:r}),e.jsx(he,{})]})})})}function nl({formControl:t,name:a,label:r,placeholder:n,formDescription:s,items:o=[],disabled:i,onSelect:d,defaultValue:u=[],defaultOptions:c=2}){const[x,g]=m.useState(""),w=m.useRef(null),N=o.filter(v=>v.label?.toLowerCase().includes(x.toLowerCase())).sort((v,C)=>(v?.label??"").localeCompare(C?.label??""));return e.jsx(fe,{control:t,name:a,render:({field:v})=>{m.useEffect(()=>{(v.value===void 0||v.value===null)&&u.length>0&&v.onChange(u)},[u,v]);const C=v.value||[],[b,S]=m.useState(C.length),p=m.useCallback(()=>{const h=w.current;if(!h)return b;const D=Array.from(h.children);let P=h.offsetWidth,R=0,M=0;for(const F of D){const ce=F.offsetWidth+4;if(R+ce<=P)R+=ce,M++;else break}return M},[b]);m.useEffect(()=>{const h=w.current;if(!h)return;let D=null;const P=new ResizeObserver(()=>{D&&cancelAnimationFrame(D),D=requestAnimationFrame(()=>{const R=p();S(M=>M!==R?R:M)})});return P.observe(h),S(p()),()=>{D&&cancelAnimationFrame(D),P.disconnect()}},[p]);const I=h=>{let D;C.includes(h)?D=C.filter(P=>P!==h):D=[...C,h],v.onChange(D),d&&d(D)},j=h=>{const D=h.currentTarget;D.scrollTop+=h.deltaY,h.preventDefault()};return e.jsxs(ge,{children:[r&&e.jsx(Ne,{children:r}),e.jsxs(Q,{children:[e.jsx(J,{asChild:!0,className:"w-full",children:e.jsx(pe,{children:e.jsxs(T,{variant:"outline",role:"combobox",className:l("justify-between",!C.length&&"text-foreground/50"),disabled:i===!0||i&&i(...arguments),children:[C.length>0?e.jsx(_e,{children:e.jsxs("div",{ref:w,className:"flex flex-wrap gap-2 items-center overflow-hidden",children:[C.slice(0,c).map(h=>{const D=o.find(P=>P.value===h)?.label||h;return e.jsxs("span",{className:"flex items-center px-2 py-1 bg-secondary text-secondary-foreground rounded-md truncate max-w-full",title:D,children:[e.jsx("span",{className:"truncate max-w-[120px]",children:D}),e.jsx("span",{role:"button",tabIndex:0,onClick:P=>{P.stopPropagation();const R=C.filter(M=>M!==h);v.onChange(R),d&&d(R)},onKeyDown:P=>{if(P.key==="Enter"||P.key===" "){P.preventDefault(),P.stopPropagation();const R=C.filter(M=>M!==h);v.onChange(R),d&&d(R)}},className:"ml-1 text-muted-foreground hover:text-destructive cursor-pointer outline-none",children:e.jsx(f.X,{className:"w-3 h-3 ml-1"})})]},h)}),C.length>c&&e.jsxs(ne,{children:[e.jsx(se,{asChild:!0,children:e.jsxs("span",{className:"px-2 py-1 bg-secondary text-secondary-foreground rounded-md cursor-pointer",children:["+",C.length-c," more"]})}),e.jsx(oe,{className:"max-w-xs break-words",children:e.jsx("div",{onWheel:j,className:"flex flex-col gap-1 max-h-[200px] overflow-auto",children:C.slice(c).map(h=>e.jsx("span",{className:"text-sm",children:o.find(D=>D.value===h)?.label||h},h))})})]})]})}):n,e.jsx(f.ChevronsUpDown,{className:"opacity-50"})]})})}),e.jsx(Z,{id:"multiSelectPopover",className:"p-0 min-w-[--radix-popover-trigger-width]",style:{width:"max-content",maxWidth:"min(500px, 90vw)"},align:"start",children:e.jsxs(Y,{id:"commandPopover",children:[e.jsx(ie,{placeholder:"Search...",value:x,onValueChange:g,autoFocus:!0}),e.jsxs(le,{className:"max-h-60 overflow-auto",onWheel:j,children:[e.jsx(de,{children:"No items found."}),e.jsx(re,{children:N.map(h=>{const D=C.includes(h.value);return e.jsxs(X,{value:h.label??"",onSelect:()=>I(h.value),className:"flex items-center space-x-2 justify-start",children:[e.jsx(Ve,{checked:D,onCheckedChange:()=>I(h.value),onClick:P=>P.stopPropagation()}),e.jsx("span",{children:h.label})]},h.value)})})]})]})})]}),s&&e.jsx(ye,{children:s}),e.jsx(he,{})]})}})}function sl({formControl:t,label:a,formDescription:r,extraFormComponent:n,name:s,...o}){return e.jsx(e.Fragment,{children:e.jsx(fe,{control:t,name:s,render:({field:i})=>e.jsxs(ge,{children:[a&&e.jsx(Ne,{children:a}),e.jsx(pe,{children:e.jsx(un,{maxLength:4,...i,children:e.jsxs(mn,{children:[e.jsx(Je,{index:0}),e.jsx(Je,{index:1}),e.jsx(Je,{index:2}),e.jsx(Je,{index:3})]})})}),n&&n(i.value),r&&e.jsx(ye,{children:r}),e.jsx(he,{})]})})})}function ol(){return e.jsx("div",{children:"FormPhoneInput"})}function il({formControl:t,name:a,label:r,formItemClass:n,formDescription:s,...o}){return e.jsx(e.Fragment,{children:e.jsx(fe,{control:t,name:a,render:({field:i})=>e.jsxs(ge,{className:n,children:[r&&e.jsx(Ne,{children:r}),e.jsx(pe,{children:e.jsx(qr,{...i,...o})}),s&&e.jsx(ye,{children:s}),e.jsx(he,{})]})})})}function ll({formControl:t,label:a,formDescription:r,extraFormComponent:n,name:s,...o}){const[i,d]=A.useState(!1),u=()=>d(!i);return e.jsx(e.Fragment,{children:e.jsx(fe,{control:t,name:s,render:({field:c})=>e.jsxs(ge,{children:[a&&e.jsx(Ne,{children:a}),e.jsxs("div",{className:"relative",children:[e.jsx(pe,{children:e.jsx(H,{type:i?"text":"password",...c,...o,className:`${o.className||""} pr-10`})}),e.jsx(T,{type:"button",variant:"ghost",size:"icon",className:"absolute right-0 top-0 h-full px-3 py-2 text-muted-foreground hover:bg-transparent!",onClick:u,children:i?e.jsx(f.EyeOff,{className:"h-4 w-4"}):e.jsx(f.Eye,{className:"h-4 w-4"})})]}),n&&n(c.value),r&&e.jsx(ye,{children:r}),e.jsx(he,{})]})})})}function dl({rowCount:t=6,showToolbar:a=!0}){return e.jsxs("div",{className:"space-y-4",children:[a&&e.jsxs("div",{className:"flex justify-between",children:[e.jsx(Be,{className:"h-8 w-64 rounded-md"}),e.jsx(Be,{className:"h-8 w-32 rounded-md"})]}),e.jsx("div",{className:"space-y-4",children:[...Array(t)].map((r,n)=>e.jsx("div",{className:"grid gap-4 items-center",children:e.jsx(Be,{className:"h-8 w-full"})},n))})]})}function cl({count:t}){return e.jsx("div",{className:"flex flex-row gap-3 w-full",children:t>0&&Array.from({length:t}).map((a,r)=>e.jsx(Be,{className:"w-1/"+t+" flex flex-col md:flex-row gap-2 h-20",children:e.jsx("div",{className:"flex flex-1 flex-row justify-between border rounded-md p-2 bg-card-new"})},"widget_"+r))})}function Mn(){const t=Ke.useForm({defaultValues:{text:"",fileNames:[]}}),[a,r]=m.useState(""),[n,s]=m.useState([]),[o,i]=m.useState([]),[d,u]=m.useState(""),[c,x]=m.useState(!0),g=o.some(b=>b.progress<100),w=async(b,S)=>{const p=new FormData;p.append("file",S.file);try{const I=await ka.post("UPLOAD_ENDPOINT_URL",p,{onUploadProgress:j=>{const h=Math.round(j.loaded*100/(j.total||1));i(D=>D.map((P,R)=>R===b?{...P,progress:h}:P))}});i(j=>j.map((h,D)=>D===b?{...h,url:I.data.url,progress:100}:h))}catch(I){console.error("Upload failed:",I)}};m.useEffect(()=>{const b=new Date,S=String(b.getDate()).padStart(2,"0"),p=String(b.getMonth()+1).padStart(2,"0"),I=b.getFullYear();u(`${S}-${p}-${I}`)},[]),m.useEffect(()=>{o.forEach((b,S)=>{b.progress===0&&w(S,b)})},[o]);const N=()=>{if(a.trim()||o.length>0){const b={text:a.trim(),fileNames:o.map(S=>S.name)};s([b,...n]),r(""),i([]),x(!1)}},v=b=>{if(b.target.files){const S=Array.from(b.target.files).map(p=>({name:p.name,url:"",progress:0,file:p}));i(p=>[...p,...S]),x(!1)}},C=b=>{const S=o.filter((p,I)=>I!==b);i(S),S.length===0&&n.length===0&&x(!0)};return e.jsx(e.Fragment,{children:e.jsxs("div",{className:"flex flex-col h-full w-full gap-3",children:[e.jsxs("div",{className:"flex-grow overflow-auto flex flex-col-reverse gap-2",children:[c&&e.jsx(ca,{text:"No files uploaded"}),o.length>0&&e.jsxs("div",{className:"p-2 my-1 rounded-md border",children:[e.jsx("p",{className:"font-bold",children:"Selected Files:"}),o.map((b,S)=>e.jsxs("div",{className:"flex flex-col mb-2",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("a",{href:b.url,download:b.name,className:"text-sm text-blue-600 underline cursor-pointer",children:b.name}),e.jsx("button",{onClick:()=>C(S),className:"text-red-500 hover:text-red-800",children:e.jsx(f.X,{className:"w-4 h-4"})})]}),e.jsx(Pt,{value:b.progress}),e.jsxs("p",{className:"text-xs text-gray-500",children:[b.progress,"% uploaded"]})]},S))]}),n.map((b,S)=>e.jsxs("div",{className:"border-b text-sm pb-2",children:[b.fileNames.map((p,I)=>e.jsx("p",{children:e.jsx("a",{href:o.find(j=>j.name===p)?.url||"#",download:p,className:"text-sm text-blue-500 underline cursor-pointer",children:p})},I)),e.jsx("p",{children:b.text||"(No Text)"}),e.jsxs("div",{className:"flex justify-between",children:[e.jsx("p",{children:"John Doe"}),e.jsx("p",{children:d})]})]},S))]}),e.jsx(ln,{...t,children:e.jsx("form",{onSubmit:t.handleSubmit(()=>N()),children:e.jsx("div",{className:"flex flex-col",children:e.jsxs("div",{className:"flex items-center justify-center gap-2",children:[e.jsx("div",{className:"flex-1",children:e.jsx(fe,{name:"text",render:({field:b})=>e.jsxs(ge,{children:[e.jsx(pe,{children:e.jsx(H,{id:"text-input",type:"text",value:a,onChange:S=>r(S.target.value),placeholder:"Type something..."})}),e.jsx(he,{})]})})}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(Se,{htmlFor:"file-upload",className:"sr-only",children:"Upload Files"}),e.jsx(T,{variant:"outline",asChild:!0,children:e.jsx("label",{htmlFor:"file-upload",className:"cursor-pointer",children:e.jsx(f.UploadIcon,{className:"w-5 h-5"})})}),e.jsx(H,{id:"file-upload",type:"file",multiple:!0,onChange:v,className:"hidden"})]}),e.jsx(T,{variant:"outline",type:"submit",disabled:g,children:e.jsx(f.Send,{})})]})})})})]})})}function En({...t}){const{navItems:a,header:r,footer:n}=lt();return!a||a.length===0?null:e.jsxs(Nr,{className:"ml-12",collapsible:"offcanvas",...t,children:[r&&e.jsx(kr,{children:r}),e.jsx(Ar,{children:e.jsx(Fn,{})}),n&&e.jsx(Ir,{children:n}),e.jsx(Cr,{})]})}function Ln(){return e.jsx("footer",{className:"ml-12 flex border-t px-4 py-2 justify-center lg:justify-start",children:e.jsxs("div",{className:"flex gap-2 items-center",children:[e.jsx(f.Copyright,{className:"size-4"}),e.jsx("span",{children:"Powered By"}),e.jsx("a",{href:"https://keross.com",target:"_blank",children:"Keross"}),e.jsx("span",{className:"",children:"|"}),e.jsx("span",{id:"txtCopyrightYear",className:"",children:new Date().getFullYear()})]})})}const te={IKON_ACCOUNT_API_URL:"",IKON_AUTH_API_URL:"",IKON_BASE_API_URL:"",IKON_PLATFORM_API_URL:"",IKON_PLATFORM_PROFILE_URL:"",IKON_PLATFORM_UI_URL:"",IKON_USER_API_URL:"",LOGIN_PAGE_URL:""},ul=t=>{te.IKON_BASE_API_URL=t.IKON_BASE_API_URL,te.IKON_PLATFORM_API_URL=`${t.IKON_BASE_API_URL}/platform`,te.IKON_AUTH_API_URL=`${te.IKON_PLATFORM_API_URL}/auth`,te.IKON_USER_API_URL=`${te.IKON_PLATFORM_API_URL}/user`,te.IKON_ACCOUNT_API_URL=`${te.IKON_PLATFORM_API_URL}/account`,te.LOGIN_PAGE_URL=t.LOGIN_PAGE_URL,te.IKON_PLATFORM_UI_URL=t.IKON_PLATFORM_UI_URL,te.IKON_PLATFORM_PROFILE_URL=`${t.IKON_PLATFORM_UI_URL}/setting/profile`},be=()=>te;function On(){const{navItems:t}=lt(),{IKON_PLATFORM_UI_URL:a}=be();return e.jsx("header",{className:"ml-12 flex h-12 border-b shrink-0 items-center gap-2 transition-[width,height] ease-linear group-has-data-[collapsible=icon]/sidebar-wrapper:h-12",children:e.jsxs("div",{className:"flex items-center justify-between gap-2 px-4 w-full",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[!t||t.length===0?e.jsx("div",{}):e.jsx(yr,{className:"-ml-1"}),!t||t.length===0?e.jsx("div",{}):e.jsx(Tt,{orientation:"vertical",className:"mr-2 data-[orientation=vertical]:h-4"}),e.jsx(Rn,{})]}),e.jsxs("div",{className:"ml-auto flex gap-4",children:[e.jsx(Re,{className:"px-2!",tooltipContent:"Notifications",children:e.jsx(f.Bell,{})}),e.jsx(Dn,{}),e.jsx(ue.Link,{to:`${a}/app-store`,children:e.jsxs(it,{variant:"default",children:[e.jsx(f.Play,{}),"App Store"]})})]})]})})}const ma="ikoncloud_next_";function Ht(t,a,r){let n=r?.expires;!n&&r?.maxAge&&(n=r.maxAge/86400),Qt.set(ma+t,a,{httpOnly:!1,sameSite:"lax",expires:n})}function yt(t){return Qt.get(ma+t)}function Kt(t){Qt.remove(ma+t)}async function ml(){}async function dt(t){const a=yt("accessToken"),r=yt("refreshToken");if(a)return a;if(r){const n=await Bn(r,t?.isSetToken);if(n)return n}return null}async function Bn(t,a){try{const r=await fetch(`${be().IKON_AUTH_API_URL}/refresh-token`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({refreshToken:t})});if(r.ok){const s=await r.json(),{accessToken:o,refreshToken:i,expiresIn:d,refreshExpiresIn:u}=s;if(a==null||a)try{Ht("accessToken",o,{maxAge:d}),Ht("refreshToken",i,{maxAge:u})}catch(c){console.error(c)}return o}}catch(r){console.error("Failed to refresh access token:",r)}return null}function Xt(){Kt("accessToken"),Kt("refreshToken"),typeof window<"u"&&(window.location.href=be().LOGIN_PAGE_URL)}const Fe=ka.create();Fe.interceptors.request.use(async t=>{const a=await dt();return a&&t.headers&&(t.headers.Authorization=`Bearer ${a}`),t},t=>Promise.reject(t instanceof Error?t:new Error(String(t))));Fe.interceptors.response.use(t=>t,async t=>{const a=t.config;if(t.response?.status===401&&a&&!a._retry){a._retry=!0;try{const r=await dt({isSetToken:!0});if(r&&a.headers)return a.headers.Authorization=`Bearer ${r}`,Fe(a);Xt()}catch(r){return Xt(),Promise.reject(r instanceof Error?r:new Error(String(r)))}}return Promise.reject(t instanceof Error?t:new Error(String(t)))});function xl(t){return Ue.useQuery({queryKey:["profile",t],queryFn:async()=>{if(!t)throw new Error("No userId");return(await Fe.get(`${be().IKON_USER_API_URL}/${t}`)).data},enabled:!!t})}function fl(){const t=Ue.useQueryClient();return Ue.useMutation({mutationFn:async a=>{await Fe.post(`${be().IKON_AUTH_API_URL}/switch-account`,{targetAccountId:a})},onSuccess:()=>{t.invalidateQueries({queryKey:["accounts"]}),t.invalidateQueries({queryKey:["profile"]})}})}function gl(){return Ue.useQuery({queryKey:["accountMembership"],queryFn:async()=>{const{data:t}=await Fe.get(`${be().IKON_BASE_API_URL}/platform/user/account-membership`);return t}})}function pl(){return Ue.useQuery({queryKey:["softwares"],queryFn:async()=>{const{data:t}=await Fe.get(`${be().IKON_BASE_API_URL}/platform/software/accessible/user`);return t}})}const Un=m.createContext(void 0);function hl({children:t}){const[a,r]=m.useState(null);m.useEffect(()=>{const d=yt("accessToken");if(d)try{const u=Rs.jwtDecode(d);r(c=>({...c,userId:u.sub,primaryAccountId:u.primaryAccountId,activeAccountId:u.activeAccountId,roles:u.platformAccess?.roles??[]}))}catch{r(null)}},[]);const n=a?.userId??"",{data:s,isSuccess:o}=xl(n);m.useEffect(()=>{o&&s&&r(d=>({...d,...s}))},[o,s]);const i=d=>{r(u=>({...u,accountName:d}))};return e.jsx(Un.Provider,{value:{user:a,setUser:r,setAccountName:i},children:t})}function Vn(){const t=m.useContext(Un);if(!t)throw new Error("useUser must be used within a UserProvider");return t}function bl(){const{user:t,setUser:a}=Vn();return e.jsxs(ve,{children:[e.jsx(je,{asChild:!0,children:e.jsx(T,{variant:"ghost",size:"icon",className:"h-10 w-10",children:e.jsx(f.CircleUserRound,{className:"h-8 w-8"})})}),e.jsxs(we,{className:"w-55 p-0",side:"right",sideOffset:8,children:[e.jsxs("div",{className:"flex items-start gap-3 p-4 bg-card",children:[e.jsx(f.CircleUserRound,{className:"h-8 w-8"}),e.jsxs("div",{className:"flex flex-col gap-0.5 flex-1 min-w-0",children:[e.jsx("p",{className:"text-sm font-bold text-foreground blue-dark:text-muted-foreground truncate",children:t?.userName}),e.jsx("p",{className:"text-xs text-muted-foreground truncate",children:t?.userEmail}),e.jsx("p",{className:"text-sm text-muted-foreground font-semibold"})]})]}),e.jsx(rt,{className:"my-0"}),e.jsxs(me,{onClick:async()=>{Xt()},className:"flex items-center gap-2 px-4 py-3 cursor-pointer focus:bg-destructive dark:focus:bg-destructive blue-dark:focus:bg-destructive",children:[e.jsx(f.LogOut,{className:"h-4 w-4 text-foreground"}),e.jsx("span",{children:"Log out"})]})]})]})}function vl(){const{data:t}=gl(),{user:a,setAccountName:r}=Vn(),n=i=>i?i.split(" ").map(d=>d[0]).join("").toUpperCase().slice(0,2):"UN";m.useEffect(()=>{const i=t?.find(d=>d.accountId===a?.activeAccountId);r(i?.accountName||"")},[t]);const{mutateAsync:s}=fl(),o=async i=>{await s(i.accountId),r(i.accountName)};return e.jsxs(ve,{children:[e.jsx(je,{asChild:!0,children:e.jsx(T,{variant:"default",className:"mb-4 h-8 w-8 rounded-lg p-0",disabled:!a?.accountName,children:e.jsx("span",{className:"text-base font-medium text-accent-background",children:a?n(a.accountName):"..."})})}),e.jsxs(we,{className:"w-55",side:"right",sideOffset:8,align:"start",children:[e.jsx("div",{className:"px-2 py-1.5 text-xs font-semibold text-foreground",children:"Accounts"}),t?.map(i=>e.jsxs(me,{className:"flex items-center justify-between cursor-pointer",onClick:async()=>{try{await o(i),window.location.reload()}catch(d){console.error("Switch account failed",d)}},children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("div",{className:"h-6 w-6 rounded bg-primary/10 flex items-center justify-center",children:e.jsx("span",{className:"text-xs font-medium text-primary",children:n(i.accountName)})}),e.jsx("span",{className:"text-sm",children:i.accountName})]}),a?.activeAccountId===i.accountId&&e.jsx(f.Check,{className:"h-4 w-4 text-primary"})]},i.accountId))]})]})}function jl(){const{IKON_PLATFORM_UI_URL:t}=be(),{data:a}=pl();function r(n){return n.split("-").map(s=>s.charAt(0).toUpperCase()+s.slice(1)).join("")}return e.jsxs(e.Fragment,{children:[" ",e.jsx("nav",{className:"flex flex-col gap-1",children:e.jsxs(ne,{children:[e.jsx(se,{asChild:!0,className:"h-8 w-8",children:e.jsx(T,{variant:"ghost",size:"icon",className:"h-10 w-10",asChild:!0,children:e.jsxs(ue.Link,{to:`${t}/home`,children:[e.jsx(f.Home,{className:"h-8 w-8"}),e.jsx("span",{className:"sr-only",children:"Home"})]})})}),e.jsx(oe,{side:"right",sideOffset:5,children:"Home"})]},"home")}),e.jsx("nav",{className:"flex flex-col gap-1 flex-1",children:a?.map(n=>{if(!n.visible)return null;const s=!!(n.icon&&n.icon.trim()!=="");return e.jsxs(ne,{children:[e.jsx(se,{asChild:!0,className:"h-8 w-8",children:e.jsx(T,{variant:"ghost",size:"icon",className:"h-10 w-10",asChild:!0,children:e.jsxs(ue.Link,{to:n.url??"#",children:[s?e.jsx(Nt,{name:r(n.icon??""),className:"h-8 w-8"}):e.jsx(f.FolderCode,{className:"h-8 w-8"}),e.jsx("span",{className:"sr-only",children:n.softwareName})]})})}),e.jsx(oe,{side:"right",sideOffset:5,children:n.softwareName})]},n.softwareName)})})]})}const $n=()=>{const{IKON_PLATFORM_UI_URL:t}=be();return e.jsx(_e,{delayDuration:0,children:e.jsxs("aside",{className:"fixed left-0 top-0 z-20 h-screen w-12 border-r border-border bg-sidebar text-sidebar-foreground flex flex-col items-center py-4 ",children:[e.jsx(vl,{}),e.jsx(jl,{}),e.jsxs(ne,{children:[e.jsx(se,{asChild:!0,className:"h-8 w-8",children:e.jsx(T,{variant:"ghost",className:"h-10 w-10",asChild:!0,children:e.jsxs(ue.Link,{to:`${t}/settings`,children:[e.jsx(f.Settings,{className:"h-8 w-8"}),e.jsx("span",{className:"sr-only",children:"Settings"})]})})}),e.jsx(oe,{side:"right",sideOffset:5,children:"Settings"})]},"settings"),e.jsx(bl,{})]})})};function Gn({children:t}){return e.jsxs(e.Fragment,{children:[e.jsx($n,{}),e.jsx(wr,{children:e.jsx(bn,{children:e.jsxs(zn,{children:[e.jsx(En,{}),e.jsxs(Sr,{className:"flex flex-col h-screen",children:[e.jsx(On,{}),e.jsx("div",{className:"flex flex-col gap-4 p-4 pt-0 ml-12 grow overflow-auto scrollbar-hidden",children:t}),e.jsx(Ln,{})]})]})})})]})}const qn=m.createContext(void 0);function Wn({children:t}){const[a,r]=m.useState("Poppins"),[n,s]=m.useState(!1);m.useEffect(()=>{s(!0);const i=localStorage.getItem("app-font");i&&["Poppins","Oswald","Outfit"].includes(i)&&r(i)},[]),m.useEffect(()=>{if(!n)return;const i={Poppins:"var(--font-poppins)",Oswald:"var(--font-oswald)",Outfit:"var(--font-outfit)"};document.body.style.fontFamily=i[a],document.documentElement.style.fontFamily=i[a],localStorage.setItem("app-font",a),console.log("Font changed to:",a,i[a])},[a,n]);const o=m.useMemo(()=>({font:a,setFont:r}),[a]);return e.jsx(qn.Provider,{value:o,children:t})}const wl=()=>{const t=m.useContext(qn);if(t===void 0)throw new Error("useFont must be used within a FontProvider");return t},Hn=m.createContext(void 0);function Kn({children:t}){const[a,r]=m.useState(.5),[n,s]=m.useState(!1);m.useEffect(()=>{s(!0);const i=localStorage.getItem("app-radius");if(i){const d=parseFloat(i);[0,.25,.5,.75,1].includes(d)&&r(d)}},[]),m.useEffect(()=>{if(!n)return;const i=a===0?"0rem":`${a}rem`;document.documentElement.style.setProperty("--radius",i),localStorage.setItem("app-radius",a.toString()),console.log("Radius changed to:",a,i)},[a,n]);const o=m.useMemo(()=>({radius:a,setRadius:r}),[a]);return e.jsx(Hn.Provider,{value:o,children:t})}const Nl=()=>{const t=m.useContext(Hn);if(t===void 0)throw new Error("useRadius must be used within a RadiusProvider");return t},Xn=m.createContext(void 0);function yl({children:t}){const[a,r]=m.useState(0),n=m.useCallback(()=>{r(s=>s+1)},[]);return e.jsx(Xn.Provider,{value:{refresh:n,refreshCounter:a},children:t})}function Cl(){const t=m.useContext(Xn);if(t===void 0)throw new Error("useRefresh must be used within a RefreshProvider");return t}const Sl=new Ue.QueryClient;function kl({children:t}){return e.jsx(Ue.QueryClientProvider,{client:Sl,children:t})}function Il({children:t}){const a=be();if(!a.IKON_BASE_API_URL||!a.IKON_PLATFORM_UI_URL||!a.LOGIN_PAGE_URL)throw new Error("[IKON] ProviderWrapper: Ikon config not set. Please call setIkonConfig() before rendering ProviderWrapper.");return e.jsx(kl,{children:e.jsx(hl,{children:e.jsx(Fr,{children:e.jsx(Wn,{children:e.jsx(Kn,{children:e.jsx(Tn,{children:e.jsx(yl,{children:e.jsx(ue.BrowserRouter,{children:e.jsx(Gn,{children:t})})})})})})})})})}function Al({activityLogs:t=[]}){const a=[{tabName:"Activity",tabId:"tab-activity",default:!0,tabContent:e.jsx("div",{className:"overflow-auto flex flex-col gap-2 h-full",children:t.length>0?t.map(r=>e.jsxs("div",{className:"border-b text-sm pb-2",children:[e.jsx("p",{className:"font-medium pb-1",children:r.activity}),e.jsxs("p",{className:"text-gray-500 pb-1",children:["Updated On:"," ",e.jsx("span",{className:"text-gray-700",children:new Date(r.updatedOn).toLocaleString()})]}),e.jsxs("p",{className:"text-gray-500 pb-1",children:["Updated By: ",e.jsx("span",{className:"text-gray-700",children:r.updatedBy})]})]},r.id)):e.jsx(ca,{text:"No Activity Logs Available"})})},{tabName:"File Upload",tabId:"tab-upload",default:!1,tabContent:e.jsx(Mn,{})}];return e.jsx(In,{buttonText:"",buttonIcon:e.jsx(f.AlignJustify,{}),sheetTitle:"",sheetContent:e.jsx(An,{tabArray:a,tabListClass:""}),closeButton:!0})}const Dl=({src:t,onCroppedImage:a,aspectRatio:r,rotationAngle:n,zoomLevel:s,moveDirection:o})=>{const i=m.useRef(null);function d(u){const c=i.current?.cropper;if(c){const g=c.getCroppedCanvas().toDataURL("image/webp");a(g)}else console.log("Cropper instance is not available.")}return m.useEffect(()=>{const u=i.current?.cropper;u&&u.rotate(n)},[n]),m.useEffect(()=>{const u=i.current?.cropper;u&&u.getCropBoxData().width&&(console.log("Inside cropper scale"),u.scale(s))},[s]),m.useEffect(()=>{const u=i.current?.cropper;if(u&&u.getCropBoxData().width){const{x,y:g}=o;typeof x=="number"&&typeof g=="number"&&u.move(x,g)}},[o]),m.useEffect(()=>{const u=i.current?.cropper;if(u&&(u.setAspectRatio(r),r===1)){const c=u.getCanvasData(),x=c.width,g=c.height,w=c.left,N=c.top,v=200,C=100,b=w+(x-v)/2,S=N+(g-C)/2;u.setCropBoxData({left:b,top:S,width:v,height:C})}},[r]),e.jsx(Ia,{src:t,style:{height:"100%",width:"100%",objectFit:"contain"},guides:!0,crop:d,ref:i,dragMode:"move",movable:!0,zoomable:!0,scalable:!0,cropBoxMovable:!0,cropBoxResizable:!1})},Yn=m.memo(Dl),ja={landscape:4/3,portrait:3/4,icon:1/1};function Pl({onNewFileUpload:t}){const{originalImage:a,setOriginalImage:r,aspectRatioWiseImages:n,setAspectRatioWiseImages:s}=xa(),[o,i]=m.useState(null),[d,u]=m.useState(),[c,x]=m.useState(0),[g,w]=m.useState(1),[N,v]=m.useState({x:0,y:0}),[C,b]=m.useState(null),S=j=>{j.preventDefault(),p(j.dataTransfer.files[0])},p=j=>{if(typeof j=="string")b(j);else if(j?.type?.startsWith("image/")){t?.();const h=new FileReader;h.onloadend=()=>{b(h.result),u(void 0)},h.readAsDataURL(j),r({...a,image:j,name:j.name})}else Ca.toast.error("Please select a valid image file.")};m.useEffect(()=>{a.image&&p(a.image)},[a.image]);const I=j=>{const h=o&&d===j?o:n[j];return e.jsxs(e.Fragment,{children:[e.jsx("h3",{className:"mb-3",children:j}),e.jsx($t,{ratio:ja[j],className:"bg-muted",children:h&&e.jsx("img",{src:h,alt:`Preview ${j}`,className:"absolute inset-0 w-full h-full object-contain"})})]})};return m.useEffect(()=>{o&&s(d?{...n,[d]:o}:{landscape:o,portrait:o,icon:o})},[o]),e.jsx(e.Fragment,{children:e.jsxs("div",{className:"flex flex-col gap-3 h-full overflow-auto",children:[e.jsxs("div",{className:"flex flex-col lg:flex-row gap-3 justify-between",children:[e.jsxs("div",{className:"w-full flex flex-col gap-4",children:[e.jsx(Se,{htmlFor:"imageName",children:"Image Name"}),e.jsx(kn,{id:"inputImage",accept:"image/*",fileNamePlaceholder:"Enter image name",fileName:a?.name||"",onChange:j=>{const h=j.target.files?.[0];h&&p(h)},onFileNameChange:j=>{r({...a,name:j.target.value})}})]}),e.jsxs("div",{className:"w-full flex flex-col gap-4",children:[e.jsx(Se,{htmlFor:"imageDescription",children:"Image Description"}),e.jsx(H,{id:"imageDescription",placeholder:"Enter image Description",value:a?.description||"",onChange:j=>r({...a,description:j.target.value})})]})]}),e.jsxs("div",{className:"flex flex-col lg:flex-row gap-3",children:[e.jsxs("div",{className:"flex-grow flex flex-col gap-3",children:[e.jsxs("div",{children:[e.jsx("h3",{className:"mb-3",children:"Original Image"}),e.jsx($t,{ratio:4/3,className:"flex justify-center items-center bg-muted text-muted-foreground",onDrop:S,onDragOver:j=>j.preventDefault(),children:C?e.jsx(Yn,{src:C,onCroppedImage:i,aspectRatio:ja[d||"icon"],rotationAngle:c,zoomLevel:g,moveDirection:N}):e.jsxs("div",{className:"text-center",children:[e.jsx(Se,{htmlFor:"inputImage",children:"Drag and drop an image here"}),e.jsx("div",{className:"mt-3",children:e.jsx(ot,{variant:"outline",onClick:()=>document.getElementById("inputImage")?.click(),children:"Browse Image"})})]})})]}),e.jsxs("div",{className:"flex flex-col lg:flex-row gap-3 justify-between",children:[e.jsx("div",{children:e.jsxs(Oe,{type:"single",variant:"outline",value:d,onValueChange:j=>u(j),children:[e.jsx(V,{className:"rounded-e-none",value:"landscape",children:e.jsx(f.ImageIcon,{})}),e.jsx(V,{className:"rounded-none border-x-0",value:"portrait",children:e.jsx(f.FileImage,{})}),e.jsx(V,{className:"rounded-s-none",value:"icon",children:e.jsx(f.Square,{})})]})}),e.jsxs("div",{className:"flex flex-col lg:flex-row gap-3 justify-between",children:[e.jsxs(Oe,{type:"single",variant:"outline",value:"",onValueChange:j=>x(parseInt(j)),children:[e.jsx(V,{className:"rounded-e-none",value:"90",children:e.jsx(f.RotateCw,{})}),e.jsx(V,{className:"rounded-s-none border-s-0",value:"-90",children:e.jsx(f.RotateCcw,{})})]}),e.jsxs(Oe,{type:"single",variant:"outline",value:"",children:[e.jsx(V,{className:"rounded-e-none",value:"up",onClick:()=>v({x:0,y:-5}),children:e.jsx(f.ArrowUp,{})}),e.jsx(V,{className:"rounded-none border-x-0",value:"down",onClick:()=>v({x:0,y:5}),children:e.jsx(f.ArrowDown,{})}),e.jsx(V,{className:"rounded-none border-e-0",value:"left",onClick:()=>v({x:-5,y:0}),children:e.jsx(f.ArrowLeft,{})}),e.jsx(V,{className:"rounded-s-none",value:"right",onClick:()=>v({x:5,y:0}),children:e.jsx(f.ArrowRight,{})})]}),e.jsxs(Oe,{type:"single",variant:"outline",value:"",onValueChange:j=>w(h=>h+parseFloat(j)),children:[e.jsx(V,{className:"rounded-e-none",value:"0.1",children:e.jsx(f.ZoomIn,{})}),e.jsx(V,{className:"rounded-s-none border-s-0",value:"-0.1",children:e.jsx(f.ZoomOut,{})})]})]})]})]}),e.jsxs("div",{className:"flex flex-row lg:flex-col gap-3 w-full lg:w-48",children:[e.jsx("div",{className:"w-5/5",children:I("landscape")}),e.jsx("div",{className:"w-4/5",children:I("portrait")}),e.jsx("div",{className:"w-3/5",children:I("icon")})]})]})]})})}const Qn=m.memo(Pl);function Jn({open:t,onOpenChange:a,onCropperChange:r}){const{originalImage:n,aspectRatioWiseImages:s}=xa();return e.jsx(kt,{modal:!0,open:t,onOpenChange:o=>{a(o)},children:e.jsxs(It,{className:"max-w-full lg:max-w-5xl max-h-full overflow-auto",children:[e.jsx(ra,{children:e.jsx(At,{children:"Image to upload"})}),e.jsx(Qn,{}),e.jsx(er,{children:e.jsx(ot,{onClick:()=>{r(n,s),a(!1)},children:"Save Changes"})})]})})}async function gt(t,a=""){if(!t||!t.resourceId)return null;try{return`${be().IKON_BASE_API_URL}/platform/file-resource/download/${a}/${t.resourceId}`}catch(r){return console.error("Error getting resource URL:",r),null}}async function Tl(t){if(!t)return null;const a=t.originalImageInfo?await gt(t.originalImageInfo):null,r=t.landscapeImageInfo?await gt(t.landscapeImageInfo):null,n=t.portraitImageInfo?await gt(t.portraitImageInfo):null,s=t.iconImageInfo?await gt(t.iconImageInfo):null;return{originalImage:{image:a,name:t.imageName,description:t.imageDescription},aspectRatioWiseImages:{landscape:r,portrait:n,icon:s}}}const Zn=m.createContext(void 0);function Rl({children:t,uploadedImages:a,onCropperChange:r,modalOpen:n,onModalOpenChange:s}){const[o,i]=m.useState({landscape:null,portrait:null,icon:null}),[d,u]=m.useState({image:null,name:"",description:""});return m.useEffect(()=>{async function c(){if(a)try{const x=await Tl(a);x&&(u(g=>JSON.stringify(g)===JSON.stringify(x.originalImage)?g:x.originalImage),i(g=>JSON.stringify(g)===JSON.stringify(x.aspectRatioWiseImages)?g:x.aspectRatioWiseImages))}catch(x){console.error("Error processing uploaded images:",x)}}c()},[a]),e.jsxs(Zn.Provider,{value:{originalImage:d,setOriginalImage:u,aspectRatioWiseImages:o,setAspectRatioWiseImages:i},children:[t,n&&s&&e.jsx(Jn,{open:n,onOpenChange:s,onCropperChange:r})]})}const xa=()=>{const t=m.useContext(Zn);if(!t)throw new Error("useImageCropper must be used within a ImageCropperProvider");return t},es=({imageSrc:t,onCroppedImage:a,aspectRatio:r,rotationAngle:n,zoomLevel:s,moveDirection:o,currentState:i})=>{const d=m.useRef(null),u=()=>{const c=d.current?.cropper;if(c){c.setDragMode("move");const g=c.getCroppedCanvas().toDataURL();a(g)}else console.log("Cropper instance is not available.")};return m.useEffect(()=>{const c=d.current?.cropper;c&&c.rotate(n)},[n]),m.useEffect(()=>{const c=d.current?.cropper;c&&c.getCropBoxData().width&&(console.log("Inside cropper scale"),c.scale(s))},[s]),m.useEffect(()=>{const c=d.current?.cropper;if(c&&c.getCropBoxData().width){const{x:g,y:w}=o;typeof g=="number"&&typeof w=="number"&&c.move(g,w)}},[o]),m.useEffect(()=>{const c=d.current?.cropper;if(c&&(c.setAspectRatio(r),r===1)){const x=c.getCanvasData(),g=x.width,w=x.height,N=x.left,v=x.top,C=200,b=100,S=N+(g-C)/2,p=v+(w-b)/2;c.setCropBoxData({left:S,top:p,width:C,height:b})}},[r]),e.jsx(Ia,{src:t,style:{height:"100%",width:"100%",objectFit:"contain"},guides:!0,crop:u,ref:d,dragMode:"move",movable:!0,zoomable:!0,scalable:!0,cropBoxMovable:!0,cropBoxResizable:!1})},_l=({open:t,setOpen:a,onImageSubmit:r})=>{const[n,s]=m.useState(null),[o,i]=m.useState(null),[d,u]=m.useState({first:null,second:null,third:null}),[c,x]=m.useState(4/3),[g,w]=m.useState("first"),[N,v]=m.useState(0),[C,b]=m.useState(1),[S,p]=m.useState({x:0,y:0}),[I,j]=m.useState(""),h=()=>{console.log("Image Submit Button is pressed"),console.log(d),r(d.third),a(!1)},D=z=>{v(O=>O+z)},P=()=>{p({x:0,y:-5})},R=()=>{p({x:0,y:5})},M=()=>{p({x:-5,y:0})},F=()=>{p({x:5,y:0})},ce=()=>{b(z=>{const O=z+.2;return O<=2?O:z})},De=()=>{b(z=>{const O=z-.2;return O>=.2?O:z})},Ce=(z,O)=>{x(z),w(O)},y=z=>{if(z.type.startsWith("image/")){const O=new FileReader;O.onloadend=()=>{s(O.result),j(Pe=>Pe||z.name)},O.readAsDataURL(z)}else alert("Please drop a valid image file.")},k=z=>{z.preventDefault(),y(z.dataTransfer.files[0])},B=z=>{const O=o&&g===z?o:d[z];return O?e.jsx("div",{className:`
4
- ${z==="first"?"relative w-3/5 h-[200px] bg-slate-400":z==="second"?"relative w-1/2 h-[220px] bg-slate-400":"relative w-1/3 h-[120px] bg-slate-400"}`,children:e.jsx("img",{src:O,alt:`Preview ${z}`,className:"absolute inset-0 w-full h-full object-contain"})}):e.jsx("div",{className:`
5
- ${z==="first"?"relative w-3/5 h-[200px] bg-slate-400":z==="second"?"relative w-1/2 h-[220px] bg-slate-400":"relative w-1/3 h-[120px] bg-slate-400"}`})};return m.useEffect(()=>{o&&(d.first===null||d.second===null||d.third===null?u({first:o,second:o,third:o}):u(z=>({...z,[g]:o})))},[o]),e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"flex flex-row gap-2",children:[e.jsxs("div",{className:"flex-1",children:[e.jsx(Se,{htmlFor:"imageName",children:"Image Name"}),e.jsx(H,{id:"imageName",placeholder:"Enter image name",value:I,onChange:z=>j(z.target.value)})]}),e.jsxs("div",{className:"self-end",children:[e.jsx(T,{variant:"outline",onClick:()=>document.getElementById("inputImage1")?.click(),children:e.jsx(f.Upload,{})}),e.jsx(H,{id:"inputImage1",type:"file",accept:"image/png, image/jpeg",className:"hidden",onChange:z=>{const O=z.target.files?.[0];if(O&&O.type.startsWith("image/")){const Pe=new FileReader;Pe.onloadend=()=>{s(Pe.result),j(ee=>ee||O.name)},Pe.readAsDataURL(O),u({first:null,second:null,third:null})}}})]}),e.jsxs("div",{className:"flex-1",children:[e.jsx(Se,{htmlFor:"imageDesc",children:"Image Description"}),e.jsx(H,{id:"imageDesc",placeholder:"Describe your image"})]})]}),e.jsxs("div",{className:"flex flex-row gap-2",children:[e.jsx("div",{className:"w-3/5 flex justify-center items-center border-2 border-dashed border-gray-400 bg-gray-100",style:{height:"70vh"},onDrop:k,onDragOver:z=>z.preventDefault(),children:n?e.jsx(es,{imageSrc:n,onCroppedImage:i,aspectRatio:c,rotationAngle:N,zoomLevel:C,moveDirection:S,currentState:g}):e.jsxs("div",{className:"text-center",children:[e.jsx(Se,{htmlFor:"inputImage",children:"Drag and drop an image here"}),e.jsxs("div",{className:"mt-4",children:[e.jsx(T,{variant:"outline",onClick:()=>document.getElementById("inputImage")?.click(),children:"Upload Image"}),e.jsx(H,{id:"inputImage",type:"file",accept:"image/png, image/jpeg",className:"hidden",onChange:z=>{const O=z.target.files?.[0];O&&y(O)}})]})]})}),e.jsxs("div",{className:"w-2/5 flex flex-col gap-2",children:[e.jsx("h3",{children:"Landscape"}),B("first"),e.jsx("h3",{children:"Potrait"}),B("second"),e.jsx("h3",{children:"Icon"}),B("third")]})]}),e.jsxs("div",{className:"flex flex-row gap-1",children:[e.jsxs("div",{className:"w-3/5 flex flex-row justify-between",children:[e.jsxs("div",{children:[e.jsx(T,{variant:"outline",onClick:()=>Ce(4/3,"first"),children:e.jsx(f.ImageIcon,{})}),e.jsx(T,{variant:"outline",onClick:()=>Ce(3/4,"second"),children:e.jsx(f.FileImage,{})}),e.jsx(T,{variant:"outline",onClick:()=>Ce(1/1,"third"),children:e.jsx(f.Square,{})})]}),e.jsxs("div",{children:[e.jsx(T,{onClick:()=>D(90),variant:"outline",children:e.jsx(f.RotateCw,{})}),e.jsx(T,{onClick:()=>D(-90),variant:"outline",children:e.jsx(f.RotateCcw,{})})]}),e.jsxs("div",{children:[e.jsx(T,{onClick:()=>ce(),variant:"outline",children:e.jsx(f.ZoomIn,{})}),e.jsx(T,{onClick:()=>De(),variant:"outline",children:e.jsx(f.ZoomOut,{})})]}),e.jsxs("div",{children:[e.jsx(T,{onClick:P,variant:"outline",children:e.jsx(f.ArrowUp,{})}),e.jsx(T,{onClick:R,variant:"outline",children:e.jsx(f.ArrowDown,{})}),e.jsx(T,{onClick:M,variant:"outline",children:e.jsx(f.ArrowLeft,{})}),e.jsx(T,{onClick:F,variant:"outline",children:e.jsx(f.ArrowRight,{})})]})]}),e.jsx("div",{className:"w-2/5 flex flex-row-reverse",children:e.jsx(T,{onClick:h,children:"Save"})})]})]})},zl=m.memo(_l);function Fl(){return e.jsx("div",{className:"flex h-full items-center justify-center",children:e.jsxs("div",{className:"bg-background text-forefround rounded-xl p-6 text-center max-w-md",children:[e.jsx("div",{className:"text-3xl font-bold mb-2 animate-pulse",children:"🚧 Work in Progress"}),e.jsx("p",{className:"text-muted-foreground",children:"We’re currently working on this section. Check back soon!"})]})})}function Ml({formControl:t,name:a,label:r,options:n,placeholder:s="Select an option",emptyMessage:o="No options found.",onValueChange:i,className:d,addNewPlaceholder:u="Add custom value...",formDescription:c,disabled:x}){const[g,w]=A.useState(!1),[N,v]=A.useState(""),[C,b]=A.useState(n),[S,p]=A.useState(!1),[I,j]=A.useState("");return A.useEffect(()=>{b(n)},[n]),e.jsx(fe,{control:t,name:a,render:({field:h})=>{const D=C.find(R=>R.value===h.value),P=()=>{const R=I.trim();if(!R)return;if(C.some(F=>F.value===R)){const F=C.find(ce=>ce.value===R);F&&(h.onChange(F.value),i?.(F.value),j(""),p(!1),w(!1),v(""));return}const M={value:R,label:R,disabled:!0};b(F=>[...F,M]),h.onChange(R),i?.(R),j(""),p(!1),w(!1),v("")};return e.jsxs(ge,{className:l(d),children:[r&&e.jsxs(e.Fragment,{children:[e.jsx(Ne,{children:r}),e.jsx("br",{})]}),e.jsxs(Q,{open:g,onOpenChange:R=>{w(R),R||(v(""),p(!1),j(""))},children:[e.jsx(J,{asChild:!0,children:e.jsx(pe,{children:e.jsxs(T,{variant:"outline",role:"combobox","aria-expanded":g,className:l("w-full justify-between",!h.value&&"text-foreground/50",d),disabled:x||h.disabled,children:[e.jsx("span",{className:"line-clamp-1 text-left",children:h.value?D?D.label:h.value:s}),e.jsx(f.ChevronsUpDown,{className:"ml-2 h-4 w-4 shrink-0 opacity-50"})]})})}),e.jsx(Z,{className:"p-0 w-[--radix-popover-trigger-width]",align:"start",children:e.jsxs(Y,{shouldFilter:!0,children:[e.jsx(ie,{placeholder:"Search...",value:N,onValueChange:v}),e.jsxs(le,{children:[e.jsx(de,{children:N&&C.length>0?"No results found.":o}),e.jsx(re,{children:C.filter(R=>R.label.toLowerCase().includes(N.toLowerCase())||R.value.toLowerCase().includes(N.toLowerCase())).map(R=>e.jsxs(X,{value:R.value,onSelect:M=>{h.onChange(M),i?.(M),w(!1),v("")},className:"cursor-pointer",disabled:R?.disabled,children:[e.jsx(f.Check,{className:l("mr-2 h-4 w-4",h.value===R.value?"opacity-100":"opacity-0")}),R.label]},R.value))})]}),e.jsx("div",{className:"border-t p-2",children:S?e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(H,{placeholder:u,value:I,onChange:R=>j(R.target.value),onKeyDown:R=>{R.key==="Enter"&&(R.preventDefault(),P()),R.key==="Escape"&&(p(!1),j(""))},autoFocus:!0,className:"h-8"}),e.jsx(T,{size:"sm",variant:"ghost",onClick:()=>{p(!1),j("")},className:"h-8",children:"Cancel"}),e.jsx(T,{size:"sm",variant:"default",onClick:P,className:"h-8",disabled:!I.trim()||C.some(R=>R.value===I.trim()),children:"Add"})]}):e.jsxs(T,{variant:"outline",className:"w-full justify-start",onClick:()=>p(!0),children:[e.jsx(f.Plus,{className:"mr-2 h-4 w-4"}),"Add new option"]})})]})})]}),c&&e.jsx(ye,{children:c}),e.jsx(he,{})]})}})}const xe=m.forwardRef(({children:t,tooltip:a,side:r="bottom",className:n,...s},o)=>e.jsxs(ne,{children:[e.jsx(se,{asChild:!0,children:e.jsxs(T,{variant:"ghost",size:"icon",...s,className:l("aui-button-icon size-6 p-1",n),ref:o,children:[e.jsx(Yt.Slottable,{children:t}),e.jsx("span",{className:"aui-sr-only sr-only",children:a})]})}),e.jsx(oe,{side:r,children:a})]}));xe.displayName="TooltipIconButton";const El=()=>e.jsx(Ft.MarkdownTextPrimitive,{remarkPlugins:[zs],className:"aui-md",components:Ul}),Ll=m.memo(El),Ol=({language:t,code:a})=>{const{isCopied:r,copyToClipboard:n}=Bl(),s=()=>{!a||r||n(a)};return e.jsxs("div",{className:"aui-code-header-root mt-4 flex items-center justify-between gap-4 rounded-t-lg bg-muted-foreground/15 px-4 py-2 font-semibold text-foreground text-sm dark:bg-muted-foreground/20",children:[e.jsx("span",{className:"aui-code-header-language lowercase [&>span]:text-xs",children:t}),e.jsxs(xe,{tooltip:"Copy",onClick:s,children:[!r&&e.jsx(f.CopyIcon,{}),r&&e.jsx(f.CheckIcon,{})]})]})},Bl=({copiedDuration:t=3e3}={})=>{const[a,r]=m.useState(!1);return{isCopied:a,copyToClipboard:s=>{s&&navigator.clipboard.writeText(s).then(()=>{r(!0),setTimeout(()=>r(!1),t)})}}},Ul=Ft.unstable_memoizeMarkdownComponents({h1:({className:t,...a})=>e.jsx("h1",{className:l("aui-md-h1 mb-8 scroll-m-20 font-extrabold text-4xl tracking-tight last:mb-0",t),...a}),h2:({className:t,...a})=>e.jsx("h2",{className:l("aui-md-h2 mt-8 mb-4 scroll-m-20 font-semibold text-3xl tracking-tight first:mt-0 last:mb-0",t),...a}),h3:({className:t,...a})=>e.jsx("h3",{className:l("aui-md-h3 mt-6 mb-4 scroll-m-20 font-semibold text-2xl tracking-tight first:mt-0 last:mb-0",t),...a}),h4:({className:t,...a})=>e.jsx("h4",{className:l("aui-md-h4 mt-6 mb-4 scroll-m-20 font-semibold text-xl tracking-tight first:mt-0 last:mb-0",t),...a}),h5:({className:t,...a})=>e.jsx("h5",{className:l("aui-md-h5 my-4 font-semibold text-lg first:mt-0 last:mb-0",t),...a}),h6:({className:t,...a})=>e.jsx("h6",{className:l("aui-md-h6 my-4 font-semibold first:mt-0 last:mb-0",t),...a}),p:({className:t,...a})=>e.jsx("p",{className:l("aui-md-p mt-5 mb-5 leading-7 first:mt-0 last:mb-0",t),...a}),a:({className:t,...a})=>e.jsx("a",{className:l("aui-md-a font-medium text-primary underline underline-offset-4",t),...a}),blockquote:({className:t,...a})=>e.jsx("blockquote",{className:l("aui-md-blockquote border-l-2 pl-6 italic",t),...a}),ul:({className:t,...a})=>e.jsx("ul",{className:l("aui-md-ul my-5 ml-6 list-disc [&>li]:mt-2",t),...a}),ol:({className:t,...a})=>e.jsx("ol",{className:l("aui-md-ol my-5 ml-6 list-decimal [&>li]:mt-2",t),...a}),hr:({className:t,...a})=>e.jsx("hr",{className:l("aui-md-hr my-5 border-b",t),...a}),table:({className:t,...a})=>e.jsx("table",{className:l("aui-md-table my-5 w-full border-separate border-spacing-0 overflow-y-auto",t),...a}),th:({className:t,...a})=>e.jsx("th",{className:l("aui-md-th bg-muted px-4 py-2 text-left font-bold first:rounded-tl-lg last:rounded-tr-lg [[align=center]]:text-center [[align=right]]:text-right",t),...a}),td:({className:t,...a})=>e.jsx("td",{className:l("aui-md-td border-b border-l px-4 py-2 text-left last:border-r [[align=center]]:text-center [[align=right]]:text-right",t),...a}),tr:({className:t,...a})=>e.jsx("tr",{className:l("aui-md-tr m-0 border-b p-0 first:border-t [&:last-child>td:first-child]:rounded-bl-lg [&:last-child>td:last-child]:rounded-br-lg",t),...a}),sup:({className:t,...a})=>e.jsx("sup",{className:l("aui-md-sup [&>a]:text-xs [&>a]:no-underline",t),...a}),pre:({className:t,...a})=>e.jsx("pre",{className:l("aui-md-pre overflow-x-auto rounded-t-none!rounded-b-lg bg-black p-4 text-white",t),...a}),code:function({className:a,...r}){const n=Ft.useIsMarkdownCodeBlock();return e.jsx("code",{className:l(!n&&"aui-md-inline-code rounded border bg-muted font-semibold",a),...r})},CodeHeader:Ol}),Vl=({toolName:t,argsText:a,result:r,status:n})=>{const[s,o]=m.useState(!0),i=n?.type==="incomplete"&&n.reason==="cancelled",d=i&&n.error?typeof n.error=="string"?n.error:JSON.stringify(n.error):null;return e.jsxs("div",{className:l("aui-tool-fallback-root mb-4 flex w-full flex-col gap-3 rounded-lg border py-3",i&&"border-muted-foreground/30 bg-muted/30"),children:[e.jsxs("div",{className:"aui-tool-fallback-header flex items-center gap-2 px-4",children:[i?e.jsx(f.XCircleIcon,{className:"aui-tool-fallback-icon size-4 text-muted-foreground"}):e.jsx(f.CheckIcon,{className:"aui-tool-fallback-icon size-4"}),e.jsxs("p",{className:l("aui-tool-fallback-title grow",i&&"text-muted-foreground line-through"),children:[i?"Cancelled tool: ":"Used tool: ",e.jsx("b",{children:t})]}),e.jsx(T,{onClick:()=>o(!s),children:s?e.jsx(f.ChevronUpIcon,{}):e.jsx(f.ChevronDownIcon,{})})]}),!s&&e.jsxs("div",{className:"aui-tool-fallback-content flex flex-col gap-2 border-t pt-2",children:[d&&e.jsxs("div",{className:"aui-tool-fallback-cancelled-root px-4",children:[e.jsx("p",{className:"aui-tool-fallback-cancelled-header font-semibold text-muted-foreground",children:"Cancelled reason:"}),e.jsx("p",{className:"aui-tool-fallback-cancelled-reason text-muted-foreground",children:d})]}),e.jsx("div",{className:l("aui-tool-fallback-args-root px-4",i&&"opacity-60"),children:e.jsx("pre",{className:"aui-tool-fallback-args-value whitespace-pre-wrap",children:a})}),!i&&r!==void 0&&e.jsxs("div",{className:"aui-tool-fallback-result-root border-t border-dashed px-4 pt-2",children:[e.jsx("p",{className:"aui-tool-fallback-result-header font-semibold",children:"Result:"}),e.jsx("pre",{className:"aui-tool-fallback-result-content whitespace-pre-wrap",children:typeof r=="string"?r:JSON.stringify(r,null,2)})]})]})]})},wa=t=>Symbol.iterator in t,Na=t=>"entries"in t,ya=(t,a)=>{const r=t instanceof Map?t:new Map(t.entries()),n=a instanceof Map?a:new Map(a.entries());if(r.size!==n.size)return!1;for(const[s,o]of r)if(!n.has(s)||!Object.is(o,n.get(s)))return!1;return!0},$l=(t,a)=>{const r=t[Symbol.iterator](),n=a[Symbol.iterator]();let s=r.next(),o=n.next();for(;!s.done&&!o.done;){if(!Object.is(s.value,o.value))return!1;s=r.next(),o=n.next()}return!!s.done&&!!o.done};function Gl(t,a){return Object.is(t,a)?!0:typeof t!="object"||t===null||typeof a!="object"||a===null||Object.getPrototypeOf(t)!==Object.getPrototypeOf(a)?!1:wa(t)&&wa(a)?Na(t)&&Na(a)?ya(t,a):$l(t,a):ya({entries:()=>Object.entries(t)},{entries:()=>Object.entries(a)})}function ql(t){const a=m.useRef(void 0);return r=>{const n=t(r);return Gl(a.current,n)?a.current:a.current=n}}const Wl=t=>{const[a,r]=m.useState(void 0);return m.useEffect(()=>{if(!t){r(void 0);return}const n=URL.createObjectURL(t);return r(n),()=>{URL.revokeObjectURL(n)}},[t]),a},ts=()=>{const{file:t,src:a}=_.useAssistantState(ql(({attachment:r})=>{if(r.type!=="image")return{};if(r.file)return{file:r.file};const n=r.content?.filter(s=>s.type==="image")[0]?.image;return n?{src:n}:{}}));return Wl(t)??a},Hl=({src:t})=>{const[a,r]=m.useState(!1);return e.jsx("img",{src:t,alt:"Image Preview",width:1,height:1,className:a?"aui-attachment-preview-image-loaded block h-auto max-h-[80vh] w-auto max-w-full object-contain":"aui-attachment-preview-image-loading hidden",onLoad:()=>r(!0),loading:"lazy"})},Kl=({children:t})=>{const a=ts();return a?e.jsxs(kt,{children:[e.jsx(Qa,{className:"aui-attachment-preview-trigger cursor-pointer transition-colors hover:bg-accent/50",asChild:!0,children:t}),e.jsxs(It,{className:"aui-attachment-preview-dialog-content p-2 sm:max-w-3xl [&>button]:rounded-full [&>button]:bg-foreground/60 [&>button]:p-1 [&>button]:opacity-100 [&>button]:ring-0! [&_svg]:text-background [&>button]:hover:[&_svg]:text-destructive",children:[e.jsx(At,{className:"aui-sr-only sr-only",children:"Image Attachment Preview"}),e.jsx("div",{className:"aui-attachment-preview relative mx-auto flex max-h-[80dvh] w-full items-center justify-center overflow-hidden bg-background",children:e.jsx(Hl,{src:a})})]})]}):t},Xl=()=>{const t=_.useAssistantState(({attachment:r})=>r.type==="image"),a=ts();return e.jsxs(Ga,{className:"aui-attachment-tile-avatar h-full w-full rounded-none",children:[e.jsx(qa,{src:a,alt:"Attachment preview",className:"aui-attachment-tile-image object-cover"}),e.jsx(Wa,{delayMs:t?200:0,children:e.jsx(f.FileText,{className:"aui-attachment-tile-fallback-icon size-8 text-muted-foreground"})})]})},as=()=>{const a=_.useAssistantApi().attachment.source==="composer",r=_.useAssistantState(({attachment:s})=>s.type==="image"),n=_.useAssistantState(({attachment:s})=>{const o=s.type;switch(o){case"image":return"Image";case"document":return"Document";case"file":return"File";default:{const i=o;throw new Error(`Unknown attachment type: ${i}`)}}});return e.jsxs(ne,{children:[e.jsxs(_.AttachmentPrimitive.Root,{className:l("aui-attachment-root relative",r&&"aui-attachment-root-composer only:[&>#attachment-tile]:size-24"),children:[e.jsx(Kl,{children:e.jsx(se,{asChild:!0,children:e.jsx("div",{className:l("aui-attachment-tile size-14 cursor-pointer overflow-hidden rounded-[14px] border bg-muted transition-opacity hover:opacity-75",a&&"aui-attachment-tile-composer border-foreground/20"),role:"button",id:"attachment-tile","aria-label":`${n} attachment`,children:e.jsx(Xl,{})})})}),a&&e.jsx(Yl,{})]}),e.jsx(oe,{side:"top",children:e.jsx(_.AttachmentPrimitive.Name,{})})]})},Yl=()=>e.jsx(_.AttachmentPrimitive.Remove,{asChild:!0,children:e.jsx(xe,{tooltip:"Remove file",className:"aui-attachment-tile-remove absolute top-1.5 right-1.5 size-3.5 rounded-full bg-white text-muted-foreground opacity-100 shadow-sm hover:bg-white! [&_svg]:text-black hover:[&_svg]:text-destructive",side:"top",children:e.jsx(f.XIcon,{className:"aui-attachment-remove-icon size-3 dark:stroke-[2.5px]"})})}),Ql=()=>e.jsx("div",{className:"aui-user-message-attachments-end col-span-full col-start-1 row-start-1 flex w-full flex-row justify-end gap-2",children:e.jsx(_.MessagePrimitive.Attachments,{components:{Attachment:as}})}),Jl=()=>e.jsx("div",{className:"aui-composer-attachments mb-2 flex w-full flex-row items-center gap-2 overflow-x-auto px-1.5 pt-0.5 pb-1 empty:hidden",children:e.jsx(_.ComposerPrimitive.Attachments,{components:{Attachment:as}})}),Zl=()=>e.jsx(_.ComposerPrimitive.AddAttachment,{asChild:!0,children:e.jsx(xe,{tooltip:"Add Attachment",side:"bottom",variant:"ghost",size:"icon",className:"aui-composer-add-attachment size-8.5 rounded-full p-1 font-semibold text-xs hover:bg-muted-foreground/15 dark:border-muted-foreground/15 dark:hover:bg-muted-foreground/30","aria-label":"Add Attachment",children:e.jsx(f.PlusIcon,{className:"aui-attachment-add-icon size-5 stroke-[1.5px]"})})}),ed=({agents:t,selectedAgent:a,onSelectAgent:r,className:n,triggerClassName:s})=>{const[o,i]=m.useState(!1),d=a||null;return e.jsxs(ve,{open:o,onOpenChange:i,children:[e.jsx(je,{asChild:!0,children:e.jsxs(T,{variant:"outline",className:l("gap-2 px-3 py-2 text-sm font-medium rounded-2xl",s),children:[e.jsx("span",{className:"truncate",children:d?.agentName||"Select Agent"}),e.jsx(f.ChevronDownIcon,{className:"size-4 shrink-0 opacity-50"})]})}),e.jsx(we,{align:"end",className:l("min-w-[200px]",n),children:t.length>0?e.jsxs(e.Fragment,{children:[e.jsx(Dt,{className:"px-2 py-1.5 text-xs font-semibold text-muted-foreground",children:"Agents"}),e.jsx(rt,{}),e.jsx(na,{children:t.map(u=>e.jsxs(me,{onClick:()=>{r(u),i(!1)},className:l("cursor-pointer flex flex-col gap-1",d?.agentID===u.agentID&&"bg-accent"),children:[e.jsx("div",{className:"font-medium text-sm",children:u.agentName}),u.agentDescription&&e.jsx("div",{className:"text-xs text-muted-foreground truncate",children:u.agentDescription})]},u.agentID))})]}):e.jsx("div",{className:"px-2 py-1.5 text-sm text-muted-foreground text-center",children:"No agents available"})})]})},td=({currentUserDetails:t,agents:a=[],initialAgentId:r="default-agent",initialAgentName:n="Default Agent",onAgentChange:s})=>{const[o,i]=m.useState(a.find(d=>d.agentID===r));return e.jsx(pt.LazyMotion,{features:pt.domAnimation,children:e.jsx(pt.MotionConfig,{reducedMotion:"user",children:e.jsx(_.ThreadPrimitive.Root,{className:"aui-root aui-thread-root @container flex h-full flex-col bg-background",style:{"--thread-max-width":"44rem"},children:e.jsxs(_.ThreadPrimitive.Viewport,{turnAnchor:"top",className:"aui-thread-viewport relative flex flex-1 flex-col overflow-x-auto overflow-y-scroll scroll-smooth px-4 pt-4",children:[e.jsx(_.ThreadPrimitive.If,{empty:!0,children:e.jsx(rd,{currentUserDetails:t})}),e.jsx(_.ThreadPrimitive.Messages,{components:{UserMessage:cd,EditComposer:md,AssistantMessage:ld}}),e.jsxs(_.ThreadPrimitive.ViewportFooter,{className:"aui-thread-viewport-footer sticky bottom-0 mx-auto mt-4 flex w-full max-w-[var(--thread-max-width)] flex-col gap-4 overflow-visible rounded-t-3xl bg-background pb-4 md:pb-6",children:[e.jsx(ad,{}),e.jsx(sd,{agents:a,selectedAgent:o,onSelectAgent:d=>{i(d),s?.(d)}})]})]})})})})},ad=()=>e.jsx(_.ThreadPrimitive.ScrollToBottom,{asChild:!0,children:e.jsx(xe,{tooltip:"Scroll to bottom",variant:"outline",className:"aui-thread-scroll-to-bottom absolute -top-12 z-10 self-center rounded-full p-4 disabled:invisible dark:bg-background dark:hover:bg-accent",children:e.jsx(f.ArrowDownIcon,{})})}),rd=({currentUserDetails:t})=>{const r=new Date().getHours();let n="";return r>=5&&r<12?n="Good Morning":r>=12&&r<17?n="Good Afternoon":r>=17&&r<21?n="Good Evening":n="Good Night",console.log(n),e.jsxs("div",{className:"aui-thread-welcome-root mx-auto my-auto flex w-full max-w-[var(--thread-max-width)] flex-grow flex-col",children:[e.jsx("div",{className:"aui-thread-welcome-center flex w-full flex-grow flex-col items-center justify-center",children:e.jsxs("div",{className:"aui-thread-welcome-message flex size-full flex-col justify-center px-8",children:[e.jsx(Et.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},exit:{opacity:0,y:10},className:"aui-thread-welcome-message-motion-1 text-2xl font-semibold",children:`${n} ${t.userName.split(" ")[0]}`}),e.jsx(Et.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},exit:{opacity:0,y:10},transition:{delay:.1},className:"aui-thread-welcome-message-motion-2 text-2xl text-muted-foreground/65",children:"How can I help you today?"})]})}),e.jsx(nd,{})]})},nd=()=>e.jsx("div",{className:"aui-thread-welcome-suggestions grid w-full gap-2 pb-4 @md:grid-cols-2",children:[{title:"What's the weather",label:"in San Francisco?",action:"What's the weather in San Francisco?"},{title:"Explain React hooks",label:"like useState and useEffect",action:"Explain React hooks like useState and useEffect"},{title:"Write a SQL query",label:"to find top customers",action:"Write a SQL query to find top customers"},{title:"Create a meal plan",label:"for healthy weight loss",action:"Create a meal plan for healthy weight loss"}].map((t,a)=>e.jsx(Et.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},exit:{opacity:0,y:20},transition:{delay:.05*a},className:"aui-thread-welcome-suggestion-display [&:nth-child(n+3)]:hidden @md:[&:nth-child(n+3)]:block",children:e.jsx(_.ThreadPrimitive.Suggestion,{prompt:t.action,send:!0,asChild:!0,children:e.jsxs(T,{variant:"ghost",className:"aui-thread-welcome-suggestion h-auto w-full flex-1 flex-wrap items-start justify-start gap-1 rounded-3xl border px-5 py-4 text-left text-sm @md:flex-col dark:hover:bg-accent/60","aria-label":t.action,children:[e.jsx("span",{className:"aui-thread-welcome-suggestion-text-1 font-medium",children:t.title}),e.jsx("span",{className:"aui-thread-welcome-suggestion-text-2 text-muted-foreground",children:t.label})]})})},`suggested-action-${t.title}-${a}`))}),sd=({agents:t=[],selectedAgent:a,onSelectAgent:r})=>e.jsx(_.ComposerPrimitive.Root,{className:"aui-composer-root relative flex w-full flex-col",children:e.jsxs(_.ComposerPrimitive.AttachmentDropzone,{className:"aui-composer-attachment-dropzone group/input-group flex w-full flex-col rounded-3xl border border-input bg-background px-1 pt-2 shadow-xs transition-[color,box-shadow] outline-none has-[textarea:focus-visible]:border-ring has-[textarea:focus-visible]:ring-[3px] has-[textarea:focus-visible]:ring-ring/50 data-[dragging=true]:border-dashed data-[dragging=true]:border-ring data-[dragging=true]:bg-accent/50 dark:bg-background",children:[e.jsx(Jl,{}),e.jsx(_.ComposerPrimitive.Input,{placeholder:"Send a message...",className:"aui-composer-input mb-1 max-h-32 min-h-16 w-full resize-none bg-transparent px-3.5 pt-1.5 pb-3 text-base outline-none placeholder:text-muted-foreground focus-visible:ring-0",rows:1,autoFocus:!0,"aria-label":"Message input"}),e.jsx(od,{agents:t,selectedAgent:a,onSelectAgent:r})]})}),od=({agents:t=[],selectedAgent:a,onSelectAgent:r})=>e.jsxs("div",{className:"aui-composer-action-wrapper relative mx-1 mt-2 mb-2 flex items-center justify-between",children:[e.jsx(Zl,{}),e.jsxs("div",{className:"flex gap-3",children:[t.length>0&&e.jsx(ed,{agents:t,selectedAgent:a,onSelectAgent:r??(()=>{}),triggerClassName:"h-9 text-xs"}),e.jsx(_.ThreadPrimitive.If,{running:!1,children:e.jsx(_.ComposerPrimitive.Send,{asChild:!0,children:e.jsx(xe,{tooltip:"Send message",side:"bottom",type:"submit",variant:"default",size:"icon",className:"aui-composer-send size-[34px] rounded-full p-1","aria-label":"Send message",children:e.jsx(f.ArrowUpIcon,{className:"aui-composer-send-icon size-5"})})})}),e.jsx(_.ThreadPrimitive.If,{running:!0,children:e.jsx(_.ComposerPrimitive.Cancel,{asChild:!0,children:e.jsx(T,{type:"button",variant:"default",size:"icon",className:"aui-composer-cancel size-[34px] rounded-full border border-muted-foreground/60 hover:bg-primary/75 dark:border-muted-foreground/90","aria-label":"Stop generating",children:e.jsx(f.Square,{className:"aui-composer-cancel-icon size-3.5 fill-white dark:fill-black"})})})})]})]}),id=()=>e.jsx(_.MessagePrimitive.Error,{children:e.jsx(_.ErrorPrimitive.Root,{className:"aui-message-error-root mt-2 rounded-md border border-destructive bg-destructive/10 p-3 text-sm text-destructive dark:bg-destructive/5 dark:text-red-200",children:e.jsx(_.ErrorPrimitive.Message,{className:"aui-message-error-message line-clamp-2"})})}),ld=()=>e.jsxs(_.MessagePrimitive.Root,{className:"aui-assistant-message-root relative mx-auto w-full max-w-[var(--thread-max-width)] animate-in py-4 duration-150 ease-out fade-in slide-in-from-bottom-1","data-role":"assistant",children:[e.jsxs("div",{className:"aui-assistant-message-content mx-2 leading-7 break-words text-foreground",children:[e.jsx(_.MessagePrimitive.Parts,{components:{Text:Ll,tools:{Fallback:Vl}}}),e.jsx(id,{})]}),e.jsxs("div",{className:"aui-assistant-message-footer mt-2 ml-2 flex",children:[e.jsx(rs,{}),e.jsx(dd,{})]})]}),dd=()=>e.jsxs(_.ActionBarPrimitive.Root,{hideWhenRunning:!0,autohide:"not-last",autohideFloat:"single-branch",className:"aui-assistant-action-bar-root col-start-3 row-start-2 -ml-1 flex gap-1 text-muted-foreground data-floating:absolute data-floating:rounded-md data-floating:border data-floating:bg-background data-floating:p-1 data-floating:shadow-sm",children:[e.jsx(_.ActionBarPrimitive.Copy,{asChild:!0,children:e.jsxs(xe,{tooltip:"Copy",children:[e.jsx(_.MessagePrimitive.If,{copied:!0,children:e.jsx(f.CheckIcon,{})}),e.jsx(_.MessagePrimitive.If,{copied:!1,children:e.jsx(f.CopyIcon,{})})]})}),e.jsx(_.ActionBarPrimitive.Reload,{asChild:!0,children:e.jsx(xe,{tooltip:"Refresh",children:e.jsx(f.RefreshCwIcon,{})})})]}),cd=()=>e.jsxs(_.MessagePrimitive.Root,{className:"aui-user-message-root mx-auto grid w-full max-w-[var(--thread-max-width)] animate-in auto-rows-auto grid-cols-[minmax(72px,1fr)_auto] content-start gap-y-2 px-2 py-4 duration-150 ease-out fade-in slide-in-from-bottom-1 [&:where(>*)]:col-start-2","data-role":"user",children:[e.jsx(Ql,{}),e.jsxs("div",{className:"aui-user-message-content-wrapper relative col-start-2 min-w-0",children:[e.jsx("div",{className:"aui-user-message-content rounded-3xl bg-muted px-5 py-2.5 break-words text-foreground",children:e.jsx(_.MessagePrimitive.Parts,{})}),e.jsx("div",{className:"aui-user-action-bar-wrapper absolute top-1/2 left-0 -translate-x-full -translate-y-1/2 pr-2",children:e.jsx(ud,{})})]}),e.jsx(rs,{className:"aui-user-branch-picker col-span-full col-start-1 row-start-3 -mr-1 justify-end"})]}),ud=()=>e.jsx(_.ActionBarPrimitive.Root,{hideWhenRunning:!0,autohide:"not-last",className:"aui-user-action-bar-root flex flex-col items-end",children:e.jsx(_.ActionBarPrimitive.Edit,{asChild:!0,children:e.jsx(xe,{tooltip:"Edit",className:"aui-user-action-edit p-4",children:e.jsx(f.PencilIcon,{})})})}),md=()=>e.jsx(_.MessagePrimitive.Root,{className:"aui-edit-composer-wrapper mx-auto flex w-full max-w-[var(--thread-max-width)] flex-col gap-4 px-2",children:e.jsxs(_.ComposerPrimitive.Root,{className:"aui-edit-composer-root ml-auto flex w-full max-w-7/8 flex-col rounded-xl bg-muted",children:[e.jsx(_.ComposerPrimitive.Input,{className:"aui-edit-composer-input flex min-h-[60px] w-full resize-none bg-transparent p-4 text-foreground outline-none",autoFocus:!0}),e.jsxs("div",{className:"aui-edit-composer-footer mx-3 mb-3 flex items-center justify-center gap-2 self-end",children:[e.jsx(_.ComposerPrimitive.Cancel,{asChild:!0,children:e.jsx(T,{variant:"ghost",size:"sm","aria-label":"Cancel edit",children:"Cancel"})}),e.jsx(_.ComposerPrimitive.Send,{asChild:!0,children:e.jsx(T,{size:"sm","aria-label":"Update message",children:"Update"})})]})]})}),rs=({className:t,...a})=>e.jsxs(_.BranchPickerPrimitive.Root,{hideWhenSingleBranch:!0,className:l("aui-branch-picker-root mr-2 -ml-2 inline-flex items-center text-xs text-muted-foreground",t),...a,children:[e.jsx(_.BranchPickerPrimitive.Previous,{asChild:!0,children:e.jsx(xe,{tooltip:"Previous",children:e.jsx(f.ChevronLeftIcon,{})})}),e.jsxs("span",{className:"aui-branch-picker-state font-medium",children:[e.jsx(_.BranchPickerPrimitive.Number,{})," / ",e.jsx(_.BranchPickerPrimitive.Count,{})]}),e.jsx(_.BranchPickerPrimitive.Next,{asChild:!0,children:e.jsx(xe,{tooltip:"Next",children:e.jsx(f.ChevronRightIcon,{})})})]});class xd{agentConfig;baseUrl;chatIdMap=new Map;constructor(a){this.agentConfig=a,this.baseUrl=a.baseUrl||""}updateAgentConfig(a){this.agentConfig={...this.agentConfig,...a}}getChatId(a){return this.chatIdMap.has(a)?this.chatIdMap.get(a):fa.v4()}async sendMessages(a){const{messages:r,chatId:n,abortSignal:s,headers:o,body:i}=a;console.log("sendMessages called with chatId:",n,"trigger:",a.trigger);const d=this.getChatId(n);console.log("Using server chatId:",d);const c={messages:r.map(w=>{const N=w.parts.filter(v=>v.type==="text").map(v=>v.text).join("");return{role:w.role,content:w.role==="user"&&this.agentConfig.additionalReferenceInfo&&Object.keys(this.agentConfig.additionalReferenceInfo).length>0?N+JSON.stringify(this.agentConfig.additionalReferenceInfo):N}}),provider:this.agentConfig.provider,model:this.agentConfig.model,agentId:this.agentConfig.agentId,agentName:this.agentConfig.agentName,temperature:this.agentConfig.temperature??.7,maxTokens:this.agentConfig.maxTokens??2048,stream:!0,useVoice:!1,...i},g={"Content-Type":"application/json",Authorization:`Bearer ${await dt()}`,...o instanceof Headers?Object.fromEntries(o.entries()):o||{}};try{const w=await fetch(`${this.baseUrl}/api/chat/completions/${d}`,{method:"POST",headers:g,body:JSON.stringify(c),signal:s,cache:"no-store"});if(!w.ok)throw new Error(`HTTP error! status: ${w.status}`);if(!w.body)throw new Error("Response body is null");return this.processResponseStream(w.body)}catch(w){throw console.error("Error in sendMessages:",w),w}}async reconnectToStream(a){return null}processResponseStream(a){const r=new TextDecoder;let n="",s=null,o=!1,i=[],d=!1,u="",c=!1,x="";return new ReadableStream({async start(g){s=a.getReader()},async pull(g){if(!(!s||o)){if(i.length>0){g.enqueue(i.shift());return}try{const{done:w,value:N}=await s.read();if(w){if(d&&u)for(c&&x&&i.push({type:"text-end",id:x}),i.push({type:"finish",finishReason:"stop"});i.length>0;)g.enqueue(i.shift());o||(o=!0,g.close());return}n+=r.decode(N,{stream:!0});const v=n.split(`
6
- `);n=v.pop()||"";for(const C of v){const b=C.trim();if(b&&b.startsWith("data:")){const S=b.slice(5).trim();if(!S)continue;try{const p=JSON.parse(S);if(o)return;p.id&&!u&&(u=p.id,d=!0,i.push({type:"start"}));let I=null;if(p.type==="ai"){const j=p.messages?.[0];j?.content&&(x||(x=fa.v4()),c||(c=!0,i.push({type:"text-start",id:x})),I={type:"text-delta",delta:j.content,id:x})}else if(p.type==="tool"){const j=p.toolCall;j&&(I={type:"tool-input-available",toolCallId:j.callId,toolName:j.name,input:j.result})}I&&i.push(I)}catch{}}}i.length>0&&g.enqueue(i.shift())}catch(w){o||(o=!0,g.error(w))}}},cancel(){o=!0,i=[],s&&(s.releaseLock(),s=null)}})}}const fd=({provider:t="openai",model:a="gpt-4o-mini",agentId:r="default-agent",agentName:n="Default Agent",temperature:s=.7,maxTokens:o=2048,className:i,baseUrl:d="http://localhost:3000",additionalReferenceInfo:u={},appId:c="",currentUserDetails:x})=>{const[g,w]=m.useState([]),[N,v]=m.useState(),C=m.useMemo(()=>new xd({provider:t,model:a,agentId:N?N.agentID:r,agentName:N?N.agentName:n,temperature:s,maxTokens:o,baseUrl:d,additionalReferenceInfo:u}),[t,a,N,r,n,s,o,d,u]),b=Fs.useChatRuntime({transport:C}),S=async()=>{try{const I=await dt(),j=await fetch(`${d}/api/agent/${c}`,{method:"GET",headers:{"Content-Type":"application/json",Authorization:`Bearer ${I}`}});if(!j.ok)throw new Error(`HTTP error! status: ${j.status}`);const h=await j.json();console.log("Agent Data:",h),w(h)}catch(I){console.error("Error while fetching agents with the specific appId",I)}};m.useEffect(()=>{S()},[c,d]);const p=I=>{v(I),console.log("Agent changed to:",I.agentName)};return e.jsx(_.AssistantRuntimeProvider,{runtime:b,children:e.jsx("div",{className:i,children:e.jsx("div",{className:`flex flex-col h-full border rounded-lg overflow-hidden ${i}`,children:e.jsx(td,{currentUserDetails:x,agents:g,initialAgentId:r,initialAgentName:n,onAgentChange:p})})})})};function gd(){const t=ae.useNavigate(),{pathname:a}=ae.useLocation(),[r]=ae.useSearchParams(),[n,s]=m.useState(r.get("search")||""),[o]=Es.useDebounce(n,500);return m.useEffect(()=>{const i=new URLSearchParams(r.toString());o?i.set("search",o):i.delete("search"),i.get("search")!==r.get("search")&&(i.set("page","1"),t(`${a}?${i.toString()}`,{replace:!0}))},[o,a,t,r]),m.useEffect(()=>{const i=r.get("search")||"";i!==n&&s(i)},[r]),e.jsxs("div",{className:"relative max-w-sm min-w-[10%]",children:[e.jsx(f.Search,{className:"absolute left-2.5 top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground"}),e.jsx("input",{type:"text",placeholder:"Search ...",value:n,onChange:i=>s(i.target.value),className:"flex h-9 w-full rounded-md border border-border bg-transparent pl-9 pr-3 py-1 text-sm shadow-sm transition-colors text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-primary"})]})}function pd(){const t=ae.useNavigate(),{pathname:a}=ae.useLocation(),[r]=ae.useSearchParams(),n=r.get("size")||"10",s=o=>{const i=new URLSearchParams(r.toString());i.set("size",o.target.value),i.set("page","1"),t(`${a}?${i.toString()}`)};return e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"text-sm text-muted-foreground",children:"Rows per page:"}),e.jsxs("select",{className:"h-9 rounded-md border border-border bg-background text-foreground px-2 py-1 text-sm focus:outline-none focus:ring-2 focus:ring-primary",value:n,onChange:s,children:[e.jsx("option",{value:"10",children:"10"}),e.jsx("option",{value:"20",children:"20"}),e.jsx("option",{value:"50",children:"50"}),e.jsx("option",{value:"100",children:"100"})]})]})}function hd({totalPages:t,currentPage:a}){const r=ae.useNavigate(),{pathname:n}=ae.useLocation(),[s]=ae.useSearchParams(),o=i=>{const d=new URLSearchParams(s.toString());d.set("page",i.toString()),r(`${n}?${d.toString()}`)};return e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx("button",{type:"button",onClick:()=>o(a-1),disabled:a<=1,className:"h-9 px-3 py-1 text-sm font-medium border border-border rounded-md bg-background text-foreground hover:bg-muted disabled:opacity-50 disabled:cursor-not-allowed transition-colors",children:"Previous"}),e.jsxs("span",{className:"text-sm text-muted-foreground px-2",children:["Page ",e.jsx("span",{className:"font-semibold",children:a})," of"," ",e.jsx("span",{className:"font-semibold",children:Math.max(t??1,1)})]}),e.jsx("button",{type:"button",onClick:()=>o(a+1),disabled:t===void 0?void 0:a>=t,className:"h-9 px-3 py-1 text-sm font-medium border border-border rounded-md bg-background text-foreground hover:bg-muted disabled:opacity-50 disabled:cursor-not-allowed transition-colors",children:"Next"})]})}function bd({table:t}){const[a,r]=m.useState(!1),[n,s]=m.useState(""),o=m.useRef(null),i=t.getState().columnFilters,u=t.getAllLeafColumns().filter(c=>c.getCanFilter()).filter(c=>c.id.toLowerCase().includes(n.toLowerCase()));return m.useEffect(()=>{const c=x=>{o.current&&!o.current.contains(x.target)&&r(!1)};return document.addEventListener("mousedown",c),()=>document.removeEventListener("mousedown",c)},[]),e.jsx("div",{className:"flex items-center gap-3 ",children:e.jsxs(ve,{children:[e.jsx(je,{asChild:!0,children:e.jsxs(T,{variant:"outline",size:"sm",className:" gap-2",children:[e.jsx(f.ListFilter,{className:"w-4 h-4"}),"Filter"]})}),e.jsxs(we,{align:"end",className:"w-64 p-2",children:[e.jsx(Dt,{className:"text-center",children:"Filter"}),e.jsxs("div",{className:"p-2",children:[e.jsxs("div",{className:"relative mb-2",children:[e.jsx(f.Search,{className:"absolute left-2 top-2.5 h-3.5 w-3.5 text-muted-foreground"}),e.jsx(da,{placeholder:"Search columns...",value:n,onChange:c=>s(c.target.value)})]}),e.jsx("div",{className:"max-h-50 overflow-auto space-y-1 scroll-m-1",children:u.map(c=>{const x=i.some(g=>g.id===c.id);return e.jsxs("div",{className:"flex items-center space-x-2 p-2 hover:bg-muted rounded-sm transition-colors cursor-pointer",children:[e.jsx(Ve,{id:c.id,checked:x,onCheckedChange:g=>{g?c.setFilterValue([]):c.setFilterValue(void 0)}}),e.jsx("label",{htmlFor:c.id,className:"text-sm font-medium leading-none cursor-pointer flex-1",children:typeof c.columnDef.header=="string"?c.columnDef.header:c.id})]},c.id)})})]}),e.jsx(rt,{}),e.jsx("div",{className:"flex gap-2 p-1",children:e.jsxs(T,{size:"sm",className:"flex-1 h-8",onClick:()=>t.resetColumnFilters(),children:[e.jsx(f.RotateCcw,{className:"mr-2 h-3 w-3"})," Reset"]})})]})]})})}function vd({activeFilters:t,table:a}){return e.jsx("div",{className:"flex flex-wrap gap-2 min-w-max max-w-[70%] overflow-y-auto",children:t.map(r=>e.jsx(jd,{filter:r,table:a},r.id))})}function jd({filter:t,table:a}){debugger;const[r,n]=m.useState(!1),[s,o]=m.useState(t.value||[]),i=m.useRef(null),d=a.getColumn(t.id);m.useEffect(()=>{o(t.value||[])},[t.value]);const u=m.useMemo(()=>{const g=new Set;return a.getPreFilteredRowModel().flatRows.forEach(w=>{const N=w.getValue(t.id);N!=null&&g.add(N)}),Array.from(g).sort()},[a.getPreFilteredRowModel().flatRows,t.id]);m.useEffect(()=>{const g=w=>{i.current&&!i.current.contains(w.target)&&n(!1)};return document.addEventListener("mousedown",g),()=>document.removeEventListener("mousedown",g)},[]);const c=()=>{d.setFilterValue(s.length>0?s:void 0),n(!1)},x=()=>{o([]),d.setFilterValue(void 0),n(!1)};return e.jsxs("div",{className:"flex items-center gap-1 ",ref:i,children:[e.jsxs(ve,{children:[e.jsx(je,{asChild:!0,children:e.jsxs(T,{variant:"outline",size:"sm",className:"h-7 rounded-full px-3 text-xs border border-dashed",children:[e.jsxs("span",{className:"font-bold uppercase text-muted-foreground mr-1",children:[typeof d.columnDef.header=="string"?d.columnDef.header:t.id,":"]}),e.jsx("span",{className:"text-primary font-semibold",children:t.value?.length?`${t.value.length} Selected`:"All"}),e.jsx(f.ChevronDown,{className:"ml-1 h-3 w-3 opacity-50"})]})}),e.jsxs(we,{className:"w-56 p-0",align:"start",children:[e.jsx("div",{className:"p-2 max-h-48 overflow-y-auto",children:u.map(g=>e.jsxs("div",{className:"flex items-center space-x-2 p-2 hover:bg-muted rounded-sm transition-colors cursor-pointer",children:[e.jsx(Ve,{id:`${t.id}-${g}`,checked:s.includes(g),onCheckedChange:w=>{o(N=>w?[...N,g]:N.filter(v=>v!==g))}}),e.jsx("label",{htmlFor:`${t.id}-${g}`,className:"text-xs flex-1 truncate cursor-pointer",children:String(g).trim()===""?"N/A":String(g)})]},g))}),e.jsxs("div",{className:"p-2 border-t bg-muted/50 flex gap-2",children:[e.jsx(T,{size:"sm",className:"flex-1 h-7 text-[10px]",onClick:()=>c(),children:"Apply"}),e.jsx(T,{size:"sm",variant:"outline",className:"flex-1 h-7 text-[10px]",onClick:()=>{x()},children:"Clear"})]})]})]}),e.jsx(T,{variant:"ghost",size:"icon",className:"h-6 w-6 rounded-full hover:text-destructive",onClick:()=>d.setFilterValue(void 0),children:e.jsx(f.X,{className:"h-3 w-3"})})]})}function wd({table:t}){const[a,r]=m.useState(!1),n=m.useRef(null);return m.useEffect(()=>{function s(o){n.current&&!n.current.contains(o.target)&&r(!1)}return document.addEventListener("mousedown",s),()=>document.removeEventListener("mousedown",s)},[]),e.jsxs("div",{className:"relative",ref:n,children:[e.jsxs("button",{type:"button",className:`flex items-center gap-2 px-3 h-9 border rounded-md bg-background transition-colors text-sm font-medium ${a?"border-primary bg-muted":"border-border hover:bg-muted"}`,onClick:()=>r(!a),children:[e.jsx(f.Settings2,{className:"w-4 h-4"}),"Columns"]}),a&&e.jsxs("div",{className:"absolute right-0 mt-2 w-56 z-50 bg-background border border-border rounded-md shadow-lg p-2 animate-in fade-in zoom-in duration-100",children:[e.jsx("div",{className:"px-2 py-1.5 text-xs font-semibold text-muted-foreground border-b mb-1",children:"Toggle Columns"}),e.jsx("div",{className:"max-h-64 overflow-y-auto",children:t.getAllLeafColumns().map(s=>s.getCanHide()?e.jsxs("label",{className:"flex items-center gap-2 px-2 py-1.5 hover:bg-muted rounded cursor-pointer text-sm capitalize",children:[e.jsx("input",{type:"checkbox",checked:s.getIsVisible(),onChange:s.getToggleVisibilityHandler(),className:"h-4 w-4 rounded border-gray-300 text-primary focus:ring-primary"}),e.jsx("span",{className:"truncate",children:typeof s.columnDef.header=="string"?s.columnDef.header:s.id})]},s.id):null)}),e.jsx("div",{className:"border-t mt-1 pt-1",children:e.jsx("button",{type:"button",onClick:()=>t.toggleAllColumnsVisible(!0),className:"w-full text-left px-2 py-1.5 text-xs hover:bg-muted hover:text-primary rounded",children:"Show All"})})]})]})}function Nd({data:t,columns:a,extraTools:r}){const[n,s]=m.useState("list"),o=ae.useNavigate(),{pathname:i}=ae.useLocation(),[d]=ae.useSearchParams(),u=Number(d.get("page")||"1")-1,[c,x]=m.useState({pageIndex:0,pageSize:10}),[g,w]=m.useState(""),[N,v]=m.useState([]),[C,b]=m.useState([]),[S,p]=m.useState({}),[I,j]=m.useState({}),[h,D]=m.useState({}),[P,R]=m.useState([]),M=r?.hiddenColumns||[];for(const y of a)y.filterFn===void 0&&(y.filterFns="multiSelect"),y.draggable===void 0&&(y.draggable=!0);const F=E.useReactTable({data:t,columns:a,pageCount:r?.totalPages,meta:{footerLabel:r?.footerLabel},state:{pagination:c,globalFilter:g,sorting:N,grouping:C,expanded:S,rowSelection:I,columnVisibility:h,columnFilters:P},onSortingChange:v,onGroupingChange:b,onExpandedChange:p,onRowSelectionChange:j,onGlobalFilterChange:w,onPaginationChange:x,onColumnVisibilityChange:D,onColumnFiltersChange:R,manualPagination:!1,manualFiltering:!1,getCoreRowModel:E.getCoreRowModel(),getPaginationRowModel:E.getPaginationRowModel(),getSortedRowModel:E.getSortedRowModel(),getFilteredRowModel:E.getFilteredRowModel(),getGroupedRowModel:E.getGroupedRowModel(),getExpandedRowModel:E.getExpandedRowModel(),filterFns:{multiSelect:(y,k,B)=>{debugger;return B.length?B.includes(String(y.getValue(k))):!0}}});m.useEffect(()=>{debugger;F.getAllLeafColumns().map(y=>{M?.includes(y.id)&&y.toggleVisibility(!1)})},[M,F]);const ce=(y,k)=>{y.dataTransfer.setData("headerId",k)},De=y=>{debugger;y.preventDefault();const k=y.dataTransfer.getData("headerId");k&&!C.includes(k)&&F.getColumn(k)?.getCanGroup()&&F.getColumn(k)?.toggleGrouping()};m.useEffect(()=>{debugger;F.setGlobalFilter(d.get("search")||"")},[d,o,i]),m.useEffect(()=>{F.setPageSize(Number(d.get("size")||"10")),F.setPageIndex(Number(d.get("page")||"1")-1)},[d,o,i]);const Ce=()=>{const y=F.getVisibleLeafColumns().filter(ee=>ee.id!=="select"&&ee.id!=="actions"),k=(ee,Te=0)=>ee.flatMap(G=>{if(G.getIsGrouped()){const Ge=String(G.id.replaceAll(`${y[0].id}:`,"")).trim()===""||G.id.replaceAll(`${G.parentId?`${G.parentId}>`:""}`,"").replaceAll(`${G.groupingColumnId}>`,"").replaceAll(`${y[0].id}:`,"").trim()===void 0?"N/A":G.id.replaceAll(`${G.parentId?`${G.parentId}>`:""}`,"").replaceAll(`${y[0].id}:`,"").trim();return[{[y[0].id]:`${" ".repeat(Te)} ${Ge} (${G.subRows.length})`},...k(G.subRows,Te+1)]}else{let Ge={};return y.forEach(ct=>{const ut=G.getValue(ct.id);Ge[ct.id]=ct.id===y[0].id||ut==="Actions"||ut==="actions"?" ":ut===void 0?"N/A":ut}),[Ge]}}),B=F.getState().grouping.length>0?k(F.getGroupedRowModel().rows):F.getFilteredRowModel().rows.map(ee=>{let Te={};return y.forEach(G=>Te[G.id]=ee.getValue(G.id)),Te}),z=xt.utils.json_to_sheet(B),O=y.map(ee=>{const Te=typeof ee.columnDef.header=="string"?ee.columnDef.header:ee.id;return{wch:Math.max(Te.length,...B.map(Ge=>String(Ge[Te]).length))+3}});z["!cols"]=O;const Pe=xt.utils.book_new();xt.utils.book_append_sheet(Pe,z,"Data"),xt.writeFile(Pe,`${r?.fileName}.xlsx`)};return e.jsxs("div",{className:"space-y-2",children:[e.jsxs("div",{className:"flex items-center justify-between gap-2",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(gd,{}),e.jsx(vd,{activeFilters:F.getState().columnFilters,table:F})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[r?.actionNode&&r?.actionNode,e.jsx(wd,{table:F}),e.jsx(bd,{table:F}),e.jsx(T,{variant:"outline",size:"sm",className:" gap-2",onClick:()=>Ce(),children:e.jsx(f.Download,{className:"w-4 h-4"})}),r?.toggleViewMode&&e.jsxs("div",{className:"flex items-center border border-border rounded-md bg-background overflow-hidden h-9",children:[e.jsx("button",{onClick:()=>s("list"),className:`px-2.5 h-full flex items-center justify-center transition-colors ${n==="list"?"bg-muted text-foreground":"text-muted-foreground hover:bg-muted/50"}`,title:"List View",children:e.jsx(f.List,{className:"w-4 h-4"})}),e.jsx("button",{onClick:()=>s("grid"),className:`px-2.5 h-full flex items-center justify-center transition-colors ${n==="grid"?"bg-muted text-foreground":"text-muted-foreground hover:bg-muted/50"}`,title:"Grid View",children:e.jsx(f.LayoutGrid,{className:"w-4 h-4"})})]})]})]}),n==="list"?e.jsxs(e.Fragment,{children:[e.jsx("div",{onDragOver:y=>y.preventDefault(),onDrop:De,className:"w-full border border-dashed rounded-md h-10 p-2 flex gap-2 items-center text-sm bg-muted/20 ",children:C.length===0?e.jsx("span",{className:"text-muted-foreground",children:"Drag a column header here to group"}):C.map(y=>e.jsxs("div",{className:"flex items-center gap-1 bg-background border px-2 py-1 rounded shadow-sm",children:[y,e.jsx(f.X,{size:14,className:"cursor-pointer",onClick:()=>F.getColumn(y)?.toggleGrouping()})]},y))}),e.jsx("div",{className:"rounded-md border border-border bg-background overflow-x-auto",children:e.jsxs("table",{className:"w-full text-sm",children:[e.jsx("thead",{className:"bg-muted/50 border-b border-border sticky top-0",children:F.getHeaderGroups().map(y=>e.jsx("tr",{children:y.headers.map(k=>e.jsx("th",{className:"px-4 py-3 text-left font-medium cursor-pointer select-none",draggable:!0,onDragStart:B=>ce(B,k.id),children:e.jsxs("div",{className:"flex items-center gap-2",onClick:k.column.getToggleSortingHandler(),children:[E.flexRender(k.column.columnDef.header,k.getContext()),{asc:e.jsx(f.ChevronUp,{size:14}),desc:e.jsx(f.ChevronDown,{size:14})}[k.column.getIsSorted()]??null]})},k.id))},y.id))}),e.jsx("tbody",{className:"divide-y divide-border",children:F.getRowModel().rows.map(y=>e.jsx("tr",{className:`hover:bg-muted/30 transition-colors ${y.getIsSelected()?"bg-accent/20":""}`,children:y.getVisibleCells().map(k=>e.jsx("td",{className:"px-4 py-3",children:k.getIsGrouped()?e.jsxs("button",{onClick:y.getToggleExpandedHandler(),className:"flex items-center gap-2 font-semibold",children:[y.getIsExpanded()?e.jsx(f.ChevronDown,{size:16}):e.jsx(f.ChevronRight,{size:16}),E.flexRender(k.column.columnDef.cell,k.getContext())," (",y.subRows.length,")"]}):k.getIsAggregated()?E.flexRender(k.column.columnDef.aggregatedCell??k.column.columnDef.cell,k.getContext()):k.getIsPlaceholder()?null:E.flexRender(k.column.columnDef.cell,k.getContext())},k.id))},y.id))}),r?.showFooter&&e.jsx("tfoot",{className:"bg-muted/30 border-t-2 border-border font-bold",children:F.getFooterGroups().map(y=>e.jsx("tr",{children:y.headers.map(k=>e.jsx("td",{className:"px-4 py-3 text-left",children:k.isPlaceholder?null:E.flexRender(k.column.columnDef.footer,k.getContext())},k.id))},y.id))})]})}),e.jsxs("div",{className:"flex items-center justify-between pt-2 border-t border-border",children:[e.jsx(pd,{}),e.jsx(hd,{totalPages:r?.totalPages,currentPage:u+1})]})]}):r?.gridComponent?r.gridComponent(t):e.jsx("div",{className:"p-12 text-center text-muted-foreground border border-border border-dashed rounded-md bg-muted/20",children:"Grid view not implemented for this component yet."})]})}function yd({data:t,columns:a,extraTools:r}){return e.jsx("div",{className:"space-y-6",children:e.jsxs("div",{className:"relative min-h-[300px]",children:[e.jsx(Sn,{isLoading:r?.isLoading,onReload:r?.onReload||(()=>window.location.reload())}),e.jsx("div",{className:`transition-all duration-300 ${r?.isLoading?"opacity-50 pointer-events-none":""}`,children:e.jsx(Nd,{data:t,columns:a,extraTools:r})})]})})}exports.Accordion=Gs;exports.AccordionContent=Hs;exports.AccordionItem=qs;exports.AccordionTrigger=Ws;exports.ActionMenu=Wt;exports.ActivitySheet=Al;exports.Alert=ho;exports.AlertDescription=vo;exports.AlertDialog=Fa;exports.AlertDialogAction=Lt;exports.AlertDialogCancel=$a;exports.AlertDialogContent=La;exports.AlertDialogDescription=Va;exports.AlertDialogFooter=Ba;exports.AlertDialogHeader=Oa;exports.AlertDialogMedia=go;exports.AlertDialogOverlay=Ea;exports.AlertDialogPortal=Ma;exports.AlertDialogTitle=Ua;exports.AlertDialogTrigger=fo;exports.AlertTitle=bo;exports.AppBreadcrumb=Rn;exports.AppSidebar=En;exports.AspectRatio=$t;exports.AssistantComponent=fd;exports.Avatar=Ga;exports.AvatarBadge=jo;exports.AvatarFallback=Wa;exports.AvatarGroup=wo;exports.AvatarGroupCount=No;exports.AvatarImage=qa;exports.Badge=ht;exports.BigCalendar=Yi;exports.Breadcrumb=Wr;exports.BreadcrumbEllipsis=qt;exports.BreadcrumbItem=We;exports.BreadcrumbLink=Gt;exports.BreadcrumbList=Hr;exports.BreadcrumbPage=Qe;exports.BreadcrumbProvider=Tn;exports.BreadcrumbSeparator=bt;exports.Button=T;exports.Calendar=Ka;exports.CalendarDayButton=Xa;exports.Card=wt;exports.CardAction=ko;exports.CardContent=Ya;exports.CardDescription=So;exports.CardFooter=Io;exports.CardHeader=yo;exports.CardTitle=Co;exports.Checkbox=Ve;exports.Collapsible=Kr;exports.CollapsibleContent=Yr;exports.CollapsibleTrigger=Xr;exports.ComboboxInput=Ai;exports.Command=Y;exports.CommandDialog=Do;exports.CommandEmpty=de;exports.CommandGroup=re;exports.CommandInput=ie;exports.CommandItem=X;exports.CommandList=le;exports.CommandSeparator=ar;exports.CommandShortcut=Po;exports.CropperForm=Qn;exports.CropperFormWithModal=Jn;exports.CustomAlertDialog=pn;exports.CustomComboboxInput=Ml;exports.CustomTabs=An;exports.DataTable=Ri;exports.DataTableColumnFilter=vn;exports.DataTableFacetedFilter=jn;exports.DataTableFilterMenu=wn;exports.DataTableLayout=yd;exports.DataTablePagination=yn;exports.DataTableToolbar=Cn;exports.Dialog=kt;exports.DialogClose=Ao;exports.DialogContent=It;exports.DialogDescription=tr;exports.DialogFooter=er;exports.DialogHeader=ra;exports.DialogOverlay=Za;exports.DialogPortal=Ja;exports.DialogProvider=bn;exports.DialogTitle=At;exports.DialogTrigger=Qa;exports.Drawer=Qr;exports.DrawerClose=en;exports.DrawerContent=an;exports.DrawerDescription=on;exports.DrawerFooter=nn;exports.DrawerHeader=rn;exports.DrawerOverlay=tn;exports.DrawerPortal=Zr;exports.DrawerTitle=sn;exports.DrawerTrigger=Jr;exports.DropdownMenu=ve;exports.DropdownMenuCheckboxItem=To;exports.DropdownMenuContent=we;exports.DropdownMenuGroup=na;exports.DropdownMenuItem=me;exports.DropdownMenuLabel=Dt;exports.DropdownMenuPortal=rr;exports.DropdownMenuRadioGroup=Ro;exports.DropdownMenuRadioItem=_o;exports.DropdownMenuSeparator=rt;exports.DropdownMenuShortcut=zo;exports.DropdownMenuSub=nr;exports.DropdownMenuSubContent=or;exports.DropdownMenuSubTrigger=sr;exports.DropdownMenuTrigger=je;exports.EChart=zi;exports.FileInput=kn;exports.FileUploader=Pi;exports.FontProvider=Wn;exports.Footer=Ln;exports.Form=ln;exports.FormComboboxInput=Zi;exports.FormComboboxInputWithValue=el;exports.FormControl=pe;exports.FormDateInput=tl;exports.FormDescription=ye;exports.FormField=fe;exports.FormFileInput=al;exports.FormInput=rl;exports.FormItem=ge;exports.FormLabel=Ne;exports.FormMessage=he;exports.FormMultiComboboxInput=nl;exports.FormOtpInput=sl;exports.FormPasswordInput=ll;exports.FormPhoneInput=ol;exports.FormTextarea=il;exports.FrameworkItemDropdown=Gi;exports.GlowingEffect=Fi;exports.GradeTableLoader=dl;exports.Header=On;exports.HoverCard=Fo;exports.HoverCardContent=Eo;exports.HoverCardTrigger=Mo;exports.Icon=Nt;exports.IconButton=gn;exports.IconButtonWithTooltip=Re;exports.IconTextButton=it;exports.IconTextButtonWithTooltip=fn;exports.ImageCropper=Yn;exports.ImageCropperProvider=Rl;exports.Input=H;exports.InputOTP=un;exports.InputOTPGroup=mn;exports.InputOTPSeparator=Ci;exports.InputOTPSlot=Je;exports.Label=Se;exports.LoadingSpinner=Mi;exports.MainLayout=Gn;exports.MainSidebar=$n;exports.MultiCombobox=Ei;exports.NavMain=Fn;exports.NavigationMenu=Lo;exports.NavigationMenuContent=Vo;exports.NavigationMenuIndicator=Go;exports.NavigationMenuItem=Bo;exports.NavigationMenuLink=$o;exports.NavigationMenuList=Oo;exports.NavigationMenuTrigger=Uo;exports.NavigationMenuViewport=lr;exports.NewCropperImg=es;exports.NewImageForm=zl;exports.NoDataComponent=ca;exports.PageWrapper=Li;exports.PasswordStrengthMeter=Oi;exports.PhoneInput=Bi;exports.Popover=Q;exports.PopoverAnchor=qo;exports.PopoverContent=Z;exports.PopoverDescription=Ko;exports.PopoverHeader=Wo;exports.PopoverTitle=Ho;exports.PopoverTrigger=J;exports.Progress=Pt;exports.ProviderWrapper=Il;exports.RadioGroup=Xo;exports.RadioGroupItem=Yo;exports.RadiusProvider=Kn;exports.Reload=Sn;exports.RenderAppBreadcrumb=Qi;exports.RenderSidebarNav=Ji;exports.ScrollArea=Qo;exports.ScrollBar=dr;exports.SearchInput=da;exports.Select=cr;exports.SelectContent=xr;exports.SelectGroup=Jo;exports.SelectItem=fr;exports.SelectLabel=Zo;exports.SelectScrollDownButton=pr;exports.SelectScrollUpButton=gr;exports.SelectSeparator=ei;exports.SelectTrigger=mr;exports.SelectValue=ur;exports.Separator=Tt;exports.Sheet=sa;exports.SheetClose=ti;exports.SheetComponent=In;exports.SheetContent=oa;exports.SheetDescription=vr;exports.SheetFooter=ni;exports.SheetHeader=br;exports.SheetTitle=ia;exports.SheetTrigger=hr;exports.Sidebar=Nr;exports.SidebarContent=Ar;exports.SidebarFooter=Ir;exports.SidebarGroup=Dr;exports.SidebarGroupAction=fi;exports.SidebarGroupContent=gi;exports.SidebarGroupLabel=xi;exports.SidebarHeader=kr;exports.SidebarInput=ui;exports.SidebarInset=Sr;exports.SidebarMenu=Pr;exports.SidebarMenuAction=hi;exports.SidebarMenuBadge=bi;exports.SidebarMenuButton=Bt;exports.SidebarMenuItem=Ot;exports.SidebarMenuSkeleton=vi;exports.SidebarMenuSub=Tr;exports.SidebarMenuSubButton=_r;exports.SidebarMenuSubItem=Rr;exports.SidebarNavProvider=zn;exports.SidebarProvider=wr;exports.SidebarRail=Cr;exports.SidebarSeparator=mi;exports.SidebarTrigger=yr;exports.SimpleWidget=Vi;exports.Skeleton=Be;exports.SkeletonWidget=cl;exports.Slider=ji;exports.Switch=Ni;exports.Table=Er;exports.TableBody=Or;exports.TableCaption=yi;exports.TableCell=Ye;exports.TableFooter=Br;exports.TableHead=Ut;exports.TableHeader=Lr;exports.TableRow=qe;exports.Tabs=Ur;exports.TabsContent=Vt;exports.TabsList=$r;exports.TabsTrigger=Gr;exports.TextButton=ot;exports.TextButtonWithTooltip=ki;exports.Textarea=qr;exports.ThemeProvider=Fr;exports.ThemeToggleBtn=Dn;exports.TitleProgress=$i;exports.Toaster=wi;exports.Toggle=Si;exports.ToggleGroup=Oe;exports.ToggleGroupItem=V;exports.Tooltip=ne;exports.TooltipComponent=ze;exports.TooltipContent=oe;exports.TooltipProvider=_e;exports.TooltipTrigger=se;exports.UploadTab=Mn;exports.Widgets=qi;exports.WorkInProgress=Fl;exports.axiosInstance=Fe;exports.badgeVariants=Ha;exports.buttonVariants=jt;exports.clearAllCookieSession=ml;exports.clearCookieSession=Kt;exports.cn=l;exports.convertFileToObject=Nn;exports.getCookieSession=yt;exports.getDataTableColumnTitle=ke;exports.getImageFromObject=Di;exports.getValidAccessToken=dt;exports.navigationMenuTriggerStyle=ir;exports.refreshAccessToken=Bn;exports.setCookieSession=Ht;exports.setIkonConfig=ul;exports.tabsListVariants=Vr;exports.toggleVariants=la;exports.useBreadcrumb=ua;exports.useDialog=Ii;exports.useFont=wl;exports.useFormField=st;exports.useImageCropper=xa;exports.useIsMobile=Rt;exports.useRadius=Nl;exports.useRefresh=Cl;exports.useSidebar=nt;exports.useSidebarNav=lt;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),f=require("lucide-react"),an=require("@radix-ui/react-accordion"),sn=require("clsx"),nn=require("tailwind-merge"),m=require("react"),on=require("@radix-ui/react-alert-dialog"),fe=require("@radix-ui/react-slot"),W=require("class-variance-authority"),ln=require("@radix-ui/react-avatar"),Mt=require("react-day-picker"),cn=require("@radix-ui/react-checkbox"),$e=require("cmdk"),dn=require("@radix-ui/react-dialog"),un=require("@radix-ui/react-dropdown-menu"),mn=require("@radix-ui/react-hover-card"),xn=require("@radix-ui/react-label"),fn=require("@radix-ui/react-navigation-menu"),gn=require("@radix-ui/react-popover"),pn=require("@radix-ui/react-progress"),hn=require("@radix-ui/react-radio-group"),bn=require("@radix-ui/react-scroll-area"),vn=require("@radix-ui/react-select"),jn=require("@radix-ui/react-separator"),wn=require("@radix-ui/react-tooltip"),Nn=require("@radix-ui/react-slider"),Or=require("sonner"),yn=require("@radix-ui/react-switch"),Cn=require("@radix-ui/react-tabs"),Sn=require("@radix-ui/react-aspect-ratio");require("react-dom");const Ee=require("vaul"),Xe=require("react-hook-form"),Br=require("input-otp"),kn=require("@radix-ui/react-toggle-group"),In=require("@radix-ui/react-toggle"),z=require("@tanstack/react-table"),Le=require("echarts"),bt=require("motion/react"),An=require("zxcvbn"),Dn=require("countries-list"),Pn=require("country-flag-icons/react/3x2"),Qe=require("date-fns"),q=require("react-big-calendar");require("react-big-calendar/lib/css/react-big-calendar.css");const Tn=require("date-fns/locale"),re=require("react-router"),Ur=require("axios"),tr=require("js-cookie"),Rn=require("jwt-decode"),Ue=require("@tanstack/react-query"),Vr=require("react-cropper"),F=require("@assistant-ui/react"),Fn=require("motion/react-m"),Et=require("@assistant-ui/react-markdown"),_n=require("remark-gfm"),Mn=require("@assistant-ui/react-ai-sdk"),Dr=require("uuid"),En=require("xlsx"),ae=require("react-router-dom"),zn=require("use-debounce");function L(t){const r=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const a in t)if(a!=="default"){const s=Object.getOwnPropertyDescriptor(t,a);Object.defineProperty(r,a,s.get?s:{enumerable:!0,get:()=>t[a]})}}return r.default=t,Object.freeze(r)}const Ln=L(f),rt=L(an),S=L(m),De=L(on),rr=L(ln),Pr=L(cn),V=L(dn),$=L(un),jt=L(mn),On=L(xn),ze=L(fn),at=L(gn),Tr=L(pn),zt=L(hn),et=L(bn),K=L(vn),Bn=L(jn),Ke=L(wn),ft=L(Nn),Rr=L(yn),St=L(Cn),Un=L(Sn),$r=L(kn),Vn=L(In),$n=L(Pn),Lt=L(Fn),gt=L(En);function d(...t){return nn.twMerge(sn.clsx(t))}function Gn({...t}){return e.jsx(rt.Root,{"data-slot":"accordion",...t})}function qn({className:t,...r}){return e.jsx(rt.Item,{"data-slot":"accordion-item",className:d("border-b last:border-b-0",t),...r})}function Wn({className:t,children:r,...a}){return e.jsx(rt.Header,{className:"flex",children:e.jsxs(rt.Trigger,{"data-slot":"accordion-trigger",className:d("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),...a,children:[r,e.jsx(f.ChevronDownIcon,{className:"text-muted-foreground pointer-events-none size-4 shrink-0 translate-y-0.5 transition-transform duration-200"})]})})}function Hn({className:t,children:r,...a}){return e.jsx(rt.Content,{"data-slot":"accordion-content",className:"data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down overflow-hidden text-sm",...a,children:e.jsx("div",{className:d("pt-0 pb-4",t),children:r})})}const Ye=W.cva("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",{variants:{variant:{default:"bg-[var(--accent)] text-[var(--accent-foreground)] shadow-xs hover:bg-[var(--accent)]/60",destructive:"bg-destructive text-white shadow-xs hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",outline:"border! border-2! bg-background shadow-xs hover:bg-accent hover:text-accent-foreground ",secondary:"bg-[var(--btn-secondary)] text-secondary-foreground shadow-xs hover:bg-[var(--btn-secondary)]/20 border border-input",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",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",smIcon:"h-8 w-8",circular:"size-10 rounded-full p-0",lgIcon:"size-10"}},defaultVariants:{variant:"default",size:"default"}});function T({className:t,variant:r,size:a,asChild:s=!1,...n}){const o=s?fe.Slot:"button";return e.jsx(o,{"data-slot":"button",className:d(Ye({variant:r,size:a,className:t})),...n})}const ar=t=>e.jsx(De.Root,{"data-slot":"alert-dialog",...t});ar.displayName="AlertDialog";const Gr=S.forwardRef((t,r)=>e.jsx(De.Trigger,{"data-slot":"alert-dialog-trigger",ref:r,...t}));Gr.displayName="AlertDialogTrigger";const sr=t=>e.jsx(De.Portal,{"data-slot":"alert-dialog-portal",...t});sr.displayName="AlertDialogPortal";const nr=S.forwardRef(({className:t,...r},a)=>e.jsx(De.Overlay,{ref:a,"data-slot":"alert-dialog-overlay",className:d("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),...r}));nr.displayName="AlertDialogOverlay";const or=S.forwardRef(({className:t,...r},a)=>e.jsxs(sr,{children:[e.jsx(nr,{}),e.jsx(De.Content,{ref:a,"data-slot":"alert-dialog-content",className:d("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 sm:max-w-lg",t),...r})]}));or.displayName="AlertDialogContent";const ir=S.forwardRef(({className:t,...r},a)=>e.jsx("div",{ref:a,"data-slot":"alert-dialog-header",className:d("flex flex-col gap-2 text-center sm:text-left",t),...r}));ir.displayName="AlertDialogHeader";const lr=S.forwardRef(({className:t,...r},a)=>e.jsx("div",{ref:a,"data-slot":"alert-dialog-footer",className:d("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",t),...r}));lr.displayName="AlertDialogFooter";const cr=S.forwardRef(({className:t,...r},a)=>e.jsx(De.Title,{ref:a,"data-slot":"alert-dialog-title",className:d("text-lg font-semibold bg-background",t),...r}));cr.displayName="AlertDialogTitle";const dr=S.forwardRef(({className:t,...r},a)=>e.jsx(De.Description,{ref:a,"data-slot":"alert-dialog-description",className:d("text-muted-foreground text-sm bg-background",t),...r}));dr.displayName="AlertDialogDescription";const wt=S.forwardRef(({className:t,...r},a)=>e.jsx(De.Action,{ref:a,className:d(Ye(),t),...r}));wt.displayName="AlertDialogAction";const ur=S.forwardRef(({className:t,...r},a)=>e.jsx(De.Cancel,{ref:a,className:d(Ye({variant:"outline"}),"bg-background",t),...r}));ur.displayName="AlertDialogCancel";const Kn=W.cva("relative w-full rounded-lg border px-4 py-3 text-sm grid has-[>svg]:grid-cols-[calc(var(--spacing)*4)_1fr] grid-cols-[0_1fr] has-[>svg]:gap-x-3 gap-y-0.5 items-start [&>svg]:size-4 [&>svg]:translate-y-0.5 [&>svg]:text-current",{variants:{variant:{default:"bg-card dark:bg-background text-card-foreground",destructive:"text-destructive bg-card [&>svg]:text-current *:data-[slot=alert-description]:text-destructive/90"}},defaultVariants:{variant:"default"}});function Xn({className:t,variant:r,...a}){return e.jsx("div",{"data-slot":"alert",role:"alert",className:d(Kn({variant:r}),t),...a})}function Yn({className:t,...r}){return e.jsx("div",{"data-slot":"alert-title",className:d("col-start-2 line-clamp-1 min-h-4 font-medium tracking-tight",t),...r})}function Qn({className:t,...r}){return e.jsx("div",{"data-slot":"alert-description",className:d("text-muted-foreground col-start-2 grid justify-items-start gap-1 text-sm [&_p]:leading-relaxed",t),...r})}function qr({className:t,...r}){return e.jsx(rr.Root,{"data-slot":"avatar",className:d("relative flex size-8 shrink-0 overflow-hidden rounded-full",t),...r})}function Wr({className:t,...r}){return e.jsx(rr.Image,{"data-slot":"avatar-image",className:d("aspect-square size-full",t),...r})}function Hr({className:t,...r}){return e.jsx(rr.Fallback,{"data-slot":"avatar-fallback",className:d("bg-foreground text-background flex size-full items-center justify-center rounded-full",t),...r})}const Kr=W.cva("inline-flex items-center justify-center rounded-md border 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:"border-transparent bg-primary text-primary-foreground [a&]:hover:bg-primary/90",secondary:"border-transparent bg-secondary text-secondary-foreground [a&]:hover:bg-secondary/90",destructive:"border-transparent bg-destructive text-white [a&]:hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive",outline:"text-foreground bg-[var(--background)] [a&]:hover:bg-accent [a&]:hover:text-accent-foreground",verified:"border-transparent bg-[#15803D] text-white [a&]:hover:bg-[#1F9145] focus-visible:ring-[#15803D]/20 dark:focus-visible:ring-[#15803D]/40"}},defaultVariants:{variant:"default"}});function tt({className:t,variant:r,asChild:a=!1,...s}){const n=a?fe.Slot:"span";return e.jsx(n,{"data-slot":"badge",className:d(Kr({variant:r}),t),...s})}function Xr({className:t,classNames:r,showOutsideDays:a=!0,captionLayout:s="label",buttonVariant:n="ghost",formatters:o,components:i,...l}){const u=Mt.getDefaultClassNames();return e.jsx(Mt.DayPicker,{showOutsideDays:a,className:d("bg-background group/calendar p-3 [--cell-size:2rem] [[data-slot=card-content]&]:bg-transparent [[data-slot=popover-content]&]:bg-transparent","dark:bg-[#202020]",String.raw`rtl:**:[.rdp-button\_next>svg]:rotate-180`,String.raw`rtl:**:[.rdp-button\_previous>svg]:rotate-180`,t),captionLayout:s,formatters:{formatMonthDropdown:c=>c.toLocaleString("default",{month:"short"}),...o},classNames:{root:d("w-fit",u.root),months:d("flex gap-4 flex-col md:flex-row relative",u.months),month:d("flex flex-col w-full gap-4",u.month),nav:d("flex items-center gap-1 w-full absolute top-0 inset-x-0 justify-between",u.nav),button_previous:d(Ye({variant:n}),"size-(--cell-size) aria-disabled:opacity-50 p-0 select-none",u.button_previous),button_next:d(Ye({variant:n}),"size-(--cell-size) aria-disabled:opacity-50 p-0 select-none",u.button_next),month_caption:d("flex items-center justify-center h-(--cell-size) w-full px-(--cell-size)",u.month_caption),dropdowns:d("w-full flex items-center text-sm font-medium justify-center h-(--cell-size) gap-1.5",u.dropdowns),dropdown_root:d("relative has-focus:border-ring border border-input shadow-xs has-focus:ring-ring/50 has-focus:ring-[3px] rounded-md","bg-[rgba(0,0,0,0.17)]",u.dropdown_root),dropdown:d("absolute bg-popover inset-0 opacity-0",u.dropdown),caption_label:d("select-none font-medium",s==="label"?"text-sm":"rounded-md pl-2 pr-1 flex items-center gap-1 text-sm h-8 [&>svg]:text-muted-foreground [&>svg]:size-3.5",u.caption_label),table:"w-full border-collapse",weekdays:d("flex",u.weekdays),weekday:d("text-muted-foreground rounded-md flex-1 font-normal text-[0.8rem] select-none",u.weekday),week:d("flex w-full mt-2",u.week),week_number_header:d("select-none w-(--cell-size)",u.week_number_header),week_number:d("text-[0.8rem] select-none text-muted-foreground",u.week_number),day:d("relative w-full h-full p-0 text-center [&:first-child[data-selected=true]_button]:rounded-l-md [&:last-child[data-selected=true]_button]:rounded-r-md group/day aspect-square select-none",u.day),range_start:d("rounded-l-md bg-accent",u.range_start),range_middle:d("rounded-none",u.range_middle),range_end:d("rounded-r-md bg-accent",u.range_end),today:d("bg-[var(--hover-back)] text-primary rounded-md data-[selected=true]:rounded-none",u.today),outside:d("text-muted-foreground aria-selected:text-muted-foreground",u.outside),disabled:d("text-muted-foreground opacity-50",u.disabled),hidden:d("invisible",u.hidden),...r},components:{Root:({className:c,rootRef:x,...g})=>e.jsx("div",{"data-slot":"calendar",ref:x,className:d(c),...g}),Chevron:({className:c,orientation:x,...g})=>x==="left"?e.jsx(f.ChevronLeftIcon,{className:d("size-4",c),...g}):x==="right"?e.jsx(f.ChevronRightIcon,{className:d("size-4",c),...g}):e.jsx(f.ChevronDownIcon,{className:d("size-4",c),...g}),DayButton:Yr,WeekNumber:({children:c,...x})=>e.jsx("td",{...x,children:e.jsx("div",{className:"flex size-(--cell-size) items-center justify-center text-center",children:c})}),...i},...l})}function Yr({className:t,day:r,modifiers:a,...s}){const n=Mt.getDefaultClassNames(),o=S.useRef(null);return S.useEffect(()=>{a.focused&&o.current?.focus()},[a.focused]),e.jsx(T,{ref:o,variant:"ghost",size:"icon","data-day":r.date.toLocaleDateString(),"data-selected-single":a.selected&&!a.range_start&&!a.range_end&&!a.range_middle,"data-range-start":a.range_start,"data-range-end":a.range_end,"data-range-middle":a.range_middle,className:d("data-[selected-single=true]:bg-[var(--calender-foreground)] data-[selected-single=true]:text-white dark:data-[selected-single=true]:text-black","data-[range-middle=true]:bg-[var(--ring)] data-[range-middle=true]:text-white root:text-black","data-[range-start=true]:bg-[var(--calender-foreground)] dark:data-[range-start=true]:text-black data-[range-start=true]:text-white","hover:bg-[var(--keross-skeleton-bg)] hover:text-white","data-[range-end=true]:bg-[var(--calender-foreground)] data-[range-end=true]:text-white dark:data-[range-end=true]:text-black","group-data-[focused=true]/day:border-ring group-data-[focused=true]/day:ring-ring/50 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 root:text-black",n.day,t),...s})}function Nt({className:t,...r}){return e.jsx("div",{"data-slot":"card",className:d("bg-card text-card-foreground flex flex-col gap-6 rounded-xl border py-6 shadow-sm",t),...r})}function Jn({className:t,...r}){return e.jsx("div",{"data-slot":"card-header",className:d("@container/card-header grid auto-rows-min grid-rows-[auto_auto] items-start gap-1.5 px-6 has-data-[slot=card-action]:grid-cols-[1fr_auto] [.border-b]:pb-6",t),...r})}function Zn({className:t,...r}){return e.jsx("div",{"data-slot":"card-title",className:d("leading-none font-semibold",t),...r})}function eo({className:t,...r}){return e.jsx("div",{"data-slot":"card-description",className:d("text-muted-foreground text-sm",t),...r})}function to({className:t,...r}){return e.jsx("div",{"data-slot":"card-action",className:d("col-start-2 row-span-2 row-start-1 self-start justify-self-end",t),...r})}function Qr({className:t,...r}){return e.jsx("div",{"data-slot":"card-content",className:d("px-6",t),...r})}function ro({className:t,...r}){return e.jsx("div",{"data-slot":"card-footer",className:d("flex items-center px-6 [.border-t]:pt-6",t),...r})}function Ve({className:t,...r}){return e.jsx(Pr.Root,{"data-slot":"checkbox",className:d("peer border-input bg-[var(--background)] dark:bg-[var(--border)] 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-1 shadow-xs transition-shadow outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50",t),...r,children:e.jsx(Pr.Indicator,{"data-slot":"checkbox-indicator",className:"flex items-center justify-center text-current transition-none",children:e.jsx(f.CheckIcon,{className:"size-3.5"})})})}function kt({...t}){return e.jsx(V.Root,{"data-slot":"dialog",...t})}function Jr({...t}){return e.jsx(V.Trigger,{"data-slot":"dialog-trigger",...t})}function Zr({...t}){return e.jsx(V.Portal,{"data-slot":"dialog-portal",...t})}function ao({...t}){return e.jsx(V.Close,{"data-slot":"dialog-close",...t})}function ea({className:t,...r}){return e.jsx(V.Overlay,{"data-slot":"dialog-overlay",className:d("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),...r})}function It({className:t,children:r,showCloseButton:a=!0,...s}){return e.jsxs(Zr,{"data-slot":"dialog-portal",children:[e.jsx(ea,{}),e.jsxs(V.Content,{"data-slot":"dialog-content",className:d("bg-card 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 sm:max-w-lg",t),...s,children:[r,a&&e.jsxs(V.Close,{"data-slot":"dialog-close",className:"ring-offset-background focus:ring-ring data-[state=open]:bg-accent data-[state=open]:text-muted-foreground absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",children:[e.jsx(f.XIcon,{}),e.jsx("span",{className:"sr-only",children:"Close"})]})]})]})}function mr({className:t,...r}){return e.jsx("div",{"data-slot":"dialog-header",className:d("flex flex-col gap-2 text-center sm:text-left",t),...r})}function ta({className:t,...r}){return e.jsx("div",{"data-slot":"dialog-footer",className:d("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",t),...r})}function ra({className:t,...r}){return e.jsx(V.Description,{"data-slot":"dialog-description",className:d("text-lg leading-none font-semibold",t),...r})}function At({className:t,...r}){return e.jsx(V.Title,{"data-slot":"dialog-title",className:d("text-muted-foreground text-sm",t),...r})}function Y({className:t,...r}){return e.jsx($e.Command,{"data-slot":"command",className:d("bg-card text-popover-foreground flex h-full w-full flex-col overflow-hidden rounded-md",t),...r})}function so({title:t="Command Palette",description:r="Search for a command to run...",children:a,className:s,showCloseButton:n=!0,...o}){return e.jsxs(kt,{...o,children:[e.jsxs(mr,{className:"sr-only",children:[e.jsx(At,{children:t}),e.jsx(ra,{children:r})]}),e.jsx(It,{className:d("overflow-hidden p-0",s),showCloseButton:n,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:a})})]})}function le({className:t,...r}){return e.jsxs("div",{"data-slot":"command-input-wrapper",className:"flex h-9 items-center gap-2 border-b px-3",children:[e.jsx(f.SearchIcon,{className:"size-4 shrink-0 opacity-50"}),e.jsx($e.Command.Input,{"data-slot":"command-input",className:d("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),...r})]})}function ce({className:t,...r}){return e.jsx($e.Command.List,{"data-slot":"command-list",className:d("max-h-[300px] scroll-py-1 overflow-x-hidden overflow-y-auto",t),...r})}function de({...t}){return e.jsx($e.Command.Empty,{"data-slot":"command-empty",className:"py-6 text-center text-sm",...t})}function se({className:t,...r}){return e.jsx($e.Command.Group,{"data-slot":"command-group",className:d("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),...r})}function aa({className:t,...r}){return e.jsx($e.Command.Separator,{"data-slot":"command-separator",className:d("bg-border -mx-1 h-px",t),...r})}function X({className:t,...r}){return e.jsx($e.Command.Item,{"data-slot":"command-item",className:d("data-[selected=true]:bg-[var(--input)] data-[selected=true]:text-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),...r})}function no({className:t,...r}){return e.jsx("span",{"data-slot":"command-shortcut",className:d("text-muted-foreground ml-auto text-xs tracking-widest",t),...r})}function ge({...t}){return e.jsx($.Root,{"data-slot":"dropdown-menu",...t})}function sa({...t}){return e.jsx($.Portal,{"data-slot":"dropdown-menu-portal",...t})}function pe({...t}){return e.jsx($.Trigger,{"data-slot":"dropdown-menu-trigger",...t})}function he({className:t,sideOffset:r=4,...a}){return e.jsx($.Portal,{children:e.jsx($.Content,{"data-slot":"dropdown-menu-content",sideOffset:r,className:d("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","bg-[var(--background)]",t),...a})})}function xr({...t}){return e.jsx($.Group,{"data-slot":"dropdown-menu-group",...t})}function me({className:t,inset:r,variant:a="default",...s}){return e.jsx($.Item,{"data-slot":"dropdown-menu-item","data-inset":r,"data-variant":a,className:d("focus:bg-[var(--input)] dark:focus:bg-[var(--card)] blue-dark:focus:bg-[var(--secondary)] focus:text-accent-foreground dark:text-foreground focus:dark:text-foreground blue-dark:text-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),...s})}function oo({className:t,children:r,checked:a,...s}){return e.jsxs($.CheckboxItem,{"data-slot":"dropdown-menu-checkbox-item",className:d("focus:bg-[var(--input)] focus:text-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:a,...s,children:[e.jsx("span",{className:"pointer-events-none absolute left-2 flex size-3.5 items-center justify-center",children:e.jsx($.ItemIndicator,{children:e.jsx(f.CheckIcon,{className:"size-4"})})}),r]})}function io({...t}){return e.jsx($.RadioGroup,{"data-slot":"dropdown-menu-radio-group",...t})}function lo({className:t,children:r,...a}){return e.jsxs($.RadioItem,{"data-slot":"dropdown-menu-radio-item",className:d("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),...a,children:[e.jsx("span",{className:"pointer-events-none absolute left-2 flex size-3.5 items-center justify-center",children:e.jsx($.ItemIndicator,{children:e.jsx(f.CircleIcon,{className:"size-2 fill-current"})})}),r]})}function Dt({className:t,inset:r,...a}){return e.jsx($.Label,{"data-slot":"dropdown-menu-label","data-inset":r,className:d("px-2 py-1.5 text-sm font-medium data-[inset]:pl-8",t),...a})}function nt({className:t,...r}){return e.jsx($.Separator,{"data-slot":"dropdown-menu-separator",className:d("bg-border -mx-1 my-1 h-px",t),...r})}function co({className:t,...r}){return e.jsx("span",{"data-slot":"dropdown-menu-shortcut",className:d("text-muted-foreground ml-auto text-xs tracking-widest",t),...r})}function na({...t}){return e.jsx($.Sub,{"data-slot":"dropdown-menu-sub",...t})}function oa({className:t,inset:r,children:a,...s}){return e.jsxs($.SubTrigger,{"data-slot":"dropdown-menu-sub-trigger","data-inset":r,className:d("focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground flex cursor-default items-center rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[inset]:pl-8",t),...s,children:[a,e.jsx(f.ChevronRightIcon,{className:"ml-auto size-4"})]})}function ia({className:t,...r}){return e.jsx($.SubContent,{"data-slot":"dropdown-menu-sub-content",className:d("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),...r})}function uo({...t}){return e.jsx(jt.Root,{"data-slot":"hover-card",...t})}function mo({...t}){return e.jsx(jt.Trigger,{"data-slot":"hover-card-trigger",...t})}function xo({className:t,align:r="center",sideOffset:a=4,...s}){return e.jsx(jt.Portal,{"data-slot":"hover-card-portal",children:e.jsx(jt.Content,{"data-slot":"hover-card-content",align:r,sideOffset:a,className:d("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),...s})})}function H({className:t,type:r,...a}){return e.jsx("input",{type:r,"data-slot":"input",className:d("file:text-foreground placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground border-input flex h-9 w-full min-w-0 rounded-md border-2 bg-secondary 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),...a})}function ke({className:t,...r}){return e.jsx(On.Root,{"data-slot":"label",className:d("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),...r})}function fo({className:t,children:r,viewport:a=!0,...s}){return e.jsxs(ze.Root,{"data-slot":"navigation-menu","data-viewport":a,className:d("group/navigation-menu relative flex max-w-max flex-1 items-center justify-center",t),...s,children:[r,a&&e.jsx(ca,{})]})}function go({className:t,...r}){return e.jsx(ze.List,{"data-slot":"navigation-menu-list",className:d("group flex flex-1 list-none items-center justify-center gap-1",t),...r})}function po({className:t,...r}){return e.jsx(ze.Item,{"data-slot":"navigation-menu-item",className:d("relative",t),...r})}const la=W.cva("group inline-flex h-9 w-max items-center justify-center rounded-md px-4 py-2 text-sm font-medium transition-[color,box-shadow] outline-none focus-visible:ring-[3px] focus-visible:outline-1 disabled:pointer-events-none disabled:opacity-50",{variants:{variant:{default:["bg-background text-foreground","hover:bg-[var(--chart-1)] hover:text-white","focus:bg-[var(--chart-1)] focus:text-white","data-[state=open]:bg-[var(--chart-1)] data-[state=open]:text-white"]}},defaultVariants:{variant:"default"}});function ho({className:t,children:r,...a}){return e.jsxs(ze.Trigger,{"data-slot":"navigation-menu-trigger",className:d(la(),"group",t),...a,children:[r," ",e.jsx(f.ChevronDownIcon,{className:"relative top-[1px] ml-1 size-3 transition duration-300 group-data-[state=open]:rotate-180","aria-hidden":"true"})]})}function bo({className:t,...r}){return e.jsx(ze.Content,{"data-slot":"navigation-menu-content",className:d("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),...r})}function ca({className:t,...r}){return e.jsx("div",{className:d("absolute top-full left-0 isolate z-50 flex justify-center"),children:e.jsx(ze.Viewport,{"data-slot":"navigation-menu-viewport",className:d("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),...r})})}function vo({className:t,...r}){return e.jsx(ze.Link,{"data-slot":"navigation-menu-link",className:d("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 [&_svg:not([class*='text-'])]:text-muted-foreground","hover:bg-[var(--chart-1)] hover:text-white","focus:bg-[var(--chart-1)] focus:text-white","data-[active=true]:bg-[var(--chart-1)] data-[active=true]:text-white",t),...r})}function jo({className:t,...r}){return e.jsx(ze.Indicator,{"data-slot":"navigation-menu-indicator",className:d("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),...r,children:e.jsx("div",{className:"bg-border relative top-[60%] h-2 w-2 rotate-45 rounded-tl-sm shadow-md"})})}function Q({...t}){return e.jsx(at.Root,{"data-slot":"popover",...t})}function J({...t}){return e.jsx(at.Trigger,{"data-slot":"popover-trigger",...t})}function Z({className:t,align:r="center",sideOffset:a=4,...s}){return e.jsx(at.Portal,{children:e.jsx(at.Content,{"data-slot":"popover-content",align:r,sideOffset:a,className:d("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),...s})})}function wo({...t}){return e.jsx(at.Anchor,{"data-slot":"popover-anchor",...t})}function Pt({className:t,value:r=0,indicatorColor:a="var(--progress-foreground)",...s}){return e.jsx(Tr.Root,{"data-slot":"progress",className:d("bg-[var(--progress-background)] relative h-2 w-full overflow-hidden rounded-full",t),...s,children:e.jsx(Tr.Indicator,{"data-slot":"progress-indicator",className:"h-full w-full flex-1 transition-all",style:{transform:`translateX(-${100-r}%)`,backgroundColor:a}})})}function No({className:t,...r}){return e.jsx(zt.Root,{"data-slot":"radio-group",className:d("grid gap-3",t),...r})}function yo({className:t,...r}){return e.jsx(zt.Item,{"data-slot":"radio-group-item",className:d("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),...r,children:e.jsx(zt.Indicator,{"data-slot":"radio-group-indicator",className:"relative flex items-center justify-center",children:e.jsx(f.CircleIcon,{className:"fill-primary absolute top-1/2 left-1/2 size-2 -translate-x-1/2 -translate-y-1/2"})})})}function Co({className:t,children:r,...a}){return e.jsxs(et.Root,{"data-slot":"scroll-area",className:d("relative",t),...a,children:[e.jsx(et.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:r}),e.jsx(da,{}),e.jsx(et.Corner,{})]})}function da({className:t,orientation:r="vertical",...a}){return e.jsx(et.ScrollAreaScrollbar,{"data-slot":"scroll-area-scrollbar",orientation:r,className:d("flex touch-none p-px transition-colors select-none",r==="vertical"&&"h-full w-2.5 border-l border-l-transparent",r==="horizontal"&&"h-2.5 flex-col border-t border-t-transparent",t),...a,children:e.jsx(et.ScrollAreaThumb,{"data-slot":"scroll-area-thumb",className:"bg-[var(--border)] relative flex-1 rounded-full"})})}function ua({...t}){return e.jsx(K.Root,{"data-slot":"select",...t})}function So({...t}){return e.jsx(K.Group,{"data-slot":"select-group",...t})}function ma({...t}){return e.jsx(K.Value,{"data-slot":"select-value",...t})}function xa({className:t,size:r="default",children:a,...s}){return e.jsxs(K.Trigger,{"data-slot":"select-trigger","data-size":r,className:d("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),...s,children:[a,e.jsx(K.Icon,{asChild:!0,children:e.jsx(f.ChevronDownIcon,{className:"size-4 opacity-50"})})]})}function fa({className:t,children:r,position:a="popper",...s}){return e.jsx(K.Portal,{children:e.jsxs(K.Content,{"data-slot":"select-content",className:d("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",a==="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:a,...s,children:[e.jsx(pa,{}),e.jsx(K.Viewport,{className:d("p-1",a==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)] scroll-my-1"),children:r}),e.jsx(ha,{})]})})}function ko({className:t,...r}){return e.jsx(K.Label,{"data-slot":"select-label",className:d("text-muted-foreground px-2 py-1.5 text-xs",t),...r})}function ga({className:t,children:r,...a}){return e.jsxs(K.Item,{"data-slot":"select-item",className:d("focus:bg-secondary focus:text-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),...a,children:[e.jsx("span",{className:"absolute right-2 flex size-3.5 items-center justify-center",children:e.jsx(K.ItemIndicator,{children:e.jsx(f.CheckIcon,{className:"size-4"})})}),e.jsx(K.ItemText,{children:r})]})}function Io({className:t,...r}){return e.jsx(K.Separator,{"data-slot":"select-separator",className:d("bg-border pointer-events-none -mx-1 my-1 h-px",t),...r})}function pa({className:t,...r}){return e.jsx(K.ScrollUpButton,{"data-slot":"select-scroll-up-button",className:d("flex cursor-default items-center justify-center py-1",t),...r,children:e.jsx(f.ChevronUpIcon,{className:"size-4"})})}function ha({className:t,...r}){return e.jsx(K.ScrollDownButton,{"data-slot":"select-scroll-down-button",className:d("flex cursor-default items-center justify-center py-1",t),...r,children:e.jsx(f.ChevronDownIcon,{className:"size-4"})})}function Tt({className:t,orientation:r="horizontal",decorative:a=!0,...s}){return e.jsx(Bn.Root,{"data-slot":"separator",decorative:a,orientation:r,className:d("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),...s})}function fr({...t}){return e.jsx(V.Root,{"data-slot":"sheet",...t})}function ba({...t}){return e.jsx(V.Trigger,{"data-slot":"sheet-trigger",...t})}function Ao({...t}){return e.jsx(V.Close,{"data-slot":"sheet-close",...t})}function Do({...t}){return e.jsx(V.Portal,{"data-slot":"sheet-portal",...t})}function Po({className:t,...r}){return e.jsx(V.Overlay,{"data-slot":"sheet-overlay",className:d("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),...r})}function gr({className:t,children:r,side:a="right",...s}){return e.jsxs(Do,{children:[e.jsx(Po,{}),e.jsxs(V.Content,{"data-slot":"sheet-content",className:d("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",a==="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",a==="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",a==="top"&&"data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top inset-x-0 top-0 h-auto border-b",a==="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:[r,e.jsxs(V.Close,{className:"ring-offset-background focus:ring-ring data-[state=open]:bg-secondary absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none",children:[e.jsx(f.XIcon,{className:"size-4"}),e.jsx("span",{className:"sr-only",children:"Close"})]})]})]})}function va({className:t,...r}){return e.jsx("div",{"data-slot":"sheet-header",className:d("flex flex-col gap-1.5 p-4",t),...r})}function To({className:t,...r}){return e.jsx("div",{"data-slot":"sheet-footer",className:d("mt-auto flex flex-col gap-2 p-4",t),...r})}function pr({className:t,...r}){return e.jsx(V.Title,{"data-slot":"sheet-title",className:d("text-foreground font-semibold",t),...r})}function ja({className:t,...r}){return e.jsx(V.Description,{"data-slot":"sheet-description",className:d("text-muted-foreground text-sm",t),...r})}const _t=768;function Rt(){const[t,r]=S.useState(void 0);return S.useEffect(()=>{const a=window.matchMedia(`(max-width: ${_t-1}px)`),s=()=>{r(window.innerWidth<_t)};return a.addEventListener("change",s),r(window.innerWidth<_t),()=>a.removeEventListener("change",s)},[]),!!t}function Be({className:t,...r}){return e.jsx("div",{"data-slot":"skeleton",className:d("animate-pulse rounded-md",t),style:{backgroundColor:"var(--keross-skeleton-bg)"},...r})}function Ae({delayDuration:t=0,...r}){return e.jsx(Ke.Provider,{"data-slot":"tooltip-provider",delayDuration:t,...r})}function ne({...t}){return e.jsx(Ae,{children:e.jsx(Ke.Root,{"data-slot":"tooltip",...t})})}function oe({...t}){return e.jsx(Ke.Trigger,{"data-slot":"tooltip-trigger",className:d("inline-flex w-[80px] whitespace-nowrap rounded-md border-0 border-input py-2 text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50"),...t})}function ie({className:t,sideOffset:r=0,children:a,...s}){return e.jsx(Ke.Portal,{children:e.jsxs(Ke.Content,{"data-slot":"tooltip-content",sideOffset:r,className:d("bg-[var(--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),...s,children:[a,e.jsx(Ke.Arrow,{className:"bg-[var(--foreground)] fill-[var(--foreground)] z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px]"})]})})}const Ro="sidebar_state",Fo=3600*24*7,_o="16rem",Mo="18rem",Eo="3rem",zo="b",wa=S.createContext(null);function ot(){const t=S.useContext(wa);if(!t)throw new Error("useSidebar must be used within a SidebarProvider.");return t}function Na({defaultOpen:t=!0,open:r,onOpenChange:a,className:s,style:n,children:o,...i}){const l=Rt(),[u,c]=S.useState(!1),[x,g]=S.useState(t),w=r??x,N=S.useCallback(k=>{const p=typeof k=="function"?k(w):k;a?a(p):g(p),document.cookie=`${Ro}=${p}; path=/; max-age=${Fo}`},[a,w]),v=S.useCallback(()=>l?c(k=>!k):N(k=>!k),[l,N,c]);S.useEffect(()=>{const k=p=>{p.key===zo&&(p.metaKey||p.ctrlKey)&&(p.preventDefault(),v())};return window.addEventListener("keydown",k),()=>window.removeEventListener("keydown",k)},[v]);const C=w?"expanded":"collapsed",b=S.useMemo(()=>({state:C,open:w,setOpen:N,isMobile:l,openMobile:u,setOpenMobile:c,toggleSidebar:v}),[C,w,N,l,u,c,v]);return e.jsx(wa.Provider,{value:b,children:e.jsx(Ae,{delayDuration:0,children:e.jsx("div",{"data-slot":"sidebar-wrapper",style:{"--sidebar-width":_o,"--sidebar-width-icon":Eo,...n},className:d("group/sidebar-wrapper has-data-[variant=inset]:bg-sidebar flex min-h-svh w-full",s),...i,children:o})})})}function ya({side:t="left",variant:r="sidebar",collapsible:a="offcanvas",className:s,children:n,...o}){const{isMobile:i,state:l,openMobile:u,setOpenMobile:c}=ot();return a==="none"?e.jsx("div",{"data-slot":"sidebar",className:d("bg-sidebar text-sidebar-foreground flex h-full w-(--sidebar-width) flex-col",s),...o,children:n}):i?e.jsx(fr,{open:u,onOpenChange:c,...o,children:e.jsxs(gr,{"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":Mo},side:t,children:[e.jsxs(va,{className:"sr-only",children:[e.jsx(pr,{children:"Sidebar"}),e.jsx(ja,{children:"Displays the mobile sidebar."})]}),e.jsx("div",{className:"flex h-full w-full flex-col",children:n})]})}):e.jsxs("div",{className:"group peer text-sidebar-foreground hidden md:block","data-state":l,"data-collapsible":l==="collapsed"?a:"","data-variant":r,"data-side":t,"data-slot":"sidebar",children:[e.jsx("div",{"data-slot":"sidebar-gap",className:d("relative w-(--sidebar-width) bg-transparent transition-[width] duration-200 ease-linear","group-data-[collapsible=offcanvas]:w-0","group-data-[side=right]:rotate-180",r==="floating"||r==="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:d("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)]",r==="floating"||r==="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",s),...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:n})})]})}function Ca({className:t,onClick:r,...a}){const{toggleSidebar:s}=ot();return e.jsxs(T,{"data-sidebar":"trigger","data-slot":"sidebar-trigger",variant:"ghost",size:"icon",className:d("size-7",t),onClick:n=>{r?.(n),s()},...a,children:[e.jsx(f.PanelLeftIcon,{}),e.jsx("span",{className:"sr-only",children:"Toggle Sidebar"})]})}function Sa({className:t,...r}){const{toggleSidebar:a}=ot();return e.jsx("button",{"data-sidebar":"rail","data-slot":"sidebar-rail","aria-label":"Toggle Sidebar",tabIndex:-1,onClick:a,title:"Toggle Sidebar",className:d("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),...r})}function ka({className:t,...r}){return e.jsx("main",{"data-slot":"sidebar-inset",className:d("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),...r})}function Lo({className:t,...r}){return e.jsx(H,{"data-slot":"sidebar-input","data-sidebar":"input",className:d("bg-background h-8 w-full shadow-none",t),...r})}function Ia({className:t,...r}){return e.jsx("div",{"data-slot":"sidebar-header","data-sidebar":"header",className:d("flex flex-col gap-2 p-2",t),...r})}function Aa({className:t,...r}){return e.jsx("div",{"data-slot":"sidebar-footer","data-sidebar":"footer",className:d("flex flex-col gap-2 p-2",t),...r})}function Oo({className:t,...r}){return e.jsx(Tt,{"data-slot":"sidebar-separator","data-sidebar":"separator",className:d("bg-sidebar-border mx-2 w-auto",t),...r})}function Da({className:t,...r}){return e.jsx("div",{"data-slot":"sidebar-content","data-sidebar":"content",className:d("flex min-h-0 flex-1 flex-col gap-2 overflow-auto group-data-[collapsible=icon]:overflow-hidden",t),...r})}function Pa({className:t,...r}){return e.jsx("div",{"data-slot":"sidebar-group","data-sidebar":"group",className:d("relative flex w-full min-w-0 flex-col p-2",t),...r})}function Bo({className:t,asChild:r=!1,...a}){const s=r?fe.Slot:"div";return e.jsx(s,{"data-slot":"sidebar-group-label","data-sidebar":"group-label",className:d("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),...a})}function Uo({className:t,asChild:r=!1,...a}){const s=r?fe.Slot:"button";return e.jsx(s,{"data-slot":"sidebar-group-action","data-sidebar":"group-action",className:d("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),...a})}function Vo({className:t,...r}){return e.jsx("div",{"data-slot":"sidebar-group-content","data-sidebar":"group-content",className:d("w-full text-sm",t),...r})}function Ta({className:t,...r}){return e.jsx("ul",{"data-slot":"sidebar-menu","data-sidebar":"menu",className:d("flex w-full min-w-0 flex-col gap-1",t),...r})}function Ot({className:t,...r}){return e.jsx("li",{"data-slot":"sidebar-menu-item","data-sidebar":"menu-item",className:d("group/menu-item relative",t),...r})}const $o=W.cva("peer/menu-button flex w-full items-center gap-2 overflow-hidden rounded-md p-2 text-left text-sm outline-hidden ring-sidebar-ring transition-[width,height,padding] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 active:bg-sidebar-accent active:text-sidebar-accent-foreground disabled:pointer-events-none disabled:opacity-50 group-has-data-[sidebar=menu-action]/menu-item:pr-8 aria-disabled:pointer-events-none aria-disabled:opacity-50 data-[active=true]:bg-sidebar-accent data-[active=true]:font-medium data-[active=true]:text-sidebar-accent-foreground data-[state=open]:hover:bg-sidebar-accent data-[state=open]:hover:text-sidebar-accent-foreground group-data-[collapsible=icon]:size-8! group-data-[collapsible=icon]:p-2! [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0",{variants:{variant:{default:"hover:bg-sidebar-accent hover:text-sidebar-accent-foreground",outline:"bg-background shadow-[0_0_0_1px_hsl(var(--sidebar-border))] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground hover:shadow-[0_0_0_1px_hsl(var(--sidebar-accent))]"},size:{default:"h-8 text-sm",sm:"h-7 text-xs",lg:"h-12 text-sm group-data-[collapsible=icon]:p-0!"}},defaultVariants:{variant:"default",size:"default"}});function Bt({asChild:t=!1,isActive:r=!1,variant:a="default",size:s="default",tooltip:n,className:o,...i}){const l=t?fe.Slot:"button",{isMobile:u,state:c}=ot(),x=e.jsx(l,{"data-slot":"sidebar-menu-button","data-sidebar":"menu-button","data-size":s,"data-active":r,className:d($o({variant:a,size:s}),o),...i});return n?(typeof n=="string"&&(n={children:n}),e.jsxs(ne,{children:[e.jsx(oe,{asChild:!0,children:x}),e.jsx(ie,{side:"right",align:"center",hidden:c!=="collapsed"||u,...n})]})):x}function Go({className:t,asChild:r=!1,showOnHover:a=!1,...s}){const n=r?fe.Slot:"button";return e.jsx(n,{"data-slot":"sidebar-menu-action","data-sidebar":"menu-action",className:d("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",a&&"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),...s})}function qo({className:t,...r}){return e.jsx("div",{"data-slot":"sidebar-menu-badge","data-sidebar":"menu-badge",className:d("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),...r})}function Wo({className:t,showIcon:r=!1,...a}){const s=S.useMemo(()=>`${Math.floor(Math.random()*40)+50}%`,[]);return e.jsxs("div",{"data-slot":"sidebar-menu-skeleton","data-sidebar":"menu-skeleton",className:d("flex h-8 items-center gap-2 rounded-md px-2",t),...a,children:[r&&e.jsx(Be,{className:"size-4 rounded-md","data-sidebar":"menu-skeleton-icon"}),e.jsx(Be,{className:"h-4 max-w-(--skeleton-width) flex-1","data-sidebar":"menu-skeleton-text",style:{"--skeleton-width":s}})]})}function Ra({className:t,...r}){return e.jsx("ul",{"data-slot":"sidebar-menu-sub","data-sidebar":"menu-sub",className:d("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),...r})}function Ut({className:t,...r}){return e.jsx("li",{"data-slot":"sidebar-menu-sub-item","data-sidebar":"menu-sub-item",className:d("group/menu-sub-item relative",t),...r})}function Vt({asChild:t=!1,size:r="md",isActive:a=!1,className:s,...n}){const o=t?fe.Slot:"a";return e.jsx(o,{"data-slot":"sidebar-menu-sub-button","data-sidebar":"menu-sub-button","data-size":r,"data-active":a,className:d("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",r==="sm"&&"text-xs",r==="md"&&"text-sm","group-data-[collapsible=icon]:hidden",s),...n})}function Ho({className:t,defaultValue:r,value:a,min:s=0,max:n=100,...o}){const i=S.useMemo(()=>Array.isArray(a)?a:Array.isArray(r)?r:[s,n],[a,r,s,n]);return e.jsxs(ft.Root,{"data-slot":"slider",defaultValue:r,value:a,min:s,max:n,className:d("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(ft.Track,{"data-slot":"slider-track",className:d("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"),style:{backgroundColor:"var(--keross-skeleton-bg)"},children:e.jsx(ft.Range,{"data-slot":"slider-range",className:d("bg-primary absolute data-[orientation=horizontal]:h-full data-[orientation=vertical]:w-full")})}),Array.from({length:i.length},(l,u)=>e.jsx(ft.Thumb,{"data-slot":"slider-thumb",className:"border-primary bg-white ring-ring/50 block size-4 shrink-0 rounded-full border shadow-sm transition-[color,box-shadow] hover:ring-4 focus-visible:ring-4 focus-visible:outline-hidden disabled:pointer-events-none disabled:opacity-50"},u))]})}const Fa=S.createContext(void 0),_a=({children:t})=>{const r=()=>typeof window>"u"?"light":window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light",[a,s]=S.useState(()=>typeof window>"u"?"system":localStorage.getItem("theme")||"system"),[n,o]=S.useState(()=>a==="system"?r():a),i=S.useCallback(u=>{const c=document.documentElement;c.classList.remove("dark","blue-dark");let x;u==="system"?x=r():x=u,x==="dark"&&c.classList.add("dark"),x==="blue-dark"&&c.classList.add("blue-dark"),o(x)},[]);S.useEffect(()=>{i(a),localStorage.setItem("theme",a)},[a,i]),S.useEffect(()=>{if(a!=="system")return;const u=window.matchMedia("(prefers-color-scheme: dark)"),c=()=>{i("system")};return u.addEventListener("change",c),()=>u.removeEventListener("change",c)},[a,i]);const l=S.useMemo(()=>({theme:a,setTheme:s,resolvedTheme:n}),[a,n]);return e.jsx(Fa.Provider,{value:l,children:t})},Ma=()=>{const t=S.useContext(Fa);if(!t)throw new Error("useTheme must be used within ThemeProvider");return t},Ko=({...t})=>{const{theme:r="system"}=Ma();return e.jsx(Or.Toaster,{theme:r,className:"toaster group",icons:{success:e.jsx(f.CircleCheckIcon,{className:"size-4"}),info:e.jsx(f.InfoIcon,{className:"size-4"}),warning:e.jsx(f.TriangleAlertIcon,{className:"size-4"}),error:e.jsx(f.OctagonXIcon,{className:"size-4"}),loading:e.jsx(f.Loader2Icon,{className:"size-4 animate-spin"})},style:{"--normal-bg":"var(--popover)","--normal-text":"var(--popover-foreground)","--normal-border":"var(--border)","--border-radius":"var(--radius)"},...t})};function Xo({className:t,...r}){return e.jsx(Rr.Root,{"data-slot":"switch",className:d("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 inline-flex h-[1.15rem] w-8 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",t),...r,children:e.jsx(Rr.Thumb,{"data-slot":"switch-thumb",className:d("bg-background dark:data-[state=unchecked]:bg-foreground dark:data-[state=checked]:bg-primary-foreground pointer-events-none block size-4 rounded-full ring-0 transition-transform data-[state=checked]:translate-x-[calc(100%-2px)] data-[state=unchecked]:translate-x-0")})})}function Ea({className:t,...r}){return e.jsx("div",{"data-slot":"table-container",className:"h-full relative w-full overflow-auto",children:e.jsx("table",{"data-slot":"table",className:d("w-full caption-bottom text-sm",t),...r})})}function za({className:t,...r}){return e.jsx("thead",{"data-slot":"table-header",className:d("[&_tr]:border-b",t),...r})}function La({className:t,...r}){return e.jsx("tbody",{"data-slot":"table-body",className:d("[&_tr:last-child]:border-0",t),...r})}function Oa({className:t,...r}){return e.jsx("tfoot",{"data-slot":"table-footer",className:d("bg-muted/50 border-t font-medium [&>tr]:last:border-b-0",t),...r})}function qe({className:t,...r}){return e.jsx("tr",{"data-slot":"table-row",className:d("border-b transition-colors hover:bg-muted/50 data-[state=selected]:bg-muted",t),...r})}function $t({className:t,...r}){return e.jsx("th",{"data-slot":"table-head",className:d("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),...r})}function Je({className:t,...r}){return e.jsx("td",{"data-slot":"table-cell",className:d("p-2 align-middle whitespace-nowrap [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",t),...r})}function Yo({className:t,...r}){return e.jsx("caption",{"data-slot":"table-caption",className:d("text-muted-foreground mt-4 text-sm",t),...r})}function Ba({className:t,...r}){return e.jsx(St.Root,{"data-slot":"tabs",className:d("flex flex-col gap-2",t),...r})}function Ua({className:t,...r}){return e.jsx(St.List,{"data-slot":"tabs-list",className:d("bg-background text-muted-foreground inline-flex h-9 w-fit items-center justify-center rounded-lg p-[3px]",t),...r})}function Va({className:t,...r}){return e.jsx(St.Trigger,{"data-slot":"tabs-trigger",className:d("data-[state=active]:bg-background dark:data-[state=active]:text-foreground focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:outline-ring dark:data-[state=active]:border-input dark:data-[state=active]:bg-input/30 text-foreground dark:text-muted-foreground 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-[color,box-shadow] focus-visible:ring-[3px] focus-visible:outline-1 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:shadow-sm [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",t),...r})}function Gt({className:t,...r}){return e.jsx(St.Content,{"data-slot":"tabs-content",className:d("flex-1 outline-none",t),...r})}function $a({className:t,...r}){return e.jsx("textarea",{"data-slot":"textarea",className:d("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 flex field-sizing-content min-h-16 w-full rounded-md border 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 bg-[var(--secondary)] dark:bg-[var(--input-background-custom)]",t),...r})}function qt({...t}){return e.jsx(Un.Root,{"data-slot":"aspect-ratio",...t})}function Ga({...t}){return e.jsx("nav",{"aria-label":"breadcrumb","data-slot":"breadcrumb",...t})}function qa({className:t,...r}){return e.jsx("ol",{"data-slot":"breadcrumb-list",className:d("text-muted-foreground blue-dark:text-foreground flex flex-wrap items-center gap-1.5 text-sm break-words sm:gap-2.5",t),...r})}function We({className:t,...r}){return e.jsx("li",{"data-slot":"breadcrumb-item",className:d("inline-flex items-center gap-1.5",t),...r})}function Wt({asChild:t,className:r,...a}){const s=t?fe.Slot:"a";return e.jsx(s,{"data-slot":"breadcrumb-link",className:d("hover:text-foreground transition-colors",r),...a})}function Ze({className:t,...r}){return e.jsx("span",{"data-slot":"breadcrumb-page",role:"link","aria-disabled":"true","aria-current":"page",className:d("text-foreground font-normal",t),...r})}function vt({children:t,className:r,...a}){return e.jsx("li",{"data-slot":"breadcrumb-separator",role:"presentation","aria-hidden":"true",className:d("[&>svg]:size-3.5",r),...a,children:t??e.jsx(f.ChevronRight,{})})}function Ht({className:t,...r}){return e.jsxs("span",{"data-slot":"breadcrumb-ellipsis",role:"presentation","aria-hidden":"true",className:d("flex size-9 items-center justify-center",t),...r,children:[e.jsx(f.MoreHorizontal,{className:"size-4"}),e.jsx("span",{className:"sr-only",children:"More"})]})}function Qo(t,r,{checkForDefaultPrevented:a=!0}={}){return function(n){if(t?.(n),a===!1||!n.defaultPrevented)return r?.(n)}}function Jo(t,r=[]){let a=[];function s(o,i){const l=S.createContext(i),u=a.length;a=[...a,i];const c=g=>{const{scope:w,children:N,...v}=g,C=w?.[t]?.[u]||l,b=S.useMemo(()=>v,Object.values(v));return e.jsx(C.Provider,{value:b,children:N})};c.displayName=o+"Provider";function x(g,w){const N=w?.[t]?.[u]||l,v=S.useContext(N);if(v)return v;if(i!==void 0)return i;throw new Error(`\`${g}\` must be used within \`${o}\``)}return[c,x]}const n=()=>{const o=a.map(i=>S.createContext(i));return function(l){const u=l?.[t]||o;return S.useMemo(()=>({[`__scope${t}`]:{...l,[t]:u}}),[l,u])}};return n.scopeName=t,[s,Zo(n,...r)]}function Zo(...t){const r=t[0];if(t.length===1)return r;const a=()=>{const s=t.map(n=>({useScope:n(),scopeName:n.scopeName}));return function(o){const i=s.reduce((l,{useScope:u,scopeName:c})=>{const g=u(o)[`__scope${c}`];return{...l,...g}},{});return S.useMemo(()=>({[`__scope${r.scopeName}`]:i}),[i])}};return a.scopeName=r.scopeName,a}var st=globalThis?.document?S.useLayoutEffect:()=>{},ei=S[" useInsertionEffect ".trim().toString()]||st;function ti({prop:t,defaultProp:r,onChange:a=()=>{},caller:s}){const[n,o,i]=ri({defaultProp:r,onChange:a}),l=t!==void 0,u=l?t:n;{const x=S.useRef(t!==void 0);S.useEffect(()=>{const g=x.current;g!==l&&console.warn(`${s} is changing from ${g?"controlled":"uncontrolled"} to ${l?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),x.current=l},[l,s])}const c=S.useCallback(x=>{if(l){const g=ai(x)?x(t):x;g!==t&&i.current?.(g)}else o(x)},[l,t,o,i]);return[u,c]}function ri({defaultProp:t,onChange:r}){const[a,s]=S.useState(t),n=S.useRef(a),o=S.useRef(r);return ei(()=>{o.current=r},[r]),S.useEffect(()=>{n.current!==a&&(o.current?.(a),n.current=a)},[a,n]),[a,s,o]}function ai(t){return typeof t=="function"}function Fr(t,r){if(typeof t=="function")return t(r);t!=null&&(t.current=r)}function si(...t){return r=>{let a=!1;const s=t.map(n=>{const o=Fr(n,r);return!a&&typeof o=="function"&&(a=!0),o});if(a)return()=>{for(let n=0;n<s.length;n++){const o=s[n];typeof o=="function"?o():Fr(t[n],null)}}}}function Wa(...t){return S.useCallback(si(...t),t)}var ni=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],hr=ni.reduce((t,r)=>{const a=fe.createSlot(`Primitive.${r}`),s=S.forwardRef((n,o)=>{const{asChild:i,...l}=n,u=i?a:r;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),e.jsx(u,{...l,ref:o})});return s.displayName=`Primitive.${r}`,{...t,[r]:s}},{});function oi(t,r){return S.useReducer((a,s)=>r[a][s]??a,t)}var Ha=t=>{const{present:r,children:a}=t,s=ii(r),n=typeof a=="function"?a({present:s.isPresent}):S.Children.only(a),o=Wa(s.ref,li(n));return typeof a=="function"||s.isPresent?S.cloneElement(n,{ref:o}):null};Ha.displayName="Presence";function ii(t){const[r,a]=S.useState(),s=S.useRef(null),n=S.useRef(t),o=S.useRef("none"),i=t?"mounted":"unmounted",[l,u]=oi(i,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return S.useEffect(()=>{const c=pt(s.current);o.current=l==="mounted"?c:"none"},[l]),st(()=>{const c=s.current,x=n.current;if(x!==t){const w=o.current,N=pt(c);t?u("MOUNT"):N==="none"||c?.display==="none"?u("UNMOUNT"):u(x&&w!==N?"ANIMATION_OUT":"UNMOUNT"),n.current=t}},[t,u]),st(()=>{if(r){let c;const x=r.ownerDocument.defaultView??window,g=N=>{const C=pt(s.current).includes(CSS.escape(N.animationName));if(N.target===r&&C&&(u("ANIMATION_END"),!n.current)){const b=r.style.animationFillMode;r.style.animationFillMode="forwards",c=x.setTimeout(()=>{r.style.animationFillMode==="forwards"&&(r.style.animationFillMode=b)})}},w=N=>{N.target===r&&(o.current=pt(s.current))};return r.addEventListener("animationstart",w),r.addEventListener("animationcancel",g),r.addEventListener("animationend",g),()=>{x.clearTimeout(c),r.removeEventListener("animationstart",w),r.removeEventListener("animationcancel",g),r.removeEventListener("animationend",g)}}else u("ANIMATION_END")},[r,u]),{isPresent:["mounted","unmountSuspended"].includes(l),ref:S.useCallback(c=>{s.current=c?getComputedStyle(c):null,a(c)},[])}}function pt(t){return t?.animationName||"none"}function li(t){let r=Object.getOwnPropertyDescriptor(t.props,"ref")?.get,a=r&&"isReactWarning"in r&&r.isReactWarning;return a?t.ref:(r=Object.getOwnPropertyDescriptor(t,"ref")?.get,a=r&&"isReactWarning"in r&&r.isReactWarning,a?t.props.ref:t.props.ref||t.ref)}var ci=S[" useId ".trim().toString()]||(()=>{}),di=0;function ui(t){const[r,a]=S.useState(ci());return st(()=>{a(s=>s??String(di++))},[t]),t||(r?`radix-${r}`:"")}var Ft="Collapsible",[mi]=Jo(Ft),[xi,br]=mi(Ft),Ka=S.forwardRef((t,r)=>{const{__scopeCollapsible:a,open:s,defaultOpen:n,disabled:o,onOpenChange:i,...l}=t,[u,c]=ti({prop:s,defaultProp:n??!1,onChange:i,caller:Ft});return e.jsx(xi,{scope:a,disabled:o,contentId:ui(),open:u,onOpenToggle:S.useCallback(()=>c(x=>!x),[c]),children:e.jsx(hr.div,{"data-state":jr(u),"data-disabled":o?"":void 0,...l,ref:r})})});Ka.displayName=Ft;var Xa="CollapsibleTrigger",Ya=S.forwardRef((t,r)=>{const{__scopeCollapsible:a,...s}=t,n=br(Xa,a);return e.jsx(hr.button,{type:"button","aria-controls":n.contentId,"aria-expanded":n.open||!1,"data-state":jr(n.open),"data-disabled":n.disabled?"":void 0,disabled:n.disabled,...s,ref:r,onClick:Qo(t.onClick,n.onOpenToggle)})});Ya.displayName=Xa;var vr="CollapsibleContent",Qa=S.forwardRef((t,r)=>{const{forceMount:a,...s}=t,n=br(vr,t.__scopeCollapsible);return e.jsx(Ha,{present:a||n.open,children:({present:o})=>e.jsx(fi,{...s,ref:r,present:o})})});Qa.displayName=vr;var fi=S.forwardRef((t,r)=>{const{__scopeCollapsible:a,present:s,children:n,...o}=t,i=br(vr,a),[l,u]=S.useState(s),c=S.useRef(null),x=Wa(r,c),g=S.useRef(0),w=g.current,N=S.useRef(0),v=N.current,C=i.open||l,b=S.useRef(C),k=S.useRef(void 0);return S.useEffect(()=>{const p=requestAnimationFrame(()=>b.current=!1);return()=>cancelAnimationFrame(p)},[]),st(()=>{const p=c.current;if(p){k.current=k.current||{transitionDuration:p.style.transitionDuration,animationName:p.style.animationName},p.style.transitionDuration="0s",p.style.animationName="none";const A=p.getBoundingClientRect();g.current=A.height,N.current=A.width,b.current||(p.style.transitionDuration=k.current.transitionDuration,p.style.animationName=k.current.animationName),u(s)}},[i.open,s]),e.jsx(hr.div,{"data-state":jr(i.open),"data-disabled":i.disabled?"":void 0,id:i.contentId,hidden:!C,...o,ref:x,style:{"--radix-collapsible-content-height":w?`${w}px`:void 0,"--radix-collapsible-content-width":v?`${v}px`:void 0,...t.style},children:C&&n})});function jr(t){return t?"open":"closed"}var gi=Ka;function Kt({...t}){return e.jsx(gi,{"data-slot":"collapsible",...t})}function Xt({...t}){return e.jsx(Ya,{"data-slot":"collapsible-trigger",...t})}function Yt({...t}){return e.jsx(Qa,{"data-slot":"collapsible-content",...t})}function Ja({...t}){return e.jsx(Ee.Drawer.Root,{"data-slot":"drawer",...t})}function Za({...t}){return e.jsx(Ee.Drawer.Trigger,{"data-slot":"drawer-trigger",...t})}function es({...t}){return e.jsx(Ee.Drawer.Portal,{"data-slot":"drawer-portal",...t})}function ts({...t}){return e.jsx(Ee.Drawer.Close,{"data-slot":"drawer-close",...t})}function rs({className:t,...r}){return e.jsx(Ee.Drawer.Overlay,{"data-slot":"drawer-overlay",className:d("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),...r})}function as({className:t,children:r,...a}){return e.jsxs(es,{"data-slot":"drawer-portal",children:[e.jsx(rs,{}),e.jsxs(Ee.Drawer.Content,{"data-slot":"drawer-content",className:d("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),...a,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"}),r]})]})}function ss({className:t,...r}){return e.jsx("div",{"data-slot":"drawer-header",className:d("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),...r})}function ns({className:t,...r}){return e.jsx("div",{"data-slot":"drawer-footer",className:d("mt-auto flex flex-col gap-2 p-4",t),...r})}function os({className:t,...r}){return e.jsx(Ee.Drawer.Title,{"data-slot":"drawer-title",className:d("text-foreground font-semibold",t),...r})}function is({className:t,...r}){return e.jsx(Ee.Drawer.Description,{"data-slot":"drawer-description",className:d("text-muted-foreground text-sm",t),...r})}const ls=Xe.FormProvider,cs=S.createContext({}),be=({...t})=>e.jsx(cs.Provider,{value:{name:t.name},children:e.jsx(Xe.Controller,{...t})}),it=()=>{const t=S.useContext(cs),r=S.useContext(ds),{getFieldState:a}=Xe.useFormContext(),s=Xe.useFormState({name:t.name}),n=a(t.name,s);if(!t)throw new Error("useFormField should be used within <FormField>");const{id:o}=r;return{id:o,name:t.name,formItemId:`${o}-form-item`,formDescriptionId:`${o}-form-item-description`,formMessageId:`${o}-form-item-message`,...n}},ds=S.createContext({});function ve({className:t,...r}){const a=S.useId();return e.jsx(ds.Provider,{value:{id:a},children:e.jsx("div",{"data-slot":"form-item",className:d("grid gap-2",t),...r})})}function ye({className:t,...r}){const{error:a,formItemId:s}=it();return e.jsx(ke,{"data-slot":"form-label","data-error":!!a,className:d("data-[error=true]:text-destructive",t),htmlFor:s,...r})}function je({...t}){const{error:r,formItemId:a,formDescriptionId:s,formMessageId:n}=it();return e.jsx(fe.Slot,{"data-slot":"form-control",id:a,"aria-describedby":r?`${s} ${n}`:`${s}`,"aria-invalid":!!r,...t})}function Ce({className:t,...r}){const{formDescriptionId:a}=it();return e.jsx("p",{"data-slot":"form-description",id:a,className:d("text-muted-foreground text-sm",t),...r})}function we({className:t,...r}){const{error:a,formMessageId:s}=it(),n=a?String(a?.message??""):r.children;return n?e.jsx("p",{"data-slot":"form-message",id:s,className:d("text-destructive text-sm",t),...r,children:n}):null}const wr=S.forwardRef(({className:t,containerClassName:r,...a},s)=>e.jsx(Br.OTPInput,{ref:s,containerClassName:d("flex items-center gap-2 has-[:disabled]:opacity-50",r),className:d("disabled:cursor-not-allowed",t),...a}));wr.displayName="InputOTP";const Nr=S.forwardRef(({className:t,...r},a)=>e.jsx("div",{ref:a,className:d("flex items-center",t),...r}));Nr.displayName="InputOTPGroup";const He=S.forwardRef(({index:t,className:r,...a},s)=>{const n=S.useContext(Br.OTPInputContext),{char:o,hasFakeCaret:i,isActive:l}=n.slots[t];return e.jsxs("div",{ref:s,className:d("relative flex h-9 w-9 items-center justify-center border-y border-r border-input text-sm shadow-sm transition-all first:rounded-l-md first:border-l last:rounded-r-md",l&&"z-10 ring-1 ring-ring",r),...a,children:[o,i&&e.jsx("div",{className:"pointer-events-none absolute inset-0 flex items-center justify-center",children:e.jsx("div",{className:"h-4 w-px animate-caret-blink bg-foreground duration-1000"})})]})});He.displayName="InputOTPSlot";const us=S.forwardRef(({...t},r)=>e.jsx("div",{ref:r,role:"separator",...t,children:e.jsx(f.Minus,{})}));us.displayName="InputOTPSeparator";const yr=W.cva("inline-flex items-center justify-center gap-2 rounded-md text-sm font-medium hover:bg-muted hover:text-muted-foreground disabled:pointer-events-none disabled:opacity-50 data-[state=on]:bg-accent data-[state=on]:text-accent-foreground [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 [&_svg]:shrink-0 focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] outline-none transition-[color,box-shadow] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive whitespace-nowrap",{variants:{variant:{default:"bg-transparent",outline:"border border-input bg-transparent shadow-xs hover:bg-accent hover:text-accent-foreground"},size:{default:"h-9 px-2 min-w-9",sm:"h-8 px-1.5 min-w-8",lg:"h-10 px-2.5 min-w-10"}},defaultVariants:{variant:"default",size:"default"}});function pi({className:t,variant:r,size:a,...s}){return e.jsx(Vn.Root,{"data-slot":"toggle",className:d(yr({variant:r,size:a,className:t})),...s})}const ms=S.createContext({size:"default",variant:"default",spacing:0});function Oe({className:t,variant:r,size:a,spacing:s=0,children:n,...o}){return e.jsx($r.Root,{"data-slot":"toggle-group","data-variant":r,"data-size":a,"data-spacing":s,style:{"--gap":s},className:d("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(ms.Provider,{value:{variant:r,size:a,spacing:s},children:n})})}function U({className:t,children:r,variant:a,size:s,...n}){const o=S.useContext(ms);return e.jsx($r.Item,{"data-slot":"toggle-group-item","data-variant":o.variant||a,"data-size":o.size||s,"data-spacing":o.spacing,className:d(yr({variant:o.variant||a,size:o.size||s}),"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),...n,children:r})}const hi={OUTSTANDING:"bg-[#FFDE721A] text-[#FBB125] border border-[#FBB12533]","IN PROGRESS":"bg-[#6A77D91A] text-[#6A77D9]",COMPLETED:"bg-[#519E591A] text-[#519E59] border border-[#FBB12533]"};function bi({name:t,steps:r,style:a}){const s=r.filter(o=>o.status==="COMPLETED").length,n=s/r.length*100;return e.jsxs("div",{style:a,className:"p-4 space-y-2 rounded-lg border dark:bg-[#171717] text-primary blue-dark:bg-[#1B2336]",children:[e.jsx("h2",{className:"text-sm font-semibold mb-4 m-3",children:t}),r.map(o=>{const i=o.id??"";return e.jsxs("div",{className:"flex flex-col sm:flex-row justify-between items-start sm:items-center p-5 border border-neutral-600 rounded-md gap-1 sm:gap-2 m-2",children:[e.jsxs("div",{className:"flex flex-col sm:flex-row items-start sm:items-center gap-2 w-full sm:w-auto",children:[e.jsx("div",{className:"w-7 h-7 sm:w-9 sm:h-9 bg-neutral-200 dark:bg-neutral-800 bg-[var(--keross-skeleton-bg)] rounded-sm flex-shrink-0"}),e.jsxs("div",{className:"flex flex-col text-md",children:[e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx("span",{className:"font-semibold",children:o.title}),o.status==="IN PROGRESS"&&o.dropdownOptions&&e.jsxs(ge,{children:[e.jsx(pe,{asChild:!0,children:e.jsx("button",{className:"p-1",children:e.jsx(f.ChevronDown,{className:"w-4 h-4 cursor-pointer"})})}),e.jsx(he,{className:"w-50 ml-40",children:o.dropdownOptions.map((l,u)=>e.jsx(S.Fragment,{children:l},u))})]})]}),o.owner&&e.jsx("span",{className:"text-sm text-neutral-400",children:o.owner}),o.createdAt&&e.jsxs("span",{className:"text-sm text-neutral-500",children:["Created on ",o.createdAt]})]})]}),e.jsx("div",{className:"mt-1 sm:mt-0 flex-shrink-0",children:e.jsx(tt,{className:hi[o.status],children:o.status})})]},i)}),e.jsxs("div",{className:"text-xs flex flex-col sm:flex-row justify-between items-start sm:items-center pt-1",children:[e.jsxs("span",{children:[r.length," steps total"]}),e.jsxs("span",{children:[s," completed"]})]}),e.jsx("div",{className:"w-full bg-gray-300 dark:bg-gray-700 h-1 rounded-full overflow-hidden mt-1",children:e.jsx("div",{className:"h-1 bg-blue-500 dark:bg-blue-400 transition-all",style:{width:`${n}%`}})})]})}function _e({tooltipContent:t,children:r}){return e.jsx(Ae,{children:e.jsxs(ne,{children:[e.jsx(oe,{asChild:!0,children:r}),e.jsx(ie,{children:t})]})})}function lt({children:t,variant:r,asChild:a=!1,size:s,...n}){return e.jsx(T,{variant:r,size:s,...n,asChild:a,children:t})}function vi({children:t,variant:r,asChild:a=!1,size:s,tooltipContent:n,...o}){return e.jsx(_e,{tooltipContent:n,children:e.jsx(lt,{variant:r,size:s,...o,asChild:a,children:t})})}function ct({children:t,variant:r,asChild:a=!1,size:s,...n}){return e.jsx(T,{variant:r||"outline",size:s||"sm",...n,asChild:a,children:t})}function xs({children:t,variant:r,size:a,asChild:s=!1,tooltipContent:n,...o}){return e.jsx(_e,{tooltipContent:n,children:e.jsx(ct,{variant:r,size:a,...o,asChild:s,children:t})})}function fs({children:t,variant:r,size:a,asChild:s=!1,...n}){return e.jsx(T,{variant:r||"outline",size:a||"icon",...n,asChild:s,children:t})}function Fe({children:t,tooltipContent:r,asChild:a=!1,variant:s,size:n,...o}){return e.jsx(_e,{tooltipContent:r,children:e.jsx(fs,{variant:s,size:n,...o,asChild:a,children:t})})}function Qt({actionMenus:t,extraActionParams:r}){const a=s=>(s=s.filter(n=>n?.visibility===void 0||n.visibility===!0||n.visibility&&n.visibility(...r?.arguments||[])),s.length===0?e.jsx(me,{className:"text-center",children:"No action available."}):s.map((n,o)=>{if(n.type==="label")return e.jsx(Dt,{children:String(n.label)},o);if(n.type==="separator")return e.jsx(nt,{},o);if(n.type==="group"&&n.items)return e.jsx(xr,{children:a(n.items)},o);if(n.items)return e.jsxs(na,{children:[e.jsx(oa,{children:String(n.label)}),e.jsx(sa,{children:e.jsx(ia,{children:a(n.items)})})]},o);let i="";return typeof n.label=="function"?i=n.label(...r?.arguments||[]):i=n.label,e.jsxs(me,{disabled:n.disabled,onClick:()=>n.onClick&&n.onClick(...r?.arguments||[]),children:[n.icon&&e.jsx(n.icon,{}),i]},o)}));return e.jsxs(ge,{children:[e.jsx(pe,{asChild:!0,children:e.jsx(Fe,{variant:"ghost",tooltipContent:"Actions",className:"h-8 w-8 p-0 border-0 bg-transparent text-foreground keross:text-white elevation-0 shadow-none hover:bg-transparent",children:e.jsx(f.MoreHorizontal,{})})}),e.jsx(he,{className:"w-56",align:"end",children:a(t)})]})}const gs=({title:t,description:r,fontSize:a="text-base",cancelText:s="",confirmText:n="",thirdOptionText:o="",onCancel:i,onConfirm:l,onThird:u})=>e.jsx(ar,{open:!0,children:e.jsxs(or,{children:[e.jsxs(ir,{children:[e.jsx(cr,{className:a,children:t}),e.jsx(dr,{className:a,children:r})]}),e.jsxs(lr,{children:[s!=""&&e.jsx(ur,{onClick:()=>{i&&i()},children:s}),o!=""&&e.jsx(wt,{className:"bg-blue-500",color:"black",onClick:()=>{u&&u()},children:o}),n!=""&&e.jsx(wt,{onClick:()=>{l&&l()},children:n})]})]})}),ps=m.createContext(void 0),ji=()=>{const t=m.useContext(ps);if(!t)throw new Error("useDialog must be used within a DialogProvider");return t},hs=({children:t})=>{const[r,a]=m.useState(null),s=o=>a(o),n=()=>a(null);return e.jsxs(ps.Provider,{value:{openDialog:s,closeDialog:n},children:[t,r&&e.jsx(gs,{title:r.title,description:r.description,fontSize:r.fontSize||"text-base",cancelText:r.cancelText||"",confirmText:r.confirmText||"",thirdOptionText:r.thirdOptionText||"",onConfirm:()=>{r.onConfirm&&r.onConfirm(),n()},onCancel:()=>{r.onCancel&&r.onCancel(),n()},onThird:()=>{r.onThird&&r.onThird(),n()}})]})};function wi({placeholder:t,items:r,disabled:a,onSelect:s,defaultValue:n}){const[o,i]=m.useState(!1),[l,u]=m.useState(n??"");return e.jsxs(Q,{open:o,onOpenChange:i,modal:!0,children:[e.jsx(J,{asChild:!0,className:"w-full",children:e.jsxs(T,{variant:"outline",role:"combobox",className:d("justify-between",!l&&"text-muted-foreground","bg-secondary"),disabled:a===!0||typeof a=="function"&&a(),children:[l?r.find(c=>c.value===l)?.label||l:t,e.jsx(f.ChevronsUpDown,{className:"opacity-50"})]})}),e.jsx(Z,{className:"p-0",align:"start",children:e.jsxs(Y,{children:[e.jsx(le,{placeholder:"Search..."}),e.jsxs(ce,{children:[e.jsx(de,{children:"No items found."}),e.jsx(se,{children:r.map(c=>e.jsxs(X,{value:c.value,disabled:c.disabled===!0||typeof c.disabled=="function"&&c.disabled(c),onSelect:x=>{const g=r.find(w=>w.value.toLowerCase()===x.toLowerCase())?.value??x;u(g),s?.(g),i(!1)},children:[c?.label||c.value,e.jsx(f.Check,{className:d("ml-auto",c.value===l?"opacity-100":"opacity-0")})]},c.value))})]})]})})]})}const Ie=t=>t?.columnDef?.title||t?.columnDef?.header&&typeof t.columnDef.header=="string"&&t?.columnDef?.header||t.id;function bs({table:t}){return e.jsxs(Q,{children:[e.jsx(_e,{tooltipContent:"Column View",children:e.jsx(J,{asChild:!0,children:e.jsxs(ct,{children:[e.jsx(f.Settings2,{}),"View"]})})}),e.jsx(Z,{className:"w-[220px] p-0",align:"end",children:e.jsxs(Y,{children:[e.jsx(le,{placeholder:"Search..."}),e.jsxs(ce,{children:[e.jsx(de,{children:"No results found."}),e.jsx(se,{children:t.getAllColumns().filter(r=>typeof r.accessorFn<"u"&&r.getCanHide()).map(r=>{const a=r.getIsVisible();return e.jsxs(X,{onSelect:()=>{r.toggleVisibility(!a)},disabled:r.getIsGrouped(),children:[e.jsx("div",{className:d("mr-2 flex h-4 w-4 items-center justify-center rounded-sm border border-black dark:border-white",a?"bg-black dark:bg-white text-white dark:text-black":"opacity-50 [&_svg]:invisible"),children:e.jsx(f.Check,{})}),e.jsx("span",{className:"overflow-hidden text-ellipsis",title:Ie(r),children:Ie(r)})]},r.id)})})]})]})})]})}function vs({column:t}){const r=t?.getFacetedUniqueValues(),a=new Set(t?.getFilterValue()),s=S.useMemo(()=>Array.from(t.getFacetedUniqueValues().keys()).sort().slice(0,5e3),[t.getFacetedUniqueValues()]);return e.jsxs(Q,{children:[e.jsx(J,{asChild:!0,children:e.jsxs(xs,{variant:"dashed",tooltipContent:Ie(t),children:[a?.size>0?e.jsx(f.X,{}):e.jsx(f.Plus,{}),Ie(t),a?.size>0&&e.jsxs(e.Fragment,{children:[e.jsx(Tt,{orientation:"vertical",className:"mx-2 h-4"}),e.jsx(tt,{variant:"secondary",className:"rounded-sm px-1 font-normal lg:hidden",children:a.size}),e.jsx("div",{className:"hidden space-x-1 lg:flex",children:a.size>2?e.jsxs(tt,{variant:"secondary",className:"rounded-sm px-1 font-normal",children:[a.size," selected"]}):s.filter(n=>a.has(n)).map(n=>e.jsx(tt,{variant:"secondary",className:"rounded-sm px-1 font-normal",children:n},n))})]})]})}),e.jsx(Z,{className:"max-w-[250px] p-0",align:"start",children:e.jsxs(Y,{children:[e.jsx(le,{placeholder:Ie(t)}),e.jsxs(ce,{children:[e.jsx(de,{children:"No results found."}),e.jsx(se,{children:s.map(n=>{const o=a.has(n);return e.jsxs(X,{onSelect:()=>{o?a.delete(n):a.add(n);const i=Array.from(a);t?.setFilterValue(i.length?i:void 0)},children:[e.jsx("div",{className:d("mr-2 flex h-4 w-4 items-center justify-center rounded-sm border border-black dark:border-white",o?"bg-black dark:bg-white text-white dark:text-black":"opacity-50 [&_svg]:invisible"),children:e.jsx(f.Check,{})}),e.jsx("span",{className:"overflow-hidden text-ellipsis",title:n,children:n}),r?.get(n)&&e.jsx("span",{className:"ml-auto flex h-4 w-4 items-center justify-center font-mono text-xs",children:r.get(n)})]},n)})})]}),a.size>0&&e.jsxs(e.Fragment,{children:[e.jsx(aa,{}),e.jsx(se,{children:e.jsx(X,{onSelect:()=>t?.setFilterValue(void 0),className:"justify-center text-center",children:"Clear filters"})})]})]})})]})}function js({table:t}){const[r,a]=m.useState([]);return e.jsxs("div",{className:"flex-grow flex gap-3 items-center overflow-hidden",children:[e.jsxs(Q,{children:[e.jsx(_e,{tooltipContent:"Filter",children:e.jsx(J,{asChild:!0,children:e.jsxs(ct,{children:[e.jsx(f.Filter,{}),"Filter"]})})}),e.jsx(Z,{className:"w-[220px] p-0",align:"start",children:e.jsxs(Y,{children:[e.jsx(le,{placeholder:"Search..."}),e.jsxs(ce,{children:[e.jsx(de,{children:"No results found."}),e.jsx(se,{children:t.getAllColumns().filter(s=>typeof s.accessorFn<"u"&&s.getCanHide()).map(s=>{const n=new Set(r),o=n.has(s.id);return e.jsxs(X,{onSelect:()=>{o?n.delete(s.id):n.add(s.id),a([...n])},children:[e.jsx("div",{className:d("mr-2 flex h-4 w-4 items-center justify-center rounded-sm border border-black dark:border-white",o?"bg-black dark:bg-white text-white dark:text-black":"opacity-50 [&_svg]:invisible"),children:e.jsx(f.Check,{})}),e.jsx("span",{className:"overflow-hidden text-ellipsis",title:Ie(s),children:Ie(s)})]},s.id)})})]})]})})]}),e.jsx("div",{className:"flex-grow flex gap-3 items-center overflow-auto",children:r.map(s=>{const n=t.getColumn(s);if(n)return e.jsx(vs,{column:n},s)})})]})}const ws=async t=>new Promise((r,a)=>{const s=new FileReader;s.onload=()=>{const o=s.result.split(",")[1];r({message:"File processed successfully",fileName:t.name,size:t.size,type:t.type,lastModified:t.lastModified,base64:o})},s.onerror=()=>a(s.error),s.readAsDataURL(t)});function Ni(t){const r=atob(t.base64),a=new Array(r.length).fill(0).map((o,i)=>r.charCodeAt(i)),s=new Uint8Array(a),n=new Blob([s],{type:t.type});return URL.createObjectURL(n)}function yi({label:t="Upload File",isDrag:r=!1,onFileSelect:a}){const[s,n]=m.useState(!1),o=async x=>{if(!x)return;const g=await ws(x);await a(g)},i=x=>{if(!r)return;x.preventDefault(),n(!1);const g=x.dataTransfer.files?.[0];g&&o(g)},l=x=>{r&&(x.preventDefault(),n(!0))},u=()=>{r&&n(!1)},c=x=>{const g=x.target.files?.[0];g&&o(g)};return e.jsxs("div",{className:"flex flex-col gap-2 w-full",children:[e.jsx("label",{className:"text-sm font-medium",children:t}),e.jsx("input",{type:"file",id:"fileInput",className:"hidden",onChange:c}),r?e.jsx("div",{className:`border-2 border-dashed rounded-lg p-6 text-center cursor-pointer transition
2
+ ${s?"border-blue-600 bg-blue-50":"border-gray-300"}
3
+ `,onDragOver:l,onDragLeave:u,onDrop:i,onClick:()=>document.getElementById("fileInput")?.click(),children:e.jsxs("div",{className:"flex flex-col items-center gap-3",children:[e.jsx(f.UploadCloud,{className:"w-10 h-10 text-blue-600"}),e.jsxs("p",{className:"text-gray-600",children:["Drag & drop your file here or"," ",e.jsx("span",{className:"text-blue-600 underline",children:"browse"})]})]})}):e.jsxs("div",{className:"border rounded-lg p-4 flex flex-col items-center gap-2 cursor-pointer text-center",onClick:()=>document.getElementById("fileInput")?.click(),children:[e.jsx(f.FileUp,{className:"w-8 h-8 text-blue-600"}),e.jsx("span",{className:"text-blue-600 underline",children:"Browse File"})]})]})}const Ci=[15,20,30,40,50,100];function Ns({table:t,extraParams:r}){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:(r?.numberOfRows==null||r?.numberOfRows)&&r?.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."]})}),(r?.pagination==null||r.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"}),(r?.rowsPerPage==null||r.rowsPerPage)&&e.jsxs(ua,{value:`${t.getState().pagination.pageSize}`,onValueChange:a=>{t.setPageSize(Number(a))},children:[e.jsx(xa,{className:"w-[70px] h-8",children:e.jsx(ma,{placeholder:t.getState().pagination.pageSize})}),e.jsx(fa,{side:"top",children:(r?.pageSizeArray||Ci).map(a=>e.jsx(ga,{value:`${a}`,children:a},a))})]})]}),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(Fe,{tooltipContent:"Go to first page",size:"smIcon",className:"dark:bg-accent dark:text-accent-foreground keross:bg-card keross:text-foreground",onClick:()=>t.setPageIndex(0),disabled:!t.getCanPreviousPage(),children:e.jsx(f.ChevronsLeft,{})}),e.jsx(Fe,{tooltipContent:"Go to previous page",size:"smIcon",className:"dark:bg-accent dark:text-accent-foreground keross:bg-card keross:text-foreground",onClick:()=>t.previousPage(),disabled:!t.getCanPreviousPage(),children:e.jsx(f.ChevronLeft,{})}),e.jsx(Fe,{tooltipContent:"Go to next page",size:"smIcon",className:"dark:bg-accent dark:text-accent-foreground keross:bg-card keross:text-foreground",onClick:()=>t.nextPage(),disabled:!t.getCanNextPage(),children:e.jsx(f.ChevronRight,{})}),e.jsx(Fe,{tooltipContent:"Go to last page",size:"smIcon",className:"dark:bg-accent dark:text-accent-foreground keross:bg-card keross:text-foreground",onClick:()=>t.setPageIndex(t.getPageCount()-1),disabled:!t.getCanNextPage(),children:e.jsx(f.ChevronsRight,{})})]})]})]})]})}function Cr({className:t,...r}){return e.jsxs("div",{className:"relative w-auto flex items-center",children:[e.jsx(f.Search,{className:"absolute left-2 mr-2 h-4 w-4 shrink-0 opacity-50"}),e.jsx(H,{className:W.cx("pl-8 h-8",t),...r})]})}function ys({table:t,extraParams:r}){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:[(r?.defaultTools==null||r?.defaultTools==!0||Array.isArray(r?.defaultTools)&&r?.defaultTools?.includes("search"))&&e.jsx(Cr,{placeholder:"Search ...",onChange:a=>t.setGlobalFilter(a.target.value),className:"max-w-sm"}),(r?.defaultTools==null||r?.defaultTools==!0||Array.isArray(r?.defaultTools)&&r?.defaultTools?.includes("filter"))&&e.jsx(js,{table:t})]}),e.jsxs("div",{className:"flex gap-3",children:[r?.extraTools?.map((a,s)=>e.jsx(m.Fragment,{children:a},s)),(r?.defaultTools==null||r?.defaultTools==!0||Array.isArray(r?.defaultTools)&&r?.defaultTools?.includes("columnFilter"))&&e.jsx(bs,{table:t})]})]})}const Si=m.forwardRef(({columns:t,data:r,extraParams:a,onTableReady:s},n)=>{const[o,i]=m.useState([]),[l,u]=m.useState(""),[c,x]=m.useState([]),[g,w]=m.useState({pageIndex:a?.pageIndex||0,pageSize:a?.pageSize||15}),[N,v]=m.useState({}),[C,b]=m.useState([]),[k,p]=m.useState({}),[A,j]=m.useState({});t=t.map(y=>(y?.filterFn||(y.filterFn="arrIncludesSome"),y)),m.useEffect(()=>{a?.checkBoxColumnCallback&&a.checkBoxColumnCallback(h.getFilteredSelectedRowModel().rows)},[A]),a?.checkBoxColumn&&t.splice(0,0,{id:"checkBoxColumn",header:({table:y})=>e.jsx(Ve,{checked:y.getIsAllPageRowsSelected()||y.getIsSomePageRowsSelected()&&"indeterminate",onCheckedChange:I=>y.toggleAllPageRowsSelected(!!I),"aria-label":"Select all"}),cell:({row:y})=>e.jsx(e.Fragment,{children:e.jsx(Ve,{checked:y.getIsSelected(),onCheckedChange:I=>y.toggleSelected(!!I),"aria-label":"Select row"})}),enableSorting:!1,enableHiding:!1}),(a?.actionMenu||a?.groupActionMenu)&&t.push({id:"DTActions",accessorKey:"Actions",header:()=>e.jsx("div",{className:"text-center",children:"Action"}),size:20,headerClassName:"text-center",cell:({row:y})=>y.getIsGrouped()?a?.groupActionMenu?e.jsx("div",{className:"text-end",children:e.jsx(Qt,{actionMenus:a.groupActionMenu.items,extraActionParams:{arguments:[y.original,...a.groupActionMenu.extraArguments||[]]}})}):null:a?.actionMenu?e.jsx("div",{className:"text-center",children:e.jsx(Qt,{actionMenus:a.actionMenu.items,extraActionParams:{arguments:[y.original,...a.actionMenu.extraArguments||[]]}})}):null,enableSorting:!1,enableHiding:!1}),m.useEffect(()=>{a?.onPaginationChange?.(g)},[g]);const h=z.useReactTable({data:r,columns:t,state:{sorting:o,globalFilter:l,columnFilters:c,columnVisibility:N,rowSelection:A,grouping:C,expanded:k,pagination:g},onPaginationChange:w,onSortingChange:i,onExpandedChange:p,onColumnFiltersChange:x,onColumnVisibilityChange:v,onGroupingChange:b,onGlobalFilterChange:u,onRowSelectionChange:j,getCoreRowModel:z.getCoreRowModel(),getPaginationRowModel:z.getPaginationRowModel(),getSortedRowModel:z.getSortedRowModel(),getFilteredRowModel:z.getFilteredRowModel(),getGroupedRowModel:z.getGroupedRowModel(),getExpandedRowModel:z.getExpandedRowModel(),getFacetedRowModel:z.getFacetedRowModel(),getFacetedUniqueValues:z.getFacetedUniqueValues(),getFacetedMinMaxValues:z.getFacetedMinMaxValues(),manualPagination:a?.pagination==null||a?.pagination==!0?void 0:!0});m.useImperativeHandle(n,()=>h);const[D,P]=m.useState([]),R=(y,I)=>{const B={id:I.id,title:Ie(I.column)};y.dataTransfer.setData("headerObj",JSON.stringify(B)),y.dataTransfer.effectAllowed="move"},E=y=>{y.preventDefault();const I=JSON.parse(y.dataTransfer.getData("headerObj"));if(!D.find(B=>B.id==I.id)){P(_=>[..._,I]);const B=h.getColumn(I.id);B&&B.getToggleGroupingHandler()()}},M=y=>{y.preventDefault()},ue=y=>{const I=D.filter(_=>_.id!==y);P(()=>[...I]);const B=h.getColumn(y);B&&B.getToggleGroupingHandler()()},[Pe,Se]=m.useState(!1);return m.useEffect(()=>{Pe||Se(!0),a?.defaultGroups&&h.setGrouping(a?.defaultGroups)},[]),m.useEffect(()=>{s&&s(h)},[s,h]),Pe&&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:[(a?.defaultTools==null||a.defaultTools||a.extraTools)&&e.jsx(ys,{table:h,extraParams:a}),e.jsxs("div",{className:"flex-grow flex flex-col overflow-hidden",children:[(a?.grouping==null||a.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:E,onDragOver:M,children:D.length===0?"Drag a column header here to group its column":D.map((y,I)=>e.jsxs("div",{className:"rounded-md px-2 py-1 bg-muted text-muted-foreground flex gap-3 items-center",children:[y.title,e.jsx("span",{onClick:()=>ue(y.id),children:e.jsx(f.X,{size:15})})]},y.id))}),e.jsx("div",{className:"flex-grow overflow-hidden",children:e.jsxs(Ea,{className:"border-t whitespace-nowrap bg-card-new",children:[(a?.header==null||a.header)&&e.jsx(za,{className:"sticky top-0 z-10 border-t bg-card-new",children:h.getHeaderGroups().map(y=>e.jsx(qe,{className:W.cx(""),children:y.headers.map(I=>I.column.getIsGrouped()?I.column.getGroupedIndex()<D.length-1?null:e.jsx($t,{colSpan:D.length,className:W.cx("w-36 ","text-left")},I.id):e.jsx($t,{...a?.grouping==null||a.grouping?{onDragStart:B=>R(B,I),draggable:!0}:{},className:W.cx("text-left"),children:I.isPlaceholder?null:(a?.sorting==null||a.sorting)&&I.column.getCanSort()?e.jsxs("div",{onClick:I.column.getToggleSortingHandler(),className:W.cx("-mx-2 inline-flex cursor-pointer select-none items-center gap-2 rounded-md px-2 py-1 hover:bg-muted"),children:[e.jsx("div",{children:z.flexRender(I.column.columnDef.header,I.getContext())}),I.column.getCanSort()?e.jsxs("div",{className:"-space-y-2",children:[e.jsx(f.ChevronUp,{className:W.cx("size-3.5 text-foreground",I.column.getIsSorted()==="desc"?"opacity-30":""),"aria-hidden":"true"}),e.jsx(f.ChevronDown,{className:W.cx("size-3.5 text-foreground",I.column.getIsSorted()==="asc"?"opacity-30":""),"aria-hidden":"true"})]}):null]}):z.flexRender(I.column.columnDef.header,I.getContext())},I.id))},y.id))}),e.jsx(La,{children:h.getRowModel().rows.length?h.getRowModel().rows.map(y=>y.getIsGrouped()?e.jsx(qe,{children:y.getVisibleCells().map(I=>I.column.getIndex()<y.depth?null:e.jsx(Je,{colSpan:I.column.getIndex()==y.depth?y.depth+1:void 0,className:I.column.getIndex()==y.depth?"w-36":"",children:I.getIsGrouped()?e.jsxs(T,{variant:"link",onClick:y.getToggleExpandedHandler(),className:"text-right text-foreground",style:{marginLeft:y.depth+"rem"},children:[y.getIsExpanded()?e.jsx(f.ChevronDown,{}):e.jsx(f.ChevronRight,{})," ",z.flexRender(I.column.columnDef.cell,I.getContext())," ","(",y.subRows.length,")"]}):I.column.id=="DTActions"?z.flexRender(I.column.columnDef.cell,I.getContext()):I.getIsAggregated()?z.flexRender(I.column.columnDef.aggregatedCell??I.column.columnDef.cell,I.getContext()):I.getIsPlaceholder()?null:z.flexRender(I.column.columnDef.cell,I.getContext())},I.id))},y.id):e.jsx(qe,{className:W.cx(y.getIsSelected()?"bg-accent/10":""),...a?.checkBoxColumn&&{onClick:()=>y.toggleSelected(!y.getIsSelected())},children:y.getVisibleCells().map((I,B)=>e.jsxs(Je,{className:W.cx(y.getIsSelected()?"relative":"",!(a?.actionMenu||a?.groupActionMenu)&&"py-2"),children:[B===0&&y.getIsSelected()&&e.jsx("div",{className:"absolute inset-y-0 left-0 w-0.5 bg-primary"}),I.getIsPlaceholder()?null:z.flexRender(I.column.columnDef.cell,I.getContext())]},I.id))},y.id)):e.jsx(qe,{children:e.jsx(Je,{colSpan:t.length,className:"h-24 text-center",children:"No results."})})}),a?.footer&&e.jsx(Oa,{className:"sticky bottom-0 bg-background text-foreground",children:h.getFooterGroups().map(y=>e.jsx(qe,{children:y.headers.map(I=>e.jsx(Je,{children:I.isPlaceholder?null:e.jsx("div",{className:"flex items-center",children:z.flexRender(I.column.columnDef.footer,I.getContext())})}))}))})]})})]})]}),(a?.paginationBar==null||a.paginationBar)&&e.jsx(Ns,{table:h,extraParams:a})]})});function Cs({isLoading:t,onReload:r,errorMessage:a}){return!t&&!a?null:e.jsx("div",{className:"absolute inset-0 z-50 flex items-center justify-center bg-background/60 backdrop-blur-md rounded-lg transition-all duration-300",children:e.jsx("div",{className:"flex flex-col items-center gap-4",children:t?e.jsx("div",{className:"bg-background/80 p-6 rounded-2xl shadow-xl border border-border/50 backdrop-blur-xl animate-in fade-in zoom-in duration-300",children:e.jsx(f.Loader2,{size:48,className:"text-primary animate-spin"})}):e.jsx("div",{className:"bg-background/80 p-4 rounded-full shadow-lg border border-border/50 backdrop-blur-xl animate-in fade-in zoom-in duration-300",children:e.jsx("button",{onClick:r,className:"p-3 rounded-full bg-primary/10 hover:bg-primary/20 transition-all text-primary hover:scale-110 active:scale-95",title:a||"Reload Data",children:e.jsx(f.RotateCcw,{className:"w-6 h-6"})})})})})}function ki(t){(t==null||typeof t!="object")&&(t={});const r={...t};return(r.toolbox===void 0||r.toolbox===null||typeof r.toolbox!="object")&&(r.toolbox={}),(r.toolbox.feature===void 0||r.toolbox.feature===null||typeof r.toolbox.feature!="object")&&(r.toolbox.feature={}),r}const Ii=m.forwardRef(({parentDivProps:t={},option:r={},style:a={},settings:s={},loading:n=!0,theme:o,isConfigurable:i=!1,resizeKey:l,onClick:u=()=>{},onConfigure:c=()=>{}},x)=>{const g=m.useRef(null),w=m.useRef(null),N=ki(r);return i&&(N.toolbox.feature={...N.toolbox.feature,myConfigureChartTool:{show:!0,title:"Configure Chart",icon:"image://data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxNiIgaGVpZ2h0PSIxNiIgdmlld0JveD0iMCAwIDI0IDI0IiBmaWxsPSJub25lIiBzdHJva2U9ImN1cnJlbnRDb2xvciIgc3Ryb2tlLXdpZHRoPSIxIiBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiIGNsYXNzPSJsdWNpZGUgbHVjaWRlLXNldHRpbmdzLTIiPjxwYXRoIGQ9Ik0yMCA3aC05Ii8+PHBhdGggZD0iTTE0IDE3SDUiLz48Y2lyY2xlIGN4PSIxNyIgY3k9IjE3IiByPSIzIi8+PGNpcmNsZSBjeD0iNyIgY3k9IjciIHI9IjMiLz48L3N2Zz4=",onclick:()=>c?.()}}),m.useImperativeHandle(x,()=>({getChartObject:()=>g.current?Le.getInstanceByDom(g.current):null,setOption:(v,C)=>{if(!g.current)return;Le.getInstanceByDom(g.current)?.setOption(v,C)},resize:(v=0)=>{if(!g.current)return;const C=Le.getInstanceByDom(g.current);C?.resize(),v&&setTimeout(()=>C?.resize(),v)},loadingVisible:v=>{if(!g.current)return;const C=Le.getInstanceByDom(g.current);v?C?.showLoading():C?.hideLoading()},dispose:()=>{if(!g.current)return;Le.getInstanceByDom(g.current)?.dispose()},on:(v,C)=>{if(!g.current)return;Le.getInstanceByDom(g.current)?.on(v,C)}})),m.useEffect(()=>{g.current&&(w.current=Le.init(g.current,o));const v=()=>w.current?.resize?.();return window.addEventListener("resize",v),()=>{w.current&&(w.current.dispose(),w.current=null),window.removeEventListener("resize",v)}},[o]),m.useEffect(()=>{w.current&&w.current.setOption(N,s),w.current&&w.current.on("click",u)},[r,s,o]),m.useEffect(()=>{w.current&&w.current.resize()},[l]),m.useEffect(()=>{w.current&&setTimeout(()=>{w.current?.resize()},500)},[]),e.jsx("div",{ref:g,...t,style:{width:"100%",height:"100%",...a}})});function Ss({tooltipContent:t,fileNamePlaceholder:r,fileName:a,onFileNameChange:s,...n}){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",...n}),e.jsx("div",{className:"mx-1"}),e.jsx(H,{className:"rounded-e-none",placeholder:r,onChange:(...i)=>s?.(...i),value:a}),e.jsx(Fe,{tooltipContent:t||"Browse File",onClick:()=>o?.current?.click(),className:"border-s-0 rounded-s-none",children:e.jsx(f.Upload,{})})]})})}const Ai=(({blur:t=0,inactiveZone:r=.7,proximity:a=0,spread:s=20,variant:n="default",glow:o=!1,className:i,movementDuration:l=2,borderWidth:u=1,disabled:c=!0})=>{const x=m.useRef(null),g=m.useRef({x:0,y:0}),w=m.useRef(0),N=m.useCallback(v=>{x.current&&(w.current&&cancelAnimationFrame(w.current),w.current=requestAnimationFrame(()=>{const C=x.current;if(!C)return;const{left:b,top:k,width:p,height:A}=C.getBoundingClientRect(),j=v?.x??g.current.x,h=v?.y??g.current.y;v&&(g.current={x:j,y:h});const D=[b+p*.5,k+A*.5],P=Math.hypot(j-D[0],h-D[1]),R=.5*Math.min(p,A)*r;if(P<R){C.style.setProperty("--active","0");return}const E=j>b-a&&j<b+p+a&&h>k-a&&h<k+A+a;if(C.style.setProperty("--active",E?"1":"0"),!E)return;const M=parseFloat(C.style.getPropertyValue("--start"))||0,Pe=(180*Math.atan2(h-D[1],j-D[0])/Math.PI+90-M+180)%360-180,Se=M+Pe;bt.animate(M,Se,{duration:l,ease:[.16,1,.3,1],onUpdate:y=>{C.style.setProperty("--start",String(y))}})}))},[r,a,l]);return m.useEffect(()=>{if(c)return;const v=()=>N(),C=b=>N(b);return window.addEventListener("scroll",v,{passive:!0}),document.body.addEventListener("pointermove",C,{passive:!0}),()=>{w.current&&cancelAnimationFrame(w.current),window.removeEventListener("scroll",v),document.body.removeEventListener("pointermove",C)}},[N,c]),e.jsxs(e.Fragment,{children:[e.jsx("div",{className:d("pointer-events-none absolute -inset-px hidden rounded-[inherit] border opacity-0 transition-opacity",o&&"opacity-100",n==="white"&&"border-white",c&&"!block")}),e.jsx("div",{ref:x,style:{"--blur":`${t}px`,"--spread":s,"--start":"0","--active":"0","--glowingeffect-border-width":`${u}px`,"--repeating-conic-gradient-times":"5","--gradient":n==="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:d("pointer-events-none absolute inset-0 rounded-[inherit] opacity-100 transition-opacity",o&&"opacity-100",t>0&&"blur-[var(--blur)] ",i,c&&"!hidden"),children:e.jsx("div",{className:d("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 yt({name:t,...r}){const a=Ln[t];return a?e.jsx(a,{...r}):(console.warn(`Icon "${t}" not found in lucide-react`),null)}const Di=({size:t=48,className:r,visible:a=!0,...s})=>a?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,...s,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:d("animate-spin",r),children:e.jsx("path",{d:"M21 12a9 9 0 1 1-6.219-8.56"})})})}):null;function Pi({placeholder:t,items:r,onValueChange:a,defaultValue:s,defaultOptions:n=2}){const[o,i]=m.useState(s||[]),[l,u]=m.useState(""),c=m.useRef(null),[x,g]=m.useState(!1);m.useEffect(()=>{a(o)},[o,a]);const w=r.filter(p=>(p.label||p.value).toLowerCase().includes(l.toLowerCase())).sort((p,A)=>(p?.label??"").localeCompare(A?.label??"")),N=p=>{const A=p.currentTarget;A.scrollTop+=p.deltaY,p.preventDefault()},v=p=>{const A=o.includes(p)?o.filter(j=>j!==p):[...o,p];i(A)},[C,b]=m.useState(o.length),k=m.useCallback(()=>{const p=c.current;if(!p)return C;const A=Array.from(p.children),j=p.offsetWidth;let h=0,D=0;for(const P of A){const R=P.offsetWidth+4;if(h+R<=j)h+=R,D++;else break}return D},[C]);return m.useEffect(()=>{const p=c.current;if(!p)return;let A=null;const j=()=>{A&&cancelAnimationFrame(A),A=requestAnimationFrame(()=>{const D=k();b(P=>P!==D?D:P)})},h=new ResizeObserver(j);return h.observe(p),A=requestAnimationFrame(j),()=>{A&&cancelAnimationFrame(A),h.disconnect()}},[k]),e.jsxs(Q,{open:x,onOpenChange:g,children:[e.jsx(J,{asChild:!0,className:"w-full",children:e.jsxs(T,{variant:"outline",role:"combobox",className:d("justify-between px-3 py-2 h-10",o.length===0&&"text-foreground/50","bg-secondary"),onClick:()=>g(p=>!p),children:[o.length>0?e.jsx(Ae,{children:e.jsxs("div",{ref:c,className:"flex flex-wrap gap-2 items-center overflow-hidden flex-1",children:[o.slice(0,n).map(p=>{const A=r.find(j=>j.value===p)?.label||p;return e.jsxs("span",{className:"flex items-center px-2 py-1 bg-secondary text-secondary-foreground rounded-md truncate max-w-full",title:A,children:[e.jsx("span",{className:"truncate max-w-[120px]",children:A}),e.jsx("span",{role:"button",tabIndex:0,onClick:j=>{j.stopPropagation(),v(p)},onKeyDown:j=>{(j.key==="Enter"||j.key===" ")&&(j.preventDefault(),j.stopPropagation(),v(p))},className:"ml-1 text-muted-foreground hover:text-destructive cursor-pointer outline-none",children:e.jsx(f.X,{className:"w-3 h-3 ml-1"})})]},p)}),o.length>n&&e.jsxs(ne,{children:[e.jsx(oe,{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-n," more"]})}),e.jsx(ie,{className:"max-w-xs break-words",children:e.jsx("div",{onWheel:N,className:"flex flex-col gap-1 max-h-[200px] overflow-auto",children:o.slice(n).map(p=>e.jsx("span",{className:"text-sm",children:r.find(A=>A.value===p)?.label||p},p))})})]})]})}):e.jsx("span",{className:"flex-1 text-left truncate",children:t}),e.jsx(f.ChevronsUpDown,{className:"ml-2 h-4 w-4 shrink-0 opacity-50"})]})}),e.jsx(Z,{className:"p-0 min-w-[var(--radix-popover-trigger-width)]",style:{width:"max-content",maxWidth:"min(500px, 90vw)"},align:"start",children:e.jsxs(Y,{onMouseDown:p=>p.preventDefault(),children:[e.jsx(le,{placeholder:"Search...",value:l,onValueChange:u}),e.jsxs(ce,{onWheel:N,className:"max-h-60 overflow-auto",children:[e.jsx(de,{children:"No items found."}),e.jsx(se,{children:w.map(p=>{const A=o.includes(p.value),j=p.disabled===!0||typeof p.disabled=="function"&&p.disabled(p);return e.jsxs(X,{value:p.label||p.value,disabled:j,onPointerDown:h=>{h.preventDefault(),h.stopPropagation()},onSelect:()=>{j||v(p.value)},className:d("flex items-center justify-between space-x-2",j&&"opacity-50 cursor-not-allowed"),children:[e.jsx(Ve,{checked:A,onCheckedChange:()=>{j||v(p.value)},onClick:h=>h.stopPropagation(),disabled:j}),e.jsx("span",{className:"flex-grow text-left",children:p?.label||p.value})]},p.value)})})]})]})})]})}function Sr({text:t}){return e.jsxs("div",{className:"flex flex-col h-full justify-center text-center gap-2",children:[e.jsx(f.CircleAlert,{className:"text-muted-foreground mx-auto",size:36}),e.jsx("p",{className:"text-muted-foreground",children:t||"No Data Available"})]})}function Ti({title:t,subtitle:r,tools:a,children:s}){return t=t??"",r=r??"",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}),r&&e.jsx("p",{className:"text-muted-foreground/60",children:r})]}),e.jsx("div",{children:a})]}),s]})}const Ri=({value:t})=>{const r=An(t),a=r.score*100/4,s=()=>{switch(r.score){case 0:return"#828282";case 1:return"#EA1111";case 2:return"#FFAD00";case 3:return"#9bc158";case 4:return"#00b500";default:return""}};return e.jsx(e.Fragment,{children:e.jsx(Pt,{value:a,className:s()})})},_r=({code:t})=>{const r=$n[t];return e.jsx(r,{})};function Fi({className:t,...r}){const[a,s]=m.useState(!1),[n,o]=m.useState(""),[i,l]=m.useState("");return e.jsxs(Q,{open:a,onOpenChange:s,children:[e.jsx(J,{asChild:!0,children:e.jsxs(T,{variant:"outline",role:"combobox","aria-expanded":a,className:"justify-between bg-secondary",children:[i?e.jsx(_r,{code:i}):"...",e.jsx(f.ChevronsUpDown,{className:"opacity-50"})]})}),e.jsx(Z,{className:"p-0",align:"start",children:e.jsxs(Y,{filter:(u,c,x=[])=>(u.toLowerCase()+" "+x.join(" ").toLowerCase()).includes(c.toLowerCase())?1:0,children:[e.jsx(le,{placeholder:"Search ...",className:"h-9"}),e.jsxs(ce,{children:[e.jsx(de,{children:"No country found."}),e.jsx(se,{children:Object.entries(Dn.countries).map(([u,c])=>c.phone.map(x=>e.jsxs(X,{value:`${x}`,keywords:[c.name,"+"+x.toString(),u],onSelect:g=>{o(g===n?"":g),l(u),s(!1)},children:[e.jsx(_r,{code:u})," ",c.name," +",x]},x)))})]})]})})]})}function ks({buttonText:t,buttonIcon:r,buttonStyle:a,sheetContent:s,sheetDescription:n,sheetTitle:o,closeButton:i}){return e.jsxs(fr,{children:[e.jsx(ba,{asChild:!0,children:e.jsxs(T,{variant:"outline",className:a,size:"smIcon",children:[t,r]})}),e.jsxs(gr,{className:"p-4",children:[e.jsx(pr,{children:o}),s]})]})}const _i=f.icons;function Mi({title:t,iconName:r,iconSize:a,iconClass:s,primaryText:n,secondaryText:o,mainClassName:i="",loading:l,loadingMessage:u}){let c=null;return r&&(c=_i[r]),a=a===void 0?20:a,s=s??"",u=u??"Loading...",e.jsx(Nt,{className:i,children:e.jsxs(Qr,{className:"p-5",children:[e.jsxs("div",{className:"flex items-center justify-between gap-4",children:[e.jsx("span",{children:t}),l?e.jsx(f.LoaderCircle,{size:a,className:"animate-spin "+s}):c&&e.jsx(c,{size:a,className:s})]}),e.jsx("div",{className:"mt-6 text-2xl font-semibold",children:l?"...":n}),o&&e.jsx("small",{className:"mt-2 text-gray-400",children:l?u:o})]})})}function Is({children:t,tabArray:r,pathName:a,tabListClass:s="",tabListInnerClass:n="",tabListButtonClass:o="",tabContentClass:i="",headerEndComponent:l,onTabChange:u,isSeperatePage:c=!1}){const[x,g]=m.useState(5),w=Rt(),[N,v]=m.useState([]),[C,b]=m.useState([]),[k,p]=m.useState(r.find(h=>h.default)?.tabId||r[0]?.tabId||"");m.useEffect(()=>{g(w?2:5)},[w]),m.useEffect(()=>{if(a&&c){const h=a.split("/").pop()||"";p(h)}},[a,c]),m.useEffect(()=>{v(r.slice(0,x)),b(r.slice(x))},[r,x]);const A=h=>{p(h),u?.(h)},j=h=>{v(D=>{const P=[...D],R=P.pop();return R&&b(E=>[...E.filter(M=>M.tabId!==h.tabId),R]),[...P,h]}),A(h.tabId)};return e.jsxs(Ba,{value:k,onValueChange:A,className:"w-full h-full flex flex-col",children:[e.jsxs(Ua,{className:`flex justify-between items-center ${s}`,children:[e.jsxs("div",{className:`flex w-full ${n}`,children:[N.map(h=>e.jsx(Va,{value:h.tabId,className:o,children:h.tabName},h.tabId)),C.length>0&&e.jsxs(ge,{children:[e.jsx(pe,{asChild:!0,children:e.jsx(lt,{variant:"outline",size:"sm",className:"mt-1",children:e.jsx(f.EllipsisVertical,{})})}),e.jsx(he,{children:C.map(h=>e.jsx(me,{onClick:()=>j(h),children:h.tabName},h.tabId))})]})]}),l&&e.jsx("div",{children:l})]}),t?e.jsx(Gt,{value:k,className:`mt-3 flex-grow overflow-auto h-full w-full ${i}`,children:e.jsx(Nt,{className:"h-full w-full p-3",children:t})}):r.map(h=>e.jsx(Gt,{value:h.tabId,className:`mt-3 flex-grow overflow-auto h-full w-full ${i}`,children:e.jsx(Nt,{className:"h-full w-full p-3",children:h?.tabContent})},h.tabId))]})}function As(){const{setTheme:t,theme:r,resolvedTheme:a}=Ma(),[s,n]=m.useState(!1);m.useEffect(()=>{n(!0)},[]);const o=r==="system"?a:r,i=N=>{const v=parseInt(N.slice(1),16),C=v>>16&255,b=v>>8&255,k=v>>0&255,[p,A,j]=[C,b,k].map(h=>(h=h/255,h<=.03928?h/12.92:Math.pow((h+.055)/1.055,2.4)));return .2126*p+.7152*A+.0722*j},l=N=>i(N)>.25?"#000000":"#ffffff",u=m.useCallback(()=>{const N=localStorage.getItem("primary")||"#0f172b",v=localStorage.getItem("secondary")||"#1b2336",C=localStorage.getItem("tertiary")||"#1f3aba",b=localStorage.getItem("primaryChart")||"#00bc7d",k=localStorage.getItem("secondaryChart")||"#fd9a00",p=localStorage.getItem("tertiaryChart")||"#ad46ff";document.documentElement.style.setProperty("--background",N),document.documentElement.style.setProperty("--secondary",v),document.documentElement.style.setProperty("--card",v),document.documentElement.style.setProperty("--popover",v),document.documentElement.style.setProperty("--muted",v),document.documentElement.style.setProperty("--sidebar",v),document.documentElement.style.setProperty("--btn-secondary",v),document.documentElement.style.setProperty("--accent",C),document.documentElement.style.setProperty("--sidebar-primary",C),document.documentElement.style.setProperty("--sidebar-accent",C),document.documentElement.style.setProperty("--foreground",l(N)),document.documentElement.style.setProperty("--secondary-foreground",l(v)),document.documentElement.style.setProperty("--card-foreground",l(v)),document.documentElement.style.setProperty("--popover-foreground",l(v)),document.documentElement.style.setProperty("--muted-foreground",l(v)),document.documentElement.style.setProperty("--sidebar-foreground",l(v)),document.documentElement.style.setProperty("--accent-foreground",l(C)),document.documentElement.style.setProperty("--sidebar-primary-foreground",l(C)),document.documentElement.style.setProperty("--sidebar-accent-foreground",l(C)),document.documentElement.style.setProperty("--chart-1",b),document.documentElement.style.setProperty("--chart-2",k),document.documentElement.style.setProperty("--chart-3",p),document.documentElement.style.setProperty("--chart-4",b),document.documentElement.style.setProperty("--chart-5",k)},[]),c=m.useCallback(()=>{document.documentElement.style.removeProperty("--background"),document.documentElement.style.removeProperty("--secondary"),document.documentElement.style.removeProperty("--card"),document.documentElement.style.removeProperty("--popover"),document.documentElement.style.removeProperty("--muted"),document.documentElement.style.removeProperty("--sidebar"),document.documentElement.style.removeProperty("--btn-secondary"),document.documentElement.style.removeProperty("--accent"),document.documentElement.style.removeProperty("--sidebar-primary"),document.documentElement.style.removeProperty("--sidebar-accent"),document.documentElement.style.removeProperty("--foreground"),document.documentElement.style.removeProperty("--secondary-foreground"),document.documentElement.style.removeProperty("--card-foreground"),document.documentElement.style.removeProperty("--popover-foreground"),document.documentElement.style.removeProperty("--muted-foreground"),document.documentElement.style.removeProperty("--sidebar-foreground"),document.documentElement.style.removeProperty("--accent-foreground"),document.documentElement.style.removeProperty("--sidebar-primary-foreground"),document.documentElement.style.removeProperty("--sidebar-accent-foreground"),document.documentElement.style.removeProperty("--chart-1"),document.documentElement.style.removeProperty("--chart-2"),document.documentElement.style.removeProperty("--chart-3"),document.documentElement.style.removeProperty("--chart-4"),document.documentElement.style.removeProperty("--chart-5")},[]);m.useEffect(()=>{s&&o==="blue-dark"&&(document.documentElement.classList.add("blue-dark"),u())},[s,o,u]);const x=m.useCallback(N=>{t(N),(N==="light"||N==="dark")&&(document.documentElement.classList.remove("blue-dark"),c()),N==="blue-dark"&&(document.documentElement.classList.add("blue-dark"),u())},[t,u,c]);if(!s)return null;const g=o==="blue-dark"?e.jsx(f.Waves,{className:"h-5 w-5"}):o==="dark"?e.jsx(f.Moon,{className:"h-5 w-5"}):o==="light"?e.jsx(f.Sun,{className:"h-5 w-5"}):e.jsx(f.Laptop,{className:"h-5 w-5"}),w=N=>o===N;return e.jsxs(ge,{children:[e.jsx(pe,{asChild:!0,children:e.jsx(T,{variant:"outline",size:"icon","aria-label":"Change theme",title:`Theme: ${r==="system"?`system (${a})`:r}`,children:g})}),e.jsxs(he,{align:"end",sideOffset:8,children:[e.jsxs(me,{onClick:()=>x("light"),className:"flex items-center justify-between gap-2",children:[e.jsxs("div",{className:"flex items-center",children:[e.jsx(f.Sun,{className:"mr-2 h-4 w-4"})," Light"]}),w("light")&&e.jsx(f.Check,{className:"h-4 w-4"})]}),e.jsxs(me,{onClick:()=>x("dark"),className:"flex items-center justify-between gap-2",children:[e.jsxs("div",{className:"flex items-center",children:[e.jsx(f.Moon,{className:"mr-2 h-4 w-4"})," Dark"]}),w("dark")&&e.jsx(f.Check,{className:"h-4 w-4"})]}),e.jsxs(me,{onClick:()=>x("blue-dark"),className:"flex items-center justify-between gap-2",children:[e.jsxs("div",{className:"flex items-center",children:[e.jsx(f.Waves,{className:"mr-2 h-4 w-4"})," Custom"]}),w("blue-dark")&&e.jsx(f.Check,{className:"h-4 w-4"})]})]})]})}function Ei({title:t,value:r,valueText:a,isPercent:s=!0,className:n,titleClassName:o,valueClassName:i,progressClassName:l}){let u=r.toFixed(2);const c=u.split(".");return c[1]==="00"&&(u=c[0]),e.jsxs("div",{className:"w-full "+(n??""),children:[e.jsxs("div",{className:"flex items-center justify-between gap-4",children:[e.jsx("div",{className:"text-muted-foreground text-sm "+(o??""),children:t}),e.jsx("div",{className:"text-sm "+(i??""),children:a??`${u}${s?"%":""}`})]}),e.jsx(Pt,{value:r,className:"w-full mt-2 "+(l??"")})]})}function zi({processedData:t,value:r,onChange:a,placeholder:s="Select items...",searchPlaceholder:n="Search...",className:o}){const[i,l]=S.useState(!1),[u,c]=S.useState(""),{flatTree:x,itemMap:g}=t,w=S.useMemo(()=>{const b=new Map,k=new Set(r);return[...x].reverse().forEach(p=>{const A=g[p.id];if(!A||!p.treatAsParent||A.childrenIds.length===0)k.has(p.id)&&b.set(p.id,"checked");else{const j=A.childrenIds.map(P=>b.get(P)),h=j.filter(P=>P==="checked").length,D=j.filter(P=>P==="indeterminate").length;h===A.childrenIds.length?b.set(p.id,"checked"):(h>0||D>0)&&b.set(p.id,"indeterminate")}}),b},[r,x,g]),N=b=>{const k=new Set(r),p=w.get(b.id),A=!(p==="checked"||p==="indeterminate"),j=new Set,h=[...g[b.id]?.childrenIds||[]];for(;h.length>0;){const P=h.shift();j.add(P),(g[P]?.childrenIds||[]).forEach(E=>h.push(E))}A?(k.add(b.id),j.forEach(P=>k.add(P))):(k.delete(b.id),j.forEach(P=>k.delete(P)));let D=g[b.id]?.parentId;for(;D;){const P=g[D];P&&P.childrenIds.length>0&&(P.childrenIds.every(E=>k.has(E))?k.add(D):k.delete(D)),D=P?.parentId}a(Array.from(k))},v=S.useMemo(()=>{if(!u)return x.slice();const b=u.toLowerCase(),k=new Set;x.forEach(h=>{(h.title.toLowerCase().includes(b)||h.description.toLowerCase().includes(b)||h.index.toLowerCase().includes(b))&&k.add(h.id)});const p=new Set(k),A=h=>{let D=h;for(;D;){const P=g[D]?.parentId;if(P&&!p.has(P))p.add(P),D=P;else break}},j=h=>{const D=g[h]?.childrenIds||[];for(const P of D)p.has(P)||(p.add(P),j(P))};return k.forEach(h=>{A(h),j(h)}),x.filter(h=>p.has(h.id))},[u,x,g]),C=()=>{const b=r.filter(k=>{const p=g[k];return!p||p.childrenIds.length===0});if(b.length===0)return e.jsx("span",{className:"text-muted-foreground",children:s});if(b.length===1){const k=x.find(p=>p.id===b[0]);return k?k.index:s}return`${b.length} items selected`};return e.jsxs(Q,{open:i,onOpenChange:l,children:[e.jsx(J,{asChild:!0,children:e.jsxs(T,{variant:"outline",role:"combobox","aria-expanded":i,className:d("w-full justify-between transition-all duration-150 ease-in-out border hover:border-primary hover:shadow-sm bg-secondary cursor-pointer",o),children:[e.jsx("span",{className:"truncate",children:C()}),e.jsx(f.ChevronsUpDown,{className:d("ml-2 h-4 w-4 shrink-0 transition-transform duration-200",i&&"rotate-180")})]})}),e.jsx(Z,{className:"w-[--radix-popover-trigger-width] p-0 max-h-[400px] overflow-y-auto",children:e.jsxs(Y,{children:[e.jsx(le,{placeholder:n,value:u,onValueChange:c}),e.jsxs(ce,{className:"transition-all duration-200 ease-in-out",children:[e.jsx(de,{children:"No results found."}),v.map(b=>e.jsxs(X,{value:`${b.index} ${b.title} ${b.description}`,onSelect:()=>N(b),className:"flex items-start cursor-pointer gap-2",style:{paddingLeft:`${b.level*1.5+.75}rem`},children:[e.jsx("input",{type:"checkbox",className:"mt-1 h-4 w-4 accent-primary border rounded",checked:w.get(b.id)==="checked",ref:k=>{k&&(k.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 Li({widgetData:t}){const r=t.slice(0,4),a=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:r.map(s=>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(Ae,{children:e.jsxs(ne,{children:[e.jsx(oe,{className:"cursor-default select-text",children:e.jsx("p",{className:"font-medium max-w-[240px] truncate",children:s.widgetText})}),e.jsx(ie,{children:e.jsx("p",{children:s.widgetText})})]})}),e.jsx("div",{children:s.onButtonClickfunc?e.jsx(T,{className:"px-0",variant:"link",onClick:()=>s.onButtonClickfunc?.({id:s.id}),children:s.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:s.widgetNumber})})]}),e.jsx("div",{className:"flex justify-end items-center",children:s.iconName&&e.jsx(yt,{name:s.iconName})})]},s.id))}),a.length>0&&e.jsx("div",{className:"flex flex-col md:flex-row gap-2",children:a.map(s=>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(Ae,{children:e.jsxs(ne,{children:[e.jsx(oe,{className:"cursor-default select-text",children:e.jsx("p",{className:"font-medium max-w-[240px] truncate",children:s.widgetText})}),e.jsx(ie,{children:e.jsx("p",{children:s.widgetText})})]})}),e.jsx("div",{children:s.onButtonClickfunc?e.jsx(T,{className:"px-0",variant:"link",onClick:()=>s.onButtonClickfunc?.({id:s.id}),children:s.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:s.widgetNumber})})]}),e.jsx("div",{className:"flex justify-end items-center",children:s.iconName&&e.jsx(yt,{name:s.iconName})})]},s.id))})]})}function Oi({onNavigate:t,onView:r,label:a,extraTools:s,view:n}){const[o,i]=m.useState(n===q.Views.DAY?"DAY":n===q.Views.WEEK?"WEEK":"MONTH");return e.jsx(e.Fragment,{children:e.jsxs("div",{className:"flex flex-col md:flex-row justify-between items-start md:items-center mb-3",children:[e.jsxs(Oe,{type:"single",variant:"outline",onValueChange:l=>{switch(l){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(f.ChevronLeft,{size:16})}),e.jsx(U,{className:"rounded-none border-x",value:"NEXT",children:e.jsx(f.ChevronRight,{size:16})}),e.jsx(U,{className:"rounded-s-none",value:"TODAY",children:"Today"})]}),e.jsx("span",{className:"rbc-toolbar-label",children:a}),e.jsxs("div",{className:"flex flex-row gap-2",children:[e.jsxs(Oe,{type:"single",variant:"outline",value:o,onValueChange:l=>{switch(i(l),l){case"DAY":r(q.Views.DAY);break;case"WEEK":r(q.Views.WEEK);break;case"MONTH":r(q.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"})]}),s?.map((l,u)=>e.jsx(m.Fragment,{children:l},u))]})]})})}function Bi({event:t,extraParamsEvent:r}){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:[(r?.isEditableAll||t.isEditable)&&e.jsx(_e,{tooltipContent:"Edit",children:e.jsx("button",{className:"event-edit-button w-fit px-1",onClick:a=>{a.stopPropagation(),r?.onEditEventClick?.(t)},children:e.jsx(f.SquarePen,{size:16})})}),e.jsx(_e,{tooltipContent:"View",children:e.jsx("button",{className:"event-view-button w-fit px-1",onClick:a=>{a.stopPropagation(),r?.onViewEventClick?.(t)},children:e.jsx(f.Eye,{size:16})})})]})]})}const Ui={"en-US":Tn.enUS},Vi=q.dateFnsLocalizer({format:Qe.format,parse:Qe.parse,startOfWeek:Qe.startOfWeek,getDay:Qe.getDay,locales:Ui});function $i({events:t,extraParamsEvent:r,extraTools:a}){const[s,n]=m.useState(r?.defaultView==="day"?q.Views.DAY:r?.defaultView==="week"?q.Views.WEEK:r?.defaultView==="month"?q.Views.MONTH:r?.defaultView==="work week"?q.Views.WORK_WEEK:r?.defaultView==="agenda"?q.Views.AGENDA:q.Views.MONTH),[o,i]=m.useState(new Date);return e.jsx(q.Calendar,{localizer:Vi,events:t||[],startAccessor:"start",endAccessor:"end",views:[q.Views.DAY,q.Views.WEEK,q.Views.MONTH],view:s,onView:l=>n(l),date:o,onNavigate:l=>i(l),components:{event:l=>e.jsx(Bi,{event:l.event,extraParamsEvent:r}),toolbar:l=>e.jsx(Oi,{...l,extraTools:a,view:s})},style:{height:r?.height||"100%",margin:r?.margin||"0px"}})}const Ds=m.createContext(void 0);function Ps({children:t}){const[r,a]=m.useState([]),s=l=>{a(u=>[...u.filter(x=>x.level<l.level),l])},n=(l,u)=>{a(u?l:c=>[...c,...l])},o=l=>{a(u=>[...u.filter(x=>x.level<=l.level)])},i=()=>{a([])};return e.jsx(Ds.Provider,{value:{breadcrumbItems:r,addBreadcrumb:s,backBreadcrumb:o,addBreadcrumbItems:n,clearBreadcrumb:i},children:t})}function kr(){const t=m.useContext(Ds);if(!t)throw new Error("useBreadcrumb must be used within a BreadcrumbProvider");return t}function Ts(){const{breadcrumbItems:t,backBreadcrumb:r}=kr(),[a,s]=m.useState(!1),[n,o]=m.useState(2),i=Rt(),l=re.useNavigate();m.useEffect(()=>{o(i?2:4)},[i]);const u=m.useMemo(()=>({firstVisibleBreadcrumbList:t.slice(0,2),hiddenBreadcrumbList:i?t.slice(2):t.slice(2,n),lastVisibleBreadcrumbList:t.length>2?t.slice(2-(t.length<n?t.length:n)):[]}),[t,n,i]);return!u||i==null||n==null?null:e.jsx(Ga,{children:e.jsxs(qa,{children:[u.firstVisibleBreadcrumbList.map((c,x)=>x<t.length-1?e.jsxs(m.Fragment,{children:[e.jsx(We,{children:c.href?e.jsx(Wt,{className:"max-w-20 truncate md:max-w-none cursor-pointer",onClick:()=>{r(c),c.href&&l(c.href)},children:c.title}):e.jsx(Ze,{className:"max-w-20 truncate md:max-w-none",children:c.title})}),e.jsx(vt,{},"firstsep"+x)]},"first"+x):e.jsx(We,{children:e.jsx(Ze,{className:"max-w-20 truncate md:max-w-none",children:c.title})},"first"+x)),t.length>n?e.jsxs(e.Fragment,{children:[e.jsx(We,{children:i?e.jsxs(Ja,{open:a,onOpenChange:s,children:[e.jsx(Za,{"aria-label":"Toggle Menu",children:e.jsx(Ht,{className:"h-4 w-4"})}),e.jsxs(as,{children:[e.jsxs(ss,{className:"text-left",children:[e.jsx(os,{children:"Navigate to"}),e.jsx(is,{children:"Select a page to navigate to."})]}),e.jsx("div",{className:"grid gap-1 px-2 lg:px-4",children:u.hiddenBreadcrumbList.map((c,x)=>e.jsx("div",{children:c.clickable==!1?e.jsx("span",{className:"py-1 text-sm",children:c.title}):e.jsx(re.Link,{to:c.href?c.href:"#",className:"py-1 text-sm",children:c.title})},x))}),e.jsx(ns,{className:"pt-4",children:e.jsx(ts,{asChild:!0,children:e.jsx(T,{variant:"outline",children:"Close"})})})]})]}):e.jsxs(ge,{open:a,onOpenChange:s,children:[e.jsx(pe,{className:"flex items-center gap-1","aria-label":"Toggle menu",children:e.jsx(Ht,{className:"h-4 w-4"})}),e.jsx(he,{align:"start",children:u.hiddenBreadcrumbList.map((c,x)=>e.jsx(me,{children:c.href?e.jsx(re.Link,{to:c.href?c.href:"#",children:c.title}):e.jsx("span",{children:c.title})},x))})]})}),!i&&e.jsx(vt,{})]}):null,!i&&u.lastVisibleBreadcrumbList.map((c,x)=>x==u.lastVisibleBreadcrumbList.length-1?e.jsx(We,{children:e.jsx(Ze,{className:"max-w-20 truncate md:max-w-none cursor-pointer",children:c.title})},"last"+x):e.jsxs(m.Fragment,{children:[e.jsx(We,{children:c.href?e.jsx(Wt,{className:"max-w-20 truncate md:max-w-none cursor-pointer",onClick:()=>{r(c),c.href&&l(c.href)},children:c.title}):e.jsx(Ze,{className:"max-w-20 truncate md:max-w-none",children:c.title})}),e.jsx(vt,{},"lastsep"+x)]},"last"+x))]},"BreadcrumbList1")},"Breadcrumb1")}function Gi({breadcrumb:t}){const{addBreadcrumb:r}=kr();return m.useEffect(()=>{r(t)},[t]),e.jsx(e.Fragment,{})}const Rs=m.createContext(void 0);function Fs({children:t}){const[r,a]=m.useState([]),[s,n]=m.useState(null),[o,i]=m.useState(null),l=N=>{a(v=>v.some(b=>b.title===N.title)?v.map(b=>b.title===N.title?{...b,...N}:b):[...v,N])},u=N=>{a(v=>v.filter(C=>C.title!==N))},c=(N,v)=>{a(C=>C.map(b=>b.title===N?{...b,...v}:b))},x=N=>{n(N)},g=N=>{i(N)},w=()=>{a([])};return e.jsx(Rs.Provider,{value:{navItems:r,header:s,footer:o,setNavItems:a,addNavItem:l,removeNavItem:u,updateNavItem:c,clearNavItems:w,setSidebarHeader:x,setSidebarFooter:g},children:t})}function dt(){const t=m.useContext(Rs);if(!t)throw new Error("useSidebarNav must be used within a SidebarNavProvider");return t}function _s(){const{navItems:t}=dt(),{pathname:r}=re.useLocation(),a=m.useCallback(i=>i?r===i||r.startsWith(i+"/"):!1,[r]),s=m.useCallback(i=>{const l=u=>a(u.url)?!0:!!u.items?.some(c=>l(c));return l(i)},[a]);function n(i){return e.jsx(Ra,{children:i.map(l=>{if(!!l.items?.length){const x=s(l);return e.jsx(Kt,{asChild:!0,className:"group/collapsible",defaultOpen:x,children:e.jsxs(Ut,{children:[e.jsx(Xt,{asChild:!0,children:e.jsxs(Vt,{isActive:x,children:[e.jsx("span",{children:l.title}),e.jsx(f.ChevronRight,{className:"ml-auto transition-transform duration-200 group-data-[state=open]/collapsible:rotate-90"})]})}),e.jsx(Yt,{children:n(l.items)})]})},l.title)}const c=a(l.url);return e.jsx(Ut,{children:e.jsx(Vt,{asChild:!0,isActive:c,"aria-current":c?"page":void 0,children:e.jsx(re.Link,{to:l.url||"#",children:e.jsx("span",{children:l.title})})})},l.title)})})}function o(i){return e.jsx(Ta,{children:i.map(l=>{const u=l.icon;if(!!l.items?.length){const g=s(l);return e.jsx(Kt,{asChild:!0,className:"group/collapsible",defaultOpen:g,children:e.jsxs(Ot,{children:[e.jsx(Xt,{asChild:!0,children:e.jsxs(Bt,{tooltip:l.title,isActive:g,children:[u&&e.jsx(u,{}),e.jsx("span",{children:l.title}),e.jsx(f.ChevronRight,{className:"ml-auto transition-transform duration-200 group-data-[state=open]/collapsible:rotate-90"})]})}),e.jsx(Yt,{children:n(l.items)})]})},l.title)}const x=a(l.url);return e.jsx(Ot,{children:e.jsx(Bt,{asChild:!0,tooltip:l.title,isActive:x,"aria-current":x?"page":void 0,children:e.jsxs(re.Link,{to:l.url||"#",children:[u&&e.jsx(u,{}),e.jsx("span",{children:l.title})]})})},l.title)})})}return e.jsx(Pa,{className:"flex flex-col gap-3",children:o(t)})}function qi({items:t,sidebarHeader:r,sidebarFooter:a}){const{setNavItems:s,setSidebarHeader:n,setSidebarFooter:o}=dt();return m.useEffect(()=>{s(t),n(r),o(a)},[t,r,a,s,n,o]),null}function Wi({formControl:t,name:r,label:a,placeholder:s,formDescription:n,items:o,disabled:i,onSelect:l}){return e.jsx(e.Fragment,{children:e.jsx(be,{control:t,name:r,render:({field:u})=>e.jsxs(ve,{className:"",children:[a&&e.jsx(e.Fragment,{children:e.jsx(ye,{children:a})}),e.jsxs(Q,{children:[e.jsx(J,{asChild:!0,className:"w-full",children:e.jsx(je,{children:e.jsxs(T,{variant:"outline",role:"combobox",className:d("justify-between",!u.value&&"text-muted-foreground"),disabled:i==!0||i&&i(...arguments),children:[u.value?o.find(c=>c.value===u.value)?.label||u.value:s,e.jsx(f.ChevronsUpDown,{className:"opacity-50"})]})})}),e.jsx(Z,{className:"p-0",align:"start",children:e.jsxs(Y,{children:[e.jsx(le,{placeholder:"Search..."}),e.jsxs(ce,{children:[e.jsx(de,{children:"No items found."}),e.jsx(se,{children:o.map(c=>e.jsxs(X,{value:c.value,disabled:c.disabled==!0||c.disabled&&c.disabled(c),onSelect:x=>{u.onChange(x),l&&l(x)},children:[c?.label||c.value,e.jsx(f.Check,{className:d("ml-auto",c.value===u.value?"opacity-100":"opacity-0")})]},c.value))})]})]})})]}),n&&e.jsx(Ce,{children:n}),e.jsx(we,{})]})})})}function Hi(t){const{field:r}=Xe.useController({name:t.name,control:t.formControl}),a=t.value!==void 0?t.value:r.value;return e.jsx(be,{control:t.formControl,name:t.name,render:({field:s})=>e.jsxs(ve,{className:"",children:[t.label&&e.jsxs(e.Fragment,{children:[e.jsx(ye,{children:t.label}),e.jsx("br",{})]}),e.jsxs(Q,{children:[e.jsx(J,{asChild:!0,className:"w-full",children:e.jsx(je,{children:e.jsxs(T,{variant:"outline",role:"combobox",className:d("justify-between",!a&&"text-muted-foreground"),disabled:typeof t.disabled=="function"?t.disabled():t.disabled,children:[a?t.items.find(n=>n.value===a)?.label||a:t.placeholder,e.jsx(f.ChevronsUpDown,{className:"opacity-50"})]})})}),e.jsx(Z,{className:"p-0",align:"start",children:e.jsxs(Y,{children:[e.jsx(le,{placeholder:"Search..."}),e.jsxs(ce,{children:[e.jsx(de,{children:"No items found."}),e.jsx(se,{children:t.items.map(n=>e.jsxs(X,{value:n.value,disabled:typeof n.disabled=="function"?n.disabled(n):n.disabled,onSelect:o=>{s.onChange(o),t.onSelect&&t.onSelect(o),t.onChange&&t.onChange(o)},children:[n?.label||n.value,e.jsx(f.Check,{className:d("ml-auto",n.value===a?"opacity-100":"opacity-0")})]},n.value))})]})]})})]}),t.formDescription&&e.jsx(Ce,{children:t.formDescription}),e.jsx(we,{})]})})}function Ki({formControl:t,name:r,label:a,placeholder:s,dateFormat:n,calendarDateDisabled:o,formDescription:i,disabled:l}){return e.jsx(e.Fragment,{children:e.jsx(be,{control:t,name:r,render:({field:u})=>e.jsxs(ve,{children:[a&&e.jsx(e.Fragment,{children:e.jsx(ye,{children:a})}),e.jsxs(Q,{children:[e.jsx(J,{asChild:!0,className:"w-full",children:e.jsx(je,{children:e.jsxs(T,{variant:"outline",className:d(!u.value&&"text-foreground/50"),disabled:l,children:[u.value?Qe.format(u.value,n||"PPP"):e.jsx("span",{children:s||"Pick a date"}),e.jsx(f.CalendarIcon,{className:"ml-auto h-4 w-4 opacity-50"})]})})}),e.jsx(Z,{className:"w-auto p-0",align:"start",children:e.jsx(Xr,{mode:"single",selected:u.value,onSelect:u.onChange,disabled:o,captionLayout:"dropdown",autoFocus:!0})})]}),i&&e.jsx(Ce,{children:i}),e.jsx(we,{})]})})})}function Xi(){return e.jsx(e.Fragment,{})}function Yi({formControl:t,label:r,formDescription:a,extraFormComponent:s,name:n,...o}){return e.jsx(e.Fragment,{children:e.jsx(be,{control:t,name:n,render:({field:i})=>e.jsxs(ve,{children:[r&&e.jsx(ye,{children:r}),e.jsx(je,{children:e.jsx(H,{...i,...o})}),s&&s(i.value),a&&e.jsx(Ce,{children:a}),e.jsx(we,{})]})})})}function Qi({formControl:t,name:r,label:a,placeholder:s,formDescription:n,items:o=[],disabled:i,onSelect:l,defaultValue:u=[],defaultOptions:c=2}){const[x,g]=m.useState(""),w=m.useRef(null),N=o.filter(v=>v.label?.toLowerCase().includes(x.toLowerCase())).sort((v,C)=>(v?.label??"").localeCompare(C?.label??""));return e.jsx(be,{control:t,name:r,render:({field:v})=>{m.useEffect(()=>{(v.value===void 0||v.value===null)&&u.length>0&&v.onChange(u)},[u,v]);const C=v.value||[],[b,k]=m.useState(C.length),p=m.useCallback(()=>{const h=w.current;if(!h)return b;const D=Array.from(h.children);let P=h.offsetWidth,R=0,E=0;for(const M of D){const ue=M.offsetWidth+4;if(R+ue<=P)R+=ue,E++;else break}return E},[b]);m.useEffect(()=>{const h=w.current;if(!h)return;let D=null;const P=new ResizeObserver(()=>{D&&cancelAnimationFrame(D),D=requestAnimationFrame(()=>{const R=p();k(E=>E!==R?R:E)})});return P.observe(h),k(p()),()=>{D&&cancelAnimationFrame(D),P.disconnect()}},[p]);const A=h=>{let D;C.includes(h)?D=C.filter(P=>P!==h):D=[...C,h],v.onChange(D),l&&l(D)},j=h=>{const D=h.currentTarget;D.scrollTop+=h.deltaY,h.preventDefault()};return e.jsxs(ve,{children:[a&&e.jsx(ye,{children:a}),e.jsxs(Q,{children:[e.jsx(J,{asChild:!0,className:"w-full",children:e.jsx(je,{children:e.jsxs(T,{variant:"outline",role:"combobox",className:d("justify-between",!C.length&&"text-foreground/50"),disabled:i===!0||i&&i(...arguments),children:[C.length>0?e.jsx(Ae,{children:e.jsxs("div",{ref:w,className:"flex flex-wrap gap-2 items-center overflow-hidden",children:[C.slice(0,c).map(h=>{const D=o.find(P=>P.value===h)?.label||h;return e.jsxs("span",{className:"flex items-center px-2 py-1 bg-secondary text-secondary-foreground rounded-md truncate max-w-full",title:D,children:[e.jsx("span",{className:"truncate max-w-[120px]",children:D}),e.jsx("span",{role:"button",tabIndex:0,onClick:P=>{P.stopPropagation();const R=C.filter(E=>E!==h);v.onChange(R),l&&l(R)},onKeyDown:P=>{if(P.key==="Enter"||P.key===" "){P.preventDefault(),P.stopPropagation();const R=C.filter(E=>E!==h);v.onChange(R),l&&l(R)}},className:"ml-1 text-muted-foreground hover:text-destructive cursor-pointer outline-none",children:e.jsx(f.X,{className:"w-3 h-3 ml-1"})})]},h)}),C.length>c&&e.jsxs(ne,{children:[e.jsx(oe,{asChild:!0,children:e.jsxs("span",{className:"px-2 py-1 bg-secondary text-secondary-foreground rounded-md cursor-pointer",children:["+",C.length-c," more"]})}),e.jsx(ie,{className:"max-w-xs break-words",children:e.jsx("div",{onWheel:j,className:"flex flex-col gap-1 max-h-[200px] overflow-auto",children:C.slice(c).map(h=>e.jsx("span",{className:"text-sm",children:o.find(D=>D.value===h)?.label||h},h))})})]})]})}):s,e.jsx(f.ChevronsUpDown,{className:"opacity-50"})]})})}),e.jsx(Z,{id:"multiSelectPopover",className:"p-0 min-w-[--radix-popover-trigger-width]",style:{width:"max-content",maxWidth:"min(500px, 90vw)"},align:"start",children:e.jsxs(Y,{id:"commandPopover",children:[e.jsx(le,{placeholder:"Search...",value:x,onValueChange:g,autoFocus:!0}),e.jsxs(ce,{className:"max-h-60 overflow-auto",onWheel:j,children:[e.jsx(de,{children:"No items found."}),e.jsx(se,{children:N.map(h=>{const D=C.includes(h.value);return e.jsxs(X,{value:h.label??"",onSelect:()=>A(h.value),className:"flex items-center space-x-2 justify-start",children:[e.jsx(Ve,{checked:D,onCheckedChange:()=>A(h.value),onClick:P=>P.stopPropagation()}),e.jsx("span",{children:h.label})]},h.value)})})]})]})})]}),n&&e.jsx(Ce,{children:n}),e.jsx(we,{})]})}})}function Ji({formControl:t,label:r,formDescription:a,extraFormComponent:s,name:n,...o}){return e.jsx(e.Fragment,{children:e.jsx(be,{control:t,name:n,render:({field:i})=>e.jsxs(ve,{children:[r&&e.jsx(ye,{children:r}),e.jsx(je,{children:e.jsx(wr,{maxLength:4,...i,children:e.jsxs(Nr,{children:[e.jsx(He,{index:0}),e.jsx(He,{index:1}),e.jsx(He,{index:2}),e.jsx(He,{index:3})]})})}),s&&s(i.value),a&&e.jsx(Ce,{children:a}),e.jsx(we,{})]})})})}function Zi(){return e.jsx("div",{children:"FormPhoneInput"})}function el({formControl:t,name:r,label:a,formItemClass:s,formDescription:n,...o}){return e.jsx(e.Fragment,{children:e.jsx(be,{control:t,name:r,render:({field:i})=>e.jsxs(ve,{className:s,children:[a&&e.jsx(ye,{children:a}),e.jsx(je,{children:e.jsx($a,{...i,...o})}),n&&e.jsx(Ce,{children:n}),e.jsx(we,{})]})})})}function tl({formControl:t,label:r,formDescription:a,extraFormComponent:s,name:n,...o}){const[i,l]=S.useState(!1),u=()=>l(!i);return e.jsx(e.Fragment,{children:e.jsx(be,{control:t,name:n,render:({field:c})=>e.jsxs(ve,{children:[r&&e.jsx(ye,{children:r}),e.jsxs("div",{className:"relative",children:[e.jsx(je,{children:e.jsx(H,{type:i?"text":"password",...c,...o,className:`${o.className||""} pr-10`})}),e.jsx(T,{type:"button",variant:"ghost",size:"icon",className:"absolute right-0 top-0 h-full px-3 py-2 text-muted-foreground hover:bg-transparent!",onClick:u,children:i?e.jsx(f.EyeOff,{className:"h-4 w-4"}):e.jsx(f.Eye,{className:"h-4 w-4"})})]}),s&&s(c.value),a&&e.jsx(Ce,{children:a}),e.jsx(we,{})]})})})}function rl({rowCount:t=6,showToolbar:r=!0}){return e.jsxs("div",{className:"space-y-4",children:[r&&e.jsxs("div",{className:"flex justify-between",children:[e.jsx(Be,{className:"h-8 w-64 rounded-md"}),e.jsx(Be,{className:"h-8 w-32 rounded-md"})]}),e.jsx("div",{className:"space-y-4",children:[...Array(t)].map((a,s)=>e.jsx("div",{className:"grid gap-4 items-center",children:e.jsx(Be,{className:"h-8 w-full"})},s))})]})}function al({count:t}){return e.jsx("div",{className:"flex flex-row gap-3 w-full",children:t>0&&Array.from({length:t}).map((r,a)=>e.jsx(Be,{className:"w-1/"+t+" flex flex-col md:flex-row gap-2 h-20",children:e.jsx("div",{className:"flex flex-1 flex-row justify-between border rounded-md p-2 bg-card-new"})},"widget_"+a))})}function Ms(){const t=Xe.useForm({defaultValues:{text:"",fileNames:[]}}),[r,a]=m.useState(""),[s,n]=m.useState([]),[o,i]=m.useState([]),[l,u]=m.useState(""),[c,x]=m.useState(!0),g=o.some(b=>b.progress<100),w=async(b,k)=>{const p=new FormData;p.append("file",k.file);try{const A=await Ur.post("UPLOAD_ENDPOINT_URL",p,{onUploadProgress:j=>{const h=Math.round(j.loaded*100/(j.total||1));i(D=>D.map((P,R)=>R===b?{...P,progress:h}:P))}});i(j=>j.map((h,D)=>D===b?{...h,url:A.data.url,progress:100}:h))}catch(A){console.error("Upload failed:",A)}};m.useEffect(()=>{const b=new Date,k=String(b.getDate()).padStart(2,"0"),p=String(b.getMonth()+1).padStart(2,"0"),A=b.getFullYear();u(`${k}-${p}-${A}`)},[]),m.useEffect(()=>{o.forEach((b,k)=>{b.progress===0&&w(k,b)})},[o]);const N=()=>{if(r.trim()||o.length>0){const b={text:r.trim(),fileNames:o.map(k=>k.name)};n([b,...s]),a(""),i([]),x(!1)}},v=b=>{if(b.target.files){const k=Array.from(b.target.files).map(p=>({name:p.name,url:"",progress:0,file:p}));i(p=>[...p,...k]),x(!1)}},C=b=>{const k=o.filter((p,A)=>A!==b);i(k),k.length===0&&s.length===0&&x(!0)};return e.jsx(e.Fragment,{children:e.jsxs("div",{className:"flex flex-col h-full w-full gap-3",children:[e.jsxs("div",{className:"flex-grow overflow-auto flex flex-col-reverse gap-2",children:[c&&e.jsx(Sr,{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,k)=>e.jsxs("div",{className:"flex flex-col mb-2",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("a",{href:b.url,download:b.name,className:"text-sm text-blue-600 underline cursor-pointer",children:b.name}),e.jsx("button",{onClick:()=>C(k),className:"text-red-500 hover:text-red-800",children:e.jsx(f.X,{className:"w-4 h-4"})})]}),e.jsx(Pt,{value:b.progress}),e.jsxs("p",{className:"text-xs text-gray-500",children:[b.progress,"% uploaded"]})]},k))]}),s.map((b,k)=>e.jsxs("div",{className:"border-b text-sm pb-2",children:[b.fileNames.map((p,A)=>e.jsx("p",{children:e.jsx("a",{href:o.find(j=>j.name===p)?.url||"#",download:p,className:"text-sm text-blue-500 underline cursor-pointer",children:p})},A)),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:l})]})]},k))]}),e.jsx(ls,{...t,children:e.jsx("form",{onSubmit:t.handleSubmit(()=>N()),children:e.jsx("div",{className:"flex flex-col",children:e.jsxs("div",{className:"flex items-center justify-center gap-2",children:[e.jsx("div",{className:"flex-1",children:e.jsx(be,{name:"text",render:({field:b})=>e.jsxs(ve,{children:[e.jsx(je,{children:e.jsx(H,{id:"text-input",type:"text",value:r,onChange:k=>a(k.target.value),placeholder:"Type something..."})}),e.jsx(we,{})]})})}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(ke,{htmlFor:"file-upload",className:"sr-only",children:"Upload Files"}),e.jsx(T,{variant:"outline",asChild:!0,children:e.jsx("label",{htmlFor:"file-upload",className:"cursor-pointer",children:e.jsx(f.UploadIcon,{className:"w-5 h-5"})})}),e.jsx(H,{id:"file-upload",type:"file",multiple:!0,onChange:v,className:"hidden"})]}),e.jsx(T,{variant:"outline",type:"submit",disabled:g,children:e.jsx(f.Send,{})})]})})})})]})})}function Es({...t}){const{navItems:r,header:a,footer:s}=dt();return!r||r.length===0?null:e.jsxs(ya,{className:"ml-12",collapsible:"offcanvas",...t,children:[a&&e.jsx(Ia,{children:a}),e.jsx(Da,{children:e.jsx(_s,{})}),s&&e.jsx(Aa,{children:s}),e.jsx(Sa,{})]})}function zs(){return e.jsx("footer",{className:"ml-12 flex border-t px-4 py-2 justify-center lg:justify-start",children:e.jsxs("div",{className:"flex gap-2 items-center",children:[e.jsx(f.Copyright,{className:"size-4"}),e.jsx("span",{children:"Powered By"}),e.jsx("a",{href:"https://keross.com",target:"_blank",children:"Keross"}),e.jsx("span",{className:"",children:"|"}),e.jsx("span",{id:"txtCopyrightYear",className:"",children:new Date().getFullYear()})]})})}const te={IKON_ACCOUNT_API_URL:"",IKON_AUTH_API_URL:"",IKON_BASE_API_URL:"",IKON_PLATFORM_API_URL:"",IKON_PLATFORM_PROFILE_URL:"",IKON_PLATFORM_UI_URL:"",IKON_USER_API_URL:"",LOGIN_PAGE_URL:""},sl=t=>{te.IKON_BASE_API_URL=t.IKON_BASE_API_URL,te.IKON_PLATFORM_API_URL=`${t.IKON_BASE_API_URL}/platform`,te.IKON_AUTH_API_URL=`${te.IKON_PLATFORM_API_URL}/auth`,te.IKON_USER_API_URL=`${te.IKON_PLATFORM_API_URL}/user`,te.IKON_ACCOUNT_API_URL=`${te.IKON_PLATFORM_API_URL}/account`,te.LOGIN_PAGE_URL=t.LOGIN_PAGE_URL,te.IKON_PLATFORM_UI_URL=t.IKON_PLATFORM_UI_URL,te.IKON_PLATFORM_PROFILE_URL=`${t.IKON_PLATFORM_UI_URL}/setting/profile`},Ne=()=>te;function Ls(){const{navItems:t}=dt(),{IKON_PLATFORM_UI_URL:r}=Ne();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(Ca,{className:"-ml-1"}),!t||t.length===0?e.jsx("div",{}):e.jsx(Tt,{orientation:"vertical",className:"mr-2 data-[orientation=vertical]:h-4"}),e.jsx(Ts,{})]}),e.jsxs("div",{className:"ml-auto flex gap-4",children:[e.jsx(Fe,{className:"px-2!",tooltipContent:"Notifications",children:e.jsx(f.Bell,{})}),e.jsx(As,{}),e.jsx(re.Link,{to:`${r}/app-store`,children:e.jsxs(ct,{variant:"default",children:[e.jsx(f.Play,{}),"App Store"]})})]})]})})}const Ir="ikoncloud_next_";function Jt(t,r,a){let s=a?.expires;!s&&a?.maxAge&&(s=a.maxAge/86400),tr.set(Ir+t,r,{httpOnly:!1,sameSite:"lax",expires:s})}function Ct(t){return tr.get(Ir+t)}function Zt(t){tr.remove(Ir+t)}async function nl(){}async function ut(t){const r=Ct("accessToken"),a=Ct("refreshToken");if(r)return r;if(a){const s=await Os(a,t?.isSetToken);if(s)return s}return null}async function Os(t,r){try{const a=await fetch(`${Ne().IKON_AUTH_API_URL}/refresh-token`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({refreshToken:t})});if(a.ok){const n=await a.json(),{accessToken:o,refreshToken:i,expiresIn:l,refreshExpiresIn:u}=n;if(r==null||r)try{Jt("accessToken",o,{maxAge:l}),Jt("refreshToken",i,{maxAge:u})}catch(c){console.error(c)}return o}}catch(a){console.error("Failed to refresh access token:",a)}return null}function er(){Zt("accessToken"),Zt("refreshToken"),typeof window<"u"&&(window.location.href=Ne().LOGIN_PAGE_URL)}const Me=Ur.create();Me.interceptors.request.use(async t=>{const r=await ut();return r&&t.headers&&(t.headers.Authorization=`Bearer ${r}`),t},t=>Promise.reject(t instanceof Error?t:new Error(String(t))));Me.interceptors.response.use(t=>t,async t=>{const r=t.config;if(t.response?.status===401&&r&&!r._retry){r._retry=!0;try{const a=await ut({isSetToken:!0});if(a&&r.headers)return r.headers.Authorization=`Bearer ${a}`,Me(r);er()}catch(a){return er(),Promise.reject(a instanceof Error?a:new Error(String(a)))}}return Promise.reject(t instanceof Error?t:new Error(String(t)))});function ol(t){return Ue.useQuery({queryKey:["profile",t],queryFn:async()=>{if(!t)throw new Error("No userId");return(await Me.get(`${Ne().IKON_USER_API_URL}/${t}`)).data},enabled:!!t})}function il(){const t=Ue.useQueryClient();return Ue.useMutation({mutationFn:async r=>{await Me.post(`${Ne().IKON_AUTH_API_URL}/switch-account`,{targetAccountId:r})},onSuccess:()=>{t.invalidateQueries({queryKey:["accounts"]}),t.invalidateQueries({queryKey:["profile"]})}})}function ll(){return Ue.useQuery({queryKey:["accountMembership"],queryFn:async()=>{const{data:t}=await Me.get(`${Ne().IKON_BASE_API_URL}/platform/user/account-membership`);return t}})}function cl(){return Ue.useQuery({queryKey:["softwares"],queryFn:async()=>{const{data:t}=await Me.get(`${Ne().IKON_BASE_API_URL}/platform/software/accessible/user`);return t}})}const Bs=m.createContext(void 0);function dl({children:t}){const[r,a]=m.useState(null);m.useEffect(()=>{const l=Ct("accessToken");if(l)try{const u=Rn.jwtDecode(l);a(c=>({...c,userId:u.sub,primaryAccountId:u.primaryAccountId,activeAccountId:u.activeAccountId,roles:u.platformAccess?.roles??[]}))}catch{a(null)}},[]);const s=r?.userId??"",{data:n,isSuccess:o}=ol(s);m.useEffect(()=>{o&&n&&a(l=>({...l,...n}))},[o,n]);const i=l=>{a(u=>({...u,accountName:l}))};return e.jsx(Bs.Provider,{value:{user:r,setUser:a,setAccountName:i},children:t})}function Us(){const t=m.useContext(Bs);if(!t)throw new Error("useUser must be used within a UserProvider");return t}function ul(){const{user:t,setUser:r}=Us();return e.jsxs(ge,{children:[e.jsx(pe,{asChild:!0,children:e.jsx(T,{variant:"ghost",size:"icon",className:"h-10 w-10",children:e.jsx(f.CircleUserRound,{className:"h-8 w-8"})})}),e.jsxs(he,{className:"w-55 p-0",side:"right",sideOffset:8,children:[e.jsxs("div",{className:"flex items-start gap-3 p-4 bg-card",children:[e.jsx(f.CircleUserRound,{className:"h-8 w-8"}),e.jsxs("div",{className:"flex flex-col gap-0.5 flex-1 min-w-0",children:[e.jsx("p",{className:"text-sm font-bold text-foreground blue-dark:text-muted-foreground truncate",children:t?.userName}),e.jsx("p",{className:"text-xs text-muted-foreground truncate",children:t?.userEmail}),e.jsx("p",{className:"text-sm text-muted-foreground font-semibold"})]})]}),e.jsx(nt,{className:"my-0"}),e.jsxs(me,{onClick:async()=>{er()},className:"flex items-center gap-2 px-4 py-3 cursor-pointer focus:bg-destructive dark:focus:bg-destructive blue-dark:focus:bg-destructive",children:[e.jsx(f.LogOut,{className:"h-4 w-4 text-foreground"}),e.jsx("span",{children:"Log out"})]})]})]})}function ml(){const{data:t}=ll(),{user:r,setAccountName:a}=Us(),s=i=>i?i.split(" ").map(l=>l[0]).join("").toUpperCase().slice(0,2):"UN";m.useEffect(()=>{const i=t?.find(l=>l.accountId===r?.activeAccountId);a(i?.accountName||"")},[t]);const{mutateAsync:n}=il(),o=async i=>{await n(i.accountId),a(i.accountName)};return e.jsxs(ge,{children:[e.jsx(pe,{asChild:!0,children:e.jsx(T,{variant:"default",className:"mb-4 h-8 w-8 rounded-lg p-0",disabled:!r?.accountName,children:e.jsx("span",{className:"text-base font-medium text-accent-background",children:r?s(r.accountName):"..."})})}),e.jsxs(he,{className:"w-55",side:"right",sideOffset:8,align:"start",children:[e.jsx("div",{className:"px-2 py-1.5 text-xs font-semibold text-foreground",children:"Accounts"}),t?.map(i=>e.jsxs(me,{className:"flex items-center justify-between cursor-pointer",onClick:async()=>{try{await o(i),window.location.reload()}catch(l){console.error("Switch account failed",l)}},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:s(i.accountName)})}),e.jsx("span",{className:"text-sm",children:i.accountName})]}),r?.activeAccountId===i.accountId&&e.jsx(f.Check,{className:"h-4 w-4 text-primary"})]},i.accountId))]})]})}function xl(){const{IKON_PLATFORM_UI_URL:t}=Ne(),{data:r}=cl();function a(s){return s.split("-").map(n=>n.charAt(0).toUpperCase()+n.slice(1)).join("")}return e.jsxs(e.Fragment,{children:[" ",e.jsx("nav",{className:"flex flex-col gap-1",children:e.jsxs(ne,{children:[e.jsx(oe,{asChild:!0,className:"h-8 w-8",children:e.jsx(T,{variant:"ghost",size:"icon",className:"h-10 w-10",asChild:!0,children:e.jsxs(re.Link,{to:`${t}/home`,children:[e.jsx(f.Home,{className:"h-8 w-8"}),e.jsx("span",{className:"sr-only",children:"Home"})]})})}),e.jsx(ie,{side:"right",sideOffset:5,children:"Home"})]},"home")}),e.jsx("nav",{className:"flex flex-col gap-1 flex-1",children:r?.map(s=>{if(!s.visible)return null;const n=!!(s.icon&&s.icon.trim()!=="");return e.jsxs(ne,{children:[e.jsx(oe,{asChild:!0,className:"h-8 w-8",children:e.jsx(T,{variant:"ghost",size:"icon",className:"h-10 w-10",asChild:!0,children:e.jsxs(re.Link,{to:s.url??"#",children:[n?e.jsx(yt,{name:a(s.icon??""),className:"h-8 w-8"}):e.jsx(f.FolderCode,{className:"h-8 w-8"}),e.jsx("span",{className:"sr-only",children:s.softwareName})]})})}),e.jsx(ie,{side:"right",sideOffset:5,children:s.softwareName})]},s.softwareName)})})]})}const Vs=()=>{const{IKON_PLATFORM_UI_URL:t}=Ne();return e.jsx(Ae,{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(ml,{}),e.jsx(xl,{}),e.jsxs(ne,{children:[e.jsx(oe,{asChild:!0,className:"h-8 w-8",children:e.jsx(T,{variant:"ghost",className:"h-10 w-10",asChild:!0,children:e.jsxs(re.Link,{to:`${t}/settings`,children:[e.jsx(f.Settings,{className:"h-8 w-8"}),e.jsx("span",{className:"sr-only",children:"Settings"})]})})}),e.jsx(ie,{side:"right",sideOffset:5,children:"Settings"})]},"settings"),e.jsx(ul,{})]})})};function $s({children:t}){return e.jsxs(e.Fragment,{children:[e.jsx(Vs,{}),e.jsx(Na,{children:e.jsx(hs,{children:e.jsxs(Fs,{children:[e.jsx(Es,{}),e.jsxs(ka,{className:"flex flex-col h-screen",children:[e.jsx(Ls,{}),e.jsx("div",{className:"flex flex-col gap-4 p-4 pt-0 ml-12 grow overflow-auto scrollbar-hidden",children:t}),e.jsx(zs,{})]})]})})})]})}const Gs=m.createContext(void 0);function qs({children:t}){const[r,a]=m.useState("Poppins"),[s,n]=m.useState(!1);m.useEffect(()=>{n(!0);const i=localStorage.getItem("app-font");i&&["Poppins","Oswald","Outfit"].includes(i)&&a(i)},[]),m.useEffect(()=>{if(!s)return;const i={Poppins:"var(--font-poppins)",Oswald:"var(--font-oswald)",Outfit:"var(--font-outfit)"};document.body.style.fontFamily=i[r],document.documentElement.style.fontFamily=i[r],localStorage.setItem("app-font",r),console.log("Font changed to:",r,i[r])},[r,s]);const o=m.useMemo(()=>({font:r,setFont:a}),[r]);return e.jsx(Gs.Provider,{value:o,children:t})}const fl=()=>{const t=m.useContext(Gs);if(t===void 0)throw new Error("useFont must be used within a FontProvider");return t},Ws=m.createContext(void 0);function Hs({children:t}){const[r,a]=m.useState(.5),[s,n]=m.useState(!1);m.useEffect(()=>{n(!0);const i=localStorage.getItem("app-radius");if(i){const l=parseFloat(i);[0,.25,.5,.75,1].includes(l)&&a(l)}},[]),m.useEffect(()=>{if(!s)return;const i=r===0?"0rem":`${r}rem`;document.documentElement.style.setProperty("--radius",i),localStorage.setItem("app-radius",r.toString()),console.log("Radius changed to:",r,i)},[r,s]);const o=m.useMemo(()=>({radius:r,setRadius:a}),[r]);return e.jsx(Ws.Provider,{value:o,children:t})}const gl=()=>{const t=m.useContext(Ws);if(t===void 0)throw new Error("useRadius must be used within a RadiusProvider");return t},Ks=m.createContext(void 0);function pl({children:t}){const[r,a]=m.useState(0),s=m.useCallback(()=>{a(n=>n+1)},[]);return e.jsx(Ks.Provider,{value:{refresh:s,refreshCounter:r},children:t})}function hl(){const t=m.useContext(Ks);if(t===void 0)throw new Error("useRefresh must be used within a RefreshProvider");return t}const bl=new Ue.QueryClient;function vl({children:t}){return e.jsx(Ue.QueryClientProvider,{client:bl,children:t})}function jl({children:t}){return re.useInRouterContext()?e.jsx(e.Fragment,{children:t}):e.jsx(re.BrowserRouter,{children:t})}function wl({children:t}){const r=Ne();if(!r.IKON_BASE_API_URL||!r.IKON_PLATFORM_UI_URL||!r.LOGIN_PAGE_URL)throw new Error("[IKON] ProviderWrapper: Ikon config not set. Please call setIkonConfig() before rendering ProviderWrapper.");return e.jsx(vl,{children:e.jsx(dl,{children:e.jsx(_a,{children:e.jsx(qs,{children:e.jsx(Hs,{children:e.jsx(Ps,{children:e.jsx(pl,{children:e.jsx(jl,{children:e.jsx($s,{children:t})})})})})})})})})}function Nl({activityLogs:t=[]}){const r=[{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(a=>e.jsxs("div",{className:"border-b text-sm pb-2",children:[e.jsx("p",{className:"font-medium pb-1",children:a.activity}),e.jsxs("p",{className:"text-gray-500 pb-1",children:["Updated On:"," ",e.jsx("span",{className:"text-gray-700",children:new Date(a.updatedOn).toLocaleString()})]}),e.jsxs("p",{className:"text-gray-500 pb-1",children:["Updated By: ",e.jsx("span",{className:"text-gray-700",children:a.updatedBy})]})]},a.id)):e.jsx(Sr,{text:"No Activity Logs Available"})})},{tabName:"File Upload",tabId:"tab-upload",default:!1,tabContent:e.jsx(Ms,{})}];return e.jsx(ks,{buttonText:"",buttonIcon:e.jsx(f.AlignJustify,{}),sheetTitle:"",sheetContent:e.jsx(Is,{tabArray:r,tabListClass:""}),closeButton:!0})}const yl=({src:t,onCroppedImage:r,aspectRatio:a,rotationAngle:s,zoomLevel:n,moveDirection:o})=>{const i=m.useRef(null);function l(u){const c=i.current?.cropper;if(c){const g=c.getCroppedCanvas().toDataURL("image/webp");r(g)}else console.log("Cropper instance is not available.")}return m.useEffect(()=>{const u=i.current?.cropper;u&&u.rotate(s)},[s]),m.useEffect(()=>{const u=i.current?.cropper;u&&u.getCropBoxData().width&&(console.log("Inside cropper scale"),u.scale(n))},[n]),m.useEffect(()=>{const u=i.current?.cropper;if(u&&u.getCropBoxData().width){const{x,y:g}=o;typeof x=="number"&&typeof g=="number"&&u.move(x,g)}},[o]),m.useEffect(()=>{const u=i.current?.cropper;if(u&&(u.setAspectRatio(a),a===1)){const c=u.getCanvasData(),x=c.width,g=c.height,w=c.left,N=c.top,v=200,C=100,b=w+(x-v)/2,k=N+(g-C)/2;u.setCropBoxData({left:b,top:k,width:v,height:C})}},[a]),e.jsx(Vr,{src:t,style:{height:"100%",width:"100%",objectFit:"contain"},guides:!0,crop:l,ref:i,dragMode:"move",movable:!0,zoomable:!0,scalable:!0,cropBoxMovable:!0,cropBoxResizable:!1})},Xs=m.memo(yl),Mr={landscape:4/3,portrait:3/4,icon:1/1};function Cl({onNewFileUpload:t}){const{originalImage:r,setOriginalImage:a,aspectRatioWiseImages:s,setAspectRatioWiseImages:n}=Ar(),[o,i]=m.useState(null),[l,u]=m.useState(),[c,x]=m.useState(0),[g,w]=m.useState(1),[N,v]=m.useState({x:0,y:0}),[C,b]=m.useState(null),k=j=>{j.preventDefault(),p(j.dataTransfer.files[0])},p=j=>{if(typeof j=="string")b(j);else if(j?.type?.startsWith("image/")){t?.();const h=new FileReader;h.onloadend=()=>{b(h.result),u(void 0)},h.readAsDataURL(j),a({...r,image:j,name:j.name})}else Or.toast.error("Please select a valid image file.")};m.useEffect(()=>{r.image&&p(r.image)},[r.image]);const A=j=>{const h=o&&l===j?o:s[j];return e.jsxs(e.Fragment,{children:[e.jsx("h3",{className:"mb-3",children:j}),e.jsx(qt,{ratio:Mr[j],className:"bg-muted",children:h&&e.jsx("img",{src:h,alt:`Preview ${j}`,className:"absolute inset-0 w-full h-full object-contain"})})]})};return m.useEffect(()=>{o&&n(l?{...s,[l]: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(ke,{htmlFor:"imageName",children:"Image Name"}),e.jsx(Ss,{id:"inputImage",accept:"image/*",fileNamePlaceholder:"Enter image name",fileName:r?.name||"",onChange:j=>{const h=j.target.files?.[0];h&&p(h)},onFileNameChange:j=>{a({...r,name:j.target.value})}})]}),e.jsxs("div",{className:"w-full flex flex-col gap-4",children:[e.jsx(ke,{htmlFor:"imageDescription",children:"Image Description"}),e.jsx(H,{id:"imageDescription",placeholder:"Enter image Description",value:r?.description||"",onChange:j=>a({...r,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(qt,{ratio:4/3,className:"flex justify-center items-center bg-muted text-muted-foreground",onDrop:k,onDragOver:j=>j.preventDefault(),children:C?e.jsx(Xs,{src:C,onCroppedImage:i,aspectRatio:Mr[l||"icon"],rotationAngle:c,zoomLevel:g,moveDirection:N}):e.jsxs("div",{className:"text-center",children:[e.jsx(ke,{htmlFor:"inputImage",children:"Drag and drop an image here"}),e.jsx("div",{className:"mt-3",children:e.jsx(lt,{variant:"outline",onClick:()=>document.getElementById("inputImage")?.click(),children:"Browse Image"})})]})})]}),e.jsxs("div",{className:"flex flex-col lg:flex-row gap-3 justify-between",children:[e.jsx("div",{children:e.jsxs(Oe,{type:"single",variant:"outline",value:l,onValueChange:j=>u(j),children:[e.jsx(U,{className:"rounded-e-none",value:"landscape",children:e.jsx(f.ImageIcon,{})}),e.jsx(U,{className:"rounded-none border-x-0",value:"portrait",children:e.jsx(f.FileImage,{})}),e.jsx(U,{className:"rounded-s-none",value:"icon",children:e.jsx(f.Square,{})})]})}),e.jsxs("div",{className:"flex flex-col lg:flex-row gap-3 justify-between",children:[e.jsxs(Oe,{type:"single",variant:"outline",value:"",onValueChange:j=>x(parseInt(j)),children:[e.jsx(U,{className:"rounded-e-none",value:"90",children:e.jsx(f.RotateCw,{})}),e.jsx(U,{className:"rounded-s-none border-s-0",value:"-90",children:e.jsx(f.RotateCcw,{})})]}),e.jsxs(Oe,{type:"single",variant:"outline",value:"",children:[e.jsx(U,{className:"rounded-e-none",value:"up",onClick:()=>v({x:0,y:-5}),children:e.jsx(f.ArrowUp,{})}),e.jsx(U,{className:"rounded-none border-x-0",value:"down",onClick:()=>v({x:0,y:5}),children:e.jsx(f.ArrowDown,{})}),e.jsx(U,{className:"rounded-none border-e-0",value:"left",onClick:()=>v({x:-5,y:0}),children:e.jsx(f.ArrowLeft,{})}),e.jsx(U,{className:"rounded-s-none",value:"right",onClick:()=>v({x:5,y:0}),children:e.jsx(f.ArrowRight,{})})]}),e.jsxs(Oe,{type:"single",variant:"outline",value:"",onValueChange:j=>w(h=>h+parseFloat(j)),children:[e.jsx(U,{className:"rounded-e-none",value:"0.1",children:e.jsx(f.ZoomIn,{})}),e.jsx(U,{className:"rounded-s-none border-s-0",value:"-0.1",children:e.jsx(f.ZoomOut,{})})]})]})]})]}),e.jsxs("div",{className:"flex flex-row lg:flex-col gap-3 w-full lg:w-48",children:[e.jsx("div",{className:"w-5/5",children:A("landscape")}),e.jsx("div",{className:"w-4/5",children:A("portrait")}),e.jsx("div",{className:"w-3/5",children:A("icon")})]})]})]})})}const Ys=m.memo(Cl);function Qs({open:t,onOpenChange:r,onCropperChange:a}){const{originalImage:s,aspectRatioWiseImages:n}=Ar();return e.jsx(kt,{modal:!0,open:t,onOpenChange:o=>{r(o)},children:e.jsxs(It,{className:"max-w-full lg:max-w-5xl max-h-full overflow-auto",children:[e.jsx(mr,{children:e.jsx(At,{children:"Image to upload"})}),e.jsx(Ys,{}),e.jsx(ta,{children:e.jsx(lt,{onClick:()=>{a(s,n),r(!1)},children:"Save Changes"})})]})})}async function ht(t,r=""){if(!t||!t.resourceId)return null;try{return`${Ne().IKON_BASE_API_URL}/platform/file-resource/download/${r}/${t.resourceId}`}catch(a){return console.error("Error getting resource URL:",a),null}}async function Sl(t){if(!t)return null;const r=t.originalImageInfo?await ht(t.originalImageInfo):null,a=t.landscapeImageInfo?await ht(t.landscapeImageInfo):null,s=t.portraitImageInfo?await ht(t.portraitImageInfo):null,n=t.iconImageInfo?await ht(t.iconImageInfo):null;return{originalImage:{image:r,name:t.imageName,description:t.imageDescription},aspectRatioWiseImages:{landscape:a,portrait:s,icon:n}}}const Js=m.createContext(void 0);function kl({children:t,uploadedImages:r,onCropperChange:a,modalOpen:s,onModalOpenChange:n}){const[o,i]=m.useState({landscape:null,portrait:null,icon:null}),[l,u]=m.useState({image:null,name:"",description:""});return m.useEffect(()=>{async function c(){if(r)try{const x=await Sl(r);x&&(u(g=>JSON.stringify(g)===JSON.stringify(x.originalImage)?g:x.originalImage),i(g=>JSON.stringify(g)===JSON.stringify(x.aspectRatioWiseImages)?g:x.aspectRatioWiseImages))}catch(x){console.error("Error processing uploaded images:",x)}}c()},[r]),e.jsxs(Js.Provider,{value:{originalImage:l,setOriginalImage:u,aspectRatioWiseImages:o,setAspectRatioWiseImages:i},children:[t,s&&n&&e.jsx(Qs,{open:s,onOpenChange:n,onCropperChange:a})]})}const Ar=()=>{const t=m.useContext(Js);if(!t)throw new Error("useImageCropper must be used within a ImageCropperProvider");return t},Zs=({imageSrc:t,onCroppedImage:r,aspectRatio:a,rotationAngle:s,zoomLevel:n,moveDirection:o,currentState:i})=>{const l=m.useRef(null),u=()=>{const c=l.current?.cropper;if(c){c.setDragMode("move");const g=c.getCroppedCanvas().toDataURL();r(g)}else console.log("Cropper instance is not available.")};return m.useEffect(()=>{const c=l.current?.cropper;c&&c.rotate(s)},[s]),m.useEffect(()=>{const c=l.current?.cropper;c&&c.getCropBoxData().width&&(console.log("Inside cropper scale"),c.scale(n))},[n]),m.useEffect(()=>{const c=l.current?.cropper;if(c&&c.getCropBoxData().width){const{x:g,y:w}=o;typeof g=="number"&&typeof w=="number"&&c.move(g,w)}},[o]),m.useEffect(()=>{const c=l.current?.cropper;if(c&&(c.setAspectRatio(a),a===1)){const x=c.getCanvasData(),g=x.width,w=x.height,N=x.left,v=x.top,C=200,b=100,k=N+(g-C)/2,p=v+(w-b)/2;c.setCropBoxData({left:k,top:p,width:C,height:b})}},[a]),e.jsx(Vr,{src:t,style:{height:"100%",width:"100%",objectFit:"contain"},guides:!0,crop:u,ref:l,dragMode:"move",movable:!0,zoomable:!0,scalable:!0,cropBoxMovable:!0,cropBoxResizable:!1})},Il=({open:t,setOpen:r,onImageSubmit:a})=>{const[s,n]=m.useState(null),[o,i]=m.useState(null),[l,u]=m.useState({first:null,second:null,third:null}),[c,x]=m.useState(4/3),[g,w]=m.useState("first"),[N,v]=m.useState(0),[C,b]=m.useState(1),[k,p]=m.useState({x:0,y:0}),[A,j]=m.useState(""),h=()=>{console.log("Image Submit Button is pressed"),console.log(l),a(l.third),r(!1)},D=_=>{v(O=>O+_)},P=()=>{p({x:0,y:-5})},R=()=>{p({x:0,y:5})},E=()=>{p({x:-5,y:0})},M=()=>{p({x:5,y:0})},ue=()=>{b(_=>{const O=_+.2;return O<=2?O:_})},Pe=()=>{b(_=>{const O=_-.2;return O>=.2?O:_})},Se=(_,O)=>{x(_),w(O)},y=_=>{if(_.type.startsWith("image/")){const O=new FileReader;O.onloadend=()=>{n(O.result),j(Te=>Te||_.name)},O.readAsDataURL(_)}else alert("Please drop a valid image file.")},I=_=>{_.preventDefault(),y(_.dataTransfer.files[0])},B=_=>{const O=o&&g===_?o:l[_];return O?e.jsx("div",{className:`
4
+ ${_==="first"?"relative w-3/5 h-[200px] bg-slate-400":_==="second"?"relative w-1/2 h-[220px] bg-slate-400":"relative w-1/3 h-[120px] bg-slate-400"}`,children:e.jsx("img",{src:O,alt:`Preview ${_}`,className:"absolute inset-0 w-full h-full object-contain"})}):e.jsx("div",{className:`
5
+ ${_==="first"?"relative w-3/5 h-[200px] bg-slate-400":_==="second"?"relative w-1/2 h-[220px] bg-slate-400":"relative w-1/3 h-[120px] bg-slate-400"}`})};return m.useEffect(()=>{o&&(l.first===null||l.second===null||l.third===null?u({first:o,second:o,third:o}):u(_=>({..._,[g]:o})))},[o]),e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"flex flex-row gap-2",children:[e.jsxs("div",{className:"flex-1",children:[e.jsx(ke,{htmlFor:"imageName",children:"Image Name"}),e.jsx(H,{id:"imageName",placeholder:"Enter image name",value:A,onChange:_=>j(_.target.value)})]}),e.jsxs("div",{className:"self-end",children:[e.jsx(T,{variant:"outline",onClick:()=>document.getElementById("inputImage1")?.click(),children:e.jsx(f.Upload,{})}),e.jsx(H,{id:"inputImage1",type:"file",accept:"image/png, image/jpeg",className:"hidden",onChange:_=>{const O=_.target.files?.[0];if(O&&O.type.startsWith("image/")){const Te=new FileReader;Te.onloadend=()=>{n(Te.result),j(ee=>ee||O.name)},Te.readAsDataURL(O),u({first:null,second:null,third:null})}}})]}),e.jsxs("div",{className:"flex-1",children:[e.jsx(ke,{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:I,onDragOver:_=>_.preventDefault(),children:s?e.jsx(Zs,{imageSrc:s,onCroppedImage:i,aspectRatio:c,rotationAngle:N,zoomLevel:C,moveDirection:k,currentState:g}):e.jsxs("div",{className:"text-center",children:[e.jsx(ke,{htmlFor:"inputImage",children:"Drag and drop an image here"}),e.jsxs("div",{className:"mt-4",children:[e.jsx(T,{variant:"outline",onClick:()=>document.getElementById("inputImage")?.click(),children:"Upload Image"}),e.jsx(H,{id:"inputImage",type:"file",accept:"image/png, image/jpeg",className:"hidden",onChange:_=>{const O=_.target.files?.[0];O&&y(O)}})]})]})}),e.jsxs("div",{className:"w-2/5 flex flex-col gap-2",children:[e.jsx("h3",{children:"Landscape"}),B("first"),e.jsx("h3",{children:"Potrait"}),B("second"),e.jsx("h3",{children:"Icon"}),B("third")]})]}),e.jsxs("div",{className:"flex flex-row gap-1",children:[e.jsxs("div",{className:"w-3/5 flex flex-row justify-between",children:[e.jsxs("div",{children:[e.jsx(T,{variant:"outline",onClick:()=>Se(4/3,"first"),children:e.jsx(f.ImageIcon,{})}),e.jsx(T,{variant:"outline",onClick:()=>Se(3/4,"second"),children:e.jsx(f.FileImage,{})}),e.jsx(T,{variant:"outline",onClick:()=>Se(1/1,"third"),children:e.jsx(f.Square,{})})]}),e.jsxs("div",{children:[e.jsx(T,{onClick:()=>D(90),variant:"outline",children:e.jsx(f.RotateCw,{})}),e.jsx(T,{onClick:()=>D(-90),variant:"outline",children:e.jsx(f.RotateCcw,{})})]}),e.jsxs("div",{children:[e.jsx(T,{onClick:()=>ue(),variant:"outline",children:e.jsx(f.ZoomIn,{})}),e.jsx(T,{onClick:()=>Pe(),variant:"outline",children:e.jsx(f.ZoomOut,{})})]}),e.jsxs("div",{children:[e.jsx(T,{onClick:P,variant:"outline",children:e.jsx(f.ArrowUp,{})}),e.jsx(T,{onClick:R,variant:"outline",children:e.jsx(f.ArrowDown,{})}),e.jsx(T,{onClick:E,variant:"outline",children:e.jsx(f.ArrowLeft,{})}),e.jsx(T,{onClick:M,variant:"outline",children:e.jsx(f.ArrowRight,{})})]})]}),e.jsx("div",{className:"w-2/5 flex flex-row-reverse",children:e.jsx(T,{onClick:h,children:"Save"})})]})]})},Al=m.memo(Il);function Dl(){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 Pl({formControl:t,name:r,label:a,options:s,placeholder:n="Select an option",emptyMessage:o="No options found.",onValueChange:i,className:l,addNewPlaceholder:u="Add custom value...",formDescription:c,disabled:x}){const[g,w]=S.useState(!1),[N,v]=S.useState(""),[C,b]=S.useState(s),[k,p]=S.useState(!1),[A,j]=S.useState("");return S.useEffect(()=>{b(s)},[s]),e.jsx(be,{control:t,name:r,render:({field:h})=>{const D=C.find(R=>R.value===h.value),P=()=>{const R=A.trim();if(!R)return;if(C.some(M=>M.value===R)){const M=C.find(ue=>ue.value===R);M&&(h.onChange(M.value),i?.(M.value),j(""),p(!1),w(!1),v(""));return}const E={value:R,label:R,disabled:!0};b(M=>[...M,E]),h.onChange(R),i?.(R),j(""),p(!1),w(!1),v("")};return e.jsxs(ve,{className:d(l),children:[a&&e.jsxs(e.Fragment,{children:[e.jsx(ye,{children:a}),e.jsx("br",{})]}),e.jsxs(Q,{open:g,onOpenChange:R=>{w(R),R||(v(""),p(!1),j(""))},children:[e.jsx(J,{asChild:!0,children:e.jsx(je,{children:e.jsxs(T,{variant:"outline",role:"combobox","aria-expanded":g,className:d("w-full justify-between",!h.value&&"text-foreground/50",l),disabled:x||h.disabled,children:[e.jsx("span",{className:"line-clamp-1 text-left",children:h.value?D?D.label:h.value:n}),e.jsx(f.ChevronsUpDown,{className:"ml-2 h-4 w-4 shrink-0 opacity-50"})]})})}),e.jsx(Z,{className:"p-0 w-[--radix-popover-trigger-width]",align:"start",children:e.jsxs(Y,{shouldFilter:!0,children:[e.jsx(le,{placeholder:"Search...",value:N,onValueChange:v}),e.jsxs(ce,{children:[e.jsx(de,{children:N&&C.length>0?"No results found.":o}),e.jsx(se,{children:C.filter(R=>R.label.toLowerCase().includes(N.toLowerCase())||R.value.toLowerCase().includes(N.toLowerCase())).map(R=>e.jsxs(X,{value:R.value,onSelect:E=>{h.onChange(E),i?.(E),w(!1),v("")},className:"cursor-pointer",disabled:R?.disabled,children:[e.jsx(f.Check,{className:d("mr-2 h-4 w-4",h.value===R.value?"opacity-100":"opacity-0")}),R.label]},R.value))})]}),e.jsx("div",{className:"border-t p-2",children:k?e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(H,{placeholder:u,value:A,onChange:R=>j(R.target.value),onKeyDown:R=>{R.key==="Enter"&&(R.preventDefault(),P()),R.key==="Escape"&&(p(!1),j(""))},autoFocus:!0,className:"h-8"}),e.jsx(T,{size:"sm",variant:"ghost",onClick:()=>{p(!1),j("")},className:"h-8",children:"Cancel"}),e.jsx(T,{size:"sm",variant:"default",onClick:P,className:"h-8",disabled:!A.trim()||C.some(R=>R.value===A.trim()),children:"Add"})]}):e.jsxs(T,{variant:"outline",className:"w-full justify-start",onClick:()=>p(!0),children:[e.jsx(f.Plus,{className:"mr-2 h-4 w-4"}),"Add new option"]})})]})})]}),c&&e.jsx(Ce,{children:c}),e.jsx(we,{})]})}})}const xe=m.forwardRef(({children:t,tooltip:r,side:a="bottom",className:s,...n},o)=>e.jsxs(ne,{children:[e.jsx(oe,{asChild:!0,children:e.jsxs(T,{variant:"ghost",size:"icon",...n,className:d("aui-button-icon size-6 p-1",s),ref:o,children:[e.jsx(fe.Slottable,{children:t}),e.jsx("span",{className:"aui-sr-only sr-only",children:r})]})}),e.jsx(ie,{side:a,children:r})]}));xe.displayName="TooltipIconButton";const Tl=()=>e.jsx(Et.MarkdownTextPrimitive,{remarkPlugins:[_n],className:"aui-md",components:Ml}),Rl=m.memo(Tl),Fl=({language:t,code:r})=>{const{isCopied:a,copyToClipboard:s}=_l(),n=()=>{!r||a||s(r)};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(xe,{tooltip:"Copy",onClick:n,children:[!a&&e.jsx(f.CopyIcon,{}),a&&e.jsx(f.CheckIcon,{})]})]})},_l=({copiedDuration:t=3e3}={})=>{const[r,a]=m.useState(!1);return{isCopied:r,copyToClipboard:n=>{n&&navigator.clipboard.writeText(n).then(()=>{a(!0),setTimeout(()=>a(!1),t)})}}},Ml=Et.unstable_memoizeMarkdownComponents({h1:({className:t,...r})=>e.jsx("h1",{className:d("aui-md-h1 mb-8 scroll-m-20 font-extrabold text-4xl tracking-tight last:mb-0",t),...r}),h2:({className:t,...r})=>e.jsx("h2",{className:d("aui-md-h2 mt-8 mb-4 scroll-m-20 font-semibold text-3xl tracking-tight first:mt-0 last:mb-0",t),...r}),h3:({className:t,...r})=>e.jsx("h3",{className:d("aui-md-h3 mt-6 mb-4 scroll-m-20 font-semibold text-2xl tracking-tight first:mt-0 last:mb-0",t),...r}),h4:({className:t,...r})=>e.jsx("h4",{className:d("aui-md-h4 mt-6 mb-4 scroll-m-20 font-semibold text-xl tracking-tight first:mt-0 last:mb-0",t),...r}),h5:({className:t,...r})=>e.jsx("h5",{className:d("aui-md-h5 my-4 font-semibold text-lg first:mt-0 last:mb-0",t),...r}),h6:({className:t,...r})=>e.jsx("h6",{className:d("aui-md-h6 my-4 font-semibold first:mt-0 last:mb-0",t),...r}),p:({className:t,...r})=>e.jsx("p",{className:d("aui-md-p mt-5 mb-5 leading-7 first:mt-0 last:mb-0",t),...r}),a:({className:t,...r})=>e.jsx("a",{className:d("aui-md-a font-medium text-primary underline underline-offset-4",t),...r}),blockquote:({className:t,...r})=>e.jsx("blockquote",{className:d("aui-md-blockquote border-l-2 pl-6 italic",t),...r}),ul:({className:t,...r})=>e.jsx("ul",{className:d("aui-md-ul my-5 ml-6 list-disc [&>li]:mt-2",t),...r}),ol:({className:t,...r})=>e.jsx("ol",{className:d("aui-md-ol my-5 ml-6 list-decimal [&>li]:mt-2",t),...r}),hr:({className:t,...r})=>e.jsx("hr",{className:d("aui-md-hr my-5 border-b",t),...r}),table:({className:t,...r})=>e.jsx("table",{className:d("aui-md-table my-5 w-full border-separate border-spacing-0 overflow-y-auto",t),...r}),th:({className:t,...r})=>e.jsx("th",{className:d("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),...r}),td:({className:t,...r})=>e.jsx("td",{className:d("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),...r}),tr:({className:t,...r})=>e.jsx("tr",{className:d("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),...r}),sup:({className:t,...r})=>e.jsx("sup",{className:d("aui-md-sup [&>a]:text-xs [&>a]:no-underline",t),...r}),pre:({className:t,...r})=>e.jsx("pre",{className:d("aui-md-pre overflow-x-auto rounded-t-none!rounded-b-lg bg-black p-4 text-white",t),...r}),code:function({className:r,...a}){const s=Et.useIsMarkdownCodeBlock();return e.jsx("code",{className:d(!s&&"aui-md-inline-code rounded border bg-muted font-semibold",r),...a})},CodeHeader:Fl}),El=({toolName:t,argsText:r,result:a,status:s})=>{const[n,o]=m.useState(!0),i=s?.type==="incomplete"&&s.reason==="cancelled",l=i&&s.error?typeof s.error=="string"?s.error:JSON.stringify(s.error):null;return e.jsxs("div",{className:d("aui-tool-fallback-root mb-4 flex w-full flex-col gap-3 rounded-lg border py-3",i&&"border-muted-foreground/30 bg-muted/30"),children:[e.jsxs("div",{className:"aui-tool-fallback-header flex items-center gap-2 px-4",children:[i?e.jsx(f.XCircleIcon,{className:"aui-tool-fallback-icon size-4 text-muted-foreground"}):e.jsx(f.CheckIcon,{className:"aui-tool-fallback-icon size-4"}),e.jsxs("p",{className:d("aui-tool-fallback-title grow",i&&"text-muted-foreground line-through"),children:[i?"Cancelled tool: ":"Used tool: ",e.jsx("b",{children:t})]}),e.jsx(T,{onClick:()=>o(!n),children:n?e.jsx(f.ChevronUpIcon,{}):e.jsx(f.ChevronDownIcon,{})})]}),!n&&e.jsxs("div",{className:"aui-tool-fallback-content flex flex-col gap-2 border-t pt-2",children:[l&&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:l})]}),e.jsx("div",{className:d("aui-tool-fallback-args-root px-4",i&&"opacity-60"),children:e.jsx("pre",{className:"aui-tool-fallback-args-value whitespace-pre-wrap",children:r})}),!i&&a!==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 a=="string"?a:JSON.stringify(a,null,2)})]})]})]})},Er=t=>Symbol.iterator in t,zr=t=>"entries"in t,Lr=(t,r)=>{const a=t instanceof Map?t:new Map(t.entries()),s=r instanceof Map?r:new Map(r.entries());if(a.size!==s.size)return!1;for(const[n,o]of a)if(!s.has(n)||!Object.is(o,s.get(n)))return!1;return!0},zl=(t,r)=>{const a=t[Symbol.iterator](),s=r[Symbol.iterator]();let n=a.next(),o=s.next();for(;!n.done&&!o.done;){if(!Object.is(n.value,o.value))return!1;n=a.next(),o=s.next()}return!!n.done&&!!o.done};function Ll(t,r){return Object.is(t,r)?!0:typeof t!="object"||t===null||typeof r!="object"||r===null||Object.getPrototypeOf(t)!==Object.getPrototypeOf(r)?!1:Er(t)&&Er(r)?zr(t)&&zr(r)?Lr(t,r):zl(t,r):Lr({entries:()=>Object.entries(t)},{entries:()=>Object.entries(r)})}function Ol(t){const r=m.useRef(void 0);return a=>{const s=t(a);return Ll(r.current,s)?r.current:r.current=s}}const Bl=t=>{const[r,a]=m.useState(void 0);return m.useEffect(()=>{if(!t){a(void 0);return}const s=URL.createObjectURL(t);return a(s),()=>{URL.revokeObjectURL(s)}},[t]),r},en=()=>{const{file:t,src:r}=F.useAssistantState(Ol(({attachment:a})=>{if(a.type!=="image")return{};if(a.file)return{file:a.file};const s=a.content?.filter(n=>n.type==="image")[0]?.image;return s?{src:s}:{}}));return Bl(t)??r},Ul=({src:t})=>{const[r,a]=m.useState(!1);return e.jsx("img",{src:t,alt:"Image Preview",width:1,height:1,className:r?"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:()=>a(!0),loading:"lazy"})},Vl=({children:t})=>{const r=en();return r?e.jsxs(kt,{children:[e.jsx(Jr,{className:"aui-attachment-preview-trigger cursor-pointer transition-colors hover:bg-accent/50",asChild:!0,children:t}),e.jsxs(It,{className:"aui-attachment-preview-dialog-content p-2 sm:max-w-3xl [&>button]:rounded-full [&>button]:bg-foreground/60 [&>button]:p-1 [&>button]:opacity-100 [&>button]:ring-0! [&_svg]:text-background [&>button]:hover:[&_svg]:text-destructive",children:[e.jsx(At,{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(Ul,{src:r})})]})]}):t},$l=()=>{const t=F.useAssistantState(({attachment:a})=>a.type==="image"),r=en();return e.jsxs(qr,{className:"aui-attachment-tile-avatar h-full w-full rounded-none",children:[e.jsx(Wr,{src:r,alt:"Attachment preview",className:"aui-attachment-tile-image object-cover"}),e.jsx(Hr,{delayMs:t?200:0,children:e.jsx(f.FileText,{className:"aui-attachment-tile-fallback-icon size-8 text-muted-foreground"})})]})},tn=()=>{const r=F.useAssistantApi().attachment.source==="composer",a=F.useAssistantState(({attachment:n})=>n.type==="image"),s=F.useAssistantState(({attachment:n})=>{const o=n.type;switch(o){case"image":return"Image";case"document":return"Document";case"file":return"File";default:{const i=o;throw new Error(`Unknown attachment type: ${i}`)}}});return e.jsxs(ne,{children:[e.jsxs(F.AttachmentPrimitive.Root,{className:d("aui-attachment-root relative",a&&"aui-attachment-root-composer only:[&>#attachment-tile]:size-24"),children:[e.jsx(Vl,{children:e.jsx(oe,{asChild:!0,children:e.jsx("div",{className:d("aui-attachment-tile size-14 cursor-pointer overflow-hidden rounded-[14px] border bg-muted transition-opacity hover:opacity-75",r&&"aui-attachment-tile-composer border-foreground/20"),role:"button",id:"attachment-tile","aria-label":`${s} attachment`,children:e.jsx($l,{})})})}),r&&e.jsx(Gl,{})]}),e.jsx(ie,{side:"top",children:e.jsx(F.AttachmentPrimitive.Name,{})})]})},Gl=()=>e.jsx(F.AttachmentPrimitive.Remove,{asChild:!0,children:e.jsx(xe,{tooltip:"Remove file",className:"aui-attachment-tile-remove absolute top-1.5 right-1.5 size-3.5 rounded-full bg-white text-muted-foreground opacity-100 shadow-sm hover:bg-white! [&_svg]:text-black hover:[&_svg]:text-destructive",side:"top",children:e.jsx(f.XIcon,{className:"aui-attachment-remove-icon size-3 dark:stroke-[2.5px]"})})}),ql=()=>e.jsx("div",{className:"aui-user-message-attachments-end col-span-full col-start-1 row-start-1 flex w-full flex-row justify-end gap-2",children:e.jsx(F.MessagePrimitive.Attachments,{components:{Attachment:tn}})}),Wl=()=>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(F.ComposerPrimitive.Attachments,{components:{Attachment:tn}})}),Hl=()=>e.jsx(F.ComposerPrimitive.AddAttachment,{asChild:!0,children:e.jsx(xe,{tooltip:"Add Attachment",side:"bottom",variant:"ghost",size:"icon",className:"aui-composer-add-attachment size-8.5 rounded-full p-1 font-semibold text-xs hover:bg-muted-foreground/15 dark:border-muted-foreground/15 dark:hover:bg-muted-foreground/30","aria-label":"Add Attachment",children:e.jsx(f.PlusIcon,{className:"aui-attachment-add-icon size-5 stroke-[1.5px]"})})}),Kl=({agents:t,selectedAgent:r,onSelectAgent:a,className:s,triggerClassName:n})=>{const[o,i]=m.useState(!1),l=r||null;return e.jsxs(ge,{open:o,onOpenChange:i,children:[e.jsx(pe,{asChild:!0,children:e.jsxs(T,{variant:"outline",className:d("gap-2 px-3 py-2 text-sm font-medium rounded-2xl",n),children:[e.jsx("span",{className:"truncate",children:l?.agentName||"Select Agent"}),e.jsx(f.ChevronDownIcon,{className:"size-4 shrink-0 opacity-50"})]})}),e.jsx(he,{align:"end",className:d("min-w-[200px]",s),children:t.length>0?e.jsxs(e.Fragment,{children:[e.jsx(Dt,{className:"px-2 py-1.5 text-xs font-semibold text-muted-foreground",children:"Agents"}),e.jsx(nt,{}),e.jsx(xr,{children:t.map(u=>e.jsxs(me,{onClick:()=>{a(u),i(!1)},className:d("cursor-pointer flex flex-col gap-1",l?.agentID===u.agentID&&"bg-accent"),children:[e.jsx("div",{className:"font-medium text-sm",children:u.agentName}),u.agentDescription&&e.jsx("div",{className:"text-xs text-muted-foreground truncate",children:u.agentDescription})]},u.agentID))})]}):e.jsx("div",{className:"px-2 py-1.5 text-sm text-muted-foreground text-center",children:"No agents available"})})]})},Xl=({currentUserDetails:t,agents:r=[],initialAgentId:a="default-agent",initialAgentName:s="Default Agent",onAgentChange:n})=>{const[o,i]=m.useState(r.find(l=>l.agentID===a));return e.jsx(bt.LazyMotion,{features:bt.domAnimation,children:e.jsx(bt.MotionConfig,{reducedMotion:"user",children:e.jsx(F.ThreadPrimitive.Root,{className:"aui-root aui-thread-root @container flex h-full flex-col bg-background",style:{"--thread-max-width":"44rem"},children:e.jsxs(F.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(F.ThreadPrimitive.If,{empty:!0,children:e.jsx(Ql,{currentUserDetails:t})}),e.jsx(F.ThreadPrimitive.Messages,{components:{UserMessage:sc,EditComposer:oc,AssistantMessage:rc}}),e.jsxs(F.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(Yl,{}),e.jsx(Zl,{agents:r,selectedAgent:o,onSelectAgent:l=>{i(l),n?.(l)}})]})]})})})})},Yl=()=>e.jsx(F.ThreadPrimitive.ScrollToBottom,{asChild:!0,children:e.jsx(xe,{tooltip:"Scroll to bottom",variant:"outline",className:"aui-thread-scroll-to-bottom absolute -top-12 z-10 self-center rounded-full p-4 disabled:invisible dark:bg-background dark:hover:bg-accent",children:e.jsx(f.ArrowDownIcon,{})})}),Ql=({currentUserDetails:t})=>{const a=new Date().getHours();let s="";return a>=5&&a<12?s="Good Morning":a>=12&&a<17?s="Good Afternoon":a>=17&&a<21?s="Good Evening":s="Good Night",console.log(s),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(Lt.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:`${s} ${t.userName.split(" ")[0]}`}),e.jsx(Lt.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(Jl,{})]})},Jl=()=>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,r)=>e.jsx(Lt.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},exit:{opacity:0,y:20},transition:{delay:.05*r},className:"aui-thread-welcome-suggestion-display [&:nth-child(n+3)]:hidden @md:[&:nth-child(n+3)]:block",children:e.jsx(F.ThreadPrimitive.Suggestion,{prompt:t.action,send:!0,asChild:!0,children:e.jsxs(T,{variant:"ghost",className:"aui-thread-welcome-suggestion h-auto w-full flex-1 flex-wrap items-start justify-start gap-1 rounded-3xl border px-5 py-4 text-left text-sm @md:flex-col dark:hover:bg-accent/60","aria-label":t.action,children:[e.jsx("span",{className:"aui-thread-welcome-suggestion-text-1 font-medium",children:t.title}),e.jsx("span",{className:"aui-thread-welcome-suggestion-text-2 text-muted-foreground",children:t.label})]})})},`suggested-action-${t.title}-${r}`))}),Zl=({agents:t=[],selectedAgent:r,onSelectAgent:a})=>e.jsx(F.ComposerPrimitive.Root,{className:"aui-composer-root relative flex w-full flex-col",children:e.jsxs(F.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(Wl,{}),e.jsx(F.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(ec,{agents:t,selectedAgent:r,onSelectAgent:a})]})}),ec=({agents:t=[],selectedAgent:r,onSelectAgent:a})=>e.jsxs("div",{className:"aui-composer-action-wrapper relative mx-1 mt-2 mb-2 flex items-center justify-between",children:[e.jsx(Hl,{}),e.jsxs("div",{className:"flex gap-3",children:[t.length>0&&e.jsx(Kl,{agents:t,selectedAgent:r,onSelectAgent:a??(()=>{}),triggerClassName:"h-9 text-xs"}),e.jsx(F.ThreadPrimitive.If,{running:!1,children:e.jsx(F.ComposerPrimitive.Send,{asChild:!0,children:e.jsx(xe,{tooltip:"Send message",side:"bottom",type:"submit",variant:"default",size:"icon",className:"aui-composer-send size-[34px] rounded-full p-1","aria-label":"Send message",children:e.jsx(f.ArrowUpIcon,{className:"aui-composer-send-icon size-5"})})})}),e.jsx(F.ThreadPrimitive.If,{running:!0,children:e.jsx(F.ComposerPrimitive.Cancel,{asChild:!0,children:e.jsx(T,{type:"button",variant:"default",size:"icon",className:"aui-composer-cancel size-[34px] rounded-full border border-muted-foreground/60 hover:bg-primary/75 dark:border-muted-foreground/90","aria-label":"Stop generating",children:e.jsx(f.Square,{className:"aui-composer-cancel-icon size-3.5 fill-white dark:fill-black"})})})})]})]}),tc=()=>e.jsx(F.MessagePrimitive.Error,{children:e.jsx(F.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(F.ErrorPrimitive.Message,{className:"aui-message-error-message line-clamp-2"})})}),rc=()=>e.jsxs(F.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(F.MessagePrimitive.Parts,{components:{Text:Rl,tools:{Fallback:El}}}),e.jsx(tc,{})]}),e.jsxs("div",{className:"aui-assistant-message-footer mt-2 ml-2 flex",children:[e.jsx(rn,{}),e.jsx(ac,{})]})]}),ac=()=>e.jsxs(F.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(F.ActionBarPrimitive.Copy,{asChild:!0,children:e.jsxs(xe,{tooltip:"Copy",children:[e.jsx(F.MessagePrimitive.If,{copied:!0,children:e.jsx(f.CheckIcon,{})}),e.jsx(F.MessagePrimitive.If,{copied:!1,children:e.jsx(f.CopyIcon,{})})]})}),e.jsx(F.ActionBarPrimitive.Reload,{asChild:!0,children:e.jsx(xe,{tooltip:"Refresh",children:e.jsx(f.RefreshCwIcon,{})})})]}),sc=()=>e.jsxs(F.MessagePrimitive.Root,{className:"aui-user-message-root mx-auto grid w-full max-w-[var(--thread-max-width)] animate-in auto-rows-auto grid-cols-[minmax(72px,1fr)_auto] content-start gap-y-2 px-2 py-4 duration-150 ease-out fade-in slide-in-from-bottom-1 [&:where(>*)]:col-start-2","data-role":"user",children:[e.jsx(ql,{}),e.jsxs("div",{className:"aui-user-message-content-wrapper relative col-start-2 min-w-0",children:[e.jsx("div",{className:"aui-user-message-content rounded-3xl bg-muted px-5 py-2.5 break-words text-foreground",children:e.jsx(F.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(nc,{})})]}),e.jsx(rn,{className:"aui-user-branch-picker col-span-full col-start-1 row-start-3 -mr-1 justify-end"})]}),nc=()=>e.jsx(F.ActionBarPrimitive.Root,{hideWhenRunning:!0,autohide:"not-last",className:"aui-user-action-bar-root flex flex-col items-end",children:e.jsx(F.ActionBarPrimitive.Edit,{asChild:!0,children:e.jsx(xe,{tooltip:"Edit",className:"aui-user-action-edit p-4",children:e.jsx(f.PencilIcon,{})})})}),oc=()=>e.jsx(F.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(F.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(F.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(F.ComposerPrimitive.Cancel,{asChild:!0,children:e.jsx(T,{variant:"ghost",size:"sm","aria-label":"Cancel edit",children:"Cancel"})}),e.jsx(F.ComposerPrimitive.Send,{asChild:!0,children:e.jsx(T,{size:"sm","aria-label":"Update message",children:"Update"})})]})]})}),rn=({className:t,...r})=>e.jsxs(F.BranchPickerPrimitive.Root,{hideWhenSingleBranch:!0,className:d("aui-branch-picker-root mr-2 -ml-2 inline-flex items-center text-xs text-muted-foreground",t),...r,children:[e.jsx(F.BranchPickerPrimitive.Previous,{asChild:!0,children:e.jsx(xe,{tooltip:"Previous",children:e.jsx(f.ChevronLeftIcon,{})})}),e.jsxs("span",{className:"aui-branch-picker-state font-medium",children:[e.jsx(F.BranchPickerPrimitive.Number,{})," / ",e.jsx(F.BranchPickerPrimitive.Count,{})]}),e.jsx(F.BranchPickerPrimitive.Next,{asChild:!0,children:e.jsx(xe,{tooltip:"Next",children:e.jsx(f.ChevronRightIcon,{})})})]});class ic{agentConfig;baseUrl;chatIdMap=new Map;constructor(r){this.agentConfig=r,this.baseUrl=r.baseUrl||""}updateAgentConfig(r){this.agentConfig={...this.agentConfig,...r}}getChatId(r){return this.chatIdMap.has(r)?this.chatIdMap.get(r):Dr.v4()}async sendMessages(r){const{messages:a,chatId:s,abortSignal:n,headers:o,body:i}=r;console.log("sendMessages called with chatId:",s,"trigger:",r.trigger);const l=this.getChatId(s);console.log("Using server chatId:",l);const c={messages:a.map(w=>{const N=w.parts.filter(v=>v.type==="text").map(v=>v.text).join("");return{role:w.role,content:w.role==="user"&&this.agentConfig.additionalReferenceInfo&&Object.keys(this.agentConfig.additionalReferenceInfo).length>0?N+JSON.stringify(this.agentConfig.additionalReferenceInfo):N}}),provider:this.agentConfig.provider,model:this.agentConfig.model,agentId:this.agentConfig.agentId,agentName:this.agentConfig.agentName,temperature:this.agentConfig.temperature??.7,maxTokens:this.agentConfig.maxTokens??2048,stream:!0,useVoice:!1,...i},g={"Content-Type":"application/json",Authorization:`Bearer ${await ut()}`,...o instanceof Headers?Object.fromEntries(o.entries()):o||{}};try{const w=await fetch(`${this.baseUrl}/api/chat/completions/${l}`,{method:"POST",headers:g,body:JSON.stringify(c),signal:n,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(r){return null}processResponseStream(r){const a=new TextDecoder;let s="",n=null,o=!1,i=[],l=!1,u="",c=!1,x="";return new ReadableStream({async start(g){n=r.getReader()},async pull(g){if(!(!n||o)){if(i.length>0){g.enqueue(i.shift());return}try{const{done:w,value:N}=await n.read();if(w){if(l&&u)for(c&&x&&i.push({type:"text-end",id:x}),i.push({type:"finish",finishReason:"stop"});i.length>0;)g.enqueue(i.shift());o||(o=!0,g.close());return}s+=a.decode(N,{stream:!0});const v=s.split(`
6
+ `);s=v.pop()||"";for(const C of v){const b=C.trim();if(b&&b.startsWith("data:")){const k=b.slice(5).trim();if(!k)continue;try{const p=JSON.parse(k);if(o)return;p.id&&!u&&(u=p.id,l=!0,i.push({type:"start"}));let A=null;if(p.type==="ai"){const j=p.messages?.[0];j?.content&&(x||(x=Dr.v4()),c||(c=!0,i.push({type:"text-start",id:x})),A={type:"text-delta",delta:j.content,id:x})}else if(p.type==="tool"){const j=p.toolCall;j&&(A={type:"tool-input-available",toolCallId:j.callId,toolName:j.name,input:j.result})}A&&i.push(A)}catch{}}}i.length>0&&g.enqueue(i.shift())}catch(w){o||(o=!0,g.error(w))}}},cancel(){o=!0,i=[],n&&(n.releaseLock(),n=null)}})}}const lc=({provider:t="openai",model:r="gpt-4o-mini",agentId:a="default-agent",agentName:s="Default Agent",temperature:n=.7,maxTokens:o=2048,className:i,baseUrl:l="http://localhost:3000",additionalReferenceInfo:u={},appId:c="",currentUserDetails:x})=>{const[g,w]=m.useState([]),[N,v]=m.useState(),C=m.useMemo(()=>new ic({provider:t,model:r,agentId:N?N.agentID:a,agentName:N?N.agentName:s,temperature:n,maxTokens:o,baseUrl:l,additionalReferenceInfo:u}),[t,r,N,a,s,n,o,l,u]),b=Mn.useChatRuntime({transport:C}),k=async()=>{try{const A=await ut(),j=await fetch(`${l}/api/agent/${c}`,{method:"GET",headers:{"Content-Type":"application/json",Authorization:`Bearer ${A}`}});if(!j.ok)throw new Error(`HTTP error! status: ${j.status}`);const h=await j.json();console.log("Agent Data:",h),w(h)}catch(A){console.error("Error while fetching agents with the specific appId",A)}};m.useEffect(()=>{k()},[c,l]);const p=A=>{v(A),console.log("Agent changed to:",A.agentName)};return e.jsx(F.AssistantRuntimeProvider,{runtime:b,children:e.jsx("div",{className:i,children:e.jsx("div",{className:`flex flex-col h-full border rounded-lg overflow-hidden ${i}`,children:e.jsx(Xl,{currentUserDetails:x,agents:g,initialAgentId:a,initialAgentName:s,onAgentChange:p})})})})};function cc(){const t=ae.useNavigate(),{pathname:r}=ae.useLocation(),[a]=ae.useSearchParams(),[s,n]=m.useState(a.get("search")||""),[o]=zn.useDebounce(s,500);return m.useEffect(()=>{const i=new URLSearchParams(a.toString());o?i.set("search",o):i.delete("search"),i.get("search")!==a.get("search")&&(i.set("page","1"),t(`${r}?${i.toString()}`,{replace:!0}))},[o,r,t,a]),m.useEffect(()=>{const i=a.get("search")||"";i!==s&&n(i)},[a]),e.jsxs("div",{className:"relative max-w-sm min-w-[10%]",children:[e.jsx(f.Search,{className:"absolute left-2.5 top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground"}),e.jsx("input",{type:"text",placeholder:"Search ...",value:s,onChange:i=>n(i.target.value),className:"flex h-9 w-full rounded-md border border-border bg-transparent pl-9 pr-3 py-1 text-sm shadow-sm transition-colors text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-primary"})]})}function dc(){const t=ae.useNavigate(),{pathname:r}=ae.useLocation(),[a]=ae.useSearchParams(),s=a.get("size")||"10",n=o=>{const i=new URLSearchParams(a.toString());i.set("size",o.target.value),i.set("page","1"),t(`${r}?${i.toString()}`)};return e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"text-sm text-muted-foreground",children:"Rows per page:"}),e.jsxs("select",{className:"h-9 rounded-md border border-border bg-background text-foreground px-2 py-1 text-sm focus:outline-none focus:ring-2 focus:ring-primary",value:s,onChange:n,children:[e.jsx("option",{value:"10",children:"10"}),e.jsx("option",{value:"20",children:"20"}),e.jsx("option",{value:"50",children:"50"}),e.jsx("option",{value:"100",children:"100"})]})]})}function uc({totalPages:t,currentPage:r}){const a=ae.useNavigate(),{pathname:s}=ae.useLocation(),[n]=ae.useSearchParams(),o=i=>{const l=new URLSearchParams(n.toString());l.set("page",i.toString()),a(`${s}?${l.toString()}`)};return e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx("button",{type:"button",onClick:()=>o(r-1),disabled:r<=1,className:"h-9 px-3 py-1 text-sm font-medium border border-border rounded-md bg-background text-foreground hover:bg-muted disabled:opacity-50 disabled:cursor-not-allowed transition-colors",children:"Previous"}),e.jsxs("span",{className:"text-sm text-muted-foreground px-2",children:["Page ",e.jsx("span",{className:"font-semibold",children:r})," of"," ",e.jsx("span",{className:"font-semibold",children:Math.max(t??1,1)})]}),e.jsx("button",{type:"button",onClick:()=>o(r+1),disabled:t===void 0?void 0:r>=t,className:"h-9 px-3 py-1 text-sm font-medium border border-border rounded-md bg-background text-foreground hover:bg-muted disabled:opacity-50 disabled:cursor-not-allowed transition-colors",children:"Next"})]})}function mc({table:t}){const[r,a]=m.useState(!1),[s,n]=m.useState(""),o=m.useRef(null),i=t.getState().columnFilters,u=t.getAllLeafColumns().filter(c=>c.getCanFilter()).filter(c=>c.id.toLowerCase().includes(s.toLowerCase()));return m.useEffect(()=>{const c=x=>{o.current&&!o.current.contains(x.target)&&a(!1)};return document.addEventListener("mousedown",c),()=>document.removeEventListener("mousedown",c)},[]),e.jsx("div",{className:"flex items-center gap-3 ",children:e.jsxs(ge,{children:[e.jsx(pe,{asChild:!0,children:e.jsxs(T,{variant:"outline",size:"sm",className:" gap-2",children:[e.jsx(f.ListFilter,{className:"w-4 h-4"}),"Filter"]})}),e.jsxs(he,{align:"end",className:"w-64 p-2",children:[e.jsx(Dt,{className:"text-center",children:"Filter"}),e.jsxs("div",{className:"p-2",children:[e.jsxs("div",{className:"relative mb-2",children:[e.jsx(f.Search,{className:"absolute left-2 top-2.5 h-3.5 w-3.5 text-muted-foreground"}),e.jsx(Cr,{placeholder:"Search columns...",value:s,onChange:c=>n(c.target.value)})]}),e.jsx("div",{className:"max-h-50 overflow-auto space-y-1 scroll-m-1",children:u.map(c=>{const x=i.some(g=>g.id===c.id);return e.jsxs("div",{className:"flex items-center space-x-2 p-2 hover:bg-muted rounded-sm transition-colors cursor-pointer",children:[e.jsx(Ve,{id:c.id,checked:x,onCheckedChange:g=>{g?c.setFilterValue([]):c.setFilterValue(void 0)}}),e.jsx("label",{htmlFor:c.id,className:"text-sm font-medium leading-none cursor-pointer flex-1",children:typeof c.columnDef.header=="string"?c.columnDef.header:c.id})]},c.id)})})]}),e.jsx(nt,{}),e.jsx("div",{className:"flex gap-2 p-1",children:e.jsxs(T,{size:"sm",className:"flex-1 h-8",onClick:()=>t.resetColumnFilters(),children:[e.jsx(f.RotateCcw,{className:"mr-2 h-3 w-3"})," Reset"]})})]})]})})}function xc({activeFilters:t,table:r}){return e.jsx("div",{className:"flex flex-wrap gap-2 min-w-max max-w-[70%] overflow-y-auto",children:t.map(a=>e.jsx(fc,{filter:a,table:r},a.id))})}function fc({filter:t,table:r}){debugger;const[a,s]=m.useState(!1),[n,o]=m.useState(t.value||[]),i=m.useRef(null),l=r.getColumn(t.id);m.useEffect(()=>{o(t.value||[])},[t.value]);const u=m.useMemo(()=>{const g=new Set;return r.getPreFilteredRowModel().flatRows.forEach(w=>{const N=w.getValue(t.id);N!=null&&g.add(N)}),Array.from(g).sort()},[r.getPreFilteredRowModel().flatRows,t.id]);m.useEffect(()=>{const g=w=>{i.current&&!i.current.contains(w.target)&&s(!1)};return document.addEventListener("mousedown",g),()=>document.removeEventListener("mousedown",g)},[]);const c=()=>{l.setFilterValue(n.length>0?n:void 0),s(!1)},x=()=>{o([]),l.setFilterValue(void 0),s(!1)};return e.jsxs("div",{className:"flex items-center gap-1 ",ref:i,children:[e.jsxs(ge,{children:[e.jsx(pe,{asChild:!0,children:e.jsxs(T,{variant:"outline",size:"sm",className:"h-7 rounded-full px-3 text-xs border border-dashed",children:[e.jsxs("span",{className:"font-bold uppercase text-muted-foreground mr-1",children:[typeof l.columnDef.header=="string"?l.columnDef.header:t.id,":"]}),e.jsx("span",{className:"text-primary font-semibold",children:t.value?.length?`${t.value.length} Selected`:"All"}),e.jsx(f.ChevronDown,{className:"ml-1 h-3 w-3 opacity-50"})]})}),e.jsxs(he,{className:"w-56 p-0",align:"start",children:[e.jsx("div",{className:"p-2 max-h-48 overflow-y-auto",children:u.map(g=>e.jsxs("div",{className:"flex items-center space-x-2 p-2 hover:bg-muted rounded-sm transition-colors cursor-pointer",children:[e.jsx(Ve,{id:`${t.id}-${g}`,checked:n.includes(g),onCheckedChange:w=>{o(N=>w?[...N,g]:N.filter(v=>v!==g))}}),e.jsx("label",{htmlFor:`${t.id}-${g}`,className:"text-xs flex-1 truncate cursor-pointer",children:String(g).trim()===""?"N/A":String(g)})]},g))}),e.jsxs("div",{className:"p-2 border-t bg-muted/50 flex gap-2",children:[e.jsx(T,{size:"sm",className:"flex-1 h-7 text-[10px]",onClick:()=>c(),children:"Apply"}),e.jsx(T,{size:"sm",variant:"outline",className:"flex-1 h-7 text-[10px]",onClick:()=>{x()},children:"Clear"})]})]})]}),e.jsx(T,{variant:"ghost",size:"icon",className:"h-6 w-6 rounded-full hover:text-destructive",onClick:()=>l.setFilterValue(void 0),children:e.jsx(f.X,{className:"h-3 w-3"})})]})}function gc({table:t}){const[r,a]=m.useState(!1),s=m.useRef(null);return m.useEffect(()=>{function n(o){s.current&&!s.current.contains(o.target)&&a(!1)}return document.addEventListener("mousedown",n),()=>document.removeEventListener("mousedown",n)},[]),e.jsxs("div",{className:"relative",ref:s,children:[e.jsxs("button",{type:"button",className:`flex items-center gap-2 px-3 h-9 border rounded-md bg-background transition-colors text-sm font-medium ${r?"border-primary bg-muted":"border-border hover:bg-muted"}`,onClick:()=>a(!r),children:[e.jsx(f.Settings2,{className:"w-4 h-4"}),"Columns"]}),r&&e.jsxs("div",{className:"absolute right-0 mt-2 w-56 z-50 bg-background border border-border rounded-md shadow-lg p-2 animate-in fade-in zoom-in duration-100",children:[e.jsx("div",{className:"px-2 py-1.5 text-xs font-semibold text-muted-foreground border-b mb-1",children:"Toggle Columns"}),e.jsx("div",{className:"max-h-64 overflow-y-auto",children:t.getAllLeafColumns().map(n=>n.getCanHide()?e.jsxs("label",{className:"flex items-center gap-2 px-2 py-1.5 hover:bg-muted rounded cursor-pointer text-sm capitalize",children:[e.jsx("input",{type:"checkbox",checked:n.getIsVisible(),onChange:n.getToggleVisibilityHandler(),className:"h-4 w-4 rounded border-gray-300 text-primary focus:ring-primary"}),e.jsx("span",{className:"truncate",children:typeof n.columnDef.header=="string"?n.columnDef.header:n.id})]},n.id):null)}),e.jsx("div",{className:"border-t mt-1 pt-1",children:e.jsx("button",{type:"button",onClick:()=>t.toggleAllColumnsVisible(!0),className:"w-full text-left px-2 py-1.5 text-xs hover:bg-muted hover:text-primary rounded",children:"Show All"})})]})]})}function pc({data:t,columns:r,extraTools:a}){const[s,n]=m.useState("list"),o=ae.useNavigate(),{pathname:i}=ae.useLocation(),[l]=ae.useSearchParams(),u=Number(l.get("page")||"1")-1,[c,x]=m.useState({pageIndex:0,pageSize:10}),[g,w]=m.useState(""),[N,v]=m.useState([]),[C,b]=m.useState([]),[k,p]=m.useState({}),[A,j]=m.useState({}),[h,D]=m.useState({}),[P,R]=m.useState([]),E=a?.hiddenColumns||[];for(const y of r)y.filterFn===void 0&&(y.filterFns="multiSelect"),y.draggable===void 0&&(y.draggable=!0);const M=z.useReactTable({data:t,columns:r,pageCount:a?.totalPages,meta:{footerLabel:a?.footerLabel},state:{pagination:c,globalFilter:g,sorting:N,grouping:C,expanded:k,rowSelection:A,columnVisibility:h,columnFilters:P},onSortingChange:v,onGroupingChange:b,onExpandedChange:p,onRowSelectionChange:j,onGlobalFilterChange:w,onPaginationChange:x,onColumnVisibilityChange:D,onColumnFiltersChange:R,manualPagination:!1,manualFiltering:!1,getCoreRowModel:z.getCoreRowModel(),getPaginationRowModel:z.getPaginationRowModel(),getSortedRowModel:z.getSortedRowModel(),getFilteredRowModel:z.getFilteredRowModel(),getGroupedRowModel:z.getGroupedRowModel(),getExpandedRowModel:z.getExpandedRowModel(),filterFns:{multiSelect:(y,I,B)=>{debugger;return B.length?B.includes(String(y.getValue(I))):!0}}});m.useEffect(()=>{debugger;M.getAllLeafColumns().map(y=>{E?.includes(y.id)&&y.toggleVisibility(!1)})},[E,M]);const ue=(y,I)=>{y.dataTransfer.setData("headerId",I)},Pe=y=>{debugger;y.preventDefault();const I=y.dataTransfer.getData("headerId");I&&!C.includes(I)&&M.getColumn(I)?.getCanGroup()&&M.getColumn(I)?.toggleGrouping()};m.useEffect(()=>{debugger;M.setGlobalFilter(l.get("search")||"")},[l,o,i]),m.useEffect(()=>{M.setPageSize(Number(l.get("size")||"10")),M.setPageIndex(Number(l.get("page")||"1")-1)},[l,o,i]);const Se=()=>{const y=M.getVisibleLeafColumns().filter(ee=>ee.id!=="select"&&ee.id!=="actions"),I=(ee,Re=0)=>ee.flatMap(G=>{if(G.getIsGrouped()){const Ge=String(G.id.replaceAll(`${y[0].id}:`,"")).trim()===""||G.id.replaceAll(`${G.parentId?`${G.parentId}>`:""}`,"").replaceAll(`${G.groupingColumnId}>`,"").replaceAll(`${y[0].id}:`,"").trim()===void 0?"N/A":G.id.replaceAll(`${G.parentId?`${G.parentId}>`:""}`,"").replaceAll(`${y[0].id}:`,"").trim();return[{[y[0].id]:`${" ".repeat(Re)} ${Ge} (${G.subRows.length})`},...I(G.subRows,Re+1)]}else{let Ge={};return y.forEach(mt=>{const xt=G.getValue(mt.id);Ge[mt.id]=mt.id===y[0].id||xt==="Actions"||xt==="actions"?" ":xt===void 0?"N/A":xt}),[Ge]}}),B=M.getState().grouping.length>0?I(M.getGroupedRowModel().rows):M.getFilteredRowModel().rows.map(ee=>{let Re={};return y.forEach(G=>Re[G.id]=ee.getValue(G.id)),Re}),_=gt.utils.json_to_sheet(B),O=y.map(ee=>{const Re=typeof ee.columnDef.header=="string"?ee.columnDef.header:ee.id;return{wch:Math.max(Re.length,...B.map(Ge=>String(Ge[Re]).length))+3}});_["!cols"]=O;const Te=gt.utils.book_new();gt.utils.book_append_sheet(Te,_,"Data"),gt.writeFile(Te,`${a?.fileName}.xlsx`)};return e.jsxs("div",{className:"space-y-2",children:[e.jsxs("div",{className:"flex items-center justify-between gap-2",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(cc,{}),e.jsx(xc,{activeFilters:M.getState().columnFilters,table:M})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[a?.actionNode&&a?.actionNode,e.jsx(gc,{table:M}),e.jsx(mc,{table:M}),e.jsx(T,{variant:"outline",size:"sm",className:" gap-2",onClick:()=>Se(),children:e.jsx(f.Download,{className:"w-4 h-4"})}),a?.toggleViewMode&&e.jsxs("div",{className:"flex items-center border border-border rounded-md bg-background overflow-hidden h-9",children:[e.jsx("button",{onClick:()=>n("list"),className:`px-2.5 h-full flex items-center justify-center transition-colors ${s==="list"?"bg-muted text-foreground":"text-muted-foreground hover:bg-muted/50"}`,title:"List View",children:e.jsx(f.List,{className:"w-4 h-4"})}),e.jsx("button",{onClick:()=>n("grid"),className:`px-2.5 h-full flex items-center justify-center transition-colors ${s==="grid"?"bg-muted text-foreground":"text-muted-foreground hover:bg-muted/50"}`,title:"Grid View",children:e.jsx(f.LayoutGrid,{className:"w-4 h-4"})})]})]})]}),s==="list"?e.jsxs(e.Fragment,{children:[e.jsx("div",{onDragOver:y=>y.preventDefault(),onDrop:Pe,className:"w-full border border-dashed rounded-md h-10 p-2 flex gap-2 items-center text-sm bg-muted/20 ",children:C.length===0?e.jsx("span",{className:"text-muted-foreground",children:"Drag a column header here to group"}):C.map(y=>e.jsxs("div",{className:"flex items-center gap-1 bg-background border px-2 py-1 rounded shadow-sm",children:[y,e.jsx(f.X,{size:14,className:"cursor-pointer",onClick:()=>M.getColumn(y)?.toggleGrouping()})]},y))}),e.jsx("div",{className:"rounded-md border border-border bg-background overflow-x-auto",children:e.jsxs("table",{className:"w-full text-sm",children:[e.jsx("thead",{className:"bg-muted/50 border-b border-border sticky top-0",children:M.getHeaderGroups().map(y=>e.jsx("tr",{children:y.headers.map(I=>e.jsx("th",{className:"px-4 py-3 text-left font-medium cursor-pointer select-none",draggable:!0,onDragStart:B=>ue(B,I.id),children:e.jsxs("div",{className:"flex items-center gap-2",onClick:I.column.getToggleSortingHandler(),children:[z.flexRender(I.column.columnDef.header,I.getContext()),{asc:e.jsx(f.ChevronUp,{size:14}),desc:e.jsx(f.ChevronDown,{size:14})}[I.column.getIsSorted()]??null]})},I.id))},y.id))}),e.jsx("tbody",{className:"divide-y divide-border",children:M.getRowModel().rows.map(y=>e.jsx("tr",{className:`hover:bg-muted/30 transition-colors ${y.getIsSelected()?"bg-accent/20":""}`,children:y.getVisibleCells().map(I=>e.jsx("td",{className:"px-4 py-3",children:I.getIsGrouped()?e.jsxs("button",{onClick:y.getToggleExpandedHandler(),className:"flex items-center gap-2 font-semibold",children:[y.getIsExpanded()?e.jsx(f.ChevronDown,{size:16}):e.jsx(f.ChevronRight,{size:16}),z.flexRender(I.column.columnDef.cell,I.getContext())," (",y.subRows.length,")"]}):I.getIsAggregated()?z.flexRender(I.column.columnDef.aggregatedCell??I.column.columnDef.cell,I.getContext()):I.getIsPlaceholder()?null:z.flexRender(I.column.columnDef.cell,I.getContext())},I.id))},y.id))}),a?.showFooter&&e.jsx("tfoot",{className:"bg-muted/30 border-t-2 border-border font-bold",children:M.getFooterGroups().map(y=>e.jsx("tr",{children:y.headers.map(I=>e.jsx("td",{className:"px-4 py-3 text-left",children:I.isPlaceholder?null:z.flexRender(I.column.columnDef.footer,I.getContext())},I.id))},y.id))})]})}),e.jsxs("div",{className:"flex items-center justify-between pt-2 border-t border-border",children:[e.jsx(dc,{}),e.jsx(uc,{totalPages:a?.totalPages,currentPage:u+1})]})]}):a?.gridComponent?a.gridComponent(t):e.jsx("div",{className:"p-12 text-center text-muted-foreground border border-border border-dashed rounded-md bg-muted/20",children:"Grid view not implemented for this component yet."})]})}function hc({data:t,columns:r,extraTools:a}){return e.jsx("div",{className:"space-y-6",children:e.jsxs("div",{className:"relative min-h-[300px]",children:[e.jsx(Cs,{isLoading:a?.isLoading,onReload:a?.onReload||(()=>window.location.reload())}),e.jsx("div",{className:`transition-all duration-300 ${a?.isLoading?"opacity-50 pointer-events-none":""}`,children:e.jsx(pc,{data:t,columns:r,extraTools:a})})]})})}exports.Accordion=Gn;exports.AccordionContent=Hn;exports.AccordionItem=qn;exports.AccordionTrigger=Wn;exports.ActionMenu=Qt;exports.ActivitySheet=Nl;exports.Alert=Xn;exports.AlertDescription=Qn;exports.AlertDialog=ar;exports.AlertDialogAction=wt;exports.AlertDialogCancel=ur;exports.AlertDialogContent=or;exports.AlertDialogDescription=dr;exports.AlertDialogFooter=lr;exports.AlertDialogHeader=ir;exports.AlertDialogOverlay=nr;exports.AlertDialogPortal=sr;exports.AlertDialogTitle=cr;exports.AlertDialogTrigger=Gr;exports.AlertTitle=Yn;exports.AppBreadcrumb=Ts;exports.AppSidebar=Es;exports.AspectRatio=qt;exports.AssistantComponent=lc;exports.Avatar=qr;exports.AvatarFallback=Hr;exports.AvatarImage=Wr;exports.Badge=tt;exports.BigCalendar=$i;exports.Breadcrumb=Ga;exports.BreadcrumbEllipsis=Ht;exports.BreadcrumbItem=We;exports.BreadcrumbLink=Wt;exports.BreadcrumbList=qa;exports.BreadcrumbPage=Ze;exports.BreadcrumbProvider=Ps;exports.BreadcrumbSeparator=vt;exports.Button=T;exports.Calendar=Xr;exports.CalendarDayButton=Yr;exports.Card=Nt;exports.CardAction=to;exports.CardContent=Qr;exports.CardDescription=eo;exports.CardFooter=ro;exports.CardHeader=Jn;exports.CardTitle=Zn;exports.Checkbox=Ve;exports.Collapsible=Kt;exports.CollapsibleContent=Yt;exports.CollapsibleTrigger=Xt;exports.ComboboxInput=wi;exports.Command=Y;exports.CommandDialog=so;exports.CommandEmpty=de;exports.CommandGroup=se;exports.CommandInput=le;exports.CommandItem=X;exports.CommandList=ce;exports.CommandSeparator=aa;exports.CommandShortcut=no;exports.CropperForm=Ys;exports.CropperFormWithModal=Qs;exports.CustomAlertDialog=gs;exports.CustomComboboxInput=Pl;exports.CustomTabs=Is;exports.DataTable=Si;exports.DataTableColumnFilter=bs;exports.DataTableFacetedFilter=vs;exports.DataTableFilterMenu=js;exports.DataTableLayout=hc;exports.DataTablePagination=Ns;exports.DataTableToolbar=ys;exports.Dialog=kt;exports.DialogClose=ao;exports.DialogContent=It;exports.DialogDescription=ra;exports.DialogFooter=ta;exports.DialogHeader=mr;exports.DialogOverlay=ea;exports.DialogPortal=Zr;exports.DialogProvider=hs;exports.DialogTitle=At;exports.DialogTrigger=Jr;exports.Drawer=Ja;exports.DrawerClose=ts;exports.DrawerContent=as;exports.DrawerDescription=is;exports.DrawerFooter=ns;exports.DrawerHeader=ss;exports.DrawerOverlay=rs;exports.DrawerPortal=es;exports.DrawerTitle=os;exports.DrawerTrigger=Za;exports.DropdownMenu=ge;exports.DropdownMenuCheckboxItem=oo;exports.DropdownMenuContent=he;exports.DropdownMenuGroup=xr;exports.DropdownMenuItem=me;exports.DropdownMenuLabel=Dt;exports.DropdownMenuPortal=sa;exports.DropdownMenuRadioGroup=io;exports.DropdownMenuRadioItem=lo;exports.DropdownMenuSeparator=nt;exports.DropdownMenuShortcut=co;exports.DropdownMenuSub=na;exports.DropdownMenuSubContent=ia;exports.DropdownMenuSubTrigger=oa;exports.DropdownMenuTrigger=pe;exports.EChart=Ii;exports.FileInput=Ss;exports.FileUploader=yi;exports.FontProvider=qs;exports.Footer=zs;exports.Form=ls;exports.FormComboboxInput=Wi;exports.FormComboboxInputWithValue=Hi;exports.FormControl=je;exports.FormDateInput=Ki;exports.FormDescription=Ce;exports.FormField=be;exports.FormFileInput=Xi;exports.FormInput=Yi;exports.FormItem=ve;exports.FormLabel=ye;exports.FormMessage=we;exports.FormMultiComboboxInput=Qi;exports.FormOtpInput=Ji;exports.FormPasswordInput=tl;exports.FormPhoneInput=Zi;exports.FormTextarea=el;exports.FrameworkItemDropdown=zi;exports.GlowingEffect=Ai;exports.GradeTableLoader=rl;exports.Header=Ls;exports.HoverCard=uo;exports.HoverCardContent=xo;exports.HoverCardTrigger=mo;exports.Icon=yt;exports.IconButton=fs;exports.IconButtonWithTooltip=Fe;exports.IconTextButton=ct;exports.IconTextButtonWithTooltip=xs;exports.ImageCropper=Xs;exports.ImageCropperProvider=kl;exports.Input=H;exports.InputOTP=wr;exports.InputOTPGroup=Nr;exports.InputOTPSeparator=us;exports.InputOTPSlot=He;exports.Label=ke;exports.LoadingSpinner=Di;exports.MainLayout=$s;exports.MainSidebar=Vs;exports.MultiCombobox=Pi;exports.NavMain=_s;exports.NavigationMenu=fo;exports.NavigationMenuContent=bo;exports.NavigationMenuIndicator=jo;exports.NavigationMenuItem=po;exports.NavigationMenuLink=vo;exports.NavigationMenuList=go;exports.NavigationMenuTrigger=ho;exports.NavigationMenuViewport=ca;exports.NewCropperImg=Zs;exports.NewImageForm=Al;exports.NoDataComponent=Sr;exports.PageWrapper=Ti;exports.PasswordStrengthMeter=Ri;exports.PhoneInput=Fi;exports.Popover=Q;exports.PopoverAnchor=wo;exports.PopoverContent=Z;exports.PopoverTrigger=J;exports.Progress=Pt;exports.ProviderWrapper=wl;exports.RadioGroup=No;exports.RadioGroupItem=yo;exports.RadiusProvider=Hs;exports.Reload=Cs;exports.RenderAppBreadcrumb=Gi;exports.RenderSidebarNav=qi;exports.ScrollArea=Co;exports.ScrollBar=da;exports.SearchInput=Cr;exports.Select=ua;exports.SelectContent=fa;exports.SelectGroup=So;exports.SelectItem=ga;exports.SelectLabel=ko;exports.SelectScrollDownButton=ha;exports.SelectScrollUpButton=pa;exports.SelectSeparator=Io;exports.SelectTrigger=xa;exports.SelectValue=ma;exports.Separator=Tt;exports.Sheet=fr;exports.SheetClose=Ao;exports.SheetComponent=ks;exports.SheetContent=gr;exports.SheetDescription=ja;exports.SheetFooter=To;exports.SheetHeader=va;exports.SheetTitle=pr;exports.SheetTrigger=ba;exports.Sidebar=ya;exports.SidebarContent=Da;exports.SidebarFooter=Aa;exports.SidebarGroup=Pa;exports.SidebarGroupAction=Uo;exports.SidebarGroupContent=Vo;exports.SidebarGroupLabel=Bo;exports.SidebarHeader=Ia;exports.SidebarInput=Lo;exports.SidebarInset=ka;exports.SidebarMenu=Ta;exports.SidebarMenuAction=Go;exports.SidebarMenuBadge=qo;exports.SidebarMenuButton=Bt;exports.SidebarMenuItem=Ot;exports.SidebarMenuSkeleton=Wo;exports.SidebarMenuSub=Ra;exports.SidebarMenuSubButton=Vt;exports.SidebarMenuSubItem=Ut;exports.SidebarNavProvider=Fs;exports.SidebarProvider=Na;exports.SidebarRail=Sa;exports.SidebarSeparator=Oo;exports.SidebarTrigger=Ca;exports.SimpleWidget=Mi;exports.Skeleton=Be;exports.SkeletonWidget=al;exports.Slider=Ho;exports.Switch=Xo;exports.Table=Ea;exports.TableBody=La;exports.TableCaption=Yo;exports.TableCell=Je;exports.TableFooter=Oa;exports.TableHead=$t;exports.TableHeader=za;exports.TableRow=qe;exports.Tabs=Ba;exports.TabsContent=Gt;exports.TabsList=Ua;exports.TabsTrigger=Va;exports.TextButton=lt;exports.TextButtonWithTooltip=vi;exports.Textarea=$a;exports.ThemeProvider=_a;exports.ThemeToggleBtn=As;exports.TitleProgress=Ei;exports.Toaster=Ko;exports.Toggle=pi;exports.ToggleGroup=Oe;exports.ToggleGroupItem=U;exports.Tooltip=ne;exports.TooltipComponent=_e;exports.TooltipContent=ie;exports.TooltipProvider=Ae;exports.TooltipTrigger=oe;exports.UploadTab=Ms;exports.Widgets=Li;exports.WorkInProgress=Dl;exports.Workflow=bi;exports.axiosInstance=Me;exports.badgeVariants=Kr;exports.buttonVariants=Ye;exports.clearAllCookieSession=nl;exports.clearCookieSession=Zt;exports.cn=d;exports.convertFileToObject=ws;exports.getCookieSession=Ct;exports.getDataTableColumnTitle=Ie;exports.getImageFromObject=Ni;exports.getValidAccessToken=ut;exports.navigationMenuTriggerStyle=la;exports.refreshAccessToken=Os;exports.setCookieSession=Jt;exports.setIkonConfig=sl;exports.toggleVariants=yr;exports.useBreadcrumb=kr;exports.useDialog=ji;exports.useFont=fl;exports.useFormField=it;exports.useImageCropper=Ar;exports.useIsMobile=Rt;exports.useRadius=gl;exports.useRefresh=hl;exports.useSidebar=ot;exports.useSidebarNav=dt;