import{r as o,j as t,q as $,R as Dt,Y as P}from"./app-BGey7YPf.js";import{c as D,a as h,S as W,f as Lt,u as ne,P as O,B as Ot,g as De,r as Ft,h as Bt}from"./button-D5r5edT8.js";import{C as Ht}from"./chevron-right-CE_1krjA.js";import{S as Le}from"./separator-Di-l93J0.js";import{I as $t}from"./input-CGSIKYsG.js";import{S as zt,i as Wt,D as Vt,c as Kt,A as Pe,a as _e,d as Ut,e as Gt,b as qt,f as Ae,j as Yt,g as pe,L as Xt}from"./icons-hx7HvmR4.js";import{c as Oe,d as je,n as Fe,D as Jt,b as Qt,u as Be,a as E,B as Zt,g as se,o as er,i as tr}from"./index-BFyaOBDQ.js";import{c as He,C as rr,R as sr,A as ar,a as or}from"./index-CwO5dfCw.js";import{R as nr,c as ir,V as $e}from"./index-Q2wK6uZI.js";import{u as dr,S as cr,M as lr,T as ur}from"./theme-provider-NKMbg-kV.js";import{u as pr,t as te}from"./use-toast-DGElh_6W.js";import{X as fr}from"./x-C4WIHhXm.js";/**
 * @license lucide-react v0.475.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const mr=[["path",{d:"m7 15 5 5 5-5",key:"1hf1tw"}],["path",{d:"m7 9 5-5 5 5",key:"sgt6xg"}]],xr=D("ChevronsUpDown",mr);/**
 * @license lucide-react v0.475.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const hr=[["path",{d:"M18 20a6 6 0 0 0-12 0",key:"1qehca"}],["circle",{cx:"12",cy:"10",r:"4",key:"1h16sb"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],br=D("CircleUserRound",hr);/**
 * @license lucide-react v0.475.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const vr=[["path",{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4",key:"1uf3rs"}],["polyline",{points:"16 17 21 12 16 7",key:"1gabdz"}],["line",{x1:"21",x2:"9",y1:"12",y2:"12",key:"1uyos4"}]],gr=D("LogOut",vr);/**
 * @license lucide-react v0.475.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const wr=[["rect",{width:"20",height:"14",x:"2",y:"3",rx:"2",key:"48i651"}],["line",{x1:"8",x2:"16",y1:"21",y2:"21",key:"1svkeh"}],["line",{x1:"12",x2:"12",y1:"17",y2:"21",key:"vw1qmm"}]],yr=D("Monitor",wr);/**
 * @license lucide-react v0.475.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const jr=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}]],Tr=D("PanelLeft",jr);/**
 * @license lucide-react v0.475.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Cr=[["circle",{cx:"18",cy:"15",r:"3",key:"gjjjvw"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}],["path",{d:"M10 15H6a4 4 0 0 0-4 4v2",key:"1nfge6"}],["path",{d:"m21.7 16.4-.9-.3",key:"12j9ji"}],["path",{d:"m15.2 13.9-.9-.3",key:"1fdjdi"}],["path",{d:"m16.6 18.7.3-.9",key:"heedtr"}],["path",{d:"m19.1 12.2.3-.9",key:"1af3ki"}],["path",{d:"m19.6 18.7-.4-1",key:"1x9vze"}],["path",{d:"m16.8 12.3-.4-1",key:"vqeiwj"}],["path",{d:"m14.3 16.6 1-.4",key:"1qlj63"}],["path",{d:"m20.7 13.8 1-.4",key:"1v5t8k"}]],Nr=D("UserCog",Cr);/**
 * @license lucide-react v0.475.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Er=[["path",{d:"M2 21a8 8 0 0 1 13.292-6",key:"bjp14o"}],["circle",{cx:"10",cy:"8",r:"5",key:"o932ke"}],["path",{d:"m16 19 2 2 4-4",key:"1b14m6"}]],H=D("UserRoundCheck",Er);/**
 * @license lucide-react v0.475.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Rr=[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["path",{d:"M16 3.13a4 4 0 0 1 0 7.75",key:"1da9ce"}]],Sr=D("Users",Rr),ze=o.forwardRef(({...e},r)=>t.jsx("nav",{ref:r,"aria-label":"breadcrumb",...e}));ze.displayName="Breadcrumb";const We=o.forwardRef(({className:e,...r},s)=>t.jsx("ol",{ref:s,className:h("flex flex-wrap items-center gap-1.5 break-words text-sm text-muted-foreground sm:gap-2.5",e),...r}));We.displayName="BreadcrumbList";const xe=o.forwardRef(({className:e,...r},s)=>t.jsx("li",{ref:s,className:h("inline-flex items-center gap-1.5",e),...r}));xe.displayName="BreadcrumbItem";const he=o.forwardRef(({asChild:e,className:r,...s},a)=>{const n=e?W:"a";return t.jsx(n,{ref:a,className:h("transition-colors hover:text-foreground",r),...s})});he.displayName="BreadcrumbLink";const kr=o.forwardRef(({className:e,...r},s)=>t.jsx("span",{ref:s,role:"link","aria-disabled":"true","aria-current":"page",className:h("font-normal text-foreground",e),...r}));kr.displayName="BreadcrumbPage";const Ve=({children:e,className:r,...s})=>t.jsx("li",{role:"presentation","aria-hidden":"true",className:h("[&>svg]:w-3.5 [&>svg]:h-3.5",r),...s,children:e??t.jsx(Ht,{})});Ve.displayName="BreadcrumbSeparator";const fe=768;function Pr(){const[e,r]=o.useState(void 0);return o.useEffect(()=>{const s=window.matchMedia(`(max-width: ${fe-1}px)`),a=()=>{r(window.innerWidth<fe)};return s.addEventListener("change",a),r(window.innerWidth<fe),()=>s.removeEventListener("change",a)},[]),!!e}function Me({className:e,...r}){return t.jsx("div",{className:h("animate-pulse rounded-md bg-primary/10",e),...r})}var[ie,ra]=Oe("Tooltip",[He]),de=He(),Ke="TooltipProvider",_r=700,be="tooltip.open",[Ar,Te]=ie(Ke),Ue=e=>{const{__scopeTooltip:r,delayDuration:s=_r,skipDelayDuration:a=300,disableHoverableContent:n=!1,children:i}=e,c=o.useRef(!0),x=o.useRef(!1),l=o.useRef(0);return o.useEffect(()=>{const d=l.current;return()=>window.clearTimeout(d)},[]),t.jsx(Ar,{scope:r,isOpenDelayedRef:c,delayDuration:s,onOpen:o.useCallback(()=>{window.clearTimeout(l.current),c.current=!1},[]),onClose:o.useCallback(()=>{window.clearTimeout(l.current),l.current=window.setTimeout(()=>c.current=!0,a)},[a]),isPointerInTransitRef:x,onPointerInTransitChange:o.useCallback(d=>{x.current=d},[]),disableHoverableContent:n,children:i})};Ue.displayName=Ke;var q="Tooltip",[Mr,X]=ie(q),Ge=e=>{const{__scopeTooltip:r,children:s,open:a,defaultOpen:n,onOpenChange:i,disableHoverableContent:c,delayDuration:x}=e,l=Te(q,e.__scopeTooltip),d=de(r),[p,b]=o.useState(null),j=Qt(),v=o.useRef(0),y=c??l.disableHoverableContent,m=x??l.delayDuration,u=o.useRef(!1),[T,f]=Be({prop:a,defaultProp:n??!1,onChange:M=>{M?(l.onOpen(),document.dispatchEvent(new CustomEvent(be))):l.onClose(),i==null||i(M)},caller:q}),w=o.useMemo(()=>T?u.current?"delayed-open":"instant-open":"closed",[T]),C=o.useCallback(()=>{window.clearTimeout(v.current),v.current=0,u.current=!1,f(!0)},[f]),N=o.useCallback(()=>{window.clearTimeout(v.current),v.current=0,f(!1)},[f]),R=o.useCallback(()=>{window.clearTimeout(v.current),v.current=window.setTimeout(()=>{u.current=!0,f(!0),v.current=0},m)},[m,f]);return o.useEffect(()=>()=>{v.current&&(window.clearTimeout(v.current),v.current=0)},[]),t.jsx(sr,{...d,children:t.jsx(Mr,{scope:r,contentId:j,open:T,stateAttribute:w,trigger:p,onTriggerChange:b,onTriggerEnter:o.useCallback(()=>{l.isOpenDelayedRef.current?R():C()},[l.isOpenDelayedRef,R,C]),onTriggerLeave:o.useCallback(()=>{y?N():(window.clearTimeout(v.current),v.current=0)},[N,y]),onOpen:C,onClose:N,disableHoverableContent:y,children:s})})};Ge.displayName=q;var ve="TooltipTrigger",qe=o.forwardRef((e,r)=>{const{__scopeTooltip:s,...a}=e,n=X(ve,s),i=Te(ve,s),c=de(s),x=o.useRef(null),l=ne(r,x,n.onTriggerChange),d=o.useRef(!1),p=o.useRef(!1),b=o.useCallback(()=>d.current=!1,[]);return o.useEffect(()=>()=>document.removeEventListener("pointerup",b),[b]),t.jsx(ar,{asChild:!0,...c,children:t.jsx(O.button,{"aria-describedby":n.open?n.contentId:void 0,"data-state":n.stateAttribute,...a,ref:l,onPointerMove:E(e.onPointerMove,j=>{j.pointerType!=="touch"&&!p.current&&!i.isPointerInTransitRef.current&&(n.onTriggerEnter(),p.current=!0)}),onPointerLeave:E(e.onPointerLeave,()=>{n.onTriggerLeave(),p.current=!1}),onPointerDown:E(e.onPointerDown,()=>{n.open&&n.onClose(),d.current=!0,document.addEventListener("pointerup",b,{once:!0})}),onFocus:E(e.onFocus,()=>{d.current||n.onOpen()}),onBlur:E(e.onBlur,n.onClose),onClick:E(e.onClick,n.onClose)})})});qe.displayName=ve;var Ce="TooltipPortal",[Ir,Dr]=ie(Ce,{forceMount:void 0}),Ye=e=>{const{__scopeTooltip:r,forceMount:s,children:a,container:n}=e,i=X(Ce,r);return t.jsx(Ir,{scope:r,forceMount:s,children:t.jsx(je,{present:s||i.open,children:t.jsx(Fe,{asChild:!0,container:n,children:a})})})};Ye.displayName=Ce;var z="TooltipContent",Xe=o.forwardRef((e,r)=>{const s=Dr(z,e.__scopeTooltip),{forceMount:a=s.forceMount,side:n="top",...i}=e,c=X(z,e.__scopeTooltip);return t.jsx(je,{present:a||c.open,children:c.disableHoverableContent?t.jsx(Je,{side:n,...i,ref:r}):t.jsx(Lr,{side:n,...i,ref:r})})}),Lr=o.forwardRef((e,r)=>{const s=X(z,e.__scopeTooltip),a=Te(z,e.__scopeTooltip),n=o.useRef(null),i=ne(r,n),[c,x]=o.useState(null),{trigger:l,onClose:d}=s,p=n.current,{onPointerInTransitChange:b}=a,j=o.useCallback(()=>{x(null),b(!1)},[b]),v=o.useCallback((y,m)=>{const u=y.currentTarget,T={x:y.clientX,y:y.clientY},f=$r(T,u.getBoundingClientRect()),w=zr(T,f),C=Wr(m.getBoundingClientRect()),N=Kr([...w,...C]);x(N),b(!0)},[b]);return o.useEffect(()=>()=>j(),[j]),o.useEffect(()=>{if(l&&p){const y=u=>v(u,p),m=u=>v(u,l);return l.addEventListener("pointerleave",y),p.addEventListener("pointerleave",m),()=>{l.removeEventListener("pointerleave",y),p.removeEventListener("pointerleave",m)}}},[l,p,v,j]),o.useEffect(()=>{if(c){const y=m=>{const u=m.target,T={x:m.clientX,y:m.clientY},f=(l==null?void 0:l.contains(u))||(p==null?void 0:p.contains(u)),w=!Vr(T,c);f?j():w&&(j(),d())};return document.addEventListener("pointermove",y),()=>document.removeEventListener("pointermove",y)}},[l,p,c,d,j]),t.jsx(Je,{...e,ref:i})}),[Or,Fr]=ie(q,{isInside:!1}),Br=Lt("TooltipContent"),Je=o.forwardRef((e,r)=>{const{__scopeTooltip:s,children:a,"aria-label":n,onEscapeKeyDown:i,onPointerDownOutside:c,...x}=e,l=X(z,s),d=de(s),{onClose:p}=l;return o.useEffect(()=>(document.addEventListener(be,p),()=>document.removeEventListener(be,p)),[p]),o.useEffect(()=>{if(l.trigger){const b=j=>{const v=j.target;v!=null&&v.contains(l.trigger)&&p()};return window.addEventListener("scroll",b,{capture:!0}),()=>window.removeEventListener("scroll",b,{capture:!0})}},[l.trigger,p]),t.jsx(Jt,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:i,onPointerDownOutside:c,onFocusOutside:b=>b.preventDefault(),onDismiss:p,children:t.jsxs(rr,{"data-state":l.stateAttribute,...d,...x,ref:r,style:{...x.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[t.jsx(Br,{children:a}),t.jsx(Or,{scope:s,isInside:!0,children:t.jsx(nr,{id:l.contentId,role:"tooltip",children:n||a})})]})})});Xe.displayName=z;var Qe="TooltipArrow",Hr=o.forwardRef((e,r)=>{const{__scopeTooltip:s,...a}=e,n=de(s);return Fr(Qe,s).isInside?null:t.jsx(or,{...n,...a,ref:r})});Hr.displayName=Qe;function $r(e,r){const s=Math.abs(r.top-e.y),a=Math.abs(r.bottom-e.y),n=Math.abs(r.right-e.x),i=Math.abs(r.left-e.x);switch(Math.min(s,a,n,i)){case i:return"left";case n:return"right";case s:return"top";case a:return"bottom";default:throw new Error("unreachable")}}function zr(e,r,s=5){const a=[];switch(r){case"top":a.push({x:e.x-s,y:e.y+s},{x:e.x+s,y:e.y+s});break;case"bottom":a.push({x:e.x-s,y:e.y-s},{x:e.x+s,y:e.y-s});break;case"left":a.push({x:e.x+s,y:e.y-s},{x:e.x+s,y:e.y+s});break;case"right":a.push({x:e.x-s,y:e.y-s},{x:e.x-s,y:e.y+s});break}return a}function Wr(e){const{top:r,right:s,bottom:a,left:n}=e;return[{x:n,y:r},{x:s,y:r},{x:s,y:a},{x:n,y:a}]}function Vr(e,r){const{x:s,y:a}=e;let n=!1;for(let i=0,c=r.length-1;i<r.length;c=i++){const x=r[i],l=r[c],d=x.x,p=x.y,b=l.x,j=l.y;p>a!=j>a&&s<(b-d)*(a-p)/(j-p)+d&&(n=!n)}return n}function Kr(e){const r=e.slice();return r.sort((s,a)=>s.x<a.x?-1:s.x>a.x?1:s.y<a.y?-1:s.y>a.y?1:0),Ur(r)}function Ur(e){if(e.length<=1)return e.slice();const r=[];for(let a=0;a<e.length;a++){const n=e[a];for(;r.length>=2;){const i=r[r.length-1],c=r[r.length-2];if((i.x-c.x)*(n.y-c.y)>=(i.y-c.y)*(n.x-c.x))r.pop();else break}r.push(n)}r.pop();const s=[];for(let a=e.length-1;a>=0;a--){const n=e[a];for(;s.length>=2;){const i=s[s.length-1],c=s[s.length-2];if((i.x-c.x)*(n.y-c.y)>=(i.y-c.y)*(n.x-c.x))s.pop();else break}s.push(n)}return s.pop(),r.length===1&&s.length===1&&r[0].x===s[0].x&&r[0].y===s[0].y?r:r.concat(s)}var Gr=Ue,qr=Ge,Yr=qe,Xr=Ye,Ze=Xe;const Jr=Gr,Qr=qr,Zr=Yr,et=o.forwardRef(({className:e,sideOffset:r=4,...s},a)=>t.jsx(Xr,{children:t.jsx(Ze,{ref:a,sideOffset:r,className:h("z-50 overflow-hidden rounded-md bg-primary px-3 py-1.5 text-xs text-primary-foreground 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",e),...s})}));et.displayName=Ze.displayName;const es="sidebar_state",ts=60*60*24*7,rs="16rem",ss="18rem",as="3rem",os="b",tt=o.createContext(null);function V(){const e=o.useContext(tt);if(!e)throw new Error("useSidebar must be used within a SidebarProvider.");return e}const rt=o.forwardRef(({defaultOpen:e=!0,open:r,onOpenChange:s,className:a,style:n,children:i,...c},x)=>{const l=Pr(),[d,p]=o.useState(!1),[b,j]=o.useState(e),v=r??b,y=o.useCallback(f=>{const w=typeof f=="function"?f(v):f;s?s(w):j(w),document.cookie=`${es}=${w}; path=/; max-age=${ts}`},[s,v]),m=o.useCallback(()=>l?p(f=>!f):y(f=>!f),[l,y,p]);o.useEffect(()=>{const f=w=>{w.key===os&&(w.metaKey||w.ctrlKey)&&(w.preventDefault(),m())};return window.addEventListener("keydown",f),()=>window.removeEventListener("keydown",f)},[m]);const u=v?"expanded":"collapsed",T=o.useMemo(()=>({state:u,open:v,setOpen:y,isMobile:l,openMobile:d,setOpenMobile:p,toggleSidebar:m}),[u,v,y,l,d,p,m]);return t.jsx(tt.Provider,{value:T,children:t.jsx(Jr,{delayDuration:0,children:t.jsx("div",{style:{"--sidebar-width":rs,"--sidebar-width-icon":as,...n},className:h("group/sidebar-wrapper flex min-h-svh w-full has-[[data-variant=inset]]:bg-sidebar",a),ref:x,...c,children:i})})})});rt.displayName="SidebarProvider";const st=o.forwardRef(({side:e="left",variant:r="sidebar",collapsible:s="offcanvas",className:a,children:n,...i},c)=>{const{isMobile:x,state:l,openMobile:d,setOpenMobile:p}=V();return s==="none"?t.jsx("div",{className:h("flex h-full w-[--sidebar-width] flex-col bg-sidebar text-sidebar-foreground",a),ref:c,...i,children:n}):x?t.jsx(zt,{open:d,onOpenChange:p,...i,children:t.jsx(Wt,{"data-sidebar":"sidebar","data-mobile":"true",className:"w-[--sidebar-width] bg-sidebar p-0 text-sidebar-foreground [&>button]:hidden",style:{"--sidebar-width":ss},side:e,children:t.jsx("div",{className:"flex h-full w-full flex-col",children:n})})}):t.jsxs("div",{ref:c,className:"group peer hidden text-sidebar-foreground md:block","data-state":l,"data-collapsible":l==="collapsed"?s:"","data-variant":r,"data-side":e,children:[t.jsx("div",{className:h("relative h-svh 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)_+_theme(spacing.4))]":"group-data-[collapsible=icon]:w-[--sidebar-width-icon]")}),t.jsx("div",{className:h("fixed inset-y-0 z-10 hidden h-svh w-[--sidebar-width] transition-[left,right,width] duration-200 ease-linear md:flex",e==="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)_+_theme(spacing.4)_+2px)]":"group-data-[collapsible=icon]:w-[--sidebar-width-icon] group-data-[side=left]:border-r group-data-[side=right]:border-l",a),...i,children:t.jsx("div",{"data-sidebar":"sidebar",className:"flex h-full w-full flex-col bg-sidebar group-data-[variant=floating]:rounded-lg group-data-[variant=floating]:border group-data-[variant=floating]:border-sidebar-border group-data-[variant=floating]:shadow",children:n})})]})});st.displayName="Sidebar";const at=o.forwardRef(({className:e,onClick:r,...s},a)=>{const{toggleSidebar:n}=V();return t.jsxs(Ot,{ref:a,"data-sidebar":"trigger",variant:"ghost",size:"icon",className:h("h-7 w-7",e),onClick:i=>{r==null||r(i),n()},...s,children:[t.jsx(Tr,{}),t.jsx("span",{className:"sr-only",children:"Toggle Sidebar"})]})});at.displayName="SidebarTrigger";const ot=o.forwardRef(({className:e,...r},s)=>{const{toggleSidebar:a}=V();return t.jsx("button",{ref:s,"data-sidebar":"rail","aria-label":"Toggle Sidebar",tabIndex:-1,onClick:a,title:"Toggle Sidebar",className:h("absolute inset-y-0 z-20 hidden w-4 -translate-x-1/2 transition-all ease-linear after:absolute after:inset-y-0 after:left-1/2 after:w-[2px] hover:after:bg-sidebar-border group-data-[side=left]:-right-4 group-data-[side=right]:left-0 sm:flex","[[data-side=left]_&]:cursor-w-resize [[data-side=right]_&]:cursor-e-resize","[[data-side=left][data-state=collapsed]_&]:cursor-e-resize [[data-side=right][data-state=collapsed]_&]:cursor-w-resize","group-data-[collapsible=offcanvas]:translate-x-0 group-data-[collapsible=offcanvas]:after:left-full group-data-[collapsible=offcanvas]:hover:bg-sidebar","[[data-side=left][data-collapsible=offcanvas]_&]:-right-2","[[data-side=right][data-collapsible=offcanvas]_&]:-left-2",e),...r})});ot.displayName="SidebarRail";const ns=o.forwardRef(({className:e,...r},s)=>t.jsx("main",{ref:s,className:h("relative flex min-h-svh flex-1 flex-col bg-background","peer-data-[variant=inset]:min-h-[calc(100svh-theme(spacing.4))] md:peer-data-[variant=inset]:m-2 md:peer-data-[state=collapsed]:peer-data-[variant=inset]:ml-2 md:peer-data-[variant=inset]:ml-0 md:peer-data-[variant=inset]:rounded-xl md:peer-data-[variant=inset]:shadow",e),...r}));ns.displayName="SidebarInset";const is=o.forwardRef(({className:e,...r},s)=>t.jsx($t,{ref:s,"data-sidebar":"input",className:h("h-8 w-full bg-background shadow-none focus-visible:ring-2 focus-visible:ring-sidebar-ring",e),...r}));is.displayName="SidebarInput";const nt=o.forwardRef(({className:e,...r},s)=>t.jsx("div",{ref:s,"data-sidebar":"header",className:h("flex flex-col gap-2 p-2",e),...r}));nt.displayName="SidebarHeader";const it=o.forwardRef(({className:e,...r},s)=>t.jsx("div",{ref:s,"data-sidebar":"footer",className:h("flex flex-col gap-2 p-2",e),...r}));it.displayName="SidebarFooter";const ds=o.forwardRef(({className:e,...r},s)=>t.jsx(Le,{ref:s,"data-sidebar":"separator",className:h("mx-2 w-auto bg-sidebar-border",e),...r}));ds.displayName="SidebarSeparator";const dt=o.forwardRef(({className:e,...r},s)=>t.jsx("div",{ref:s,"data-sidebar":"content",className:h("flex min-h-0 flex-1 flex-col gap-2 overflow-auto group-data-[collapsible=icon]:overflow-hidden",e),...r}));dt.displayName="SidebarContent";const Ne=o.forwardRef(({className:e,...r},s)=>t.jsx("div",{ref:s,"data-sidebar":"group",className:h("relative flex w-full min-w-0 flex-col p-2",e),...r}));Ne.displayName="SidebarGroup";const ae=o.forwardRef(({className:e,asChild:r=!1,...s},a)=>{const n=r?W:"div";return t.jsx(n,{ref:a,"data-sidebar":"group-label",className:h("flex h-8 shrink-0 items-center rounded-md px-2 text-xs font-medium text-sidebar-foreground/70 outline-none ring-sidebar-ring transition-[margin,opa] 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",e),...s})});ae.displayName="SidebarGroupLabel";const cs=o.forwardRef(({className:e,asChild:r=!1,...s},a)=>{const n=r?W:"button";return t.jsx(n,{ref:a,"data-sidebar":"group-action",className:h("absolute right-3 top-3.5 flex aspect-square w-5 items-center justify-center rounded-md p-0 text-sidebar-foreground outline-none ring-sidebar-ring transition-transform hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0","after:absolute after:-inset-2 after:md:hidden","group-data-[collapsible=icon]:hidden",e),...s})});cs.displayName="SidebarGroupAction";const oe=o.forwardRef(({className:e,...r},s)=>t.jsx("div",{ref:s,"data-sidebar":"group-content",className:h("w-full text-sm",e),...r}));oe.displayName="SidebarGroupContent";const Y=o.forwardRef(({className:e,...r},s)=>t.jsx("ul",{ref:s,"data-sidebar":"menu",className:h("flex w-full min-w-0 flex-col gap-1",e),...r}));Y.displayName="SidebarMenu";const _=o.forwardRef(({className:e,...r},s)=>t.jsx("li",{ref:s,"data-sidebar":"menu-item",className:h("group/menu-item relative",e),...r}));_.displayName="SidebarMenuItem";const ls=De("peer/menu-button flex w-full items-center gap-2 overflow-hidden rounded-md p-2 text-left text-sm outline-none ring-sidebar-ring transition-[width,height,padding] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-0 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"}}),A=o.forwardRef(({asChild:e=!1,isActive:r=!1,variant:s="default",size:a="default",tooltip:n,className:i,...c},x)=>{const l=e?W:"button",{isMobile:d,state:p}=V(),b=t.jsx(l,{ref:x,"data-sidebar":"menu-button","data-size":a,"data-active":r,className:h(ls({variant:s,size:a}),i),...c});return n?(typeof n=="string"&&(n={children:n}),t.jsxs(Qr,{children:[t.jsx(Zr,{asChild:!0,children:b}),t.jsx(et,{side:"right",align:"center",hidden:p!=="collapsed"||d,...n})]})):b});A.displayName="SidebarMenuButton";const us=o.forwardRef(({className:e,asChild:r=!1,showOnHover:s=!1,...a},n)=>{const i=r?W:"button";return t.jsx(i,{ref:n,"data-sidebar":"menu-action",className:h("absolute right-1 top-1.5 flex aspect-square w-5 items-center justify-center rounded-md p-0 text-sidebar-foreground outline-none ring-sidebar-ring transition-transform hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 peer-hover/menu-button:text-sidebar-accent-foreground [&>svg]:size-4 [&>svg]:shrink-0","after:absolute after:-inset-2 after:md: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",s&&"group-focus-within/menu-item:opacity-100 group-hover/menu-item:opacity-100 data-[state=open]:opacity-100 peer-data-[active=true]/menu-button:text-sidebar-accent-foreground md:opacity-0",e),...a})});us.displayName="SidebarMenuAction";const ps=o.forwardRef(({className:e,...r},s)=>t.jsx("div",{ref:s,"data-sidebar":"menu-badge",className:h("pointer-events-none absolute right-1 flex h-5 min-w-5 select-none items-center justify-center rounded-md px-1 text-xs font-medium tabular-nums text-sidebar-foreground","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",e),...r}));ps.displayName="SidebarMenuBadge";const fs=o.forwardRef(({className:e,showIcon:r=!1,...s},a)=>{const n=o.useMemo(()=>`${Math.floor(Math.random()*40)+50}%`,[]);return t.jsxs("div",{ref:a,"data-sidebar":"menu-skeleton",className:h("flex h-8 items-center gap-2 rounded-md px-2",e),...s,children:[r&&t.jsx(Me,{className:"size-4 rounded-md","data-sidebar":"menu-skeleton-icon"}),t.jsx(Me,{className:"h-4 max-w-[--skeleton-width] flex-1","data-sidebar":"menu-skeleton-text",style:{"--skeleton-width":n}})]})});fs.displayName="SidebarMenuSkeleton";const ms=o.forwardRef(({className:e,...r},s)=>t.jsx("ul",{ref:s,"data-sidebar":"menu-sub",className:h("mx-3.5 flex min-w-0 translate-x-px flex-col gap-1 border-l border-sidebar-border px-2.5 py-0.5","group-data-[collapsible=icon]:hidden",e),...r}));ms.displayName="SidebarMenuSub";const xs=o.forwardRef(({...e},r)=>t.jsx("li",{ref:r,...e}));xs.displayName="SidebarMenuSubItem";const hs=o.forwardRef(({asChild:e=!1,size:r="md",isActive:s,className:a,...n},i)=>{const c=e?W:"a";return t.jsx(c,{ref:i,"data-sidebar":"menu-sub-button","data-size":r,"data-active":s,className:h("flex h-7 min-w-0 -translate-x-px items-center gap-2 overflow-hidden rounded-md px-2 text-sidebar-foreground outline-none ring-sidebar-ring 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 aria-disabled:pointer-events-none aria-disabled:opacity-50 [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0 [&>svg]:text-sidebar-accent-foreground","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",a),...n})});hs.displayName="SidebarMenuSubButton";function bs(){const{url:e}=$(),r=[{name:"Stats",isActive:e==="/apps/dashboard",subItems:[{name:"Dashboard",isActive:e==="/apps/dashboard",href:route("apps.dashboard")}]},{name:"Manajemen Pengguna",isActive:e.startsWith("/apps/permissions")||e.startsWith("/apps/roles")||e.startsWith("/apps/users"),subItems:[{name:"Hak Akses",isActive:e.startsWith("/apps/permissions"),href:route("apps.permissions.index")},{name:"Akses Group",isActive:e.startsWith("/apps/roles"),href:route("apps.roles.index")},{name:"Pengguna",isActive:e.startsWith("/apps/users"),href:route("apps.users.index")}]}];return t.jsxs("div",{className:"flex items-center gap-2 px-4 w-full",children:[t.jsx(at,{className:"-ml-1"}),t.jsx(Le,{orientation:"vertical",className:"mr-2 h-4"}),t.jsx(ze,{children:t.jsx(We,{children:r.map((s,a)=>s.isActive&&s.subItems.find(n=>n.isActive)&&t.jsxs(Dt.Fragment,{children:[t.jsx(xe,{children:t.jsx(he,{asChild:!0,children:t.jsx("div",{children:s.name})})}),t.jsx(Ve,{}),s.subItems.filter(n=>n.isActive).map((n,i)=>t.jsx(xe,{children:t.jsx(he,{asChild:!0,children:t.jsx("div",{children:n.name})})},i))]},a))})})]})}function vs(){const{auth:e}=$().props,{isMobile:r}=V(),{theme:s,setTheme:a}=dr();return t.jsx(Y,{children:t.jsx(_,{children:t.jsxs(Vt,{children:[t.jsx(Kt,{asChild:!0,children:t.jsxs(A,{size:"lg",className:"data-[state=open]:bg-sidebar-accent data-[state=open]:text-sidebar-accent-foreground",children:[t.jsx(Pe,{className:"h-8 w-8 rounded-full",children:t.jsx(_e,{src:e.user.avatar,alt:e.user.name})}),t.jsxs("div",{className:"grid flex-1 text-left text-sm leading-tight",children:[t.jsx("span",{className:"truncate font-semibold",children:e.user.name}),t.jsx("span",{className:"truncate text-xs",children:e.user.email})]}),t.jsx(xr,{className:"ml-auto size-4"})]})}),t.jsxs(Ut,{className:"w-[--radix-dropdown-menu-trigger-width] min-w-56 rounded-lg",side:r?"bottom":"right",align:"end",sideOffset:4,children:[t.jsx(Gt,{className:"p-0 font-normal",children:t.jsxs("div",{className:"flex items-center gap-2 px-1 py-1.5 text-left text-sm",children:[t.jsxs(Pe,{className:"h-8 w-8 rounded-full",children:[t.jsx(_e,{src:e.user.avatar,alt:e.user.name}),t.jsx(qt,{className:"rounded-lg",children:"CN"})]}),t.jsxs("div",{className:"grid flex-1 text-left text-sm leading-tight",children:[t.jsx("span",{className:"truncate font-semibold",children:e.user.name}),t.jsx("span",{className:"truncate text-xs",children:e.user.email})]})]})}),t.jsx(Ae,{}),t.jsxs(Yt,{children:[t.jsxs(pe,{children:[t.jsx(br,{})," Profile"]}),t.jsxs(pe,{onClick:()=>a(s==="light"?"dark":"light"),children:[t.jsx(cr,{className:"h-[1.2rem] w-[1.2rem] rotate-0 scale-100 transition-all dark:-rotate-90 dark:scale-0"}),t.jsx(lr,{className:"absolute h-[1.2rem] w-[1.2rem] rotate-90 scale-0 transition-all dark:rotate-0 dark:scale-100"}),t.jsx("span",{children:s=="light"?"Light Mode":"Dark Mode"})]})]}),t.jsx(Ae,{}),t.jsx(pe,{asChild:!0,children:t.jsxs(P,{method:"post",href:route("logout"),as:"button",className:"w-full",children:[t.jsx(gr,{}),"Log out"]})})]})]})})})}function gs({url:e,setOpenMobile:r}){return t.jsxs(Ne,{children:[t.jsx(ae,{children:"Stats"}),t.jsx(oe,{children:t.jsx(Y,{children:t.jsx(_,{children:t.jsx(A,{asChild:!0,tooltip:"Dashboard",isActive:e==="/apps/dashboard"&&!0,children:t.jsxs(P,{href:route("apps.dashboard"),onClick:()=>r(!1),children:[t.jsx(yr,{}),t.jsx("span",{children:"Dashboard"})]})})})})})]})}function k(e){const{auth:r}=$().props;return r.super?!0:e.some(s=>{if(s.startsWith("*-")){const a=s.slice(1);return Object.keys(r.permissions).some(n=>n.endsWith(a)&&r.permissions[n])}return r.permissions[s]===!0})}function ws({url:e,setOpenMobile:r}){return t.jsxs(Ne,{children:[(k(["permissions-data"])||k(["users-data"])||k(["roles-data"]))&&t.jsx(ae,{children:"Manajemen Pengguna"}),t.jsx(oe,{children:t.jsxs(Y,{children:[k(["permissions-data"])&&t.jsx(_,{children:t.jsx(A,{asChild:!0,tooltip:"Hak Akses",isActive:e.startsWith("/apps/permissions")&&!0,children:t.jsxs(P,{href:route("apps.permissions.index"),onClick:()=>r(!1),children:[t.jsx(H,{}),t.jsx("span",{children:"Hak Akses"})]})})}),k(["roles-data"])&&t.jsx(_,{children:t.jsx(A,{asChild:!0,tooltip:"Akses Group",isActive:e.startsWith("/apps/roles")&&!0,children:t.jsxs(P,{href:route("apps.roles.index"),onClick:()=>r(!1),children:[t.jsx(Nr,{}),t.jsx("span",{children:"Akses Group"})]})})}),k(["users-data"])&&t.jsx(_,{children:t.jsx(A,{asChild:!0,tooltip:"Pengguna",isActive:e.startsWith("/apps/users")&&!0,children:t.jsxs(P,{href:route("apps.users.index"),onClick:()=>r(!1),children:[t.jsx(Sr,{}),t.jsx("span",{children:"Pengguna"})]})})})]})}),(k(["lembagas-data"])||k(["applications-data"]))&&t.jsx(ae,{children:"Data Master"}),t.jsx(oe,{children:t.jsxs(Y,{children:[k(["applications-data"])&&t.jsx(_,{children:t.jsx(A,{asChild:!0,tooltip:"Aplikasi",isActive:e.startsWith("/apps/applications")&&!0,children:t.jsxs(P,{href:route("apps.applications.index"),onClick:()=>r(!1),children:[t.jsx(H,{}),t.jsx("span",{children:"Aplikasi"})]})})}),k(["lembagas-data"])&&t.jsx(_,{children:t.jsx(A,{asChild:!0,tooltip:"Lembaga",isActive:e.startsWith("/apps/lembagas")&&!0,children:t.jsxs(P,{href:route("apps.lembagas.index"),onClick:()=>r(!1),children:[t.jsx(H,{}),t.jsx("span",{children:"Lembaga"})]})})}),k(["token-apps-data"])&&t.jsx(_,{children:t.jsx(A,{asChild:!0,tooltip:"Token Aplikasi",isActive:e.startsWith("/apps/token-apps")&&!0,children:t.jsxs(P,{href:route("apps.token-apps.index"),onClick:()=>r(!1),children:[t.jsx(H,{}),t.jsx("span",{children:"Token Aplikasi"})]})})}),k(["token-apps-data"])&&t.jsx(_,{children:t.jsx(A,{asChild:!0,tooltip:"Link Profile",isActive:e.startsWith("/apps/link-profiles")&&!0,children:t.jsxs(P,{href:route("apps.link-profiles.index"),onClick:()=>r(!1),children:[t.jsx(H,{}),t.jsx("span",{children:"Link Profile"})]})})}),t.jsx(_,{children:t.jsx(A,{asChild:!0,tooltip:"Posting",isActive:e.startsWith("/post")&&!0,children:t.jsxs(P,{href:route("forum.posts.index"),onClick:()=>r(!1),children:[t.jsx(H,{}),t.jsx("span",{children:"Posting"})]})})})]})})]})}function ys({...e}){const{url:r}=$(),{appName:s}=$().props,{setOpenMobile:a}=V();return t.jsxs(st,{collapsible:"icon",...e,children:[t.jsx(nt,{className:"border-b group-data-[collapsible=icon]:h-14 h-14 flex flex-row items-center justify-center dark:bg-gray-950 bg-white",children:t.jsxs(P,{rel:"noreferrer noopener",href:route("landing.index"),className:"ml-2 font-bold text-xl flex",children:[t.jsx(Xt,{}),s]})}),t.jsxs(dt,{className:"dark:bg-gray-950 scrollbar-hide bg-white",children:[t.jsx(gs,{url:r,setOpenMobile:a}),t.jsx(ws,{url:r,setOpenMobile:a})]}),t.jsx(it,{className:"border-t bg-white dark:bg-gray-950",children:t.jsx(vs,{})}),t.jsx(ot,{})]})}var Ee="ToastProvider",[Re,js,Ts]=ir("Toast"),[ct,sa]=Oe("Toast",[Ts]),[Cs,ce]=ct(Ee),lt=e=>{const{__scopeToast:r,label:s="Notification",duration:a=5e3,swipeDirection:n="right",swipeThreshold:i=50,children:c}=e,[x,l]=o.useState(null),[d,p]=o.useState(0),b=o.useRef(!1),j=o.useRef(!1);return s.trim()||console.error(`Invalid prop \`label\` supplied to \`${Ee}\`. Expected non-empty \`string\`.`),t.jsx(Re.Provider,{scope:r,children:t.jsx(Cs,{scope:r,label:s,duration:a,swipeDirection:n,swipeThreshold:i,toastCount:d,viewport:x,onViewportChange:l,onToastAdd:o.useCallback(()=>p(v=>v+1),[]),onToastRemove:o.useCallback(()=>p(v=>v-1),[]),isFocusedToastEscapeKeyDownRef:b,isClosePausedRef:j,children:c})})};lt.displayName=Ee;var ut="ToastViewport",Ns=["F8"],ge="toast.viewportPause",we="toast.viewportResume",pt=o.forwardRef((e,r)=>{const{__scopeToast:s,hotkey:a=Ns,label:n="Notifications ({hotkey})",...i}=e,c=ce(ut,s),x=js(s),l=o.useRef(null),d=o.useRef(null),p=o.useRef(null),b=o.useRef(null),j=ne(r,b,c.onViewportChange),v=a.join("+").replace(/Key/g,"").replace(/Digit/g,""),y=c.toastCount>0;o.useEffect(()=>{const u=T=>{var w;a.length!==0&&a.every(C=>T[C]||T.code===C)&&((w=b.current)==null||w.focus())};return document.addEventListener("keydown",u),()=>document.removeEventListener("keydown",u)},[a]),o.useEffect(()=>{const u=l.current,T=b.current;if(y&&u&&T){const f=()=>{if(!c.isClosePausedRef.current){const R=new CustomEvent(ge);T.dispatchEvent(R),c.isClosePausedRef.current=!0}},w=()=>{if(c.isClosePausedRef.current){const R=new CustomEvent(we);T.dispatchEvent(R),c.isClosePausedRef.current=!1}},C=R=>{!u.contains(R.relatedTarget)&&w()},N=()=>{u.contains(document.activeElement)||w()};return u.addEventListener("focusin",f),u.addEventListener("focusout",C),u.addEventListener("pointermove",f),u.addEventListener("pointerleave",N),window.addEventListener("blur",f),window.addEventListener("focus",w),()=>{u.removeEventListener("focusin",f),u.removeEventListener("focusout",C),u.removeEventListener("pointermove",f),u.removeEventListener("pointerleave",N),window.removeEventListener("blur",f),window.removeEventListener("focus",w)}}},[y,c.isClosePausedRef]);const m=o.useCallback(({tabbingDirection:u})=>{const f=x().map(w=>{const C=w.ref.current,N=[C,...Fs(C)];return u==="forwards"?N:N.reverse()});return(u==="forwards"?f.reverse():f).flat()},[x]);return o.useEffect(()=>{const u=b.current;if(u){const T=f=>{var N,R,M;const w=f.altKey||f.ctrlKey||f.metaKey;if(f.key==="Tab"&&!w){const K=document.activeElement,F=f.shiftKey;if(f.target===u&&F){(N=d.current)==null||N.focus();return}const L=m({tabbingDirection:F?"backwards":"forwards"}),Q=L.findIndex(g=>g===K);me(L.slice(Q+1))?f.preventDefault():F?(R=d.current)==null||R.focus():(M=p.current)==null||M.focus()}};return u.addEventListener("keydown",T),()=>u.removeEventListener("keydown",T)}},[x,m]),t.jsxs(Zt,{ref:l,role:"region","aria-label":n.replace("{hotkey}",v),tabIndex:-1,style:{pointerEvents:y?void 0:"none"},children:[y&&t.jsx(ye,{ref:d,onFocusFromOutsideViewport:()=>{const u=m({tabbingDirection:"forwards"});me(u)}}),t.jsx(Re.Slot,{scope:s,children:t.jsx(O.ol,{tabIndex:-1,...i,ref:j})}),y&&t.jsx(ye,{ref:p,onFocusFromOutsideViewport:()=>{const u=m({tabbingDirection:"backwards"});me(u)}})]})});pt.displayName=ut;var ft="ToastFocusProxy",ye=o.forwardRef((e,r)=>{const{__scopeToast:s,onFocusFromOutsideViewport:a,...n}=e,i=ce(ft,s);return t.jsx($e,{"aria-hidden":!0,tabIndex:0,...n,ref:r,style:{position:"fixed"},onFocus:c=>{var d;const x=c.relatedTarget;!((d=i.viewport)!=null&&d.contains(x))&&a()}})});ye.displayName=ft;var J="Toast",Es="toast.swipeStart",Rs="toast.swipeMove",Ss="toast.swipeCancel",ks="toast.swipeEnd",mt=o.forwardRef((e,r)=>{const{forceMount:s,open:a,defaultOpen:n,onOpenChange:i,...c}=e,[x,l]=Be({prop:a,defaultProp:n??!0,onChange:i,caller:J});return t.jsx(je,{present:s||x,children:t.jsx(As,{open:x,...c,ref:r,onClose:()=>l(!1),onPause:se(e.onPause),onResume:se(e.onResume),onSwipeStart:E(e.onSwipeStart,d=>{d.currentTarget.setAttribute("data-swipe","start")}),onSwipeMove:E(e.onSwipeMove,d=>{const{x:p,y:b}=d.detail.delta;d.currentTarget.setAttribute("data-swipe","move"),d.currentTarget.style.setProperty("--radix-toast-swipe-move-x",`${p}px`),d.currentTarget.style.setProperty("--radix-toast-swipe-move-y",`${b}px`)}),onSwipeCancel:E(e.onSwipeCancel,d=>{d.currentTarget.setAttribute("data-swipe","cancel"),d.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),d.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),d.currentTarget.style.removeProperty("--radix-toast-swipe-end-x"),d.currentTarget.style.removeProperty("--radix-toast-swipe-end-y")}),onSwipeEnd:E(e.onSwipeEnd,d=>{const{x:p,y:b}=d.detail.delta;d.currentTarget.setAttribute("data-swipe","end"),d.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),d.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),d.currentTarget.style.setProperty("--radix-toast-swipe-end-x",`${p}px`),d.currentTarget.style.setProperty("--radix-toast-swipe-end-y",`${b}px`),l(!1)})})})});mt.displayName=J;var[Ps,_s]=ct(J,{onClose(){}}),As=o.forwardRef((e,r)=>{const{__scopeToast:s,type:a="foreground",duration:n,open:i,onClose:c,onEscapeKeyDown:x,onPause:l,onResume:d,onSwipeStart:p,onSwipeMove:b,onSwipeCancel:j,onSwipeEnd:v,...y}=e,m=ce(J,s),[u,T]=o.useState(null),f=ne(r,g=>T(g)),w=o.useRef(null),C=o.useRef(null),N=n||m.duration,R=o.useRef(0),M=o.useRef(N),K=o.useRef(0),{onToastAdd:F,onToastRemove:le}=m,B=se(()=>{var S;(u==null?void 0:u.contains(document.activeElement))&&((S=m.viewport)==null||S.focus()),c()}),L=o.useCallback(g=>{!g||g===1/0||(window.clearTimeout(K.current),R.current=new Date().getTime(),K.current=window.setTimeout(B,g))},[B]);o.useEffect(()=>{const g=m.viewport;if(g){const S=()=>{L(M.current),d==null||d()},I=()=>{const U=new Date().getTime()-R.current;M.current=M.current-U,window.clearTimeout(K.current),l==null||l()};return g.addEventListener(ge,I),g.addEventListener(we,S),()=>{g.removeEventListener(ge,I),g.removeEventListener(we,S)}}},[m.viewport,N,l,d,L]),o.useEffect(()=>{i&&!m.isClosePausedRef.current&&L(N)},[i,N,m.isClosePausedRef,L]),o.useEffect(()=>(F(),()=>le()),[F,le]);const Q=o.useMemo(()=>u?yt(u):null,[u]);return m.viewport?t.jsxs(t.Fragment,{children:[Q&&t.jsx(Ms,{__scopeToast:s,role:"status","aria-live":a==="foreground"?"assertive":"polite","aria-atomic":!0,children:Q}),t.jsx(Ps,{scope:s,onClose:B,children:Ft.createPortal(t.jsx(Re.ItemSlot,{scope:s,children:t.jsx(er,{asChild:!0,onEscapeKeyDown:E(x,()=>{m.isFocusedToastEscapeKeyDownRef.current||B(),m.isFocusedToastEscapeKeyDownRef.current=!1}),children:t.jsx(O.li,{role:"status","aria-live":"off","aria-atomic":!0,tabIndex:0,"data-state":i?"open":"closed","data-swipe-direction":m.swipeDirection,...y,ref:f,style:{userSelect:"none",touchAction:"none",...e.style},onKeyDown:E(e.onKeyDown,g=>{g.key==="Escape"&&(x==null||x(g.nativeEvent),g.nativeEvent.defaultPrevented||(m.isFocusedToastEscapeKeyDownRef.current=!0,B()))}),onPointerDown:E(e.onPointerDown,g=>{g.button===0&&(w.current={x:g.clientX,y:g.clientY})}),onPointerMove:E(e.onPointerMove,g=>{if(!w.current)return;const S=g.clientX-w.current.x,I=g.clientY-w.current.y,U=!!C.current,G=["left","right"].includes(m.swipeDirection),Z=["left","up"].includes(m.swipeDirection)?Math.min:Math.max,Mt=G?Z(0,S):0,It=G?0:Z(0,I),ue=g.pointerType==="touch"?10:2,ee={x:Mt,y:It},ke={originalEvent:g,delta:ee};U?(C.current=ee,re(Rs,b,ke,{discrete:!1})):Ie(ee,m.swipeDirection,ue)?(C.current=ee,re(Es,p,ke,{discrete:!1}),g.target.setPointerCapture(g.pointerId)):(Math.abs(S)>ue||Math.abs(I)>ue)&&(w.current=null)}),onPointerUp:E(e.onPointerUp,g=>{const S=C.current,I=g.target;if(I.hasPointerCapture(g.pointerId)&&I.releasePointerCapture(g.pointerId),C.current=null,w.current=null,S){const U=g.currentTarget,G={originalEvent:g,delta:S};Ie(S,m.swipeDirection,m.swipeThreshold)?re(ks,v,G,{discrete:!0}):re(Ss,j,G,{discrete:!0}),U.addEventListener("click",Z=>Z.preventDefault(),{once:!0})}})})})}),m.viewport)})]}):null}),Ms=e=>{const{__scopeToast:r,children:s,...a}=e,n=ce(J,r),[i,c]=o.useState(!1),[x,l]=o.useState(!1);return Ls(()=>c(!0)),o.useEffect(()=>{const d=window.setTimeout(()=>l(!0),1e3);return()=>window.clearTimeout(d)},[]),x?null:t.jsx(Fe,{asChild:!0,children:t.jsx($e,{...a,children:i&&t.jsxs(t.Fragment,{children:[n.label," ",s]})})})},Is="ToastTitle",xt=o.forwardRef((e,r)=>{const{__scopeToast:s,...a}=e;return t.jsx(O.div,{...a,ref:r})});xt.displayName=Is;var Ds="ToastDescription",ht=o.forwardRef((e,r)=>{const{__scopeToast:s,...a}=e;return t.jsx(O.div,{...a,ref:r})});ht.displayName=Ds;var bt="ToastAction",vt=o.forwardRef((e,r)=>{const{altText:s,...a}=e;return s.trim()?t.jsx(wt,{altText:s,asChild:!0,children:t.jsx(Se,{...a,ref:r})}):(console.error(`Invalid prop \`altText\` supplied to \`${bt}\`. Expected non-empty \`string\`.`),null)});vt.displayName=bt;var gt="ToastClose",Se=o.forwardRef((e,r)=>{const{__scopeToast:s,...a}=e,n=_s(gt,s);return t.jsx(wt,{asChild:!0,children:t.jsx(O.button,{type:"button",...a,ref:r,onClick:E(e.onClick,n.onClose)})})});Se.displayName=gt;var wt=o.forwardRef((e,r)=>{const{__scopeToast:s,altText:a,...n}=e;return t.jsx(O.div,{"data-radix-toast-announce-exclude":"","data-radix-toast-announce-alt":a||void 0,...n,ref:r})});function yt(e){const r=[];return Array.from(e.childNodes).forEach(a=>{if(a.nodeType===a.TEXT_NODE&&a.textContent&&r.push(a.textContent),Os(a)){const n=a.ariaHidden||a.hidden||a.style.display==="none",i=a.dataset.radixToastAnnounceExclude==="";if(!n)if(i){const c=a.dataset.radixToastAnnounceAlt;c&&r.push(c)}else r.push(...yt(a))}}),r}function re(e,r,s,{discrete:a}){const n=s.originalEvent.currentTarget,i=new CustomEvent(e,{bubbles:!0,cancelable:!0,detail:s});r&&n.addEventListener(e,r,{once:!0}),a?Bt(n,i):n.dispatchEvent(i)}var Ie=(e,r,s=0)=>{const a=Math.abs(e.x),n=Math.abs(e.y),i=a>n;return r==="left"||r==="right"?i&&a>s:!i&&n>s};function Ls(e=()=>{}){const r=se(e);tr(()=>{let s=0,a=0;return s=window.requestAnimationFrame(()=>a=window.requestAnimationFrame(r)),()=>{window.cancelAnimationFrame(s),window.cancelAnimationFrame(a)}},[r])}function Os(e){return e.nodeType===e.ELEMENT_NODE}function Fs(e){const r=[],s=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:a=>{const n=a.tagName==="INPUT"&&a.type==="hidden";return a.disabled||a.hidden||n?NodeFilter.FILTER_SKIP:a.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;s.nextNode();)r.push(s.currentNode);return r}function me(e){const r=document.activeElement;return e.some(s=>s===r?!0:(s.focus(),document.activeElement!==r))}var Bs=lt,jt=pt,Tt=mt,Ct=xt,Nt=ht,Et=vt,Rt=Se;const Hs=Bs,St=o.forwardRef(({className:e,...r},s)=>t.jsx(jt,{ref:s,className:h("fixed top-0 z-[100] flex max-h-screen w-full flex-col-reverse p-4 sm:bottom-0 sm:right-0 sm:top-auto sm:flex-col md:max-w-[420px]",e),...r}));St.displayName=jt.displayName;const $s=De("group pointer-events-auto relative flex w-full items-center justify-between space-x-2 overflow-hidden rounded-md border p-4 pr-6 shadow-lg transition-all data-[swipe=cancel]:translate-x-0 data-[swipe=end]:translate-x-[var(--radix-toast-swipe-end-x)] data-[swipe=move]:translate-x-[var(--radix-toast-swipe-move-x)] data-[swipe=move]:transition-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[swipe=end]:animate-out data-[state=closed]:fade-out-80 data-[state=closed]:slide-out-to-right-full data-[state=open]:slide-in-from-top-full data-[state=open]:sm:slide-in-from-bottom-full",{variants:{variant:{success:"text-white bg-teal-500",default:"border bg-background text-foreground",destructive:"destructive group border-destructive bg-destructive text-destructive-foreground"}},defaultVariants:{variant:"default"}}),kt=o.forwardRef(({className:e,variant:r,...s},a)=>t.jsx(Tt,{ref:a,className:h($s({variant:r}),e),...s}));kt.displayName=Tt.displayName;const zs=o.forwardRef(({className:e,...r},s)=>t.jsx(Et,{ref:s,className:h("inline-flex h-8 shrink-0 items-center justify-center rounded-md border bg-transparent px-3 text-sm font-medium transition-colors hover:bg-secondary focus:outline-none focus:ring-1 focus:ring-ring disabled:pointer-events-none disabled:opacity-50 group-[.destructive]:border-muted/40 group-[.destructive]:hover:border-destructive/30 group-[.destructive]:hover:bg-destructive group-[.destructive]:hover:text-destructive-foreground group-[.destructive]:focus:ring-destructive",e),...r}));zs.displayName=Et.displayName;const Pt=o.forwardRef(({className:e,...r},s)=>t.jsx(Rt,{ref:s,className:h("absolute right-1 top-1 rounded-md p-1 text-foreground/50 opacity-0 transition-opacity hover:text-foreground focus:opacity-100 focus:outline-none focus:ring-1 group-hover:opacity-100 group-[.destructive]:text-red-300 group-[.destructive]:hover:text-red-50 group-[.destructive]:focus:ring-red-400 group-[.destructive]:focus:ring-offset-red-600",e),"toast-close":"",...r,children:t.jsx(fr,{className:"h-4 w-4"})}));Pt.displayName=Rt.displayName;const _t=o.forwardRef(({className:e,...r},s)=>t.jsx(Ct,{ref:s,className:h("text-sm font-semibold [&+div]:text-xs",e),...r}));_t.displayName=Ct.displayName;const At=o.forwardRef(({className:e,...r},s)=>t.jsx(Nt,{ref:s,className:h("text-sm opacity-90",e),...r}));At.displayName=Nt.displayName;function Ws(){const{toasts:e}=pr();return t.jsxs(Hs,{children:[e.map(({id:r,title:s,description:a,action:n,...i})=>t.jsxs(kt,{...i,children:[t.jsxs("div",{className:"grid gap-1",children:[s&&t.jsx(_t,{children:s}),a&&t.jsx(At,{children:a})]}),n,t.jsx(Pt,{})]},r)),t.jsx(St,{})]})}function aa({children:e}){const{flash:r}=$().props;return o.useEffect(()=>{r!=null&&r.success&&te({title:"Berhasil",description:r.success,variant:"success"}),r!=null&&r.error&&te({title:"Gagal",description:r.error,variant:"destructive"}),r!=null&&r.info&&te({title:"Info",description:r.info}),r!=null&&r.warning&&te({title:"Peringatan",description:r.warning,variant:"default"})},[r]),t.jsx(ur,{defaultTheme:"dark",storageKey:"vite-ui-theme",children:t.jsxs(rt,{children:[t.jsx(ys,{}),t.jsxs("main",{className:"w-full overflow-x-hidden bg-zinc-50 dark:bg-zinc-800",children:[t.jsx("div",{className:"flex h-14 shrink-0 items-center gap-2 transition-[width,height] ease-linear group-has-  [[data-collapsible=icon]]/sidebar-wrapper:h-12 border-b bg-white dark:bg-zinc-950 fixed w-full top-0",children:t.jsx(bs,{})}),t.jsx("div",{className:"mt-[50px]",children:e}),t.jsx(Ws,{})]})]})})}export{aa as A,H as U,k as h};
