@starasia/admin 8.2.8 → 8.3.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.
Files changed (28) hide show
  1. package/dist/components/FilterBar/components/MobileFilterBar.d.ts +52 -0
  2. package/dist/components/FilterBar/components/MobileFilterDrawer.d.ts +25 -0
  3. package/dist/components/FilterBar/components/MobileMoreMenu.d.ts +16 -0
  4. package/dist/components/FilterBar/hooks/useColumnPrefs.d.ts +3 -1
  5. package/dist/components/FilterBar/hooks/useFilterBarApiParams.d.ts +52 -0
  6. package/dist/components/FilterBar/hooks/useFilterBarControls.d.ts +39 -0
  7. package/dist/components/FilterBar/hooks/useLastFilterState.d.ts +11 -8
  8. package/dist/components/FilterBar/hooks/usePerPagePref.d.ts +23 -0
  9. package/dist/components/FilterBar/hooks/useUrlHydration.d.ts +23 -0
  10. package/dist/components/FilterBar/index.d.ts +3 -0
  11. package/dist/components/FilterBar/types.d.ts +25 -4
  12. package/dist/components/FilterBar/utils/expand-date-compact.d.ts +33 -0
  13. package/dist/components/FilterBar/utils/relative-date.d.ts +17 -0
  14. package/dist/components/FilterBar/utils/storage-adapter.d.ts +2 -0
  15. package/dist/components/TableLayout/ColumnMenu.d.ts +15 -0
  16. package/dist/components/TableLayout/TableLayout.d.ts +4 -0
  17. package/dist/components/TableLayout/hooks/useTableSortApiParams.d.ts +64 -0
  18. package/dist/components/TableLayout/index.d.ts +4 -0
  19. package/dist/components/TableLayout/types.d.ts +182 -0
  20. package/dist/components/index.d.ts +1 -1
  21. package/dist/index.cjs.js +43 -1
  22. package/dist/index.es.js +4098 -2675
  23. package/dist/index.umd.js +43 -1
  24. package/dist/style.css +1 -1
  25. package/package.json +3 -3
  26. package/dist/components/DataGrid/DataGrid.d.ts +0 -4
  27. package/dist/components/DataGrid/index.d.ts +0 -2
  28. package/dist/components/DataGrid/types.d.ts +0 -66
package/dist/index.cjs.js CHANGED
@@ -1 +1,43 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const Tt=require("@starasia/alert"),ve=require("@starasia/badges"),f=require("@starasia/box"),Me=require("@starasia/breadcrumb"),T=require("@starasia/button"),Wt=require("@starasia/card"),Be=require("@starasia/date"),fe=require("@starasia/dialog"),yt=require("@starasia/drawer"),Ie=require("@starasia/dropdown"),ie=require("@starasia/hooks"),Oe=require("@starasia/http"),De=require("@starasia/input"),B=require("@starasia/menu"),$e=require("@starasia/pagination"),Ve=require("@starasia/storage"),X=require("@starasia/table"),Rt=require("@starasia/tabs"),pt=require("@starasia/textarea"),Le=require("@starasia/theme"),At=require("@starasia/toast"),Ne=require("@starasia/toggle"),ae=require("@starasia/tooltip"),Te=require("@starasia/checkbox"),bt=require("@starasia/radio"),b=require("@starasia/text"),w=require("@starasia/icon"),K=require("@starasia/flex"),zt=require("@starasia/grid"),Ht=require("@starasia/progress"),Vt=require("@starasia/stepper"),Nt=require("@starasia/accordion"),Pt=require("@starasia/story-record"),Se=require("@starasia/skeleton"),_t=require("@starasia/progress-stepper"),e=require("react/jsx-runtime"),x=require("react"),re=require("react-router"),Dt=require("react-dom"),Hr=require("react-easy-crop"),Vr={menus:[],menuBottom:void 0,logo:"",appName:"Workspace",userData:null,setUserData:()=>{}},wt=x.createContext(Vr),St=()=>x.useContext(wt),lr=t=>{const[r,n]=x.useState((t==null?void 0:t.initialUserData)||null);return{userData:r,setUserData:n}},cr=x.createContext({badges:{},setBadge:()=>{},setBadges:()=>{},clearBadge:()=>{}}),ar=({children:t})=>{const[r,n]=x.useState({}),i=x.useCallback(l=>{n(u=>typeof l=="function"?l(u):l)},[]),o=x.useCallback((l,u)=>{n(a=>{const h=typeof u=="function"?u(a[l]):u;return{...a,[l]:h}})},[]),s=x.useCallback(l=>{n(u=>{if(!(l in u))return u;const a={...u};return delete a[l],a})},[]),c=x.useMemo(()=>({badges:r,setBadge:o,setBadges:i,clearBadge:s}),[r,o,i,s]);return e.jsx(cr.Provider,{value:c,children:t})},dr=()=>x.useContext(cr),Ye=(t,r)=>{const n=r!==void 0?r:t;return n==null?null:typeof n=="string"||typeof n=="number"?{value:n}:n},ur=({router:t,menus:r=[],menuBottom:n,logo:i,appName:o="Workspace",initialUserData:s,theme:c})=>{const l=lr({initialUserData:s}),{theme:u}=Le.useTheme();return e.jsx(wt.Provider,{value:{logo:i,appName:o,menus:r,userData:l.userData,setUserData:l.setUserData,menuBottom:n},children:e.jsx(ar,{children:c?e.jsx(Le.ThemeProvider,{value:c,children:t}):u?e.jsx(Le.ThemeProvider,{value:u,children:t}):t})})},Nr=x.memo(ur);function xr({collapsed:t=!1,children:r}){if(!r)return null;const n=typeof r=="function",i=n?r({collapsed:t}):r;return i==null||i===!1?null:e.jsx("div",{style:{position:"sticky",top:"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:n?i:e.jsx("div",{style:{opacity:t?0:1,transition:"opacity 0.3s",visibility:t?"hidden":"visible"},children:i})})}const Bt=x.createContext(null);function hr({children:t}){const[r,n]=x.useState(null),[i,o]=x.useState(null),[s,c]=x.useState(null),[l,u]=x.useState(0),a=x.useCallback(()=>(u(h=>h+1),()=>u(h=>h-1)),[]);return e.jsx(Bt.Provider,{value:{prependNode:r,appendNode:i,replaceNode:s,setPrependNode:n,setAppendNode:o,setReplaceNode:c,replaceCount:l,registerReplace:a},children:t})}function fr({children:t}){const r=x.useContext(Bt);return r?e.jsxs(e.Fragment,{children:[e.jsx("div",{ref:r.setPrependNode,style:{display:"contents"}}),r.replaceCount>0?e.jsx("div",{ref:r.setReplaceNode,style:{display:"contents"}}):t,e.jsx("div",{ref:r.setAppendNode,style:{display:"contents"}})]}):e.jsx(e.Fragment,{children:t})}function Pr({children:t,mode:r="append"}){const n=x.useContext(Bt);if(x.useEffect(()=>{if(!(r!=="replace"||!n))return n.registerReplace()},[r,n]),!n)return process.env.NODE_ENV!=="production"&&console.warn("[HeaderLeftSlot] used outside AppLayout — content not rendered"),null;const i=r==="prepend"?n.prependNode:r==="replace"?n.replaceNode:n.appendNode;return i?Dt.createPortal(t,i):null}const kt=x.createContext(null);function mr({children:t}){const[r,n]=x.useState({}),[i,o]=x.useState({}),s=x.useCallback((u,a)=>{n(h=>h[u]===a?h:{...h,[u]:a})},[]),c=x.useCallback(u=>(o(a=>({...a,[u]:(a[u]??0)+1})),()=>o(a=>({...a,[u]:Math.max(0,(a[u]??0)-1)}))),[]),l=x.useMemo(()=>({outletNodes:r,setOutletNode:s,slotCounts:i,registerSlot:c}),[r,s,i,c]);return e.jsx(kt.Provider,{value:l,children:t})}function gr({slotKey:t,fallback:r}){const n=x.useContext(kt),i=n?(n.slotCounts[t]??0)>0:!1,o=x.useRef(n==null?void 0:n.setOutletNode);o.current=n==null?void 0:n.setOutletNode;const s=x.useCallback(c=>{var l;return(l=o.current)==null?void 0:l.call(o,t,c)},[t]);return e.jsx(e.Fragment,{children:i?e.jsx("div",{ref:s,style:{display:"contents"}}):r})}function _r({slotKey:t,children:r}){const n=x.useContext(kt),i=x.useRef(n==null?void 0:n.registerSlot);if(i.current=n==null?void 0:n.registerSlot,x.useEffect(()=>{var s;return(s=i.current)==null?void 0:s.call(i,t)},[t]),!n)return process.env.NODE_ENV!=="production"&&console.warn("[SidebarGroupSlot] used outside AppLayout — content not rendered"),null;const o=n.outletNodes[t];return o?Dt.createPortal(r,o):null}const et="moduleSwitcherGroupId",Ct="sa-module-switcher-change";function qt(){if(typeof window>"u")return null;const t=window.localStorage.getItem(et);if(t===null)return null;const r=Number(t);return Number.isFinite(r)?r:null}function jr(t){typeof window>"u"||(t===null?window.localStorage.removeItem(et):window.localStorage.setItem(et,String(t)),window.dispatchEvent(new CustomEvent(Ct,{detail:t})))}function qr(){jr(null)}function Ft(){const[t,r]=x.useState(()=>qt());return x.useEffect(()=>{const i=()=>{r(qt())},o=s=>{s.key===et&&i()};return window.addEventListener(Ct,i),window.addEventListener("storage",o),()=>{window.removeEventListener(Ct,i),window.removeEventListener("storage",o)}},[]),{selectedGroupId:t,setSelectedGroupId:i=>{jr(i),r(i)}}}let Je=0,we=!1,Zt=new Set;const Qt=()=>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"})]}),Gt={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"};function Zr({children:t,headerLeftSlot:r,profile:n,isLoadingProfile:i,onLogout:o,isLoggingOut:s,loadingComponent:c,sidebarHeaderContent:l,headerActions:u,profileRole:a,profileMenuButtons:h,profileMenuItems:m,logoutButton:g}){var Fe,Ge;const[y]=re.useSearchParams(),E=y.get("embed")==="true",j=St(),{badges:v}=dr(),F=re.useNavigate(),k=re.useLocation(),p=!ie.useMediaQuery("md"),[M,L]=x.useState(!1),[S,_]=x.useState(!1),[I,P]=x.useState(!1),[W,Y]=x.useState(!1),[$,J]=x.useState(()=>new Set(Zt)),[te,ne]=x.useState(null),{selectedGroupId:G,setSelectedGroupId:Q}=Ft();x.useEffect(()=>{Zt=$},[$]);const se=x.useRef(null),xe=x.useRef(null);x.useEffect(()=>{const C=se.current;if(!C)return;const H=()=>{we||(Je=C.scrollTop)};return C.addEventListener("scroll",H),()=>C.removeEventListener("scroll",H)},[]);const he=()=>{const C=se.current;C&&Je>0&&(we=!0,C.scrollTop=Je,requestAnimationFrame(()=>{we=!1}))};x.useLayoutEffect(()=>{we=!0,he();const C=setTimeout(()=>{we=!1},300);return()=>clearTimeout(C)},[]),x.useLayoutEffect(()=>{j.menus.length>0&&(Je>0?he():requestAnimationFrame(()=>{var H;const C=(H=se.current)==null?void 0:H.querySelector("[data-menu-active='true']");C&&C.scrollIntoView({block:"center",behavior:"instant"})}))},[j.menus]),x.useEffect(()=>{we=!0,he();const C=setTimeout(he,0),H=setTimeout(he,50),V=setTimeout(he,100),D=setTimeout(he,200),R=setTimeout(()=>{we=!1},300),O=setTimeout(()=>{const A=se.current,q=A==null?void 0:A.querySelector("[data-menu-active='true']");if(A&&q){const le=A.getBoundingClientRect(),ue=q.getBoundingClientRect();ue.top>=le.top&&ue.bottom<=le.bottom||q.scrollIntoView({block:"center",behavior:"smooth"})}},250);return()=>{clearTimeout(C),clearTimeout(H),clearTimeout(V),clearTimeout(D),clearTimeout(R),clearTimeout(O)}},[k.pathname]),x.useEffect(()=>{xe.current&&(xe.current.scrollTop=0)},[k.pathname]),x.useEffect(()=>{p&&P(!1)},[k.pathname,p]),x.useEffect(()=>{p&&_(!0)},[p]);const We=()=>{L(!0)},qe=()=>{L(!1)},dt=()=>{L(!1),o()},Ze=C=>{const H=[C.to];return C.children&&H.push(...C.children.map(V=>V.to)),H},Re=[...j.menus.flatMap(C=>C.items.flatMap(Ze)),...((Fe=j.menuBottom)==null?void 0:Fe.flatMap(Ze))??[]],de=C=>{if(!k.pathname.startsWith(C))return!1;const H=Re.filter(V=>k.pathname.startsWith(V)).sort((V,D)=>D.length-V.length)[0];return C===H};x.useEffect(()=>{var H;const C=V=>{var D;(D=V.children)!=null&&D.some(R=>k.pathname.startsWith(R.to))&&J(R=>{const O=new Set(R);return O.add(V.id),O})};j.menus.forEach(V=>{V.items.forEach(C)}),(H=j.menuBottom)==null||H.forEach(C)},[k.pathname,j.menus,j.menuBottom]);const Qe=C=>{J(H=>{const V=new Set(H);return V.has(C)?V.delete(C):V.add(C),V})};x.useEffect(()=>{j.menus.length!==0&&G!==null&&!j.menus.some(C=>C.id===G)&&Q(null)},[j.menus,G,Q]);const Ae=x.useMemo(()=>{if(G!==null)return j.menus.filter(V=>V.id===G||V.parentGroupId===G);const C=j.menus.filter(V=>V.parentGroupId===void 0),H=j.menus.filter(V=>V.parentGroupId!==void 0).flatMap(V=>V.items);return H.length===0?C:[...C,{id:18,name:"Pengaturan",items:H,parentGroupId:void 0}]},[j.menus,G]);if(E)return e.jsx("main",{style:{height:"100vh",overflowY:"auto",backgroundColor:"var(--sa-background-primary-inverse, #f8f8f8)"},children:t||e.jsx(re.Outlet,{})});const ke=C=>{const H=C.children&&C.children.length>0,V=$.has(C.id),D=H?C.children.some(A=>de(A.to)):de(C.to),R=Ye(C.badge,v[C.id]),O=!!R&&S&&!p;return e.jsxs("div",{"data-menu-active":D||void 0,children:[e.jsxs("button",{onClick:A=>{if(H)if(S&&!p){const q=A.currentTarget.getBoundingClientRect();ne({item:C,top:q.top,left:q.right+8})}else Qe(C.id);else F(C.to)},style:{width:"100%",display:"flex",alignItems:"center",justifyContent:S&&!p?"center":void 0,gap:"0.5rem",paddingLeft:S&&!p?"0":"0.5rem",paddingRight:S&&!p?"0":"0.5rem",paddingTop:"0.25rem",paddingBottom:"0.25rem",height:"2rem",borderRadius:D?"var(--sa-radii-sm, 0.375rem)":"var(--sa-radii-md, 0.5rem)",textAlign:"left",border:D?"1px solid var(--sa-border-subtle, #0b120e24)":"1px solid transparent",backgroundColor:D?"var(--sa-background-primary, #ffffff)":"transparent",color:"var(--sa-text-primary, #292a2e)",cursor:"pointer"},title:S&&!p?C.title:void 0,onMouseEnter:A=>{D||(A.currentTarget.style.backgroundColor="var(--sa-background-neutral, #f0f1f2)")},onMouseLeave:A=>{D||(A.currentTarget.style.backgroundColor="transparent")},children:[e.jsxs("span",{style:{position:"relative",display:"inline-flex",flexShrink:0},children:[e.jsx(w.Icon,{name:C.icon,size:"sm",style:{flexShrink:0}}),O&&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)"}})]}),(!S||p)&&e.jsxs(e.Fragment,{children:[e.jsx("span",{style:{fontSize:"0.875rem",fontWeight:"500",whiteSpace:"nowrap",transition:"opacity 0.3s",flex:1,minWidth:0,overflow:"hidden",textOverflow:"ellipsis"},children:C.title}),R&&e.jsx(ve.Badges,{text:String(R.value),variant:R.variant??"info",size:"xs",border:!0}),H&&e.jsx("svg",{style:{width:"1rem",height:"1rem",flexShrink:0,transition:"transform 0.2s",transform:V?"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"})})]})]}),H&&(!S||p)&&(()=>{const A=C.children.findIndex(q=>de(q.to));return e.jsxs("div",{style:{position:"relative",marginLeft:"0.9375rem",paddingLeft:"1.125rem",overflow:"hidden",transition:"all 0.3s ease-in-out",maxHeight:V?`${C.children.length*36}px`:"0px",opacity:V?1:0,marginTop:V?"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"}}),A>=0&&e.jsx("span",{"aria-hidden":"true",style:{position:"absolute",left:0,top:`${A*32}px`,width:"1.5px",height:"32px",backgroundColor:"var(--sa-text-primary, #292a2e)",transition:"top 0.2s ease-in-out",pointerEvents:"none",zIndex:1}}),C.children.map(q=>{const le=Ye(q.badge,v[q.id]);return e.jsxs("button",{onClick:()=>F(q.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:de(q.to)?"var(--sa-radii-sm, 0.375rem)":"var(--sa-radii-md, 0.5rem)",textAlign:"left",backgroundColor:de(q.to)?"var(--sa-background-primary, #ffffff)":"transparent",color:de(q.to)?"var(--sa-text-primary, #292a2e)":"var(--sa-text-subtle, #505258)",cursor:"pointer",border:de(q.to)?"1px solid var(--sa-border-subtle, #0b120e24)":"1px solid transparent"},onMouseEnter:ue=>{de(q.to)||(ue.currentTarget.style.backgroundColor="var(--sa-background-neutral, #f0f1f2)")},onMouseLeave:ue=>{de(q.to)||(ue.currentTarget.style.backgroundColor="transparent")},children:[e.jsx(w.Icon,{name:q.icon,size:"sm",style:{flexShrink:0}}),e.jsx("span",{style:{fontSize:"0.875rem",fontWeight:"500",whiteSpace:"nowrap",flex:1,minWidth:0,overflow:"hidden",textOverflow:"ellipsis"},children:q.title}),le&&e.jsx(ve.Badges,{text:String(le.value),variant:le.variant??"info",size:"xs",border:!0})]},q.id)})]})})()]},C.id)};return e.jsx(mr,{children:e.jsxs(hr,{children:[e.jsxs("div",{style:{display:"flex",height:"100vh",position:"relative","--app-sidebar-width":p?"0px":S?"4.375rem":"16.375rem","--app-footer-zindex":p&&I?"40":"999"},children:[p&&e.jsx("div",{style:{position:"fixed",inset:0,backgroundColor:"var(--sa-color-black-alpha-a50, #181a198f)",zIndex:40,opacity:I?.5:0,pointerEvents:I?"auto":"none",transition:"opacity 0.3s"},onClick:()=>P(!1)}),e.jsxs("aside",{style:{width:p?"16.375rem":S?"4.375rem":"16.375rem",position:p?"fixed":"relative",...p&&{inset:0,zIndex:50,transform:I?"translateX(0)":"translateX(-100%)"},backgroundColor:"var(--sa-background-primary-inverse, #f8f8f8)",borderRight:"1px solid var(--sa-border-subtle, #0b120e24)",display:"flex",flexDirection:"column",transition:"all 0.3s ease-in-out",flexShrink:p?void 0:0},children:[e.jsx("div",{onMouseEnter:()=>Y(!0),onMouseLeave:()=>Y(!1),style:{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 C=!p&&S&&!I,H=C&&W;return e.jsxs(e.Fragment,{children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"0.5rem",flex:C?1:void 0,justifyContent:C?"center":void 0,transition:"opacity 0.2s",opacity:H?0:1,pointerEvents:H?"none":"auto"},children:[e.jsx("img",{src:j.logo,alt:"Logo",style:{width:"2rem",height:"2rem",flexShrink:0}}),(!S||I)&&e.jsx("span",{style:{fontWeight:"600",color:"var(--sa-text-primary, #292a2e)",whiteSpace:"nowrap",transition:"opacity 0.3s"},children:j.appName})]}),!p&&!S&&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(Qt,{})}),C&&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:H?1:0,pointerEvents:H?"auto":"none",transition:"opacity 0.2s"},children:e.jsx("span",{style:{width:"1rem",height:"1rem",display:"inline-flex"},children:e.jsx(Qt,{})})}),p&&e.jsx("button",{onClick:()=>P(!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"})})})]})})()}),l&&e.jsx(xr,{collapsed:p?!1:S,children:l}),e.jsx("div",{ref:se,style:{flex:1,overflowY:"auto",paddingTop:"1rem",paddingBottom:"1rem"},children:Ae.map(C=>e.jsxs("div",{style:{marginBottom:"1rem"},children:[!S||p?C.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:C.name}):C.name&&e.jsx("div",{"aria-label":C.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:C.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:C.slotKey?e.jsx(gr,{slotKey:C.slotKey,fallback:C.items.map(H=>ke(H))}):C.items.map(H=>ke(H))})]},C.id))}),j.menuBottom&&j.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:j.menuBottom.map(C=>ke(C))})]}),e.jsxs("div",{style:{flex:1,display:"flex",flexDirection:"column",overflow:"hidden"},children:[e.jsxs("header",{style:{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:"1rem"},children:[p&&e.jsx("button",{onClick:()=>P(!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(fr,{children:r})]}),e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"0.75rem"},children:[u,e.jsxs(B.Menu,{position:"bottom-right",children:[e.jsx(B.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:"0.875rem",fontWeight:500,color:"var(--sa-text-subtle, #8c8f97)",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:i?"Loading...":(n==null?void 0:n.name)||"unknown"}),e.jsx("p",{style:{margin:0,fontSize:"0.75rem",color:"var(--sa-text-subtle, #8c8f97)",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:i?"":(n==null?void 0:n.email)||"unknown"})]}),e.jsx("div",{style:{width:"2.5rem",height:"2.5rem",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:((n==null?void 0:n.name)||"U")[0].toUpperCase()}),e.jsx(w.Icon,{name:"ChevronDown",size:"sm",style:{color:"var(--sa-text-subtle, #8c8f97)"}})]})}),e.jsxs(B.MenuLists,{style:{width:"280px",paddingBlock:"12px",paddingInline:"12px",gap:"8px",marginTop:"16px"},children:[e.jsx(B.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:((n==null?void 0:n.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:(n==null?void 0:n.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:(n==null?void 0:n.email)||"unknown"}),a&&e.jsx("p",{style:{margin:0,fontSize:"0.75rem",color:"var(--sa-text-subtle, #8c8f97)",maxWidth:"100%",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:a})]})}),(h&&h.length>0||m)&&e.jsxs(B.MenuBody,{children:[h==null?void 0:h.map((C,H)=>e.jsx(B.MenuButton,{children:e.jsxs("button",{type:"button",onClick:C.onClick,style:Gt,onMouseEnter:V=>{V.currentTarget.style.backgroundColor="var(--sa-background-neutral, #f0f1f2)"},onMouseLeave:V=>{V.currentTarget.style.backgroundColor="transparent"},children:[e.jsx(w.Icon,{name:C.icon,size:"md"}),e.jsx("span",{children:C.label})]})},`${C.label}-${H}`)),m]}),g??e.jsx(B.MenuFooter,{children:e.jsx(B.MenuButton,{children:e.jsxs("button",{type:"button",onClick:We,style:{...Gt,color:"var(--sa-background-error, #c9184a)",fontWeight:500},onMouseEnter:C=>{C.currentTarget.style.backgroundColor="var(--sa-color-error-50, #fff0f3)"},onMouseLeave:C=>{C.currentTarget.style.backgroundColor="transparent"},children:[e.jsx(w.Icon,{name:"Logout",size:"md",style:{color:"var(--sa-background-error, #c9184a)"}}),e.jsx("span",{children:"Logout"})]})})})]})]})]})]}),e.jsx("main",{ref:xe,style:{flex:1,overflowY:"auto"},children:t||e.jsx(re.Outlet,{})})]})]}),s&&c&&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:c}),e.jsxs(fe.Dialog,{isShow:M,onHide:qe,children:[e.jsx(fe.DialogTitle,{children:"Confirmation Logout"}),e.jsx(fe.DialogBody,{children:"Are you sure you want to end the session and exit the page?"}),e.jsx(fe.DialogFooter,{children:e.jsx(f.Box,{direction:"column",display:"flex",align:"flex-end",justify:"center",children:e.jsxs(K.Flex,{direction:"row",gap:"sm",align:"center",children:[e.jsx(f.Box,{direction:"column",children:e.jsx(T.Button,{secondary:!0,onClick:qe,children:"Cancel"})}),e.jsx(f.Box,{direction:"column",children:e.jsx(T.Button,{primary:!0,onClick:dt,children:"Yes, Sure"})})]})})})]}),te&&e.jsxs(e.Fragment,{children:[e.jsx("div",{onClick:()=>ne(null),style:{position:"fixed",inset:0,zIndex:60,backgroundColor:"transparent"}}),e.jsxs("div",{role:"dialog","aria-label":te.item.title,style:{position:"fixed",top:te.top,left:te.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:te.item.title}),(Ge=te.item.children)==null?void 0:Ge.map(C=>{const H=de(C.to),V=Ye(C.badge,v[C.id]);return e.jsxs("button",{onClick:()=>{F(C.to),ne(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:H?"var(--sa-color-gray-100, #f8f8f8)":"transparent",color:H?"var(--sa-text-primary, #292a2e)":"var(--sa-color-gray-800, #505258)",border:"1px solid transparent",cursor:"pointer",fontSize:"0.875rem",fontWeight:500},onMouseEnter:D=>{H||(D.currentTarget.style.backgroundColor="var(--sa-color-gray-100, #f8f8f8)")},onMouseLeave:D=>{H||(D.currentTarget.style.backgroundColor="transparent")},children:[C.icon&&e.jsx(w.Icon,{name:C.icon,size:"sm",style:{flexShrink:0}}),e.jsx("span",{style:{flex:1,whiteSpace:"nowrap"},children:C.title}),V&&e.jsx(ve.Badges,{text:String(V.value),variant:V.variant??"info",size:"xs",border:!0})]},C.id)})]})]})]})})}const rt=x.forwardRef(({children:t,...r},n)=>e.jsx(f.Box,{ref:n,role:"button",cursor:"pointer","aria-pressed":"true",display:"inline-block",tabIndex:0,...r,children:t})),Jt=({title:t,iconName:r,textColor:n,iconColor:i,hoverTextColor:o,hoverIconColor:s})=>{const[c,l]=x.useState(!1),u=i??"var(--sa-text-subtle, #8c8f97)",a=n??"var(--sa-text-subtle, #8c8f97)",h=s??"var(--sa-text-subtle, #8c8f97)",m=o??"var(--sa-text-primary, #292a2e)";return e.jsxs(f.Box,{direction:"row",gap:"xs",align:"center",onMouseEnter:()=>l(!0),onMouseLeave:()=>l(!1),style:{cursor:"pointer"},children:[e.jsx(w.Icon,{name:r||"ChevronLeft",size:"xs",style:{color:c?h:u,transition:"color 0.15s ease"}}),e.jsx(b.Text,{variant:"sub-h3",style:{color:c?m:a,transition:"color 0.15s ease"},children:t||"Back"})]})},Qr=({items:t,separator:r="/",iconName:n,iconColor:i,hoverIconColor:o})=>{const[s,c]=x.useState(!1),l=i??"var(--sa-text-subtle, #8c8f97)",u=o??"var(--sa-text-subtle, #8c8f97)",a=t.length>1?t[0]:void 0,h=!!(a!=null&&a.to||a!=null&&a.onClick),m=e.jsx(w.Icon,{name:n||"ChevronLeft",size:"xs",onMouseEnter:h?()=>c(!0):void 0,onMouseLeave:h?()=>c(!1):void 0,style:{color:h&&s?u:l,transition:"color 0.15s ease",cursor:h?"pointer":void 0}}),g=a!=null&&a.to?e.jsx(re.Link,{to:a.to,replace:!0,style:{textDecoration:"none"},children:m}):a!=null&&a.onClick?e.jsx(rt,{onClick:a.onClick,children:m}):m;return e.jsxs(f.Box,{direction:"row",gap:"xs",align:"center",children:[g,e.jsx(Me.Breadcrumb,{separator:r,size:"md",children:t.map((y,E)=>{const j=E===t.length-1;return y.to&&!j?e.jsx(Me.BreadcrumbItem,{children:e.jsx(re.Link,{to:y.to,children:y.label})},E):e.jsx(Me.BreadcrumbItem,{currentPage:j,children:e.jsx(Me.BreadcrumbLink,{onClick:j?void 0:y.onClick,children:y.label})},E)})})]})},Gr=t=>{const{items:r,separator:n,onClick:i,navigateTo:o,...s}=t;return r&&r.length>0?e.jsx(Qr,{items:r,separator:n,iconName:s.iconName,iconColor:s.iconColor,hoverIconColor:s.hoverIconColor}):o?e.jsx(f.Box,{direction:"row",children:e.jsx(re.Link,{to:o,replace:!0,style:{textDecoration:"none"},children:e.jsx(Jt,{...s})})}):e.jsx(f.Box,{direction:"row",children:e.jsx(rt,{onClick:i,children:e.jsx(Jt,{...s})})})},ht=[{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 Ut(t,r,n){return{display:"flex",alignItems:"center",justifyContent:"center",width:"64px",height:"64px",borderRadius:"var(--sa-radii-sm, 6px)",border:t?`2px solid ${n.activeBorder}`:"2px solid var(--sa-color-gray-200, #f0f1f2)",backgroundColor:t?n.activeBg:"var(--sa-color-gray-50, #ffffff)",boxShadow:t?r?`0 8px 20px ${n.activeShadow.replace("0.25","0.35")}`:`0 2px 8px ${n.activeShadow}`:r?"0 8px 20px rgba(0, 0, 0, 0.14)":"0 1px 4px rgba(0, 0, 0, 0.08)",transform:r?"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 Yt={fontSize:"11px",fontWeight:500,textAlign:"center",overflowWrap:"normal",wordBreak:"normal",color:"var(--sa-background-primary, #ffffff)",lineHeight:"1.3",maxWidth:"80px"},Xt={display:"flex",flexDirection:"column",alignItems:"center",gap:"8px",background:"none",border:"none",cursor:"pointer",padding:0};function yr({isShow:t,onHide:r,menus:n,selectedGroupId:i,onSelect:o}){const[s,c]=x.useState(void 0),l=a=>{o(a),r()},u=ht[0];return e.jsx(fe.Dialog,{isShow:t,onHide:r,style:{width:560,background:"transparent",boxShadow:"none",border:"none"},children:e.jsx(fe.DialogBody,{children:e.jsxs("div",{style:{display:"grid",gridTemplateColumns:"repeat(5, 1fr)",gap:"16px"},children:[e.jsxs("button",{onClick:()=>l(null),onMouseEnter:()=>c("all"),onMouseLeave:()=>c(void 0),style:Xt,children:[e.jsx("div",{style:Ut(i===null,s==="all",u),children:e.jsx("div",{style:{color:u.icon,display:"flex",alignItems:"center",justifyContent:"center"},children:e.jsx(w.Icon,{name:"Grid",size:"lg",style:{width:32,height:32}})})}),e.jsx("span",{style:Yt,children:"Semua"})]}),n.map((a,h)=>{var j;const m=i===a.id,g=s===a.id,y=((j=a.items[0])==null?void 0:j.icon)??"Grid",E=ht[(h+1)%ht.length];return e.jsxs("button",{onClick:()=>l(a.id),onMouseEnter:()=>c(a.id),onMouseLeave:()=>c(void 0),style:Xt,children:[e.jsx("div",{style:Ut(m,g,E),children:e.jsx("div",{style:{color:E.icon,display:"flex",alignItems:"center",justifyContent:"center"},children:e.jsx(w.Icon,{name:y,size:"lg",style:{width:32,height:32}})})}),e.jsx("span",{style:Yt,children:a.name})]},a.id)})]})})})}function Jr({onSelect:t,"aria-label":r="Pilih module"}={}){const n=St(),i=re.useNavigate(),{selectedGroupId:o,setSelectedGroupId:s}=Ft(),[c,l]=x.useState(!1),u=a=>{var h;if(s(a),a!==null){const m=n.menus.find(y=>y.id===a),g=(h=m==null?void 0:m.items[0])==null?void 0:h.to;g&&i(g)}t==null||t(a)};return e.jsxs(e.Fragment,{children:[e.jsxs("div",{style:{position:"relative"},children:[e.jsx("button",{onClick:()=>l(!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":r,onMouseEnter:a=>{a.currentTarget.style.backgroundColor="var(--sa-background-primary-inverse, #f8f8f8)"},onMouseLeave:a=>{a.currentTarget.style.backgroundColor="transparent"},children:e.jsx(w.Icon,{name:"GridApplication",size:"sm"})}),o!==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(yr,{isShow:c,onHide:()=>l(!1),menus:n.menus.filter(a=>a.parentGroupId===void 0),selectedGroupId:o,onSelect:u})]})}const Ur=(t,r)=>{const n=[];if(r===0)return n.push(t),n;for(let i=0;i<t.length;i+=r){const o=t.slice(i,i+r);n.push(o)}return n},Yr=x.memo(({value:t,label:r,separator:n,labelWidth:i,lastIndex:o,labelAlign:s="top"})=>{const c=x.useMemo(()=>({padding:0,paddingBottom:o?0:12,verticalAlign:s}),[o,s]),l=x.useMemo(()=>({padding:0,paddingRight:12,paddingLeft:12,paddingBottom:o?0:12,verticalAlign:s}),[o,s]),u=()=>typeof r=="string"?e.jsx(b.Text,{fontWeight:"medium",color:"subtlest",children:r}):r,a=()=>typeof t=="string"||typeof t=="number"?e.jsx(b.Text,{color:"primary",fontWeight:"medium",children:t}):t,h=()=>typeof n=="string"||typeof n=="number"?e.jsx(b.Text,{fontWeight:"medium",color:"subtlest",children:n}):n;return e.jsxs(X.Tr,{children:[e.jsx(X.Td,{style:c,width:i,children:u()}),n?e.jsx(X.Td,{style:l,width:24,children:h()}):null,e.jsx(X.Td,{style:c,children:a()})]})}),Xr=x.memo(({fields:t,separator:r,labelWidth:n})=>e.jsx(X.Table,{children:t.map((i,o)=>e.jsx(Yr,{separator:r,labelWidth:n,lastIndex:o===t.length-1,...i},`field-group-field-${o}`))})),Kr=x.memo(({maxRow:t=0,maxColumn:r=2,separator:n=":",fields:i=[],labelWidth:o=150,bordered:s=!1})=>{const c=x.useMemo(()=>Ur(i,t),[i,t]),l=c.length>2,u=()=>{switch(r){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:l?void 0:"lg",direction:"row",flexWrap:"wrap",borderRadius:"rounded-sm",padding:"lg",paddingBottom:l?"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((a,h)=>e.jsx(f.Box,{direction:"column",flex:l?void 0:"1",width:l?u():void 0,marginBottom:l?"lg":void 0,children:e.jsx(Xr,{labelWidth:o,fields:a,separator:n})},h))})}),$r=({backButton:t})=>{const[r,n]=x.useState(!1),i=(t==null?void 0:t.iconColor)??"var(--sa-text-subtle, #8c8f97)",o=(t==null?void 0:t.textColor)??"var(--sa-text-subtle, #8c8f97)",s=(t==null?void 0:t.hoverIconColor)??"var(--sa-text-subtle, #8c8f97)",c=(t==null?void 0:t.hoverTextColor)??"var(--sa-text-primary, #292a2e)";return e.jsxs(f.Box,{direction:"row",gap:"xs",align:"center",onMouseEnter:()=>n(!0),onMouseLeave:()=>n(!1),style:{cursor:"pointer"},children:[e.jsx(w.Icon,{name:(t==null?void 0:t.iconName)||"ChevronLeft",size:"xs",style:{color:r?s:i,transition:"color 0.15s ease"}}),e.jsx(b.Text,{variant:"sub-h3",style:{color:r?c:o,textDecoration:r?"underline":"none",transition:"color 0.15s ease"},children:(t==null?void 0:t.title)||"Back"})]})},en=({backButton:t,title:r,titleIcon:n,titleTag:i,children:o,header:s=!0,headerBorder:c=!1,subHeaders:l,action:u,titleTagProps:a,containerProps:h,headerProps:m})=>{const g=ie.useMediaQuery("lg"),y=re.useNavigate(),E=re.useLocation(),j=t==null?void 0:t.show,v=()=>{if(typeof(t==null?void 0:t.onClick)=="function"){t.onClick();return}y(-1,{replace:!0})},F=()=>u?x.isValidElement(u)?u:e.jsx(f.Box,{direction:"row",gap:"lg",children:u.map(({title:S,icon:_,buttonProps:I,onClick:P},W)=>!S&&!_?null:e.jsx(T.Button,{fullWidth:!g,iconLeft:_?e.jsx(w.Icon,{name:_,size:"md"}):void 0,onClick:P,...I,children:S},`action-${W}`))}):null,k=()=>{const S=e.jsx($r,{backButton:t});return t!=null&&t.navigateTo?e.jsx(f.Box,{direction:"row",children:e.jsx(re.Link,{to:t.navigateTo,replace:!0,style:{textDecoration:"none"},children:S})}):e.jsx(f.Box,{direction:"row",children:e.jsx(rt,{onClick:v,children:S})})},z=()=>{const S=!!r,_=x.isValidElement(u)?!0:Array.isArray(u)&&u.length>0;return!S&&!_&&!j?null:e.jsxs(f.Box,{direction:"column",gap:"xs",paddingBlock:(m==null?void 0:m.paddingBlock)??"sm",paddingInline:(m==null?void 0:m.paddingInline)??"md",...m,style:{...c?{borderBottom:"1px solid var(--sa-border-subtle, #0b120e24)"}:{},...m==null?void 0:m.style},children:[j&&k(),(S||_)&&e.jsxs(f.Box,{direction:g?"row":"column",gap:"lg",justify:"space-between",align:"center",children:[S?typeof r=="string"?e.jsxs(f.Box,{direction:"row",gap:"lg",align:"center",children:[e.jsxs(f.Box,{direction:"row",gap:"sm",align:"center",children:[n&&e.jsx(w.Icon,{name:n,size:"md",color:"primary"}),e.jsx(b.Text,{variant:"h3",fontWeight:"semibold",fontFamily:"Poppins",children:r})]}),i&&e.jsx(ve.Badge,{border:!0,size:"lg",text:i,...a})]}):r:null,F()]})]})},p=()=>{if(!l||l.length===0)return null;let S=0,_=-1/0;return l.forEach((I,P)=>{const W=I.order??0;W>=_&&(_=W,S=P)}),l.map(({content:I,order:P,borderBottom:W=!0},Y)=>e.jsx(f.Box,{direction:"column",paddingTop:"sm",paddingBottom:W||Y===S?"sm":"spacing-0",paddingInline:"md",style:{...W?{borderBottom:"1px solid var(--sa-border-subtle, #0b120e24)"}:{},...P!==void 0?{order:P}:{}},children:I},`sub-header-${Y}`))},M=()=>{const S=s?z():null,_=p();return!S&&!_?null:e.jsxs(f.Box,{direction:"column",style:{marginBottom:l&&l.length>0?"var(--sa-spacing-0)":"var(--sa-spacing-md)"},children:[S,_]})},L=()=>o;return e.jsxs(f.Box,{direction:"column",as:"main",...h,style:{...(h==null?void 0:h.style)??{},animation:"pageLayoutEnter 320ms cubic-bezier(0.16, 1, 0.3, 1) backwards"},children:[M(),L()]},E.pathname)},tn=x.memo(en),rn={icon:"Cross",title:""},nn="calc(100vw - 16px)",Kt=t=>t==null?void 0:`min(${typeof t=="number"?`${t}px`:t}, ${nn})`,pr=x.forwardRef(({onHide:t,show:r,withBlur:n=!1,style:i,children:o,closeButton:s=rn,width:c,minWidth:l="357px",maxWidth:u="357px"},a)=>{const h=Kt(c??l),m=Kt(c??u);return e.jsx(yt.Drawer,{blur:n,isShow:r,position:"right",onHide:t,ref:a,style:{minWidth:h,maxWidth:m,...i},children:e.jsxs(f.Box,{direction:"column",padding:"lg",children:[s?e.jsxs(f.Box,{direction:"row",align:"center",gap:"sm",onClick:t,marginBottom:"lg",cursor:"pointer",children:[e.jsx(w.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,o]})})}),Et=x.memo(({children:t,borderBottom:r=!0,padding:n=!0})=>{const i=ie.useMediaQuery("lg");return e.jsx(f.Box,{direction:"column",padding:n?"md":"spacing-0",paddingLeft:n?"md":"spacing-0",paddingRight:n?"md":"spacing-0",style:r?{borderBottom:"1px solid var(--sa-border-subtle, #0b120e24)"}:void 0,children:t})}),Mt=x.memo(({children:t,borderTop:r=!0,padding:n=!0})=>{const i=ie.useMediaQuery("lg");return e.jsx(f.Box,{direction:"column",padding:n?"md":"spacing-0",paddingLeft:n?"md":"spacing-0",paddingRight:n?"md":"spacing-0",style:r?{borderTop:"1px solid var(--sa-border-subtle, #0b120e24)"}:void 0,children:t})}),on=x.memo(({children:t,...r})=>e.jsx(f.Box,{direction:"column",padding:"md",paddingLeft:"md",paddingRight:"md",gap:"md",...r,children:t})),sn=x.memo(({children:t,title:r,titleTag:n,action:i,header:o,footer:s,actionContainer:c,containerProps:l,bodyProps:u,headerProps:a={borderBottom:!0},footerProps:h={borderTop:!0},variantTag:m="info"})=>{const g=ie.useMediaQuery("lg"),y=()=>n?e.jsxs(f.Box,{direction:"row",gap:"sm",align:"center",children:[e.jsx(b.Text,{fontWeight:"medium",children:r}),e.jsx(ve.Badges,{border:!0,text:n,variant:m})]}):e.jsx(b.Text,{fontWeight:"medium",children:r}),E=()=>o||e.jsxs(f.Box,{direction:"row",justify:"space-between",align:"flex-start",gap:"md",children:[e.jsx(f.Box,{direction:"column",children:r?y():null}),e.jsx(f.Box,{direction:"column",style:g?{width:"100%",maxWidth:"19.313rem"}:{flex:1},...c,children:i??null})]}),j=!!(o||r||i);return e.jsxs(f.Box,{direction:"column",bg:"white",borderRadius:"rounded-xs",as:"section",borderWidth:"border",borderStyle:"border-solid",borderColor:"border-base",...l,style:{backgroundColor:"var(--sa-background-primary, #ffffff)",...(l==null?void 0:l.style)??{}},children:[o!==null&&j?e.jsx(Et,{...a,children:E()}):null,e.jsx(on,{...u,children:t}),s?e.jsx(Mt,{...h,children:s}):null]})}),ln=t=>e.jsx(b.Text,{variant:"h1",children:t.children,...t.props}),cn=t=>e.jsx(b.Text,{variant:"h2",children:t.children,...t.props}),an=t=>e.jsx(b.Text,{variant:"h3",children:t.children,...t.props}),dn=t=>e.jsx(b.Text,{variant:"h4",children:t.children,...t.props}),un=t=>e.jsx(b.Text,{variant:"h5",children:t.children,...t.props}),xn=t=>e.jsx(b.Text,{variant:"h6",children:t.children,...t.props}),hn=t=>e.jsx(b.Text,{variant:"sub-h1",children:t.children,...t.props}),fn=t=>e.jsx(b.Text,{variant:"sub-h2",children:t.children,...t.props}),mn=t=>e.jsx(b.Text,{variant:"sub-h3",children:t.children,...t.props}),gn=t=>e.jsx(b.Text,{variant:"body-1",children:t.children,...t.props}),jn=t=>e.jsx(b.Text,{variant:"body-2",children:t.children,...t.props}),yn=t=>e.jsx(b.Text,{variant:"body-3",children:t.children,...t.props}),me={H1:ln,H2:cn,H3:an,H4:dn,H5:un,H6:xn,SubH1:hn,SubH2:fn,SubH3:mn,Body1:gn,Body2:jn,Body3:yn},pe=()=>{const[t,r]=re.useSearchParams(),n=Oe.searchParamsToObject(t.toString()),i=re.useParams(),o=re.useLocation(),s=i.id;return{setSearchParams:r,searchParams:t,searchQueries:n,isHasQuery:(h,m)=>t.has(h)&&t.get(h)===m,getQueryParam:h=>t.get(h),getRouteParam:h=>i[h],params:i,location:o,id:s,hasId:!!s}},br=t=>JSON.stringify(t),Cr=t=>JSON.stringify(t),vr=t=>JSON.stringify(t),Dr=t=>JSON.stringify(t),pn=t=>t,bn=t=>JSON.stringify(t),Pe=({value:t,name:r,type:n,withSearchParam:i=!0,setSearchParams:o,searchQueries:s,dropdownSearchKey:c,filterKey:l="filter",pageKey:u="page"})=>{if(i){let a;switch(n){case"search":a=pn(t);break;case"dropdown":case"dropdown-multiple":a=br(t);break;case"radio":a=Cr(t);break;case"date-range":a=vr(t);break;case"advanced-date-range":a=bn(t);break;case"date":a=Dr(t);break;default:a=t;break}if(typeof a<"u"){const m={...s[l]&&typeof s[l]=="string"?JSON.parse(s[l]):void 0,[r]:a},g={...s};c&&typeof c=="string"&&delete g[c],delete g[u];const y={...g,[l]:JSON.stringify(m)},E=new URLSearchParams(s).toString(),j=new URLSearchParams(y).toString();if(E===j)return;o(y)}}},Xe=({name:t,filterKey:r="filter",searchParams:n,get:i})=>{const o=n.get(r)||void 0,s=o&&typeof o=="string"?JSON.parse(o):void 0,c=s?s[t]:void 0;return i==="label"&&c?JSON.parse(c)[0].label:i==="value"&&c?JSON.parse(c)[0].value:c},wr=({name:t,filterKey:r="filter",searchParams:n,get:i})=>{const o=n.get(r)||void 0,s=o&&typeof o=="string"?JSON.parse(o):void 0,c=s?s[t]:void 0;return i==="label"&&c?JSON.parse(c).map(l=>l.label):i==="value"&&c?JSON.parse(c).map(l=>l.value):i==="array"&&c?JSON.parse(c):c},Cn=({name:t,filterKey:r="filter",searchParams:n,get:i})=>{const o=n.get(r)||void 0,s=o&&typeof o=="string"?JSON.parse(o):void 0,c=s?s[t]:void 0;return i==="id"&&c?JSON.parse(c).id:i==="label"&&c?JSON.parse(c).label:i==="value"&&c?JSON.parse(c).value:c},Lt=(t,r,n)=>{const i=r.get(n||"filter")||void 0,o=i&&typeof i=="string"?JSON.parse(i):void 0;return o?o[t]:void 0},vn=({name:t,filterKey:r="filter",searchParams:n})=>{const i=n.get(r||"filter")||void 0,o=i&&typeof i=="string"?JSON.parse(i):void 0,s=o?o[t]:void 0;return{start:s?JSON.parse(s).from:void 0,end:s?JSON.parse(s).to:void 0}},Sr=({name:t,filterKey:r="filter",searchParams:n})=>{const i=n.get(r||"filter")||void 0,o=i&&typeof i=="string"?JSON.parse(i):void 0,s=o?o[t]:void 0;return s?JSON.parse(s):void 0},Dn=(t,{filterKey:r="filter",perPageKey:n="perPage",pageKey:i="page"})=>{const o=t.get(r)||void 0,s=t.get(n)||void 0,c=t.get(i)||void 0;return!!o||!!s||!!c},Br=({isOpen:t,onClose:r,filterKey:n,pageKey:i,filters:o})=>{const{searchParams:s,setSearchParams:c,searchQueries:l}=pe(),[u,a]=x.useState({}),h=()=>{s.delete(n||"filter"),c(s)},m=(g,y)=>{switch(g.type){case"radio":{const{show:E=!0}=g;return E&&e.jsx(f.Box,{direction:"column",children:e.jsx(f.Box,{direction:"column",children:g.title})},y)}case"dropdown":{const{show:E=!0}=g;return E&&e.jsx(f.Box,{direction:"column",children:e.jsx(f.Box,{direction:"column",children:g.title})},y)}case"date-range":return e.jsx(f.Box,{direction:"column",children:e.jsx(f.Box,{direction:"column",children:g.title})},y);case"date":return e.jsx(f.Box,{direction:"column",children:e.jsx(f.Box,{direction:"column",children:g.title})},y);case"dropdown-multiple":{const{show:E=!0}=g;return E&&e.jsx(f.Box,{direction:"column",children:e.jsx(f.Box,{direction:"column",children:g.title})},y)}default:return null}};return e.jsx(pr,{onHide:r,show:t||!1,children:e.jsxs(f.Box,{direction:"column",gap:"md",children:[e.jsxs(K.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:h,children:"Reset"})]}),o==null?void 0:o.map((g,y)=>m(g,y))]})})},kr=({searchKey:t="q",statusKey:r="status",searchPlaceholder:n="Search",searchHighlightPlaceholder:i,extendedFilter:o,showSearchFilter:s=!0,showStatusFilter:c=!0,filterKey:l="filter",pageKey:u="page",customWidthSearch:a,handleOnReset:h,filterConfigs:m,buttonToggleProps:g,position:y="right",titleSearchLabel:E="Work Order",withTitleLabels:j=!1})=>{const F=(g==null?void 0:g.isShowLabel)??!0,[k,z]=x.useState(!1),[p,M]=x.useState(0),L=()=>{M(Q=>Q+1)},{searchParams:S,setSearchParams:_,getQueryParam:I}=pe(),P=Oe.searchParamsToObject(S.toString()),W=Lt(t,S,l)||"",[Y,$]=x.useState(W),J=I(l),ne=!!(J&&!(()=>{if(J)try{const Q=JSON.parse(J);return Object.keys(Q).length===1&&Q[t]===""}catch(Q){console.error("Filter parameter is not a valid JSON:",Q)}return!1})()),G=ie.useMediaQuery("md");return x.useEffect(()=>{$(W)},[W]),x.useEffect(()=>{if(Y===W)return;const Q=window.setTimeout(()=>{Pe({value:Y,name:t,type:"search",searchQueries:P,setSearchParams:_,filterKey:l,pageKey:u})},350);return()=>{window.clearTimeout(Q)}},[Y,W,t,P,_,l,u]),e.jsxs(K.Flex,{gap:"md",style:{flexDirection:G&&y==="left"?"row":G&&y==="right"?"row-reverse":"column"},align:"flex-end",children:[ne&&e.jsx(f.Box,{direction:"column",justify:"flex-end",children:e.jsx(T.Button,{onClick:()=>{const Q=new URLSearchParams(S);Q.delete(l),_(Q),$(""),L(),h&&h()},variant:"outline",tone:"neutral",children:e.jsx(b.Text,{color:"error",fontWeight:"semibold",children:"Reset"})})}),o==null?void 0:o.map(({minWidth:Q,content:se,title:xe,onClickContainer:he},We)=>e.jsxs(f.Box,{direction:"column",gap:"sm",onClick:he,style:{minWidth:Q},children:[xe&&e.jsx(me.SubH3,{children:xe}),se]},`extended-filter-${We}-${p}`)),!!(m!=null&&m.length)&&e.jsx(T.Button,{primary:ne,secondary:!ne,iconLeft:e.jsx(w.Icon,{size:"sm",name:(g==null?void 0:g.icon)||"FilterHorizontal",style:{color:J?"var(--sa-background-brand, #04254f)":"var(--sa-text-primary, #292a2e)"}}),fullWidth:!G,onClick:()=>z(!0),children:F?"Filter":void 0}),c&&e.jsxs(f.Box,{direction:"column",gap:"sm",style:{minWidth:"126px"},children:[j&&e.jsx(me.SubH3,{children:"Status"}),e.jsx(Ie.Dropdown,{dropdownLists:[{label:"Active",value:"active"},{label:"InActive",value:"inactive"}],defaultValue:Xe({get:"value",name:r,searchParams:S,filterKey:l})?[{label:Xe({get:"value",name:r,searchParams:S,filterKey:l})==="active"?"Active":"InActive",value:Xe({get:"value",name:r,searchParams:S,filterKey:l})}]:[],onChange:Q=>Pe({value:Q,name:r,type:"dropdown",searchQueries:P,setSearchParams:_,filterKey:l}),placeholder:j?"All":"All Status"},p)]}),s&&e.jsxs(f.Box,{direction:"column",gap:"sm",style:{width:a&&G?a:G?"310px":""},children:[j&&e.jsxs(me.SubH3,{children:["Search for ",E]}),e.jsx(De.Input,{placeholder:n,leftIcon:e.jsx(w.Icon,{name:"Search",width:20,height:20}),onChange:Q=>$(Q.target.value),value:Y,fullWidth:!0},p+1+l)]}),e.jsx(Br,{isOpen:k,onClose:()=>z(!1),filterKey:l,filters:m,pageKey:u})]})},wn=t=>t==="checkbox-multiple"?"dropdown-multiple":t==="radio"?"dropdown":t==="date-compact"?"date":t;function Sn({configs:t,filterKey:r="filter",activeFilterKey:n="filters",pageKey:i="page",searchKey:o="q"}){const{searchParams:s,setSearchParams:c,searchQueries:l}=pe(),u=x.useMemo(()=>Object.fromEntries(t.map(p=>[p.key,p])),[t]),a=x.useMemo(()=>{const p=(s.get(n)||"").split(",").map(L=>L.trim()).filter(Boolean);let M=[];try{const L=s.get(r);L&&(M=Object.keys(JSON.parse(L)).filter(S=>S!==o))}catch{}return t.map(L=>L.key).filter(L=>{const S=u[L];return(S==null?void 0:S.locked)||p.includes(L)||M.includes(L)})},[s,n,r,o,t,u]),h=x.useCallback(p=>{try{return p[r]?JSON.parse(p[r]):{}}catch{return{}}},[r]),m=x.useCallback(p=>{const M={...l};p.length?M[n]=p.join(","):delete M[n],c(M)},[l,n,c]),g=x.useCallback(p=>{a.includes(p)||m([...a,p])},[a,m]),y=x.useCallback(p=>{var _;if((_=u[p])!=null&&_.locked)return;const M={...l},L=a.filter(I=>I!==p);L.length?M[n]=L.join(","):delete M[n];const S=h(M);p in S&&(delete S[p],Object.keys(S).length?M[r]=JSON.stringify(S):delete M[r]),delete M[i],c(M)},[l,a,n,r,i,h,c,u]),E=x.useCallback(p=>a.includes(p)?y(p):g(p),[a,g,y]),j=x.useCallback(p=>{switch(p.type){case"dropdown":case"dropdown-multiple":case"checkbox-multiple":case"radio":return wr({name:p.key,get:"array",searchParams:s,filterKey:r})||[];case"date":{const M=Sr({name:p.key,searchParams:s,filterKey:r});return M?new Date(M):void 0}case"date-compact":{const L=h(Object.fromEntries(s.entries()))[p.key];return L&&typeof L=="object"?L:void 0}default:return}},[s,r,h]),v=x.useCallback((p,M)=>{if(p.type==="date-compact"){const L={...l},S=h(L);M==null?delete S[p.key]:S[p.key]=M,Object.keys(S).length?L[r]=JSON.stringify(S):delete L[r],delete L[i],c(L);return}Pe({value:M,name:p.key,type:wn(p.type),searchQueries:l,setSearchParams:c,filterKey:r,pageKey:i})},[l,c,r,i,h]),F=x.useCallback(p=>{const M={...l},L=h(M);p in L&&(delete L[p],Object.keys(L).length?M[r]=JSON.stringify(L):delete M[r]),delete M[i],c(M)},[l,r,i,h,c]),k=x.useCallback(()=>{const p={...l};delete p[r],delete p[n],delete p[i],c(p)},[l,r,n,i,c]),z=a.length>0;return{activeKeys:a,configByKey:u,hasActiveFilter:z,addFilter:g,removeFilter:y,toggleFilter:E,getValue:j,setValue:v,clearValue:F,clearAll:k}}const Fr={get(t){return Ve.storage.get(t)??null},set(t,r){Ve.storage.save(t,r)},remove(t){Ve.storage.delete(t)}},nt={columns:t=>`filterbar:colprefs:${t}`,savedViews:t=>`filterbar:views:${t}`,lastState:t=>`filterbar:last:${t}`},ft=(t,r)=>{const n=new Set(r.map(s=>s.key)),i=t.order.filter(s=>n.has(s));for(const s of r)i.includes(s.key)||i.push(s.key);const o=t.hidden.filter(s=>n.has(s));return{order:i,hidden:o}};function Bn({columns:t,scopeId:r,storage:n,onColumnsChange:i}){const o=x.useMemo(()=>({order:t.map(k=>k.key),hidden:[]}),[t]),s=r?nt.columns(r):void 0,[c,l]=x.useState(()=>{if(s){const k=n.get(s);if(k&&Array.isArray(k.order))return ft(k,t)}return o}),u=t.map(k=>k.key).join("|");x.useEffect(()=>l(k=>ft(k,t)),[u]);const a=x.useRef(!1);x.useEffect(()=>{a.current||(a.current=!0,i==null||i(c))},[]);const h=x.useCallback(k=>{l(k),s&&n.set(s,k),i==null||i(k)},[s,n,i]),m=x.useMemo(()=>{const k=new Map(t.map(z=>[z.key,z]));return c.order.filter(z=>k.has(z)).map(z=>({...k.get(z),visible:!c.hidden.includes(z)}))},[c,t]),g=x.useCallback(k=>{const z=c.hidden.includes(k)?c.hidden.filter(p=>p!==k):[...c.hidden,k];h({...c,hidden:z})},[c,h]),y=x.useCallback((k,z)=>{if(k===z)return;const p=[...c.order],[M]=p.splice(k,1);p.splice(z,0,M),h({...c,order:p})},[c,h]),E=x.useCallback(k=>{h({...c,hidden:k?t.filter(z=>!z.locked).map(z=>z.key):[]})},[c,t,h]),j=x.useCallback(()=>h(o),[h,o]),v=x.useCallback(k=>h(ft(k,t)),[h,t]),F=c.hidden.length===0;return{state:c,orderedColumns:m,allVisible:F,toggleVisibility:g,reorder:y,setAllHidden:E,reset:j,applyState:v}}function kn({scopeId:t,storage:r,snapshotKeys:n,pageKey:i="page",getColumns:o,applyColumns:s}){const{searchParams:c,setSearchParams:l}=pe(),u=t?nt.savedViews(t):void 0,[a,h]=x.useState(()=>u?r.get(u)||[]:[]),m=x.useCallback(j=>{h(j),u&&r.set(u,j)},[u]),g=x.useCallback(j=>{const v=j.trim();if(!v)return;const F={};n.forEach(z=>{const p=c.get(z);p!=null&&(F[z]=p)});const k={id:`${Date.now()}`,name:v,query:F,columns:o==null?void 0:o(),createdAt:Date.now()};m([...a,k])},[n,c,o,m,a]),y=x.useCallback(j=>m(a.filter(v=>v.id!==j)),[m,a]),E=x.useCallback(j=>{const v=Object.fromEntries(c.entries());n.forEach(F=>delete v[F]),Object.assign(v,j.query),delete v[i],l(v),j.columns&&(s==null||s(j.columns))},[c,n,i,l,s]);return{enabled:!!u,views:a,saveView:g,deleteView:y,applyView:E}}function Fn({scopeId:t,storage:r,snapshotKeys:n,enabled:i=!0}){const{searchParams:o,setSearchParams:s}=pe(),c=t&&i?nt.lastState(t):void 0,l=x.useRef(!1);x.useEffect(()=>{if(l.current||(l.current=!0,!c)||n.some(m=>o.has(m)))return;const h=r.get(c);!h||Object.keys(h).length===0||s({...Object.fromEntries(o.entries()),...h})},[]),x.useEffect(()=>{if(!c)return;const a={};n.forEach(h=>{const m=o.get(h);m!=null&&(a[h]=m)}),r.set(c,a)},[o,c,n,r]);const u=x.useCallback(()=>{c&&r.remove(c)},[c,r]);return{enabled:!!c,clear:u}}const En=({configs:t,activeKeys:r,onToggle:n,hasActiveFilter:i,onReset:o})=>t.length?e.jsxs(B.Menu,{position:"bottom-left",children:[e.jsx(B.MenuButton,{children:e.jsx(T.Button,{variant:i?"secondary":"outline",tone:"neutral",size:"sm",iconLeft:e.jsx(w.Icon,{name:"FilterHorizontal"}),"aria-label":"Add filter"})}),e.jsx(B.MenuLists,{children:e.jsx(B.MenuBody,{style:{minWidth:260},title:e.jsxs(f.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"}),i&&o&&e.jsx(T.Button,{variant:"link",tone:"brand",size:"xs",onClick:o,children:"Reset"})]}),children:t.map(s=>e.jsx(B.MenuItem,{selected:s.locked||r.includes(s.key),disabled:s.locked,closeOnSelect:!1,startIcon:s.icon??void 0,onClick:()=>{s.locked||n(s.key)},children:s.label},s.key))})})]}):null,ot=({onClear:t,onRemove:r})=>e.jsxs(B.Menu,{position:"bottom-right",children:[e.jsx(B.MenuButton,{children:e.jsx(T.Button,{variant:"link",tone:"neutral",size:"xs",iconLeft:e.jsx(w.Icon,{name:"MenuHorizontal"}),"aria-label":"Filter actions"})}),e.jsx(B.MenuLists,{children:e.jsxs(B.MenuBody,{style:{width:180},children:[e.jsx(B.MenuItem,{startIcon:e.jsx(w.Icon,{name:"CrossCircle"}),onClick:t,children:"Clear value"}),r&&e.jsx(B.MenuItem,{intent:"danger",startIcon:e.jsx(w.Icon,{name:"Trash1"}),onClick:r,children:"Remove filter"})]})})]}),$t=24,Er=t=>t.length>$t?`${t.slice(0,$t)}...`:t,Ke=t=>t.toLocaleDateString(void 0,{day:"2-digit",month:"short",year:"numeric"}),tt={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"],vt={past:"Past",next:"Next",this:"This"},Ln=["day","week","month","year"],In=["past","next","this"],On=t=>{const r=new Date(t);return r.setHours(0,0,0,0),r},er=(t,r,n)=>{const i=new Date(t);return n==="day"?i.setDate(i.getDate()+r):n==="week"?i.setDate(i.getDate()+r*7):n==="month"?i.setMonth(i.getMonth()+r):i.setFullYear(i.getFullYear()+r),i},Tn=t=>{const r=On(new Date);if(t.direction==="this"){const i=new Date(r),o=new Date(r);return t.period==="week"?(i.setDate(r.getDate()-r.getDay()),o.setDate(i.getDate()+6)):t.period==="month"?(i.setDate(1),o.setMonth(o.getMonth()+1,0)):t.period==="year"&&(i.setMonth(0,1),o.setMonth(11,31)),{from:i,to:o}}const n=t.count??1;return t.direction==="past"?{from:er(r,-n,t.period),to:r}:{from:r,to:er(r,n,t.period)}},Wn=t=>t.field.type==="date-compact"?e.jsx(zn,{field:t.field,value:t.value,onChange:t.onChange,onClear:t.onClear,onRemove:t.onRemove}):e.jsx(Rn,{field:t.field,value:t.value,onChange:t.onChange,onClear:t.onClear,onRemove:t.onRemove}),Rn=({field:t,value:r,onChange:n,onClear:i,onRemove:o})=>{const s=r?Ke(new Date(r)):null,c=!!s,l=c?e.jsxs(e.Fragment,{children:[e.jsxs("span",{style:{fontWeight:500},children:[t.label,":"]})," ",e.jsx("span",{style:{fontWeight:400},children:Er(s)})]}):t.label;return e.jsxs(B.Menu,{position:"bottom-left",children:[e.jsx(B.MenuButton,{children:e.jsx(T.Button,{variant:c?"secondary":"outline",tone:"neutral",size:"sm",iconLeft:c?e.jsx(w.Icon,{name:"Calendar",size:"sm"}):void 0,iconRight:e.jsx(w.Icon,{name:"ChevronSmallDown"}),children:l})}),e.jsx(B.MenuLists,{children:e.jsx(B.MenuBody,{style:{width:260},title:e.jsxs(f.Box,{display:"flex",direction:"row",align:"center",justify:"space-between",fullWidth:!0,children:[e.jsx(b.Text,{fontSize:"sm",fontWeight:"medium",color:"subtlest",children:t.label}),e.jsx(ot,{onClear:i,onRemove:o})]}),children:e.jsx(Be.StarasiaDate,{size:"sm",input:!1,clearable:!0,filter:t.mode,value:r,onChange:u=>u==null?i():n(u),withPadding:!1})})})]})},An=t=>{switch(t.op){case"is":case"is-before":case"is-after":case"is-on-or-before":case"is-on-or-after":return t.date?`${tt[t.op]} ${Ke(new Date(t.date))}`:null;case"is-between":return t.from&&t.to?`${Ke(new Date(t.from))} - ${Ke(new Date(t.to))}`:null;case"is-relative-to-today":{const r=t.relative;if(!r)return null;if(r.direction==="this")return`This ${r.period}`;const n=r.count??1,i=n===1?r.period:`${r.period}s`;return`${vt[r.direction]} ${n} ${i}`}case"is-empty":case"is-not-empty":return tt[t.op];default:return null}},zn=({field:t,value:r,onChange:n,onClear:i,onRemove:o})=>{const s=(r==null?void 0:r.op)??"is",c=r?An(r):null,l=!!c,u=l?e.jsxs(e.Fragment,{children:[e.jsxs("span",{style:{fontWeight:500},children:[t.label,":"]})," ",e.jsx("span",{style:{fontWeight:400},children:Er(c)})]}):t.label,a=h=>{if(h!==s){if(h==="is-empty"||h==="is-not-empty"){n({op:h});return}if(h==="is-relative-to-today"){n({op:h,relative:(r==null?void 0:r.relative)??{direction:"past",count:1,period:"week"}});return}if(h==="is-between"){n({op:h,from:r==null?void 0:r.from,to:r==null?void 0:r.to});return}n({op:h,date:r==null?void 0:r.date})}};return e.jsxs(B.Menu,{position:"bottom-left",children:[e.jsx(B.MenuButton,{children:e.jsx(T.Button,{variant:l?"secondary":"outline",tone:"neutral",size:"sm",iconLeft:l?e.jsx(w.Icon,{name:"Calendar",size:"sm"}):void 0,iconRight:e.jsx(w.Icon,{name:"ChevronSmallDown"}),children:u})}),e.jsxs(B.MenuLists,{children:[e.jsx(B.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(b.Text,{fontSize:"sm",fontWeight:"medium",color:"subtlest",children:t.label}),e.jsx(Hn,{op:s,onChange:a})]}),e.jsx(ot,{onClear:i,onRemove:o})]}),children:e.jsx(Vn,{value:r,op:s,onChange:n})}),s==="is-relative-to-today"&&e.jsx(B.MenuFooter,{children:e.jsx(b.Text,{fontSize:"xs",color:"subtlest",children:"Filter will update with the current date"})})]})]})},Hn=({op:t,onChange:r})=>e.jsxs(B.Menu,{position:"bottom-left",children:[e.jsx(B.MenuButton,{children:e.jsx(T.Button,{variant:"link",tone:"neutral",size:"xs",iconRight:e.jsx(w.Icon,{name:"ChevronSmallDown"}),children:tt[t]})}),e.jsx(B.MenuLists,{children:e.jsx(B.MenuBody,{style:{width:200},children:Mn.map(n=>e.jsx(B.MenuItem,{selected:t===n,onClick:()=>r(n),endIcon:t===n?e.jsx(w.Icon,{name:"Check"}):void 0,children:tt[n]},n))})})]}),Vn=({value:t,op:r,onChange:n})=>{if(r==="is-empty"||r==="is-not-empty")return e.jsx(f.Box,{paddingBlock:"sm",paddingInline:"sm",children:e.jsx(b.Text,{fontSize:"xs",color:"subtlest",children:"No further input required."})});if(r==="is-between"){const i=t!=null&&t.from||t!=null&&t.to?{from:t!=null&&t.from?new Date(t.from):null,to:t!=null&&t.to?new Date(t.to):null}:void 0;return e.jsx(Be.StarasiaDate,{size:"sm",input:!1,clearable:!0,rangedDate:!0,value:i,onChange:o=>{if(o==null){n({op:r});return}if(typeof o=="object"&&o!==null&&"from"in o&&"to"in o){let{from:s,to:c}=o;if(!s&&c&&(s=c,c=null),!s&&!c){n({op:r});return}n({op:r,from:s?s.toISOString():void 0,to:c?c.toISOString():void 0})}},withPadding:!1},"range")}return r==="is-relative-to-today"?e.jsx(Nn,{value:t==null?void 0:t.relative,onChange:i=>n({op:r,relative:i})}):e.jsx(Be.StarasiaDate,{size:"sm",input:!1,clearable:!0,value:t!=null&&t.date?new Date(t.date):void 0,onChange:i=>{if(i==null){n({op:r});return}i instanceof Date&&n({op:r,date:i.toISOString()})},withPadding:!1},"single")},Nn=({value:t,onChange:r})=>{const n=(t==null?void 0:t.direction)??"past",i=(t==null?void 0:t.count)??1,o=(t==null?void 0:t.period)??"week",s=n!=="this",c=Tn({direction:n,count:i,period:o});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(B.Menu,{position:"bottom-left",children:[e.jsx(B.MenuButton,{children:e.jsx(T.Button,{variant:"outline",tone:"neutral",size:"sm",iconRight:e.jsx(w.Icon,{name:"ChevronSmallDown"}),children:vt[n]})}),e.jsx(B.MenuLists,{children:e.jsx(B.MenuBody,{style:{width:140},children:In.map(l=>e.jsx(B.MenuItem,{selected:n===l,endIcon:n===l?e.jsx(w.Icon,{name:"Check"}):void 0,onClick:()=>r(l==="this"?{direction:l,period:o}:{direction:l,count:i,period:o}),children:vt[l]},l))})})]}),s&&e.jsx(De.Input,{type:"number",size:"sm",min:1,clearable:!1,value:i,onChange:l=>{const u=Number(l.target.value);r({direction:n,count:Number.isFinite(u)&&u>0?u:1,period:o})},style:{width:72}}),e.jsxs(B.Menu,{position:"bottom-left",children:[e.jsx(B.MenuButton,{children:e.jsx(T.Button,{variant:"outline",tone:"neutral",size:"sm",iconRight:e.jsx(w.Icon,{name:"ChevronSmallDown"}),children:o})}),e.jsx(B.MenuLists,{children:e.jsx(B.MenuBody,{style:{width:140},children:Ln.map(l=>e.jsx(B.MenuItem,{selected:o===l,endIcon:o===l?e.jsx(w.Icon,{name:"Check"}):void 0,onClick:()=>r(n==="this"?{direction:n,period:l}:{direction:n,count:i,period:l}),children:l},l))})})]})]}),e.jsx(Be.StarasiaDate,{size:"sm",input:!1,disabled:!0,rangedDate:!0,value:c,onChange:()=>{},withPadding:!1},"relative-preview")]})},tr=18,Pn=t=>t.length>tr?`${t.slice(0,tr)}...`:t,_n=({field:t,value:r,onChange:n,onClear:i,onRemove:o})=>{const s=t.type==="dropdown-multiple",c=r.length,[l,u]=x.useState(""),a=t.options,h=typeof t.onSearch=="function",m=(()=>{if(h)return a;const v=l.trim().toLowerCase();return v?a.filter(F=>F.label.toLowerCase().includes(v)):a})(),g=v=>r.some(F=>F.value===v.value),y=v=>{if(!s){n([{label:v.label,value:v.value}]),u("");return}n(g(v)?r.filter(F=>F.value!==v.value):[...r,{label:v.label,value:v.value}])},E=v=>{var F;u(v),(F=t.onSearch)==null||F.call(t,v)},j=c===0?t.label:e.jsxs(e.Fragment,{children:[e.jsxs("span",{style:{fontWeight:500},children:[t.label,":"]})," ",e.jsx("span",{style:{fontWeight:400},children:c===1?Pn(r[0].label):`${c} Selected`})]});return e.jsxs(B.Menu,{position:"bottom-left",children:[e.jsx(B.MenuButton,{children:e.jsx(T.Button,{variant:c>0?"secondary":"outline",tone:"neutral",size:"sm",iconLeft:c>0?e.jsx(w.Icon,{name:"Tag",size:"sm"}):void 0,iconRight:e.jsx(w.Icon,{name:"ChevronSmallDown"}),children:j})}),e.jsx(B.MenuLists,{children:e.jsx(B.MenuBody,{style:{width:260},title:e.jsxs(f.Box,{display:"flex",direction:"row",align:"center",justify:"space-between",fullWidth:!0,children:[e.jsx(b.Text,{fontSize:"sm",fontWeight:"medium",color:"subtlest",children:t.label}),e.jsx(ot,{onClear:i,onRemove:o})]}),children:e.jsxs(f.Box,{direction:"column",gap:"sm",children:[e.jsx(Ie.Dropdown,{size:"sm",triggerInput:!0,fullWidth:!0,hideChevronIcon:!0,clearable:!0,multiSelect:s,searchAble:!0,searchValue:l,onSearch:E,value:r,onChange:n,placeholder:`Search ${t.label.toLowerCase()}…`}),e.jsx(f.Box,{direction:"column",overflow:"overflow-y-auto",customMaxHeight:"240px",children:t.isLoading?e.jsx(f.Box,{paddingBlock:"sm",paddingInline:"sm",children:e.jsx(b.Text,{fontSize:"xs",color:"subtlest",children:"Loading…"})}):m.length===0?e.jsx(f.Box,{paddingBlock:"sm",paddingInline:"sm",children:e.jsx(b.Text,{fontSize:"xs",color:"subtlest",children:"No results"})}):m.map(v=>e.jsx(B.MenuItem,{closeOnSelect:!s,selected:g(v),startIcon:v.avatar,endIcon:g(v)?e.jsx(w.Icon,{name:"Check"}):void 0,description:v.description,onClick:()=>y(v),children:v.label},v.value))})]})})})]})},rr=18,qn=t=>t.length>rr?`${t.slice(0,rr)}...`:t,nr=({checked:t,indeterminate:r})=>e.jsx("span",{style:{pointerEvents:"none",display:"inline-flex"},children:e.jsx(Te.Checkbox,{size:"sm",checked:t,readOnly:!0,onChange:()=>{},variant:r?"indeterminate":"select"})}),Zn=({field:t,value:r,onChange:n,onClear:i,onRemove:o})=>{const s=new Set(r.map(g=>g.value)),c=r.length,l=t.options.length>0&&t.options.every(g=>s.has(g.value)),u=c>0&&!l,a=g=>{n(s.has(g.value)?r.filter(y=>y.value!==g.value):[...r,{label:g.label,value:g.value}])},h=()=>{n(l?[]:t.options.map(g=>({label:g.label,value:g.value})))},m=c===0?t.label:e.jsxs(e.Fragment,{children:[e.jsxs(b.Text,{as:"span",fontWeight:"semibold",children:[t.label,":"]})," ",e.jsx(b.Text,{as:"span",children:c===1?qn(r[0].label):`${c} Selected`})]});return e.jsxs(B.Menu,{position:"bottom-left",children:[e.jsx(B.MenuButton,{children:e.jsx(T.Button,{variant:c>0?"secondary":"outline",tone:"neutral",size:"sm",iconLeft:c>0?e.jsx(w.Icon,{name:"Tag",size:"sm"}):void 0,iconRight:e.jsx(w.Icon,{name:"ChevronSmallDown"}),children:m})}),e.jsx(B.MenuLists,{children:e.jsxs(B.MenuBody,{style:{width:240},title:e.jsxs(f.Box,{display:"flex",direction:"row",align:"center",justify:"space-between",fullWidth:!0,children:[e.jsx(b.Text,{fontSize:"sm",fontWeight:"medium",color:"subtlest",children:t.label}),e.jsx(ot,{onClear:i,onRemove:o})]}),children:[e.jsx(B.MenuItem,{closeOnSelect:!1,selected:l,onClick:h,startIcon:e.jsx(nr,{checked:l||u,indeterminate:u}),children:"Select All"}),t.options.map(g=>e.jsx(B.MenuItem,{closeOnSelect:!1,selected:s.has(g.value),onClick:()=>a(g),startIcon:e.jsx(nr,{checked:s.has(g.value)}),children:g.label},g.value))]})})]})},Qn=({activeKeys:t,configByKey:r,getValue:n,setValue:i,clearValue:o,removeFilter:s})=>e.jsx(e.Fragment,{children:t.map(c=>{const l=r[c];if(!l)return null;const u=n(l),a=l.locked?void 0:()=>s(c);return l.type==="date"||l.type==="date-compact"?e.jsx(Wn,{field:l,value:u,onChange:h=>i(l,h),onClear:()=>o(c),onRemove:a},c):l.type==="checkbox-multiple"?e.jsx(Zn,{field:l,value:u||[],onChange:h=>i(l,h),onClear:()=>o(c),onRemove:a},c):e.jsx(_n,{field:l,value:u||[],onChange:h=>i(l,h),onClear:()=>o(c),onRemove:a},c)})}),or=t=>`${t} Rows`,Gn=({pagination:t,pageKey:r="page",perPageKey:n="perPage",pageSizeOptions:i=[10,25,50,100],defaultPerPage:o=10,showResultCount:s=!0,showPageSize:c=!0,showPagination:l=!0})=>{var F;const{searchQueries:u,setSearchParams:a,searchParams:h}=pe(),m=h.get(n),g=m?Number(m):o,y=k=>{a({...u,[r]:String(k)})},E=k=>{a({...u,[n]:k,[r]:"1"})},j=(t==null?void 0:t.rangeStart)??(((t==null?void 0:t.currentPage)||0)>1?(((t==null?void 0:t.currentPage)||0)-1)*((t==null?void 0:t.perPage)||0)+1:1),v=(t==null?void 0:t.rangeEnd)??((t==null?void 0:t.totalCurrentPage)!==(t==null?void 0:t.perPage)?t==null?void 0:t.totalData:((t==null?void 0:t.currentPage)||1)*((t==null?void 0:t.totalCurrentPage)||0));return e.jsxs(e.Fragment,{children:[s&&e.jsx(b.Text,{fontSize:"sm",fontWeight:"medium",color:"primary",truncate:!0,children:`${j}-${v} of ${((F=t==null?void 0:t.totalData)==null?void 0:F.toLocaleString())||0}`}),c&&e.jsxs(B.Menu,{position:"bottom-left",children:[e.jsx(B.MenuButton,{children:e.jsx(T.Button,{variant:"outline",tone:"neutral",size:"xs",iconRight:e.jsx(w.Icon,{name:"ChevronSmallDown"}),"aria-label":"Rows per page",children:or(g)})}),e.jsx(B.MenuLists,{children:e.jsx(B.MenuBody,{children:i.map(k=>e.jsx(B.MenuItem,{selected:k===g,onClick:()=>E(String(k)),children:or(k)},k))})})]}),l&&!!(t!=null&&t.totalPage)&&e.jsx(f.Box,{direction:"column",display:"flex",align:"center",gap:"sm",paddingRight:"lg",style:{borderRight:"1px solid var(--sa-border-subtle, rgba(11, 18, 14, 0.14))"},children:e.jsx($e.Pagination,{size:"sm",variant:"neutral",siblingCount:0,currentPage:t!=null&&t.currentPage?Number(t.currentPage):1,totalPages:Number(t.totalPage),onPageChange:y})})]})};function Jn(t,r,n=!0){x.useEffect(()=>{if(!n)return;const i=o=>{var l;if(o.metaKey||o.ctrlKey||o.altKey||o.key!==t)return;const s=o.target,c=(l=s==null?void 0:s.tagName)==null?void 0:l.toLowerCase();c==="input"||c==="textarea"||s!=null&&s.isContentEditable||(o.preventDefault(),r())};return window.addEventListener("keydown",i),()=>window.removeEventListener("keydown",i)},[t,r,n])}const Un=240,Yn=({searchKey:t="q",filterKey:r="filter",pageKey:n="page",placeholder:i="Search",shortcut:o="/"})=>{const{searchParams:s,setSearchParams:c,searchQueries:l}=pe(),u=Lt(t,s,r)||"",[a,h]=x.useState(!!u),[m,g]=x.useState(!u),[y,E]=x.useState(u),j=ie.useDebounce(y,350),v=x.useRef(null);x.useEffect(()=>{E(u),u&&h(!0)},[u]),x.useEffect(()=>{a&&g(!1)},[a]),x.useEffect(()=>{j!==u&&Pe({value:j,name:t,type:"search",searchQueries:l,setSearchParams:c,filterKey:r,pageKey:n})},[j]);const F=x.useCallback(()=>{h(!0),requestAnimationFrame(()=>{var M;return(M=v.current)==null?void 0:M.focus()})},[]);Jn(o,F);const k=()=>{y||h(!1)},z=M=>{var L;M.key==="Escape"&&!y&&(h(!1),(L=v.current)==null||L.blur())},p=()=>{a||g(!0)};return e.jsxs(f.Box,{display:"flex",direction:"row",align:"center",gap:"spacing-0",children:[m&&e.jsx(T.Button,{variant:"outline",tone:"neutral",size:"sm",iconLeft:e.jsx(w.Icon,{name:"Search",size:"sm"}),"aria-label":"Search","aria-expanded":!1,onClick:F}),e.jsxs(f.Box,{onTransitionEnd:p,style:{position:"relative",width:a?Un:0,overflow:"hidden",transition:"width 220ms ease"},children:[e.jsx(De.Input,{ref:v,size:"sm",fullWidth:!0,value:y,placeholder:i,leftIcon:e.jsx(w.Icon,{name:"Search",width:16,height:16}),onChange:M=>E(M.target.value),onKeyDown:z,onBlur:k,tabIndex:a?0:-1}),a&&!y&&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(b.Text,{fontSize:"xs",color:"subtle",children:o})})]})]})},Xn=({columns:t,allVisible:r,onToggle:n,onReorder:i,onSetAllHidden:o})=>{const[s,c]=x.useState(null),[l,u]=x.useState(null),a=()=>{s!==null&&l!==null&&s!==l&&i(s,l),c(null),u(null)},h=(m,g)=>{const y=m+g;y<0||y>=t.length||i(m,y)};return e.jsxs(B.Menu,{position:"bottom-right",children:[e.jsx(B.MenuButton,{children:e.jsx(T.Button,{variant:r?"outline":"secondary",tone:"neutral",size:"sm",iconLeft:e.jsx(w.Icon,{name:"Grid",size:"sm"}),"aria-label":"Customize columns"})}),e.jsx(B.MenuLists,{children:e.jsx(B.MenuBody,{children:e.jsxs(f.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(f.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(T.Button,{variant:"link",tone:"info",size:"xs",onClick:()=>o(r),children:r?"Hide All":"Show All"})]}),e.jsx(f.Box,{direction:"column",overflow:"overflow-y-auto",children:t.map((m,g)=>{const y=!m.locked,E=l===g&&s!==null&&s!==g;return e.jsxs(f.Box,{direction:"row",display:"flex",align:"center",gap:"sm",paddingBlock:"xs",draggable:y,onDragStart:()=>y&&c(g),onDragOver:j=>{j.preventDefault(),u(g)},onDrop:a,onDragEnd:a,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:y?0:-1,"aria-label":`Reorder ${m.title}`,"aria-disabled":!y||void 0,color:"icon-subtlest",onKeyDown:j=>{y&&(j.key==="ArrowUp"?(j.preventDefault(),h(g,-1)):j.key==="ArrowDown"&&(j.preventDefault(),h(g,1)))},style:{display:"inline-flex",cursor:y?"grab":"default",opacity:y?1:.4},children:e.jsx(w.Icon,{name:"DragVertical",width:16,height:16})}),m.icon&&e.jsx(f.Box,{direction:"column",align:"center",color:"icon-subtle",style:{display:"inline-flex"},children:m.icon}),e.jsx(b.Text,{fontSize:"sm",fontWeight:"medium",color:"primary",truncate:!0,children:m.title}),e.jsx(f.Box,{direction:"column",style:{marginLeft:"auto"},children:e.jsx(Ne.Toggle,{size:"sm",checked:m.visible,disabled:m.locked,onChange:()=>n(m.key),"aria-label":`Toggle ${m.title} column`})})]},m.key)})})]})})})]})},Kn=({views:t,onApply:r,onDelete:n,onSave:i})=>{const[o,s]=x.useState(""),c=()=>{const l=o.trim();l&&(i(l),s(""))};return e.jsxs(B.Menu,{position:"bottom-right",children:[e.jsx(B.MenuButton,{children:e.jsx(T.Button,{variant:t.length>0?"secondary":"outline",tone:(t.length>0,"neutral"),size:"sm",iconLeft:e.jsx(w.Icon,{name:"Bookmark",size:"sm"}),"aria-label":"Saved views"})}),e.jsxs(B.MenuLists,{style:{width:"260px"},children:[e.jsx(B.MenuBody,{children:e.jsxs(f.Box,{direction:"column",padding:"xs",gap:"sm",children:[e.jsx(b.Text,{fontWeight:"semibold",color:"primary",children:"Saved Views"}),e.jsx(f.Box,{direction:"column",overflow:"overflow-y-auto",children:t.length===0?e.jsx(f.Box,{direction:"column",paddingBlock:"sm",children:e.jsx(b.Text,{fontSize:"sm",color:"subtlest",children:"No saved views yet"})}):t.map(l=>e.jsx(B.MenuItem,{startIcon:e.jsx(w.Icon,{name:"Bookmark"}),onClick:()=>r(l),endIcon:e.jsx(T.Button,{variant:"link",tone:"error",size:"sm",iconLeft:e.jsx(w.Icon,{name:"Trash2"}),"aria-label":`Delete ${l.name}`,onClick:u=>{u.stopPropagation(),n(l.id)}}),children:l.name},l.id))})]})}),e.jsx(B.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(De.Input,{size:"sm",fullWidth:!0,placeholder:"Save current view as…",value:o,onChange:l=>s(l.target.value),onKeyDown:l=>{l.key==="Enter"&&c()}})}),e.jsx(T.Button,{variant:"primary",tone:"brand",size:"sm",disabled:!o.trim(),onClick:c,children:"Save"})]})})]})]})},$n=({withPadding:t=!1,filterConfigs:r=[],filterKey:n="filter",activeFilterKey:i="filters",pageKey:o="page",perPageKey:s="perPage",pageSizeOptions:c=[10,25,50,100],showPagination:l=!0,showResultCount:u=!0,showPageSize:a=!0,searchable:h=!1,searchKey:m="q",searchPlaceholder:g="Search",searchShortcut:y="/",pagination:E,columns:j=[],onColumnsChange:v,savedViews:F,persistLastState:k=!0,storage:z=Fr,onReset:p})=>{const{activeKeys:M,configByKey:L,hasActiveFilter:S,toggleFilter:_,removeFilter:I,getValue:P,setValue:W,clearValue:Y,clearAll:$}=Sn({configs:r,filterKey:n,activeFilterKey:i,pageKey:o,searchKey:m}),J=Bn({columns:j,scopeId:F==null?void 0:F.scopeId,storage:z,onColumnsChange:v}),te=kn({scopeId:F==null?void 0:F.scopeId,storage:z,snapshotKeys:[i,n,s],pageKey:o,getColumns:()=>J.state,applyColumns:J.applyState}),ne=Fn({scopeId:F==null?void 0:F.scopeId,storage:z,snapshotKeys:[i,n,s,o],enabled:k}),G=!!(F!=null&&F.enabled)&&te.enabled,Q=()=>{$(),ne.clear(),p==null||p()};return e.jsxs(f.Box,{display:"flex",direction:"row",align:"center",gap:"sm",wrap:"wrap",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",gap:"sm",style:{flex:"1 1 0",minWidth:0},children:[e.jsx(En,{configs:r,activeKeys:M,onToggle:_,hasActiveFilter:S,onReset:Q}),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(Qn,{activeKeys:M,configByKey:L,getValue:P,setValue:W,clearValue:Y,removeFilter:I}),S&&e.jsx(T.Button,{variant:"link",tone:"brand",size:"sm",onClick:Q,children:"Reset"})]})]}),e.jsxs(f.Box,{direction:"row",display:"flex",align:"center",gap:"sm",children:[e.jsx(Gn,{pagination:E,pageKey:o,perPageKey:s,pageSizeOptions:c,showPagination:l,showResultCount:u,showPageSize:a}),h&&e.jsx(Yn,{searchKey:m,filterKey:n,pageKey:o,placeholder:g,shortcut:y}),G&&e.jsx(Kn,{views:te.views,onApply:te.applyView,onDelete:te.deleteView,onSave:te.saveView}),j.length>0&&e.jsx(Xn,{columns:J.orderedColumns,allVisible:J.allVisible,onToggle:J.toggleVisibility,onReorder:J.reorder,onSetAllHidden:J.setAllHidden})]})]})},Mr=({children:t,borderRadius:r,height:n})=>{const i=x.useRef(null),[o,s]=x.useState("100vh");return x.useEffect(()=>{if(n)return;const c=()=>{if(i.current){const l=i.current.getBoundingClientRect().top;s(`calc(100vh - ${l}px)`)}};return c(),window.addEventListener("resize",c),()=>window.removeEventListener("resize",c)},[n]),e.jsx(f.Box,{ref:i,fullWidth:!0,borderStyle:"border-solid",borderWidth:"border",borderColor:"border-base",borderRadius:r||"rounded-xs",style:{height:n??o,display:"flex",flexDirection:"column"},children:t})},Lr=({action:t,rightContent:r,leftContent:n,headerSlot:i,advanceFilter:o,showFilter:s=!0})=>{const c=ie.useMediaQuery("md"),l=s?e.jsx(kr,{...o}):null,u=()=>t?x.isValidElement(t)?t:e.jsx(f.Box,{style:{display:"flex",flexDirection:c?"row":"column",gap:"8px",width:c?"auto":"100%",textWrap:"nowrap"},children:t.map(({title:a,icon:h,buttonProps:m,onClick:g},y)=>!a&&!h?null:e.jsx(T.Button,{fullWidth:!c,iconLeft:h?e.jsx(w.Icon,{name:h}):void 0,onClick:g,...m,children:a},`action-${y}`))}):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:i?i({filter:l}):e.jsxs(e.Fragment,{children:[e.jsxs(f.Box,{style:{display:"flex",gap:"8px",flexDirection:"row",alignItems:"center",flex:1,minWidth:0},children:[l,n]}),e.jsxs(f.Box,{style:{display:"flex",gap:"8px",flexDirection:"row",alignItems:"center",flexShrink:0},children:[r,u()]})]})})},eo=({totalData:t,withMarginBottom:r=!0,withMarginTop:n=!0})=>e.jsxs(f.Box,{style:{display:"flex",gap:"4px",flexDirection:"row",alignItems:"center",marginBottom:r?"16px":void 0,marginTop:n?"16px":void 0},children:[e.jsxs(me.Body1,{props:{color:"gray-500"},children:["Total data:"," "]}),e.jsx(me.Body1,{children:t||0})]}),Ir=({pagination:t,pageKey:r="page",perPageKey:n="perPage",defaultPerPage:i=10,showPagination:o=!0,totalData:s})=>{const{searchQueries:c,setSearchParams:l,searchParams:u}=pe(),a=u.get(n),h=E=>{l({...c,[r]:String(E)})},m=E=>{l({...c,[n]:E,[r]:"1"})},g=(t==null?void 0:t.rangeStart)??(((t==null?void 0:t.currentPage)||0)>1?(((t==null?void 0:t.currentPage)||0)-1)*((t==null?void 0:t.perPage)||0)+1:1),y=(t==null?void 0:t.rangeEnd)??((t==null?void 0:t.totalCurrentPage)!==(t==null?void 0:t.perPage)?t==null?void 0:t.totalData:((t==null?void 0:t.currentPage)||1)*((t==null?void 0:t.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:o?e.jsxs(e.Fragment,{children:[e.jsxs(f.Box,{style:{display:"flex",flexDirection:"row",gap:"8px",alignItems:"center",textWrap:"nowrap"},children:[e.jsx(b.Text,{children:"Rows Per Page: "}),e.jsx(Ie.Dropdown,{dropdownLists:[{label:"5",value:"5"},{label:"10",value:"10"},{label:"25",value:"25"},{label:"50",value:"50"},{label:"100",value:"100"}],onChange:E=>{m(E[0].value)},value:a?[{label:`${a} per row`,value:a}]:[{label:`${i} per row`,value:`${i}`}],defaultValue:a?[{label:`${a} per row`,value:a}]:[{label:`${i} per row`,value:`${i}`}]}),e.jsx(b.Text,{children:`${g}-${y} of ${(t==null?void 0:t.totalData)||0}`})]}),e.jsx($e.Pagination,{currentPage:t!=null&&t.currentPage?Number(t==null?void 0:t.currentPage):1,totalPages:t!=null&&t.totalPage?Number(t==null?void 0:t.totalPage):1,onPageChange:h})]}):e.jsx(eo,{totalData:s,withMarginBottom:!1,withMarginTop:!1})})},Or=({filter:t,columnTitle:r})=>{const[n,i]=x.useState(!1),o=x.useRef(null),s=x.useRef(null),c=x.useRef(null),[l,u]=x.useState(""),[a,h]=x.useState({top:0,left:0}),m=t.selectedValues,g=x.useMemo(()=>l?t.options.filter(j=>j.label.toLowerCase().includes(l.toLowerCase())):t.options,[t.options,l]);x.useEffect(()=>{if(n&&s.current){const j=s.current.getBoundingClientRect(),v=280,F={top:j.bottom+8};t.position==="left"||j.left+v>window.innerWidth?F.right=window.innerWidth-j.right:F.left=j.left,h(F)}},[n,t.position]),x.useEffect(()=>{n&&c.current?setTimeout(()=>{var j;return(j=c.current)==null?void 0:j.focus()},50):u("")},[n]),x.useEffect(()=>{const j=v=>{o.current&&!o.current.contains(v.target)&&s.current&&!s.current.contains(v.target)&&i(!1)};return n&&document.addEventListener("mousedown",j),()=>document.removeEventListener("mousedown",j)},[n]);const y=j=>{const v=m.includes(j)?m.filter(F=>F!==j):[...m,j];t.onFilterChange(v)},E=()=>t.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:j=>{var v;j.stopPropagation(),n||(v=t.onOpen)==null||v.call(t),i(F=>!F)},children:e.jsx(w.Icon,{name:n?"ChevronUp":"ChevronDown",size:"sm",style:{color:m.length>0?"var(--sa-color-brand-500, #1a4fa0)":"var(--sa-text-subtle, #8c8f97)"}})}),n&&e.jsxs(f.Box,{ref:o,style:{position:"fixed",top:`${a.top}px`,...a.left!==void 0?{left:`${a.left}px`}:{right:`${a.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(b.Text,{fontSize:"sm",fontWeight:"semibold",color:"gray-700",children:["Filter ",r]}),m.length>0&&e.jsx(f.Box,{direction:"column",style:{cursor:"pointer"},children:e.jsx(b.Text,{fontSize:"xs",color:"primary",fontWeight:"semibold",onClick:j=>{j.stopPropagation(),E()},children:"CLEAR"})})]}),!t.hideSearch&&e.jsx(f.Box,{direction:"column",style:{paddingLeft:"16px",paddingRight:"16px",paddingTop:"8px",paddingBottom:"8px"},children:e.jsx(De.Input,{ref:c,placeholder:`Search ${r.toLowerCase()}...`,leftIcon:e.jsx(w.Icon,{name:"Search",size:"sm"}),value:l,onChange:j=>u(j.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:t.isLoadingOptions?e.jsxs(f.Box,{style:{paddingTop:"40px",paddingBottom:"40px",display:"flex",alignItems:"center",justifyContent:"center",flexDirection:"column"},children:[e.jsx(w.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..."})]}):g.length>0?e.jsx(f.Box,{direction:"column",style:{gap:"2px",paddingTop:"4px",paddingBottom:"4px"},children:g.map(j=>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:m.includes(j.value)?"var(--sa-color-brand-50, #e6edf6)":"transparent"},onClick:v=>{v.stopPropagation(),y(j.value)},onMouseEnter:v=>{m.includes(j.value)||(v.currentTarget.style.backgroundColor="var(--sa-background-primary, #ffffff)"),v.currentTarget.style.transform="translateX(2px)"},onMouseLeave:v=>{v.currentTarget.style.backgroundColor=m.includes(j.value)?"var(--sa-color-brand-50, #e6edf6)":"transparent",v.currentTarget.style.transform="translateX(0)"},children:[e.jsx(Te.Checkbox,{checked:m.includes(j.value),onChange:()=>{}}),e.jsx(b.Text,{fontSize:"sm",fontWeight:m.includes(j.value)?"medium":"normal",color:m.includes(j.value)?"primary":"gray-700",children:j.label})]},j.value))}):e.jsxs(f.Box,{style:{paddingTop:"40px",paddingBottom:"40px",display:"flex",alignItems:"center",justifyContent:"center",flexDirection:"column"},children:[e.jsx(w.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"})]})}),m.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:m.length}),e.jsxs(b.Text,{fontSize:"xs",color:"primary",fontWeight:"medium",children:["item",m.length>1?"s":""," selected"]})]})})]})]})},to=({direction:t})=>{const r="var(--sa-text-primary, #292a2e)",n="var(--sa-text-subtle, #8c8f97)",i=t==="asc"?r:n,o=t==="desc"?r:n,s=t==="asc"?1:.45,c=t==="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:i,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:o,opacity:c},children:e.jsx("path",{d:"M0 0 L8 0 L4 5 Z",fill:"currentColor"})})]})},ro=({frozen:t})=>e.jsxs("svg",{width:"11",height:"11",viewBox:"0 0 24 24",fill:t?"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:t?"M7 11V7a5 5 0 0 1 10 0v4":"M7 11V7a5 5 0 0 1 9.9-1"})]}),mt="var(--sa-background-primary, #ffffff)",ir="var(--sa-background-primary-inverse, #f8f8f8)",Tr=({columns:t,records:r,handleDetail:n,handleUpdate:i,handleDelete:o,isLoading:s,visibleHandleDelete:c,visibleHandleUpdate:l,visibleHandleDetail:u,showHeadBorder:a=!1,scrollParentRef:h,frozenCount:m=0,onFrozenCountChange:g,customActions:y,actionsOrder:E=["detail","update","delete","custom"],customEmptyState:j,enableColumnResize:v=!1,defaultColumnWidths:F,onColumnWidthsChange:k,defaultMinColumnWidth:z=60,sort:p,defaultSort:M,onSortChange:L,showActionDivider:S=!1})=>{const _=p!==void 0,[I,P]=x.useState(M??null),W=_?p??null:I,Y=D=>{if(D.sortKey)return D.sortKey;if(typeof D.accessor=="string")return D.accessor},$=D=>{const R=Y(D);if(!R)return;let O;!W||W.key!==R?O={key:R,direction:"asc"}:W.direction==="asc"?O={key:R,direction:"desc"}:O=null,_||P(O),L==null||L(O)},te=[n,i,o].filter(D=>D!==void 0).length,ne=!!y,G=!!n||!!i||!!o||ne,Q="var(--sa-border-subtle, #0b120e24)",se=`1px solid ${Q}`,xe=`inset 1px 0 0 ${Q}`,he=`inset -1px 0 0 ${Q}`,We=te===3?ne?"178px":"140px":te===2?ne?"140px":"102px":te===1?ne?"112px":"74px":ne?"74px":"",qe=(D,R)=>{if(!R)return D;if(typeof R=="function")return R(D);if(typeof R=="string")return D[R]},[dt,Ze]=x.useState(!1);x.useEffect(()=>{if(!(h!=null&&h.current))return;const D=h.current;Ze(D.scrollHeight>D.clientHeight)},[r,h]);const Re=x.useRef(null),[de,Qe]=x.useState([]),[Ae,ke]=x.useState(()=>F??{}),Fe=x.useRef(null);x.useLayoutEffect(()=>{if(!m||!Re.current){Qe([]);return}const D=Array.from(Re.current.querySelectorAll("thead tr th")),R=[];let O=0;D.forEach((A,q)=>{R[q]=O,q<m&&(O+=A.offsetWidth)}),Qe(R)},[m,t,r,Ae]);const Ge=D=>{g&&g(D<m?D:D+1)},C=(D,R)=>{const O=Ae[D];if(O!==void 0){const A=`${O}px`;return{width:A,minWidth:A,maxWidth:A}}return R?{width:R}:{}},H=D=>v&&(D.resizable??!0),V=(D,R)=>{D.preventDefault(),D.stopPropagation();const O=D.currentTarget.closest("th");if(!O)return;const A=Math.round(O.getBoundingClientRect().width);Fe.current={colIndex:R,startX:D.clientX,startWidth:A};const q=document.body.style.userSelect,le=document.body.style.cursor;document.body.style.userSelect="none",document.body.style.cursor="col-resize";const ue=ye=>{var He;const je=Fe.current;if(!je)return;const ut=((He=t[je.colIndex])==null?void 0:He.minWidth)??z,ze=Math.max(ut,je.startWidth+(ye.clientX-je.startX));ke(Ee=>Ee[je.colIndex]===ze?Ee:{...Ee,[je.colIndex]:ze})},Ce=()=>{document.removeEventListener("mousemove",ue),document.removeEventListener("mouseup",Ce),document.body.style.userSelect=q,document.body.style.cursor=le,Fe.current=null,k&&ke(ye=>(k(ye),ye))};document.addEventListener("mousemove",ue),document.addEventListener("mouseup",Ce)};return e.jsx("div",{ref:Re,children:e.jsxs(X.Table,{fullWidth:!0,children:[e.jsx(X.Thead,{style:{height:"40px",whiteSpace:"nowrap"},children:e.jsxs(X.Tr,{children:[t.map((D,R)=>{var It,Ot;const O=m>0&&R<m,A=de[R]??0,q=H(D),ue=R===t.length-1&&G&&S,Ce=Y(D),ye=!!D.sortable&&!!Ce,je=ye&&(W==null?void 0:W.key)===Ce?W.direction:null,ut=D.title||((It=D.accessor)==null?void 0:It.toString())||"",ze=(Ot=D.headerTooltip)!=null&&Ot.showIcon?e.jsx(w.Icon,{name:"InfoCircle",size:"xs",style:{flexShrink:0,color:"var(--sa-icon-subtle, #8c8f97)",opacity:.75}}):null,He=e.jsx("span",{style:{flex:1,minWidth:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:ut}),Ee=ye?e.jsxs("button",{type:"button",onClick:()=>$(D),title:je==="asc"?"Sorted ascending — click to sort descending":je==="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:D.textAlign==="text-right"?"right":D.textAlign==="text-center"?"center":"left"},children:[He,ze,e.jsx(to,{direction:je})]}):e.jsxs("span",{style:{flex:1,minWidth:0,display:"flex",alignItems:"center",gap:4},children:[He,ze]});return e.jsxs(X.Th,{style:{position:"sticky",top:0,left:O?A:void 0,zIndex:O?4:2,paddingLeft:R===0?"12px":"",borderRight:a&&!ue&&!O?se:void 0,borderBottom:a?se:void 0,boxShadow:a&&O?he:void 0,backgroundColor:"var(--sa-background-primary-inverse, #f8f8f8)",textAlign:D.textAlign==="text-right"?"right":D.textAlign==="text-center"?"center":"left",...C(R,D.width)},children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"4px",justifyContent:"space-between",minWidth:0},children:[D.headerTooltip?e.jsx(ae.Tooltip,{label:D.headerTooltip.content,position:"bottom",children:Ee}):Ee,D.filter&&e.jsx(Or,{filter:D.filter,columnTitle:D.title}),g&&e.jsx("button",{onClick:()=>Ge(R),title:O?"Unfreeze column":"Freeze column",style:{background:"none",border:"none",cursor:"pointer",padding:"2px",display:"flex",alignItems:"center",flexShrink:0,color:O?"var(--sa-background-brand, #04254f)":"var(--sa-text-subtle, #8c8f97)",opacity:O?1:.45,transition:"opacity 0.15s"},children:e.jsx(ro,{frozen:O})})]}),q&&e.jsx("div",{onMouseDown:xt=>V(xt,R),onClick:xt=>xt.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}`)}),G?e.jsx(X.Th,{style:{backgroundColor:"var(--sa-background-primary-inverse, #f8f8f8)",position:"sticky",top:0,right:0,zIndex:3,borderBottom:a?se:void 0,boxShadow:a&&S?xe:void 0}}):null]})}),e.jsx(X.Tbody,{children:s?e.jsx(X.Tr,{children:e.jsx(X.Td,{colSpan:t.length+1,children:e.jsxs(f.Box,{direction:"column",style:{gap:"16px"},children:[e.jsx(Se.Skeleton,{variant:"list"}),e.jsx(Se.Skeleton,{variant:"list"}),e.jsx(Se.Skeleton,{variant:"list"}),e.jsx(Se.Skeleton,{variant:"list"}),e.jsx(Se.Skeleton,{variant:"list"})]})})}):!(r!=null&&r.length)&&j?e.jsx(X.Tr,{children:e.jsx(X.Td,{colSpan:t.length+1,children:j})}):r==null?void 0:r.map((D,R)=>e.jsxs(X.Tr,{style:{transition:"background-color 0.3s ease",padding:0,borderBottom:R===r.length-1&&dt?void 0:"1px solid var(--sa-border-subtle, #0b120e24)"},onMouseEnter:O=>{const A=O.currentTarget;A.style.backgroundColor=ir,Array.from(A.querySelectorAll("td")).forEach(q=>{q.style.position==="sticky"&&(q.style.backgroundColor=ir)})},onMouseLeave:O=>{const A=O.currentTarget;A.style.backgroundColor="",Array.from(A.querySelectorAll("td")).forEach(q=>{q.style.position==="sticky"&&(q.style.backgroundColor=mt)})},children:[t.map((O,A)=>{const q=O.render?O.render(D,R,r):qe(D,O.accessor),le=m>0&&A<m,ue=de[A]??0,Ce=Ae[A]!==void 0,ye=le&&A===m-1;return e.jsx(X.Td,{style:{position:le?"sticky":void 0,left:le?ue:void 0,zIndex:le?1:void 0,backgroundColor:le?mt:void 0,transition:le?"background-color 0.3s ease":void 0,paddingLeft:A===0?"12px":"",whiteSpace:"nowrap",overflow:Ce?"hidden":void 0,borderLeft:O.showBorderLeft?se:void 0,borderRight:O.showBorderRight?se:void 0,boxShadow:ye?he:void 0,textAlign:O.textAlign==="text-right"?"right":O.textAlign==="text-center"?"center":"left",...C(A,O.width)},children:typeof q=="string"?e.jsx(b.Text,{style:{whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",textAlign:O.textAlign==="text-right"?"right":O.textAlign==="text-center"?"center":"left"},children:q}):q},`row-${R}-col-${A}`)}),G?e.jsx(X.Td,{style:{width:We,position:"sticky",right:0,zIndex:1,backgroundColor:mt,boxShadow:S?xe:void 0,transition:"background-color 0.3s ease"},children:e.jsx(K.Flex,{direction:"row",align:"center",justify:"center",gap:"sm",children:E.map(O=>{const A=R===r.length-1?"top":"bottom";return O==="detail"&&n&&(u==null?void 0:u(D))!==!1?e.jsx(ae.Tooltip,{label:"Detail",position:A,children:e.jsx(T.Button,{size:"xs",variant:"outline",tone:"neutral",onClick:()=>n(D.id,D),iconLeft:e.jsx(w.Icon,{name:"DocumentClean",size:"sm",style:{color:"var(--sa-text-subtle, #8c8f97)"}})})},"detail"):O==="update"&&i&&(l==null?void 0:l(D))!==!1?e.jsx(ae.Tooltip,{label:"Update",position:A,children:e.jsx(T.Button,{size:"xs",variant:"outline",tone:"neutral",onClick:()=>i(D),iconLeft:e.jsx(w.Icon,{name:"Edit1",size:"sm",style:{color:"var(--sa-text-subtle, #8c8f97)"}})})},"update"):O==="delete"&&o&&(c==null?void 0:c(D))!==!1?e.jsx(ae.Tooltip,{label:"Delete",position:A,children:e.jsx(T.Button,{size:"xs",variant:"outline",tone:"neutral",onClick:()=>o(D.id,D),iconLeft:e.jsx(w.Icon,{name:"Trash1",size:"sm",style:{color:"var(--sa-color-error-600, #c9184a)"}})})},"delete"):O==="custom"?e.jsx(x.Fragment,{children:y==null?void 0:y(D)},"custom"):null})})}):null]},`${D}${R}`))})]})})},no=({wrapperProps:t,dataTableProps:r,headerProps:n,footerProps:i})=>{var m;const o=x.useRef(null),[s,c]=x.useState((r==null?void 0:r.defaultFrozenCount)??0),l=(n==null?void 0:n.show)??!0,u=x.useRef(null),a=(m=r==null?void 0:r.pagination)==null?void 0:m.totalData;typeof a=="number"&&(u.current=a);const h=(i==null?void 0:i.showFooter)??(a===void 0?u.current!==0:a!==0);return e.jsxs(Mr,{...t,children:[l&&e.jsx(Lr,{...n}),e.jsx(f.Box,{direction:"column",ref:o,style:{flex:1,overflowY:"auto",overflowX:"auto"},children:r?e.jsx(Tr,{...r,scrollParentRef:o,frozenCount:r!=null&&r.enableFreezeColumns?s:0,onFrozenCountChange:r!=null&&r.enableFreezeColumns?c:void 0}):null}),h&&e.jsx(Ir,{pagination:r==null?void 0:r.pagination,pageKey:r==null?void 0:r.pageKey,perPageKey:r==null?void 0:r.perPageKey,defaultPerPage:r==null?void 0:r.defaultPerPage,showPagination:r==null?void 0:r.showPagination,totalData:i==null?void 0:i.totalData})]})};function oo(t){return x.memo(t)}const io=oo(no),gt=t=>t==="right"?"right":t==="center"?"center":"left",so=(t,r)=>{if(r)return t[r]},lo=(t,r)=>t.key??(typeof t.accessor=="string"?t.accessor:`col-${r}`),co=({columns:t,data:r,getRowKey:n,size:i="md",resizable:o=!1,widthStorageKey:s,columnState:c,height:l,emptyState:u})=>{const a=x.useMemo(()=>{const I=t.map(($,J)=>({col:$,key:lo($,J)}));if(!c)return I;const P=new Set(c.hidden??[]);let W=I.filter($=>!P.has($.key));const Y=c.order;if(Y!=null&&Y.length){const $=new Map(Y.map((J,te)=>[J,te]));W=[...W].sort((J,te)=>($.get(J.key)??1/0)-($.get(te.key)??1/0))}return W},[t,c]),h=a.map(I=>I.key).join("|"),m=!!s,[g,y]=X.useColumnWidths(s??""),E=m?g:void 0,j=x.useRef(null),[v,F]=x.useState();x.useLayoutEffect(()=>{F(void 0)},[h]),x.useLayoutEffect(()=>{if(v||!j.current)return;const I=j.current.querySelectorAll(":scope > tr:first-child > th");F(Array.from(I).map(P=>P.offsetWidth))},[v]);const k=(I,P)=>v?(E==null?void 0:E[P])??I.width:I.width,z=(I,P)=>typeof I.width=="number"?I.width:v==null?void 0:v[P],p=x.useRef(null),[M,L]=x.useState("100vh");x.useLayoutEffect(()=>{if(l!==void 0)return;const I=()=>{if(p.current){const P=p.current.getBoundingClientRect().top;L(`calc(100vh - ${P}px)`)}};return I(),window.addEventListener("resize",I),()=>window.removeEventListener("resize",I)},[l]);const S={position:"sticky",top:0,zIndex:2,backgroundColor:"var(--sa-background-neutral, #f0f1f2)"},_=e.jsxs(X.Table,{fullWidth:!0,size:i,resizable:o,onWidthsChange:m?y:void 0,children:[e.jsx(X.Thead,{ref:j,children:e.jsx(X.Tr,{children:a.map(({col:I,key:P},W)=>e.jsx(X.Th,{minWidth:I.minWidth,resizable:I.resizable,defaultWidth:z(I,W),style:{textAlign:gt(I.align),width:k(I,W),...S},children:I.title},`dg-head-${P}`))})}),e.jsx(X.Tbody,{children:r.length===0?e.jsx(X.Tr,{children:e.jsx(X.Td,{colSpan:a.length,children:u})}):r.map((I,P)=>e.jsx(X.Tr,{children:a.map(({col:W,key:Y},$)=>{const J=W.render?W.render(I,P,r):so(I,W.accessor);return e.jsx(X.Td,{style:{textAlign:gt(W.align),width:k(W,$),minWidth:W.minWidth},children:typeof J=="string"?e.jsx(b.Text,{style:{whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",textAlign:gt(W.align)},children:J}):J},`dg-cell-${P}-${Y}`)})},n?n(I,P):P))})]});return e.jsx(f.Box,{ref:p,fullWidth:!0,style:{overflow:"auto",height:l??M},children:_})},it=({of:t,render:r})=>x.Children.toArray(t==null?void 0:t.map((n,i,o)=>r(n,i,o))),U=({condition:t,fallback:r,children:n,loading:i,isLoading:o})=>e.jsx(e.Fragment,{children:o?i:t?n:r}),ee=t=>e.jsx(b.Text,{...t,fontFamily:"Poppins",fontSize:t.fontSize||"md",fontWeight:t.fontWeight||"medium",color:t.color||"gray-700",children:t.children}),be=t=>e.jsx(b.Text,{color:"red-600",fontSize:"sm",children:t.message}),ao=({size:t="md",direction:r="vertical",requiredTitle:n="(Required)",fullWidth:i=!1,...o})=>{var l,u,a;const s=o.hideMessageError||!1,c=r==="horizontal"?t==="sm"?342:t==="lg"?400:342:void 0;return e.jsxs(f.Box,{gap:r==="horizontal"?"spacing-96":"sm",direction:r==="horizontal"?"row":"column",...o.containerProps,children:[o.title&&e.jsx(U,{condition:!!o.inputProps.required,fallback:e.jsxs(f.Box,{direction:"column",customMaxWidth:c,fullWidth:i,children:[e.jsx(ee,{children:o.title}),e.jsx(b.Text,{fontSize:t,color:"gray-500",children:o.description})]}),children:e.jsxs(f.Box,{direction:"column",customMaxWidth:c,fullWidth:i,children:[e.jsxs(K.Flex,{direction:"row",gap:"xs",align:"center",children:[e.jsx(ee,{fontSize:t,children:o.title}),e.jsx(ee,{color:"error",fontSize:t,children:n}),e.jsx(U,{condition:!!((l=o.tooltip)!=null&&l.label),children:e.jsx(ae.Tooltip,{label:(u=o.tooltip)==null?void 0:u.label,arrowPosition:(a=o.tooltip)==null?void 0:a.arrowPosition,...o.tooltip,children:e.jsx(w.Icon,{name:"InfoCircle",size:t==="lg"?"sm":"xs",style:{color:"var(--sa-color-info-500, #00abeb)",marginTop:"6px"}})})})]}),e.jsx(U,{condition:!!o.description,children:e.jsx(b.Text,{fontSize:t,color:"gray-500",children:o.description})})]})}),e.jsxs(f.Box,{direction:"column",gap:"xs",fullWidth:o.inputProps.fullWidth||!1,children:[e.jsx(De.Input,{ref:o.inputRef,size:t,...o.inputProps,status:o.errorMessage?"error":"default",fullWidth:!0}),!s&&o.errorMessage&&e.jsx(be,{message:o.errorMessage}),o.inputProps.extended&&o.inputProps.extended]})]})},uo=({size:t="md",direction:r="vertical",requiredTitle:n="(Required)",fullWidth:i=!1,...o})=>{var l,u,a;const s=o.hideMessageError||!1,c=r==="horizontal"?t==="sm"?342:t==="lg"?400:342:void 0;return e.jsxs(f.Box,{gap:r==="horizontal"?"spacing-96":"sm",direction:r==="horizontal"?"row":"column",onClick:o.onClickContainer,children:[o.title&&e.jsx(U,{condition:!!o.inputProps.required,fallback:e.jsxs(f.Box,{direction:"column",customMaxWidth:c,fullWidth:i,children:[e.jsx(ee,{children:o.title}),e.jsx(b.Text,{fontSize:t,color:"gray-500",children:o.description})]}),children:e.jsxs(f.Box,{direction:"column",customMaxWidth:c,fullWidth:i,children:[e.jsxs(K.Flex,{direction:"row",gap:"xs",align:"center",children:[e.jsx(ee,{fontSize:t,children:o.title}),e.jsx(ee,{color:"error",fontSize:t,children:n}),e.jsx(U,{condition:!!((l=o.tooltip)!=null&&l.label),children:e.jsx(ae.Tooltip,{label:(u=o.tooltip)==null?void 0:u.label,arrowPosition:(a=o.tooltip)==null?void 0:a.arrowPosition,...o.tooltip,children:e.jsx(w.Icon,{name:"InfoCircle",size:t==="lg"?"sm":"xs",style:{color:"var(--sa-color-info-500, #00abeb)",marginTop:"6px"}})})})]}),e.jsx(U,{condition:!!o.description,children:e.jsx(b.Text,{fontSize:t,color:"gray-500",children:o.description})})]})}),e.jsxs(f.Box,{direction:"column",gap:"xs",fullWidth:o.inputProps.fullWidth||!1,children:[e.jsx(f.Box,{direction:"column",style:{width:o.inputProps.fullWidth?"100%":r==="horizontal"&&o.customWidth?o.customWidth:r==="horizontal"?"343px":""},children:e.jsx(Ie.Dropdown,{size:t,...o.inputProps,error:!!o.errorMessage})}),!s&&o.errorMessage&&e.jsx(be,{message:o.errorMessage}),o.inputProps.extended&&o.inputProps.extended]})]})},xo=(t,r)=>typeof t=="string"&&t||r==="error"?"var(--sa-border-danger)":"var(--sa-border-subtle)",ho=t=>{var l;const[r,n]=x.useState(!1),i=u=>{u.preventDefault(),u.stopPropagation()},o=u=>{u.preventDefault(),u.stopPropagation(),u.dataTransfer&&t.handleOnFileChange(u.dataTransfer.files.item(0))},s=u=>{u.preventDefault(),n(!0)},c=u=>{u.preventDefault(),n(!1)};return e.jsxs(f.Box,{width:"width-full",paddingInline:"md",direction:"row",gap:"sm",align:"center",onClick:t.handleOnClick,onDragOver:i,onDrop:o,onDragEnter:s,onDragLeave:c,paddingBlock:"md",borderRadius:"rounded-md",style:{border:r?"1px solid var(--sa-border-info)":`1px solid ${xo(t.errorMessage,t.status)}`},children:[e.jsx(w.Icon,{name:"Upload",size:"lg",style:{width:30,height:30}}),e.jsxs(K.Flex,{direction:"column",gap:"xs",children:[e.jsxs(K.Flex,{direction:"row",gap:"xs",children:[e.jsx(b.Text,{fontWeight:"medium",color:"gray-500",style:{textWrap:"nowrap"},fontSize:t.isDesktop?"md":"sm",children:"Click your upload"}),e.jsx(b.Text,{fontWeight:"medium",style:{textWrap:"nowrap"},fontSize:t.isDesktop?"md":"sm",children:"or Drag & Drop"})]}),e.jsx(b.Text,{fontSize:"sm",color:"gray-500",children:(l=t.fileSupports)==null?void 0:l.map(u=>u.toLocaleUpperCase()).join(", ")})]})]})};function fo(t){return t.split(" ").map(r=>r[0]).join("").slice(0,2).toUpperCase()}const Wr=t=>{const r={day:"2-digit",month:"short",year:"numeric"};return t.toLocaleDateString("id-ID",r)},mo=t=>{const r={Jan:0,Feb:1,Mar:2,Apr:3,Mei:4,Jun:5,Jul:6,Agu:7,Sep:8,Okt:9,Nov:10,Des:11},n=t.split(" ");if(n.length!==3)return null;const i=parseInt(n[0],10),o=r[n[1]],s=parseInt(n[2],10);return isNaN(i)||isNaN(o)||isNaN(s)?null:new Date(s,o,i)};function go(t,r=!0){if(!t)return"Rp 0";const n=typeof t=="number"?t.toString():t;if(isNaN(Number(n)))return"Rp 0";const i=n.split("."),o=i[0].replace(/\B(?=(\d{3})+(?!\d))/g,"."),s=i.length===2?o+"."+i[1]:o;return r?"Rp"+s:s}String.prototype.toTitleCase=function(){return this.toLowerCase().split(" ").map(t=>t.charAt(0).toUpperCase()+t.slice(1)).join(" ")};String.prototype.toNumber=function(){return Number(this)};const jo=t=>{const r=t.split(" ");let n=r[0].charAt(0);return r.length>1&&(n+=""+r[1].charAt(0)),n.toUpperCase()};function yo(t){const r=typeof t=="string"?new Date(t):t;if(isNaN(r.getTime()))throw new Error("Invalid date format");const n=r.getFullYear(),i=String(r.getMonth()+1).padStart(2,"0"),o=String(r.getDate()).padStart(2,"0");return`${n}-${i}-${o}`}const po="sa-admin",ge=t=>`var(--${po}-${t})`,bo={base:{borderColor:ge("base-border-color"),textColor:ge("base-text-color"),iconColor:ge("base-icon-color"),placeholderColor:ge("base-placeholder-color")},document:{bgColor:ge("document-bg-color")},sidebar:{bgColor:ge("sidebar-bg-color"),borderColor:ge("sidebar-border-color"),maxWidth:ge("sidebar-max-width"),width:ge("sidebar-width"),collapseWidth:ge("sidebar-collapse-width"),collapseV2Width:ge("sidebar-v2-collapse-width")}},Co=24*60*60*1e3,vo=t=>{const r="14px poppins",i=document.createElement("canvas").getContext("2d");i.font=r;const o=i.measureText(t).width;return Number(Math.ceil(o))},Do=/^[^\s@]+@[^\s@]+\.[^\s@]+$/,wo=/--+/,So=/-$/;function Bo(t,r){return JSON.stringify(t)!==JSON.stringify(r)}function ko(t){return/^(?:\+62|62|0)8[1-9][0-9]{7,10}$/.test(t)}function Fo(t){return/^[A-Za-z\s]+$/.test(t)}const Eo=t=>{const r=/^[0-9]$/,n=["ArrowLeft","ArrowRight","ArrowUp","ArrowDown","Backspace","Delete","Enter","Tab"];(t.ctrlKey||t.metaKey)&&(t.key==="a"||t.key==="c"||t.key==="v")||!r.test(t.key)&&!n.includes(t.key)&&t.preventDefault()},Mo=t=>{const r=/^[0-9]$/,n=["ArrowLeft","ArrowRight","ArrowUp","ArrowDown","Backspace","Delete","Enter","Tab"];(t.ctrlKey||t.metaKey)&&t.key==="v"||r.test(t.key)&&!n.includes(t.key)&&t.preventDefault()},Lo=t=>{const r=/^[0-9.]$/,n=["ArrowLeft","ArrowRight","ArrowUp","ArrowDown","Backspace","Delete","Enter","Tab"];(t.ctrlKey||t.metaKey)&&t.key==="v"||!r.test(t.key)&&!n.includes(t.key)&&t.preventDefault()},Io=t=>Do.test(t);function Oo(t){return!(wo.test(t)||So.test(t))}const To=t=>{const r=["ArrowLeft","ArrowRight","ArrowUp","ArrowDown","Backspace","Delete","Enter","Tab","Home","End"];if((t.ctrlKey||t.metaKey)&&["a","c","v","x"].includes(t.key.toLowerCase()))return;const n=t.currentTarget.value;/^[0-9]$/.test(t.key)||t.key==="."&&!n.includes(".")||t.key==="-"&&n.length===0&&!n.includes("-")||r.includes(t.key)||t.preventDefault()},Wo=t=>{const r=document.getElementById(t);if(r){const n=r.getBoundingClientRect(),i=window.scrollY+n.top-80;window.scrollTo({top:i,behavior:"smooth"})}};function Ro(t){const r=t.toLowerCase();if(["kb","mb","gb"].find(s=>r.endsWith(s)))return t;const o=Number(t);if(isNaN(o))throw new Error("Invalid size format");return o>=1e6?`${(o/1e6).toFixed(2)}MB`:o>=1e3?`${(o/1e3).toFixed(2)}KB`:`${o}B`}function Ao(t){const r=t.split("/");return r[r.length-1]}const zo=t=>{var r,n;return e.jsxs(f.Box,{width:"width-full",paddingInline:"md",height:"height-full",direction:"row",justify:"space-between",align:"center",onClick:t.handleOnClickFile,fullHeight:!0,paddingBlock:"md",id:"file-item",borderRadius:"rounded-md",style:{border:"1px solid var(--sa-border-subtle)",cursor:"pointer"},children:[e.jsxs(K.Flex,{direction:"row",align:"center",gap:"sm",style:{flex:1,minWidth:0},children:[e.jsx(w.Icon,{name:"DocumentFilled",size:"lg",style:{color:"var(--sa-icon-brand)",width:30,height:30,flexShrink:0}}),e.jsxs(K.Flex,{direction:"column",style:{minWidth:0,flex:1},children:[e.jsx(b.Text,{fontWeight:"bold",style:{textOverflow:"ellipsis",whiteSpace:"nowrap",overflow:"hidden"},children:t.defaultFile?Ao(t.defaultFile.url):(r=t.fileSelected)==null?void 0:r.name}),t.defaultFile?(t.defaultFile.size||t.defaultFile.date)&&e.jsxs(K.Flex,{direction:"row",gap:"xs",align:"center",children:[t.defaultFile.size&&e.jsx(b.Text,{fontSize:"sm",fontWeight:"medium",children:t.defaultFile.size}),t.defaultFile.size&&t.defaultFile.date&&e.jsx(w.Icon,{name:"Dot",size:"xs"}),t.defaultFile.date&&e.jsx(b.Text,{fontSize:"sm",fontWeight:"medium",style:{textWrap:"nowrap"},children:t.defaultFile.date})]}):e.jsxs(K.Flex,{direction:"row",gap:"xs",align:"center",children:[e.jsx(b.Text,{fontSize:"sm",fontWeight:"medium",children:Ro(((n=t.fileSelected)==null?void 0:n.size.toString())||"100000")}),e.jsx(w.Icon,{name:"Dot",size:"xs"}),e.jsx(b.Text,{fontSize:"sm",fontWeight:"medium",style:{textWrap:"nowrap"},children:Wr(new Date)})]})]})]}),e.jsx(T.Button,{size:"xs",variant:"tertiary",tone:"error",type:"button",onClick:i=>{i.stopPropagation(),t.handleOnDeleteFile()},iconLeft:e.jsx(w.Icon,{name:"Trash1"})})]})},Rr=({status:t="default",labelPosition:r="outside-top",...n})=>{var g;const i=x.useRef(null),o=()=>{if(n.defaultFile){window.open(n.defaultFile.url);return}i.current&&i.current.click()},s=ie.useMediaQuery("md"),c=t==="error"||typeof n.errorMessage=="string"&&!!n.errorMessage,l=n.label?e.jsxs(K.Flex,{direction:"row",align:"center",gap:"xs",children:[e.jsx(b.Text,{style:{fontSize:"14px",fontWeight:500,color:"var(--sa-text-primary)"},children:n.label}),n.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"}),n.required&&e.jsx("span",{style:{fontSize:"14px",fontWeight:500,color:"var(--sa-text-error)"},children:"*"})]}):null,u=n.description?e.jsx(b.Text,{style:{fontSize:"12px",fontWeight:400,color:"var(--sa-text-subtlest, #6b6e76)",lineHeight:"18px"},children:n.description}):null,a=e.jsxs(e.Fragment,{children:[n.helperText&&e.jsx(b.Text,{style:{fontSize:"12px",fontWeight:400,color:"var(--sa-text-subtlest, #6b6e76)",lineHeight:"18px"},children:n.helperText}),n.errorText&&t==="error"&&e.jsx(b.Text,{style:{fontSize:"12px",fontWeight:400,color:"var(--sa-text-error, #a4133c)",lineHeight:"18px"},children:n.errorText}),n.errorMessage&&!n.errorText&&e.jsx(b.Text,{style:{fontSize:"12px",fontWeight:400,color:"var(--sa-text-error, #a4133c)",lineHeight:"18px"},children:n.errorMessage})]}),h=e.jsx("input",{type:"file",style:{display:"none"},ref:i,onChange:y=>{var E;return n.handleOnChangeFile(((E=y.target.files)==null?void 0:E.item(0))||null)},accept:(g=n.fileSupportOption)==null?void 0:g.map(y=>"."+(y==null?void 0:y.toLowerCase())).join(", ")}),m=e.jsxs(f.Box,{direction:"column",fullWidth:!0,style:{minHeight:"69px"},borderRadius:"rounded-md",display:"flex",justify:"center",align:"center",cursor:"pointer",gap:"md",...n.containerProps,children:[h,(n.fileSelected||n.defaultFile)&&e.jsx(zo,{fileSelected:n.fileSelected,defaultFile:n.defaultFile,handleOnDeleteFile:n.handleOnDeleteFile,handleOnClickFile:o}),!n.fileSelected&&!n.defaultFile&&e.jsx(ho,{fileSupports:n.fileSupportOption,isDesktop:s,errorMessage:c?n.errorText||n.errorMessage||" ":void 0,status:c?"error":"default",handleOnClick:o,handleOnFileChange:n.handleOnChangeFile})]});return r==="outside-left"?e.jsxs(K.Flex,{direction:"row",align:"flex-start",gap:"sm",style:{width:"100%"},children:[e.jsxs(K.Flex,{direction:"column",gap:"xs",style:{width:"40%",minWidth:"120px",paddingTop:"10px"},children:[l,u]}),e.jsxs(K.Flex,{direction:"column",gap:"sm",style:{flex:1,minWidth:0},children:[m,a]})]}):e.jsxs(K.Flex,{direction:"column",gap:"sm",style:{width:"100%"},children:[l,u,m,a]})},Ho=({size:t="md",direction:r="vertical",requiredTitle:n="(Required)",fullWidth:i=!1,...o})=>{var l,u,a;const s=o.hideMessageError||!1,c=r==="horizontal"?t==="sm"?342:t==="lg"?400:342:void 0;return e.jsxs(f.Box,{gap:r==="horizontal"?"spacing-96":"sm",direction:r==="horizontal"?"row":"column",...o.containerProps,children:[o.title&&e.jsx(U,{condition:!!o.inputProps.required,fallback:e.jsxs(f.Box,{direction:"column",customMaxWidth:c,fullWidth:i,children:[e.jsx(ee,{children:o.title}),e.jsx(b.Text,{fontSize:t,color:"gray-500",children:o.description})]}),children:e.jsxs(f.Box,{direction:"column",customMaxWidth:c,fullWidth:i,children:[e.jsxs(K.Flex,{direction:"row",gap:"xs",align:"center",children:[e.jsx(ee,{fontSize:t,children:o.title}),e.jsx(ee,{color:"error",fontSize:t,children:n}),e.jsx(U,{condition:!!((l=o.tooltip)!=null&&l.label),children:e.jsx(ae.Tooltip,{label:(u=o.tooltip)==null?void 0:u.label,arrowPosition:(a=o.tooltip)==null?void 0:a.arrowPosition,...o.tooltip,children:e.jsx(w.Icon,{name:"InfoCircle",size:t==="lg"?"sm":"xs",style:{color:"var(--sa-color-info-500, #00abeb)",marginTop:"6px"}})})})]}),e.jsx(U,{condition:!!o.description,children:e.jsx(b.Text,{fontSize:t,color:"gray-500",children:o.description})})]})}),e.jsxs(K.Flex,{direction:"column",gap:"xs",children:[e.jsx(Rr,{...o.inputProps,status:o.errorMessage?"error":"default"}),!s&&o.errorMessage&&e.jsx(be,{message:o.errorMessage})]})]})},Vo=({size:t="md",direction:r="vertical",requiredTitle:n="(Required)",fullWidth:i=!1,required:o=!1,...s})=>{var u,a,h,m;const c=s.hideMessageError||!1,l=r==="horizontal"?t==="sm"?342:t==="lg"?400:342:void 0;return e.jsxs(f.Box,{gap:r==="horizontal"||r==="horizontal-inline"?"spacing-96":"sm",direction:r==="horizontal"||r==="horizontal-inline"?"row":"column",...s.containerProps,children:[s.title&&e.jsx(U,{condition:!!o,fallback:e.jsxs(f.Box,{direction:"column",customMaxWidth:l,fullWidth:i,children:[e.jsx(ee,{children:s.title}),e.jsx(me.Body3,{props:{color:"gray-500"},children:s.description})]}),children:e.jsxs(f.Box,{direction:"column",customMaxWidth:l,fullWidth:i,children:[e.jsxs(K.Flex,{direction:"row",gap:"xs",align:"center",children:[e.jsx(ee,{fontSize:t,children:s.title}),e.jsx(ee,{color:"error",fontSize:t,children:n}),e.jsx(U,{condition:!!((u=s.tooltip)!=null&&u.label),children:e.jsx(ae.Tooltip,{label:(a=s.tooltip)==null?void 0:a.label,arrowPosition:(h=s.tooltip)==null?void 0:h.arrowPosition,...s.tooltip,children:e.jsx(w.Icon,{name:"InfoCircle",size:t==="lg"?"sm":"xs",style:{color:"var(--sa-color-info-500, #00abeb)",marginTop:"6px"}})})})]}),e.jsx(U,{condition:!!s.description,children:e.jsx(b.Text,{fontSize:t,color:"gray-500",children:s.description})})]})}),e.jsx(f.Box,{gap:r==="horizontal-inline"?"xl":"md",direction:r==="horizontal-inline"?"row":"column",align:"flex-start",children:e.jsx(it,{of:(m=s.checkBoxesList)==null?void 0:m.map(g=>({...g,isChecked:s.checkBoxesAreChecked.includes(g.id)})),render:g=>g.renderBadge?e.jsxs(f.Box,{direction:"row",justify:"space-between",gap:"lg",...s.badgeContainerProps,children:[e.jsx(Te.Checkbox,{name:g.name,value:g.id,checked:g.isChecked,onChange:y=>s.onChecked(y.target.value,g),label:g.name,description:g.description}),g.renderBadge]}):e.jsx(Te.Checkbox,{name:g.name,value:g.id,checked:g.isChecked,onChange:y=>s.onChecked(y.target.value,g),label:g.name,description:g.description})})}),!c&&s.errorMessage&&e.jsx(be,{message:s.errorMessage})]})},No=({position:t="vertical",size:r="md",fullWidth:n=!1,...i})=>{var s;const o=t==="horizontal-inline"||t==="horizontal-block"?r==="sm"?342:r==="lg"?400:342:void 0;return e.jsxs(f.Box,{gap:t==="horizontal-inline"||t==="horizontal-block"?"spacing-96":"sm",direction:t==="horizontal-inline"||t==="horizontal-block"?"row":"column",children:[e.jsx(U,{condition:!!i.description||!!i.title,children:e.jsxs(f.Box,{direction:"column",customMaxWidth:o,fullWidth:n,children:[i.title&&e.jsx(ee,{children:i.title}),e.jsx(U,{condition:!!i.description,children:e.jsx(b.Text,{color:"gray-500",children:i.description})})]})}),e.jsx(f.Box,{gap:"sm",direction:t==="horizontal"||t==="horizontal-inline"?"row":"column",align:"flex-start",flexWrap:"wrap",children:e.jsx(it,{of:(s=i.radioList)==null?void 0:s.map(c=>({...c,isChecked:i.radioIsChecked===c.id})),render:({value:c,id:l,isChecked:u,subInput:a,label:h,description:m})=>e.jsxs(f.Box,{direction:"column",gap:"xs",customMaxWidth:o,children:[e.jsx(bt.Radio,{id:`${l.toString()}-${c}`,name:i.groupName||h,label:h,value:c,checked:u,onChange:g=>i.onChecked({id:l,label:g.target.name,value:g.target.value}),disabled:i.disableAll},l),m&&e.jsx(b.Text,{color:"gray-500",style:{marginLeft:28},children:m}),a]})})}),i.errorMessage&&e.jsx(be,{message:i.errorMessage})]})},Po=({size:t="md",direction:r="vertical",requiredTitle:n="(Required)",fullWidth:i=!1,...o})=>{var l,u,a;const s=o.hideMessageError||!1,c=r==="horizontal"?t==="sm"?342:t==="lg"?400:342:void 0;return e.jsxs(f.Box,{gap:r==="horizontal"?"spacing-96":"sm",direction:r==="horizontal"?"row":"column",...o.containerProps,children:[o.title&&e.jsx(U,{condition:!!o.inputProps.required,fallback:e.jsxs(f.Box,{direction:"column",customMaxWidth:c,fullWidth:i,children:[e.jsx(ee,{children:o.title}),e.jsx(b.Text,{fontSize:t,color:"gray-500",children:o.description})]}),children:e.jsxs(f.Box,{direction:"column",customMaxWidth:c,fullWidth:i,children:[e.jsxs(K.Flex,{direction:"row",gap:"xs",align:"center",children:[e.jsx(ee,{fontSize:t,children:o.title}),e.jsx(ee,{color:"error",fontSize:t,children:n}),e.jsx(U,{condition:!!((l=o.tooltip)!=null&&l.label),children:e.jsx(ae.Tooltip,{label:(u=o.tooltip)==null?void 0:u.label,arrowPosition:(a=o.tooltip)==null?void 0:a.arrowPosition,...o.tooltip,children:e.jsx(w.Icon,{name:"InfoCircle",size:t==="lg"?"sm":"xs",style:{color:"var(--sa-color-info-500, #00abeb)",marginTop:"6px"}})})})]}),e.jsx(U,{condition:!!o.description,children:e.jsx(b.Text,{fontSize:t,color:"gray-500",children:o.description})})]})}),e.jsxs(K.Flex,{direction:"column",gap:"xs",children:[e.jsx(pt.Textarea,{ref:o.inputRef,size:t,...o.inputProps,status:o.errorMessage?"error":"default"}),!s&&o.errorMessage&&e.jsx(be,{message:o.errorMessage})]})]})},_o=({size:t="md",direction:r="vertical",requiredTitle:n="(Required)",required:i=!1,fullWidth:o=!1,...s})=>{var l,u,a;const c=r==="horizontal"?t==="sm"?342:t==="lg"?400:342:void 0;return e.jsxs(f.Box,{gap:r==="horizontal"?"spacing-96":"sm",direction:r==="horizontal"?"row":"column",...s.containerProps,children:[s.title&&e.jsx(U,{condition:i,fallback:e.jsxs(f.Box,{direction:"column",customMaxWidth:c,fullWidth:o,children:[e.jsx(ee,{children:s.title}),e.jsx(b.Text,{fontSize:t,color:"gray-500",children:s.titleDescription})]}),children:e.jsxs(f.Box,{direction:"column",customMaxWidth:c,fullWidth:o,children:[e.jsxs(K.Flex,{direction:"row",gap:"xs",align:"center",children:[e.jsx(ee,{fontSize:t,children:s.title}),e.jsx(ee,{color:"error",fontSize:t,children:n}),e.jsx(U,{condition:!!((l=s.tooltip)!=null&&l.label),children:e.jsx(ae.Tooltip,{label:(u=s.tooltip)==null?void 0:u.label,arrowPosition:(a=s.tooltip)==null?void 0:a.arrowPosition,...s.tooltip,children:e.jsx(w.Icon,{name:"InfoCircle",size:t==="lg"?"sm":"xs",style:{color:"var(--sa-color-info-500, #00abeb)",marginTop:"6px"}})})})]}),e.jsx(U,{condition:!!s.titleDescription,children:e.jsx(b.Text,{fontSize:t,color:"gray-500",children:s.titleDescription})})]})}),e.jsx(Ne.Toggle,{checked:s.checked,onChange:s.onChange,label:s.label,description:s.description}),s.errorMessage&&e.jsx(be,{message:s.errorMessage})]})},qo=({variant:t="primary",size:r="md",...n})=>{const i=Le.useColor(),o=c=>{var u,a,h,m,g,y;if(!c)return;const l=n.disabled?"var(--sa-text-disable, #181a198f)":t==="secondary"?"var(--sa-text-subtle, #8c8f97)":t==="secondary-danger"?(a=(u=i==null?void 0:i.computed)==null?void 0:u.red)==null?void 0:a[600]:t==="secondary-primary"?(m=(h=i==null?void 0:i.computed)==null?void 0:h.blue)==null?void 0:m[700]:(y=(g=i==null?void 0:i.computed)==null?void 0:g.gray)==null?void 0:y[50];return e.jsx(w.Icon,{name:c,size:r,style:{color:l}})},s=()=>{var l,u,a,h;if(t!=="secondary-danger"&&t!=="secondary-primary")return n.title;const c={color:n.disabled?"var(--sa-text-disable, #181a198f)":t==="secondary-danger"?(u=(l=i==null?void 0:i.computed)==null?void 0:l.red)==null?void 0:u[600]:(h=(a=i==null?void 0:i.computed)==null?void 0:a.blue)==null?void 0:h[700]};switch(r){case"xs":return e.jsx(me.Body2,{props:{style:c},children:n.title});case"sm":case"md":return e.jsx(me.SubH3,{props:{style:c},children:n.title});case"lg":return e.jsx(me.SubH2,{props:{style:c},children:n.title});default:return n.title}};return e.jsx(T.Button,{fullWidth:!0,disabled:n.disabled,primary:t==="primary",secondary:t==="secondary"||t==="secondary-danger"||t==="secondary-primary",success:t==="success",onClick:n.onClick,type:n.type,iconLeft:o(n.iconLeft),iconRight:o(n.iconRight),size:r,children:s()})},Zo=t=>e.jsx(me.H5,{props:{...t},children:t.title}),Qo=({size:t="md",direction:r="vertical",requiredTitle:n="(Required)",fullWidth:i=!1,...o})=>{var l,u,a;const s=o.hideMessageError||!1,c=r==="horizontal"?t==="sm"?342:t==="lg"?400:342:void 0;return e.jsxs(f.Box,{gap:r==="horizontal"?"spacing-96":"sm",direction:r==="horizontal"?"row":"column",onClick:o.onClickContainer,children:[o.title&&e.jsx(U,{condition:!!o.inputProps.required,fallback:e.jsxs(f.Box,{direction:"column",customMaxWidth:c,fullWidth:i,children:[e.jsx(ee,{children:o.title}),e.jsx(b.Text,{fontSize:t,color:"gray-500",children:o.description})]}),children:e.jsxs(f.Box,{direction:"column",customMaxWidth:c,fullWidth:i,children:[e.jsxs(K.Flex,{direction:"row",gap:"xs",align:"center",children:[e.jsx(ee,{fontSize:t,children:o.title}),e.jsx(ee,{color:"error",fontSize:t,children:n}),e.jsx(U,{condition:!!((l=o.tooltip)!=null&&l.label),children:e.jsx(ae.Tooltip,{label:(u=o.tooltip)==null?void 0:u.label,arrowPosition:(a=o.tooltip)==null?void 0:a.arrowPosition,...o.tooltip,children:e.jsx(w.Icon,{name:"InfoCircle",size:t==="lg"?"sm":"xs",style:{color:"var(--sa-color-info-500, #00abeb)",marginTop:"6px"}})})})]}),e.jsx(U,{condition:!!o.description,children:e.jsx(b.Text,{fontSize:t,color:"gray-500",children:o.description})})]})}),e.jsxs(K.Flex,{direction:"column",gap:"xs",children:[e.jsx(f.Box,{direction:"column",style:{width:r==="horizontal"&&o.customWidth?o.customWidth:r==="horizontal"?"343px":""},children:e.jsx(Be.StarasiaDate,{size:t,...o.inputProps,status:o.errorMessage?"error":void 0})}),!s&&o.errorMessage&&e.jsx(be,{message:o.errorMessage})]})]})};async function Go(t,r){const n=new Image;n.src=t,await new Promise((s,c)=>{n.onload=s,n.onerror=c});const i=document.createElement("canvas");i.width=r.width,i.height=r.height;const o=i.getContext("2d",{alpha:!0});if(!o)throw new Error("No 2D context");return o.drawImage(n,r.x,r.y,r.width,r.height,0,0,r.width,r.height),new Promise((s,c)=>{i.toBlob(l=>{if(!l)return c("Canvas is empty");const u=new File([l],"cropped.png",{type:"image/png"});s(u)},"image/png")})}const sr={"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},Ar=x.forwardRef(({handleUpload:t,urlImage:r,isUploading:n,croppedImage:i,setCroppedImage:o,size:s="96",aspect:c="1:1",containerProps:l,maxFileSize:u=2,onError:a},h)=>{const m=ie.useMediaQuery("md"),[g,y]=x.useState(!1),[E,j]=x.useState(null),[v,F]=x.useState(!1),[k,z]=x.useState({x:0,y:0}),[p,M]=x.useState(1),[L,S]=x.useState(null);x.useEffect(()=>{r===null&&o(null)},[r]);const _=x.useCallback((G,Q)=>{S(Q)},[]),I=G=>{var xe;const Q=(xe=G.target.files)==null?void 0:xe[0];if(!Q)return;const se=new FileReader;se.onload=()=>{j(se.result),F(!0)},se.readAsDataURL(Q)},P=async()=>{if(!(!E||!L))try{const G=await Go(E,L);if(u&&G.size>u*1024*1024){a==null||a(`Ukuran file maksimal ${u}MB`);return}t==null||t(G);const Q=URL.createObjectURL(G);o(Q,G),F(!1)}catch{a==null||a("Gagal memproses gambar")}},W=x.useRef(null),Y=()=>{W.current&&W.current.click()};x.useImperativeHandle(h,()=>({openFileDialog:()=>{var G;(G=W.current)==null||G.click()}}));const $=parseInt(s,10),J=sr[c];let te,ne;return J>=1?(ne=$,te=$*J):(te=$,ne=$/J),e.jsxs(f.Box,{direction:"column",display:"flex",position:"relative",bg:(l==null?void 0:l.bg)||"gray-200",borderStyle:(l==null?void 0:l.borderStyle)||"border-none",borderColor:(l==null?void 0:l.borderColor)||"gray-200",borderWidth:(l==null?void 0:l.borderWidth)||"border-2",borderRadius:(l==null?void 0:l.borderRadius)||"rounded-md",overflow:"overflow-hidden",align:"center",justify:"center",style:{width:l!=null&&l.fullWidth?"100%":`${te}px`,height:l!=null&&l.fullWidth?"auto":`${ne}px`,aspectRatio:J,flexShrink:0},onMouseEnter:()=>y(!0),onMouseLeave:()=>y(!1),children:[i||r?e.jsx("img",{src:i||r||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(w.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:g?1:0,transition:"opacity 0.3s ease-in-out"},onClick:Y,children:[e.jsx("input",{ref:W,type:"file",accept:"image/*",onChange:I,disabled:n,style:{display:"none"}}),e.jsxs(f.Box,{display:"flex",align:"center",gap:"spacing-2",direction:"row",children:[e.jsx(w.Icon,{name:"Edit3",style:{color:"var(--sa-background-primary, #ffffff)"}}),e.jsx(U,{condition:s.toNumber()>80,children:e.jsx(b.Text,{color:"gray-50",fontSize:s.toNumber()>80?"sm":"md",fontWeight:"medium",children:"Edit Image"})})]})]}),n&&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"})}),v&&Dt.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:m?c==="1:1"?"min(90vw, 480px)":`min(90vw, ${te*2}px)`:"calc(100vw - 2rem)",display:"flex",flexDirection:"column"},onClick:G=>G.stopPropagation(),children:[e.jsx("div",{style:{position:"relative",width:"100%",height:"20rem",backgroundColor:"var(--sa-color-gray-100)"},children:E&&e.jsx(Hr,{image:E,crop:k,zoom:p,aspect:c?sr[c]:void 0,onCropChange:z,onZoomChange:M,onCropComplete:_,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(T.Button,{size:"sm",secondary:!0,onClick:()=>F(!1),children:"Cancel"}),e.jsx(T.Button,{size:"sm",primary:!0,onClick:P,children:"Crop"})]})]})}),document.body)]})}),Jo=({size:t="md",direction:r="vertical",requiredTitle:n="(Required)",fullWidth:i=!1,required:o=!1,...s})=>{var u,a,h;const c=s.hideMessageError||!1,l=r==="horizontal"?t==="sm"?342:t==="lg"?400:342:void 0;return e.jsxs(f.Box,{gap:r==="horizontal"?"spacing-96":"sm",direction:r==="horizontal"?"row":"column",...s.containerProps,children:[s.title&&e.jsx(U,{condition:!!o,fallback:e.jsxs(f.Box,{direction:"column",customMaxWidth:l,fullWidth:i,children:[e.jsx(ee,{children:s.title}),e.jsx(b.Text,{fontSize:t,color:"gray-500",children:s.description})]}),children:e.jsxs(f.Box,{direction:"column",customMaxWidth:l,fullWidth:i,children:[e.jsxs(K.Flex,{direction:"row",gap:"xs",align:"center",children:[e.jsx(ee,{fontSize:t,children:s.title}),e.jsx(ee,{color:"error",fontSize:t,children:n}),e.jsx(U,{condition:!!((u=s.tooltip)!=null&&u.label),children:e.jsx(ae.Tooltip,{label:(a=s.tooltip)==null?void 0:a.label,arrowPosition:(h=s.tooltip)==null?void 0:h.arrowPosition,...s.tooltip,children:e.jsx(w.Icon,{name:"InfoCircle",size:t==="lg"?"sm":"xs",style:{color:"var(--sa-color-info-500, #00abeb)",marginTop:"6px"}})})})]}),e.jsx(U,{condition:!!s.description,children:e.jsx(b.Text,{fontSize:t,color:"gray-500",children:s.description})})]})}),e.jsxs(K.Flex,{direction:"column",gap:"xs",children:[e.jsx(Ar,{...s.inputProps}),!c&&s.errorMessage&&e.jsx(be,{message:s.errorMessage})]})]})},Uo=({size:t="md",direction:r="vertical",requiredTitle:n="(Required)",fullWidth:i=!1,...o})=>{var c,l,u;const s=r==="horizontal"?t==="sm"?342:t==="lg"?400:342:void 0;return e.jsxs(f.Box,{gap:r==="horizontal"?"spacing-96":"sm",direction:r==="horizontal"?"row":"column",...o.containerProps,children:[o.title&&e.jsx(U,{condition:!!o.inputProps.required,fallback:e.jsxs(f.Box,{direction:"column",customMaxWidth:s,fullWidth:i,children:[e.jsx(ee,{children:o.title}),e.jsx(b.Text,{fontSize:t,color:"gray-500",children:o.description})]}),children:e.jsxs(f.Box,{direction:"column",customMaxWidth:s,fullWidth:i,children:[e.jsxs(K.Flex,{direction:"row",gap:"xs",align:"center",children:[e.jsx(ee,{fontSize:t,children:o.title}),e.jsx(ee,{color:"error",fontSize:t,children:n}),e.jsx(U,{condition:!!((c=o.tooltip)!=null&&c.label),children:e.jsx(ae.Tooltip,{label:(l=o.tooltip)==null?void 0:l.label,arrowPosition:(u=o.tooltip)==null?void 0:u.arrowPosition,...o.tooltip,children:e.jsx(w.Icon,{name:"InfoCircle",size:t==="lg"?"sm":"xs",style:{color:"var(--sa-color-info-500, #00abeb)",marginTop:"6px"}})})})]}),e.jsx(U,{condition:!!o.description,children:e.jsx(b.Text,{fontSize:t,color:"gray-500",children:o.description})})]})}),o.inputProps.extended&&o.inputProps.extended]})},Yo=({items:t,id:r,handleOnUpdate:n,width:i,toggleShow:o=!0,disabled:s=!1})=>{var h;const[c,l]=x.useState([]);x.useEffect(()=>{t&&l([...t.map(m=>({id:m.id,isActive:m.isActive}))])},[t]);const u=(h=c.find(m=>m.id===r))==null?void 0:h.isActive,a=x.useCallback(()=>{l(m=>m.map(g=>g.id===r?{...g,isActive:!g.isActive}:g)),n&&n(!u)},[r,n,u]);return e.jsx(f.Box,{direction:"row",gap:"md",style:{width:i},children:o&&e.jsx(Ne.Toggle,{disabled:s,checked:u,onChange:a,label:u?"Active":"Inactive"})})},Xo={InputText:ao,InputDropdown:uo,InputSingleFile:Ho,CheckBoxOptions:Vo,RadioOptions:No,InputTextArea:Po,ToggleForm:_o,ActionButton:qo,FormTitle:Zo,InputDate:Qo,InputImgFile:Jo,Custom:Uo},zr=({customBottom:t})=>{const[r,n]=x.useState(!1),i=()=>{window.scrollY>window.screenY?n(!0):n(!1)},o=()=>{window.scrollTo({top:0,behavior:"smooth"})};return x.useEffect(()=>(window.addEventListener("scroll",i),()=>{window.removeEventListener("scroll",i)}),[]),e.jsx(f.Box,{direction:"column",style:{position:"fixed",bottom:0,right:0},children:e.jsx(f.Box,{direction:"column",position:"absolute",style:{bottom:t||"1.6rem",right:"2rem",transform:r?"scale(1)":"scale(0)",transition:"transform 0.2s ease-in-out"},children:e.jsx(T.Button,{secondary:!0,size:"xs",onClick:o,type:"button",iconLeft:e.jsx(w.Icon,{width:16,size:"xs",name:"ArrowPullUp",style:{color:"var(--sa-background-brand, #04254f)"}})})})})},Ko=({pageLayout:t,children:r,wrapperProps:n,containerProps:i})=>{const o=ie.useMediaQuery("md"),s=(i==null?void 0:i.customWidth)??264;return e.jsxs(f.Box,{display:"block",direction:"row",...n,style:{marginRight:o?s:24,...(n==null?void 0:n.style)??{}},children:[t,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",...i,style:{marginTop:"4rem",backgroundColor:"var(--sa-background-white, #ffffff)",borderColor:"var(--sa-border-subtle, #0b120e24)",...(i==null?void 0:i.style)??{}},children:r})]})},$o=({children:t,withScrollToTopButton:r=!1,scrollToTopButtonProps:n,containerProps:i})=>e.jsx(f.Box,{direction:"column",position:"absolute",width:"width-full",style:{zIndex:"var(--app-footer-zindex, 999)"},children:e.jsxs(f.Box,{position:"fixed",bottom:"bottom-0",right:"right-0",padding:"spacing-32",height:"height-24",bg:"gray-50",direction:"row",align:"center",display:"flex",style:{left:"var(--app-sidebar-width, 0px)",transition:"left 0.3s ease-in-out",borderColor:"var(--sa-border-subtle, #0b120e24)"},justify:(i==null?void 0:i.justify)||"flex-end",borderStyle:"border-solid-t",borderWidth:"border-t",children:[r&&e.jsx(zr,{...n,customBottom:(n==null?void 0:n.customBottom)||"5.7rem"}),t]})}),ei=({fields:t})=>e.jsx(f.Box,{display:"flex",direction:"column",gap:"lg",children:e.jsx(it,{of:t,render:(r,n)=>e.jsx(ti,{...r},n)})}),ti=({title:t,value:r,icon:n})=>e.jsxs(f.Box,{display:"flex",direction:"column",gap:"sm",children:[n?e.jsxs(f.Box,{display:"flex",direction:"row",align:"center",gap:"xs",children:[e.jsx(w.Icon,{name:n,color:"subtle"}),e.jsx(b.Text,{color:"gray-500",variant:"sub-h3",children:t})]}):e.jsx(b.Text,{color:"gray-500",variant:"sub-h3",children:t}),typeof r=="string"?e.jsx(b.Text,{variant:"sub-h3",children:r}):r]}),oe={silhouette:"#A7B0AC",accent:"#78867F"};function ri({width:t,height:r}){return e.jsx(e.Fragment,{children:e.jsxs("svg",{width:t||"100",height:r||"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:oe.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:oe.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:oe.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:oe.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:oe.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:oe.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:oe.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:oe.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:oe.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:oe.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:oe.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:oe.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:oe.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:oe.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:oe.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:oe.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:oe.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:oe.accent,fillOpacity:"0.65"})]})})}const ni=({title:t="create",children:r,onClickAction:n,variant:i="primary",variantTitle:o,leftIcon:s,showButton:c=!0,customHeight:l,childrenButton:u,customIcon:a})=>{const h=()=>{switch(i){case"primary":return e.jsx(e.Fragment,{children:s?e.jsx(T.Button,{primary:!0,iconLeft:s,onClick:n,children:u||t}):e.jsx(T.Button,{primary:!0,onClick:n,children:u||t})});case"secondary":return e.jsx(e.Fragment,{children:s?e.jsx(T.Button,{secondary:!0,iconLeft:s,onClick:n,children:o?e.jsx(b.Text,{fontFamily:"Poppins",fontSize:"md",fontWeight:"medium",style:{color:"var(--sa-background-success, #28ac6e)"},children:u||t}):t}):e.jsx(T.Button,{secondary:!0,onClick:n,children:u||t})});case"success":return e.jsx(e.Fragment,{children:s?e.jsx(T.Button,{success:!0,iconLeft:s,onClick:n,children:u||t}):e.jsx(T.Button,{success:!0,onClick:n,children:u||t})});default:return e.jsx(e.Fragment,{children:s?e.jsx(T.Button,{primary:!0,iconLeft:s,onClick:n,children:u||t}):e.jsx(T.Button,{primary:!0,onClick:n,children:u||t})})}};return e.jsxs(f.Box,{height:"height-full",display:"flex",direction:"column",gap:"sm",justify:"center",align:"center",marginBlock:"auto",customHeight:l,children:[a||e.jsx(ri,{}),e.jsx(f.Box,{direction:"column",children:r.map((m,g)=>e.jsx(me.Body1,{props:{align:"center",textAlign:"center"},children:g>2?null:m},g))}),c?h():null]})},N={c001A72:"#001A72",c64B5F6:"#64B5F6",c98B4CB:"#98B4CB",cBBDEFB:"#BBDEFB",cD0E5F7:"#D0E5F7",cD6EBFD:"#D6EBFD",c000000:"#000000",cFFFFFF:"#FFFFFF"};function oi({width:t,height:r}){return e.jsx(e.Fragment,{children:e.jsxs("svg",{width:t,height:r,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:N.c64B5F6,strokeWidth:"5",strokeLinecap:"round"}),e.jsx("rect",{x:"216.562",y:"45.5605",width:"55",height:"20",fill:N.cD6EBFD}),e.jsx("rect",{x:"14.4375",y:"89.7803",width:"46",height:"20",fill:N.cD6EBFD}),e.jsx("rect",{x:"0.4375",y:"111.78",width:"46",height:"20",fill:N.cD6EBFD}),e.jsx("rect",{x:"0.4375",y:"67.7803",width:"46",height:"20",fill:N.cD6EBFD}),e.jsx("rect",{x:"344.312",y:"0.5",width:"55",height:"20",fill:N.cD6EBFD}),e.jsx("rect",{x:"549.562",y:"86.7803",width:"55",height:"20",fill:N.cD6EBFD}),e.jsx("rect",{x:"566.562",y:"64.7803",width:"55",height:"20",fill:N.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:N.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:N.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:N.cBBDEFB,fillOpacity:"0.6"}),e.jsx("path",{d:"M349.472 171.5H261.64V186.396H349.472V171.5Z",fill:N.c98B4CB}),e.jsx("path",{d:"M261.64 171.5L244.719 186.396H261.64V171.5Z",fill:N.c98B4CB}),e.jsx("path",{d:"M363.574 186.396L349.472 171.5V186.396H363.574Z",fill:N.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:N.c000000,strokeWidth:"2"}),e.jsx("rect",{x:"246.438",y:"202.5",width:"116",height:"60",fill:N.cFFFFFF}),e.jsx("path",{d:"M245.536 187.5H362.959L369.438 198.5H237.438L245.536 187.5Z",fill:N.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:N.cFFFFFF,stroke:N.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:N.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:N.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:N.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:N.c000000,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}),e.jsx("circle",{cx:"291.724",cy:"118.765",r:"3.1027",fill:N.c000000}),e.jsx("path",{d:"M308.128 122.463C309.123 120.973 309.987 120.418 311.883 120.237",stroke:N.c000000,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}),e.jsx("circle",{cx:"307.681",cy:"118.765",r:"3.1027",fill:N.c000000}),e.jsx("ellipse",{cx:"297.938",cy:"134.5",rx:"2.5",ry:"2",fill:N.c000000}),e.jsx("path",{d:"M340.437 97.5L333.438 104.5M333.438 97.5L340.438 104.5",stroke:N.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:N.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:N.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:N.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:N.c001A72,strokeWidth:"1.2",strokeLinecap:"round",strokeLinejoin:"round"}),e.jsx("circle",{cx:"339.938",cy:"111",r:"2.5",fill:N.c001A72}),e.jsx("circle",{cx:"336.438",cy:"94.5",r:"1",fill:N.c001A72}),e.jsx("circle",{cx:"347.438",cy:"99.5",r:"1",fill:N.c001A72}),e.jsx("circle",{cx:"267.438",cy:"109.5",r:"2",fill:N.c001A72}),e.jsx("circle",{cx:"293.438",cy:"85.5",r:"2",fill:N.c001A72}),e.jsx("circle",{cx:"339.438",cy:"138.5",r:"2",fill:N.c001A72}),e.jsx("circle",{cx:"267.438",cy:"150.5",r:"2",fill:N.c001A72}),e.jsx("circle",{cx:"268.438",cy:"118.5",r:"1",fill:N.c001A72}),e.jsx("circle",{cx:"260.438",cy:"124.5",r:"1",fill:N.c001A72})]})})}function ii({onClick:t}){const r=ie.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(oi,{width:r?600:300}),e.jsx(b.Text,{fontWeight:"bold",fontSize:r?"3xl":"2xl",textAlign:"center",children:"Page Not Found"}),e.jsx(b.Text,{fontWeight:"semibold",fontSize:r?"lg":"md",textAlign:"center",children:"Sorry, we couldn't find the page you are looking for"}),t&&e.jsx(T.Button,{size:r?"md":"xs",onClick:t,children:"Go Back"})]})}const Z={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 si({width:t,height:r}){return e.jsx(e.Fragment,{children:e.jsxs("svg",{width:t,height:r,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:Z.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:Z.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:Z.cEFF3F8,stroke:Z.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:Z.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:Z.cCABEB1}),e.jsx("path",{d:"M287.68 218.884L289.354 213.022H378.961L381.473 218.884H287.68Z",fill:Z.cC0B2A2}),e.jsx("path",{d:"M381.944 218.803L381.58 212.266H386.385L386.022 218.803H381.944Z",fill:Z.c956847,stroke:Z.c48504C}),e.jsx("path",{d:"M283.124 218.803L282.768 213.104H287.565L287.209 218.803H283.124Z",fill:Z.c956847,stroke:Z.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:Z.cC8CEF4,stroke:Z.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:Z.cC8CEF4,stroke:Z.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:Z.cC8CEF4,stroke:Z.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:Z.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:Z.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:Z.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:Z.cD6D6D6}),e.jsx("path",{d:"M368.673 152.523H301.336V174.5H368.673V152.523Z",fill:Z.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:Z.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:Z.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:Z.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:Z.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:Z.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:Z.cBBDEFB,fillOpacity:"0.6"}),e.jsx("rect",{x:"43",y:"87.5",width:"46",height:"20",fill:Z.cD6EBFD}),e.jsx("rect",{x:"29",y:"109.5",width:"46",height:"20",fill:Z.cD6EBFD}),e.jsx("rect",{x:"29",y:"65.5",width:"46",height:"20",fill:Z.cD6EBFD}),e.jsx("rect",{x:"356",y:"0.5",width:"55",height:"20",fill:Z.cD6EBFD}),e.jsx("rect",{x:"572",y:"142.5",width:"55",height:"20",fill:Z.cD6EBFD}),e.jsx("rect",{x:"589",y:"120.5",width:"55",height:"20",fill:Z.cD6EBFD}),e.jsx("path",{d:"M3 255.5L651 255.5",stroke:Z.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:Z.cFFFFFF,transform:"translate(246 60.5)"})})})]})})}function li({onClick:t}){const r=ie.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(si,{width:r?600:300}),e.jsx(b.Text,{fontWeight:"bold",fontSize:r?"3xl":"2xl",children:"We Are Sorry ..."}),t&&e.jsx(T.Button,{size:r?"md":"xs",onClick:t,children:"Go Back"})]})}const d={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 ci({width:t,height:r}){return e.jsx(e.Fragment,{children:e.jsxs("svg",{width:t,height:r,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:d.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:d.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:d.cD6EBFD}),e.jsx("rect",{x:"216.562",y:"45.7803",width:"55",height:"20",fill:d.cD6EBFD}),e.jsx("rect",{x:"14.4375",y:"90",width:"46",height:"20",fill:d.cD6EBFD}),e.jsx("rect",{x:"0.4375",y:"112",width:"46",height:"20",fill:d.cD6EBFD}),e.jsx("rect",{x:"0.4375",y:"68",width:"46",height:"20",fill:d.cD6EBFD}),e.jsx("rect",{x:"344.312",y:"0.719727",width:"55",height:"20",fill:d.cD6EBFD}),e.jsx("rect",{x:"549.562",y:"87",width:"55",height:"20",fill:d.cD6EBFD}),e.jsx("rect",{x:"566.562",y:"65",width:"55",height:"20",fill:d.cD6EBFD}),e.jsx("path",{d:"M25.8125 282.22H605.812",stroke:d.c64B5F6,strokeWidth:"5",strokeLinecap:"round"}),e.jsx("rect",{x:"263.012",y:"175.42",width:"104.6",height:"31.2833",rx:"3.3",fill:d.cFFFFFF,stroke:d.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:d.c001174}),e.jsx("rect",{x:"263.012",y:"210.752",width:"104.6",height:"31.2833",rx:"3.3",fill:d.cFFFFFF,stroke:d.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:d.c001174}),e.jsx("rect",{x:"263.012",y:"246.969",width:"104.6",height:"31.2833",rx:"3.3",fill:d.cFFFFFF,stroke:d.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:d.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:d.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:d.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:d.cF3F8FD}),e.jsx("circle",{cx:"270.258",cy:"179.136",r:"0.883333",fill:d.cD9D9D9}),e.jsx("circle",{cx:"270.258",cy:"181.786",r:"0.883333",fill:d.cD9D9D9}),e.jsx("circle",{cx:"281.561",cy:"179.136",r:"0.883333",fill:d.cD9D9D9}),e.jsx("circle",{cx:"281.561",cy:"181.786",r:"0.883333",fill:d.cD9D9D9}),e.jsx("circle",{cx:"273.085",cy:"179.136",r:"0.883333",fill:d.cD9D9D9}),e.jsx("circle",{cx:"273.085",cy:"181.786",r:"0.883333",fill:d.cD9D9D9}),e.jsx("circle",{cx:"284.388",cy:"179.136",r:"0.883333",fill:d.cD9D9D9}),e.jsx("circle",{cx:"284.388",cy:"181.786",r:"0.883333",fill:d.cD9D9D9}),e.jsx("circle",{cx:"275.91",cy:"179.136",r:"0.883333",fill:d.cD9D9D9}),e.jsx("circle",{cx:"275.91",cy:"181.786",r:"0.883333",fill:d.cD9D9D9}),e.jsx("circle",{cx:"287.214",cy:"179.136",r:"0.883333",fill:d.cD9D9D9}),e.jsx("circle",{cx:"287.214",cy:"181.786",r:"0.883333",fill:d.cD9D9D9}),e.jsx("circle",{cx:"278.737",cy:"179.136",r:"0.883333",fill:d.cD9D9D9}),e.jsx("circle",{cx:"278.737",cy:"181.786",r:"0.883333",fill:d.cD9D9D9}),e.jsx("circle",{cx:"290.04",cy:"179.136",r:"0.883333",fill:d.cD9D9D9}),e.jsx("circle",{cx:"290.04",cy:"181.786",r:"0.883333",fill:d.cD9D9D9}),e.jsx("circle",{cx:"344.462",cy:"179.136",r:"0.883333",fill:d.cD9D9D9}),e.jsx("circle",{cx:"344.462",cy:"181.786",r:"0.883333",fill:d.cD9D9D9}),e.jsx("circle",{cx:"355.765",cy:"179.136",r:"0.883333",fill:d.cD9D9D9}),e.jsx("circle",{cx:"355.765",cy:"181.786",r:"0.883333",fill:d.cD9D9D9}),e.jsx("circle",{cx:"347.29",cy:"179.136",r:"0.883333",fill:d.cD9D9D9}),e.jsx("circle",{cx:"347.29",cy:"181.786",r:"0.883333",fill:d.cD9D9D9}),e.jsx("circle",{cx:"358.592",cy:"179.136",r:"0.883333",fill:d.cD9D9D9}),e.jsx("circle",{cx:"358.592",cy:"181.786",r:"0.883333",fill:d.cD9D9D9}),e.jsx("circle",{cx:"350.114",cy:"179.136",r:"0.883333",fill:d.cD9D9D9}),e.jsx("circle",{cx:"350.114",cy:"181.786",r:"0.883333",fill:d.cD9D9D9}),e.jsx("circle",{cx:"361.418",cy:"179.136",r:"0.883333",fill:d.cD9D9D9}),e.jsx("circle",{cx:"361.418",cy:"181.786",r:"0.883333",fill:d.cD9D9D9}),e.jsx("circle",{cx:"352.941",cy:"179.136",r:"0.883333",fill:d.cD9D9D9}),e.jsx("circle",{cx:"352.941",cy:"181.786",r:"0.883333",fill:d.cD9D9D9}),e.jsx("circle",{cx:"364.244",cy:"179.136",r:"0.883333",fill:d.cD9D9D9}),e.jsx("circle",{cx:"364.244",cy:"181.786",r:"0.883333",fill:d.cD9D9D9}),e.jsx("circle",{cx:"344.462",cy:"200.336",r:"0.883333",fill:d.cD9D9D9}),e.jsx("circle",{cx:"344.462",cy:"202.986",r:"0.883333",fill:d.cD9D9D9}),e.jsx("circle",{cx:"355.765",cy:"200.336",r:"0.883333",fill:d.cD9D9D9}),e.jsx("circle",{cx:"355.765",cy:"202.986",r:"0.883333",fill:d.cD9D9D9}),e.jsx("circle",{cx:"347.29",cy:"200.336",r:"0.883333",fill:d.cD9D9D9}),e.jsx("circle",{cx:"347.29",cy:"202.986",r:"0.883333",fill:d.cD9D9D9}),e.jsx("circle",{cx:"358.592",cy:"200.336",r:"0.883333",fill:d.cD9D9D9}),e.jsx("circle",{cx:"358.592",cy:"202.986",r:"0.883333",fill:d.cD9D9D9}),e.jsx("circle",{cx:"350.114",cy:"200.336",r:"0.883333",fill:d.cD9D9D9}),e.jsx("circle",{cx:"350.114",cy:"202.986",r:"0.883333",fill:d.cD9D9D9}),e.jsx("circle",{cx:"361.418",cy:"200.336",r:"0.883333",fill:d.cD9D9D9}),e.jsx("circle",{cx:"361.418",cy:"202.986",r:"0.883333",fill:d.cD9D9D9}),e.jsx("circle",{cx:"352.941",cy:"200.336",r:"0.883333",fill:d.cD9D9D9}),e.jsx("circle",{cx:"352.941",cy:"202.986",r:"0.883333",fill:d.cD9D9D9}),e.jsx("circle",{cx:"364.244",cy:"200.336",r:"0.883333",fill:d.cD9D9D9}),e.jsx("circle",{cx:"364.244",cy:"202.986",r:"0.883333",fill:d.cD9D9D9}),e.jsx("circle",{cx:"359.918",cy:"191.061",r:"4.45833",stroke:d.c001174,strokeWidth:"0.8"}),e.jsx("circle",{cx:"359.918",cy:"191.061",r:"2.20833",fill:d.cE7EAE9}),e.jsx("rect",{x:"269.726",y:"186.553",width:"36.4",height:"9.01667",rx:"0.65",fill:d.cE7EAE9,stroke:d.c001174,strokeWidth:"0.7"}),e.jsx("rect",{x:"310.537",y:"186.553",width:"6.54333",height:"9.01667",rx:"0.65",fill:d.cE7EAE9,stroke:d.c001174,strokeWidth:"0.7"}),e.jsx("rect",{x:"321.312",y:"186.553",width:"6.54333",height:"9.01667",rx:"0.65",fill:d.cE7EAE9,stroke:d.c001174,strokeWidth:"0.7"}),e.jsx("rect",{x:"332.089",y:"186.553",width:"6.54333",height:"9.01667",rx:"0.65",fill:d.cE7EAE9,stroke:d.c001174,strokeWidth:"0.7"}),e.jsx("rect",{x:"342.864",y:"186.553",width:"6.54333",height:"9.01667",rx:"0.65",fill:d.cE7EAE9,stroke:d.c001174,strokeWidth:"0.7"}),e.jsx("circle",{cx:"270.258",cy:"214.468",r:"0.883333",fill:d.cD9D9D9}),e.jsx("circle",{cx:"270.258",cy:"217.118",r:"0.883333",fill:d.cD9D9D9}),e.jsx("circle",{cx:"281.561",cy:"214.468",r:"0.883333",fill:d.cD9D9D9}),e.jsx("circle",{cx:"281.561",cy:"217.118",r:"0.883333",fill:d.cD9D9D9}),e.jsx("circle",{cx:"273.085",cy:"214.468",r:"0.883333",fill:d.cD9D9D9}),e.jsx("circle",{cx:"273.085",cy:"217.118",r:"0.883333",fill:d.cD9D9D9}),e.jsx("circle",{cx:"284.388",cy:"214.468",r:"0.883333",fill:d.cD9D9D9}),e.jsx("circle",{cx:"284.388",cy:"217.118",r:"0.883333",fill:d.cD9D9D9}),e.jsx("circle",{cx:"275.91",cy:"214.468",r:"0.883333",fill:d.cD9D9D9}),e.jsx("circle",{cx:"275.91",cy:"217.118",r:"0.883333",fill:d.cD9D9D9}),e.jsx("circle",{cx:"287.214",cy:"214.468",r:"0.883333",fill:d.cD9D9D9}),e.jsx("circle",{cx:"287.214",cy:"217.118",r:"0.883333",fill:d.cD9D9D9}),e.jsx("circle",{cx:"278.737",cy:"214.468",r:"0.883333",fill:d.cD9D9D9}),e.jsx("circle",{cx:"278.737",cy:"217.118",r:"0.883333",fill:d.cD9D9D9}),e.jsx("circle",{cx:"290.04",cy:"214.468",r:"0.883333",fill:d.cD9D9D9}),e.jsx("circle",{cx:"290.04",cy:"217.118",r:"0.883333",fill:d.cD9D9D9}),e.jsx("circle",{cx:"344.462",cy:"214.468",r:"0.883333",fill:d.cD9D9D9}),e.jsx("circle",{cx:"344.462",cy:"217.118",r:"0.883333",fill:d.cD9D9D9}),e.jsx("circle",{cx:"355.765",cy:"214.468",r:"0.883333",fill:d.cD9D9D9}),e.jsx("circle",{cx:"355.765",cy:"217.118",r:"0.883333",fill:d.cD9D9D9}),e.jsx("circle",{cx:"347.29",cy:"214.468",r:"0.883333",fill:d.cD9D9D9}),e.jsx("circle",{cx:"347.29",cy:"217.118",r:"0.883333",fill:d.cD9D9D9}),e.jsx("circle",{cx:"358.592",cy:"214.468",r:"0.883333",fill:d.cD9D9D9}),e.jsx("circle",{cx:"358.592",cy:"217.118",r:"0.883333",fill:d.cD9D9D9}),e.jsx("circle",{cx:"350.114",cy:"214.468",r:"0.883333",fill:d.cD9D9D9}),e.jsx("circle",{cx:"350.114",cy:"217.118",r:"0.883333",fill:d.cD9D9D9}),e.jsx("circle",{cx:"361.418",cy:"214.468",r:"0.883333",fill:d.cD9D9D9}),e.jsx("circle",{cx:"361.418",cy:"217.118",r:"0.883333",fill:d.cD9D9D9}),e.jsx("circle",{cx:"352.941",cy:"214.468",r:"0.883333",fill:d.cD9D9D9}),e.jsx("circle",{cx:"352.941",cy:"217.118",r:"0.883333",fill:d.cD9D9D9}),e.jsx("circle",{cx:"364.244",cy:"214.468",r:"0.883333",fill:d.cD9D9D9}),e.jsx("circle",{cx:"364.244",cy:"217.118",r:"0.883333",fill:d.cD9D9D9}),e.jsx("circle",{cx:"344.462",cy:"235.668",r:"0.883333",fill:d.cD9D9D9}),e.jsx("circle",{cx:"344.462",cy:"238.318",r:"0.883333",fill:d.cD9D9D9}),e.jsx("circle",{cx:"355.765",cy:"235.668",r:"0.883333",fill:d.cD9D9D9}),e.jsx("circle",{cx:"355.765",cy:"238.318",r:"0.883333",fill:d.cD9D9D9}),e.jsx("circle",{cx:"347.29",cy:"235.668",r:"0.883333",fill:d.cD9D9D9}),e.jsx("circle",{cx:"347.29",cy:"238.318",r:"0.883333",fill:d.cD9D9D9}),e.jsx("circle",{cx:"358.592",cy:"235.668",r:"0.883333",fill:d.cD9D9D9}),e.jsx("circle",{cx:"358.592",cy:"238.318",r:"0.883333",fill:d.cD9D9D9}),e.jsx("circle",{cx:"350.114",cy:"235.668",r:"0.883333",fill:d.cD9D9D9}),e.jsx("circle",{cx:"350.114",cy:"238.318",r:"0.883333",fill:d.cD9D9D9}),e.jsx("circle",{cx:"361.418",cy:"235.668",r:"0.883333",fill:d.cD9D9D9}),e.jsx("circle",{cx:"361.418",cy:"238.318",r:"0.883333",fill:d.cD9D9D9}),e.jsx("circle",{cx:"352.941",cy:"235.668",r:"0.883333",fill:d.cD9D9D9}),e.jsx("circle",{cx:"352.941",cy:"238.318",r:"0.883333",fill:d.cD9D9D9}),e.jsx("circle",{cx:"364.244",cy:"235.668",r:"0.883333",fill:d.cD9D9D9}),e.jsx("circle",{cx:"364.244",cy:"238.318",r:"0.883333",fill:d.cD9D9D9}),e.jsx("circle",{cx:"359.918",cy:"226.393",r:"4.45833",stroke:d.c001174,strokeWidth:"0.8"}),e.jsx("circle",{cx:"359.918",cy:"226.393",r:"2.20833",fill:d.cE7EAE9}),e.jsx("rect",{x:"269.726",y:"221.885",width:"36.4",height:"9.01667",rx:"0.65",fill:d.cE7EAE9,stroke:d.c001174,strokeWidth:"0.7"}),e.jsx("rect",{x:"310.537",y:"221.885",width:"6.54333",height:"9.01667",rx:"0.65",fill:d.cE7EAE9,stroke:d.c001174,strokeWidth:"0.7"}),e.jsx("rect",{x:"321.312",y:"221.885",width:"6.54333",height:"9.01667",rx:"0.65",fill:d.cE7EAE9,stroke:d.c001174,strokeWidth:"0.7"}),e.jsx("rect",{x:"332.089",y:"221.885",width:"6.54333",height:"9.01667",rx:"0.65",fill:d.cE7EAE9,stroke:d.c001174,strokeWidth:"0.7"}),e.jsx("rect",{x:"342.864",y:"221.885",width:"6.54333",height:"9.01667",rx:"0.65",fill:d.cE7EAE9,stroke:d.c001174,strokeWidth:"0.7"}),e.jsx("circle",{cx:"270.258",cy:"250.685",r:"0.883333",fill:d.cD9D9D9}),e.jsx("circle",{cx:"270.258",cy:"253.335",r:"0.883333",fill:d.cD9D9D9}),e.jsx("circle",{cx:"281.561",cy:"250.685",r:"0.883333",fill:d.cD9D9D9}),e.jsx("circle",{cx:"281.561",cy:"253.335",r:"0.883333",fill:d.cD9D9D9}),e.jsx("circle",{cx:"273.085",cy:"250.685",r:"0.883333",fill:d.cD9D9D9}),e.jsx("circle",{cx:"273.085",cy:"253.335",r:"0.883333",fill:d.cD9D9D9}),e.jsx("circle",{cx:"284.388",cy:"250.685",r:"0.883333",fill:d.cD9D9D9}),e.jsx("circle",{cx:"284.388",cy:"253.335",r:"0.883333",fill:d.cD9D9D9}),e.jsx("circle",{cx:"275.91",cy:"250.685",r:"0.883333",fill:d.cD9D9D9}),e.jsx("circle",{cx:"275.91",cy:"253.335",r:"0.883333",fill:d.cD9D9D9}),e.jsx("circle",{cx:"287.214",cy:"250.685",r:"0.883333",fill:d.cD9D9D9}),e.jsx("circle",{cx:"287.214",cy:"253.335",r:"0.883333",fill:d.cD9D9D9}),e.jsx("circle",{cx:"278.737",cy:"250.685",r:"0.883333",fill:d.cD9D9D9}),e.jsx("circle",{cx:"278.737",cy:"253.335",r:"0.883333",fill:d.cD9D9D9}),e.jsx("circle",{cx:"290.04",cy:"250.685",r:"0.883333",fill:d.cD9D9D9}),e.jsx("circle",{cx:"290.04",cy:"253.335",r:"0.883333",fill:d.cD9D9D9}),e.jsx("circle",{cx:"344.462",cy:"250.685",r:"0.883333",fill:d.cD9D9D9}),e.jsx("circle",{cx:"344.462",cy:"253.335",r:"0.883333",fill:d.cD9D9D9}),e.jsx("circle",{cx:"355.765",cy:"250.685",r:"0.883333",fill:d.cD9D9D9}),e.jsx("circle",{cx:"355.765",cy:"253.335",r:"0.883333",fill:d.cD9D9D9}),e.jsx("circle",{cx:"347.29",cy:"250.685",r:"0.883333",fill:d.cD9D9D9}),e.jsx("circle",{cx:"347.29",cy:"253.335",r:"0.883333",fill:d.cD9D9D9}),e.jsx("circle",{cx:"358.592",cy:"250.685",r:"0.883333",fill:d.cD9D9D9}),e.jsx("circle",{cx:"358.592",cy:"253.335",r:"0.883333",fill:d.cD9D9D9}),e.jsx("circle",{cx:"350.114",cy:"250.685",r:"0.883333",fill:d.cD9D9D9}),e.jsx("circle",{cx:"350.114",cy:"253.335",r:"0.883333",fill:d.cD9D9D9}),e.jsx("circle",{cx:"361.418",cy:"250.685",r:"0.883333",fill:d.cD9D9D9}),e.jsx("circle",{cx:"361.418",cy:"253.335",r:"0.883333",fill:d.cD9D9D9}),e.jsx("circle",{cx:"352.941",cy:"250.685",r:"0.883333",fill:d.cD9D9D9}),e.jsx("circle",{cx:"352.941",cy:"253.335",r:"0.883333",fill:d.cD9D9D9}),e.jsx("circle",{cx:"364.244",cy:"250.685",r:"0.883333",fill:d.cD9D9D9}),e.jsx("circle",{cx:"364.244",cy:"253.335",r:"0.883333",fill:d.cD9D9D9}),e.jsx("circle",{cx:"344.462",cy:"271.885",r:"0.883333",fill:d.cD9D9D9}),e.jsx("circle",{cx:"344.462",cy:"274.535",r:"0.883333",fill:d.cD9D9D9}),e.jsx("circle",{cx:"355.765",cy:"271.885",r:"0.883333",fill:d.cD9D9D9}),e.jsx("circle",{cx:"355.765",cy:"274.535",r:"0.883333",fill:d.cD9D9D9}),e.jsx("circle",{cx:"347.29",cy:"271.885",r:"0.883333",fill:d.cD9D9D9}),e.jsx("circle",{cx:"347.29",cy:"274.535",r:"0.883333",fill:d.cD9D9D9}),e.jsx("circle",{cx:"358.592",cy:"271.885",r:"0.883333",fill:d.cD9D9D9}),e.jsx("circle",{cx:"358.592",cy:"274.535",r:"0.883333",fill:d.cD9D9D9}),e.jsx("circle",{cx:"350.114",cy:"271.885",r:"0.883333",fill:d.cD9D9D9}),e.jsx("circle",{cx:"350.114",cy:"274.535",r:"0.883333",fill:d.cD9D9D9}),e.jsx("circle",{cx:"361.418",cy:"271.885",r:"0.883333",fill:d.cD9D9D9}),e.jsx("circle",{cx:"361.418",cy:"274.535",r:"0.883333",fill:d.cD9D9D9}),e.jsx("circle",{cx:"352.941",cy:"271.885",r:"0.883333",fill:d.cD9D9D9}),e.jsx("circle",{cx:"352.941",cy:"274.535",r:"0.883333",fill:d.cD9D9D9}),e.jsx("circle",{cx:"364.244",cy:"271.885",r:"0.883333",fill:d.cD9D9D9}),e.jsx("circle",{cx:"364.244",cy:"274.535",r:"0.883333",fill:d.cD9D9D9}),e.jsx("circle",{cx:"359.918",cy:"262.61",r:"4.45833",stroke:d.c001174,strokeWidth:"0.8"}),e.jsx("circle",{cx:"359.918",cy:"262.61",r:"2.20833",fill:d.cE7EAE9}),e.jsx("rect",{x:"269.726",y:"258.102",width:"36.4",height:"9.01667",rx:"0.65",fill:d.cE7EAE9,stroke:d.c001174,strokeWidth:"0.7"}),e.jsx("rect",{x:"310.537",y:"258.102",width:"6.54333",height:"9.01667",rx:"0.65",fill:d.cE7EAE9,stroke:d.c001174,strokeWidth:"0.7"}),e.jsx("rect",{x:"321.312",y:"258.102",width:"6.54333",height:"9.01667",rx:"0.65",fill:d.cE7EAE9,stroke:d.c001174,strokeWidth:"0.7"}),e.jsx("rect",{x:"332.089",y:"258.102",width:"6.54333",height:"9.01667",rx:"0.65",fill:d.cE7EAE9,stroke:d.c001174,strokeWidth:"0.7"}),e.jsx("rect",{x:"342.864",y:"258.102",width:"6.54333",height:"9.01667",rx:"0.65",fill:d.cE7EAE9,stroke:d.c001174,strokeWidth:"0.7"}),e.jsx("rect",{x:"270.261",y:"200.336",width:"8.83333",height:"6.18333",fill:d.cFFFFFF}),e.jsx("rect",{x:"270.261",y:"235.668",width:"8.83333",height:"6.18333",fill:d.cFFFFFF}),e.jsx("rect",{x:"270.261",y:"271.885",width:"8.83333",height:"6.18333",fill:d.cFFFFFF}),e.jsx("rect",{x:"279.095",y:"200.336",width:"26.5",height:"6.18333",fill:d.cDEECF8}),e.jsx("rect",{x:"279.095",y:"235.668",width:"26.5",height:"6.18333",fill:d.cDEECF8}),e.jsx("rect",{x:"279.095",y:"271.885",width:"26.5",height:"6.18333",fill:d.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:d.c000D58,stroke:d.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:d.c000D58,stroke:d.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:d.cFFFFFF,stroke:d.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:d.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:d.cD6D6D6}),e.jsx("circle",{cx:"287.212",cy:"131.62",r:"0.9",fill:d.c28AC6E}),e.jsx("circle",{cx:"289.812",cy:"131.62",r:"0.9",fill:d.cC9184A}),e.jsx("circle",{cx:"292.412",cy:"131.62",r:"0.9",fill:d.cFFE18B}),e.jsx("rect",{x:"315.312",y:"133.72",width:"35",height:"35",fill:d.c90CAF9}),e.jsx("path",{d:"M319.312 153.22H341.312",stroke:d.cFFFFFF,strokeWidth:"1.3",strokeLinecap:"round"}),e.jsx("path",{d:"M288.312 150.72H310.312",stroke:d.c001174,strokeWidth:"1.3",strokeLinecap:"round"}),e.jsx("path",{d:"M319.312 156.22H336.312",stroke:d.cFFFFFF,strokeWidth:"1.3",strokeLinecap:"round"}),e.jsx("path",{d:"M288.312 153.72H305.312",stroke:d.c001174,strokeWidth:"1.3",strokeLinecap:"round"}),e.jsx("path",{d:"M319.312 159.22H336.312",stroke:d.cFFFFFF,strokeWidth:"1.3",strokeLinecap:"round"}),e.jsx("path",{d:"M288.312 156.72H305.312",stroke:d.c001174,strokeWidth:"1.3",strokeLinecap:"round"}),e.jsx("path",{d:"M337.312 139.72L328.312 148.72M328.313 139.72L337.313 148.72",stroke:d.cFFFFFF,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]})})}function ai({onClick:t}){const r=ie.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(ci,{width:r?600:300}),e.jsx(b.Text,{fontWeight:"bold",fontSize:r?"3xl":"2xl",textAlign:"center",children:"Server Problem"}),e.jsx(b.Text,{fontWeight:"semibold",fontSize:r?"lg":"md",textAlign:"center",children:"we are trying to fix the problem"}),t&&e.jsx(T.Button,{size:r?"md":"xs",onClick:t,children:"Go Back"})]})}const di=t=>{var n,i,o,s,c;const r=ie.useMediaQuery("md");return e.jsxs(fe.Dialog,{isShow:t.isShow,onHide:t.onHide,style:{...r?{minWidth:t.customMinWidth||"458px"}:{maxWidth:t.customMinWidth||"458px"}},children:[e.jsx(fe.DialogTitle,{...t.dialogTitleProps,children:typeof t.title=="string"?e.jsx(b.Text,{fontSize:"lg",fontWeight:"medium",children:t.title}):t.title}),e.jsx(fe.DialogBody,{children:typeof t.description=="string"?e.jsx(b.Text,{fontSize:"md",lineHeight:"leading-6",color:"brand",children:t.description}):t.description}),e.jsx(fe.DialogFooter,{children:e.jsx(f.Box,{display:"flex",direction:((n=t.containerConfirmBtnProps)==null?void 0:n.direction)||"row",justify:((i=t.containerConfirmBtnProps)==null?void 0:i.justify)||"flex-end",...t.containerConfirmBtnProps,children:e.jsxs(f.Box,{display:"flex",direction:((o=t.wrapperConfirmBtnProps)==null?void 0:o.direction)||"row",justify:((s=t.wrapperConfirmBtnProps)==null?void 0:s.justify)||"flex-end",gap:((c=t.wrapperConfirmBtnProps)==null?void 0:c.gap)||"sm",...t.wrapperConfirmBtnProps,children:[t.onCancel&&e.jsx(T.Button,{secondary:!0,onClick:t.onCancel,size:"md",fullWidth:!0,children:t.titleCancelBtn||"Cancel"}),e.jsx(f.Box,{direction:"column",fullWidth:!0,style:{textWrap:"nowrap"},children:e.jsx(T.Button,{...t.buttonConfirmProps,onClick:t.onConfirm,size:"md",fullWidth:!0,children:t.titleConfirmBtn||"Ok"})})]})})})]},t.key)},ui=x.memo(({children:t,height:r,minHeight:n,customHeight:i,paddingInline:o="spacing-0",paddingBlock:s="spacing-0",header:c,footer:l,title:u,titleTag:a,action:h,actionContainer:m,containerProps:g,bodyProps:y,headerProps:E={borderBottom:!0},footerProps:j={borderTop:!0},variantTag:v="info"})=>{const F=x.useRef(null),[k,z]=x.useState("100vh");x.useEffect(()=>{const S=()=>{if(F.current){const _=F.current.getBoundingClientRect().top;z(`calc(100vh - ${_}px)`)}};return S(),window.addEventListener("resize",S),()=>window.removeEventListener("resize",S)},[]);const p=()=>a?e.jsxs(f.Box,{direction:"row",gap:"sm",align:"center",children:[e.jsx(b.Text,{fontWeight:"medium",children:u}),e.jsx(ve.Badges,{border:!0,text:a,variant:v})]}):e.jsx(b.Text,{fontWeight:"medium",children:u}),M=()=>c||e.jsxs(f.Box,{direction:"row",justify:"space-between",align:"flex-start",gap:"md",children:[e.jsx(f.Box,{direction:"column",children:u?p():null}),e.jsx(f.Box,{direction:"column",...m,children:h??null})]}),L=!!(c||u||h);return e.jsxs(f.Box,{ref:F,height:r,customMinHeight:n,customHeight:i,paddingBlock:s,paddingInline:o,bg:"white",direction:"column",...g,style:{backgroundColor:"var(--sa-background-primary, #ffffff)",display:"flex",minHeight:k,...(g==null?void 0:g.style)??{}},children:[c!==null&&L?e.jsx(Et,{...E,children:M()}):null,e.jsx(f.Box,{direction:"column",padding:"spacing-0",...y,style:{flex:1,overflow:"auto",...(y==null?void 0:y.style)??{}},children:t}),l?e.jsx(Mt,{...j,children:l}):null]})}),xi=x.memo(({value:t,options:r=[],onChange:n,multiple:i})=>{const o=(t==null?void 0:t.map(l=>l.value))||[],s=(r==null?void 0:r.filter(l=>o.includes(l.value)))||[],c=l=>{const u=[...s];let a=[];i?a=o.includes(l.value)?u.filter(h=>h.value!==l.value):[...u,l]:a=[l],n==null||n(a)};return e.jsx(f.Box,{direction:"row",gap:"sm",flexWrap:"wrap",children:r==null?void 0:r.map((l,u)=>e.jsx(T.Button,{...o.includes(l.value)?{primary:!0}:{secondary:!0},onClick:()=>c(l),children:l.label},u))})});function st(t){return null}st.displayName="LayoutDialog.Header";function lt(t){return null}lt.displayName="LayoutDialog.Body";function ct(t){return null}ct.displayName="LayoutDialog.Aside";function at(t){return null}at.displayName="LayoutDialog.Footer";const ce={"lyd-root":"_lyd-root_1e92c_1","lyd-backdrop":"_lyd-backdrop_1e92c_28","lyd-panel":"_lyd-panel_1e92c_37","lyd-modal":"_lyd-modal_1e92c_48","lyd-fullscreen":"_lyd-fullscreen_1e92c_58","lyd-sidebar":"_lyd-sidebar_1e92c_66","lyd-header":"_lyd-header_1e92c_94","lyd-header-content":"_lyd-header-content_1e92c_105","lyd-header-actions":"_lyd-header-actions_1e92c_113","lyd-main":"_lyd-main_1e92c_120","lyd-body":"_lyd-body_1e92c_127","lyd-aside":"_lyd-aside_1e92c_133","lyd-footer":"_lyd-footer_1e92c_149","lyd-vm-group":"_lyd-vm-group_1e92c_162","lyd-vm-btn":"_lyd-vm-btn_1e92c_170","lyd-close-btn":"_lyd-close-btn_1e92c_193"},hi=[{mode:"sidebar",label:"Sidebar",icon:e.jsx(mi,{})},{mode:"modal",label:"Modal",icon:e.jsx(w.Icon,{name:"Newscreen",size:"sm"})},{mode:"fullscreen",label:"Fullscreen",icon:e.jsx(w.Icon,{name:"Fullscreen",size:"sm"})}];function fi({value:t,onChange:r}){return e.jsx("div",{className:ce["lyd-vm-group"],role:"group","aria-label":"View mode",children:hi.map(n=>e.jsx("button",{type:"button",className:ce["lyd-vm-btn"],"data-active":t===n.mode,"aria-label":`Switch to ${n.label} view`,"aria-pressed":t===n.mode,onClick:()=>r(n.mode),children:n.icon},n.mode))})}function mi(){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 jt={md:"768px",lg:"1024px",xl:"1200px","2xl":"1440px"};function gi(t){return t?t in jt?jt[t]:t:jt.xl}function Ue(t,r){let n=null;return x.Children.forEach(t,i=>{x.isValidElement(i)&&i.type===r&&(n=i.props.children??null)}),n}function ji(t){const{isOpen:r,onClose:n,viewMode:i,defaultViewMode:o="modal",onViewModeChange:s,showViewModeToggle:c=!0,showCloseButton:l=!0,size:u,asideWidth:a,disableEscapeClose:h=!1,disableBackdropClose:m=!1,lockBodyScroll:g=!0,children:y}=t,[E,j]=x.useState(o),v=i??E,k=ie.useMediaQuery("md")?v:"fullscreen",z=x.useCallback(Y=>{i===void 0&&j(Y),s==null||s(Y)},[i,s]),p=x.useRef(null);x.useEffect(()=>{if(!(!r||!g))return p.current=document.body.style.overflow,document.body.style.overflow="hidden",()=>{document.body.style.overflow=p.current??""}},[r,g]),x.useEffect(()=>{if(!r||h)return;const Y=$=>{$.key==="Escape"&&n()};return window.addEventListener("keydown",Y),()=>window.removeEventListener("keydown",Y)},[r,h,n]);const M=x.useMemo(()=>Ue(y,st),[y]),L=x.useMemo(()=>Ue(y,lt),[y]),S=x.useMemo(()=>Ue(y,ct),[y]),_=x.useMemo(()=>Ue(y,at),[y]);if(!r)return null;const I=[ce["lyd-panel"],k==="modal"&&ce["lyd-modal"],k==="fullscreen"&&ce["lyd-fullscreen"],k==="sidebar"&&ce["lyd-sidebar"]].filter(Boolean).join(" "),P={"--lyd-max-w":gi(u),...a!==void 0&&{"--lyd-aside-w":a}},W=()=>{m||n()};return e.jsxs("div",{className:ce["lyd-root"],style:P,role:"dialog","aria-modal":"true",children:[e.jsx("div",{className:ce["lyd-backdrop"],onClick:W,"aria-hidden":"true"}),e.jsxs("div",{className:I,children:[e.jsxs("div",{className:ce["lyd-header"],children:[e.jsx("div",{className:ce["lyd-header-content"],children:M}),e.jsxs("div",{className:ce["lyd-header-actions"],children:[c&&e.jsx(fi,{value:v,onChange:z}),l&&e.jsx("button",{type:"button",className:ce["lyd-close-btn"],onClick:n,"aria-label":"Close dialog",children:e.jsx(w.Icon,{name:"Cross",size:"md"})})]})]}),e.jsxs("div",{className:ce["lyd-main"],children:[e.jsx("div",{className:ce["lyd-body"],children:L}),S&&e.jsx("aside",{className:ce["lyd-aside"],children:S})]}),_&&e.jsx("div",{className:ce["lyd-footer"],children:_})]})]})}const _e=ji;_e.Header=st;_e.Body=lt;_e.Aside=ct;_e.Footer=at;function yi({url:t,filename:r,onClose:n}){return x.useEffect(()=>{const i=o=>{o.key==="Escape"&&n()};return window.addEventListener("keydown",i),()=>window.removeEventListener("keydown",i)},[n]),e.jsxs("div",{onClick:n,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:i=>i.stopPropagation(),style:{position:"absolute",top:"16px",right:"16px",display:"flex",gap:"8px"},children:[e.jsx("a",{href:t,download:r,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:n,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:t,alt:r,onClick:i=>i.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:r})]})}const pi=t=>{const{defaultTab:r=0,paramKey:n="tab"}=t||{},[i,o]=re.useSearchParams(),s=Oe.searchParamsToObject(i.toString());return{activeTab:s[n]?parseInt(s[n]):r,handleTabChange:u=>{o({...s,[n]:u.toString()})},searchQueries:s}};function bi({appName:t,menuConfig:r,formatTitle:n}){const i=re.useLocation();x.useEffect(()=>{let o=null,s=null;for(const u of r){const a=u.items.find(h=>h.to?h.to==="/"?i.pathname==="/":!!(h.to===i.pathname||i.pathname.startsWith(h.to+"/")):!1);if(a){o=a,s=u;break}}const c=[];o!=null&&o.title&&c.push(o.title),s!=null&&s.name&&c.push(s.name.toTitleCase());const l=(u,a)=>u.length>0?`${u.join(" - ")} | ${a}`:a;document.title=(n||l)(c,t)},[i.pathname])}const Ci=()=>{const[t,r]=re.useSearchParams(),n=Oe.searchParamsToObject(t.toString()),i=re.useParams(),o=re.useLocation(),s=i.id;return{setSearchParams:r,searchParams:t,searchQueries:n,isHasQuery:(h,m)=>t.has(h)&&t.get(h)===m,getQueryParam:h=>t.get(h),getRouteParam:h=>i[h],params:i,location:o,id:s,hasId:!!s}};function vi(t){var i,o;const r=t.decodedAccessToken;return x.useMemo(()=>{var u,a;const s=((a=(u=r==null?void 0:r.access)==null?void 0:u.role)==null?void 0:a.code)??"",c=Object.keys(t.role).reduce((h,m)=>{const g=`is${m.toLowerCase().replace(/(^\w|_\w)/g,y=>y.replace("_","").toUpperCase())}`;return{...h,[g]:!1}},{});return{...Object.keys(t.role).reduce((h,m)=>{const g=`is${m.toLowerCase().replace(/(^\w|_\w)/g,y=>y.replace("_","").toUpperCase())}`;return{...h,[g]:s===t.role[m]}},c),hasRole:h=>s===t.role[h],getRoleKey:()=>s}},[(o=(i=r==null?void 0:r.access)==null?void 0:i.role)==null?void 0:o.code,t])}exports.AdvanceFilterBar=kr;exports.App=Nr;exports.AppComponent=ur;exports.AppContext=wt;exports.AppLayout=Zr;exports.AsideBar=Ko;exports.BackButton=Gr;exports.ColumnFilterDropdown=Or;exports.ConfirmationDialog=di;exports.DataGrid=co;exports.DataTable=Tr;exports.DecisionWrapper=U;exports.EachUtils=it;exports.EmptyStatePage=ni;exports.FilterBar=$n;exports.FilterDrawer=Br;exports.FloatingFooter=$o;exports.ForbiddenPage=li;exports.Form=Xo;exports.FullSection=ui;exports.HeaderLeftSlot=Pr;exports.HeaderLeftSlotOutlet=fr;exports.HeaderLeftSlotProvider=hr;exports.HorizontalField=Kr;exports.ImagePreview=yi;exports.InputFile=Rr;exports.InputImage=Ar;exports.LayoutDialog=_e;exports.LayoutDialogAside=ct;exports.LayoutDialogBody=lt;exports.LayoutDialogFooter=at;exports.LayoutDialogHeader=st;exports.ModuleSwitcher=Jr;exports.ModuleSwitcherModal=yr;exports.NotFoundPage=ii;exports.PageLayout=tn;exports.Pressable=rt;exports.RightDrawer=pr;exports.ScrollToTopButton=zr;exports.Section=sn;exports.SectionFooter=Mt;exports.SectionHeader=Et;exports.SelectButton=xi;exports.ServerErrorPage=ai;exports.SidebarBadgesProvider=ar;exports.SidebarGroupSlot=_r;exports.SidebarGroupSlotOutlet=gr;exports.SidebarGroupSlotProvider=mr;exports.SidebarHeaderSlot=xr;exports.TableFooter=Ir;exports.TableHeader=Lr;exports.TableSection=io;exports.TableWrapper=Mr;exports.ToggleStatus=Yo;exports.Typography=me;exports.VerticalField=ei;exports.clearModuleSelection=qr;exports.createInitialFromUserName=fo;exports.cssVars=bo;exports.formHasChanged=Bo;exports.formatDate=yo;exports.formatDateToIndonesian=Wr;exports.formatRupiah=go;exports.getDateFilterValue=Sr;exports.getDateRangeFilterValue=vn;exports.getInitials=jo;exports.getValueDropdownMultipleFilter=wr;exports.getValueRadioFilter=Cn;exports.getValueSearch=Lt;exports.getValuesFilter=Xe;exports.handleChangeFilter=Pe;exports.handleOnScroll=Wo;exports.isEmail=Io;exports.isFilterActive=Dn;exports.isOnlyLettersAndSpaces=Fo;exports.isPhoneNumber=ko;exports.isSlug=Oo;exports.localStorageAdapter=Fr;exports.oneDayInMs=Co;exports.parseIndonesianDateToDate=mo;exports.preventNonCoordinateInput=To;exports.preventNonNumberAndDecimalInput=Lo;exports.preventNonNumberInput=Eo;exports.preventNumberInput=Mo;exports.resolveDateRangeValueToString=vr;exports.resolveDateValueToString=Dr;exports.resolveDropdownValueToString=br;exports.resolveRadioValueToString=Cr;exports.resolveSidebarBadge=Ye;exports.storageKeys=nt;exports.textWidth=vo;exports.useApp=St;exports.useAppState=lr;exports.useAuthRole=vi;exports.useDynamicTitle=bi;exports.useModuleSelection=Ft;exports.useRouteInfo=pe;exports.useRouteParams=Ci;exports.useSidebarBadges=dr;exports.useTabState=pi;Object.keys(Tt).forEach(t=>{t!=="default"&&!Object.prototype.hasOwnProperty.call(exports,t)&&Object.defineProperty(exports,t,{enumerable:!0,get:()=>Tt[t]})});Object.keys(ve).forEach(t=>{t!=="default"&&!Object.prototype.hasOwnProperty.call(exports,t)&&Object.defineProperty(exports,t,{enumerable:!0,get:()=>ve[t]})});Object.keys(f).forEach(t=>{t!=="default"&&!Object.prototype.hasOwnProperty.call(exports,t)&&Object.defineProperty(exports,t,{enumerable:!0,get:()=>f[t]})});Object.keys(Me).forEach(t=>{t!=="default"&&!Object.prototype.hasOwnProperty.call(exports,t)&&Object.defineProperty(exports,t,{enumerable:!0,get:()=>Me[t]})});Object.keys(T).forEach(t=>{t!=="default"&&!Object.prototype.hasOwnProperty.call(exports,t)&&Object.defineProperty(exports,t,{enumerable:!0,get:()=>T[t]})});Object.keys(Wt).forEach(t=>{t!=="default"&&!Object.prototype.hasOwnProperty.call(exports,t)&&Object.defineProperty(exports,t,{enumerable:!0,get:()=>Wt[t]})});Object.keys(Be).forEach(t=>{t!=="default"&&!Object.prototype.hasOwnProperty.call(exports,t)&&Object.defineProperty(exports,t,{enumerable:!0,get:()=>Be[t]})});Object.keys(fe).forEach(t=>{t!=="default"&&!Object.prototype.hasOwnProperty.call(exports,t)&&Object.defineProperty(exports,t,{enumerable:!0,get:()=>fe[t]})});Object.keys(yt).forEach(t=>{t!=="default"&&!Object.prototype.hasOwnProperty.call(exports,t)&&Object.defineProperty(exports,t,{enumerable:!0,get:()=>yt[t]})});Object.keys(Ie).forEach(t=>{t!=="default"&&!Object.prototype.hasOwnProperty.call(exports,t)&&Object.defineProperty(exports,t,{enumerable:!0,get:()=>Ie[t]})});Object.keys(ie).forEach(t=>{t!=="default"&&!Object.prototype.hasOwnProperty.call(exports,t)&&Object.defineProperty(exports,t,{enumerable:!0,get:()=>ie[t]})});Object.keys(Oe).forEach(t=>{t!=="default"&&!Object.prototype.hasOwnProperty.call(exports,t)&&Object.defineProperty(exports,t,{enumerable:!0,get:()=>Oe[t]})});Object.keys(De).forEach(t=>{t!=="default"&&!Object.prototype.hasOwnProperty.call(exports,t)&&Object.defineProperty(exports,t,{enumerable:!0,get:()=>De[t]})});Object.keys(B).forEach(t=>{t!=="default"&&!Object.prototype.hasOwnProperty.call(exports,t)&&Object.defineProperty(exports,t,{enumerable:!0,get:()=>B[t]})});Object.keys($e).forEach(t=>{t!=="default"&&!Object.prototype.hasOwnProperty.call(exports,t)&&Object.defineProperty(exports,t,{enumerable:!0,get:()=>$e[t]})});Object.keys(Ve).forEach(t=>{t!=="default"&&!Object.prototype.hasOwnProperty.call(exports,t)&&Object.defineProperty(exports,t,{enumerable:!0,get:()=>Ve[t]})});Object.keys(X).forEach(t=>{t!=="default"&&!Object.prototype.hasOwnProperty.call(exports,t)&&Object.defineProperty(exports,t,{enumerable:!0,get:()=>X[t]})});Object.keys(Rt).forEach(t=>{t!=="default"&&!Object.prototype.hasOwnProperty.call(exports,t)&&Object.defineProperty(exports,t,{enumerable:!0,get:()=>Rt[t]})});Object.keys(pt).forEach(t=>{t!=="default"&&!Object.prototype.hasOwnProperty.call(exports,t)&&Object.defineProperty(exports,t,{enumerable:!0,get:()=>pt[t]})});Object.keys(Le).forEach(t=>{t!=="default"&&!Object.prototype.hasOwnProperty.call(exports,t)&&Object.defineProperty(exports,t,{enumerable:!0,get:()=>Le[t]})});Object.keys(At).forEach(t=>{t!=="default"&&!Object.prototype.hasOwnProperty.call(exports,t)&&Object.defineProperty(exports,t,{enumerable:!0,get:()=>At[t]})});Object.keys(Ne).forEach(t=>{t!=="default"&&!Object.prototype.hasOwnProperty.call(exports,t)&&Object.defineProperty(exports,t,{enumerable:!0,get:()=>Ne[t]})});Object.keys(ae).forEach(t=>{t!=="default"&&!Object.prototype.hasOwnProperty.call(exports,t)&&Object.defineProperty(exports,t,{enumerable:!0,get:()=>ae[t]})});Object.keys(Te).forEach(t=>{t!=="default"&&!Object.prototype.hasOwnProperty.call(exports,t)&&Object.defineProperty(exports,t,{enumerable:!0,get:()=>Te[t]})});Object.keys(bt).forEach(t=>{t!=="default"&&!Object.prototype.hasOwnProperty.call(exports,t)&&Object.defineProperty(exports,t,{enumerable:!0,get:()=>bt[t]})});Object.keys(b).forEach(t=>{t!=="default"&&!Object.prototype.hasOwnProperty.call(exports,t)&&Object.defineProperty(exports,t,{enumerable:!0,get:()=>b[t]})});Object.keys(w).forEach(t=>{t!=="default"&&!Object.prototype.hasOwnProperty.call(exports,t)&&Object.defineProperty(exports,t,{enumerable:!0,get:()=>w[t]})});Object.keys(K).forEach(t=>{t!=="default"&&!Object.prototype.hasOwnProperty.call(exports,t)&&Object.defineProperty(exports,t,{enumerable:!0,get:()=>K[t]})});Object.keys(zt).forEach(t=>{t!=="default"&&!Object.prototype.hasOwnProperty.call(exports,t)&&Object.defineProperty(exports,t,{enumerable:!0,get:()=>zt[t]})});Object.keys(Ht).forEach(t=>{t!=="default"&&!Object.prototype.hasOwnProperty.call(exports,t)&&Object.defineProperty(exports,t,{enumerable:!0,get:()=>Ht[t]})});Object.keys(Vt).forEach(t=>{t!=="default"&&!Object.prototype.hasOwnProperty.call(exports,t)&&Object.defineProperty(exports,t,{enumerable:!0,get:()=>Vt[t]})});Object.keys(Nt).forEach(t=>{t!=="default"&&!Object.prototype.hasOwnProperty.call(exports,t)&&Object.defineProperty(exports,t,{enumerable:!0,get:()=>Nt[t]})});Object.keys(Pt).forEach(t=>{t!=="default"&&!Object.prototype.hasOwnProperty.call(exports,t)&&Object.defineProperty(exports,t,{enumerable:!0,get:()=>Pt[t]})});Object.keys(Se).forEach(t=>{t!=="default"&&!Object.prototype.hasOwnProperty.call(exports,t)&&Object.defineProperty(exports,t,{enumerable:!0,get:()=>Se[t]})});Object.keys(_t).forEach(t=>{t!=="default"&&!Object.prototype.hasOwnProperty.call(exports,t)&&Object.defineProperty(exports,t,{enumerable:!0,get:()=>_t[t]})});
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const hr=require("@starasia/alert"),Ze=require("@starasia/badges"),f=require("@starasia/box"),$e=require("@starasia/breadcrumb"),A=require("@starasia/button"),fr=require("@starasia/card"),Ye=require("@starasia/date"),Me=require("@starasia/dialog"),wt=require("@starasia/drawer"),tt=require("@starasia/dropdown"),ye=require("@starasia/hooks"),rt=require("@starasia/http"),Ge=require("@starasia/input"),L=require("@starasia/menu"),at=require("@starasia/pagination"),ct=require("@starasia/storage"),J=require("@starasia/table"),mr=require("@starasia/tabs"),Yt=require("@starasia/textarea"),et=require("@starasia/theme"),gr=require("@starasia/toast"),nt=require("@starasia/toggle"),Ce=require("@starasia/tooltip"),ot=require("@starasia/checkbox"),Xt=require("@starasia/radio"),w=require("@starasia/text"),k=require("@starasia/icon"),oe=require("@starasia/flex"),yr=require("@starasia/grid"),pr=require("@starasia/progress"),jr=require("@starasia/stepper"),br=require("@starasia/accordion"),Cr=require("@starasia/story-record"),Je=require("@starasia/skeleton"),vr=require("@starasia/progress-stepper"),e=require("react/jsx-runtime"),u=require("react"),ge=require("react-router"),er=require("react-dom"),Rn=require("react-easy-crop"),An={menus:[],menuBottom:void 0,logo:"",appName:"Workspace",userData:null,setUserData:()=>{}},tr=u.createContext(An),rr=()=>u.useContext(tr),qr=t=>{const[r,n]=u.useState((t==null?void 0:t.initialUserData)||null);return{userData:r,setUserData:n}},Zr=u.createContext({badges:{},setBadge:()=>{},setBadges:()=>{},clearBadge:()=>{}}),Gr=({children:t})=>{const[r,n]=u.useState({}),i=u.useCallback(l=>{n(a=>typeof l=="function"?l(a):l)},[]),o=u.useCallback((l,a)=>{n(d=>{const h=typeof a=="function"?a(d[l]):a;return{...d,[l]:h}})},[]),s=u.useCallback(l=>{n(a=>{if(!(l in a))return a;const d={...a};return delete d[l],d})},[]),c=u.useMemo(()=>({badges:r,setBadge:o,setBadges:i,clearBadge:s}),[r,o,i,s]);return e.jsx(Zr.Provider,{value:c,children:t})},Qr=()=>u.useContext(Zr),bt=(t,r)=>{const n=r!==void 0?r:t;return n==null?null:typeof n=="string"||typeof n=="number"?{value:n}:n},Ur=({router:t,menus:r=[],menuBottom:n,logo:i,appName:o="Workspace",initialUserData:s,theme:c})=>{const l=qr({initialUserData:s}),{theme:a}=et.useTheme();return e.jsx(tr.Provider,{value:{logo:i,appName:o,menus:r,userData:l.userData,setUserData:l.setUserData,menuBottom:n},children:e.jsx(Gr,{children:c?e.jsx(et.ThemeProvider,{value:c,children:t}):a?e.jsx(et.ThemeProvider,{value:a,children:t}):t})})},zn=u.memo(Ur);function Jr({collapsed:t=!1,children:r}){if(!r)return null;const n=typeof r=="function",i=n?r({collapsed:t}):r;return i==null||i===!1?null:e.jsx("div",{style:{position:"sticky",top:"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:n?i:e.jsx("div",{style:{opacity:t?0:1,transition:"opacity 0.3s",visibility:t?"hidden":"visible"},children:i})})}const nr=u.createContext(null);function Yr({children:t}){const[r,n]=u.useState(null),[i,o]=u.useState(null),[s,c]=u.useState(null),[l,a]=u.useState(0),d=u.useCallback(()=>(a(h=>h+1),()=>a(h=>h-1)),[]);return e.jsx(nr.Provider,{value:{prependNode:r,appendNode:i,replaceNode:s,setPrependNode:n,setAppendNode:o,setReplaceNode:c,replaceCount:l,registerReplace:d},children:t})}function Xr({children:t}){const r=u.useContext(nr);return r?e.jsxs(e.Fragment,{children:[e.jsx("div",{ref:r.setPrependNode,style:{display:"contents"}}),r.replaceCount>0?e.jsx("div",{ref:r.setReplaceNode,style:{display:"contents"}}):t,e.jsx("div",{ref:r.setAppendNode,style:{display:"contents"}})]}):e.jsx(e.Fragment,{children:t})}function Vn({children:t,mode:r="append"}){const n=u.useContext(nr);if(u.useEffect(()=>{if(!(r!=="replace"||!n))return n.registerReplace()},[r,n]),!n)return process.env.NODE_ENV!=="production"&&console.warn("[HeaderLeftSlot] used outside AppLayout — content not rendered"),null;const i=r==="prepend"?n.prependNode:r==="replace"?n.replaceNode:n.appendNode;return i?er.createPortal(t,i):null}const or=u.createContext(null);function Kr({children:t}){const[r,n]=u.useState({}),[i,o]=u.useState({}),s=u.useCallback((a,d)=>{n(h=>h[a]===d?h:{...h,[a]:d})},[]),c=u.useCallback(a=>(o(d=>({...d,[a]:(d[a]??0)+1})),()=>o(d=>({...d,[a]:Math.max(0,(d[a]??0)-1)}))),[]),l=u.useMemo(()=>({outletNodes:r,setOutletNode:s,slotCounts:i,registerSlot:c}),[r,s,i,c]);return e.jsx(or.Provider,{value:l,children:t})}function $r({slotKey:t,fallback:r}){const n=u.useContext(or),i=n?(n.slotCounts[t]??0)>0:!1,o=u.useRef(n==null?void 0:n.setOutletNode);o.current=n==null?void 0:n.setOutletNode;const s=u.useCallback(c=>{var l;return(l=o.current)==null?void 0:l.call(o,t,c)},[t]);return e.jsx(e.Fragment,{children:i?e.jsx("div",{ref:s,style:{display:"contents"}}):r})}function Pn({slotKey:t,children:r}){const n=u.useContext(or),i=u.useRef(n==null?void 0:n.registerSlot);if(i.current=n==null?void 0:n.registerSlot,u.useEffect(()=>{var s;return(s=i.current)==null?void 0:s.call(i,t)},[t]),!n)return process.env.NODE_ENV!=="production"&&console.warn("[SidebarGroupSlot] used outside AppLayout — content not rendered"),null;const o=n.outletNodes[t];return o?er.createPortal(r,o):null}const Dt="moduleSwitcherGroupId",Kt="sa-module-switcher-change";function wr(){if(typeof window>"u")return null;const t=window.localStorage.getItem(Dt);if(t===null)return null;const r=Number(t);return Number.isFinite(r)?r:null}function en(t){typeof window>"u"||(t===null?window.localStorage.removeItem(Dt):window.localStorage.setItem(Dt,String(t)),window.dispatchEvent(new CustomEvent(Kt,{detail:t})))}function Hn(){en(null)}function ir(){const[t,r]=u.useState(()=>wr());return u.useEffect(()=>{const i=()=>{r(wr())},o=s=>{s.key===Dt&&i()};return window.addEventListener(Kt,i),window.addEventListener("storage",o),()=>{window.removeEventListener(Kt,i),window.removeEventListener("storage",o)}},[]),{selectedGroupId:t,setSelectedGroupId:i=>{en(i),r(i)}}}let mt=0,Ue=!1,Dr=new Set;const Sr=()=>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"})]}),kr={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"};function Nn({children:t,headerLeftSlot:r,profile:n,isLoadingProfile:i,onLogout:o,isLoggingOut:s,loadingComponent:c,sidebarHeaderContent:l,headerActions:a,profileRole:d,profileMenuButtons:h,profileMenuItems:m,logoutButton:g}){var _e,Xe;const[p]=ge.useSearchParams(),M=p.get("embed")==="true",y=rr(),{badges:D}=Qr(),B=ge.useNavigate(),v=ge.useLocation(),b=!ye.useMediaQuery("md"),[O,T]=u.useState(!1),[C,I]=u.useState(!1),[N,G]=u.useState(!1),[q,X]=u.useState(!1),[ee,de]=u.useState(()=>new Set(Dr)),[se,le]=u.useState(null),{selectedGroupId:$,setSelectedGroupId:z}=ir();u.useEffect(()=>{Dr=ee},[ee]);const re=u.useRef(null),he=u.useRef(null);u.useEffect(()=>{const S=re.current;if(!S)return;const H=()=>{Ue||(mt=S.scrollTop)};return S.addEventListener("scroll",H),()=>S.removeEventListener("scroll",H)},[]);const ue=()=>{const S=re.current;S&&mt>0&&(Ue=!0,S.scrollTop=mt,requestAnimationFrame(()=>{Ue=!1}))};u.useLayoutEffect(()=>{Ue=!0,ue();const S=setTimeout(()=>{Ue=!1},300);return()=>clearTimeout(S)},[]),u.useLayoutEffect(()=>{y.menus.length>0&&(mt>0?ue():requestAnimationFrame(()=>{var H;const S=(H=re.current)==null?void 0:H.querySelector("[data-menu-active='true']");S&&S.scrollIntoView({block:"center",behavior:"instant"})}))},[y.menus]),u.useEffect(()=>{Ue=!0,ue();const S=setTimeout(ue,0),H=setTimeout(ue,50),V=setTimeout(ue,100),F=setTimeout(ue,200),Z=setTimeout(()=>{Ue=!1},300),P=setTimeout(()=>{const _=re.current,U=_==null?void 0:_.querySelector("[data-menu-active='true']");if(_&&U){const fe=_.getBoundingClientRect(),ve=U.getBoundingClientRect();ve.top>=fe.top&&ve.bottom<=fe.bottom||U.scrollIntoView({block:"center",behavior:"smooth"})}},250);return()=>{clearTimeout(S),clearTimeout(H),clearTimeout(V),clearTimeout(F),clearTimeout(Z),clearTimeout(P)}},[v.pathname]),u.useEffect(()=>{he.current&&(he.current.scrollTop=0)},[v.pathname]),u.useEffect(()=>{b&&G(!1)},[v.pathname,b]),u.useEffect(()=>{b&&I(!0)},[b]);const xe=()=>{T(!0)},De=()=>{T(!1)},Ie=()=>{T(!1),o()},ze=S=>{const H=[S.to];return S.children&&H.push(...S.children.map(V=>V.to)),H},Ve=[...y.menus.flatMap(S=>S.items.flatMap(ze)),...((_e=y.menuBottom)==null?void 0:_e.flatMap(ze))??[]],je=S=>{if(!v.pathname.startsWith(S))return!1;const H=Ve.filter(V=>v.pathname.startsWith(V)).sort((V,F)=>F.length-V.length)[0];return S===H};u.useEffect(()=>{var H;const S=V=>{var F;(F=V.children)!=null&&F.some(Z=>v.pathname.startsWith(Z.to))&&de(Z=>{const P=new Set(Z);return P.add(V.id),P})};y.menus.forEach(V=>{V.items.forEach(S)}),(H=y.menuBottom)==null||H.forEach(S)},[v.pathname,y.menus,y.menuBottom]);const be=S=>{de(H=>{const V=new Set(H);return V.has(S)?V.delete(S):V.add(S),V})};u.useEffect(()=>{y.menus.length!==0&&$!==null&&!y.menus.some(S=>S.id===$)&&z(null)},[y.menus,$,z]);const Be=u.useMemo(()=>{if($!==null)return y.menus.filter(V=>V.id===$||V.parentGroupId===$);const S=y.menus.filter(V=>V.parentGroupId===void 0),H=y.menus.filter(V=>V.parentGroupId!==void 0).flatMap(V=>V.items);return H.length===0?S:[...S,{id:18,name:"Pengaturan",items:H,parentGroupId:void 0}]},[y.menus,$]);if(M)return e.jsx("main",{style:{height:"100vh",overflowY:"auto",backgroundColor:"var(--sa-background-primary-inverse, #f8f8f8)"},children:t||e.jsx(ge.Outlet,{})});const Te=S=>{const H=S.children&&S.children.length>0,V=ee.has(S.id),F=H?S.children.some(_=>je(_.to)):je(S.to),Z=bt(S.badge,D[S.id]),P=!!Z&&C&&!b;return e.jsxs("div",{"data-menu-active":F||void 0,children:[e.jsxs("button",{onClick:_=>{if(H)if(C&&!b){const U=_.currentTarget.getBoundingClientRect();le({item:S,top:U.top,left:U.right+8})}else be(S.id);else B(S.to)},style:{width:"100%",display:"flex",alignItems:"center",justifyContent:C&&!b?"center":void 0,gap:"0.5rem",paddingLeft:C&&!b?"0":"0.5rem",paddingRight:C&&!b?"0":"0.5rem",paddingTop:"0.25rem",paddingBottom:"0.25rem",height:"2rem",borderRadius:F?"var(--sa-radii-sm, 0.375rem)":"var(--sa-radii-md, 0.5rem)",textAlign:"left",border:F?"1px solid var(--sa-border-subtle, #0b120e24)":"1px solid transparent",backgroundColor:F?"var(--sa-background-primary, #ffffff)":"transparent",color:"var(--sa-text-primary, #292a2e)",cursor:"pointer"},title:C&&!b?S.title:void 0,onMouseEnter:_=>{F||(_.currentTarget.style.backgroundColor="var(--sa-background-neutral, #f0f1f2)")},onMouseLeave:_=>{F||(_.currentTarget.style.backgroundColor="transparent")},children:[e.jsxs("span",{style:{position:"relative",display:"inline-flex",flexShrink:0},children:[e.jsx(k.Icon,{name:S.icon,size:"sm",style:{flexShrink:0}}),P&&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)"}})]}),(!C||b)&&e.jsxs(e.Fragment,{children:[e.jsx("span",{style:{fontSize:"0.875rem",fontWeight:"500",whiteSpace:"nowrap",transition:"opacity 0.3s",flex:1,minWidth:0,overflow:"hidden",textOverflow:"ellipsis"},children:S.title}),Z&&e.jsx(Ze.Badges,{text:String(Z.value),variant:Z.variant??"info",size:"xs",border:!0}),H&&e.jsx("svg",{style:{width:"1rem",height:"1rem",flexShrink:0,transition:"transform 0.2s",transform:V?"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"})})]})]}),H&&(!C||b)&&(()=>{const _=S.children.findIndex(U=>je(U.to));return e.jsxs("div",{style:{position:"relative",marginLeft:"0.9375rem",paddingLeft:"1.125rem",overflow:"hidden",transition:"all 0.3s ease-in-out",maxHeight:V?`${S.children.length*36}px`:"0px",opacity:V?1:0,marginTop:V?"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"}}),_>=0&&e.jsx("span",{"aria-hidden":"true",style:{position:"absolute",left:0,top:`${_*32}px`,width:"1.5px",height:"32px",backgroundColor:"var(--sa-text-primary, #292a2e)",transition:"top 0.2s ease-in-out",pointerEvents:"none",zIndex:1}}),S.children.map(U=>{const fe=bt(U.badge,D[U.id]);return e.jsxs("button",{onClick:()=>B(U.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:je(U.to)?"var(--sa-radii-sm, 0.375rem)":"var(--sa-radii-md, 0.5rem)",textAlign:"left",backgroundColor:je(U.to)?"var(--sa-background-primary, #ffffff)":"transparent",color:je(U.to)?"var(--sa-text-primary, #292a2e)":"var(--sa-text-subtle, #505258)",cursor:"pointer",border:je(U.to)?"1px solid var(--sa-border-subtle, #0b120e24)":"1px solid transparent"},onMouseEnter:ve=>{je(U.to)||(ve.currentTarget.style.backgroundColor="var(--sa-background-neutral, #f0f1f2)")},onMouseLeave:ve=>{je(U.to)||(ve.currentTarget.style.backgroundColor="transparent")},children:[e.jsx(k.Icon,{name:U.icon,size:"sm",style:{flexShrink:0}}),e.jsx("span",{style:{fontSize:"0.875rem",fontWeight:"500",whiteSpace:"nowrap",flex:1,minWidth:0,overflow:"hidden",textOverflow:"ellipsis"},children:U.title}),fe&&e.jsx(Ze.Badges,{text:String(fe.value),variant:fe.variant??"info",size:"xs",border:!0})]},U.id)})]})})()]},S.id)};return e.jsx(Kr,{children:e.jsxs(Yr,{children:[e.jsxs("div",{style:{display:"flex",height:"100vh",position:"relative","--app-sidebar-width":b?"0px":C?"4.375rem":"16.375rem","--app-footer-zindex":b&&N?"40":"999"},children:[b&&e.jsx("div",{style:{position:"fixed",inset:0,backgroundColor:"var(--sa-color-black-alpha-a50, #181a198f)",zIndex:40,opacity:N?.5:0,pointerEvents:N?"auto":"none",transition:"opacity 0.3s"},onClick:()=>G(!1)}),e.jsxs("aside",{style:{width:b?"16.375rem":C?"4.375rem":"16.375rem",position:b?"fixed":"relative",...b&&{inset:0,zIndex:50,transform:N?"translateX(0)":"translateX(-100%)"},backgroundColor:"var(--sa-background-primary-inverse, #f8f8f8)",borderRight:"1px solid var(--sa-border-subtle, #0b120e24)",display:"flex",flexDirection:"column",transition:"all 0.3s ease-in-out",flexShrink:b?void 0:0},children:[e.jsx("div",{onMouseEnter:()=>X(!0),onMouseLeave:()=>X(!1),style:{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 S=!b&&C&&!N,H=S&&q;return e.jsxs(e.Fragment,{children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"0.5rem",flex:S?1:void 0,justifyContent:S?"center":void 0,transition:"opacity 0.2s",opacity:H?0:1,pointerEvents:H?"none":"auto"},children:[e.jsx("img",{src:y.logo,alt:"Logo",style:{width:"2rem",height:"2rem",flexShrink:0}}),(!C||N)&&e.jsx("span",{style:{fontWeight:"600",color:"var(--sa-text-primary, #292a2e)",whiteSpace:"nowrap",transition:"opacity 0.3s"},children:y.appName})]}),!b&&!C&&e.jsx("button",{type:"button",onClick:()=>I(!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(Sr,{})}),S&&e.jsx("button",{type:"button",onClick:()=>I(!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:H?1:0,pointerEvents:H?"auto":"none",transition:"opacity 0.2s"},children:e.jsx("span",{style:{width:"1rem",height:"1rem",display:"inline-flex"},children:e.jsx(Sr,{})})}),b&&e.jsx("button",{onClick:()=>G(!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"})})})]})})()}),l&&e.jsx(Jr,{collapsed:b?!1:C,children:l}),e.jsx("div",{ref:re,style:{flex:1,overflowY:"auto",paddingTop:"1rem",paddingBottom:"1rem"},children:Be.map(S=>e.jsxs("div",{style:{marginBottom:"1rem"},children:[!C||b?S.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:S.name}):S.name&&e.jsx("div",{"aria-label":S.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:S.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:S.slotKey?e.jsx($r,{slotKey:S.slotKey,fallback:S.items.map(H=>Te(H))}):S.items.map(H=>Te(H))})]},S.id))}),y.menuBottom&&y.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:y.menuBottom.map(S=>Te(S))})]}),e.jsxs("div",{style:{flex:1,display:"flex",flexDirection:"column",overflow:"hidden"},children:[e.jsxs("header",{style:{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:"1rem"},children:[b&&e.jsx("button",{onClick:()=>G(!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(Xr,{children:r})]}),e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"0.75rem"},children:[a,e.jsxs(L.Menu,{position:"bottom-right",children:[e.jsx(L.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:"0.875rem",fontWeight:500,color:"var(--sa-text-subtle, #8c8f97)",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:i?"Loading...":(n==null?void 0:n.name)||"unknown"}),e.jsx("p",{style:{margin:0,fontSize:"0.75rem",color:"var(--sa-text-subtle, #8c8f97)",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:i?"":(n==null?void 0:n.email)||"unknown"})]}),e.jsx("div",{style:{width:"2.5rem",height:"2.5rem",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:((n==null?void 0:n.name)||"U")[0].toUpperCase()}),e.jsx(k.Icon,{name:"ChevronDown",size:"sm",style:{color:"var(--sa-text-subtle, #8c8f97)"}})]})}),e.jsxs(L.MenuLists,{style:{width:"280px",paddingBlock:"12px",paddingInline:"12px",gap:"8px",marginTop:"16px"},children:[e.jsx(L.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:((n==null?void 0:n.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:(n==null?void 0:n.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:(n==null?void 0:n.email)||"unknown"}),d&&e.jsx("p",{style:{margin:0,fontSize:"0.75rem",color:"var(--sa-text-subtle, #8c8f97)",maxWidth:"100%",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:d})]})}),(h&&h.length>0||m)&&e.jsxs(L.MenuBody,{children:[h==null?void 0:h.map((S,H)=>e.jsx(L.MenuButton,{children:e.jsxs("button",{type:"button",onClick:S.onClick,style:kr,onMouseEnter:V=>{V.currentTarget.style.backgroundColor="var(--sa-background-neutral, #f0f1f2)"},onMouseLeave:V=>{V.currentTarget.style.backgroundColor="transparent"},children:[e.jsx(k.Icon,{name:S.icon,size:"md"}),e.jsx("span",{children:S.label})]})},`${S.label}-${H}`)),m]}),g??e.jsx(L.MenuFooter,{children:e.jsx(L.MenuButton,{children:e.jsxs("button",{type:"button",onClick:xe,style:{...kr,color:"var(--sa-background-error, #c9184a)",fontWeight:500},onMouseEnter:S=>{S.currentTarget.style.backgroundColor="var(--sa-color-error-50, #fff0f3)"},onMouseLeave:S=>{S.currentTarget.style.backgroundColor="transparent"},children:[e.jsx(k.Icon,{name:"Logout",size:"md",style:{color:"var(--sa-background-error, #c9184a)"}}),e.jsx("span",{children:"Logout"})]})})})]})]})]})]}),e.jsx("main",{ref:he,style:{flex:1,overflowY:"auto"},children:t||e.jsx(ge.Outlet,{})})]})]}),s&&c&&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:c}),e.jsxs(Me.Dialog,{isShow:O,onHide:De,children:[e.jsx(Me.DialogTitle,{children:"Confirmation Logout"}),e.jsx(Me.DialogBody,{children:"Are you sure you want to end the session and exit the page?"}),e.jsx(Me.DialogFooter,{children:e.jsx(f.Box,{direction:"column",display:"flex",align:"flex-end",justify:"center",children:e.jsxs(oe.Flex,{direction:"row",gap:"sm",align:"center",children:[e.jsx(f.Box,{direction:"column",children:e.jsx(A.Button,{secondary:!0,onClick:De,children:"Cancel"})}),e.jsx(f.Box,{direction:"column",children:e.jsx(A.Button,{primary:!0,onClick:Ie,children:"Yes, Sure"})})]})})})]}),se&&e.jsxs(e.Fragment,{children:[e.jsx("div",{onClick:()=>le(null),style:{position:"fixed",inset:0,zIndex:60,backgroundColor:"transparent"}}),e.jsxs("div",{role:"dialog","aria-label":se.item.title,style:{position:"fixed",top:se.top,left:se.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:se.item.title}),(Xe=se.item.children)==null?void 0:Xe.map(S=>{const H=je(S.to),V=bt(S.badge,D[S.id]);return e.jsxs("button",{onClick:()=>{B(S.to),le(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:H?"var(--sa-color-gray-100, #f8f8f8)":"transparent",color:H?"var(--sa-text-primary, #292a2e)":"var(--sa-color-gray-800, #505258)",border:"1px solid transparent",cursor:"pointer",fontSize:"0.875rem",fontWeight:500},onMouseEnter:F=>{H||(F.currentTarget.style.backgroundColor="var(--sa-color-gray-100, #f8f8f8)")},onMouseLeave:F=>{H||(F.currentTarget.style.backgroundColor="transparent")},children:[S.icon&&e.jsx(k.Icon,{name:S.icon,size:"sm",style:{flexShrink:0}}),e.jsx("span",{style:{flex:1,whiteSpace:"nowrap"},children:S.title}),V&&e.jsx(Ze.Badges,{text:String(V.value),variant:V.variant??"info",size:"xs",border:!0})]},S.id)})]})]})]})})}const kt=u.forwardRef(({children:t,...r},n)=>e.jsx(f.Box,{ref:n,role:"button",cursor:"pointer","aria-pressed":"true",display:"inline-block",tabIndex:0,...r,children:t})),Br=({title:t,iconName:r,textColor:n,iconColor:i,hoverTextColor:o,hoverIconColor:s})=>{const[c,l]=u.useState(!1),a=i??"var(--sa-text-subtle, #8c8f97)",d=n??"var(--sa-text-subtle, #8c8f97)",h=s??"var(--sa-text-subtle, #8c8f97)",m=o??"var(--sa-text-primary, #292a2e)";return e.jsxs(f.Box,{direction:"row",gap:"xs",align:"center",onMouseEnter:()=>l(!0),onMouseLeave:()=>l(!1),style:{cursor:"pointer"},children:[e.jsx(k.Icon,{name:r||"ChevronLeft",size:"xs",style:{color:c?h:a,transition:"color 0.15s ease"}}),e.jsx(w.Text,{variant:"sub-h3",style:{color:c?m:d,transition:"color 0.15s ease"},children:t||"Back"})]})},_n=({items:t,separator:r="/",iconName:n,iconColor:i,hoverIconColor:o})=>{const[s,c]=u.useState(!1),l=i??"var(--sa-text-subtle, #8c8f97)",a=o??"var(--sa-text-subtle, #8c8f97)",d=t.length>1?t[0]:void 0,h=!!(d!=null&&d.to||d!=null&&d.onClick),m=e.jsx(k.Icon,{name:n||"ChevronLeft",size:"xs",onMouseEnter:h?()=>c(!0):void 0,onMouseLeave:h?()=>c(!1):void 0,style:{color:h&&s?a:l,transition:"color 0.15s ease",cursor:h?"pointer":void 0}}),g=d!=null&&d.to?e.jsx(ge.Link,{to:d.to,replace:!0,style:{textDecoration:"none"},children:m}):d!=null&&d.onClick?e.jsx(kt,{onClick:d.onClick,children:m}):m;return e.jsxs(f.Box,{direction:"row",gap:"xs",align:"center",children:[g,e.jsx($e.Breadcrumb,{separator:r,size:"md",children:t.map((p,M)=>{const y=M===t.length-1;return p.to&&!y?e.jsx($e.BreadcrumbItem,{children:e.jsx(ge.Link,{to:p.to,children:p.label})},M):e.jsx($e.BreadcrumbItem,{currentPage:y,children:e.jsx($e.BreadcrumbLink,{onClick:y?void 0:p.onClick,children:p.label})},M)})})]})},qn=t=>{const{items:r,separator:n,onClick:i,navigateTo:o,...s}=t;return r&&r.length>0?e.jsx(_n,{items:r,separator:n,iconName:s.iconName,iconColor:s.iconColor,hoverIconColor:s.hoverIconColor}):o?e.jsx(f.Box,{direction:"row",children:e.jsx(ge.Link,{to:o,replace:!0,style:{textDecoration:"none"},children:e.jsx(Br,{...s})})}):e.jsx(f.Box,{direction:"row",children:e.jsx(kt,{onClick:i,children:e.jsx(Br,{...s})})})},Pt=[{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 Fr(t,r,n){return{display:"flex",alignItems:"center",justifyContent:"center",width:"64px",height:"64px",borderRadius:"var(--sa-radii-sm, 6px)",border:t?`2px solid ${n.activeBorder}`:"2px solid var(--sa-color-gray-200, #f0f1f2)",backgroundColor:t?n.activeBg:"var(--sa-color-gray-50, #ffffff)",boxShadow:t?r?`0 8px 20px ${n.activeShadow.replace("0.25","0.35")}`:`0 2px 8px ${n.activeShadow}`:r?"0 8px 20px rgba(0, 0, 0, 0.14)":"0 1px 4px rgba(0, 0, 0, 0.08)",transform:r?"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 Er={fontSize:"11px",fontWeight:500,textAlign:"center",overflowWrap:"normal",wordBreak:"normal",color:"var(--sa-background-primary, #ffffff)",lineHeight:"1.3",maxWidth:"80px"},Mr={display:"flex",flexDirection:"column",alignItems:"center",gap:"8px",background:"none",border:"none",cursor:"pointer",padding:0};function tn({isShow:t,onHide:r,menus:n,selectedGroupId:i,onSelect:o}){const[s,c]=u.useState(void 0),l=d=>{o(d),r()},a=Pt[0];return e.jsx(Me.Dialog,{isShow:t,onHide:r,style:{width:560,background:"transparent",boxShadow:"none",border:"none"},children:e.jsx(Me.DialogBody,{children:e.jsxs("div",{style:{display:"grid",gridTemplateColumns:"repeat(5, 1fr)",gap:"16px"},children:[e.jsxs("button",{onClick:()=>l(null),onMouseEnter:()=>c("all"),onMouseLeave:()=>c(void 0),style:Mr,children:[e.jsx("div",{style:Fr(i===null,s==="all",a),children:e.jsx("div",{style:{color:a.icon,display:"flex",alignItems:"center",justifyContent:"center"},children:e.jsx(k.Icon,{name:"Grid",size:"lg",style:{width:32,height:32}})})}),e.jsx("span",{style:Er,children:"Semua"})]}),n.map((d,h)=>{var y;const m=i===d.id,g=s===d.id,p=((y=d.items[0])==null?void 0:y.icon)??"Grid",M=Pt[(h+1)%Pt.length];return e.jsxs("button",{onClick:()=>l(d.id),onMouseEnter:()=>c(d.id),onMouseLeave:()=>c(void 0),style:Mr,children:[e.jsx("div",{style:Fr(m,g,M),children:e.jsx("div",{style:{color:M.icon,display:"flex",alignItems:"center",justifyContent:"center"},children:e.jsx(k.Icon,{name:p,size:"lg",style:{width:32,height:32}})})}),e.jsx("span",{style:Er,children:d.name})]},d.id)})]})})})}function Zn({onSelect:t,"aria-label":r="Pilih module"}={}){const n=rr(),i=ge.useNavigate(),{selectedGroupId:o,setSelectedGroupId:s}=ir(),[c,l]=u.useState(!1),a=d=>{var h;if(s(d),d!==null){const m=n.menus.find(p=>p.id===d),g=(h=m==null?void 0:m.items[0])==null?void 0:h.to;g&&i(g)}t==null||t(d)};return e.jsxs(e.Fragment,{children:[e.jsxs("div",{style:{position:"relative"},children:[e.jsx("button",{onClick:()=>l(!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":r,onMouseEnter:d=>{d.currentTarget.style.backgroundColor="var(--sa-background-primary-inverse, #f8f8f8)"},onMouseLeave:d=>{d.currentTarget.style.backgroundColor="transparent"},children:e.jsx(k.Icon,{name:"GridApplication",size:"sm"})}),o!==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(tn,{isShow:c,onHide:()=>l(!1),menus:n.menus.filter(d=>d.parentGroupId===void 0),selectedGroupId:o,onSelect:a})]})}const Gn=(t,r)=>{const n=[];if(r===0)return n.push(t),n;for(let i=0;i<t.length;i+=r){const o=t.slice(i,i+r);n.push(o)}return n},Qn=u.memo(({value:t,label:r,separator:n,labelWidth:i,lastIndex:o,labelAlign:s="top"})=>{const c=u.useMemo(()=>({padding:0,paddingBottom:o?0:12,verticalAlign:s}),[o,s]),l=u.useMemo(()=>({padding:0,paddingRight:12,paddingLeft:12,paddingBottom:o?0:12,verticalAlign:s}),[o,s]),a=()=>typeof r=="string"?e.jsx(w.Text,{fontWeight:"medium",color:"subtlest",children:r}):r,d=()=>typeof t=="string"||typeof t=="number"?e.jsx(w.Text,{color:"primary",fontWeight:"medium",children:t}):t,h=()=>typeof n=="string"||typeof n=="number"?e.jsx(w.Text,{fontWeight:"medium",color:"subtlest",children:n}):n;return e.jsxs(J.Tr,{children:[e.jsx(J.Td,{style:c,width:i,children:a()}),n?e.jsx(J.Td,{style:l,width:24,children:h()}):null,e.jsx(J.Td,{style:c,children:d()})]})}),Un=u.memo(({fields:t,separator:r,labelWidth:n})=>e.jsx(J.Table,{children:t.map((i,o)=>e.jsx(Qn,{separator:r,labelWidth:n,lastIndex:o===t.length-1,...i},`field-group-field-${o}`))})),Jn=u.memo(({maxRow:t=0,maxColumn:r=2,separator:n=":",fields:i=[],labelWidth:o=150,bordered:s=!1})=>{const c=u.useMemo(()=>Gn(i,t),[i,t]),l=c.length>2,a=()=>{switch(r){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:l?void 0:"lg",direction:"row",flexWrap:"wrap",borderRadius:"rounded-sm",padding:"lg",paddingBottom:l?"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((d,h)=>e.jsx(f.Box,{direction:"column",flex:l?void 0:"1",width:l?a():void 0,marginBottom:l?"lg":void 0,children:e.jsx(Un,{labelWidth:o,fields:d,separator:n})},h))})}),Yn=({backButton:t})=>{const[r,n]=u.useState(!1),i=(t==null?void 0:t.iconColor)??"var(--sa-text-subtle, #8c8f97)",o=(t==null?void 0:t.textColor)??"var(--sa-text-subtle, #8c8f97)",s=(t==null?void 0:t.hoverIconColor)??"var(--sa-text-subtle, #8c8f97)",c=(t==null?void 0:t.hoverTextColor)??"var(--sa-text-primary, #292a2e)";return e.jsxs(f.Box,{direction:"row",gap:"xs",align:"center",onMouseEnter:()=>n(!0),onMouseLeave:()=>n(!1),style:{cursor:"pointer"},children:[e.jsx(k.Icon,{name:(t==null?void 0:t.iconName)||"ChevronLeft",size:"xs",style:{color:r?s:i,transition:"color 0.15s ease"}}),e.jsx(w.Text,{variant:"sub-h3",style:{color:r?c:o,textDecoration:r?"underline":"none",transition:"color 0.15s ease"},children:(t==null?void 0:t.title)||"Back"})]})},Xn=({backButton:t,title:r,titleIcon:n,titleTag:i,children:o,header:s=!0,headerBorder:c=!1,subHeaders:l,action:a,titleTagProps:d,containerProps:h,headerProps:m})=>{const g=ye.useMediaQuery("md"),p=ge.useNavigate(),M=ge.useLocation(),y=t==null?void 0:t.show,D=()=>{if(typeof(t==null?void 0:t.onClick)=="function"){t.onClick();return}p(-1,{replace:!0})},B=()=>{if(!a)return null;if(u.isValidElement(a))return a;const C=a.filter(I=>I&&(I.title||I.icon));return C.length===0?null:g?e.jsx(f.Box,{direction:"row",gap:"md",children:C.map(({title:I,icon:N,buttonProps:G,onClick:q},X)=>e.jsx(A.Button,{iconLeft:N?e.jsx(k.Icon,{name:N,size:"md"}):void 0,onClick:q,...G,children:I},`action-${X}`))}):e.jsxs(L.Menu,{position:"bottom-right",children:[e.jsx(L.MenuButton,{children:e.jsx(A.Button,{variant:"tertiary",size:"sm",iconLeft:e.jsx(k.Icon,{name:"MenuBurger"}),"aria-label":"Actions"})}),e.jsx(L.MenuLists,{children:e.jsx(L.MenuBody,{style:{minWidth:200},children:C.map(({title:I,icon:N,buttonProps:G,onClick:q},X)=>{const ee=(G==null?void 0:G.tone)==="error"||(G==null?void 0:G.danger)===!0;return e.jsx(L.MenuItem,{intent:ee?"danger":void 0,disabled:G==null?void 0:G.disabled,startIcon:N?e.jsx(k.Icon,{name:N}):void 0,onClick:q,children:I},`action-${X}`)})})})]})},v=()=>{const C=e.jsx(Yn,{backButton:t});return t!=null&&t.navigateTo?e.jsx(f.Box,{direction:"row",children:e.jsx(ge.Link,{to:t.navigateTo,replace:!0,style:{textDecoration:"none"},children:C})}):e.jsx(f.Box,{direction:"row",children:e.jsx(kt,{onClick:D,children:C})})},R=()=>{const C=!!r,I=Array.isArray(a)&&a.length>0,N=u.isValidElement(a)?!0:I;if(!C&&!N&&!y)return null;const q=g||!g&&I;return e.jsxs(f.Box,{direction:"column",gap:"xs",paddingBlock:(m==null?void 0:m.paddingBlock)??"sm",paddingInline:(m==null?void 0:m.paddingInline)??"md",...m,style:{...c?{borderBottom:"1px solid var(--sa-border-subtle, #0b120e24)"}:{},...m==null?void 0:m.style},children:[y&&v(),(C||N)&&e.jsxs(f.Box,{direction:q?"row":"column",gap:"sm",justify:"space-between",align:q?"center":"flex-start",children:[C?typeof r=="string"?e.jsxs(f.Box,{direction:"row",gap:"lg",align:"center",children:[e.jsxs(f.Box,{direction:"row",gap:"sm",align:"center",children:[n&&e.jsx(k.Icon,{name:n,size:"md",color:"primary"}),e.jsx(w.Text,{variant:"h3",fontWeight:"semibold",fontFamily:"Poppins",children:r})]}),i&&e.jsx(Ze.Badge,{border:!0,size:"lg",text:i,...d})]}):r:null,B()]})]})},b=()=>{if(!l||l.length===0)return null;let C=0,I=-1/0;return l.forEach((N,G)=>{const q=N.order??0;q>=I&&(I=q,C=G)}),l.map(({content:N,order:G,borderBottom:q=!0},X)=>e.jsx(f.Box,{direction:"column",paddingTop:"sm",paddingBottom:q||X===C?"sm":"spacing-0",paddingInline:"md",style:{...q?{borderBottom:"1px solid var(--sa-border-subtle, #0b120e24)"}:{},...G!==void 0?{order:G}:{}},children:N},`sub-header-${X}`))},O=()=>{const C=s?R():null,I=b();return!C&&!I?null:e.jsxs(f.Box,{direction:"column",style:{marginBottom:l&&l.length>0?"var(--sa-spacing-0)":"var(--sa-spacing-md)"},children:[C,I]})},T=()=>o;return e.jsxs(f.Box,{direction:"column",as:"main",...h,style:{...(h==null?void 0:h.style)??{},animation:"pageLayoutEnter 320ms cubic-bezier(0.16, 1, 0.3, 1) backwards"},children:[O(),T()]},M.pathname)},Kn=u.memo(Xn),$n={icon:"Cross",title:""},eo="calc(100vw - 16px)",Lr=t=>t==null?void 0:`min(${typeof t=="number"?`${t}px`:t}, ${eo})`,rn=u.forwardRef(({onHide:t,show:r,withBlur:n=!1,style:i,children:o,closeButton:s=$n,width:c,minWidth:l="357px",maxWidth:a="357px"},d)=>{const h=Lr(c??l),m=Lr(c??a);return e.jsx(wt.Drawer,{blur:n,isShow:r,position:"right",onHide:t,ref:d,style:{minWidth:h,maxWidth:m,...i},children:e.jsxs(f.Box,{direction:"column",padding:"lg",children:[s?e.jsxs(f.Box,{direction:"row",align:"center",gap:"sm",onClick:t,marginBottom:"lg",cursor:"pointer",children:[e.jsx(k.Icon,{name:s.icon,size:"md",color:"subtle",cursor:"pointer"}),s.title?e.jsx(w.Text,{fontFamily:"Poppins",fontSize:"md",color:"subtlest",children:s.title}):null]}):null,o]})})}),sr=u.memo(({children:t,borderBottom:r=!0,padding:n=!0})=>{const i=ye.useMediaQuery("lg");return e.jsx(f.Box,{direction:"column",padding:n?"md":"spacing-0",paddingLeft:n?"md":"spacing-0",paddingRight:n?"md":"spacing-0",style:r?{borderBottom:"1px solid var(--sa-border-subtle, #0b120e24)"}:void 0,children:t})}),lr=u.memo(({children:t,borderTop:r=!0,padding:n=!0})=>{const i=ye.useMediaQuery("lg");return e.jsx(f.Box,{direction:"column",padding:n?"md":"spacing-0",paddingLeft:n?"md":"spacing-0",paddingRight:n?"md":"spacing-0",style:r?{borderTop:"1px solid var(--sa-border-subtle, #0b120e24)"}:void 0,children:t})}),to=u.memo(({children:t,...r})=>e.jsx(f.Box,{direction:"column",padding:"md",paddingLeft:"md",paddingRight:"md",gap:"md",...r,children:t})),ro=u.memo(({children:t,title:r,titleTag:n,action:i,header:o,footer:s,actionContainer:c,containerProps:l,bodyProps:a,headerProps:d={borderBottom:!0},footerProps:h={borderTop:!0},variantTag:m="info"})=>{const g=ye.useMediaQuery("lg"),p=()=>n?e.jsxs(f.Box,{direction:"row",gap:"sm",align:"center",children:[e.jsx(w.Text,{fontWeight:"medium",children:r}),e.jsx(Ze.Badges,{border:!0,text:n,variant:m})]}):e.jsx(w.Text,{fontWeight:"medium",children:r}),M=()=>o||e.jsxs(f.Box,{direction:"row",justify:"space-between",align:"flex-start",gap:"md",children:[e.jsx(f.Box,{direction:"column",children:r?p():null}),e.jsx(f.Box,{direction:"column",style:g?{width:"100%",maxWidth:"19.313rem"}:{flex:1},...c,children:i??null})]}),y=!!(o||r||i);return e.jsxs(f.Box,{direction:"column",bg:"white",borderRadius:"rounded-xs",as:"section",borderWidth:"border",borderStyle:"border-solid",borderColor:"border-base",...l,style:{backgroundColor:"var(--sa-background-primary, #ffffff)",...(l==null?void 0:l.style)??{}},children:[o!==null&&y?e.jsx(sr,{...d,children:M()}):null,e.jsx(to,{...a,children:t}),s?e.jsx(lr,{...h,children:s}):null]})}),no=t=>e.jsx(w.Text,{variant:"h1",children:t.children,...t.props}),oo=t=>e.jsx(w.Text,{variant:"h2",children:t.children,...t.props}),io=t=>e.jsx(w.Text,{variant:"h3",children:t.children,...t.props}),so=t=>e.jsx(w.Text,{variant:"h4",children:t.children,...t.props}),lo=t=>e.jsx(w.Text,{variant:"h5",children:t.children,...t.props}),co=t=>e.jsx(w.Text,{variant:"h6",children:t.children,...t.props}),ao=t=>e.jsx(w.Text,{variant:"sub-h1",children:t.children,...t.props}),uo=t=>e.jsx(w.Text,{variant:"sub-h2",children:t.children,...t.props}),xo=t=>e.jsx(w.Text,{variant:"sub-h3",children:t.children,...t.props}),ho=t=>e.jsx(w.Text,{variant:"body-1",children:t.children,...t.props}),fo=t=>e.jsx(w.Text,{variant:"body-2",children:t.children,...t.props}),mo=t=>e.jsx(w.Text,{variant:"body-3",children:t.children,...t.props}),Le={H1:no,H2:oo,H3:io,H4:so,H5:lo,H6:co,SubH1:ao,SubH2:uo,SubH3:xo,Body1:ho,Body2:fo,Body3:mo},ke=()=>{const[t,r]=ge.useSearchParams(),n=rt.searchParamsToObject(t.toString()),i=ge.useParams(),o=ge.useLocation(),s=i.id;return{setSearchParams:r,searchParams:t,searchQueries:n,isHasQuery:(h,m)=>t.has(h)&&t.get(h)===m,getQueryParam:h=>t.get(h),getRouteParam:h=>i[h],params:i,location:o,id:s,hasId:!!s}},nn=t=>JSON.stringify(t),on=t=>JSON.stringify(t),sn=t=>JSON.stringify(t),ln=t=>JSON.stringify(t),go=t=>t,yo=t=>JSON.stringify(t),dt=({value:t,name:r,type:n,withSearchParam:i=!0,setSearchParams:o,searchQueries:s,dropdownSearchKey:c,filterKey:l="filter",pageKey:a="page"})=>{if(i){let d;switch(n){case"search":d=go(t);break;case"dropdown":case"dropdown-multiple":d=nn(t);break;case"radio":d=on(t);break;case"date-range":d=sn(t);break;case"advanced-date-range":d=yo(t);break;case"date":d=ln(t);break;default:d=t;break}if(typeof d<"u"){const m={...s[l]&&typeof s[l]=="string"?JSON.parse(s[l]):void 0,[r]:d},g={...s};c&&typeof c=="string"&&delete g[c],delete g[a];const p={...g,[l]:JSON.stringify(m)},M=new URLSearchParams(s).toString(),y=new URLSearchParams(p).toString();if(M===y)return;o(p)}}},Ct=({name:t,filterKey:r="filter",searchParams:n,get:i})=>{const o=n.get(r)||void 0,s=o&&typeof o=="string"?JSON.parse(o):void 0,c=s?s[t]:void 0;return i==="label"&&c?JSON.parse(c)[0].label:i==="value"&&c?JSON.parse(c)[0].value:c},cn=({name:t,filterKey:r="filter",searchParams:n,get:i})=>{const o=n.get(r)||void 0,s=o&&typeof o=="string"?JSON.parse(o):void 0,c=s?s[t]:void 0;return i==="label"&&c?JSON.parse(c).map(l=>l.label):i==="value"&&c?JSON.parse(c).map(l=>l.value):i==="array"&&c?JSON.parse(c):c},po=({name:t,filterKey:r="filter",searchParams:n,get:i})=>{const o=n.get(r)||void 0,s=o&&typeof o=="string"?JSON.parse(o):void 0,c=s?s[t]:void 0;return i==="id"&&c?JSON.parse(c).id:i==="label"&&c?JSON.parse(c).label:i==="value"&&c?JSON.parse(c).value:c},Bt=(t,r,n)=>{const i=r.get(n||"filter")||void 0,o=i&&typeof i=="string"?JSON.parse(i):void 0;return o?o[t]:void 0},jo=({name:t,filterKey:r="filter",searchParams:n})=>{const i=n.get(r||"filter")||void 0,o=i&&typeof i=="string"?JSON.parse(i):void 0,s=o?o[t]:void 0;return{start:s?JSON.parse(s).from:void 0,end:s?JSON.parse(s).to:void 0}},an=({name:t,filterKey:r="filter",searchParams:n})=>{const i=n.get(r||"filter")||void 0,o=i&&typeof i=="string"?JSON.parse(i):void 0,s=o?o[t]:void 0;return s?JSON.parse(s):void 0},bo=(t,{filterKey:r="filter",perPageKey:n="perPage",pageKey:i="page"})=>{const o=t.get(r)||void 0,s=t.get(n)||void 0,c=t.get(i)||void 0;return!!o||!!s||!!c},dn=({isOpen:t,onClose:r,filterKey:n,pageKey:i,filters:o})=>{const{searchParams:s,setSearchParams:c,searchQueries:l}=ke(),[a,d]=u.useState({}),h=()=>{s.delete(n||"filter"),c(s)},m=(g,p)=>{switch(g.type){case"radio":{const{show:M=!0}=g;return M&&e.jsx(f.Box,{direction:"column",children:e.jsx(f.Box,{direction:"column",children:g.title})},p)}case"dropdown":{const{show:M=!0}=g;return M&&e.jsx(f.Box,{direction:"column",children:e.jsx(f.Box,{direction:"column",children:g.title})},p)}case"date-range":return e.jsx(f.Box,{direction:"column",children:e.jsx(f.Box,{direction:"column",children:g.title})},p);case"date":return e.jsx(f.Box,{direction:"column",children:e.jsx(f.Box,{direction:"column",children:g.title})},p);case"dropdown-multiple":{const{show:M=!0}=g;return M&&e.jsx(f.Box,{direction:"column",children:e.jsx(f.Box,{direction:"column",children:g.title})},p)}default:return null}};return e.jsx(rn,{onHide:r,show:t||!1,children:e.jsxs(f.Box,{direction:"column",gap:"md",children:[e.jsxs(oe.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:h,children:"Reset"})]}),o==null?void 0:o.map((g,p)=>m(g,p))]})})},un=({searchKey:t="q",statusKey:r="status",searchPlaceholder:n="Search",searchHighlightPlaceholder:i,extendedFilter:o,showSearchFilter:s=!0,showStatusFilter:c=!0,filterKey:l="filter",pageKey:a="page",customWidthSearch:d,handleOnReset:h,filterConfigs:m,buttonToggleProps:g,position:p="right",titleSearchLabel:M="Work Order",withTitleLabels:y=!1})=>{const B=(g==null?void 0:g.isShowLabel)??!0,[v,R]=u.useState(!1),[b,O]=u.useState(0),T=()=>{O(z=>z+1)},{searchParams:C,setSearchParams:I,getQueryParam:N}=ke(),G=rt.searchParamsToObject(C.toString()),q=Bt(t,C,l)||"",[X,ee]=u.useState(q),de=N(l),le=!!(de&&!(()=>{if(de)try{const z=JSON.parse(de);return Object.keys(z).length===1&&z[t]===""}catch(z){console.error("Filter parameter is not a valid JSON:",z)}return!1})()),$=ye.useMediaQuery("md");return u.useEffect(()=>{ee(q)},[q]),u.useEffect(()=>{if(X===q)return;const z=window.setTimeout(()=>{dt({value:X,name:t,type:"search",searchQueries:G,setSearchParams:I,filterKey:l,pageKey:a})},350);return()=>{window.clearTimeout(z)}},[X,q,t,G,I,l,a]),e.jsxs(oe.Flex,{gap:"md",style:{flexDirection:$&&p==="left"?"row":$&&p==="right"?"row-reverse":"column"},align:"flex-end",children:[le&&e.jsx(f.Box,{direction:"column",justify:"flex-end",children:e.jsx(A.Button,{onClick:()=>{const z=new URLSearchParams(C);z.delete(l),I(z),ee(""),T(),h&&h()},variant:"outline",tone:"neutral",children:e.jsx(w.Text,{color:"error",fontWeight:"semibold",children:"Reset"})})}),o==null?void 0:o.map(({minWidth:z,content:re,title:he,onClickContainer:ue},xe)=>e.jsxs(f.Box,{direction:"column",gap:"sm",onClick:ue,style:{minWidth:z},children:[he&&e.jsx(Le.SubH3,{children:he}),re]},`extended-filter-${xe}-${b}`)),!!(m!=null&&m.length)&&e.jsx(A.Button,{primary:le,secondary:!le,iconLeft:e.jsx(k.Icon,{size:"sm",name:(g==null?void 0:g.icon)||"FilterHorizontal",style:{color:de?"var(--sa-background-brand, #04254f)":"var(--sa-text-primary, #292a2e)"}}),fullWidth:!$,onClick:()=>R(!0),children:B?"Filter":void 0}),c&&e.jsxs(f.Box,{direction:"column",gap:"sm",style:{minWidth:"126px"},children:[y&&e.jsx(Le.SubH3,{children:"Status"}),e.jsx(tt.Dropdown,{dropdownLists:[{label:"Active",value:"active"},{label:"InActive",value:"inactive"}],defaultValue:Ct({get:"value",name:r,searchParams:C,filterKey:l})?[{label:Ct({get:"value",name:r,searchParams:C,filterKey:l})==="active"?"Active":"InActive",value:Ct({get:"value",name:r,searchParams:C,filterKey:l})}]:[],onChange:z=>dt({value:z,name:r,type:"dropdown",searchQueries:G,setSearchParams:I,filterKey:l}),placeholder:y?"All":"All Status"},b)]}),s&&e.jsxs(f.Box,{direction:"column",gap:"sm",style:{width:d&&$?d:$?"310px":""},children:[y&&e.jsxs(Le.SubH3,{children:["Search for ",M]}),e.jsx(Ge.Input,{placeholder:n,leftIcon:e.jsx(k.Icon,{name:"Search",width:20,height:20}),onChange:z=>ee(z.target.value),value:X,fullWidth:!0},b+1+l)]}),e.jsx(dn,{isOpen:v,onClose:()=>R(!1),filterKey:l,filters:m,pageKey:a})]})},Co=t=>t==="checkbox-multiple"?"dropdown-multiple":t==="radio"?"dropdown":t==="date-compact"?"date":t;function cr({configs:t,filterKey:r="filter",activeFilterKey:n="filters",pageKey:i="page",searchKey:o="q"}){const{searchParams:s,setSearchParams:c,searchQueries:l}=ke(),a=u.useMemo(()=>Object.fromEntries(t.map(b=>[b.key,b])),[t]),d=u.useMemo(()=>{const b=(s.get(n)||"").split(",").map(T=>T.trim()).filter(Boolean);let O=[];try{const T=s.get(r);T&&(O=Object.keys(JSON.parse(T)).filter(C=>C!==o))}catch{}return t.map(T=>T.key).filter(T=>{const C=a[T];return(C==null?void 0:C.locked)||b.includes(T)||O.includes(T)})},[s,n,r,o,t,a]),h=u.useCallback(b=>{try{return b[r]?JSON.parse(b[r]):{}}catch{return{}}},[r]),m=u.useCallback(b=>{const O={...l};b.length?O[n]=b.join(","):delete O[n],c(O)},[l,n,c]),g=u.useCallback(b=>{d.includes(b)||m([...d,b])},[d,m]),p=u.useCallback(b=>{var I;if((I=a[b])!=null&&I.locked)return;const O={...l},T=d.filter(N=>N!==b);T.length?O[n]=T.join(","):delete O[n];const C=h(O);b in C&&(delete C[b],Object.keys(C).length?O[r]=JSON.stringify(C):delete O[r]),delete O[i],c(O)},[l,d,n,r,i,h,c,a]),M=u.useCallback(b=>d.includes(b)?p(b):g(b),[d,g,p]),y=u.useCallback(b=>{switch(b.type){case"dropdown":case"dropdown-multiple":case"checkbox-multiple":case"radio":return cn({name:b.key,get:"array",searchParams:s,filterKey:r})||[];case"date":{const O=an({name:b.key,searchParams:s,filterKey:r});return O?new Date(O):void 0}case"date-compact":{const T=h(Object.fromEntries(s.entries()))[b.key];return T&&typeof T=="object"?T:void 0}default:return}},[s,r,h]),D=u.useCallback((b,O)=>{if(b.type==="date-compact"){const T={...l},C=h(T);O==null?delete C[b.key]:C[b.key]=O,Object.keys(C).length?T[r]=JSON.stringify(C):delete T[r],delete T[i],c(T);return}dt({value:O,name:b.key,type:Co(b.type),searchQueries:l,setSearchParams:c,filterKey:r,pageKey:i})},[l,c,r,i,h]),B=u.useCallback(b=>{const O={...l},T=h(O);b in T&&(delete T[b],Object.keys(T).length?O[r]=JSON.stringify(T):delete O[r]),delete O[i],c(O)},[l,r,i,h,c]),v=u.useCallback(()=>{const b={...l};delete b[r],delete b[n],delete b[i],c(b)},[l,r,n,i,c]),R=d.length>0;return{activeKeys:d,configByKey:a,hasActiveFilter:R,addFilter:g,removeFilter:p,toggleFilter:M,getValue:y,setValue:D,clearValue:B,clearAll:v}}const ar={get(t){return ct.storage.get(t)??null},set(t,r){ct.storage.save(t,r)},remove(t){ct.storage.delete(t)}},it={columns:t=>`filterbar:colprefs:${t}`,savedViews:t=>`filterbar:views:${t}`,lastState:t=>`filterbar:last:${t}`,perPage:t=>`filterbar:perpage:${t}`,tableSort:t=>`tablelayout:sort:${t}`},gt=(t,r)=>{const n=new Set(r.map(s=>s.key)),i=t.order.filter(s=>n.has(s));for(const s of r)i.includes(s.key)||i.push(s.key);const o=t.hidden.filter(s=>n.has(s));return{order:i,hidden:o}};function vo({columns:t,scopeId:r,storage:n,onColumnsChange:i,value:o}){const s=u.useMemo(()=>({order:t.map(C=>C.key),hidden:[]}),[t]),c=r?it.columns(r):void 0,l=(C,I)=>gt({order:C.order??I,hidden:C.hidden??[]},t),[a,d]=u.useState(()=>{if(o&&(o.order||o.hidden))return l(o,t.map(C=>C.key));if(c){const C=n.get(c);if(C&&Array.isArray(C.order))return gt(C,t)}return s}),h=t.map(C=>C.key).join("|");u.useEffect(()=>d(C=>gt(C,t)),[h]);const m=u.useRef(a);m.current=a;const g=o?`${(o.order??[]).join("|")}~${(o.hidden??[]).join("|")}`:null,p=u.useRef(g);u.useEffect(()=>{if(g==null||p.current===g)return;p.current=g;const C=m.current,I=l(o,C.order);I.order.join("|")===C.order.join("|")&&I.hidden.join("|")===C.hidden.join("|")||(d(I),c&&n.set(c,I))},[g,h]);const M=u.useRef(!1);u.useEffect(()=>{M.current||(M.current=!0,i==null||i(a))},[]);const y=u.useCallback(C=>{d(C),c&&n.set(c,C),i==null||i(C)},[c,n,i]),D=u.useMemo(()=>{const C=new Map(t.map(I=>[I.key,I]));return a.order.filter(I=>C.has(I)).map(I=>({...C.get(I),visible:!a.hidden.includes(I)}))},[a,t]),B=u.useCallback(C=>{const I=a.hidden.includes(C)?a.hidden.filter(N=>N!==C):[...a.hidden,C];y({...a,hidden:I})},[a,y]),v=u.useCallback((C,I)=>{if(C===I)return;const N=[...a.order],[G]=N.splice(C,1);N.splice(I,0,G),y({...a,order:N})},[a,y]),R=u.useCallback(C=>{y({...a,hidden:C?t.filter(I=>!I.locked).map(I=>I.key):[]})},[a,t,y]),b=u.useCallback(()=>y(s),[y,s]),O=u.useCallback(C=>y(gt(C,t)),[y,t]),T=a.hidden.length===0;return{state:a,orderedColumns:D,allVisible:T,toggleVisibility:B,reorder:v,setAllHidden:R,reset:b,applyState:O}}function wo({scopeId:t,storage:r,snapshotKeys:n,pageKey:i="page",getColumns:o,applyColumns:s}){const{searchParams:c,setSearchParams:l}=ke(),a=t?it.savedViews(t):void 0,[d,h]=u.useState(()=>a?r.get(a)||[]:[]),m=u.useCallback(y=>{h(y),a&&r.set(a,y)},[a]),g=u.useCallback(y=>{const D=y.trim();if(!D)return;const B={};n.forEach(R=>{const b=c.get(R);b!=null&&(B[R]=b)});const v={id:`${Date.now()}`,name:D,query:B,columns:o==null?void 0:o(),createdAt:Date.now()};m([...d,v])},[n,c,o,m,d]),p=u.useCallback(y=>m(d.filter(D=>D.id!==y)),[m,d]),M=u.useCallback(y=>{const D=Object.fromEntries(c.entries());n.forEach(B=>delete D[B]),Object.assign(D,y.query),delete D[i],l(D),y.columns&&(s==null||s(y.columns))},[c,n,i,l,s]);return{enabled:!!a,views:d,saveView:g,deleteView:p,applyView:M}}function Do({scopeId:t,storage:r,snapshotKeys:n,enabled:i=!0}){const{searchParams:o}=ke(),s=t&&i?it.lastState(t):void 0;u.useEffect(()=>{if(!s)return;const a={};n.forEach(d=>{const h=o.get(d);h!=null&&(a[d]=h)}),Object.keys(a).length!==0&&r.set(s,a)},[o,s,n,r]);const c=u.useCallback(()=>{if(!s)return null;const a=r.get(s);return a&&Object.keys(a).length>0?a:null},[s,r]),l=u.useCallback(()=>{s&&r.remove(s)},[s,r]);return{enabled:!!s,read:c,clear:l}}function So({scopeId:t,storage:r,perPageKey:n,pageSizeOptions:i,enabled:o=!0}){const{searchParams:s}=ke(),c=t&&o?it.perPage(t):void 0,l=s.toString();u.useEffect(()=>{if(!c)return;const h=s.get(n);if(!h)return;const m=Number(h);!Number.isFinite(m)||m<=0||r.set(c,m)},[l,c,n,r]);const a=u.useCallback(()=>{if(!c)return null;const h=r.get(c);if(h==null)return null;const m=Number(h);return!Number.isFinite(m)||m<=0||i&&!i.includes(m)?null:String(m)},[c,r,i]),d=u.useCallback(()=>{c&&r.remove(c)},[c,r]);return{enabled:!!c,read:a,clear:d}}let Ht={},Nt=!1,_t=null;const ko=(t,r)=>{Object.assign(Ht,t),_t=r,!Nt&&(Nt=!0,queueMicrotask(()=>{const n=Ht,i=_t;Ht={},Nt=!1,_t=null,!(!i||Object.keys(n).length===0)&&i(o=>{const s=new URLSearchParams(o);return Object.entries(n).forEach(([c,l])=>s.set(c,l)),s})}))};function Bo({enabled:t,snapshotKeys:r,perPageKey:n,readSnapshot:i,readPerPage:o}){const{searchParams:s,setSearchParams:c,location:l}=ke(),a=u.useRef(null);u.useEffect(()=>{if(!t||a.current===l.pathname)return;a.current=l.pathname;const d={};if(!s.has(n)){const h=o();h&&(d[n]=h)}if(!r.some(h=>s.has(h))){const h=i();h&&Object.assign(d,h)}Object.keys(d).length!==0&&ko(d,c)},[l.pathname,t])}const Fo=({configs:t,activeKeys:r,onToggle:n,hasActiveFilter:i,onReset:o})=>t.length?e.jsxs(L.Menu,{position:"bottom-left",children:[e.jsx(L.MenuButton,{children:e.jsx(A.Button,{variant:i?"secondary":"outline",tone:"neutral",size:"sm",iconLeft:e.jsx(k.Icon,{name:"FilterHorizontal"}),"aria-label":"Add filter"})}),e.jsx(L.MenuLists,{children:e.jsx(L.MenuBody,{style:{minWidth:260},title:e.jsxs(f.Box,{display:"flex",direction:"row",align:"center",justify:"space-between",fullWidth:!0,children:[e.jsx(w.Text,{fontSize:"sm",fontWeight:"medium",color:"subtlest",children:"Add Filter"}),i&&o&&e.jsx(A.Button,{variant:"link",tone:"brand",size:"xs",onClick:o,children:"Reset"})]}),children:t.map(s=>e.jsx(L.MenuItem,{selected:s.locked||r.includes(s.key),disabled:s.locked,closeOnSelect:!1,startIcon:s.icon??void 0,onClick:()=>{s.locked||n(s.key)},children:s.label},s.key))})})]}):null,Ft=({onClear:t,onRemove:r})=>e.jsxs(L.Menu,{position:"bottom-right",children:[e.jsx(L.MenuButton,{children:e.jsx(A.Button,{variant:"link",tone:"neutral",size:"xs",iconLeft:e.jsx(k.Icon,{name:"MenuHorizontal"}),"aria-label":"Filter actions"})}),e.jsx(L.MenuLists,{children:e.jsxs(L.MenuBody,{style:{width:180},children:[e.jsx(L.MenuItem,{startIcon:e.jsx(k.Icon,{name:"CrossCircle"}),onClick:t,children:"Clear value"}),r&&e.jsx(L.MenuItem,{intent:"danger",startIcon:e.jsx(k.Icon,{name:"Trash1"}),onClick:r,children:"Remove filter"})]})})]}),Eo=t=>{const r=new Date(t);return r.setHours(0,0,0,0),r},Ir=(t,r,n)=>{const i=new Date(t);return n==="day"?i.setDate(i.getDate()+r):n==="week"?i.setDate(i.getDate()+r*7):n==="month"?i.setMonth(i.getMonth()+r):i.setFullYear(i.getFullYear()+r),i},xn=t=>{const r=Eo(new Date);if(t.direction==="this"){const i=new Date(r),o=new Date(r);return t.period==="week"?(i.setDate(r.getDate()-r.getDay()),o.setDate(i.getDate()+6)):t.period==="month"?(i.setDate(1),o.setMonth(o.getMonth()+1,0)):t.period==="year"&&(i.setMonth(0,1),o.setMonth(11,31)),{from:i,to:o}}const n=t.count??1;return t.direction==="past"?{from:Ir(r,-n,t.period),to:r}:{from:r,to:Ir(r,n,t.period)}},Tr=24,hn=t=>t.length>Tr?`${t.slice(0,Tr)}...`:t,vt=t=>t.toLocaleDateString(void 0,{day:"2-digit",month:"short",year:"numeric"}),St={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"},Mo=["is","is-before","is-after","is-on-or-before","is-on-or-after","is-between","is-relative-to-today","is-empty","is-not-empty"],$t={past:"Past",next:"Next",this:"This"},Lo=["day","week","month","year"],Io=["past","next","this"],To=t=>t.field.type==="date-compact"?e.jsx(Ro,{field:t.field,value:t.value,onChange:t.onChange,onClear:t.onClear,onRemove:t.onRemove}):e.jsx(Oo,{field:t.field,value:t.value,onChange:t.onChange,onClear:t.onClear,onRemove:t.onRemove}),Oo=({field:t,value:r,onChange:n,onClear:i,onRemove:o})=>{const s=r?vt(new Date(r)):null,c=!!s,l=c?e.jsxs(e.Fragment,{children:[e.jsxs("span",{style:{fontWeight:500},children:[t.label,":"]})," ",e.jsx("span",{style:{fontWeight:400},children:hn(s)})]}):t.label;return e.jsxs(L.Menu,{position:"bottom-left",children:[e.jsx(L.MenuButton,{children:e.jsx(A.Button,{variant:c?"secondary":"outline",tone:"neutral",size:"sm",iconLeft:c?e.jsx(k.Icon,{name:"Calendar",size:"sm"}):void 0,iconRight:e.jsx(k.Icon,{name:"ChevronSmallDown"}),children:l})}),e.jsx(L.MenuLists,{children:e.jsx(L.MenuBody,{style:{width:260},title:e.jsxs(f.Box,{display:"flex",direction:"row",align:"center",justify:"space-between",fullWidth:!0,children:[e.jsx(w.Text,{fontSize:"sm",fontWeight:"medium",color:"subtlest",children:t.label}),e.jsx(Ft,{onClear:i,onRemove:o})]}),children:e.jsx(Ye.StarasiaDate,{size:"sm",input:!1,clearable:!0,filter:t.mode,value:r,onChange:a=>a==null?i():n(a),withPadding:!1})})})]})},Wo=t=>{switch(t.op){case"is":case"is-before":case"is-after":case"is-on-or-before":case"is-on-or-after":return t.date?`${St[t.op]} ${vt(new Date(t.date))}`:null;case"is-between":return t.from&&t.to?`${vt(new Date(t.from))} - ${vt(new Date(t.to))}`:null;case"is-relative-to-today":{const r=t.relative;if(!r)return null;if(r.direction==="this")return`This ${r.period}`;const n=r.count??1,i=n===1?r.period:`${r.period}s`;return`${$t[r.direction]} ${n} ${i}`}case"is-empty":case"is-not-empty":return St[t.op];default:return null}},Ro=({field:t,value:r,onChange:n,onClear:i,onRemove:o})=>{const s=(r==null?void 0:r.op)??"is",c=r?Wo(r):null,l=!!c,a=l?e.jsxs(e.Fragment,{children:[e.jsxs("span",{style:{fontWeight:500},children:[t.label,":"]})," ",e.jsx("span",{style:{fontWeight:400},children:hn(c)})]}):t.label,d=h=>{if(h!==s){if(h==="is-empty"||h==="is-not-empty"){n({op:h});return}if(h==="is-relative-to-today"){n({op:h,relative:(r==null?void 0:r.relative)??{direction:"past",count:1,period:"week"}});return}if(h==="is-between"){n({op:h,from:r==null?void 0:r.from,to:r==null?void 0:r.to});return}n({op:h,date:r==null?void 0:r.date})}};return e.jsxs(L.Menu,{position:"bottom-left",children:[e.jsx(L.MenuButton,{children:e.jsx(A.Button,{variant:l?"secondary":"outline",tone:"neutral",size:"sm",iconLeft:l?e.jsx(k.Icon,{name:"Calendar",size:"sm"}):void 0,iconRight:e.jsx(k.Icon,{name:"ChevronSmallDown"}),children:a})}),e.jsxs(L.MenuLists,{children:[e.jsx(L.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(w.Text,{fontSize:"sm",fontWeight:"medium",color:"subtlest",children:t.label}),e.jsx(Ao,{op:s,onChange:d})]}),e.jsx(Ft,{onClear:i,onRemove:o})]}),children:e.jsx(zo,{value:r,op:s,onChange:n})}),s==="is-relative-to-today"&&e.jsx(L.MenuFooter,{children:e.jsx(w.Text,{fontSize:"xs",color:"subtlest",children:"Filter will update with the current date"})})]})]})},Ao=({op:t,onChange:r})=>e.jsxs(L.Menu,{position:"bottom-left",children:[e.jsx(L.MenuButton,{children:e.jsx(A.Button,{variant:"link",tone:"neutral",size:"xs",iconRight:e.jsx(k.Icon,{name:"ChevronSmallDown"}),children:St[t]})}),e.jsx(L.MenuLists,{children:e.jsx(L.MenuBody,{style:{width:200},children:Mo.map(n=>e.jsx(L.MenuItem,{selected:t===n,onClick:()=>r(n),endIcon:t===n?e.jsx(k.Icon,{name:"Check"}):void 0,children:St[n]},n))})})]}),zo=({value:t,op:r,onChange:n})=>{if(r==="is-empty"||r==="is-not-empty")return e.jsx(f.Box,{paddingBlock:"sm",paddingInline:"sm",children:e.jsx(w.Text,{fontSize:"xs",color:"subtlest",children:"No further input required."})});if(r==="is-between"){const i=t!=null&&t.from||t!=null&&t.to?{from:t!=null&&t.from?new Date(t.from):null,to:t!=null&&t.to?new Date(t.to):null}:void 0;return e.jsx(Ye.StarasiaDate,{size:"sm",input:!1,clearable:!0,rangedDate:!0,value:i,onChange:o=>{if(o==null){n({op:r});return}if(typeof o=="object"&&o!==null&&"from"in o&&"to"in o){let{from:s,to:c}=o;if(!s&&c&&(s=c,c=null),!s&&!c){n({op:r});return}n({op:r,from:s?s.toISOString():void 0,to:c?c.toISOString():void 0})}},withPadding:!1},"range")}return r==="is-relative-to-today"?e.jsx(Vo,{value:t==null?void 0:t.relative,onChange:i=>n({op:r,relative:i})}):e.jsx(Ye.StarasiaDate,{size:"sm",input:!1,clearable:!0,value:t!=null&&t.date?new Date(t.date):void 0,onChange:i=>{if(i==null){n({op:r});return}i instanceof Date&&n({op:r,date:i.toISOString()})},withPadding:!1},"single")},Vo=({value:t,onChange:r})=>{const n=(t==null?void 0:t.direction)??"past",i=(t==null?void 0:t.count)??1,o=(t==null?void 0:t.period)??"week",s=n!=="this",c=xn({direction:n,count:i,period:o});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(L.Menu,{position:"bottom-left",children:[e.jsx(L.MenuButton,{children:e.jsx(A.Button,{variant:"outline",tone:"neutral",size:"sm",iconRight:e.jsx(k.Icon,{name:"ChevronSmallDown"}),children:$t[n]})}),e.jsx(L.MenuLists,{children:e.jsx(L.MenuBody,{style:{width:140},children:Io.map(l=>e.jsx(L.MenuItem,{selected:n===l,endIcon:n===l?e.jsx(k.Icon,{name:"Check"}):void 0,onClick:()=>r(l==="this"?{direction:l,period:o}:{direction:l,count:i,period:o}),children:$t[l]},l))})})]}),s&&e.jsx(Ge.Input,{type:"number",size:"sm",min:1,clearable:!1,value:i,onChange:l=>{const a=Number(l.target.value);r({direction:n,count:Number.isFinite(a)&&a>0?a:1,period:o})},style:{width:72}}),e.jsxs(L.Menu,{position:"bottom-left",children:[e.jsx(L.MenuButton,{children:e.jsx(A.Button,{variant:"outline",tone:"neutral",size:"sm",iconRight:e.jsx(k.Icon,{name:"ChevronSmallDown"}),children:o})}),e.jsx(L.MenuLists,{children:e.jsx(L.MenuBody,{style:{width:140},children:Lo.map(l=>e.jsx(L.MenuItem,{selected:o===l,endIcon:o===l?e.jsx(k.Icon,{name:"Check"}):void 0,onClick:()=>r(n==="this"?{direction:n,period:l}:{direction:n,count:i,period:l}),children:l},l))})})]})]}),e.jsx(Ye.StarasiaDate,{size:"sm",input:!1,disabled:!0,rangedDate:!0,value:c,onChange:()=>{},withPadding:!1},"relative-preview")]})},Or=18,Po=t=>t.length>Or?`${t.slice(0,Or)}...`:t,Ho=({field:t,value:r,onChange:n,onClear:i,onRemove:o})=>{const s=t.type==="dropdown-multiple",c=r.length,[l,a]=u.useState(""),d=t.options,h=typeof t.onSearch=="function",m=(()=>{if(h)return d;const D=l.trim().toLowerCase();return D?d.filter(B=>B.label.toLowerCase().includes(D)):d})(),g=D=>r.some(B=>B.value===D.value),p=D=>{if(!s){n([{label:D.label,value:D.value}]),a("");return}n(g(D)?r.filter(B=>B.value!==D.value):[...r,{label:D.label,value:D.value}])},M=D=>{var B;a(D),(B=t.onSearch)==null||B.call(t,D)},y=c===0?t.label:e.jsxs(e.Fragment,{children:[e.jsxs("span",{style:{fontWeight:500},children:[t.label,":"]})," ",e.jsx("span",{style:{fontWeight:400},children:c===1?Po(r[0].label):`${c} Selected`})]});return e.jsxs(L.Menu,{position:"bottom-left",children:[e.jsx(L.MenuButton,{children:e.jsx(A.Button,{variant:c>0?"secondary":"outline",tone:"neutral",size:"sm",iconLeft:c>0?e.jsx(k.Icon,{name:"Tag",size:"sm"}):void 0,iconRight:e.jsx(k.Icon,{name:"ChevronSmallDown"}),children:y})}),e.jsx(L.MenuLists,{children:e.jsx(L.MenuBody,{style:{width:260},title:e.jsxs(f.Box,{display:"flex",direction:"row",align:"center",justify:"space-between",fullWidth:!0,children:[e.jsx(w.Text,{fontSize:"sm",fontWeight:"medium",color:"subtlest",children:t.label}),e.jsx(Ft,{onClear:i,onRemove:o})]}),children:e.jsxs(f.Box,{direction:"column",gap:"sm",children:[e.jsx(tt.Dropdown,{size:"sm",triggerInput:!0,fullWidth:!0,hideChevronIcon:!0,clearable:!0,multiSelect:s,searchAble:!0,searchValue:l,onSearch:M,value:r,onChange:n,placeholder:`Search ${t.label.toLowerCase()}…`}),e.jsx(f.Box,{direction:"column",overflow:"overflow-y-auto",customMaxHeight:"240px",children:t.isLoading?e.jsx(f.Box,{paddingBlock:"sm",paddingInline:"sm",children:e.jsx(w.Text,{fontSize:"xs",color:"subtlest",children:"Loading…"})}):m.length===0?e.jsx(f.Box,{paddingBlock:"sm",paddingInline:"sm",children:e.jsx(w.Text,{fontSize:"xs",color:"subtlest",children:"No results"})}):m.map(D=>e.jsx(L.MenuItem,{closeOnSelect:!s,selected:g(D),startIcon:D.avatar,endIcon:g(D)?e.jsx(k.Icon,{name:"Check"}):void 0,description:D.description,onClick:()=>p(D),children:D.label},D.value))})]})})})]})},Wr=18,No=t=>t.length>Wr?`${t.slice(0,Wr)}...`:t,Rr=({checked:t,indeterminate:r})=>e.jsx("span",{style:{pointerEvents:"none",display:"inline-flex"},children:e.jsx(ot.Checkbox,{size:"sm",checked:t,readOnly:!0,onChange:()=>{},variant:r?"indeterminate":"select"})}),_o=({field:t,value:r,onChange:n,onClear:i,onRemove:o})=>{const s=new Set(r.map(g=>g.value)),c=r.length,l=t.options.length>0&&t.options.every(g=>s.has(g.value)),a=c>0&&!l,d=g=>{n(s.has(g.value)?r.filter(p=>p.value!==g.value):[...r,{label:g.label,value:g.value}])},h=()=>{n(l?[]:t.options.map(g=>({label:g.label,value:g.value})))},m=c===0?t.label:e.jsxs(e.Fragment,{children:[e.jsxs(w.Text,{as:"span",fontWeight:"semibold",children:[t.label,":"]})," ",e.jsx(w.Text,{as:"span",children:c===1?No(r[0].label):`${c} Selected`})]});return e.jsxs(L.Menu,{position:"bottom-left",children:[e.jsx(L.MenuButton,{children:e.jsx(A.Button,{variant:c>0?"secondary":"outline",tone:"neutral",size:"sm",iconLeft:c>0?e.jsx(k.Icon,{name:"Tag",size:"sm"}):void 0,iconRight:e.jsx(k.Icon,{name:"ChevronSmallDown"}),children:m})}),e.jsx(L.MenuLists,{children:e.jsxs(L.MenuBody,{style:{width:240},title:e.jsxs(f.Box,{display:"flex",direction:"row",align:"center",justify:"space-between",fullWidth:!0,children:[e.jsx(w.Text,{fontSize:"sm",fontWeight:"medium",color:"subtlest",children:t.label}),e.jsx(Ft,{onClear:i,onRemove:o})]}),children:[e.jsx(L.MenuItem,{closeOnSelect:!1,selected:l,onClick:h,startIcon:e.jsx(Rr,{checked:l||a,indeterminate:a}),children:"Select All"}),t.options.map(g=>e.jsx(L.MenuItem,{closeOnSelect:!1,selected:s.has(g.value),onClick:()=>d(g),startIcon:e.jsx(Rr,{checked:s.has(g.value)}),children:g.label},g.value))]})})]})},fn=({activeKeys:t,configByKey:r,getValue:n,setValue:i,clearValue:o,removeFilter:s})=>e.jsx(e.Fragment,{children:t.map(c=>{const l=r[c];if(!l)return null;const a=n(l),d=l.locked?void 0:()=>s(c);return l.type==="date"||l.type==="date-compact"?e.jsx(To,{field:l,value:a,onChange:h=>i(l,h),onClear:()=>o(c),onRemove:d},c):l.type==="checkbox-multiple"?e.jsx(_o,{field:l,value:a||[],onChange:h=>i(l,h),onClear:()=>o(c),onRemove:d},c):e.jsx(Ho,{field:l,value:a||[],onChange:h=>i(l,h),onClear:()=>o(c),onRemove:d},c)})}),Ar=t=>`${t} Rows`,qo=({pagination:t,pageKey:r="page",perPageKey:n="perPage",pageSizeOptions:i=[10,25,50,100],defaultPerPage:o=10,showResultCount:s=!0,showPageSize:c=!0,showPagination:l=!0})=>{var B;const{searchQueries:a,setSearchParams:d,searchParams:h}=ke(),m=h.get(n),g=m?Number(m):o,p=v=>{d({...a,[r]:String(v)})},M=v=>{d({...a,[n]:v,[r]:"1"})},y=(t==null?void 0:t.rangeStart)??(((t==null?void 0:t.currentPage)||0)>1?(((t==null?void 0:t.currentPage)||0)-1)*((t==null?void 0:t.perPage)||0)+1:1),D=(t==null?void 0:t.rangeEnd)??((t==null?void 0:t.totalCurrentPage)!==(t==null?void 0:t.perPage)?t==null?void 0:t.totalData:((t==null?void 0:t.currentPage)||1)*((t==null?void 0:t.totalCurrentPage)||0));return e.jsxs(e.Fragment,{children:[s&&e.jsx(w.Text,{fontSize:"sm",fontWeight:"medium",color:"primary",truncate:!0,children:`${y}-${D} of ${((B=t==null?void 0:t.totalData)==null?void 0:B.toLocaleString())||0}`}),c&&e.jsxs(L.Menu,{position:"bottom-left",children:[e.jsx(L.MenuButton,{children:e.jsx(A.Button,{variant:"outline",tone:"neutral",size:"xs",iconRight:e.jsx(k.Icon,{name:"ChevronSmallDown"}),"aria-label":"Rows per page",children:Ar(g)})}),e.jsx(L.MenuLists,{children:e.jsx(L.MenuBody,{children:i.map(v=>e.jsx(L.MenuItem,{selected:v===g,onClick:()=>M(String(v)),children:Ar(v)},v))})})]}),l&&!!(t!=null&&t.totalPage)&&e.jsx(f.Box,{direction:"column",display:"flex",align:"center",gap:"sm",paddingRight:"lg",style:{borderRight:"1px solid var(--sa-border-subtle, rgba(11, 18, 14, 0.14))"},children:e.jsx(at.Pagination,{size:"sm",variant:"neutral",siblingCount:0,currentPage:t!=null&&t.currentPage?Number(t.currentPage):1,totalPages:Number(t.totalPage),onPageChange:p})})]})};function Zo(t,r,n=!0){u.useEffect(()=>{if(!n)return;const i=o=>{var l;if(o.metaKey||o.ctrlKey||o.altKey||o.key!==t)return;const s=o.target,c=(l=s==null?void 0:s.tagName)==null?void 0:l.toLowerCase();c==="input"||c==="textarea"||s!=null&&s.isContentEditable||(o.preventDefault(),r())};return window.addEventListener("keydown",i),()=>window.removeEventListener("keydown",i)},[t,r,n])}const Go=240,mn=({searchKey:t="q",filterKey:r="filter",pageKey:n="page",placeholder:i="Search",shortcut:o="/"})=>{const{searchParams:s,setSearchParams:c,searchQueries:l}=ke(),a=Bt(t,s,r)||"",[d,h]=u.useState(!!a),[m,g]=u.useState(!a),[p,M]=u.useState(a),y=ye.useDebounce(p,350),D=u.useRef(null);u.useEffect(()=>{M(a),a&&h(!0)},[a]),u.useEffect(()=>{d&&g(!1)},[d]),u.useEffect(()=>{y!==a&&dt({value:y,name:t,type:"search",searchQueries:l,setSearchParams:c,filterKey:r,pageKey:n})},[y]);const B=u.useCallback(()=>{h(!0),requestAnimationFrame(()=>{var O;return(O=D.current)==null?void 0:O.focus()})},[]);Zo(o,B);const v=()=>{p||h(!1)},R=O=>{var T;O.key==="Escape"&&!p&&(h(!1),(T=D.current)==null||T.blur())},b=()=>{d||g(!0)};return e.jsxs(f.Box,{display:"flex",direction:"row",align:"center",gap:"spacing-0",children:[m&&e.jsx(A.Button,{variant:"outline",tone:"neutral",size:"sm",iconLeft:e.jsx(k.Icon,{name:"Search",size:"sm"}),"aria-label":"Search","aria-expanded":!1,onClick:B}),e.jsxs(f.Box,{onTransitionEnd:b,style:{position:"relative",width:d?Go:0,overflow:"hidden",transition:"width 220ms ease"},children:[e.jsx(Ge.Input,{ref:D,size:"sm",fullWidth:!0,value:p,placeholder:i,leftIcon:e.jsx(k.Icon,{name:"Search",width:16,height:16}),onChange:O=>M(O.target.value),onKeyDown:R,onBlur:v,tabIndex:d?0:-1}),d&&!p&&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(w.Text,{fontSize:"xs",color:"subtle",children:o})})]})]})},gn=({columns:t,allVisible:r,onToggle:n,onReorder:i,onSetAllHidden:o})=>{const[s,c]=u.useState(null),[l,a]=u.useState(null),d=()=>{s!==null&&l!==null&&s!==l&&i(s,l),c(null),a(null)},h=(m,g)=>{const p=m+g;p<0||p>=t.length||i(m,p)};return e.jsxs(L.Menu,{position:"bottom-right",children:[e.jsx(L.MenuButton,{children:e.jsx(A.Button,{variant:r?"outline":"secondary",tone:"neutral",size:"sm",iconLeft:e.jsx(k.Icon,{name:"Grid",size:"sm"}),"aria-label":"Customize columns"})}),e.jsx(L.MenuLists,{children:e.jsx(L.MenuBody,{children:e.jsxs(f.Box,{padding:"sm",direction:"column",customWidth:"296px",customMaxHeight:"60vh",overflow:"overflow-hidden",children:[e.jsx(w.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(w.Text,{fontSize:"sm",fontWeight:"medium",color:"subtle",children:"Show in table"}),e.jsx(A.Button,{variant:"link",tone:"info",size:"xs",onClick:()=>o(r),children:r?"Hide All":"Show All"})]}),e.jsx(f.Box,{direction:"column",overflow:"overflow-y-auto",children:t.map((m,g)=>{const p=!m.locked,M=l===g&&s!==null&&s!==g;return e.jsxs(f.Box,{direction:"row",display:"flex",align:"center",gap:"sm",paddingBlock:"xs",draggable:p,onDragStart:()=>p&&c(g),onDragOver:y=>{y.preventDefault(),a(g)},onDrop:d,onDragEnd:d,style:{minHeight:32,boxShadow:M?"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:p?0:-1,"aria-label":`Reorder ${m.title}`,"aria-disabled":!p||void 0,color:"icon-subtlest",onKeyDown:y=>{p&&(y.key==="ArrowUp"?(y.preventDefault(),h(g,-1)):y.key==="ArrowDown"&&(y.preventDefault(),h(g,1)))},style:{display:"inline-flex",cursor:p?"grab":"default",opacity:p?1:.4},children:e.jsx(k.Icon,{name:"DragVertical",width:16,height:16})}),m.icon&&e.jsx(f.Box,{direction:"column",align:"center",color:"icon-subtle",style:{display:"inline-flex"},children:m.icon}),e.jsx(w.Text,{fontSize:"sm",fontWeight:"medium",color:"primary",truncate:!0,children:m.title}),e.jsx(f.Box,{direction:"column",style:{marginLeft:"auto"},children:e.jsx(nt.Toggle,{size:"sm",checked:m.visible,disabled:m.locked,onChange:()=>n(m.key),"aria-label":`Toggle ${m.title} column`})})]},m.key)})})]})})})]})},yn=({views:t,onApply:r,onDelete:n,onSave:i})=>{const[o,s]=u.useState(""),c=()=>{const l=o.trim();l&&(i(l),s(""))};return e.jsxs(L.Menu,{position:"bottom-right",children:[e.jsx(L.MenuButton,{children:e.jsx(A.Button,{variant:t.length>0?"secondary":"outline",tone:(t.length>0,"neutral"),size:"sm",iconLeft:e.jsx(k.Icon,{name:"Bookmark",size:"sm"}),"aria-label":"Saved views"})}),e.jsxs(L.MenuLists,{style:{width:"260px"},children:[e.jsx(L.MenuBody,{children:e.jsxs(f.Box,{direction:"column",padding:"xs",gap:"sm",children:[e.jsx(w.Text,{fontWeight:"semibold",color:"primary",children:"Saved Views"}),e.jsx(f.Box,{direction:"column",overflow:"overflow-y-auto",children:t.length===0?e.jsx(f.Box,{direction:"column",paddingBlock:"sm",children:e.jsx(w.Text,{fontSize:"sm",color:"subtlest",children:"No saved views yet"})}):t.map(l=>e.jsx(L.MenuItem,{startIcon:e.jsx(k.Icon,{name:"Bookmark"}),onClick:()=>r(l),endIcon:e.jsx(A.Button,{variant:"link",tone:"error",size:"sm",iconLeft:e.jsx(k.Icon,{name:"Trash2"}),"aria-label":`Delete ${l.name}`,onClick:a=>{a.stopPropagation(),n(l.id)}}),children:l.name},l.id))})]})}),e.jsx(L.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(Ge.Input,{size:"sm",fullWidth:!0,placeholder:"Save current view as…",value:o,onChange:l=>s(l.target.value),onKeyDown:l=>{l.key==="Enter"&&c()}})}),e.jsx(A.Button,{variant:"primary",tone:"brand",size:"sm",disabled:!o.trim(),onClick:c,children:"Save"})]})})]})]})},Qo=({isOpen:t,onClose:r,configs:n,activeKeys:i,configByKey:o,hasActiveFilter:s,onToggle:c,onReset:l,getValue:a,setValue:d,clearValue:h,removeFilter:m})=>{const g=i.length;return e.jsx(wt.Drawer,{position:"bottom",isShow:t,onHide:r,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(w.Text,{fontWeight:"semibold",color:"primary",children:"Filter"}),g>0&&e.jsxs(w.Text,{fontSize:"sm",color:"subtle",children:["(",g,")"]})]}),e.jsx(A.Button,{variant:"link",tone:"neutral",size:"sm",iconLeft:e.jsx(k.Icon,{name:"Cross"}),"aria-label":"Close filter",onClick:r})]}),e.jsxs(f.Box,{direction:"column",gap:"lg",padding:"md",overflow:"overflow-y-auto",style:{flex:"1 1 auto",minHeight:0},children:[g>0&&e.jsxs(f.Box,{direction:"column",gap:"sm",children:[e.jsx(w.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(fn,{activeKeys:i,configByKey:o,getValue:a,setValue:d,clearValue:h,removeFilter:m})})]}),n.length>0&&e.jsxs(f.Box,{direction:"column",gap:"sm",children:[e.jsx(w.Text,{fontSize:"xs",fontWeight:"medium",color:"subtlest",children:"Tambah filter"}),e.jsx(f.Box,{direction:"column",children:n.map(p=>{const M=i.includes(p.key),y=!!p.locked;return e.jsxs(f.Box,{direction:"row",display:"flex",align:"center",justify:"space-between",gap:"sm",paddingBlock:"sm",style:{opacity:y?.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:[p.icon&&e.jsx(f.Box,{direction:"column",align:"center",color:"icon-subtle",style:{display:"inline-flex"},children:p.icon}),e.jsx(w.Text,{fontSize:"sm",color:"primary",truncate:!0,children:p.label})]}),e.jsx(nt.Toggle,{size:"sm",checked:M||y,disabled:y,onChange:()=>c(p.key),"aria-label":`Toggle ${p.label}`})]},p.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(A.Button,{variant:"outline",tone:"neutral",size:"md",fullWidth:!0,disabled:!s,onClick:l,children:"Reset"})}),e.jsx(f.Box,{direction:"column",style:{flex:"1 1 0"},children:e.jsx(A.Button,{variant:"primary",tone:"brand",size:"md",fullWidth:!0,onClick:r,children:"Selesai"})})]})]})})},Uo=t=>`${t} Rows`,Jo=({perPageKey:t,pageKey:r,pageSizeOptions:n,defaultPerPage:i=10,showPageSize:o})=>{const{searchQueries:s,setSearchParams:c,searchParams:l}=ke(),a=l.get(t),d=a?Number(a):i,h=m=>{c({...s,[t]:m,[r]:"1"})};return o?e.jsxs(L.Menu,{position:"bottom-right",children:[e.jsx(L.MenuButton,{children:e.jsx(A.Button,{variant:"outline",tone:"neutral",size:"sm",iconLeft:e.jsx(k.Icon,{name:"MenuVertical",size:"sm"}),"aria-label":"More options"})}),e.jsx(L.MenuLists,{children:e.jsxs(L.MenuBody,{style:{minWidth:200},children:[e.jsx(f.Box,{paddingInline:"sm",paddingBlock:"xs",children:e.jsx(w.Text,{fontSize:"xs",fontWeight:"medium",color:"subtlest",children:"Rows per page"})}),n.map(m=>e.jsx(L.MenuItem,{selected:m===d,endIcon:m===d?e.jsx(k.Icon,{name:"Check"}):void 0,onClick:()=>h(String(m)),children:Uo(m)},m))]})})]}):null},Yo=t=>{var Be;const{withPadding:r,configs:n,activeKeys:i,configByKey:o,hasActiveFilter:s,toggleFilter:c,removeFilter:l,getValue:a,setValue:d,clearValue:h,onReset:m,searchable:g,searchKey:p,filterKey:M,pageKey:y,searchPlaceholder:D,searchShortcut:B,pagination:v,perPageKey:R,pageSizeOptions:b,defaultPerPage:O,showPagination:T,showResultCount:C,showPageSize:I,hasColumns:N,orderedColumns:G,allVisible:q,onToggleVisibility:X,onReorder:ee,onSetAllHidden:de,showSavedViews:se,savedViews:le,onApplyView:$,onDeleteView:z,onSaveView:re}=t,[he,ue]=u.useState(!1),{searchQueries:xe,setSearchParams:De}=ke(),Ie=(v==null?void 0:v.rangeStart)??(((v==null?void 0:v.currentPage)||0)>1?(((v==null?void 0:v.currentPage)||0)-1)*((v==null?void 0:v.perPage)||0)+1:1),ze=(v==null?void 0:v.rangeEnd)??((v==null?void 0:v.totalCurrentPage)!==(v==null?void 0:v.perPage)?v==null?void 0:v.totalData:((v==null?void 0:v.currentPage)||1)*((v==null?void 0:v.totalCurrentPage)||0)),Ve=Te=>{De({...xe,[y]:String(Te)})},je=C||T&&!!(v!=null&&v.totalPage),be=()=>{m(),ue(!1)};return e.jsxs(f.Box,{direction:"column",gap:"sm",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",wrap:"wrap",gap:"sm",fullWidth:!0,overflow:"overflow-auto",children:[g&&e.jsx(mn,{searchKey:p,filterKey:M,pageKey:y,placeholder:D,shortcut:B}),e.jsx(A.Button,{variant:s?"secondary":"outline",tone:"neutral",size:"sm",iconLeft:e.jsx(k.Icon,{name:"FilterHorizontal"}),onClick:()=>ue(!0),"aria-label":"Open filters",children:s?`Filter: ${i.length}`:null}),e.jsxs(f.Box,{direction:"row",display:"flex",align:"center",gap:"sm",style:{marginLeft:"auto"},children:[se&&e.jsx(yn,{views:le,onApply:$,onDelete:z,onSave:re}),N&&e.jsx(gn,{columns:G,allVisible:q,onToggle:X,onReorder:ee,onSetAllHidden:de}),e.jsx(Jo,{perPageKey:R,pageKey:y,pageSizeOptions:b,defaultPerPage:O,showPageSize:I})]})]}),je&&e.jsxs(f.Box,{direction:"row",display:"flex",align:"center",justify:"space-between",gap:"sm",fullWidth:!0,children:[C?e.jsx(w.Text,{fontSize:"sm",fontWeight:"medium",color:"primary",truncate:!0,children:`${Ie}-${ze} of ${((Be=v==null?void 0:v.totalData)==null?void 0:Be.toLocaleString())||0}`}):e.jsx(f.Box,{direction:"column"}),T&&!!(v!=null&&v.totalPage)&&e.jsx(at.Pagination,{size:"xs",variant:"neutral",siblingCount:0,currentPage:v!=null&&v.currentPage?Number(v.currentPage):1,totalPages:Number(v.totalPage),onPageChange:Ve})]}),e.jsx(Qo,{isOpen:he,onClose:()=>ue(!1),configs:n,activeKeys:i,configByKey:o,hasActiveFilter:s,onToggle:c,onReset:be,getValue:a,setValue:d,clearValue:h,removeFilter:l})]})},Xo=({withPadding:t=!1,filterConfigs:r=[],filterKey:n="filter",activeFilterKey:i="filters",pageKey:o="page",perPageKey:s="perPage",pageSizeOptions:c=[25,50,100],defaultPerPage:l,showPagination:a=!0,showResultCount:d=!0,showPageSize:h=!0,searchable:m=!1,searchKey:g="q",searchPlaceholder:p="Search",searchShortcut:M="/",pagination:y,columns:D=[],onColumnsChange:B,columnsState:v,scopeId:R,savedViews:b,persistLastState:O=!0,storage:T=ar,onReset:C})=>{const I=R??(b==null?void 0:b.scopeId),{activeKeys:N,configByKey:G,hasActiveFilter:q,toggleFilter:X,removeFilter:ee,getValue:de,setValue:se,clearValue:le,clearAll:$}=cr({configs:r,filterKey:n,activeFilterKey:i,pageKey:o,searchKey:g}),z=vo({columns:D,scopeId:I,storage:T,onColumnsChange:B,value:v}),re=wo({scopeId:I,storage:T,snapshotKeys:[i,n,s],pageKey:o,getColumns:()=>z.state,applyColumns:z.applyState}),he=Do({scopeId:I,storage:T,snapshotKeys:[i,n,o],enabled:O}),ue=So({scopeId:I,storage:T,perPageKey:s,pageSizeOptions:c,enabled:O});Bo({enabled:O&&!!I,snapshotKeys:[i,n,o],perPageKey:s,readSnapshot:he.read,readPerPage:ue.read});const xe=l??c[0]??25,De=!!(b!=null&&b.enabled)&&re.enabled,Ie=()=>{$(),he.clear(),C==null||C()};return ye.useMediaQuery("md")?e.jsxs(f.Box,{display:"flex",direction:"row",align:"center",gap:"sm",wrap:"wrap",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",gap:"sm",style:{flex:"1 1 0",minWidth:0},children:[e.jsx(Fo,{configs:r,activeKeys:N,onToggle:X,hasActiveFilter:q,onReset:Ie}),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(fn,{activeKeys:N,configByKey:G,getValue:de,setValue:se,clearValue:le,removeFilter:ee}),q&&e.jsx(A.Button,{variant:"link",tone:"brand",size:"sm",onClick:Ie,children:"Reset"})]})]}),e.jsxs(f.Box,{direction:"row",display:"flex",align:"center",gap:"sm",children:[e.jsx(qo,{pagination:y,pageKey:o,perPageKey:s,pageSizeOptions:c,defaultPerPage:xe,showPagination:a,showResultCount:d,showPageSize:h}),m&&e.jsx(mn,{searchKey:g,filterKey:n,pageKey:o,placeholder:p,shortcut:M}),De&&e.jsx(yn,{views:re.views,onApply:re.applyView,onDelete:re.deleteView,onSave:re.saveView}),D.length>0&&e.jsx(gn,{columns:z.orderedColumns,allVisible:z.allVisible,onToggle:z.toggleVisibility,onReorder:z.reorder,onSetAllHidden:z.setAllHidden})]})]}):e.jsx(Yo,{withPadding:t,configs:r,activeKeys:N,configByKey:G,hasActiveFilter:q,toggleFilter:X,removeFilter:ee,getValue:de,setValue:se,clearValue:le,onReset:Ie,searchable:m,searchKey:g,filterKey:n,pageKey:o,searchPlaceholder:p,searchShortcut:M,pagination:y,perPageKey:s,pageSizeOptions:c,defaultPerPage:xe,showPagination:a,showResultCount:d,showPageSize:h,hasColumns:D.length>0,orderedColumns:z.orderedColumns,allVisible:z.allVisible,onToggleVisibility:z.toggleVisibility,onReorder:z.reorder,onSetAllHidden:z.setAllHidden,showSavedViews:De,savedViews:re.views,onApplyView:re.applyView,onDeleteView:re.deleteView,onSaveView:re.saveView})},Ko=t=>{if(!Array.isArray(t)||t.length===0)return;const r=t[0];return(r==null?void 0:r.value)!=null?String(r.value):void 0},$o=t=>{if(!Array.isArray(t)||t.length===0)return;const r=t.map(n=>(n==null?void 0:n.value)!=null?String(n.value):null).filter(n=>n!=null);return r.length?r:void 0},ei=(t,r)=>{switch(t.type){case"dropdown":case"radio":return Ko(r);case"dropdown-multiple":case"checkbox-multiple":return $o(r);case"date":return r instanceof Date?r.toISOString():void 0;case"date-compact":return r;default:return}},zr=(t,r)=>{if(t==null||t==="")return r;const n=Number(t);return Number.isFinite(n)&&n>0?n:r},ti=t=>{const{filterConfigs:r,filterKey:n="filter",activeFilterKey:i="filters",pageKey:o="page",perPageKey:s="perPage",searchKey:c="q",defaultPage:l=1,defaultPerPage:a=10,paramKeys:d,serialize:h}=t,{activeKeys:m,configByKey:g,hasActiveFilter:p,getValue:M}=cr({configs:r,filterKey:n,activeFilterKey:i,pageKey:o,searchKey:c}),{searchParams:y}=ke(),D=y.toString();return u.useMemo(()=>{const v={},R={},b=zr(y.get(o),l),O=zr(y.get(s),a);v[(d==null?void 0:d.page)??"page"]=b,v[(d==null?void 0:d.perPage)??"perPage"]=O;const T=Bt(c,y,n)||"";T&&(v[(d==null?void 0:d.search)??"search"]=T);let C=!1;for(const I of m){const N=g[I];if(!N)continue;const G=M(N);R[I]=G;const q=h==null?void 0:h[I],X=q?q(G):ei(N,G);if(X==null||Array.isArray(X)&&X.length===0)continue;const ee=(d==null?void 0:d[I])??I;v[ee]=X,C=!0}return{params:v,raw:R,hasActiveFilter:p||!!T||C}},[D,m.join("|"),n,i,o,s,c,l,a,d,h,g])},ri=["dropdown","dropdown-multiple","checkbox-multiple","radio"],ni=({filterConfigs:t,filterKey:r,activeFilterKey:n,pageKey:i,searchKey:o})=>{const{configByKey:s,getValue:c,setValue:l,removeFilter:a,clearAll:d,hasActiveFilter:h}=cr({configs:t,filterKey:r,activeFilterKey:n,pageKey:i,searchKey:o}),m=(B,v)=>{var b;const R=B.options;return((b=R==null?void 0:R.find(O=>O.value===v))==null?void 0:b.label)??v},g=u.useCallback(B=>{const v=s[B];if(!v)return[];const R=c(v);return Array.isArray(R)?R.map(b=>String(b.value)):[]},[s,c]),p=u.useCallback((B,v)=>{const R=s[B];if(!R||!ri.includes(R.type))return;const b=Array.isArray(v)?v:[v];if(b.length===0){a(B);return}l(R,b.map(O=>({label:m(R,O),value:O})))},[s,l,a]),M=u.useCallback((B,v)=>{const R=g(B);p(B,R.includes(v)?R.filter(b=>b!==v):[...R,v])},[g,p]),y=u.useCallback((B,v)=>g(B).includes(v),[g]),D=u.useCallback(B=>a(B),[a]);return{set:p,toggle:M,clear:D,clearAll:d,isActive:y,values:g,hasActiveFilter:h}},oi=(t,r)=>{if(!t)return{};const{fromKey:n,toKey:i,opKey:o}=r,s={};switch(t.op){case"is":case"is-before":case"is-after":case"is-on-or-before":case"is-on-or-after":return t.date&&(s[n]=new Date(t.date).toISOString()),o&&(s[o]=t.op),s;case"is-between":return t.from&&(s[n]=new Date(t.from).toISOString()),t.to&&(s[i]=new Date(t.to).toISOString()),s;case"is-relative-to-today":{if(!t.relative)return s;const{from:c,to:l}=xn(t.relative);return s[n]=c.toISOString(),s[i]=l.toISOString(),s}case"is-empty":case"is-not-empty":return o&&(s[o]=t.op==="is-empty"?"empty":"not-empty"),s;default:return s}},pn=({children:t,borderRadius:r,height:n})=>{const i=u.useRef(null),[o,s]=u.useState("100vh");return u.useEffect(()=>{if(n)return;const c=()=>{if(i.current){const l=i.current.getBoundingClientRect().top;s(`calc(100vh - ${l}px)`)}};return c(),window.addEventListener("resize",c),()=>window.removeEventListener("resize",c)},[n]),e.jsx(f.Box,{ref:i,fullWidth:!0,borderStyle:"border-solid",borderWidth:"border",borderColor:"border-base",borderRadius:r||"rounded-xs",style:{height:n??o,display:"flex",flexDirection:"column"},children:t})},jn=({action:t,rightContent:r,leftContent:n,headerSlot:i,advanceFilter:o,showFilter:s=!0})=>{const c=ye.useMediaQuery("md"),l=s?e.jsx(un,{...o}):null,a=()=>t?u.isValidElement(t)?t:e.jsx(f.Box,{style:{display:"flex",flexDirection:c?"row":"column",gap:"8px",width:c?"auto":"100%",textWrap:"nowrap"},children:t.map(({title:d,icon:h,buttonProps:m,onClick:g},p)=>!d&&!h?null:e.jsx(A.Button,{fullWidth:!c,iconLeft:h?e.jsx(k.Icon,{name:h}):void 0,onClick:g,...m,children:d},`action-${p}`))}):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:i?i({filter:l}):e.jsxs(e.Fragment,{children:[e.jsxs(f.Box,{style:{display:"flex",gap:"8px",flexDirection:"row",alignItems:"center",flex:1,minWidth:0},children:[l,n]}),e.jsxs(f.Box,{style:{display:"flex",gap:"8px",flexDirection:"row",alignItems:"center",flexShrink:0},children:[r,a()]})]})})},ii=({totalData:t,withMarginBottom:r=!0,withMarginTop:n=!0})=>e.jsxs(f.Box,{style:{display:"flex",gap:"4px",flexDirection:"row",alignItems:"center",marginBottom:r?"16px":void 0,marginTop:n?"16px":void 0},children:[e.jsxs(Le.Body1,{props:{color:"gray-500"},children:["Total data:"," "]}),e.jsx(Le.Body1,{children:t||0})]}),bn=({pagination:t,pageKey:r="page",perPageKey:n="perPage",defaultPerPage:i=10,showPagination:o=!0,totalData:s})=>{const{searchQueries:c,setSearchParams:l,searchParams:a}=ke(),d=a.get(n),h=M=>{l({...c,[r]:String(M)})},m=M=>{l({...c,[n]:M,[r]:"1"})},g=(t==null?void 0:t.rangeStart)??(((t==null?void 0:t.currentPage)||0)>1?(((t==null?void 0:t.currentPage)||0)-1)*((t==null?void 0:t.perPage)||0)+1:1),p=(t==null?void 0:t.rangeEnd)??((t==null?void 0:t.totalCurrentPage)!==(t==null?void 0:t.perPage)?t==null?void 0:t.totalData:((t==null?void 0:t.currentPage)||1)*((t==null?void 0:t.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:o?e.jsxs(e.Fragment,{children:[e.jsxs(f.Box,{style:{display:"flex",flexDirection:"row",gap:"8px",alignItems:"center",textWrap:"nowrap"},children:[e.jsx(w.Text,{children:"Rows Per Page: "}),e.jsx(tt.Dropdown,{dropdownLists:[{label:"5",value:"5"},{label:"10",value:"10"},{label:"25",value:"25"},{label:"50",value:"50"},{label:"100",value:"100"}],onChange:M=>{m(M[0].value)},value:d?[{label:`${d} per row`,value:d}]:[{label:`${i} per row`,value:`${i}`}],defaultValue:d?[{label:`${d} per row`,value:d}]:[{label:`${i} per row`,value:`${i}`}]}),e.jsx(w.Text,{children:`${g}-${p} of ${(t==null?void 0:t.totalData)||0}`})]}),e.jsx(at.Pagination,{currentPage:t!=null&&t.currentPage?Number(t==null?void 0:t.currentPage):1,totalPages:t!=null&&t.totalPage?Number(t==null?void 0:t.totalPage):1,onPageChange:h})]}):e.jsx(ii,{totalData:s,withMarginBottom:!1,withMarginTop:!1})})},Cn=({filter:t,columnTitle:r})=>{const[n,i]=u.useState(!1),o=u.useRef(null),s=u.useRef(null),c=u.useRef(null),[l,a]=u.useState(""),[d,h]=u.useState({top:0,left:0}),m=t.selectedValues,g=u.useMemo(()=>l?t.options.filter(y=>y.label.toLowerCase().includes(l.toLowerCase())):t.options,[t.options,l]);u.useEffect(()=>{if(n&&s.current){const y=s.current.getBoundingClientRect(),D=280,B={top:y.bottom+8};t.position==="left"||y.left+D>window.innerWidth?B.right=window.innerWidth-y.right:B.left=y.left,h(B)}},[n,t.position]),u.useEffect(()=>{n&&c.current?setTimeout(()=>{var y;return(y=c.current)==null?void 0:y.focus()},50):a("")},[n]),u.useEffect(()=>{const y=D=>{o.current&&!o.current.contains(D.target)&&s.current&&!s.current.contains(D.target)&&i(!1)};return n&&document.addEventListener("mousedown",y),()=>document.removeEventListener("mousedown",y)},[n]);const p=y=>{const D=m.includes(y)?m.filter(B=>B!==y):[...m,y];t.onFilterChange(D)},M=()=>t.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:y=>{var D;y.stopPropagation(),n||(D=t.onOpen)==null||D.call(t),i(B=>!B)},children:e.jsx(k.Icon,{name:n?"ChevronUp":"ChevronDown",size:"sm",style:{color:m.length>0?"var(--sa-color-brand-500, #1a4fa0)":"var(--sa-text-subtle, #8c8f97)"}})}),n&&e.jsxs(f.Box,{ref:o,style:{position:"fixed",top:`${d.top}px`,...d.left!==void 0?{left:`${d.left}px`}:{right:`${d.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(w.Text,{fontSize:"sm",fontWeight:"semibold",color:"gray-700",children:["Filter ",r]}),m.length>0&&e.jsx(f.Box,{direction:"column",style:{cursor:"pointer"},children:e.jsx(w.Text,{fontSize:"xs",color:"primary",fontWeight:"semibold",onClick:y=>{y.stopPropagation(),M()},children:"CLEAR"})})]}),!t.hideSearch&&e.jsx(f.Box,{direction:"column",style:{paddingLeft:"16px",paddingRight:"16px",paddingTop:"8px",paddingBottom:"8px"},children:e.jsx(Ge.Input,{ref:c,placeholder:`Search ${r.toLowerCase()}...`,leftIcon:e.jsx(k.Icon,{name:"Search",size:"sm"}),value:l,onChange:y=>a(y.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:t.isLoadingOptions?e.jsxs(f.Box,{style:{paddingTop:"40px",paddingBottom:"40px",display:"flex",alignItems:"center",justifyContent:"center",flexDirection:"column"},children:[e.jsx(k.Icon,{name:"Loading",size:"lg",style:{color:"var(--sa-background-brand, #04254f)",animation:"spin 1s linear infinite"}}),e.jsx(w.Text,{fontSize:"sm",color:"gray-500",style:{textAlign:"center",marginTop:"8px"},children:"Loading options..."})]}):g.length>0?e.jsx(f.Box,{direction:"column",style:{gap:"2px",paddingTop:"4px",paddingBottom:"4px"},children:g.map(y=>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:m.includes(y.value)?"var(--sa-color-brand-50, #e6edf6)":"transparent"},onClick:D=>{D.stopPropagation(),p(y.value)},onMouseEnter:D=>{m.includes(y.value)||(D.currentTarget.style.backgroundColor="var(--sa-background-primary, #ffffff)"),D.currentTarget.style.transform="translateX(2px)"},onMouseLeave:D=>{D.currentTarget.style.backgroundColor=m.includes(y.value)?"var(--sa-color-brand-50, #e6edf6)":"transparent",D.currentTarget.style.transform="translateX(0)"},children:[e.jsx(ot.Checkbox,{checked:m.includes(y.value),onChange:()=>{}}),e.jsx(w.Text,{fontSize:"sm",fontWeight:m.includes(y.value)?"medium":"normal",color:m.includes(y.value)?"primary":"gray-700",children:y.label})]},y.value))}):e.jsxs(f.Box,{style:{paddingTop:"40px",paddingBottom:"40px",display:"flex",alignItems:"center",justifyContent:"center",flexDirection:"column"},children:[e.jsx(k.Icon,{name:"Search",size:"lg",style:{color:"var(--sa-text-subtle, #8c8f97)"}}),e.jsx(w.Text,{fontSize:"sm",color:"gray-500",style:{textAlign:"center",marginTop:"8px"},children:"No results found"})]})}),m.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:m.length}),e.jsxs(w.Text,{fontSize:"xs",color:"primary",fontWeight:"medium",children:["item",m.length>1?"s":""," selected"]})]})})]})]})},si=({direction:t})=>{const r="var(--sa-text-primary, #292a2e)",n="var(--sa-text-subtle, #8c8f97)",i=t==="asc"?r:n,o=t==="desc"?r:n,s=t==="asc"?1:.45,c=t==="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:i,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:o,opacity:c},children:e.jsx("path",{d:"M0 0 L8 0 L4 5 Z",fill:"currentColor"})})]})},li=({frozen:t})=>e.jsxs("svg",{width:"11",height:"11",viewBox:"0 0 24 24",fill:t?"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:t?"M7 11V7a5 5 0 0 1 10 0v4":"M7 11V7a5 5 0 0 1 9.9-1"})]}),qt="var(--sa-background-primary, #ffffff)",Vr="var(--sa-background-primary-inverse, #f8f8f8)",vn=({columns:t,records:r,handleDetail:n,handleUpdate:i,handleDelete:o,isLoading:s,visibleHandleDelete:c,visibleHandleUpdate:l,visibleHandleDetail:a,showHeadBorder:d=!1,scrollParentRef:h,frozenCount:m=0,onFrozenCountChange:g,customActions:p,actionsOrder:M=["detail","update","delete","custom"],customEmptyState:y,enableColumnResize:D=!1,defaultColumnWidths:B,onColumnWidthsChange:v,defaultMinColumnWidth:R=60,sort:b,defaultSort:O,onSortChange:T,showActionDivider:C=!1})=>{const I=b!==void 0,[N,G]=u.useState(O??null),q=I?b??null:N,X=F=>{if(F.sortKey)return F.sortKey;if(typeof F.accessor=="string")return F.accessor},ee=F=>{const Z=X(F);if(!Z)return;let P;!q||q.key!==Z?P={key:Z,direction:"asc"}:q.direction==="asc"?P={key:Z,direction:"desc"}:P=null,I||G(P),T==null||T(P)},se=[n,i,o].filter(F=>F!==void 0).length,le=!!p,$=!!n||!!i||!!o||le,z="var(--sa-border-subtle, #0b120e24)",re=`1px solid ${z}`,he=`inset 1px 0 0 ${z}`,ue=`inset -1px 0 0 ${z}`,xe=se===3?le?"178px":"140px":se===2?le?"140px":"102px":se===1?le?"112px":"74px":le?"74px":"",De=(F,Z)=>{if(!Z)return F;if(typeof Z=="function")return Z(F);if(typeof Z=="string")return F[Z]},[Ie,ze]=u.useState(!1);u.useEffect(()=>{if(!(h!=null&&h.current))return;const F=h.current;ze(F.scrollHeight>F.clientHeight)},[r,h]);const Ve=u.useRef(null),[je,be]=u.useState([]),[Be,Te]=u.useState(()=>B??{}),_e=u.useRef(null);u.useLayoutEffect(()=>{if(!m||!Ve.current){be([]);return}const F=Array.from(Ve.current.querySelectorAll("thead tr th")),Z=[];let P=0;F.forEach((_,U)=>{Z[U]=P,U<m&&(P+=_.offsetWidth)}),be(Z)},[m,t,r,Be]);const Xe=F=>{g&&g(F<m?F:F+1)},S=(F,Z)=>{const P=Be[F];if(P!==void 0){const _=`${P}px`;return{width:_,minWidth:_,maxWidth:_}}return Z?{width:Z}:{}},H=F=>D&&(F.resizable??!0),V=(F,Z)=>{F.preventDefault(),F.stopPropagation();const P=F.currentTarget.closest("th");if(!P)return;const _=Math.round(P.getBoundingClientRect().width);_e.current={colIndex:Z,startX:F.clientX,startWidth:_};const U=document.body.style.userSelect,fe=document.body.style.cursor;document.body.style.userSelect="none",document.body.style.cursor="col-resize";const ve=Fe=>{var He;const Ee=_e.current;if(!Ee)return;const st=((He=t[Ee.colIndex])==null?void 0:He.minWidth)??R,We=Math.max(st,Ee.startWidth+(Fe.clientX-Ee.startX));Te(Pe=>Pe[Ee.colIndex]===We?Pe:{...Pe,[Ee.colIndex]:We})},Oe=()=>{document.removeEventListener("mousemove",ve),document.removeEventListener("mouseup",Oe),document.body.style.userSelect=U,document.body.style.cursor=fe,_e.current=null,v&&Te(Fe=>(v(Fe),Fe))};document.addEventListener("mousemove",ve),document.addEventListener("mouseup",Oe)};return e.jsx("div",{ref:Ve,children:e.jsxs(J.Table,{fullWidth:!0,children:[e.jsx(J.Thead,{style:{height:"40px",whiteSpace:"nowrap"},children:e.jsxs(J.Tr,{children:[t.map((F,Z)=>{var xt,ht;const P=m>0&&Z<m,_=je[Z]??0,U=H(F),ve=Z===t.length-1&&$&&C,Oe=X(F),Fe=!!F.sortable&&!!Oe,Ee=Fe&&(q==null?void 0:q.key)===Oe?q.direction:null,st=F.title||((xt=F.accessor)==null?void 0:xt.toString())||"",We=(ht=F.headerTooltip)!=null&&ht.showIcon?e.jsx(k.Icon,{name:"InfoCircle",size:"xs",style:{flexShrink:0,color:"var(--sa-icon-subtle, #8c8f97)",opacity:.75}}):null,He=e.jsx("span",{style:{flex:1,minWidth:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:st}),Pe=Fe?e.jsxs("button",{type:"button",onClick:()=>ee(F),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:F.textAlign==="text-right"?"right":F.textAlign==="text-center"?"center":"left"},children:[He,We,e.jsx(si,{direction:Ee})]}):e.jsxs("span",{style:{flex:1,minWidth:0,display:"flex",alignItems:"center",gap:4},children:[He,We]});return e.jsxs(J.Th,{style:{position:"sticky",top:0,left:P?_:void 0,zIndex:P?4:2,paddingLeft:Z===0?"12px":"",borderRight:d&&!ve&&!P?re:void 0,borderBottom:d?re:void 0,boxShadow:d&&P?ue:void 0,backgroundColor:"var(--sa-background-primary-inverse, #f8f8f8)",textAlign:F.textAlign==="text-right"?"right":F.textAlign==="text-center"?"center":"left",...S(Z,F.width)},children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"4px",justifyContent:"space-between",minWidth:0},children:[F.headerTooltip?e.jsx(Ce.Tooltip,{label:F.headerTooltip.content,position:"bottom",children:Pe}):Pe,F.filter&&e.jsx(Cn,{filter:F.filter,columnTitle:F.title}),g&&e.jsx("button",{onClick:()=>Xe(Z),title:P?"Unfreeze column":"Freeze column",style:{background:"none",border:"none",cursor:"pointer",padding:"2px",display:"flex",alignItems:"center",flexShrink:0,color:P?"var(--sa-background-brand, #04254f)":"var(--sa-text-subtle, #8c8f97)",opacity:P?1:.45,transition:"opacity 0.15s"},children:e.jsx(li,{frozen:P})})]}),U&&e.jsx("div",{onMouseDown:qe=>V(qe,Z),onClick:qe=>qe.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-${Z}`)}),$?e.jsx(J.Th,{style:{backgroundColor:"var(--sa-background-primary-inverse, #f8f8f8)",position:"sticky",top:0,right:0,zIndex:3,borderBottom:d?re:void 0,boxShadow:d&&C?he:void 0}}):null]})}),e.jsx(J.Tbody,{children:s?e.jsx(J.Tr,{children:e.jsx(J.Td,{colSpan:t.length+1,children:e.jsxs(f.Box,{direction:"column",style:{gap:"16px"},children:[e.jsx(Je.Skeleton,{variant:"list"}),e.jsx(Je.Skeleton,{variant:"list"}),e.jsx(Je.Skeleton,{variant:"list"}),e.jsx(Je.Skeleton,{variant:"list"}),e.jsx(Je.Skeleton,{variant:"list"})]})})}):!(r!=null&&r.length)&&y?e.jsx(J.Tr,{children:e.jsx(J.Td,{colSpan:t.length+1,children:y})}):r==null?void 0:r.map((F,Z)=>e.jsxs(J.Tr,{style:{transition:"background-color 0.3s ease",padding:0,borderBottom:Z===r.length-1&&Ie?void 0:"1px solid var(--sa-border-subtle, #0b120e24)"},onMouseEnter:P=>{const _=P.currentTarget;_.style.backgroundColor=Vr,Array.from(_.querySelectorAll("td")).forEach(U=>{U.style.position==="sticky"&&(U.style.backgroundColor=Vr)})},onMouseLeave:P=>{const _=P.currentTarget;_.style.backgroundColor="",Array.from(_.querySelectorAll("td")).forEach(U=>{U.style.position==="sticky"&&(U.style.backgroundColor=qt)})},children:[t.map((P,_)=>{const U=P.render?P.render(F,Z,r):De(F,P.accessor),fe=m>0&&_<m,ve=je[_]??0,Oe=Be[_]!==void 0,Fe=fe&&_===m-1;return e.jsx(J.Td,{style:{position:fe?"sticky":void 0,left:fe?ve:void 0,zIndex:fe?1:void 0,backgroundColor:fe?qt:void 0,transition:fe?"background-color 0.3s ease":void 0,paddingLeft:_===0?"12px":"",whiteSpace:"nowrap",overflow:Oe?"hidden":void 0,borderLeft:P.showBorderLeft?re:void 0,borderRight:P.showBorderRight?re:void 0,boxShadow:Fe?ue:void 0,textAlign:P.textAlign==="text-right"?"right":P.textAlign==="text-center"?"center":"left",...S(_,P.width)},children:typeof U=="string"?e.jsx(w.Text,{style:{whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",textAlign:P.textAlign==="text-right"?"right":P.textAlign==="text-center"?"center":"left"},children:U}):U},`row-${Z}-col-${_}`)}),$?e.jsx(J.Td,{style:{width:xe,position:"sticky",right:0,zIndex:1,backgroundColor:qt,boxShadow:C?he:void 0,transition:"background-color 0.3s ease"},children:e.jsx(oe.Flex,{direction:"row",align:"center",justify:"center",gap:"sm",children:M.map(P=>{const _=Z===r.length-1?"top":"bottom";return P==="detail"&&n&&(a==null?void 0:a(F))!==!1?e.jsx(Ce.Tooltip,{label:"Detail",position:_,children:e.jsx(A.Button,{size:"xs",variant:"outline",tone:"neutral",onClick:()=>n(F.id,F),iconLeft:e.jsx(k.Icon,{name:"DocumentClean",size:"sm",style:{color:"var(--sa-text-subtle, #8c8f97)"}})})},"detail"):P==="update"&&i&&(l==null?void 0:l(F))!==!1?e.jsx(Ce.Tooltip,{label:"Update",position:_,children:e.jsx(A.Button,{size:"xs",variant:"outline",tone:"neutral",onClick:()=>i(F),iconLeft:e.jsx(k.Icon,{name:"Edit1",size:"sm",style:{color:"var(--sa-text-subtle, #8c8f97)"}})})},"update"):P==="delete"&&o&&(c==null?void 0:c(F))!==!1?e.jsx(Ce.Tooltip,{label:"Delete",position:_,children:e.jsx(A.Button,{size:"xs",variant:"outline",tone:"neutral",onClick:()=>o(F.id,F),iconLeft:e.jsx(k.Icon,{name:"Trash1",size:"sm",style:{color:"var(--sa-color-error-600, #c9184a)"}})})},"delete"):P==="custom"?e.jsx(u.Fragment,{children:p==null?void 0:p(F)},"custom"):null})})}):null]},`${F}${Z}`))})]})})},ci=({wrapperProps:t,dataTableProps:r,headerProps:n,footerProps:i})=>{var m;const o=u.useRef(null),[s,c]=u.useState((r==null?void 0:r.defaultFrozenCount)??0),l=(n==null?void 0:n.show)??!0,a=u.useRef(null),d=(m=r==null?void 0:r.pagination)==null?void 0:m.totalData;typeof d=="number"&&(a.current=d);const h=(i==null?void 0:i.showFooter)??(d===void 0?a.current!==0:d!==0);return e.jsxs(pn,{...t,children:[l&&e.jsx(jn,{...n}),e.jsx(f.Box,{direction:"column",ref:o,style:{flex:1,overflowY:"auto",overflowX:"auto"},children:r?e.jsx(vn,{...r,scrollParentRef:o,frozenCount:r!=null&&r.enableFreezeColumns?s:0,onFrozenCountChange:r!=null&&r.enableFreezeColumns?c:void 0}):null}),h&&e.jsx(bn,{pagination:r==null?void 0:r.pagination,pageKey:r==null?void 0:r.pageKey,perPageKey:r==null?void 0:r.perPageKey,defaultPerPage:r==null?void 0:r.defaultPerPage,showPagination:r==null?void 0:r.showPagination,totalData:i==null?void 0:i.totalData})]})};function ai(t){return u.memo(t)}const di=ai(ci),Pr=200,Zt="1px solid var(--sa-border-subtle, #0b120e24)",ui=({sortDir:t,frozen:r})=>t==="asc"?e.jsx(k.Icon,{name:"ArrowUp",width:14,height:14}):t==="desc"?e.jsx(k.Icon,{name:"ArrowDown",width:14,height:14}):r?e.jsx(k.Icon,{name:"Pin1",width:14,height:14}):e.jsx(k.Icon,{name:"FilterVertical",width:14,height:14}),yt=({icon:t,label:r,active:n,danger:i,onClick:o})=>{const s=i?"var(--sa-color-error-600, #c9184a)":"var(--sa-text-primary, #292a2e)";return e.jsxs("button",{type:"button",onClick:o,style:{display:"flex",alignItems:"center",gap:12,width:"100%",padding:"8px 12px",background:n?"var(--sa-background-brand-subtlest, #e6edf6)":"none",border:"none",cursor:"pointer",font:"inherit",color:s,textAlign:"left"},onMouseEnter:c=>{n||(c.currentTarget.style.background="var(--sa-background-primary-inverse, #f8f8f8)")},onMouseLeave:c=>{c.currentTarget.style.background=n?"var(--sa-background-brand-subtlest, #e6edf6)":"none"},children:[e.jsx(k.Icon,{name:t,size:"sm",style:{color:s,flexShrink:0}}),e.jsx(w.Text,{as:"span",style:{color:s},children:r})]})},wn=({active:t,canSort:r,canHide:n,sortDir:i,frozen:o,onSort:s,onClearSort:c,onToggleFreeze:l,onHide:a})=>{const[d,h]=u.useState(!1),m=u.useRef(null),g=u.useRef(null),[p,M]=u.useState({top:0,left:0});u.useEffect(()=>{if(d&&m.current){const D=m.current.getBoundingClientRect(),B=D.left+Pr>window.innerWidth;M({top:D.bottom+6,...B?{right:window.innerWidth-D.right}:{left:D.left}})}},[d]),u.useEffect(()=>{if(!d)return;const D=B=>{g.current&&!g.current.contains(B.target)&&m.current&&!m.current.contains(B.target)&&h(!1)};return document.addEventListener("mousedown",D),()=>document.removeEventListener("mousedown",D)},[d]);const y=D=>{D(),h(!1)};return e.jsxs(e.Fragment,{children:[e.jsx("button",{ref:m,type:"button",className:"sa-tl-menu-trigger","data-active":t||d?"true":"false",onClick:D=>{D.stopPropagation(),h(B=>!B)},title:"Column options",style:{display:"inline-flex",alignItems:"center",justifyContent:"center",width:22,height:22,borderRadius:"var(--sa-radii-sm, 6px)",border:Zt,background:"var(--sa-background-primary, #ffffff)",cursor:"pointer",color:"var(--sa-text-subtle, #8c8f97)",flexShrink:0},children:e.jsx(ui,{sortDir:i,frozen:o})}),d&&e.jsxs(f.Box,{ref:g,onClick:D=>D.stopPropagation(),style:{position:"fixed",top:`${p.top}px`,...p.left!==void 0?{left:`${p.left}px`}:{right:`${p.right}px`},minWidth:Pr,backgroundColor:"var(--sa-background-primary, #ffffff)",border:Zt,borderRadius:"var(--sa-radii-sm, 6px)",boxShadow:"0 6px 24px rgba(0,0,0,0.12)",zIndex:9999,paddingTop:4,paddingBottom:4,display:"flex",flexDirection:"column"},children:[r&&e.jsxs(e.Fragment,{children:[e.jsx(yt,{icon:"ArrowUp",label:"Ascending",active:i==="asc",onClick:()=>y(()=>i==="asc"?c():s("asc"))}),e.jsx(yt,{icon:"ArrowDown",label:"Descending",active:i==="desc",onClick:()=>y(()=>i==="desc"?c():s("desc"))}),e.jsx("div",{style:{borderTop:Zt,margin:"4px 0"}})]}),e.jsx(yt,{icon:"Pin1",label:o?"Unfreeze":"Freeze",active:o,onClick:()=>y(l)}),n&&e.jsx(yt,{icon:"EyeClosed",label:"Hide column",danger:!0,onClick:()=>y(a)})]})]})},Gt="1px solid var(--sa-border-subtle, #0b120e24)",xi="var(--sa-text-subtle, #8c8f97)",lt="var(--sa-background-neutral, #f0f1f2)",Hr="2px 0 4px -2px rgba(0,0,0,0.15)",pt={display:"block",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},Nr="sa-table-layout-styles",hi=()=>{if(typeof document>"u"||document.getElementById(Nr))return;const t=document.createElement("style");t.id=Nr,t.textContent=`
2
+ .sa-table-layout tbody td { transition: background-color 0.15s ease; }
3
+ .sa-table-layout tbody tr:hover td {
4
+ background-color: var(--sa-background-primary-inverse, #f8f8f8);
5
+ }
6
+ .sa-table-layout td.sa-tl-frozen {
7
+ background-color: var(--sa-background-primary, #ffffff);
8
+ }
9
+ .sa-table-layout tbody tr:hover td.sa-tl-frozen {
10
+ background-color: var(--sa-background-primary-inverse, #f8f8f8);
11
+ }
12
+ .sa-tl-menu-trigger {
13
+ opacity: 0;
14
+ transition: opacity 0.12s ease;
15
+ }
16
+ .sa-table-layout th:hover .sa-tl-menu-trigger,
17
+ .sa-tl-menu-trigger[data-active="true"] {
18
+ opacity: 1;
19
+ }
20
+ @media (hover: hover) {
21
+ .sa-tl-row-actions {
22
+ opacity: 0; transition: opacity 0.12s ease; pointer-events: none;
23
+ }
24
+ .sa-table-layout tbody tr:hover .sa-tl-row-actions {
25
+ opacity: 1; pointer-events: auto;
26
+ }
27
+ }
28
+ @media (hover: none) {
29
+ .sa-tl-row-actions {
30
+ opacity: 1; pointer-events: auto;
31
+ background: var(--sa-background-primary, #fff) !important;
32
+ padding-left: 8px !important;
33
+ }
34
+ }
35
+ .sa-tl-kebab-menu {
36
+ position: fixed; z-index: 1000; min-width: 160px;
37
+ background: var(--sa-background-primary, #fff);
38
+ border: 1px solid var(--sa-border-subtle, #0b120e24);
39
+ border-radius: var(--sa-radii-sm, 6px);
40
+ box-shadow: 0 4px 12px rgba(0,0,0,0.12);
41
+ padding: 4px 0;
42
+ }
43
+ `,document.head.appendChild(t)},Qt=t=>t==="right"?"right":t==="center"?"center":"left",fi=(t,r)=>{if(r)return t[r]},mi=(t,r)=>t==null&&r==null?0:t==null?-1:r==null?1:typeof t=="number"&&typeof r=="number"?t-r:String(t).localeCompare(String(r)),gi=({columns:t,data:r,getRowKey:n,size:i="md",resizable:o=!1,widthStorageKey:s,columnState:c,onColumnStateChange:l,columnMenu:a=!1,sort:d,defaultSort:h,onSortChange:m,height:g,mobileLayout:p="cards",mobileBreakpoint:M="md",groupSeparator:y,summary:D,emptyState:B,rowActions:v})=>{hi();const b=!ye.useMediaQuery(M)&&p!=="scroll",O=!!(v!=null&&v.length),[T,C]=u.useState(null);u.useEffect(()=>{if(!T)return;const j=()=>C(null),E=setTimeout(()=>document.addEventListener("click",j),0);return()=>{clearTimeout(E),document.removeEventListener("click",j)}},[T]);const[I,N]=u.useState(()=>new Set),G=c!==void 0,[q,X]=u.useState({}),ee=c??q,de=j=>{l==null||l(j),G||X(j)},se=d!==void 0,[le,$]=u.useState(h??null),z=se?d??null:le,re=!m,he=j=>{m==null||m(j),se||$(j)},{headerGroups:ue,leafColumns:xe,hasGroups:De}=u.useMemo(()=>{var me;const j=new Set(ee.hidden??[]),E=(K,ae)=>K.key??(typeof K.accessor=="string"?K.accessor:`col-${ae}`),W=t.map((K,ae)=>{var Re;if((Re=K.children)!=null&&Re.length){const Ke=K.children.map((Qe,Vt)=>({col:Qe,key:E(Qe,`${ae}-${Vt}`)})).filter(Qe=>!j.has(Qe.key));return{col:K,key:K.key??`group-${ae}`,isGroup:!0,leaves:Ke}}const Se={col:K,key:E(K,`${ae}`)};return{col:K,key:Se.key,isGroup:!1,leaves:j.has(Se.key)?[]:[Se]}}).filter(K=>K.leaves.length>0),Y=W.some(K=>K.isGroup);let ce=W.flatMap(K=>K.leaves);if(!Y&&((me=ee.order)!=null&&me.length)){const K=new Map(ee.order.map((ae,Se)=>[ae,Se]));ce=[...ce].sort((ae,Se)=>(K.get(ae.key)??1/0)-(K.get(Se.key)??1/0))}return{headerGroups:W,leafColumns:ce,hasGroups:Y}},[t,ee]),Ie=u.useMemo(()=>new Map(xe.map((j,E)=>[j.key,E])),[xe]),ze=xe.map(j=>j.key).join("|"),Ve=(j,E)=>{const W=j.sortKey??(typeof j.accessor=="string"?j.accessor:void 0);return W?E[W]:void 0},je=j=>j.sortable??(!!j.sortKey||typeof j.accessor=="string"),be=u.useMemo(()=>{if(!re||!z)return r;const j=xe.find(W=>W.key===z.key);if(!j)return r;const E=z.direction==="asc"?1:-1;return[...r].sort((W,Y)=>mi(Ve(j.col,W),Ve(j.col,Y))*E)},[r,re,z,xe]),Be=!De,Te=!!s&&Be,[_e,Xe]=J.useColumnWidths(s??""),S=Te?_e:void 0,H=u.useRef(null),[V,F]=u.useState();u.useLayoutEffect(()=>{F(void 0)},[ze]),u.useLayoutEffect(()=>{if(!Be||V||!H.current)return;const j=H.current.querySelectorAll("th.sa-tl-leaf");F(Array.from(j).map(E=>E.offsetWidth))},[V,Be]);const[Z,P]=u.useState(0);u.useLayoutEffect(()=>{if(!De||!H.current)return;const j=H.current.querySelector(":scope > tr");j&&P(j.offsetHeight)},[De,ze]);const _=(j,E)=>{if((S==null?void 0:S[E])!=null)return S[E];if(j.width!=null)return j.width;if((V==null?void 0:V[E])!=null)return V[E]},U=(j,E)=>typeof j.width=="number"?j.width:V==null?void 0:V[E],fe=ee.frozenKey&&!De?xe.findIndex(j=>j.key===ee.frozenKey):-1,ve=j=>j<=fe,Oe=j=>{if(!V)return 0;let E=0;for(let W=0;W<j;W++)E+=V[W]??0;return E},Fe=u.useRef(null),[Ee,st]=u.useState("100vh");u.useLayoutEffect(()=>{if(g!==void 0)return;const j=()=>{if(Fe.current){const E=Fe.current.getBoundingClientRect().top;st(`calc(100vh - ${E}px)`)}};return j(),window.addEventListener("resize",j),()=>window.removeEventListener("resize",j)},[g]);const We=(j,E)=>n?n(j,E):E,He=(j,E,W)=>j.render?j.render(E,W,be):fi(E,j.accessor),Pe=xe.length+(O?1:0),xt=(j,E)=>{E||de({...ee,hidden:[...ee.hidden??[],j]})},ht=j=>de({...ee,frozenKey:ee.frozenKey===j?void 0:j}),qe=j=>(v??[]).filter(E=>{var W;return!((W=E.hidden)!=null&&W.call(E,j))}),dr={position:"absolute",right:0,top:"50%",transform:"translateY(-50%)",display:"flex",alignItems:"center",gap:4,paddingRight:8,paddingLeft:40,background:"linear-gradient(to right, transparent, var(--sa-background-primary-inverse, #f8f8f8) 40px)"},ft=(j,E,W,Y)=>{var Re;const ce=(Re=j.disabled)==null?void 0:Re.call(j,E),me=(Y==null?void 0:Y.showLabel)??j.showLabel,K=(Y==null?void 0:Y.size)??"xs",ae=e.jsx(A.Button,{size:K,variant:j.variant??"tertiary",tone:j.tone??"neutral",disabled:ce,onClick:()=>j.onClick(E,W),iconLeft:j.icon?e.jsx(k.Icon,{name:j.icon,size:"sm"}):void 0,children:me&&j.label}),Se=j.tooltip;return Se?e.jsx(Ce.Tooltip,{label:Se,position:"top",children:ae}):ae},Fn=(j,E)=>{const W=qe(j);if(!W.length)return null;if(W.length>5){const ce=We(j,E),me=(T==null?void 0:T.rowKey)===ce;return e.jsx("div",{className:"sa-tl-row-actions",style:dr,onClick:K=>K.stopPropagation(),children:e.jsx(Ce.Tooltip,{label:"Aksi lainnya",position:"top",children:e.jsx(A.Button,{size:"xs",variant:"tertiary",onClick:K=>{const ae=K.currentTarget.getBoundingClientRect();C(me?null:{rowKey:ce,top:ae.bottom+4,right:window.innerWidth-ae.right})},children:e.jsx(k.Icon,{name:"MenuVertical",size:"sm"})})})})}return e.jsx("div",{className:"sa-tl-row-actions",style:dr,children:W.map(ce=>e.jsx(u.Fragment,{children:ft(ce,j,E)},ce.key))})},En=(j,E)=>{const W=qe(j);return W.length?e.jsx("div",{style:{display:"flex",gap:6,flexWrap:"wrap",paddingTop:8,marginTop:8,borderTop:Gt},children:W.map(Y=>e.jsx(u.Fragment,{children:ft(Y,j,E,{showLabel:!0,size:"sm"})},Y.key))}):null},Mn=(j,E)=>{const W=qe(j);return W.length?e.jsx("div",{style:{display:"flex",gap:4,paddingRight:8,flexShrink:0},children:W.map(Y=>e.jsx(u.Fragment,{children:ft(Y,j,E,{showLabel:!1})},Y.key))}):null},Ot=(j,E)=>{const{col:W,key:Y}=j,ce=Ie.get(Y)??0,me=ve(ce),K=me&&ce===fe,ae=(z==null?void 0:z.key)===Y?z.direction:null,Se=a&&!W.disableMenu?e.jsx(wn,{active:!!ae||me,canSort:je(W),canHide:!W.locked,sortDir:ae,frozen:me,onSort:Vt=>he({key:Y,direction:Vt}),onClearSort:()=>he(null),onToggleFreeze:()=>ht(Y),onHide:()=>xt(Y,W.locked)}):null,Re=W.align==="right",Ke=W.align==="right"?"flex-end":W.align==="center"?"center":"flex-start",Qe=e.jsxs("span",{style:{flex:1,minWidth:0,display:"flex",alignItems:"center",gap:6,justifyContent:Ke,overflow:"hidden"},children:[W.icon&&e.jsx(k.Icon,{name:W.icon,size:"sm",style:{flexShrink:0}}),e.jsx("span",{style:pt,children:W.title})]});return e.jsx(J.Th,{className:`sa-tl-leaf${me?" sa-tl-frozen":""}`,rowSpan:E==null?void 0:E.rowSpan,minWidth:W.minWidth,resizable:Be?W.resizable:!1,defaultWidth:U(W,ce),style:{textAlign:Qt(W.align),width:_(W,ce),position:"sticky",top:(E==null?void 0:E.top)??0,left:me?Oe(ce):void 0,zIndex:me?3:2,backgroundColor:lt,boxShadow:K?Hr:void 0},children:e.jsx("div",{style:{display:"flex",alignItems:"center",gap:6,width:"100%"},children:Re?e.jsxs(e.Fragment,{children:[Se,Qe]}):e.jsxs(e.Fragment,{children:[Qe,Se]})})},`th-${Y}`)},Wt=xe.filter(j=>!j.col.hideOnMobile),Rt=Wt.find(j=>j.col.primary)??Wt[0],Ln=Wt.filter(j=>j!==Rt),In=j=>N(E=>{const W=new Set(E);return W.has(j)?W.delete(j):W.add(j),W}),ur=(j,E)=>Ln.map(({col:W,key:Y})=>{const ce=He(W,j,E),me=typeof ce=="string"||typeof ce=="number"?e.jsx(w.Text,{style:{minWidth:0,overflow:"hidden",textOverflow:"ellipsis",textAlign:"right"},children:ce}):e.jsx("div",{style:{minWidth:0,overflow:"hidden",textOverflow:"ellipsis",textAlign:"right"},children:ce});return e.jsxs("div",{style:{display:"flex",gap:12,justifyContent:"space-between",alignItems:"baseline"},children:[typeof W.title=="string"?e.jsx(w.Text,{color:"subtle",fontWeight:"medium",style:{color:xi,flexShrink:0},children:W.title}):e.jsx("div",{style:{flexShrink:0},children:W.title}),me]},Y)}),xr=(j,E)=>{const W=Rt?He(Rt.col,j,E):null;return typeof W=="string"||typeof W=="number"?e.jsx(w.Text,{as:"span",style:pt,children:W}):e.jsx("span",{style:pt,children:W})},Tn=be.length===0?e.jsx(f.Box,{style:{padding:16,textAlign:"center"},children:B}):p==="expand"?e.jsx(f.Box,{style:{display:"flex",flexDirection:"column"},children:be.map((j,E)=>{const W=We(j,E),Y=I.has(W);return e.jsxs("div",{style:{borderBottom:Gt},children:[e.jsxs("div",{style:{display:"flex",alignItems:"center"},children:[e.jsxs("button",{type:"button",onClick:()=>In(W),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:[xr(j,E),e.jsx(k.Icon,{name:Y?"ChevronUp":"ChevronDown",size:"sm",style:{flexShrink:0}})]}),O&&Mn(j,E)]}),Y&&e.jsx("div",{style:{padding:"0 12px 12px",display:"flex",flexDirection:"column",gap:6},children:ur(j,E)})]},W)})}):e.jsx(f.Box,{style:{display:"flex",flexDirection:"column",gap:8,padding:8},children:be.map((j,E)=>e.jsxs(f.Box,{style:{border:Gt,borderRadius:"var(--sa-radii-sm, 6px)",padding:12,display:"flex",flexDirection:"column",gap:6},children:[xr(j,E),ur(j,E),O&&En(j,E)]},We(j,E)))}),On=o&&Be&&V!==void 0,Wn=e.jsxs(J.Table,{className:"sa-table-layout",fullWidth:!0,size:i,resizable:On,onWidthsChange:Te?Xe:void 0,children:[e.jsx(J.Thead,{ref:H,children:De?e.jsxs(e.Fragment,{children:[e.jsxs(J.Tr,{children:[ue.map(j=>j.isGroup?e.jsx(J.Th,{colSpan:j.leaves.length,style:{textAlign:"center",position:"sticky",top:0,zIndex:2,backgroundColor:lt},children:e.jsx("span",{style:pt,children:j.col.title})},`grp-${j.key}`):Ot(j.leaves[0],{rowSpan:2})),O&&e.jsx(J.Th,{rowSpan:2,style:{position:"sticky",top:0,right:0,zIndex:3,width:1,padding:0,border:"none",backgroundColor:lt}})]}),e.jsx(J.Tr,{children:ue.flatMap(j=>j.isGroup?j.leaves.map(E=>Ot(E,{top:Z})):[])})]}):e.jsxs(J.Tr,{children:[xe.map(j=>Ot(j)),O&&e.jsx(J.Th,{style:{position:"sticky",top:0,right:0,zIndex:3,width:1,padding:0,border:"none",backgroundColor:lt}})]})}),e.jsx(J.Tbody,{children:be.length===0?e.jsx(J.Tr,{children:e.jsx(J.Td,{colSpan:Pe,children:B})}):e.jsxs(e.Fragment,{children:[be.map((j,E)=>{const W=y==null?void 0:y(j,E,E>0?be[E-1]:void 0);return e.jsxs(u.Fragment,{children:[W!=null&&W!==!1&&e.jsx(J.Tr,{children:e.jsx(J.Td,{colSpan:Pe,style:{backgroundColor:lt},children:W})}),e.jsxs(J.Tr,{children:[xe.map(({col:Y,key:ce},me)=>{var Ke;const K=(Ke=Y.cellProps)==null?void 0:Ke.call(Y,j,E,be);if(K!=null&&K.hidden)return null;const ae=ve(me),Se=ae&&me===fe,Re=He(Y,j,E);return e.jsx(J.Td,{className:ae?"sa-tl-frozen":void 0,colSpan:K==null?void 0:K.colSpan,rowSpan:K==null?void 0:K.rowSpan,style:{textAlign:Qt(Y.align),width:_(Y,me),minWidth:Y.minWidth,position:ae?"sticky":void 0,left:ae?Oe(me):void 0,zIndex:ae?1:void 0,boxShadow:Se?Hr:void 0},children:typeof Re=="string"?e.jsx(w.Text,{style:{whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",textAlign:Qt(Y.align)},children:Re}):Re},`tl-cell-${E}-${ce}`)}),O&&e.jsx(J.Td,{style:{position:"sticky",right:0,width:1,padding:0,overflow:"visible",zIndex:2,border:"none"},children:Fn(j,E)})]})]},We(j,E))}),D!=null&&e.jsx(J.Tr,{children:e.jsx(J.Td,{colSpan:Pe,children:D})})]})})]}),At=T?be.findIndex((j,E)=>We(j,E)===T.rowKey):-1,zt=At>=0?be[At]:null;return e.jsxs(e.Fragment,{children:[e.jsx(f.Box,{ref:Fe,fullWidth:!0,style:{overflow:"auto",height:g??Ee},children:b?Tn:Wn}),T&&zt&&e.jsx("div",{className:"sa-tl-kebab-menu",style:{top:T.top,right:T.right},onClick:j=>j.stopPropagation(),children:qe(zt).map(j=>e.jsx("div",{style:{padding:"2px 4px"},children:ft(j,zt,At,{showLabel:!0,size:"sm"})},j.key))})]})},Ut=t=>t==="asc"||t==="desc",yi=(t={})=>{const{sortKeyParam:r="sortBy",sortOrderParam:n="sortOrder",pageKey:i="page",defaultSort:o=null,paramKeys:s,scopeId:c,storage:l=ar}=t,{searchParams:a,setSearchParams:d,searchQueries:h}=ke(),m=a.toString(),g=c?it.tableSort(c):void 0,p=u.useRef(!1);u.useEffect(()=>{if(p.current||(p.current=!0,!g)||a.has(r)||a.has(n))return;const R=l.get(g);!(R!=null&&R.key)||!Ut(R.direction)||d({...Object.fromEntries(a.entries()),[r]:R.key,[n]:R.direction})},[]);const M=u.useMemo(()=>{const R=a.get(r),b=a.get(n);return R&&Ut(b)?{key:R,direction:b}:o},[m,r,n,o]);u.useEffect(()=>{if(!g)return;const R=a.get(r),b=a.get(n);R&&Ut(b)?l.set(g,{key:R,direction:b}):l.remove(g)},[m,g,r,n,l]);const y=(s==null?void 0:s.sortBy)??"sortBy",D=(s==null?void 0:s.sortOrder)??"sortOrder",B=u.useMemo(()=>M?{[y]:M.key,[D]:M.direction}:{},[M,y,D]),v=u.useCallback(R=>{const b={...h};R?(b[r]=R.key,b[n]=R.direction):(delete b[r],delete b[n]),delete b[i],d(b)},[h,r,n,i,d]);return{sort:M,setSort:v,params:B}},Et=({of:t,render:r})=>u.Children.toArray(t==null?void 0:t.map((n,i,o)=>r(n,i,o))),ne=({condition:t,fallback:r,children:n,loading:i,isLoading:o})=>e.jsx(e.Fragment,{children:o?i:t?n:r}),ie=t=>e.jsx(w.Text,{...t,fontFamily:"Poppins",fontSize:t.fontSize||"md",fontWeight:t.fontWeight||"medium",color:t.color||"gray-700",children:t.children}),Ne=t=>e.jsx(w.Text,{color:"red-600",fontSize:"sm",children:t.message}),pi=({size:t="md",direction:r="vertical",requiredTitle:n="(Required)",fullWidth:i=!1,...o})=>{var l,a,d;const s=o.hideMessageError||!1,c=r==="horizontal"?t==="sm"?342:t==="lg"?400:342:void 0;return e.jsxs(f.Box,{gap:r==="horizontal"?"spacing-96":"sm",direction:r==="horizontal"?"row":"column",...o.containerProps,children:[o.title&&e.jsx(ne,{condition:!!o.inputProps.required,fallback:e.jsxs(f.Box,{direction:"column",customMaxWidth:c,fullWidth:i,children:[e.jsx(ie,{children:o.title}),e.jsx(w.Text,{fontSize:t,color:"gray-500",children:o.description})]}),children:e.jsxs(f.Box,{direction:"column",customMaxWidth:c,fullWidth:i,children:[e.jsxs(oe.Flex,{direction:"row",gap:"xs",align:"center",children:[e.jsx(ie,{fontSize:t,children:o.title}),e.jsx(ie,{color:"error",fontSize:t,children:n}),e.jsx(ne,{condition:!!((l=o.tooltip)!=null&&l.label),children:e.jsx(Ce.Tooltip,{label:(a=o.tooltip)==null?void 0:a.label,arrowPosition:(d=o.tooltip)==null?void 0:d.arrowPosition,...o.tooltip,children:e.jsx(k.Icon,{name:"InfoCircle",size:t==="lg"?"sm":"xs",style:{color:"var(--sa-color-info-500, #00abeb)",marginTop:"6px"}})})})]}),e.jsx(ne,{condition:!!o.description,children:e.jsx(w.Text,{fontSize:t,color:"gray-500",children:o.description})})]})}),e.jsxs(f.Box,{direction:"column",gap:"xs",fullWidth:o.inputProps.fullWidth||!1,children:[e.jsx(Ge.Input,{ref:o.inputRef,size:t,...o.inputProps,status:o.errorMessage?"error":"default",fullWidth:!0}),!s&&o.errorMessage&&e.jsx(Ne,{message:o.errorMessage}),o.inputProps.extended&&o.inputProps.extended]})]})},ji=({size:t="md",direction:r="vertical",requiredTitle:n="(Required)",fullWidth:i=!1,...o})=>{var l,a,d;const s=o.hideMessageError||!1,c=r==="horizontal"?t==="sm"?342:t==="lg"?400:342:void 0;return e.jsxs(f.Box,{gap:r==="horizontal"?"spacing-96":"sm",direction:r==="horizontal"?"row":"column",onClick:o.onClickContainer,children:[o.title&&e.jsx(ne,{condition:!!o.inputProps.required,fallback:e.jsxs(f.Box,{direction:"column",customMaxWidth:c,fullWidth:i,children:[e.jsx(ie,{children:o.title}),e.jsx(w.Text,{fontSize:t,color:"gray-500",children:o.description})]}),children:e.jsxs(f.Box,{direction:"column",customMaxWidth:c,fullWidth:i,children:[e.jsxs(oe.Flex,{direction:"row",gap:"xs",align:"center",children:[e.jsx(ie,{fontSize:t,children:o.title}),e.jsx(ie,{color:"error",fontSize:t,children:n}),e.jsx(ne,{condition:!!((l=o.tooltip)!=null&&l.label),children:e.jsx(Ce.Tooltip,{label:(a=o.tooltip)==null?void 0:a.label,arrowPosition:(d=o.tooltip)==null?void 0:d.arrowPosition,...o.tooltip,children:e.jsx(k.Icon,{name:"InfoCircle",size:t==="lg"?"sm":"xs",style:{color:"var(--sa-color-info-500, #00abeb)",marginTop:"6px"}})})})]}),e.jsx(ne,{condition:!!o.description,children:e.jsx(w.Text,{fontSize:t,color:"gray-500",children:o.description})})]})}),e.jsxs(f.Box,{direction:"column",gap:"xs",fullWidth:o.inputProps.fullWidth||!1,children:[e.jsx(f.Box,{direction:"column",style:{width:o.inputProps.fullWidth?"100%":r==="horizontal"&&o.customWidth?o.customWidth:r==="horizontal"?"343px":""},children:e.jsx(tt.Dropdown,{size:t,...o.inputProps,error:!!o.errorMessage})}),!s&&o.errorMessage&&e.jsx(Ne,{message:o.errorMessage}),o.inputProps.extended&&o.inputProps.extended]})]})},bi=(t,r)=>typeof t=="string"&&t||r==="error"?"var(--sa-border-danger)":"var(--sa-border-subtle)",Ci=t=>{var l;const[r,n]=u.useState(!1),i=a=>{a.preventDefault(),a.stopPropagation()},o=a=>{a.preventDefault(),a.stopPropagation(),a.dataTransfer&&t.handleOnFileChange(a.dataTransfer.files.item(0))},s=a=>{a.preventDefault(),n(!0)},c=a=>{a.preventDefault(),n(!1)};return e.jsxs(f.Box,{width:"width-full",paddingInline:"md",direction:"row",gap:"sm",align:"center",onClick:t.handleOnClick,onDragOver:i,onDrop:o,onDragEnter:s,onDragLeave:c,paddingBlock:"md",borderRadius:"rounded-md",style:{border:r?"1px solid var(--sa-border-info)":`1px solid ${bi(t.errorMessage,t.status)}`},children:[e.jsx(k.Icon,{name:"Upload",size:"lg",style:{width:30,height:30}}),e.jsxs(oe.Flex,{direction:"column",gap:"xs",children:[e.jsxs(oe.Flex,{direction:"row",gap:"xs",children:[e.jsx(w.Text,{fontWeight:"medium",color:"gray-500",style:{textWrap:"nowrap"},fontSize:t.isDesktop?"md":"sm",children:"Click your upload"}),e.jsx(w.Text,{fontWeight:"medium",style:{textWrap:"nowrap"},fontSize:t.isDesktop?"md":"sm",children:"or Drag & Drop"})]}),e.jsx(w.Text,{fontSize:"sm",color:"gray-500",children:(l=t.fileSupports)==null?void 0:l.map(a=>a.toLocaleUpperCase()).join(", ")})]})]})};function vi(t){return t.split(" ").map(r=>r[0]).join("").slice(0,2).toUpperCase()}const Dn=t=>{const r={day:"2-digit",month:"short",year:"numeric"};return t.toLocaleDateString("id-ID",r)},wi=t=>{const r={Jan:0,Feb:1,Mar:2,Apr:3,Mei:4,Jun:5,Jul:6,Agu:7,Sep:8,Okt:9,Nov:10,Des:11},n=t.split(" ");if(n.length!==3)return null;const i=parseInt(n[0],10),o=r[n[1]],s=parseInt(n[2],10);return isNaN(i)||isNaN(o)||isNaN(s)?null:new Date(s,o,i)};function Di(t,r=!0){if(!t)return"Rp 0";const n=typeof t=="number"?t.toString():t;if(isNaN(Number(n)))return"Rp 0";const i=n.split("."),o=i[0].replace(/\B(?=(\d{3})+(?!\d))/g,"."),s=i.length===2?o+"."+i[1]:o;return r?"Rp"+s:s}String.prototype.toTitleCase=function(){return this.toLowerCase().split(" ").map(t=>t.charAt(0).toUpperCase()+t.slice(1)).join(" ")};String.prototype.toNumber=function(){return Number(this)};const Si=t=>{const r=t.split(" ");let n=r[0].charAt(0);return r.length>1&&(n+=""+r[1].charAt(0)),n.toUpperCase()};function ki(t){const r=typeof t=="string"?new Date(t):t;if(isNaN(r.getTime()))throw new Error("Invalid date format");const n=r.getFullYear(),i=String(r.getMonth()+1).padStart(2,"0"),o=String(r.getDate()).padStart(2,"0");return`${n}-${i}-${o}`}const Bi="sa-admin",Ae=t=>`var(--${Bi}-${t})`,Fi={base:{borderColor:Ae("base-border-color"),textColor:Ae("base-text-color"),iconColor:Ae("base-icon-color"),placeholderColor:Ae("base-placeholder-color")},document:{bgColor:Ae("document-bg-color")},sidebar:{bgColor:Ae("sidebar-bg-color"),borderColor:Ae("sidebar-border-color"),maxWidth:Ae("sidebar-max-width"),width:Ae("sidebar-width"),collapseWidth:Ae("sidebar-collapse-width"),collapseV2Width:Ae("sidebar-v2-collapse-width")}},Ei=24*60*60*1e3,Mi=t=>{const r="14px poppins",i=document.createElement("canvas").getContext("2d");i.font=r;const o=i.measureText(t).width;return Number(Math.ceil(o))},Li=/^[^\s@]+@[^\s@]+\.[^\s@]+$/,Ii=/--+/,Ti=/-$/;function Oi(t,r){return JSON.stringify(t)!==JSON.stringify(r)}function Wi(t){return/^(?:\+62|62|0)8[1-9][0-9]{7,10}$/.test(t)}function Ri(t){return/^[A-Za-z\s]+$/.test(t)}const Ai=t=>{const r=/^[0-9]$/,n=["ArrowLeft","ArrowRight","ArrowUp","ArrowDown","Backspace","Delete","Enter","Tab"];(t.ctrlKey||t.metaKey)&&(t.key==="a"||t.key==="c"||t.key==="v")||!r.test(t.key)&&!n.includes(t.key)&&t.preventDefault()},zi=t=>{const r=/^[0-9]$/,n=["ArrowLeft","ArrowRight","ArrowUp","ArrowDown","Backspace","Delete","Enter","Tab"];(t.ctrlKey||t.metaKey)&&t.key==="v"||r.test(t.key)&&!n.includes(t.key)&&t.preventDefault()},Vi=t=>{const r=/^[0-9.]$/,n=["ArrowLeft","ArrowRight","ArrowUp","ArrowDown","Backspace","Delete","Enter","Tab"];(t.ctrlKey||t.metaKey)&&t.key==="v"||!r.test(t.key)&&!n.includes(t.key)&&t.preventDefault()},Pi=t=>Li.test(t);function Hi(t){return!(Ii.test(t)||Ti.test(t))}const Ni=t=>{const r=["ArrowLeft","ArrowRight","ArrowUp","ArrowDown","Backspace","Delete","Enter","Tab","Home","End"];if((t.ctrlKey||t.metaKey)&&["a","c","v","x"].includes(t.key.toLowerCase()))return;const n=t.currentTarget.value;/^[0-9]$/.test(t.key)||t.key==="."&&!n.includes(".")||t.key==="-"&&n.length===0&&!n.includes("-")||r.includes(t.key)||t.preventDefault()},_i=t=>{const r=document.getElementById(t);if(r){const n=r.getBoundingClientRect(),i=window.scrollY+n.top-80;window.scrollTo({top:i,behavior:"smooth"})}};function qi(t){const r=t.toLowerCase();if(["kb","mb","gb"].find(s=>r.endsWith(s)))return t;const o=Number(t);if(isNaN(o))throw new Error("Invalid size format");return o>=1e6?`${(o/1e6).toFixed(2)}MB`:o>=1e3?`${(o/1e3).toFixed(2)}KB`:`${o}B`}function Zi(t){const r=t.split("/");return r[r.length-1]}const Gi=t=>{var r,n;return e.jsxs(f.Box,{width:"width-full",paddingInline:"md",height:"height-full",direction:"row",justify:"space-between",align:"center",onClick:t.handleOnClickFile,fullHeight:!0,paddingBlock:"md",id:"file-item",borderRadius:"rounded-md",style:{border:"1px solid var(--sa-border-subtle)",cursor:"pointer"},children:[e.jsxs(oe.Flex,{direction:"row",align:"center",gap:"sm",style:{flex:1,minWidth:0},children:[e.jsx(k.Icon,{name:"DocumentFilled",size:"lg",style:{color:"var(--sa-icon-brand)",width:30,height:30,flexShrink:0}}),e.jsxs(oe.Flex,{direction:"column",style:{minWidth:0,flex:1},children:[e.jsx(w.Text,{fontWeight:"bold",style:{textOverflow:"ellipsis",whiteSpace:"nowrap",overflow:"hidden"},children:t.defaultFile?Zi(t.defaultFile.url):(r=t.fileSelected)==null?void 0:r.name}),t.defaultFile?(t.defaultFile.size||t.defaultFile.date)&&e.jsxs(oe.Flex,{direction:"row",gap:"xs",align:"center",children:[t.defaultFile.size&&e.jsx(w.Text,{fontSize:"sm",fontWeight:"medium",children:t.defaultFile.size}),t.defaultFile.size&&t.defaultFile.date&&e.jsx(k.Icon,{name:"Dot",size:"xs"}),t.defaultFile.date&&e.jsx(w.Text,{fontSize:"sm",fontWeight:"medium",style:{textWrap:"nowrap"},children:t.defaultFile.date})]}):e.jsxs(oe.Flex,{direction:"row",gap:"xs",align:"center",children:[e.jsx(w.Text,{fontSize:"sm",fontWeight:"medium",children:qi(((n=t.fileSelected)==null?void 0:n.size.toString())||"100000")}),e.jsx(k.Icon,{name:"Dot",size:"xs"}),e.jsx(w.Text,{fontSize:"sm",fontWeight:"medium",style:{textWrap:"nowrap"},children:Dn(new Date)})]})]})]}),e.jsx(A.Button,{size:"xs",variant:"tertiary",tone:"error",type:"button",onClick:i=>{i.stopPropagation(),t.handleOnDeleteFile()},iconLeft:e.jsx(k.Icon,{name:"Trash1"})})]})},Sn=({status:t="default",labelPosition:r="outside-top",...n})=>{var g;const i=u.useRef(null),o=()=>{if(n.defaultFile){window.open(n.defaultFile.url);return}i.current&&i.current.click()},s=ye.useMediaQuery("md"),c=t==="error"||typeof n.errorMessage=="string"&&!!n.errorMessage,l=n.label?e.jsxs(oe.Flex,{direction:"row",align:"center",gap:"xs",children:[e.jsx(w.Text,{style:{fontSize:"14px",fontWeight:500,color:"var(--sa-text-primary)"},children:n.label}),n.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"}),n.required&&e.jsx("span",{style:{fontSize:"14px",fontWeight:500,color:"var(--sa-text-error)"},children:"*"})]}):null,a=n.description?e.jsx(w.Text,{style:{fontSize:"12px",fontWeight:400,color:"var(--sa-text-subtlest, #6b6e76)",lineHeight:"18px"},children:n.description}):null,d=e.jsxs(e.Fragment,{children:[n.helperText&&e.jsx(w.Text,{style:{fontSize:"12px",fontWeight:400,color:"var(--sa-text-subtlest, #6b6e76)",lineHeight:"18px"},children:n.helperText}),n.errorText&&t==="error"&&e.jsx(w.Text,{style:{fontSize:"12px",fontWeight:400,color:"var(--sa-text-error, #a4133c)",lineHeight:"18px"},children:n.errorText}),n.errorMessage&&!n.errorText&&e.jsx(w.Text,{style:{fontSize:"12px",fontWeight:400,color:"var(--sa-text-error, #a4133c)",lineHeight:"18px"},children:n.errorMessage})]}),h=e.jsx("input",{type:"file",style:{display:"none"},ref:i,onChange:p=>{var M;return n.handleOnChangeFile(((M=p.target.files)==null?void 0:M.item(0))||null)},accept:(g=n.fileSupportOption)==null?void 0:g.map(p=>"."+(p==null?void 0:p.toLowerCase())).join(", ")}),m=e.jsxs(f.Box,{direction:"column",fullWidth:!0,style:{minHeight:"69px"},borderRadius:"rounded-md",display:"flex",justify:"center",align:"center",cursor:"pointer",gap:"md",...n.containerProps,children:[h,(n.fileSelected||n.defaultFile)&&e.jsx(Gi,{fileSelected:n.fileSelected,defaultFile:n.defaultFile,handleOnDeleteFile:n.handleOnDeleteFile,handleOnClickFile:o}),!n.fileSelected&&!n.defaultFile&&e.jsx(Ci,{fileSupports:n.fileSupportOption,isDesktop:s,errorMessage:c?n.errorText||n.errorMessage||" ":void 0,status:c?"error":"default",handleOnClick:o,handleOnFileChange:n.handleOnChangeFile})]});return r==="outside-left"?e.jsxs(oe.Flex,{direction:"row",align:"flex-start",gap:"sm",style:{width:"100%"},children:[e.jsxs(oe.Flex,{direction:"column",gap:"xs",style:{width:"40%",minWidth:"120px",paddingTop:"10px"},children:[l,a]}),e.jsxs(oe.Flex,{direction:"column",gap:"sm",style:{flex:1,minWidth:0},children:[m,d]})]}):e.jsxs(oe.Flex,{direction:"column",gap:"sm",style:{width:"100%"},children:[l,a,m,d]})},Qi=({size:t="md",direction:r="vertical",requiredTitle:n="(Required)",fullWidth:i=!1,...o})=>{var l,a,d;const s=o.hideMessageError||!1,c=r==="horizontal"?t==="sm"?342:t==="lg"?400:342:void 0;return e.jsxs(f.Box,{gap:r==="horizontal"?"spacing-96":"sm",direction:r==="horizontal"?"row":"column",...o.containerProps,children:[o.title&&e.jsx(ne,{condition:!!o.inputProps.required,fallback:e.jsxs(f.Box,{direction:"column",customMaxWidth:c,fullWidth:i,children:[e.jsx(ie,{children:o.title}),e.jsx(w.Text,{fontSize:t,color:"gray-500",children:o.description})]}),children:e.jsxs(f.Box,{direction:"column",customMaxWidth:c,fullWidth:i,children:[e.jsxs(oe.Flex,{direction:"row",gap:"xs",align:"center",children:[e.jsx(ie,{fontSize:t,children:o.title}),e.jsx(ie,{color:"error",fontSize:t,children:n}),e.jsx(ne,{condition:!!((l=o.tooltip)!=null&&l.label),children:e.jsx(Ce.Tooltip,{label:(a=o.tooltip)==null?void 0:a.label,arrowPosition:(d=o.tooltip)==null?void 0:d.arrowPosition,...o.tooltip,children:e.jsx(k.Icon,{name:"InfoCircle",size:t==="lg"?"sm":"xs",style:{color:"var(--sa-color-info-500, #00abeb)",marginTop:"6px"}})})})]}),e.jsx(ne,{condition:!!o.description,children:e.jsx(w.Text,{fontSize:t,color:"gray-500",children:o.description})})]})}),e.jsxs(oe.Flex,{direction:"column",gap:"xs",children:[e.jsx(Sn,{...o.inputProps,status:o.errorMessage?"error":"default"}),!s&&o.errorMessage&&e.jsx(Ne,{message:o.errorMessage})]})]})},Ui=({size:t="md",direction:r="vertical",requiredTitle:n="(Required)",fullWidth:i=!1,required:o=!1,...s})=>{var a,d,h,m;const c=s.hideMessageError||!1,l=r==="horizontal"?t==="sm"?342:t==="lg"?400:342:void 0;return e.jsxs(f.Box,{gap:r==="horizontal"||r==="horizontal-inline"?"spacing-96":"sm",direction:r==="horizontal"||r==="horizontal-inline"?"row":"column",...s.containerProps,children:[s.title&&e.jsx(ne,{condition:!!o,fallback:e.jsxs(f.Box,{direction:"column",customMaxWidth:l,fullWidth:i,children:[e.jsx(ie,{children:s.title}),e.jsx(Le.Body3,{props:{color:"gray-500"},children:s.description})]}),children:e.jsxs(f.Box,{direction:"column",customMaxWidth:l,fullWidth:i,children:[e.jsxs(oe.Flex,{direction:"row",gap:"xs",align:"center",children:[e.jsx(ie,{fontSize:t,children:s.title}),e.jsx(ie,{color:"error",fontSize:t,children:n}),e.jsx(ne,{condition:!!((a=s.tooltip)!=null&&a.label),children:e.jsx(Ce.Tooltip,{label:(d=s.tooltip)==null?void 0:d.label,arrowPosition:(h=s.tooltip)==null?void 0:h.arrowPosition,...s.tooltip,children:e.jsx(k.Icon,{name:"InfoCircle",size:t==="lg"?"sm":"xs",style:{color:"var(--sa-color-info-500, #00abeb)",marginTop:"6px"}})})})]}),e.jsx(ne,{condition:!!s.description,children:e.jsx(w.Text,{fontSize:t,color:"gray-500",children:s.description})})]})}),e.jsx(f.Box,{gap:r==="horizontal-inline"?"xl":"md",direction:r==="horizontal-inline"?"row":"column",align:"flex-start",children:e.jsx(Et,{of:(m=s.checkBoxesList)==null?void 0:m.map(g=>({...g,isChecked:s.checkBoxesAreChecked.includes(g.id)})),render:g=>g.renderBadge?e.jsxs(f.Box,{direction:"row",justify:"space-between",gap:"lg",...s.badgeContainerProps,children:[e.jsx(ot.Checkbox,{name:g.name,value:g.id,checked:g.isChecked,onChange:p=>s.onChecked(p.target.value,g),label:g.name,description:g.description}),g.renderBadge]}):e.jsx(ot.Checkbox,{name:g.name,value:g.id,checked:g.isChecked,onChange:p=>s.onChecked(p.target.value,g),label:g.name,description:g.description})})}),!c&&s.errorMessage&&e.jsx(Ne,{message:s.errorMessage})]})},Ji=({position:t="vertical",size:r="md",fullWidth:n=!1,...i})=>{var s;const o=t==="horizontal-inline"||t==="horizontal-block"?r==="sm"?342:r==="lg"?400:342:void 0;return e.jsxs(f.Box,{gap:t==="horizontal-inline"||t==="horizontal-block"?"spacing-96":"sm",direction:t==="horizontal-inline"||t==="horizontal-block"?"row":"column",children:[e.jsx(ne,{condition:!!i.description||!!i.title,children:e.jsxs(f.Box,{direction:"column",customMaxWidth:o,fullWidth:n,children:[i.title&&e.jsx(ie,{children:i.title}),e.jsx(ne,{condition:!!i.description,children:e.jsx(w.Text,{color:"gray-500",children:i.description})})]})}),e.jsx(f.Box,{gap:"sm",direction:t==="horizontal"||t==="horizontal-inline"?"row":"column",align:"flex-start",flexWrap:"wrap",children:e.jsx(Et,{of:(s=i.radioList)==null?void 0:s.map(c=>({...c,isChecked:i.radioIsChecked===c.id})),render:({value:c,id:l,isChecked:a,subInput:d,label:h,description:m})=>e.jsxs(f.Box,{direction:"column",gap:"xs",customMaxWidth:o,children:[e.jsx(Xt.Radio,{id:`${l.toString()}-${c}`,name:i.groupName||h,label:h,value:c,checked:a,onChange:g=>i.onChecked({id:l,label:g.target.name,value:g.target.value}),disabled:i.disableAll},l),m&&e.jsx(w.Text,{color:"gray-500",style:{marginLeft:28},children:m}),d]})})}),i.errorMessage&&e.jsx(Ne,{message:i.errorMessage})]})},Yi=({size:t="md",direction:r="vertical",requiredTitle:n="(Required)",fullWidth:i=!1,...o})=>{var l,a,d;const s=o.hideMessageError||!1,c=r==="horizontal"?t==="sm"?342:t==="lg"?400:342:void 0;return e.jsxs(f.Box,{gap:r==="horizontal"?"spacing-96":"sm",direction:r==="horizontal"?"row":"column",...o.containerProps,children:[o.title&&e.jsx(ne,{condition:!!o.inputProps.required,fallback:e.jsxs(f.Box,{direction:"column",customMaxWidth:c,fullWidth:i,children:[e.jsx(ie,{children:o.title}),e.jsx(w.Text,{fontSize:t,color:"gray-500",children:o.description})]}),children:e.jsxs(f.Box,{direction:"column",customMaxWidth:c,fullWidth:i,children:[e.jsxs(oe.Flex,{direction:"row",gap:"xs",align:"center",children:[e.jsx(ie,{fontSize:t,children:o.title}),e.jsx(ie,{color:"error",fontSize:t,children:n}),e.jsx(ne,{condition:!!((l=o.tooltip)!=null&&l.label),children:e.jsx(Ce.Tooltip,{label:(a=o.tooltip)==null?void 0:a.label,arrowPosition:(d=o.tooltip)==null?void 0:d.arrowPosition,...o.tooltip,children:e.jsx(k.Icon,{name:"InfoCircle",size:t==="lg"?"sm":"xs",style:{color:"var(--sa-color-info-500, #00abeb)",marginTop:"6px"}})})})]}),e.jsx(ne,{condition:!!o.description,children:e.jsx(w.Text,{fontSize:t,color:"gray-500",children:o.description})})]})}),e.jsxs(oe.Flex,{direction:"column",gap:"xs",children:[e.jsx(Yt.Textarea,{ref:o.inputRef,size:t,...o.inputProps,status:o.errorMessage?"error":"default"}),!s&&o.errorMessage&&e.jsx(Ne,{message:o.errorMessage})]})]})},Xi=({size:t="md",direction:r="vertical",requiredTitle:n="(Required)",required:i=!1,fullWidth:o=!1,...s})=>{var l,a,d;const c=r==="horizontal"?t==="sm"?342:t==="lg"?400:342:void 0;return e.jsxs(f.Box,{gap:r==="horizontal"?"spacing-96":"sm",direction:r==="horizontal"?"row":"column",...s.containerProps,children:[s.title&&e.jsx(ne,{condition:i,fallback:e.jsxs(f.Box,{direction:"column",customMaxWidth:c,fullWidth:o,children:[e.jsx(ie,{children:s.title}),e.jsx(w.Text,{fontSize:t,color:"gray-500",children:s.titleDescription})]}),children:e.jsxs(f.Box,{direction:"column",customMaxWidth:c,fullWidth:o,children:[e.jsxs(oe.Flex,{direction:"row",gap:"xs",align:"center",children:[e.jsx(ie,{fontSize:t,children:s.title}),e.jsx(ie,{color:"error",fontSize:t,children:n}),e.jsx(ne,{condition:!!((l=s.tooltip)!=null&&l.label),children:e.jsx(Ce.Tooltip,{label:(a=s.tooltip)==null?void 0:a.label,arrowPosition:(d=s.tooltip)==null?void 0:d.arrowPosition,...s.tooltip,children:e.jsx(k.Icon,{name:"InfoCircle",size:t==="lg"?"sm":"xs",style:{color:"var(--sa-color-info-500, #00abeb)",marginTop:"6px"}})})})]}),e.jsx(ne,{condition:!!s.titleDescription,children:e.jsx(w.Text,{fontSize:t,color:"gray-500",children:s.titleDescription})})]})}),e.jsx(nt.Toggle,{checked:s.checked,onChange:s.onChange,label:s.label,description:s.description}),s.errorMessage&&e.jsx(Ne,{message:s.errorMessage})]})},Ki=({variant:t="primary",size:r="md",...n})=>{const i=et.useColor(),o=c=>{var a,d,h,m,g,p;if(!c)return;const l=n.disabled?"var(--sa-text-disable, #181a198f)":t==="secondary"?"var(--sa-text-subtle, #8c8f97)":t==="secondary-danger"?(d=(a=i==null?void 0:i.computed)==null?void 0:a.red)==null?void 0:d[600]:t==="secondary-primary"?(m=(h=i==null?void 0:i.computed)==null?void 0:h.blue)==null?void 0:m[700]:(p=(g=i==null?void 0:i.computed)==null?void 0:g.gray)==null?void 0:p[50];return e.jsx(k.Icon,{name:c,size:r,style:{color:l}})},s=()=>{var l,a,d,h;if(t!=="secondary-danger"&&t!=="secondary-primary")return n.title;const c={color:n.disabled?"var(--sa-text-disable, #181a198f)":t==="secondary-danger"?(a=(l=i==null?void 0:i.computed)==null?void 0:l.red)==null?void 0:a[600]:(h=(d=i==null?void 0:i.computed)==null?void 0:d.blue)==null?void 0:h[700]};switch(r){case"xs":return e.jsx(Le.Body2,{props:{style:c},children:n.title});case"sm":case"md":return e.jsx(Le.SubH3,{props:{style:c},children:n.title});case"lg":return e.jsx(Le.SubH2,{props:{style:c},children:n.title});default:return n.title}};return e.jsx(A.Button,{fullWidth:!0,disabled:n.disabled,primary:t==="primary",secondary:t==="secondary"||t==="secondary-danger"||t==="secondary-primary",success:t==="success",onClick:n.onClick,type:n.type,iconLeft:o(n.iconLeft),iconRight:o(n.iconRight),size:r,children:s()})},$i=t=>e.jsx(Le.H5,{props:{...t},children:t.title}),es=({size:t="md",direction:r="vertical",requiredTitle:n="(Required)",fullWidth:i=!1,...o})=>{var l,a,d;const s=o.hideMessageError||!1,c=r==="horizontal"?t==="sm"?342:t==="lg"?400:342:void 0;return e.jsxs(f.Box,{gap:r==="horizontal"?"spacing-96":"sm",direction:r==="horizontal"?"row":"column",onClick:o.onClickContainer,children:[o.title&&e.jsx(ne,{condition:!!o.inputProps.required,fallback:e.jsxs(f.Box,{direction:"column",customMaxWidth:c,fullWidth:i,children:[e.jsx(ie,{children:o.title}),e.jsx(w.Text,{fontSize:t,color:"gray-500",children:o.description})]}),children:e.jsxs(f.Box,{direction:"column",customMaxWidth:c,fullWidth:i,children:[e.jsxs(oe.Flex,{direction:"row",gap:"xs",align:"center",children:[e.jsx(ie,{fontSize:t,children:o.title}),e.jsx(ie,{color:"error",fontSize:t,children:n}),e.jsx(ne,{condition:!!((l=o.tooltip)!=null&&l.label),children:e.jsx(Ce.Tooltip,{label:(a=o.tooltip)==null?void 0:a.label,arrowPosition:(d=o.tooltip)==null?void 0:d.arrowPosition,...o.tooltip,children:e.jsx(k.Icon,{name:"InfoCircle",size:t==="lg"?"sm":"xs",style:{color:"var(--sa-color-info-500, #00abeb)",marginTop:"6px"}})})})]}),e.jsx(ne,{condition:!!o.description,children:e.jsx(w.Text,{fontSize:t,color:"gray-500",children:o.description})})]})}),e.jsxs(oe.Flex,{direction:"column",gap:"xs",children:[e.jsx(f.Box,{direction:"column",style:{width:r==="horizontal"&&o.customWidth?o.customWidth:r==="horizontal"?"343px":""},children:e.jsx(Ye.StarasiaDate,{size:t,...o.inputProps,status:o.errorMessage?"error":void 0})}),!s&&o.errorMessage&&e.jsx(Ne,{message:o.errorMessage})]})]})};async function ts(t,r){const n=new Image;n.src=t,await new Promise((s,c)=>{n.onload=s,n.onerror=c});const i=document.createElement("canvas");i.width=r.width,i.height=r.height;const o=i.getContext("2d",{alpha:!0});if(!o)throw new Error("No 2D context");return o.drawImage(n,r.x,r.y,r.width,r.height,0,0,r.width,r.height),new Promise((s,c)=>{i.toBlob(l=>{if(!l)return c("Canvas is empty");const a=new File([l],"cropped.png",{type:"image/png"});s(a)},"image/png")})}const _r={"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},kn=u.forwardRef(({handleUpload:t,urlImage:r,isUploading:n,croppedImage:i,setCroppedImage:o,size:s="96",aspect:c="1:1",containerProps:l,maxFileSize:a=2,onError:d},h)=>{const m=ye.useMediaQuery("md"),[g,p]=u.useState(!1),[M,y]=u.useState(null),[D,B]=u.useState(!1),[v,R]=u.useState({x:0,y:0}),[b,O]=u.useState(1),[T,C]=u.useState(null);u.useEffect(()=>{r===null&&o(null)},[r]);const I=u.useCallback(($,z)=>{C(z)},[]),N=$=>{var he;const z=(he=$.target.files)==null?void 0:he[0];if(!z)return;const re=new FileReader;re.onload=()=>{y(re.result),B(!0)},re.readAsDataURL(z)},G=async()=>{if(!(!M||!T))try{const $=await ts(M,T);if(a&&$.size>a*1024*1024){d==null||d(`Ukuran file maksimal ${a}MB`);return}t==null||t($);const z=URL.createObjectURL($);o(z,$),B(!1)}catch{d==null||d("Gagal memproses gambar")}},q=u.useRef(null),X=()=>{q.current&&q.current.click()};u.useImperativeHandle(h,()=>({openFileDialog:()=>{var $;($=q.current)==null||$.click()}}));const ee=parseInt(s,10),de=_r[c];let se,le;return de>=1?(le=ee,se=ee*de):(se=ee,le=ee/de),e.jsxs(f.Box,{direction:"column",display:"flex",position:"relative",bg:(l==null?void 0:l.bg)||"gray-200",borderStyle:(l==null?void 0:l.borderStyle)||"border-none",borderColor:(l==null?void 0:l.borderColor)||"gray-200",borderWidth:(l==null?void 0:l.borderWidth)||"border-2",borderRadius:(l==null?void 0:l.borderRadius)||"rounded-md",overflow:"overflow-hidden",align:"center",justify:"center",style:{width:l!=null&&l.fullWidth?"100%":`${se}px`,height:l!=null&&l.fullWidth?"auto":`${le}px`,aspectRatio:de,flexShrink:0},onMouseEnter:()=>p(!0),onMouseLeave:()=>p(!1),children:[i||r?e.jsx("img",{src:i||r||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(k.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:g?1:0,transition:"opacity 0.3s ease-in-out"},onClick:X,children:[e.jsx("input",{ref:q,type:"file",accept:"image/*",onChange:N,disabled:n,style:{display:"none"}}),e.jsxs(f.Box,{display:"flex",align:"center",gap:"spacing-2",direction:"row",children:[e.jsx(k.Icon,{name:"Edit3",style:{color:"var(--sa-background-primary, #ffffff)"}}),e.jsx(ne,{condition:s.toNumber()>80,children:e.jsx(w.Text,{color:"gray-50",fontSize:s.toNumber()>80?"sm":"md",fontWeight:"medium",children:"Edit Image"})})]})]}),n&&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"})}),D&&er.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:()=>B(!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:m?c==="1:1"?"min(90vw, 480px)":`min(90vw, ${se*2}px)`:"calc(100vw - 2rem)",display:"flex",flexDirection:"column"},onClick:$=>$.stopPropagation(),children:[e.jsx("div",{style:{position:"relative",width:"100%",height:"20rem",backgroundColor:"var(--sa-color-gray-100)"},children:M&&e.jsx(Rn,{image:M,crop:v,zoom:b,aspect:c?_r[c]:void 0,onCropChange:R,onZoomChange:O,onCropComplete:I,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(A.Button,{size:"sm",secondary:!0,onClick:()=>B(!1),children:"Cancel"}),e.jsx(A.Button,{size:"sm",primary:!0,onClick:G,children:"Crop"})]})]})}),document.body)]})}),rs=({size:t="md",direction:r="vertical",requiredTitle:n="(Required)",fullWidth:i=!1,required:o=!1,...s})=>{var a,d,h;const c=s.hideMessageError||!1,l=r==="horizontal"?t==="sm"?342:t==="lg"?400:342:void 0;return e.jsxs(f.Box,{gap:r==="horizontal"?"spacing-96":"sm",direction:r==="horizontal"?"row":"column",...s.containerProps,children:[s.title&&e.jsx(ne,{condition:!!o,fallback:e.jsxs(f.Box,{direction:"column",customMaxWidth:l,fullWidth:i,children:[e.jsx(ie,{children:s.title}),e.jsx(w.Text,{fontSize:t,color:"gray-500",children:s.description})]}),children:e.jsxs(f.Box,{direction:"column",customMaxWidth:l,fullWidth:i,children:[e.jsxs(oe.Flex,{direction:"row",gap:"xs",align:"center",children:[e.jsx(ie,{fontSize:t,children:s.title}),e.jsx(ie,{color:"error",fontSize:t,children:n}),e.jsx(ne,{condition:!!((a=s.tooltip)!=null&&a.label),children:e.jsx(Ce.Tooltip,{label:(d=s.tooltip)==null?void 0:d.label,arrowPosition:(h=s.tooltip)==null?void 0:h.arrowPosition,...s.tooltip,children:e.jsx(k.Icon,{name:"InfoCircle",size:t==="lg"?"sm":"xs",style:{color:"var(--sa-color-info-500, #00abeb)",marginTop:"6px"}})})})]}),e.jsx(ne,{condition:!!s.description,children:e.jsx(w.Text,{fontSize:t,color:"gray-500",children:s.description})})]})}),e.jsxs(oe.Flex,{direction:"column",gap:"xs",children:[e.jsx(kn,{...s.inputProps}),!c&&s.errorMessage&&e.jsx(Ne,{message:s.errorMessage})]})]})},ns=({size:t="md",direction:r="vertical",requiredTitle:n="(Required)",fullWidth:i=!1,...o})=>{var c,l,a;const s=r==="horizontal"?t==="sm"?342:t==="lg"?400:342:void 0;return e.jsxs(f.Box,{gap:r==="horizontal"?"spacing-96":"sm",direction:r==="horizontal"?"row":"column",...o.containerProps,children:[o.title&&e.jsx(ne,{condition:!!o.inputProps.required,fallback:e.jsxs(f.Box,{direction:"column",customMaxWidth:s,fullWidth:i,children:[e.jsx(ie,{children:o.title}),e.jsx(w.Text,{fontSize:t,color:"gray-500",children:o.description})]}),children:e.jsxs(f.Box,{direction:"column",customMaxWidth:s,fullWidth:i,children:[e.jsxs(oe.Flex,{direction:"row",gap:"xs",align:"center",children:[e.jsx(ie,{fontSize:t,children:o.title}),e.jsx(ie,{color:"error",fontSize:t,children:n}),e.jsx(ne,{condition:!!((c=o.tooltip)!=null&&c.label),children:e.jsx(Ce.Tooltip,{label:(l=o.tooltip)==null?void 0:l.label,arrowPosition:(a=o.tooltip)==null?void 0:a.arrowPosition,...o.tooltip,children:e.jsx(k.Icon,{name:"InfoCircle",size:t==="lg"?"sm":"xs",style:{color:"var(--sa-color-info-500, #00abeb)",marginTop:"6px"}})})})]}),e.jsx(ne,{condition:!!o.description,children:e.jsx(w.Text,{fontSize:t,color:"gray-500",children:o.description})})]})}),o.inputProps.extended&&o.inputProps.extended]})},os=({items:t,id:r,handleOnUpdate:n,width:i,toggleShow:o=!0,disabled:s=!1})=>{var h;const[c,l]=u.useState([]);u.useEffect(()=>{t&&l([...t.map(m=>({id:m.id,isActive:m.isActive}))])},[t]);const a=(h=c.find(m=>m.id===r))==null?void 0:h.isActive,d=u.useCallback(()=>{l(m=>m.map(g=>g.id===r?{...g,isActive:!g.isActive}:g)),n&&n(!a)},[r,n,a]);return e.jsx(f.Box,{direction:"row",gap:"md",style:{width:i},children:o&&e.jsx(nt.Toggle,{disabled:s,checked:a,onChange:d,label:a?"Active":"Inactive"})})},is={InputText:pi,InputDropdown:ji,InputSingleFile:Qi,CheckBoxOptions:Ui,RadioOptions:Ji,InputTextArea:Yi,ToggleForm:Xi,ActionButton:Ki,FormTitle:$i,InputDate:es,InputImgFile:rs,Custom:ns},Bn=({customBottom:t})=>{const[r,n]=u.useState(!1),i=()=>{window.scrollY>window.screenY?n(!0):n(!1)},o=()=>{window.scrollTo({top:0,behavior:"smooth"})};return u.useEffect(()=>(window.addEventListener("scroll",i),()=>{window.removeEventListener("scroll",i)}),[]),e.jsx(f.Box,{direction:"column",style:{position:"fixed",bottom:0,right:0},children:e.jsx(f.Box,{direction:"column",position:"absolute",style:{bottom:t||"1.6rem",right:"2rem",transform:r?"scale(1)":"scale(0)",transition:"transform 0.2s ease-in-out"},children:e.jsx(A.Button,{secondary:!0,size:"xs",onClick:o,type:"button",iconLeft:e.jsx(k.Icon,{width:16,size:"xs",name:"ArrowPullUp",style:{color:"var(--sa-background-brand, #04254f)"}})})})})},ss=({pageLayout:t,children:r,wrapperProps:n,containerProps:i})=>{const o=ye.useMediaQuery("md"),s=(i==null?void 0:i.customWidth)??264;return e.jsxs(f.Box,{display:"block",direction:"row",...n,style:{marginRight:o?s:24,...(n==null?void 0:n.style)??{}},children:[t,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",...i,style:{marginTop:"4rem",backgroundColor:"var(--sa-background-white, #ffffff)",borderColor:"var(--sa-border-subtle, #0b120e24)",...(i==null?void 0:i.style)??{}},children:r})]})},ls=({children:t,withScrollToTopButton:r=!1,scrollToTopButtonProps:n,containerProps:i})=>e.jsx(f.Box,{direction:"column",position:"absolute",width:"width-full",style:{zIndex:"var(--app-footer-zindex, 999)"},children:e.jsxs(f.Box,{position:"fixed",bottom:"bottom-0",right:"right-0",padding:"spacing-32",height:"height-24",bg:"gray-50",direction:"row",align:"center",display:"flex",style:{left:"var(--app-sidebar-width, 0px)",transition:"left 0.3s ease-in-out",borderColor:"var(--sa-border-subtle, #0b120e24)"},justify:(i==null?void 0:i.justify)||"flex-end",borderStyle:"border-solid-t",borderWidth:"border-t",children:[r&&e.jsx(Bn,{...n,customBottom:(n==null?void 0:n.customBottom)||"5.7rem"}),t]})}),cs=({fields:t})=>e.jsx(f.Box,{display:"flex",direction:"column",gap:"lg",children:e.jsx(Et,{of:t,render:(r,n)=>e.jsx(as,{...r},n)})}),as=({title:t,value:r,icon:n})=>e.jsxs(f.Box,{display:"flex",direction:"column",gap:"sm",children:[n?e.jsxs(f.Box,{display:"flex",direction:"row",align:"center",gap:"xs",children:[e.jsx(k.Icon,{name:n,color:"subtle"}),e.jsx(w.Text,{color:"gray-500",variant:"sub-h3",children:t})]}):e.jsx(w.Text,{color:"gray-500",variant:"sub-h3",children:t}),typeof r=="string"?e.jsx(w.Text,{variant:"sub-h3",children:r}):r]}),pe={silhouette:"#A7B0AC",accent:"#78867F"};function ds({width:t,height:r}){return e.jsx(e.Fragment,{children:e.jsxs("svg",{width:t||"100",height:r||"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:pe.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:pe.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:pe.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:pe.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:pe.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:pe.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:pe.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:pe.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:pe.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:pe.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:pe.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:pe.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:pe.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:pe.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:pe.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:pe.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:pe.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:pe.accent,fillOpacity:"0.65"})]})})}const us=({title:t="create",children:r,onClickAction:n,variant:i="primary",variantTitle:o,leftIcon:s,showButton:c=!0,customHeight:l,childrenButton:a,customIcon:d})=>{const h=()=>{switch(i){case"primary":return e.jsx(e.Fragment,{children:s?e.jsx(A.Button,{primary:!0,iconLeft:s,onClick:n,children:a||t}):e.jsx(A.Button,{primary:!0,onClick:n,children:a||t})});case"secondary":return e.jsx(e.Fragment,{children:s?e.jsx(A.Button,{secondary:!0,iconLeft:s,onClick:n,children:o?e.jsx(w.Text,{fontFamily:"Poppins",fontSize:"md",fontWeight:"medium",style:{color:"var(--sa-background-success, #28ac6e)"},children:a||t}):t}):e.jsx(A.Button,{secondary:!0,onClick:n,children:a||t})});case"success":return e.jsx(e.Fragment,{children:s?e.jsx(A.Button,{success:!0,iconLeft:s,onClick:n,children:a||t}):e.jsx(A.Button,{success:!0,onClick:n,children:a||t})});default:return e.jsx(e.Fragment,{children:s?e.jsx(A.Button,{primary:!0,iconLeft:s,onClick:n,children:a||t}):e.jsx(A.Button,{primary:!0,onClick:n,children:a||t})})}};return e.jsxs(f.Box,{height:"height-full",display:"flex",direction:"column",gap:"sm",justify:"center",align:"center",marginBlock:"auto",customHeight:l,children:[d||e.jsx(ds,{}),e.jsx(f.Box,{direction:"column",children:r.map((m,g)=>e.jsx(Le.Body1,{props:{align:"center",textAlign:"center"},children:g>2?null:m},g))}),c?h():null]})},Q={c001A72:"#001A72",c64B5F6:"#64B5F6",c98B4CB:"#98B4CB",cBBDEFB:"#BBDEFB",cD0E5F7:"#D0E5F7",cD6EBFD:"#D6EBFD",c000000:"#000000",cFFFFFF:"#FFFFFF"};function xs({width:t,height:r}){return e.jsx(e.Fragment,{children:e.jsxs("svg",{width:t,height:r,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:Q.c64B5F6,strokeWidth:"5",strokeLinecap:"round"}),e.jsx("rect",{x:"216.562",y:"45.5605",width:"55",height:"20",fill:Q.cD6EBFD}),e.jsx("rect",{x:"14.4375",y:"89.7803",width:"46",height:"20",fill:Q.cD6EBFD}),e.jsx("rect",{x:"0.4375",y:"111.78",width:"46",height:"20",fill:Q.cD6EBFD}),e.jsx("rect",{x:"0.4375",y:"67.7803",width:"46",height:"20",fill:Q.cD6EBFD}),e.jsx("rect",{x:"344.312",y:"0.5",width:"55",height:"20",fill:Q.cD6EBFD}),e.jsx("rect",{x:"549.562",y:"86.7803",width:"55",height:"20",fill:Q.cD6EBFD}),e.jsx("rect",{x:"566.562",y:"64.7803",width:"55",height:"20",fill:Q.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:Q.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:Q.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:Q.cBBDEFB,fillOpacity:"0.6"}),e.jsx("path",{d:"M349.472 171.5H261.64V186.396H349.472V171.5Z",fill:Q.c98B4CB}),e.jsx("path",{d:"M261.64 171.5L244.719 186.396H261.64V171.5Z",fill:Q.c98B4CB}),e.jsx("path",{d:"M363.574 186.396L349.472 171.5V186.396H363.574Z",fill:Q.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:Q.c000000,strokeWidth:"2"}),e.jsx("rect",{x:"246.438",y:"202.5",width:"116",height:"60",fill:Q.cFFFFFF}),e.jsx("path",{d:"M245.536 187.5H362.959L369.438 198.5H237.438L245.536 187.5Z",fill:Q.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:Q.cFFFFFF,stroke:Q.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:Q.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:Q.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:Q.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:Q.c000000,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}),e.jsx("circle",{cx:"291.724",cy:"118.765",r:"3.1027",fill:Q.c000000}),e.jsx("path",{d:"M308.128 122.463C309.123 120.973 309.987 120.418 311.883 120.237",stroke:Q.c000000,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}),e.jsx("circle",{cx:"307.681",cy:"118.765",r:"3.1027",fill:Q.c000000}),e.jsx("ellipse",{cx:"297.938",cy:"134.5",rx:"2.5",ry:"2",fill:Q.c000000}),e.jsx("path",{d:"M340.437 97.5L333.438 104.5M333.438 97.5L340.438 104.5",stroke:Q.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:Q.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:Q.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:Q.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:Q.c001A72,strokeWidth:"1.2",strokeLinecap:"round",strokeLinejoin:"round"}),e.jsx("circle",{cx:"339.938",cy:"111",r:"2.5",fill:Q.c001A72}),e.jsx("circle",{cx:"336.438",cy:"94.5",r:"1",fill:Q.c001A72}),e.jsx("circle",{cx:"347.438",cy:"99.5",r:"1",fill:Q.c001A72}),e.jsx("circle",{cx:"267.438",cy:"109.5",r:"2",fill:Q.c001A72}),e.jsx("circle",{cx:"293.438",cy:"85.5",r:"2",fill:Q.c001A72}),e.jsx("circle",{cx:"339.438",cy:"138.5",r:"2",fill:Q.c001A72}),e.jsx("circle",{cx:"267.438",cy:"150.5",r:"2",fill:Q.c001A72}),e.jsx("circle",{cx:"268.438",cy:"118.5",r:"1",fill:Q.c001A72}),e.jsx("circle",{cx:"260.438",cy:"124.5",r:"1",fill:Q.c001A72})]})})}function hs({onClick:t}){const r=ye.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(xs,{width:r?600:300}),e.jsx(w.Text,{fontWeight:"bold",fontSize:r?"3xl":"2xl",textAlign:"center",children:"Page Not Found"}),e.jsx(w.Text,{fontWeight:"semibold",fontSize:r?"lg":"md",textAlign:"center",children:"Sorry, we couldn't find the page you are looking for"}),t&&e.jsx(A.Button,{size:r?"md":"xs",onClick:t,children:"Go Back"})]})}const te={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 fs({width:t,height:r}){return e.jsx(e.Fragment,{children:e.jsxs("svg",{width:t,height:r,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:te.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:te.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:te.cEFF3F8,stroke:te.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:te.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:te.cCABEB1}),e.jsx("path",{d:"M287.68 218.884L289.354 213.022H378.961L381.473 218.884H287.68Z",fill:te.cC0B2A2}),e.jsx("path",{d:"M381.944 218.803L381.58 212.266H386.385L386.022 218.803H381.944Z",fill:te.c956847,stroke:te.c48504C}),e.jsx("path",{d:"M283.124 218.803L282.768 213.104H287.565L287.209 218.803H283.124Z",fill:te.c956847,stroke:te.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:te.cC8CEF4,stroke:te.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:te.cC8CEF4,stroke:te.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:te.cC8CEF4,stroke:te.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:te.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:te.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:te.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:te.cD6D6D6}),e.jsx("path",{d:"M368.673 152.523H301.336V174.5H368.673V152.523Z",fill:te.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:te.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:te.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:te.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:te.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:te.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:te.cBBDEFB,fillOpacity:"0.6"}),e.jsx("rect",{x:"43",y:"87.5",width:"46",height:"20",fill:te.cD6EBFD}),e.jsx("rect",{x:"29",y:"109.5",width:"46",height:"20",fill:te.cD6EBFD}),e.jsx("rect",{x:"29",y:"65.5",width:"46",height:"20",fill:te.cD6EBFD}),e.jsx("rect",{x:"356",y:"0.5",width:"55",height:"20",fill:te.cD6EBFD}),e.jsx("rect",{x:"572",y:"142.5",width:"55",height:"20",fill:te.cD6EBFD}),e.jsx("rect",{x:"589",y:"120.5",width:"55",height:"20",fill:te.cD6EBFD}),e.jsx("path",{d:"M3 255.5L651 255.5",stroke:te.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:te.cFFFFFF,transform:"translate(246 60.5)"})})})]})})}function ms({onClick:t}){const r=ye.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(fs,{width:r?600:300}),e.jsx(w.Text,{fontWeight:"bold",fontSize:r?"3xl":"2xl",children:"We Are Sorry ..."}),t&&e.jsx(A.Button,{size:r?"md":"xs",onClick:t,children:"Go Back"})]})}const x={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 gs({width:t,height:r}){return e.jsx(e.Fragment,{children:e.jsxs("svg",{width:t,height:r,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:x.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:x.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:x.cD6EBFD}),e.jsx("rect",{x:"216.562",y:"45.7803",width:"55",height:"20",fill:x.cD6EBFD}),e.jsx("rect",{x:"14.4375",y:"90",width:"46",height:"20",fill:x.cD6EBFD}),e.jsx("rect",{x:"0.4375",y:"112",width:"46",height:"20",fill:x.cD6EBFD}),e.jsx("rect",{x:"0.4375",y:"68",width:"46",height:"20",fill:x.cD6EBFD}),e.jsx("rect",{x:"344.312",y:"0.719727",width:"55",height:"20",fill:x.cD6EBFD}),e.jsx("rect",{x:"549.562",y:"87",width:"55",height:"20",fill:x.cD6EBFD}),e.jsx("rect",{x:"566.562",y:"65",width:"55",height:"20",fill:x.cD6EBFD}),e.jsx("path",{d:"M25.8125 282.22H605.812",stroke:x.c64B5F6,strokeWidth:"5",strokeLinecap:"round"}),e.jsx("rect",{x:"263.012",y:"175.42",width:"104.6",height:"31.2833",rx:"3.3",fill:x.cFFFFFF,stroke:x.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:x.c001174}),e.jsx("rect",{x:"263.012",y:"210.752",width:"104.6",height:"31.2833",rx:"3.3",fill:x.cFFFFFF,stroke:x.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:x.c001174}),e.jsx("rect",{x:"263.012",y:"246.969",width:"104.6",height:"31.2833",rx:"3.3",fill:x.cFFFFFF,stroke:x.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:x.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:x.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:x.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:x.cF3F8FD}),e.jsx("circle",{cx:"270.258",cy:"179.136",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"270.258",cy:"181.786",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"281.561",cy:"179.136",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"281.561",cy:"181.786",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"273.085",cy:"179.136",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"273.085",cy:"181.786",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"284.388",cy:"179.136",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"284.388",cy:"181.786",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"275.91",cy:"179.136",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"275.91",cy:"181.786",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"287.214",cy:"179.136",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"287.214",cy:"181.786",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"278.737",cy:"179.136",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"278.737",cy:"181.786",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"290.04",cy:"179.136",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"290.04",cy:"181.786",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"344.462",cy:"179.136",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"344.462",cy:"181.786",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"355.765",cy:"179.136",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"355.765",cy:"181.786",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"347.29",cy:"179.136",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"347.29",cy:"181.786",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"358.592",cy:"179.136",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"358.592",cy:"181.786",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"350.114",cy:"179.136",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"350.114",cy:"181.786",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"361.418",cy:"179.136",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"361.418",cy:"181.786",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"352.941",cy:"179.136",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"352.941",cy:"181.786",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"364.244",cy:"179.136",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"364.244",cy:"181.786",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"344.462",cy:"200.336",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"344.462",cy:"202.986",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"355.765",cy:"200.336",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"355.765",cy:"202.986",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"347.29",cy:"200.336",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"347.29",cy:"202.986",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"358.592",cy:"200.336",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"358.592",cy:"202.986",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"350.114",cy:"200.336",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"350.114",cy:"202.986",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"361.418",cy:"200.336",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"361.418",cy:"202.986",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"352.941",cy:"200.336",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"352.941",cy:"202.986",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"364.244",cy:"200.336",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"364.244",cy:"202.986",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"359.918",cy:"191.061",r:"4.45833",stroke:x.c001174,strokeWidth:"0.8"}),e.jsx("circle",{cx:"359.918",cy:"191.061",r:"2.20833",fill:x.cE7EAE9}),e.jsx("rect",{x:"269.726",y:"186.553",width:"36.4",height:"9.01667",rx:"0.65",fill:x.cE7EAE9,stroke:x.c001174,strokeWidth:"0.7"}),e.jsx("rect",{x:"310.537",y:"186.553",width:"6.54333",height:"9.01667",rx:"0.65",fill:x.cE7EAE9,stroke:x.c001174,strokeWidth:"0.7"}),e.jsx("rect",{x:"321.312",y:"186.553",width:"6.54333",height:"9.01667",rx:"0.65",fill:x.cE7EAE9,stroke:x.c001174,strokeWidth:"0.7"}),e.jsx("rect",{x:"332.089",y:"186.553",width:"6.54333",height:"9.01667",rx:"0.65",fill:x.cE7EAE9,stroke:x.c001174,strokeWidth:"0.7"}),e.jsx("rect",{x:"342.864",y:"186.553",width:"6.54333",height:"9.01667",rx:"0.65",fill:x.cE7EAE9,stroke:x.c001174,strokeWidth:"0.7"}),e.jsx("circle",{cx:"270.258",cy:"214.468",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"270.258",cy:"217.118",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"281.561",cy:"214.468",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"281.561",cy:"217.118",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"273.085",cy:"214.468",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"273.085",cy:"217.118",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"284.388",cy:"214.468",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"284.388",cy:"217.118",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"275.91",cy:"214.468",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"275.91",cy:"217.118",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"287.214",cy:"214.468",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"287.214",cy:"217.118",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"278.737",cy:"214.468",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"278.737",cy:"217.118",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"290.04",cy:"214.468",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"290.04",cy:"217.118",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"344.462",cy:"214.468",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"344.462",cy:"217.118",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"355.765",cy:"214.468",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"355.765",cy:"217.118",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"347.29",cy:"214.468",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"347.29",cy:"217.118",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"358.592",cy:"214.468",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"358.592",cy:"217.118",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"350.114",cy:"214.468",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"350.114",cy:"217.118",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"361.418",cy:"214.468",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"361.418",cy:"217.118",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"352.941",cy:"214.468",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"352.941",cy:"217.118",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"364.244",cy:"214.468",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"364.244",cy:"217.118",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"344.462",cy:"235.668",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"344.462",cy:"238.318",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"355.765",cy:"235.668",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"355.765",cy:"238.318",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"347.29",cy:"235.668",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"347.29",cy:"238.318",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"358.592",cy:"235.668",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"358.592",cy:"238.318",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"350.114",cy:"235.668",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"350.114",cy:"238.318",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"361.418",cy:"235.668",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"361.418",cy:"238.318",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"352.941",cy:"235.668",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"352.941",cy:"238.318",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"364.244",cy:"235.668",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"364.244",cy:"238.318",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"359.918",cy:"226.393",r:"4.45833",stroke:x.c001174,strokeWidth:"0.8"}),e.jsx("circle",{cx:"359.918",cy:"226.393",r:"2.20833",fill:x.cE7EAE9}),e.jsx("rect",{x:"269.726",y:"221.885",width:"36.4",height:"9.01667",rx:"0.65",fill:x.cE7EAE9,stroke:x.c001174,strokeWidth:"0.7"}),e.jsx("rect",{x:"310.537",y:"221.885",width:"6.54333",height:"9.01667",rx:"0.65",fill:x.cE7EAE9,stroke:x.c001174,strokeWidth:"0.7"}),e.jsx("rect",{x:"321.312",y:"221.885",width:"6.54333",height:"9.01667",rx:"0.65",fill:x.cE7EAE9,stroke:x.c001174,strokeWidth:"0.7"}),e.jsx("rect",{x:"332.089",y:"221.885",width:"6.54333",height:"9.01667",rx:"0.65",fill:x.cE7EAE9,stroke:x.c001174,strokeWidth:"0.7"}),e.jsx("rect",{x:"342.864",y:"221.885",width:"6.54333",height:"9.01667",rx:"0.65",fill:x.cE7EAE9,stroke:x.c001174,strokeWidth:"0.7"}),e.jsx("circle",{cx:"270.258",cy:"250.685",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"270.258",cy:"253.335",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"281.561",cy:"250.685",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"281.561",cy:"253.335",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"273.085",cy:"250.685",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"273.085",cy:"253.335",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"284.388",cy:"250.685",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"284.388",cy:"253.335",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"275.91",cy:"250.685",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"275.91",cy:"253.335",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"287.214",cy:"250.685",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"287.214",cy:"253.335",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"278.737",cy:"250.685",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"278.737",cy:"253.335",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"290.04",cy:"250.685",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"290.04",cy:"253.335",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"344.462",cy:"250.685",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"344.462",cy:"253.335",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"355.765",cy:"250.685",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"355.765",cy:"253.335",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"347.29",cy:"250.685",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"347.29",cy:"253.335",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"358.592",cy:"250.685",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"358.592",cy:"253.335",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"350.114",cy:"250.685",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"350.114",cy:"253.335",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"361.418",cy:"250.685",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"361.418",cy:"253.335",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"352.941",cy:"250.685",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"352.941",cy:"253.335",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"364.244",cy:"250.685",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"364.244",cy:"253.335",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"344.462",cy:"271.885",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"344.462",cy:"274.535",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"355.765",cy:"271.885",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"355.765",cy:"274.535",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"347.29",cy:"271.885",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"347.29",cy:"274.535",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"358.592",cy:"271.885",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"358.592",cy:"274.535",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"350.114",cy:"271.885",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"350.114",cy:"274.535",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"361.418",cy:"271.885",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"361.418",cy:"274.535",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"352.941",cy:"271.885",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"352.941",cy:"274.535",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"364.244",cy:"271.885",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"364.244",cy:"274.535",r:"0.883333",fill:x.cD9D9D9}),e.jsx("circle",{cx:"359.918",cy:"262.61",r:"4.45833",stroke:x.c001174,strokeWidth:"0.8"}),e.jsx("circle",{cx:"359.918",cy:"262.61",r:"2.20833",fill:x.cE7EAE9}),e.jsx("rect",{x:"269.726",y:"258.102",width:"36.4",height:"9.01667",rx:"0.65",fill:x.cE7EAE9,stroke:x.c001174,strokeWidth:"0.7"}),e.jsx("rect",{x:"310.537",y:"258.102",width:"6.54333",height:"9.01667",rx:"0.65",fill:x.cE7EAE9,stroke:x.c001174,strokeWidth:"0.7"}),e.jsx("rect",{x:"321.312",y:"258.102",width:"6.54333",height:"9.01667",rx:"0.65",fill:x.cE7EAE9,stroke:x.c001174,strokeWidth:"0.7"}),e.jsx("rect",{x:"332.089",y:"258.102",width:"6.54333",height:"9.01667",rx:"0.65",fill:x.cE7EAE9,stroke:x.c001174,strokeWidth:"0.7"}),e.jsx("rect",{x:"342.864",y:"258.102",width:"6.54333",height:"9.01667",rx:"0.65",fill:x.cE7EAE9,stroke:x.c001174,strokeWidth:"0.7"}),e.jsx("rect",{x:"270.261",y:"200.336",width:"8.83333",height:"6.18333",fill:x.cFFFFFF}),e.jsx("rect",{x:"270.261",y:"235.668",width:"8.83333",height:"6.18333",fill:x.cFFFFFF}),e.jsx("rect",{x:"270.261",y:"271.885",width:"8.83333",height:"6.18333",fill:x.cFFFFFF}),e.jsx("rect",{x:"279.095",y:"200.336",width:"26.5",height:"6.18333",fill:x.cDEECF8}),e.jsx("rect",{x:"279.095",y:"235.668",width:"26.5",height:"6.18333",fill:x.cDEECF8}),e.jsx("rect",{x:"279.095",y:"271.885",width:"26.5",height:"6.18333",fill:x.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:x.c000D58,stroke:x.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:x.c000D58,stroke:x.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:x.cFFFFFF,stroke:x.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:x.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:x.cD6D6D6}),e.jsx("circle",{cx:"287.212",cy:"131.62",r:"0.9",fill:x.c28AC6E}),e.jsx("circle",{cx:"289.812",cy:"131.62",r:"0.9",fill:x.cC9184A}),e.jsx("circle",{cx:"292.412",cy:"131.62",r:"0.9",fill:x.cFFE18B}),e.jsx("rect",{x:"315.312",y:"133.72",width:"35",height:"35",fill:x.c90CAF9}),e.jsx("path",{d:"M319.312 153.22H341.312",stroke:x.cFFFFFF,strokeWidth:"1.3",strokeLinecap:"round"}),e.jsx("path",{d:"M288.312 150.72H310.312",stroke:x.c001174,strokeWidth:"1.3",strokeLinecap:"round"}),e.jsx("path",{d:"M319.312 156.22H336.312",stroke:x.cFFFFFF,strokeWidth:"1.3",strokeLinecap:"round"}),e.jsx("path",{d:"M288.312 153.72H305.312",stroke:x.c001174,strokeWidth:"1.3",strokeLinecap:"round"}),e.jsx("path",{d:"M319.312 159.22H336.312",stroke:x.cFFFFFF,strokeWidth:"1.3",strokeLinecap:"round"}),e.jsx("path",{d:"M288.312 156.72H305.312",stroke:x.c001174,strokeWidth:"1.3",strokeLinecap:"round"}),e.jsx("path",{d:"M337.312 139.72L328.312 148.72M328.313 139.72L337.313 148.72",stroke:x.cFFFFFF,strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]})})}function ys({onClick:t}){const r=ye.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(gs,{width:r?600:300}),e.jsx(w.Text,{fontWeight:"bold",fontSize:r?"3xl":"2xl",textAlign:"center",children:"Server Problem"}),e.jsx(w.Text,{fontWeight:"semibold",fontSize:r?"lg":"md",textAlign:"center",children:"we are trying to fix the problem"}),t&&e.jsx(A.Button,{size:r?"md":"xs",onClick:t,children:"Go Back"})]})}const ps=t=>{var n,i,o,s,c;const r=ye.useMediaQuery("md");return e.jsxs(Me.Dialog,{isShow:t.isShow,onHide:t.onHide,style:{...r?{minWidth:t.customMinWidth||"458px"}:{maxWidth:t.customMinWidth||"458px"}},children:[e.jsx(Me.DialogTitle,{...t.dialogTitleProps,children:typeof t.title=="string"?e.jsx(w.Text,{fontSize:"lg",fontWeight:"medium",children:t.title}):t.title}),e.jsx(Me.DialogBody,{children:typeof t.description=="string"?e.jsx(w.Text,{fontSize:"md",lineHeight:"leading-6",color:"brand",children:t.description}):t.description}),e.jsx(Me.DialogFooter,{children:e.jsx(f.Box,{display:"flex",direction:((n=t.containerConfirmBtnProps)==null?void 0:n.direction)||"row",justify:((i=t.containerConfirmBtnProps)==null?void 0:i.justify)||"flex-end",...t.containerConfirmBtnProps,children:e.jsxs(f.Box,{display:"flex",direction:((o=t.wrapperConfirmBtnProps)==null?void 0:o.direction)||"row",justify:((s=t.wrapperConfirmBtnProps)==null?void 0:s.justify)||"flex-end",gap:((c=t.wrapperConfirmBtnProps)==null?void 0:c.gap)||"sm",...t.wrapperConfirmBtnProps,children:[t.onCancel&&e.jsx(A.Button,{secondary:!0,onClick:t.onCancel,size:"md",fullWidth:!0,children:t.titleCancelBtn||"Cancel"}),e.jsx(f.Box,{direction:"column",fullWidth:!0,style:{textWrap:"nowrap"},children:e.jsx(A.Button,{...t.buttonConfirmProps,onClick:t.onConfirm,size:"md",fullWidth:!0,children:t.titleConfirmBtn||"Ok"})})]})})})]},t.key)},js=u.memo(({children:t,height:r,minHeight:n,customHeight:i,paddingInline:o="spacing-0",paddingBlock:s="spacing-0",header:c,footer:l,title:a,titleTag:d,action:h,actionContainer:m,containerProps:g,bodyProps:p,headerProps:M={borderBottom:!0},footerProps:y={borderTop:!0},variantTag:D="info"})=>{const B=u.useRef(null),[v,R]=u.useState("100vh");u.useEffect(()=>{const C=()=>{if(B.current){const I=B.current.getBoundingClientRect().top;R(`calc(100vh - ${I}px)`)}};return C(),window.addEventListener("resize",C),()=>window.removeEventListener("resize",C)},[]);const b=()=>d?e.jsxs(f.Box,{direction:"row",gap:"sm",align:"center",children:[e.jsx(w.Text,{fontWeight:"medium",children:a}),e.jsx(Ze.Badges,{border:!0,text:d,variant:D})]}):e.jsx(w.Text,{fontWeight:"medium",children:a}),O=()=>c||e.jsxs(f.Box,{direction:"row",justify:"space-between",align:"flex-start",gap:"md",children:[e.jsx(f.Box,{direction:"column",children:a?b():null}),e.jsx(f.Box,{direction:"column",...m,children:h??null})]}),T=!!(c||a||h);return e.jsxs(f.Box,{ref:B,height:r,customMinHeight:n,customHeight:i,paddingBlock:s,paddingInline:o,bg:"white",direction:"column",...g,style:{backgroundColor:"var(--sa-background-primary, #ffffff)",display:"flex",minHeight:v,...(g==null?void 0:g.style)??{}},children:[c!==null&&T?e.jsx(sr,{...M,children:O()}):null,e.jsx(f.Box,{direction:"column",padding:"spacing-0",...p,style:{flex:1,overflow:"auto",...(p==null?void 0:p.style)??{}},children:t}),l?e.jsx(lr,{...y,children:l}):null]})}),bs=u.memo(({value:t,options:r=[],onChange:n,multiple:i})=>{const o=(t==null?void 0:t.map(l=>l.value))||[],s=(r==null?void 0:r.filter(l=>o.includes(l.value)))||[],c=l=>{const a=[...s];let d=[];i?d=o.includes(l.value)?a.filter(h=>h.value!==l.value):[...a,l]:d=[l],n==null||n(d)};return e.jsx(f.Box,{direction:"row",gap:"sm",flexWrap:"wrap",children:r==null?void 0:r.map((l,a)=>e.jsx(A.Button,{...o.includes(l.value)?{primary:!0}:{secondary:!0},onClick:()=>c(l),children:l.label},a))})});function Mt(t){return null}Mt.displayName="LayoutDialog.Header";function Lt(t){return null}Lt.displayName="LayoutDialog.Body";function It(t){return null}It.displayName="LayoutDialog.Aside";function Tt(t){return null}Tt.displayName="LayoutDialog.Footer";const we={"lyd-root":"_lyd-root_1e92c_1","lyd-backdrop":"_lyd-backdrop_1e92c_28","lyd-panel":"_lyd-panel_1e92c_37","lyd-modal":"_lyd-modal_1e92c_48","lyd-fullscreen":"_lyd-fullscreen_1e92c_58","lyd-sidebar":"_lyd-sidebar_1e92c_66","lyd-header":"_lyd-header_1e92c_94","lyd-header-content":"_lyd-header-content_1e92c_105","lyd-header-actions":"_lyd-header-actions_1e92c_113","lyd-main":"_lyd-main_1e92c_120","lyd-body":"_lyd-body_1e92c_127","lyd-aside":"_lyd-aside_1e92c_133","lyd-footer":"_lyd-footer_1e92c_149","lyd-vm-group":"_lyd-vm-group_1e92c_162","lyd-vm-btn":"_lyd-vm-btn_1e92c_170","lyd-close-btn":"_lyd-close-btn_1e92c_193"},Cs=[{mode:"sidebar",label:"Sidebar",icon:e.jsx(ws,{})},{mode:"modal",label:"Modal",icon:e.jsx(k.Icon,{name:"Newscreen",size:"sm"})},{mode:"fullscreen",label:"Fullscreen",icon:e.jsx(k.Icon,{name:"Fullscreen",size:"sm"})}];function vs({value:t,onChange:r}){return e.jsx("div",{className:we["lyd-vm-group"],role:"group","aria-label":"View mode",children:Cs.map(n=>e.jsx("button",{type:"button",className:we["lyd-vm-btn"],"data-active":t===n.mode,"aria-label":`Switch to ${n.label} view`,"aria-pressed":t===n.mode,onClick:()=>r(n.mode),children:n.icon},n.mode))})}function ws(){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 Jt={md:"768px",lg:"1024px",xl:"1200px","2xl":"1440px"};function Ds(t){return t?t in Jt?Jt[t]:t:Jt.xl}function jt(t,r){let n=null;return u.Children.forEach(t,i=>{u.isValidElement(i)&&i.type===r&&(n=i.props.children??null)}),n}function Ss(t){const{isOpen:r,onClose:n,viewMode:i,defaultViewMode:o="modal",onViewModeChange:s,showViewModeToggle:c=!0,showCloseButton:l=!0,size:a,asideWidth:d,disableEscapeClose:h=!1,disableBackdropClose:m=!1,lockBodyScroll:g=!0,children:p}=t,[M,y]=u.useState(o),D=i??M,v=ye.useMediaQuery("md")?D:"fullscreen",R=u.useCallback(X=>{i===void 0&&y(X),s==null||s(X)},[i,s]),b=u.useRef(null);u.useEffect(()=>{if(!(!r||!g))return b.current=document.body.style.overflow,document.body.style.overflow="hidden",()=>{document.body.style.overflow=b.current??""}},[r,g]),u.useEffect(()=>{if(!r||h)return;const X=ee=>{ee.key==="Escape"&&n()};return window.addEventListener("keydown",X),()=>window.removeEventListener("keydown",X)},[r,h,n]);const O=u.useMemo(()=>jt(p,Mt),[p]),T=u.useMemo(()=>jt(p,Lt),[p]),C=u.useMemo(()=>jt(p,It),[p]),I=u.useMemo(()=>jt(p,Tt),[p]);if(!r)return null;const N=[we["lyd-panel"],v==="modal"&&we["lyd-modal"],v==="fullscreen"&&we["lyd-fullscreen"],v==="sidebar"&&we["lyd-sidebar"]].filter(Boolean).join(" "),G={"--lyd-max-w":Ds(a),...d!==void 0&&{"--lyd-aside-w":d}},q=()=>{m||n()};return e.jsxs("div",{className:we["lyd-root"],style:G,role:"dialog","aria-modal":"true",children:[e.jsx("div",{className:we["lyd-backdrop"],onClick:q,"aria-hidden":"true"}),e.jsxs("div",{className:N,children:[e.jsxs("div",{className:we["lyd-header"],children:[e.jsx("div",{className:we["lyd-header-content"],children:O}),e.jsxs("div",{className:we["lyd-header-actions"],children:[c&&e.jsx(vs,{value:D,onChange:R}),l&&e.jsx("button",{type:"button",className:we["lyd-close-btn"],onClick:n,"aria-label":"Close dialog",children:e.jsx(k.Icon,{name:"Cross",size:"md"})})]})]}),e.jsxs("div",{className:we["lyd-main"],children:[e.jsx("div",{className:we["lyd-body"],children:T}),C&&e.jsx("aside",{className:we["lyd-aside"],children:C})]}),I&&e.jsx("div",{className:we["lyd-footer"],children:I})]})]})}const ut=Ss;ut.Header=Mt;ut.Body=Lt;ut.Aside=It;ut.Footer=Tt;function ks({url:t,filename:r,onClose:n}){return u.useEffect(()=>{const i=o=>{o.key==="Escape"&&n()};return window.addEventListener("keydown",i),()=>window.removeEventListener("keydown",i)},[n]),e.jsxs("div",{onClick:n,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:i=>i.stopPropagation(),style:{position:"absolute",top:"16px",right:"16px",display:"flex",gap:"8px"},children:[e.jsx("a",{href:t,download:r,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:n,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:t,alt:r,onClick:i=>i.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:r})]})}const Bs=t=>{const{defaultTab:r=0,paramKey:n="tab"}=t||{},[i,o]=ge.useSearchParams(),s=rt.searchParamsToObject(i.toString());return{activeTab:s[n]?parseInt(s[n]):r,handleTabChange:a=>{o({...s,[n]:a.toString()})},searchQueries:s}};function Fs({appName:t,menuConfig:r,formatTitle:n}){const i=ge.useLocation();u.useEffect(()=>{let o=null,s=null;for(const a of r){const d=a.items.find(h=>h.to?h.to==="/"?i.pathname==="/":!!(h.to===i.pathname||i.pathname.startsWith(h.to+"/")):!1);if(d){o=d,s=a;break}}const c=[];o!=null&&o.title&&c.push(o.title),s!=null&&s.name&&c.push(s.name.toTitleCase());const l=(a,d)=>a.length>0?`${a.join(" - ")} | ${d}`:d;document.title=(n||l)(c,t)},[i.pathname])}const Es=()=>{const[t,r]=ge.useSearchParams(),n=rt.searchParamsToObject(t.toString()),i=ge.useParams(),o=ge.useLocation(),s=i.id;return{setSearchParams:r,searchParams:t,searchQueries:n,isHasQuery:(h,m)=>t.has(h)&&t.get(h)===m,getQueryParam:h=>t.get(h),getRouteParam:h=>i[h],params:i,location:o,id:s,hasId:!!s}};function Ms(t){var i,o;const r=t.decodedAccessToken;return u.useMemo(()=>{var a,d;const s=((d=(a=r==null?void 0:r.access)==null?void 0:a.role)==null?void 0:d.code)??"",c=Object.keys(t.role).reduce((h,m)=>{const g=`is${m.toLowerCase().replace(/(^\w|_\w)/g,p=>p.replace("_","").toUpperCase())}`;return{...h,[g]:!1}},{});return{...Object.keys(t.role).reduce((h,m)=>{const g=`is${m.toLowerCase().replace(/(^\w|_\w)/g,p=>p.replace("_","").toUpperCase())}`;return{...h,[g]:s===t.role[m]}},c),hasRole:h=>s===t.role[h],getRoleKey:()=>s}},[(o=(i=r==null?void 0:r.access)==null?void 0:i.role)==null?void 0:o.code,t])}exports.AdvanceFilterBar=un;exports.App=zn;exports.AppComponent=Ur;exports.AppContext=tr;exports.AppLayout=Nn;exports.AsideBar=ss;exports.BackButton=qn;exports.ColumnFilterDropdown=Cn;exports.ColumnMenu=wn;exports.ConfirmationDialog=ps;exports.DataTable=vn;exports.DecisionWrapper=ne;exports.EachUtils=Et;exports.EmptyStatePage=us;exports.FilterBar=Xo;exports.FilterDrawer=dn;exports.FloatingFooter=ls;exports.ForbiddenPage=ms;exports.Form=is;exports.FullSection=js;exports.HeaderLeftSlot=Vn;exports.HeaderLeftSlotOutlet=Xr;exports.HeaderLeftSlotProvider=Yr;exports.HorizontalField=Jn;exports.ImagePreview=ks;exports.InputFile=Sn;exports.InputImage=kn;exports.LayoutDialog=ut;exports.LayoutDialogAside=It;exports.LayoutDialogBody=Lt;exports.LayoutDialogFooter=Tt;exports.LayoutDialogHeader=Mt;exports.ModuleSwitcher=Zn;exports.ModuleSwitcherModal=tn;exports.NotFoundPage=hs;exports.PageLayout=Kn;exports.Pressable=kt;exports.RightDrawer=rn;exports.ScrollToTopButton=Bn;exports.Section=ro;exports.SectionFooter=lr;exports.SectionHeader=sr;exports.SelectButton=bs;exports.ServerErrorPage=ys;exports.SidebarBadgesProvider=Gr;exports.SidebarGroupSlot=Pn;exports.SidebarGroupSlotOutlet=$r;exports.SidebarGroupSlotProvider=Kr;exports.SidebarHeaderSlot=Jr;exports.TableFooter=bn;exports.TableHeader=jn;exports.TableLayout=gi;exports.TableSection=di;exports.TableWrapper=pn;exports.ToggleStatus=os;exports.Typography=Le;exports.VerticalField=cs;exports.clearModuleSelection=Hn;exports.createInitialFromUserName=vi;exports.cssVars=Fi;exports.expandDateCompact=oi;exports.formHasChanged=Oi;exports.formatDate=ki;exports.formatDateToIndonesian=Dn;exports.formatRupiah=Di;exports.getDateFilterValue=an;exports.getDateRangeFilterValue=jo;exports.getInitials=Si;exports.getValueDropdownMultipleFilter=cn;exports.getValueRadioFilter=po;exports.getValueSearch=Bt;exports.getValuesFilter=Ct;exports.handleChangeFilter=dt;exports.handleOnScroll=_i;exports.isEmail=Pi;exports.isFilterActive=bo;exports.isOnlyLettersAndSpaces=Ri;exports.isPhoneNumber=Wi;exports.isSlug=Hi;exports.localStorageAdapter=ar;exports.oneDayInMs=Ei;exports.parseIndonesianDateToDate=wi;exports.preventNonCoordinateInput=Ni;exports.preventNonNumberAndDecimalInput=Vi;exports.preventNonNumberInput=Ai;exports.preventNumberInput=zi;exports.resolveDateRangeValueToString=sn;exports.resolveDateValueToString=ln;exports.resolveDropdownValueToString=nn;exports.resolveRadioValueToString=on;exports.resolveSidebarBadge=bt;exports.storageKeys=it;exports.textWidth=Mi;exports.useApp=rr;exports.useAppState=qr;exports.useAuthRole=Ms;exports.useDynamicTitle=Fs;exports.useFilterBarApiParams=ti;exports.useFilterBarControls=ni;exports.useModuleSelection=ir;exports.useRouteInfo=ke;exports.useRouteParams=Es;exports.useSidebarBadges=Qr;exports.useTabState=Bs;exports.useTableSortApiParams=yi;Object.keys(hr).forEach(t=>{t!=="default"&&!Object.prototype.hasOwnProperty.call(exports,t)&&Object.defineProperty(exports,t,{enumerable:!0,get:()=>hr[t]})});Object.keys(Ze).forEach(t=>{t!=="default"&&!Object.prototype.hasOwnProperty.call(exports,t)&&Object.defineProperty(exports,t,{enumerable:!0,get:()=>Ze[t]})});Object.keys(f).forEach(t=>{t!=="default"&&!Object.prototype.hasOwnProperty.call(exports,t)&&Object.defineProperty(exports,t,{enumerable:!0,get:()=>f[t]})});Object.keys($e).forEach(t=>{t!=="default"&&!Object.prototype.hasOwnProperty.call(exports,t)&&Object.defineProperty(exports,t,{enumerable:!0,get:()=>$e[t]})});Object.keys(A).forEach(t=>{t!=="default"&&!Object.prototype.hasOwnProperty.call(exports,t)&&Object.defineProperty(exports,t,{enumerable:!0,get:()=>A[t]})});Object.keys(fr).forEach(t=>{t!=="default"&&!Object.prototype.hasOwnProperty.call(exports,t)&&Object.defineProperty(exports,t,{enumerable:!0,get:()=>fr[t]})});Object.keys(Ye).forEach(t=>{t!=="default"&&!Object.prototype.hasOwnProperty.call(exports,t)&&Object.defineProperty(exports,t,{enumerable:!0,get:()=>Ye[t]})});Object.keys(Me).forEach(t=>{t!=="default"&&!Object.prototype.hasOwnProperty.call(exports,t)&&Object.defineProperty(exports,t,{enumerable:!0,get:()=>Me[t]})});Object.keys(wt).forEach(t=>{t!=="default"&&!Object.prototype.hasOwnProperty.call(exports,t)&&Object.defineProperty(exports,t,{enumerable:!0,get:()=>wt[t]})});Object.keys(tt).forEach(t=>{t!=="default"&&!Object.prototype.hasOwnProperty.call(exports,t)&&Object.defineProperty(exports,t,{enumerable:!0,get:()=>tt[t]})});Object.keys(ye).forEach(t=>{t!=="default"&&!Object.prototype.hasOwnProperty.call(exports,t)&&Object.defineProperty(exports,t,{enumerable:!0,get:()=>ye[t]})});Object.keys(rt).forEach(t=>{t!=="default"&&!Object.prototype.hasOwnProperty.call(exports,t)&&Object.defineProperty(exports,t,{enumerable:!0,get:()=>rt[t]})});Object.keys(Ge).forEach(t=>{t!=="default"&&!Object.prototype.hasOwnProperty.call(exports,t)&&Object.defineProperty(exports,t,{enumerable:!0,get:()=>Ge[t]})});Object.keys(L).forEach(t=>{t!=="default"&&!Object.prototype.hasOwnProperty.call(exports,t)&&Object.defineProperty(exports,t,{enumerable:!0,get:()=>L[t]})});Object.keys(at).forEach(t=>{t!=="default"&&!Object.prototype.hasOwnProperty.call(exports,t)&&Object.defineProperty(exports,t,{enumerable:!0,get:()=>at[t]})});Object.keys(ct).forEach(t=>{t!=="default"&&!Object.prototype.hasOwnProperty.call(exports,t)&&Object.defineProperty(exports,t,{enumerable:!0,get:()=>ct[t]})});Object.keys(J).forEach(t=>{t!=="default"&&!Object.prototype.hasOwnProperty.call(exports,t)&&Object.defineProperty(exports,t,{enumerable:!0,get:()=>J[t]})});Object.keys(mr).forEach(t=>{t!=="default"&&!Object.prototype.hasOwnProperty.call(exports,t)&&Object.defineProperty(exports,t,{enumerable:!0,get:()=>mr[t]})});Object.keys(Yt).forEach(t=>{t!=="default"&&!Object.prototype.hasOwnProperty.call(exports,t)&&Object.defineProperty(exports,t,{enumerable:!0,get:()=>Yt[t]})});Object.keys(et).forEach(t=>{t!=="default"&&!Object.prototype.hasOwnProperty.call(exports,t)&&Object.defineProperty(exports,t,{enumerable:!0,get:()=>et[t]})});Object.keys(gr).forEach(t=>{t!=="default"&&!Object.prototype.hasOwnProperty.call(exports,t)&&Object.defineProperty(exports,t,{enumerable:!0,get:()=>gr[t]})});Object.keys(nt).forEach(t=>{t!=="default"&&!Object.prototype.hasOwnProperty.call(exports,t)&&Object.defineProperty(exports,t,{enumerable:!0,get:()=>nt[t]})});Object.keys(Ce).forEach(t=>{t!=="default"&&!Object.prototype.hasOwnProperty.call(exports,t)&&Object.defineProperty(exports,t,{enumerable:!0,get:()=>Ce[t]})});Object.keys(ot).forEach(t=>{t!=="default"&&!Object.prototype.hasOwnProperty.call(exports,t)&&Object.defineProperty(exports,t,{enumerable:!0,get:()=>ot[t]})});Object.keys(Xt).forEach(t=>{t!=="default"&&!Object.prototype.hasOwnProperty.call(exports,t)&&Object.defineProperty(exports,t,{enumerable:!0,get:()=>Xt[t]})});Object.keys(w).forEach(t=>{t!=="default"&&!Object.prototype.hasOwnProperty.call(exports,t)&&Object.defineProperty(exports,t,{enumerable:!0,get:()=>w[t]})});Object.keys(k).forEach(t=>{t!=="default"&&!Object.prototype.hasOwnProperty.call(exports,t)&&Object.defineProperty(exports,t,{enumerable:!0,get:()=>k[t]})});Object.keys(oe).forEach(t=>{t!=="default"&&!Object.prototype.hasOwnProperty.call(exports,t)&&Object.defineProperty(exports,t,{enumerable:!0,get:()=>oe[t]})});Object.keys(yr).forEach(t=>{t!=="default"&&!Object.prototype.hasOwnProperty.call(exports,t)&&Object.defineProperty(exports,t,{enumerable:!0,get:()=>yr[t]})});Object.keys(pr).forEach(t=>{t!=="default"&&!Object.prototype.hasOwnProperty.call(exports,t)&&Object.defineProperty(exports,t,{enumerable:!0,get:()=>pr[t]})});Object.keys(jr).forEach(t=>{t!=="default"&&!Object.prototype.hasOwnProperty.call(exports,t)&&Object.defineProperty(exports,t,{enumerable:!0,get:()=>jr[t]})});Object.keys(br).forEach(t=>{t!=="default"&&!Object.prototype.hasOwnProperty.call(exports,t)&&Object.defineProperty(exports,t,{enumerable:!0,get:()=>br[t]})});Object.keys(Cr).forEach(t=>{t!=="default"&&!Object.prototype.hasOwnProperty.call(exports,t)&&Object.defineProperty(exports,t,{enumerable:!0,get:()=>Cr[t]})});Object.keys(Je).forEach(t=>{t!=="default"&&!Object.prototype.hasOwnProperty.call(exports,t)&&Object.defineProperty(exports,t,{enumerable:!0,get:()=>Je[t]})});Object.keys(vr).forEach(t=>{t!=="default"&&!Object.prototype.hasOwnProperty.call(exports,t)&&Object.defineProperty(exports,t,{enumerable:!0,get:()=>vr[t]})});