@starasia/admin 12.41.1 → 12.42.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/AppLayout/index.d.ts +3 -2
- package/dist/components/RightDrawer/index.d.ts +69 -3
- package/dist/components/TableSection/components/TableSection.d.ts +11 -0
- package/dist/components/TableSection/index.d.ts +11 -0
- package/dist/components/TableSection/types.d.ts +3 -0
- package/dist/entries/App/sidebar.d.ts +7 -6
- package/dist/index.cjs.js +18 -18
- package/dist/index.es.js +3652 -3667
- package/dist/index.umd.js +16 -16
- package/package.json +2 -2
package/dist/index.umd.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
(function(f,gr){typeof exports=="object"&&typeof module<"u"?gr(exports,require("@starasia/alert"),require("@starasia/avatar"),require("@starasia/badges"),require("@starasia/box"),require("@starasia/breadcrumb"),require("@starasia/button"),require("@starasia/card"),require("@starasia/date"),require("@starasia/dialog"),require("@starasia/drawer"),require("@starasia/dropdown"),require("@starasia/hooks"),require("@starasia/http"),require("@starasia/input"),require("@starasia/menu"),require("@starasia/pagination"),require("@starasia/storage"),require("@starasia/table"),require("@starasia/tabs"),require("@starasia/textarea"),require("@starasia/theme"),require("@starasia/toast"),require("@starasia/toggle"),require("@starasia/tooltip"),require("@starasia/checkbox"),require("@starasia/radio"),require("@starasia/text"),require("@starasia/icon"),require("@starasia/flex"),require("@starasia/grid"),require("@starasia/progress"),require("@starasia/stepper"),require("@starasia/accordion"),require("@starasia/story-record"),require("@starasia/skeleton"),require("@starasia/progress-stepper"),require("react/jsx-runtime"),require("react"),require("react-dom"),require("react-easy-crop")):typeof define=="function"&&define.amd?define(["exports","@starasia/alert","@starasia/avatar","@starasia/badges","@starasia/box","@starasia/breadcrumb","@starasia/button","@starasia/card","@starasia/date","@starasia/dialog","@starasia/drawer","@starasia/dropdown","@starasia/hooks","@starasia/http","@starasia/input","@starasia/menu","@starasia/pagination","@starasia/storage","@starasia/table","@starasia/tabs","@starasia/textarea","@starasia/theme","@starasia/toast","@starasia/toggle","@starasia/tooltip","@starasia/checkbox","@starasia/radio","@starasia/text","@starasia/icon","@starasia/flex","@starasia/grid","@starasia/progress","@starasia/stepper","@starasia/accordion","@starasia/story-record","@starasia/skeleton","@starasia/progress-stepper","react/jsx-runtime","react","react-dom","react-easy-crop"],gr):(f=typeof globalThis<"u"?globalThis:f||self,gr(f["@starasia/admin"]={},f.alert,f.avatar,f.badges,f.box,f.breadcrumb,f.button,f.card,f.date,f.dialog,f.drawer,f.dropdown,f.hooks,f.http,f.input,f.menu,f.pagination,f.storage,f.table,f.tabs,f.textarea,f.theme,f.toast,f.toggle,f.tooltip,f.checkbox,f.radio,f.text,f.icon,f.flex,f.grid,f.progress,f.stepper,f.accordion,f.storyRecord,f.skeleton,f.progressStepper,f.jsxRuntime,f.React,f.ReactDOM,f.ReactEasyCrop))})(this,function(f,gr,Ut,cr,u,yr,j,st,hr,Oe,Ar,pr,De,br,ar,O,Br,mr,G,Jt,it,vr,Yt,Cr,me,er,ct,B,T,se,Xt,$t,Kt,Rt,eo,qe,ro,e,d,zr,Hl){"use strict";const Vl={menus:[],menuBottom:void 0,logo:"",appName:"Workspace",userData:null,setUserData:()=>{}},at=d.createContext(Vl),dt=()=>d.useContext(at),to=r=>{const[t,o]=d.useState((r==null?void 0:r.initialUserData)||null);return{userData:t,setUserData:o}},oo=d.createContext({badges:{},setBadge:()=>{},setBadges:()=>{},clearBadge:()=>{}}),lo=({children:r})=>{const[t,o]=d.useState({}),n=d.useCallback(c=>{o(a=>typeof c=="function"?c(a):c)},[]),l=d.useCallback((c,a)=>{o(h=>{const y=typeof a=="function"?a(h[c]):a;return{...h,[c]:y}})},[]),s=d.useCallback(c=>{o(a=>{if(!(c in a))return a;const h={...a};return delete h[c],h})},[]),i=d.useMemo(()=>({badges:t,setBadge:l,setBadges:n,clearBadge:s}),[t,l,n,s]);return e.jsx(oo.Provider,{value:i,children:r})},no=()=>d.useContext(oo),Hr=(r,t)=>{const o=t!==void 0?t:r;return o==null?null:typeof o=="string"||typeof o=="number"?{value:o}:o},Vr=262,ht=Vr,ft=480,Pl="sa-sidebar-width",ut=(r,t,o)=>Math.min(Math.max(r,t),o),jl=(r,t,o,n)=>{if(typeof window>"u")return t;try{const l=window.localStorage.getItem(r);if(!l)return t;const s=parseInt(l,10);return Number.isFinite(s)?ut(s,o,n):t}catch{return t}},so=(r,t)=>{if(!(typeof window>"u"))try{window.localStorage.setItem(r,String(t))}catch{}},io=d.createContext({collapsed:!1,setCollapsed:()=>{},toggle:()=>{},collapse:()=>{},expand:()=>{},width:Vr,setWidth:()=>{},resetWidth:()=>{},minWidth:ht,maxWidth:ft,mobileOpen:!1,setMobileOpen:()=>{},openMobile:()=>{},closeMobile:()=>{},toggleMobile:()=>{}}),co=({children:r,defaultCollapsed:t=!1,defaultWidth:o=Vr,minWidth:n=ht,maxWidth:l=ft,widthStorageKey:s=Pl})=>{const[i,c]=d.useState(t),[a,h]=d.useState(!1),[y,b]=d.useState(()=>jl(s,o,n,l)),p=d.useCallback(k=>{c(z=>typeof k=="function"?k(z):k)},[]),C=d.useCallback(()=>c(k=>!k),[]),E=d.useCallback(()=>c(!0),[]),w=d.useCallback(()=>c(!1),[]),L=d.useCallback(k=>{b(z=>{const W=typeof k=="function"?k(z):k,X=ut(Math.round(W),n,l);return so(s,X),X})},[n,l,s]),F=d.useCallback(()=>{const k=ut(o,n,l);so(s,k),b(k)},[o,n,l,s]),I=d.useCallback(k=>{h(z=>typeof k=="function"?k(z):k)},[]),S=d.useCallback(()=>h(!0),[]),D=d.useCallback(()=>h(!1),[]),H=d.useCallback(()=>h(k=>!k),[]),A=d.useMemo(()=>({collapsed:i,setCollapsed:p,toggle:C,collapse:E,expand:w,width:y,setWidth:L,resetWidth:F,minWidth:n,maxWidth:l,mobileOpen:a,setMobileOpen:I,openMobile:S,closeMobile:D,toggleMobile:H}),[i,p,C,E,w,y,L,F,n,l,a,I,S,D,H]);return e.jsx(io.Provider,{value:A,children:r})},ao=()=>d.useContext(io),ho=d.createContext(null),fo=({adapter:r,children:t})=>e.jsx(ho.Provider,{value:r,children:t}),rr=()=>{const r=d.useContext(ho);if(!r)throw new Error("[@starasia/admin] Router adapter belum dipasang. Bungkus aplikasi dengan <App routerAdapter={...} /> atau <StarasiaRouterProvider adapter={...}>. Import adapter dari '@starasia/admin/adapters/react-router' atau '@starasia/admin/adapters/tanstack'.");return r},uo=({router:r,routerAdapter:t,menus:o=[],menuBottom:n,logo:l,appName:s="Workspace",initialUserData:i,theme:c})=>{const a=to({initialUserData:i}),{theme:h}=vr.useTheme();return e.jsx(fo,{adapter:t,children:e.jsx(at.Provider,{value:{logo:l,appName:s,menus:o,userData:a.userData,setUserData:a.setUserData,menuBottom:n},children:e.jsx(lo,{children:e.jsx(co,{children:c?e.jsx(vr.ThemeProvider,{value:c,children:r}):h?e.jsx(vr.ThemeProvider,{value:h,children:r}):r})})})})},Nl=d.memo(uo);function go({collapsed:r=!1,children:t}){if(!t)return null;const o=typeof t=="function",n=o?t({collapsed:r}):t;return n==null||n===!1?null:e.jsx("div",{style:{position:"sticky",top:"var(--app-header-height, 4rem)",zIndex:1,borderBottom:"1px solid var(--sa-border-subtle, #0b120e24)",paddingLeft:"0.5rem",paddingRight:"0.5rem",paddingTop:"0.5rem",paddingBottom:"0.5rem",boxSizing:"border-box"},children:o?n:e.jsx("div",{style:{opacity:r?0:1,transition:"opacity 0.3s",visibility:r?"hidden":"visible"},children:n})})}const gt=d.createContext(null);function yo({children:r}){const[t,o]=d.useState(null),[n,l]=d.useState(null),[s,i]=d.useState(null),[c,a]=d.useState(0),h=d.useCallback(()=>(a(y=>y+1),()=>a(y=>y-1)),[]);return e.jsx(gt.Provider,{value:{prependNode:t,appendNode:n,replaceNode:s,setPrependNode:o,setAppendNode:l,setReplaceNode:i,replaceCount:c,registerReplace:h},children:r})}function po({children:r}){const t=d.useContext(gt);return t?e.jsxs(e.Fragment,{children:[e.jsx("div",{ref:t.setPrependNode,style:{display:"contents"}}),t.replaceCount>0?e.jsx("div",{ref:t.setReplaceNode,style:{display:"contents"}}):r,e.jsx("div",{ref:t.setAppendNode,style:{display:"contents"}})]}):e.jsx(e.Fragment,{children:r})}function _l({children:r,mode:t="append"}){const o=d.useContext(gt);if(d.useEffect(()=>{if(!(t!=="replace"||!o))return o.registerReplace()},[t,o]),!o)return process.env.NODE_ENV!=="production"&&console.warn("[HeaderLeftSlot] used outside AppLayout — content not rendered"),null;const n=t==="prepend"?o.prependNode:t==="replace"?o.replaceNode:o.appendNode;return n?zr.createPortal(r,n):null}const yt=d.createContext(null);function bo({children:r}){const[t,o]=d.useState({}),[n,l]=d.useState({}),s=d.useCallback((a,h)=>{o(y=>y[a]===h?y:{...y,[a]:h})},[]),i=d.useCallback(a=>(l(h=>({...h,[a]:(h[a]??0)+1})),()=>l(h=>({...h,[a]:Math.max(0,(h[a]??0)-1)}))),[]),c=d.useMemo(()=>({outletNodes:t,setOutletNode:s,slotCounts:n,registerSlot:i}),[t,s,n,i]);return e.jsx(yt.Provider,{value:c,children:r})}function vo({slotKey:r,fallback:t}){const o=d.useContext(yt),n=o?(o.slotCounts[r]??0)>0:!1,l=d.useRef(o==null?void 0:o.setOutletNode);l.current=o==null?void 0:o.setOutletNode;const s=d.useCallback(i=>{var c;return(c=l.current)==null?void 0:c.call(l,r,i)},[r]);return e.jsx(e.Fragment,{children:n?e.jsx("div",{ref:s,style:{display:"contents"}}):t})}function ql({slotKey:r,children:t}){const o=d.useContext(yt),n=d.useRef(o==null?void 0:o.registerSlot);if(n.current=o==null?void 0:o.registerSlot,d.useEffect(()=>{var s;return(s=n.current)==null?void 0:s.call(n,r)},[r]),!o)return process.env.NODE_ENV!=="production"&&console.warn("[SidebarGroupSlot] used outside AppLayout — content not rendered"),null;const l=o.outletNodes[r];return l?zr.createPortal(t,l):null}const Pr="moduleSwitcherGroupId",pt="sa-module-switcher-change";function Co(){if(typeof window>"u")return null;const r=window.localStorage.getItem(Pr);if(r===null)return null;const t=Number(r);return Number.isFinite(t)?t:null}function xo(r){typeof window>"u"||(r===null?window.localStorage.removeItem(Pr):window.localStorage.setItem(Pr,String(r)),window.dispatchEvent(new CustomEvent(pt,{detail:r})))}function Zl(){xo(null)}function bt(){const[r,t]=d.useState(()=>Co());return d.useEffect(()=>{const n=()=>{t(Co())},l=s=>{s.key===Pr&&n()};return window.addEventListener(pt,n),window.addEventListener("storage",l),()=>{window.removeEventListener(pt,n),window.removeEventListener("storage",l)}},[]),{selectedGroupId:r,setSelectedGroupId:n=>{xo(n),t(n)}}}let jr=0,fr=!1,wo=new Set;const Do=()=>e.jsxs("svg",{width:"100%",height:"100%",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.25",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[e.jsx("rect",{x:"1.667",y:"1.667",width:"12.667",height:"12.667",rx:"2"}),e.jsx("line",{x1:"6",y1:"1.667",x2:"6",y2:"14.333"})]});function Gl(r){const[t,o]=d.useState(!1),n=d.useRef(null),l=d.useRef(null);return d.useLayoutEffect(()=>{const s=n.current;if(!s)return;let i=0;const c=()=>{i=0;const h=l.current;if(!h)return;const y=h.scrollWidth>s.clientWidth;o(b=>b===y?b:y)},a=new ResizeObserver(()=>{i||(i=requestAnimationFrame(c))});return a.observe(s),c(),()=>{i&&cancelAnimationFrame(i),a.disconnect()}},[r]),{containerRef:n,textRef:l,truncated:t}}function So({text:r,textStyle:t}){const{containerRef:o,textRef:n,truncated:l}=Gl(r),s=e.jsx("span",{ref:n,style:{display:"block",fontSize:"0.875rem",fontWeight:"500",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",...t},children:r});return e.jsx("div",{ref:o,style:{flex:1,minWidth:0},children:l?e.jsx(me.Tooltip,{fluid:!0,label:r,position:"top",children:s}):s})}const ko={width:"100%",display:"flex",alignItems:"center",gap:"0.75rem",paddingLeft:"0.75rem",paddingRight:"0.75rem",paddingTop:"0.5rem",paddingBottom:"0.5rem",fontSize:"0.875rem",color:"var(--sa-text-subtle, #8c8f97)",background:"transparent",border:"none",borderRadius:"0.375rem",cursor:"pointer",textAlign:"left"},Ql=200,Bo=16;function Ul({children:r,headerLeftSlot:t,profile:o,isLoadingProfile:n,onLogout:l,isLoggingOut:s,loadingComponent:i,sidebarHeaderContent:c,headerActions:a,profileRole:h,profileMenuButtons:y,profileMenuItems:b,logoutButton:p,resizableSidebar:C=!0}){var ur,dr;const{useSearchParams:E,useNavigate:w,useLocation:L,Outlet:F}=rr(),[I]=E(),S=I.get("embed")==="true",D=dt(),{badges:H}=no(),A=w(),k=L(),W=!De.useMediaQuery("md"),[X,K]=d.useState(!1),{collapsed:Q,setCollapsed:_,width:R,setWidth:re,resetWidth:q,minWidth:P,maxWidth:N,mobileOpen:ce,setMobileOpen:xe}=ao(),[Ae,ue]=d.useState(!1),[Se,Be]=d.useState(()=>new Set(wo)),[ze,He]=d.useState(null),{selectedGroupId:Le,setSelectedGroupId:je}=bt();d.useEffect(()=>{wo=Se},[Se]);const we=d.useRef(null),Pe=d.useRef(null),Ge=d.useRef(null),[Xe,ke]=d.useState(!1),[tr,Dr]=d.useState(null),V=C&&!W&&!Q,ee=m=>Math.min(Math.max(m,P),N),U=tr??R,de=m=>{var ye,Ke,Fe;if(!V)return;m.preventDefault();const J=m.clientX,Y=((ye=Ge.current)==null?void 0:ye.getBoundingClientRect().width)??R;(Fe=(Ke=m.currentTarget).setPointerCapture)==null||Fe.call(Ke,m.pointerId),ke(!0),document.body.style.userSelect="none",document.body.style.cursor="col-resize";let ge=0,Te=Y;const Je=Sr=>{Te=Y+(Sr.clientX-J),ge||(ge=requestAnimationFrame(()=>{ge=0,Dr(ee(Te))}))},Ce=()=>{ge&&cancelAnimationFrame(ge),window.removeEventListener("pointermove",Je),window.removeEventListener("pointerup",Ce),document.body.style.userSelect="",document.body.style.cursor="",Dr(null),ke(!1),Te<Ql?(re(P),_(!0)):re(ee(Te))};window.addEventListener("pointermove",Je),window.addEventListener("pointerup",Ce)},ne=m=>{V&&(m.key==="ArrowLeft"?(m.preventDefault(),re(J=>J-Bo)):m.key==="ArrowRight"?(m.preventDefault(),re(J=>J+Bo)):m.key==="Home"?(m.preventDefault(),re(P)):m.key==="End"&&(m.preventDefault(),re(N)))};d.useEffect(()=>{const m=we.current;if(!m)return;const J=()=>{fr||(jr=m.scrollTop)};return m.addEventListener("scroll",J),()=>m.removeEventListener("scroll",J)},[]);const pe=()=>{const m=we.current;m&&jr>0&&(fr=!0,m.scrollTop=jr,requestAnimationFrame(()=>{fr=!1}))};d.useLayoutEffect(()=>{fr=!0,pe();const m=setTimeout(()=>{fr=!1},300);return()=>clearTimeout(m)},[]),d.useLayoutEffect(()=>{D.menus.length>0&&(jr>0?pe():requestAnimationFrame(()=>{var J;const m=(J=we.current)==null?void 0:J.querySelector("[data-menu-active='true']");m&&m.scrollIntoView({block:"center",behavior:"instant"})}))},[D.menus]),d.useEffect(()=>{fr=!0,pe();const m=setTimeout(pe,0),J=setTimeout(pe,50),Y=setTimeout(pe,100),ge=setTimeout(pe,200),Te=setTimeout(()=>{fr=!1},300),Je=setTimeout(()=>{const Ce=we.current,ye=Ce==null?void 0:Ce.querySelector("[data-menu-active='true']");if(Ce&&ye){const Ke=Ce.getBoundingClientRect(),Fe=ye.getBoundingClientRect();Fe.top>=Ke.top&&Fe.bottom<=Ke.bottom||ye.scrollIntoView({block:"center",behavior:"smooth"})}},250);return()=>{clearTimeout(m),clearTimeout(J),clearTimeout(Y),clearTimeout(ge),clearTimeout(Te),clearTimeout(Je)}},[k.pathname]),d.useEffect(()=>{Pe.current&&(Pe.current.scrollTop=0)},[k.pathname]),d.useEffect(()=>{W&&xe(!1)},[k.pathname,W]),d.useEffect(()=>{W&&_(!0)},[W]);const $e=()=>{K(!0)},Qe=()=>{K(!1)},Ne=()=>{K(!1),l()},Ee=m=>{const J=[m.to];return m.children&&J.push(...m.children.map(Y=>Y.to)),J},Ue=[...D.menus.flatMap(m=>m.items.flatMap(Ee)),...((ur=D.menuBottom)==null?void 0:ur.flatMap(Ee))??[]],he=m=>{if(!k.pathname.startsWith(m))return!1;const J=Ue.filter(Y=>k.pathname.startsWith(Y)).sort((Y,ge)=>ge.length-Y.length)[0];return m===J};d.useEffect(()=>{var J;const m=Y=>{var ge;(ge=Y.children)!=null&&ge.some(Te=>k.pathname.startsWith(Te.to))&&Be(Te=>{const Je=new Set(Te);return Je.add(Y.id),Je})};D.menus.forEach(Y=>{Y.items.forEach(m)}),(J=D.menuBottom)==null||J.forEach(m)},[k.pathname,D.menus,D.menuBottom]);const or=m=>{Be(J=>{const Y=new Set(J);return Y.has(m)?Y.delete(m):Y.add(m),Y})};d.useEffect(()=>{D.menus.length!==0&&Le!==null&&!D.menus.some(m=>m.id===Le)&&je(null)},[D.menus,Le,je]);const lr=d.useMemo(()=>{if(Le!==null)return D.menus.filter(Y=>Y.id===Le||Y.parentGroupId===Le);const m=D.menus.filter(Y=>Y.parentGroupId===void 0),J=D.menus.filter(Y=>Y.parentGroupId!==void 0).flatMap(Y=>Y.items);return J.length===0?m:[...m,{id:18,name:"Pengaturan",items:J,parentGroupId:void 0}]},[D.menus,Le]);if(S)return e.jsx("main",{style:{height:"100vh",overflowY:"auto",backgroundColor:"var(--sa-background-primary-inverse, #f8f8f8)"},children:r||e.jsx(F,{})});const sr=m=>{const J=m.children&&m.children.length>0,Y=Se.has(m.id),ge=J?m.children.some(Ce=>he(Ce.to)):he(m.to),Te=Hr(m.badge,H[m.id]),Je=!!Te&&Q&&!W;return e.jsxs("div",{"data-menu-active":ge||void 0,children:[e.jsxs("button",{onClick:Ce=>{if(J)if(Q&&!W){const ye=Ce.currentTarget.getBoundingClientRect();He({item:m,top:ye.top,left:ye.right+8})}else or(m.id);else A(m.to)},style:{width:"100%",display:"flex",alignItems:"center",justifyContent:Q&&!W?"center":void 0,gap:"0.5rem",paddingLeft:Q&&!W?"0":"0.5rem",paddingRight:Q&&!W?"0":"0.5rem",paddingTop:"0.25rem",paddingBottom:"0.25rem",height:"2rem",borderRadius:ge?"var(--sa-radii-sm, 0.375rem)":"var(--sa-radii-md, 0.5rem)",textAlign:"left",border:ge?"1px solid var(--sa-border-subtle, #0b120e24)":"1px solid transparent",backgroundColor:ge?"var(--sa-background-primary, #ffffff)":"transparent",color:"var(--sa-text-primary, #292a2e)",cursor:"pointer"},title:Q&&!W?m.title:void 0,onMouseEnter:Ce=>{ge||(Ce.currentTarget.style.backgroundColor="var(--sa-background-neutral, #f0f1f2)")},onMouseLeave:Ce=>{ge||(Ce.currentTarget.style.backgroundColor="transparent")},children:[e.jsxs("span",{style:{position:"relative",display:"inline-flex",flexShrink:0},children:[e.jsx(T.Icon,{name:m.icon,size:"sm",style:{flexShrink:0}}),Je&&e.jsx("span",{"aria-hidden":"true",style:{position:"absolute",top:"-2px",right:"-2px",width:"0.5rem",height:"0.5rem",borderRadius:"9999px",backgroundColor:"var(--sa-color-error-500, #ff4d6d)",border:"1px solid var(--sa-background-primary, #ffffff)"}})]}),(!Q||W)&&e.jsxs(e.Fragment,{children:[e.jsx(So,{text:m.title,textStyle:{transition:"opacity 0.3s"}}),Te&&e.jsx(cr.Badges,{text:String(Te.value),variant:Te.variant??"info",size:"xs",border:!0}),J&&e.jsx("svg",{style:{width:"1rem",height:"1rem",flexShrink:0,transition:"transform 0.2s",transform:Y?"rotate(180deg)":"rotate(0deg)"},fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 9l-7 7-7-7"})})]})]}),J&&(!Q||W)&&(()=>{const Ce=m.children.findIndex(ye=>he(ye.to));return e.jsxs("div",{style:{position:"relative",marginLeft:"0.9375rem",paddingLeft:"1.125rem",overflow:"hidden",transition:"all 0.3s ease-in-out",maxHeight:Y?`${m.children.length*36}px`:"0px",opacity:Y?1:0,marginTop:Y?"0.25rem":"0px"},children:[e.jsx("span",{"aria-hidden":"true",style:{position:"absolute",left:0,top:0,width:"1.5px",height:"100%",backgroundColor:"var(--sa-border-subtle, #0b120e24)",pointerEvents:"none"}}),Ce>=0&&e.jsx("span",{"aria-hidden":"true",style:{position:"absolute",left:0,top:`${Ce*32}px`,width:"1.5px",height:"32px",backgroundColor:"var(--sa-text-primary, #292a2e)",transition:"top 0.2s ease-in-out",pointerEvents:"none",zIndex:1}}),m.children.map(ye=>{const Ke=Hr(ye.badge,H[ye.id]);return e.jsxs("button",{onClick:()=>A(ye.to),style:{width:"100%",display:"flex",alignItems:"center",gap:"0.5rem",paddingLeft:"0.75rem",paddingRight:"0.5rem",paddingTop:"0.25rem",paddingBottom:"0.25rem",height:"2rem",borderRadius:he(ye.to)?"var(--sa-radii-sm, 0.375rem)":"var(--sa-radii-md, 0.5rem)",textAlign:"left",backgroundColor:he(ye.to)?"var(--sa-background-primary, #ffffff)":"transparent",color:he(ye.to)?"var(--sa-text-primary, #292a2e)":"var(--sa-text-subtle, #505258)",cursor:"pointer",border:he(ye.to)?"1px solid var(--sa-border-subtle, #0b120e24)":"1px solid transparent"},onMouseEnter:Fe=>{he(ye.to)||(Fe.currentTarget.style.backgroundColor="var(--sa-background-neutral, #f0f1f2)")},onMouseLeave:Fe=>{he(ye.to)||(Fe.currentTarget.style.backgroundColor="transparent")},children:[e.jsx(T.Icon,{name:ye.icon,size:"sm",style:{flexShrink:0}}),e.jsx(So,{text:ye.title}),Ke&&e.jsx(cr.Badges,{text:String(Ke.value),variant:Ke.variant??"info",size:"xs",border:!0})]},ye.id)})]})})()]},m.id)};return e.jsx(bo,{children:e.jsxs(yo,{children:[e.jsxs("div",{style:{display:"flex",height:"100vh",position:"relative","--app-header-height":"44px","--app-sidebar-width":W?"0px":Q?"4.375rem":`${U}px`,"--app-footer-zindex":W&&ce?"40":"998"},children:[W&&e.jsx("div",{style:{position:"fixed",inset:0,backgroundColor:"var(--sa-color-black-alpha-a50, #181a198f)",zIndex:40,opacity:ce?.5:0,pointerEvents:ce?"auto":"none",transition:"opacity 0.3s"},onClick:()=>xe(!1)}),e.jsxs("aside",{ref:Ge,style:{width:W?"16.375rem":Q?"4.375rem":`${U}px`,position:W?"fixed":"relative",...W&&{inset:0,zIndex:50,transform:ce?"translateX(0)":"translateX(-100%)"},backgroundColor:"var(--sa-background-primary-inverse, #f8f8f8)",borderRight:"1px solid var(--sa-border-subtle, #0b120e24)",display:"flex",flexDirection:"column",transition:Xe?"none":"all 0.3s ease-in-out",flexShrink:W?void 0:0,minWidth:0},children:[e.jsx("div",{onMouseEnter:()=>ue(!0),onMouseLeave:()=>ue(!1),style:{height:"var(--app-header-height, 4rem)",display:"flex",alignItems:"center",justifyContent:"space-between",paddingLeft:"1rem",paddingRight:"1rem",borderBottom:"1px solid var(--sa-border-subtle, #0b120e24)",position:"relative"},children:(()=>{const m=!W&&Q&&!ce,J=m&&Ae;return e.jsxs(e.Fragment,{children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"0.5rem",flex:m?1:void 0,justifyContent:m?"center":void 0,transition:"opacity 0.2s",opacity:J?0:1,pointerEvents:J?"none":"auto"},children:[e.jsx("img",{src:D.logo,alt:"Logo",style:{width:"1.5rem",height:"1.5rem",flexShrink:0}}),(!Q||ce)&&e.jsx("span",{style:{fontSize:"var(--sa-font-size-md, 0.875rem)",fontWeight:"600",color:"var(--sa-text-primary, #292a2e)",whiteSpace:"nowrap",transition:"opacity 0.3s"},children:D.appName})]}),!W&&!Q&&e.jsx("button",{type:"button",onClick:()=>_(!0),"aria-label":"Collapse sidebar",style:{display:"inline-flex",alignItems:"center",justifyContent:"center",width:"1rem",height:"1rem",padding:0,background:"transparent",border:"none",color:"var(--sa-text-subtle, #8c8f97)",cursor:"pointer",flexShrink:0},children:e.jsx(Do,{})}),m&&e.jsx("button",{type:"button",onClick:()=>_(!1),"aria-label":"Expand sidebar",style:{position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%)",display:"inline-flex",alignItems:"center",justifyContent:"center",width:"2rem",height:"2rem",padding:0,background:"var(--sa-background-primary, #ffffff)",border:"1px solid var(--sa-border-subtle, #0b120e24)",borderRadius:"var(--sa-radii-sm, 0.375rem)",color:"var(--sa-text-primary, #292a2e)",cursor:"pointer",opacity:J?1:0,pointerEvents:J?"auto":"none",transition:"opacity 0.2s"},children:e.jsx("span",{style:{width:"1rem",height:"1rem",display:"inline-flex"},children:e.jsx(Do,{})})}),W&&e.jsx("button",{onClick:()=>xe(!1),"aria-label":"Close menu",style:{padding:"0.375rem",borderRadius:"0.5rem",backgroundColor:"transparent",border:"none",color:"var(--sa-text-subtle, #8c8f97)",cursor:"pointer"},children:e.jsx("svg",{style:{width:"1.25rem",height:"1.25rem"},fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})]})})()}),c&&e.jsx(go,{collapsed:W?!1:Q,children:c}),e.jsx("div",{ref:we,style:{flex:1,overflowY:"auto",paddingTop:"1rem",paddingBottom:"1rem"},children:lr.map(m=>e.jsxs("div",{style:{marginBottom:"1rem"},children:[!Q||W?m.name&&e.jsx("div",{style:{paddingLeft:"1.5rem",paddingRight:"1rem",paddingTop:"0rem",paddingBottom:"0.25rem",fontSize:"0.875rem",fontWeight:"400",color:"var(--sa-text-subtlest, #6b6e76)",transition:"opacity 0.3s",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:m.name}):m.name&&e.jsx("div",{"aria-label":m.name,style:{display:"flex",alignItems:"center",justifyContent:"center",paddingTop:"0.75rem",paddingBottom:"0.75rem"},children:e.jsx("span",{style:{display:"block",width:"1rem",height:"2px",borderRadius:"1px",backgroundColor:m.color??"var(--sa-background-brand, #04254f)"}})}),e.jsx("div",{style:{paddingLeft:"1rem",paddingRight:"1rem",display:"flex",flexDirection:"column",gap:"var(--sa-spacing-xs, 0.25rem)"},children:m.slotKey?e.jsx(vo,{slotKey:m.slotKey,fallback:m.items.map(J=>sr(J))}):m.items.map(J=>sr(J))})]},m.id))}),D.menuBottom&&D.menuBottom.length>0&&e.jsx("div",{style:{borderTop:"1px solid var(--sa-border-subtle, #0b120e24)",paddingTop:"0.75rem",paddingBottom:"0.75rem",paddingLeft:"1rem",paddingRight:"1rem",backgroundColor:"var(--sa-background-primary-inverse, #f8f8f8)",display:"flex",flexDirection:"column",gap:"var(--sa-spacing-xs, 0.25rem)",flexShrink:0},children:D.menuBottom.map(m=>sr(m))}),V&&e.jsx("div",{role:"separator","aria-orientation":"vertical","aria-label":"Resize sidebar","aria-valuenow":R,"aria-valuemin":P,"aria-valuemax":N,tabIndex:0,onPointerDown:de,onKeyDown:ne,onDoubleClick:q,title:"Drag to resize · double-click to reset",style:{position:"absolute",top:0,right:0,width:"6px",height:"100%",transform:"translateX(50%)",cursor:"col-resize",zIndex:5,touchAction:"none",background:Xe?"var(--sa-background-brand, #04254f)":"transparent",transition:"background 0.15s"},onMouseEnter:m=>{Xe||(m.currentTarget.style.background="var(--sa-border-bold, #0b120e40)")},onMouseLeave:m=>{Xe||(m.currentTarget.style.background="transparent")}})]}),e.jsxs("div",{style:{flex:1,display:"flex",flexDirection:"column",overflow:"hidden"},children:[e.jsxs("header",{style:{height:"var(--app-header-height, 4rem)",backgroundColor:"var(--sa-background-primary, #ffffff)",borderBottom:"1px solid var(--sa-border-subtle, #0b120e24)",display:"flex",alignItems:"center",justifyContent:"space-between",paddingLeft:"1rem",paddingRight:"1rem",flexShrink:0},children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:W?"1rem":void 0},children:[W&&e.jsx("button",{onClick:()=>xe(!0),style:{padding:"0.375rem",borderRadius:"0.5rem",backgroundColor:"transparent",border:"none",color:"var(--sa-text-subtle, #8c8f97)",cursor:"pointer"},children:e.jsx("svg",{style:{width:"1.5rem",height:"1.5rem"},fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 6h16M4 12h16M4 18h16"})})}),e.jsx(po,{children:t})]}),e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"0.75rem"},children:[a,e.jsxs(O.Menu,{position:"bottom-right",children:[e.jsx(O.MenuButton,{children:e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"0.5rem",cursor:"pointer"},children:[e.jsxs("div",{style:{textAlign:"right",maxWidth:"12.5rem"},children:[e.jsx("p",{style:{margin:0,fontSize:"var(--sa-font-size-sm, 0.75rem)",fontWeight:500,color:"var(--sa-text-subtle, #8c8f97)",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:n?"Loading...":(o==null?void 0:o.name)||"unknown"}),e.jsx("p",{style:{margin:0,fontSize:"var(--sa-font-size-xs, 0.625rem)",color:"var(--sa-text-subtle, #8c8f97)",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:n?"":(o==null?void 0:o.email)||"unknown"})]}),e.jsx("div",{style:{width:"2rem",height:"2rem",borderRadius:"9999px",display:"flex",alignItems:"center",justifyContent:"center",color:"var(--sa-background-primary, #ffffff)",fontWeight:600,fontSize:"0.875rem",boxShadow:"var(--sa-shadow-sm, 0 1px 2px 0 #0000000d)",flexShrink:0,backgroundColor:"var(--sa-background-brand, #04254f)"},children:((o==null?void 0:o.name)||"U")[0].toUpperCase()}),e.jsx(T.Icon,{name:"ChevronDown",size:"sm",style:{color:"var(--sa-text-subtle, #8c8f97)"}})]})}),e.jsxs(O.MenuLists,{width:280,style:{paddingBlock:"12px",paddingInline:"12px",gap:"8px",marginTop:"16px"},children:[e.jsx(O.MenuHeading,{children:e.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:"center",textAlign:"center",paddingBlock:"0.5rem"},children:[e.jsx("div",{style:{width:"4rem",height:"4rem",borderRadius:"9999px",display:"flex",alignItems:"center",justifyContent:"center",color:"var(--sa-background-primary, #ffffff)",fontWeight:600,fontSize:"1.25rem",boxShadow:"var(--sa-shadow-sm, 0 1px 2px 0 #0000000d)",marginBottom:"0.75rem",backgroundColor:"var(--sa-background-brand, #04254f)"},children:((o==null?void 0:o.name)||"U")[0].toUpperCase()}),e.jsx("p",{style:{margin:0,fontSize:"0.875rem",fontWeight:600,color:"var(--sa-text-primary, #292a2e)",maxWidth:"100%",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:(o==null?void 0:o.name)||"unknown"}),e.jsx("p",{style:{margin:0,fontSize:"0.75rem",color:"var(--sa-text-subtle, #8c8f97)",maxWidth:"100%",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:(o==null?void 0:o.email)||"unknown"}),h&&e.jsx("p",{style:{margin:0,fontSize:"0.75rem",color:"var(--sa-text-subtle, #8c8f97)",maxWidth:"100%",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:h})]})}),(y&&y.length>0||b)&&e.jsxs(O.MenuBody,{children:[y==null?void 0:y.map((m,J)=>e.jsx(O.MenuButton,{children:e.jsxs("button",{type:"button",onClick:m.onClick,style:ko,onMouseEnter:Y=>{Y.currentTarget.style.backgroundColor="var(--sa-background-neutral, #f0f1f2)"},onMouseLeave:Y=>{Y.currentTarget.style.backgroundColor="transparent"},children:[e.jsx(T.Icon,{name:m.icon,size:"md"}),e.jsx("span",{children:m.label})]})},`${m.label}-${J}`)),b]}),p??e.jsx(O.MenuFooter,{children:e.jsx(O.MenuButton,{children:e.jsxs("button",{type:"button",onClick:$e,style:{...ko,color:"var(--sa-background-error, #c9184a)",fontWeight:500},onMouseEnter:m=>{m.currentTarget.style.backgroundColor="var(--sa-color-error-50, #fff0f3)"},onMouseLeave:m=>{m.currentTarget.style.backgroundColor="transparent"},children:[e.jsx(T.Icon,{name:"Logout",size:"md",style:{color:"var(--sa-background-error, #c9184a)"}}),e.jsx("span",{children:"Logout"})]})})})]})]})]})]}),e.jsx("main",{ref:Pe,style:{flex:1,overflowY:"auto"},children:r||e.jsx(F,{})})]})]}),s&&i&&e.jsx("div",{style:{position:"fixed",inset:0,background:"var(--sa-color-black-alpha-a70, #181a19b8)",display:"flex",alignItems:"center",justifyContent:"center",zIndex:9999},children:i}),e.jsxs(Oe.Dialog,{isShow:X,onHide:Qe,children:[e.jsx(Oe.DialogTitle,{children:"Confirmation Logout"}),e.jsx(Oe.DialogBody,{children:"Are you sure you want to end the session and exit the page?"}),e.jsx(Oe.DialogFooter,{children:e.jsx(u.Box,{direction:"column",display:"flex",align:"flex-end",justify:"center",children:e.jsxs(se.Flex,{direction:"row",gap:"sm",align:"center",children:[e.jsx(u.Box,{direction:"column",children:e.jsx(j.Button,{secondary:!0,onClick:Qe,children:"Cancel"})}),e.jsx(u.Box,{direction:"column",children:e.jsx(j.Button,{primary:!0,onClick:Ne,children:"Yes, Sure"})})]})})})]}),ze&&e.jsxs(e.Fragment,{children:[e.jsx("div",{onClick:()=>He(null),style:{position:"fixed",inset:0,zIndex:60,backgroundColor:"transparent"}}),e.jsxs("div",{role:"dialog","aria-label":ze.item.title,style:{position:"fixed",top:ze.top,left:ze.left,zIndex:61,minWidth:"13rem",maxWidth:"16rem",backgroundColor:"var(--sa-background-primary, #ffffff)",border:"1px solid var(--sa-border-subtle, #0b120e24)",borderRadius:"var(--sa-radii-md, 0.5rem)",boxShadow:"var(--sa-shadow-lg, 0 10px 15px -3px #0000001a, 0 4px 6px -4px #0000001a)",padding:"0.5rem",display:"flex",flexDirection:"column",gap:"0.125rem"},children:[e.jsx("div",{style:{fontSize:"0.75rem",fontWeight:600,color:"var(--sa-color-gray-500, #8c8f97)",padding:"0.25rem 0.5rem 0.5rem",textTransform:"uppercase",letterSpacing:"0.05em"},children:ze.item.title}),(dr=ze.item.children)==null?void 0:dr.map(m=>{const J=he(m.to),Y=Hr(m.badge,H[m.id]);return e.jsxs("button",{onClick:()=>{A(m.to),He(null)},style:{width:"100%",display:"flex",alignItems:"center",gap:"0.75rem",padding:"0.5rem 0.75rem",borderRadius:"var(--sa-radii-md, 0.5rem)",textAlign:"left",backgroundColor:J?"var(--sa-color-gray-100, #f8f8f8)":"transparent",color:J?"var(--sa-text-primary, #292a2e)":"var(--sa-color-gray-800, #505258)",border:"1px solid transparent",cursor:"pointer",fontSize:"0.875rem",fontWeight:500},onMouseEnter:ge=>{J||(ge.currentTarget.style.backgroundColor="var(--sa-color-gray-100, #f8f8f8)")},onMouseLeave:ge=>{J||(ge.currentTarget.style.backgroundColor="transparent")},children:[m.icon&&e.jsx(T.Icon,{name:m.icon,size:"sm",style:{flexShrink:0}}),e.jsx("span",{style:{flex:1,whiteSpace:"nowrap"},children:m.title}),Y&&e.jsx(cr.Badges,{text:String(Y.value),variant:Y.variant??"info",size:"xs",border:!0})]},m.id)})]})]})]})})}const Er=d.forwardRef(({children:r,...t},o)=>e.jsx(u.Box,{ref:o,role:"button",cursor:"pointer","aria-pressed":"true",display:"inline-block",tabIndex:0,...t,children:r})),mo=({title:r,iconName:t,textColor:o,iconColor:n,hoverTextColor:l,hoverIconColor:s})=>{const[i,c]=d.useState(!1),a=n??"var(--sa-text-subtle, #8c8f97)",h=o??"var(--sa-text-subtle, #8c8f97)",y=s??"var(--sa-text-subtle, #8c8f97)",b=l??"var(--sa-text-primary, #292a2e)";return e.jsxs(u.Box,{direction:"row",gap:"xs",align:"center",onMouseEnter:()=>c(!0),onMouseLeave:()=>c(!1),style:{cursor:"pointer"},children:[e.jsx(T.Icon,{name:t||"ChevronLeft",size:"xs",style:{color:i?y:a,transition:"color 0.15s ease"}}),e.jsx(B.Text,{variant:"sub-h3",style:{color:i?b:h,transition:"color 0.15s ease"},children:r||"Back"})]})},Jl=({items:r,separator:t="/",iconName:o,iconColor:n,hoverIconColor:l})=>{const{Link:s}=rr(),[i,c]=d.useState(!1),a=n??"var(--sa-text-subtle, #8c8f97)",h=l??"var(--sa-text-subtle, #8c8f97)",y=r.length>1?r[0]:void 0,b=!!(y!=null&&y.to||y!=null&&y.onClick),p=e.jsx(T.Icon,{name:o||"ChevronLeft",size:"xs",onMouseEnter:b?()=>c(!0):void 0,onMouseLeave:b?()=>c(!1):void 0,style:{color:b&&i?h:a,transition:"color 0.15s ease",cursor:b?"pointer":void 0}}),C=y!=null&&y.to?e.jsx(s,{to:y.to,replace:!0,style:{textDecoration:"none"},children:p}):y!=null&&y.onClick?e.jsx(Er,{onClick:y.onClick,children:p}):p;return e.jsxs(u.Box,{direction:"row",gap:"xs",align:"center",children:[C,e.jsx(yr.Breadcrumb,{separator:t,size:"md",children:r.map((E,w)=>{const L=w===r.length-1;return E.to&&!L?e.jsx(yr.BreadcrumbItem,{children:e.jsx(s,{to:E.to,children:E.label})},w):e.jsx(yr.BreadcrumbItem,{currentPage:L,children:e.jsx(yr.BreadcrumbLink,{onClick:L?void 0:E.onClick,children:E.label})},w)})})]})},Yl=r=>{const{Link:t}=rr(),{items:o,separator:n,onClick:l,navigateTo:s,...i}=r;return o&&o.length>0?e.jsx(Jl,{items:o,separator:n,iconName:i.iconName,iconColor:i.iconColor,hoverIconColor:i.hoverIconColor}):s?e.jsx(u.Box,{direction:"row",children:e.jsx(t,{to:s,replace:!0,style:{textDecoration:"none"},children:e.jsx(mo,{...i})})}):e.jsx(u.Box,{direction:"row",children:e.jsx(Er,{onClick:l,children:e.jsx(mo,{...i})})})},vt=[{icon:"var(--sa-color-brand-400, #3366b7)",activeBg:"var(--sa-color-brand-50, #e6edf6)",activeBorder:"var(--sa-color-brand-300, #668cc9)",activeShadow:"rgba(51, 102, 183, 0.25)"},{icon:"var(--sa-color-warning-400, #ed9f30)",activeBg:"var(--sa-color-warning-50, #fef2e6)",activeBorder:"var(--sa-color-warning-300, #f1b259)",activeShadow:"rgba(237, 159, 48, 0.25)"},{icon:"var(--sa-color-secondary-300, #5468e1)",activeBg:"var(--sa-color-secondary-50, #e6e9fb)",activeBorder:"var(--sa-color-secondary-200, #8a98ea)",activeShadow:"rgba(84, 104, 225, 0.25)"},{icon:"var(--sa-color-info-500, #00abeb)",activeBg:"var(--sa-color-info-50, #effaff)",activeBorder:"var(--sa-color-info-300, #75dbff)",activeShadow:"rgba(0, 171, 235, 0.25)"},{icon:"var(--sa-color-success-500, #30ce84)",activeBg:"var(--sa-color-success-50, #ecfff6)",activeBorder:"var(--sa-color-success-300, #75dead)",activeShadow:"rgba(48, 206, 132, 0.25)"},{icon:"var(--sa-color-error-400, #ff758f)",activeBg:"var(--sa-color-error-50, #fff0f3)",activeBorder:"var(--sa-color-error-300, #ff8fa3)",activeShadow:"rgba(255, 117, 143, 0.25)"}];function Eo(r,t,o){return{display:"flex",alignItems:"center",justifyContent:"center",width:"64px",height:"64px",borderRadius:"var(--sa-radii-sm, 6px)",border:r?`2px solid ${o.activeBorder}`:"2px solid var(--sa-color-gray-200, #f0f1f2)",backgroundColor:r?o.activeBg:"var(--sa-color-gray-50, #ffffff)",boxShadow:r?t?`0 8px 20px ${o.activeShadow.replace("0.25","0.35")}`:`0 2px 8px ${o.activeShadow}`:t?"0 8px 20px rgba(0, 0, 0, 0.14)":"0 1px 4px rgba(0, 0, 0, 0.08)",transform:t?"translateY(-3px) scale(1.05)":"translateY(0) scale(1)",transition:"box-shadow 0.2s ease, transform 0.2s ease, background-color 0.15s ease, border-color 0.15s ease"}}const Fo={fontSize:"11px",fontWeight:500,textAlign:"center",overflowWrap:"normal",wordBreak:"normal",color:"var(--sa-background-primary, #ffffff)",lineHeight:"1.3",maxWidth:"80px"},Mo={display:"flex",flexDirection:"column",alignItems:"center",gap:"8px",background:"none",border:"none",cursor:"pointer",padding:0};function To({isShow:r,onHide:t,menus:o,selectedGroupId:n,onSelect:l}){const[s,i]=d.useState(void 0),c=h=>{l(h),t()},a=vt[0];return e.jsx(Oe.Dialog,{isShow:r,onHide:t,style:{width:560,background:"transparent",boxShadow:"none",border:"none"},children:e.jsx(Oe.DialogBody,{children:e.jsxs("div",{style:{display:"grid",gridTemplateColumns:"repeat(5, 1fr)",gap:"16px"},children:[e.jsxs("button",{onClick:()=>c(null),onMouseEnter:()=>i("all"),onMouseLeave:()=>i(void 0),style:Mo,children:[e.jsx("div",{style:Eo(n===null,s==="all",a),children:e.jsx("div",{style:{color:a.icon,display:"flex",alignItems:"center",justifyContent:"center"},children:e.jsx(T.Icon,{name:"Grid",size:"lg",style:{width:32,height:32}})})}),e.jsx("span",{style:Fo,children:"Semua"})]}),o.map((h,y)=>{var w;const b=n===h.id,p=s===h.id,C=((w=h.items[0])==null?void 0:w.icon)??"Grid",E=vt[(y+1)%vt.length];return e.jsxs("button",{onClick:()=>c(h.id),onMouseEnter:()=>i(h.id),onMouseLeave:()=>i(void 0),style:Mo,children:[e.jsx("div",{style:Eo(b,p,E),children:e.jsx("div",{style:{color:E.icon,display:"flex",alignItems:"center",justifyContent:"center"},children:e.jsx(T.Icon,{name:C,size:"lg",style:{width:32,height:32}})})}),e.jsx("span",{style:Fo,children:h.name})]},h.id)})]})})})}function Xl({onSelect:r,"aria-label":t="Pilih module"}={}){const o=dt(),{useNavigate:n}=rr(),l=n(),{selectedGroupId:s,setSelectedGroupId:i}=bt(),[c,a]=d.useState(!1),h=y=>{var b;if(i(y),y!==null){const p=o.menus.find(E=>E.id===y),C=(b=p==null?void 0:p.items[0])==null?void 0:b.to;C&&l(C)}r==null||r(y)};return e.jsxs(e.Fragment,{children:[e.jsxs("div",{style:{position:"relative"},children:[e.jsx("button",{onClick:()=>a(!0),style:{display:"inline-flex",alignItems:"center",justifyContent:"center",width:"2.25rem",height:"2.25rem",borderRadius:"var(--sa-radii-sm, 0.25rem)",border:"1px solid var(--sa-border-subtle, #0b120e24)",color:"var(--sa-text-subtle, #8c8f97)",backgroundColor:"transparent",cursor:"pointer"},"aria-label":t,onMouseEnter:y=>{y.currentTarget.style.backgroundColor="var(--sa-background-primary-inverse, #f8f8f8)"},onMouseLeave:y=>{y.currentTarget.style.backgroundColor="transparent"},children:e.jsx(T.Icon,{name:"GridApplication",size:"sm"})}),s!==null&&e.jsx("span",{style:{position:"absolute",top:"0.25rem",right:"0.25rem",width:"0.5rem",height:"0.5rem",borderRadius:"9999px",backgroundColor:"var(--sa-color-brand-500, #1a4fa0)"},"aria-hidden":"true"})]}),e.jsx(To,{isShow:c,onHide:()=>a(!1),menus:o.menus.filter(y=>y.parentGroupId===void 0),selectedGroupId:s,onSelect:h})]})}const $l=(r,t)=>{const o=[];if(t===0)return o.push(r),o;for(let n=0;n<r.length;n+=t){const l=r.slice(n,n+t);o.push(l)}return o},Kl=d.memo(({value:r,label:t,separator:o,labelWidth:n,lastIndex:l,labelAlign:s="top"})=>{const i=d.useMemo(()=>({padding:0,paddingBottom:l?0:12,verticalAlign:s}),[l,s]),c=d.useMemo(()=>({padding:0,paddingRight:12,paddingLeft:12,paddingBottom:l?0:12,verticalAlign:s}),[l,s]),a=()=>typeof t=="string"?e.jsx(B.Text,{fontWeight:"medium",color:"subtlest",children:t}):t,h=()=>typeof r=="string"||typeof r=="number"?e.jsx(B.Text,{color:"primary",fontWeight:"medium",children:r}):r,y=()=>typeof o=="string"||typeof o=="number"?e.jsx(B.Text,{fontWeight:"medium",color:"subtlest",children:o}):o;return e.jsxs(G.Tr,{children:[e.jsx(G.Td,{style:i,width:n,children:a()}),o?e.jsx(G.Td,{style:c,width:24,children:y()}):null,e.jsx(G.Td,{style:i,children:h()})]})}),Rl=d.memo(({fields:r,separator:t,labelWidth:o})=>e.jsx(G.Table,{withColumnBorder:!1,withRowBorder:!1,children:r.map((n,l)=>e.jsx(Kl,{separator:t,labelWidth:o,lastIndex:l===r.length-1,...n},`field-group-field-${l}`))})),en=d.memo(({maxRow:r=0,maxColumn:t=2,separator:o=":",fields:n=[],labelWidth:l=150,bordered:s=!1})=>{const i=d.useMemo(()=>$l(n,r),[n,r]),c=i.length>2,a=()=>{switch(t){case 1:return"width-full";case 2:return"width-1-2";case 3:return"width-1-3";case 4:return"width-1-4";default:return"width-1-2"}};return e.jsx(u.Box,{gap:c?void 0:"lg",direction:"row",flexWrap:"wrap",borderRadius:"rounded-sm",padding:"lg",paddingBottom:c?"xs":"lg",bg:"accent-dark-tertiary",borderWidth:s?"border":void 0,borderStyle:s?"border-solid":void 0,borderColor:s?"border-subtle":void 0,children:i.map((h,y)=>e.jsx(u.Box,{direction:"column",flex:c?void 0:"1",width:c?a():void 0,marginBottom:c?"lg":void 0,children:e.jsx(Rl,{labelWidth:l,fields:h,separator:o})},y))})}),rn=({backButton:r})=>{const[t,o]=d.useState(!1),n=(r==null?void 0:r.iconColor)??"var(--sa-text-subtle, #8c8f97)",l=(r==null?void 0:r.textColor)??"var(--sa-text-subtle, #8c8f97)",s=(r==null?void 0:r.hoverIconColor)??"var(--sa-text-subtle, #8c8f97)",i=(r==null?void 0:r.hoverTextColor)??"var(--sa-text-primary, #292a2e)";return e.jsxs(u.Box,{direction:"row",gap:"xs",align:"center",onMouseEnter:()=>o(!0),onMouseLeave:()=>o(!1),style:{cursor:"pointer"},children:[e.jsx(T.Icon,{name:(r==null?void 0:r.iconName)||"ChevronLeft",size:"xs",style:{color:t?s:n,transition:"color 0.15s ease"}}),e.jsx(B.Text,{variant:"sub-h3",style:{color:t?i:l,textDecoration:t?"underline":"none",transition:"color 0.15s ease"},children:(r==null?void 0:r.title)||"Back"})]})},tn=({backButton:r,title:t,titleIcon:o,titleTag:n,children:l,header:s=!0,headerBorder:i=!1,disableAnimation:c=!1,scrollable:a=!1,stickyHeader:h=!1,subHeaders:y,action:b,titleTagProps:p,containerProps:C,headerProps:E})=>{const w=De.useMediaQuery("md"),{Link:L,useNavigate:F,useLocation:I}=rr(),S=F(),D=I(),H=r==null?void 0:r.show,A=()=>{if(typeof(r==null?void 0:r.onClick)=="function"){r.onClick();return}S(-1,{replace:!0})},k=()=>{if(!b)return null;if(d.isValidElement(b))return b;const _=b.filter(R=>R&&(R.title||R.icon));return _.length===0?null:w?e.jsx(u.Box,{direction:"row",gap:"md",children:_.map(({title:R,icon:re,buttonProps:q,onClick:P},N)=>e.jsx(j.Button,{iconLeft:re?e.jsx(T.Icon,{name:re,size:"md"}):void 0,onClick:P,...q,children:R},`action-${N}`))}):e.jsxs(O.Menu,{position:"bottom-right",children:[e.jsx(O.MenuButton,{children:e.jsx(j.Button,{variant:"tertiary",size:"sm",iconLeft:e.jsx(T.Icon,{name:"MenuBurger"}),"aria-label":"Actions"})}),e.jsx(O.MenuLists,{children:e.jsx(O.MenuBody,{style:{minWidth:200},children:_.map(({title:R,icon:re,buttonProps:q,onClick:P},N)=>{const ce=(q==null?void 0:q.tone)==="error"||(q==null?void 0:q.danger)===!0;return e.jsx(O.MenuItem,{intent:ce?"danger":void 0,disabled:q==null?void 0:q.disabled,startIcon:re?e.jsx(T.Icon,{name:re}):void 0,onClick:P,children:R},`action-${N}`)})})})]})},z=()=>{const _=e.jsx(rn,{backButton:r});return r!=null&&r.navigateTo?e.jsx(u.Box,{direction:"row",children:e.jsx(L,{to:r.navigateTo,replace:!0,style:{textDecoration:"none"},children:_})}):e.jsx(u.Box,{direction:"row",children:e.jsx(Er,{onClick:A,children:_})})},W=()=>{const _=!!t,R=Array.isArray(b)&&b.length>0,re=d.isValidElement(b)?!0:R;if(!_&&!re&&!H)return null;const P=w||!w&&R;return e.jsxs(u.Box,{direction:"column",gap:"xs",paddingBlock:(E==null?void 0:E.paddingBlock)??"sm",paddingInline:(E==null?void 0:E.paddingInline)??"md",...E,style:{...i?{boxShadow:"inset 0 -1px 0 0 var(--sa-border-subtle, #0b120e24)"}:{},...E==null?void 0:E.style},children:[H&&z(),(_||re)&&e.jsxs(u.Box,{direction:P?"row":"column",gap:"sm",justify:"space-between",align:P?"center":"flex-start",children:[_?typeof t=="string"?e.jsxs(u.Box,{direction:"row",gap:"lg",align:"center",children:[e.jsxs(u.Box,{direction:"row",gap:"sm",align:"center",children:[o&&e.jsx(T.Icon,{name:o,size:"md",color:"primary"}),e.jsx(B.Text,{variant:"h3",fontWeight:"semibold",fontFamily:"Poppins",children:t})]}),n&&e.jsx(cr.Badge,{border:!0,size:"lg",text:n,...p})]}):t:null,k()]})]})},X=()=>{if(!y||y.length===0)return null;const _=y.filter(q=>q.show!==!1);if(_.length===0)return null;let R=0,re=-1/0;return _.forEach((q,P)=>{const N=q.order??0;N>=re&&(re=N,R=P)}),_.map(({content:q,order:P,borderBottom:N=!0,keepBottomPadding:ce=!1,paddingInline:xe=!0,paddingBlock:Ae=!0},ue)=>e.jsx(u.Box,{direction:"column",paddingTop:Ae?"sm":"spacing-0",paddingBottom:Ae&&(N||ce||ue===R)?"sm":"spacing-0",paddingInline:xe?"md":"spacing-0",style:{...N?{boxShadow:"inset 0 -1px 0 0 var(--sa-border-subtle, #0b120e24)"}:{},...P!==void 0?{order:P}:{}},children:q},`sub-header-${ue}`))},K=()=>{const _=s?W():null,R=X();return!_&&!R?null:e.jsxs(u.Box,{direction:"column",style:{...a?{position:"sticky",left:0,...h?{top:0}:{},zIndex:2,background:"var(--sa-background-primary, #ffffff)"}:{},marginBottom:R?"var(--sa-spacing-0)":"var(--sa-spacing-md)"},children:[_,R]})},Q=()=>l;return e.jsxs(u.Box,{direction:"column",as:"main",...C,style:{...a?{height:"100%",minHeight:0,overflow:"auto"}:{},...(C==null?void 0:C.style)??{},...c?{}:{animation:"pageLayoutEnter 320ms cubic-bezier(0.16, 1, 0.3, 1) backwards"}},children:[K(),Q()]},D.pathname)},on=d.memo(tn),ln={icon:"Cross",title:""},Lo=d.forwardRef(({onHide:r,show:t,withBlur:o=!1,style:n,children:l,closeButton:s=ln,width:i,minWidth:c,maxWidth:a},h)=>{const y=i??a??c??"357px";return e.jsx(Ar.Drawer,{blur:o,isShow:t,position:"right",onHide:r,ref:h,size:y,style:n,children:e.jsxs(u.Box,{direction:"column",padding:"lg",children:[s?e.jsxs(u.Box,{direction:"row",align:"center",gap:"sm",onClick:r,marginBottom:"lg",cursor:"pointer",children:[e.jsx(T.Icon,{name:s.icon,size:"md",color:"subtle",cursor:"pointer"}),s.title?e.jsx(B.Text,{fontFamily:"Poppins",fontSize:"md",color:"subtlest",children:s.title}):null]}):null,l]})})}),Ct=d.memo(({children:r,borderBottom:t=!0,padding:o=!0})=>{const n=De.useMediaQuery("lg");return e.jsx(u.Box,{direction:"column",padding:o?"md":"spacing-0",paddingLeft:o?"md":"spacing-0",paddingRight:o?"md":"spacing-0",style:t?{borderBottom:"1px solid var(--sa-border-subtle, #0b120e24)"}:void 0,children:r})}),xt=d.memo(({children:r,borderTop:t=!0,padding:o=!0})=>{const n=De.useMediaQuery("lg");return e.jsx(u.Box,{direction:"column",padding:o?"md":"spacing-0",paddingLeft:o?"md":"spacing-0",paddingRight:o?"md":"spacing-0",style:t?{borderTop:"1px solid var(--sa-border-subtle, #0b120e24)"}:void 0,children:r})}),nn=d.memo(({children:r,...t})=>e.jsx(u.Box,{direction:"column",padding:"md",paddingLeft:"md",paddingRight:"md",gap:"md",...t,children:r})),sn=d.memo(({children:r,title:t,titleTag:o,action:n,header:l,footer:s,actionContainer:i,containerProps:c,bodyProps:a,headerProps:h={borderBottom:!0},footerProps:y={borderTop:!0},variantTag:b="info"})=>{const p=De.useMediaQuery("lg"),C=()=>o?e.jsxs(u.Box,{direction:"row",gap:"sm",align:"center",children:[e.jsx(B.Text,{fontWeight:"medium",children:t}),e.jsx(cr.Badges,{border:!0,text:o,variant:b})]}):e.jsx(B.Text,{fontWeight:"medium",children:t}),E=()=>l||e.jsxs(u.Box,{direction:"row",justify:"space-between",align:"flex-start",gap:"md",children:[e.jsx(u.Box,{direction:"column",children:t?C():null}),e.jsx(u.Box,{direction:"column",style:p?{width:"100%",maxWidth:"19.313rem"}:{flex:1},...i,children:n??null})]}),w=!!(l||t||n);return e.jsxs(u.Box,{direction:"column",bg:"white",borderRadius:"rounded-xs",as:"section",borderWidth:"border",borderStyle:"border-solid",borderColor:"border-base",...c,style:{backgroundColor:"var(--sa-background-primary, #ffffff)",...(c==null?void 0:c.style)??{}},children:[l!==null&&w?e.jsx(Ct,{...h,children:E()}):null,e.jsx(nn,{...a,children:r}),s?e.jsx(xt,{...y,children:s}):null]})}),Ze={H1:r=>e.jsx(B.Text,{variant:"h1",children:r.children,...r.props}),H2:r=>e.jsx(B.Text,{variant:"h2",children:r.children,...r.props}),H3:r=>e.jsx(B.Text,{variant:"h3",children:r.children,...r.props}),H4:r=>e.jsx(B.Text,{variant:"h4",children:r.children,...r.props}),H5:r=>e.jsx(B.Text,{variant:"h5",children:r.children,...r.props}),H6:r=>e.jsx(B.Text,{variant:"h6",children:r.children,...r.props}),SubH1:r=>e.jsx(B.Text,{variant:"sub-h1",children:r.children,...r.props}),SubH2:r=>e.jsx(B.Text,{variant:"sub-h2",children:r.children,...r.props}),SubH3:r=>e.jsx(B.Text,{variant:"sub-h3",children:r.children,...r.props}),Body1:r=>e.jsx(B.Text,{variant:"body-1",children:r.children,...r.props}),Body2:r=>e.jsx(B.Text,{variant:"body-2",children:r.children,...r.props}),Body3:r=>e.jsx(B.Text,{variant:"body-3",children:r.children,...r.props})},We=()=>{const{useSearchParams:r,useParams:t,useLocation:o}=rr(),[n,l]=r(),s=br.searchParamsToObject(n.toString()),i=t(),c=o(),a=i.id;return{setSearchParams:l,searchParams:n,searchQueries:s,isHasQuery:(C,E)=>n.has(C)&&n.get(C)===E,getQueryParam:C=>n.get(C),getRouteParam:C=>i[C],params:i,location:c,id:a,hasId:!!a}},Io=r=>JSON.stringify(r),Oo=r=>JSON.stringify(r),Wo=r=>JSON.stringify(r),Ao=r=>JSON.stringify(r),cn=r=>r,an=r=>JSON.stringify(r),Fr=({value:r,name:t,type:o,withSearchParam:n=!0,setSearchParams:l,searchQueries:s,dropdownSearchKey:i,filterKey:c="filter",pageKey:a="page"})=>{if(n){let h;switch(o){case"search":h=cn(r);break;case"dropdown":case"dropdown-multiple":h=Io(r);break;case"radio":h=Oo(r);break;case"date-range":h=Wo(r);break;case"advanced-date-range":h=an(r);break;case"date":h=Ao(r);break;default:h=r;break}if(typeof h<"u"){const b={...s[c]&&typeof s[c]=="string"?JSON.parse(s[c]):void 0,[t]:h},p={...s};i&&typeof i=="string"&&delete p[i],delete p[a];const C={...p,[c]:JSON.stringify(b)},E=new URLSearchParams(s).toString(),w=new URLSearchParams(C).toString();if(E===w)return;l(C)}}},Nr=({name:r,filterKey:t="filter",searchParams:o,get:n})=>{const l=o.get(t)||void 0,s=l&&typeof l=="string"?JSON.parse(l):void 0,i=s?s[r]:void 0;return n==="label"&&i?JSON.parse(i)[0].label:n==="value"&&i?JSON.parse(i)[0].value:i},zo=({name:r,filterKey:t="filter",searchParams:o,get:n})=>{const l=o.get(t)||void 0,s=l&&typeof l=="string"?JSON.parse(l):void 0,i=s?s[r]:void 0;return n==="label"&&i?JSON.parse(i).map(c=>c.label):n==="value"&&i?JSON.parse(i).map(c=>c.value):n==="array"&&i?JSON.parse(i):i},dn=({name:r,filterKey:t="filter",searchParams:o,get:n})=>{const l=o.get(t)||void 0,s=l&&typeof l=="string"?JSON.parse(l):void 0,i=s?s[r]:void 0;return n==="id"&&i?JSON.parse(i).id:n==="label"&&i?JSON.parse(i).label:n==="value"&&i?JSON.parse(i).value:i},_r=(r,t,o)=>{const n=t.get(o||"filter")||void 0,l=n&&typeof n=="string"?JSON.parse(n):void 0;return l?l[r]:void 0},hn=({name:r,filterKey:t="filter",searchParams:o})=>{const n=o.get(t||"filter")||void 0,l=n&&typeof n=="string"?JSON.parse(n):void 0,s=l?l[r]:void 0;return{start:s?JSON.parse(s).from:void 0,end:s?JSON.parse(s).to:void 0}},Ho=({name:r,filterKey:t="filter",searchParams:o})=>{const n=o.get(t||"filter")||void 0,l=n&&typeof n=="string"?JSON.parse(n):void 0,s=l?l[r]:void 0;return s?JSON.parse(s):void 0},fn=(r,{filterKey:t="filter",perPageKey:o="perPage",pageKey:n="page"})=>{const l=r.get(t)||void 0,s=r.get(o)||void 0,i=r.get(n)||void 0;return!!l||!!s||!!i},Vo=({isOpen:r,onClose:t,filterKey:o,pageKey:n,filters:l})=>{const{searchParams:s,setSearchParams:i,searchQueries:c}=We(),[a,h]=d.useState({}),y=()=>{s.delete(o||"filter"),i(s)},b=(p,C)=>{switch(p.type){case"radio":{const{show:E=!0}=p;return E&&e.jsx(u.Box,{direction:"column",children:e.jsx(u.Box,{direction:"column",children:p.title})},C)}case"dropdown":{const{show:E=!0}=p;return E&&e.jsx(u.Box,{direction:"column",children:e.jsx(u.Box,{direction:"column",children:p.title})},C)}case"date-range":return e.jsx(u.Box,{direction:"column",children:e.jsx(u.Box,{direction:"column",children:p.title})},C);case"date":return e.jsx(u.Box,{direction:"column",children:e.jsx(u.Box,{direction:"column",children:p.title})},C);case"dropdown-multiple":{const{show:E=!0}=p;return E&&e.jsx(u.Box,{direction:"column",children:e.jsx(u.Box,{direction:"column",children:p.title})},C)}default:return null}};return e.jsx(Lo,{onHide:t,show:r||!1,children:e.jsxs(u.Box,{direction:"column",gap:"md",children:[e.jsxs(se.Flex,{direction:"row",justify:"space-between",align:"center",children:[e.jsx(u.Box,{direction:"column",children:"Filter"}),e.jsx(u.Box,{direction:"column",style:{cursor:"pointer"},onClick:y,children:"Reset"})]}),l==null?void 0:l.map((p,C)=>b(p,C))]})})},Po=({searchKey:r="q",statusKey:t="status",searchPlaceholder:o="Search",searchHighlightPlaceholder:n,extendedFilter:l,showSearchFilter:s=!0,showStatusFilter:i=!0,filterKey:c="filter",pageKey:a="page",customWidthSearch:h,handleOnReset:y,filterConfigs:b,buttonToggleProps:p,position:C="right",titleSearchLabel:E="Work Order",withTitleLabels:w=!1})=>{const F=(p==null?void 0:p.isShowLabel)??!0,[I,S]=d.useState(!1),[D,H]=d.useState(0),A=()=>{H(N=>N+1)},{searchParams:k,setSearchParams:z,getQueryParam:W}=We(),X=br.searchParamsToObject(k.toString()),K=_r(r,k,c)||"",[Q,_]=d.useState(K),R=W(c),q=!!(R&&!(()=>{if(R)try{const N=JSON.parse(R);return Object.keys(N).length===1&&N[r]===""}catch(N){console.error("Filter parameter is not a valid JSON:",N)}return!1})()),P=De.useMediaQuery("md");return d.useEffect(()=>{_(K)},[K]),d.useEffect(()=>{if(Q===K)return;const N=window.setTimeout(()=>{Fr({value:Q,name:r,type:"search",searchQueries:X,setSearchParams:z,filterKey:c,pageKey:a})},350);return()=>{window.clearTimeout(N)}},[Q,K,r,X,z,c,a]),e.jsxs(se.Flex,{gap:"md",style:{flexDirection:P&&C==="left"?"row":P&&C==="right"?"row-reverse":"column"},align:"flex-end",children:[q&&e.jsx(u.Box,{direction:"column",justify:"flex-end",children:e.jsx(j.Button,{onClick:()=>{const N=new URLSearchParams(k);N.delete(c),z(N),_(""),A(),y&&y()},variant:"outline",tone:"neutral",children:e.jsx(B.Text,{color:"error",fontWeight:"semibold",children:"Reset"})})}),l==null?void 0:l.map(({minWidth:N,content:ce,title:xe,onClickContainer:Ae},ue)=>e.jsxs(u.Box,{direction:"column",gap:"sm",onClick:Ae,style:{minWidth:N},children:[xe&&e.jsx(Ze.SubH3,{children:xe}),ce]},`extended-filter-${ue}-${D}`)),!!(b!=null&&b.length)&&e.jsx(j.Button,{primary:q,secondary:!q,iconLeft:e.jsx(T.Icon,{size:"sm",name:(p==null?void 0:p.icon)||"FilterHorizontal",style:{color:R?"var(--sa-background-brand, #04254f)":"var(--sa-text-primary, #292a2e)"}}),fullWidth:!P,onClick:()=>S(!0),children:F?"Filter":void 0}),i&&e.jsxs(u.Box,{direction:"column",gap:"sm",style:{minWidth:"126px"},children:[w&&e.jsx(Ze.SubH3,{children:"Status"}),e.jsx(pr.Dropdown,{dropdownLists:[{label:"Active",value:"active"},{label:"InActive",value:"inactive"}],defaultValue:Nr({get:"value",name:t,searchParams:k,filterKey:c})?[{label:Nr({get:"value",name:t,searchParams:k,filterKey:c})==="active"?"Active":"InActive",value:Nr({get:"value",name:t,searchParams:k,filterKey:c})}]:[],onChange:N=>Fr({value:N,name:t,type:"dropdown",searchQueries:X,setSearchParams:z,filterKey:c}),placeholder:w?"All":"All Status"},D)]}),s&&e.jsxs(u.Box,{direction:"column",gap:"sm",style:{width:h&&P?h:P?"310px":""},children:[w&&e.jsxs(Ze.SubH3,{children:["Search for ",E]}),e.jsx(ar.Input,{placeholder:o,leftIcon:e.jsx(T.Icon,{name:"Search",width:20,height:20}),onChange:N=>_(N.target.value),value:Q,fullWidth:!0},D+1+c)]}),e.jsx(Vo,{isOpen:I,onClose:()=>S(!1),filterKey:c,filters:b,pageKey:a})]})},un=r=>r==="checkbox-multiple"?"dropdown-multiple":r==="radio"?"dropdown":r==="date-compact"?"date":r;function wt({configs:r,filterKey:t="filter",activeFilterKey:o="filters",pageKey:n="page",searchKey:l="q"}){const{searchParams:s,setSearchParams:i,searchQueries:c}=We(),a=d.useMemo(()=>Object.fromEntries(r.map(D=>[D.key,D])),[r]),h=d.useMemo(()=>{const D=(s.get(o)||"").split(",").map(A=>A.trim()).filter(Boolean);let H=[];try{const A=s.get(t);A&&(H=Object.keys(JSON.parse(A)).filter(k=>k!==l))}catch{}return r.map(A=>A.key).filter(A=>{const k=a[A];return(k==null?void 0:k.locked)||D.includes(A)||H.includes(A)})},[s,o,t,l,r,a]),y=d.useCallback(D=>{try{return D[t]?JSON.parse(D[t]):{}}catch{return{}}},[t]),b=d.useCallback(D=>{const H={...c};D.length?H[o]=D.join(","):delete H[o],i(H)},[c,o,i]),p=d.useCallback(D=>{h.includes(D)||b([...h,D])},[h,b]),C=d.useCallback(D=>{var z;if((z=a[D])!=null&&z.locked)return;const H={...c},A=h.filter(W=>W!==D);A.length?H[o]=A.join(","):delete H[o];const k=y(H);D in k&&(delete k[D],Object.keys(k).length?H[t]=JSON.stringify(k):delete H[t]),delete H[n],i(H)},[c,h,o,t,n,y,i,a]),E=d.useCallback(D=>h.includes(D)?C(D):p(D),[h,p,C]),w=d.useCallback(D=>{switch(D.type){case"dropdown":case"dropdown-multiple":case"checkbox-multiple":case"radio":return zo({name:D.key,get:"array",searchParams:s,filterKey:t})||[];case"date":{const H=Ho({name:D.key,searchParams:s,filterKey:t});return H?new Date(H):void 0}case"date-compact":{const A=y(Object.fromEntries(s.entries()))[D.key];return A&&typeof A=="object"?A:void 0}default:return}},[s,t,y]),L=d.useCallback((D,H)=>{if(D.type==="date-compact"){const A={...c},k=y(A);H==null?delete k[D.key]:k[D.key]=H,Object.keys(k).length?A[t]=JSON.stringify(k):delete A[t],delete A[n],i(A);return}Fr({value:H,name:D.key,type:un(D.type),searchQueries:c,setSearchParams:i,filterKey:t,pageKey:n})},[c,i,t,n,y]),F=d.useCallback(D=>{const H={...c},A=y(H);D in A&&(delete A[D],Object.keys(A).length?H[t]=JSON.stringify(A):delete H[t]),delete H[n],i(H)},[c,t,n,y,i]),I=d.useCallback(()=>{const D={...c};delete D[t],delete D[o],delete D[n],i(D)},[c,t,o,n,i]),S=h.length>0;return{activeKeys:h,configByKey:a,hasActiveFilter:S,addFilter:p,removeFilter:C,toggleFilter:E,getValue:w,setValue:L,clearValue:F,clearAll:I}}const Dt={get(r){return mr.storage.get(r)??null},set(r,t){mr.storage.save(r,t)},remove(r){mr.storage.delete(r)}},xr={columns:r=>`filterbar:colprefs:${r}`,savedViews:r=>`filterbar:views:${r}`,lastState:r=>`filterbar:last:${r}`,perPage:r=>`filterbar:perpage:${r}`,tableSort:r=>`tablelayout:sort:${r}`},qr=(r,t)=>{const o=new Set(t.map(s=>s.key)),n=r.order.filter(s=>o.has(s));for(const s of t)n.includes(s.key)||n.push(s.key);const l=r.hidden.filter(s=>o.has(s));return{order:n,hidden:l}};function gn({columns:r,scopeId:t,storage:o,onColumnsChange:n,value:l}){const s=d.useMemo(()=>({order:r.map(k=>k.key),hidden:[]}),[r]),i=t?xr.columns(t):void 0,c=(k,z)=>qr({order:k.order??z,hidden:k.hidden??[]},r),[a,h]=d.useState(()=>{if(l&&(l.order||l.hidden))return c(l,r.map(k=>k.key));if(i){const k=o.get(i);if(k&&Array.isArray(k.order))return qr(k,r)}return s}),y=r.map(k=>k.key).join("|");d.useEffect(()=>h(k=>qr(k,r)),[y]);const b=d.useRef(a);b.current=a;const p=l?`${(l.order??[]).join("|")}~${(l.hidden??[]).join("|")}`:null,C=d.useRef(p);d.useEffect(()=>{if(p==null||C.current===p)return;C.current=p;const k=b.current,z=c(l,k.order);z.order.join("|")===k.order.join("|")&&z.hidden.join("|")===k.hidden.join("|")||(h(z),i&&o.set(i,z))},[p,y]);const E=d.useRef(!1);d.useEffect(()=>{E.current||(E.current=!0,n==null||n(a))},[]);const w=d.useCallback(k=>{h(k),i&&o.set(i,k),n==null||n(k)},[i,o,n]),L=d.useMemo(()=>{const k=new Map(r.map(z=>[z.key,z]));return a.order.filter(z=>k.has(z)).map(z=>({...k.get(z),visible:!a.hidden.includes(z)}))},[a,r]),F=d.useCallback(k=>{const z=a.hidden.includes(k)?a.hidden.filter(W=>W!==k):[...a.hidden,k];w({...a,hidden:z})},[a,w]),I=d.useCallback((k,z)=>{if(k===z)return;const W=[...a.order],[X]=W.splice(k,1);W.splice(z,0,X),w({...a,order:W})},[a,w]),S=d.useCallback(k=>{w({...a,hidden:k?r.filter(z=>!z.locked).map(z=>z.key):[]})},[a,r,w]),D=d.useCallback(()=>w(s),[w,s]),H=d.useCallback(k=>w(qr(k,r)),[w,r]),A=a.hidden.length===0;return{state:a,orderedColumns:L,allVisible:A,toggleVisibility:F,reorder:I,setAllHidden:S,reset:D,applyState:H}}function yn({scopeId:r,storage:t,snapshotKeys:o,pageKey:n="page",getColumns:l,applyColumns:s}){const{searchParams:i,setSearchParams:c}=We(),a=r?xr.savedViews(r):void 0,[h,y]=d.useState(()=>a?t.get(a)||[]:[]),b=d.useCallback(w=>{y(w),a&&t.set(a,w)},[a]),p=d.useCallback(w=>{const L=w.trim();if(!L)return;const F={};o.forEach(S=>{const D=i.get(S);D!=null&&(F[S]=D)});const I={id:`${Date.now()}`,name:L,query:F,columns:l==null?void 0:l(),createdAt:Date.now()};b([...h,I])},[o,i,l,b,h]),C=d.useCallback(w=>b(h.filter(L=>L.id!==w)),[b,h]),E=d.useCallback(w=>{const L=Object.fromEntries(i.entries());o.forEach(F=>delete L[F]),Object.assign(L,w.query),delete L[n],c(L),w.columns&&(s==null||s(w.columns))},[i,o,n,c,s]);return{enabled:!!a,views:h,saveView:p,deleteView:C,applyView:E}}function pn(r,t){let o;try{o=JSON.parse(r)}catch{return r}return!o||typeof o!="object"?r:(delete o[t],Object.keys(o).length>0?JSON.stringify(o):void 0)}function jo(r,t,o){const n=r[t];if(n==null)return;const l=pn(n,o);l===void 0?delete r[t]:r[t]=l}function bn({scopeId:r,storage:t,snapshotKeys:o,enabled:n=!0,filterKey:l="filter",searchKey:s="q",persistSearch:i=!0}){const{searchParams:c}=We(),a=r&&n?xr.lastState(r):void 0,h=d.useRef(a),y=d.useRef(!1);d.useEffect(()=>{if(!a){h.current=a;return}if(h.current!==a){h.current=a,y.current=!1;return}const C={};if(o.forEach(E=>{const w=c.get(E);w!=null&&(C[E]=w)}),i||jo(C,l,s),Object.keys(C).length===0){y.current&&t.remove(a);return}y.current=!0,t.set(a,C)},[c,a,o,t,i,l,s]);const b=d.useCallback(()=>{if(!a)return null;const C=t.get(a);return!C||Object.keys(C).length===0||!i&&(jo(C,l,s),Object.keys(C).length===0)?null:C},[a,t,i,l,s]),p=d.useCallback(()=>{a&&t.remove(a)},[a,t]);return{enabled:!!a,read:b,clear:p}}function vn({scopeId:r,storage:t,perPageKey:o,pageSizeOptions:n,enabled:l=!0}){const{searchParams:s}=We(),i=r&&l?xr.perPage(r):void 0,c=s.toString(),a=d.useRef(i);d.useEffect(()=>{if(!i){a.current=i;return}if(a.current!==i){a.current=i;return}const b=s.get(o);if(!b)return;const p=Number(b);!Number.isFinite(p)||p<=0||t.set(i,p)},[c,i,o,t]);const h=d.useCallback(()=>{if(!i)return null;const b=t.get(i);if(b==null)return null;const p=Number(b);return!Number.isFinite(p)||p<=0||n&&!n.includes(p)?null:String(p)},[i,t,n]),y=d.useCallback(()=>{i&&t.remove(i)},[i,t]);return{enabled:!!i,read:h,clear:y}}let St={},kt=!1,Bt=null;const Cn=(r,t)=>{Object.assign(St,r),Bt=t,!kt&&(kt=!0,queueMicrotask(()=>{const o=St,n=Bt;St={},kt=!1,Bt=null,!(!n||Object.keys(o).length===0)&&n(l=>{const s=new URLSearchParams(l);return Object.entries(o).forEach(([i,c])=>s.set(i,c)),s})}))};function xn({enabled:r,snapshotKeys:t,perPageKey:o,readSnapshot:n,readPerPage:l}){const{searchParams:s,setSearchParams:i,location:c}=We(),a=d.useRef(null);d.useEffect(()=>{if(!r||a.current===c.pathname)return;a.current=c.pathname;const h={};if(!s.has(o)){const y=l();y&&(h[o]=y)}if(!t.some(y=>s.has(y))){const y=n();y&&Object.assign(h,y)}Object.keys(h).length!==0&&Cn(h,i)},[c.pathname,r])}const wn=({configs:r,activeKeys:t,onToggle:o,hasActiveFilter:n,onReset:l})=>r.length?e.jsxs(O.Menu,{position:"bottom-left",children:[e.jsx(O.MenuButton,{children:e.jsx(j.Button,{variant:n?"secondary":"outline",tone:"neutral",size:"sm",iconLeft:e.jsx(T.Icon,{name:"FilterHorizontal"}),"aria-label":"Add filter"})}),e.jsx(O.MenuLists,{children:e.jsx(O.MenuBody,{style:{minWidth:260},title:e.jsxs(u.Box,{display:"flex",direction:"row",align:"center",justify:"space-between",fullWidth:!0,children:[e.jsx(B.Text,{fontSize:"sm",fontWeight:"medium",color:"subtlest",children:"Add Filter"}),n&&l&&e.jsx(j.Button,{variant:"link",tone:"brand",size:"xs",onClick:l,children:"Reset"})]}),children:r.map(s=>e.jsx(O.MenuItem,{selected:s.locked||t.includes(s.key),disabled:s.locked,closeOnSelect:!1,startIcon:s.icon??void 0,onClick:()=>{s.locked||o(s.key)},children:s.label},s.key))})})]}):null,Zr=({onClear:r,onRemove:t})=>e.jsxs(O.Menu,{position:"bottom-right",children:[e.jsx(O.MenuButton,{children:e.jsx(j.Button,{variant:"link",tone:"neutral",size:"xs",iconLeft:e.jsx(T.Icon,{name:"MenuHorizontal"}),"aria-label":"Filter actions"})}),e.jsx(O.MenuLists,{children:e.jsxs(O.MenuBody,{style:{width:180},children:[e.jsx(O.MenuItem,{startIcon:e.jsx(T.Icon,{name:"CrossCircle"}),onClick:r,children:"Clear value"}),t&&e.jsx(O.MenuItem,{intent:"danger",startIcon:e.jsx(T.Icon,{name:"Trash1"}),onClick:t,children:"Remove filter"})]})})]}),Dn=r=>{const t=new Date(r);return t.setHours(0,0,0,0),t},No=(r,t,o)=>{const n=new Date(r);return o==="day"?n.setDate(n.getDate()+t):o==="week"?n.setDate(n.getDate()+t*7):o==="month"?n.setMonth(n.getMonth()+t):n.setFullYear(n.getFullYear()+t),n},_o=r=>{const t=Dn(new Date);if(r.direction==="this"){const n=new Date(t),l=new Date(t);return r.period==="week"?(n.setDate(t.getDate()-t.getDay()),l.setDate(n.getDate()+6)):r.period==="month"?(n.setDate(1),l.setMonth(l.getMonth()+1,0)):r.period==="year"&&(n.setMonth(0,1),l.setMonth(11,31)),{from:n,to:l}}const o=r.count??1;return r.direction==="past"?{from:No(t,-o,r.period),to:t}:{from:t,to:No(t,o,r.period)}},qo=24,Zo=r=>r.length>qo?`${r.slice(0,qo)}...`:r,Go=r=>r.toLocaleDateString(void 0,{day:"2-digit",month:"short",year:"numeric"}),mt=(r,t="days")=>t==="months"?r.toLocaleDateString(void 0,{month:"short",year:"numeric"}):t==="years"?String(r.getFullYear()):Go(r),Gr={is:"Is","is-before":"Is before","is-after":"Is after","is-on-or-before":"Is on or before","is-on-or-after":"Is on or after","is-between":"Is between","is-relative-to-today":"Is relative to today","is-empty":"Is empty","is-not-empty":"Is not empty"},Sn=["is","is-before","is-after","is-on-or-before","is-on-or-after","is-between","is-relative-to-today","is-empty","is-not-empty"],Et={past:"Past",next:"Next",this:"This"},kn=["day","week","month","year"],Bn=["past","next","this"],mn=r=>r.field.type==="date-compact"?e.jsx(Mn,{field:r.field,value:r.value,onChange:r.onChange,onClear:r.onClear,onRemove:r.onRemove}):e.jsx(En,{field:r.field,value:r.value,onChange:r.onChange,onClear:r.onClear,onRemove:r.onRemove}),En=({field:r,value:t,onChange:o,onClear:n,onRemove:l})=>{const s=t?Go(new Date(t)):null,i=!!s,c=i?e.jsxs(e.Fragment,{children:[e.jsxs("span",{style:{fontWeight:500},children:[r.label,":"]})," ",e.jsx("span",{style:{fontWeight:400},children:Zo(s)})]}):r.label;return e.jsxs(O.Menu,{position:"bottom-left",children:[e.jsx(O.MenuButton,{children:e.jsx(j.Button,{variant:i?"secondary":"outline",tone:"neutral",size:"sm",iconLeft:i?e.jsx(T.Icon,{name:"Calendar",size:"sm"}):void 0,iconRight:e.jsx(T.Icon,{name:"ChevronSmallDown"}),children:c})}),e.jsx(O.MenuLists,{children:e.jsx(O.MenuBody,{style:{width:260},title:e.jsxs(u.Box,{display:"flex",direction:"row",align:"center",justify:"space-between",fullWidth:!0,children:[e.jsx(B.Text,{fontSize:"sm",fontWeight:"medium",color:"subtlest",children:r.label}),e.jsx(Zr,{onClear:n,onRemove:l})]}),children:e.jsx(hr.StarasiaDate,{size:"sm",input:!1,clearable:!0,filter:r.mode,value:t,onChange:a=>a==null?n():o(a),withPadding:!1})})})]})},Fn=(r,t="days")=>{switch(r.op){case"is":case"is-before":case"is-after":case"is-on-or-before":case"is-on-or-after":return r.date?`${Gr[r.op]} ${mt(new Date(r.date),t)}`:null;case"is-between":return r.from&&r.to?`${mt(new Date(r.from),t)} - ${mt(new Date(r.to),t)}`:null;case"is-relative-to-today":{const o=r.relative;if(!o)return null;if(o.direction==="this")return`This ${o.period}`;const n=o.count??1,l=n===1?o.period:`${o.period}s`;return`${Et[o.direction]} ${n} ${l}`}case"is-empty":case"is-not-empty":return Gr[r.op];default:return null}},Mn=({field:r,value:t,onChange:o,onClear:n,onRemove:l})=>{const s=r.ops&&r.ops.length>0?r.ops:Sn,i=r.defaultOp&&s.includes(r.defaultOp)?r.defaultOp:s[0],c=r.mode??"days",a=(t==null?void 0:t.op)??i,h=t?Fn(t,c):null,y=!!h,b=y?e.jsxs(e.Fragment,{children:[e.jsxs("span",{style:{fontWeight:500},children:[r.label,":"]})," ",e.jsx("span",{style:{fontWeight:400},children:Zo(h)})]}):r.label,p=C=>{if(C!==a){if(C==="is-empty"||C==="is-not-empty"){o({op:C});return}if(C==="is-relative-to-today"){o({op:C,relative:(t==null?void 0:t.relative)??{direction:"past",count:1,period:"week"}});return}if(C==="is-between"){o({op:C,from:t==null?void 0:t.from,to:t==null?void 0:t.to});return}o({op:C,date:t==null?void 0:t.date})}};return e.jsxs(O.Menu,{position:"bottom-left",children:[e.jsx(O.MenuButton,{children:e.jsx(j.Button,{variant:y?"secondary":"outline",tone:"neutral",size:"sm",iconLeft:y?e.jsx(T.Icon,{name:"Calendar",size:"sm"}):void 0,iconRight:e.jsx(T.Icon,{name:"ChevronSmallDown"}),children:b})}),e.jsxs(O.MenuLists,{children:[e.jsx(O.MenuBody,{style:{width:320},title:e.jsxs(u.Box,{display:"flex",direction:"row",align:"center",justify:"space-between",gap:"xs",fullWidth:!0,children:[e.jsxs(u.Box,{display:"flex",direction:"row",align:"center",gap:"xs",style:{minWidth:0},children:[e.jsx(B.Text,{fontSize:"sm",fontWeight:"medium",color:"subtlest",children:r.label}),e.jsx(Tn,{op:a,ops:s,onChange:p})]}),e.jsx(Zr,{onClear:n,onRemove:l})]}),children:e.jsx(Ln,{value:t,op:a,mode:c,onChange:o})}),a==="is-relative-to-today"&&e.jsx(O.MenuFooter,{children:e.jsx(B.Text,{fontSize:"xs",color:"subtlest",children:"Filter will update with the current date"})})]})]})},Tn=({op:r,ops:t,onChange:o})=>e.jsxs(O.Menu,{position:"bottom-left",children:[e.jsx(O.MenuButton,{children:e.jsx(j.Button,{variant:"link",tone:"neutral",size:"xs",iconRight:e.jsx(T.Icon,{name:"ChevronSmallDown"}),children:Gr[r]})}),e.jsx(O.MenuLists,{children:e.jsx(O.MenuBody,{style:{width:200},children:t.map(n=>e.jsx(O.MenuItem,{selected:r===n,onClick:()=>o(n),endIcon:r===n?e.jsx(T.Icon,{name:"Check"}):void 0,children:Gr[n]},n))})})]}),Ln=({value:r,op:t,mode:o="days",onChange:n})=>{if(t==="is-empty"||t==="is-not-empty")return e.jsx(u.Box,{paddingBlock:"sm",paddingInline:"sm",children:e.jsx(B.Text,{fontSize:"xs",color:"subtlest",children:"No further input required."})});if(t==="is-between"){const l=r!=null&&r.from||r!=null&&r.to?{from:r!=null&&r.from?new Date(r.from):null,to:r!=null&&r.to?new Date(r.to):null}:void 0;return e.jsx(hr.StarasiaDate,{size:"sm",input:!1,clearable:!0,rangedDate:!0,filter:o,value:l,onChange:s=>{if(s==null){n({op:t});return}if(typeof s=="object"&&s!==null&&"from"in s&&"to"in s){let{from:i,to:c}=s;if(!i&&c&&(i=c,c=null),!i&&!c){n({op:t});return}n({op:t,from:i?i.toISOString():void 0,to:c?c.toISOString():void 0})}},withPadding:!1},`range-${o}`)}return t==="is-relative-to-today"?e.jsx(In,{value:r==null?void 0:r.relative,onChange:l=>n({op:t,relative:l})}):e.jsx(hr.StarasiaDate,{size:"sm",input:!1,clearable:!0,filter:o,value:r!=null&&r.date?new Date(r.date):void 0,onChange:l=>{if(l==null){n({op:t});return}l instanceof Date&&n({op:t,date:l.toISOString()})},withPadding:!1},`single-${o}`)},In=({value:r,onChange:t})=>{const o=(r==null?void 0:r.direction)??"past",n=(r==null?void 0:r.count)??1,l=(r==null?void 0:r.period)??"week",s=o!=="this",i=_o({direction:o,count:n,period:l});return e.jsxs(u.Box,{direction:"column",display:"flex",gap:"sm",children:[e.jsxs(u.Box,{direction:"row",display:"flex",align:"center",gap:"xs",children:[e.jsxs(O.Menu,{position:"bottom-left",children:[e.jsx(O.MenuButton,{children:e.jsx(j.Button,{variant:"outline",tone:"neutral",size:"sm",iconRight:e.jsx(T.Icon,{name:"ChevronSmallDown"}),children:Et[o]})}),e.jsx(O.MenuLists,{children:e.jsx(O.MenuBody,{style:{width:140},children:Bn.map(c=>e.jsx(O.MenuItem,{selected:o===c,endIcon:o===c?e.jsx(T.Icon,{name:"Check"}):void 0,onClick:()=>t(c==="this"?{direction:c,period:l}:{direction:c,count:n,period:l}),children:Et[c]},c))})})]}),s&&e.jsx(ar.Input,{type:"number",size:"sm",min:1,clearable:!1,value:n,onChange:c=>{const a=Number(c.target.value);t({direction:o,count:Number.isFinite(a)&&a>0?a:1,period:l})},style:{width:72}}),e.jsxs(O.Menu,{position:"bottom-left",children:[e.jsx(O.MenuButton,{children:e.jsx(j.Button,{variant:"outline",tone:"neutral",size:"sm",iconRight:e.jsx(T.Icon,{name:"ChevronSmallDown"}),children:l})}),e.jsx(O.MenuLists,{children:e.jsx(O.MenuBody,{style:{width:140},children:kn.map(c=>e.jsx(O.MenuItem,{selected:l===c,endIcon:l===c?e.jsx(T.Icon,{name:"Check"}):void 0,onClick:()=>t(o==="this"?{direction:o,period:c}:{direction:o,count:n,period:c}),children:c},c))})})]})]}),e.jsx(hr.StarasiaDate,{size:"sm",input:!1,disabled:!0,rangedDate:!0,value:i,onChange:()=>{},withPadding:!1},"relative-preview")]})},Qo=18,On=r=>r.length>Qo?`${r.slice(0,Qo)}...`:r,Wn=({field:r,value:t,onChange:o,onClear:n,onRemove:l})=>{const s=r.type==="dropdown-multiple",i=t.length,c=r.searchable!==!1,[a,h]=d.useState(""),y=r.options,b=typeof r.onSearch=="function",p=(()=>{if(b)return y;const F=a.trim().toLowerCase();return F?y.filter(I=>I.label.toLowerCase().includes(F)):y})(),C=F=>t.some(I=>I.value===F.value),E=F=>{if(!s){o([{label:F.label,value:F.value}]),h("");return}o(C(F)?t.filter(I=>I.value!==F.value):[...t,{label:F.label,value:F.value}])},w=F=>{var I;h(F),(I=r.onSearch)==null||I.call(r,F)},L=i===0?r.label:e.jsxs(e.Fragment,{children:[e.jsxs("span",{style:{fontWeight:500},children:[r.label,":"]})," ",e.jsx("span",{style:{fontWeight:400},children:i===1?On(t[0].label):`${i} Selected`})]});return e.jsxs(O.Menu,{position:"bottom-left",children:[e.jsx(O.MenuButton,{children:e.jsx(j.Button,{variant:i>0?"secondary":"outline",tone:"neutral",size:"sm",iconLeft:i>0?e.jsx(T.Icon,{name:"Tag",size:"sm"}):void 0,iconRight:e.jsx(T.Icon,{name:"ChevronSmallDown"}),children:L})}),e.jsx(O.MenuLists,{children:e.jsx(O.MenuBody,{style:{width:260},title:e.jsxs(u.Box,{display:"flex",direction:"row",align:"center",justify:"space-between",fullWidth:!0,children:[e.jsx(B.Text,{fontSize:"sm",fontWeight:"medium",color:"subtlest",children:r.label}),e.jsx(Zr,{onClear:n,onRemove:l})]}),children:e.jsxs(u.Box,{direction:"column",gap:"sm",children:[c&&e.jsx(pr.Dropdown,{size:"sm",triggerInput:!0,fullWidth:!0,hideChevronIcon:!0,clearable:!0,multiSelect:s,searchAble:!0,searchValue:a,onSearch:w,value:t,onChange:o,placeholder:`Search ${r.label.toLowerCase()}…`}),e.jsx(u.Box,{direction:"column",overflow:"overflow-y-auto",customMaxHeight:"240px",children:r.isLoading?e.jsx(u.Box,{paddingBlock:"sm",paddingInline:"sm",children:e.jsx(B.Text,{fontSize:"xs",color:"subtlest",children:"Loading…"})}):p.length===0?e.jsx(u.Box,{paddingBlock:"sm",paddingInline:"sm",children:e.jsx(B.Text,{fontSize:"xs",color:"subtlest",children:"No results"})}):p.map(F=>e.jsx(O.MenuItem,{closeOnSelect:!s,selected:C(F),startIcon:F.avatar,endIcon:C(F)?e.jsx(T.Icon,{name:"Check"}):void 0,description:F.description,onClick:()=>E(F),children:F.label},F.value))})]})})})]})},Uo=18,An=r=>r.length>Uo?`${r.slice(0,Uo)}...`:r,Jo=({checked:r,indeterminate:t})=>e.jsx("span",{style:{pointerEvents:"none",display:"inline-flex"},children:e.jsx(er.Checkbox,{size:"sm",checked:r,readOnly:!0,onChange:()=>{},variant:t?"indeterminate":"select"})}),zn=({field:r,value:t,onChange:o,onClear:n,onRemove:l})=>{const s=new Set(t.map(p=>p.value)),i=t.length,c=r.options.length>0&&r.options.every(p=>s.has(p.value)),a=i>0&&!c,h=p=>{o(s.has(p.value)?t.filter(C=>C.value!==p.value):[...t,{label:p.label,value:p.value}])},y=()=>{o(c?[]:r.options.map(p=>({label:p.label,value:p.value})))},b=i===0?r.label:e.jsxs(e.Fragment,{children:[e.jsxs(B.Text,{as:"span",fontWeight:"semibold",children:[r.label,":"]})," ",e.jsx(B.Text,{as:"span",children:i===1?An(t[0].label):`${i} Selected`})]});return e.jsxs(O.Menu,{position:"bottom-left",children:[e.jsx(O.MenuButton,{children:e.jsx(j.Button,{variant:i>0?"secondary":"outline",tone:"neutral",size:"sm",iconLeft:i>0?e.jsx(T.Icon,{name:"Tag",size:"sm"}):void 0,iconRight:e.jsx(T.Icon,{name:"ChevronSmallDown"}),children:b})}),e.jsx(O.MenuLists,{children:e.jsxs(O.MenuBody,{style:{width:240},title:e.jsxs(u.Box,{display:"flex",direction:"row",align:"center",justify:"space-between",fullWidth:!0,children:[e.jsx(B.Text,{fontSize:"sm",fontWeight:"medium",color:"subtlest",children:r.label}),e.jsx(Zr,{onClear:n,onRemove:l})]}),children:[e.jsx(O.MenuItem,{closeOnSelect:!1,selected:c,onClick:y,startIcon:e.jsx(Jo,{checked:c||a,indeterminate:a}),children:"Select All"}),r.options.map(p=>e.jsx(O.MenuItem,{closeOnSelect:!1,selected:s.has(p.value),onClick:()=>h(p),startIcon:e.jsx(Jo,{checked:s.has(p.value)}),children:p.label},p.value))]})})]})},Yo=({activeKeys:r,configByKey:t,getValue:o,setValue:n,clearValue:l,removeFilter:s})=>e.jsx(e.Fragment,{children:r.map(i=>{const c=t[i];if(!c)return null;const a=o(c),h=c.locked?void 0:()=>s(i);return c.type==="date"||c.type==="date-compact"?e.jsx(mn,{field:c,value:a,onChange:y=>n(c,y),onClear:()=>l(i),onRemove:h},i):c.type==="checkbox-multiple"?e.jsx(zn,{field:c,value:a||[],onChange:y=>n(c,y),onClear:()=>l(i),onRemove:h},i):e.jsx(Wn,{field:c,value:a||[],onChange:y=>n(c,y),onClear:()=>l(i),onRemove:h},i)})}),Xo=r=>`${r} Rows`,Hn=({pagination:r,pageKey:t="page",perPageKey:o="perPage",pageSizeOptions:n=[10,25,50,100],defaultPerPage:l=10,showResultCount:s=!0,showPageSize:i=!0,showPagination:c=!0})=>{var F;const{searchQueries:a,setSearchParams:h,searchParams:y}=We(),b=y.get(o),p=b?Number(b):l,C=I=>{h({...a,[t]:String(I)})},E=I=>{h({...a,[o]:I,[t]:"1"})},w=(r==null?void 0:r.rangeStart)??(((r==null?void 0:r.currentPage)||0)>1?(((r==null?void 0:r.currentPage)||0)-1)*((r==null?void 0:r.perPage)||0)+1:0),L=(r==null?void 0:r.rangeEnd)??((r==null?void 0:r.totalCurrentPage)!==(r==null?void 0:r.perPage)?r==null?void 0:r.totalData:((r==null?void 0:r.currentPage)||1)*((r==null?void 0:r.totalCurrentPage)||0));return e.jsxs(e.Fragment,{children:[s&&e.jsx(B.Text,{fontSize:"sm",fontWeight:"medium",color:"primary",truncate:!0,children:`${w}-${L} of ${((F=r==null?void 0:r.totalData)==null?void 0:F.toLocaleString())||0}`}),i&&e.jsxs(O.Menu,{position:"bottom-left",children:[e.jsx(O.MenuButton,{children:e.jsx(j.Button,{variant:"outline",tone:"neutral",size:"sm",iconRight:e.jsx(T.Icon,{name:"ChevronSmallDown"}),"aria-label":"Rows per page",children:Xo(p)})}),e.jsx(O.MenuLists,{children:e.jsx(O.MenuBody,{children:n.map(I=>e.jsx(O.MenuItem,{selected:I===p,onClick:()=>E(String(I)),children:Xo(I)},I))})})]}),c&&((r==null?void 0:r.totalPage)??0)>1&&e.jsx(u.Box,{direction:"column",display:"flex",align:"center",gap:"sm",paddingRight:"sm",style:{borderRight:"1px solid var(--sa-border-subtle, rgba(11, 18, 14, 0.14))"},children:e.jsx(Br.Pagination,{size:"sm",variant:"neutral",siblingCount:0,currentPage:r!=null&&r.currentPage?Number(r.currentPage):1,totalPages:Number(r==null?void 0:r.totalPage),onPageChange:C})})]})};function Vn(r,t,o=!0){d.useEffect(()=>{if(!o)return;const n=l=>{var c;if(l.metaKey||l.ctrlKey||l.altKey||l.key!==r||Oe.isOverlayOpen())return;const s=l.target,i=(c=s==null?void 0:s.tagName)==null?void 0:c.toLowerCase();i==="input"||i==="textarea"||s!=null&&s.isContentEditable||(l.preventDefault(),t())};return window.addEventListener("keydown",n),()=>window.removeEventListener("keydown",n)},[r,t,o])}const Pn=240,$o=({searchKey:r="q",filterKey:t="filter",pageKey:o="page",placeholder:n="Search",shortcut:l="/",collapsible:s=!0})=>{const{searchParams:i,setSearchParams:c,searchQueries:a}=We(),h=_r(r,i,t)||"",[y,b]=d.useState(!s||!!h),[p,C]=d.useState(s&&!h),[E,w]=d.useState(h),L=De.useDebounce(E,350),F=d.useRef(null);d.useEffect(()=>{w(h),h&&b(!0)},[h]),d.useEffect(()=>{y&&C(!1)},[y]),d.useEffect(()=>{L!==h&&Fr({value:L,name:r,type:"search",searchQueries:a,setSearchParams:c,filterKey:t,pageKey:o})},[L]);const I=d.useCallback(()=>{b(!0),requestAnimationFrame(()=>{var A;return(A=F.current)==null?void 0:A.focus()})},[]);Vn(l,I);const S=()=>{s&&!E&&b(!1)},D=A=>{var k;s&&A.key==="Escape"&&!E&&(b(!1),(k=F.current)==null||k.blur())},H=()=>{y||C(!0)};return e.jsxs(u.Box,{display:"flex",direction:"row",align:"center",gap:"spacing-0",children:[p&&e.jsx(j.Button,{variant:"outline",tone:"neutral",size:"sm",iconLeft:e.jsx(T.Icon,{name:"Search",size:"sm"}),"aria-label":"Search","aria-expanded":!1,onClick:I}),e.jsxs(u.Box,{onTransitionEnd:H,style:{position:"relative",width:y?Pn:0,overflow:"hidden",transition:"width 220ms ease"},children:[e.jsx(ar.Input,{ref:F,size:"sm",fullWidth:!0,value:E,placeholder:n,leftIcon:e.jsx(T.Icon,{name:"Search",width:16,height:16}),onChange:A=>w(A.target.value),onKeyDown:D,onBlur:S,tabIndex:y?0:-1}),y&&!E&&e.jsx(u.Box,{align:"center",justify:"center",borderColor:"border-subtle",borderWidth:"border",borderStyle:"border-solid",borderRadius:"rounded-xs",paddingInline:"spacing-1",customBackgroundColor:"var(--sa-background-surface-hover, #f1f2f4)",style:{position:"absolute",right:8,top:"50%",transform:"translateY(-50%)",pointerEvents:"none",minWidth:18,height:18,display:"inline-flex"},children:e.jsx(B.Text,{fontSize:"xs",color:"subtle",children:l})})]})]})},Ko=({columns:r,allVisible:t,onToggle:o,onReorder:n,onSetAllHidden:l})=>{const[s,i]=d.useState(null),[c,a]=d.useState(null),h=()=>{s!==null&&c!==null&&s!==c&&n(s,c),i(null),a(null)},y=(b,p)=>{const C=b+p;C<0||C>=r.length||n(b,C)};return e.jsxs(O.Menu,{position:"bottom-right",children:[e.jsx(O.MenuButton,{children:e.jsx(j.Button,{variant:t?"outline":"secondary",tone:"neutral",size:"sm",iconLeft:e.jsx(T.Icon,{name:"Grid",size:"sm"}),"aria-label":"Customize columns"})}),e.jsx(O.MenuLists,{children:e.jsx(O.MenuBody,{children:e.jsxs(u.Box,{padding:"sm",direction:"column",customWidth:"296px",customMaxHeight:"60vh",overflow:"overflow-hidden",children:[e.jsx(B.Text,{fontWeight:"semibold",color:"primary",children:"Customize Column Table"}),e.jsxs(u.Box,{direction:"row",display:"flex",align:"center",justify:"space-between",paddingBlock:"md",children:[e.jsx(B.Text,{fontSize:"sm",fontWeight:"medium",color:"subtle",children:"Show in table"}),e.jsx(j.Button,{variant:"link",tone:"info",size:"xs",onClick:()=>l(t),children:t?"Hide All":"Show All"})]}),e.jsx(u.Box,{direction:"column",overflow:"overflow-y-auto",children:r.map((b,p)=>{const C=!b.locked,E=c===p&&s!==null&&s!==p;return e.jsxs(u.Box,{direction:"row",display:"flex",align:"center",gap:"sm",paddingBlock:"xs",draggable:C,onDragStart:()=>C&&i(p),onDragOver:w=>{w.preventDefault(),a(p)},onDrop:h,onDragEnd:h,style:{minHeight:32,boxShadow:E?"inset 0 2px 0 0 var(--sa-background-brand, #04254f)":void 0},children:[e.jsx(u.Box,{direction:"column",as:"div",align:"center",justify:"center",role:"button",tabIndex:C?0:-1,"aria-label":`Reorder ${b.title}`,"aria-disabled":!C||void 0,color:"icon-subtlest",onKeyDown:w=>{C&&(w.key==="ArrowUp"?(w.preventDefault(),y(p,-1)):w.key==="ArrowDown"&&(w.preventDefault(),y(p,1)))},style:{display:"inline-flex",cursor:C?"grab":"default",opacity:C?1:.4},children:e.jsx(T.Icon,{name:"DragVertical",width:16,height:16})}),b.icon&&e.jsx(u.Box,{direction:"column",align:"center",color:"icon-subtle",style:{display:"inline-flex"},children:b.icon}),e.jsx(B.Text,{fontSize:"sm",fontWeight:"medium",color:"primary",truncate:!0,children:b.title}),e.jsx(u.Box,{direction:"column",style:{marginLeft:"auto"},children:e.jsx(Cr.Toggle,{size:"sm",checked:b.visible,disabled:b.locked,onChange:()=>o(b.key),"aria-label":`Toggle ${b.title} column`})})]},b.key)})})]})})})]})},Ro=({views:r,onApply:t,onDelete:o,onSave:n})=>{const[l,s]=d.useState(""),i=()=>{const c=l.trim();c&&(n(c),s(""))};return e.jsxs(O.Menu,{position:"bottom-right",children:[e.jsx(O.MenuButton,{children:e.jsx(j.Button,{variant:r.length>0?"secondary":"outline",tone:(r.length>0,"neutral"),size:"sm",iconLeft:e.jsx(T.Icon,{name:"Bookmark",size:"sm"}),"aria-label":"Saved views"})}),e.jsxs(O.MenuLists,{style:{width:"260px"},children:[e.jsx(O.MenuBody,{children:e.jsxs(u.Box,{direction:"column",padding:"xs",gap:"sm",children:[e.jsx(B.Text,{fontWeight:"semibold",color:"primary",children:"Saved Views"}),e.jsx(u.Box,{direction:"column",overflow:"overflow-y-auto",children:r.length===0?e.jsx(u.Box,{direction:"column",paddingBlock:"sm",children:e.jsx(B.Text,{fontSize:"sm",color:"subtlest",children:"No saved views yet"})}):r.map(c=>e.jsx(O.MenuItem,{startIcon:e.jsx(T.Icon,{name:"Bookmark"}),onClick:()=>t(c),endIcon:e.jsx(j.Button,{variant:"link",tone:"error",size:"sm",iconLeft:e.jsx(T.Icon,{name:"Trash2"}),"aria-label":`Delete ${c.name}`,onClick:a=>{a.stopPropagation(),o(c.id)}}),children:c.name},c.id))})]})}),e.jsx(O.MenuFooter,{children:e.jsxs(u.Box,{direction:"row",gap:"xs",children:[e.jsx(u.Box,{direction:"column",style:{flex:"1 0 0",minWidth:0},children:e.jsx(ar.Input,{size:"sm",fullWidth:!0,placeholder:"Save current view as…",value:l,onChange:c=>s(c.target.value),onKeyDown:c=>{c.key==="Enter"&&i()}})}),e.jsx(j.Button,{variant:"primary",tone:"brand",size:"sm",disabled:!l.trim(),onClick:i,children:"Save"})]})})]})]})},jn=({isOpen:r,onClose:t,configs:o,activeKeys:n,configByKey:l,hasActiveFilter:s,onToggle:i,onReset:c,getValue:a,setValue:h,clearValue:y,removeFilter:b})=>{const p=n.length;return e.jsx(Ar.Drawer,{position:"bottom",isShow:r,onHide:t,children:e.jsxs(u.Box,{direction:"column",customMaxHeight:"85vh",style:{minHeight:280},children:[e.jsxs(u.Box,{direction:"row",display:"flex",align:"center",justify:"space-between",paddingInline:"md",paddingBlock:"sm",style:{borderBottom:"1px solid var(--sa-border-subtle, rgba(11, 18, 14, 0.14))"},children:[e.jsxs(u.Box,{direction:"row",display:"flex",align:"center",gap:"xs",children:[e.jsx(B.Text,{fontWeight:"semibold",color:"primary",children:"Filter"}),p>0&&e.jsxs(B.Text,{fontSize:"sm",color:"subtle",children:["(",p,")"]})]}),e.jsx(j.Button,{variant:"link",tone:"neutral",size:"sm",iconLeft:e.jsx(T.Icon,{name:"Cross"}),"aria-label":"Close filter",onClick:t})]}),e.jsxs(u.Box,{direction:"column",gap:"lg",padding:"md",overflow:"overflow-y-auto",style:{flex:"1 1 auto",minHeight:0},children:[p>0&&e.jsxs(u.Box,{direction:"column",gap:"sm",children:[e.jsx(B.Text,{fontSize:"xs",fontWeight:"medium",color:"subtlest",children:"Filter aktif"}),e.jsx(u.Box,{direction:"row",display:"flex",wrap:"wrap",gap:"sm",align:"center",children:e.jsx(Yo,{activeKeys:n,configByKey:l,getValue:a,setValue:h,clearValue:y,removeFilter:b})})]}),o.length>0&&e.jsxs(u.Box,{direction:"column",gap:"sm",children:[e.jsx(B.Text,{fontSize:"xs",fontWeight:"medium",color:"subtlest",children:"Tambah filter"}),e.jsx(u.Box,{direction:"column",children:o.map(C=>{const E=n.includes(C.key),w=!!C.locked;return e.jsxs(u.Box,{direction:"row",display:"flex",align:"center",justify:"space-between",gap:"sm",paddingBlock:"sm",style:{opacity:w?.5:1,borderTop:"1px solid var(--sa-border-subtle, rgba(11, 18, 14, 0.08))"},children:[e.jsxs(u.Box,{direction:"row",display:"flex",align:"center",gap:"sm",style:{minWidth:0},children:[C.icon&&e.jsx(u.Box,{direction:"column",align:"center",color:"icon-subtle",style:{display:"inline-flex"},children:C.icon}),e.jsx(B.Text,{fontSize:"sm",color:"primary",truncate:!0,children:C.label})]}),e.jsx(Cr.Toggle,{size:"sm",checked:E||w,disabled:w,onChange:()=>i(C.key),"aria-label":`Toggle ${C.label}`})]},C.key)})})]})]}),e.jsxs(u.Box,{direction:"row",display:"flex",gap:"sm",paddingInline:"md",paddingBlock:"sm",style:{borderTop:"1px solid var(--sa-border-subtle, rgba(11, 18, 14, 0.14))"},children:[e.jsx(u.Box,{direction:"column",style:{flex:"1 1 0"},children:e.jsx(j.Button,{variant:"outline",tone:"neutral",size:"md",fullWidth:!0,disabled:!s,onClick:c,children:"Reset"})}),e.jsx(u.Box,{direction:"column",style:{flex:"1 1 0"},children:e.jsx(j.Button,{variant:"primary",tone:"brand",size:"md",fullWidth:!0,onClick:t,children:"Selesai"})})]})]})})},Nn=r=>`${r} Rows`,_n=({perPageKey:r,pageKey:t,pageSizeOptions:o,defaultPerPage:n=10,showPageSize:l})=>{const{searchQueries:s,setSearchParams:i,searchParams:c}=We(),a=c.get(r),h=a?Number(a):n,y=b=>{i({...s,[r]:b,[t]:"1"})};return l?e.jsxs(O.Menu,{position:"bottom-right",children:[e.jsx(O.MenuButton,{children:e.jsx(j.Button,{variant:"outline",tone:"neutral",size:"sm",iconLeft:e.jsx(T.Icon,{name:"MenuVertical",size:"sm"}),"aria-label":"More options"})}),e.jsx(O.MenuLists,{children:e.jsxs(O.MenuBody,{style:{minWidth:200},children:[e.jsx(u.Box,{paddingInline:"sm",paddingBlock:"xs",children:e.jsx(B.Text,{fontSize:"xs",fontWeight:"medium",color:"subtlest",children:"Rows per page"})}),o.map(b=>e.jsx(O.MenuItem,{selected:b===h,endIcon:b===h?e.jsx(T.Icon,{name:"Check"}):void 0,onClick:()=>y(String(b)),children:Nn(b)},b))]})})]}):null},qn=r=>{var Ge;const{withPadding:t,configs:o,activeKeys:n,configByKey:l,hasActiveFilter:s,toggleFilter:i,removeFilter:c,getValue:a,setValue:h,clearValue:y,onReset:b,searchable:p,searchKey:C,filterKey:E,pageKey:w,searchPlaceholder:L,searchShortcut:F,searchCollapsible:I,pagination:S,perPageKey:D,pageSizeOptions:H,defaultPerPage:A,showPagination:k,showResultCount:z,showPageSize:W,hasColumns:X,orderedColumns:K,allVisible:Q,onToggleVisibility:_,onReorder:R,onSetAllHidden:re,showSavedViews:q,savedViews:P,onApplyView:N,onDeleteView:ce,onSaveView:xe,leadingActions:Ae}=r,[ue,Se]=d.useState(!1),{searchQueries:Be,setSearchParams:ze}=We(),He=(S==null?void 0:S.rangeStart)??(((S==null?void 0:S.currentPage)||0)>1?(((S==null?void 0:S.currentPage)||0)-1)*((S==null?void 0:S.perPage)||0)+1:1),Le=(S==null?void 0:S.rangeEnd)??((S==null?void 0:S.totalCurrentPage)!==(S==null?void 0:S.perPage)?S==null?void 0:S.totalData:((S==null?void 0:S.currentPage)||1)*((S==null?void 0:S.totalCurrentPage)||0)),je=Xe=>{ze({...Be,[w]:String(Xe)})},we=z||k&&!!(S!=null&&S.totalPage),Pe=()=>{b(),Se(!1)};return e.jsxs(u.Box,{direction:"column",gap:"sm",fullWidth:!0,paddingTop:t?"sm":void 0,paddingBottom:t?"sm":void 0,paddingLeft:t?"md":void 0,paddingRight:t?"md":void 0,role:"toolbar","aria-label":"Filter bar",children:[e.jsxs(u.Box,{direction:"row",display:"flex",align:"center",wrap:"wrap",gap:"sm",fullWidth:!0,overflow:"overflow-auto",children:[p&&e.jsx($o,{searchKey:C,filterKey:E,pageKey:w,placeholder:L,shortcut:F,collapsible:I}),e.jsx(j.Button,{variant:s?"secondary":"outline",tone:"neutral",size:"sm",iconLeft:e.jsx(T.Icon,{name:"FilterHorizontal"}),onClick:()=>Se(!0),"aria-label":"Open filters",children:s?`Filter: ${n.length}`:null}),e.jsxs(u.Box,{direction:"row",display:"flex",align:"center",gap:"sm",style:{marginLeft:"auto"},children:[Ae,q&&e.jsx(Ro,{views:P,onApply:N,onDelete:ce,onSave:xe}),X&&e.jsx(Ko,{columns:K,allVisible:Q,onToggle:_,onReorder:R,onSetAllHidden:re}),e.jsx(_n,{perPageKey:D,pageKey:w,pageSizeOptions:H,defaultPerPage:A,showPageSize:W})]})]}),we&&e.jsxs(u.Box,{direction:"row",display:"flex",align:"center",justify:"space-between",gap:"sm",fullWidth:!0,children:[z?e.jsx(B.Text,{fontSize:"sm",fontWeight:"medium",color:"primary",truncate:!0,children:`${He}-${Le} of ${((Ge=S==null?void 0:S.totalData)==null?void 0:Ge.toLocaleString())||0}`}):e.jsx(u.Box,{direction:"column"}),k&&!!(S!=null&&S.totalPage)&&e.jsx(Br.Pagination,{size:"xs",variant:"neutral",siblingCount:0,currentPage:S!=null&&S.currentPage?Number(S.currentPage):1,totalPages:Number(S.totalPage),onPageChange:je})]}),e.jsx(jn,{isOpen:ue,onClose:()=>Se(!1),configs:o,activeKeys:n,configByKey:l,hasActiveFilter:s,onToggle:i,onReset:Pe,getValue:a,setValue:h,clearValue:y,removeFilter:c})]})},Zn=({withPadding:r=!1,filterConfigs:t=[],filterKey:o="filter",activeFilterKey:n="filters",pageKey:l="page",perPageKey:s="perPage",pageSizeOptions:i=[25,50,100],defaultPerPage:c,showPagination:a=!0,showResultCount:h=!0,showPageSize:y=!0,searchable:b=!1,searchKey:p="q",searchPlaceholder:C="Search",searchShortcut:E="/",searchPosition:w="right",searchCollapsible:L=!0,pagination:F,columns:I=[],onColumnsChange:S,columnsState:D,scopeId:H,savedViews:A,persistLastState:k=!0,persistSearch:z=!0,storage:W=Dt,onReset:X,leadingActions:K})=>{const Q=H??(A==null?void 0:A.scopeId),{activeKeys:_,configByKey:R,hasActiveFilter:re,toggleFilter:q,removeFilter:P,getValue:N,setValue:ce,clearValue:xe,clearAll:Ae}=wt({configs:t,filterKey:o,activeFilterKey:n,pageKey:l,searchKey:p}),ue=gn({columns:I,scopeId:Q,storage:W,onColumnsChange:S,value:D}),Se=yn({scopeId:Q,storage:W,snapshotKeys:[n,o,s],pageKey:l,getColumns:()=>ue.state,applyColumns:ue.applyState}),Be=bn({scopeId:Q,storage:W,snapshotKeys:[n,o,l],enabled:k,filterKey:o,searchKey:p,persistSearch:z}),ze=vn({scopeId:Q,storage:W,perPageKey:s,pageSizeOptions:i,enabled:k});xn({enabled:k&&!!Q,snapshotKeys:[n,o,l],perPageKey:s,readSnapshot:Be.read,readPerPage:ze.read});const He=c??i[0]??25,Le=!!(A!=null&&A.enabled)&&Se.enabled,je=()=>{Ae(),Be.clear(),X==null||X()},we=De.useMediaQuery("md"),Pe=b?e.jsx($o,{searchKey:p,filterKey:o,pageKey:l,placeholder:C,shortcut:E,collapsible:L}):null;return we?e.jsxs(u.Box,{display:"flex",direction:"row",align:"center",gap:"sm",wrap:"wrap",fullWidth:!0,paddingTop:r?"sm":void 0,paddingBottom:r?"sm":void 0,paddingLeft:r?"md":void 0,paddingRight:r?"md":void 0,role:"toolbar","aria-label":"Filter bar",children:[e.jsxs(u.Box,{direction:"row",display:"flex",align:"center",gap:"sm",style:{flex:"1 1 0",minWidth:0},children:[e.jsx(wn,{configs:t,activeKeys:_,onToggle:q,hasActiveFilter:re,onReset:je}),w==="left"&&Pe,e.jsxs(u.Box,{direction:"row",display:"flex",align:"center",gap:"sm",overflow:"overflow-x-auto",style:{flex:"1 1 0",minWidth:0},children:[e.jsx(Yo,{activeKeys:_,configByKey:R,getValue:N,setValue:ce,clearValue:xe,removeFilter:P}),re&&e.jsx(j.Button,{variant:"link",tone:"brand",size:"sm",onClick:je,children:"Reset"})]})]}),e.jsxs(u.Box,{direction:"row",display:"flex",align:"center",gap:"sm",children:[K,e.jsx(Hn,{pagination:F,pageKey:l,perPageKey:s,pageSizeOptions:i,defaultPerPage:He,showPagination:a,showResultCount:h,showPageSize:y}),w==="right"&&Pe,Le&&e.jsx(Ro,{views:Se.views,onApply:Se.applyView,onDelete:Se.deleteView,onSave:Se.saveView}),I.length>0&&e.jsx(Ko,{columns:ue.orderedColumns,allVisible:ue.allVisible,onToggle:ue.toggleVisibility,onReorder:ue.reorder,onSetAllHidden:ue.setAllHidden})]})]}):e.jsx(qn,{withPadding:r,configs:t,activeKeys:_,configByKey:R,hasActiveFilter:re,toggleFilter:q,removeFilter:P,getValue:N,setValue:ce,clearValue:xe,onReset:je,searchable:b,searchKey:p,filterKey:o,pageKey:l,searchPlaceholder:C,searchShortcut:E,searchCollapsible:L,pagination:F,perPageKey:s,pageSizeOptions:i,defaultPerPage:He,showPagination:a,showResultCount:h,showPageSize:y,hasColumns:I.length>0,orderedColumns:ue.orderedColumns,allVisible:ue.allVisible,onToggleVisibility:ue.toggleVisibility,onReorder:ue.reorder,onSetAllHidden:ue.setAllHidden,showSavedViews:Le,savedViews:Se.views,onApplyView:Se.applyView,onDeleteView:Se.deleteView,onSaveView:Se.saveView,leadingActions:K})},Gn=r=>{if(!Array.isArray(r)||r.length===0)return;const t=r[0];return(t==null?void 0:t.value)!=null?String(t.value):void 0},Qn=r=>{if(!Array.isArray(r)||r.length===0)return;const t=r.map(o=>(o==null?void 0:o.value)!=null?String(o.value):null).filter(o=>o!=null);return t.length?t:void 0},Un=(r,t)=>{switch(r.type){case"dropdown":case"radio":return Gn(t);case"dropdown-multiple":case"checkbox-multiple":return Qn(t);case"date":return t instanceof Date?t.toISOString():void 0;case"date-compact":return t;default:return}},el=(r,t)=>{if(r==null||r==="")return t;const o=Number(r);return Number.isFinite(o)&&o>0?o:t},Jn=r=>{const{filterConfigs:t,filterKey:o="filter",activeFilterKey:n="filters",pageKey:l="page",perPageKey:s="perPage",searchKey:i="q",defaultPage:c=1,defaultPerPage:a=10,paramKeys:h,serialize:y}=r,{activeKeys:b,configByKey:p,hasActiveFilter:C,getValue:E}=wt({configs:t,filterKey:o,activeFilterKey:n,pageKey:l,searchKey:i}),{searchParams:w}=We(),L=w.toString();return d.useMemo(()=>{const I={},S={},D=el(w.get(l),c),H=el(w.get(s),a);I[(h==null?void 0:h.page)??"page"]=D,I[(h==null?void 0:h.perPage)??"perPage"]=H;const A=_r(i,w,o)||"";A&&(I[(h==null?void 0:h.search)??"search"]=A);let k=!1;for(const z of b){const W=p[z];if(!W)continue;const X=E(W);S[z]=X;const K=y==null?void 0:y[z],Q=K?K(X):Un(W,X);if(Q==null||Array.isArray(Q)&&Q.length===0)continue;const _=(h==null?void 0:h[z])??z;I[_]=Q,k=!0}return{params:I,raw:S,hasActiveFilter:C||!!A||k}},[L,b.join("|"),o,n,l,s,i,c,a,h,y,p])},Yn=["dropdown","dropdown-multiple","checkbox-multiple","radio"],Xn=({filterConfigs:r,filterKey:t,activeFilterKey:o,pageKey:n,searchKey:l})=>{const{configByKey:s,getValue:i,setValue:c,removeFilter:a,clearAll:h,hasActiveFilter:y}=wt({configs:r,filterKey:t,activeFilterKey:o,pageKey:n,searchKey:l}),b=(F,I)=>{var D;const S=F.options;return((D=S==null?void 0:S.find(H=>H.value===I))==null?void 0:D.label)??I},p=d.useCallback(F=>{const I=s[F];if(!I)return[];const S=i(I);return Array.isArray(S)?S.map(D=>String(D.value)):[]},[s,i]),C=d.useCallback((F,I)=>{const S=s[F];if(!S||!Yn.includes(S.type))return;const D=Array.isArray(I)?I:[I];if(D.length===0){a(F);return}c(S,D.map(H=>({label:b(S,H),value:H})))},[s,c,a]),E=d.useCallback((F,I)=>{const S=p(F);C(F,S.includes(I)?S.filter(D=>D!==I):[...S,I])},[p,C]),w=d.useCallback((F,I)=>p(F).includes(I),[p]),L=d.useCallback(F=>a(F),[a]);return{set:C,toggle:E,clear:L,clearAll:h,isActive:w,values:p,hasActiveFilter:y}},$n=(r,t)=>{if(!r)return{};const{fromKey:o,toKey:n,opKey:l}=t,s={};switch(r.op){case"is":case"is-before":case"is-after":case"is-on-or-before":case"is-on-or-after":return r.date&&(s[o]=new Date(r.date).toISOString()),l&&(s[l]=r.op),s;case"is-between":return r.from&&(s[o]=new Date(r.from).toISOString()),r.to&&(s[n]=new Date(r.to).toISOString()),s;case"is-relative-to-today":{if(!r.relative)return s;const{from:i,to:c}=_o(r.relative);return s[o]=i.toISOString(),s[n]=c.toISOString(),s}case"is-empty":case"is-not-empty":return l&&(s[l]=r.op==="is-empty"?"empty":"not-empty"),s;default:return s}},rl=({children:r,borderRadius:t,height:o})=>{const n=d.useRef(null),[l,s]=d.useState("100vh");return d.useEffect(()=>{if(o)return;const i=()=>{if(n.current){const c=n.current.getBoundingClientRect().top;s(`calc(100vh - ${c}px)`)}};return i(),window.addEventListener("resize",i),()=>window.removeEventListener("resize",i)},[o]),e.jsx(u.Box,{ref:n,fullWidth:!0,borderStyle:"border-solid",borderWidth:"border",borderColor:"border-base",borderRadius:t||"rounded-xs",style:{height:o??l,display:"flex",flexDirection:"column"},children:r})},tl=({action:r,rightContent:t,leftContent:o,headerSlot:n,advanceFilter:l,showFilter:s=!0})=>{const i=De.useMediaQuery("md"),c=s?e.jsx(Po,{...l}):null,a=()=>r?d.isValidElement(r)?r:e.jsx(u.Box,{style:{display:"flex",flexDirection:i?"row":"column",gap:"8px",width:i?"auto":"100%",textWrap:"nowrap"},children:r.map(({title:h,icon:y,buttonProps:b,onClick:p},C)=>!h&&!y?null:e.jsx(j.Button,{fullWidth:!i,iconLeft:y?e.jsx(T.Icon,{name:y}):void 0,onClick:p,...b,children:h},`action-${C}`))}):null;return e.jsx(u.Box,{style:{display:"flex",width:"100%",justifyContent:"space-between",alignItems:"center",paddingLeft:"8px",paddingRight:"8px",paddingTop:"8px",paddingBottom:"8px",borderBottom:"1px solid var(--sa-border-subtle, #0b120e24)",flexShrink:0,position:"relative",zIndex:10,flexDirection:i?"row":"column-reverse",gap:"16px"},children:n?n({filter:c}):e.jsxs(e.Fragment,{children:[e.jsxs(u.Box,{style:{display:"flex",gap:"8px",flexDirection:"row",alignItems:"center",flex:1,minWidth:0},children:[c,o]}),e.jsxs(u.Box,{style:{display:"flex",gap:"8px",flexDirection:"row",alignItems:"center",flexShrink:0},children:[t,a()]})]})})},Kn=({totalData:r,withMarginBottom:t=!0,withMarginTop:o=!0})=>e.jsxs(u.Box,{style:{display:"flex",gap:"4px",flexDirection:"row",alignItems:"center",marginBottom:t?"16px":void 0,marginTop:o?"16px":void 0},children:[e.jsxs(Ze.Body1,{props:{color:"gray-500"},children:["Total data:"," "]}),e.jsx(Ze.Body1,{children:r||0})]}),ol=({pagination:r,pageKey:t="page",perPageKey:o="perPage",defaultPerPage:n=10,showPagination:l=!0,totalData:s})=>{const{searchQueries:i,setSearchParams:c,searchParams:a}=We(),h=a.get(o),y=E=>{c({...i,[t]:String(E)})},b=E=>{c({...i,[o]:E,[t]:"1"})},p=(r==null?void 0:r.rangeStart)??(((r==null?void 0:r.currentPage)||0)>1?(((r==null?void 0:r.currentPage)||0)-1)*((r==null?void 0:r.perPage)||0)+1:1),C=(r==null?void 0:r.rangeEnd)??((r==null?void 0:r.totalCurrentPage)!==(r==null?void 0:r.perPage)?r==null?void 0:r.totalData:((r==null?void 0:r.currentPage)||1)*((r==null?void 0:r.totalCurrentPage)||0));return e.jsx(u.Box,{style:{display:"flex",width:"100%",flexDirection:"row",justifyContent:"space-between",alignItems:"center",paddingLeft:"16px",paddingRight:"16px",paddingTop:"8px",paddingBottom:"8px",borderTop:"1px solid var(--sa-border-subtle, #0b120e24)",flexShrink:0},children:l?e.jsxs(e.Fragment,{children:[e.jsxs(u.Box,{style:{display:"flex",flexDirection:"row",gap:"8px",alignItems:"center",textWrap:"nowrap"},children:[e.jsx(B.Text,{children:"Rows Per Page: "}),e.jsx(pr.Dropdown,{dropdownLists:[{label:"5",value:"5"},{label:"10",value:"10"},{label:"25",value:"25"},{label:"50",value:"50"},{label:"100",value:"100"}],onChange:E=>{b(E[0].value)},value:h?[{label:`${h} per row`,value:h}]:[{label:`${n} per row`,value:`${n}`}],defaultValue:h?[{label:`${h} per row`,value:h}]:[{label:`${n} per row`,value:`${n}`}]}),e.jsx(B.Text,{children:`${p}-${C} of ${(r==null?void 0:r.totalData)||0}`})]}),e.jsx(Br.Pagination,{currentPage:r!=null&&r.currentPage?Number(r==null?void 0:r.currentPage):1,totalPages:r!=null&&r.totalPage?Number(r==null?void 0:r.totalPage):1,onPageChange:y})]}):e.jsx(Kn,{totalData:s,withMarginBottom:!1,withMarginTop:!1})})},ll=({filter:r,columnTitle:t})=>{const[o,n]=d.useState(!1),l=d.useRef(null),s=d.useRef(null),i=d.useRef(null),[c,a]=d.useState(""),[h,y]=d.useState({top:0,left:0}),b=r.selectedValues,p=d.useMemo(()=>c?r.options.filter(w=>w.label.toLowerCase().includes(c.toLowerCase())):r.options,[r.options,c]);d.useEffect(()=>{if(o&&s.current){const w=s.current.getBoundingClientRect(),L=280,F={top:w.bottom+8};r.position==="left"||w.left+L>window.innerWidth?F.right=window.innerWidth-w.right:F.left=w.left,y(F)}},[o,r.position]),d.useEffect(()=>{o&&i.current?setTimeout(()=>{var w;return(w=i.current)==null?void 0:w.focus()},50):a("")},[o]),d.useEffect(()=>{const w=L=>{l.current&&!l.current.contains(L.target)&&s.current&&!s.current.contains(L.target)&&n(!1)};return o&&document.addEventListener("mousedown",w),()=>document.removeEventListener("mousedown",w)},[o]);const C=w=>{const L=b.includes(w)?b.filter(F=>F!==w):[...b,w];r.onFilterChange(L)},E=()=>r.onFilterChange([]);return e.jsxs(u.Box,{direction:"column",style:{position:"relative"},children:[e.jsx(u.Box,{ref:s,style:{display:"flex",flexDirection:"row",alignItems:"center",cursor:"pointer"},onClick:w=>{var L;w.stopPropagation(),o||(L=r.onOpen)==null||L.call(r),n(F=>!F)},children:e.jsx(T.Icon,{name:o?"ChevronUp":"ChevronDown",size:"sm",style:{color:b.length>0?"var(--sa-color-brand-500, #1a4fa0)":"var(--sa-text-subtle, #8c8f97)"}})}),o&&e.jsxs(u.Box,{ref:l,style:{position:"fixed",top:`${h.top}px`,...h.left!==void 0?{left:`${h.left}px`}:{right:`${h.right}px`},backgroundColor:"white",borderRadius:"4px",minWidth:"280px",maxHeight:"400px",display:"flex",flexDirection:"column",zIndex:9999,animation:"fadeInDropdown 0.15s ease-out",border:"1px solid var(--sa-border-subtle, #0b120e24)"},children:[e.jsxs(u.Box,{style:{display:"flex",flexDirection:"row",justifyContent:"space-between",alignItems:"center",paddingTop:"12px",paddingBottom:"12px",paddingLeft:"16px",paddingRight:"16px",borderBottom:"1px solid var(--sa-border-subtle, #0b120e24)"},children:[e.jsxs(B.Text,{fontSize:"sm",fontWeight:"semibold",color:"gray-700",children:["Filter ",t]}),b.length>0&&e.jsx(u.Box,{direction:"column",style:{cursor:"pointer"},children:e.jsx(B.Text,{fontSize:"xs",color:"primary",fontWeight:"semibold",onClick:w=>{w.stopPropagation(),E()},children:"CLEAR"})})]}),!r.hideSearch&&e.jsx(u.Box,{direction:"column",style:{paddingLeft:"16px",paddingRight:"16px",paddingTop:"8px",paddingBottom:"8px"},children:e.jsx(ar.Input,{ref:i,placeholder:`Search ${t.toLowerCase()}...`,leftIcon:e.jsx(T.Icon,{name:"Search",size:"sm"}),value:c,onChange:w=>a(w.target.value),style:{fontSize:"14px"}})}),e.jsx(u.Box,{direction:"column",className:"ts-filter-dropdown-options",style:{overflowY:"auto",maxHeight:"250px",paddingLeft:"8px",paddingRight:"8px"},children:r.isLoadingOptions?e.jsxs(u.Box,{style:{paddingTop:"40px",paddingBottom:"40px",display:"flex",alignItems:"center",justifyContent:"center",flexDirection:"column"},children:[e.jsx(T.Icon,{name:"Loading",size:"lg",style:{color:"var(--sa-background-brand, #04254f)",animation:"spin 1s linear infinite"}}),e.jsx(B.Text,{fontSize:"sm",color:"gray-500",style:{textAlign:"center",marginTop:"8px"},children:"Loading options..."})]}):p.length>0?e.jsx(u.Box,{direction:"column",style:{gap:"2px",paddingTop:"4px",paddingBottom:"4px"},children:p.map(w=>e.jsxs(u.Box,{style:{display:"flex",flexDirection:"row",alignItems:"center",gap:"8px",paddingTop:"8px",paddingBottom:"8px",paddingLeft:"8px",paddingRight:"8px",cursor:"pointer",borderRadius:"8px",transition:"all 0.2s ease",backgroundColor:b.includes(w.value)?"var(--sa-color-brand-50, #e6edf6)":"transparent"},onClick:L=>{L.stopPropagation(),C(w.value)},onMouseEnter:L=>{b.includes(w.value)||(L.currentTarget.style.backgroundColor="var(--sa-background-primary, #ffffff)"),L.currentTarget.style.transform="translateX(2px)"},onMouseLeave:L=>{L.currentTarget.style.backgroundColor=b.includes(w.value)?"var(--sa-color-brand-50, #e6edf6)":"transparent",L.currentTarget.style.transform="translateX(0)"},children:[e.jsx(er.Checkbox,{checked:b.includes(w.value),onChange:()=>{}}),e.jsx(B.Text,{fontSize:"sm",fontWeight:b.includes(w.value)?"medium":"normal",color:b.includes(w.value)?"primary":"gray-700",children:w.label})]},w.value))}):e.jsxs(u.Box,{style:{paddingTop:"40px",paddingBottom:"40px",display:"flex",alignItems:"center",justifyContent:"center",flexDirection:"column"},children:[e.jsx(T.Icon,{name:"Search",size:"lg",style:{color:"var(--sa-text-subtle, #8c8f97)"}}),e.jsx(B.Text,{fontSize:"sm",color:"gray-500",style:{textAlign:"center",marginTop:"8px"},children:"No results found"})]})}),b.length>0&&e.jsx(u.Box,{direction:"column",style:{paddingTop:"8px",paddingBottom:"8px",paddingLeft:"16px",paddingRight:"16px",borderTop:"1px solid var(--sa-border-subtle, #0b120e24)",backgroundColor:"var(--sa-color-brand-50, #e6edf6)",marginTop:"auto"},children:e.jsxs(u.Box,{style:{display:"flex",flexDirection:"row",alignItems:"center",gap:"4px"},children:[e.jsx(u.Box,{direction:"column",style:{backgroundColor:"var(--sa-background-brand, #04254f)",borderRadius:"12px",padding:"2px 8px",fontSize:"11px",fontWeight:600,color:"white"},children:b.length}),e.jsxs(B.Text,{fontSize:"xs",color:"primary",fontWeight:"medium",children:["item",b.length>1?"s":""," selected"]})]})})]})]})},Rn=({direction:r})=>{const t="var(--sa-text-primary, #292a2e)",o="var(--sa-text-subtle, #8c8f97)",n=r==="asc"?t:o,l=r==="desc"?t:o,s=r==="asc"?1:.45,i=r==="desc"?1:.45;return e.jsxs("span",{style:{display:"inline-flex",flexDirection:"column",alignItems:"center",justifyContent:"center",flexShrink:0,lineHeight:0},"aria-hidden":!0,children:[e.jsx("svg",{width:"8",height:"5",viewBox:"0 0 8 5",style:{color:n,opacity:s,marginBottom:1},children:e.jsx("path",{d:"M4 0 L8 5 L0 5 Z",fill:"currentColor"})}),e.jsx("svg",{width:"8",height:"5",viewBox:"0 0 8 5",style:{color:l,opacity:i},children:e.jsx("path",{d:"M0 0 L8 0 L4 5 Z",fill:"currentColor"})})]})},es=({frozen:r})=>e.jsxs("svg",{width:"11",height:"11",viewBox:"0 0 24 24",fill:r?"currentColor":"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("rect",{x:"3",y:"11",width:"18",height:"11",rx:"2",ry:"2"}),e.jsx("path",{d:r?"M7 11V7a5 5 0 0 1 10 0v4":"M7 11V7a5 5 0 0 1 9.9-1"})]}),Ft="var(--sa-background-primary, #ffffff)",nl="var(--sa-background-primary-inverse, #f8f8f8)",sl=({columns:r,records:t,handleDetail:o,handleUpdate:n,handleDelete:l,isLoading:s,visibleHandleDelete:i,visibleHandleUpdate:c,visibleHandleDetail:a,showHeadBorder:h=!1,scrollParentRef:y,frozenCount:b=0,onFrozenCountChange:p,customActions:C,actionsOrder:E=["detail","update","delete","custom"],customEmptyState:w,enableColumnResize:L=!1,defaultColumnWidths:F,onColumnWidthsChange:I,defaultMinColumnWidth:S=60,sort:D,defaultSort:H,onSortChange:A,showActionDivider:k=!1})=>{const z=D!==void 0,[W,X]=d.useState(H??null),K=z?D??null:W,Q=V=>{if(V.sortKey)return V.sortKey;if(typeof V.accessor=="string")return V.accessor},_=V=>{const ee=Q(V);if(!ee)return;let U;!K||K.key!==ee?U={key:ee,direction:"asc"}:K.direction==="asc"?U={key:ee,direction:"desc"}:U=null,z||X(U),A==null||A(U)},re=[o,n,l].filter(V=>V!==void 0).length,q=!!C,P=!!o||!!n||!!l||q,N="var(--sa-border-subtle, #0b120e24)",ce=`1px solid ${N}`,xe=`inset 1px 0 0 ${N}`,Ae=`inset -1px 0 0 ${N}`,ue=re===3?q?"178px":"140px":re===2?q?"140px":"102px":re===1?q?"112px":"74px":q?"74px":"",Se=(V,ee)=>{if(!ee)return V;if(typeof ee=="function")return ee(V);if(typeof ee=="string")return V[ee]},[Be,ze]=d.useState(!1);d.useEffect(()=>{if(!(y!=null&&y.current))return;const V=y.current;ze(V.scrollHeight>V.clientHeight)},[t,y]);const He=d.useRef(null),[Le,je]=d.useState([]),[we,Pe]=d.useState(()=>F??{}),Ge=d.useRef(null);d.useLayoutEffect(()=>{if(!b||!He.current){je([]);return}const V=Array.from(He.current.querySelectorAll("thead tr th")),ee=[];let U=0;V.forEach((de,ne)=>{ee[ne]=U,ne<b&&(U+=de.offsetWidth)}),je(ee)},[b,r,t,we]);const Xe=V=>{p&&p(V<b?V:V+1)},ke=(V,ee)=>{const U=we[V];if(U!==void 0){const de=`${U}px`;return{width:de,minWidth:de,maxWidth:de}}return ee?{width:ee}:{}},tr=V=>L&&(V.resizable??!0),Dr=(V,ee)=>{V.preventDefault(),V.stopPropagation();const U=V.currentTarget.closest("th");if(!U)return;const de=Math.round(U.getBoundingClientRect().width);Ge.current={colIndex:ee,startX:V.clientX,startWidth:de};const ne=document.body.style.userSelect,pe=document.body.style.cursor;document.body.style.userSelect="none",document.body.style.cursor="col-resize";const $e=Ne=>{var or;const Ee=Ge.current;if(!Ee)return;const Ue=((or=r[Ee.colIndex])==null?void 0:or.minWidth)??S,he=Math.max(Ue,Ee.startWidth+(Ne.clientX-Ee.startX));Pe(lr=>lr[Ee.colIndex]===he?lr:{...lr,[Ee.colIndex]:he})},Qe=()=>{document.removeEventListener("mousemove",$e),document.removeEventListener("mouseup",Qe),document.body.style.userSelect=ne,document.body.style.cursor=pe,Ge.current=null,I&&Pe(Ne=>(I(Ne),Ne))};document.addEventListener("mousemove",$e),document.addEventListener("mouseup",Qe)};return e.jsx("div",{ref:He,children:e.jsxs(G.Table,{fullWidth:!0,children:[e.jsx(G.Thead,{style:{height:"40px",whiteSpace:"nowrap"},children:e.jsxs(G.Tr,{children:[r.map((V,ee)=>{var sr,ur;const U=b>0&&ee<b,de=Le[ee]??0,ne=tr(V),$e=ee===r.length-1&&P&&k,Qe=Q(V),Ne=!!V.sortable&&!!Qe,Ee=Ne&&(K==null?void 0:K.key)===Qe?K.direction:null,Ue=V.title||((sr=V.accessor)==null?void 0:sr.toString())||"",he=(ur=V.headerTooltip)!=null&&ur.showIcon?e.jsx(T.Icon,{name:"InfoCircle",size:"xs",style:{flexShrink:0,color:"var(--sa-icon-subtle, #8c8f97)",opacity:.75}}):null,or=e.jsx("span",{style:{flex:1,minWidth:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:Ue}),lr=Ne?e.jsxs("button",{type:"button",onClick:()=>_(V),title:Ee==="asc"?"Sorted ascending — click to sort descending":Ee==="desc"?"Sorted descending — click to clear":"Click to sort ascending",style:{flex:1,minWidth:0,display:"flex",alignItems:"center",gap:4,background:"none",border:"none",padding:0,margin:0,font:"inherit",color:"inherit",cursor:"pointer",textAlign:V.textAlign==="text-right"?"right":V.textAlign==="text-center"?"center":"left"},children:[or,he,e.jsx(Rn,{direction:Ee})]}):e.jsxs("span",{style:{flex:1,minWidth:0,display:"flex",alignItems:"center",gap:4},children:[or,he]});return e.jsxs(G.Th,{style:{position:"sticky",top:0,left:U?de:void 0,zIndex:U?4:2,paddingLeft:ee===0?"12px":"",borderRight:h&&!$e&&!U?ce:void 0,borderBottom:h?ce:void 0,boxShadow:h&&U?Ae:void 0,backgroundColor:"var(--sa-background-primary-inverse, #f8f8f8)",textAlign:V.textAlign==="text-right"?"right":V.textAlign==="text-center"?"center":"left",...ke(ee,V.width)},children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"4px",justifyContent:"space-between",minWidth:0},children:[V.headerTooltip?e.jsx(me.Tooltip,{label:V.headerTooltip.content,position:"bottom",children:lr}):lr,V.filter&&e.jsx(ll,{filter:V.filter,columnTitle:V.title}),p&&e.jsx("button",{onClick:()=>Xe(ee),title:U?"Unfreeze column":"Freeze column",style:{background:"none",border:"none",cursor:"pointer",padding:"2px",display:"flex",alignItems:"center",flexShrink:0,color:U?"var(--sa-background-brand, #04254f)":"var(--sa-text-subtle, #8c8f97)",opacity:U?1:.45,transition:"opacity 0.15s"},children:e.jsx(es,{frozen:U})})]}),ne&&e.jsx("div",{onMouseDown:dr=>Dr(dr,ee),onClick:dr=>dr.stopPropagation(),role:"separator","aria-orientation":"vertical",title:"Drag to resize",style:{position:"absolute",top:0,right:-3,width:6,height:"100%",cursor:"col-resize",userSelect:"none",zIndex:5,touchAction:"none"}})]},`table-head-${ee}`)}),P?e.jsx(G.Th,{style:{backgroundColor:"var(--sa-background-primary-inverse, #f8f8f8)",position:"sticky",top:0,right:0,zIndex:3,borderBottom:h?ce:void 0,boxShadow:h&&k?xe:void 0}}):null]})}),e.jsx(G.Tbody,{children:s?e.jsx(G.Tr,{children:e.jsx(G.Td,{colSpan:r.length+1,children:e.jsxs(u.Box,{direction:"column",style:{gap:"16px"},children:[e.jsx(qe.Skeleton,{variant:"list"}),e.jsx(qe.Skeleton,{variant:"list"}),e.jsx(qe.Skeleton,{variant:"list"}),e.jsx(qe.Skeleton,{variant:"list"}),e.jsx(qe.Skeleton,{variant:"list"})]})})}):!(t!=null&&t.length)&&w?e.jsx(G.Tr,{children:e.jsx(G.Td,{colSpan:r.length+1,children:w})}):t==null?void 0:t.map((V,ee)=>e.jsxs(G.Tr,{style:{transition:"background-color 0.3s ease",padding:0,borderBottom:ee===t.length-1&&Be?void 0:"1px solid var(--sa-border-subtle, #0b120e24)"},onMouseEnter:U=>{const de=U.currentTarget;de.style.backgroundColor=nl,Array.from(de.querySelectorAll("td")).forEach(ne=>{ne.style.position==="sticky"&&(ne.style.backgroundColor=nl)})},onMouseLeave:U=>{const de=U.currentTarget;de.style.backgroundColor="",Array.from(de.querySelectorAll("td")).forEach(ne=>{ne.style.position==="sticky"&&(ne.style.backgroundColor=Ft)})},children:[r.map((U,de)=>{const ne=U.render?U.render(V,ee,t):Se(V,U.accessor),pe=b>0&&de<b,$e=Le[de]??0,Qe=we[de]!==void 0,Ne=pe&&de===b-1;return e.jsx(G.Td,{style:{position:pe?"sticky":void 0,left:pe?$e:void 0,zIndex:pe?1:void 0,backgroundColor:pe?Ft:void 0,transition:pe?"background-color 0.3s ease":void 0,paddingLeft:de===0?"12px":"",whiteSpace:"nowrap",overflow:Qe?"hidden":void 0,borderLeft:U.showBorderLeft?ce:void 0,borderRight:U.showBorderRight?ce:void 0,boxShadow:Ne?Ae:void 0,textAlign:U.textAlign==="text-right"?"right":U.textAlign==="text-center"?"center":"left",...ke(de,U.width)},children:typeof ne=="string"?e.jsx(B.Text,{style:{whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",textAlign:U.textAlign==="text-right"?"right":U.textAlign==="text-center"?"center":"left"},children:ne}):ne},`row-${ee}-col-${de}`)}),P?e.jsx(G.Td,{style:{width:ue,position:"sticky",right:0,zIndex:1,backgroundColor:Ft,boxShadow:k?xe:void 0,transition:"background-color 0.3s ease"},children:e.jsx(se.Flex,{direction:"row",align:"center",justify:"center",gap:"sm",children:E.map(U=>{const de=ee===t.length-1?"top":"bottom";return U==="detail"&&o&&(a==null?void 0:a(V))!==!1?e.jsx(me.Tooltip,{label:"Detail",position:de,children:e.jsx(j.Button,{size:"xs",variant:"outline",tone:"neutral",onClick:()=>o(V.id,V),iconLeft:e.jsx(T.Icon,{name:"DocumentClean",size:"sm",style:{color:"var(--sa-text-subtle, #8c8f97)"}})})},"detail"):U==="update"&&n&&(c==null?void 0:c(V))!==!1?e.jsx(me.Tooltip,{label:"Update",position:de,children:e.jsx(j.Button,{size:"xs",variant:"outline",tone:"neutral",onClick:()=>n(V),iconLeft:e.jsx(T.Icon,{name:"Edit1",size:"sm",style:{color:"var(--sa-text-subtle, #8c8f97)"}})})},"update"):U==="delete"&&l&&(i==null?void 0:i(V))!==!1?e.jsx(me.Tooltip,{label:"Delete",position:de,children:e.jsx(j.Button,{size:"xs",variant:"outline",tone:"neutral",onClick:()=>l(V.id,V),iconLeft:e.jsx(T.Icon,{name:"Trash1",size:"sm",style:{color:"var(--sa-color-error-600, #c9184a)"}})})},"delete"):U==="custom"?e.jsx(d.Fragment,{children:C==null?void 0:C(V)},"custom"):null})})}):null]},`${V}${ee}`))})]})})},rs=({wrapperProps:r,dataTableProps:t,headerProps:o,footerProps:n})=>{var b;const l=d.useRef(null),[s,i]=d.useState((t==null?void 0:t.defaultFrozenCount)??0),c=(o==null?void 0:o.show)??!0,a=d.useRef(null),h=(b=t==null?void 0:t.pagination)==null?void 0:b.totalData;typeof h=="number"&&(a.current=h);const y=(n==null?void 0:n.showFooter)??(h===void 0?a.current!==0:h!==0);return e.jsxs(rl,{...r,children:[c&&e.jsx(tl,{...o}),e.jsx(u.Box,{direction:"column",ref:l,style:{flex:1,overflowY:"auto",overflowX:"auto"},children:t?e.jsx(sl,{...t,scrollParentRef:l,frozenCount:t!=null&&t.enableFreezeColumns?s:0,onFrozenCountChange:t!=null&&t.enableFreezeColumns?i:void 0}):null}),y&&e.jsx(ol,{pagination:t==null?void 0:t.pagination,pageKey:t==null?void 0:t.pageKey,perPageKey:t==null?void 0:t.perPageKey,defaultPerPage:t==null?void 0:t.defaultPerPage,showPagination:t==null?void 0:t.showPagination,totalData:n==null?void 0:n.totalData})]})};function ts(r){return d.memo(r)}const os=ts(rs),il=200,Mt="1px solid var(--sa-border-subtle, #0b120e24)",ls=({sortDir:r,frozen:t})=>r==="asc"?e.jsx(T.Icon,{name:"ChevronSmallUp"}):r==="desc"?e.jsx(T.Icon,{name:"ChevronSmallDown"}):t?e.jsx(T.Icon,{name:"LockOn",size:"xs"}):e.jsx(T.Icon,{name:"Filter",size:"xs"}),Qr=({icon:r,label:t,active:o,danger:n,onClick:l})=>{const s=n?"var(--sa-text-error, #a4133c)":"var(--sa-text-primary, #292a2e)";return e.jsxs("button",{type:"button",onClick:l,style:{display:"flex",alignItems:"center",gap:12,width:"100%",padding:"8px 12px",background:o?"var(--sa-background-brand-subtlest, #e6edf6)":"none",border:"none",cursor:"pointer",font:"inherit",color:s,textAlign:"left"},onMouseEnter:i=>{o||(i.currentTarget.style.background="var(--sa-background-primary-inverse, #f8f8f8)")},onMouseLeave:i=>{i.currentTarget.style.background=o?"var(--sa-background-brand-subtlest, #e6edf6)":"none"},children:[e.jsx(T.Icon,{name:r,size:"sm",style:{color:s,flexShrink:0}}),e.jsx(B.Text,{as:"span",style:{color:s},children:t})]})},cl=({active:r,canSort:t,canHide:o,sortDir:n,frozen:l,onSort:s,onClearSort:i,onToggleFreeze:c,onHide:a})=>{const[h,y]=d.useState(!1),b=d.useRef(null),p=d.useRef(null),[C,E]=d.useState({top:0,left:0});d.useEffect(()=>{if(h&&b.current){const L=b.current.getBoundingClientRect(),F=L.left+il>window.innerWidth;E({top:L.bottom+6,...F?{right:window.innerWidth-L.right}:{left:L.left}})}},[h]),d.useEffect(()=>{if(!h)return;const L=F=>{p.current&&!p.current.contains(F.target)&&b.current&&!b.current.contains(F.target)&&y(!1)};return document.addEventListener("mousedown",L),()=>document.removeEventListener("mousedown",L)},[h]);const w=L=>{L(),y(!1)};return e.jsxs(e.Fragment,{children:[e.jsx("button",{ref:b,type:"button",className:"sa-tl-menu-trigger","data-active":r||h?"true":"false",onClick:L=>{L.stopPropagation(),y(F=>!F)},title:"Column options",style:{display:"inline-flex",alignItems:"center",justifyContent:"center",width:22,height:22,borderRadius:"var(--sa-radii-sm, 6px)",border:Mt,background:"var(--sa-background-primary, #ffffff)",cursor:"pointer",color:"var(--sa-text-subtle, #8c8f97)",flexShrink:0},children:e.jsx(ls,{sortDir:n,frozen:l})}),h&&e.jsxs(u.Box,{ref:p,onClick:L=>L.stopPropagation(),style:{position:"fixed",top:`${C.top}px`,...C.left!==void 0?{left:`${C.left}px`}:{right:`${C.right}px`},minWidth:il,backgroundColor:"var(--sa-background-primary, #ffffff)",border:Mt,borderRadius:"var(--sa-radii-sm, 6px)",boxShadow:"var(--sa-shadow-xl, 0 20px 25px -5px #0000001a, 0 8px 10px -6px #0000001a)",zIndex:9999,padding:"4px",display:"flex",flexDirection:"column"},children:[t&&e.jsxs(e.Fragment,{children:[e.jsx(Qr,{icon:"ChevronUp",label:"Ascending",active:n==="asc",onClick:()=>w(()=>n==="asc"?i():s("asc"))}),e.jsx(Qr,{icon:"ChevronDown",label:"Descending",active:n==="desc",onClick:()=>w(()=>n==="desc"?i():s("desc"))}),e.jsx("div",{style:{borderTop:Mt,margin:"4px 0"}})]}),e.jsx(Qr,{icon:"Pin1",label:l?"Unfreeze":"Freeze",active:l,onClick:()=>w(c)}),o&&e.jsx(Qr,{icon:"EyeClosed",label:"Hide column",danger:!0,onClick:()=>w(a)})]})]})},Mr="1px solid var(--sa-border-subtle, #0b120e24)",ns="var(--sa-text-subtle, #8c8f97)",wr="var(--sa-background-neutral, #f0f1f2)",al="2px 0 4px -2px var(--sa-border-subtle, #0b120e24)",Tr=40,Tt="var(--sa-background-brand-subtlest)",Ur={display:"block",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},dl="sa-table-layout-styles",ss=()=>{if(typeof document>"u"||document.getElementById(dl))return;const r=document.createElement("style");r.id=dl,r.textContent=`
|
|
1
|
+
(function(u,yr){typeof exports=="object"&&typeof module<"u"?yr(exports,require("@starasia/alert"),require("@starasia/avatar"),require("@starasia/badges"),require("@starasia/box"),require("@starasia/breadcrumb"),require("@starasia/button"),require("@starasia/card"),require("@starasia/date"),require("@starasia/dialog"),require("@starasia/drawer"),require("@starasia/dropdown"),require("@starasia/hooks"),require("@starasia/http"),require("@starasia/input"),require("@starasia/menu"),require("@starasia/pagination"),require("@starasia/storage"),require("@starasia/table"),require("@starasia/tabs"),require("@starasia/textarea"),require("@starasia/theme"),require("@starasia/toast"),require("@starasia/toggle"),require("@starasia/tooltip"),require("@starasia/checkbox"),require("@starasia/radio"),require("@starasia/text"),require("@starasia/icon"),require("@starasia/flex"),require("@starasia/grid"),require("@starasia/progress"),require("@starasia/stepper"),require("@starasia/accordion"),require("@starasia/story-record"),require("@starasia/skeleton"),require("@starasia/progress-stepper"),require("react/jsx-runtime"),require("react"),require("react-dom"),require("react-easy-crop")):typeof define=="function"&&define.amd?define(["exports","@starasia/alert","@starasia/avatar","@starasia/badges","@starasia/box","@starasia/breadcrumb","@starasia/button","@starasia/card","@starasia/date","@starasia/dialog","@starasia/drawer","@starasia/dropdown","@starasia/hooks","@starasia/http","@starasia/input","@starasia/menu","@starasia/pagination","@starasia/storage","@starasia/table","@starasia/tabs","@starasia/textarea","@starasia/theme","@starasia/toast","@starasia/toggle","@starasia/tooltip","@starasia/checkbox","@starasia/radio","@starasia/text","@starasia/icon","@starasia/flex","@starasia/grid","@starasia/progress","@starasia/stepper","@starasia/accordion","@starasia/story-record","@starasia/skeleton","@starasia/progress-stepper","react/jsx-runtime","react","react-dom","react-easy-crop"],yr):(u=typeof globalThis<"u"?globalThis:u||self,yr(u["@starasia/admin"]={},u.alert,u.avatar,u.badges,u.box,u.breadcrumb,u.button,u.card,u.date,u.dialog,u.drawer,u.dropdown,u.hooks,u.http,u.input,u.menu,u.pagination,u.storage,u.table,u.tabs,u.textarea,u.theme,u.toast,u.toggle,u.tooltip,u.checkbox,u.radio,u.text,u.icon,u.flex,u.grid,u.progress,u.stepper,u.accordion,u.storyRecord,u.skeleton,u.progressStepper,u.jsxRuntime,u.React,u.ReactDOM,u.ReactEasyCrop))})(this,function(u,yr,zr,sr,f,pr,j,ct,fr,je,Hr,br,De,vr,ar,A,kr,Er,U,$t,it,Cr,Kt,xr,me,tr,at,D,M,ie,Rt,eo,ro,to,oo,$e,lo,e,d,Pr,Nl){"use strict";const _l={menus:[],menuBottom:void 0,logo:"",appName:"Workspace",userData:null,setUserData:()=>{}},dt=d.createContext(_l),ht=()=>d.useContext(dt),no=r=>{const[t,o]=d.useState((r==null?void 0:r.initialUserData)||null);return{userData:t,setUserData:o}},so=d.createContext({badges:{},setBadge:()=>{},setBadges:()=>{},clearBadge:()=>{}}),co=({children:r})=>{const[t,o]=d.useState({}),n=d.useCallback(i=>{o(a=>typeof i=="function"?i(a):i)},[]),l=d.useCallback((i,a)=>{o(h=>{const y=typeof a=="function"?a(h[i]):a;return{...h,[i]:y}})},[]),s=d.useCallback(i=>{o(a=>{if(!(i in a))return a;const h={...a};return delete h[i],h})},[]),c=d.useMemo(()=>({badges:t,setBadge:l,setBadges:n,clearBadge:s}),[t,l,n,s]);return e.jsx(so.Provider,{value:c,children:r})},io=()=>d.useContext(so),Vr=(r,t)=>{const o=t!==void 0?t:r;return o==null?null:typeof o=="string"||typeof o=="number"?{value:o}:o},ft=240,ut=200,gt=480,ql="sa-sidebar-width",yt=(r,t,o)=>Math.min(Math.max(r,t),o),Zl=(r,t,o,n)=>{if(typeof window>"u")return t;try{const l=window.localStorage.getItem(r);if(!l)return t;const s=parseInt(l,10);return Number.isFinite(s)?yt(s,o,n):t}catch{return t}},ao=(r,t)=>{if(!(typeof window>"u"))try{window.localStorage.setItem(r,String(t))}catch{}},ho=d.createContext({collapsed:!1,setCollapsed:()=>{},toggle:()=>{},collapse:()=>{},expand:()=>{},width:ft,setWidth:()=>{},resetWidth:()=>{},minWidth:ut,maxWidth:gt,mobileOpen:!1,setMobileOpen:()=>{},openMobile:()=>{},closeMobile:()=>{},toggleMobile:()=>{}}),fo=({children:r,defaultCollapsed:t=!1,defaultWidth:o=ft,minWidth:n=ut,maxWidth:l=gt,widthStorageKey:s=ql})=>{const[c,i]=d.useState(t),[a,h]=d.useState(!1),[y,b]=d.useState(()=>Zl(s,o,n,l)),p=d.useCallback(S=>{i(z=>typeof S=="function"?S(z):S)},[]),C=d.useCallback(()=>i(S=>!S),[]),E=d.useCallback(()=>i(!0),[]),w=d.useCallback(()=>i(!1),[]),L=d.useCallback(S=>{b(z=>{const O=typeof S=="function"?S(z):S,Y=yt(Math.round(O),n,l);return ao(s,Y),Y})},[n,l,s]),F=d.useCallback(()=>{const S=yt(o,n,l);ao(s,S),b(S)},[o,n,l,s]),I=d.useCallback(S=>{h(z=>typeof S=="function"?S(z):S)},[]),B=d.useCallback(()=>h(!0),[]),k=d.useCallback(()=>h(!1),[]),H=d.useCallback(()=>h(S=>!S),[]),W=d.useMemo(()=>({collapsed:c,setCollapsed:p,toggle:C,collapse:E,expand:w,width:y,setWidth:L,resetWidth:F,minWidth:n,maxWidth:l,mobileOpen:a,setMobileOpen:I,openMobile:B,closeMobile:k,toggleMobile:H}),[c,p,C,E,w,y,L,F,n,l,a,I,B,k,H]);return e.jsx(ho.Provider,{value:W,children:r})},uo=()=>d.useContext(ho),go=d.createContext(null),yo=({adapter:r,children:t})=>e.jsx(go.Provider,{value:r,children:t}),or=()=>{const r=d.useContext(go);if(!r)throw new Error("[@starasia/admin] Router adapter belum dipasang. Bungkus aplikasi dengan <App routerAdapter={...} /> atau <StarasiaRouterProvider adapter={...}>. Import adapter dari '@starasia/admin/adapters/react-router' atau '@starasia/admin/adapters/tanstack'.");return r},po=({router:r,routerAdapter:t,menus:o=[],menuBottom:n,logo:l,appName:s="Workspace",initialUserData:c,theme:i})=>{const a=no({initialUserData:c}),{theme:h}=Cr.useTheme();return e.jsx(yo,{adapter:t,children:e.jsx(dt.Provider,{value:{logo:l,appName:s,menus:o,userData:a.userData,setUserData:a.setUserData,menuBottom:n},children:e.jsx(co,{children:e.jsx(fo,{children:i?e.jsx(Cr.ThemeProvider,{value:i,children:r}):h?e.jsx(Cr.ThemeProvider,{value:h,children:r}):r})})})})},Gl=d.memo(po);function bo({collapsed:r=!1,children:t}){if(!t)return null;const o=typeof t=="function",n=o?t({collapsed:r}):t;return n==null||n===!1?null:e.jsx("div",{style:{position:"sticky",top:"var(--app-header-height, 4rem)",zIndex:1,borderBottom:"1px solid var(--sa-border-subtle, #0b120e24)",paddingLeft:r?"calc((var(--app-header-height, 4rem) - 2rem) / 2)":"0.5rem",paddingRight:r?"calc((var(--app-header-height, 4rem) - 2rem) / 2)":"0.5rem",paddingTop:"0.5rem",paddingBottom:"0.5rem",boxSizing:"border-box"},children:o?n:e.jsx("div",{style:{opacity:r?0:1,transition:"opacity 0.3s",visibility:r?"hidden":"visible"},children:n})})}const pt=d.createContext(null);function vo({children:r}){const[t,o]=d.useState(null),[n,l]=d.useState(null),[s,c]=d.useState(null),[i,a]=d.useState(0),h=d.useCallback(()=>(a(y=>y+1),()=>a(y=>y-1)),[]);return e.jsx(pt.Provider,{value:{prependNode:t,appendNode:n,replaceNode:s,setPrependNode:o,setAppendNode:l,setReplaceNode:c,replaceCount:i,registerReplace:h},children:r})}function Co({children:r}){const t=d.useContext(pt);return t?e.jsxs(e.Fragment,{children:[e.jsx("div",{ref:t.setPrependNode,style:{display:"contents"}}),t.replaceCount>0?e.jsx("div",{ref:t.setReplaceNode,style:{display:"contents"}}):r,e.jsx("div",{ref:t.setAppendNode,style:{display:"contents"}})]}):e.jsx(e.Fragment,{children:r})}function Ql({children:r,mode:t="append"}){const o=d.useContext(pt);if(d.useEffect(()=>{if(!(t!=="replace"||!o))return o.registerReplace()},[t,o]),!o)return process.env.NODE_ENV!=="production"&&console.warn("[HeaderLeftSlot] used outside AppLayout — content not rendered"),null;const n=t==="prepend"?o.prependNode:t==="replace"?o.replaceNode:o.appendNode;return n?Pr.createPortal(r,n):null}const bt=d.createContext(null);function xo({children:r}){const[t,o]=d.useState({}),[n,l]=d.useState({}),s=d.useCallback((a,h)=>{o(y=>y[a]===h?y:{...y,[a]:h})},[]),c=d.useCallback(a=>(l(h=>({...h,[a]:(h[a]??0)+1})),()=>l(h=>({...h,[a]:Math.max(0,(h[a]??0)-1)}))),[]),i=d.useMemo(()=>({outletNodes:t,setOutletNode:s,slotCounts:n,registerSlot:c}),[t,s,n,c]);return e.jsx(bt.Provider,{value:i,children:r})}function wo({slotKey:r,fallback:t}){const o=d.useContext(bt),n=o?(o.slotCounts[r]??0)>0:!1,l=d.useRef(o==null?void 0:o.setOutletNode);l.current=o==null?void 0:o.setOutletNode;const s=d.useCallback(c=>{var i;return(i=l.current)==null?void 0:i.call(l,r,c)},[r]);return e.jsx(e.Fragment,{children:n?e.jsx("div",{ref:s,style:{display:"contents"}}):t})}function Ul({slotKey:r,children:t}){const o=d.useContext(bt),n=d.useRef(o==null?void 0:o.registerSlot);if(n.current=o==null?void 0:o.registerSlot,d.useEffect(()=>{var s;return(s=n.current)==null?void 0:s.call(n,r)},[r]),!o)return process.env.NODE_ENV!=="production"&&console.warn("[SidebarGroupSlot] used outside AppLayout — content not rendered"),null;const l=o.outletNodes[r];return l?Pr.createPortal(t,l):null}const jr="moduleSwitcherGroupId",vt="sa-module-switcher-change";function Do(){if(typeof window>"u")return null;const r=window.localStorage.getItem(jr);if(r===null)return null;const t=Number(r);return Number.isFinite(t)?t:null}function So(r){typeof window>"u"||(r===null?window.localStorage.removeItem(jr):window.localStorage.setItem(jr,String(r)),window.dispatchEvent(new CustomEvent(vt,{detail:r})))}function Jl(){So(null)}function Ct(){const[r,t]=d.useState(()=>Do());return d.useEffect(()=>{const n=()=>{t(Do())},l=s=>{s.key===jr&&n()};return window.addEventListener(vt,n),window.addEventListener("storage",l),()=>{window.removeEventListener(vt,n),window.removeEventListener("storage",l)}},[]),{selectedGroupId:r,setSelectedGroupId:n=>{So(n),t(n)}}}let Nr=0,ur=!1,Bo=new Set;function Yl(r){const[t,o]=d.useState(!1),n=d.useRef(null),l=d.useRef(null);return d.useLayoutEffect(()=>{const s=n.current;if(!s)return;let c=0;const i=()=>{c=0;const h=l.current;if(!h)return;const y=h.scrollWidth>s.clientWidth;o(b=>b===y?b:y)},a=new ResizeObserver(()=>{c||(c=requestAnimationFrame(i))});return a.observe(s),i(),()=>{c&&cancelAnimationFrame(c),a.disconnect()}},[r]),{containerRef:n,textRef:l,truncated:t}}function ko({text:r,textStyle:t}){const{containerRef:o,textRef:n,truncated:l}=Yl(r),s=e.jsx(D.Text,{ref:n,as:"span",fontSize:"md",fontWeight:"semibold",truncate:!0,style:{display:"block",...t},children:r});return e.jsx(f.Box,{ref:o,display:"block",style:{flex:1,minWidth:0},children:l?e.jsx(me.Tooltip,{fluid:!0,label:r,position:"top",children:s}):s})}const Xl=200,xt="var(--app-header-height, 4rem)",Eo="44px",wt=`calc((${xt} - 2rem) / 2)`,mo=16;function $l({children:r,headerLeftSlot:t,profile:o,isLoadingProfile:n,onLogout:l,isLoggingOut:s,loadingComponent:c,sidebarHeaderContent:i,headerActions:a,profileRole:h,profileMenuButtons:y,profileMenuItems:b,logoutButton:p,resizableSidebar:C=!0}){var hr,Sr;const{useSearchParams:E,useNavigate:w,useLocation:L,Outlet:F}=or(),[I]=E(),B=I.get("embed")==="true",k=ht(),{badges:H}=io(),W=w(),S=L(),O=!De.useMediaQuery("md"),[Y,X]=d.useState(!1),{collapsed:q,setCollapsed:Z,width:K,setWidth:te,resetWidth:_,minWidth:V,maxWidth:N,mobileOpen:se,setMobileOpen:ve}=uo(),[Ee,ue]=d.useState(!1),[Ce,xe]=d.useState(()=>new Set(Bo)),[we,Ae]=d.useState(null),{selectedGroupId:Fe,setSelectedGroupId:_e}=Ct(),$=q&&!O;d.useEffect(()=>{Bo=Ce},[Ce]);const ge=d.useRef(null),We=d.useRef(null),Ze=d.useRef(null),[de,Ge]=d.useState(!1),[lr,P]=d.useState(null),R=C&&!O&&!q,J=m=>Math.min(Math.max(m,V),N),he=lr??K,ce=m=>{var ke,Ie,Ve;if(!R)return;m.preventDefault();const G=m.clientX,re=((ke=Ze.current)==null?void 0:ke.getBoundingClientRect().width)??K;(Ve=(Ie=m.currentTarget).setPointerCapture)==null||Ve.call(Ie,m.pointerId),Ge(!0),document.body.style.userSelect="none",document.body.style.cursor="col-resize";let Se=0,Oe=re;const Ye=Or=>{Oe=re+(Or.clientX-G),Se||(Se=requestAnimationFrame(()=>{Se=0,P(J(Oe))}))},He=()=>{Se&&cancelAnimationFrame(Se),window.removeEventListener("pointermove",Ye),window.removeEventListener("pointerup",He),document.body.style.userSelect="",document.body.style.cursor="",P(null),Ge(!1),Oe<Xl?Z(!0):te(J(Oe))};window.addEventListener("pointermove",Ye),window.addEventListener("pointerup",He)},Me=m=>{R&&(m.key==="ArrowLeft"?(m.preventDefault(),te(G=>G-mo)):m.key==="ArrowRight"?(m.preventDefault(),te(G=>G+mo)):m.key==="Home"?(m.preventDefault(),te(V)):m.key==="End"&&(m.preventDefault(),te(N)))};d.useEffect(()=>{const m=ge.current;if(!m)return;const G=()=>{ur||(Nr=m.scrollTop)};return m.addEventListener("scroll",G),()=>m.removeEventListener("scroll",G)},[]);const ze=()=>{const m=ge.current;m&&Nr>0&&(ur=!0,m.scrollTop=Nr,requestAnimationFrame(()=>{ur=!1}))};d.useLayoutEffect(()=>{ur=!0,ze();const m=setTimeout(()=>{ur=!1},300);return()=>clearTimeout(m)},[]),d.useLayoutEffect(()=>{k.menus.length>0&&(Nr>0?ze():requestAnimationFrame(()=>{var G;const m=(G=ge.current)==null?void 0:G.querySelector("[data-menu-active='true']");m&&m.scrollIntoView({block:"center",behavior:"instant"})}))},[k.menus]),d.useEffect(()=>{ur=!0,ze();const m=setTimeout(ze,0),G=setTimeout(ze,50),re=setTimeout(ze,100),Se=setTimeout(ze,200),Oe=setTimeout(()=>{ur=!1},300),Ye=setTimeout(()=>{const He=ge.current,ke=He==null?void 0:He.querySelector("[data-menu-active='true']");if(He&&ke){const Ie=He.getBoundingClientRect(),Ve=ke.getBoundingClientRect();Ve.top>=Ie.top&&Ve.bottom<=Ie.bottom||ke.scrollIntoView({block:"center",behavior:"smooth"})}},250);return()=>{clearTimeout(m),clearTimeout(G),clearTimeout(re),clearTimeout(Se),clearTimeout(Oe),clearTimeout(Ye)}},[S.pathname]),d.useEffect(()=>{We.current&&(We.current.scrollTop=0)},[S.pathname]),d.useEffect(()=>{O&&ve(!1)},[S.pathname,O]),d.useEffect(()=>{O&&Z(!0)},[O]),d.useEffect(()=>{const m=document.documentElement;return m.style.setProperty("--app-header-height",Eo),()=>{m.style.removeProperty("--app-header-height")}},[]);const er=()=>{X(!0)},Qe=()=>{X(!1)},Le=()=>{X(!1),l()},Je=m=>{const G=[m.to];return m.children&&G.push(...m.children.map(re=>re.to)),G},Be=[...k.menus.flatMap(m=>m.items.flatMap(Je)),...((hr=k.menuBottom)==null?void 0:hr.flatMap(Je))??[]],Ue=m=>{if(!S.pathname.startsWith(m))return!1;const G=Be.filter(re=>S.pathname.startsWith(re)).sort((re,Se)=>Se.length-re.length)[0];return m===G};d.useEffect(()=>{var G;const m=re=>{var Se;(Se=re.children)!=null&&Se.some(Oe=>S.pathname.startsWith(Oe.to))&&xe(Oe=>{const Ye=new Set(Oe);return Ye.add(re.id),Ye})};k.menus.forEach(re=>{re.items.forEach(m)}),(G=k.menuBottom)==null||G.forEach(m)},[S.pathname,k.menus,k.menuBottom]);const nr=m=>{xe(G=>{const re=new Set(G);return re.has(m)?re.delete(m):re.add(m),re})};d.useEffect(()=>{k.menus.length!==0&&Fe!==null&&!k.menus.some(m=>m.id===Fe)&&_e(null)},[k.menus,Fe,_e]);const gr=d.useMemo(()=>{if(Fe!==null)return k.menus.filter(re=>re.id===Fe||re.parentGroupId===Fe);const m=k.menus.filter(re=>re.parentGroupId===void 0),G=k.menus.filter(re=>re.parentGroupId!==void 0).flatMap(re=>re.items);return G.length===0?m:[...m,{id:18,name:"Pengaturan",items:G,parentGroupId:void 0}]},[k.menus,Fe]);if(B)return e.jsx(f.Box,{as:"main",overflow:"overflow-y-auto",bg:"surface-inverse",style:{height:"100vh"},children:r||e.jsx(F,{})});const dr=m=>{const G=m.children&&m.children.length>0,re=Ce.has(m.id),Se=G?m.children.some(He=>Ue(He.to)):Ue(m.to),Oe=Vr(m.badge,H[m.id]),Ye=!!Oe&&q&&!O;return e.jsxs(f.Box,{display:"block","data-menu-active":Se||void 0,children:[e.jsxs(f.Box,{as:"button",onClick:He=>{if(G)if(q&&!O){const ke=He.currentTarget.getBoundingClientRect();Ae({item:m,top:ke.top,left:ke.right+8})}else nr(m.id);else W(m.to)},fullWidth:!0,direction:"row",align:"center",justify:q&&!O?"center":void 0,gap:"sm",paddingInline:q&&!O?void 0:"sm",paddingBlock:"xs",height:"height-32",borderRadius:Se?"rounded-sm":"rounded-md",borderWidth:"border",borderStyle:"border-solid",borderColor:Se?"border-base":void 0,bg:Se?"white":void 0,hover:Se?void 0:{bg:"neutral"},title:q&&!O?m.title:void 0,style:{textAlign:"left",color:"var(--sa-text-primary, #292a2e)",...Se?null:{borderColor:"transparent"}},children:[e.jsxs(f.Box,{position:"relative",display:"inline-flex",flexShrink:"0",style:{alignItems:"center"},children:[e.jsx(M.Icon,{name:m.icon,size:"sm",style:{flexShrink:0}}),Ye&&e.jsx(f.Box,{"aria-hidden":"true",position:"absolute",top:"top-n2",right:"right-n2",display:"inline-flex",borderRadius:"rounded-full",style:{boxShadow:"0 0 0 1px var(--sa-background-primary, #ffffff)"},children:e.jsx(sr.BadgeDot,{tone:"error",variant:"solid",size:"xs"})})]}),(!q||O)&&e.jsxs(e.Fragment,{children:[e.jsx(ko,{text:m.title,textStyle:{transition:"opacity 0.3s"}}),Oe&&e.jsx(sr.Badge,{text:String(Oe.value),variant:Oe.variant??"info",size:"xs",border:!0}),G&&e.jsx(M.Icon,{name:"ChevronDown",size:"sm",style:{flexShrink:0,transition:"transform 0.2s",transform:re?"rotate(180deg)":"rotate(0deg)"}})]})]}),G&&(!q||O)&&(()=>{const He=m.children.findIndex(ke=>Ue(ke.to));return e.jsxs(f.Box,{position:"relative",overflow:"overflow-hidden",style:{marginLeft:"1rem",paddingLeft:"0.75rem",transition:"all 0.3s ease-in-out",maxHeight:re?`${m.children.length*36}px`:"0px",opacity:re?1:0,marginTop:re?"0.25rem":"0px"},children:[e.jsx(f.Box,{"aria-hidden":"true",position:"absolute",left:"left-0",top:"top-0",fullHeight:!0,style:{width:"1.5px",backgroundColor:"var(--sa-border-subtle, #0b120e24)",pointerEvents:"none"}}),He>=0&&e.jsx(f.Box,{"aria-hidden":"true",position:"absolute",left:"left-0",height:"height-32",zIndex:"10",style:{top:`${He*32}px`,width:"1.5px",backgroundColor:"var(--sa-text-primary, #292a2e)",transition:"top 0.2s ease-in-out",pointerEvents:"none"}}),m.children.map(ke=>{const Ie=Vr(ke.badge,H[ke.id]),Ve=Ue(ke.to);return e.jsxs(f.Box,{as:"button",onClick:()=>W(ke.to),fullWidth:!0,direction:"row",align:"center",gap:"sm",paddingLeft:"sm",paddingRight:"sm",paddingBlock:"xs",height:"height-32",borderRadius:Ve?"rounded-sm":"rounded-md",borderWidth:"border",borderStyle:"border-solid",borderColor:Ve?"border-base":void 0,bg:Ve?"white":void 0,hover:Ve?void 0:{bg:"neutral"},style:{textAlign:"left",color:Ve?"var(--sa-text-primary, #292a2e)":"var(--sa-text-subtle, #505258)",...Ve?null:{borderColor:"transparent"}},children:[e.jsx(M.Icon,{name:ke.icon,size:"sm",style:{flexShrink:0}}),e.jsx(ko,{text:ke.title}),Ie&&e.jsx(sr.Badge,{text:String(Ie.value),variant:Ie.variant??"info",size:"xs",border:!0})]},ke.id)})]})})()]},m.id)};return e.jsx(xo,{children:e.jsxs(vo,{children:[e.jsxs(f.Box,{direction:"row",position:"relative",style:{height:"100vh","--app-header-height":Eo,"--app-sidebar-width":O?"0px":q?xt:`${he}px`,"--app-footer-zindex":O&&se?"40":"998"},children:[O&&e.jsx(f.Box,{position:"fixed",zIndex:"40",bg:"black-alpha-a50",style:{inset:0,opacity:se?.5:0,pointerEvents:se?"auto":"none",transition:"opacity 0.3s"},onClick:()=>ve(!1)}),e.jsxs(f.Box,{as:"aside",ref:Ze,bg:"surface-inverse",borderWidth:"border-r",borderStyle:"border-solid-r",borderColor:"border-base",flexShrink:O?void 0:"0",style:{width:O?"16.375rem":q?xt:`${he}px`,position:O?"fixed":"relative",...O&&{inset:0,zIndex:50,transform:se?"translateX(0)":"translateX(-100%)"},transition:de?"none":"all 0.3s ease-in-out",minWidth:0},children:[e.jsx(f.Box,{onMouseEnter:()=>ue(!0),onMouseLeave:()=>ue(!1),direction:"row",align:"center",justify:"space-between",paddingInline:$?void 0:"lg",borderWidth:"border-b",borderStyle:"border-solid-b",borderColor:"border-base",position:"relative",style:{height:"var(--app-header-height, 4rem)",...$?{paddingInline:wt}:null},children:(()=>{const m=!O&&q&&!se,G=m&&Ee;return e.jsxs(e.Fragment,{children:[e.jsxs(f.Box,{direction:"row",align:"center",gap:"sm",flex:m?"1":void 0,justify:m?"center":void 0,style:{transition:"opacity 0.2s",opacity:G?0:1,pointerEvents:G?"none":"auto"},children:[e.jsx("img",{src:k.logo,alt:"Logo",style:{width:"1.5rem",height:"1.5rem",flexShrink:0}}),(!q||se)&&e.jsx(D.Text,{as:"span",fontSize:"md",fontWeight:"bold",color:"primary",truncate:!0,style:{transition:"opacity 0.3s"},children:k.appName})]}),!O&&!q&&e.jsx(f.Box,{as:"button",onClick:()=>Z(!0),"aria-label":"Collapse sidebar",display:"inline-flex",align:"center",justify:"center",flexShrink:"0",style:{color:"var(--sa-text-subtle, #8c8f97)"},children:e.jsx(M.Icon,{name:"LayoutLeft",size:"sm"})}),m&&e.jsx(f.Box,{as:"button",onClick:()=>Z(!1),"aria-label":"Expand sidebar",position:"absolute",display:"inline-flex",align:"center",justify:"center",width:"width-32",height:"height-32",bg:"white",borderWidth:"border",borderStyle:"border-solid",borderColor:"border-base",borderRadius:"rounded-sm",style:{top:"50%",left:"50%",transform:"translate(-50%, -50%)",color:"var(--sa-text-primary, #292a2e)",opacity:G?1:0,pointerEvents:G?"auto":"none",transition:"opacity 0.2s"},children:e.jsx(M.Icon,{name:"LayoutLeft",size:"sm"})}),O&&e.jsx(f.Box,{as:"button",onClick:()=>ve(!1),"aria-label":"Close menu",align:"center",justify:"center",borderRadius:"rounded-md",style:{padding:"0.375rem",color:"var(--sa-text-subtle, #8c8f97)"},children:e.jsx(M.Icon,{name:"Cross",size:"md"})})]})})()}),i&&e.jsx(bo,{collapsed:O?!1:q,children:i}),e.jsx(f.Box,{ref:ge,flex:"1",overflow:"overflow-y-auto",paddingBlock:"lg",children:gr.map(m=>e.jsxs(f.Box,{marginBottom:"lg",children:[!q||O?m.name&&e.jsx(D.Text,{fontSize:"md",fontWeight:"medium",color:"subtlest",truncate:!0,style:{paddingLeft:"1.25rem",paddingRight:"0.75rem",paddingBottom:"0.25rem",transition:"opacity 0.3s"},children:m.name}):m.name&&e.jsx(f.Box,{"aria-label":m.name,direction:"row",align:"center",justify:"center",paddingBlock:"md",children:e.jsx(f.Box,{width:"width-16",style:{height:"2px",borderRadius:"1px",backgroundColor:m.color??"var(--sa-background-brand, #04254f)"}})}),e.jsx(f.Box,{paddingInline:$?void 0:"md",gap:"xs",style:$?{paddingInline:wt}:void 0,children:m.slotKey?e.jsx(wo,{slotKey:m.slotKey,fallback:m.items.map(G=>dr(G))}):m.items.map(G=>dr(G))})]},m.id))}),k.menuBottom&&k.menuBottom.length>0&&e.jsx(f.Box,{borderWidth:"border-t",borderStyle:"border-solid-t",borderColor:"border-base",paddingBlock:"md",paddingInline:$?void 0:"md",bg:"surface-inverse",gap:"xs",flexShrink:"0",style:$?{paddingInline:wt}:void 0,children:k.menuBottom.map(m=>dr(m))}),R&&e.jsx(f.Box,{role:"separator","aria-orientation":"vertical","aria-label":"Resize sidebar","aria-valuenow":K,"aria-valuemin":V,"aria-valuemax":N,tabIndex:0,onPointerDown:ce,onKeyDown:Me,onDoubleClick:_,title:"Drag to resize · double-click to reset",position:"absolute",top:"top-0",right:"right-0",fullHeight:!0,style:{width:"6px",transform:"translateX(50%)",cursor:"col-resize",zIndex:5,touchAction:"none",background:de?"var(--sa-background-brand, #04254f)":"transparent",transition:"background 0.15s"},onMouseEnter:m=>{de||(m.currentTarget.style.background="var(--sa-border-bold, #0b120e40)")},onMouseLeave:m=>{de||(m.currentTarget.style.background="transparent")}})]}),e.jsxs(f.Box,{flex:"1",overflow:"overflow-hidden",children:[e.jsxs(f.Box,{as:"header",bg:"white",borderWidth:"border-b",borderStyle:"border-solid-b",borderColor:"border-base",direction:"row",align:"center",justify:"space-between",paddingInline:"lg",flexShrink:"0",style:{height:"var(--app-header-height, 4rem)"},children:[e.jsxs(f.Box,{direction:"row",align:"center",gap:O?"lg":void 0,children:[O&&e.jsx(f.Box,{as:"button",onClick:()=>ve(!0),align:"center",justify:"center",borderRadius:"rounded-md",style:{padding:"0.375rem",color:"var(--sa-text-subtle, #8c8f97)"},children:e.jsx(M.Icon,{name:"MenuBurger",size:"lg"})}),e.jsx(Co,{children:t})]}),e.jsxs(f.Box,{direction:"row",align:"center",gap:"md",children:[a,e.jsxs(A.Menu,{position:"bottom-right",children:[e.jsx(A.MenuButton,{children:e.jsxs(f.Box,{direction:"row",align:"center",gap:"sm",cursor:"pointer",children:[e.jsxs(f.Box,{display:"block",textAlign:"right",style:{maxWidth:"12.5rem"},children:[e.jsx(D.Text,{fontSize:"sm",fontWeight:"semibold",color:"subtle",truncate:!0,children:n?"Loading...":(o==null?void 0:o.name)||"unknown"}),e.jsx(D.Text,{fontSize:"xs",color:"subtle",truncate:!0,children:n?"":(o==null?void 0:o.email)||"unknown"})]}),e.jsx(zr.Avatar,{size:"md",initials:((o==null?void 0:o.name)||"U")[0].toUpperCase(),bg:"var(--sa-background-brand, #04254f)",color:"var(--sa-background-primary, #ffffff)",style:{fontSize:"0.875rem",boxShadow:"var(--sa-shadow-sm, 0 1px 2px 0 #0000000d)"}}),e.jsx(M.Icon,{name:"ChevronDown",size:"sm",style:{color:"var(--sa-text-subtle, #8c8f97)"}})]})}),e.jsxs(A.MenuLists,{width:280,style:{paddingBlock:"12px",paddingInline:"12px",gap:"8px",marginTop:"16px"},children:[e.jsx(A.MenuHeading,{children:e.jsxs(f.Box,{align:"center",textAlign:"center",paddingBlock:"sm",fullWidth:!0,children:[e.jsx(zr.Avatar,{customSize:64,initials:((o==null?void 0:o.name)||"U")[0].toUpperCase(),bg:"var(--sa-background-brand, #04254f)",color:"var(--sa-background-primary, #ffffff)",style:{fontSize:"1.25rem",marginBottom:"0.75rem",boxShadow:"var(--sa-shadow-sm, 0 1px 2px 0 #0000000d)"}}),e.jsx(D.Text,{fontSize:"md",fontWeight:"bold",color:"primary",truncate:!0,style:{maxWidth:"100%"},children:(o==null?void 0:o.name)||"unknown"}),e.jsx(D.Text,{fontSize:"sm",color:"subtle",truncate:!0,style:{maxWidth:"100%"},children:(o==null?void 0:o.email)||"unknown"}),h&&e.jsx(D.Text,{fontSize:"sm",color:"subtle",truncate:!0,style:{maxWidth:"100%"},children:h})]})}),(y&&y.length>0||b)&&e.jsxs(A.MenuBody,{children:[y==null?void 0:y.map((m,G)=>e.jsx(A.MenuItem,{onClick:m.onClick,startIcon:e.jsx(M.Icon,{name:m.icon,size:"md"}),children:m.label},`${m.label}-${G}`)),b]}),p??e.jsx(A.MenuFooter,{children:e.jsx(A.MenuItem,{intent:"danger",onClick:er,startIcon:e.jsx(M.Icon,{name:"Logout",size:"md"}),children:"Logout"})})]})]})]})]}),e.jsx(f.Box,{as:"main",ref:We,flex:"1",overflow:"overflow-y-auto",children:r||e.jsx(F,{})})]})]}),s&&c&&e.jsx(f.Box,{position:"fixed",align:"center",justify:"center",bg:"black-alpha-a70",style:{inset:0,zIndex:9999},children:c}),e.jsxs(je.Dialog,{isShow:Y,onHide:Qe,children:[e.jsx(je.DialogTitle,{children:"Confirmation Logout"}),e.jsx(je.DialogBody,{children:"Are you sure you want to end the session and exit the page?"}),e.jsx(je.DialogFooter,{children:e.jsx(f.Box,{direction:"column",display:"flex",align:"flex-end",justify:"center",children:e.jsxs(ie.Flex,{direction:"row",gap:"sm",align:"center",children:[e.jsx(f.Box,{direction:"column",children:e.jsx(j.Button,{secondary:!0,onClick:Qe,children:"Cancel"})}),e.jsx(f.Box,{direction:"column",children:e.jsx(j.Button,{primary:!0,onClick:Le,children:"Yes, Sure"})})]})})})]}),we&&e.jsxs(e.Fragment,{children:[e.jsx(f.Box,{onClick:()=>Ae(null),position:"fixed",style:{inset:0,zIndex:60}}),e.jsxs(f.Box,{role:"dialog","aria-label":we.item.title,position:"fixed",bg:"white",borderWidth:"border",borderStyle:"border-solid",borderColor:"border-base",borderRadius:"rounded-md",shadow:"shadow-lg",padding:"sm",gap:"spacing-2",style:{top:we.top,left:we.left,zIndex:61,minWidth:"13rem",maxWidth:"16rem"},children:[e.jsx(D.Text,{fontSize:"sm",fontWeight:"bold",color:"gray-500",textTransform:"uppercase",style:{padding:"0.25rem 0.5rem 0.5rem",letterSpacing:"0.05em"},children:we.item.title}),(Sr=we.item.children)==null?void 0:Sr.map(m=>{const G=Ue(m.to),re=Vr(m.badge,H[m.id]);return e.jsxs(f.Box,{as:"button",onClick:()=>{W(m.to),Ae(null)},fullWidth:!0,direction:"row",align:"center",gap:"md",paddingBlock:"sm",paddingInline:"md",borderRadius:"rounded-md",borderWidth:"border",borderStyle:"border-solid",bg:G?"primary-inverse":void 0,hover:G?void 0:{bg:"primary-inverse"},style:{textAlign:"left",borderColor:"transparent",color:G?"var(--sa-text-primary, #292a2e)":"var(--sa-color-gray-800, #505258)"},children:[m.icon&&e.jsx(M.Icon,{name:m.icon,size:"sm",style:{flexShrink:0}}),e.jsx(D.Text,{as:"span",fontSize:"md",fontWeight:"semibold",whiteSpace:"nowrap",style:{flex:1},children:m.title}),re&&e.jsx(sr.Badge,{text:String(re.value),variant:re.variant??"info",size:"xs",border:!0})]},m.id)})]})]})]})})}const mr=d.forwardRef(({children:r,...t},o)=>e.jsx(f.Box,{ref:o,role:"button",cursor:"pointer","aria-pressed":"true",display:"inline-block",tabIndex:0,...t,children:r})),Fo=({title:r,iconName:t,textColor:o,iconColor:n,hoverTextColor:l,hoverIconColor:s})=>{const[c,i]=d.useState(!1),a=n??"var(--sa-text-subtle, #8c8f97)",h=o??"var(--sa-text-subtle, #8c8f97)",y=s??"var(--sa-text-subtle, #8c8f97)",b=l??"var(--sa-text-primary, #292a2e)";return e.jsxs(f.Box,{direction:"row",gap:"xs",align:"center",onMouseEnter:()=>i(!0),onMouseLeave:()=>i(!1),style:{cursor:"pointer"},children:[e.jsx(M.Icon,{name:t||"ChevronLeft",size:"xs",style:{color:c?y:a,transition:"color 0.15s ease"}}),e.jsx(D.Text,{variant:"sub-h3",style:{color:c?b:h,transition:"color 0.15s ease"},children:r||"Back"})]})},Kl=({items:r,separator:t="/",iconName:o,iconColor:n,hoverIconColor:l})=>{const{Link:s}=or(),[c,i]=d.useState(!1),a=n??"var(--sa-text-subtle, #8c8f97)",h=l??"var(--sa-text-subtle, #8c8f97)",y=r.length>1?r[0]:void 0,b=!!(y!=null&&y.to||y!=null&&y.onClick),p=e.jsx(M.Icon,{name:o||"ChevronLeft",size:"xs",onMouseEnter:b?()=>i(!0):void 0,onMouseLeave:b?()=>i(!1):void 0,style:{color:b&&c?h:a,transition:"color 0.15s ease",cursor:b?"pointer":void 0}}),C=y!=null&&y.to?e.jsx(s,{to:y.to,replace:!0,style:{textDecoration:"none"},children:p}):y!=null&&y.onClick?e.jsx(mr,{onClick:y.onClick,children:p}):p;return e.jsxs(f.Box,{direction:"row",gap:"xs",align:"center",children:[C,e.jsx(pr.Breadcrumb,{separator:t,size:"md",children:r.map((E,w)=>{const L=w===r.length-1;return E.to&&!L?e.jsx(pr.BreadcrumbItem,{children:e.jsx(s,{to:E.to,children:E.label})},w):e.jsx(pr.BreadcrumbItem,{currentPage:L,children:e.jsx(pr.BreadcrumbLink,{onClick:L?void 0:E.onClick,children:E.label})},w)})})]})},Rl=r=>{const{Link:t}=or(),{items:o,separator:n,onClick:l,navigateTo:s,...c}=r;return o&&o.length>0?e.jsx(Kl,{items:o,separator:n,iconName:c.iconName,iconColor:c.iconColor,hoverIconColor:c.hoverIconColor}):s?e.jsx(f.Box,{direction:"row",children:e.jsx(t,{to:s,replace:!0,style:{textDecoration:"none"},children:e.jsx(Fo,{...c})})}):e.jsx(f.Box,{direction:"row",children:e.jsx(mr,{onClick:l,children:e.jsx(Fo,{...c})})})},Dt=[{icon:"var(--sa-color-brand-400, #3366b7)",activeBg:"var(--sa-color-brand-50, #e6edf6)",activeBorder:"var(--sa-color-brand-300, #668cc9)",activeShadow:"rgba(51, 102, 183, 0.25)"},{icon:"var(--sa-color-warning-400, #ed9f30)",activeBg:"var(--sa-color-warning-50, #fef2e6)",activeBorder:"var(--sa-color-warning-300, #f1b259)",activeShadow:"rgba(237, 159, 48, 0.25)"},{icon:"var(--sa-color-secondary-300, #5468e1)",activeBg:"var(--sa-color-secondary-50, #e6e9fb)",activeBorder:"var(--sa-color-secondary-200, #8a98ea)",activeShadow:"rgba(84, 104, 225, 0.25)"},{icon:"var(--sa-color-info-500, #00abeb)",activeBg:"var(--sa-color-info-50, #effaff)",activeBorder:"var(--sa-color-info-300, #75dbff)",activeShadow:"rgba(0, 171, 235, 0.25)"},{icon:"var(--sa-color-success-500, #30ce84)",activeBg:"var(--sa-color-success-50, #ecfff6)",activeBorder:"var(--sa-color-success-300, #75dead)",activeShadow:"rgba(48, 206, 132, 0.25)"},{icon:"var(--sa-color-error-400, #ff758f)",activeBg:"var(--sa-color-error-50, #fff0f3)",activeBorder:"var(--sa-color-error-300, #ff8fa3)",activeShadow:"rgba(255, 117, 143, 0.25)"}];function Mo(r,t,o){return{display:"flex",alignItems:"center",justifyContent:"center",width:"64px",height:"64px",borderRadius:"var(--sa-radii-sm, 6px)",border:r?`2px solid ${o.activeBorder}`:"2px solid var(--sa-color-gray-200, #f0f1f2)",backgroundColor:r?o.activeBg:"var(--sa-color-gray-50, #ffffff)",boxShadow:r?t?`0 8px 20px ${o.activeShadow.replace("0.25","0.35")}`:`0 2px 8px ${o.activeShadow}`:t?"0 8px 20px rgba(0, 0, 0, 0.14)":"0 1px 4px rgba(0, 0, 0, 0.08)",transform:t?"translateY(-3px) scale(1.05)":"translateY(0) scale(1)",transition:"box-shadow 0.2s ease, transform 0.2s ease, background-color 0.15s ease, border-color 0.15s ease"}}const Io={fontSize:"11px",fontWeight:500,textAlign:"center",overflowWrap:"normal",wordBreak:"normal",color:"var(--sa-background-primary, #ffffff)",lineHeight:"1.3",maxWidth:"80px"},To={display:"flex",flexDirection:"column",alignItems:"center",gap:"8px",background:"none",border:"none",cursor:"pointer",padding:0};function Lo({isShow:r,onHide:t,menus:o,selectedGroupId:n,onSelect:l}){const[s,c]=d.useState(void 0),i=h=>{l(h),t()},a=Dt[0];return e.jsx(je.Dialog,{isShow:r,onHide:t,style:{width:560,background:"transparent",boxShadow:"none",border:"none"},children:e.jsx(je.DialogBody,{children:e.jsxs("div",{style:{display:"grid",gridTemplateColumns:"repeat(5, 1fr)",gap:"16px"},children:[e.jsxs("button",{onClick:()=>i(null),onMouseEnter:()=>c("all"),onMouseLeave:()=>c(void 0),style:To,children:[e.jsx("div",{style:Mo(n===null,s==="all",a),children:e.jsx("div",{style:{color:a.icon,display:"flex",alignItems:"center",justifyContent:"center"},children:e.jsx(M.Icon,{name:"Grid",size:"lg",style:{width:32,height:32}})})}),e.jsx("span",{style:Io,children:"Semua"})]}),o.map((h,y)=>{var w;const b=n===h.id,p=s===h.id,C=((w=h.items[0])==null?void 0:w.icon)??"Grid",E=Dt[(y+1)%Dt.length];return e.jsxs("button",{onClick:()=>i(h.id),onMouseEnter:()=>c(h.id),onMouseLeave:()=>c(void 0),style:To,children:[e.jsx("div",{style:Mo(b,p,E),children:e.jsx("div",{style:{color:E.icon,display:"flex",alignItems:"center",justifyContent:"center"},children:e.jsx(M.Icon,{name:C,size:"lg",style:{width:32,height:32}})})}),e.jsx("span",{style:Io,children:h.name})]},h.id)})]})})})}function en({onSelect:r,"aria-label":t="Pilih module"}={}){const o=ht(),{useNavigate:n}=or(),l=n(),{selectedGroupId:s,setSelectedGroupId:c}=Ct(),[i,a]=d.useState(!1),h=y=>{var b;if(c(y),y!==null){const p=o.menus.find(E=>E.id===y),C=(b=p==null?void 0:p.items[0])==null?void 0:b.to;C&&l(C)}r==null||r(y)};return e.jsxs(e.Fragment,{children:[e.jsxs("div",{style:{position:"relative"},children:[e.jsx("button",{onClick:()=>a(!0),style:{display:"inline-flex",alignItems:"center",justifyContent:"center",width:"2.25rem",height:"2.25rem",borderRadius:"var(--sa-radii-sm, 0.25rem)",border:"1px solid var(--sa-border-subtle, #0b120e24)",color:"var(--sa-text-subtle, #8c8f97)",backgroundColor:"transparent",cursor:"pointer"},"aria-label":t,onMouseEnter:y=>{y.currentTarget.style.backgroundColor="var(--sa-background-primary-inverse, #f8f8f8)"},onMouseLeave:y=>{y.currentTarget.style.backgroundColor="transparent"},children:e.jsx(M.Icon,{name:"GridApplication",size:"sm"})}),s!==null&&e.jsx("span",{style:{position:"absolute",top:"0.25rem",right:"0.25rem",width:"0.5rem",height:"0.5rem",borderRadius:"9999px",backgroundColor:"var(--sa-color-brand-500, #1a4fa0)"},"aria-hidden":"true"})]}),e.jsx(Lo,{isShow:i,onHide:()=>a(!1),menus:o.menus.filter(y=>y.parentGroupId===void 0),selectedGroupId:s,onSelect:h})]})}const rn=(r,t)=>{const o=[];if(t===0)return o.push(r),o;for(let n=0;n<r.length;n+=t){const l=r.slice(n,n+t);o.push(l)}return o},tn=d.memo(({value:r,label:t,separator:o,labelWidth:n,lastIndex:l,labelAlign:s="top"})=>{const c=d.useMemo(()=>({padding:0,paddingBottom:l?0:12,verticalAlign:s}),[l,s]),i=d.useMemo(()=>({padding:0,paddingRight:12,paddingLeft:12,paddingBottom:l?0:12,verticalAlign:s}),[l,s]),a=()=>typeof t=="string"?e.jsx(D.Text,{fontWeight:"medium",color:"subtlest",children:t}):t,h=()=>typeof r=="string"||typeof r=="number"?e.jsx(D.Text,{color:"primary",fontWeight:"medium",children:r}):r,y=()=>typeof o=="string"||typeof o=="number"?e.jsx(D.Text,{fontWeight:"medium",color:"subtlest",children:o}):o;return e.jsxs(U.Tr,{children:[e.jsx(U.Td,{style:c,width:n,children:a()}),o?e.jsx(U.Td,{style:i,width:24,children:y()}):null,e.jsx(U.Td,{style:c,children:h()})]})}),on=d.memo(({fields:r,separator:t,labelWidth:o})=>e.jsx(U.Table,{withColumnBorder:!1,withRowBorder:!1,children:r.map((n,l)=>e.jsx(tn,{separator:t,labelWidth:o,lastIndex:l===r.length-1,...n},`field-group-field-${l}`))})),ln=d.memo(({maxRow:r=0,maxColumn:t=2,separator:o=":",fields:n=[],labelWidth:l=150,bordered:s=!1})=>{const c=d.useMemo(()=>rn(n,r),[n,r]),i=c.length>2,a=()=>{switch(t){case 1:return"width-full";case 2:return"width-1-2";case 3:return"width-1-3";case 4:return"width-1-4";default:return"width-1-2"}};return e.jsx(f.Box,{gap:i?void 0:"lg",direction:"row",flexWrap:"wrap",borderRadius:"rounded-sm",padding:"lg",paddingBottom:i?"xs":"lg",bg:"accent-dark-tertiary",borderWidth:s?"border":void 0,borderStyle:s?"border-solid":void 0,borderColor:s?"border-subtle":void 0,children:c.map((h,y)=>e.jsx(f.Box,{direction:"column",flex:i?void 0:"1",width:i?a():void 0,marginBottom:i?"lg":void 0,children:e.jsx(on,{labelWidth:l,fields:h,separator:o})},y))})}),nn=({backButton:r})=>{const[t,o]=d.useState(!1),n=(r==null?void 0:r.iconColor)??"var(--sa-text-subtle, #8c8f97)",l=(r==null?void 0:r.textColor)??"var(--sa-text-subtle, #8c8f97)",s=(r==null?void 0:r.hoverIconColor)??"var(--sa-text-subtle, #8c8f97)",c=(r==null?void 0:r.hoverTextColor)??"var(--sa-text-primary, #292a2e)";return e.jsxs(f.Box,{direction:"row",gap:"xs",align:"center",onMouseEnter:()=>o(!0),onMouseLeave:()=>o(!1),style:{cursor:"pointer"},children:[e.jsx(M.Icon,{name:(r==null?void 0:r.iconName)||"ChevronLeft",size:"xs",style:{color:t?s:n,transition:"color 0.15s ease"}}),e.jsx(D.Text,{variant:"sub-h3",style:{color:t?c:l,textDecoration:t?"underline":"none",transition:"color 0.15s ease"},children:(r==null?void 0:r.title)||"Back"})]})},sn=({backButton:r,title:t,titleIcon:o,titleTag:n,children:l,header:s=!0,headerBorder:c=!1,disableAnimation:i=!1,scrollable:a=!1,stickyHeader:h=!1,subHeaders:y,action:b,titleTagProps:p,containerProps:C,headerProps:E})=>{const w=De.useMediaQuery("md"),{Link:L,useNavigate:F,useLocation:I}=or(),B=F(),k=I(),H=r==null?void 0:r.show,W=()=>{if(typeof(r==null?void 0:r.onClick)=="function"){r.onClick();return}B(-1,{replace:!0})},S=()=>{if(!b)return null;if(d.isValidElement(b))return b;const Z=b.filter(K=>K&&(K.title||K.icon));return Z.length===0?null:w?e.jsx(f.Box,{direction:"row",gap:"md",children:Z.map(({title:K,icon:te,buttonProps:_,onClick:V},N)=>e.jsx(j.Button,{iconLeft:te?e.jsx(M.Icon,{name:te,size:"md"}):void 0,onClick:V,..._,children:K},`action-${N}`))}):e.jsxs(A.Menu,{position:"bottom-right",children:[e.jsx(A.MenuButton,{children:e.jsx(j.Button,{variant:"tertiary",size:"sm",iconLeft:e.jsx(M.Icon,{name:"MenuBurger"}),"aria-label":"Actions"})}),e.jsx(A.MenuLists,{children:e.jsx(A.MenuBody,{style:{minWidth:200},children:Z.map(({title:K,icon:te,buttonProps:_,onClick:V},N)=>{const se=(_==null?void 0:_.tone)==="error"||(_==null?void 0:_.danger)===!0;return e.jsx(A.MenuItem,{intent:se?"danger":void 0,disabled:_==null?void 0:_.disabled,startIcon:te?e.jsx(M.Icon,{name:te}):void 0,onClick:V,children:K},`action-${N}`)})})})]})},z=()=>{const Z=e.jsx(nn,{backButton:r});return r!=null&&r.navigateTo?e.jsx(f.Box,{direction:"row",children:e.jsx(L,{to:r.navigateTo,replace:!0,style:{textDecoration:"none"},children:Z})}):e.jsx(f.Box,{direction:"row",children:e.jsx(mr,{onClick:W,children:Z})})},O=()=>{const Z=!!t,K=Array.isArray(b)&&b.length>0,te=d.isValidElement(b)?!0:K;if(!Z&&!te&&!H)return null;const V=w||!w&&K;return e.jsxs(f.Box,{direction:"column",gap:"xs",paddingBlock:(E==null?void 0:E.paddingBlock)??"sm",paddingInline:(E==null?void 0:E.paddingInline)??"md",...E,style:{...c?{boxShadow:"inset 0 -1px 0 0 var(--sa-border-subtle, #0b120e24)"}:{},...E==null?void 0:E.style},children:[H&&z(),(Z||te)&&e.jsxs(f.Box,{direction:V?"row":"column",gap:"sm",justify:"space-between",align:V?"center":"flex-start",children:[Z?typeof t=="string"?e.jsxs(f.Box,{direction:"row",gap:"lg",align:"center",children:[e.jsxs(f.Box,{direction:"row",gap:"sm",align:"center",children:[o&&e.jsx(M.Icon,{name:o,size:"md",color:"primary"}),e.jsx(D.Text,{variant:"h3",fontWeight:"semibold",fontFamily:"Poppins",children:t})]}),n&&e.jsx(sr.Badge,{border:!0,size:"lg",text:n,...p})]}):t:null,S()]})]})},Y=()=>{if(!y||y.length===0)return null;const Z=y.filter(_=>_.show!==!1);if(Z.length===0)return null;let K=0,te=-1/0;return Z.forEach((_,V)=>{const N=_.order??0;N>=te&&(te=N,K=V)}),Z.map(({content:_,order:V,borderBottom:N=!0,keepBottomPadding:se=!1,paddingInline:ve=!0,paddingBlock:Ee=!0},ue)=>e.jsx(f.Box,{direction:"column",paddingTop:Ee?"sm":"spacing-0",paddingBottom:Ee&&(N||se||ue===K)?"sm":"spacing-0",paddingInline:ve?"md":"spacing-0",style:{...N?{boxShadow:"inset 0 -1px 0 0 var(--sa-border-subtle, #0b120e24)"}:{},...V!==void 0?{order:V}:{}},children:_},`sub-header-${ue}`))},X=()=>{const Z=s?O():null,K=Y();return!Z&&!K?null:e.jsxs(f.Box,{direction:"column",style:{...a?{position:"sticky",left:0,...h?{top:0}:{},zIndex:2,background:"var(--sa-background-primary, #ffffff)"}:{},marginBottom:K?"var(--sa-spacing-0)":"var(--sa-spacing-md)"},children:[Z,K]})},q=()=>l;return e.jsxs(f.Box,{direction:"column",as:"main",...C,style:{...a?{height:"100%",minHeight:0,overflow:"auto"}:{},...(C==null?void 0:C.style)??{},...i?{}:{animation:"pageLayoutEnter 320ms cubic-bezier(0.16, 1, 0.3, 1) backwards"}},children:[X(),q()]},k.pathname)},cn=d.memo(sn),an={icon:"Cross",title:""},dn=320,Oo=16,Ao=4,hn=8,Wo=d.forwardRef(({onHide:r,show:t,withBlur:o=!1,style:n,children:l,closeButton:s=an,paddingHorizontal:c=!0,width:i,minWidth:a,maxWidth:h,hideBackdrop:y=!1,title:b,headerAction:p,header:C=!0,widthPresets:E,resizable:w=!0,resizeMin:L=dn,resizeMax:F,onWidthChange:I},B)=>{const H=!De.useMediaQuery("md"),W=i??h??a??"357px",S=E??[],z=S.length>1,[O,Y]=d.useState(()=>{const $=S.indexOf(W);return $>=0?$:0}),[X,q]=d.useState(null),[Z,K]=d.useState(!1),[te,_]=d.useState(!1),V=d.useRef(null),N=$=>{V.current=$,typeof B=="function"?B($):B&&(B.current=$)},se=z?S[O]:W,ve=X!=null?`${X}px`:se,Ee=w&&!H,ue=O===S.length-1,Ce=()=>{const $=(O+1)%S.length;q(null),Y($),I==null||I(S[$])},xe=d.useCallback($=>{const ge=F??window.innerWidth;return Math.min(Math.max($,L),ge)},[L,F]),we=d.useRef(null),Ae=$=>{if(!Ee)return;$.preventDefault();const ge=$.currentTarget;ge.setPointerCapture($.pointerId),K(!0);const We=document.body.style.cursor,Ze=document.body.style.userSelect;document.body.style.cursor="col-resize",document.body.style.userSelect="none";let de=null;const Ge=P=>{const R=xe(window.innerWidth-P.clientX);we.current=R,de==null&&(de=window.requestAnimationFrame(()=>{de=null,we.current!=null&&q(we.current)}))},lr=P=>{de!=null&&window.cancelAnimationFrame(de),we.current!=null&&q(we.current),ge.releasePointerCapture(P.pointerId),ge.removeEventListener("pointermove",Ge),ge.removeEventListener("pointerup",lr),ge.removeEventListener("pointercancel",lr),document.body.style.cursor=We,document.body.style.userSelect=Ze,K(!1),we.current!=null&&(I==null||I(`${we.current}px`))};ge.addEventListener("pointermove",Ge),ge.addEventListener("pointerup",lr),ge.addEventListener("pointercancel",lr)},Fe=$=>{var de;if(!Ee||$.key!=="ArrowLeft"&&$.key!=="ArrowRight")return;$.preventDefault();const ge=$.key==="ArrowLeft"?Oo:-Oo,We=X??((de=V.current)==null?void 0:de.offsetWidth)??L,Ze=xe(We+ge);q(Ze),I==null||I(`${Ze}px`)},_e=()=>{Ee&&(q(null),I==null||I(se))};return e.jsx(Hr.Drawer,{blur:o,isShow:t,position:"right",onHide:r,ref:N,size:ve,style:n,flush:!0,radius:"none",hideBackdrop:y,children:e.jsxs(f.Box,{direction:"column",height:"height-full",children:[Ee?e.jsx("div",{role:"separator","aria-orientation":"vertical","aria-label":"Ubah lebar panel",tabIndex:0,onPointerDown:Ae,onKeyDown:Fe,onDoubleClick:_e,title:"Tarik untuk mengubah lebar — klik dua kali untuk reset",onPointerEnter:()=>_(!0),onPointerLeave:()=>_(!1),style:{position:"absolute",left:0,top:0,bottom:0,width:hn,cursor:"col-resize",zIndex:1,background:Z||te?`linear-gradient(to right, var(--sa-border-brand, var(--sa-border-subtle)) 0 ${Ao}px, transparent ${Ao}px)`:"transparent",transition:"background 0.15s",touchAction:"none"}}):null,C?e.jsxs(f.Box,{direction:"row",align:"center",justify:"space-between",gap:"sm",paddingInline:"md",borderWidth:"border-b",borderStyle:"border-solid-b",borderColor:"border-base",customHeight:"var(--app-header-height, 44px)",flexShrink:"0",children:[e.jsx(f.Box,{direction:"row",align:"center",gap:"sm",overflow:"overflow-hidden",children:typeof b=="string"?e.jsx(D.Text,{fontSize:"md",fontWeight:"bold",children:b}):b}),e.jsxs(f.Box,{direction:"row",align:"center",gap:"sm",flexShrink:"0",children:[p,z?e.jsx(j.Button,{variant:"tertiary",tone:"neutral",size:"xs",onClick:Ce,"aria-label":ue?"Kecilkan panel":"Lebarkan panel",iconRight:e.jsx(M.Icon,{name:ue?"ChevronRight":"ChevronLeft"})}):null,s?e.jsx(j.Button,{variant:"tertiary",tone:"neutral",size:"xs",onClick:r,"aria-label":s.title||"Tutup",iconRight:e.jsx(M.Icon,{name:s.icon}),children:s.title||void 0}):null]})]}):null,e.jsx(f.Box,{direction:"column",paddingBlock:"md",paddingInline:c?"md":"spacing-0",overflow:"overflow-y-auto",style:{flex:1,minHeight:0},children:l})]})})}),St=d.memo(({children:r,borderBottom:t=!0,padding:o=!0})=>{const n=De.useMediaQuery("lg");return e.jsx(f.Box,{direction:"column",padding:o?"md":"spacing-0",paddingLeft:o?"md":"spacing-0",paddingRight:o?"md":"spacing-0",style:t?{borderBottom:"1px solid var(--sa-border-subtle, #0b120e24)"}:void 0,children:r})}),Bt=d.memo(({children:r,borderTop:t=!0,padding:o=!0})=>{const n=De.useMediaQuery("lg");return e.jsx(f.Box,{direction:"column",padding:o?"md":"spacing-0",paddingLeft:o?"md":"spacing-0",paddingRight:o?"md":"spacing-0",style:t?{borderTop:"1px solid var(--sa-border-subtle, #0b120e24)"}:void 0,children:r})}),fn=d.memo(({children:r,...t})=>e.jsx(f.Box,{direction:"column",padding:"md",paddingLeft:"md",paddingRight:"md",gap:"md",...t,children:r})),un=d.memo(({children:r,title:t,titleTag:o,action:n,header:l,footer:s,actionContainer:c,containerProps:i,bodyProps:a,headerProps:h={borderBottom:!0},footerProps:y={borderTop:!0},variantTag:b="info"})=>{const p=De.useMediaQuery("lg"),C=()=>o?e.jsxs(f.Box,{direction:"row",gap:"sm",align:"center",children:[e.jsx(D.Text,{fontWeight:"medium",children:t}),e.jsx(sr.Badges,{border:!0,text:o,variant:b})]}):e.jsx(D.Text,{fontWeight:"medium",children:t}),E=()=>l||e.jsxs(f.Box,{direction:"row",justify:"space-between",align:"flex-start",gap:"md",children:[e.jsx(f.Box,{direction:"column",children:t?C():null}),e.jsx(f.Box,{direction:"column",style:p?{width:"100%",maxWidth:"19.313rem"}:{flex:1},...c,children:n??null})]}),w=!!(l||t||n);return e.jsxs(f.Box,{direction:"column",bg:"white",borderRadius:"rounded-xs",as:"section",borderWidth:"border",borderStyle:"border-solid",borderColor:"border-base",...i,style:{backgroundColor:"var(--sa-background-primary, #ffffff)",...(i==null?void 0:i.style)??{}},children:[l!==null&&w?e.jsx(St,{...h,children:E()}):null,e.jsx(fn,{...a,children:r}),s?e.jsx(Bt,{...y,children:s}):null]})}),Ke={H1:r=>e.jsx(D.Text,{variant:"h1",children:r.children,...r.props}),H2:r=>e.jsx(D.Text,{variant:"h2",children:r.children,...r.props}),H3:r=>e.jsx(D.Text,{variant:"h3",children:r.children,...r.props}),H4:r=>e.jsx(D.Text,{variant:"h4",children:r.children,...r.props}),H5:r=>e.jsx(D.Text,{variant:"h5",children:r.children,...r.props}),H6:r=>e.jsx(D.Text,{variant:"h6",children:r.children,...r.props}),SubH1:r=>e.jsx(D.Text,{variant:"sub-h1",children:r.children,...r.props}),SubH2:r=>e.jsx(D.Text,{variant:"sub-h2",children:r.children,...r.props}),SubH3:r=>e.jsx(D.Text,{variant:"sub-h3",children:r.children,...r.props}),Body1:r=>e.jsx(D.Text,{variant:"body-1",children:r.children,...r.props}),Body2:r=>e.jsx(D.Text,{variant:"body-2",children:r.children,...r.props}),Body3:r=>e.jsx(D.Text,{variant:"body-3",children:r.children,...r.props})},Ne=()=>{const{useSearchParams:r,useParams:t,useLocation:o}=or(),[n,l]=r(),s=vr.searchParamsToObject(n.toString()),c=t(),i=o(),a=c.id;return{setSearchParams:l,searchParams:n,searchQueries:s,isHasQuery:(C,E)=>n.has(C)&&n.get(C)===E,getQueryParam:C=>n.get(C),getRouteParam:C=>c[C],params:c,location:i,id:a,hasId:!!a}},zo=r=>JSON.stringify(r),Ho=r=>JSON.stringify(r),Po=r=>JSON.stringify(r),Vo=r=>JSON.stringify(r),gn=r=>r,yn=r=>JSON.stringify(r),Fr=({value:r,name:t,type:o,withSearchParam:n=!0,setSearchParams:l,searchQueries:s,dropdownSearchKey:c,filterKey:i="filter",pageKey:a="page"})=>{if(n){let h;switch(o){case"search":h=gn(r);break;case"dropdown":case"dropdown-multiple":h=zo(r);break;case"radio":h=Ho(r);break;case"date-range":h=Po(r);break;case"advanced-date-range":h=yn(r);break;case"date":h=Vo(r);break;default:h=r;break}if(typeof h<"u"){const b={...s[i]&&typeof s[i]=="string"?JSON.parse(s[i]):void 0,[t]:h},p={...s};c&&typeof c=="string"&&delete p[c],delete p[a];const C={...p,[i]:JSON.stringify(b)},E=new URLSearchParams(s).toString(),w=new URLSearchParams(C).toString();if(E===w)return;l(C)}}},_r=({name:r,filterKey:t="filter",searchParams:o,get:n})=>{const l=o.get(t)||void 0,s=l&&typeof l=="string"?JSON.parse(l):void 0,c=s?s[r]:void 0;return n==="label"&&c?JSON.parse(c)[0].label:n==="value"&&c?JSON.parse(c)[0].value:c},jo=({name:r,filterKey:t="filter",searchParams:o,get:n})=>{const l=o.get(t)||void 0,s=l&&typeof l=="string"?JSON.parse(l):void 0,c=s?s[r]:void 0;return n==="label"&&c?JSON.parse(c).map(i=>i.label):n==="value"&&c?JSON.parse(c).map(i=>i.value):n==="array"&&c?JSON.parse(c):c},pn=({name:r,filterKey:t="filter",searchParams:o,get:n})=>{const l=o.get(t)||void 0,s=l&&typeof l=="string"?JSON.parse(l):void 0,c=s?s[r]:void 0;return n==="id"&&c?JSON.parse(c).id:n==="label"&&c?JSON.parse(c).label:n==="value"&&c?JSON.parse(c).value:c},qr=(r,t,o)=>{const n=t.get(o||"filter")||void 0,l=n&&typeof n=="string"?JSON.parse(n):void 0;return l?l[r]:void 0},bn=({name:r,filterKey:t="filter",searchParams:o})=>{const n=o.get(t||"filter")||void 0,l=n&&typeof n=="string"?JSON.parse(n):void 0,s=l?l[r]:void 0;return{start:s?JSON.parse(s).from:void 0,end:s?JSON.parse(s).to:void 0}},No=({name:r,filterKey:t="filter",searchParams:o})=>{const n=o.get(t||"filter")||void 0,l=n&&typeof n=="string"?JSON.parse(n):void 0,s=l?l[r]:void 0;return s?JSON.parse(s):void 0},vn=(r,{filterKey:t="filter",perPageKey:o="perPage",pageKey:n="page"})=>{const l=r.get(t)||void 0,s=r.get(o)||void 0,c=r.get(n)||void 0;return!!l||!!s||!!c},_o=({isOpen:r,onClose:t,filterKey:o,pageKey:n,filters:l})=>{const{searchParams:s,setSearchParams:c,searchQueries:i}=Ne(),[a,h]=d.useState({}),y=()=>{s.delete(o||"filter"),c(s)},b=(p,C)=>{switch(p.type){case"radio":{const{show:E=!0}=p;return E&&e.jsx(f.Box,{direction:"column",children:e.jsx(f.Box,{direction:"column",children:p.title})},C)}case"dropdown":{const{show:E=!0}=p;return E&&e.jsx(f.Box,{direction:"column",children:e.jsx(f.Box,{direction:"column",children:p.title})},C)}case"date-range":return e.jsx(f.Box,{direction:"column",children:e.jsx(f.Box,{direction:"column",children:p.title})},C);case"date":return e.jsx(f.Box,{direction:"column",children:e.jsx(f.Box,{direction:"column",children:p.title})},C);case"dropdown-multiple":{const{show:E=!0}=p;return E&&e.jsx(f.Box,{direction:"column",children:e.jsx(f.Box,{direction:"column",children:p.title})},C)}default:return null}};return e.jsx(Wo,{onHide:t,show:r||!1,children:e.jsxs(f.Box,{direction:"column",gap:"md",children:[e.jsxs(ie.Flex,{direction:"row",justify:"space-between",align:"center",children:[e.jsx(f.Box,{direction:"column",children:"Filter"}),e.jsx(f.Box,{direction:"column",style:{cursor:"pointer"},onClick:y,children:"Reset"})]}),l==null?void 0:l.map((p,C)=>b(p,C))]})})},qo=({searchKey:r="q",statusKey:t="status",searchPlaceholder:o="Search",searchHighlightPlaceholder:n,extendedFilter:l,showSearchFilter:s=!0,showStatusFilter:c=!0,filterKey:i="filter",pageKey:a="page",customWidthSearch:h,handleOnReset:y,filterConfigs:b,buttonToggleProps:p,position:C="right",titleSearchLabel:E="Work Order",withTitleLabels:w=!1})=>{const F=(p==null?void 0:p.isShowLabel)??!0,[I,B]=d.useState(!1),[k,H]=d.useState(0),W=()=>{H(N=>N+1)},{searchParams:S,setSearchParams:z,getQueryParam:O}=Ne(),Y=vr.searchParamsToObject(S.toString()),X=qr(r,S,i)||"",[q,Z]=d.useState(X),K=O(i),_=!!(K&&!(()=>{if(K)try{const N=JSON.parse(K);return Object.keys(N).length===1&&N[r]===""}catch(N){console.error("Filter parameter is not a valid JSON:",N)}return!1})()),V=De.useMediaQuery("md");return d.useEffect(()=>{Z(X)},[X]),d.useEffect(()=>{if(q===X)return;const N=window.setTimeout(()=>{Fr({value:q,name:r,type:"search",searchQueries:Y,setSearchParams:z,filterKey:i,pageKey:a})},350);return()=>{window.clearTimeout(N)}},[q,X,r,Y,z,i,a]),e.jsxs(ie.Flex,{gap:"md",style:{flexDirection:V&&C==="left"?"row":V&&C==="right"?"row-reverse":"column"},align:"flex-end",children:[_&&e.jsx(f.Box,{direction:"column",justify:"flex-end",children:e.jsx(j.Button,{onClick:()=>{const N=new URLSearchParams(S);N.delete(i),z(N),Z(""),W(),y&&y()},variant:"outline",tone:"neutral",children:e.jsx(D.Text,{color:"error",fontWeight:"semibold",children:"Reset"})})}),l==null?void 0:l.map(({minWidth:N,content:se,title:ve,onClickContainer:Ee},ue)=>e.jsxs(f.Box,{direction:"column",gap:"sm",onClick:Ee,style:{minWidth:N},children:[ve&&e.jsx(Ke.SubH3,{children:ve}),se]},`extended-filter-${ue}-${k}`)),!!(b!=null&&b.length)&&e.jsx(j.Button,{primary:_,secondary:!_,iconLeft:e.jsx(M.Icon,{size:"sm",name:(p==null?void 0:p.icon)||"FilterHorizontal",style:{color:K?"var(--sa-background-brand, #04254f)":"var(--sa-text-primary, #292a2e)"}}),fullWidth:!V,onClick:()=>B(!0),children:F?"Filter":void 0}),c&&e.jsxs(f.Box,{direction:"column",gap:"sm",style:{minWidth:"126px"},children:[w&&e.jsx(Ke.SubH3,{children:"Status"}),e.jsx(br.Dropdown,{dropdownLists:[{label:"Active",value:"active"},{label:"InActive",value:"inactive"}],defaultValue:_r({get:"value",name:t,searchParams:S,filterKey:i})?[{label:_r({get:"value",name:t,searchParams:S,filterKey:i})==="active"?"Active":"InActive",value:_r({get:"value",name:t,searchParams:S,filterKey:i})}]:[],onChange:N=>Fr({value:N,name:t,type:"dropdown",searchQueries:Y,setSearchParams:z,filterKey:i}),placeholder:w?"All":"All Status"},k)]}),s&&e.jsxs(f.Box,{direction:"column",gap:"sm",style:{width:h&&V?h:V?"310px":""},children:[w&&e.jsxs(Ke.SubH3,{children:["Search for ",E]}),e.jsx(ar.Input,{placeholder:o,leftIcon:e.jsx(M.Icon,{name:"Search",width:20,height:20}),onChange:N=>Z(N.target.value),value:q,fullWidth:!0},k+1+i)]}),e.jsx(_o,{isOpen:I,onClose:()=>B(!1),filterKey:i,filters:b,pageKey:a})]})},Cn=r=>r==="checkbox-multiple"?"dropdown-multiple":r==="radio"?"dropdown":r==="date-compact"?"date":r;function kt({configs:r,filterKey:t="filter",activeFilterKey:o="filters",pageKey:n="page",searchKey:l="q"}){const{searchParams:s,setSearchParams:c,searchQueries:i}=Ne(),a=d.useMemo(()=>Object.fromEntries(r.map(k=>[k.key,k])),[r]),h=d.useMemo(()=>{const k=(s.get(o)||"").split(",").map(W=>W.trim()).filter(Boolean);let H=[];try{const W=s.get(t);W&&(H=Object.keys(JSON.parse(W)).filter(S=>S!==l))}catch{}return r.map(W=>W.key).filter(W=>{const S=a[W];return(S==null?void 0:S.locked)||k.includes(W)||H.includes(W)})},[s,o,t,l,r,a]),y=d.useCallback(k=>{try{return k[t]?JSON.parse(k[t]):{}}catch{return{}}},[t]),b=d.useCallback(k=>{const H={...i};k.length?H[o]=k.join(","):delete H[o],c(H)},[i,o,c]),p=d.useCallback(k=>{h.includes(k)||b([...h,k])},[h,b]),C=d.useCallback(k=>{var z;if((z=a[k])!=null&&z.locked)return;const H={...i},W=h.filter(O=>O!==k);W.length?H[o]=W.join(","):delete H[o];const S=y(H);k in S&&(delete S[k],Object.keys(S).length?H[t]=JSON.stringify(S):delete H[t]),delete H[n],c(H)},[i,h,o,t,n,y,c,a]),E=d.useCallback(k=>h.includes(k)?C(k):p(k),[h,p,C]),w=d.useCallback(k=>{switch(k.type){case"dropdown":case"dropdown-multiple":case"checkbox-multiple":case"radio":return jo({name:k.key,get:"array",searchParams:s,filterKey:t})||[];case"date":{const H=No({name:k.key,searchParams:s,filterKey:t});return H?new Date(H):void 0}case"date-compact":{const W=y(Object.fromEntries(s.entries()))[k.key];return W&&typeof W=="object"?W:void 0}default:return}},[s,t,y]),L=d.useCallback((k,H)=>{if(k.type==="date-compact"){const W={...i},S=y(W);H==null?delete S[k.key]:S[k.key]=H,Object.keys(S).length?W[t]=JSON.stringify(S):delete W[t],delete W[n],c(W);return}Fr({value:H,name:k.key,type:Cn(k.type),searchQueries:i,setSearchParams:c,filterKey:t,pageKey:n})},[i,c,t,n,y]),F=d.useCallback(k=>{const H={...i},W=y(H);k in W&&(delete W[k],Object.keys(W).length?H[t]=JSON.stringify(W):delete H[t]),delete H[n],c(H)},[i,t,n,y,c]),I=d.useCallback(()=>{const k={...i};delete k[t],delete k[o],delete k[n],c(k)},[i,t,o,n,c]),B=h.length>0;return{activeKeys:h,configByKey:a,hasActiveFilter:B,addFilter:p,removeFilter:C,toggleFilter:E,getValue:w,setValue:L,clearValue:F,clearAll:I}}const Et={get(r){return Er.storage.get(r)??null},set(r,t){Er.storage.save(r,t)},remove(r){Er.storage.delete(r)}},wr={columns:r=>`filterbar:colprefs:${r}`,savedViews:r=>`filterbar:views:${r}`,lastState:r=>`filterbar:last:${r}`,perPage:r=>`filterbar:perpage:${r}`,tableSort:r=>`tablelayout:sort:${r}`},Zr=(r,t)=>{const o=new Set(t.map(s=>s.key)),n=r.order.filter(s=>o.has(s));for(const s of t)n.includes(s.key)||n.push(s.key);const l=r.hidden.filter(s=>o.has(s));return{order:n,hidden:l}};function xn({columns:r,scopeId:t,storage:o,onColumnsChange:n,value:l}){const s=d.useMemo(()=>({order:r.map(S=>S.key),hidden:[]}),[r]),c=t?wr.columns(t):void 0,i=(S,z)=>Zr({order:S.order??z,hidden:S.hidden??[]},r),[a,h]=d.useState(()=>{if(l&&(l.order||l.hidden))return i(l,r.map(S=>S.key));if(c){const S=o.get(c);if(S&&Array.isArray(S.order))return Zr(S,r)}return s}),y=r.map(S=>S.key).join("|");d.useEffect(()=>h(S=>Zr(S,r)),[y]);const b=d.useRef(a);b.current=a;const p=l?`${(l.order??[]).join("|")}~${(l.hidden??[]).join("|")}`:null,C=d.useRef(p);d.useEffect(()=>{if(p==null||C.current===p)return;C.current=p;const S=b.current,z=i(l,S.order);z.order.join("|")===S.order.join("|")&&z.hidden.join("|")===S.hidden.join("|")||(h(z),c&&o.set(c,z))},[p,y]);const E=d.useRef(!1);d.useEffect(()=>{E.current||(E.current=!0,n==null||n(a))},[]);const w=d.useCallback(S=>{h(S),c&&o.set(c,S),n==null||n(S)},[c,o,n]),L=d.useMemo(()=>{const S=new Map(r.map(z=>[z.key,z]));return a.order.filter(z=>S.has(z)).map(z=>({...S.get(z),visible:!a.hidden.includes(z)}))},[a,r]),F=d.useCallback(S=>{const z=a.hidden.includes(S)?a.hidden.filter(O=>O!==S):[...a.hidden,S];w({...a,hidden:z})},[a,w]),I=d.useCallback((S,z)=>{if(S===z)return;const O=[...a.order],[Y]=O.splice(S,1);O.splice(z,0,Y),w({...a,order:O})},[a,w]),B=d.useCallback(S=>{w({...a,hidden:S?r.filter(z=>!z.locked).map(z=>z.key):[]})},[a,r,w]),k=d.useCallback(()=>w(s),[w,s]),H=d.useCallback(S=>w(Zr(S,r)),[w,r]),W=a.hidden.length===0;return{state:a,orderedColumns:L,allVisible:W,toggleVisibility:F,reorder:I,setAllHidden:B,reset:k,applyState:H}}function wn({scopeId:r,storage:t,snapshotKeys:o,pageKey:n="page",getColumns:l,applyColumns:s}){const{searchParams:c,setSearchParams:i}=Ne(),a=r?wr.savedViews(r):void 0,[h,y]=d.useState(()=>a?t.get(a)||[]:[]),b=d.useCallback(w=>{y(w),a&&t.set(a,w)},[a]),p=d.useCallback(w=>{const L=w.trim();if(!L)return;const F={};o.forEach(B=>{const k=c.get(B);k!=null&&(F[B]=k)});const I={id:`${Date.now()}`,name:L,query:F,columns:l==null?void 0:l(),createdAt:Date.now()};b([...h,I])},[o,c,l,b,h]),C=d.useCallback(w=>b(h.filter(L=>L.id!==w)),[b,h]),E=d.useCallback(w=>{const L=Object.fromEntries(c.entries());o.forEach(F=>delete L[F]),Object.assign(L,w.query),delete L[n],i(L),w.columns&&(s==null||s(w.columns))},[c,o,n,i,s]);return{enabled:!!a,views:h,saveView:p,deleteView:C,applyView:E}}function Dn(r,t){let o;try{o=JSON.parse(r)}catch{return r}return!o||typeof o!="object"?r:(delete o[t],Object.keys(o).length>0?JSON.stringify(o):void 0)}function Zo(r,t,o){const n=r[t];if(n==null)return;const l=Dn(n,o);l===void 0?delete r[t]:r[t]=l}function Sn({scopeId:r,storage:t,snapshotKeys:o,enabled:n=!0,filterKey:l="filter",searchKey:s="q",persistSearch:c=!0}){const{searchParams:i}=Ne(),a=r&&n?wr.lastState(r):void 0,h=d.useRef(a),y=d.useRef(!1);d.useEffect(()=>{if(!a){h.current=a;return}if(h.current!==a){h.current=a,y.current=!1;return}const C={};if(o.forEach(E=>{const w=i.get(E);w!=null&&(C[E]=w)}),c||Zo(C,l,s),Object.keys(C).length===0){y.current&&t.remove(a);return}y.current=!0,t.set(a,C)},[i,a,o,t,c,l,s]);const b=d.useCallback(()=>{if(!a)return null;const C=t.get(a);return!C||Object.keys(C).length===0||!c&&(Zo(C,l,s),Object.keys(C).length===0)?null:C},[a,t,c,l,s]),p=d.useCallback(()=>{a&&t.remove(a)},[a,t]);return{enabled:!!a,read:b,clear:p}}function Bn({scopeId:r,storage:t,perPageKey:o,pageSizeOptions:n,enabled:l=!0}){const{searchParams:s}=Ne(),c=r&&l?wr.perPage(r):void 0,i=s.toString(),a=d.useRef(c);d.useEffect(()=>{if(!c){a.current=c;return}if(a.current!==c){a.current=c;return}const b=s.get(o);if(!b)return;const p=Number(b);!Number.isFinite(p)||p<=0||t.set(c,p)},[i,c,o,t]);const h=d.useCallback(()=>{if(!c)return null;const b=t.get(c);if(b==null)return null;const p=Number(b);return!Number.isFinite(p)||p<=0||n&&!n.includes(p)?null:String(p)},[c,t,n]),y=d.useCallback(()=>{c&&t.remove(c)},[c,t]);return{enabled:!!c,read:h,clear:y}}let mt={},Ft=!1,Mt=null;const kn=(r,t)=>{Object.assign(mt,r),Mt=t,!Ft&&(Ft=!0,queueMicrotask(()=>{const o=mt,n=Mt;mt={},Ft=!1,Mt=null,!(!n||Object.keys(o).length===0)&&n(l=>{const s=new URLSearchParams(l);return Object.entries(o).forEach(([c,i])=>s.set(c,i)),s})}))};function En({enabled:r,snapshotKeys:t,perPageKey:o,readSnapshot:n,readPerPage:l}){const{searchParams:s,setSearchParams:c,location:i}=Ne(),a=d.useRef(null);d.useEffect(()=>{if(!r||a.current===i.pathname)return;a.current=i.pathname;const h={};if(!s.has(o)){const y=l();y&&(h[o]=y)}if(!t.some(y=>s.has(y))){const y=n();y&&Object.assign(h,y)}Object.keys(h).length!==0&&kn(h,c)},[i.pathname,r])}const mn=({configs:r,activeKeys:t,onToggle:o,hasActiveFilter:n,onReset:l})=>r.length?e.jsxs(A.Menu,{position:"bottom-left",children:[e.jsx(A.MenuButton,{children:e.jsx(j.Button,{variant:n?"secondary":"outline",tone:"neutral",size:"sm",iconLeft:e.jsx(M.Icon,{name:"FilterHorizontal"}),"aria-label":"Add filter"})}),e.jsx(A.MenuLists,{children:e.jsx(A.MenuBody,{style:{minWidth:260},title:e.jsxs(f.Box,{display:"flex",direction:"row",align:"center",justify:"space-between",fullWidth:!0,children:[e.jsx(D.Text,{fontSize:"sm",fontWeight:"medium",color:"subtlest",children:"Add Filter"}),n&&l&&e.jsx(j.Button,{variant:"link",tone:"brand",size:"xs",onClick:l,children:"Reset"})]}),children:r.map(s=>e.jsx(A.MenuItem,{selected:s.locked||t.includes(s.key),disabled:s.locked,closeOnSelect:!1,startIcon:s.icon??void 0,onClick:()=>{s.locked||o(s.key)},children:s.label},s.key))})})]}):null,Gr=({onClear:r,onRemove:t})=>e.jsxs(A.Menu,{position:"bottom-right",children:[e.jsx(A.MenuButton,{children:e.jsx(j.Button,{variant:"link",tone:"neutral",size:"xs",iconLeft:e.jsx(M.Icon,{name:"MenuHorizontal"}),"aria-label":"Filter actions"})}),e.jsx(A.MenuLists,{children:e.jsxs(A.MenuBody,{style:{width:180},children:[e.jsx(A.MenuItem,{startIcon:e.jsx(M.Icon,{name:"CrossCircle"}),onClick:r,children:"Clear value"}),t&&e.jsx(A.MenuItem,{intent:"danger",startIcon:e.jsx(M.Icon,{name:"Trash1"}),onClick:t,children:"Remove filter"})]})})]}),Fn=r=>{const t=new Date(r);return t.setHours(0,0,0,0),t},Go=(r,t,o)=>{const n=new Date(r);return o==="day"?n.setDate(n.getDate()+t):o==="week"?n.setDate(n.getDate()+t*7):o==="month"?n.setMonth(n.getMonth()+t):n.setFullYear(n.getFullYear()+t),n},Qo=r=>{const t=Fn(new Date);if(r.direction==="this"){const n=new Date(t),l=new Date(t);return r.period==="week"?(n.setDate(t.getDate()-t.getDay()),l.setDate(n.getDate()+6)):r.period==="month"?(n.setDate(1),l.setMonth(l.getMonth()+1,0)):r.period==="year"&&(n.setMonth(0,1),l.setMonth(11,31)),{from:n,to:l}}const o=r.count??1;return r.direction==="past"?{from:Go(t,-o,r.period),to:t}:{from:t,to:Go(t,o,r.period)}},Uo=24,Jo=r=>r.length>Uo?`${r.slice(0,Uo)}...`:r,Yo=r=>r.toLocaleDateString(void 0,{day:"2-digit",month:"short",year:"numeric"}),It=(r,t="days")=>t==="months"?r.toLocaleDateString(void 0,{month:"short",year:"numeric"}):t==="years"?String(r.getFullYear()):Yo(r),Qr={is:"Is","is-before":"Is before","is-after":"Is after","is-on-or-before":"Is on or before","is-on-or-after":"Is on or after","is-between":"Is between","is-relative-to-today":"Is relative to today","is-empty":"Is empty","is-not-empty":"Is not empty"},Mn=["is","is-before","is-after","is-on-or-before","is-on-or-after","is-between","is-relative-to-today","is-empty","is-not-empty"],Tt={past:"Past",next:"Next",this:"This"},In=["day","week","month","year"],Tn=["past","next","this"],Ln=r=>r.field.type==="date-compact"?e.jsx(Wn,{field:r.field,value:r.value,onChange:r.onChange,onClear:r.onClear,onRemove:r.onRemove}):e.jsx(On,{field:r.field,value:r.value,onChange:r.onChange,onClear:r.onClear,onRemove:r.onRemove}),On=({field:r,value:t,onChange:o,onClear:n,onRemove:l})=>{const s=t?Yo(new Date(t)):null,c=!!s,i=c?e.jsxs(e.Fragment,{children:[e.jsxs("span",{style:{fontWeight:500},children:[r.label,":"]})," ",e.jsx("span",{style:{fontWeight:400},children:Jo(s)})]}):r.label;return e.jsxs(A.Menu,{position:"bottom-left",children:[e.jsx(A.MenuButton,{children:e.jsx(j.Button,{variant:c?"secondary":"outline",tone:"neutral",size:"sm",iconLeft:c?e.jsx(M.Icon,{name:"Calendar",size:"sm"}):void 0,iconRight:e.jsx(M.Icon,{name:"ChevronSmallDown"}),children:i})}),e.jsx(A.MenuLists,{children:e.jsx(A.MenuBody,{style:{width:260},title:e.jsxs(f.Box,{display:"flex",direction:"row",align:"center",justify:"space-between",fullWidth:!0,children:[e.jsx(D.Text,{fontSize:"sm",fontWeight:"medium",color:"subtlest",children:r.label}),e.jsx(Gr,{onClear:n,onRemove:l})]}),children:e.jsx(fr.StarasiaDate,{size:"sm",input:!1,clearable:!0,filter:r.mode,value:t,onChange:a=>a==null?n():o(a),withPadding:!1})})})]})},An=(r,t="days")=>{switch(r.op){case"is":case"is-before":case"is-after":case"is-on-or-before":case"is-on-or-after":return r.date?`${Qr[r.op]} ${It(new Date(r.date),t)}`:null;case"is-between":return r.from&&r.to?`${It(new Date(r.from),t)} - ${It(new Date(r.to),t)}`:null;case"is-relative-to-today":{const o=r.relative;if(!o)return null;if(o.direction==="this")return`This ${o.period}`;const n=o.count??1,l=n===1?o.period:`${o.period}s`;return`${Tt[o.direction]} ${n} ${l}`}case"is-empty":case"is-not-empty":return Qr[r.op];default:return null}},Wn=({field:r,value:t,onChange:o,onClear:n,onRemove:l})=>{const s=r.ops&&r.ops.length>0?r.ops:Mn,c=r.defaultOp&&s.includes(r.defaultOp)?r.defaultOp:s[0],i=r.mode??"days",a=(t==null?void 0:t.op)??c,h=t?An(t,i):null,y=!!h,b=y?e.jsxs(e.Fragment,{children:[e.jsxs("span",{style:{fontWeight:500},children:[r.label,":"]})," ",e.jsx("span",{style:{fontWeight:400},children:Jo(h)})]}):r.label,p=C=>{if(C!==a){if(C==="is-empty"||C==="is-not-empty"){o({op:C});return}if(C==="is-relative-to-today"){o({op:C,relative:(t==null?void 0:t.relative)??{direction:"past",count:1,period:"week"}});return}if(C==="is-between"){o({op:C,from:t==null?void 0:t.from,to:t==null?void 0:t.to});return}o({op:C,date:t==null?void 0:t.date})}};return e.jsxs(A.Menu,{position:"bottom-left",children:[e.jsx(A.MenuButton,{children:e.jsx(j.Button,{variant:y?"secondary":"outline",tone:"neutral",size:"sm",iconLeft:y?e.jsx(M.Icon,{name:"Calendar",size:"sm"}):void 0,iconRight:e.jsx(M.Icon,{name:"ChevronSmallDown"}),children:b})}),e.jsxs(A.MenuLists,{children:[e.jsx(A.MenuBody,{style:{width:320},title:e.jsxs(f.Box,{display:"flex",direction:"row",align:"center",justify:"space-between",gap:"xs",fullWidth:!0,children:[e.jsxs(f.Box,{display:"flex",direction:"row",align:"center",gap:"xs",style:{minWidth:0},children:[e.jsx(D.Text,{fontSize:"sm",fontWeight:"medium",color:"subtlest",children:r.label}),e.jsx(zn,{op:a,ops:s,onChange:p})]}),e.jsx(Gr,{onClear:n,onRemove:l})]}),children:e.jsx(Hn,{value:t,op:a,mode:i,onChange:o})}),a==="is-relative-to-today"&&e.jsx(A.MenuFooter,{children:e.jsx(D.Text,{fontSize:"xs",color:"subtlest",children:"Filter will update with the current date"})})]})]})},zn=({op:r,ops:t,onChange:o})=>e.jsxs(A.Menu,{position:"bottom-left",children:[e.jsx(A.MenuButton,{children:e.jsx(j.Button,{variant:"link",tone:"neutral",size:"xs",iconRight:e.jsx(M.Icon,{name:"ChevronSmallDown"}),children:Qr[r]})}),e.jsx(A.MenuLists,{children:e.jsx(A.MenuBody,{style:{width:200},children:t.map(n=>e.jsx(A.MenuItem,{selected:r===n,onClick:()=>o(n),endIcon:r===n?e.jsx(M.Icon,{name:"Check"}):void 0,children:Qr[n]},n))})})]}),Hn=({value:r,op:t,mode:o="days",onChange:n})=>{if(t==="is-empty"||t==="is-not-empty")return e.jsx(f.Box,{paddingBlock:"sm",paddingInline:"sm",children:e.jsx(D.Text,{fontSize:"xs",color:"subtlest",children:"No further input required."})});if(t==="is-between"){const l=r!=null&&r.from||r!=null&&r.to?{from:r!=null&&r.from?new Date(r.from):null,to:r!=null&&r.to?new Date(r.to):null}:void 0;return e.jsx(fr.StarasiaDate,{size:"sm",input:!1,clearable:!0,rangedDate:!0,filter:o,value:l,onChange:s=>{if(s==null){n({op:t});return}if(typeof s=="object"&&s!==null&&"from"in s&&"to"in s){let{from:c,to:i}=s;if(!c&&i&&(c=i,i=null),!c&&!i){n({op:t});return}n({op:t,from:c?c.toISOString():void 0,to:i?i.toISOString():void 0})}},withPadding:!1},`range-${o}`)}return t==="is-relative-to-today"?e.jsx(Pn,{value:r==null?void 0:r.relative,onChange:l=>n({op:t,relative:l})}):e.jsx(fr.StarasiaDate,{size:"sm",input:!1,clearable:!0,filter:o,value:r!=null&&r.date?new Date(r.date):void 0,onChange:l=>{if(l==null){n({op:t});return}l instanceof Date&&n({op:t,date:l.toISOString()})},withPadding:!1},`single-${o}`)},Pn=({value:r,onChange:t})=>{const o=(r==null?void 0:r.direction)??"past",n=(r==null?void 0:r.count)??1,l=(r==null?void 0:r.period)??"week",s=o!=="this",c=Qo({direction:o,count:n,period:l});return e.jsxs(f.Box,{direction:"column",display:"flex",gap:"sm",children:[e.jsxs(f.Box,{direction:"row",display:"flex",align:"center",gap:"xs",children:[e.jsxs(A.Menu,{position:"bottom-left",children:[e.jsx(A.MenuButton,{children:e.jsx(j.Button,{variant:"outline",tone:"neutral",size:"sm",iconRight:e.jsx(M.Icon,{name:"ChevronSmallDown"}),children:Tt[o]})}),e.jsx(A.MenuLists,{children:e.jsx(A.MenuBody,{style:{width:140},children:Tn.map(i=>e.jsx(A.MenuItem,{selected:o===i,endIcon:o===i?e.jsx(M.Icon,{name:"Check"}):void 0,onClick:()=>t(i==="this"?{direction:i,period:l}:{direction:i,count:n,period:l}),children:Tt[i]},i))})})]}),s&&e.jsx(ar.Input,{type:"number",size:"sm",min:1,clearable:!1,value:n,onChange:i=>{const a=Number(i.target.value);t({direction:o,count:Number.isFinite(a)&&a>0?a:1,period:l})},style:{width:72}}),e.jsxs(A.Menu,{position:"bottom-left",children:[e.jsx(A.MenuButton,{children:e.jsx(j.Button,{variant:"outline",tone:"neutral",size:"sm",iconRight:e.jsx(M.Icon,{name:"ChevronSmallDown"}),children:l})}),e.jsx(A.MenuLists,{children:e.jsx(A.MenuBody,{style:{width:140},children:In.map(i=>e.jsx(A.MenuItem,{selected:l===i,endIcon:l===i?e.jsx(M.Icon,{name:"Check"}):void 0,onClick:()=>t(o==="this"?{direction:o,period:i}:{direction:o,count:n,period:i}),children:i},i))})})]})]}),e.jsx(fr.StarasiaDate,{size:"sm",input:!1,disabled:!0,rangedDate:!0,value:c,onChange:()=>{},withPadding:!1},"relative-preview")]})},Xo=18,Vn=r=>r.length>Xo?`${r.slice(0,Xo)}...`:r,jn=({field:r,value:t,onChange:o,onClear:n,onRemove:l})=>{const s=r.type==="dropdown-multiple",c=t.length,i=r.searchable!==!1,[a,h]=d.useState(""),y=r.options,b=typeof r.onSearch=="function",p=(()=>{if(b)return y;const F=a.trim().toLowerCase();return F?y.filter(I=>I.label.toLowerCase().includes(F)):y})(),C=F=>t.some(I=>I.value===F.value),E=F=>{if(!s){o([{label:F.label,value:F.value}]),h("");return}o(C(F)?t.filter(I=>I.value!==F.value):[...t,{label:F.label,value:F.value}])},w=F=>{var I;h(F),(I=r.onSearch)==null||I.call(r,F)},L=c===0?r.label:e.jsxs(e.Fragment,{children:[e.jsxs("span",{style:{fontWeight:500},children:[r.label,":"]})," ",e.jsx("span",{style:{fontWeight:400},children:c===1?Vn(t[0].label):`${c} Selected`})]});return e.jsxs(A.Menu,{position:"bottom-left",children:[e.jsx(A.MenuButton,{children:e.jsx(j.Button,{variant:c>0?"secondary":"outline",tone:"neutral",size:"sm",iconLeft:c>0?e.jsx(M.Icon,{name:"Tag",size:"sm"}):void 0,iconRight:e.jsx(M.Icon,{name:"ChevronSmallDown"}),children:L})}),e.jsx(A.MenuLists,{children:e.jsx(A.MenuBody,{style:{width:260},title:e.jsxs(f.Box,{display:"flex",direction:"row",align:"center",justify:"space-between",fullWidth:!0,children:[e.jsx(D.Text,{fontSize:"sm",fontWeight:"medium",color:"subtlest",children:r.label}),e.jsx(Gr,{onClear:n,onRemove:l})]}),children:e.jsxs(f.Box,{direction:"column",gap:"sm",children:[i&&e.jsx(br.Dropdown,{size:"sm",triggerInput:!0,fullWidth:!0,hideChevronIcon:!0,clearable:!0,multiSelect:s,searchAble:!0,searchValue:a,onSearch:w,value:t,onChange:o,placeholder:`Search ${r.label.toLowerCase()}…`}),e.jsx(f.Box,{direction:"column",overflow:"overflow-y-auto",customMaxHeight:"240px",children:r.isLoading?e.jsx(f.Box,{paddingBlock:"sm",paddingInline:"sm",children:e.jsx(D.Text,{fontSize:"xs",color:"subtlest",children:"Loading…"})}):p.length===0?e.jsx(f.Box,{paddingBlock:"sm",paddingInline:"sm",children:e.jsx(D.Text,{fontSize:"xs",color:"subtlest",children:"No results"})}):p.map(F=>e.jsx(A.MenuItem,{closeOnSelect:!s,selected:C(F),startIcon:F.avatar,endIcon:C(F)?e.jsx(M.Icon,{name:"Check"}):void 0,description:F.description,onClick:()=>E(F),children:F.label},F.value))})]})})})]})},$o=18,Nn=r=>r.length>$o?`${r.slice(0,$o)}...`:r,Ko=({checked:r,indeterminate:t})=>e.jsx("span",{style:{pointerEvents:"none",display:"inline-flex"},children:e.jsx(tr.Checkbox,{size:"sm",checked:r,readOnly:!0,onChange:()=>{},variant:t?"indeterminate":"select"})}),_n=({field:r,value:t,onChange:o,onClear:n,onRemove:l})=>{const s=new Set(t.map(p=>p.value)),c=t.length,i=r.options.length>0&&r.options.every(p=>s.has(p.value)),a=c>0&&!i,h=p=>{o(s.has(p.value)?t.filter(C=>C.value!==p.value):[...t,{label:p.label,value:p.value}])},y=()=>{o(i?[]:r.options.map(p=>({label:p.label,value:p.value})))},b=c===0?r.label:e.jsxs(e.Fragment,{children:[e.jsxs(D.Text,{as:"span",fontWeight:"semibold",children:[r.label,":"]})," ",e.jsx(D.Text,{as:"span",children:c===1?Nn(t[0].label):`${c} Selected`})]});return e.jsxs(A.Menu,{position:"bottom-left",children:[e.jsx(A.MenuButton,{children:e.jsx(j.Button,{variant:c>0?"secondary":"outline",tone:"neutral",size:"sm",iconLeft:c>0?e.jsx(M.Icon,{name:"Tag",size:"sm"}):void 0,iconRight:e.jsx(M.Icon,{name:"ChevronSmallDown"}),children:b})}),e.jsx(A.MenuLists,{children:e.jsxs(A.MenuBody,{style:{width:240},title:e.jsxs(f.Box,{display:"flex",direction:"row",align:"center",justify:"space-between",fullWidth:!0,children:[e.jsx(D.Text,{fontSize:"sm",fontWeight:"medium",color:"subtlest",children:r.label}),e.jsx(Gr,{onClear:n,onRemove:l})]}),children:[e.jsx(A.MenuItem,{closeOnSelect:!1,selected:i,onClick:y,startIcon:e.jsx(Ko,{checked:i||a,indeterminate:a}),children:"Select All"}),r.options.map(p=>e.jsx(A.MenuItem,{closeOnSelect:!1,selected:s.has(p.value),onClick:()=>h(p),startIcon:e.jsx(Ko,{checked:s.has(p.value)}),children:p.label},p.value))]})})]})},Ro=({activeKeys:r,configByKey:t,getValue:o,setValue:n,clearValue:l,removeFilter:s})=>e.jsx(e.Fragment,{children:r.map(c=>{const i=t[c];if(!i)return null;const a=o(i),h=i.locked?void 0:()=>s(c);return i.type==="date"||i.type==="date-compact"?e.jsx(Ln,{field:i,value:a,onChange:y=>n(i,y),onClear:()=>l(c),onRemove:h},c):i.type==="checkbox-multiple"?e.jsx(_n,{field:i,value:a||[],onChange:y=>n(i,y),onClear:()=>l(c),onRemove:h},c):e.jsx(jn,{field:i,value:a||[],onChange:y=>n(i,y),onClear:()=>l(c),onRemove:h},c)})}),el=r=>`${r} Rows`,qn=({pagination:r,pageKey:t="page",perPageKey:o="perPage",pageSizeOptions:n=[10,25,50,100],defaultPerPage:l=10,showResultCount:s=!0,showPageSize:c=!0,showPagination:i=!0})=>{var F;const{searchQueries:a,setSearchParams:h,searchParams:y}=Ne(),b=y.get(o),p=b?Number(b):l,C=I=>{h({...a,[t]:String(I)})},E=I=>{h({...a,[o]:I,[t]:"1"})},w=(r==null?void 0:r.rangeStart)??(((r==null?void 0:r.currentPage)||0)>1?(((r==null?void 0:r.currentPage)||0)-1)*((r==null?void 0:r.perPage)||0)+1:0),L=(r==null?void 0:r.rangeEnd)??((r==null?void 0:r.totalCurrentPage)!==(r==null?void 0:r.perPage)?r==null?void 0:r.totalData:((r==null?void 0:r.currentPage)||1)*((r==null?void 0:r.totalCurrentPage)||0));return e.jsxs(e.Fragment,{children:[s&&e.jsx(D.Text,{fontSize:"sm",fontWeight:"medium",color:"primary",truncate:!0,children:`${w}-${L} of ${((F=r==null?void 0:r.totalData)==null?void 0:F.toLocaleString())||0}`}),c&&e.jsxs(A.Menu,{position:"bottom-left",children:[e.jsx(A.MenuButton,{children:e.jsx(j.Button,{variant:"outline",tone:"neutral",size:"sm",iconRight:e.jsx(M.Icon,{name:"ChevronSmallDown"}),"aria-label":"Rows per page",children:el(p)})}),e.jsx(A.MenuLists,{children:e.jsx(A.MenuBody,{children:n.map(I=>e.jsx(A.MenuItem,{selected:I===p,onClick:()=>E(String(I)),children:el(I)},I))})})]}),i&&((r==null?void 0:r.totalPage)??0)>1&&e.jsx(f.Box,{direction:"column",display:"flex",align:"center",gap:"sm",paddingRight:"sm",style:{borderRight:"1px solid var(--sa-border-subtle, rgba(11, 18, 14, 0.14))"},children:e.jsx(kr.Pagination,{size:"sm",variant:"neutral",siblingCount:0,currentPage:r!=null&&r.currentPage?Number(r.currentPage):1,totalPages:Number(r==null?void 0:r.totalPage),onPageChange:C})})]})};function Zn(r,t,o=!0){d.useEffect(()=>{if(!o)return;const n=l=>{var i;if(l.metaKey||l.ctrlKey||l.altKey||l.key!==r||je.isOverlayOpen())return;const s=l.target,c=(i=s==null?void 0:s.tagName)==null?void 0:i.toLowerCase();c==="input"||c==="textarea"||s!=null&&s.isContentEditable||(l.preventDefault(),t())};return window.addEventListener("keydown",n),()=>window.removeEventListener("keydown",n)},[r,t,o])}const Gn=240,rl=({searchKey:r="q",filterKey:t="filter",pageKey:o="page",placeholder:n="Search",shortcut:l="/",collapsible:s=!0})=>{const{searchParams:c,setSearchParams:i,searchQueries:a}=Ne(),h=qr(r,c,t)||"",[y,b]=d.useState(!s||!!h),[p,C]=d.useState(s&&!h),[E,w]=d.useState(h),L=De.useDebounce(E,350),F=d.useRef(null);d.useEffect(()=>{w(h),h&&b(!0)},[h]),d.useEffect(()=>{y&&C(!1)},[y]),d.useEffect(()=>{L!==h&&Fr({value:L,name:r,type:"search",searchQueries:a,setSearchParams:i,filterKey:t,pageKey:o})},[L]);const I=d.useCallback(()=>{b(!0),requestAnimationFrame(()=>{var W;return(W=F.current)==null?void 0:W.focus()})},[]);Zn(l,I);const B=()=>{s&&!E&&b(!1)},k=W=>{var S;s&&W.key==="Escape"&&!E&&(b(!1),(S=F.current)==null||S.blur())},H=()=>{y||C(!0)};return e.jsxs(f.Box,{display:"flex",direction:"row",align:"center",gap:"spacing-0",children:[p&&e.jsx(j.Button,{variant:"outline",tone:"neutral",size:"sm",iconLeft:e.jsx(M.Icon,{name:"Search",size:"sm"}),"aria-label":"Search","aria-expanded":!1,onClick:I}),e.jsxs(f.Box,{onTransitionEnd:H,style:{position:"relative",width:y?Gn:0,overflow:"hidden",transition:"width 220ms ease"},children:[e.jsx(ar.Input,{ref:F,size:"sm",fullWidth:!0,value:E,placeholder:n,leftIcon:e.jsx(M.Icon,{name:"Search",width:16,height:16}),onChange:W=>w(W.target.value),onKeyDown:k,onBlur:B,tabIndex:y?0:-1}),y&&!E&&e.jsx(f.Box,{align:"center",justify:"center",borderColor:"border-subtle",borderWidth:"border",borderStyle:"border-solid",borderRadius:"rounded-xs",paddingInline:"spacing-1",customBackgroundColor:"var(--sa-background-surface-hover, #f1f2f4)",style:{position:"absolute",right:8,top:"50%",transform:"translateY(-50%)",pointerEvents:"none",minWidth:18,height:18,display:"inline-flex"},children:e.jsx(D.Text,{fontSize:"xs",color:"subtle",children:l})})]})]})},tl=({columns:r,allVisible:t,onToggle:o,onReorder:n,onSetAllHidden:l})=>{const[s,c]=d.useState(null),[i,a]=d.useState(null),h=()=>{s!==null&&i!==null&&s!==i&&n(s,i),c(null),a(null)},y=(b,p)=>{const C=b+p;C<0||C>=r.length||n(b,C)};return e.jsxs(A.Menu,{position:"bottom-right",children:[e.jsx(A.MenuButton,{children:e.jsx(j.Button,{variant:t?"outline":"secondary",tone:"neutral",size:"sm",iconLeft:e.jsx(M.Icon,{name:"Grid",size:"sm"}),"aria-label":"Customize columns"})}),e.jsx(A.MenuLists,{children:e.jsx(A.MenuBody,{children:e.jsxs(f.Box,{padding:"sm",direction:"column",customWidth:"296px",customMaxHeight:"60vh",overflow:"overflow-hidden",children:[e.jsx(D.Text,{fontWeight:"semibold",color:"primary",children:"Customize Column Table"}),e.jsxs(f.Box,{direction:"row",display:"flex",align:"center",justify:"space-between",paddingBlock:"md",children:[e.jsx(D.Text,{fontSize:"sm",fontWeight:"medium",color:"subtle",children:"Show in table"}),e.jsx(j.Button,{variant:"link",tone:"info",size:"xs",onClick:()=>l(t),children:t?"Hide All":"Show All"})]}),e.jsx(f.Box,{direction:"column",overflow:"overflow-y-auto",children:r.map((b,p)=>{const C=!b.locked,E=i===p&&s!==null&&s!==p;return e.jsxs(f.Box,{direction:"row",display:"flex",align:"center",gap:"sm",paddingBlock:"xs",draggable:C,onDragStart:()=>C&&c(p),onDragOver:w=>{w.preventDefault(),a(p)},onDrop:h,onDragEnd:h,style:{minHeight:32,boxShadow:E?"inset 0 2px 0 0 var(--sa-background-brand, #04254f)":void 0},children:[e.jsx(f.Box,{direction:"column",as:"div",align:"center",justify:"center",role:"button",tabIndex:C?0:-1,"aria-label":`Reorder ${b.title}`,"aria-disabled":!C||void 0,color:"icon-subtlest",onKeyDown:w=>{C&&(w.key==="ArrowUp"?(w.preventDefault(),y(p,-1)):w.key==="ArrowDown"&&(w.preventDefault(),y(p,1)))},style:{display:"inline-flex",cursor:C?"grab":"default",opacity:C?1:.4},children:e.jsx(M.Icon,{name:"DragVertical",width:16,height:16})}),b.icon&&e.jsx(f.Box,{direction:"column",align:"center",color:"icon-subtle",style:{display:"inline-flex"},children:b.icon}),e.jsx(D.Text,{fontSize:"sm",fontWeight:"medium",color:"primary",truncate:!0,children:b.title}),e.jsx(f.Box,{direction:"column",style:{marginLeft:"auto"},children:e.jsx(xr.Toggle,{size:"sm",checked:b.visible,disabled:b.locked,onChange:()=>o(b.key),"aria-label":`Toggle ${b.title} column`})})]},b.key)})})]})})})]})},ol=({views:r,onApply:t,onDelete:o,onSave:n})=>{const[l,s]=d.useState(""),c=()=>{const i=l.trim();i&&(n(i),s(""))};return e.jsxs(A.Menu,{position:"bottom-right",children:[e.jsx(A.MenuButton,{children:e.jsx(j.Button,{variant:r.length>0?"secondary":"outline",tone:(r.length>0,"neutral"),size:"sm",iconLeft:e.jsx(M.Icon,{name:"Bookmark",size:"sm"}),"aria-label":"Saved views"})}),e.jsxs(A.MenuLists,{style:{width:"260px"},children:[e.jsx(A.MenuBody,{children:e.jsxs(f.Box,{direction:"column",padding:"xs",gap:"sm",children:[e.jsx(D.Text,{fontWeight:"semibold",color:"primary",children:"Saved Views"}),e.jsx(f.Box,{direction:"column",overflow:"overflow-y-auto",children:r.length===0?e.jsx(f.Box,{direction:"column",paddingBlock:"sm",children:e.jsx(D.Text,{fontSize:"sm",color:"subtlest",children:"No saved views yet"})}):r.map(i=>e.jsx(A.MenuItem,{startIcon:e.jsx(M.Icon,{name:"Bookmark"}),onClick:()=>t(i),endIcon:e.jsx(j.Button,{variant:"link",tone:"error",size:"sm",iconLeft:e.jsx(M.Icon,{name:"Trash2"}),"aria-label":`Delete ${i.name}`,onClick:a=>{a.stopPropagation(),o(i.id)}}),children:i.name},i.id))})]})}),e.jsx(A.MenuFooter,{children:e.jsxs(f.Box,{direction:"row",gap:"xs",children:[e.jsx(f.Box,{direction:"column",style:{flex:"1 0 0",minWidth:0},children:e.jsx(ar.Input,{size:"sm",fullWidth:!0,placeholder:"Save current view as…",value:l,onChange:i=>s(i.target.value),onKeyDown:i=>{i.key==="Enter"&&c()}})}),e.jsx(j.Button,{variant:"primary",tone:"brand",size:"sm",disabled:!l.trim(),onClick:c,children:"Save"})]})})]})]})},Qn=({isOpen:r,onClose:t,configs:o,activeKeys:n,configByKey:l,hasActiveFilter:s,onToggle:c,onReset:i,getValue:a,setValue:h,clearValue:y,removeFilter:b})=>{const p=n.length;return e.jsx(Hr.Drawer,{position:"bottom",isShow:r,onHide:t,children:e.jsxs(f.Box,{direction:"column",customMaxHeight:"85vh",style:{minHeight:280},children:[e.jsxs(f.Box,{direction:"row",display:"flex",align:"center",justify:"space-between",paddingInline:"md",paddingBlock:"sm",style:{borderBottom:"1px solid var(--sa-border-subtle, rgba(11, 18, 14, 0.14))"},children:[e.jsxs(f.Box,{direction:"row",display:"flex",align:"center",gap:"xs",children:[e.jsx(D.Text,{fontWeight:"semibold",color:"primary",children:"Filter"}),p>0&&e.jsxs(D.Text,{fontSize:"sm",color:"subtle",children:["(",p,")"]})]}),e.jsx(j.Button,{variant:"link",tone:"neutral",size:"sm",iconLeft:e.jsx(M.Icon,{name:"Cross"}),"aria-label":"Close filter",onClick:t})]}),e.jsxs(f.Box,{direction:"column",gap:"lg",padding:"md",overflow:"overflow-y-auto",style:{flex:"1 1 auto",minHeight:0},children:[p>0&&e.jsxs(f.Box,{direction:"column",gap:"sm",children:[e.jsx(D.Text,{fontSize:"xs",fontWeight:"medium",color:"subtlest",children:"Filter aktif"}),e.jsx(f.Box,{direction:"row",display:"flex",wrap:"wrap",gap:"sm",align:"center",children:e.jsx(Ro,{activeKeys:n,configByKey:l,getValue:a,setValue:h,clearValue:y,removeFilter:b})})]}),o.length>0&&e.jsxs(f.Box,{direction:"column",gap:"sm",children:[e.jsx(D.Text,{fontSize:"xs",fontWeight:"medium",color:"subtlest",children:"Tambah filter"}),e.jsx(f.Box,{direction:"column",children:o.map(C=>{const E=n.includes(C.key),w=!!C.locked;return e.jsxs(f.Box,{direction:"row",display:"flex",align:"center",justify:"space-between",gap:"sm",paddingBlock:"sm",style:{opacity:w?.5:1,borderTop:"1px solid var(--sa-border-subtle, rgba(11, 18, 14, 0.08))"},children:[e.jsxs(f.Box,{direction:"row",display:"flex",align:"center",gap:"sm",style:{minWidth:0},children:[C.icon&&e.jsx(f.Box,{direction:"column",align:"center",color:"icon-subtle",style:{display:"inline-flex"},children:C.icon}),e.jsx(D.Text,{fontSize:"sm",color:"primary",truncate:!0,children:C.label})]}),e.jsx(xr.Toggle,{size:"sm",checked:E||w,disabled:w,onChange:()=>c(C.key),"aria-label":`Toggle ${C.label}`})]},C.key)})})]})]}),e.jsxs(f.Box,{direction:"row",display:"flex",gap:"sm",paddingInline:"md",paddingBlock:"sm",style:{borderTop:"1px solid var(--sa-border-subtle, rgba(11, 18, 14, 0.14))"},children:[e.jsx(f.Box,{direction:"column",style:{flex:"1 1 0"},children:e.jsx(j.Button,{variant:"outline",tone:"neutral",size:"md",fullWidth:!0,disabled:!s,onClick:i,children:"Reset"})}),e.jsx(f.Box,{direction:"column",style:{flex:"1 1 0"},children:e.jsx(j.Button,{variant:"primary",tone:"brand",size:"md",fullWidth:!0,onClick:t,children:"Selesai"})})]})]})})},Un=r=>`${r} Rows`,Jn=({perPageKey:r,pageKey:t,pageSizeOptions:o,defaultPerPage:n=10,showPageSize:l})=>{const{searchQueries:s,setSearchParams:c,searchParams:i}=Ne(),a=i.get(r),h=a?Number(a):n,y=b=>{c({...s,[r]:b,[t]:"1"})};return l?e.jsxs(A.Menu,{position:"bottom-right",children:[e.jsx(A.MenuButton,{children:e.jsx(j.Button,{variant:"outline",tone:"neutral",size:"sm",iconLeft:e.jsx(M.Icon,{name:"MenuVertical",size:"sm"}),"aria-label":"More options"})}),e.jsx(A.MenuLists,{children:e.jsxs(A.MenuBody,{style:{minWidth:200},children:[e.jsx(f.Box,{paddingInline:"sm",paddingBlock:"xs",children:e.jsx(D.Text,{fontSize:"xs",fontWeight:"medium",color:"subtlest",children:"Rows per page"})}),o.map(b=>e.jsx(A.MenuItem,{selected:b===h,endIcon:b===h?e.jsx(M.Icon,{name:"Check"}):void 0,onClick:()=>y(String(b)),children:Un(b)},b))]})})]}):null},Yn=r=>{var We;const{withPadding:t,configs:o,activeKeys:n,configByKey:l,hasActiveFilter:s,toggleFilter:c,removeFilter:i,getValue:a,setValue:h,clearValue:y,onReset:b,searchable:p,searchKey:C,filterKey:E,pageKey:w,searchPlaceholder:L,searchShortcut:F,searchCollapsible:I,pagination:B,perPageKey:k,pageSizeOptions:H,defaultPerPage:W,showPagination:S,showResultCount:z,showPageSize:O,hasColumns:Y,orderedColumns:X,allVisible:q,onToggleVisibility:Z,onReorder:K,onSetAllHidden:te,showSavedViews:_,savedViews:V,onApplyView:N,onDeleteView:se,onSaveView:ve,leadingActions:Ee}=r,[ue,Ce]=d.useState(!1),{searchQueries:xe,setSearchParams:we}=Ne(),Ae=(B==null?void 0:B.rangeStart)??(((B==null?void 0:B.currentPage)||0)>1?(((B==null?void 0:B.currentPage)||0)-1)*((B==null?void 0:B.perPage)||0)+1:1),Fe=(B==null?void 0:B.rangeEnd)??((B==null?void 0:B.totalCurrentPage)!==(B==null?void 0:B.perPage)?B==null?void 0:B.totalData:((B==null?void 0:B.currentPage)||1)*((B==null?void 0:B.totalCurrentPage)||0)),_e=Ze=>{we({...xe,[w]:String(Ze)})},$=z||S&&!!(B!=null&&B.totalPage),ge=()=>{b(),Ce(!1)};return e.jsxs(f.Box,{direction:"column",gap:"sm",fullWidth:!0,paddingTop:t?"sm":void 0,paddingBottom:t?"sm":void 0,paddingLeft:t?"md":void 0,paddingRight:t?"md":void 0,role:"toolbar","aria-label":"Filter bar",children:[e.jsxs(f.Box,{direction:"row",display:"flex",align:"center",wrap:"wrap",gap:"sm",fullWidth:!0,overflow:"overflow-auto",children:[p&&e.jsx(rl,{searchKey:C,filterKey:E,pageKey:w,placeholder:L,shortcut:F,collapsible:I}),e.jsx(j.Button,{variant:s?"secondary":"outline",tone:"neutral",size:"sm",iconLeft:e.jsx(M.Icon,{name:"FilterHorizontal"}),onClick:()=>Ce(!0),"aria-label":"Open filters",children:s?`Filter: ${n.length}`:null}),e.jsxs(f.Box,{direction:"row",display:"flex",align:"center",gap:"sm",style:{marginLeft:"auto"},children:[Ee,_&&e.jsx(ol,{views:V,onApply:N,onDelete:se,onSave:ve}),Y&&e.jsx(tl,{columns:X,allVisible:q,onToggle:Z,onReorder:K,onSetAllHidden:te}),e.jsx(Jn,{perPageKey:k,pageKey:w,pageSizeOptions:H,defaultPerPage:W,showPageSize:O})]})]}),$&&e.jsxs(f.Box,{direction:"row",display:"flex",align:"center",justify:"space-between",gap:"sm",fullWidth:!0,children:[z?e.jsx(D.Text,{fontSize:"sm",fontWeight:"medium",color:"primary",truncate:!0,children:`${Ae}-${Fe} of ${((We=B==null?void 0:B.totalData)==null?void 0:We.toLocaleString())||0}`}):e.jsx(f.Box,{direction:"column"}),S&&!!(B!=null&&B.totalPage)&&e.jsx(kr.Pagination,{size:"xs",variant:"neutral",siblingCount:0,currentPage:B!=null&&B.currentPage?Number(B.currentPage):1,totalPages:Number(B.totalPage),onPageChange:_e})]}),e.jsx(Qn,{isOpen:ue,onClose:()=>Ce(!1),configs:o,activeKeys:n,configByKey:l,hasActiveFilter:s,onToggle:c,onReset:ge,getValue:a,setValue:h,clearValue:y,removeFilter:i})]})},Xn=({withPadding:r=!1,filterConfigs:t=[],filterKey:o="filter",activeFilterKey:n="filters",pageKey:l="page",perPageKey:s="perPage",pageSizeOptions:c=[25,50,100],defaultPerPage:i,showPagination:a=!0,showResultCount:h=!0,showPageSize:y=!0,searchable:b=!1,searchKey:p="q",searchPlaceholder:C="Search",searchShortcut:E="/",searchPosition:w="right",searchCollapsible:L=!0,pagination:F,columns:I=[],onColumnsChange:B,columnsState:k,scopeId:H,savedViews:W,persistLastState:S=!0,persistSearch:z=!0,storage:O=Et,onReset:Y,leadingActions:X})=>{const q=H??(W==null?void 0:W.scopeId),{activeKeys:Z,configByKey:K,hasActiveFilter:te,toggleFilter:_,removeFilter:V,getValue:N,setValue:se,clearValue:ve,clearAll:Ee}=kt({configs:t,filterKey:o,activeFilterKey:n,pageKey:l,searchKey:p}),ue=xn({columns:I,scopeId:q,storage:O,onColumnsChange:B,value:k}),Ce=wn({scopeId:q,storage:O,snapshotKeys:[n,o,s],pageKey:l,getColumns:()=>ue.state,applyColumns:ue.applyState}),xe=Sn({scopeId:q,storage:O,snapshotKeys:[n,o,l],enabled:S,filterKey:o,searchKey:p,persistSearch:z}),we=Bn({scopeId:q,storage:O,perPageKey:s,pageSizeOptions:c,enabled:S});En({enabled:S&&!!q,snapshotKeys:[n,o,l],perPageKey:s,readSnapshot:xe.read,readPerPage:we.read});const Ae=i??c[0]??25,Fe=!!(W!=null&&W.enabled)&&Ce.enabled,_e=()=>{Ee(),xe.clear(),Y==null||Y()},$=De.useMediaQuery("md"),ge=b?e.jsx(rl,{searchKey:p,filterKey:o,pageKey:l,placeholder:C,shortcut:E,collapsible:L}):null;return $?e.jsxs(f.Box,{display:"flex",direction:"row",align:"center",gap:"sm",wrap:"wrap",fullWidth:!0,paddingTop:r?"sm":void 0,paddingBottom:r?"sm":void 0,paddingLeft:r?"md":void 0,paddingRight:r?"md":void 0,role:"toolbar","aria-label":"Filter bar",children:[e.jsxs(f.Box,{direction:"row",display:"flex",align:"center",gap:"sm",style:{flex:"1 1 0",minWidth:0},children:[e.jsx(mn,{configs:t,activeKeys:Z,onToggle:_,hasActiveFilter:te,onReset:_e}),w==="left"&&ge,e.jsxs(f.Box,{direction:"row",display:"flex",align:"center",gap:"sm",overflow:"overflow-x-auto",style:{flex:"1 1 0",minWidth:0},children:[e.jsx(Ro,{activeKeys:Z,configByKey:K,getValue:N,setValue:se,clearValue:ve,removeFilter:V}),te&&e.jsx(j.Button,{variant:"link",tone:"brand",size:"sm",onClick:_e,children:"Reset"})]})]}),e.jsxs(f.Box,{direction:"row",display:"flex",align:"center",gap:"sm",children:[X,e.jsx(qn,{pagination:F,pageKey:l,perPageKey:s,pageSizeOptions:c,defaultPerPage:Ae,showPagination:a,showResultCount:h,showPageSize:y}),w==="right"&&ge,Fe&&e.jsx(ol,{views:Ce.views,onApply:Ce.applyView,onDelete:Ce.deleteView,onSave:Ce.saveView}),I.length>0&&e.jsx(tl,{columns:ue.orderedColumns,allVisible:ue.allVisible,onToggle:ue.toggleVisibility,onReorder:ue.reorder,onSetAllHidden:ue.setAllHidden})]})]}):e.jsx(Yn,{withPadding:r,configs:t,activeKeys:Z,configByKey:K,hasActiveFilter:te,toggleFilter:_,removeFilter:V,getValue:N,setValue:se,clearValue:ve,onReset:_e,searchable:b,searchKey:p,filterKey:o,pageKey:l,searchPlaceholder:C,searchShortcut:E,searchCollapsible:L,pagination:F,perPageKey:s,pageSizeOptions:c,defaultPerPage:Ae,showPagination:a,showResultCount:h,showPageSize:y,hasColumns:I.length>0,orderedColumns:ue.orderedColumns,allVisible:ue.allVisible,onToggleVisibility:ue.toggleVisibility,onReorder:ue.reorder,onSetAllHidden:ue.setAllHidden,showSavedViews:Fe,savedViews:Ce.views,onApplyView:Ce.applyView,onDeleteView:Ce.deleteView,onSaveView:Ce.saveView,leadingActions:X})},$n=r=>{if(!Array.isArray(r)||r.length===0)return;const t=r[0];return(t==null?void 0:t.value)!=null?String(t.value):void 0},Kn=r=>{if(!Array.isArray(r)||r.length===0)return;const t=r.map(o=>(o==null?void 0:o.value)!=null?String(o.value):null).filter(o=>o!=null);return t.length?t:void 0},Rn=(r,t)=>{switch(r.type){case"dropdown":case"radio":return $n(t);case"dropdown-multiple":case"checkbox-multiple":return Kn(t);case"date":return t instanceof Date?t.toISOString():void 0;case"date-compact":return t;default:return}},ll=(r,t)=>{if(r==null||r==="")return t;const o=Number(r);return Number.isFinite(o)&&o>0?o:t},es=r=>{const{filterConfigs:t,filterKey:o="filter",activeFilterKey:n="filters",pageKey:l="page",perPageKey:s="perPage",searchKey:c="q",defaultPage:i=1,defaultPerPage:a=10,paramKeys:h,serialize:y}=r,{activeKeys:b,configByKey:p,hasActiveFilter:C,getValue:E}=kt({configs:t,filterKey:o,activeFilterKey:n,pageKey:l,searchKey:c}),{searchParams:w}=Ne(),L=w.toString();return d.useMemo(()=>{const I={},B={},k=ll(w.get(l),i),H=ll(w.get(s),a);I[(h==null?void 0:h.page)??"page"]=k,I[(h==null?void 0:h.perPage)??"perPage"]=H;const W=qr(c,w,o)||"";W&&(I[(h==null?void 0:h.search)??"search"]=W);let S=!1;for(const z of b){const O=p[z];if(!O)continue;const Y=E(O);B[z]=Y;const X=y==null?void 0:y[z],q=X?X(Y):Rn(O,Y);if(q==null||Array.isArray(q)&&q.length===0)continue;const Z=(h==null?void 0:h[z])??z;I[Z]=q,S=!0}return{params:I,raw:B,hasActiveFilter:C||!!W||S}},[L,b.join("|"),o,n,l,s,c,i,a,h,y,p])},rs=["dropdown","dropdown-multiple","checkbox-multiple","radio"],ts=({filterConfigs:r,filterKey:t,activeFilterKey:o,pageKey:n,searchKey:l})=>{const{configByKey:s,getValue:c,setValue:i,removeFilter:a,clearAll:h,hasActiveFilter:y}=kt({configs:r,filterKey:t,activeFilterKey:o,pageKey:n,searchKey:l}),b=(F,I)=>{var k;const B=F.options;return((k=B==null?void 0:B.find(H=>H.value===I))==null?void 0:k.label)??I},p=d.useCallback(F=>{const I=s[F];if(!I)return[];const B=c(I);return Array.isArray(B)?B.map(k=>String(k.value)):[]},[s,c]),C=d.useCallback((F,I)=>{const B=s[F];if(!B||!rs.includes(B.type))return;const k=Array.isArray(I)?I:[I];if(k.length===0){a(F);return}i(B,k.map(H=>({label:b(B,H),value:H})))},[s,i,a]),E=d.useCallback((F,I)=>{const B=p(F);C(F,B.includes(I)?B.filter(k=>k!==I):[...B,I])},[p,C]),w=d.useCallback((F,I)=>p(F).includes(I),[p]),L=d.useCallback(F=>a(F),[a]);return{set:C,toggle:E,clear:L,clearAll:h,isActive:w,values:p,hasActiveFilter:y}},os=(r,t)=>{if(!r)return{};const{fromKey:o,toKey:n,opKey:l}=t,s={};switch(r.op){case"is":case"is-before":case"is-after":case"is-on-or-before":case"is-on-or-after":return r.date&&(s[o]=new Date(r.date).toISOString()),l&&(s[l]=r.op),s;case"is-between":return r.from&&(s[o]=new Date(r.from).toISOString()),r.to&&(s[n]=new Date(r.to).toISOString()),s;case"is-relative-to-today":{if(!r.relative)return s;const{from:c,to:i}=Qo(r.relative);return s[o]=c.toISOString(),s[n]=i.toISOString(),s}case"is-empty":case"is-not-empty":return l&&(s[l]=r.op==="is-empty"?"empty":"not-empty"),s;default:return s}},nl=({children:r,borderRadius:t,height:o})=>{const n=d.useRef(null),[l,s]=d.useState("100vh");return d.useEffect(()=>{if(o)return;const c=()=>{if(n.current){const i=n.current.getBoundingClientRect().top;s(`calc(100vh - ${i}px)`)}};return c(),window.addEventListener("resize",c),()=>window.removeEventListener("resize",c)},[o]),e.jsx(f.Box,{ref:n,fullWidth:!0,borderStyle:"border-solid",borderWidth:"border",borderColor:"border-base",borderRadius:t||"rounded-xs",style:{height:o??l,display:"flex",flexDirection:"column"},children:r})},sl=({action:r,rightContent:t,leftContent:o,headerSlot:n,advanceFilter:l,showFilter:s=!0})=>{const c=De.useMediaQuery("md"),i=s?e.jsx(qo,{...l}):null,a=()=>r?d.isValidElement(r)?r:e.jsx(f.Box,{style:{display:"flex",flexDirection:c?"row":"column",gap:"8px",width:c?"auto":"100%",textWrap:"nowrap"},children:r.map(({title:h,icon:y,buttonProps:b,onClick:p},C)=>!h&&!y?null:e.jsx(j.Button,{fullWidth:!c,iconLeft:y?e.jsx(M.Icon,{name:y}):void 0,onClick:p,...b,children:h},`action-${C}`))}):null;return e.jsx(f.Box,{style:{display:"flex",width:"100%",justifyContent:"space-between",alignItems:"center",paddingLeft:"8px",paddingRight:"8px",paddingTop:"8px",paddingBottom:"8px",borderBottom:"1px solid var(--sa-border-subtle, #0b120e24)",flexShrink:0,position:"relative",zIndex:10,flexDirection:c?"row":"column-reverse",gap:"16px"},children:n?n({filter:i}):e.jsxs(e.Fragment,{children:[e.jsxs(f.Box,{style:{display:"flex",gap:"8px",flexDirection:"row",alignItems:"center",flex:1,minWidth:0},children:[i,o]}),e.jsxs(f.Box,{style:{display:"flex",gap:"8px",flexDirection:"row",alignItems:"center",flexShrink:0},children:[t,a()]})]})})},ls=({totalData:r,withMarginBottom:t=!0,withMarginTop:o=!0})=>e.jsxs(f.Box,{style:{display:"flex",gap:"4px",flexDirection:"row",alignItems:"center",marginBottom:t?"16px":void 0,marginTop:o?"16px":void 0},children:[e.jsxs(Ke.Body1,{props:{color:"gray-500"},children:["Total data:"," "]}),e.jsx(Ke.Body1,{children:r||0})]}),cl=({pagination:r,pageKey:t="page",perPageKey:o="perPage",defaultPerPage:n=10,showPagination:l=!0,totalData:s})=>{const{searchQueries:c,setSearchParams:i,searchParams:a}=Ne(),h=a.get(o),y=E=>{i({...c,[t]:String(E)})},b=E=>{i({...c,[o]:E,[t]:"1"})},p=(r==null?void 0:r.rangeStart)??(((r==null?void 0:r.currentPage)||0)>1?(((r==null?void 0:r.currentPage)||0)-1)*((r==null?void 0:r.perPage)||0)+1:1),C=(r==null?void 0:r.rangeEnd)??((r==null?void 0:r.totalCurrentPage)!==(r==null?void 0:r.perPage)?r==null?void 0:r.totalData:((r==null?void 0:r.currentPage)||1)*((r==null?void 0:r.totalCurrentPage)||0));return e.jsx(f.Box,{style:{display:"flex",width:"100%",flexDirection:"row",justifyContent:"space-between",alignItems:"center",paddingLeft:"16px",paddingRight:"16px",paddingTop:"8px",paddingBottom:"8px",borderTop:"1px solid var(--sa-border-subtle, #0b120e24)",flexShrink:0},children:l?e.jsxs(e.Fragment,{children:[e.jsxs(f.Box,{style:{display:"flex",flexDirection:"row",gap:"8px",alignItems:"center",textWrap:"nowrap"},children:[e.jsx(D.Text,{children:"Rows Per Page: "}),e.jsx(br.Dropdown,{dropdownLists:[{label:"5",value:"5"},{label:"10",value:"10"},{label:"25",value:"25"},{label:"50",value:"50"},{label:"100",value:"100"}],onChange:E=>{b(E[0].value)},value:h?[{label:`${h} per row`,value:h}]:[{label:`${n} per row`,value:`${n}`}],defaultValue:h?[{label:`${h} per row`,value:h}]:[{label:`${n} per row`,value:`${n}`}]}),e.jsx(D.Text,{children:`${p}-${C} of ${(r==null?void 0:r.totalData)||0}`})]}),e.jsx(kr.Pagination,{currentPage:r!=null&&r.currentPage?Number(r==null?void 0:r.currentPage):1,totalPages:r!=null&&r.totalPage?Number(r==null?void 0:r.totalPage):1,onPageChange:y})]}):e.jsx(ls,{totalData:s,withMarginBottom:!1,withMarginTop:!1})})},il=({filter:r,columnTitle:t})=>{const[o,n]=d.useState(!1),l=d.useRef(null),s=d.useRef(null),c=d.useRef(null),[i,a]=d.useState(""),[h,y]=d.useState({top:0,left:0}),b=r.selectedValues,p=d.useMemo(()=>i?r.options.filter(w=>w.label.toLowerCase().includes(i.toLowerCase())):r.options,[r.options,i]);d.useEffect(()=>{if(o&&s.current){const w=s.current.getBoundingClientRect(),L=280,F={top:w.bottom+8};r.position==="left"||w.left+L>window.innerWidth?F.right=window.innerWidth-w.right:F.left=w.left,y(F)}},[o,r.position]),d.useEffect(()=>{o&&c.current?setTimeout(()=>{var w;return(w=c.current)==null?void 0:w.focus()},50):a("")},[o]),d.useEffect(()=>{const w=L=>{l.current&&!l.current.contains(L.target)&&s.current&&!s.current.contains(L.target)&&n(!1)};return o&&document.addEventListener("mousedown",w),()=>document.removeEventListener("mousedown",w)},[o]);const C=w=>{const L=b.includes(w)?b.filter(F=>F!==w):[...b,w];r.onFilterChange(L)},E=()=>r.onFilterChange([]);return e.jsxs(f.Box,{direction:"column",style:{position:"relative"},children:[e.jsx(f.Box,{ref:s,style:{display:"flex",flexDirection:"row",alignItems:"center",cursor:"pointer"},onClick:w=>{var L;w.stopPropagation(),o||(L=r.onOpen)==null||L.call(r),n(F=>!F)},children:e.jsx(M.Icon,{name:o?"ChevronUp":"ChevronDown",size:"sm",style:{color:b.length>0?"var(--sa-color-brand-500, #1a4fa0)":"var(--sa-text-subtle, #8c8f97)"}})}),o&&e.jsxs(f.Box,{ref:l,style:{position:"fixed",top:`${h.top}px`,...h.left!==void 0?{left:`${h.left}px`}:{right:`${h.right}px`},backgroundColor:"white",borderRadius:"4px",minWidth:"280px",maxHeight:"400px",display:"flex",flexDirection:"column",zIndex:9999,animation:"fadeInDropdown 0.15s ease-out",border:"1px solid var(--sa-border-subtle, #0b120e24)"},children:[e.jsxs(f.Box,{style:{display:"flex",flexDirection:"row",justifyContent:"space-between",alignItems:"center",paddingTop:"12px",paddingBottom:"12px",paddingLeft:"16px",paddingRight:"16px",borderBottom:"1px solid var(--sa-border-subtle, #0b120e24)"},children:[e.jsxs(D.Text,{fontSize:"sm",fontWeight:"semibold",color:"gray-700",children:["Filter ",t]}),b.length>0&&e.jsx(f.Box,{direction:"column",style:{cursor:"pointer"},children:e.jsx(D.Text,{fontSize:"xs",color:"primary",fontWeight:"semibold",onClick:w=>{w.stopPropagation(),E()},children:"CLEAR"})})]}),!r.hideSearch&&e.jsx(f.Box,{direction:"column",style:{paddingLeft:"16px",paddingRight:"16px",paddingTop:"8px",paddingBottom:"8px"},children:e.jsx(ar.Input,{ref:c,placeholder:`Search ${t.toLowerCase()}...`,leftIcon:e.jsx(M.Icon,{name:"Search",size:"sm"}),value:i,onChange:w=>a(w.target.value),style:{fontSize:"14px"}})}),e.jsx(f.Box,{direction:"column",className:"ts-filter-dropdown-options",style:{overflowY:"auto",maxHeight:"250px",paddingLeft:"8px",paddingRight:"8px"},children:r.isLoadingOptions?e.jsxs(f.Box,{style:{paddingTop:"40px",paddingBottom:"40px",display:"flex",alignItems:"center",justifyContent:"center",flexDirection:"column"},children:[e.jsx(M.Icon,{name:"Loading",size:"lg",style:{color:"var(--sa-background-brand, #04254f)",animation:"spin 1s linear infinite"}}),e.jsx(D.Text,{fontSize:"sm",color:"gray-500",style:{textAlign:"center",marginTop:"8px"},children:"Loading options..."})]}):p.length>0?e.jsx(f.Box,{direction:"column",style:{gap:"2px",paddingTop:"4px",paddingBottom:"4px"},children:p.map(w=>e.jsxs(f.Box,{style:{display:"flex",flexDirection:"row",alignItems:"center",gap:"8px",paddingTop:"8px",paddingBottom:"8px",paddingLeft:"8px",paddingRight:"8px",cursor:"pointer",borderRadius:"8px",transition:"all 0.2s ease",backgroundColor:b.includes(w.value)?"var(--sa-color-brand-50, #e6edf6)":"transparent"},onClick:L=>{L.stopPropagation(),C(w.value)},onMouseEnter:L=>{b.includes(w.value)||(L.currentTarget.style.backgroundColor="var(--sa-background-primary, #ffffff)"),L.currentTarget.style.transform="translateX(2px)"},onMouseLeave:L=>{L.currentTarget.style.backgroundColor=b.includes(w.value)?"var(--sa-color-brand-50, #e6edf6)":"transparent",L.currentTarget.style.transform="translateX(0)"},children:[e.jsx(tr.Checkbox,{checked:b.includes(w.value),onChange:()=>{}}),e.jsx(D.Text,{fontSize:"sm",fontWeight:b.includes(w.value)?"medium":"normal",color:b.includes(w.value)?"primary":"gray-700",children:w.label})]},w.value))}):e.jsxs(f.Box,{style:{paddingTop:"40px",paddingBottom:"40px",display:"flex",alignItems:"center",justifyContent:"center",flexDirection:"column"},children:[e.jsx(M.Icon,{name:"Search",size:"lg",style:{color:"var(--sa-text-subtle, #8c8f97)"}}),e.jsx(D.Text,{fontSize:"sm",color:"gray-500",style:{textAlign:"center",marginTop:"8px"},children:"No results found"})]})}),b.length>0&&e.jsx(f.Box,{direction:"column",style:{paddingTop:"8px",paddingBottom:"8px",paddingLeft:"16px",paddingRight:"16px",borderTop:"1px solid var(--sa-border-subtle, #0b120e24)",backgroundColor:"var(--sa-color-brand-50, #e6edf6)",marginTop:"auto"},children:e.jsxs(f.Box,{style:{display:"flex",flexDirection:"row",alignItems:"center",gap:"4px"},children:[e.jsx(f.Box,{direction:"column",style:{backgroundColor:"var(--sa-background-brand, #04254f)",borderRadius:"12px",padding:"2px 8px",fontSize:"11px",fontWeight:600,color:"white"},children:b.length}),e.jsxs(D.Text,{fontSize:"xs",color:"primary",fontWeight:"medium",children:["item",b.length>1?"s":""," selected"]})]})})]})]})},ns=({direction:r})=>{const t="var(--sa-text-primary, #292a2e)",o="var(--sa-text-subtle, #8c8f97)",n=r==="asc"?t:o,l=r==="desc"?t:o,s=r==="asc"?1:.45,c=r==="desc"?1:.45;return e.jsxs("span",{style:{display:"inline-flex",flexDirection:"column",alignItems:"center",justifyContent:"center",flexShrink:0,lineHeight:0},"aria-hidden":!0,children:[e.jsx("svg",{width:"8",height:"5",viewBox:"0 0 8 5",style:{color:n,opacity:s,marginBottom:1},children:e.jsx("path",{d:"M4 0 L8 5 L0 5 Z",fill:"currentColor"})}),e.jsx("svg",{width:"8",height:"5",viewBox:"0 0 8 5",style:{color:l,opacity:c},children:e.jsx("path",{d:"M0 0 L8 0 L4 5 Z",fill:"currentColor"})})]})},ss=({frozen:r})=>e.jsxs("svg",{width:"11",height:"11",viewBox:"0 0 24 24",fill:r?"currentColor":"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("rect",{x:"3",y:"11",width:"18",height:"11",rx:"2",ry:"2"}),e.jsx("path",{d:r?"M7 11V7a5 5 0 0 1 10 0v4":"M7 11V7a5 5 0 0 1 9.9-1"})]}),Lt="var(--sa-background-primary, #ffffff)",al="var(--sa-background-primary-inverse, #f8f8f8)",dl=({columns:r,records:t,handleDetail:o,handleUpdate:n,handleDelete:l,isLoading:s,visibleHandleDelete:c,visibleHandleUpdate:i,visibleHandleDetail:a,showHeadBorder:h=!1,scrollParentRef:y,frozenCount:b=0,onFrozenCountChange:p,customActions:C,actionsOrder:E=["detail","update","delete","custom"],customEmptyState:w,enableColumnResize:L=!1,defaultColumnWidths:F,onColumnWidthsChange:I,defaultMinColumnWidth:B=60,sort:k,defaultSort:H,onSortChange:W,showActionDivider:S=!1})=>{const z=k!==void 0,[O,Y]=d.useState(H??null),X=z?k??null:O,q=P=>{if(P.sortKey)return P.sortKey;if(typeof P.accessor=="string")return P.accessor},Z=P=>{const R=q(P);if(!R)return;let J;!X||X.key!==R?J={key:R,direction:"asc"}:X.direction==="asc"?J={key:R,direction:"desc"}:J=null,z||Y(J),W==null||W(J)},te=[o,n,l].filter(P=>P!==void 0).length,_=!!C,V=!!o||!!n||!!l||_,N="var(--sa-border-subtle, #0b120e24)",se=`1px solid ${N}`,ve=`inset 1px 0 0 ${N}`,Ee=`inset -1px 0 0 ${N}`,ue=te===3?_?"178px":"140px":te===2?_?"140px":"102px":te===1?_?"112px":"74px":_?"74px":"",Ce=(P,R)=>{if(!R)return P;if(typeof R=="function")return R(P);if(typeof R=="string")return P[R]},[xe,we]=d.useState(!1);d.useEffect(()=>{if(!(y!=null&&y.current))return;const P=y.current;we(P.scrollHeight>P.clientHeight)},[t,y]);const Ae=d.useRef(null),[Fe,_e]=d.useState([]),[$,ge]=d.useState(()=>F??{}),We=d.useRef(null);d.useLayoutEffect(()=>{if(!b||!Ae.current){_e([]);return}const P=Array.from(Ae.current.querySelectorAll("thead tr th")),R=[];let J=0;P.forEach((he,ce)=>{R[ce]=J,ce<b&&(J+=he.offsetWidth)}),_e(R)},[b,r,t,$]);const Ze=P=>{p&&p(P<b?P:P+1)},de=(P,R)=>{const J=$[P];if(J!==void 0){const he=`${J}px`;return{width:he,minWidth:he,maxWidth:he}}return R?{width:R}:{}},Ge=P=>L&&(P.resizable??!0),lr=(P,R)=>{P.preventDefault(),P.stopPropagation();const J=P.currentTarget.closest("th");if(!J)return;const he=Math.round(J.getBoundingClientRect().width);We.current={colIndex:R,startX:P.clientX,startWidth:he};const ce=document.body.style.userSelect,Me=document.body.style.cursor;document.body.style.userSelect="none",document.body.style.cursor="col-resize";const ze=Qe=>{var Ue;const Le=We.current;if(!Le)return;const Je=((Ue=r[Le.colIndex])==null?void 0:Ue.minWidth)??B,Be=Math.max(Je,Le.startWidth+(Qe.clientX-Le.startX));ge(nr=>nr[Le.colIndex]===Be?nr:{...nr,[Le.colIndex]:Be})},er=()=>{document.removeEventListener("mousemove",ze),document.removeEventListener("mouseup",er),document.body.style.userSelect=ce,document.body.style.cursor=Me,We.current=null,I&&ge(Qe=>(I(Qe),Qe))};document.addEventListener("mousemove",ze),document.addEventListener("mouseup",er)};return e.jsx("div",{ref:Ae,children:e.jsxs(U.Table,{fullWidth:!0,children:[e.jsx(U.Thead,{style:{height:"40px",whiteSpace:"nowrap"},children:e.jsxs(U.Tr,{children:[r.map((P,R)=>{var gr,dr;const J=b>0&&R<b,he=Fe[R]??0,ce=Ge(P),ze=R===r.length-1&&V&&S,er=q(P),Qe=!!P.sortable&&!!er,Le=Qe&&(X==null?void 0:X.key)===er?X.direction:null,Je=P.title||((gr=P.accessor)==null?void 0:gr.toString())||"",Be=(dr=P.headerTooltip)!=null&&dr.showIcon?e.jsx(M.Icon,{name:"InfoCircle",size:"xs",style:{flexShrink:0,color:"var(--sa-icon-subtle, #8c8f97)",opacity:.75}}):null,Ue=e.jsx("span",{style:{flex:1,minWidth:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:Je}),nr=Qe?e.jsxs("button",{type:"button",onClick:()=>Z(P),title:Le==="asc"?"Sorted ascending — click to sort descending":Le==="desc"?"Sorted descending — click to clear":"Click to sort ascending",style:{flex:1,minWidth:0,display:"flex",alignItems:"center",gap:4,background:"none",border:"none",padding:0,margin:0,font:"inherit",color:"inherit",cursor:"pointer",textAlign:P.textAlign==="text-right"?"right":P.textAlign==="text-center"?"center":"left"},children:[Ue,Be,e.jsx(ns,{direction:Le})]}):e.jsxs("span",{style:{flex:1,minWidth:0,display:"flex",alignItems:"center",gap:4},children:[Ue,Be]});return e.jsxs(U.Th,{style:{position:"sticky",top:0,left:J?he:void 0,zIndex:J?4:2,paddingLeft:R===0?"12px":"",borderRight:h&&!ze&&!J?se:void 0,borderBottom:h?se:void 0,boxShadow:h&&J?Ee:void 0,backgroundColor:"var(--sa-background-primary-inverse, #f8f8f8)",textAlign:P.textAlign==="text-right"?"right":P.textAlign==="text-center"?"center":"left",...de(R,P.width)},children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"4px",justifyContent:"space-between",minWidth:0},children:[P.headerTooltip?e.jsx(me.Tooltip,{label:P.headerTooltip.content,position:"bottom",children:nr}):nr,P.filter&&e.jsx(il,{filter:P.filter,columnTitle:P.title}),p&&e.jsx("button",{onClick:()=>Ze(R),title:J?"Unfreeze column":"Freeze column",style:{background:"none",border:"none",cursor:"pointer",padding:"2px",display:"flex",alignItems:"center",flexShrink:0,color:J?"var(--sa-background-brand, #04254f)":"var(--sa-text-subtle, #8c8f97)",opacity:J?1:.45,transition:"opacity 0.15s"},children:e.jsx(ss,{frozen:J})})]}),ce&&e.jsx("div",{onMouseDown:hr=>lr(hr,R),onClick:hr=>hr.stopPropagation(),role:"separator","aria-orientation":"vertical",title:"Drag to resize",style:{position:"absolute",top:0,right:-3,width:6,height:"100%",cursor:"col-resize",userSelect:"none",zIndex:5,touchAction:"none"}})]},`table-head-${R}`)}),V?e.jsx(U.Th,{style:{backgroundColor:"var(--sa-background-primary-inverse, #f8f8f8)",position:"sticky",top:0,right:0,zIndex:3,borderBottom:h?se:void 0,boxShadow:h&&S?ve:void 0}}):null]})}),e.jsx(U.Tbody,{children:s?e.jsx(U.Tr,{children:e.jsx(U.Td,{colSpan:r.length+1,children:e.jsxs(f.Box,{direction:"column",style:{gap:"16px"},children:[e.jsx($e.Skeleton,{variant:"list"}),e.jsx($e.Skeleton,{variant:"list"}),e.jsx($e.Skeleton,{variant:"list"}),e.jsx($e.Skeleton,{variant:"list"}),e.jsx($e.Skeleton,{variant:"list"})]})})}):!(t!=null&&t.length)&&w?e.jsx(U.Tr,{children:e.jsx(U.Td,{colSpan:r.length+1,children:w})}):t==null?void 0:t.map((P,R)=>e.jsxs(U.Tr,{style:{transition:"background-color 0.3s ease",padding:0,borderBottom:R===t.length-1&&xe?void 0:"1px solid var(--sa-border-subtle, #0b120e24)"},onMouseEnter:J=>{const he=J.currentTarget;he.style.backgroundColor=al,Array.from(he.querySelectorAll("td")).forEach(ce=>{ce.style.position==="sticky"&&(ce.style.backgroundColor=al)})},onMouseLeave:J=>{const he=J.currentTarget;he.style.backgroundColor="",Array.from(he.querySelectorAll("td")).forEach(ce=>{ce.style.position==="sticky"&&(ce.style.backgroundColor=Lt)})},children:[r.map((J,he)=>{const ce=J.render?J.render(P,R,t):Ce(P,J.accessor),Me=b>0&&he<b,ze=Fe[he]??0,er=$[he]!==void 0,Qe=Me&&he===b-1;return e.jsx(U.Td,{style:{position:Me?"sticky":void 0,left:Me?ze:void 0,zIndex:Me?1:void 0,backgroundColor:Me?Lt:void 0,transition:Me?"background-color 0.3s ease":void 0,paddingLeft:he===0?"12px":"",whiteSpace:"nowrap",overflow:er?"hidden":void 0,borderLeft:J.showBorderLeft?se:void 0,borderRight:J.showBorderRight?se:void 0,boxShadow:Qe?Ee:void 0,textAlign:J.textAlign==="text-right"?"right":J.textAlign==="text-center"?"center":"left",...de(he,J.width)},children:typeof ce=="string"?e.jsx(D.Text,{style:{whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",textAlign:J.textAlign==="text-right"?"right":J.textAlign==="text-center"?"center":"left"},children:ce}):ce},`row-${R}-col-${he}`)}),V?e.jsx(U.Td,{style:{width:ue,position:"sticky",right:0,zIndex:1,backgroundColor:Lt,boxShadow:S?ve:void 0,transition:"background-color 0.3s ease"},children:e.jsx(ie.Flex,{direction:"row",align:"center",justify:"center",gap:"sm",children:E.map(J=>{const he=R===t.length-1?"top":"bottom";return J==="detail"&&o&&(a==null?void 0:a(P))!==!1?e.jsx(me.Tooltip,{label:"Detail",position:he,children:e.jsx(j.Button,{size:"xs",variant:"outline",tone:"neutral",onClick:()=>o(P.id,P),iconLeft:e.jsx(M.Icon,{name:"DocumentClean",size:"sm",style:{color:"var(--sa-text-subtle, #8c8f97)"}})})},"detail"):J==="update"&&n&&(i==null?void 0:i(P))!==!1?e.jsx(me.Tooltip,{label:"Update",position:he,children:e.jsx(j.Button,{size:"xs",variant:"outline",tone:"neutral",onClick:()=>n(P),iconLeft:e.jsx(M.Icon,{name:"Edit1",size:"sm",style:{color:"var(--sa-text-subtle, #8c8f97)"}})})},"update"):J==="delete"&&l&&(c==null?void 0:c(P))!==!1?e.jsx(me.Tooltip,{label:"Delete",position:he,children:e.jsx(j.Button,{size:"xs",variant:"outline",tone:"neutral",onClick:()=>l(P.id,P),iconLeft:e.jsx(M.Icon,{name:"Trash1",size:"sm",style:{color:"var(--sa-color-error-600, #c9184a)"}})})},"delete"):J==="custom"?e.jsx(d.Fragment,{children:C==null?void 0:C(P)},"custom"):null})})}):null]},`${P}${R}`))})]})})};let hl=!1;const cs=({wrapperProps:r,dataTableProps:t,headerProps:o,footerProps:n})=>{var b;process.env.NODE_ENV!=="production"&&!hl&&(hl=!0,console.warn("[@starasia/admin] `TableSection` deprecated — pakai `<FilterBar>` + `<TableLayout>`. Lihat skill `starasia-list-page-pattern`. Akan dihapus di @starasia/admin@13.0.0."));const l=d.useRef(null),[s,c]=d.useState((t==null?void 0:t.defaultFrozenCount)??0),i=(o==null?void 0:o.show)??!0,a=d.useRef(null),h=(b=t==null?void 0:t.pagination)==null?void 0:b.totalData;typeof h=="number"&&(a.current=h);const y=(n==null?void 0:n.showFooter)??(h===void 0?a.current!==0:h!==0);return e.jsxs(nl,{...r,children:[i&&e.jsx(sl,{...o}),e.jsx(f.Box,{direction:"column",ref:l,style:{flex:1,overflowY:"auto",overflowX:"auto"},children:t?e.jsx(dl,{...t,scrollParentRef:l,frozenCount:t!=null&&t.enableFreezeColumns?s:0,onFrozenCountChange:t!=null&&t.enableFreezeColumns?c:void 0}):null}),y&&e.jsx(cl,{pagination:t==null?void 0:t.pagination,pageKey:t==null?void 0:t.pageKey,perPageKey:t==null?void 0:t.perPageKey,defaultPerPage:t==null?void 0:t.defaultPerPage,showPagination:t==null?void 0:t.showPagination,totalData:n==null?void 0:n.totalData})]})};function is(r){return d.memo(r)}const as=is(cs),fl=200,Ot="1px solid var(--sa-border-subtle, #0b120e24)",ds=({sortDir:r,frozen:t})=>r==="asc"?e.jsx(M.Icon,{name:"ChevronSmallUp"}):r==="desc"?e.jsx(M.Icon,{name:"ChevronSmallDown"}):t?e.jsx(M.Icon,{name:"LockOn",size:"xs"}):e.jsx(M.Icon,{name:"Filter",size:"xs"}),Ur=({icon:r,label:t,active:o,danger:n,onClick:l})=>{const s=n?"var(--sa-text-error, #a4133c)":"var(--sa-text-primary, #292a2e)";return e.jsxs("button",{type:"button",onClick:l,style:{display:"flex",alignItems:"center",gap:12,width:"100%",padding:"8px 12px",background:o?"var(--sa-background-brand-subtlest, #e6edf6)":"none",border:"none",cursor:"pointer",font:"inherit",color:s,textAlign:"left"},onMouseEnter:c=>{o||(c.currentTarget.style.background="var(--sa-background-primary-inverse, #f8f8f8)")},onMouseLeave:c=>{c.currentTarget.style.background=o?"var(--sa-background-brand-subtlest, #e6edf6)":"none"},children:[e.jsx(M.Icon,{name:r,size:"sm",style:{color:s,flexShrink:0}}),e.jsx(D.Text,{as:"span",style:{color:s},children:t})]})},ul=({active:r,canSort:t,canHide:o,sortDir:n,frozen:l,onSort:s,onClearSort:c,onToggleFreeze:i,onHide:a})=>{const[h,y]=d.useState(!1),b=d.useRef(null),p=d.useRef(null),[C,E]=d.useState({top:0,left:0});d.useEffect(()=>{if(h&&b.current){const L=b.current.getBoundingClientRect(),F=L.left+fl>window.innerWidth;E({top:L.bottom+6,...F?{right:window.innerWidth-L.right}:{left:L.left}})}},[h]),d.useEffect(()=>{if(!h)return;const L=F=>{p.current&&!p.current.contains(F.target)&&b.current&&!b.current.contains(F.target)&&y(!1)};return document.addEventListener("mousedown",L),()=>document.removeEventListener("mousedown",L)},[h]);const w=L=>{L(),y(!1)};return e.jsxs(e.Fragment,{children:[e.jsx("button",{ref:b,type:"button",className:"sa-tl-menu-trigger","data-active":r||h?"true":"false",onClick:L=>{L.stopPropagation(),y(F=>!F)},title:"Column options",style:{display:"inline-flex",alignItems:"center",justifyContent:"center",width:22,height:22,borderRadius:"var(--sa-radii-sm, 6px)",border:Ot,background:"var(--sa-background-primary, #ffffff)",cursor:"pointer",color:"var(--sa-text-subtle, #8c8f97)",flexShrink:0},children:e.jsx(ds,{sortDir:n,frozen:l})}),h&&e.jsxs(f.Box,{ref:p,onClick:L=>L.stopPropagation(),style:{position:"fixed",top:`${C.top}px`,...C.left!==void 0?{left:`${C.left}px`}:{right:`${C.right}px`},minWidth:fl,backgroundColor:"var(--sa-background-primary, #ffffff)",border:Ot,borderRadius:"var(--sa-radii-sm, 6px)",boxShadow:"var(--sa-shadow-xl, 0 20px 25px -5px #0000001a, 0 8px 10px -6px #0000001a)",zIndex:9999,padding:"4px",display:"flex",flexDirection:"column"},children:[t&&e.jsxs(e.Fragment,{children:[e.jsx(Ur,{icon:"ChevronUp",label:"Ascending",active:n==="asc",onClick:()=>w(()=>n==="asc"?c():s("asc"))}),e.jsx(Ur,{icon:"ChevronDown",label:"Descending",active:n==="desc",onClick:()=>w(()=>n==="desc"?c():s("desc"))}),e.jsx("div",{style:{borderTop:Ot,margin:"4px 0"}})]}),e.jsx(Ur,{icon:"Pin1",label:l?"Unfreeze":"Freeze",active:l,onClick:()=>w(i)}),o&&e.jsx(Ur,{icon:"EyeClosed",label:"Hide column",danger:!0,onClick:()=>w(a)})]})]})},Mr="1px solid var(--sa-border-subtle, #0b120e24)",hs="var(--sa-text-subtle, #8c8f97)",Dr="var(--sa-background-neutral, #f0f1f2)",gl="2px 0 4px -2px var(--sa-border-subtle, #0b120e24)",Ir=40,At="var(--sa-background-brand-subtlest)",Jr={display:"block",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},yl="sa-table-layout-styles",fs=()=>{if(typeof document>"u"||document.getElementById(yl))return;const r=document.createElement("style");r.id=yl,r.textContent=`
|
|
2
2
|
.sa-table-layout tbody td {
|
|
3
3
|
transition: background-color 0.15s ease;
|
|
4
4
|
background-color: var(--sa-tl-bg, transparent);
|
|
@@ -54,8 +54,8 @@
|
|
|
54
54
|
.sa-table-layout tfoot.sa-tl-sticky-foot > tr:first-child > th {
|
|
55
55
|
box-shadow: 0 -2px 4px -2px var(--sa-border-subtle, #0b120e24);
|
|
56
56
|
}
|
|
57
|
-
`,document.head.appendChild(r)},Lr=r=>r==="right"?"right":r==="center"?"center":"left",is=/^(#|rgb|hsl|var\()/,Jr=r=>r?is.test(r)?r:`var(--sa-background-${r})`:void 0,cs=(r,t)=>{if(t)return r[t]},as=(r,t)=>r==null&&t==null?0:r==null?-1:t==null?1:typeof r=="number"&&typeof t=="number"?r-t:String(r).localeCompare(String(t)),ds=({columns:r,data:t,getRowKey:o,rowBg:n,size:l="md",resizable:s=!1,layout:i="auto",widthStorageKey:c,columnState:a,onColumnStateChange:h,columnMenu:y=!1,sort:b,defaultSort:p,onSortChange:C,height:E,mobileLayout:w="cards",mobileBreakpoint:L="md",groupSeparator:F,summary:I,footer:S,stickyFooter:D=!1,emptyState:H,loading:A=!1,loadingRows:k=8,rowActions:z,selectable:W=!1,selectedKeys:X,defaultSelectedKeys:K,onSelectionChange:Q,isRowSelectable:_})=>{ss();const re=!De.useMediaQuery(L)&&w!=="scroll",q=!!(z!=null&&z.length),[P,N]=d.useState(null);d.useEffect(()=>{if(!P)return;const v=()=>N(null),x=setTimeout(()=>document.addEventListener("click",v),0);return()=>{clearTimeout(x),document.removeEventListener("click",v)}},[P]);const[ce,xe]=d.useState(()=>new Set),Ae=a!==void 0,[ue,Se]=d.useState({}),Be=a??ue,ze=v=>{h==null||h(v),Ae||Se(v)},He=b!==void 0,[Le,je]=d.useState(p??null),we=He?b??null:Le,Pe=!C,Ge=v=>{C==null||C(v),He||je(v)},{headerGroups:Xe,leafColumns:ke,hasGroups:tr}=d.useMemo(()=>{var ie;const v=new Set(Be.hidden??[]),x=(oe,be)=>oe.key??(typeof oe.accessor=="string"?oe.accessor:`col-${be}`),M=r.map((oe,be)=>{var _e;if((_e=oe.children)!=null&&_e.length){const Or=oe.children.map((Re,Wr)=>({col:Re,key:x(Re,`${be}-${Wr}`)})).filter(Re=>!v.has(Re.key));return{col:oe,key:oe.key??`group-${be}`,isGroup:!0,leaves:Or}}const ve={col:oe,key:x(oe,`${be}`)};return{col:oe,key:ve.key,isGroup:!1,leaves:v.has(ve.key)?[]:[ve]}}).filter(oe=>oe.leaves.length>0),Z=M.some(oe=>oe.isGroup);let te=M.flatMap(oe=>oe.leaves);if(!Z&&((ie=Be.order)!=null&&ie.length)){const oe=new Map(Be.order.map((be,ve)=>[be,ve]));te=[...te].sort((be,ve)=>(oe.get(be.key)??1/0)-(oe.get(ve.key)??1/0))}return{headerGroups:M,leafColumns:te,hasGroups:Z}},[r,Be]),Dr=d.useMemo(()=>new Map(ke.map((v,x)=>[v.key,x])),[ke]),V=!tr&&ke.some(v=>(v.col.headerColSpan??1)>1),ee=ke.map(v=>v.key).join("|"),U=(v,x)=>{const M=v.sortKey??(typeof v.accessor=="string"?v.accessor:void 0);return M?x[M]:void 0},de=v=>v.sortable??(!!v.sortKey||typeof v.accessor=="string"),ne=d.useMemo(()=>{if(!Pe||!we)return t;const v=ke.find(M=>M.key===we.key);if(!v)return t;const x=we.direction==="asc"?1:-1;return[...t].sort((M,Z)=>as(U(v.col,M),U(v.col,Z))*x)},[t,Pe,we,ke]),pe=!tr&&!V,$e=!!c&&pe,[Qe,Ne]=G.useColumnWidths(c??""),Ee=$e?Qe:void 0,Ue=d.useRef(null),[he,or]=d.useState();d.useLayoutEffect(()=>{or(void 0)},[ee]),d.useLayoutEffect(()=>{if(!pe||he||!Ue.current)return;const v=Ue.current.querySelectorAll("th.sa-tl-leaf");or(Array.from(v).map(x=>x.offsetWidth))},[he,pe]);const[lr,sr]=d.useState(),[ur,dr]=d.useState(0);d.useLayoutEffect(()=>{if(!tr||!Ue.current)return;const v=Ue.current.querySelector(":scope > tr");v&&dr(v.offsetHeight)},[tr,ee]);const m=(v,x)=>{if((Ee==null?void 0:Ee[x])!=null)return Ee[x];if(v.width!=null)return v.width;if((he==null?void 0:he[x])!=null)return he[x]},J=(v,x)=>typeof v.width=="number"?v.width:he==null?void 0:he[x],Y=Be.frozenKey&&!tr&&!V?ke.findIndex(v=>v.key===Be.frozenKey):-1,ge=v=>v<=Y,Te=W?Tr:0,Je=v=>{const x=lr??he;if(!x)return Te;let M=Te;for(let Z=0;Z<v;Z++)M+=x[Z]??0;return M};d.useLayoutEffect(()=>{const v=Ue.current;if(!v||Y<0){sr(void 0);return}let x=0;const M=()=>{x=0;const te=v.querySelectorAll("th.sa-tl-leaf"),ie=Array.from(te).map(oe=>oe.getBoundingClientRect().width);sr(oe=>oe&&oe.length===ie.length&&oe.every((be,ve)=>Math.abs(be-ie[ve])<.5)?oe:ie)},Z=new ResizeObserver(()=>{x||(x=requestAnimationFrame(M))});return Z.observe(v),v.querySelectorAll("th.sa-tl-leaf").forEach(te=>Z.observe(te)),M(),()=>{x&&cancelAnimationFrame(x),Z.disconnect()}},[ee,Y,W,he,Ee]);const Ce=d.useRef(null),[ye,Ke]=d.useState("100vh");d.useLayoutEffect(()=>{if(E!==void 0)return;const v=()=>{if(Ce.current){const x=Ce.current.getBoundingClientRect().top;Ke(`calc(100vh - ${x}px - var(--sa-floating-footer-height, 0px) + 12px)`)}};return v(),window.addEventListener("resize",v),()=>window.removeEventListener("resize",v)},[E]);const Fe=(v,x)=>o?o(v,x):x,Sr=X!==void 0,[Bl,Ai]=d.useState(()=>new Set(K??[])),ir=d.useMemo(()=>Sr?new Set(X):Bl,[Sr,X,Bl]);d.useEffect(()=>{W&&!o&&process.env.NODE_ENV!=="production"&&console.warn("[@starasia/admin] TableLayout: `selectable` tanpa `getRowKey` — key default (index) membuat seleksi menempel ke POSISI baris, bukan datanya. Beri `getRowKey` yang stabil (mis. r => r.id).")},[W,!o]);const ml=v=>{if(Sr||Ai(v),Q){const x=ne.filter((M,Z)=>v.has(Fe(M,Z)));Q(Array.from(v),x)}},zt=(v,x)=>W&&(_?_(v,x):!0),Ht=v=>{const x=new Set(ir);x.has(v)?x.delete(v):x.add(v),ml(x)},kr=d.useMemo(()=>W?ne.map((v,x)=>({row:v,i:x,key:Fe(v,x)})).filter(({row:v,i:x})=>_?_(v,x):!0).map(({key:v})=>v):[],[W,ne,_,o]),El=kr.filter(v=>ir.has(v)),Vt=kr.length>0&&El.length===kr.length,Fl=El.length>0&&!Vt,zi=()=>{const v=new Set(ir);Vt?kr.forEach(x=>v.delete(x)):kr.forEach(x=>v.add(x)),ml(v)},Pt=(v,x,M)=>v.render?v.render(x,M,ne):cs(x,v.accessor),jt=ke.length+(W?1:0)+(q?1:0),Ml=["80%","55%","70%","45%","90%","60%"],Hi=(v,x)=>Ml[(v*7+x*3)%Ml.length],Vi=(v,x)=>e.jsx(qe.Skeleton,{height:14,width:Hi(v,x),borderRadius:"rounded-sm"}),Pi=Array.from({length:k},(v,x)=>e.jsxs(G.Tr,{children:[W&&e.jsx(G.Td,{style:{width:Tr,padding:0},children:e.jsx("div",{style:{display:"flex",justifyContent:"center"},children:e.jsx(qe.Skeleton,{height:14,width:14,borderRadius:"rounded-sm"})})}),ke.map(({col:M,key:Z},te)=>e.jsx(G.Td,{style:{textAlign:Lr(M.align)},children:Vi(x,te)},`sa-tl-sk-${x}-${Z}`)),q&&e.jsx(G.Td,{style:{width:1,padding:0,border:"none"}})]},`sa-tl-sk-${x}`)),ji=(v,x)=>{x||ze({...Be,hidden:[...Be.hidden??[],v]})},Ni=v=>ze({...Be,frozenKey:Be.frozenKey===v?void 0:v}),ot=v=>(z??[]).filter(x=>{var M;return!((M=x.hidden)!=null&&M.call(x,v))}),Tl={position:"absolute",right:0,top:0,bottom:0,display:"flex",alignItems:"center",gap:4,paddingRight:16,paddingLeft:40,background:"linear-gradient(to right, transparent, var(--sa-background-primary-inverse, #f8f8f8) 40px)"},lt=(v,x,M,Z)=>{var _e;const te=(_e=v.disabled)==null?void 0:_e.call(v,x),ie=(Z==null?void 0:Z.showLabel)??v.showLabel,oe=(Z==null?void 0:Z.size)??"xs",be=e.jsx(j.Button,{size:oe,variant:v.variant??"tertiary",tone:v.tone??"neutral",disabled:te,onClick:()=>v.onClick(x,M),iconLeft:v.icon?e.jsx(T.Icon,{name:v.icon,size:"sm"}):void 0,children:ie&&v.label}),ve=v.tooltip;return ve?e.jsx(me.Tooltip,{label:ve,position:"top-end",children:be}):be},_i=(v,x)=>{const M=ot(v);if(!M.length)return null;if(M.length>5){const te=Fe(v,x),ie=(P==null?void 0:P.rowKey)===te;return e.jsx("div",{className:"sa-tl-row-actions",style:Tl,onClick:oe=>oe.stopPropagation(),children:e.jsx(me.Tooltip,{label:"Aksi lainnya",position:"top",children:e.jsx(j.Button,{size:"xs",variant:"tertiary",onClick:oe=>{const be=oe.currentTarget.getBoundingClientRect();N(ie?null:{rowKey:te,top:be.bottom+4,right:window.innerWidth-be.right})},children:e.jsx(T.Icon,{name:"MenuVertical",size:"sm"})})})})}return e.jsx("div",{className:"sa-tl-row-actions",style:Tl,children:M.map(te=>e.jsx(d.Fragment,{children:lt(te,v,x)},te.key))})},qi=(v,x)=>{const M=ot(v);return M.length?e.jsx("div",{style:{display:"flex",gap:6,flexWrap:"wrap",paddingTop:8,marginTop:8,borderTop:Mr},children:M.map(Z=>e.jsx(d.Fragment,{children:lt(Z,v,x,{showLabel:!0,size:"sm"})},Z.key))}):null},Zi=(v,x)=>{const M=ot(v);return M.length?e.jsx("div",{style:{display:"flex",gap:4,paddingRight:8,flexShrink:0},children:M.map(Z=>e.jsx(d.Fragment,{children:lt(Z,v,x,{showLabel:!1})},Z.key))}):null},Nt=(v,x)=>{const{col:M,key:Z}=v,te=Dr.get(Z)??0,ie=ge(te),oe=ie&&te===Y,be=(we==null?void 0:we.key)===Z?we.direction:null,ve=y&&!M.disableMenu?e.jsx(cl,{active:!!be||ie,canSort:de(M),canHide:!M.locked,sortDir:be,frozen:ie,onSort:Wr=>Ge({key:Z,direction:Wr}),onClearSort:()=>Ge(null),onToggleFreeze:()=>Ni(Z),onHide:()=>ji(Z,M.locked)}):null,_e=M.align==="right",Or=M.align==="right"?"flex-end":M.align==="center"?"center":"flex-start",Re=e.jsxs("span",{style:{flex:1,minWidth:0,display:"flex",alignItems:"center",gap:6,justifyContent:Or,overflow:"hidden"},children:[M.icon&&e.jsx(T.Icon,{name:M.icon,size:"sm",style:{flexShrink:0}}),e.jsx("span",{style:Ur,children:M.title})]});return e.jsx(G.Th,{className:`sa-tl-leaf${ie?" sa-tl-frozen":""}`,rowSpan:x==null?void 0:x.rowSpan,colSpan:x==null?void 0:x.colSpan,minWidth:M.minWidth,resizable:pe?M.resizable:!1,defaultWidth:J(M,te),style:{textAlign:Lr(M.align),width:m(M,te),position:"sticky",top:(x==null?void 0:x.top)??0,left:ie?Je(te):void 0,zIndex:ie?3:2,backgroundColor:wr,boxShadow:oe?al:void 0},children:e.jsx("div",{style:{display:"flex",alignItems:"center",gap:6,width:"100%"},children:_e?e.jsxs(e.Fragment,{children:[ve,Re]}):e.jsxs(e.Fragment,{children:[Re,ve]})})},`th-${Z}`)},Gi=()=>{const v=[];for(let x=0;x<ke.length;){const M=ke[x],Z=M.col.headerColSpan??1,te=Math.max(1,Math.min(Z,ke.length-x));v.push(Nt(M,te>1?{colSpan:te}:void 0)),x+=te}return v},Ll=v=>e.jsx(G.Th,{rowSpan:v==null?void 0:v.rowSpan,style:{width:Tr,position:"sticky",top:0,left:0,zIndex:4,backgroundColor:wr,padding:0},children:e.jsx("div",{style:{display:"flex",alignItems:"center",justifyContent:"center"},onClick:x=>x.stopPropagation(),children:e.jsx(er.Checkbox,{size:"sm",variant:Fl?"indeterminate":"select",checked:Vt||Fl,disabled:kr.length===0,onChange:zi,"aria-label":"Pilih semua baris di halaman ini"})})},"th-select"),Qi=(v,x,M)=>{const Z=Fe(v,x);return e.jsx(G.Td,{className:"sa-tl-frozen",style:{width:Tr,padding:0,position:"sticky",left:0,zIndex:2,...M?{"--sa-tl-bg":M}:{}},children:zt(v,x)&&e.jsx("div",{style:{display:"flex",alignItems:"center",justifyContent:"center"},onClick:te=>te.stopPropagation(),children:e.jsx(er.Checkbox,{size:"sm",checked:ir.has(Z),onChange:()=>Ht(Z),"aria-label":"Pilih baris"})})},`tl-select-${x}`)},_t=ke.filter(v=>!v.col.hideOnMobile),qt=_t.find(v=>v.col.primary)??_t[0],Ui=_t.filter(v=>v!==qt),Ji=v=>xe(x=>{const M=new Set(x);return M.has(v)?M.delete(v):M.add(v),M}),Il=(v,x)=>Ui.map(({col:M,key:Z})=>{const te=Pt(M,v,x),ie=typeof te=="string"||typeof te=="number"?e.jsx(B.Text,{style:{minWidth:0,overflow:"hidden",textOverflow:"ellipsis",textAlign:"right"},children:te}):e.jsx("div",{style:{minWidth:0,overflow:"hidden",textOverflow:"ellipsis",textAlign:"right"},children:te});return e.jsxs("div",{style:{display:"flex",gap:12,justifyContent:"space-between",alignItems:"baseline"},children:[typeof M.title=="string"?e.jsx(B.Text,{color:"subtle",fontWeight:"medium",style:{color:ns,flexShrink:0},children:M.title}):e.jsx("div",{style:{flexShrink:0},children:M.title}),ie]},Z)}),Zt=(v,x)=>{const M=qt?Pt(qt.col,v,x):null;return typeof M=="string"||typeof M=="number"?e.jsx(B.Text,{as:"span",style:Ur,children:M}):e.jsx("span",{style:Ur,children:M})},Yi=e.jsx(u.Box,{style:{display:"flex",flexDirection:"column",gap:8,padding:8},children:Array.from({length:k},(v,x)=>e.jsxs(u.Box,{style:{border:Mr,borderRadius:"var(--sa-radii-sm, 6px)",padding:12,display:"flex",flexDirection:"column",gap:8},children:[e.jsx(qe.Skeleton,{height:16,width:"60%",borderRadius:"rounded-sm"}),e.jsx(qe.Skeleton,{height:12,width:"85%",borderRadius:"rounded-sm"}),e.jsx(qe.Skeleton,{height:12,width:"70%",borderRadius:"rounded-sm"})]},`sa-tl-sk-card-${x}`))}),Ol=e.jsx(u.Box,{fullWidth:!0,style:{minHeight:(H==null?void 0:H.minHeight)??320,display:"flex",alignItems:"center",justifyContent:"center",padding:16},children:H==null?void 0:H.content}),Xi=A?Yi:ne.length===0?Ol:w==="expand"?e.jsx(u.Box,{style:{display:"flex",flexDirection:"column"},children:ne.map((v,x)=>{const M=Fe(v,x),Z=ce.has(M),ie=W&&ir.has(M)?Tt:Jr(n==null?void 0:n(v,x));return e.jsxs("div",{style:{borderBottom:Mr,backgroundColor:ie},children:[e.jsxs("div",{style:{display:"flex",alignItems:"center"},children:[zt(v,x)&&e.jsx("div",{style:{display:"flex",alignItems:"center",paddingLeft:12,flexShrink:0},children:e.jsx(er.Checkbox,{size:"sm",checked:ir.has(M),onChange:()=>Ht(M),"aria-label":"Pilih baris"})}),e.jsxs("button",{type:"button",onClick:()=>Ji(M),style:{flex:1,minWidth:0,display:"flex",alignItems:"center",justifyContent:"space-between",gap:12,padding:"10px 12px",background:"none",border:"none",font:"inherit",color:"inherit",cursor:"pointer",textAlign:"left"},children:[Zt(v,x),e.jsx(T.Icon,{name:Z?"ChevronUp":"ChevronDown",size:"sm",style:{flexShrink:0}})]}),q&&Zi(v,x)]}),Z&&e.jsx("div",{style:{padding:"0 12px 12px",display:"flex",flexDirection:"column",gap:6},children:Il(v,x)})]},M)})}):e.jsx(u.Box,{style:{display:"flex",flexDirection:"column",gap:8,padding:8},children:ne.map((v,x)=>{const M=Fe(v,x),Z=W&&ir.has(M);return e.jsxs(u.Box,{style:{border:Mr,borderRadius:"var(--sa-radii-sm, 6px)",padding:12,display:"flex",flexDirection:"column",gap:6,backgroundColor:Z?Tt:Jr(n==null?void 0:n(v,x))},children:[zt(v,x)?e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8},children:[e.jsx(er.Checkbox,{size:"sm",checked:ir.has(M),onChange:()=>Ht(M),"aria-label":"Pilih baris"}),e.jsx("div",{style:{flex:1,minWidth:0},children:Zt(v,x)})]}):Zt(v,x),Il(v,x),q&&qi(v,x)]},M)})}),$i=s&&pe&&he!==void 0,Wl=i==="fixed"&&!s&&(pe?he!==void 0:!0),Ki=Wl&&!pe,nt=S&&S.length>0?S.map((v,x)=>e.jsx(G.Tr,{children:v.cells.map((M,Z)=>e.jsx(G.Td,{colSpan:M.colSpan,rowSpan:M.rowSpan,style:{textAlign:Lr(M.align)},children:M.content},`tl-foot-${x}-${Z}`))},`tl-foot-${x}`)):null,Ri=e.jsxs(G.Table,{className:"sa-table-layout",fullWidth:!0,size:l,resizable:$i,style:Wl?{tableLayout:"fixed"}:void 0,onWidthsChange:$e?Ne:void 0,children:[Ki&&e.jsxs("colgroup",{children:[W&&e.jsx("col",{style:{width:Tr}}),ke.map(({col:v,key:x},M)=>e.jsx("col",{style:{width:m(v,M)}},`col-${x}`)),q&&e.jsx("col",{style:{width:1}})]}),e.jsx(G.Thead,{ref:Ue,children:tr?e.jsxs(e.Fragment,{children:[e.jsxs(G.Tr,{children:[W&&Ll({rowSpan:2}),Xe.map(v=>v.isGroup?e.jsx(G.Th,{colSpan:v.leaves.length,style:{textAlign:"center",position:"sticky",top:0,zIndex:2,backgroundColor:wr},children:e.jsx("span",{style:Ur,children:v.col.title})},`grp-${v.key}`):Nt(v.leaves[0],{rowSpan:2})),q&&e.jsx(G.Th,{rowSpan:2,style:{position:"sticky",top:0,right:0,zIndex:3,width:1,padding:0,border:"none",backgroundColor:wr}})]}),e.jsx(G.Tr,{children:Xe.flatMap(v=>v.isGroup?v.leaves.map(x=>Nt(x,{top:ur})):[])})]}):e.jsxs(G.Tr,{children:[W&&Ll(),Gi(),q&&e.jsx(G.Th,{style:{position:"sticky",top:0,right:0,zIndex:3,width:1,padding:0,border:"none",backgroundColor:wr}})]})}),e.jsx(G.Tbody,{children:A?Pi:ne.length===0?e.jsx(G.Tr,{children:e.jsx(G.Td,{colSpan:jt,children:Ol})}):e.jsxs(e.Fragment,{children:[ne.map((v,x)=>{const M=F==null?void 0:F(v,x,x>0?ne[x-1]:void 0),te=W&&ir.has(Fe(v,x))?Tt:Jr(n==null?void 0:n(v,x));return e.jsxs(d.Fragment,{children:[M!=null&&M!==!1&&e.jsx(G.Tr,{children:e.jsx(G.Td,{colSpan:jt,style:{backgroundColor:wr},children:M})}),e.jsxs(G.Tr,{children:[W&&Qi(v,x,te),ke.map(({col:ie,key:oe},be)=>{var zl;const ve=(zl=ie.cellProps)==null?void 0:zl.call(ie,v,x,ne);if(ve!=null&&ve.hidden)return null;const _e=ge(be),Or=_e&&be===Y,Re=Pt(ie,v,x),Wr=typeof ie.bg=="function"?ie.bg(v,x,ne):ie.bg,Al=Jr(Wr)??te;return e.jsx(G.Td,{className:_e?"sa-tl-frozen":void 0,colSpan:ve==null?void 0:ve.colSpan,rowSpan:ve==null?void 0:ve.rowSpan,style:{textAlign:Lr(ie.align),width:m(ie,be),minWidth:ie.minWidth,position:_e?"sticky":void 0,left:_e?Je(be):void 0,zIndex:_e?1:void 0,boxShadow:Or?al:void 0,...Al?{"--sa-tl-bg":Al}:{}},children:typeof Re=="string"?e.jsx(B.Text,{style:{whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",textAlign:Lr(ie.align)},children:Re}):Re},`tl-cell-${x}-${oe}`)}),q&&e.jsx(G.Td,{style:{position:"sticky",right:0,width:1,padding:0,overflow:"visible",zIndex:2,border:"none"},children:_i(v,x)})]})]},Fe(v,x))}),I!=null&&e.jsx(G.Tr,{children:e.jsx(G.Td,{colSpan:jt,children:I})})]})}),nt&&e.jsx(G.Tfoot,{className:D?"sa-tl-sticky-foot":void 0,children:nt})]}),Gt=P?ne.findIndex((v,x)=>Fe(v,x)===P.rowKey):-1,Qt=Gt>=0?ne[Gt]:null;return e.jsxs(e.Fragment,{children:[e.jsx(u.Box,{ref:Ce,fullWidth:!0,style:{overflow:"auto",height:E??ye},children:re?e.jsxs(e.Fragment,{children:[Xi,nt&&!A&&ne.length>0&&e.jsx(u.Box,{style:{borderTop:Mr},children:e.jsx(G.Table,{fullWidth:!0,size:l,className:"sa-table-layout",children:e.jsx(G.Tbody,{children:nt})})})]}):Ri}),P&&Qt&&e.jsx("div",{className:"sa-tl-kebab-menu",style:{top:P.top,right:P.right},onClick:v=>v.stopPropagation(),children:ot(Qt).map(v=>e.jsx("div",{style:{padding:"2px 4px"},children:lt(v,Qt,Gt,{showLabel:!0,size:"sm"})},v.key))})]})},Lt=r=>r==="asc"||r==="desc",hs=(r={})=>{const{sortKeyParam:t="sortBy",sortOrderParam:o="sortOrder",pageKey:n="page",defaultSort:l=null,paramKeys:s,scopeId:i,storage:c=Dt}=r,{searchParams:a,setSearchParams:h,searchQueries:y}=We(),b=a.toString(),p=i?xr.tableSort(i):void 0,C=d.useRef(!1);d.useEffect(()=>{if(C.current||(C.current=!0,!p)||a.has(t)||a.has(o))return;const S=c.get(p);!(S!=null&&S.key)||!Lt(S.direction)||h({...Object.fromEntries(a.entries()),[t]:S.key,[o]:S.direction})},[]);const E=d.useMemo(()=>{const S=a.get(t),D=a.get(o);return S&&Lt(D)?{key:S,direction:D}:l},[b,t,o,l]);d.useEffect(()=>{if(!p)return;const S=a.get(t),D=a.get(o);S&&Lt(D)?c.set(p,{key:S,direction:D}):c.remove(p)},[b,p,t,o,c]);const w=(s==null?void 0:s.sortBy)??"sortBy",L=(s==null?void 0:s.sortOrder)??"sortOrder",F=d.useMemo(()=>E?{[w]:E.key,[L]:E.direction}:{},[E,w,L]),I=d.useCallback(S=>{const D={...y};S?(D[t]=S.key,D[o]=S.direction):(delete D[t],delete D[o]),delete D[n],h(D)},[y,t,o,n,h]);return{sort:E,setSort:I,params:F}},Yr=({of:r,render:t})=>d.Children.toArray(r==null?void 0:r.map((o,n,l)=>t(o,n,l))),ae=({condition:r,fallback:t,children:o,loading:n,isLoading:l})=>e.jsx(e.Fragment,{children:l?n:r?o:t}),fe=r=>e.jsx(B.Text,{...r,fontFamily:"Poppins",fontSize:r.fontSize||"md",fontWeight:r.fontWeight||"medium",color:r.color||"gray-700",children:r.children}),nr=r=>e.jsx(B.Text,{color:"red-600",fontSize:"sm",children:r.message}),fs=({size:r="md",direction:t="vertical",requiredTitle:o="(Required)",fullWidth:n=!1,...l})=>{var c,a,h;const s=l.hideMessageError||!1,i=t==="horizontal"?r==="sm"?342:r==="lg"?400:342:void 0;return e.jsxs(u.Box,{gap:t==="horizontal"?"spacing-96":"sm",direction:t==="horizontal"?"row":"column",...l.containerProps,children:[l.title&&e.jsx(ae,{condition:!!l.inputProps.required,fallback:e.jsxs(u.Box,{direction:"column",customMaxWidth:i,fullWidth:n,children:[e.jsx(fe,{children:l.title}),e.jsx(B.Text,{fontSize:r,color:"gray-500",children:l.description})]}),children:e.jsxs(u.Box,{direction:"column",customMaxWidth:i,fullWidth:n,children:[e.jsxs(se.Flex,{direction:"row",gap:"xs",align:"center",children:[e.jsx(fe,{fontSize:r,children:l.title}),e.jsx(fe,{color:"error",fontSize:r,children:o}),e.jsx(ae,{condition:!!((c=l.tooltip)!=null&&c.label),children:e.jsx(me.Tooltip,{label:(a=l.tooltip)==null?void 0:a.label,arrowPosition:(h=l.tooltip)==null?void 0:h.arrowPosition,...l.tooltip,children:e.jsx(T.Icon,{name:"InfoCircle",size:r==="lg"?"sm":"xs",style:{color:"var(--sa-color-info-500, #00abeb)",marginTop:"6px"}})})})]}),e.jsx(ae,{condition:!!l.description,children:e.jsx(B.Text,{fontSize:r,color:"gray-500",children:l.description})})]})}),e.jsxs(u.Box,{direction:"column",gap:"xs",fullWidth:l.inputProps.fullWidth||!1,children:[e.jsx(ar.Input,{ref:l.inputRef,size:r,...l.inputProps,status:l.errorMessage?"error":"default",fullWidth:!0}),!s&&l.errorMessage&&e.jsx(nr,{message:l.errorMessage}),l.inputProps.extended&&l.inputProps.extended]})]})},us=({size:r="md",direction:t="vertical",requiredTitle:o="(Required)",fullWidth:n=!1,...l})=>{var c,a,h;const s=l.hideMessageError||!1,i=t==="horizontal"?r==="sm"?342:r==="lg"?400:342:void 0;return e.jsxs(u.Box,{gap:t==="horizontal"?"spacing-96":"sm",direction:t==="horizontal"?"row":"column",onClick:l.onClickContainer,children:[l.title&&e.jsx(ae,{condition:!!l.inputProps.required,fallback:e.jsxs(u.Box,{direction:"column",customMaxWidth:i,fullWidth:n,children:[e.jsx(fe,{children:l.title}),e.jsx(B.Text,{fontSize:r,color:"gray-500",children:l.description})]}),children:e.jsxs(u.Box,{direction:"column",customMaxWidth:i,fullWidth:n,children:[e.jsxs(se.Flex,{direction:"row",gap:"xs",align:"center",children:[e.jsx(fe,{fontSize:r,children:l.title}),e.jsx(fe,{color:"error",fontSize:r,children:o}),e.jsx(ae,{condition:!!((c=l.tooltip)!=null&&c.label),children:e.jsx(me.Tooltip,{label:(a=l.tooltip)==null?void 0:a.label,arrowPosition:(h=l.tooltip)==null?void 0:h.arrowPosition,...l.tooltip,children:e.jsx(T.Icon,{name:"InfoCircle",size:r==="lg"?"sm":"xs",style:{color:"var(--sa-color-info-500, #00abeb)",marginTop:"6px"}})})})]}),e.jsx(ae,{condition:!!l.description,children:e.jsx(B.Text,{fontSize:r,color:"gray-500",children:l.description})})]})}),e.jsxs(u.Box,{direction:"column",gap:"xs",fullWidth:l.inputProps.fullWidth||!1,children:[e.jsx(u.Box,{direction:"column",style:{width:l.inputProps.fullWidth?"100%":t==="horizontal"&&l.customWidth?l.customWidth:t==="horizontal"?"343px":""},children:e.jsx(pr.Dropdown,{size:r,...l.inputProps,error:!!l.errorMessage})}),!s&&l.errorMessage&&e.jsx(nr,{message:l.errorMessage}),l.inputProps.extended&&l.inputProps.extended]})]})},gs=(r,t)=>typeof r=="string"&&r||t==="error"?"var(--sa-border-danger)":"var(--sa-border-subtle)",ys=r=>{var c;const[t,o]=d.useState(!1),n=a=>{a.preventDefault(),a.stopPropagation()},l=a=>{a.preventDefault(),a.stopPropagation(),a.dataTransfer&&r.handleOnFileChange(a.dataTransfer.files.item(0))},s=a=>{a.preventDefault(),o(!0)},i=a=>{a.preventDefault(),o(!1)};return e.jsxs(u.Box,{width:"width-full",paddingInline:"md",direction:"row",gap:"sm",align:"center",onClick:r.handleOnClick,onDragOver:n,onDrop:l,onDragEnter:s,onDragLeave:i,paddingBlock:"md",borderRadius:"rounded-md",style:{border:t?"1px solid var(--sa-border-info)":`1px solid ${gs(r.errorMessage,r.status)}`},children:[e.jsx(T.Icon,{name:"Upload",size:"lg",style:{width:30,height:30}}),e.jsxs(se.Flex,{direction:"column",gap:"xs",children:[e.jsxs(se.Flex,{direction:"row",gap:"xs",children:[e.jsx(B.Text,{fontWeight:"medium",color:"gray-500",style:{textWrap:"nowrap"},fontSize:r.isDesktop?"md":"sm",children:"Click your upload"}),e.jsx(B.Text,{fontWeight:"medium",style:{textWrap:"nowrap"},fontSize:r.isDesktop?"md":"sm",children:"or Drag & Drop"})]}),e.jsx(B.Text,{fontSize:"sm",color:"gray-500",children:(c=r.fileSupports)==null?void 0:c.map(a=>a.toLocaleUpperCase()).join(", ")})]})]})};function ps(r){return r.split(" ").map(t=>t[0]).join("").slice(0,2).toUpperCase()}const hl=r=>{const t={day:"2-digit",month:"short",year:"numeric"};return r.toLocaleDateString("id-ID",t)},bs=r=>{const t={Jan:0,Feb:1,Mar:2,Apr:3,Mei:4,Jun:5,Jul:6,Agu:7,Sep:8,Okt:9,Nov:10,Des:11},o=r.split(" ");if(o.length!==3)return null;const n=parseInt(o[0],10),l=t[o[1]],s=parseInt(o[2],10);return isNaN(n)||isNaN(l)||isNaN(s)?null:new Date(s,l,n)};function vs(r,t=!0){if(!r)return"Rp 0";const o=typeof r=="number"?r.toString():r;if(isNaN(Number(o)))return"Rp 0";const n=o.split("."),l=n[0].replace(/\B(?=(\d{3})+(?!\d))/g,"."),s=n.length===2?l+"."+n[1]:l;return t?"Rp"+s:s}String.prototype.toTitleCase=function(){return this.toLowerCase().split(" ").map(r=>r.charAt(0).toUpperCase()+r.slice(1)).join(" ")},String.prototype.toNumber=function(){return Number(this)};const Cs=r=>{const t=r.split(" ");let o=t[0].charAt(0);return t.length>1&&(o+=""+t[1].charAt(0)),o.toUpperCase()};function xs(r){const t=typeof r=="string"?new Date(r):r;if(isNaN(t.getTime()))throw new Error("Invalid date format");const o=t.getFullYear(),n=String(t.getMonth()+1).padStart(2,"0"),l=String(t.getDate()).padStart(2,"0");return`${o}-${n}-${l}`}const ws="sa-admin",Ye=r=>`var(--${ws}-${r})`,Ds={base:{borderColor:Ye("base-border-color"),textColor:Ye("base-text-color"),iconColor:Ye("base-icon-color"),placeholderColor:Ye("base-placeholder-color")},document:{bgColor:Ye("document-bg-color")},sidebar:{bgColor:Ye("sidebar-bg-color"),borderColor:Ye("sidebar-border-color"),maxWidth:Ye("sidebar-max-width"),width:Ye("sidebar-width"),collapseWidth:Ye("sidebar-collapse-width"),collapseV2Width:Ye("sidebar-v2-collapse-width")}},Ss=24*60*60*1e3,ks=r=>{const t="14px poppins",n=document.createElement("canvas").getContext("2d");n.font=t;const l=n.measureText(r).width;return Number(Math.ceil(l))},Bs=/^[^\s@]+@[^\s@]+\.[^\s@]+$/,ms=/--+/,Es=/-$/;function Fs(r,t){return JSON.stringify(r)!==JSON.stringify(t)}function Ms(r){return/^(?:\+62|62|0)8[1-9][0-9]{7,10}$/.test(r)}function Ts(r){return/^[A-Za-z\s]+$/.test(r)}const Ls=r=>{const t=/^[0-9]$/,o=["ArrowLeft","ArrowRight","ArrowUp","ArrowDown","Backspace","Delete","Enter","Tab"];(r.ctrlKey||r.metaKey)&&(r.key==="a"||r.key==="c"||r.key==="v")||!t.test(r.key)&&!o.includes(r.key)&&r.preventDefault()},Is=r=>{const t=/^[0-9]$/,o=["ArrowLeft","ArrowRight","ArrowUp","ArrowDown","Backspace","Delete","Enter","Tab"];(r.ctrlKey||r.metaKey)&&r.key==="v"||t.test(r.key)&&!o.includes(r.key)&&r.preventDefault()},Os=r=>{const t=/^[0-9.]$/,o=["ArrowLeft","ArrowRight","ArrowUp","ArrowDown","Backspace","Delete","Enter","Tab"];(r.ctrlKey||r.metaKey)&&r.key==="v"||!t.test(r.key)&&!o.includes(r.key)&&r.preventDefault()},Ws=r=>Bs.test(r);function As(r){return!(ms.test(r)||Es.test(r))}const zs=r=>{const t=["ArrowLeft","ArrowRight","ArrowUp","ArrowDown","Backspace","Delete","Enter","Tab","Home","End"];if((r.ctrlKey||r.metaKey)&&["a","c","v","x"].includes(r.key.toLowerCase()))return;const o=r.currentTarget.value;/^[0-9]$/.test(r.key)||r.key==="."&&!o.includes(".")||r.key==="-"&&o.length===0&&!o.includes("-")||t.includes(r.key)||r.preventDefault()},Hs=r=>{const t=document.getElementById(r);if(t){const o=t.getBoundingClientRect(),n=window.scrollY+o.top-80;window.scrollTo({top:n,behavior:"smooth"})}};function Vs(r){const t=r.toLowerCase();if(["kb","mb","gb"].find(s=>t.endsWith(s)))return r;const l=Number(r);if(isNaN(l))throw new Error("Invalid size format");return l>=1e6?`${(l/1e6).toFixed(2)}MB`:l>=1e3?`${(l/1e3).toFixed(2)}KB`:`${l}B`}function Ps(r){const t=r.split("/");return t[t.length-1]}const js=r=>{var t,o;return e.jsxs(u.Box,{width:"width-full",paddingInline:"md",height:"height-full",direction:"row",justify:"space-between",align:"center",onClick:r.handleOnClickFile,fullHeight:!0,paddingBlock:"md",id:"file-item",borderRadius:"rounded-md",style:{border:"1px solid var(--sa-border-subtle)",cursor:"pointer"},children:[e.jsxs(se.Flex,{direction:"row",align:"center",gap:"sm",style:{flex:1,minWidth:0},children:[e.jsx(T.Icon,{name:"DocumentFilled",size:"lg",style:{color:"var(--sa-icon-brand)",width:30,height:30,flexShrink:0}}),e.jsxs(se.Flex,{direction:"column",style:{minWidth:0,flex:1},children:[e.jsx(B.Text,{fontWeight:"bold",style:{textOverflow:"ellipsis",whiteSpace:"nowrap",overflow:"hidden"},children:r.defaultFile?Ps(r.defaultFile.url):(t=r.fileSelected)==null?void 0:t.name}),r.defaultFile?(r.defaultFile.size||r.defaultFile.date)&&e.jsxs(se.Flex,{direction:"row",gap:"xs",align:"center",children:[r.defaultFile.size&&e.jsx(B.Text,{fontSize:"sm",fontWeight:"medium",children:r.defaultFile.size}),r.defaultFile.size&&r.defaultFile.date&&e.jsx(T.Icon,{name:"Dot",size:"xs"}),r.defaultFile.date&&e.jsx(B.Text,{fontSize:"sm",fontWeight:"medium",style:{textWrap:"nowrap"},children:r.defaultFile.date})]}):e.jsxs(se.Flex,{direction:"row",gap:"xs",align:"center",children:[e.jsx(B.Text,{fontSize:"sm",fontWeight:"medium",children:Vs(((o=r.fileSelected)==null?void 0:o.size.toString())||"100000")}),e.jsx(T.Icon,{name:"Dot",size:"xs"}),e.jsx(B.Text,{fontSize:"sm",fontWeight:"medium",style:{textWrap:"nowrap"},children:hl(new Date)})]})]})]}),e.jsx(j.Button,{size:"xs",variant:"tertiary",tone:"error",type:"button",onClick:n=>{n.stopPropagation(),r.handleOnDeleteFile()},iconLeft:e.jsx(T.Icon,{name:"Trash1"})})]})},fl=({status:r="default",labelPosition:t="outside-top",...o})=>{var p;const n=d.useRef(null),l=()=>{if(o.defaultFile){window.open(o.defaultFile.url);return}n.current&&n.current.click()},s=De.useMediaQuery("md"),i=r==="error"||typeof o.errorMessage=="string"&&!!o.errorMessage,c=o.label?e.jsxs(se.Flex,{direction:"row",align:"center",gap:"xs",children:[e.jsx(B.Text,{style:{fontSize:"14px",fontWeight:500,color:"var(--sa-text-primary)"},children:o.label}),o.optional&&e.jsx("span",{style:{background:"var(--sa-background-neutral)",border:"1px solid var(--sa-border-subtle)",borderRadius:"4px",padding:"0 8px",fontSize:"10px",fontWeight:500,lineHeight:"18px",color:"var(--sa-text-primary)",display:"inline-flex",alignItems:"center"},children:"Optional"}),o.required&&e.jsx("span",{style:{fontSize:"14px",fontWeight:500,color:"var(--sa-text-error)"},children:"*"})]}):null,a=o.description?e.jsx(B.Text,{style:{fontSize:"12px",fontWeight:400,color:"var(--sa-text-subtlest, #6b6e76)",lineHeight:"18px"},children:o.description}):null,h=e.jsxs(e.Fragment,{children:[o.helperText&&e.jsx(B.Text,{style:{fontSize:"12px",fontWeight:400,color:"var(--sa-text-subtlest, #6b6e76)",lineHeight:"18px"},children:o.helperText}),o.errorText&&r==="error"&&e.jsx(B.Text,{style:{fontSize:"12px",fontWeight:400,color:"var(--sa-text-error, #a4133c)",lineHeight:"18px"},children:o.errorText}),o.errorMessage&&!o.errorText&&e.jsx(B.Text,{style:{fontSize:"12px",fontWeight:400,color:"var(--sa-text-error, #a4133c)",lineHeight:"18px"},children:o.errorMessage})]}),y=e.jsx("input",{type:"file",style:{display:"none"},ref:n,onChange:C=>{var E;return o.handleOnChangeFile(((E=C.target.files)==null?void 0:E.item(0))||null)},accept:(p=o.fileSupportOption)==null?void 0:p.map(C=>"."+(C==null?void 0:C.toLowerCase())).join(", ")}),b=e.jsxs(u.Box,{direction:"column",fullWidth:!0,style:{minHeight:"69px"},borderRadius:"rounded-md",display:"flex",justify:"center",align:"center",cursor:"pointer",gap:"md",...o.containerProps,children:[y,(o.fileSelected||o.defaultFile)&&e.jsx(js,{fileSelected:o.fileSelected,defaultFile:o.defaultFile,handleOnDeleteFile:o.handleOnDeleteFile,handleOnClickFile:l}),!o.fileSelected&&!o.defaultFile&&e.jsx(ys,{fileSupports:o.fileSupportOption,isDesktop:s,errorMessage:i?o.errorText||o.errorMessage||" ":void 0,status:i?"error":"default",handleOnClick:l,handleOnFileChange:o.handleOnChangeFile})]});return t==="outside-left"?e.jsxs(se.Flex,{direction:"row",align:"flex-start",gap:"sm",style:{width:"100%"},children:[e.jsxs(se.Flex,{direction:"column",gap:"xs",style:{width:"40%",minWidth:"120px",paddingTop:"10px"},children:[c,a]}),e.jsxs(se.Flex,{direction:"column",gap:"sm",style:{flex:1,minWidth:0},children:[b,h]})]}):e.jsxs(se.Flex,{direction:"column",gap:"sm",style:{width:"100%"},children:[c,a,b,h]})},Ns=({size:r="md",direction:t="vertical",requiredTitle:o="(Required)",fullWidth:n=!1,...l})=>{var c,a,h;const s=l.hideMessageError||!1,i=t==="horizontal"?r==="sm"?342:r==="lg"?400:342:void 0;return e.jsxs(u.Box,{gap:t==="horizontal"?"spacing-96":"sm",direction:t==="horizontal"?"row":"column",...l.containerProps,children:[l.title&&e.jsx(ae,{condition:!!l.inputProps.required,fallback:e.jsxs(u.Box,{direction:"column",customMaxWidth:i,fullWidth:n,children:[e.jsx(fe,{children:l.title}),e.jsx(B.Text,{fontSize:r,color:"gray-500",children:l.description})]}),children:e.jsxs(u.Box,{direction:"column",customMaxWidth:i,fullWidth:n,children:[e.jsxs(se.Flex,{direction:"row",gap:"xs",align:"center",children:[e.jsx(fe,{fontSize:r,children:l.title}),e.jsx(fe,{color:"error",fontSize:r,children:o}),e.jsx(ae,{condition:!!((c=l.tooltip)!=null&&c.label),children:e.jsx(me.Tooltip,{label:(a=l.tooltip)==null?void 0:a.label,arrowPosition:(h=l.tooltip)==null?void 0:h.arrowPosition,...l.tooltip,children:e.jsx(T.Icon,{name:"InfoCircle",size:r==="lg"?"sm":"xs",style:{color:"var(--sa-color-info-500, #00abeb)",marginTop:"6px"}})})})]}),e.jsx(ae,{condition:!!l.description,children:e.jsx(B.Text,{fontSize:r,color:"gray-500",children:l.description})})]})}),e.jsxs(se.Flex,{direction:"column",gap:"xs",children:[e.jsx(fl,{...l.inputProps,status:l.errorMessage?"error":"default"}),!s&&l.errorMessage&&e.jsx(nr,{message:l.errorMessage})]})]})},_s=({size:r="md",direction:t="vertical",requiredTitle:o="(Required)",fullWidth:n=!1,required:l=!1,...s})=>{var a,h,y,b;const i=s.hideMessageError||!1,c=t==="horizontal"?r==="sm"?342:r==="lg"?400:342:void 0;return e.jsxs(u.Box,{gap:t==="horizontal"||t==="horizontal-inline"?"spacing-96":"sm",direction:t==="horizontal"||t==="horizontal-inline"?"row":"column",...s.containerProps,children:[s.title&&e.jsx(ae,{condition:!!l,fallback:e.jsxs(u.Box,{direction:"column",customMaxWidth:c,fullWidth:n,children:[e.jsx(fe,{children:s.title}),e.jsx(Ze.Body3,{props:{color:"gray-500"},children:s.description})]}),children:e.jsxs(u.Box,{direction:"column",customMaxWidth:c,fullWidth:n,children:[e.jsxs(se.Flex,{direction:"row",gap:"xs",align:"center",children:[e.jsx(fe,{fontSize:r,children:s.title}),e.jsx(fe,{color:"error",fontSize:r,children:o}),e.jsx(ae,{condition:!!((a=s.tooltip)!=null&&a.label),children:e.jsx(me.Tooltip,{label:(h=s.tooltip)==null?void 0:h.label,arrowPosition:(y=s.tooltip)==null?void 0:y.arrowPosition,...s.tooltip,children:e.jsx(T.Icon,{name:"InfoCircle",size:r==="lg"?"sm":"xs",style:{color:"var(--sa-color-info-500, #00abeb)",marginTop:"6px"}})})})]}),e.jsx(ae,{condition:!!s.description,children:e.jsx(B.Text,{fontSize:r,color:"gray-500",children:s.description})})]})}),e.jsx(u.Box,{gap:t==="horizontal-inline"?"xl":"md",direction:t==="horizontal-inline"?"row":"column",align:"flex-start",children:e.jsx(Yr,{of:(b=s.checkBoxesList)==null?void 0:b.map(p=>({...p,isChecked:s.checkBoxesAreChecked.includes(p.id)})),render:p=>p.renderBadge?e.jsxs(u.Box,{direction:"row",justify:"space-between",gap:"lg",...s.badgeContainerProps,children:[e.jsx(er.Checkbox,{name:p.name,value:p.id,checked:p.isChecked,onChange:C=>s.onChecked(C.target.value,p),label:p.name,description:p.description}),p.renderBadge]}):e.jsx(er.Checkbox,{name:p.name,value:p.id,checked:p.isChecked,onChange:C=>s.onChecked(C.target.value,p),label:p.name,description:p.description})})}),!i&&s.errorMessage&&e.jsx(nr,{message:s.errorMessage})]})},qs=({position:r="vertical",size:t="md",fullWidth:o=!1,...n})=>{var s;const l=r==="horizontal-inline"||r==="horizontal-block"?t==="sm"?342:t==="lg"?400:342:void 0;return e.jsxs(u.Box,{gap:r==="horizontal-inline"||r==="horizontal-block"?"spacing-96":"sm",direction:r==="horizontal-inline"||r==="horizontal-block"?"row":"column",children:[e.jsx(ae,{condition:!!n.description||!!n.title,children:e.jsxs(u.Box,{direction:"column",customMaxWidth:l,fullWidth:o,children:[n.title&&e.jsx(fe,{children:n.title}),e.jsx(ae,{condition:!!n.description,children:e.jsx(B.Text,{color:"gray-500",children:n.description})})]})}),e.jsx(u.Box,{gap:"sm",direction:r==="horizontal"||r==="horizontal-inline"?"row":"column",align:"flex-start",flexWrap:"wrap",children:e.jsx(Yr,{of:(s=n.radioList)==null?void 0:s.map(i=>({...i,isChecked:n.radioIsChecked===i.id})),render:({value:i,id:c,isChecked:a,subInput:h,label:y,description:b})=>e.jsxs(u.Box,{direction:"column",gap:"xs",customMaxWidth:l,children:[e.jsx(ct.Radio,{id:`${c.toString()}-${i}`,name:n.groupName||y,label:y,value:i,checked:a,onChange:p=>n.onChecked({id:c,label:p.target.name,value:p.target.value}),disabled:n.disableAll},c),b&&e.jsx(B.Text,{color:"gray-500",style:{marginLeft:28},children:b}),h]})})}),n.errorMessage&&e.jsx(nr,{message:n.errorMessage})]})},Zs=({size:r="md",direction:t="vertical",requiredTitle:o="(Required)",fullWidth:n=!1,...l})=>{var c,a,h;const s=l.hideMessageError||!1,i=t==="horizontal"?r==="sm"?342:r==="lg"?400:342:void 0;return e.jsxs(u.Box,{gap:t==="horizontal"?"spacing-96":"sm",direction:t==="horizontal"?"row":"column",...l.containerProps,children:[l.title&&e.jsx(ae,{condition:!!l.inputProps.required,fallback:e.jsxs(u.Box,{direction:"column",customMaxWidth:i,fullWidth:n,children:[e.jsx(fe,{children:l.title}),e.jsx(B.Text,{fontSize:r,color:"gray-500",children:l.description})]}),children:e.jsxs(u.Box,{direction:"column",customMaxWidth:i,fullWidth:n,children:[e.jsxs(se.Flex,{direction:"row",gap:"xs",align:"center",children:[e.jsx(fe,{fontSize:r,children:l.title}),e.jsx(fe,{color:"error",fontSize:r,children:o}),e.jsx(ae,{condition:!!((c=l.tooltip)!=null&&c.label),children:e.jsx(me.Tooltip,{label:(a=l.tooltip)==null?void 0:a.label,arrowPosition:(h=l.tooltip)==null?void 0:h.arrowPosition,...l.tooltip,children:e.jsx(T.Icon,{name:"InfoCircle",size:r==="lg"?"sm":"xs",style:{color:"var(--sa-color-info-500, #00abeb)",marginTop:"6px"}})})})]}),e.jsx(ae,{condition:!!l.description,children:e.jsx(B.Text,{fontSize:r,color:"gray-500",children:l.description})})]})}),e.jsxs(se.Flex,{direction:"column",gap:"xs",children:[e.jsx(it.Textarea,{ref:l.inputRef,size:r,...l.inputProps,status:l.errorMessage?"error":"default"}),!s&&l.errorMessage&&e.jsx(nr,{message:l.errorMessage})]})]})},Gs=({size:r="md",direction:t="vertical",requiredTitle:o="(Required)",required:n=!1,fullWidth:l=!1,...s})=>{var c,a,h;const i=t==="horizontal"?r==="sm"?342:r==="lg"?400:342:void 0;return e.jsxs(u.Box,{gap:t==="horizontal"?"spacing-96":"sm",direction:t==="horizontal"?"row":"column",...s.containerProps,children:[s.title&&e.jsx(ae,{condition:n,fallback:e.jsxs(u.Box,{direction:"column",customMaxWidth:i,fullWidth:l,children:[e.jsx(fe,{children:s.title}),e.jsx(B.Text,{fontSize:r,color:"gray-500",children:s.titleDescription})]}),children:e.jsxs(u.Box,{direction:"column",customMaxWidth:i,fullWidth:l,children:[e.jsxs(se.Flex,{direction:"row",gap:"xs",align:"center",children:[e.jsx(fe,{fontSize:r,children:s.title}),e.jsx(fe,{color:"error",fontSize:r,children:o}),e.jsx(ae,{condition:!!((c=s.tooltip)!=null&&c.label),children:e.jsx(me.Tooltip,{label:(a=s.tooltip)==null?void 0:a.label,arrowPosition:(h=s.tooltip)==null?void 0:h.arrowPosition,...s.tooltip,children:e.jsx(T.Icon,{name:"InfoCircle",size:r==="lg"?"sm":"xs",style:{color:"var(--sa-color-info-500, #00abeb)",marginTop:"6px"}})})})]}),e.jsx(ae,{condition:!!s.titleDescription,children:e.jsx(B.Text,{fontSize:r,color:"gray-500",children:s.titleDescription})})]})}),e.jsx(Cr.Toggle,{checked:s.checked,onChange:s.onChange,label:s.label,description:s.description}),s.errorMessage&&e.jsx(nr,{message:s.errorMessage})]})},Qs=({variant:r="primary",size:t="md",...o})=>{const n=vr.useColor(),l=i=>{var a,h,y,b,p,C;if(!i)return;const c=o.disabled?"var(--sa-text-disable, #181a198f)":r==="secondary"?"var(--sa-text-subtle, #8c8f97)":r==="secondary-danger"?(h=(a=n==null?void 0:n.computed)==null?void 0:a.red)==null?void 0:h[600]:r==="secondary-primary"?(b=(y=n==null?void 0:n.computed)==null?void 0:y.blue)==null?void 0:b[700]:(C=(p=n==null?void 0:n.computed)==null?void 0:p.gray)==null?void 0:C[50];return e.jsx(T.Icon,{name:i,size:t,style:{color:c}})},s=()=>{var c,a,h,y;if(r!=="secondary-danger"&&r!=="secondary-primary")return o.title;const i={color:o.disabled?"var(--sa-text-disable, #181a198f)":r==="secondary-danger"?(a=(c=n==null?void 0:n.computed)==null?void 0:c.red)==null?void 0:a[600]:(y=(h=n==null?void 0:n.computed)==null?void 0:h.blue)==null?void 0:y[700]};switch(t){case"xs":return e.jsx(Ze.Body2,{props:{style:i},children:o.title});case"sm":case"md":return e.jsx(Ze.SubH3,{props:{style:i},children:o.title});case"lg":return e.jsx(Ze.SubH2,{props:{style:i},children:o.title});default:return o.title}};return e.jsx(j.Button,{fullWidth:!0,disabled:o.disabled,primary:r==="primary",secondary:r==="secondary"||r==="secondary-danger"||r==="secondary-primary",success:r==="success",onClick:o.onClick,type:o.type,iconLeft:l(o.iconLeft),iconRight:l(o.iconRight),size:t,children:s()})},Us=r=>e.jsx(Ze.H5,{props:{...r},children:r.title}),Js=({size:r="md",direction:t="vertical",requiredTitle:o="(Required)",fullWidth:n=!1,...l})=>{var c,a,h;const s=l.hideMessageError||!1,i=t==="horizontal"?r==="sm"?342:r==="lg"?400:342:void 0;return e.jsxs(u.Box,{gap:t==="horizontal"?"spacing-96":"sm",direction:t==="horizontal"?"row":"column",onClick:l.onClickContainer,children:[l.title&&e.jsx(ae,{condition:!!l.inputProps.required,fallback:e.jsxs(u.Box,{direction:"column",customMaxWidth:i,fullWidth:n,children:[e.jsx(fe,{children:l.title}),e.jsx(B.Text,{fontSize:r,color:"gray-500",children:l.description})]}),children:e.jsxs(u.Box,{direction:"column",customMaxWidth:i,fullWidth:n,children:[e.jsxs(se.Flex,{direction:"row",gap:"xs",align:"center",children:[e.jsx(fe,{fontSize:r,children:l.title}),e.jsx(fe,{color:"error",fontSize:r,children:o}),e.jsx(ae,{condition:!!((c=l.tooltip)!=null&&c.label),children:e.jsx(me.Tooltip,{label:(a=l.tooltip)==null?void 0:a.label,arrowPosition:(h=l.tooltip)==null?void 0:h.arrowPosition,...l.tooltip,children:e.jsx(T.Icon,{name:"InfoCircle",size:r==="lg"?"sm":"xs",style:{color:"var(--sa-color-info-500, #00abeb)",marginTop:"6px"}})})})]}),e.jsx(ae,{condition:!!l.description,children:e.jsx(B.Text,{fontSize:r,color:"gray-500",children:l.description})})]})}),e.jsxs(se.Flex,{direction:"column",gap:"xs",children:[e.jsx(u.Box,{direction:"column",style:{width:t==="horizontal"&&l.customWidth?l.customWidth:t==="horizontal"?"343px":""},children:e.jsx(hr.StarasiaDate,{size:r,...l.inputProps,status:l.errorMessage?"error":void 0})}),!s&&l.errorMessage&&e.jsx(nr,{message:l.errorMessage})]})]})};async function Ys(r,t){const o=new Image;o.src=r,await new Promise((s,i)=>{o.onload=s,o.onerror=i});const n=document.createElement("canvas");n.width=t.width,n.height=t.height;const l=n.getContext("2d",{alpha:!0});if(!l)throw new Error("No 2D context");return l.drawImage(o,t.x,t.y,t.width,t.height,0,0,t.width,t.height),new Promise((s,i)=>{n.toBlob(c=>{if(!c)return i("Canvas is empty");const a=new File([c],"cropped.png",{type:"image/png"});s(a)},"image/png")})}const ul={"1:1":1,"4:3":4/3,"16:9":16/9,"3:4":3/4,"9:16":9/16,"2:3":2/3,"3:2":3/2,"32:9":32/9},gl=d.forwardRef(({handleUpload:r,urlImage:t,isUploading:o,croppedImage:n,setCroppedImage:l,size:s="96",aspect:i="1:1",containerProps:c,maxFileSize:a=2,onError:h},y)=>{const b=De.useMediaQuery("md"),[p,C]=d.useState(!1),[E,w]=d.useState(null),[L,F]=d.useState(!1),[I,S]=d.useState({x:0,y:0}),[D,H]=d.useState(1),[A,k]=d.useState(null);d.useEffect(()=>{t===null&&l(null)},[t]);const z=d.useCallback((P,N)=>{k(N)},[]),W=P=>{var xe;const N=(xe=P.target.files)==null?void 0:xe[0];if(!N)return;const ce=new FileReader;ce.onload=()=>{w(ce.result),F(!0)},ce.readAsDataURL(N)},X=async()=>{if(!(!E||!A))try{const P=await Ys(E,A);if(a&&P.size>a*1024*1024){h==null||h(`Ukuran file maksimal ${a}MB`);return}r==null||r(P);const N=URL.createObjectURL(P);l(N,P),F(!1)}catch{h==null||h("Gagal memproses gambar")}},K=d.useRef(null),Q=()=>{K.current&&K.current.click()};d.useImperativeHandle(y,()=>({openFileDialog:()=>{var P;(P=K.current)==null||P.click()}}));const _=parseInt(s,10),R=ul[i];let re,q;return R>=1?(q=_,re=_*R):(re=_,q=_/R),e.jsxs(u.Box,{direction:"column",display:"flex",position:"relative",bg:(c==null?void 0:c.bg)||"gray-200",borderStyle:(c==null?void 0:c.borderStyle)||"border-none",borderColor:(c==null?void 0:c.borderColor)||"gray-200",borderWidth:(c==null?void 0:c.borderWidth)||"border-2",borderRadius:(c==null?void 0:c.borderRadius)||"rounded-md",overflow:"overflow-hidden",align:"center",justify:"center",style:{width:c!=null&&c.fullWidth?"100%":`${re}px`,height:c!=null&&c.fullWidth?"auto":`${q}px`,aspectRatio:R,flexShrink:0},onMouseEnter:()=>C(!0),onMouseLeave:()=>C(!1),children:[n||t?e.jsx("img",{src:n||t||void 0,alt:"Profile",style:{objectFit:"cover",width:"100%",height:"100%"}}):e.jsx(u.Box,{display:"flex",direction:"column",align:"center",justify:"center",padding:"spacing-4",children:e.jsx(T.Icon,{name:"Image",style:{color:"var(--sa-text-subtle, #8c8f97)",width:Number(s)/2<40?Number(s)/2:40,height:Number(s)/2<40?Number(s)/2:40}})}),e.jsxs(u.Box,{direction:"column",position:"absolute",display:"flex",align:"center",justify:"center",cursor:"pointer",style:{inset:0,backgroundColor:"var(--sa-color-black-alpha-a30, #080f214a)",opacity:p?1:0,transition:"opacity 0.3s ease-in-out"},onClick:Q,children:[e.jsx("input",{ref:K,type:"file",accept:"image/*",onChange:W,disabled:o,style:{display:"none"}}),e.jsxs(u.Box,{display:"flex",align:"center",gap:"spacing-2",direction:"row",children:[e.jsx(T.Icon,{name:"Edit3",style:{color:"var(--sa-background-primary, #ffffff)"}}),e.jsx(ae,{condition:s.toNumber()>80,children:e.jsx(B.Text,{color:"gray-50",fontSize:s.toNumber()>80?"sm":"md",fontWeight:"medium",children:"Edit Image"})})]})]}),o&&e.jsx(u.Box,{direction:"column",position:"absolute",display:"flex",align:"center",justify:"center",style:{inset:0,zIndex:20,backgroundColor:"var(--sa-color-white-alpha-a80, #e5e9f640)"},children:e.jsx(u.Box,{direction:"column",borderRadius:"rounded-full",style:{animation:"spin 1s linear infinite",border:"2px solid transparent",height:"2rem",width:"2rem"},borderColor:"info-600"})}),L&&zr.createPortal(e.jsx("div",{style:{position:"fixed",inset:0,zIndex:19999,display:"flex",alignItems:"center",justifyContent:"center",backgroundColor:"rgba(0,0,0,0.6)"},onClick:()=>F(!1),children:e.jsxs("div",{style:{backgroundColor:"var(--sa-background-primary)",borderRadius:"var(--sa-radii-md)",boxShadow:"0 20px 60px rgba(0,0,0,0.3)",overflow:"hidden",width:b?i==="1:1"?"min(90vw, 480px)":`min(90vw, ${re*2}px)`:"calc(100vw - 2rem)",display:"flex",flexDirection:"column"},onClick:P=>P.stopPropagation(),children:[e.jsx("div",{style:{position:"relative",width:"100%",height:"20rem",backgroundColor:"var(--sa-color-gray-100)"},children:E&&e.jsx(Hl,{image:E,crop:I,zoom:D,aspect:i?ul[i]:void 0,onCropChange:S,onZoomChange:H,onCropComplete:z,objectFit:"contain",minZoom:.5,restrictPosition:!1})}),e.jsxs("div",{style:{display:"flex",justifyContent:"flex-end",gap:"0.5rem",padding:"0.75rem 1rem",borderTop:"1px solid var(--sa-border-subtle)"},children:[e.jsx(j.Button,{size:"sm",secondary:!0,onClick:()=>F(!1),children:"Cancel"}),e.jsx(j.Button,{size:"sm",primary:!0,onClick:X,children:"Crop"})]})]})}),document.body)]})}),Xs=({size:r="md",direction:t="vertical",requiredTitle:o="(Required)",fullWidth:n=!1,required:l=!1,...s})=>{var a,h,y;const i=s.hideMessageError||!1,c=t==="horizontal"?r==="sm"?342:r==="lg"?400:342:void 0;return e.jsxs(u.Box,{gap:t==="horizontal"?"spacing-96":"sm",direction:t==="horizontal"?"row":"column",...s.containerProps,children:[s.title&&e.jsx(ae,{condition:!!l,fallback:e.jsxs(u.Box,{direction:"column",customMaxWidth:c,fullWidth:n,children:[e.jsx(fe,{children:s.title}),e.jsx(B.Text,{fontSize:r,color:"gray-500",children:s.description})]}),children:e.jsxs(u.Box,{direction:"column",customMaxWidth:c,fullWidth:n,children:[e.jsxs(se.Flex,{direction:"row",gap:"xs",align:"center",children:[e.jsx(fe,{fontSize:r,children:s.title}),e.jsx(fe,{color:"error",fontSize:r,children:o}),e.jsx(ae,{condition:!!((a=s.tooltip)!=null&&a.label),children:e.jsx(me.Tooltip,{label:(h=s.tooltip)==null?void 0:h.label,arrowPosition:(y=s.tooltip)==null?void 0:y.arrowPosition,...s.tooltip,children:e.jsx(T.Icon,{name:"InfoCircle",size:r==="lg"?"sm":"xs",style:{color:"var(--sa-color-info-500, #00abeb)",marginTop:"6px"}})})})]}),e.jsx(ae,{condition:!!s.description,children:e.jsx(B.Text,{fontSize:r,color:"gray-500",children:s.description})})]})}),e.jsxs(se.Flex,{direction:"column",gap:"xs",children:[e.jsx(gl,{...s.inputProps}),!i&&s.errorMessage&&e.jsx(nr,{message:s.errorMessage})]})]})},$s=({size:r="md",direction:t="vertical",requiredTitle:o="(Required)",fullWidth:n=!1,...l})=>{var i,c,a;const s=t==="horizontal"?r==="sm"?342:r==="lg"?400:342:void 0;return e.jsxs(u.Box,{gap:t==="horizontal"?"spacing-96":"sm",direction:t==="horizontal"?"row":"column",...l.containerProps,children:[l.title&&e.jsx(ae,{condition:!!l.inputProps.required,fallback:e.jsxs(u.Box,{direction:"column",customMaxWidth:s,fullWidth:n,children:[e.jsx(fe,{children:l.title}),e.jsx(B.Text,{fontSize:r,color:"gray-500",children:l.description})]}),children:e.jsxs(u.Box,{direction:"column",customMaxWidth:s,fullWidth:n,children:[e.jsxs(se.Flex,{direction:"row",gap:"xs",align:"center",children:[e.jsx(fe,{fontSize:r,children:l.title}),e.jsx(fe,{color:"error",fontSize:r,children:o}),e.jsx(ae,{condition:!!((i=l.tooltip)!=null&&i.label),children:e.jsx(me.Tooltip,{label:(c=l.tooltip)==null?void 0:c.label,arrowPosition:(a=l.tooltip)==null?void 0:a.arrowPosition,...l.tooltip,children:e.jsx(T.Icon,{name:"InfoCircle",size:r==="lg"?"sm":"xs",style:{color:"var(--sa-color-info-500, #00abeb)",marginTop:"6px"}})})})]}),e.jsx(ae,{condition:!!l.description,children:e.jsx(B.Text,{fontSize:r,color:"gray-500",children:l.description})})]})}),l.inputProps.extended&&l.inputProps.extended]})},Ks=({items:r,id:t,handleOnUpdate:o,width:n,toggleShow:l=!0,disabled:s=!1})=>{var y;const[i,c]=d.useState([]);d.useEffect(()=>{r&&c([...r.map(b=>({id:b.id,isActive:b.isActive}))])},[r]);const a=(y=i.find(b=>b.id===t))==null?void 0:y.isActive,h=d.useCallback(()=>{c(b=>b.map(p=>p.id===t?{...p,isActive:!p.isActive}:p)),o&&o(!a)},[t,o,a]);return e.jsx(u.Box,{direction:"row",gap:"md",style:{width:n},children:l&&e.jsx(Cr.Toggle,{disabled:s,checked:a,onChange:h,label:a?"Active":"Inactive"})})},Rs={InputText:fs,InputDropdown:us,InputSingleFile:Ns,CheckBoxOptions:_s,RadioOptions:qs,InputTextArea:Zs,ToggleForm:Gs,ActionButton:Qs,FormTitle:Us,InputDate:Js,InputImgFile:Xs,Custom:$s},yl=({customBottom:r})=>{const[t,o]=d.useState(!1),n=()=>{window.scrollY>window.screenY?o(!0):o(!1)},l=()=>{window.scrollTo({top:0,behavior:"smooth"})};return d.useEffect(()=>(window.addEventListener("scroll",n),()=>{window.removeEventListener("scroll",n)}),[]),e.jsx(u.Box,{direction:"column",style:{position:"fixed",bottom:0,right:0},children:e.jsx(u.Box,{direction:"column",position:"absolute",style:{bottom:r||"1.6rem",right:"2rem",transform:t?"scale(1)":"scale(0)",transition:"transform 0.2s ease-in-out"},children:e.jsx(j.Button,{secondary:!0,size:"xs",onClick:l,type:"button",iconLeft:e.jsx(T.Icon,{width:16,size:"xs",name:"ArrowPullUp",style:{color:"var(--sa-background-brand, #04254f)"}})})})})},Ve="sa-sidepanel-item",pl="sa-sidepanel-item-styles",ei=`
|
|
58
|
-
.${
|
|
57
|
+
`,document.head.appendChild(r)},Tr=r=>r==="right"?"right":r==="center"?"center":"left",us=/^(#|rgb|hsl|var\()/,Yr=r=>r?us.test(r)?r:`var(--sa-background-${r})`:void 0,gs=(r,t)=>{if(t)return r[t]},ys=(r,t)=>r==null&&t==null?0:r==null?-1:t==null?1:typeof r=="number"&&typeof t=="number"?r-t:String(r).localeCompare(String(t)),ps=({columns:r,data:t,getRowKey:o,rowBg:n,size:l="md",resizable:s=!1,layout:c="auto",widthStorageKey:i,columnState:a,onColumnStateChange:h,columnMenu:y=!1,sort:b,defaultSort:p,onSortChange:C,height:E,mobileLayout:w="cards",mobileBreakpoint:L="md",groupSeparator:F,summary:I,footer:B,stickyFooter:k=!1,emptyState:H,loading:W=!1,loadingRows:S=8,rowActions:z,selectable:O=!1,selectedKeys:Y,defaultSelectedKeys:X,onSelectionChange:q,isRowSelectable:Z})=>{fs();const te=!De.useMediaQuery(L)&&w!=="scroll",_=!!(z!=null&&z.length),[V,N]=d.useState(null);d.useEffect(()=>{if(!V)return;const v=()=>N(null),x=setTimeout(()=>document.addEventListener("click",v),0);return()=>{clearTimeout(x),document.removeEventListener("click",v)}},[V]);const[se,ve]=d.useState(()=>new Set),Ee=a!==void 0,[ue,Ce]=d.useState({}),xe=a??ue,we=v=>{h==null||h(v),Ee||Ce(v)},Ae=b!==void 0,[Fe,_e]=d.useState(p??null),$=Ae?b??null:Fe,ge=!C,We=v=>{C==null||C(v),Ae||_e(v)},{headerGroups:Ze,leafColumns:de,hasGroups:Ge}=d.useMemo(()=>{var ae;const v=new Set(xe.hidden??[]),x=(le,pe)=>le.key??(typeof le.accessor=="string"?le.accessor:`col-${pe}`),T=r.map((le,pe)=>{var Xe;if((Xe=le.children)!=null&&Xe.length){const Ar=le.children.map((rr,Wr)=>({col:rr,key:x(rr,`${pe}-${Wr}`)})).filter(rr=>!v.has(rr.key));return{col:le,key:le.key??`group-${pe}`,isGroup:!0,leaves:Ar}}const be={col:le,key:x(le,`${pe}`)};return{col:le,key:be.key,isGroup:!1,leaves:v.has(be.key)?[]:[be]}}).filter(le=>le.leaves.length>0),Q=T.some(le=>le.isGroup);let oe=T.flatMap(le=>le.leaves);if(!Q&&((ae=xe.order)!=null&&ae.length)){const le=new Map(xe.order.map((pe,be)=>[pe,be]));oe=[...oe].sort((pe,be)=>(le.get(pe.key)??1/0)-(le.get(be.key)??1/0))}return{headerGroups:T,leafColumns:oe,hasGroups:Q}},[r,xe]),lr=d.useMemo(()=>new Map(de.map((v,x)=>[v.key,x])),[de]),P=!Ge&&de.some(v=>(v.col.headerColSpan??1)>1),R=de.map(v=>v.key).join("|"),J=(v,x)=>{const T=v.sortKey??(typeof v.accessor=="string"?v.accessor:void 0);return T?x[T]:void 0},he=v=>v.sortable??(!!v.sortKey||typeof v.accessor=="string"),ce=d.useMemo(()=>{if(!ge||!$)return t;const v=de.find(T=>T.key===$.key);if(!v)return t;const x=$.direction==="asc"?1:-1;return[...t].sort((T,Q)=>ys(J(v.col,T),J(v.col,Q))*x)},[t,ge,$,de]),Me=!Ge&&!P,ze=!!i&&Me,[er,Qe]=U.useColumnWidths(i??""),Le=ze?er:void 0,Je=d.useRef(null),[Be,Ue]=d.useState();d.useLayoutEffect(()=>{Ue(void 0)},[R]),d.useLayoutEffect(()=>{if(!Me||Be||!Je.current)return;const v=Je.current.querySelectorAll("th.sa-tl-leaf");Ue(Array.from(v).map(x=>x.offsetWidth))},[Be,Me]);const[nr,gr]=d.useState(),[dr,hr]=d.useState(0);d.useLayoutEffect(()=>{if(!Ge||!Je.current)return;const v=Je.current.querySelector(":scope > tr");v&&hr(v.offsetHeight)},[Ge,R]);const Sr=(v,x)=>{if((Le==null?void 0:Le[x])!=null)return Le[x];if(v.width!=null)return v.width;if((Be==null?void 0:Be[x])!=null)return Be[x]},m=(v,x)=>typeof v.width=="number"?v.width:Be==null?void 0:Be[x],G=xe.frozenKey&&!Ge&&!P?de.findIndex(v=>v.key===xe.frozenKey):-1,re=v=>v<=G,Se=O?Ir:0,Oe=v=>{const x=nr??Be;if(!x)return Se;let T=Se;for(let Q=0;Q<v;Q++)T+=x[Q]??0;return T};d.useLayoutEffect(()=>{const v=Je.current;if(!v||G<0){gr(void 0);return}let x=0;const T=()=>{x=0;const oe=v.querySelectorAll("th.sa-tl-leaf"),ae=Array.from(oe).map(le=>le.getBoundingClientRect().width);gr(le=>le&&le.length===ae.length&&le.every((pe,be)=>Math.abs(pe-ae[be])<.5)?le:ae)},Q=new ResizeObserver(()=>{x||(x=requestAnimationFrame(T))});return Q.observe(v),v.querySelectorAll("th.sa-tl-leaf").forEach(oe=>Q.observe(oe)),T(),()=>{x&&cancelAnimationFrame(x),Q.disconnect()}},[R,G,O,Be,Le]);const Ye=d.useRef(null),[He,ke]=d.useState("100vh");d.useLayoutEffect(()=>{if(E!==void 0)return;const v=()=>{if(Ye.current){const x=Ye.current.getBoundingClientRect().top;ke(`calc(100vh - ${x}px - var(--sa-floating-footer-height, 0px) + 12px)`)}};return v(),window.addEventListener("resize",v),()=>window.removeEventListener("resize",v)},[E]);const Ie=(v,x)=>o?o(v,x):x,Ve=Y!==void 0,[Or,Nc]=d.useState(()=>new Set(X??[])),ir=d.useMemo(()=>Ve?new Set(Y):Or,[Ve,Y,Or]);d.useEffect(()=>{O&&!o&&process.env.NODE_ENV!=="production"&&console.warn("[@starasia/admin] TableLayout: `selectable` tanpa `getRowKey` — key default (index) membuat seleksi menempel ke POSISI baris, bukan datanya. Beri `getRowKey` yang stabil (mis. r => r.id).")},[O,!o]);const Il=v=>{if(Ve||Nc(v),q){const x=ce.filter((T,Q)=>v.has(Ie(T,Q)));q(Array.from(v),x)}},jt=(v,x)=>O&&(Z?Z(v,x):!0),Nt=v=>{const x=new Set(ir);x.has(v)?x.delete(v):x.add(v),Il(x)},Br=d.useMemo(()=>O?ce.map((v,x)=>({row:v,i:x,key:Ie(v,x)})).filter(({row:v,i:x})=>Z?Z(v,x):!0).map(({key:v})=>v):[],[O,ce,Z,o]),Tl=Br.filter(v=>ir.has(v)),_t=Br.length>0&&Tl.length===Br.length,Ll=Tl.length>0&&!_t,_c=()=>{const v=new Set(ir);_t?Br.forEach(x=>v.delete(x)):Br.forEach(x=>v.add(x)),Il(v)},qt=(v,x,T)=>v.render?v.render(x,T,ce):gs(x,v.accessor),Zt=de.length+(O?1:0)+(_?1:0),Ol=["80%","55%","70%","45%","90%","60%"],qc=(v,x)=>Ol[(v*7+x*3)%Ol.length],Zc=(v,x)=>e.jsx($e.Skeleton,{height:14,width:qc(v,x),borderRadius:"rounded-sm"}),Gc=Array.from({length:S},(v,x)=>e.jsxs(U.Tr,{children:[O&&e.jsx(U.Td,{style:{width:Ir,padding:0},children:e.jsx("div",{style:{display:"flex",justifyContent:"center"},children:e.jsx($e.Skeleton,{height:14,width:14,borderRadius:"rounded-sm"})})}),de.map(({col:T,key:Q},oe)=>e.jsx(U.Td,{style:{textAlign:Tr(T.align)},children:Zc(x,oe)},`sa-tl-sk-${x}-${Q}`)),_&&e.jsx(U.Td,{style:{width:1,padding:0,border:"none"}})]},`sa-tl-sk-${x}`)),Qc=(v,x)=>{x||we({...xe,hidden:[...xe.hidden??[],v]})},Uc=v=>we({...xe,frozenKey:xe.frozenKey===v?void 0:v}),lt=v=>(z??[]).filter(x=>{var T;return!((T=x.hidden)!=null&&T.call(x,v))}),Al={position:"absolute",right:0,top:0,bottom:0,display:"flex",alignItems:"center",gap:4,paddingRight:16,paddingLeft:40,background:"linear-gradient(to right, transparent, var(--sa-background-primary-inverse, #f8f8f8) 40px)"},nt=(v,x,T,Q)=>{var Xe;const oe=(Xe=v.disabled)==null?void 0:Xe.call(v,x),ae=(Q==null?void 0:Q.showLabel)??v.showLabel,le=(Q==null?void 0:Q.size)??"xs",pe=e.jsx(j.Button,{size:le,variant:v.variant??"tertiary",tone:v.tone??"neutral",disabled:oe,onClick:()=>v.onClick(x,T),iconLeft:v.icon?e.jsx(M.Icon,{name:v.icon,size:"sm"}):void 0,children:ae&&v.label}),be=v.tooltip;return be?e.jsx(me.Tooltip,{label:be,position:"top-end",children:pe}):pe},Jc=(v,x)=>{const T=lt(v);if(!T.length)return null;if(T.length>5){const oe=Ie(v,x),ae=(V==null?void 0:V.rowKey)===oe;return e.jsx("div",{className:"sa-tl-row-actions",style:Al,onClick:le=>le.stopPropagation(),children:e.jsx(me.Tooltip,{label:"Aksi lainnya",position:"top",children:e.jsx(j.Button,{size:"xs",variant:"tertiary",onClick:le=>{const pe=le.currentTarget.getBoundingClientRect();N(ae?null:{rowKey:oe,top:pe.bottom+4,right:window.innerWidth-pe.right})},children:e.jsx(M.Icon,{name:"MenuVertical",size:"sm"})})})})}return e.jsx("div",{className:"sa-tl-row-actions",style:Al,children:T.map(oe=>e.jsx(d.Fragment,{children:nt(oe,v,x)},oe.key))})},Yc=(v,x)=>{const T=lt(v);return T.length?e.jsx("div",{style:{display:"flex",gap:6,flexWrap:"wrap",paddingTop:8,marginTop:8,borderTop:Mr},children:T.map(Q=>e.jsx(d.Fragment,{children:nt(Q,v,x,{showLabel:!0,size:"sm"})},Q.key))}):null},Xc=(v,x)=>{const T=lt(v);return T.length?e.jsx("div",{style:{display:"flex",gap:4,paddingRight:8,flexShrink:0},children:T.map(Q=>e.jsx(d.Fragment,{children:nt(Q,v,x,{showLabel:!1})},Q.key))}):null},Gt=(v,x)=>{const{col:T,key:Q}=v,oe=lr.get(Q)??0,ae=re(oe),le=ae&&oe===G,pe=($==null?void 0:$.key)===Q?$.direction:null,be=y&&!T.disableMenu?e.jsx(ul,{active:!!pe||ae,canSort:he(T),canHide:!T.locked,sortDir:pe,frozen:ae,onSort:Wr=>We({key:Q,direction:Wr}),onClearSort:()=>We(null),onToggleFreeze:()=>Uc(Q),onHide:()=>Qc(Q,T.locked)}):null,Xe=T.align==="right",Ar=T.align==="right"?"flex-end":T.align==="center"?"center":"flex-start",rr=e.jsxs("span",{style:{flex:1,minWidth:0,display:"flex",alignItems:"center",gap:6,justifyContent:Ar,overflow:"hidden"},children:[T.icon&&e.jsx(M.Icon,{name:T.icon,size:"sm",style:{flexShrink:0}}),e.jsx("span",{style:Jr,children:T.title})]});return e.jsx(U.Th,{className:`sa-tl-leaf${ae?" sa-tl-frozen":""}`,rowSpan:x==null?void 0:x.rowSpan,colSpan:x==null?void 0:x.colSpan,minWidth:T.minWidth,resizable:Me?T.resizable:!1,defaultWidth:m(T,oe),style:{textAlign:Tr(T.align),width:Sr(T,oe),position:"sticky",top:(x==null?void 0:x.top)??0,left:ae?Oe(oe):void 0,zIndex:ae?3:2,backgroundColor:Dr,boxShadow:le?gl:void 0},children:e.jsx("div",{style:{display:"flex",alignItems:"center",gap:6,width:"100%"},children:Xe?e.jsxs(e.Fragment,{children:[be,rr]}):e.jsxs(e.Fragment,{children:[rr,be]})})},`th-${Q}`)},$c=()=>{const v=[];for(let x=0;x<de.length;){const T=de[x],Q=T.col.headerColSpan??1,oe=Math.max(1,Math.min(Q,de.length-x));v.push(Gt(T,oe>1?{colSpan:oe}:void 0)),x+=oe}return v},Wl=v=>e.jsx(U.Th,{rowSpan:v==null?void 0:v.rowSpan,style:{width:Ir,position:"sticky",top:0,left:0,zIndex:4,backgroundColor:Dr,padding:0},children:e.jsx("div",{style:{display:"flex",alignItems:"center",justifyContent:"center"},onClick:x=>x.stopPropagation(),children:e.jsx(tr.Checkbox,{size:"sm",variant:Ll?"indeterminate":"select",checked:_t||Ll,disabled:Br.length===0,onChange:_c,"aria-label":"Pilih semua baris di halaman ini"})})},"th-select"),Kc=(v,x,T)=>{const Q=Ie(v,x);return e.jsx(U.Td,{className:"sa-tl-frozen",style:{width:Ir,padding:0,position:"sticky",left:0,zIndex:2,...T?{"--sa-tl-bg":T}:{}},children:jt(v,x)&&e.jsx("div",{style:{display:"flex",alignItems:"center",justifyContent:"center"},onClick:oe=>oe.stopPropagation(),children:e.jsx(tr.Checkbox,{size:"sm",checked:ir.has(Q),onChange:()=>Nt(Q),"aria-label":"Pilih baris"})})},`tl-select-${x}`)},Qt=de.filter(v=>!v.col.hideOnMobile),Ut=Qt.find(v=>v.col.primary)??Qt[0],Rc=Qt.filter(v=>v!==Ut),ei=v=>ve(x=>{const T=new Set(x);return T.has(v)?T.delete(v):T.add(v),T}),zl=(v,x)=>Rc.map(({col:T,key:Q})=>{const oe=qt(T,v,x),ae=typeof oe=="string"||typeof oe=="number"?e.jsx(D.Text,{style:{minWidth:0,overflow:"hidden",textOverflow:"ellipsis",textAlign:"right"},children:oe}):e.jsx("div",{style:{minWidth:0,overflow:"hidden",textOverflow:"ellipsis",textAlign:"right"},children:oe});return e.jsxs("div",{style:{display:"flex",gap:12,justifyContent:"space-between",alignItems:"baseline"},children:[typeof T.title=="string"?e.jsx(D.Text,{color:"subtle",fontWeight:"medium",style:{color:hs,flexShrink:0},children:T.title}):e.jsx("div",{style:{flexShrink:0},children:T.title}),ae]},Q)}),Jt=(v,x)=>{const T=Ut?qt(Ut.col,v,x):null;return typeof T=="string"||typeof T=="number"?e.jsx(D.Text,{as:"span",style:Jr,children:T}):e.jsx("span",{style:Jr,children:T})},ri=e.jsx(f.Box,{style:{display:"flex",flexDirection:"column",gap:8,padding:8},children:Array.from({length:S},(v,x)=>e.jsxs(f.Box,{style:{border:Mr,borderRadius:"var(--sa-radii-sm, 6px)",padding:12,display:"flex",flexDirection:"column",gap:8},children:[e.jsx($e.Skeleton,{height:16,width:"60%",borderRadius:"rounded-sm"}),e.jsx($e.Skeleton,{height:12,width:"85%",borderRadius:"rounded-sm"}),e.jsx($e.Skeleton,{height:12,width:"70%",borderRadius:"rounded-sm"})]},`sa-tl-sk-card-${x}`))}),Hl=e.jsx(f.Box,{fullWidth:!0,style:{minHeight:(H==null?void 0:H.minHeight)??320,display:"flex",alignItems:"center",justifyContent:"center",padding:16},children:H==null?void 0:H.content}),ti=W?ri:ce.length===0?Hl:w==="expand"?e.jsx(f.Box,{style:{display:"flex",flexDirection:"column"},children:ce.map((v,x)=>{const T=Ie(v,x),Q=se.has(T),ae=O&&ir.has(T)?At:Yr(n==null?void 0:n(v,x));return e.jsxs("div",{style:{borderBottom:Mr,backgroundColor:ae},children:[e.jsxs("div",{style:{display:"flex",alignItems:"center"},children:[jt(v,x)&&e.jsx("div",{style:{display:"flex",alignItems:"center",paddingLeft:12,flexShrink:0},children:e.jsx(tr.Checkbox,{size:"sm",checked:ir.has(T),onChange:()=>Nt(T),"aria-label":"Pilih baris"})}),e.jsxs("button",{type:"button",onClick:()=>ei(T),style:{flex:1,minWidth:0,display:"flex",alignItems:"center",justifyContent:"space-between",gap:12,padding:"10px 12px",background:"none",border:"none",font:"inherit",color:"inherit",cursor:"pointer",textAlign:"left"},children:[Jt(v,x),e.jsx(M.Icon,{name:Q?"ChevronUp":"ChevronDown",size:"sm",style:{flexShrink:0}})]}),_&&Xc(v,x)]}),Q&&e.jsx("div",{style:{padding:"0 12px 12px",display:"flex",flexDirection:"column",gap:6},children:zl(v,x)})]},T)})}):e.jsx(f.Box,{style:{display:"flex",flexDirection:"column",gap:8,padding:8},children:ce.map((v,x)=>{const T=Ie(v,x),Q=O&&ir.has(T);return e.jsxs(f.Box,{style:{border:Mr,borderRadius:"var(--sa-radii-sm, 6px)",padding:12,display:"flex",flexDirection:"column",gap:6,backgroundColor:Q?At:Yr(n==null?void 0:n(v,x))},children:[jt(v,x)?e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8},children:[e.jsx(tr.Checkbox,{size:"sm",checked:ir.has(T),onChange:()=>Nt(T),"aria-label":"Pilih baris"}),e.jsx("div",{style:{flex:1,minWidth:0},children:Jt(v,x)})]}):Jt(v,x),zl(v,x),_&&Yc(v,x)]},T)})}),oi=s&&Me&&Be!==void 0,Pl=c==="fixed"&&!s&&(Me?Be!==void 0:!0),li=Pl&&!Me,st=B&&B.length>0?B.map((v,x)=>e.jsx(U.Tr,{children:v.cells.map((T,Q)=>e.jsx(U.Td,{colSpan:T.colSpan,rowSpan:T.rowSpan,style:{textAlign:Tr(T.align)},children:T.content},`tl-foot-${x}-${Q}`))},`tl-foot-${x}`)):null,ni=e.jsxs(U.Table,{className:"sa-table-layout",fullWidth:!0,size:l,resizable:oi,style:Pl?{tableLayout:"fixed"}:void 0,onWidthsChange:ze?Qe:void 0,children:[li&&e.jsxs("colgroup",{children:[O&&e.jsx("col",{style:{width:Ir}}),de.map(({col:v,key:x},T)=>e.jsx("col",{style:{width:Sr(v,T)}},`col-${x}`)),_&&e.jsx("col",{style:{width:1}})]}),e.jsx(U.Thead,{ref:Je,children:Ge?e.jsxs(e.Fragment,{children:[e.jsxs(U.Tr,{children:[O&&Wl({rowSpan:2}),Ze.map(v=>v.isGroup?e.jsx(U.Th,{colSpan:v.leaves.length,style:{textAlign:"center",position:"sticky",top:0,zIndex:2,backgroundColor:Dr},children:e.jsx("span",{style:Jr,children:v.col.title})},`grp-${v.key}`):Gt(v.leaves[0],{rowSpan:2})),_&&e.jsx(U.Th,{rowSpan:2,style:{position:"sticky",top:0,right:0,zIndex:3,width:1,padding:0,border:"none",backgroundColor:Dr}})]}),e.jsx(U.Tr,{children:Ze.flatMap(v=>v.isGroup?v.leaves.map(x=>Gt(x,{top:dr})):[])})]}):e.jsxs(U.Tr,{children:[O&&Wl(),$c(),_&&e.jsx(U.Th,{style:{position:"sticky",top:0,right:0,zIndex:3,width:1,padding:0,border:"none",backgroundColor:Dr}})]})}),e.jsx(U.Tbody,{children:W?Gc:ce.length===0?e.jsx(U.Tr,{children:e.jsx(U.Td,{colSpan:Zt,children:Hl})}):e.jsxs(e.Fragment,{children:[ce.map((v,x)=>{const T=F==null?void 0:F(v,x,x>0?ce[x-1]:void 0),oe=O&&ir.has(Ie(v,x))?At:Yr(n==null?void 0:n(v,x));return e.jsxs(d.Fragment,{children:[T!=null&&T!==!1&&e.jsx(U.Tr,{children:e.jsx(U.Td,{colSpan:Zt,style:{backgroundColor:Dr},children:T})}),e.jsxs(U.Tr,{children:[O&&Kc(v,x,oe),de.map(({col:ae,key:le},pe)=>{var jl;const be=(jl=ae.cellProps)==null?void 0:jl.call(ae,v,x,ce);if(be!=null&&be.hidden)return null;const Xe=re(pe),Ar=Xe&&pe===G,rr=qt(ae,v,x),Wr=typeof ae.bg=="function"?ae.bg(v,x,ce):ae.bg,Vl=Yr(Wr)??oe;return e.jsx(U.Td,{className:Xe?"sa-tl-frozen":void 0,colSpan:be==null?void 0:be.colSpan,rowSpan:be==null?void 0:be.rowSpan,style:{textAlign:Tr(ae.align),width:Sr(ae,pe),minWidth:ae.minWidth,position:Xe?"sticky":void 0,left:Xe?Oe(pe):void 0,zIndex:Xe?1:void 0,boxShadow:Ar?gl:void 0,...Vl?{"--sa-tl-bg":Vl}:{}},children:typeof rr=="string"?e.jsx(D.Text,{style:{whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",textAlign:Tr(ae.align)},children:rr}):rr},`tl-cell-${x}-${le}`)}),_&&e.jsx(U.Td,{style:{position:"sticky",right:0,width:1,padding:0,overflow:"visible",zIndex:2,border:"none"},children:Jc(v,x)})]})]},Ie(v,x))}),I!=null&&e.jsx(U.Tr,{children:e.jsx(U.Td,{colSpan:Zt,children:I})})]})}),st&&e.jsx(U.Tfoot,{className:k?"sa-tl-sticky-foot":void 0,children:st})]}),Yt=V?ce.findIndex((v,x)=>Ie(v,x)===V.rowKey):-1,Xt=Yt>=0?ce[Yt]:null;return e.jsxs(e.Fragment,{children:[e.jsx(f.Box,{ref:Ye,fullWidth:!0,style:{overflow:"auto",height:E??He},children:te?e.jsxs(e.Fragment,{children:[ti,st&&!W&&ce.length>0&&e.jsx(f.Box,{style:{borderTop:Mr},children:e.jsx(U.Table,{fullWidth:!0,size:l,className:"sa-table-layout",children:e.jsx(U.Tbody,{children:st})})})]}):ni}),V&&Xt&&e.jsx("div",{className:"sa-tl-kebab-menu",style:{top:V.top,right:V.right},onClick:v=>v.stopPropagation(),children:lt(Xt).map(v=>e.jsx("div",{style:{padding:"2px 4px"},children:nt(v,Xt,Yt,{showLabel:!0,size:"sm"})},v.key))})]})},Wt=r=>r==="asc"||r==="desc",bs=(r={})=>{const{sortKeyParam:t="sortBy",sortOrderParam:o="sortOrder",pageKey:n="page",defaultSort:l=null,paramKeys:s,scopeId:c,storage:i=Et}=r,{searchParams:a,setSearchParams:h,searchQueries:y}=Ne(),b=a.toString(),p=c?wr.tableSort(c):void 0,C=d.useRef(!1);d.useEffect(()=>{if(C.current||(C.current=!0,!p)||a.has(t)||a.has(o))return;const B=i.get(p);!(B!=null&&B.key)||!Wt(B.direction)||h({...Object.fromEntries(a.entries()),[t]:B.key,[o]:B.direction})},[]);const E=d.useMemo(()=>{const B=a.get(t),k=a.get(o);return B&&Wt(k)?{key:B,direction:k}:l},[b,t,o,l]);d.useEffect(()=>{if(!p)return;const B=a.get(t),k=a.get(o);B&&Wt(k)?i.set(p,{key:B,direction:k}):i.remove(p)},[b,p,t,o,i]);const w=(s==null?void 0:s.sortBy)??"sortBy",L=(s==null?void 0:s.sortOrder)??"sortOrder",F=d.useMemo(()=>E?{[w]:E.key,[L]:E.direction}:{},[E,w,L]),I=d.useCallback(B=>{const k={...y};B?(k[t]=B.key,k[o]=B.direction):(delete k[t],delete k[o]),delete k[n],h(k)},[y,t,o,n,h]);return{sort:E,setSort:I,params:F}},Xr=({of:r,render:t})=>d.Children.toArray(r==null?void 0:r.map((o,n,l)=>t(o,n,l))),fe=({condition:r,fallback:t,children:o,loading:n,isLoading:l})=>e.jsx(e.Fragment,{children:l?n:r?o:t}),ye=r=>e.jsx(D.Text,{...r,fontFamily:"Poppins",fontSize:r.fontSize||"md",fontWeight:r.fontWeight||"medium",color:r.color||"gray-700",children:r.children}),cr=r=>e.jsx(D.Text,{color:"red-600",fontSize:"sm",children:r.message}),vs=({size:r="md",direction:t="vertical",requiredTitle:o="(Required)",fullWidth:n=!1,...l})=>{var i,a,h;const s=l.hideMessageError||!1,c=t==="horizontal"?r==="sm"?342:r==="lg"?400:342:void 0;return e.jsxs(f.Box,{gap:t==="horizontal"?"spacing-96":"sm",direction:t==="horizontal"?"row":"column",...l.containerProps,children:[l.title&&e.jsx(fe,{condition:!!l.inputProps.required,fallback:e.jsxs(f.Box,{direction:"column",customMaxWidth:c,fullWidth:n,children:[e.jsx(ye,{children:l.title}),e.jsx(D.Text,{fontSize:r,color:"gray-500",children:l.description})]}),children:e.jsxs(f.Box,{direction:"column",customMaxWidth:c,fullWidth:n,children:[e.jsxs(ie.Flex,{direction:"row",gap:"xs",align:"center",children:[e.jsx(ye,{fontSize:r,children:l.title}),e.jsx(ye,{color:"error",fontSize:r,children:o}),e.jsx(fe,{condition:!!((i=l.tooltip)!=null&&i.label),children:e.jsx(me.Tooltip,{label:(a=l.tooltip)==null?void 0:a.label,arrowPosition:(h=l.tooltip)==null?void 0:h.arrowPosition,...l.tooltip,children:e.jsx(M.Icon,{name:"InfoCircle",size:r==="lg"?"sm":"xs",style:{color:"var(--sa-color-info-500, #00abeb)",marginTop:"6px"}})})})]}),e.jsx(fe,{condition:!!l.description,children:e.jsx(D.Text,{fontSize:r,color:"gray-500",children:l.description})})]})}),e.jsxs(f.Box,{direction:"column",gap:"xs",fullWidth:l.inputProps.fullWidth||!1,children:[e.jsx(ar.Input,{ref:l.inputRef,size:r,...l.inputProps,status:l.errorMessage?"error":"default",fullWidth:!0}),!s&&l.errorMessage&&e.jsx(cr,{message:l.errorMessage}),l.inputProps.extended&&l.inputProps.extended]})]})},Cs=({size:r="md",direction:t="vertical",requiredTitle:o="(Required)",fullWidth:n=!1,...l})=>{var i,a,h;const s=l.hideMessageError||!1,c=t==="horizontal"?r==="sm"?342:r==="lg"?400:342:void 0;return e.jsxs(f.Box,{gap:t==="horizontal"?"spacing-96":"sm",direction:t==="horizontal"?"row":"column",onClick:l.onClickContainer,children:[l.title&&e.jsx(fe,{condition:!!l.inputProps.required,fallback:e.jsxs(f.Box,{direction:"column",customMaxWidth:c,fullWidth:n,children:[e.jsx(ye,{children:l.title}),e.jsx(D.Text,{fontSize:r,color:"gray-500",children:l.description})]}),children:e.jsxs(f.Box,{direction:"column",customMaxWidth:c,fullWidth:n,children:[e.jsxs(ie.Flex,{direction:"row",gap:"xs",align:"center",children:[e.jsx(ye,{fontSize:r,children:l.title}),e.jsx(ye,{color:"error",fontSize:r,children:o}),e.jsx(fe,{condition:!!((i=l.tooltip)!=null&&i.label),children:e.jsx(me.Tooltip,{label:(a=l.tooltip)==null?void 0:a.label,arrowPosition:(h=l.tooltip)==null?void 0:h.arrowPosition,...l.tooltip,children:e.jsx(M.Icon,{name:"InfoCircle",size:r==="lg"?"sm":"xs",style:{color:"var(--sa-color-info-500, #00abeb)",marginTop:"6px"}})})})]}),e.jsx(fe,{condition:!!l.description,children:e.jsx(D.Text,{fontSize:r,color:"gray-500",children:l.description})})]})}),e.jsxs(f.Box,{direction:"column",gap:"xs",fullWidth:l.inputProps.fullWidth||!1,children:[e.jsx(f.Box,{direction:"column",style:{width:l.inputProps.fullWidth?"100%":t==="horizontal"&&l.customWidth?l.customWidth:t==="horizontal"?"343px":""},children:e.jsx(br.Dropdown,{size:r,...l.inputProps,error:!!l.errorMessage})}),!s&&l.errorMessage&&e.jsx(cr,{message:l.errorMessage}),l.inputProps.extended&&l.inputProps.extended]})]})},xs=(r,t)=>typeof r=="string"&&r||t==="error"?"var(--sa-border-danger)":"var(--sa-border-subtle)",ws=r=>{var i;const[t,o]=d.useState(!1),n=a=>{a.preventDefault(),a.stopPropagation()},l=a=>{a.preventDefault(),a.stopPropagation(),a.dataTransfer&&r.handleOnFileChange(a.dataTransfer.files.item(0))},s=a=>{a.preventDefault(),o(!0)},c=a=>{a.preventDefault(),o(!1)};return e.jsxs(f.Box,{width:"width-full",paddingInline:"md",direction:"row",gap:"sm",align:"center",onClick:r.handleOnClick,onDragOver:n,onDrop:l,onDragEnter:s,onDragLeave:c,paddingBlock:"md",borderRadius:"rounded-md",style:{border:t?"1px solid var(--sa-border-info)":`1px solid ${xs(r.errorMessage,r.status)}`},children:[e.jsx(M.Icon,{name:"Upload",size:"lg",style:{width:30,height:30}}),e.jsxs(ie.Flex,{direction:"column",gap:"xs",children:[e.jsxs(ie.Flex,{direction:"row",gap:"xs",children:[e.jsx(D.Text,{fontWeight:"medium",color:"gray-500",style:{textWrap:"nowrap"},fontSize:r.isDesktop?"md":"sm",children:"Click your upload"}),e.jsx(D.Text,{fontWeight:"medium",style:{textWrap:"nowrap"},fontSize:r.isDesktop?"md":"sm",children:"or Drag & Drop"})]}),e.jsx(D.Text,{fontSize:"sm",color:"gray-500",children:(i=r.fileSupports)==null?void 0:i.map(a=>a.toLocaleUpperCase()).join(", ")})]})]})};function Ds(r){return r.split(" ").map(t=>t[0]).join("").slice(0,2).toUpperCase()}const pl=r=>{const t={day:"2-digit",month:"short",year:"numeric"};return r.toLocaleDateString("id-ID",t)},Ss=r=>{const t={Jan:0,Feb:1,Mar:2,Apr:3,Mei:4,Jun:5,Jul:6,Agu:7,Sep:8,Okt:9,Nov:10,Des:11},o=r.split(" ");if(o.length!==3)return null;const n=parseInt(o[0],10),l=t[o[1]],s=parseInt(o[2],10);return isNaN(n)||isNaN(l)||isNaN(s)?null:new Date(s,l,n)};function Bs(r,t=!0){if(!r)return"Rp 0";const o=typeof r=="number"?r.toString():r;if(isNaN(Number(o)))return"Rp 0";const n=o.split("."),l=n[0].replace(/\B(?=(\d{3})+(?!\d))/g,"."),s=n.length===2?l+"."+n[1]:l;return t?"Rp"+s:s}String.prototype.toTitleCase=function(){return this.toLowerCase().split(" ").map(r=>r.charAt(0).toUpperCase()+r.slice(1)).join(" ")},String.prototype.toNumber=function(){return Number(this)};const ks=r=>{const t=r.split(" ");let o=t[0].charAt(0);return t.length>1&&(o+=""+t[1].charAt(0)),o.toUpperCase()};function Es(r){const t=typeof r=="string"?new Date(r):r;if(isNaN(t.getTime()))throw new Error("Invalid date format");const o=t.getFullYear(),n=String(t.getMonth()+1).padStart(2,"0"),l=String(t.getDate()).padStart(2,"0");return`${o}-${n}-${l}`}const ms="sa-admin",Re=r=>`var(--${ms}-${r})`,Fs={base:{borderColor:Re("base-border-color"),textColor:Re("base-text-color"),iconColor:Re("base-icon-color"),placeholderColor:Re("base-placeholder-color")},document:{bgColor:Re("document-bg-color")},sidebar:{bgColor:Re("sidebar-bg-color"),borderColor:Re("sidebar-border-color"),maxWidth:Re("sidebar-max-width"),width:Re("sidebar-width"),collapseWidth:Re("sidebar-collapse-width"),collapseV2Width:Re("sidebar-v2-collapse-width")}},Ms=24*60*60*1e3,Is=r=>{const t="14px poppins",n=document.createElement("canvas").getContext("2d");n.font=t;const l=n.measureText(r).width;return Number(Math.ceil(l))},Ts=/^[^\s@]+@[^\s@]+\.[^\s@]+$/,Ls=/--+/,Os=/-$/;function As(r,t){return JSON.stringify(r)!==JSON.stringify(t)}function Ws(r){return/^(?:\+62|62|0)8[1-9][0-9]{7,10}$/.test(r)}function zs(r){return/^[A-Za-z\s]+$/.test(r)}const Hs=r=>{const t=/^[0-9]$/,o=["ArrowLeft","ArrowRight","ArrowUp","ArrowDown","Backspace","Delete","Enter","Tab"];(r.ctrlKey||r.metaKey)&&(r.key==="a"||r.key==="c"||r.key==="v")||!t.test(r.key)&&!o.includes(r.key)&&r.preventDefault()},Ps=r=>{const t=/^[0-9]$/,o=["ArrowLeft","ArrowRight","ArrowUp","ArrowDown","Backspace","Delete","Enter","Tab"];(r.ctrlKey||r.metaKey)&&r.key==="v"||t.test(r.key)&&!o.includes(r.key)&&r.preventDefault()},Vs=r=>{const t=/^[0-9.]$/,o=["ArrowLeft","ArrowRight","ArrowUp","ArrowDown","Backspace","Delete","Enter","Tab"];(r.ctrlKey||r.metaKey)&&r.key==="v"||!t.test(r.key)&&!o.includes(r.key)&&r.preventDefault()},js=r=>Ts.test(r);function Ns(r){return!(Ls.test(r)||Os.test(r))}const _s=r=>{const t=["ArrowLeft","ArrowRight","ArrowUp","ArrowDown","Backspace","Delete","Enter","Tab","Home","End"];if((r.ctrlKey||r.metaKey)&&["a","c","v","x"].includes(r.key.toLowerCase()))return;const o=r.currentTarget.value;/^[0-9]$/.test(r.key)||r.key==="."&&!o.includes(".")||r.key==="-"&&o.length===0&&!o.includes("-")||t.includes(r.key)||r.preventDefault()},qs=r=>{const t=document.getElementById(r);if(t){const o=t.getBoundingClientRect(),n=window.scrollY+o.top-80;window.scrollTo({top:n,behavior:"smooth"})}};function Zs(r){const t=r.toLowerCase();if(["kb","mb","gb"].find(s=>t.endsWith(s)))return r;const l=Number(r);if(isNaN(l))throw new Error("Invalid size format");return l>=1e6?`${(l/1e6).toFixed(2)}MB`:l>=1e3?`${(l/1e3).toFixed(2)}KB`:`${l}B`}function Gs(r){const t=r.split("/");return t[t.length-1]}const Qs=r=>{var t,o;return e.jsxs(f.Box,{width:"width-full",paddingInline:"md",height:"height-full",direction:"row",justify:"space-between",align:"center",onClick:r.handleOnClickFile,fullHeight:!0,paddingBlock:"md",id:"file-item",borderRadius:"rounded-md",style:{border:"1px solid var(--sa-border-subtle)",cursor:"pointer"},children:[e.jsxs(ie.Flex,{direction:"row",align:"center",gap:"sm",style:{flex:1,minWidth:0},children:[e.jsx(M.Icon,{name:"DocumentFilled",size:"lg",style:{color:"var(--sa-icon-brand)",width:30,height:30,flexShrink:0}}),e.jsxs(ie.Flex,{direction:"column",style:{minWidth:0,flex:1},children:[e.jsx(D.Text,{fontWeight:"bold",style:{textOverflow:"ellipsis",whiteSpace:"nowrap",overflow:"hidden"},children:r.defaultFile?Gs(r.defaultFile.url):(t=r.fileSelected)==null?void 0:t.name}),r.defaultFile?(r.defaultFile.size||r.defaultFile.date)&&e.jsxs(ie.Flex,{direction:"row",gap:"xs",align:"center",children:[r.defaultFile.size&&e.jsx(D.Text,{fontSize:"sm",fontWeight:"medium",children:r.defaultFile.size}),r.defaultFile.size&&r.defaultFile.date&&e.jsx(M.Icon,{name:"Dot",size:"xs"}),r.defaultFile.date&&e.jsx(D.Text,{fontSize:"sm",fontWeight:"medium",style:{textWrap:"nowrap"},children:r.defaultFile.date})]}):e.jsxs(ie.Flex,{direction:"row",gap:"xs",align:"center",children:[e.jsx(D.Text,{fontSize:"sm",fontWeight:"medium",children:Zs(((o=r.fileSelected)==null?void 0:o.size.toString())||"100000")}),e.jsx(M.Icon,{name:"Dot",size:"xs"}),e.jsx(D.Text,{fontSize:"sm",fontWeight:"medium",style:{textWrap:"nowrap"},children:pl(new Date)})]})]})]}),e.jsx(j.Button,{size:"xs",variant:"tertiary",tone:"error",type:"button",onClick:n=>{n.stopPropagation(),r.handleOnDeleteFile()},iconLeft:e.jsx(M.Icon,{name:"Trash1"})})]})},bl=({status:r="default",labelPosition:t="outside-top",...o})=>{var p;const n=d.useRef(null),l=()=>{if(o.defaultFile){window.open(o.defaultFile.url);return}n.current&&n.current.click()},s=De.useMediaQuery("md"),c=r==="error"||typeof o.errorMessage=="string"&&!!o.errorMessage,i=o.label?e.jsxs(ie.Flex,{direction:"row",align:"center",gap:"xs",children:[e.jsx(D.Text,{style:{fontSize:"14px",fontWeight:500,color:"var(--sa-text-primary)"},children:o.label}),o.optional&&e.jsx("span",{style:{background:"var(--sa-background-neutral)",border:"1px solid var(--sa-border-subtle)",borderRadius:"4px",padding:"0 8px",fontSize:"10px",fontWeight:500,lineHeight:"18px",color:"var(--sa-text-primary)",display:"inline-flex",alignItems:"center"},children:"Optional"}),o.required&&e.jsx("span",{style:{fontSize:"14px",fontWeight:500,color:"var(--sa-text-error)"},children:"*"})]}):null,a=o.description?e.jsx(D.Text,{style:{fontSize:"12px",fontWeight:400,color:"var(--sa-text-subtlest, #6b6e76)",lineHeight:"18px"},children:o.description}):null,h=e.jsxs(e.Fragment,{children:[o.helperText&&e.jsx(D.Text,{style:{fontSize:"12px",fontWeight:400,color:"var(--sa-text-subtlest, #6b6e76)",lineHeight:"18px"},children:o.helperText}),o.errorText&&r==="error"&&e.jsx(D.Text,{style:{fontSize:"12px",fontWeight:400,color:"var(--sa-text-error, #a4133c)",lineHeight:"18px"},children:o.errorText}),o.errorMessage&&!o.errorText&&e.jsx(D.Text,{style:{fontSize:"12px",fontWeight:400,color:"var(--sa-text-error, #a4133c)",lineHeight:"18px"},children:o.errorMessage})]}),y=e.jsx("input",{type:"file",style:{display:"none"},ref:n,onChange:C=>{var E;return o.handleOnChangeFile(((E=C.target.files)==null?void 0:E.item(0))||null)},accept:(p=o.fileSupportOption)==null?void 0:p.map(C=>"."+(C==null?void 0:C.toLowerCase())).join(", ")}),b=e.jsxs(f.Box,{direction:"column",fullWidth:!0,style:{minHeight:"69px"},borderRadius:"rounded-md",display:"flex",justify:"center",align:"center",cursor:"pointer",gap:"md",...o.containerProps,children:[y,(o.fileSelected||o.defaultFile)&&e.jsx(Qs,{fileSelected:o.fileSelected,defaultFile:o.defaultFile,handleOnDeleteFile:o.handleOnDeleteFile,handleOnClickFile:l}),!o.fileSelected&&!o.defaultFile&&e.jsx(ws,{fileSupports:o.fileSupportOption,isDesktop:s,errorMessage:c?o.errorText||o.errorMessage||" ":void 0,status:c?"error":"default",handleOnClick:l,handleOnFileChange:o.handleOnChangeFile})]});return t==="outside-left"?e.jsxs(ie.Flex,{direction:"row",align:"flex-start",gap:"sm",style:{width:"100%"},children:[e.jsxs(ie.Flex,{direction:"column",gap:"xs",style:{width:"40%",minWidth:"120px",paddingTop:"10px"},children:[i,a]}),e.jsxs(ie.Flex,{direction:"column",gap:"sm",style:{flex:1,minWidth:0},children:[b,h]})]}):e.jsxs(ie.Flex,{direction:"column",gap:"sm",style:{width:"100%"},children:[i,a,b,h]})},Us=({size:r="md",direction:t="vertical",requiredTitle:o="(Required)",fullWidth:n=!1,...l})=>{var i,a,h;const s=l.hideMessageError||!1,c=t==="horizontal"?r==="sm"?342:r==="lg"?400:342:void 0;return e.jsxs(f.Box,{gap:t==="horizontal"?"spacing-96":"sm",direction:t==="horizontal"?"row":"column",...l.containerProps,children:[l.title&&e.jsx(fe,{condition:!!l.inputProps.required,fallback:e.jsxs(f.Box,{direction:"column",customMaxWidth:c,fullWidth:n,children:[e.jsx(ye,{children:l.title}),e.jsx(D.Text,{fontSize:r,color:"gray-500",children:l.description})]}),children:e.jsxs(f.Box,{direction:"column",customMaxWidth:c,fullWidth:n,children:[e.jsxs(ie.Flex,{direction:"row",gap:"xs",align:"center",children:[e.jsx(ye,{fontSize:r,children:l.title}),e.jsx(ye,{color:"error",fontSize:r,children:o}),e.jsx(fe,{condition:!!((i=l.tooltip)!=null&&i.label),children:e.jsx(me.Tooltip,{label:(a=l.tooltip)==null?void 0:a.label,arrowPosition:(h=l.tooltip)==null?void 0:h.arrowPosition,...l.tooltip,children:e.jsx(M.Icon,{name:"InfoCircle",size:r==="lg"?"sm":"xs",style:{color:"var(--sa-color-info-500, #00abeb)",marginTop:"6px"}})})})]}),e.jsx(fe,{condition:!!l.description,children:e.jsx(D.Text,{fontSize:r,color:"gray-500",children:l.description})})]})}),e.jsxs(ie.Flex,{direction:"column",gap:"xs",children:[e.jsx(bl,{...l.inputProps,status:l.errorMessage?"error":"default"}),!s&&l.errorMessage&&e.jsx(cr,{message:l.errorMessage})]})]})},Js=({size:r="md",direction:t="vertical",requiredTitle:o="(Required)",fullWidth:n=!1,required:l=!1,...s})=>{var a,h,y,b;const c=s.hideMessageError||!1,i=t==="horizontal"?r==="sm"?342:r==="lg"?400:342:void 0;return e.jsxs(f.Box,{gap:t==="horizontal"||t==="horizontal-inline"?"spacing-96":"sm",direction:t==="horizontal"||t==="horizontal-inline"?"row":"column",...s.containerProps,children:[s.title&&e.jsx(fe,{condition:!!l,fallback:e.jsxs(f.Box,{direction:"column",customMaxWidth:i,fullWidth:n,children:[e.jsx(ye,{children:s.title}),e.jsx(Ke.Body3,{props:{color:"gray-500"},children:s.description})]}),children:e.jsxs(f.Box,{direction:"column",customMaxWidth:i,fullWidth:n,children:[e.jsxs(ie.Flex,{direction:"row",gap:"xs",align:"center",children:[e.jsx(ye,{fontSize:r,children:s.title}),e.jsx(ye,{color:"error",fontSize:r,children:o}),e.jsx(fe,{condition:!!((a=s.tooltip)!=null&&a.label),children:e.jsx(me.Tooltip,{label:(h=s.tooltip)==null?void 0:h.label,arrowPosition:(y=s.tooltip)==null?void 0:y.arrowPosition,...s.tooltip,children:e.jsx(M.Icon,{name:"InfoCircle",size:r==="lg"?"sm":"xs",style:{color:"var(--sa-color-info-500, #00abeb)",marginTop:"6px"}})})})]}),e.jsx(fe,{condition:!!s.description,children:e.jsx(D.Text,{fontSize:r,color:"gray-500",children:s.description})})]})}),e.jsx(f.Box,{gap:t==="horizontal-inline"?"xl":"md",direction:t==="horizontal-inline"?"row":"column",align:"flex-start",children:e.jsx(Xr,{of:(b=s.checkBoxesList)==null?void 0:b.map(p=>({...p,isChecked:s.checkBoxesAreChecked.includes(p.id)})),render:p=>p.renderBadge?e.jsxs(f.Box,{direction:"row",justify:"space-between",gap:"lg",...s.badgeContainerProps,children:[e.jsx(tr.Checkbox,{name:p.name,value:p.id,checked:p.isChecked,onChange:C=>s.onChecked(C.target.value,p),label:p.name,description:p.description}),p.renderBadge]}):e.jsx(tr.Checkbox,{name:p.name,value:p.id,checked:p.isChecked,onChange:C=>s.onChecked(C.target.value,p),label:p.name,description:p.description})})}),!c&&s.errorMessage&&e.jsx(cr,{message:s.errorMessage})]})},Ys=({position:r="vertical",size:t="md",fullWidth:o=!1,...n})=>{var s;const l=r==="horizontal-inline"||r==="horizontal-block"?t==="sm"?342:t==="lg"?400:342:void 0;return e.jsxs(f.Box,{gap:r==="horizontal-inline"||r==="horizontal-block"?"spacing-96":"sm",direction:r==="horizontal-inline"||r==="horizontal-block"?"row":"column",children:[e.jsx(fe,{condition:!!n.description||!!n.title,children:e.jsxs(f.Box,{direction:"column",customMaxWidth:l,fullWidth:o,children:[n.title&&e.jsx(ye,{children:n.title}),e.jsx(fe,{condition:!!n.description,children:e.jsx(D.Text,{color:"gray-500",children:n.description})})]})}),e.jsx(f.Box,{gap:"sm",direction:r==="horizontal"||r==="horizontal-inline"?"row":"column",align:"flex-start",flexWrap:"wrap",children:e.jsx(Xr,{of:(s=n.radioList)==null?void 0:s.map(c=>({...c,isChecked:n.radioIsChecked===c.id})),render:({value:c,id:i,isChecked:a,subInput:h,label:y,description:b})=>e.jsxs(f.Box,{direction:"column",gap:"xs",customMaxWidth:l,children:[e.jsx(at.Radio,{id:`${i.toString()}-${c}`,name:n.groupName||y,label:y,value:c,checked:a,onChange:p=>n.onChecked({id:i,label:p.target.name,value:p.target.value}),disabled:n.disableAll},i),b&&e.jsx(D.Text,{color:"gray-500",style:{marginLeft:28},children:b}),h]})})}),n.errorMessage&&e.jsx(cr,{message:n.errorMessage})]})},Xs=({size:r="md",direction:t="vertical",requiredTitle:o="(Required)",fullWidth:n=!1,...l})=>{var i,a,h;const s=l.hideMessageError||!1,c=t==="horizontal"?r==="sm"?342:r==="lg"?400:342:void 0;return e.jsxs(f.Box,{gap:t==="horizontal"?"spacing-96":"sm",direction:t==="horizontal"?"row":"column",...l.containerProps,children:[l.title&&e.jsx(fe,{condition:!!l.inputProps.required,fallback:e.jsxs(f.Box,{direction:"column",customMaxWidth:c,fullWidth:n,children:[e.jsx(ye,{children:l.title}),e.jsx(D.Text,{fontSize:r,color:"gray-500",children:l.description})]}),children:e.jsxs(f.Box,{direction:"column",customMaxWidth:c,fullWidth:n,children:[e.jsxs(ie.Flex,{direction:"row",gap:"xs",align:"center",children:[e.jsx(ye,{fontSize:r,children:l.title}),e.jsx(ye,{color:"error",fontSize:r,children:o}),e.jsx(fe,{condition:!!((i=l.tooltip)!=null&&i.label),children:e.jsx(me.Tooltip,{label:(a=l.tooltip)==null?void 0:a.label,arrowPosition:(h=l.tooltip)==null?void 0:h.arrowPosition,...l.tooltip,children:e.jsx(M.Icon,{name:"InfoCircle",size:r==="lg"?"sm":"xs",style:{color:"var(--sa-color-info-500, #00abeb)",marginTop:"6px"}})})})]}),e.jsx(fe,{condition:!!l.description,children:e.jsx(D.Text,{fontSize:r,color:"gray-500",children:l.description})})]})}),e.jsxs(ie.Flex,{direction:"column",gap:"xs",children:[e.jsx(it.Textarea,{ref:l.inputRef,size:r,...l.inputProps,status:l.errorMessage?"error":"default"}),!s&&l.errorMessage&&e.jsx(cr,{message:l.errorMessage})]})]})},$s=({size:r="md",direction:t="vertical",requiredTitle:o="(Required)",required:n=!1,fullWidth:l=!1,...s})=>{var i,a,h;const c=t==="horizontal"?r==="sm"?342:r==="lg"?400:342:void 0;return e.jsxs(f.Box,{gap:t==="horizontal"?"spacing-96":"sm",direction:t==="horizontal"?"row":"column",...s.containerProps,children:[s.title&&e.jsx(fe,{condition:n,fallback:e.jsxs(f.Box,{direction:"column",customMaxWidth:c,fullWidth:l,children:[e.jsx(ye,{children:s.title}),e.jsx(D.Text,{fontSize:r,color:"gray-500",children:s.titleDescription})]}),children:e.jsxs(f.Box,{direction:"column",customMaxWidth:c,fullWidth:l,children:[e.jsxs(ie.Flex,{direction:"row",gap:"xs",align:"center",children:[e.jsx(ye,{fontSize:r,children:s.title}),e.jsx(ye,{color:"error",fontSize:r,children:o}),e.jsx(fe,{condition:!!((i=s.tooltip)!=null&&i.label),children:e.jsx(me.Tooltip,{label:(a=s.tooltip)==null?void 0:a.label,arrowPosition:(h=s.tooltip)==null?void 0:h.arrowPosition,...s.tooltip,children:e.jsx(M.Icon,{name:"InfoCircle",size:r==="lg"?"sm":"xs",style:{color:"var(--sa-color-info-500, #00abeb)",marginTop:"6px"}})})})]}),e.jsx(fe,{condition:!!s.titleDescription,children:e.jsx(D.Text,{fontSize:r,color:"gray-500",children:s.titleDescription})})]})}),e.jsx(xr.Toggle,{checked:s.checked,onChange:s.onChange,label:s.label,description:s.description}),s.errorMessage&&e.jsx(cr,{message:s.errorMessage})]})},Ks=({variant:r="primary",size:t="md",...o})=>{const n=Cr.useColor(),l=c=>{var a,h,y,b,p,C;if(!c)return;const i=o.disabled?"var(--sa-text-disable, #181a198f)":r==="secondary"?"var(--sa-text-subtle, #8c8f97)":r==="secondary-danger"?(h=(a=n==null?void 0:n.computed)==null?void 0:a.red)==null?void 0:h[600]:r==="secondary-primary"?(b=(y=n==null?void 0:n.computed)==null?void 0:y.blue)==null?void 0:b[700]:(C=(p=n==null?void 0:n.computed)==null?void 0:p.gray)==null?void 0:C[50];return e.jsx(M.Icon,{name:c,size:t,style:{color:i}})},s=()=>{var i,a,h,y;if(r!=="secondary-danger"&&r!=="secondary-primary")return o.title;const c={color:o.disabled?"var(--sa-text-disable, #181a198f)":r==="secondary-danger"?(a=(i=n==null?void 0:n.computed)==null?void 0:i.red)==null?void 0:a[600]:(y=(h=n==null?void 0:n.computed)==null?void 0:h.blue)==null?void 0:y[700]};switch(t){case"xs":return e.jsx(Ke.Body2,{props:{style:c},children:o.title});case"sm":case"md":return e.jsx(Ke.SubH3,{props:{style:c},children:o.title});case"lg":return e.jsx(Ke.SubH2,{props:{style:c},children:o.title});default:return o.title}};return e.jsx(j.Button,{fullWidth:!0,disabled:o.disabled,primary:r==="primary",secondary:r==="secondary"||r==="secondary-danger"||r==="secondary-primary",success:r==="success",onClick:o.onClick,type:o.type,iconLeft:l(o.iconLeft),iconRight:l(o.iconRight),size:t,children:s()})},Rs=r=>e.jsx(Ke.H5,{props:{...r},children:r.title}),ec=({size:r="md",direction:t="vertical",requiredTitle:o="(Required)",fullWidth:n=!1,...l})=>{var i,a,h;const s=l.hideMessageError||!1,c=t==="horizontal"?r==="sm"?342:r==="lg"?400:342:void 0;return e.jsxs(f.Box,{gap:t==="horizontal"?"spacing-96":"sm",direction:t==="horizontal"?"row":"column",onClick:l.onClickContainer,children:[l.title&&e.jsx(fe,{condition:!!l.inputProps.required,fallback:e.jsxs(f.Box,{direction:"column",customMaxWidth:c,fullWidth:n,children:[e.jsx(ye,{children:l.title}),e.jsx(D.Text,{fontSize:r,color:"gray-500",children:l.description})]}),children:e.jsxs(f.Box,{direction:"column",customMaxWidth:c,fullWidth:n,children:[e.jsxs(ie.Flex,{direction:"row",gap:"xs",align:"center",children:[e.jsx(ye,{fontSize:r,children:l.title}),e.jsx(ye,{color:"error",fontSize:r,children:o}),e.jsx(fe,{condition:!!((i=l.tooltip)!=null&&i.label),children:e.jsx(me.Tooltip,{label:(a=l.tooltip)==null?void 0:a.label,arrowPosition:(h=l.tooltip)==null?void 0:h.arrowPosition,...l.tooltip,children:e.jsx(M.Icon,{name:"InfoCircle",size:r==="lg"?"sm":"xs",style:{color:"var(--sa-color-info-500, #00abeb)",marginTop:"6px"}})})})]}),e.jsx(fe,{condition:!!l.description,children:e.jsx(D.Text,{fontSize:r,color:"gray-500",children:l.description})})]})}),e.jsxs(ie.Flex,{direction:"column",gap:"xs",children:[e.jsx(f.Box,{direction:"column",style:{width:t==="horizontal"&&l.customWidth?l.customWidth:t==="horizontal"?"343px":""},children:e.jsx(fr.StarasiaDate,{size:r,...l.inputProps,status:l.errorMessage?"error":void 0})}),!s&&l.errorMessage&&e.jsx(cr,{message:l.errorMessage})]})]})};async function rc(r,t){const o=new Image;o.src=r,await new Promise((s,c)=>{o.onload=s,o.onerror=c});const n=document.createElement("canvas");n.width=t.width,n.height=t.height;const l=n.getContext("2d",{alpha:!0});if(!l)throw new Error("No 2D context");return l.drawImage(o,t.x,t.y,t.width,t.height,0,0,t.width,t.height),new Promise((s,c)=>{n.toBlob(i=>{if(!i)return c("Canvas is empty");const a=new File([i],"cropped.png",{type:"image/png"});s(a)},"image/png")})}const vl={"1:1":1,"4:3":4/3,"16:9":16/9,"3:4":3/4,"9:16":9/16,"2:3":2/3,"3:2":3/2,"32:9":32/9},Cl=d.forwardRef(({handleUpload:r,urlImage:t,isUploading:o,croppedImage:n,setCroppedImage:l,size:s="96",aspect:c="1:1",containerProps:i,maxFileSize:a=2,onError:h},y)=>{const b=De.useMediaQuery("md"),[p,C]=d.useState(!1),[E,w]=d.useState(null),[L,F]=d.useState(!1),[I,B]=d.useState({x:0,y:0}),[k,H]=d.useState(1),[W,S]=d.useState(null);d.useEffect(()=>{t===null&&l(null)},[t]);const z=d.useCallback((V,N)=>{S(N)},[]),O=V=>{var ve;const N=(ve=V.target.files)==null?void 0:ve[0];if(!N)return;const se=new FileReader;se.onload=()=>{w(se.result),F(!0)},se.readAsDataURL(N)},Y=async()=>{if(!(!E||!W))try{const V=await rc(E,W);if(a&&V.size>a*1024*1024){h==null||h(`Ukuran file maksimal ${a}MB`);return}r==null||r(V);const N=URL.createObjectURL(V);l(N,V),F(!1)}catch{h==null||h("Gagal memproses gambar")}},X=d.useRef(null),q=()=>{X.current&&X.current.click()};d.useImperativeHandle(y,()=>({openFileDialog:()=>{var V;(V=X.current)==null||V.click()}}));const Z=parseInt(s,10),K=vl[c];let te,_;return K>=1?(_=Z,te=Z*K):(te=Z,_=Z/K),e.jsxs(f.Box,{direction:"column",display:"flex",position:"relative",bg:(i==null?void 0:i.bg)||"gray-200",borderStyle:(i==null?void 0:i.borderStyle)||"border-none",borderColor:(i==null?void 0:i.borderColor)||"gray-200",borderWidth:(i==null?void 0:i.borderWidth)||"border-2",borderRadius:(i==null?void 0:i.borderRadius)||"rounded-md",overflow:"overflow-hidden",align:"center",justify:"center",style:{width:i!=null&&i.fullWidth?"100%":`${te}px`,height:i!=null&&i.fullWidth?"auto":`${_}px`,aspectRatio:K,flexShrink:0},onMouseEnter:()=>C(!0),onMouseLeave:()=>C(!1),children:[n||t?e.jsx("img",{src:n||t||void 0,alt:"Profile",style:{objectFit:"cover",width:"100%",height:"100%"}}):e.jsx(f.Box,{display:"flex",direction:"column",align:"center",justify:"center",padding:"spacing-4",children:e.jsx(M.Icon,{name:"Image",style:{color:"var(--sa-text-subtle, #8c8f97)",width:Number(s)/2<40?Number(s)/2:40,height:Number(s)/2<40?Number(s)/2:40}})}),e.jsxs(f.Box,{direction:"column",position:"absolute",display:"flex",align:"center",justify:"center",cursor:"pointer",style:{inset:0,backgroundColor:"var(--sa-color-black-alpha-a30, #080f214a)",opacity:p?1:0,transition:"opacity 0.3s ease-in-out"},onClick:q,children:[e.jsx("input",{ref:X,type:"file",accept:"image/*",onChange:O,disabled:o,style:{display:"none"}}),e.jsxs(f.Box,{display:"flex",align:"center",gap:"spacing-2",direction:"row",children:[e.jsx(M.Icon,{name:"Edit3",style:{color:"var(--sa-background-primary, #ffffff)"}}),e.jsx(fe,{condition:s.toNumber()>80,children:e.jsx(D.Text,{color:"gray-50",fontSize:s.toNumber()>80?"sm":"md",fontWeight:"medium",children:"Edit Image"})})]})]}),o&&e.jsx(f.Box,{direction:"column",position:"absolute",display:"flex",align:"center",justify:"center",style:{inset:0,zIndex:20,backgroundColor:"var(--sa-color-white-alpha-a80, #e5e9f640)"},children:e.jsx(f.Box,{direction:"column",borderRadius:"rounded-full",style:{animation:"spin 1s linear infinite",border:"2px solid transparent",height:"2rem",width:"2rem"},borderColor:"info-600"})}),L&&Pr.createPortal(e.jsx("div",{style:{position:"fixed",inset:0,zIndex:19999,display:"flex",alignItems:"center",justifyContent:"center",backgroundColor:"rgba(0,0,0,0.6)"},onClick:()=>F(!1),children:e.jsxs("div",{style:{backgroundColor:"var(--sa-background-primary)",borderRadius:"var(--sa-radii-md)",boxShadow:"0 20px 60px rgba(0,0,0,0.3)",overflow:"hidden",width:b?c==="1:1"?"min(90vw, 480px)":`min(90vw, ${te*2}px)`:"calc(100vw - 2rem)",display:"flex",flexDirection:"column"},onClick:V=>V.stopPropagation(),children:[e.jsx("div",{style:{position:"relative",width:"100%",height:"20rem",backgroundColor:"var(--sa-color-gray-100)"},children:E&&e.jsx(Nl,{image:E,crop:I,zoom:k,aspect:c?vl[c]:void 0,onCropChange:B,onZoomChange:H,onCropComplete:z,objectFit:"contain",minZoom:.5,restrictPosition:!1})}),e.jsxs("div",{style:{display:"flex",justifyContent:"flex-end",gap:"0.5rem",padding:"0.75rem 1rem",borderTop:"1px solid var(--sa-border-subtle)"},children:[e.jsx(j.Button,{size:"sm",secondary:!0,onClick:()=>F(!1),children:"Cancel"}),e.jsx(j.Button,{size:"sm",primary:!0,onClick:Y,children:"Crop"})]})]})}),document.body)]})}),tc=({size:r="md",direction:t="vertical",requiredTitle:o="(Required)",fullWidth:n=!1,required:l=!1,...s})=>{var a,h,y;const c=s.hideMessageError||!1,i=t==="horizontal"?r==="sm"?342:r==="lg"?400:342:void 0;return e.jsxs(f.Box,{gap:t==="horizontal"?"spacing-96":"sm",direction:t==="horizontal"?"row":"column",...s.containerProps,children:[s.title&&e.jsx(fe,{condition:!!l,fallback:e.jsxs(f.Box,{direction:"column",customMaxWidth:i,fullWidth:n,children:[e.jsx(ye,{children:s.title}),e.jsx(D.Text,{fontSize:r,color:"gray-500",children:s.description})]}),children:e.jsxs(f.Box,{direction:"column",customMaxWidth:i,fullWidth:n,children:[e.jsxs(ie.Flex,{direction:"row",gap:"xs",align:"center",children:[e.jsx(ye,{fontSize:r,children:s.title}),e.jsx(ye,{color:"error",fontSize:r,children:o}),e.jsx(fe,{condition:!!((a=s.tooltip)!=null&&a.label),children:e.jsx(me.Tooltip,{label:(h=s.tooltip)==null?void 0:h.label,arrowPosition:(y=s.tooltip)==null?void 0:y.arrowPosition,...s.tooltip,children:e.jsx(M.Icon,{name:"InfoCircle",size:r==="lg"?"sm":"xs",style:{color:"var(--sa-color-info-500, #00abeb)",marginTop:"6px"}})})})]}),e.jsx(fe,{condition:!!s.description,children:e.jsx(D.Text,{fontSize:r,color:"gray-500",children:s.description})})]})}),e.jsxs(ie.Flex,{direction:"column",gap:"xs",children:[e.jsx(Cl,{...s.inputProps}),!c&&s.errorMessage&&e.jsx(cr,{message:s.errorMessage})]})]})},oc=({size:r="md",direction:t="vertical",requiredTitle:o="(Required)",fullWidth:n=!1,...l})=>{var c,i,a;const s=t==="horizontal"?r==="sm"?342:r==="lg"?400:342:void 0;return e.jsxs(f.Box,{gap:t==="horizontal"?"spacing-96":"sm",direction:t==="horizontal"?"row":"column",...l.containerProps,children:[l.title&&e.jsx(fe,{condition:!!l.inputProps.required,fallback:e.jsxs(f.Box,{direction:"column",customMaxWidth:s,fullWidth:n,children:[e.jsx(ye,{children:l.title}),e.jsx(D.Text,{fontSize:r,color:"gray-500",children:l.description})]}),children:e.jsxs(f.Box,{direction:"column",customMaxWidth:s,fullWidth:n,children:[e.jsxs(ie.Flex,{direction:"row",gap:"xs",align:"center",children:[e.jsx(ye,{fontSize:r,children:l.title}),e.jsx(ye,{color:"error",fontSize:r,children:o}),e.jsx(fe,{condition:!!((c=l.tooltip)!=null&&c.label),children:e.jsx(me.Tooltip,{label:(i=l.tooltip)==null?void 0:i.label,arrowPosition:(a=l.tooltip)==null?void 0:a.arrowPosition,...l.tooltip,children:e.jsx(M.Icon,{name:"InfoCircle",size:r==="lg"?"sm":"xs",style:{color:"var(--sa-color-info-500, #00abeb)",marginTop:"6px"}})})})]}),e.jsx(fe,{condition:!!l.description,children:e.jsx(D.Text,{fontSize:r,color:"gray-500",children:l.description})})]})}),l.inputProps.extended&&l.inputProps.extended]})},lc=({items:r,id:t,handleOnUpdate:o,width:n,toggleShow:l=!0,disabled:s=!1})=>{var y;const[c,i]=d.useState([]);d.useEffect(()=>{r&&i([...r.map(b=>({id:b.id,isActive:b.isActive}))])},[r]);const a=(y=c.find(b=>b.id===t))==null?void 0:y.isActive,h=d.useCallback(()=>{i(b=>b.map(p=>p.id===t?{...p,isActive:!p.isActive}:p)),o&&o(!a)},[t,o,a]);return e.jsx(f.Box,{direction:"row",gap:"md",style:{width:n},children:l&&e.jsx(xr.Toggle,{disabled:s,checked:a,onChange:h,label:a?"Active":"Inactive"})})},nc={InputText:vs,InputDropdown:Cs,InputSingleFile:Us,CheckBoxOptions:Js,RadioOptions:Ys,InputTextArea:Xs,ToggleForm:$s,ActionButton:Ks,FormTitle:Rs,InputDate:ec,InputImgFile:tc,Custom:oc},xl=({customBottom:r})=>{const[t,o]=d.useState(!1),n=()=>{window.scrollY>window.screenY?o(!0):o(!1)},l=()=>{window.scrollTo({top:0,behavior:"smooth"})};return d.useEffect(()=>(window.addEventListener("scroll",n),()=>{window.removeEventListener("scroll",n)}),[]),e.jsx(f.Box,{direction:"column",style:{position:"fixed",bottom:0,right:0},children:e.jsx(f.Box,{direction:"column",position:"absolute",style:{bottom:r||"1.6rem",right:"2rem",transform:t?"scale(1)":"scale(0)",transition:"transform 0.2s ease-in-out"},children:e.jsx(j.Button,{secondary:!0,size:"xs",onClick:l,type:"button",iconLeft:e.jsx(M.Icon,{width:16,size:"xs",name:"ArrowPullUp",style:{color:"var(--sa-background-brand, #04254f)"}})})})})},qe="sa-sidepanel-item",wl="sa-sidepanel-item-styles",sc=`
|
|
58
|
+
.${qe} {
|
|
59
59
|
display: block;
|
|
60
60
|
box-sizing: border-box;
|
|
61
61
|
width: 100%;
|
|
@@ -70,39 +70,39 @@
|
|
|
70
70
|
outline: none;
|
|
71
71
|
transition: background-color 140ms ease, box-shadow 140ms ease;
|
|
72
72
|
}
|
|
73
|
-
.${
|
|
73
|
+
.${qe}[data-divider="true"] {
|
|
74
74
|
border-bottom: 1px solid var(--sa-border-subtle, #0b120e24);
|
|
75
75
|
}
|
|
76
76
|
/* The first row also gets a top line so the list is bounded on its own,
|
|
77
77
|
without relying on a wrapping container's border. Adjacent rows still
|
|
78
78
|
share a single 1px line (only border-bottom), never a doubled 2px one. */
|
|
79
|
-
.${
|
|
79
|
+
.${qe}[data-divider="true"]:first-child {
|
|
80
80
|
border-top: 1px solid var(--sa-border-subtle, #0b120e24);
|
|
81
81
|
}
|
|
82
|
-
.${
|
|
82
|
+
.${qe}:hover {
|
|
83
83
|
background: var(--sa-background-neutral, #f0f1f2);
|
|
84
84
|
}
|
|
85
|
-
.${
|
|
86
|
-
.${
|
|
85
|
+
.${qe}:focus-visible,
|
|
86
|
+
.${qe}[data-active="true"] {
|
|
87
87
|
background: var(--sa-background-brand-subtlest, #e6edf6);
|
|
88
88
|
}
|
|
89
|
-
.${
|
|
89
|
+
.${qe}:focus-visible {
|
|
90
90
|
background: var(--sa-background-neutral, #f0f1f2);
|
|
91
91
|
}
|
|
92
92
|
/* Accent bar — sign of the offset picks the edge it hugs. */
|
|
93
|
-
.${
|
|
94
|
-
.${
|
|
93
|
+
.${qe}[data-accent="left"]:focus-visible,
|
|
94
|
+
.${qe}[data-accent="left"][data-active="true"] {
|
|
95
95
|
box-shadow: inset 3.5px 0 0 0 var(--sa-border-focused, #1a4fa0);
|
|
96
96
|
}
|
|
97
|
-
.${
|
|
98
|
-
.${
|
|
97
|
+
.${qe}[data-accent="right"]:focus-visible,
|
|
98
|
+
.${qe}[data-accent="right"][data-active="true"] {
|
|
99
99
|
box-shadow: inset -3.5px 0 0 0 var(--sa-border-focused, #1a4fa0);
|
|
100
100
|
}
|
|
101
|
-
.${
|
|
101
|
+
.${qe}[data-active="true"]:hover {
|
|
102
102
|
background: var(--sa-background-brand-subtlest, #e6edf6);
|
|
103
103
|
}
|
|
104
|
-
.${
|
|
104
|
+
.${qe}:disabled {
|
|
105
105
|
cursor: not-allowed;
|
|
106
106
|
opacity: 0.55;
|
|
107
107
|
}
|
|
108
|
-
`;function ri(){if(typeof document>"u"||document.getElementById(pl))return;const r=document.createElement("style");r.id=pl,r.textContent=ei,document.head.appendChild(r)}const ti=({active:r=!1,accentSide:t="left",onClick:o,title:n,badge:l,heading:s,meta:i,children:c,divider:a=!0,disabled:h,className:y,style:b,"aria-label":p})=>(d.useEffect(ri,[]),e.jsx("button",{type:"button",className:[Ve,y].filter(Boolean).join(" "),"data-active":r?"true":"false","data-accent":t,"data-divider":a?"true":"false","aria-current":r?"true":void 0,"aria-label":p,disabled:h,onClick:o,style:b,children:c??e.jsxs(u.Box,{display:"flex",direction:"column",gap:"spacing-4",fullWidth:!0,style:{minWidth:0},children:[(n||l)&&e.jsxs(se.Flex,{direction:"row",align:"center",justify:"space-between",gap:"sm",style:{minWidth:0},children:[n?e.jsx(B.Text,{fontSize:"sm",style:{minWidth:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",color:"var(--sa-text-primary, #292a2e)"},children:n}):e.jsx("span",{}),l?e.jsx(u.Box,{style:{flexShrink:0},children:l}):null]}),s?e.jsx(B.Text,{fontSize:"md",fontWeight:"semibold",style:{color:"var(--sa-text-primary, #292a2e)"},children:s}):null,i?e.jsx(B.Text,{fontSize:"sm",style:{color:"var(--sa-text-subtlest, #6b6e76)"},children:i}):null]})})),It=18,oi=40,bl="280ms cubic-bezier(0.4, 0, 0.2, 1)",vl="var(--sa-border-subtle, #0b120e24)",li=`1px solid ${vl}`,Cl="var(--sa-background-white, #ffffff)",ni=({children:r,header:t,collapsed:o,defaultCollapsed:n=!1,onToggle:l,width:s=337,side:i="left",offsetTop:c="var(--app-header-height, 4rem)",height:a,showToggle:h=!0,togglePosition:y="top",toggleOffset:b=40,toggleLabel:p,style:C,bodyStyle:E,className:w,pageLayout:L,overlay:F="mobile",wrapperProps:I,contentProps:S})=>{const D=De.useMediaQuery("md"),H=o!==void 0,[A,k]=d.useState(n),z=H?o:A,W=()=>{const ce=!z;H||k(ce),l==null||l(ce)},X=i==="left",K=typeof c=="number"?`${c}px`:c,Q=a!==void 0?typeof a=="number"?`${a}px`:a:`calc(100vh - ${K})`,_=p??{collapse:"Collapse panel",expand:"Expand panel"},R=y==="center"?{top:"50%",transform:"translateY(-50%)"}:y==="bottom"?{bottom:b}:{top:b},re=z?X?"ChevronRight":"ChevronLeft":X?"ChevronLeft":"ChevronRight",q=L!==void 0&&(F==="mobile"?!D:F),P=q?{position:"absolute",top:0,bottom:0,width:s,transform:`translateX(${z?X?"-100%":"100%":"0"})`,transition:`transform ${bl}`,zIndex:50,...X?{left:0}:{right:0},...C}:{position:"sticky",top:K,alignSelf:"flex-start",width:z?0:s,flexShrink:0,height:Q,transition:`width ${bl}`,...C},N=e.jsxs(u.Box,{className:w,style:P,children:[e.jsx(u.Box,{fullWidth:!0,fullHeight:!0,display:"flex",direction:"column",overflow:"overflow-hidden",borderStyle:z?void 0:X?"border-solid-r":"border-solid-l",borderWidth:z?void 0:X?"border-r":"border-l",style:{backgroundColor:Cl,borderColor:vl},children:e.jsxs(u.Box,{fullHeight:!0,display:"flex",direction:"column",customWidth:s,customMinWidth:s,style:X?void 0:{marginLeft:"auto"},children:[t?e.jsx(u.Box,{padding:"md",style:{flexShrink:0},children:t}):null,e.jsx(u.Box,{display:"block",overflow:"overflow-y-auto",style:{flex:"1 1 0",minHeight:0,...E},children:r})]})}),h&&e.jsx(Er,{display:"inline-flex",align:"center",justify:"center",position:"absolute",onClick:W,"aria-label":z?_.expand:_.collapse,"aria-expanded":!z,"aria-pressed":z,customWidth:It,customHeight:oi,style:{...R,backgroundColor:Cl,border:li,zIndex:5,...X?{right:-It,borderLeft:"none",borderRadius:"0 8px 8px 0"}:{left:-It,borderRight:"none",borderRadius:"8px 0 0 8px"}},children:e.jsx(T.Icon,{name:re,size:"sm"})})]});return L===void 0?N:e.jsxs(u.Box,{direction:"row",position:"relative",...I,style:{height:`calc(100vh - ${K})`,overflow:"hidden",...(I==null?void 0:I.style)??{}},children:[!q&&X?N:null,e.jsx(u.Box,{display:"block",...S,style:{flex:"1 1 0",minWidth:0,height:"100%",overflowY:"auto",...(S==null?void 0:S.style)??{}},children:L}),!q&&!X?N:null,q&&e.jsxs(e.Fragment,{children:[!z&&e.jsx("div",{onClick:W,"aria-hidden":"true",style:{position:"absolute",inset:0,backgroundColor:"rgba(0, 0, 0, 0.4)",zIndex:40}}),N]})]})},Ot="--app-aside-width",si=r=>typeof r=="number"?`${r}px`:r,ii=({pageLayout:r,children:t,wrapperProps:o,containerProps:n})=>{const l=De.useMediaQuery("md"),s=(n==null?void 0:n.customWidth)??264;return d.useLayoutEffect(()=>{const i=document.documentElement;return i.style.setProperty(Ot,l?si(s):"0px"),()=>i.style.removeProperty(Ot)},[l,s]),e.jsxs(u.Box,{display:"block",direction:"row",...o,style:{marginRight:l?s:24,...(o==null?void 0:o.style)??{}},children:[r,e.jsx(u.Box,{direction:"column",show:"desktop",as:"aside",position:"fixed",top:"top-0",bottom:"bottom-0",right:"right-0",customWidth:264,borderStyle:"border-solid-l",borderWidth:"border-l",...n,style:{marginTop:"var(--app-header-height, 4rem)",backgroundColor:"var(--sa-background-white, #ffffff)",borderColor:"var(--sa-border-subtle, #0b120e24)",...(n==null?void 0:n.style)??{}},children:t})]})},Wt="--sa-floating-footer-height",ci=r=>typeof r=="number"?`${r}px`:r,ai=({children:r,withScrollToTopButton:t=!1,scrollToTopButtonProps:o,respectAside:n=!1,offsetRight:l,containerProps:s})=>{const i=d.useRef(null),c=l!=null?ci(l):n?"var(--app-aside-width, 0px)":"0px";return d.useLayoutEffect(()=>{const a=document.documentElement,h=()=>{var p;const b=((p=i.current)==null?void 0:p.getBoundingClientRect().height)??0;a.style.setProperty(Wt,`${b}px`)};h();const y=new ResizeObserver(h);return i.current&&y.observe(i.current),()=>{y.disconnect(),a.style.removeProperty(Wt)}},[]),e.jsx(u.Box,{direction:"column",position:"absolute",width:"width-full",style:{zIndex:"var(--app-footer-zindex, 998)"},children:e.jsxs(u.Box,{ref:i,position:"fixed",bottom:"bottom-0",bg:"white",direction:"row",align:"center",display:"flex",paddingBlock:"sm",paddingInline:"md",borderColor:"border-subtle",style:{left:"var(--app-sidebar-width, 0px)",right:c,transition:"left 0.3s ease-in-out, right 0.3s ease-in-out"},justify:(s==null?void 0:s.justify)||"flex-end",borderStyle:"border-solid-t",borderWidth:"border-t",children:[t&&e.jsx(yl,{...o,customBottom:(o==null?void 0:o.customBottom)||"5.7rem"}),r]})})},di=({fields:r})=>e.jsx(u.Box,{display:"flex",direction:"column",gap:"lg",children:e.jsx(Yr,{of:r,render:(t,o)=>e.jsx(hi,{...t},o)})}),hi=({title:r,value:t,icon:o})=>e.jsxs(u.Box,{display:"flex",direction:"column",gap:"sm",children:[o?e.jsxs(u.Box,{display:"flex",direction:"row",align:"center",gap:"xs",children:[e.jsx(T.Icon,{name:o,color:"subtle"}),e.jsx(B.Text,{color:"gray-500",variant:"sub-h3",children:r})]}):e.jsx(B.Text,{color:"gray-500",variant:"sub-h3",children:r}),typeof t=="string"?e.jsx(B.Text,{variant:"sub-h3",children:t}):t]}),Me={silhouette:"#A7B0AC",accent:"#78867F"};function fi({width:r,height:t}){return e.jsx(e.Fragment,{children:e.jsxs("svg",{width:r||"100",height:t||"90",viewBox:"0 0 102 90",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[e.jsx("path",{d:"M51.0002 16.8145C36.0811 16.8145 24.8296 21.3801 24.8296 27.4328V76.5344C24.8296 82.573 36.0799 87.127 51.0002 87.127C65.9204 87.127 77.1707 82.573 77.1707 76.5344V27.4328C77.1707 21.3801 65.9204 16.8145 51.0002 16.8145ZM51.0002 19.1582C65.0602 19.1582 74.8582 23.5187 74.8582 27.4328C74.8582 30.1363 70.1615 32.9664 63.1708 34.4746C55.861 36.0543 46.1416 36.0543 38.8318 34.4746C31.8399 32.9664 27.1432 30.1363 27.1432 27.4328C27.1432 23.5187 36.9402 19.1582 51.0002 19.1582ZM74.8582 31.9199V43.784C74.8582 46.532 70.3142 49.2941 63.2737 50.8328C63.2391 50.8375 63.2032 50.8434 63.1697 50.8504C57.6867 52.0352 50.8498 52.3305 44.6893 51.7387C42.6358 51.5418 40.6575 51.2453 38.8306 50.8504C38.8029 50.8445 38.7682 50.8387 38.7347 50.8352C32.5707 49.4898 28.318 47.2047 27.3514 44.8141C27.2138 44.4719 27.1421 44.1285 27.1421 43.7852V31.9199C27.1999 31.9715 27.2693 32.0207 27.3294 32.0723C27.5052 32.2246 27.6902 32.3758 27.8844 32.5234C27.9954 32.609 28.1064 32.6934 28.2232 32.7766C28.4371 32.9301 28.6637 33.0801 28.8973 33.2289C29.0083 33.2992 29.1135 33.3719 29.2291 33.441C29.5702 33.6473 29.9275 33.8488 30.3044 34.0434C30.3195 34.0516 30.3333 34.0598 30.3484 34.068C30.7427 34.2707 31.1601 34.4652 31.5925 34.6551C31.7301 34.716 31.8758 34.7734 32.0168 34.832C32.3221 34.9598 32.6331 35.0852 32.9557 35.207C33.1303 35.2727 33.3095 35.3359 33.4887 35.4004C33.8032 35.5117 34.1247 35.6207 34.4542 35.7273C34.6404 35.7871 34.8254 35.8469 35.015 35.9043C35.3734 36.0133 35.7434 36.1164 36.1181 36.2184C36.2915 36.2652 36.4603 36.3145 36.6361 36.3602C37.1911 36.5031 37.7588 36.6402 38.3485 36.7668C42.1595 37.5906 46.5336 38.0254 50.999 38.0254C55.4644 38.0254 59.8397 37.5906 63.6495 36.768C64.2404 36.6402 64.8092 36.5031 65.3666 36.3602C65.5377 36.3156 65.7007 36.2688 65.8684 36.223C66.2499 36.1199 66.6246 36.0145 66.9888 35.9031C67.1749 35.8469 67.3553 35.7883 67.5368 35.7309C67.8745 35.623 68.2028 35.5105 68.5243 35.3969C68.6966 35.3359 68.8677 35.275 69.0353 35.2117C69.3672 35.0863 69.6852 34.9574 69.9985 34.8262C70.1326 34.7699 70.2725 34.7148 70.4032 34.6574C70.8379 34.4664 71.2576 34.2707 71.6542 34.0668C71.66 34.0633 71.6658 34.0609 71.6716 34.0574C72.0589 33.8582 72.4243 33.6508 72.7735 33.441C72.8868 33.3719 72.9909 33.3016 73.1007 33.2313C73.3354 33.0813 73.5632 32.9312 73.7794 32.7766C73.8951 32.6934 74.0049 32.609 74.1159 32.5258C74.3102 32.377 74.4963 32.2258 74.6732 32.0723C74.7322 32.0207 74.8027 31.9727 74.8594 31.9211L74.8582 31.9199ZM74.8582 48.2887V60.1598C74.8582 62.8773 70.3396 65.6359 63.335 67.2004C63.2737 67.2051 63.2136 67.2156 63.1547 67.2285C59.5021 68.016 55.2482 68.4109 50.9955 68.4098C48.8692 68.4098 46.7428 68.3113 44.6917 68.1145C42.6405 67.9176 40.6656 67.6211 38.8399 67.2273C38.7832 67.2133 38.7266 67.2051 38.6699 67.2004C31.663 65.6359 27.1432 62.8785 27.1432 60.1598V48.2887C27.2022 48.3426 27.2739 48.393 27.3352 48.4457C27.5075 48.5945 27.6878 48.7422 27.8763 48.8875C27.9908 48.9754 28.1052 49.0633 28.2255 49.15C28.4348 49.3 28.6568 49.4477 28.8834 49.593C28.999 49.6668 29.1089 49.7418 29.228 49.8145C29.5633 50.0172 29.9136 50.2152 30.2825 50.4074C30.3114 50.4227 30.338 50.4379 30.3669 50.452C30.7507 50.6488 31.1566 50.8398 31.5775 51.0262C31.722 51.0895 31.8746 51.1504 32.0226 51.2125C32.3198 51.3379 32.6227 51.4609 32.9372 51.5793C33.1164 51.6473 33.2991 51.7129 33.4841 51.7785C33.7917 51.8887 34.1073 51.9953 34.4299 52.0996C34.6196 52.1605 34.8092 52.2227 35.0046 52.2812C35.3584 52.3891 35.7238 52.4922 36.0938 52.593C36.2684 52.641 36.4395 52.6902 36.6176 52.7359C37.1714 52.8789 37.738 53.016 38.3253 53.1426C38.3554 53.1496 38.3889 53.1555 38.4236 53.159C42.2161 53.9723 46.5636 54.4023 51.0013 54.4023C55.439 54.4023 59.7784 53.9734 63.5697 53.1613C63.6056 53.1566 63.6414 53.1508 63.6773 53.1426C64.2647 53.0148 64.8312 52.8789 65.3851 52.7359C65.5643 52.6902 65.7342 52.6398 65.9088 52.593C66.2788 52.4922 66.6442 52.3891 66.998 52.2812C67.1934 52.2215 67.3831 52.1605 67.5727 52.0996C67.8953 51.9953 68.2109 51.8887 68.5185 51.7785C68.7023 51.7129 68.8862 51.6473 69.0654 51.5793C69.3799 51.4598 69.6817 51.3367 69.98 51.2125C70.128 51.1504 70.2806 51.0895 70.4252 51.0262C70.846 50.841 71.2507 50.65 71.6357 50.452C71.6646 50.4367 71.6912 50.4215 71.7201 50.4074C72.0901 50.2152 72.4405 50.0172 72.7747 49.8145C72.8949 49.7418 73.0036 49.6668 73.1192 49.593C73.347 49.4477 73.5678 49.3 73.7771 49.15C73.8974 49.0633 74.0118 48.9766 74.1263 48.8875C74.3148 48.7422 74.4952 48.5945 74.6674 48.4457C74.7287 48.393 74.7992 48.3426 74.8582 48.2887ZM74.8582 76.5355C74.8582 80.4367 65.0602 84.7844 51.0002 84.7844C36.9402 84.7844 27.1421 80.4367 27.1421 76.5355V64.6469C27.1987 64.6984 27.2693 64.7477 27.3282 64.7992C27.5028 64.9504 27.6844 65.0992 27.8763 65.2469C27.9873 65.3324 28.0995 65.418 28.2162 65.5023C28.4302 65.6559 28.6568 65.807 28.8892 65.9559C28.9979 66.0262 29.1019 66.0977 29.2152 66.1656C29.5691 66.3801 29.9367 66.591 30.3299 66.7937C30.331 66.7937 30.3322 66.7938 30.3333 66.7961C30.7253 66.9988 31.1404 67.1945 31.5694 67.3855C31.7058 67.4465 31.8515 67.5039 31.9914 67.5637C32.2955 67.6926 32.6054 67.8191 32.928 67.9422C33.1002 68.0078 33.2772 68.0711 33.4541 68.1355C33.7674 68.248 34.0888 68.3582 34.4184 68.466C34.6034 68.5258 34.7872 68.5867 34.9768 68.6453C35.3341 68.7555 35.703 68.8609 36.0764 68.9641C36.2476 69.0109 36.4141 69.0602 36.5887 69.1059C37.1413 69.2512 37.7079 69.3895 38.2941 69.5195C38.3462 69.5312 38.3993 69.5383 38.4514 69.543C42.2369 70.3516 46.5717 70.7793 50.999 70.7793C55.4263 70.7793 59.7599 70.3527 63.5478 69.543C63.5998 69.5383 63.653 69.5312 63.705 69.5195C64.2912 69.3906 64.8578 69.2512 65.4105 69.1059C65.5839 69.0602 65.7493 69.0121 65.9192 68.9652C66.295 68.8621 66.665 68.7555 67.0246 68.6453C67.2131 68.5879 67.3958 68.5281 67.5785 68.4684C67.9092 68.3605 68.2329 68.2492 68.5486 68.1355C68.7231 68.0723 68.8977 68.009 69.0689 67.9445C69.3938 67.8203 69.7071 67.6926 70.0135 67.5625C70.1511 67.5039 70.2933 67.4477 70.4275 67.3879C71.29 67.0047 72.0774 66.5969 72.7851 66.1668C72.8972 66.0988 73.0001 66.0273 73.1088 65.9582C73.3424 65.8082 73.5702 65.657 73.7852 65.5023C73.9008 65.4191 74.0118 65.3336 74.1217 65.2492C74.3148 65.1016 74.4975 64.9516 74.6732 64.7992C74.7322 64.7488 74.8016 64.6996 74.8582 64.648V76.5355Z",fill:Me.silhouette}),e.jsx("path",{d:"M33.2089 38.8535C31.3993 38.8535 29.9263 40.3453 29.9263 42.1805C29.9263 44.0156 31.3982 45.5062 33.2089 45.5062C35.0196 45.5062 36.4903 44.0145 36.4903 42.1805C36.4903 40.3465 35.0184 38.8535 33.2089 38.8535ZM33.2089 43.1625C32.6735 43.1625 32.2388 42.7219 32.2388 42.1805C32.2388 41.6391 32.6735 41.1973 33.2089 41.1973C33.7442 41.1973 34.1778 41.6379 34.1778 42.1805C34.1778 42.723 33.7431 43.1625 33.2089 43.1625Z",fill:Me.silhouette}),e.jsx("path",{d:"M33.2089 54.6777C31.3993 54.6777 29.9263 56.1695 29.9263 58.0047C29.9263 59.8398 31.3982 61.3316 33.2089 61.3316C35.0196 61.3316 36.4903 59.8398 36.4903 58.0047C36.4903 56.1695 35.0184 54.6777 33.2089 54.6777ZM33.2089 58.9879C32.6735 58.9879 32.2388 58.5473 32.2388 58.0047C32.2388 57.4621 32.6735 57.0215 33.2089 57.0215C33.7442 57.0215 34.1778 57.4621 34.1778 58.0047C34.1778 58.5473 33.7431 58.9879 33.2089 58.9879Z",fill:Me.silhouette}),e.jsx("path",{d:"M33.2089 70.5C31.3993 70.5 29.9263 71.9918 29.9263 73.827C29.9263 75.6621 31.3982 77.1539 33.2089 77.1539C35.0196 77.1539 36.4903 75.6621 36.4903 73.827C36.4903 71.9918 35.0184 70.5 33.2089 70.5ZM33.2089 74.8102C32.6735 74.8102 32.2388 74.3695 32.2388 73.827C32.2388 73.2844 32.6735 72.8438 33.2089 72.8438C33.7442 72.8438 34.1778 73.2844 34.1778 73.827C34.1778 74.3695 33.7431 74.8102 33.2089 74.8102Z",fill:Me.silhouette}),e.jsx("path",{d:"M70.0215 38.2852C69.3821 38.2852 68.8652 38.809 68.8652 39.457V44.3332C68.8652 44.9812 69.3821 45.5051 70.0215 45.5051C70.6609 45.5051 71.1777 44.9812 71.1777 44.3332V39.457C71.1777 38.809 70.6609 38.2852 70.0215 38.2852Z",fill:Me.silhouette}),e.jsx("path",{d:"M70.0215 54.3926C69.3821 54.3926 68.8652 54.9164 68.8652 55.5645V60.4406C68.8652 61.0887 69.3821 61.6125 70.0215 61.6125C70.6609 61.6125 71.1777 61.0887 71.1777 60.4406V55.5645C71.1777 54.9164 70.6609 54.3926 70.0215 54.3926Z",fill:Me.silhouette}),e.jsx("path",{d:"M70.0215 70.5C69.3821 70.5 68.8652 71.0238 68.8652 71.6719V76.5492C68.8652 77.1973 69.3821 77.7211 70.0215 77.7211C70.6609 77.7211 71.1777 77.1973 71.1777 76.5492V71.6719C71.1777 71.0238 70.6609 70.5 70.0215 70.5Z",fill:Me.silhouette}),e.jsx("path",{d:"M65.77 39.7617C65.1306 39.7617 64.6138 40.2855 64.6138 40.9336V45.8098C64.6138 46.4578 65.1306 46.9816 65.77 46.9816C66.4094 46.9816 66.9263 46.4578 66.9263 45.8098V40.9336C66.9263 40.2855 66.4094 39.7617 65.77 39.7617Z",fill:Me.silhouette}),e.jsx("path",{d:"M65.77 55.8691C65.1306 55.8691 64.6138 56.393 64.6138 57.041V61.9172C64.6138 62.5652 65.1306 63.0891 65.77 63.0891C66.4094 63.0891 66.9263 62.5652 66.9263 61.9172V57.041C66.9263 56.393 66.4094 55.8691 65.77 55.8691Z",fill:Me.silhouette}),e.jsx("path",{d:"M65.77 71.9766C65.1306 71.9766 64.6138 72.5004 64.6138 73.1484V78.0246C64.6138 78.6727 65.1306 79.1965 65.77 79.1965C66.4094 79.1965 66.9263 78.6727 66.9263 78.0246V73.1484C66.9263 72.5004 66.4094 71.9766 65.77 71.9766Z",fill:Me.silhouette}),e.jsx("path",{d:"M61.2939 40.7246C60.6545 40.7246 60.1377 41.2484 60.1377 41.8965V46.7727C60.1377 47.4207 60.6545 47.9445 61.2939 47.9445C61.9334 47.9445 62.4502 47.4207 62.4502 46.7727V41.8965C62.4502 41.2484 61.9334 40.7246 61.2939 40.7246Z",fill:Me.silhouette}),e.jsx("path",{d:"M61.2939 56.832C60.6545 56.832 60.1377 57.3559 60.1377 58.0039V62.8801C60.1377 63.5281 60.6545 64.052 61.2939 64.052C61.9334 64.052 62.4502 63.5281 62.4502 62.8801V58.0039C62.4502 57.3559 61.9334 56.832 61.2939 56.832Z",fill:Me.silhouette}),e.jsx("path",{d:"M61.2939 72.9395C60.6545 72.9395 60.1377 73.4633 60.1377 74.1113V78.9875C60.1377 79.6355 60.6545 80.1594 61.2939 80.1594C61.9334 80.1594 62.4502 79.6355 62.4502 78.9875V74.1113C62.4502 73.4633 61.9334 72.9395 61.2939 72.9395Z",fill:Me.silhouette}),e.jsx("path",{d:"M39.0489 24.4037C39.131 24.4037 39.2154 24.3944 39.2986 24.3768C42.7316 23.6127 46.6755 23.185 51.0207 23.11C51.659 23.0983 52.1677 22.5651 52.1561 21.917C52.1446 21.2701 51.652 20.7451 50.9791 20.7662C46.4813 20.8448 42.3835 21.2889 38.8015 22.0881C38.1782 22.2264 37.7828 22.8522 37.9204 23.4838C38.0395 24.0311 38.5182 24.4037 39.0489 24.4037Z",fill:Me.silhouette}),e.jsx("path",{d:"M32.5406 26.6215C32.7407 26.6215 32.9442 26.57 33.128 26.4586C33.1315 26.4563 33.5096 26.2336 34.2889 25.9055C34.8786 25.6582 35.1584 24.9727 34.9144 24.3739C34.6704 23.775 33.9917 23.4926 33.4032 23.7399C32.4632 24.1348 31.9926 24.4149 31.9417 24.4465C31.396 24.7782 31.219 25.4942 31.544 26.0485C31.7613 26.4164 32.1452 26.6204 32.5395 26.6204L32.5406 26.6215Z",fill:Me.silhouette}),e.jsx("path",{d:"M92.7251 26.7272L82.3845 29.3124C81.6929 29.4856 80.9911 29.0642 80.8179 28.3727C80.6447 27.6799 81.066 26.978 81.7576 26.8048L92.0982 24.2196C92.791 24.0464 93.4929 24.4678 93.6661 25.1593C93.8393 25.8521 93.4179 26.554 92.7251 26.7272Z",fill:Me.accent,fillOpacity:"0.65"}),e.jsx("path",{d:"M94.4649 11.0082L80.2465 21.3488C79.6701 21.7676 78.8609 21.6409 78.4408 21.0632C78.022 20.4867 78.1487 19.6775 78.7265 19.2574L92.9448 8.91682C93.5213 8.49803 94.3305 8.6247 94.7505 9.20248C95.1693 9.77897 95.0414 10.5881 94.4649 11.0082Z",fill:Me.accent,fillOpacity:"0.65"}),e.jsx("path",{d:"M78.0091 10.6269L74.1314 17.0898C73.7643 17.7025 72.9706 17.9002 72.358 17.5331C71.7466 17.1673 71.5475 16.3724 71.9146 15.7597L75.7923 9.29684C76.1594 8.68545 76.9544 8.48769 77.5657 8.85349C78.1784 9.22058 78.3762 10.0155 78.0091 10.6269Z",fill:Me.accent,fillOpacity:"0.65"})]})})}const ui=({title:r="create",children:t,onClickAction:o,variant:n="primary",variantTitle:l,leftIcon:s,showButton:i=!0,customHeight:c,childrenButton:a,customIcon:h})=>{const y=()=>{switch(n){case"primary":return e.jsx(e.Fragment,{children:s?e.jsx(j.Button,{primary:!0,iconLeft:s,onClick:o,children:a||r}):e.jsx(j.Button,{primary:!0,onClick:o,children:a||r})});case"secondary":return e.jsx(e.Fragment,{children:s?e.jsx(j.Button,{secondary:!0,iconLeft:s,onClick:o,children:l?e.jsx(B.Text,{fontFamily:"Poppins",fontSize:"md",fontWeight:"medium",style:{color:"var(--sa-background-success, #28ac6e)"},children:a||r}):r}):e.jsx(j.Button,{secondary:!0,onClick:o,children:a||r})});case"success":return e.jsx(e.Fragment,{children:s?e.jsx(j.Button,{success:!0,iconLeft:s,onClick:o,children:a||r}):e.jsx(j.Button,{success:!0,onClick:o,children:a||r})});default:return e.jsx(e.Fragment,{children:s?e.jsx(j.Button,{primary:!0,iconLeft:s,onClick:o,children:a||r}):e.jsx(j.Button,{primary:!0,onClick:o,children:a||r})})}};return e.jsxs(u.Box,{height:"height-full",display:"flex",direction:"column",gap:"sm",justify:"center",align:"center",marginBlock:"auto",customHeight:c,children:[h||e.jsx(fi,{}),e.jsx(u.Box,{direction:"column",children:t.map((b,p)=>e.jsx(Ze.Body1,{props:{align:"center",textAlign:"center"},children:p>2?null:b},p))}),i?y():null]})},$={c001A72:"#001A72",c64B5F6:"#64B5F6",c98B4CB:"#98B4CB",cBBDEFB:"#BBDEFB",cD0E5F7:"#D0E5F7",cD6EBFD:"#D6EBFD",c000000:"#000000",cFFFFFF:"#FFFFFF"};function gi({width:r,height:t}){return e.jsx(e.Fragment,{children:e.jsxs("svg",{width:r,height:t,viewBox:"0 0 622 271",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[e.jsx("path",{d:"M32.4375 254.5H612.437",stroke:$.c64B5F6,strokeWidth:"5",strokeLinecap:"round"}),e.jsx("rect",{x:"216.562",y:"45.5605",width:"55",height:"20",fill:$.cD6EBFD}),e.jsx("rect",{x:"14.4375",y:"89.7803",width:"46",height:"20",fill:$.cD6EBFD}),e.jsx("rect",{x:"0.4375",y:"111.78",width:"46",height:"20",fill:$.cD6EBFD}),e.jsx("rect",{x:"0.4375",y:"67.7803",width:"46",height:"20",fill:$.cD6EBFD}),e.jsx("rect",{x:"344.312",y:"0.5",width:"55",height:"20",fill:$.cD6EBFD}),e.jsx("rect",{x:"549.562",y:"86.7803",width:"55",height:"20",fill:$.cD6EBFD}),e.jsx("rect",{x:"566.562",y:"64.7803",width:"55",height:"20",fill:$.cD6EBFD}),e.jsx("path",{d:"M233.438 165.217C233.438 132.764 239.035 107.198 250.231 88.5189C261.596 69.8396 279.832 60.5 304.938 60.5C330.043 60.5 348.194 69.8396 359.389 88.5189C370.755 107.198 376.438 132.764 376.438 165.217C376.438 198.047 370.755 223.802 359.389 242.481C348.194 261.16 330.043 270.5 304.938 270.5C279.832 270.5 261.596 261.16 250.231 242.481C239.035 223.802 233.438 198.047 233.438 165.217ZM333.69 165.217C333.69 146.16 331.824 131.538 328.092 121.349C324.36 110.972 316.642 105.783 304.938 105.783C293.233 105.783 285.515 110.972 281.783 121.349C278.051 131.538 276.185 146.16 276.185 165.217C276.185 178.047 276.863 188.708 278.22 197.198C279.577 205.5 282.292 212.292 286.363 217.575C290.604 222.67 296.795 225.217 304.938 225.217C313.08 225.217 319.187 222.67 323.258 217.575C327.499 212.292 330.298 205.5 331.655 197.198C333.012 188.708 333.69 178.047 333.69 165.217Z",fill:$.cD0E5F7}),e.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M50.4375 235.124V194.28L138.96 60.5H192.466V191.32H215.438V235.124H192.466V249.5H144.563V235.124H50.4375ZM100.862 191.32L147.925 116.143V191.32H100.862Z",fill:$.cBBDEFB,fillOpacity:"0.6"}),e.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M394.438 235.124V194.28L482.96 60.5H536.466V191.32H559.438V235.124H536.466V249.5H488.563V235.124H394.438ZM444.862 191.32L491.925 116.143V191.32H444.862Z",fill:$.cBBDEFB,fillOpacity:"0.6"}),e.jsx("path",{d:"M349.472 171.5H261.64V186.396H349.472V171.5Z",fill:$.c98B4CB}),e.jsx("path",{d:"M261.64 171.5L244.719 186.396H261.64V171.5Z",fill:$.c98B4CB}),e.jsx("path",{d:"M363.574 186.396L349.472 171.5V186.396H363.574Z",fill:$.c98B4CB}),e.jsx("path",{d:"M244.719 200.89V264.5H363.574V200.89M244.719 200.89H233.438L244.719 186.396M244.719 200.89H363.574M363.574 200.89H372.437L363.574 186.396M244.719 186.396L261.64 171.5M244.719 186.396H261.64M363.574 186.396L349.472 171.5M363.574 186.396H349.472M261.64 171.5H349.472M261.64 171.5V186.396M349.472 171.5V186.396M349.472 186.396H261.64",stroke:$.c000000,strokeWidth:"2"}),e.jsx("rect",{x:"246.438",y:"202.5",width:"116",height:"60",fill:$.cFFFFFF}),e.jsx("path",{d:"M245.536 187.5H362.959L369.438 198.5H237.438L245.536 187.5Z",fill:$.cFFFFFF}),e.jsx("path",{d:"M332.438 129.846C332.438 141.175 329.183 152.403 323.949 160.772C318.699 169.168 311.592 174.5 303.938 174.5C296.283 174.5 289.176 169.168 283.926 160.772C278.692 152.403 275.438 141.175 275.438 129.846C275.438 118.458 277.838 109.628 282.543 103.663C287.216 97.7387 294.274 94.5 303.938 94.5C313.601 94.5 320.659 97.7387 325.332 103.663C330.037 109.628 332.438 118.458 332.438 129.846Z",fill:$.cFFFFFF,stroke:$.c000000,strokeWidth:"2"}),e.jsx("path",{d:"M281.438 145.5C284.032 154.136 285.762 158.682 290.951 164.591M292.681 166.409C293.624 167.647 295.708 169.591 297.438 170.5",stroke:$.c000000,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}),e.jsx("path",{d:"M304.438 175C299.54 176.339 297.208 177.876 293.938 182.5M304.438 175C301.183 178.041 299.537 178.883 299.438 182.5M304.438 175C308.173 177.107 309.635 178.834 311.438 182.5",stroke:$.c000000,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}),e.jsx("path",{d:"M304.936 175.5C303.438 180 302.529 181.628 304.936 186.5",stroke:$.c000000,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}),e.jsx("path",{d:"M288.178 120.981C289.969 120.93 290.921 121.313 292.167 122.754",stroke:$.c000000,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}),e.jsx("circle",{cx:"291.724",cy:"118.765",r:"3.1027",fill:$.c000000}),e.jsx("path",{d:"M308.128 122.463C309.123 120.973 309.987 120.418 311.883 120.237",stroke:$.c000000,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}),e.jsx("circle",{cx:"307.681",cy:"118.765",r:"3.1027",fill:$.c000000}),e.jsx("ellipse",{cx:"297.938",cy:"134.5",rx:"2.5",ry:"2",fill:$.c000000}),e.jsx("path",{d:"M340.437 97.5L333.438 104.5M333.438 97.5L340.438 104.5",stroke:$.c001A72,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}),e.jsx("path",{d:"M265.437 115.5L260.438 120.5M260.438 115.5L265.438 120.5",stroke:$.c001A72,strokeWidth:"1.2",strokeLinecap:"round",strokeLinejoin:"round"}),e.jsx("path",{d:"M288.437 87.5L283.438 92.5M283.438 87.5L288.438 92.5",stroke:$.c001A72,strokeWidth:"1.2",strokeLinecap:"round",strokeLinejoin:"round"}),e.jsx("path",{d:"M305.437 83.5L298.438 90.5M298.438 83.5L305.438 90.5",stroke:$.c001A72,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),e.jsx("path",{d:"M342.437 145.5L337.438 150.5M337.438 145.5L342.438 150.5",stroke:$.c001A72,strokeWidth:"1.2",strokeLinecap:"round",strokeLinejoin:"round"}),e.jsx("circle",{cx:"339.938",cy:"111",r:"2.5",fill:$.c001A72}),e.jsx("circle",{cx:"336.438",cy:"94.5",r:"1",fill:$.c001A72}),e.jsx("circle",{cx:"347.438",cy:"99.5",r:"1",fill:$.c001A72}),e.jsx("circle",{cx:"267.438",cy:"109.5",r:"2",fill:$.c001A72}),e.jsx("circle",{cx:"293.438",cy:"85.5",r:"2",fill:$.c001A72}),e.jsx("circle",{cx:"339.438",cy:"138.5",r:"2",fill:$.c001A72}),e.jsx("circle",{cx:"267.438",cy:"150.5",r:"2",fill:$.c001A72}),e.jsx("circle",{cx:"268.438",cy:"118.5",r:"1",fill:$.c001A72}),e.jsx("circle",{cx:"260.438",cy:"124.5",r:"1",fill:$.c001A72})]})})}function yi({onClick:r}){const t=De.useMediaQuery("md");return e.jsxs(u.Box,{direction:"column",height:"height-screen",fullWidth:!0,display:"flex",align:"center",justify:"center",gap:"md",children:[e.jsx(gi,{width:t?600:300}),e.jsx(B.Text,{fontWeight:"bold",fontSize:t?"3xl":"2xl",textAlign:"center",children:"Page Not Found"}),e.jsx(B.Text,{fontWeight:"semibold",fontSize:t?"lg":"md",textAlign:"center",children:"Sorry, we couldn't find the page you are looking for"}),r&&e.jsx(j.Button,{size:t?"md":"xs",onClick:r,children:"Go Back"})]})}const le={c46F16B:"#46F16B",c48504C:"#48504C",c64B5F6:"#64B5F6",c67AEE6:"#67AEE6",c86512B:"#86512B",c956847:"#956847",cBBC3F5:"#BBC3F5",cBBDEFB:"#BBDEFB",cC0B2A2:"#C0B2A2",cC8CEF4:"#C8CEF4",cCABEB1:"#CABEB1",cD5C7BD:"#D5C7BD",cD6D6D6:"#D6D6D6",cD6EBFD:"#D6EBFD",cE5EE80:"#E5EE80",cEE8080:"#EE8080",cEFF3F8:"#EFF3F8",cF4F4F4:"#F4F4F4",cFFFFFF:"#FFFFFF"};function pi({width:r,height:t}){return e.jsx(e.Fragment,{children:e.jsxs("svg",{width:r,height:t,viewBox:"0 0 654 258",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[e.jsx("rect",{x:"228",y:"55.5",width:"55",height:"20",fill:le.cD6EBFD}),e.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M75 238.124V197.28L163.523 63.5H217.029V194.32H240V238.124H217.029V252.5H169.126V238.124H75ZM125.424 194.32L172.487 119.143V194.32H125.424Z",fill:le.cBBDEFB,fillOpacity:"0.6"}),e.jsxs("g",{clipPath:"url(#clip0_2949_9690)",children:[e.jsx("path",{d:"M334.5 274.5C381.168 274.5 419 227.266 419 169C419 110.734 381.168 63.5 334.5 63.5C287.832 63.5 250 110.734 250 169C250 227.266 287.832 274.5 334.5 274.5Z",fill:le.cEFF3F8,stroke:le.c67AEE6,strokeWidth:"5"}),e.jsx("path",{d:"M413 197.5C411.397 211.835 402.919 230.898 389.361 246.49C375.596 262.32 356.651 274.5 334.496 274.5C311.331 274.5 292.389 261.672 278.878 245.52C265.592 229.638 257.606 210.603 256 197.5H413Z",fill:le.cD5C7BD}),e.jsx("path",{d:"M278.887 211.766H391.104L392.583 222.856C392.687 223.635 392.08 224.328 391.294 224.328H277.961C277.14 224.328 276.525 223.577 276.686 222.773L278.887 211.766Z",fill:le.cCABEB1}),e.jsx("path",{d:"M287.68 218.884L289.354 213.022H378.961L381.473 218.884H287.68Z",fill:le.cC0B2A2}),e.jsx("path",{d:"M381.944 218.803L381.58 212.266H386.385L386.022 218.803H381.944Z",fill:le.c956847,stroke:le.c48504C}),e.jsx("path",{d:"M283.124 218.803L282.768 213.104H287.565L287.209 218.803H283.124Z",fill:le.c956847,stroke:le.c48504C}),e.jsx("path",{d:"M285.902 212.103L284.935 186.306H279.606C278.151 186.306 277.004 187.542 277.113 188.993L278.673 209.79C278.77 211.095 279.857 212.103 281.166 212.103H285.902Z",fill:le.cC8CEF4,stroke:le.c48504C}),e.jsx("path",{d:"M383.256 212.103L384.638 186.306H389.556C391.007 186.306 392.153 187.537 392.05 188.984L390.564 209.782C390.471 211.09 389.382 212.103 388.07 212.103H383.256Z",fill:le.cC8CEF4,stroke:le.c48504C}),e.jsx("path",{d:"M284.497 178.155C284.455 176.194 286.034 174.581 287.996 174.581H381.904C383.895 174.581 385.485 176.24 385.401 178.23L384.066 209.59C383.987 211.463 382.445 212.941 380.569 212.941H288.663C286.759 212.941 285.205 211.419 285.164 209.515L284.497 178.155Z",fill:le.cC8CEF4,stroke:le.c48504C}),e.jsx("path",{d:"M284.845 181.524C284.792 179.279 286.598 177.431 288.844 177.431H380.687C382.948 177.431 384.76 179.304 384.684 181.565L383.774 208.737C383.701 210.893 381.933 212.603 379.776 212.603H289.48C287.307 212.603 285.532 210.869 285.481 208.697L284.845 181.524Z",fill:le.cBBC3F5}),e.jsx("mask",{id:"mask0_2949_9690",maskUnits:"userSpaceOnUse",x:"301",y:"144",width:"68",height:"17",style:{maskType:"luminance"},children:e.jsx("path",{d:"M301 146.5C301 145.395 301.887 144.5 302.98 144.5H367.02C368.114 144.5 369 145.395 369 146.5V160.411H301V146.5Z",fill:le.cFFFFFF})}),e.jsxs("g",{mask:"url(#mask0_2949_9690)",children:[e.jsx("path",{d:"M301 146.191C301 145.257 301.748 144.5 302.671 144.5H356.701C357.624 144.5 358.372 145.257 358.372 146.191V157.949H301V146.191Z",fill:le.cFFFFFF}),e.jsx("path",{d:"M301.336 146.607C301.336 145.673 302.08 144.916 302.999 144.916H367.01C367.929 144.916 368.673 145.673 368.673 146.607V152.523H301.336V146.607Z",fill:le.cD6D6D6}),e.jsx("path",{d:"M368.673 152.523H301.336V174.5H368.673V152.523Z",fill:le.cF4F4F4}),e.jsx("path",{d:"M307.685 150.417C308.607 150.417 309.356 149.66 309.356 148.726C309.356 147.793 308.607 147.036 307.685 147.036C306.762 147.036 306.014 147.793 306.014 148.726C306.014 149.66 306.762 150.417 307.685 150.417Z",fill:le.cEE8080}),e.jsx("path",{d:"M313.532 150.417C314.455 150.417 315.203 149.66 315.203 148.726C315.203 147.793 314.455 147.036 313.532 147.036C312.609 147.036 311.861 147.793 311.861 148.726C311.861 149.66 312.609 150.417 313.532 150.417Z",fill:le.cE5EE80}),e.jsx("path",{d:"M318.546 150.417C319.469 150.417 320.217 149.66 320.217 148.726C320.217 147.793 319.469 147.036 318.546 147.036C317.623 147.036 316.875 147.793 316.875 148.726C316.875 149.66 317.623 150.417 318.546 150.417Z",fill:le.c46F16B})]}),e.jsx("path",{d:"M301.16 146C301.16 145.172 301.832 144.5 302.66 144.5H367.33C368.159 144.5 368.83 145.172 368.83 146V174.419H301.16V146Z",stroke:le.c48504C}),e.jsx("path",{d:"M395.29 207.579H423.344M354.255 236.889H369.329M327.038 222.234H347.556M350.905 222.234H358.024M288.097 230.19H304.846M253.344 210.091H272.605M278.467 246.938H295.216M297.309 246.938H303.59M337.088 252.801H354.255",stroke:le.c86512B,strokeWidth:"2",strokeLinecap:"round"})]}),e.jsx("path",{d:"M430.241 125.78C430.987 105.807 437.521 90.4065 449.841 79.5799C462.161 68.7532 478.867 63.3398 499.961 63.3398C513.961 63.3398 525.907 65.7665 535.801 70.6199C545.881 75.4732 553.441 82.0998 558.481 90.4998C563.707 98.8998 566.321 108.327 566.321 118.78C566.321 131.1 563.241 141.18 557.081 149.02C550.921 156.673 543.734 161.9 535.521 164.7V165.82C546.161 169.367 554.561 175.247 560.721 183.46C566.881 191.673 569.961 202.22 569.961 215.1C569.961 226.673 567.254 236.94 561.841 245.9C560.436 248.258 558.849 250.481 557.081 252.569L443.5 252.662C432.5 241 427.721 230.5 427.721 207.82H474.201C474.387 216.033 476.721 222.567 481.201 227.42C485.681 232.087 492.214 234.42 500.801 234.42C508.081 234.42 513.681 232.367 517.601 228.26C521.707 223.967 523.761 218.367 523.761 211.46C523.761 202.5 520.867 196.06 515.081 192.14C509.481 188.033 500.427 185.98 487.921 185.98H478.961V147.06H487.921C497.441 147.06 505.094 145.473 510.881 142.3C516.854 138.94 519.841 133.06 519.841 124.66C519.841 117.94 517.974 112.713 514.241 108.98C510.507 105.247 505.374 103.38 498.841 103.38C491.747 103.38 486.427 105.527 482.881 109.82C479.521 114.113 477.561 119.433 477.001 125.78H430.241Z",fill:le.cBBDEFB,fillOpacity:"0.6"}),e.jsx("rect",{x:"43",y:"87.5",width:"46",height:"20",fill:le.cD6EBFD}),e.jsx("rect",{x:"29",y:"109.5",width:"46",height:"20",fill:le.cD6EBFD}),e.jsx("rect",{x:"29",y:"65.5",width:"46",height:"20",fill:le.cD6EBFD}),e.jsx("rect",{x:"356",y:"0.5",width:"55",height:"20",fill:le.cD6EBFD}),e.jsx("rect",{x:"572",y:"142.5",width:"55",height:"20",fill:le.cD6EBFD}),e.jsx("rect",{x:"589",y:"120.5",width:"55",height:"20",fill:le.cD6EBFD}),e.jsx("path",{d:"M3 255.5L651 255.5",stroke:le.c64B5F6,strokeWidth:"5",strokeLinecap:"round"}),e.jsx("defs",{children:e.jsx("clipPath",{id:"clip0_2949_9690",children:e.jsx("rect",{width:"179",height:"192",fill:le.cFFFFFF,transform:"translate(246 60.5)"})})})]})})}function bi({onClick:r}){const t=De.useMediaQuery("md");return e.jsxs(u.Box,{direction:"column",height:"height-screen",fullWidth:!0,display:"flex",align:"center",justify:"center",gap:"md",children:[e.jsx(pi,{width:t?600:300}),e.jsx(B.Text,{fontWeight:"bold",fontSize:t?"3xl":"2xl",children:"We Are Sorry ..."}),r&&e.jsx(j.Button,{size:t?"md":"xs",onClick:r,children:"Go Back"})]})}const g={c000D58:"#000D58",c001174:"#001174",c28AC6E:"#28AC6E",c48504C:"#48504C",c64B5F6:"#64B5F6",c90CAF9:"#90CAF9",cC9184A:"#C9184A",cD6D6D6:"#D6D6D6",cD6EBFD:"#D6EBFD",cD9D9D9:"#D9D9D9",cDEECF8:"#DEECF8",cE7EAE9:"#E7EAE9",cF3F8FD:"#F3F8FD",cFFE18B:"#FFE18B",cFFFFFF:"#FFFFFF"};function vi({width:r,height:t}){return e.jsx(e.Fragment,{children:e.jsxs("svg",{width:r,height:t,viewBox:"0 0 622 287",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[e.jsx("path",{d:"M406.562 180.997C406.562 148.544 412.16 122.978 423.356 104.299C434.721 85.6199 452.957 76.2803 478.063 76.2803C503.168 76.2803 521.319 85.6199 532.514 104.299C543.88 122.978 549.562 148.544 549.562 180.997C549.562 213.827 543.88 239.582 532.514 258.261C521.319 276.941 503.168 286.28 478.063 286.28C452.957 286.28 434.721 276.941 423.356 258.261C412.16 239.582 406.562 213.827 406.562 180.997ZM506.815 180.997C506.815 161.941 504.949 147.318 501.217 137.129C497.485 126.752 489.767 121.563 478.063 121.563C466.358 121.563 458.64 126.752 454.908 137.129C451.176 147.318 449.31 161.941 449.31 180.997C449.31 193.827 449.988 204.488 451.345 212.978C452.703 221.28 455.417 228.073 459.488 233.356C463.729 238.45 469.92 240.997 478.063 240.997C486.205 240.997 492.312 238.45 496.383 233.356C500.624 228.073 503.423 221.28 504.78 212.978C506.137 204.488 506.815 193.827 506.815 180.997Z",fill:g.cD6EBFD}),e.jsx("path",{d:"M246.562 180.558C246.562 148.105 252.16 122.539 263.356 103.86C274.721 85.1804 292.957 75.8408 318.063 75.8408C343.168 75.8408 361.319 85.1804 372.514 103.86C383.88 122.539 389.562 148.105 389.562 180.558C389.562 213.388 383.88 239.143 372.514 257.822C361.319 276.501 343.168 285.841 318.063 285.841C292.957 285.841 274.721 276.501 263.356 257.822C252.16 239.143 246.562 213.388 246.562 180.558ZM346.815 180.558C346.815 161.501 344.949 146.879 341.217 136.69C337.485 126.313 329.767 121.124 318.063 121.124C306.358 121.124 298.64 126.313 294.908 136.69C291.176 146.879 289.31 161.501 289.31 180.558C289.31 193.388 289.988 204.048 291.345 212.539C292.702 220.841 295.417 227.633 299.488 232.916C303.729 238.011 309.92 240.558 318.063 240.558C326.205 240.558 332.312 238.011 336.383 232.916C340.624 227.633 343.423 220.841 344.78 212.539C346.137 204.048 346.815 193.388 346.815 180.558Z",fill:g.cD6EBFD}),e.jsx("path",{d:"M222.808 118.703H128.062V159.858C132.111 155.484 137.779 151.905 145.067 149.122C152.356 146.338 160.251 144.946 168.754 144.946C183.938 144.946 196.49 148.326 206.41 155.086C216.532 161.846 223.922 170.594 228.578 181.329C233.234 192.065 235.562 203.696 235.562 216.221C235.562 239.483 228.882 257.972 215.52 271.691C202.158 285.21 183.357 282.89 159.062 282.89C142.867 282.89 131.098 284.939 116.826 283.918C104.881 278.351 95.6695 270.697 89.1911 260.955C82.7127 251.213 79.1698 239.98 78.5625 227.256H129.276C130.491 233.419 133.426 238.588 138.083 242.763C142.739 246.739 149.116 248.728 157.214 248.728C166.729 248.728 173.815 245.745 178.472 239.781C183.128 233.817 185.456 225.864 185.456 215.923C185.456 206.181 183.027 198.726 178.168 193.557C173.309 188.387 166.223 185.803 156.911 185.803C150.027 185.803 144.359 187.493 139.905 190.873C135.451 194.054 132.515 198.328 131.098 203.696H80.9919V73.9697H222.808V118.703Z",fill:g.cD6EBFD}),e.jsx("rect",{x:"216.562",y:"45.7803",width:"55",height:"20",fill:g.cD6EBFD}),e.jsx("rect",{x:"14.4375",y:"90",width:"46",height:"20",fill:g.cD6EBFD}),e.jsx("rect",{x:"0.4375",y:"112",width:"46",height:"20",fill:g.cD6EBFD}),e.jsx("rect",{x:"0.4375",y:"68",width:"46",height:"20",fill:g.cD6EBFD}),e.jsx("rect",{x:"344.312",y:"0.719727",width:"55",height:"20",fill:g.cD6EBFD}),e.jsx("rect",{x:"549.562",y:"87",width:"55",height:"20",fill:g.cD6EBFD}),e.jsx("rect",{x:"566.562",y:"65",width:"55",height:"20",fill:g.cD6EBFD}),e.jsx("path",{d:"M25.8125 282.22H605.812",stroke:g.c64B5F6,strokeWidth:"5",strokeLinecap:"round"}),e.jsx("rect",{x:"263.012",y:"175.42",width:"104.6",height:"31.2833",rx:"3.3",fill:g.cFFFFFF,stroke:g.c001174,strokeWidth:"1.4"}),e.jsx("path",{d:"M269.878 200.539C269.878 200.263 270.101 200.039 270.377 200.039L305.476 199.955C305.753 199.955 305.978 200.179 305.978 200.455V206.461H269.878V200.539Z",stroke:g.c001174}),e.jsx("rect",{x:"263.012",y:"210.752",width:"104.6",height:"31.2833",rx:"3.3",fill:g.cFFFFFF,stroke:g.c001174,strokeWidth:"1.4"}),e.jsx("path",{d:"M269.878 235.871C269.878 235.595 270.101 235.372 270.377 235.371L305.476 235.288C305.753 235.287 305.978 235.511 305.978 235.788V241.794H269.878V235.871Z",stroke:g.c001174}),e.jsx("rect",{x:"263.012",y:"246.969",width:"104.6",height:"31.2833",rx:"3.3",fill:g.cFFFFFF,stroke:g.c001174,strokeWidth:"1.4"}),e.jsx("path",{d:"M269.878 272.088C269.878 271.812 270.101 271.589 270.377 271.588L305.476 271.505C305.753 271.504 305.978 271.728 305.978 272.005V278.011H269.878V272.088Z",stroke:g.c001174}),e.jsx("path",{d:"M279.095 176.348H364.373C365.459 176.348 366.125 176.992 366.986 178.252V202.985C366.986 202.985 366.986 203.869 366.545 204.752C366.103 205.635 365.661 206.077 365.661 206.077L306.478 206.163V199.452L279.095 199.518V176.348Z",fill:g.cF3F8FD}),e.jsx("path",{d:"M279.095 211.093H364.373C365.459 211.093 366.125 211.736 366.986 212.997V237.73C366.986 237.73 366.986 238.613 366.545 239.497C366.103 240.38 365.661 240.822 365.661 240.822L306.478 240.908V234.197L279.095 234.262V211.093Z",fill:g.cF3F8FD}),e.jsx("path",{d:"M279.095 248.008H364.373C365.459 248.008 366.125 248.652 366.986 249.912V274.646C366.986 274.646 366.986 275.529 366.545 276.412C366.103 277.296 365.661 277.737 365.661 277.737L306.478 277.824V271.112L279.095 271.178V248.008Z",fill:g.cF3F8FD}),e.jsx("circle",{cx:"270.258",cy:"179.136",r:"0.883333",fill:g.cD9D9D9}),e.jsx("circle",{cx:"270.258",cy:"181.786",r:"0.883333",fill:g.cD9D9D9}),e.jsx("circle",{cx:"281.561",cy:"179.136",r:"0.883333",fill:g.cD9D9D9}),e.jsx("circle",{cx:"281.561",cy:"181.786",r:"0.883333",fill:g.cD9D9D9}),e.jsx("circle",{cx:"273.085",cy:"179.136",r:"0.883333",fill:g.cD9D9D9}),e.jsx("circle",{cx:"273.085",cy:"181.786",r:"0.883333",fill:g.cD9D9D9}),e.jsx("circle",{cx:"284.388",cy:"179.136",r:"0.883333",fill:g.cD9D9D9}),e.jsx("circle",{cx:"284.388",cy:"181.786",r:"0.883333",fill:g.cD9D9D9}),e.jsx("circle",{cx:"275.91",cy:"179.136",r:"0.883333",fill:g.cD9D9D9}),e.jsx("circle",{cx:"275.91",cy:"181.786",r:"0.883333",fill:g.cD9D9D9}),e.jsx("circle",{cx:"287.214",cy:"179.136",r:"0.883333",fill:g.cD9D9D9}),e.jsx("circle",{cx:"287.214",cy:"181.786",r:"0.883333",fill:g.cD9D9D9}),e.jsx("circle",{cx:"278.737",cy:"179.136",r:"0.883333",fill:g.cD9D9D9}),e.jsx("circle",{cx:"278.737",cy:"181.786",r:"0.883333",fill:g.cD9D9D9}),e.jsx("circle",{cx:"290.04",cy:"179.136",r:"0.883333",fill:g.cD9D9D9}),e.jsx("circle",{cx:"290.04",cy:"181.786",r:"0.883333",fill:g.cD9D9D9}),e.jsx("circle",{cx:"344.462",cy:"179.136",r:"0.883333",fill:g.cD9D9D9}),e.jsx("circle",{cx:"344.462",cy:"181.786",r:"0.883333",fill:g.cD9D9D9}),e.jsx("circle",{cx:"355.765",cy:"179.136",r:"0.883333",fill:g.cD9D9D9}),e.jsx("circle",{cx:"355.765",cy:"181.786",r:"0.883333",fill:g.cD9D9D9}),e.jsx("circle",{cx:"347.29",cy:"179.136",r:"0.883333",fill:g.cD9D9D9}),e.jsx("circle",{cx:"347.29",cy:"181.786",r:"0.883333",fill:g.cD9D9D9}),e.jsx("circle",{cx:"358.592",cy:"179.136",r:"0.883333",fill:g.cD9D9D9}),e.jsx("circle",{cx:"358.592",cy:"181.786",r:"0.883333",fill:g.cD9D9D9}),e.jsx("circle",{cx:"350.114",cy:"179.136",r:"0.883333",fill:g.cD9D9D9}),e.jsx("circle",{cx:"350.114",cy:"181.786",r:"0.883333",fill:g.cD9D9D9}),e.jsx("circle",{cx:"361.418",cy:"179.136",r:"0.883333",fill:g.cD9D9D9}),e.jsx("circle",{cx:"361.418",cy:"181.786",r:"0.883333",fill:g.cD9D9D9}),e.jsx("circle",{cx:"352.941",cy:"179.136",r:"0.883333",fill:g.cD9D9D9}),e.jsx("circle",{cx:"352.941",cy:"181.786",r:"0.883333",fill:g.cD9D9D9}),e.jsx("circle",{cx:"364.244",cy:"179.136",r:"0.883333",fill:g.cD9D9D9}),e.jsx("circle",{cx:"364.244",cy:"181.786",r:"0.883333",fill:g.cD9D9D9}),e.jsx("circle",{cx:"344.462",cy:"200.336",r:"0.883333",fill:g.cD9D9D9}),e.jsx("circle",{cx:"344.462",cy:"202.986",r:"0.883333",fill:g.cD9D9D9}),e.jsx("circle",{cx:"355.765",cy:"200.336",r:"0.883333",fill:g.cD9D9D9}),e.jsx("circle",{cx:"355.765",cy:"202.986",r:"0.883333",fill:g.cD9D9D9}),e.jsx("circle",{cx:"347.29",cy:"200.336",r:"0.883333",fill:g.cD9D9D9}),e.jsx("circle",{cx:"347.29",cy:"202.986",r:"0.883333",fill:g.cD9D9D9}),e.jsx("circle",{cx:"358.592",cy:"200.336",r:"0.883333",fill:g.cD9D9D9}),e.jsx("circle",{cx:"358.592",cy:"202.986",r:"0.883333",fill:g.cD9D9D9}),e.jsx("circle",{cx:"350.114",cy:"200.336",r:"0.883333",fill:g.cD9D9D9}),e.jsx("circle",{cx:"350.114",cy:"202.986",r:"0.883333",fill:g.cD9D9D9}),e.jsx("circle",{cx:"361.418",cy:"200.336",r:"0.883333",fill:g.cD9D9D9}),e.jsx("circle",{cx:"361.418",cy:"202.986",r:"0.883333",fill:g.cD9D9D9}),e.jsx("circle",{cx:"352.941",cy:"200.336",r:"0.883333",fill:g.cD9D9D9}),e.jsx("circle",{cx:"352.941",cy:"202.986",r:"0.883333",fill:g.cD9D9D9}),e.jsx("circle",{cx:"364.244",cy:"200.336",r:"0.883333",fill:g.cD9D9D9}),e.jsx("circle",{cx:"364.244",cy:"202.986",r:"0.883333",fill:g.cD9D9D9}),e.jsx("circle",{cx:"359.918",cy:"191.061",r:"4.45833",stroke:g.c001174,strokeWidth:"0.8"}),e.jsx("circle",{cx:"359.918",cy:"191.061",r:"2.20833",fill:g.cE7EAE9}),e.jsx("rect",{x:"269.726",y:"186.553",width:"36.4",height:"9.01667",rx:"0.65",fill:g.cE7EAE9,stroke:g.c001174,strokeWidth:"0.7"}),e.jsx("rect",{x:"310.537",y:"186.553",width:"6.54333",height:"9.01667",rx:"0.65",fill:g.cE7EAE9,stroke:g.c001174,strokeWidth:"0.7"}),e.jsx("rect",{x:"321.312",y:"186.553",width:"6.54333",height:"9.01667",rx:"0.65",fill:g.cE7EAE9,stroke:g.c001174,strokeWidth:"0.7"}),e.jsx("rect",{x:"332.089",y:"186.553",width:"6.54333",height:"9.01667",rx:"0.65",fill:g.cE7EAE9,stroke:g.c001174,strokeWidth:"0.7"}),e.jsx("rect",{x:"342.864",y:"186.553",width:"6.54333",height:"9.01667",rx:"0.65",fill:g.cE7EAE9,stroke:g.c001174,strokeWidth:"0.7"}),e.jsx("circle",{cx:"270.258",cy:"214.468",r:"0.883333",fill:g.cD9D9D9}),e.jsx("circle",{cx:"270.258",cy:"217.118",r:"0.883333",fill:g.cD9D9D9}),e.jsx("circle",{cx:"281.561",cy:"214.468",r:"0.883333",fill:g.cD9D9D9}),e.jsx("circle",{cx:"281.561",cy:"217.118",r:"0.883333",fill:g.cD9D9D9}),e.jsx("circle",{cx:"273.085",cy:"214.468",r:"0.883333",fill:g.cD9D9D9}),e.jsx("circle",{cx:"273.085",cy:"217.118",r:"0.883333",fill:g.cD9D9D9}),e.jsx("circle",{cx:"284.388",cy:"214.468",r:"0.883333",fill:g.cD9D9D9}),e.jsx("circle",{cx:"284.388",cy:"217.118",r:"0.883333",fill:g.cD9D9D9}),e.jsx("circle",{cx:"275.91",cy:"214.468",r:"0.883333",fill:g.cD9D9D9}),e.jsx("circle",{cx:"275.91",cy:"217.118",r:"0.883333",fill:g.cD9D9D9}),e.jsx("circle",{cx:"287.214",cy:"214.468",r:"0.883333",fill:g.cD9D9D9}),e.jsx("circle",{cx:"287.214",cy:"217.118",r:"0.883333",fill:g.cD9D9D9}),e.jsx("circle",{cx:"278.737",cy:"214.468",r:"0.883333",fill:g.cD9D9D9}),e.jsx("circle",{cx:"278.737",cy:"217.118",r:"0.883333",fill:g.cD9D9D9}),e.jsx("circle",{cx:"290.04",cy:"214.468",r:"0.883333",fill:g.cD9D9D9}),e.jsx("circle",{cx:"290.04",cy:"217.118",r:"0.883333",fill:g.cD9D9D9}),e.jsx("circle",{cx:"344.462",cy:"214.468",r:"0.883333",fill:g.cD9D9D9}),e.jsx("circle",{cx:"344.462",cy:"217.118",r:"0.883333",fill:g.cD9D9D9}),e.jsx("circle",{cx:"355.765",cy:"214.468",r:"0.883333",fill:g.cD9D9D9}),e.jsx("circle",{cx:"355.765",cy:"217.118",r:"0.883333",fill:g.cD9D9D9}),e.jsx("circle",{cx:"347.29",cy:"214.468",r:"0.883333",fill:g.cD9D9D9}),e.jsx("circle",{cx:"347.29",cy:"217.118",r:"0.883333",fill:g.cD9D9D9}),e.jsx("circle",{cx:"358.592",cy:"214.468",r:"0.883333",fill:g.cD9D9D9}),e.jsx("circle",{cx:"358.592",cy:"217.118",r:"0.883333",fill:g.cD9D9D9}),e.jsx("circle",{cx:"350.114",cy:"214.468",r:"0.883333",fill:g.cD9D9D9}),e.jsx("circle",{cx:"350.114",cy:"217.118",r:"0.883333",fill:g.cD9D9D9}),e.jsx("circle",{cx:"361.418",cy:"214.468",r:"0.883333",fill:g.cD9D9D9}),e.jsx("circle",{cx:"361.418",cy:"217.118",r:"0.883333",fill:g.cD9D9D9}),e.jsx("circle",{cx:"352.941",cy:"214.468",r:"0.883333",fill:g.cD9D9D9}),e.jsx("circle",{cx:"352.941",cy:"217.118",r:"0.883333",fill:g.cD9D9D9}),e.jsx("circle",{cx:"364.244",cy:"214.468",r:"0.883333",fill:g.cD9D9D9}),e.jsx("circle",{cx:"364.244",cy:"217.118",r:"0.883333",fill:g.cD9D9D9}),e.jsx("circle",{cx:"344.462",cy:"235.668",r:"0.883333",fill:g.cD9D9D9}),e.jsx("circle",{cx:"344.462",cy:"238.318",r:"0.883333",fill:g.cD9D9D9}),e.jsx("circle",{cx:"355.765",cy:"235.668",r:"0.883333",fill:g.cD9D9D9}),e.jsx("circle",{cx:"355.765",cy:"238.318",r:"0.883333",fill:g.cD9D9D9}),e.jsx("circle",{cx:"347.29",cy:"235.668",r:"0.883333",fill:g.cD9D9D9}),e.jsx("circle",{cx:"347.29",cy:"238.318",r:"0.883333",fill:g.cD9D9D9}),e.jsx("circle",{cx:"358.592",cy:"235.668",r:"0.883333",fill:g.cD9D9D9}),e.jsx("circle",{cx:"358.592",cy:"238.318",r:"0.883333",fill:g.cD9D9D9}),e.jsx("circle",{cx:"350.114",cy:"235.668",r:"0.883333",fill:g.cD9D9D9}),e.jsx("circle",{cx:"350.114",cy:"238.318",r:"0.883333",fill:g.cD9D9D9}),e.jsx("circle",{cx:"361.418",cy:"235.668",r:"0.883333",fill:g.cD9D9D9}),e.jsx("circle",{cx:"361.418",cy:"238.318",r:"0.883333",fill:g.cD9D9D9}),e.jsx("circle",{cx:"352.941",cy:"235.668",r:"0.883333",fill:g.cD9D9D9}),e.jsx("circle",{cx:"352.941",cy:"238.318",r:"0.883333",fill:g.cD9D9D9}),e.jsx("circle",{cx:"364.244",cy:"235.668",r:"0.883333",fill:g.cD9D9D9}),e.jsx("circle",{cx:"364.244",cy:"238.318",r:"0.883333",fill:g.cD9D9D9}),e.jsx("circle",{cx:"359.918",cy:"226.393",r:"4.45833",stroke:g.c001174,strokeWidth:"0.8"}),e.jsx("circle",{cx:"359.918",cy:"226.393",r:"2.20833",fill:g.cE7EAE9}),e.jsx("rect",{x:"269.726",y:"221.885",width:"36.4",height:"9.01667",rx:"0.65",fill:g.cE7EAE9,stroke:g.c001174,strokeWidth:"0.7"}),e.jsx("rect",{x:"310.537",y:"221.885",width:"6.54333",height:"9.01667",rx:"0.65",fill:g.cE7EAE9,stroke:g.c001174,strokeWidth:"0.7"}),e.jsx("rect",{x:"321.312",y:"221.885",width:"6.54333",height:"9.01667",rx:"0.65",fill:g.cE7EAE9,stroke:g.c001174,strokeWidth:"0.7"}),e.jsx("rect",{x:"332.089",y:"221.885",width:"6.54333",height:"9.01667",rx:"0.65",fill:g.cE7EAE9,stroke:g.c001174,strokeWidth:"0.7"}),e.jsx("rect",{x:"342.864",y:"221.885",width:"6.54333",height:"9.01667",rx:"0.65",fill:g.cE7EAE9,stroke:g.c001174,strokeWidth:"0.7"}),e.jsx("circle",{cx:"270.258",cy:"250.685",r:"0.883333",fill:g.cD9D9D9}),e.jsx("circle",{cx:"270.258",cy:"253.335",r:"0.883333",fill:g.cD9D9D9}),e.jsx("circle",{cx:"281.561",cy:"250.685",r:"0.883333",fill:g.cD9D9D9}),e.jsx("circle",{cx:"281.561",cy:"253.335",r:"0.883333",fill:g.cD9D9D9}),e.jsx("circle",{cx:"273.085",cy:"250.685",r:"0.883333",fill:g.cD9D9D9}),e.jsx("circle",{cx:"273.085",cy:"253.335",r:"0.883333",fill:g.cD9D9D9}),e.jsx("circle",{cx:"284.388",cy:"250.685",r:"0.883333",fill:g.cD9D9D9}),e.jsx("circle",{cx:"284.388",cy:"253.335",r:"0.883333",fill:g.cD9D9D9}),e.jsx("circle",{cx:"275.91",cy:"250.685",r:"0.883333",fill:g.cD9D9D9}),e.jsx("circle",{cx:"275.91",cy:"253.335",r:"0.883333",fill:g.cD9D9D9}),e.jsx("circle",{cx:"287.214",cy:"250.685",r:"0.883333",fill:g.cD9D9D9}),e.jsx("circle",{cx:"287.214",cy:"253.335",r:"0.883333",fill:g.cD9D9D9}),e.jsx("circle",{cx:"278.737",cy:"250.685",r:"0.883333",fill:g.cD9D9D9}),e.jsx("circle",{cx:"278.737",cy:"253.335",r:"0.883333",fill:g.cD9D9D9}),e.jsx("circle",{cx:"290.04",cy:"250.685",r:"0.883333",fill:g.cD9D9D9}),e.jsx("circle",{cx:"290.04",cy:"253.335",r:"0.883333",fill:g.cD9D9D9}),e.jsx("circle",{cx:"344.462",cy:"250.685",r:"0.883333",fill:g.cD9D9D9}),e.jsx("circle",{cx:"344.462",cy:"253.335",r:"0.883333",fill:g.cD9D9D9}),e.jsx("circle",{cx:"355.765",cy:"250.685",r:"0.883333",fill:g.cD9D9D9}),e.jsx("circle",{cx:"355.765",cy:"253.335",r:"0.883333",fill:g.cD9D9D9}),e.jsx("circle",{cx:"347.29",cy:"250.685",r:"0.883333",fill:g.cD9D9D9}),e.jsx("circle",{cx:"347.29",cy:"253.335",r:"0.883333",fill:g.cD9D9D9}),e.jsx("circle",{cx:"358.592",cy:"250.685",r:"0.883333",fill:g.cD9D9D9}),e.jsx("circle",{cx:"358.592",cy:"253.335",r:"0.883333",fill:g.cD9D9D9}),e.jsx("circle",{cx:"350.114",cy:"250.685",r:"0.883333",fill:g.cD9D9D9}),e.jsx("circle",{cx:"350.114",cy:"253.335",r:"0.883333",fill:g.cD9D9D9}),e.jsx("circle",{cx:"361.418",cy:"250.685",r:"0.883333",fill:g.cD9D9D9}),e.jsx("circle",{cx:"361.418",cy:"253.335",r:"0.883333",fill:g.cD9D9D9}),e.jsx("circle",{cx:"352.941",cy:"250.685",r:"0.883333",fill:g.cD9D9D9}),e.jsx("circle",{cx:"352.941",cy:"253.335",r:"0.883333",fill:g.cD9D9D9}),e.jsx("circle",{cx:"364.244",cy:"250.685",r:"0.883333",fill:g.cD9D9D9}),e.jsx("circle",{cx:"364.244",cy:"253.335",r:"0.883333",fill:g.cD9D9D9}),e.jsx("circle",{cx:"344.462",cy:"271.885",r:"0.883333",fill:g.cD9D9D9}),e.jsx("circle",{cx:"344.462",cy:"274.535",r:"0.883333",fill:g.cD9D9D9}),e.jsx("circle",{cx:"355.765",cy:"271.885",r:"0.883333",fill:g.cD9D9D9}),e.jsx("circle",{cx:"355.765",cy:"274.535",r:"0.883333",fill:g.cD9D9D9}),e.jsx("circle",{cx:"347.29",cy:"271.885",r:"0.883333",fill:g.cD9D9D9}),e.jsx("circle",{cx:"347.29",cy:"274.535",r:"0.883333",fill:g.cD9D9D9}),e.jsx("circle",{cx:"358.592",cy:"271.885",r:"0.883333",fill:g.cD9D9D9}),e.jsx("circle",{cx:"358.592",cy:"274.535",r:"0.883333",fill:g.cD9D9D9}),e.jsx("circle",{cx:"350.114",cy:"271.885",r:"0.883333",fill:g.cD9D9D9}),e.jsx("circle",{cx:"350.114",cy:"274.535",r:"0.883333",fill:g.cD9D9D9}),e.jsx("circle",{cx:"361.418",cy:"271.885",r:"0.883333",fill:g.cD9D9D9}),e.jsx("circle",{cx:"361.418",cy:"274.535",r:"0.883333",fill:g.cD9D9D9}),e.jsx("circle",{cx:"352.941",cy:"271.885",r:"0.883333",fill:g.cD9D9D9}),e.jsx("circle",{cx:"352.941",cy:"274.535",r:"0.883333",fill:g.cD9D9D9}),e.jsx("circle",{cx:"364.244",cy:"271.885",r:"0.883333",fill:g.cD9D9D9}),e.jsx("circle",{cx:"364.244",cy:"274.535",r:"0.883333",fill:g.cD9D9D9}),e.jsx("circle",{cx:"359.918",cy:"262.61",r:"4.45833",stroke:g.c001174,strokeWidth:"0.8"}),e.jsx("circle",{cx:"359.918",cy:"262.61",r:"2.20833",fill:g.cE7EAE9}),e.jsx("rect",{x:"269.726",y:"258.102",width:"36.4",height:"9.01667",rx:"0.65",fill:g.cE7EAE9,stroke:g.c001174,strokeWidth:"0.7"}),e.jsx("rect",{x:"310.537",y:"258.102",width:"6.54333",height:"9.01667",rx:"0.65",fill:g.cE7EAE9,stroke:g.c001174,strokeWidth:"0.7"}),e.jsx("rect",{x:"321.312",y:"258.102",width:"6.54333",height:"9.01667",rx:"0.65",fill:g.cE7EAE9,stroke:g.c001174,strokeWidth:"0.7"}),e.jsx("rect",{x:"332.089",y:"258.102",width:"6.54333",height:"9.01667",rx:"0.65",fill:g.cE7EAE9,stroke:g.c001174,strokeWidth:"0.7"}),e.jsx("rect",{x:"342.864",y:"258.102",width:"6.54333",height:"9.01667",rx:"0.65",fill:g.cE7EAE9,stroke:g.c001174,strokeWidth:"0.7"}),e.jsx("rect",{x:"270.261",y:"200.336",width:"8.83333",height:"6.18333",fill:g.cFFFFFF}),e.jsx("rect",{x:"270.261",y:"235.668",width:"8.83333",height:"6.18333",fill:g.cFFFFFF}),e.jsx("rect",{x:"270.261",y:"271.885",width:"8.83333",height:"6.18333",fill:g.cFFFFFF}),e.jsx("rect",{x:"279.095",y:"200.336",width:"26.5",height:"6.18333",fill:g.cDEECF8}),e.jsx("rect",{x:"279.095",y:"235.668",width:"26.5",height:"6.18333",fill:g.cDEECF8}),e.jsx("rect",{x:"279.095",y:"271.885",width:"26.5",height:"6.18333",fill:g.cDEECF8}),e.jsx("path",{d:"M268.053 210.494C268.483 209.112 268.564 208.343 268.053 206.961H362.569C361.955 208.363 361.972 209.136 362.569 210.494H268.053Z",fill:g.c000D58,stroke:g.c001174}),e.jsx("path",{d:"M268.053 246.269C268.483 244.887 268.564 244.118 268.053 242.736H362.569C361.955 244.138 361.972 244.911 362.569 246.269H268.053Z",fill:g.c000D58,stroke:g.c001174}),e.jsx("path",{d:"M283.312 130.775C283.312 129.64 283.987 128.72 284.82 128.72H349.805C350.638 128.72 351.312 129.64 351.312 130.775V169.72H283.312V130.775Z",fill:g.cFFFFFF,stroke:g.c48504C,strokeWidth:"2"}),e.jsx("path",{d:"M279.574 171.847C279.381 171.283 279.267 170.624 279.33 169.72H355.195C355.423 170.925 355.287 171.695 355.063 172.241C354.834 172.802 354.506 173.186 354.101 173.66C354.084 173.68 354.067 173.7 354.05 173.72H280.503C280.468 173.658 280.434 173.598 280.4 173.539C280.051 172.922 279.774 172.434 279.574 171.847Z",stroke:g.c48504C,strokeWidth:"2"}),e.jsx("path",{d:"M350.312 133.72V129.726L284.812 129.72C284.312 129.726 284.312 129.726 284.312 130.125V133.72H350.312Z",fill:g.cD6D6D6}),e.jsx("circle",{cx:"287.212",cy:"131.62",r:"0.9",fill:g.c28AC6E}),e.jsx("circle",{cx:"289.812",cy:"131.62",r:"0.9",fill:g.cC9184A}),e.jsx("circle",{cx:"292.412",cy:"131.62",r:"0.9",fill:g.cFFE18B}),e.jsx("rect",{x:"315.312",y:"133.72",width:"35",height:"35",fill:g.c90CAF9}),e.jsx("path",{d:"M319.312 153.22H341.312",stroke:g.cFFFFFF,strokeWidth:"1.3",strokeLinecap:"round"}),e.jsx("path",{d:"M288.312 150.72H310.312",stroke:g.c001174,strokeWidth:"1.3",strokeLinecap:"round"}),e.jsx("path",{d:"M319.312 156.22H336.312",stroke:g.cFFFFFF,strokeWidth:"1.3",strokeLinecap:"round"}),e.jsx("path",{d:"M288.312 153.72H305.312",stroke:g.c001174,strokeWidth:"1.3",strokeLinecap:"round"}),e.jsx("path",{d:"M319.312 159.22H336.312",stroke:g.cFFFFFF,strokeWidth:"1.3",strokeLinecap:"round"}),e.jsx("path",{d:"M288.312 156.72H305.312",stroke:g.c001174,strokeWidth:"1.3",strokeLinecap:"round"}),e.jsx("path",{d:"M337.312 139.72L328.312 148.72M328.313 139.72L337.313 148.72",stroke:g.cFFFFFF,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]})})}function Ci({onClick:r}){const t=De.useMediaQuery("md");return e.jsxs(u.Box,{direction:"column",height:"height-screen",fullWidth:!0,display:"flex",align:"center",justify:"center",gap:"md",overflow:"overflow-hidden",children:[e.jsx(vi,{width:t?600:300}),e.jsx(B.Text,{fontWeight:"bold",fontSize:t?"3xl":"2xl",textAlign:"center",children:"Server Problem"}),e.jsx(B.Text,{fontWeight:"semibold",fontSize:t?"lg":"md",textAlign:"center",children:"we are trying to fix the problem"}),r&&e.jsx(j.Button,{size:t?"md":"xs",onClick:r,children:"Go Back"})]})}const xi=r=>{var o,n,l,s,i;const t=De.useMediaQuery("md");return e.jsxs(Oe.Dialog,{isShow:r.isShow,onHide:r.onHide,style:{...t?{minWidth:r.customMinWidth||"458px"}:{maxWidth:r.customMinWidth||"458px"}},children:[e.jsx(Oe.DialogTitle,{...r.dialogTitleProps,children:typeof r.title=="string"?e.jsx(B.Text,{fontSize:"lg",fontWeight:"medium",children:r.title}):r.title}),e.jsx(Oe.DialogBody,{children:typeof r.description=="string"?e.jsx(B.Text,{fontSize:"md",lineHeight:"leading-6",color:"brand",children:r.description}):r.description}),e.jsx(Oe.DialogFooter,{children:e.jsx(u.Box,{display:"flex",direction:((o=r.containerConfirmBtnProps)==null?void 0:o.direction)||"row",justify:((n=r.containerConfirmBtnProps)==null?void 0:n.justify)||"flex-end",...r.containerConfirmBtnProps,children:e.jsxs(u.Box,{display:"flex",direction:((l=r.wrapperConfirmBtnProps)==null?void 0:l.direction)||"row",justify:((s=r.wrapperConfirmBtnProps)==null?void 0:s.justify)||"flex-end",gap:((i=r.wrapperConfirmBtnProps)==null?void 0:i.gap)||"sm",...r.wrapperConfirmBtnProps,children:[r.onCancel&&e.jsx(j.Button,{secondary:!0,onClick:r.onCancel,size:"md",fullWidth:!0,children:r.titleCancelBtn||"Cancel"}),e.jsx(u.Box,{direction:"column",fullWidth:!0,style:{textWrap:"nowrap"},children:e.jsx(j.Button,{...r.buttonConfirmProps,onClick:r.onConfirm,size:"md",fullWidth:!0,children:r.titleConfirmBtn||"Ok"})})]})})})]},r.key)},wi=d.memo(({children:r,height:t,minHeight:o,customHeight:n,paddingInline:l="spacing-0",paddingBlock:s="spacing-0",header:i,footer:c,title:a,titleTag:h,action:y,actionContainer:b,containerProps:p,bodyProps:C,headerProps:E={borderBottom:!0},footerProps:w={borderTop:!0},variantTag:L="info"})=>{const F=d.useRef(null),[I,S]=d.useState("100vh");d.useEffect(()=>{const k=()=>{if(F.current){const z=F.current.getBoundingClientRect().top;S(`calc(100vh - ${z}px)`)}};return k(),window.addEventListener("resize",k),()=>window.removeEventListener("resize",k)},[]);const D=()=>h?e.jsxs(u.Box,{direction:"row",gap:"sm",align:"center",children:[e.jsx(B.Text,{fontWeight:"medium",children:a}),e.jsx(cr.Badges,{border:!0,text:h,variant:L})]}):e.jsx(B.Text,{fontWeight:"medium",children:a}),H=()=>i||e.jsxs(u.Box,{direction:"row",justify:"space-between",align:"flex-start",gap:"md",children:[e.jsx(u.Box,{direction:"column",children:a?D():null}),e.jsx(u.Box,{direction:"column",...b,children:y??null})]}),A=!!(i||a||y);return e.jsxs(u.Box,{ref:F,height:t,customMinHeight:o,customHeight:n,paddingBlock:s,paddingInline:l,bg:"white",direction:"column",...p,style:{backgroundColor:"var(--sa-background-primary, #ffffff)",display:"flex",minHeight:I,...(p==null?void 0:p.style)??{}},children:[i!==null&&A?e.jsx(Ct,{...E,children:H()}):null,e.jsx(u.Box,{direction:"column",padding:"spacing-0",...C,style:{flex:1,overflow:"auto",...(C==null?void 0:C.style)??{}},children:r}),c?e.jsx(xt,{...w,children:c}):null]})}),Di=d.memo(({value:r,options:t=[],onChange:o,multiple:n})=>{const l=(r==null?void 0:r.map(c=>c.value))||[],s=(t==null?void 0:t.filter(c=>l.includes(c.value)))||[],i=c=>{const a=[...s];let h=[];n?h=l.includes(c.value)?a.filter(y=>y.value!==c.value):[...a,c]:h=[c],o==null||o(h)};return e.jsx(u.Box,{direction:"row",gap:"sm",flexWrap:"wrap",children:t==null?void 0:t.map((c,a)=>e.jsx(j.Button,{...l.includes(c.value)?{primary:!0}:{secondary:!0},onClick:()=>i(c),children:c.label},a))})});function Xr(r){return null}Xr.displayName="LayoutDialog.Header";function $r(r){return null}$r.displayName="LayoutDialog.Body";function Kr(r){return null}Kr.displayName="LayoutDialog.Aside";function Rr(r){return null}Rr.displayName="LayoutDialog.Footer";const Ie={"lyd-root":"_lyd-root_1g78i_1","lyd-backdrop":"_lyd-backdrop_1g78i_38","lyd-panel":"_lyd-panel_1g78i_47","lyd-modal":"_lyd-modal_1g78i_58","lyd-fullscreen":"_lyd-fullscreen_1g78i_72","lyd-sidebar":"_lyd-sidebar_1g78i_80","lyd-header":"_lyd-header_1g78i_110","lyd-header-content":"_lyd-header-content_1g78i_121","lyd-header-actions":"_lyd-header-actions_1g78i_129","lyd-main":"_lyd-main_1g78i_136","lyd-body":"_lyd-body_1g78i_143","lyd-aside":"_lyd-aside_1g78i_149","lyd-footer":"_lyd-footer_1g78i_165","lyd-vm-group":"_lyd-vm-group_1g78i_178","lyd-vm-btn":"_lyd-vm-btn_1g78i_186","lyd-close-btn":"_lyd-close-btn_1g78i_209"},Si=[{mode:"sidebar",label:"Sidebar",icon:e.jsx(Bi,{})},{mode:"modal",label:"Modal",icon:e.jsx(T.Icon,{name:"Newscreen",size:"sm"})},{mode:"fullscreen",label:"Fullscreen",icon:e.jsx(T.Icon,{name:"Fullscreen",size:"sm"})}];function ki({value:r,onChange:t}){return e.jsx("div",{className:Ie["lyd-vm-group"],role:"group","aria-label":"View mode",children:Si.map(o=>e.jsx("button",{type:"button",className:Ie["lyd-vm-btn"],"data-active":r===o.mode,"aria-label":`Switch to ${o.label} view`,"aria-pressed":r===o.mode,onClick:()=>t(o.mode),children:o.icon},o.mode))})}function Bi(){return e.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[e.jsx("rect",{x:"3",y:"4",width:"18",height:"16",rx:"2"}),e.jsx("line",{x1:"15",y1:"4",x2:"15",y2:"20"})]})}const At={md:"768px",lg:"1024px",xl:"1200px","2xl":"1440px"};function mi(r){return r?r in At?At[r]:r:At.xl}function et(r,t){let o=null;return d.Children.forEach(r,n=>{d.isValidElement(n)&&n.type===t&&(o=n.props.children??null)}),o}function Ei(r){const{isOpen:t,onClose:o,viewMode:n,defaultViewMode:l="modal",onViewModeChange:s,showViewModeToggle:i=!0,showCloseButton:c=!0,size:a,asideWidth:h,disableEscapeClose:y=!1,disableBackdropClose:b=!1,lockBodyScroll:p=!0,children:C}=r,[E,w]=d.useState(l),L=n??E,I=De.useMediaQuery("md")?L:"fullscreen",S=d.useCallback(_=>{n===void 0&&w(_),s==null||s(_)},[n,s]),D=d.useRef(null);d.useEffect(()=>{if(!(!t||!p))return D.current=document.body.style.overflow,document.body.style.overflow="hidden",()=>{document.body.style.overflow=D.current??""}},[t,p]);const H=d.useRef(o);H.current=o,d.useEffect(()=>{if(t)return Oe.registerOverlay({onEscape:y?void 0:()=>H.current()})},[t,y]);const A=d.useMemo(()=>et(C,Xr),[C]),k=d.useMemo(()=>et(C,$r),[C]),z=d.useMemo(()=>et(C,Kr),[C]),W=d.useMemo(()=>et(C,Rr),[C]);if(!t)return null;const X=[Ie["lyd-panel"],I==="modal"&&Ie["lyd-modal"],I==="fullscreen"&&Ie["lyd-fullscreen"],I==="sidebar"&&Ie["lyd-sidebar"]].filter(Boolean).join(" "),K={"--lyd-max-w":mi(a),...h!==void 0&&{"--lyd-aside-w":h}},Q=()=>{b||o()};return typeof document>"u"?null:zr.createPortal(e.jsxs("div",{className:Ie["lyd-root"],style:K,role:"dialog","aria-modal":"true",children:[e.jsx("div",{className:Ie["lyd-backdrop"],onClick:Q,"aria-hidden":"true"}),e.jsxs("div",{className:X,children:[e.jsxs("div",{className:Ie["lyd-header"],children:[e.jsx("div",{className:Ie["lyd-header-content"],children:A}),e.jsxs("div",{className:Ie["lyd-header-actions"],children:[i&&e.jsx(ki,{value:L,onChange:S}),c&&e.jsx("button",{type:"button",className:Ie["lyd-close-btn"],onClick:o,"aria-label":"Close dialog",children:e.jsx(T.Icon,{name:"Cross",size:"md"})})]})]}),e.jsxs("div",{className:Ie["lyd-main"],children:[e.jsx("div",{className:Ie["lyd-body"],children:k}),z&&e.jsx("aside",{className:Ie["lyd-aside"],children:z})]}),W&&e.jsx("div",{className:Ie["lyd-footer"],children:W})]})]}),document.body)}const Ir=Ei;Ir.Header=Xr,Ir.Body=$r,Ir.Aside=Kr,Ir.Footer=Rr;function Fi({url:r,filename:t,onClose:o}){const n=d.useRef(o);return n.current=o,d.useEffect(()=>Oe.registerOverlay({onEscape:()=>n.current()}),[]),e.jsxs("div",{onClick:o,style:{position:"fixed",inset:0,zIndex:9999,backgroundColor:"rgba(0,0,0,0.85)",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",gap:"12px"},children:[e.jsxs("div",{onClick:l=>l.stopPropagation(),style:{position:"absolute",top:"16px",right:"16px",display:"flex",gap:"8px"},children:[e.jsx("a",{href:r,download:t,style:{display:"inline-flex",alignItems:"center",gap:"6px",padding:"6px 12px",backgroundColor:"rgba(255,255,255,0.15)",color:"#fff",borderRadius:"var(--sa-radii-sm, 6px)",fontSize:"13px",textDecoration:"none",backdropFilter:"blur(4px)"},children:"Download"}),e.jsx("button",{onClick:o,style:{display:"inline-flex",alignItems:"center",justifyContent:"center",width:"32px",height:"32px",backgroundColor:"rgba(255,255,255,0.15)",border:"none",borderRadius:"var(--sa-radii-sm, 6px)",color:"#fff",cursor:"pointer",backdropFilter:"blur(4px)"},"aria-label":"Close preview",children:"✕"})]}),e.jsx("img",{src:r,alt:t,onClick:l=>l.stopPropagation(),style:{maxWidth:"90vw",maxHeight:"85vh",objectFit:"contain",borderRadius:"var(--sa-radii-sm, 6px)",boxShadow:"var(--sa-shadow-lg, 0 25px 50px rgba(0,0,0,0.5))"}}),e.jsx("span",{style:{color:"rgba(255,255,255,0.6)",fontSize:"12px"},children:t})]})}const xl="var(--sa-border-subtle, #e5e7eb)",rt=()=>e.jsx(u.Box,{style:{width:1,height:22,backgroundColor:xl}}),Mi=r=>typeof r=="number"?`${r}px`:r;function wl({count:r,children:t,label:o,onClear:n,clearLabel:l="Clear selection",clearDisabled:s=!1,bottom:i=20,zIndex:c=50,style:a,className:h}){if(r===0)return null;const y=typeof o=="function"?o(r):o??`${r} selected`;return e.jsx(u.Box,{direction:"row",justify:"center",style:{position:"fixed",bottom:Mi(i),left:0,right:0,zIndex:c,pointerEvents:"none"},children:e.jsxs(u.Box,{direction:"row",align:"center",gap:"xs",bg:"white",padding:"spacing-8",className:h,style:{pointerEvents:"auto",borderRadius:10,border:`1px solid ${xl}`,boxShadow:"var(--sa-shadow-xl, 0 10px 25px -5px rgb(0 0 0/0.15))",...a},children:[e.jsx(B.Text,{fontSize:"sm",fontWeight:"medium",whiteSpace:"nowrap",style:{paddingInline:6},children:y}),e.jsx(rt,{}),t,n&&e.jsxs(e.Fragment,{children:[e.jsx(rt,{}),e.jsx(me.Tooltip,{label:l,position:"top",children:e.jsx(j.Button,{variant:"tertiary",tone:"neutral",size:"sm",iconLeft:e.jsx(T.Icon,{name:"Cross",size:"xs"}),"aria-label":l,onClick:n,disabled:s})})]})]})})}wl.Divider=rt;const tt=r=>{const{variant:t="outlined",overflow:o="hidden",style:n,children:l,...s}=r;return e.jsx(st.Card,{variant:t,overflow:o,style:{display:"flex",flexDirection:"column",...n},...s,children:l})},Ti=r=>r==null?void 0:typeof r=="number"?`${r}px`:r,Dl=({src:r,alt:t="",height:o=140,bg:n="var(--sa-background-neutral, #f0f1f2)",avatar:l,children:s})=>e.jsxs(u.Box,{style:{position:"relative",marginBottom:l?24:void 0},children:[e.jsx(u.Box,{style:{height:Ti(o),background:r?void 0:n,overflow:"hidden"},children:r?e.jsx("img",{src:r,alt:t,style:{width:"100%",height:"100%",objectFit:"cover",display:"block"}}):null}),s?e.jsx(u.Box,{style:{position:"absolute",inset:0,pointerEvents:"none"},children:s}):null,l?e.jsx(u.Box,{style:{position:"absolute",left:16,bottom:0,transform:"translateY(50%)"},children:l}):null]}),Sl=({avatar:r,title:t,subtitle:o,action:n,divided:l=!1,children:s})=>e.jsx(u.Box,{padding:"md",style:{borderBottom:l?"1px solid var(--sa-border-subtle, #0b120e24)":void 0},children:s??e.jsxs(se.Flex,{direction:"row",align:"center",gap:"sm",children:[r,e.jsxs(u.Box,{flex:"1",style:{minWidth:0},children:[t!=null&&e.jsx(B.Text,{fontWeight:"semibold",truncate:!0,children:t}),o!=null&&e.jsx(B.Text,{fontSize:"sm",color:"subtlest",truncate:!0,children:o})]}),n!=null&&e.jsx(u.Box,{style:{flexShrink:0},children:n})]})}),kl=({left:r,right:t,divided:o=!0,children:n})=>e.jsx(u.Box,{padding:"md",style:{marginTop:"auto",borderTop:o?"1px solid var(--sa-border-subtle, #0b120e24)":void 0},children:n??e.jsxs(se.Flex,{direction:"row",align:"center",justify:"space-between",gap:"sm",children:[e.jsx(u.Box,{style:{minWidth:0},children:r}),e.jsx(u.Box,{style:{flexShrink:0},children:t})]})});tt.Media=Dl,tt.Header=Sl,tt.Footer=kl;const Li=r=>{const{defaultTab:t=0,paramKey:o="tab"}=r||{},{useSearchParams:n}=rr(),[l,s]=n(),i=br.searchParamsToObject(l.toString());return{activeTab:i[o]?parseInt(i[o]):t,handleTabChange:h=>{s({...i,[o]:h.toString()})},searchQueries:i}};function Ii({appName:r,menuConfig:t,formatTitle:o}){const{useLocation:n}=rr(),l=n();d.useEffect(()=>{let s=null,i=null;for(const h of t){const y=h.items.find(b=>b.to?b.to==="/"?l.pathname==="/":!!(b.to===l.pathname||l.pathname.startsWith(b.to+"/")):!1);if(y){s=y,i=h;break}}const c=[];s!=null&&s.title&&c.push(s.title),i!=null&&i.name&&c.push(i.name.toTitleCase());const a=(h,y)=>h.length>0?`${h.join(" - ")} | ${y}`:y;document.title=(o||a)(c,r)},[l.pathname])}const Oi=()=>{const{useSearchParams:r,useParams:t,useLocation:o}=rr(),[n,l]=r(),s=br.searchParamsToObject(n.toString()),i=t(),c=o(),a=i.id;return{setSearchParams:l,searchParams:n,searchQueries:s,isHasQuery:(C,E)=>n.has(C)&&n.get(C)===E,getQueryParam:C=>n.get(C),getRouteParam:C=>i[C],params:i,location:c,id:a,hasId:!!a}};function Wi(r){var n,l;const t=r.decodedAccessToken;return d.useMemo(()=>{var a,h;const s=((h=(a=t==null?void 0:t.access)==null?void 0:a.role)==null?void 0:h.code)??"",i=Object.keys(r.role).reduce((y,b)=>{const p=`is${b.toLowerCase().replace(/(^\w|_\w)/g,C=>C.replace("_","").toUpperCase())}`;return{...y,[p]:!1}},{});return{...Object.keys(r.role).reduce((y,b)=>{const p=`is${b.toLowerCase().replace(/(^\w|_\w)/g,C=>C.replace("_","").toUpperCase())}`;return{...y,[p]:s===r.role[b]}},i),hasRole:y=>s===r.role[y],getRoleKey:()=>s}},[(l=(n=t==null?void 0:t.access)==null?void 0:n.role)==null?void 0:l.code,r])}f.ASIDE_WIDTH_VAR=Ot,f.AdvanceFilterBar=Po,f.App=Nl,f.AppComponent=uo,f.AppContext=at,f.AppLayout=Ul,f.AsideBar=ii,f.BackButton=Yl,f.ColumnFilterDropdown=ll,f.ColumnMenu=cl,f.ConfirmationDialog=xi,f.DataTable=sl,f.DecisionWrapper=ae,f.EachUtils=Yr,f.EmptyStatePage=ui,f.EntityCard=tt,f.EntityCardFooter=kl,f.EntityCardHeader=Sl,f.EntityCardMedia=Dl,f.FLOATING_FOOTER_HEIGHT_VAR=Wt,f.FilterBar=Zn,f.FilterDrawer=Vo,f.FloatingFooter=ai,f.ForbiddenPage=bi,f.Form=Rs,f.FullSection=wi,f.HeaderLeftSlot=_l,f.HeaderLeftSlotOutlet=po,f.HeaderLeftSlotProvider=yo,f.HorizontalField=en,f.ImagePreview=Fi,f.InputFile=fl,f.InputImage=gl,f.LayoutDialog=Ir,f.LayoutDialogAside=Kr,f.LayoutDialogBody=$r,f.LayoutDialogFooter=Rr,f.LayoutDialogHeader=Xr,f.ModuleSwitcher=Xl,f.ModuleSwitcherModal=To,f.NotFoundPage=yi,f.PageLayout=on,f.Pressable=Er,f.RightDrawer=Lo,f.SIDEBAR_DEFAULT_WIDTH=Vr,f.SIDEBAR_MAX_WIDTH=ft,f.SIDEBAR_MIN_WIDTH=ht,f.ScrollToTopButton=yl,f.Section=sn,f.SectionFooter=xt,f.SectionHeader=Ct,f.SelectButton=Di,f.SelectionActionBar=wl,f.SelectionActionBarDivider=rt,f.ServerErrorPage=Ci,f.SidePanel=ni,f.SidePanelItem=ti,f.SidebarBadgesProvider=lo,f.SidebarGroupSlot=ql,f.SidebarGroupSlotOutlet=vo,f.SidebarGroupSlotProvider=bo,f.SidebarHeaderSlot=go,f.SidebarProvider=co,f.StarasiaRouterProvider=fo,f.TableFooter=ol,f.TableHeader=tl,f.TableLayout=ds,f.TableSection=os,f.TableWrapper=rl,f.ToggleStatus=Ks,f.Typography=Ze,f.VerticalField=di,f.clearModuleSelection=Zl,f.createInitialFromUserName=ps,f.cssVars=Ds,f.expandDateCompact=$n,f.formHasChanged=Fs,f.formatDate=xs,f.formatDateToIndonesian=hl,f.formatRupiah=vs,f.getDateFilterValue=Ho,f.getDateRangeFilterValue=hn,f.getInitials=Cs,f.getValueDropdownMultipleFilter=zo,f.getValueRadioFilter=dn,f.getValueSearch=_r,f.getValuesFilter=Nr,f.handleChangeFilter=Fr,f.handleOnScroll=Hs,f.isEmail=Ws,f.isFilterActive=fn,f.isOnlyLettersAndSpaces=Ts,f.isPhoneNumber=Ms,f.isSlug=As,f.localStorageAdapter=Dt,f.oneDayInMs=Ss,f.parseIndonesianDateToDate=bs,f.preventNonCoordinateInput=zs,f.preventNonNumberAndDecimalInput=Os,f.preventNonNumberInput=Ls,f.preventNumberInput=Is,f.resolveDateRangeValueToString=Wo,f.resolveDateValueToString=Ao,f.resolveDropdownValueToString=Io,f.resolveRadioValueToString=Oo,f.resolveSidebarBadge=Hr,f.storageKeys=xr,f.textWidth=ks,f.useApp=dt,f.useAppState=to,f.useAuthRole=Wi,f.useDynamicTitle=Ii,f.useFilterBarApiParams=Jn,f.useFilterBarControls=Xn,f.useModuleSelection=bt,f.useRouteInfo=We,f.useRouteParams=Oi,f.useRouterAdapter=rr,f.useSidebar=ao,f.useSidebarBadges=no,f.useTabState=Li,f.useTableSortApiParams=hs,Object.keys(gr).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(f,r)&&Object.defineProperty(f,r,{enumerable:!0,get:()=>gr[r]})}),Object.keys(Ut).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(f,r)&&Object.defineProperty(f,r,{enumerable:!0,get:()=>Ut[r]})}),Object.keys(cr).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(f,r)&&Object.defineProperty(f,r,{enumerable:!0,get:()=>cr[r]})}),Object.keys(u).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(f,r)&&Object.defineProperty(f,r,{enumerable:!0,get:()=>u[r]})}),Object.keys(yr).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(f,r)&&Object.defineProperty(f,r,{enumerable:!0,get:()=>yr[r]})}),Object.keys(j).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(f,r)&&Object.defineProperty(f,r,{enumerable:!0,get:()=>j[r]})}),Object.keys(st).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(f,r)&&Object.defineProperty(f,r,{enumerable:!0,get:()=>st[r]})}),Object.keys(hr).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(f,r)&&Object.defineProperty(f,r,{enumerable:!0,get:()=>hr[r]})}),Object.keys(Oe).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(f,r)&&Object.defineProperty(f,r,{enumerable:!0,get:()=>Oe[r]})}),Object.keys(Ar).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(f,r)&&Object.defineProperty(f,r,{enumerable:!0,get:()=>Ar[r]})}),Object.keys(pr).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(f,r)&&Object.defineProperty(f,r,{enumerable:!0,get:()=>pr[r]})}),Object.keys(De).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(f,r)&&Object.defineProperty(f,r,{enumerable:!0,get:()=>De[r]})}),Object.keys(br).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(f,r)&&Object.defineProperty(f,r,{enumerable:!0,get:()=>br[r]})}),Object.keys(ar).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(f,r)&&Object.defineProperty(f,r,{enumerable:!0,get:()=>ar[r]})}),Object.keys(O).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(f,r)&&Object.defineProperty(f,r,{enumerable:!0,get:()=>O[r]})}),Object.keys(Br).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(f,r)&&Object.defineProperty(f,r,{enumerable:!0,get:()=>Br[r]})}),Object.keys(mr).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(f,r)&&Object.defineProperty(f,r,{enumerable:!0,get:()=>mr[r]})}),Object.keys(G).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(f,r)&&Object.defineProperty(f,r,{enumerable:!0,get:()=>G[r]})}),Object.keys(Jt).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(f,r)&&Object.defineProperty(f,r,{enumerable:!0,get:()=>Jt[r]})}),Object.keys(it).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(f,r)&&Object.defineProperty(f,r,{enumerable:!0,get:()=>it[r]})}),Object.keys(vr).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(f,r)&&Object.defineProperty(f,r,{enumerable:!0,get:()=>vr[r]})}),Object.keys(Yt).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(f,r)&&Object.defineProperty(f,r,{enumerable:!0,get:()=>Yt[r]})}),Object.keys(Cr).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(f,r)&&Object.defineProperty(f,r,{enumerable:!0,get:()=>Cr[r]})}),Object.keys(me).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(f,r)&&Object.defineProperty(f,r,{enumerable:!0,get:()=>me[r]})}),Object.keys(er).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(f,r)&&Object.defineProperty(f,r,{enumerable:!0,get:()=>er[r]})}),Object.keys(ct).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(f,r)&&Object.defineProperty(f,r,{enumerable:!0,get:()=>ct[r]})}),Object.keys(B).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(f,r)&&Object.defineProperty(f,r,{enumerable:!0,get:()=>B[r]})}),Object.keys(T).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(f,r)&&Object.defineProperty(f,r,{enumerable:!0,get:()=>T[r]})}),Object.keys(se).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(f,r)&&Object.defineProperty(f,r,{enumerable:!0,get:()=>se[r]})}),Object.keys(Xt).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(f,r)&&Object.defineProperty(f,r,{enumerable:!0,get:()=>Xt[r]})}),Object.keys($t).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(f,r)&&Object.defineProperty(f,r,{enumerable:!0,get:()=>$t[r]})}),Object.keys(Kt).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(f,r)&&Object.defineProperty(f,r,{enumerable:!0,get:()=>Kt[r]})}),Object.keys(Rt).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(f,r)&&Object.defineProperty(f,r,{enumerable:!0,get:()=>Rt[r]})}),Object.keys(eo).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(f,r)&&Object.defineProperty(f,r,{enumerable:!0,get:()=>eo[r]})}),Object.keys(qe).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(f,r)&&Object.defineProperty(f,r,{enumerable:!0,get:()=>qe[r]})}),Object.keys(ro).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(f,r)&&Object.defineProperty(f,r,{enumerable:!0,get:()=>ro[r]})}),Object.defineProperty(f,Symbol.toStringTag,{value:"Module"})});
|
|
108
|
+
`;function cc(){if(typeof document>"u"||document.getElementById(wl))return;const r=document.createElement("style");r.id=wl,r.textContent=sc,document.head.appendChild(r)}const ic=({active:r=!1,accentSide:t="left",onClick:o,title:n,badge:l,heading:s,meta:c,children:i,divider:a=!0,disabled:h,className:y,style:b,"aria-label":p})=>(d.useEffect(cc,[]),e.jsx("button",{type:"button",className:[qe,y].filter(Boolean).join(" "),"data-active":r?"true":"false","data-accent":t,"data-divider":a?"true":"false","aria-current":r?"true":void 0,"aria-label":p,disabled:h,onClick:o,style:b,children:i??e.jsxs(f.Box,{display:"flex",direction:"column",gap:"spacing-4",fullWidth:!0,style:{minWidth:0},children:[(n||l)&&e.jsxs(ie.Flex,{direction:"row",align:"center",justify:"space-between",gap:"sm",style:{minWidth:0},children:[n?e.jsx(D.Text,{fontSize:"sm",style:{minWidth:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",color:"var(--sa-text-primary, #292a2e)"},children:n}):e.jsx("span",{}),l?e.jsx(f.Box,{style:{flexShrink:0},children:l}):null]}),s?e.jsx(D.Text,{fontSize:"md",fontWeight:"semibold",style:{color:"var(--sa-text-primary, #292a2e)"},children:s}):null,c?e.jsx(D.Text,{fontSize:"sm",style:{color:"var(--sa-text-subtlest, #6b6e76)"},children:c}):null]})})),zt=18,ac=40,Dl="280ms cubic-bezier(0.4, 0, 0.2, 1)",Sl="var(--sa-border-subtle, #0b120e24)",dc=`1px solid ${Sl}`,Bl="var(--sa-background-white, #ffffff)",hc=({children:r,header:t,collapsed:o,defaultCollapsed:n=!1,onToggle:l,width:s=337,side:c="left",offsetTop:i="var(--app-header-height, 4rem)",height:a,showToggle:h=!0,togglePosition:y="top",toggleOffset:b=40,toggleLabel:p,style:C,bodyStyle:E,className:w,pageLayout:L,overlay:F="mobile",wrapperProps:I,contentProps:B})=>{const k=De.useMediaQuery("md"),H=o!==void 0,[W,S]=d.useState(n),z=H?o:W,O=()=>{const se=!z;H||S(se),l==null||l(se)},Y=c==="left",X=typeof i=="number"?`${i}px`:i,q=a!==void 0?typeof a=="number"?`${a}px`:a:`calc(100vh - ${X})`,Z=p??{collapse:"Collapse panel",expand:"Expand panel"},K=y==="center"?{top:"50%",transform:"translateY(-50%)"}:y==="bottom"?{bottom:b}:{top:b},te=z?Y?"ChevronRight":"ChevronLeft":Y?"ChevronLeft":"ChevronRight",_=L!==void 0&&(F==="mobile"?!k:F),V=_?{position:"absolute",top:0,bottom:0,width:s,transform:`translateX(${z?Y?"-100%":"100%":"0"})`,transition:`transform ${Dl}`,zIndex:50,...Y?{left:0}:{right:0},...C}:{position:"sticky",top:X,alignSelf:"flex-start",width:z?0:s,flexShrink:0,height:q,transition:`width ${Dl}`,...C},N=e.jsxs(f.Box,{className:w,style:V,children:[e.jsx(f.Box,{fullWidth:!0,fullHeight:!0,display:"flex",direction:"column",overflow:"overflow-hidden",borderStyle:z?void 0:Y?"border-solid-r":"border-solid-l",borderWidth:z?void 0:Y?"border-r":"border-l",style:{backgroundColor:Bl,borderColor:Sl},children:e.jsxs(f.Box,{fullHeight:!0,display:"flex",direction:"column",customWidth:s,customMinWidth:s,style:Y?void 0:{marginLeft:"auto"},children:[t?e.jsx(f.Box,{padding:"md",style:{flexShrink:0},children:t}):null,e.jsx(f.Box,{display:"block",overflow:"overflow-y-auto",style:{flex:"1 1 0",minHeight:0,...E},children:r})]})}),h&&e.jsx(mr,{display:"inline-flex",align:"center",justify:"center",position:"absolute",onClick:O,"aria-label":z?Z.expand:Z.collapse,"aria-expanded":!z,"aria-pressed":z,customWidth:zt,customHeight:ac,style:{...K,backgroundColor:Bl,border:dc,zIndex:5,...Y?{right:-zt,borderLeft:"none",borderRadius:"0 8px 8px 0"}:{left:-zt,borderRight:"none",borderRadius:"8px 0 0 8px"}},children:e.jsx(M.Icon,{name:te,size:"sm"})})]});return L===void 0?N:e.jsxs(f.Box,{direction:"row",position:"relative",...I,style:{height:`calc(100vh - ${X})`,overflow:"hidden",...(I==null?void 0:I.style)??{}},children:[!_&&Y?N:null,e.jsx(f.Box,{display:"block",...B,style:{flex:"1 1 0",minWidth:0,height:"100%",overflowY:"auto",...(B==null?void 0:B.style)??{}},children:L}),!_&&!Y?N:null,_&&e.jsxs(e.Fragment,{children:[!z&&e.jsx("div",{onClick:O,"aria-hidden":"true",style:{position:"absolute",inset:0,backgroundColor:"rgba(0, 0, 0, 0.4)",zIndex:40}}),N]})]})},Ht="--app-aside-width",fc=r=>typeof r=="number"?`${r}px`:r,uc=({pageLayout:r,children:t,wrapperProps:o,containerProps:n})=>{const l=De.useMediaQuery("md"),s=(n==null?void 0:n.customWidth)??264;return d.useLayoutEffect(()=>{const c=document.documentElement;return c.style.setProperty(Ht,l?fc(s):"0px"),()=>c.style.removeProperty(Ht)},[l,s]),e.jsxs(f.Box,{display:"block",direction:"row",...o,style:{marginRight:l?s:24,...(o==null?void 0:o.style)??{}},children:[r,e.jsx(f.Box,{direction:"column",show:"desktop",as:"aside",position:"fixed",top:"top-0",bottom:"bottom-0",right:"right-0",customWidth:264,borderStyle:"border-solid-l",borderWidth:"border-l",...n,style:{marginTop:"var(--app-header-height, 4rem)",backgroundColor:"var(--sa-background-white, #ffffff)",borderColor:"var(--sa-border-subtle, #0b120e24)",...(n==null?void 0:n.style)??{}},children:t})]})},Pt="--sa-floating-footer-height",gc=r=>typeof r=="number"?`${r}px`:r,yc=({children:r,withScrollToTopButton:t=!1,scrollToTopButtonProps:o,respectAside:n=!1,offsetRight:l,containerProps:s})=>{const c=d.useRef(null),i=l!=null?gc(l):n?"var(--app-aside-width, 0px)":"0px";return d.useLayoutEffect(()=>{const a=document.documentElement,h=()=>{var p;const b=((p=c.current)==null?void 0:p.getBoundingClientRect().height)??0;a.style.setProperty(Pt,`${b}px`)};h();const y=new ResizeObserver(h);return c.current&&y.observe(c.current),()=>{y.disconnect(),a.style.removeProperty(Pt)}},[]),e.jsx(f.Box,{direction:"column",position:"absolute",width:"width-full",style:{zIndex:"var(--app-footer-zindex, 998)"},children:e.jsxs(f.Box,{ref:c,position:"fixed",bottom:"bottom-0",bg:"white",direction:"row",align:"center",display:"flex",paddingBlock:"sm",paddingInline:"md",borderColor:"border-subtle",style:{left:"var(--app-sidebar-width, 0px)",right:i,transition:"left 0.3s ease-in-out, right 0.3s ease-in-out"},justify:(s==null?void 0:s.justify)||"flex-end",borderStyle:"border-solid-t",borderWidth:"border-t",children:[t&&e.jsx(xl,{...o,customBottom:(o==null?void 0:o.customBottom)||"5.7rem"}),r]})})},pc=({fields:r})=>e.jsx(f.Box,{display:"flex",direction:"column",gap:"lg",children:e.jsx(Xr,{of:r,render:(t,o)=>e.jsx(bc,{...t},o)})}),bc=({title:r,value:t,icon:o})=>e.jsxs(f.Box,{display:"flex",direction:"column",gap:"sm",children:[o?e.jsxs(f.Box,{display:"flex",direction:"row",align:"center",gap:"xs",children:[e.jsx(M.Icon,{name:o,color:"subtle"}),e.jsx(D.Text,{color:"gray-500",variant:"sub-h3",children:r})]}):e.jsx(D.Text,{color:"gray-500",variant:"sub-h3",children:r}),typeof t=="string"?e.jsx(D.Text,{variant:"sub-h3",children:t}):t]}),Te={silhouette:"#A7B0AC",accent:"#78867F"};function vc({width:r,height:t}){return e.jsx(e.Fragment,{children:e.jsxs("svg",{width:r||"100",height:t||"90",viewBox:"0 0 102 90",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[e.jsx("path",{d:"M51.0002 16.8145C36.0811 16.8145 24.8296 21.3801 24.8296 27.4328V76.5344C24.8296 82.573 36.0799 87.127 51.0002 87.127C65.9204 87.127 77.1707 82.573 77.1707 76.5344V27.4328C77.1707 21.3801 65.9204 16.8145 51.0002 16.8145ZM51.0002 19.1582C65.0602 19.1582 74.8582 23.5187 74.8582 27.4328C74.8582 30.1363 70.1615 32.9664 63.1708 34.4746C55.861 36.0543 46.1416 36.0543 38.8318 34.4746C31.8399 32.9664 27.1432 30.1363 27.1432 27.4328C27.1432 23.5187 36.9402 19.1582 51.0002 19.1582ZM74.8582 31.9199V43.784C74.8582 46.532 70.3142 49.2941 63.2737 50.8328C63.2391 50.8375 63.2032 50.8434 63.1697 50.8504C57.6867 52.0352 50.8498 52.3305 44.6893 51.7387C42.6358 51.5418 40.6575 51.2453 38.8306 50.8504C38.8029 50.8445 38.7682 50.8387 38.7347 50.8352C32.5707 49.4898 28.318 47.2047 27.3514 44.8141C27.2138 44.4719 27.1421 44.1285 27.1421 43.7852V31.9199C27.1999 31.9715 27.2693 32.0207 27.3294 32.0723C27.5052 32.2246 27.6902 32.3758 27.8844 32.5234C27.9954 32.609 28.1064 32.6934 28.2232 32.7766C28.4371 32.9301 28.6637 33.0801 28.8973 33.2289C29.0083 33.2992 29.1135 33.3719 29.2291 33.441C29.5702 33.6473 29.9275 33.8488 30.3044 34.0434C30.3195 34.0516 30.3333 34.0598 30.3484 34.068C30.7427 34.2707 31.1601 34.4652 31.5925 34.6551C31.7301 34.716 31.8758 34.7734 32.0168 34.832C32.3221 34.9598 32.6331 35.0852 32.9557 35.207C33.1303 35.2727 33.3095 35.3359 33.4887 35.4004C33.8032 35.5117 34.1247 35.6207 34.4542 35.7273C34.6404 35.7871 34.8254 35.8469 35.015 35.9043C35.3734 36.0133 35.7434 36.1164 36.1181 36.2184C36.2915 36.2652 36.4603 36.3145 36.6361 36.3602C37.1911 36.5031 37.7588 36.6402 38.3485 36.7668C42.1595 37.5906 46.5336 38.0254 50.999 38.0254C55.4644 38.0254 59.8397 37.5906 63.6495 36.768C64.2404 36.6402 64.8092 36.5031 65.3666 36.3602C65.5377 36.3156 65.7007 36.2688 65.8684 36.223C66.2499 36.1199 66.6246 36.0145 66.9888 35.9031C67.1749 35.8469 67.3553 35.7883 67.5368 35.7309C67.8745 35.623 68.2028 35.5105 68.5243 35.3969C68.6966 35.3359 68.8677 35.275 69.0353 35.2117C69.3672 35.0863 69.6852 34.9574 69.9985 34.8262C70.1326 34.7699 70.2725 34.7148 70.4032 34.6574C70.8379 34.4664 71.2576 34.2707 71.6542 34.0668C71.66 34.0633 71.6658 34.0609 71.6716 34.0574C72.0589 33.8582 72.4243 33.6508 72.7735 33.441C72.8868 33.3719 72.9909 33.3016 73.1007 33.2313C73.3354 33.0813 73.5632 32.9312 73.7794 32.7766C73.8951 32.6934 74.0049 32.609 74.1159 32.5258C74.3102 32.377 74.4963 32.2258 74.6732 32.0723C74.7322 32.0207 74.8027 31.9727 74.8594 31.9211L74.8582 31.9199ZM74.8582 48.2887V60.1598C74.8582 62.8773 70.3396 65.6359 63.335 67.2004C63.2737 67.2051 63.2136 67.2156 63.1547 67.2285C59.5021 68.016 55.2482 68.4109 50.9955 68.4098C48.8692 68.4098 46.7428 68.3113 44.6917 68.1145C42.6405 67.9176 40.6656 67.6211 38.8399 67.2273C38.7832 67.2133 38.7266 67.2051 38.6699 67.2004C31.663 65.6359 27.1432 62.8785 27.1432 60.1598V48.2887C27.2022 48.3426 27.2739 48.393 27.3352 48.4457C27.5075 48.5945 27.6878 48.7422 27.8763 48.8875C27.9908 48.9754 28.1052 49.0633 28.2255 49.15C28.4348 49.3 28.6568 49.4477 28.8834 49.593C28.999 49.6668 29.1089 49.7418 29.228 49.8145C29.5633 50.0172 29.9136 50.2152 30.2825 50.4074C30.3114 50.4227 30.338 50.4379 30.3669 50.452C30.7507 50.6488 31.1566 50.8398 31.5775 51.0262C31.722 51.0895 31.8746 51.1504 32.0226 51.2125C32.3198 51.3379 32.6227 51.4609 32.9372 51.5793C33.1164 51.6473 33.2991 51.7129 33.4841 51.7785C33.7917 51.8887 34.1073 51.9953 34.4299 52.0996C34.6196 52.1605 34.8092 52.2227 35.0046 52.2812C35.3584 52.3891 35.7238 52.4922 36.0938 52.593C36.2684 52.641 36.4395 52.6902 36.6176 52.7359C37.1714 52.8789 37.738 53.016 38.3253 53.1426C38.3554 53.1496 38.3889 53.1555 38.4236 53.159C42.2161 53.9723 46.5636 54.4023 51.0013 54.4023C55.439 54.4023 59.7784 53.9734 63.5697 53.1613C63.6056 53.1566 63.6414 53.1508 63.6773 53.1426C64.2647 53.0148 64.8312 52.8789 65.3851 52.7359C65.5643 52.6902 65.7342 52.6398 65.9088 52.593C66.2788 52.4922 66.6442 52.3891 66.998 52.2812C67.1934 52.2215 67.3831 52.1605 67.5727 52.0996C67.8953 51.9953 68.2109 51.8887 68.5185 51.7785C68.7023 51.7129 68.8862 51.6473 69.0654 51.5793C69.3799 51.4598 69.6817 51.3367 69.98 51.2125C70.128 51.1504 70.2806 51.0895 70.4252 51.0262C70.846 50.841 71.2507 50.65 71.6357 50.452C71.6646 50.4367 71.6912 50.4215 71.7201 50.4074C72.0901 50.2152 72.4405 50.0172 72.7747 49.8145C72.8949 49.7418 73.0036 49.6668 73.1192 49.593C73.347 49.4477 73.5678 49.3 73.7771 49.15C73.8974 49.0633 74.0118 48.9766 74.1263 48.8875C74.3148 48.7422 74.4952 48.5945 74.6674 48.4457C74.7287 48.393 74.7992 48.3426 74.8582 48.2887ZM74.8582 76.5355C74.8582 80.4367 65.0602 84.7844 51.0002 84.7844C36.9402 84.7844 27.1421 80.4367 27.1421 76.5355V64.6469C27.1987 64.6984 27.2693 64.7477 27.3282 64.7992C27.5028 64.9504 27.6844 65.0992 27.8763 65.2469C27.9873 65.3324 28.0995 65.418 28.2162 65.5023C28.4302 65.6559 28.6568 65.807 28.8892 65.9559C28.9979 66.0262 29.1019 66.0977 29.2152 66.1656C29.5691 66.3801 29.9367 66.591 30.3299 66.7937C30.331 66.7937 30.3322 66.7938 30.3333 66.7961C30.7253 66.9988 31.1404 67.1945 31.5694 67.3855C31.7058 67.4465 31.8515 67.5039 31.9914 67.5637C32.2955 67.6926 32.6054 67.8191 32.928 67.9422C33.1002 68.0078 33.2772 68.0711 33.4541 68.1355C33.7674 68.248 34.0888 68.3582 34.4184 68.466C34.6034 68.5258 34.7872 68.5867 34.9768 68.6453C35.3341 68.7555 35.703 68.8609 36.0764 68.9641C36.2476 69.0109 36.4141 69.0602 36.5887 69.1059C37.1413 69.2512 37.7079 69.3895 38.2941 69.5195C38.3462 69.5312 38.3993 69.5383 38.4514 69.543C42.2369 70.3516 46.5717 70.7793 50.999 70.7793C55.4263 70.7793 59.7599 70.3527 63.5478 69.543C63.5998 69.5383 63.653 69.5312 63.705 69.5195C64.2912 69.3906 64.8578 69.2512 65.4105 69.1059C65.5839 69.0602 65.7493 69.0121 65.9192 68.9652C66.295 68.8621 66.665 68.7555 67.0246 68.6453C67.2131 68.5879 67.3958 68.5281 67.5785 68.4684C67.9092 68.3605 68.2329 68.2492 68.5486 68.1355C68.7231 68.0723 68.8977 68.009 69.0689 67.9445C69.3938 67.8203 69.7071 67.6926 70.0135 67.5625C70.1511 67.5039 70.2933 67.4477 70.4275 67.3879C71.29 67.0047 72.0774 66.5969 72.7851 66.1668C72.8972 66.0988 73.0001 66.0273 73.1088 65.9582C73.3424 65.8082 73.5702 65.657 73.7852 65.5023C73.9008 65.4191 74.0118 65.3336 74.1217 65.2492C74.3148 65.1016 74.4975 64.9516 74.6732 64.7992C74.7322 64.7488 74.8016 64.6996 74.8582 64.648V76.5355Z",fill:Te.silhouette}),e.jsx("path",{d:"M33.2089 38.8535C31.3993 38.8535 29.9263 40.3453 29.9263 42.1805C29.9263 44.0156 31.3982 45.5062 33.2089 45.5062C35.0196 45.5062 36.4903 44.0145 36.4903 42.1805C36.4903 40.3465 35.0184 38.8535 33.2089 38.8535ZM33.2089 43.1625C32.6735 43.1625 32.2388 42.7219 32.2388 42.1805C32.2388 41.6391 32.6735 41.1973 33.2089 41.1973C33.7442 41.1973 34.1778 41.6379 34.1778 42.1805C34.1778 42.723 33.7431 43.1625 33.2089 43.1625Z",fill:Te.silhouette}),e.jsx("path",{d:"M33.2089 54.6777C31.3993 54.6777 29.9263 56.1695 29.9263 58.0047C29.9263 59.8398 31.3982 61.3316 33.2089 61.3316C35.0196 61.3316 36.4903 59.8398 36.4903 58.0047C36.4903 56.1695 35.0184 54.6777 33.2089 54.6777ZM33.2089 58.9879C32.6735 58.9879 32.2388 58.5473 32.2388 58.0047C32.2388 57.4621 32.6735 57.0215 33.2089 57.0215C33.7442 57.0215 34.1778 57.4621 34.1778 58.0047C34.1778 58.5473 33.7431 58.9879 33.2089 58.9879Z",fill:Te.silhouette}),e.jsx("path",{d:"M33.2089 70.5C31.3993 70.5 29.9263 71.9918 29.9263 73.827C29.9263 75.6621 31.3982 77.1539 33.2089 77.1539C35.0196 77.1539 36.4903 75.6621 36.4903 73.827C36.4903 71.9918 35.0184 70.5 33.2089 70.5ZM33.2089 74.8102C32.6735 74.8102 32.2388 74.3695 32.2388 73.827C32.2388 73.2844 32.6735 72.8438 33.2089 72.8438C33.7442 72.8438 34.1778 73.2844 34.1778 73.827C34.1778 74.3695 33.7431 74.8102 33.2089 74.8102Z",fill:Te.silhouette}),e.jsx("path",{d:"M70.0215 38.2852C69.3821 38.2852 68.8652 38.809 68.8652 39.457V44.3332C68.8652 44.9812 69.3821 45.5051 70.0215 45.5051C70.6609 45.5051 71.1777 44.9812 71.1777 44.3332V39.457C71.1777 38.809 70.6609 38.2852 70.0215 38.2852Z",fill:Te.silhouette}),e.jsx("path",{d:"M70.0215 54.3926C69.3821 54.3926 68.8652 54.9164 68.8652 55.5645V60.4406C68.8652 61.0887 69.3821 61.6125 70.0215 61.6125C70.6609 61.6125 71.1777 61.0887 71.1777 60.4406V55.5645C71.1777 54.9164 70.6609 54.3926 70.0215 54.3926Z",fill:Te.silhouette}),e.jsx("path",{d:"M70.0215 70.5C69.3821 70.5 68.8652 71.0238 68.8652 71.6719V76.5492C68.8652 77.1973 69.3821 77.7211 70.0215 77.7211C70.6609 77.7211 71.1777 77.1973 71.1777 76.5492V71.6719C71.1777 71.0238 70.6609 70.5 70.0215 70.5Z",fill:Te.silhouette}),e.jsx("path",{d:"M65.77 39.7617C65.1306 39.7617 64.6138 40.2855 64.6138 40.9336V45.8098C64.6138 46.4578 65.1306 46.9816 65.77 46.9816C66.4094 46.9816 66.9263 46.4578 66.9263 45.8098V40.9336C66.9263 40.2855 66.4094 39.7617 65.77 39.7617Z",fill:Te.silhouette}),e.jsx("path",{d:"M65.77 55.8691C65.1306 55.8691 64.6138 56.393 64.6138 57.041V61.9172C64.6138 62.5652 65.1306 63.0891 65.77 63.0891C66.4094 63.0891 66.9263 62.5652 66.9263 61.9172V57.041C66.9263 56.393 66.4094 55.8691 65.77 55.8691Z",fill:Te.silhouette}),e.jsx("path",{d:"M65.77 71.9766C65.1306 71.9766 64.6138 72.5004 64.6138 73.1484V78.0246C64.6138 78.6727 65.1306 79.1965 65.77 79.1965C66.4094 79.1965 66.9263 78.6727 66.9263 78.0246V73.1484C66.9263 72.5004 66.4094 71.9766 65.77 71.9766Z",fill:Te.silhouette}),e.jsx("path",{d:"M61.2939 40.7246C60.6545 40.7246 60.1377 41.2484 60.1377 41.8965V46.7727C60.1377 47.4207 60.6545 47.9445 61.2939 47.9445C61.9334 47.9445 62.4502 47.4207 62.4502 46.7727V41.8965C62.4502 41.2484 61.9334 40.7246 61.2939 40.7246Z",fill:Te.silhouette}),e.jsx("path",{d:"M61.2939 56.832C60.6545 56.832 60.1377 57.3559 60.1377 58.0039V62.8801C60.1377 63.5281 60.6545 64.052 61.2939 64.052C61.9334 64.052 62.4502 63.5281 62.4502 62.8801V58.0039C62.4502 57.3559 61.9334 56.832 61.2939 56.832Z",fill:Te.silhouette}),e.jsx("path",{d:"M61.2939 72.9395C60.6545 72.9395 60.1377 73.4633 60.1377 74.1113V78.9875C60.1377 79.6355 60.6545 80.1594 61.2939 80.1594C61.9334 80.1594 62.4502 79.6355 62.4502 78.9875V74.1113C62.4502 73.4633 61.9334 72.9395 61.2939 72.9395Z",fill:Te.silhouette}),e.jsx("path",{d:"M39.0489 24.4037C39.131 24.4037 39.2154 24.3944 39.2986 24.3768C42.7316 23.6127 46.6755 23.185 51.0207 23.11C51.659 23.0983 52.1677 22.5651 52.1561 21.917C52.1446 21.2701 51.652 20.7451 50.9791 20.7662C46.4813 20.8448 42.3835 21.2889 38.8015 22.0881C38.1782 22.2264 37.7828 22.8522 37.9204 23.4838C38.0395 24.0311 38.5182 24.4037 39.0489 24.4037Z",fill:Te.silhouette}),e.jsx("path",{d:"M32.5406 26.6215C32.7407 26.6215 32.9442 26.57 33.128 26.4586C33.1315 26.4563 33.5096 26.2336 34.2889 25.9055C34.8786 25.6582 35.1584 24.9727 34.9144 24.3739C34.6704 23.775 33.9917 23.4926 33.4032 23.7399C32.4632 24.1348 31.9926 24.4149 31.9417 24.4465C31.396 24.7782 31.219 25.4942 31.544 26.0485C31.7613 26.4164 32.1452 26.6204 32.5395 26.6204L32.5406 26.6215Z",fill:Te.silhouette}),e.jsx("path",{d:"M92.7251 26.7272L82.3845 29.3124C81.6929 29.4856 80.9911 29.0642 80.8179 28.3727C80.6447 27.6799 81.066 26.978 81.7576 26.8048L92.0982 24.2196C92.791 24.0464 93.4929 24.4678 93.6661 25.1593C93.8393 25.8521 93.4179 26.554 92.7251 26.7272Z",fill:Te.accent,fillOpacity:"0.65"}),e.jsx("path",{d:"M94.4649 11.0082L80.2465 21.3488C79.6701 21.7676 78.8609 21.6409 78.4408 21.0632C78.022 20.4867 78.1487 19.6775 78.7265 19.2574L92.9448 8.91682C93.5213 8.49803 94.3305 8.6247 94.7505 9.20248C95.1693 9.77897 95.0414 10.5881 94.4649 11.0082Z",fill:Te.accent,fillOpacity:"0.65"}),e.jsx("path",{d:"M78.0091 10.6269L74.1314 17.0898C73.7643 17.7025 72.9706 17.9002 72.358 17.5331C71.7466 17.1673 71.5475 16.3724 71.9146 15.7597L75.7923 9.29684C76.1594 8.68545 76.9544 8.48769 77.5657 8.85349C78.1784 9.22058 78.3762 10.0155 78.0091 10.6269Z",fill:Te.accent,fillOpacity:"0.65"})]})})}const Cc=({title:r="create",children:t,onClickAction:o,variant:n="primary",variantTitle:l,leftIcon:s,showButton:c=!0,customHeight:i,childrenButton:a,customIcon:h})=>{const y=()=>{switch(n){case"primary":return e.jsx(e.Fragment,{children:s?e.jsx(j.Button,{primary:!0,iconLeft:s,onClick:o,children:a||r}):e.jsx(j.Button,{primary:!0,onClick:o,children:a||r})});case"secondary":return e.jsx(e.Fragment,{children:s?e.jsx(j.Button,{secondary:!0,iconLeft:s,onClick:o,children:l?e.jsx(D.Text,{fontFamily:"Poppins",fontSize:"md",fontWeight:"medium",style:{color:"var(--sa-background-success, #28ac6e)"},children:a||r}):r}):e.jsx(j.Button,{secondary:!0,onClick:o,children:a||r})});case"success":return e.jsx(e.Fragment,{children:s?e.jsx(j.Button,{success:!0,iconLeft:s,onClick:o,children:a||r}):e.jsx(j.Button,{success:!0,onClick:o,children:a||r})});default:return e.jsx(e.Fragment,{children:s?e.jsx(j.Button,{primary:!0,iconLeft:s,onClick:o,children:a||r}):e.jsx(j.Button,{primary:!0,onClick:o,children:a||r})})}};return e.jsxs(f.Box,{height:"height-full",display:"flex",direction:"column",gap:"sm",justify:"center",align:"center",marginBlock:"auto",customHeight:i,children:[h||e.jsx(vc,{}),e.jsx(f.Box,{direction:"column",children:t.map((b,p)=>e.jsx(Ke.Body1,{props:{align:"center",textAlign:"center"},children:p>2?null:b},p))}),c?y():null]})},ee={c001A72:"#001A72",c64B5F6:"#64B5F6",c98B4CB:"#98B4CB",cBBDEFB:"#BBDEFB",cD0E5F7:"#D0E5F7",cD6EBFD:"#D6EBFD",c000000:"#000000",cFFFFFF:"#FFFFFF"};function xc({width:r,height:t}){return e.jsx(e.Fragment,{children:e.jsxs("svg",{width:r,height:t,viewBox:"0 0 622 271",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[e.jsx("path",{d:"M32.4375 254.5H612.437",stroke:ee.c64B5F6,strokeWidth:"5",strokeLinecap:"round"}),e.jsx("rect",{x:"216.562",y:"45.5605",width:"55",height:"20",fill:ee.cD6EBFD}),e.jsx("rect",{x:"14.4375",y:"89.7803",width:"46",height:"20",fill:ee.cD6EBFD}),e.jsx("rect",{x:"0.4375",y:"111.78",width:"46",height:"20",fill:ee.cD6EBFD}),e.jsx("rect",{x:"0.4375",y:"67.7803",width:"46",height:"20",fill:ee.cD6EBFD}),e.jsx("rect",{x:"344.312",y:"0.5",width:"55",height:"20",fill:ee.cD6EBFD}),e.jsx("rect",{x:"549.562",y:"86.7803",width:"55",height:"20",fill:ee.cD6EBFD}),e.jsx("rect",{x:"566.562",y:"64.7803",width:"55",height:"20",fill:ee.cD6EBFD}),e.jsx("path",{d:"M233.438 165.217C233.438 132.764 239.035 107.198 250.231 88.5189C261.596 69.8396 279.832 60.5 304.938 60.5C330.043 60.5 348.194 69.8396 359.389 88.5189C370.755 107.198 376.438 132.764 376.438 165.217C376.438 198.047 370.755 223.802 359.389 242.481C348.194 261.16 330.043 270.5 304.938 270.5C279.832 270.5 261.596 261.16 250.231 242.481C239.035 223.802 233.438 198.047 233.438 165.217ZM333.69 165.217C333.69 146.16 331.824 131.538 328.092 121.349C324.36 110.972 316.642 105.783 304.938 105.783C293.233 105.783 285.515 110.972 281.783 121.349C278.051 131.538 276.185 146.16 276.185 165.217C276.185 178.047 276.863 188.708 278.22 197.198C279.577 205.5 282.292 212.292 286.363 217.575C290.604 222.67 296.795 225.217 304.938 225.217C313.08 225.217 319.187 222.67 323.258 217.575C327.499 212.292 330.298 205.5 331.655 197.198C333.012 188.708 333.69 178.047 333.69 165.217Z",fill:ee.cD0E5F7}),e.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M50.4375 235.124V194.28L138.96 60.5H192.466V191.32H215.438V235.124H192.466V249.5H144.563V235.124H50.4375ZM100.862 191.32L147.925 116.143V191.32H100.862Z",fill:ee.cBBDEFB,fillOpacity:"0.6"}),e.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M394.438 235.124V194.28L482.96 60.5H536.466V191.32H559.438V235.124H536.466V249.5H488.563V235.124H394.438ZM444.862 191.32L491.925 116.143V191.32H444.862Z",fill:ee.cBBDEFB,fillOpacity:"0.6"}),e.jsx("path",{d:"M349.472 171.5H261.64V186.396H349.472V171.5Z",fill:ee.c98B4CB}),e.jsx("path",{d:"M261.64 171.5L244.719 186.396H261.64V171.5Z",fill:ee.c98B4CB}),e.jsx("path",{d:"M363.574 186.396L349.472 171.5V186.396H363.574Z",fill:ee.c98B4CB}),e.jsx("path",{d:"M244.719 200.89V264.5H363.574V200.89M244.719 200.89H233.438L244.719 186.396M244.719 200.89H363.574M363.574 200.89H372.437L363.574 186.396M244.719 186.396L261.64 171.5M244.719 186.396H261.64M363.574 186.396L349.472 171.5M363.574 186.396H349.472M261.64 171.5H349.472M261.64 171.5V186.396M349.472 171.5V186.396M349.472 186.396H261.64",stroke:ee.c000000,strokeWidth:"2"}),e.jsx("rect",{x:"246.438",y:"202.5",width:"116",height:"60",fill:ee.cFFFFFF}),e.jsx("path",{d:"M245.536 187.5H362.959L369.438 198.5H237.438L245.536 187.5Z",fill:ee.cFFFFFF}),e.jsx("path",{d:"M332.438 129.846C332.438 141.175 329.183 152.403 323.949 160.772C318.699 169.168 311.592 174.5 303.938 174.5C296.283 174.5 289.176 169.168 283.926 160.772C278.692 152.403 275.438 141.175 275.438 129.846C275.438 118.458 277.838 109.628 282.543 103.663C287.216 97.7387 294.274 94.5 303.938 94.5C313.601 94.5 320.659 97.7387 325.332 103.663C330.037 109.628 332.438 118.458 332.438 129.846Z",fill:ee.cFFFFFF,stroke:ee.c000000,strokeWidth:"2"}),e.jsx("path",{d:"M281.438 145.5C284.032 154.136 285.762 158.682 290.951 164.591M292.681 166.409C293.624 167.647 295.708 169.591 297.438 170.5",stroke:ee.c000000,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}),e.jsx("path",{d:"M304.438 175C299.54 176.339 297.208 177.876 293.938 182.5M304.438 175C301.183 178.041 299.537 178.883 299.438 182.5M304.438 175C308.173 177.107 309.635 178.834 311.438 182.5",stroke:ee.c000000,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}),e.jsx("path",{d:"M304.936 175.5C303.438 180 302.529 181.628 304.936 186.5",stroke:ee.c000000,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}),e.jsx("path",{d:"M288.178 120.981C289.969 120.93 290.921 121.313 292.167 122.754",stroke:ee.c000000,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}),e.jsx("circle",{cx:"291.724",cy:"118.765",r:"3.1027",fill:ee.c000000}),e.jsx("path",{d:"M308.128 122.463C309.123 120.973 309.987 120.418 311.883 120.237",stroke:ee.c000000,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}),e.jsx("circle",{cx:"307.681",cy:"118.765",r:"3.1027",fill:ee.c000000}),e.jsx("ellipse",{cx:"297.938",cy:"134.5",rx:"2.5",ry:"2",fill:ee.c000000}),e.jsx("path",{d:"M340.437 97.5L333.438 104.5M333.438 97.5L340.438 104.5",stroke:ee.c001A72,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}),e.jsx("path",{d:"M265.437 115.5L260.438 120.5M260.438 115.5L265.438 120.5",stroke:ee.c001A72,strokeWidth:"1.2",strokeLinecap:"round",strokeLinejoin:"round"}),e.jsx("path",{d:"M288.437 87.5L283.438 92.5M283.438 87.5L288.438 92.5",stroke:ee.c001A72,strokeWidth:"1.2",strokeLinecap:"round",strokeLinejoin:"round"}),e.jsx("path",{d:"M305.437 83.5L298.438 90.5M298.438 83.5L305.438 90.5",stroke:ee.c001A72,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),e.jsx("path",{d:"M342.437 145.5L337.438 150.5M337.438 145.5L342.438 150.5",stroke:ee.c001A72,strokeWidth:"1.2",strokeLinecap:"round",strokeLinejoin:"round"}),e.jsx("circle",{cx:"339.938",cy:"111",r:"2.5",fill:ee.c001A72}),e.jsx("circle",{cx:"336.438",cy:"94.5",r:"1",fill:ee.c001A72}),e.jsx("circle",{cx:"347.438",cy:"99.5",r:"1",fill:ee.c001A72}),e.jsx("circle",{cx:"267.438",cy:"109.5",r:"2",fill:ee.c001A72}),e.jsx("circle",{cx:"293.438",cy:"85.5",r:"2",fill:ee.c001A72}),e.jsx("circle",{cx:"339.438",cy:"138.5",r:"2",fill:ee.c001A72}),e.jsx("circle",{cx:"267.438",cy:"150.5",r:"2",fill:ee.c001A72}),e.jsx("circle",{cx:"268.438",cy:"118.5",r:"1",fill:ee.c001A72}),e.jsx("circle",{cx:"260.438",cy:"124.5",r:"1",fill:ee.c001A72})]})})}function wc({onClick:r}){const t=De.useMediaQuery("md");return e.jsxs(f.Box,{direction:"column",height:"height-screen",fullWidth:!0,display:"flex",align:"center",justify:"center",gap:"md",children:[e.jsx(xc,{width:t?600:300}),e.jsx(D.Text,{fontWeight:"bold",fontSize:t?"3xl":"2xl",textAlign:"center",children:"Page Not Found"}),e.jsx(D.Text,{fontWeight:"semibold",fontSize:t?"lg":"md",textAlign:"center",children:"Sorry, we couldn't find the page you are looking for"}),r&&e.jsx(j.Button,{size:t?"md":"xs",onClick:r,children:"Go Back"})]})}const ne={c46F16B:"#46F16B",c48504C:"#48504C",c64B5F6:"#64B5F6",c67AEE6:"#67AEE6",c86512B:"#86512B",c956847:"#956847",cBBC3F5:"#BBC3F5",cBBDEFB:"#BBDEFB",cC0B2A2:"#C0B2A2",cC8CEF4:"#C8CEF4",cCABEB1:"#CABEB1",cD5C7BD:"#D5C7BD",cD6D6D6:"#D6D6D6",cD6EBFD:"#D6EBFD",cE5EE80:"#E5EE80",cEE8080:"#EE8080",cEFF3F8:"#EFF3F8",cF4F4F4:"#F4F4F4",cFFFFFF:"#FFFFFF"};function Dc({width:r,height:t}){return e.jsx(e.Fragment,{children:e.jsxs("svg",{width:r,height:t,viewBox:"0 0 654 258",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[e.jsx("rect",{x:"228",y:"55.5",width:"55",height:"20",fill:ne.cD6EBFD}),e.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M75 238.124V197.28L163.523 63.5H217.029V194.32H240V238.124H217.029V252.5H169.126V238.124H75ZM125.424 194.32L172.487 119.143V194.32H125.424Z",fill:ne.cBBDEFB,fillOpacity:"0.6"}),e.jsxs("g",{clipPath:"url(#clip0_2949_9690)",children:[e.jsx("path",{d:"M334.5 274.5C381.168 274.5 419 227.266 419 169C419 110.734 381.168 63.5 334.5 63.5C287.832 63.5 250 110.734 250 169C250 227.266 287.832 274.5 334.5 274.5Z",fill:ne.cEFF3F8,stroke:ne.c67AEE6,strokeWidth:"5"}),e.jsx("path",{d:"M413 197.5C411.397 211.835 402.919 230.898 389.361 246.49C375.596 262.32 356.651 274.5 334.496 274.5C311.331 274.5 292.389 261.672 278.878 245.52C265.592 229.638 257.606 210.603 256 197.5H413Z",fill:ne.cD5C7BD}),e.jsx("path",{d:"M278.887 211.766H391.104L392.583 222.856C392.687 223.635 392.08 224.328 391.294 224.328H277.961C277.14 224.328 276.525 223.577 276.686 222.773L278.887 211.766Z",fill:ne.cCABEB1}),e.jsx("path",{d:"M287.68 218.884L289.354 213.022H378.961L381.473 218.884H287.68Z",fill:ne.cC0B2A2}),e.jsx("path",{d:"M381.944 218.803L381.58 212.266H386.385L386.022 218.803H381.944Z",fill:ne.c956847,stroke:ne.c48504C}),e.jsx("path",{d:"M283.124 218.803L282.768 213.104H287.565L287.209 218.803H283.124Z",fill:ne.c956847,stroke:ne.c48504C}),e.jsx("path",{d:"M285.902 212.103L284.935 186.306H279.606C278.151 186.306 277.004 187.542 277.113 188.993L278.673 209.79C278.77 211.095 279.857 212.103 281.166 212.103H285.902Z",fill:ne.cC8CEF4,stroke:ne.c48504C}),e.jsx("path",{d:"M383.256 212.103L384.638 186.306H389.556C391.007 186.306 392.153 187.537 392.05 188.984L390.564 209.782C390.471 211.09 389.382 212.103 388.07 212.103H383.256Z",fill:ne.cC8CEF4,stroke:ne.c48504C}),e.jsx("path",{d:"M284.497 178.155C284.455 176.194 286.034 174.581 287.996 174.581H381.904C383.895 174.581 385.485 176.24 385.401 178.23L384.066 209.59C383.987 211.463 382.445 212.941 380.569 212.941H288.663C286.759 212.941 285.205 211.419 285.164 209.515L284.497 178.155Z",fill:ne.cC8CEF4,stroke:ne.c48504C}),e.jsx("path",{d:"M284.845 181.524C284.792 179.279 286.598 177.431 288.844 177.431H380.687C382.948 177.431 384.76 179.304 384.684 181.565L383.774 208.737C383.701 210.893 381.933 212.603 379.776 212.603H289.48C287.307 212.603 285.532 210.869 285.481 208.697L284.845 181.524Z",fill:ne.cBBC3F5}),e.jsx("mask",{id:"mask0_2949_9690",maskUnits:"userSpaceOnUse",x:"301",y:"144",width:"68",height:"17",style:{maskType:"luminance"},children:e.jsx("path",{d:"M301 146.5C301 145.395 301.887 144.5 302.98 144.5H367.02C368.114 144.5 369 145.395 369 146.5V160.411H301V146.5Z",fill:ne.cFFFFFF})}),e.jsxs("g",{mask:"url(#mask0_2949_9690)",children:[e.jsx("path",{d:"M301 146.191C301 145.257 301.748 144.5 302.671 144.5H356.701C357.624 144.5 358.372 145.257 358.372 146.191V157.949H301V146.191Z",fill:ne.cFFFFFF}),e.jsx("path",{d:"M301.336 146.607C301.336 145.673 302.08 144.916 302.999 144.916H367.01C367.929 144.916 368.673 145.673 368.673 146.607V152.523H301.336V146.607Z",fill:ne.cD6D6D6}),e.jsx("path",{d:"M368.673 152.523H301.336V174.5H368.673V152.523Z",fill:ne.cF4F4F4}),e.jsx("path",{d:"M307.685 150.417C308.607 150.417 309.356 149.66 309.356 148.726C309.356 147.793 308.607 147.036 307.685 147.036C306.762 147.036 306.014 147.793 306.014 148.726C306.014 149.66 306.762 150.417 307.685 150.417Z",fill:ne.cEE8080}),e.jsx("path",{d:"M313.532 150.417C314.455 150.417 315.203 149.66 315.203 148.726C315.203 147.793 314.455 147.036 313.532 147.036C312.609 147.036 311.861 147.793 311.861 148.726C311.861 149.66 312.609 150.417 313.532 150.417Z",fill:ne.cE5EE80}),e.jsx("path",{d:"M318.546 150.417C319.469 150.417 320.217 149.66 320.217 148.726C320.217 147.793 319.469 147.036 318.546 147.036C317.623 147.036 316.875 147.793 316.875 148.726C316.875 149.66 317.623 150.417 318.546 150.417Z",fill:ne.c46F16B})]}),e.jsx("path",{d:"M301.16 146C301.16 145.172 301.832 144.5 302.66 144.5H367.33C368.159 144.5 368.83 145.172 368.83 146V174.419H301.16V146Z",stroke:ne.c48504C}),e.jsx("path",{d:"M395.29 207.579H423.344M354.255 236.889H369.329M327.038 222.234H347.556M350.905 222.234H358.024M288.097 230.19H304.846M253.344 210.091H272.605M278.467 246.938H295.216M297.309 246.938H303.59M337.088 252.801H354.255",stroke:ne.c86512B,strokeWidth:"2",strokeLinecap:"round"})]}),e.jsx("path",{d:"M430.241 125.78C430.987 105.807 437.521 90.4065 449.841 79.5799C462.161 68.7532 478.867 63.3398 499.961 63.3398C513.961 63.3398 525.907 65.7665 535.801 70.6199C545.881 75.4732 553.441 82.0998 558.481 90.4998C563.707 98.8998 566.321 108.327 566.321 118.78C566.321 131.1 563.241 141.18 557.081 149.02C550.921 156.673 543.734 161.9 535.521 164.7V165.82C546.161 169.367 554.561 175.247 560.721 183.46C566.881 191.673 569.961 202.22 569.961 215.1C569.961 226.673 567.254 236.94 561.841 245.9C560.436 248.258 558.849 250.481 557.081 252.569L443.5 252.662C432.5 241 427.721 230.5 427.721 207.82H474.201C474.387 216.033 476.721 222.567 481.201 227.42C485.681 232.087 492.214 234.42 500.801 234.42C508.081 234.42 513.681 232.367 517.601 228.26C521.707 223.967 523.761 218.367 523.761 211.46C523.761 202.5 520.867 196.06 515.081 192.14C509.481 188.033 500.427 185.98 487.921 185.98H478.961V147.06H487.921C497.441 147.06 505.094 145.473 510.881 142.3C516.854 138.94 519.841 133.06 519.841 124.66C519.841 117.94 517.974 112.713 514.241 108.98C510.507 105.247 505.374 103.38 498.841 103.38C491.747 103.38 486.427 105.527 482.881 109.82C479.521 114.113 477.561 119.433 477.001 125.78H430.241Z",fill:ne.cBBDEFB,fillOpacity:"0.6"}),e.jsx("rect",{x:"43",y:"87.5",width:"46",height:"20",fill:ne.cD6EBFD}),e.jsx("rect",{x:"29",y:"109.5",width:"46",height:"20",fill:ne.cD6EBFD}),e.jsx("rect",{x:"29",y:"65.5",width:"46",height:"20",fill:ne.cD6EBFD}),e.jsx("rect",{x:"356",y:"0.5",width:"55",height:"20",fill:ne.cD6EBFD}),e.jsx("rect",{x:"572",y:"142.5",width:"55",height:"20",fill:ne.cD6EBFD}),e.jsx("rect",{x:"589",y:"120.5",width:"55",height:"20",fill:ne.cD6EBFD}),e.jsx("path",{d:"M3 255.5L651 255.5",stroke:ne.c64B5F6,strokeWidth:"5",strokeLinecap:"round"}),e.jsx("defs",{children:e.jsx("clipPath",{id:"clip0_2949_9690",children:e.jsx("rect",{width:"179",height:"192",fill:ne.cFFFFFF,transform:"translate(246 60.5)"})})})]})})}function Sc({onClick:r}){const t=De.useMediaQuery("md");return e.jsxs(f.Box,{direction:"column",height:"height-screen",fullWidth:!0,display:"flex",align:"center",justify:"center",gap:"md",children:[e.jsx(Dc,{width:t?600:300}),e.jsx(D.Text,{fontWeight:"bold",fontSize:t?"3xl":"2xl",children:"We Are Sorry ..."}),r&&e.jsx(j.Button,{size:t?"md":"xs",onClick:r,children:"Go Back"})]})}const g={c000D58:"#000D58",c001174:"#001174",c28AC6E:"#28AC6E",c48504C:"#48504C",c64B5F6:"#64B5F6",c90CAF9:"#90CAF9",cC9184A:"#C9184A",cD6D6D6:"#D6D6D6",cD6EBFD:"#D6EBFD",cD9D9D9:"#D9D9D9",cDEECF8:"#DEECF8",cE7EAE9:"#E7EAE9",cF3F8FD:"#F3F8FD",cFFE18B:"#FFE18B",cFFFFFF:"#FFFFFF"};function Bc({width:r,height:t}){return e.jsx(e.Fragment,{children:e.jsxs("svg",{width:r,height:t,viewBox:"0 0 622 287",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[e.jsx("path",{d:"M406.562 180.997C406.562 148.544 412.16 122.978 423.356 104.299C434.721 85.6199 452.957 76.2803 478.063 76.2803C503.168 76.2803 521.319 85.6199 532.514 104.299C543.88 122.978 549.562 148.544 549.562 180.997C549.562 213.827 543.88 239.582 532.514 258.261C521.319 276.941 503.168 286.28 478.063 286.28C452.957 286.28 434.721 276.941 423.356 258.261C412.16 239.582 406.562 213.827 406.562 180.997ZM506.815 180.997C506.815 161.941 504.949 147.318 501.217 137.129C497.485 126.752 489.767 121.563 478.063 121.563C466.358 121.563 458.64 126.752 454.908 137.129C451.176 147.318 449.31 161.941 449.31 180.997C449.31 193.827 449.988 204.488 451.345 212.978C452.703 221.28 455.417 228.073 459.488 233.356C463.729 238.45 469.92 240.997 478.063 240.997C486.205 240.997 492.312 238.45 496.383 233.356C500.624 228.073 503.423 221.28 504.78 212.978C506.137 204.488 506.815 193.827 506.815 180.997Z",fill:g.cD6EBFD}),e.jsx("path",{d:"M246.562 180.558C246.562 148.105 252.16 122.539 263.356 103.86C274.721 85.1804 292.957 75.8408 318.063 75.8408C343.168 75.8408 361.319 85.1804 372.514 103.86C383.88 122.539 389.562 148.105 389.562 180.558C389.562 213.388 383.88 239.143 372.514 257.822C361.319 276.501 343.168 285.841 318.063 285.841C292.957 285.841 274.721 276.501 263.356 257.822C252.16 239.143 246.562 213.388 246.562 180.558ZM346.815 180.558C346.815 161.501 344.949 146.879 341.217 136.69C337.485 126.313 329.767 121.124 318.063 121.124C306.358 121.124 298.64 126.313 294.908 136.69C291.176 146.879 289.31 161.501 289.31 180.558C289.31 193.388 289.988 204.048 291.345 212.539C292.702 220.841 295.417 227.633 299.488 232.916C303.729 238.011 309.92 240.558 318.063 240.558C326.205 240.558 332.312 238.011 336.383 232.916C340.624 227.633 343.423 220.841 344.78 212.539C346.137 204.048 346.815 193.388 346.815 180.558Z",fill:g.cD6EBFD}),e.jsx("path",{d:"M222.808 118.703H128.062V159.858C132.111 155.484 137.779 151.905 145.067 149.122C152.356 146.338 160.251 144.946 168.754 144.946C183.938 144.946 196.49 148.326 206.41 155.086C216.532 161.846 223.922 170.594 228.578 181.329C233.234 192.065 235.562 203.696 235.562 216.221C235.562 239.483 228.882 257.972 215.52 271.691C202.158 285.21 183.357 282.89 159.062 282.89C142.867 282.89 131.098 284.939 116.826 283.918C104.881 278.351 95.6695 270.697 89.1911 260.955C82.7127 251.213 79.1698 239.98 78.5625 227.256H129.276C130.491 233.419 133.426 238.588 138.083 242.763C142.739 246.739 149.116 248.728 157.214 248.728C166.729 248.728 173.815 245.745 178.472 239.781C183.128 233.817 185.456 225.864 185.456 215.923C185.456 206.181 183.027 198.726 178.168 193.557C173.309 188.387 166.223 185.803 156.911 185.803C150.027 185.803 144.359 187.493 139.905 190.873C135.451 194.054 132.515 198.328 131.098 203.696H80.9919V73.9697H222.808V118.703Z",fill:g.cD6EBFD}),e.jsx("rect",{x:"216.562",y:"45.7803",width:"55",height:"20",fill:g.cD6EBFD}),e.jsx("rect",{x:"14.4375",y:"90",width:"46",height:"20",fill:g.cD6EBFD}),e.jsx("rect",{x:"0.4375",y:"112",width:"46",height:"20",fill:g.cD6EBFD}),e.jsx("rect",{x:"0.4375",y:"68",width:"46",height:"20",fill:g.cD6EBFD}),e.jsx("rect",{x:"344.312",y:"0.719727",width:"55",height:"20",fill:g.cD6EBFD}),e.jsx("rect",{x:"549.562",y:"87",width:"55",height:"20",fill:g.cD6EBFD}),e.jsx("rect",{x:"566.562",y:"65",width:"55",height:"20",fill:g.cD6EBFD}),e.jsx("path",{d:"M25.8125 282.22H605.812",stroke:g.c64B5F6,strokeWidth:"5",strokeLinecap:"round"}),e.jsx("rect",{x:"263.012",y:"175.42",width:"104.6",height:"31.2833",rx:"3.3",fill:g.cFFFFFF,stroke:g.c001174,strokeWidth:"1.4"}),e.jsx("path",{d:"M269.878 200.539C269.878 200.263 270.101 200.039 270.377 200.039L305.476 199.955C305.753 199.955 305.978 200.179 305.978 200.455V206.461H269.878V200.539Z",stroke:g.c001174}),e.jsx("rect",{x:"263.012",y:"210.752",width:"104.6",height:"31.2833",rx:"3.3",fill:g.cFFFFFF,stroke:g.c001174,strokeWidth:"1.4"}),e.jsx("path",{d:"M269.878 235.871C269.878 235.595 270.101 235.372 270.377 235.371L305.476 235.288C305.753 235.287 305.978 235.511 305.978 235.788V241.794H269.878V235.871Z",stroke:g.c001174}),e.jsx("rect",{x:"263.012",y:"246.969",width:"104.6",height:"31.2833",rx:"3.3",fill:g.cFFFFFF,stroke:g.c001174,strokeWidth:"1.4"}),e.jsx("path",{d:"M269.878 272.088C269.878 271.812 270.101 271.589 270.377 271.588L305.476 271.505C305.753 271.504 305.978 271.728 305.978 272.005V278.011H269.878V272.088Z",stroke:g.c001174}),e.jsx("path",{d:"M279.095 176.348H364.373C365.459 176.348 366.125 176.992 366.986 178.252V202.985C366.986 202.985 366.986 203.869 366.545 204.752C366.103 205.635 365.661 206.077 365.661 206.077L306.478 206.163V199.452L279.095 199.518V176.348Z",fill:g.cF3F8FD}),e.jsx("path",{d:"M279.095 211.093H364.373C365.459 211.093 366.125 211.736 366.986 212.997V237.73C366.986 237.73 366.986 238.613 366.545 239.497C366.103 240.38 365.661 240.822 365.661 240.822L306.478 240.908V234.197L279.095 234.262V211.093Z",fill:g.cF3F8FD}),e.jsx("path",{d:"M279.095 248.008H364.373C365.459 248.008 366.125 248.652 366.986 249.912V274.646C366.986 274.646 366.986 275.529 366.545 276.412C366.103 277.296 365.661 277.737 365.661 277.737L306.478 277.824V271.112L279.095 271.178V248.008Z",fill:g.cF3F8FD}),e.jsx("circle",{cx:"270.258",cy:"179.136",r:"0.883333",fill:g.cD9D9D9}),e.jsx("circle",{cx:"270.258",cy:"181.786",r:"0.883333",fill:g.cD9D9D9}),e.jsx("circle",{cx:"281.561",cy:"179.136",r:"0.883333",fill:g.cD9D9D9}),e.jsx("circle",{cx:"281.561",cy:"181.786",r:"0.883333",fill:g.cD9D9D9}),e.jsx("circle",{cx:"273.085",cy:"179.136",r:"0.883333",fill:g.cD9D9D9}),e.jsx("circle",{cx:"273.085",cy:"181.786",r:"0.883333",fill:g.cD9D9D9}),e.jsx("circle",{cx:"284.388",cy:"179.136",r:"0.883333",fill:g.cD9D9D9}),e.jsx("circle",{cx:"284.388",cy:"181.786",r:"0.883333",fill:g.cD9D9D9}),e.jsx("circle",{cx:"275.91",cy:"179.136",r:"0.883333",fill:g.cD9D9D9}),e.jsx("circle",{cx:"275.91",cy:"181.786",r:"0.883333",fill:g.cD9D9D9}),e.jsx("circle",{cx:"287.214",cy:"179.136",r:"0.883333",fill:g.cD9D9D9}),e.jsx("circle",{cx:"287.214",cy:"181.786",r:"0.883333",fill:g.cD9D9D9}),e.jsx("circle",{cx:"278.737",cy:"179.136",r:"0.883333",fill:g.cD9D9D9}),e.jsx("circle",{cx:"278.737",cy:"181.786",r:"0.883333",fill:g.cD9D9D9}),e.jsx("circle",{cx:"290.04",cy:"179.136",r:"0.883333",fill:g.cD9D9D9}),e.jsx("circle",{cx:"290.04",cy:"181.786",r:"0.883333",fill:g.cD9D9D9}),e.jsx("circle",{cx:"344.462",cy:"179.136",r:"0.883333",fill:g.cD9D9D9}),e.jsx("circle",{cx:"344.462",cy:"181.786",r:"0.883333",fill:g.cD9D9D9}),e.jsx("circle",{cx:"355.765",cy:"179.136",r:"0.883333",fill:g.cD9D9D9}),e.jsx("circle",{cx:"355.765",cy:"181.786",r:"0.883333",fill:g.cD9D9D9}),e.jsx("circle",{cx:"347.29",cy:"179.136",r:"0.883333",fill:g.cD9D9D9}),e.jsx("circle",{cx:"347.29",cy:"181.786",r:"0.883333",fill:g.cD9D9D9}),e.jsx("circle",{cx:"358.592",cy:"179.136",r:"0.883333",fill:g.cD9D9D9}),e.jsx("circle",{cx:"358.592",cy:"181.786",r:"0.883333",fill:g.cD9D9D9}),e.jsx("circle",{cx:"350.114",cy:"179.136",r:"0.883333",fill:g.cD9D9D9}),e.jsx("circle",{cx:"350.114",cy:"181.786",r:"0.883333",fill:g.cD9D9D9}),e.jsx("circle",{cx:"361.418",cy:"179.136",r:"0.883333",fill:g.cD9D9D9}),e.jsx("circle",{cx:"361.418",cy:"181.786",r:"0.883333",fill:g.cD9D9D9}),e.jsx("circle",{cx:"352.941",cy:"179.136",r:"0.883333",fill:g.cD9D9D9}),e.jsx("circle",{cx:"352.941",cy:"181.786",r:"0.883333",fill:g.cD9D9D9}),e.jsx("circle",{cx:"364.244",cy:"179.136",r:"0.883333",fill:g.cD9D9D9}),e.jsx("circle",{cx:"364.244",cy:"181.786",r:"0.883333",fill:g.cD9D9D9}),e.jsx("circle",{cx:"344.462",cy:"200.336",r:"0.883333",fill:g.cD9D9D9}),e.jsx("circle",{cx:"344.462",cy:"202.986",r:"0.883333",fill:g.cD9D9D9}),e.jsx("circle",{cx:"355.765",cy:"200.336",r:"0.883333",fill:g.cD9D9D9}),e.jsx("circle",{cx:"355.765",cy:"202.986",r:"0.883333",fill:g.cD9D9D9}),e.jsx("circle",{cx:"347.29",cy:"200.336",r:"0.883333",fill:g.cD9D9D9}),e.jsx("circle",{cx:"347.29",cy:"202.986",r:"0.883333",fill:g.cD9D9D9}),e.jsx("circle",{cx:"358.592",cy:"200.336",r:"0.883333",fill:g.cD9D9D9}),e.jsx("circle",{cx:"358.592",cy:"202.986",r:"0.883333",fill:g.cD9D9D9}),e.jsx("circle",{cx:"350.114",cy:"200.336",r:"0.883333",fill:g.cD9D9D9}),e.jsx("circle",{cx:"350.114",cy:"202.986",r:"0.883333",fill:g.cD9D9D9}),e.jsx("circle",{cx:"361.418",cy:"200.336",r:"0.883333",fill:g.cD9D9D9}),e.jsx("circle",{cx:"361.418",cy:"202.986",r:"0.883333",fill:g.cD9D9D9}),e.jsx("circle",{cx:"352.941",cy:"200.336",r:"0.883333",fill:g.cD9D9D9}),e.jsx("circle",{cx:"352.941",cy:"202.986",r:"0.883333",fill:g.cD9D9D9}),e.jsx("circle",{cx:"364.244",cy:"200.336",r:"0.883333",fill:g.cD9D9D9}),e.jsx("circle",{cx:"364.244",cy:"202.986",r:"0.883333",fill:g.cD9D9D9}),e.jsx("circle",{cx:"359.918",cy:"191.061",r:"4.45833",stroke:g.c001174,strokeWidth:"0.8"}),e.jsx("circle",{cx:"359.918",cy:"191.061",r:"2.20833",fill:g.cE7EAE9}),e.jsx("rect",{x:"269.726",y:"186.553",width:"36.4",height:"9.01667",rx:"0.65",fill:g.cE7EAE9,stroke:g.c001174,strokeWidth:"0.7"}),e.jsx("rect",{x:"310.537",y:"186.553",width:"6.54333",height:"9.01667",rx:"0.65",fill:g.cE7EAE9,stroke:g.c001174,strokeWidth:"0.7"}),e.jsx("rect",{x:"321.312",y:"186.553",width:"6.54333",height:"9.01667",rx:"0.65",fill:g.cE7EAE9,stroke:g.c001174,strokeWidth:"0.7"}),e.jsx("rect",{x:"332.089",y:"186.553",width:"6.54333",height:"9.01667",rx:"0.65",fill:g.cE7EAE9,stroke:g.c001174,strokeWidth:"0.7"}),e.jsx("rect",{x:"342.864",y:"186.553",width:"6.54333",height:"9.01667",rx:"0.65",fill:g.cE7EAE9,stroke:g.c001174,strokeWidth:"0.7"}),e.jsx("circle",{cx:"270.258",cy:"214.468",r:"0.883333",fill:g.cD9D9D9}),e.jsx("circle",{cx:"270.258",cy:"217.118",r:"0.883333",fill:g.cD9D9D9}),e.jsx("circle",{cx:"281.561",cy:"214.468",r:"0.883333",fill:g.cD9D9D9}),e.jsx("circle",{cx:"281.561",cy:"217.118",r:"0.883333",fill:g.cD9D9D9}),e.jsx("circle",{cx:"273.085",cy:"214.468",r:"0.883333",fill:g.cD9D9D9}),e.jsx("circle",{cx:"273.085",cy:"217.118",r:"0.883333",fill:g.cD9D9D9}),e.jsx("circle",{cx:"284.388",cy:"214.468",r:"0.883333",fill:g.cD9D9D9}),e.jsx("circle",{cx:"284.388",cy:"217.118",r:"0.883333",fill:g.cD9D9D9}),e.jsx("circle",{cx:"275.91",cy:"214.468",r:"0.883333",fill:g.cD9D9D9}),e.jsx("circle",{cx:"275.91",cy:"217.118",r:"0.883333",fill:g.cD9D9D9}),e.jsx("circle",{cx:"287.214",cy:"214.468",r:"0.883333",fill:g.cD9D9D9}),e.jsx("circle",{cx:"287.214",cy:"217.118",r:"0.883333",fill:g.cD9D9D9}),e.jsx("circle",{cx:"278.737",cy:"214.468",r:"0.883333",fill:g.cD9D9D9}),e.jsx("circle",{cx:"278.737",cy:"217.118",r:"0.883333",fill:g.cD9D9D9}),e.jsx("circle",{cx:"290.04",cy:"214.468",r:"0.883333",fill:g.cD9D9D9}),e.jsx("circle",{cx:"290.04",cy:"217.118",r:"0.883333",fill:g.cD9D9D9}),e.jsx("circle",{cx:"344.462",cy:"214.468",r:"0.883333",fill:g.cD9D9D9}),e.jsx("circle",{cx:"344.462",cy:"217.118",r:"0.883333",fill:g.cD9D9D9}),e.jsx("circle",{cx:"355.765",cy:"214.468",r:"0.883333",fill:g.cD9D9D9}),e.jsx("circle",{cx:"355.765",cy:"217.118",r:"0.883333",fill:g.cD9D9D9}),e.jsx("circle",{cx:"347.29",cy:"214.468",r:"0.883333",fill:g.cD9D9D9}),e.jsx("circle",{cx:"347.29",cy:"217.118",r:"0.883333",fill:g.cD9D9D9}),e.jsx("circle",{cx:"358.592",cy:"214.468",r:"0.883333",fill:g.cD9D9D9}),e.jsx("circle",{cx:"358.592",cy:"217.118",r:"0.883333",fill:g.cD9D9D9}),e.jsx("circle",{cx:"350.114",cy:"214.468",r:"0.883333",fill:g.cD9D9D9}),e.jsx("circle",{cx:"350.114",cy:"217.118",r:"0.883333",fill:g.cD9D9D9}),e.jsx("circle",{cx:"361.418",cy:"214.468",r:"0.883333",fill:g.cD9D9D9}),e.jsx("circle",{cx:"361.418",cy:"217.118",r:"0.883333",fill:g.cD9D9D9}),e.jsx("circle",{cx:"352.941",cy:"214.468",r:"0.883333",fill:g.cD9D9D9}),e.jsx("circle",{cx:"352.941",cy:"217.118",r:"0.883333",fill:g.cD9D9D9}),e.jsx("circle",{cx:"364.244",cy:"214.468",r:"0.883333",fill:g.cD9D9D9}),e.jsx("circle",{cx:"364.244",cy:"217.118",r:"0.883333",fill:g.cD9D9D9}),e.jsx("circle",{cx:"344.462",cy:"235.668",r:"0.883333",fill:g.cD9D9D9}),e.jsx("circle",{cx:"344.462",cy:"238.318",r:"0.883333",fill:g.cD9D9D9}),e.jsx("circle",{cx:"355.765",cy:"235.668",r:"0.883333",fill:g.cD9D9D9}),e.jsx("circle",{cx:"355.765",cy:"238.318",r:"0.883333",fill:g.cD9D9D9}),e.jsx("circle",{cx:"347.29",cy:"235.668",r:"0.883333",fill:g.cD9D9D9}),e.jsx("circle",{cx:"347.29",cy:"238.318",r:"0.883333",fill:g.cD9D9D9}),e.jsx("circle",{cx:"358.592",cy:"235.668",r:"0.883333",fill:g.cD9D9D9}),e.jsx("circle",{cx:"358.592",cy:"238.318",r:"0.883333",fill:g.cD9D9D9}),e.jsx("circle",{cx:"350.114",cy:"235.668",r:"0.883333",fill:g.cD9D9D9}),e.jsx("circle",{cx:"350.114",cy:"238.318",r:"0.883333",fill:g.cD9D9D9}),e.jsx("circle",{cx:"361.418",cy:"235.668",r:"0.883333",fill:g.cD9D9D9}),e.jsx("circle",{cx:"361.418",cy:"238.318",r:"0.883333",fill:g.cD9D9D9}),e.jsx("circle",{cx:"352.941",cy:"235.668",r:"0.883333",fill:g.cD9D9D9}),e.jsx("circle",{cx:"352.941",cy:"238.318",r:"0.883333",fill:g.cD9D9D9}),e.jsx("circle",{cx:"364.244",cy:"235.668",r:"0.883333",fill:g.cD9D9D9}),e.jsx("circle",{cx:"364.244",cy:"238.318",r:"0.883333",fill:g.cD9D9D9}),e.jsx("circle",{cx:"359.918",cy:"226.393",r:"4.45833",stroke:g.c001174,strokeWidth:"0.8"}),e.jsx("circle",{cx:"359.918",cy:"226.393",r:"2.20833",fill:g.cE7EAE9}),e.jsx("rect",{x:"269.726",y:"221.885",width:"36.4",height:"9.01667",rx:"0.65",fill:g.cE7EAE9,stroke:g.c001174,strokeWidth:"0.7"}),e.jsx("rect",{x:"310.537",y:"221.885",width:"6.54333",height:"9.01667",rx:"0.65",fill:g.cE7EAE9,stroke:g.c001174,strokeWidth:"0.7"}),e.jsx("rect",{x:"321.312",y:"221.885",width:"6.54333",height:"9.01667",rx:"0.65",fill:g.cE7EAE9,stroke:g.c001174,strokeWidth:"0.7"}),e.jsx("rect",{x:"332.089",y:"221.885",width:"6.54333",height:"9.01667",rx:"0.65",fill:g.cE7EAE9,stroke:g.c001174,strokeWidth:"0.7"}),e.jsx("rect",{x:"342.864",y:"221.885",width:"6.54333",height:"9.01667",rx:"0.65",fill:g.cE7EAE9,stroke:g.c001174,strokeWidth:"0.7"}),e.jsx("circle",{cx:"270.258",cy:"250.685",r:"0.883333",fill:g.cD9D9D9}),e.jsx("circle",{cx:"270.258",cy:"253.335",r:"0.883333",fill:g.cD9D9D9}),e.jsx("circle",{cx:"281.561",cy:"250.685",r:"0.883333",fill:g.cD9D9D9}),e.jsx("circle",{cx:"281.561",cy:"253.335",r:"0.883333",fill:g.cD9D9D9}),e.jsx("circle",{cx:"273.085",cy:"250.685",r:"0.883333",fill:g.cD9D9D9}),e.jsx("circle",{cx:"273.085",cy:"253.335",r:"0.883333",fill:g.cD9D9D9}),e.jsx("circle",{cx:"284.388",cy:"250.685",r:"0.883333",fill:g.cD9D9D9}),e.jsx("circle",{cx:"284.388",cy:"253.335",r:"0.883333",fill:g.cD9D9D9}),e.jsx("circle",{cx:"275.91",cy:"250.685",r:"0.883333",fill:g.cD9D9D9}),e.jsx("circle",{cx:"275.91",cy:"253.335",r:"0.883333",fill:g.cD9D9D9}),e.jsx("circle",{cx:"287.214",cy:"250.685",r:"0.883333",fill:g.cD9D9D9}),e.jsx("circle",{cx:"287.214",cy:"253.335",r:"0.883333",fill:g.cD9D9D9}),e.jsx("circle",{cx:"278.737",cy:"250.685",r:"0.883333",fill:g.cD9D9D9}),e.jsx("circle",{cx:"278.737",cy:"253.335",r:"0.883333",fill:g.cD9D9D9}),e.jsx("circle",{cx:"290.04",cy:"250.685",r:"0.883333",fill:g.cD9D9D9}),e.jsx("circle",{cx:"290.04",cy:"253.335",r:"0.883333",fill:g.cD9D9D9}),e.jsx("circle",{cx:"344.462",cy:"250.685",r:"0.883333",fill:g.cD9D9D9}),e.jsx("circle",{cx:"344.462",cy:"253.335",r:"0.883333",fill:g.cD9D9D9}),e.jsx("circle",{cx:"355.765",cy:"250.685",r:"0.883333",fill:g.cD9D9D9}),e.jsx("circle",{cx:"355.765",cy:"253.335",r:"0.883333",fill:g.cD9D9D9}),e.jsx("circle",{cx:"347.29",cy:"250.685",r:"0.883333",fill:g.cD9D9D9}),e.jsx("circle",{cx:"347.29",cy:"253.335",r:"0.883333",fill:g.cD9D9D9}),e.jsx("circle",{cx:"358.592",cy:"250.685",r:"0.883333",fill:g.cD9D9D9}),e.jsx("circle",{cx:"358.592",cy:"253.335",r:"0.883333",fill:g.cD9D9D9}),e.jsx("circle",{cx:"350.114",cy:"250.685",r:"0.883333",fill:g.cD9D9D9}),e.jsx("circle",{cx:"350.114",cy:"253.335",r:"0.883333",fill:g.cD9D9D9}),e.jsx("circle",{cx:"361.418",cy:"250.685",r:"0.883333",fill:g.cD9D9D9}),e.jsx("circle",{cx:"361.418",cy:"253.335",r:"0.883333",fill:g.cD9D9D9}),e.jsx("circle",{cx:"352.941",cy:"250.685",r:"0.883333",fill:g.cD9D9D9}),e.jsx("circle",{cx:"352.941",cy:"253.335",r:"0.883333",fill:g.cD9D9D9}),e.jsx("circle",{cx:"364.244",cy:"250.685",r:"0.883333",fill:g.cD9D9D9}),e.jsx("circle",{cx:"364.244",cy:"253.335",r:"0.883333",fill:g.cD9D9D9}),e.jsx("circle",{cx:"344.462",cy:"271.885",r:"0.883333",fill:g.cD9D9D9}),e.jsx("circle",{cx:"344.462",cy:"274.535",r:"0.883333",fill:g.cD9D9D9}),e.jsx("circle",{cx:"355.765",cy:"271.885",r:"0.883333",fill:g.cD9D9D9}),e.jsx("circle",{cx:"355.765",cy:"274.535",r:"0.883333",fill:g.cD9D9D9}),e.jsx("circle",{cx:"347.29",cy:"271.885",r:"0.883333",fill:g.cD9D9D9}),e.jsx("circle",{cx:"347.29",cy:"274.535",r:"0.883333",fill:g.cD9D9D9}),e.jsx("circle",{cx:"358.592",cy:"271.885",r:"0.883333",fill:g.cD9D9D9}),e.jsx("circle",{cx:"358.592",cy:"274.535",r:"0.883333",fill:g.cD9D9D9}),e.jsx("circle",{cx:"350.114",cy:"271.885",r:"0.883333",fill:g.cD9D9D9}),e.jsx("circle",{cx:"350.114",cy:"274.535",r:"0.883333",fill:g.cD9D9D9}),e.jsx("circle",{cx:"361.418",cy:"271.885",r:"0.883333",fill:g.cD9D9D9}),e.jsx("circle",{cx:"361.418",cy:"274.535",r:"0.883333",fill:g.cD9D9D9}),e.jsx("circle",{cx:"352.941",cy:"271.885",r:"0.883333",fill:g.cD9D9D9}),e.jsx("circle",{cx:"352.941",cy:"274.535",r:"0.883333",fill:g.cD9D9D9}),e.jsx("circle",{cx:"364.244",cy:"271.885",r:"0.883333",fill:g.cD9D9D9}),e.jsx("circle",{cx:"364.244",cy:"274.535",r:"0.883333",fill:g.cD9D9D9}),e.jsx("circle",{cx:"359.918",cy:"262.61",r:"4.45833",stroke:g.c001174,strokeWidth:"0.8"}),e.jsx("circle",{cx:"359.918",cy:"262.61",r:"2.20833",fill:g.cE7EAE9}),e.jsx("rect",{x:"269.726",y:"258.102",width:"36.4",height:"9.01667",rx:"0.65",fill:g.cE7EAE9,stroke:g.c001174,strokeWidth:"0.7"}),e.jsx("rect",{x:"310.537",y:"258.102",width:"6.54333",height:"9.01667",rx:"0.65",fill:g.cE7EAE9,stroke:g.c001174,strokeWidth:"0.7"}),e.jsx("rect",{x:"321.312",y:"258.102",width:"6.54333",height:"9.01667",rx:"0.65",fill:g.cE7EAE9,stroke:g.c001174,strokeWidth:"0.7"}),e.jsx("rect",{x:"332.089",y:"258.102",width:"6.54333",height:"9.01667",rx:"0.65",fill:g.cE7EAE9,stroke:g.c001174,strokeWidth:"0.7"}),e.jsx("rect",{x:"342.864",y:"258.102",width:"6.54333",height:"9.01667",rx:"0.65",fill:g.cE7EAE9,stroke:g.c001174,strokeWidth:"0.7"}),e.jsx("rect",{x:"270.261",y:"200.336",width:"8.83333",height:"6.18333",fill:g.cFFFFFF}),e.jsx("rect",{x:"270.261",y:"235.668",width:"8.83333",height:"6.18333",fill:g.cFFFFFF}),e.jsx("rect",{x:"270.261",y:"271.885",width:"8.83333",height:"6.18333",fill:g.cFFFFFF}),e.jsx("rect",{x:"279.095",y:"200.336",width:"26.5",height:"6.18333",fill:g.cDEECF8}),e.jsx("rect",{x:"279.095",y:"235.668",width:"26.5",height:"6.18333",fill:g.cDEECF8}),e.jsx("rect",{x:"279.095",y:"271.885",width:"26.5",height:"6.18333",fill:g.cDEECF8}),e.jsx("path",{d:"M268.053 210.494C268.483 209.112 268.564 208.343 268.053 206.961H362.569C361.955 208.363 361.972 209.136 362.569 210.494H268.053Z",fill:g.c000D58,stroke:g.c001174}),e.jsx("path",{d:"M268.053 246.269C268.483 244.887 268.564 244.118 268.053 242.736H362.569C361.955 244.138 361.972 244.911 362.569 246.269H268.053Z",fill:g.c000D58,stroke:g.c001174}),e.jsx("path",{d:"M283.312 130.775C283.312 129.64 283.987 128.72 284.82 128.72H349.805C350.638 128.72 351.312 129.64 351.312 130.775V169.72H283.312V130.775Z",fill:g.cFFFFFF,stroke:g.c48504C,strokeWidth:"2"}),e.jsx("path",{d:"M279.574 171.847C279.381 171.283 279.267 170.624 279.33 169.72H355.195C355.423 170.925 355.287 171.695 355.063 172.241C354.834 172.802 354.506 173.186 354.101 173.66C354.084 173.68 354.067 173.7 354.05 173.72H280.503C280.468 173.658 280.434 173.598 280.4 173.539C280.051 172.922 279.774 172.434 279.574 171.847Z",stroke:g.c48504C,strokeWidth:"2"}),e.jsx("path",{d:"M350.312 133.72V129.726L284.812 129.72C284.312 129.726 284.312 129.726 284.312 130.125V133.72H350.312Z",fill:g.cD6D6D6}),e.jsx("circle",{cx:"287.212",cy:"131.62",r:"0.9",fill:g.c28AC6E}),e.jsx("circle",{cx:"289.812",cy:"131.62",r:"0.9",fill:g.cC9184A}),e.jsx("circle",{cx:"292.412",cy:"131.62",r:"0.9",fill:g.cFFE18B}),e.jsx("rect",{x:"315.312",y:"133.72",width:"35",height:"35",fill:g.c90CAF9}),e.jsx("path",{d:"M319.312 153.22H341.312",stroke:g.cFFFFFF,strokeWidth:"1.3",strokeLinecap:"round"}),e.jsx("path",{d:"M288.312 150.72H310.312",stroke:g.c001174,strokeWidth:"1.3",strokeLinecap:"round"}),e.jsx("path",{d:"M319.312 156.22H336.312",stroke:g.cFFFFFF,strokeWidth:"1.3",strokeLinecap:"round"}),e.jsx("path",{d:"M288.312 153.72H305.312",stroke:g.c001174,strokeWidth:"1.3",strokeLinecap:"round"}),e.jsx("path",{d:"M319.312 159.22H336.312",stroke:g.cFFFFFF,strokeWidth:"1.3",strokeLinecap:"round"}),e.jsx("path",{d:"M288.312 156.72H305.312",stroke:g.c001174,strokeWidth:"1.3",strokeLinecap:"round"}),e.jsx("path",{d:"M337.312 139.72L328.312 148.72M328.313 139.72L337.313 148.72",stroke:g.cFFFFFF,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]})})}function kc({onClick:r}){const t=De.useMediaQuery("md");return e.jsxs(f.Box,{direction:"column",height:"height-screen",fullWidth:!0,display:"flex",align:"center",justify:"center",gap:"md",overflow:"overflow-hidden",children:[e.jsx(Bc,{width:t?600:300}),e.jsx(D.Text,{fontWeight:"bold",fontSize:t?"3xl":"2xl",textAlign:"center",children:"Server Problem"}),e.jsx(D.Text,{fontWeight:"semibold",fontSize:t?"lg":"md",textAlign:"center",children:"we are trying to fix the problem"}),r&&e.jsx(j.Button,{size:t?"md":"xs",onClick:r,children:"Go Back"})]})}const Ec=r=>{var o,n,l,s,c;const t=De.useMediaQuery("md");return e.jsxs(je.Dialog,{isShow:r.isShow,onHide:r.onHide,style:{...t?{minWidth:r.customMinWidth||"458px"}:{maxWidth:r.customMinWidth||"458px"}},children:[e.jsx(je.DialogTitle,{...r.dialogTitleProps,children:typeof r.title=="string"?e.jsx(D.Text,{fontSize:"lg",fontWeight:"medium",children:r.title}):r.title}),e.jsx(je.DialogBody,{children:typeof r.description=="string"?e.jsx(D.Text,{fontSize:"md",lineHeight:"leading-6",color:"brand",children:r.description}):r.description}),e.jsx(je.DialogFooter,{children:e.jsx(f.Box,{display:"flex",direction:((o=r.containerConfirmBtnProps)==null?void 0:o.direction)||"row",justify:((n=r.containerConfirmBtnProps)==null?void 0:n.justify)||"flex-end",...r.containerConfirmBtnProps,children:e.jsxs(f.Box,{display:"flex",direction:((l=r.wrapperConfirmBtnProps)==null?void 0:l.direction)||"row",justify:((s=r.wrapperConfirmBtnProps)==null?void 0:s.justify)||"flex-end",gap:((c=r.wrapperConfirmBtnProps)==null?void 0:c.gap)||"sm",...r.wrapperConfirmBtnProps,children:[r.onCancel&&e.jsx(j.Button,{secondary:!0,onClick:r.onCancel,size:"md",fullWidth:!0,children:r.titleCancelBtn||"Cancel"}),e.jsx(f.Box,{direction:"column",fullWidth:!0,style:{textWrap:"nowrap"},children:e.jsx(j.Button,{...r.buttonConfirmProps,onClick:r.onConfirm,size:"md",fullWidth:!0,children:r.titleConfirmBtn||"Ok"})})]})})})]},r.key)},mc=d.memo(({children:r,height:t,minHeight:o,customHeight:n,paddingInline:l="spacing-0",paddingBlock:s="spacing-0",header:c,footer:i,title:a,titleTag:h,action:y,actionContainer:b,containerProps:p,bodyProps:C,headerProps:E={borderBottom:!0},footerProps:w={borderTop:!0},variantTag:L="info"})=>{const F=d.useRef(null),[I,B]=d.useState("100vh");d.useEffect(()=>{const S=()=>{if(F.current){const z=F.current.getBoundingClientRect().top;B(`calc(100vh - ${z}px)`)}};return S(),window.addEventListener("resize",S),()=>window.removeEventListener("resize",S)},[]);const k=()=>h?e.jsxs(f.Box,{direction:"row",gap:"sm",align:"center",children:[e.jsx(D.Text,{fontWeight:"medium",children:a}),e.jsx(sr.Badges,{border:!0,text:h,variant:L})]}):e.jsx(D.Text,{fontWeight:"medium",children:a}),H=()=>c||e.jsxs(f.Box,{direction:"row",justify:"space-between",align:"flex-start",gap:"md",children:[e.jsx(f.Box,{direction:"column",children:a?k():null}),e.jsx(f.Box,{direction:"column",...b,children:y??null})]}),W=!!(c||a||y);return e.jsxs(f.Box,{ref:F,height:t,customMinHeight:o,customHeight:n,paddingBlock:s,paddingInline:l,bg:"white",direction:"column",...p,style:{backgroundColor:"var(--sa-background-primary, #ffffff)",display:"flex",minHeight:I,...(p==null?void 0:p.style)??{}},children:[c!==null&&W?e.jsx(St,{...E,children:H()}):null,e.jsx(f.Box,{direction:"column",padding:"spacing-0",...C,style:{flex:1,overflow:"auto",...(C==null?void 0:C.style)??{}},children:r}),i?e.jsx(Bt,{...w,children:i}):null]})}),Fc=d.memo(({value:r,options:t=[],onChange:o,multiple:n})=>{const l=(r==null?void 0:r.map(i=>i.value))||[],s=(t==null?void 0:t.filter(i=>l.includes(i.value)))||[],c=i=>{const a=[...s];let h=[];n?h=l.includes(i.value)?a.filter(y=>y.value!==i.value):[...a,i]:h=[i],o==null||o(h)};return e.jsx(f.Box,{direction:"row",gap:"sm",flexWrap:"wrap",children:t==null?void 0:t.map((i,a)=>e.jsx(j.Button,{...l.includes(i.value)?{primary:!0}:{secondary:!0},onClick:()=>c(i),children:i.label},a))})});function $r(r){return null}$r.displayName="LayoutDialog.Header";function Kr(r){return null}Kr.displayName="LayoutDialog.Body";function Rr(r){return null}Rr.displayName="LayoutDialog.Aside";function et(r){return null}et.displayName="LayoutDialog.Footer";const Pe={"lyd-root":"_lyd-root_1g78i_1","lyd-backdrop":"_lyd-backdrop_1g78i_38","lyd-panel":"_lyd-panel_1g78i_47","lyd-modal":"_lyd-modal_1g78i_58","lyd-fullscreen":"_lyd-fullscreen_1g78i_72","lyd-sidebar":"_lyd-sidebar_1g78i_80","lyd-header":"_lyd-header_1g78i_110","lyd-header-content":"_lyd-header-content_1g78i_121","lyd-header-actions":"_lyd-header-actions_1g78i_129","lyd-main":"_lyd-main_1g78i_136","lyd-body":"_lyd-body_1g78i_143","lyd-aside":"_lyd-aside_1g78i_149","lyd-footer":"_lyd-footer_1g78i_165","lyd-vm-group":"_lyd-vm-group_1g78i_178","lyd-vm-btn":"_lyd-vm-btn_1g78i_186","lyd-close-btn":"_lyd-close-btn_1g78i_209"},Mc=[{mode:"sidebar",label:"Sidebar",icon:e.jsx(Tc,{})},{mode:"modal",label:"Modal",icon:e.jsx(M.Icon,{name:"Newscreen",size:"sm"})},{mode:"fullscreen",label:"Fullscreen",icon:e.jsx(M.Icon,{name:"Fullscreen",size:"sm"})}];function Ic({value:r,onChange:t}){return e.jsx("div",{className:Pe["lyd-vm-group"],role:"group","aria-label":"View mode",children:Mc.map(o=>e.jsx("button",{type:"button",className:Pe["lyd-vm-btn"],"data-active":r===o.mode,"aria-label":`Switch to ${o.label} view`,"aria-pressed":r===o.mode,onClick:()=>t(o.mode),children:o.icon},o.mode))})}function Tc(){return e.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[e.jsx("rect",{x:"3",y:"4",width:"18",height:"16",rx:"2"}),e.jsx("line",{x1:"15",y1:"4",x2:"15",y2:"20"})]})}const Vt={md:"768px",lg:"1024px",xl:"1200px","2xl":"1440px"};function Lc(r){return r?r in Vt?Vt[r]:r:Vt.xl}function rt(r,t){let o=null;return d.Children.forEach(r,n=>{d.isValidElement(n)&&n.type===t&&(o=n.props.children??null)}),o}function Oc(r){const{isOpen:t,onClose:o,viewMode:n,defaultViewMode:l="modal",onViewModeChange:s,showViewModeToggle:c=!0,showCloseButton:i=!0,size:a,asideWidth:h,disableEscapeClose:y=!1,disableBackdropClose:b=!1,lockBodyScroll:p=!0,children:C}=r,[E,w]=d.useState(l),L=n??E,I=De.useMediaQuery("md")?L:"fullscreen",B=d.useCallback(Z=>{n===void 0&&w(Z),s==null||s(Z)},[n,s]),k=d.useRef(null);d.useEffect(()=>{if(!(!t||!p))return k.current=document.body.style.overflow,document.body.style.overflow="hidden",()=>{document.body.style.overflow=k.current??""}},[t,p]);const H=d.useRef(o);H.current=o,d.useEffect(()=>{if(t)return je.registerOverlay({onEscape:y?void 0:()=>H.current()})},[t,y]);const W=d.useMemo(()=>rt(C,$r),[C]),S=d.useMemo(()=>rt(C,Kr),[C]),z=d.useMemo(()=>rt(C,Rr),[C]),O=d.useMemo(()=>rt(C,et),[C]);if(!t)return null;const Y=[Pe["lyd-panel"],I==="modal"&&Pe["lyd-modal"],I==="fullscreen"&&Pe["lyd-fullscreen"],I==="sidebar"&&Pe["lyd-sidebar"]].filter(Boolean).join(" "),X={"--lyd-max-w":Lc(a),...h!==void 0&&{"--lyd-aside-w":h}},q=()=>{b||o()};return typeof document>"u"?null:Pr.createPortal(e.jsxs("div",{className:Pe["lyd-root"],style:X,role:"dialog","aria-modal":"true",children:[e.jsx("div",{className:Pe["lyd-backdrop"],onClick:q,"aria-hidden":"true"}),e.jsxs("div",{className:Y,children:[e.jsxs("div",{className:Pe["lyd-header"],children:[e.jsx("div",{className:Pe["lyd-header-content"],children:W}),e.jsxs("div",{className:Pe["lyd-header-actions"],children:[c&&e.jsx(Ic,{value:L,onChange:B}),i&&e.jsx("button",{type:"button",className:Pe["lyd-close-btn"],onClick:o,"aria-label":"Close dialog",children:e.jsx(M.Icon,{name:"Cross",size:"md"})})]})]}),e.jsxs("div",{className:Pe["lyd-main"],children:[e.jsx("div",{className:Pe["lyd-body"],children:S}),z&&e.jsx("aside",{className:Pe["lyd-aside"],children:z})]}),O&&e.jsx("div",{className:Pe["lyd-footer"],children:O})]})]}),document.body)}const Lr=Oc;Lr.Header=$r,Lr.Body=Kr,Lr.Aside=Rr,Lr.Footer=et;function Ac({url:r,filename:t,onClose:o}){const n=d.useRef(o);return n.current=o,d.useEffect(()=>je.registerOverlay({onEscape:()=>n.current()}),[]),e.jsxs("div",{onClick:o,style:{position:"fixed",inset:0,zIndex:9999,backgroundColor:"rgba(0,0,0,0.85)",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",gap:"12px"},children:[e.jsxs("div",{onClick:l=>l.stopPropagation(),style:{position:"absolute",top:"16px",right:"16px",display:"flex",gap:"8px"},children:[e.jsx("a",{href:r,download:t,style:{display:"inline-flex",alignItems:"center",gap:"6px",padding:"6px 12px",backgroundColor:"rgba(255,255,255,0.15)",color:"#fff",borderRadius:"var(--sa-radii-sm, 6px)",fontSize:"13px",textDecoration:"none",backdropFilter:"blur(4px)"},children:"Download"}),e.jsx("button",{onClick:o,style:{display:"inline-flex",alignItems:"center",justifyContent:"center",width:"32px",height:"32px",backgroundColor:"rgba(255,255,255,0.15)",border:"none",borderRadius:"var(--sa-radii-sm, 6px)",color:"#fff",cursor:"pointer",backdropFilter:"blur(4px)"},"aria-label":"Close preview",children:"✕"})]}),e.jsx("img",{src:r,alt:t,onClick:l=>l.stopPropagation(),style:{maxWidth:"90vw",maxHeight:"85vh",objectFit:"contain",borderRadius:"var(--sa-radii-sm, 6px)",boxShadow:"var(--sa-shadow-lg, 0 25px 50px rgba(0,0,0,0.5))"}}),e.jsx("span",{style:{color:"rgba(255,255,255,0.6)",fontSize:"12px"},children:t})]})}const kl="var(--sa-border-subtle, #e5e7eb)",tt=()=>e.jsx(f.Box,{style:{width:1,height:22,backgroundColor:kl}}),Wc=r=>typeof r=="number"?`${r}px`:r;function El({count:r,children:t,label:o,onClear:n,clearLabel:l="Clear selection",clearDisabled:s=!1,bottom:c=20,zIndex:i=50,style:a,className:h}){if(r===0)return null;const y=typeof o=="function"?o(r):o??`${r} selected`;return e.jsx(f.Box,{direction:"row",justify:"center",style:{position:"fixed",bottom:Wc(c),left:0,right:0,zIndex:i,pointerEvents:"none"},children:e.jsxs(f.Box,{direction:"row",align:"center",gap:"xs",bg:"white",padding:"spacing-8",className:h,style:{pointerEvents:"auto",borderRadius:10,border:`1px solid ${kl}`,boxShadow:"var(--sa-shadow-xl, 0 10px 25px -5px rgb(0 0 0/0.15))",...a},children:[e.jsx(D.Text,{fontSize:"sm",fontWeight:"medium",whiteSpace:"nowrap",style:{paddingInline:6},children:y}),e.jsx(tt,{}),t,n&&e.jsxs(e.Fragment,{children:[e.jsx(tt,{}),e.jsx(me.Tooltip,{label:l,position:"top",children:e.jsx(j.Button,{variant:"tertiary",tone:"neutral",size:"sm",iconLeft:e.jsx(M.Icon,{name:"Cross",size:"xs"}),"aria-label":l,onClick:n,disabled:s})})]})]})})}El.Divider=tt;const ot=r=>{const{variant:t="outlined",overflow:o="hidden",style:n,children:l,...s}=r;return e.jsx(ct.Card,{variant:t,overflow:o,style:{display:"flex",flexDirection:"column",...n},...s,children:l})},zc=r=>r==null?void 0:typeof r=="number"?`${r}px`:r,ml=({src:r,alt:t="",height:o=140,bg:n="var(--sa-background-neutral, #f0f1f2)",avatar:l,children:s})=>e.jsxs(f.Box,{style:{position:"relative",marginBottom:l?24:void 0},children:[e.jsx(f.Box,{style:{height:zc(o),background:r?void 0:n,overflow:"hidden"},children:r?e.jsx("img",{src:r,alt:t,style:{width:"100%",height:"100%",objectFit:"cover",display:"block"}}):null}),s?e.jsx(f.Box,{style:{position:"absolute",inset:0,pointerEvents:"none"},children:s}):null,l?e.jsx(f.Box,{style:{position:"absolute",left:16,bottom:0,transform:"translateY(50%)"},children:l}):null]}),Fl=({avatar:r,title:t,subtitle:o,action:n,divided:l=!1,children:s})=>e.jsx(f.Box,{padding:"md",style:{borderBottom:l?"1px solid var(--sa-border-subtle, #0b120e24)":void 0},children:s??e.jsxs(ie.Flex,{direction:"row",align:"center",gap:"sm",children:[r,e.jsxs(f.Box,{flex:"1",style:{minWidth:0},children:[t!=null&&e.jsx(D.Text,{fontWeight:"semibold",truncate:!0,children:t}),o!=null&&e.jsx(D.Text,{fontSize:"sm",color:"subtlest",truncate:!0,children:o})]}),n!=null&&e.jsx(f.Box,{style:{flexShrink:0},children:n})]})}),Ml=({left:r,right:t,divided:o=!0,children:n})=>e.jsx(f.Box,{padding:"md",style:{marginTop:"auto",borderTop:o?"1px solid var(--sa-border-subtle, #0b120e24)":void 0},children:n??e.jsxs(ie.Flex,{direction:"row",align:"center",justify:"space-between",gap:"sm",children:[e.jsx(f.Box,{style:{minWidth:0},children:r}),e.jsx(f.Box,{style:{flexShrink:0},children:t})]})});ot.Media=ml,ot.Header=Fl,ot.Footer=Ml;const Hc=r=>{const{defaultTab:t=0,paramKey:o="tab"}=r||{},{useSearchParams:n}=or(),[l,s]=n(),c=vr.searchParamsToObject(l.toString());return{activeTab:c[o]?parseInt(c[o]):t,handleTabChange:h=>{s({...c,[o]:h.toString()})},searchQueries:c}};function Pc({appName:r,menuConfig:t,formatTitle:o}){const{useLocation:n}=or(),l=n();d.useEffect(()=>{let s=null,c=null;for(const h of t){const y=h.items.find(b=>b.to?b.to==="/"?l.pathname==="/":!!(b.to===l.pathname||l.pathname.startsWith(b.to+"/")):!1);if(y){s=y,c=h;break}}const i=[];s!=null&&s.title&&i.push(s.title),c!=null&&c.name&&i.push(c.name.toTitleCase());const a=(h,y)=>h.length>0?`${h.join(" - ")} | ${y}`:y;document.title=(o||a)(i,r)},[l.pathname])}const Vc=()=>{const{useSearchParams:r,useParams:t,useLocation:o}=or(),[n,l]=r(),s=vr.searchParamsToObject(n.toString()),c=t(),i=o(),a=c.id;return{setSearchParams:l,searchParams:n,searchQueries:s,isHasQuery:(C,E)=>n.has(C)&&n.get(C)===E,getQueryParam:C=>n.get(C),getRouteParam:C=>c[C],params:c,location:i,id:a,hasId:!!a}};function jc(r){var n,l;const t=r.decodedAccessToken;return d.useMemo(()=>{var a,h;const s=((h=(a=t==null?void 0:t.access)==null?void 0:a.role)==null?void 0:h.code)??"",c=Object.keys(r.role).reduce((y,b)=>{const p=`is${b.toLowerCase().replace(/(^\w|_\w)/g,C=>C.replace("_","").toUpperCase())}`;return{...y,[p]:!1}},{});return{...Object.keys(r.role).reduce((y,b)=>{const p=`is${b.toLowerCase().replace(/(^\w|_\w)/g,C=>C.replace("_","").toUpperCase())}`;return{...y,[p]:s===r.role[b]}},c),hasRole:y=>s===r.role[y],getRoleKey:()=>s}},[(l=(n=t==null?void 0:t.access)==null?void 0:n.role)==null?void 0:l.code,r])}u.ASIDE_WIDTH_VAR=Ht,u.AdvanceFilterBar=qo,u.App=Gl,u.AppComponent=po,u.AppContext=dt,u.AppLayout=$l,u.AsideBar=uc,u.BackButton=Rl,u.ColumnFilterDropdown=il,u.ColumnMenu=ul,u.ConfirmationDialog=Ec,u.DataTable=dl,u.DecisionWrapper=fe,u.EachUtils=Xr,u.EmptyStatePage=Cc,u.EntityCard=ot,u.EntityCardFooter=Ml,u.EntityCardHeader=Fl,u.EntityCardMedia=ml,u.FLOATING_FOOTER_HEIGHT_VAR=Pt,u.FilterBar=Xn,u.FilterDrawer=_o,u.FloatingFooter=yc,u.ForbiddenPage=Sc,u.Form=nc,u.FullSection=mc,u.HeaderLeftSlot=Ql,u.HeaderLeftSlotOutlet=Co,u.HeaderLeftSlotProvider=vo,u.HorizontalField=ln,u.ImagePreview=Ac,u.InputFile=bl,u.InputImage=Cl,u.LayoutDialog=Lr,u.LayoutDialogAside=Rr,u.LayoutDialogBody=Kr,u.LayoutDialogFooter=et,u.LayoutDialogHeader=$r,u.ModuleSwitcher=en,u.ModuleSwitcherModal=Lo,u.NotFoundPage=wc,u.PageLayout=cn,u.Pressable=mr,u.RightDrawer=Wo,u.SIDEBAR_DEFAULT_WIDTH=ft,u.SIDEBAR_MAX_WIDTH=gt,u.SIDEBAR_MIN_WIDTH=ut,u.ScrollToTopButton=xl,u.Section=un,u.SectionFooter=Bt,u.SectionHeader=St,u.SelectButton=Fc,u.SelectionActionBar=El,u.SelectionActionBarDivider=tt,u.ServerErrorPage=kc,u.SidePanel=hc,u.SidePanelItem=ic,u.SidebarBadgesProvider=co,u.SidebarGroupSlot=Ul,u.SidebarGroupSlotOutlet=wo,u.SidebarGroupSlotProvider=xo,u.SidebarHeaderSlot=bo,u.SidebarProvider=fo,u.StarasiaRouterProvider=yo,u.TableFooter=cl,u.TableHeader=sl,u.TableLayout=ps,u.TableSection=as,u.TableWrapper=nl,u.ToggleStatus=lc,u.Typography=Ke,u.VerticalField=pc,u.clearModuleSelection=Jl,u.createInitialFromUserName=Ds,u.cssVars=Fs,u.expandDateCompact=os,u.formHasChanged=As,u.formatDate=Es,u.formatDateToIndonesian=pl,u.formatRupiah=Bs,u.getDateFilterValue=No,u.getDateRangeFilterValue=bn,u.getInitials=ks,u.getValueDropdownMultipleFilter=jo,u.getValueRadioFilter=pn,u.getValueSearch=qr,u.getValuesFilter=_r,u.handleChangeFilter=Fr,u.handleOnScroll=qs,u.isEmail=js,u.isFilterActive=vn,u.isOnlyLettersAndSpaces=zs,u.isPhoneNumber=Ws,u.isSlug=Ns,u.localStorageAdapter=Et,u.oneDayInMs=Ms,u.parseIndonesianDateToDate=Ss,u.preventNonCoordinateInput=_s,u.preventNonNumberAndDecimalInput=Vs,u.preventNonNumberInput=Hs,u.preventNumberInput=Ps,u.resolveDateRangeValueToString=Po,u.resolveDateValueToString=Vo,u.resolveDropdownValueToString=zo,u.resolveRadioValueToString=Ho,u.resolveSidebarBadge=Vr,u.storageKeys=wr,u.textWidth=Is,u.useApp=ht,u.useAppState=no,u.useAuthRole=jc,u.useDynamicTitle=Pc,u.useFilterBarApiParams=es,u.useFilterBarControls=ts,u.useModuleSelection=Ct,u.useRouteInfo=Ne,u.useRouteParams=Vc,u.useRouterAdapter=or,u.useSidebar=uo,u.useSidebarBadges=io,u.useTabState=Hc,u.useTableSortApiParams=bs,Object.keys(yr).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(u,r)&&Object.defineProperty(u,r,{enumerable:!0,get:()=>yr[r]})}),Object.keys(zr).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(u,r)&&Object.defineProperty(u,r,{enumerable:!0,get:()=>zr[r]})}),Object.keys(sr).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(u,r)&&Object.defineProperty(u,r,{enumerable:!0,get:()=>sr[r]})}),Object.keys(f).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(u,r)&&Object.defineProperty(u,r,{enumerable:!0,get:()=>f[r]})}),Object.keys(pr).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(u,r)&&Object.defineProperty(u,r,{enumerable:!0,get:()=>pr[r]})}),Object.keys(j).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(u,r)&&Object.defineProperty(u,r,{enumerable:!0,get:()=>j[r]})}),Object.keys(ct).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(u,r)&&Object.defineProperty(u,r,{enumerable:!0,get:()=>ct[r]})}),Object.keys(fr).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(u,r)&&Object.defineProperty(u,r,{enumerable:!0,get:()=>fr[r]})}),Object.keys(je).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(u,r)&&Object.defineProperty(u,r,{enumerable:!0,get:()=>je[r]})}),Object.keys(Hr).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(u,r)&&Object.defineProperty(u,r,{enumerable:!0,get:()=>Hr[r]})}),Object.keys(br).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(u,r)&&Object.defineProperty(u,r,{enumerable:!0,get:()=>br[r]})}),Object.keys(De).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(u,r)&&Object.defineProperty(u,r,{enumerable:!0,get:()=>De[r]})}),Object.keys(vr).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(u,r)&&Object.defineProperty(u,r,{enumerable:!0,get:()=>vr[r]})}),Object.keys(ar).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(u,r)&&Object.defineProperty(u,r,{enumerable:!0,get:()=>ar[r]})}),Object.keys(A).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(u,r)&&Object.defineProperty(u,r,{enumerable:!0,get:()=>A[r]})}),Object.keys(kr).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(u,r)&&Object.defineProperty(u,r,{enumerable:!0,get:()=>kr[r]})}),Object.keys(Er).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(u,r)&&Object.defineProperty(u,r,{enumerable:!0,get:()=>Er[r]})}),Object.keys(U).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(u,r)&&Object.defineProperty(u,r,{enumerable:!0,get:()=>U[r]})}),Object.keys($t).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(u,r)&&Object.defineProperty(u,r,{enumerable:!0,get:()=>$t[r]})}),Object.keys(it).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(u,r)&&Object.defineProperty(u,r,{enumerable:!0,get:()=>it[r]})}),Object.keys(Cr).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(u,r)&&Object.defineProperty(u,r,{enumerable:!0,get:()=>Cr[r]})}),Object.keys(Kt).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(u,r)&&Object.defineProperty(u,r,{enumerable:!0,get:()=>Kt[r]})}),Object.keys(xr).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(u,r)&&Object.defineProperty(u,r,{enumerable:!0,get:()=>xr[r]})}),Object.keys(me).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(u,r)&&Object.defineProperty(u,r,{enumerable:!0,get:()=>me[r]})}),Object.keys(tr).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(u,r)&&Object.defineProperty(u,r,{enumerable:!0,get:()=>tr[r]})}),Object.keys(at).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(u,r)&&Object.defineProperty(u,r,{enumerable:!0,get:()=>at[r]})}),Object.keys(D).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(u,r)&&Object.defineProperty(u,r,{enumerable:!0,get:()=>D[r]})}),Object.keys(M).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(u,r)&&Object.defineProperty(u,r,{enumerable:!0,get:()=>M[r]})}),Object.keys(ie).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(u,r)&&Object.defineProperty(u,r,{enumerable:!0,get:()=>ie[r]})}),Object.keys(Rt).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(u,r)&&Object.defineProperty(u,r,{enumerable:!0,get:()=>Rt[r]})}),Object.keys(eo).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(u,r)&&Object.defineProperty(u,r,{enumerable:!0,get:()=>eo[r]})}),Object.keys(ro).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(u,r)&&Object.defineProperty(u,r,{enumerable:!0,get:()=>ro[r]})}),Object.keys(to).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(u,r)&&Object.defineProperty(u,r,{enumerable:!0,get:()=>to[r]})}),Object.keys(oo).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(u,r)&&Object.defineProperty(u,r,{enumerable:!0,get:()=>oo[r]})}),Object.keys($e).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(u,r)&&Object.defineProperty(u,r,{enumerable:!0,get:()=>$e[r]})}),Object.keys(lo).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(u,r)&&Object.defineProperty(u,r,{enumerable:!0,get:()=>lo[r]})}),Object.defineProperty(u,Symbol.toStringTag,{value:"Module"})});
|