@starasia/admin 8.19.2 → 8.20.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const wr=require("@starasia/alert"),Ue=require("@starasia/badges"),f=require("@starasia/box"),rt=require("@starasia/breadcrumb"),V=require("@starasia/button"),Dr=require("@starasia/card"),$e=require("@starasia/date"),Le=require("@starasia/dialog"),Mt=require("@starasia/drawer"),ot=require("@starasia/dropdown"),ge=require("@starasia/hooks"),st=require("@starasia/http"),Je=require("@starasia/input"),T=require("@starasia/menu"),ut=require("@starasia/pagination"),dt=require("@starasia/storage"),Y=require("@starasia/table"),Sr=require("@starasia/tabs"),rr=require("@starasia/textarea"),nt=require("@starasia/theme"),kr=require("@starasia/toast"),it=require("@starasia/toggle"),Ce=require("@starasia/tooltip"),lt=require("@starasia/checkbox"),nr=require("@starasia/radio"),w=require("@starasia/text"),B=require("@starasia/icon"),ne=require("@starasia/flex"),Br=require("@starasia/grid"),Fr=require("@starasia/progress"),Er=require("@starasia/stepper"),Mr=require("@starasia/accordion"),Lr=require("@starasia/story-record"),ze=require("@starasia/skeleton"),Ir=require("@starasia/progress-stepper"),e=require("react/jsx-runtime"),u=require("react"),ye=require("react-router"),ir=require("react-dom"),oo=require("react-easy-crop"),so={menus:[],menuBottom:void 0,logo:"",appName:"Workspace",userData:null,setUserData:()=>{}},lr=u.createContext(so),cr=()=>u.useContext(lr),nn=t=>{const[r,n]=u.useState((t==null?void 0:t.initialUserData)||null);return{userData:r,setUserData:n}},on=u.createContext({badges:{},setBadge:()=>{},setBadges:()=>{},clearBadge:()=>{}}),sn=({children:t})=>{const[r,n]=u.useState({}),s=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}})},[]),i=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:s,clearBadge:i}),[r,o,s,i]);return e.jsx(on.Provider,{value:c,children:t})},ln=()=>u.useContext(on),Bt=(t,r)=>{const n=r!==void 0?r:t;return n==null?null:typeof n=="string"||typeof n=="number"?{value:n}:n},cn=({router:t,menus:r=[],menuBottom:n,logo:s,appName:o="Workspace",initialUserData:i,theme:c})=>{const l=nn({initialUserData:i}),{theme:a}=nt.useTheme();return e.jsx(lr.Provider,{value:{logo:s,appName:o,menus:r,userData:l.userData,setUserData:l.setUserData,menuBottom:n},children:e.jsx(sn,{children:c?e.jsx(nt.ThemeProvider,{value:c,children:t}):a?e.jsx(nt.ThemeProvider,{value:a,children:t}):t})})},io=u.memo(cn);function an({collapsed:t=!1,children:r}){if(!r)return null;const n=typeof r=="function",s=n?r({collapsed:t}):r;return s==null||s===!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?s:e.jsx("div",{style:{opacity:t?0:1,transition:"opacity 0.3s",visibility:t?"hidden":"visible"},children:s})})}const ar=u.createContext(null);function dn({children:t}){const[r,n]=u.useState(null),[s,o]=u.useState(null),[i,c]=u.useState(null),[l,a]=u.useState(0),d=u.useCallback(()=>(a(h=>h+1),()=>a(h=>h-1)),[]);return e.jsx(ar.Provider,{value:{prependNode:r,appendNode:s,replaceNode:i,setPrependNode:n,setAppendNode:o,setReplaceNode:c,replaceCount:l,registerReplace:d},children:t})}function un({children:t}){const r=u.useContext(ar);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 lo({children:t,mode:r="append"}){const n=u.useContext(ar);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 s=r==="prepend"?n.prependNode:r==="replace"?n.replaceNode:n.appendNode;return s?ir.createPortal(t,s):null}const dr=u.createContext(null);function xn({children:t}){const[r,n]=u.useState({}),[s,o]=u.useState({}),i=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:i,slotCounts:s,registerSlot:c}),[r,i,s,c]);return e.jsx(dr.Provider,{value:l,children:t})}function hn({slotKey:t,fallback:r}){const n=u.useContext(dr),s=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 i=u.useCallback(c=>{var l;return(l=o.current)==null?void 0:l.call(o,t,c)},[t]);return e.jsx(e.Fragment,{children:s?e.jsx("div",{ref:i,style:{display:"contents"}}):r})}function co({slotKey:t,children:r}){const n=u.useContext(dr),s=u.useRef(n==null?void 0:n.registerSlot);if(s.current=n==null?void 0:n.registerSlot,u.useEffect(()=>{var i;return(i=s.current)==null?void 0:i.call(s,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?ir.createPortal(r,o):null}const Lt="moduleSwitcherGroupId",or="sa-module-switcher-change";function Tr(){if(typeof window>"u")return null;const t=window.localStorage.getItem(Lt);if(t===null)return null;const r=Number(t);return Number.isFinite(r)?r:null}function fn(t){typeof window>"u"||(t===null?window.localStorage.removeItem(Lt):window.localStorage.setItem(Lt,String(t)),window.dispatchEvent(new CustomEvent(or,{detail:t})))}function ao(){fn(null)}function ur(){const[t,r]=u.useState(()=>Tr());return u.useEffect(()=>{const s=()=>{r(Tr())},o=i=>{i.key===Lt&&s()};return window.addEventListener(or,s),window.addEventListener("storage",o),()=>{window.removeEventListener(or,s),window.removeEventListener("storage",o)}},[]),{selectedGroupId:t,setSelectedGroupId:s=>{fn(s),r(s)}}}let jt=0,Ke=!1,Or=new Set;const Wr=()=>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"})]}),Rr={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 uo({children:t,headerLeftSlot:r,profile:n,isLoadingProfile:s,onLogout:o,isLoggingOut:i,loadingComponent:c,sidebarHeaderContent:l,headerActions:a,profileRole:d,profileMenuButtons:h,profileMenuItems:g,logoutButton:m}){var Re,et;const[j]=ye.useSearchParams(),E=j.get("embed")==="true",y=cr(),{badges:M}=ln(),k=ye.useNavigate(),L=ye.useLocation(),b=!ge.useMediaQuery("md"),[A,W]=u.useState(!1),[v,F]=u.useState(!1),[z,R]=u.useState(!1),[_,J]=u.useState(!1),[te,xe]=u.useState(()=>new Set(Or)),[he,se]=u.useState(null),{selectedGroupId:Z,setSelectedGroupId:Q}=ur();u.useEffect(()=>{Or=te},[te]);const ae=u.useRef(null),ie=u.useRef(null);u.useEffect(()=>{const S=ae.current;if(!S)return;const N=()=>{Ke||(jt=S.scrollTop)};return S.addEventListener("scroll",N),()=>S.removeEventListener("scroll",N)},[]);const ue=()=>{const S=ae.current;S&&jt>0&&(Ke=!0,S.scrollTop=jt,requestAnimationFrame(()=>{Ke=!1}))};u.useLayoutEffect(()=>{Ke=!0,ue();const S=setTimeout(()=>{Ke=!1},300);return()=>clearTimeout(S)},[]),u.useLayoutEffect(()=>{y.menus.length>0&&(jt>0?ue():requestAnimationFrame(()=>{var N;const S=(N=ae.current)==null?void 0:N.querySelector("[data-menu-active='true']");S&&S.scrollIntoView({block:"center",behavior:"instant"})}))},[y.menus]),u.useEffect(()=>{Ke=!0,ue();const S=setTimeout(ue,0),N=setTimeout(ue,50),U=setTimeout(ue,100),I=setTimeout(ue,200),G=setTimeout(()=>{Ke=!1},300),H=setTimeout(()=>{const q=ae.current,P=q==null?void 0:q.querySelector("[data-menu-active='true']");if(q&&P){const pe=q.getBoundingClientRect(),De=P.getBoundingClientRect();De.top>=pe.top&&De.bottom<=pe.bottom||P.scrollIntoView({block:"center",behavior:"smooth"})}},250);return()=>{clearTimeout(S),clearTimeout(N),clearTimeout(U),clearTimeout(I),clearTimeout(G),clearTimeout(H)}},[L.pathname]),u.useEffect(()=>{ie.current&&(ie.current.scrollTop=0)},[L.pathname]),u.useEffect(()=>{b&&R(!1)},[L.pathname,b]),u.useEffect(()=>{b&&F(!0)},[b]);const me=()=>{W(!0)},Te=()=>{W(!1)},Oe=()=>{W(!1),o()},Fe=S=>{const N=[S.to];return S.children&&N.push(...S.children.map(U=>U.to)),N},de=[...y.menus.flatMap(S=>S.items.flatMap(Fe)),...((Re=y.menuBottom)==null?void 0:Re.flatMap(Fe))??[]],fe=S=>{if(!L.pathname.startsWith(S))return!1;const N=de.filter(U=>L.pathname.startsWith(U)).sort((U,I)=>I.length-U.length)[0];return S===N};u.useEffect(()=>{var N;const S=U=>{var I;(I=U.children)!=null&&I.some(G=>L.pathname.startsWith(G.to))&&xe(G=>{const H=new Set(G);return H.add(U.id),H})};y.menus.forEach(U=>{U.items.forEach(S)}),(N=y.menuBottom)==null||N.forEach(S)},[L.pathname,y.menus,y.menuBottom]);const We=S=>{xe(N=>{const U=new Set(N);return U.has(S)?U.delete(S):U.add(S),U})};u.useEffect(()=>{y.menus.length!==0&&Z!==null&&!y.menus.some(S=>S.id===Z)&&Q(null)},[y.menus,Z,Q]);const Ve=u.useMemo(()=>{if(Z!==null)return y.menus.filter(U=>U.id===Z||U.parentGroupId===Z);const S=y.menus.filter(U=>U.parentGroupId===void 0),N=y.menus.filter(U=>U.parentGroupId!==void 0).flatMap(U=>U.items);return N.length===0?S:[...S,{id:18,name:"Pengaturan",items:N,parentGroupId:void 0}]},[y.menus,Z]);if(E)return e.jsx("main",{style:{height:"100vh",overflowY:"auto",backgroundColor:"var(--sa-background-primary-inverse, #f8f8f8)"},children:t||e.jsx(ye.Outlet,{})});const Ee=S=>{const N=S.children&&S.children.length>0,U=te.has(S.id),I=N?S.children.some(q=>fe(q.to)):fe(S.to),G=Bt(S.badge,M[S.id]),H=!!G&&v&&!b;return e.jsxs("div",{"data-menu-active":I||void 0,children:[e.jsxs("button",{onClick:q=>{if(N)if(v&&!b){const P=q.currentTarget.getBoundingClientRect();se({item:S,top:P.top,left:P.right+8})}else We(S.id);else k(S.to)},style:{width:"100%",display:"flex",alignItems:"center",justifyContent:v&&!b?"center":void 0,gap:"0.5rem",paddingLeft:v&&!b?"0":"0.5rem",paddingRight:v&&!b?"0":"0.5rem",paddingTop:"0.25rem",paddingBottom:"0.25rem",height:"2rem",borderRadius:I?"var(--sa-radii-sm, 0.375rem)":"var(--sa-radii-md, 0.5rem)",textAlign:"left",border:I?"1px solid var(--sa-border-subtle, #0b120e24)":"1px solid transparent",backgroundColor:I?"var(--sa-background-primary, #ffffff)":"transparent",color:"var(--sa-text-primary, #292a2e)",cursor:"pointer"},title:v&&!b?S.title:void 0,onMouseEnter:q=>{I||(q.currentTarget.style.backgroundColor="var(--sa-background-neutral, #f0f1f2)")},onMouseLeave:q=>{I||(q.currentTarget.style.backgroundColor="transparent")},children:[e.jsxs("span",{style:{position:"relative",display:"inline-flex",flexShrink:0},children:[e.jsx(B.Icon,{name:S.icon,size:"sm",style:{flexShrink:0}}),H&&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)"}})]}),(!v||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}),G&&e.jsx(Ue.Badges,{text:String(G.value),variant:G.variant??"info",size:"xs",border:!0}),N&&e.jsx("svg",{style:{width:"1rem",height:"1rem",flexShrink:0,transition:"transform 0.2s",transform:U?"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"})})]})]}),N&&(!v||b)&&(()=>{const q=S.children.findIndex(P=>fe(P.to));return e.jsxs("div",{style:{position:"relative",marginLeft:"0.9375rem",paddingLeft:"1.125rem",overflow:"hidden",transition:"all 0.3s ease-in-out",maxHeight:U?`${S.children.length*36}px`:"0px",opacity:U?1:0,marginTop:U?"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"}}),q>=0&&e.jsx("span",{"aria-hidden":"true",style:{position:"absolute",left:0,top:`${q*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(P=>{const pe=Bt(P.badge,M[P.id]);return e.jsxs("button",{onClick:()=>k(P.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:fe(P.to)?"var(--sa-radii-sm, 0.375rem)":"var(--sa-radii-md, 0.5rem)",textAlign:"left",backgroundColor:fe(P.to)?"var(--sa-background-primary, #ffffff)":"transparent",color:fe(P.to)?"var(--sa-text-primary, #292a2e)":"var(--sa-text-subtle, #505258)",cursor:"pointer",border:fe(P.to)?"1px solid var(--sa-border-subtle, #0b120e24)":"1px solid transparent"},onMouseEnter:De=>{fe(P.to)||(De.currentTarget.style.backgroundColor="var(--sa-background-neutral, #f0f1f2)")},onMouseLeave:De=>{fe(P.to)||(De.currentTarget.style.backgroundColor="transparent")},children:[e.jsx(B.Icon,{name:P.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:P.title}),pe&&e.jsx(Ue.Badges,{text:String(pe.value),variant:pe.variant??"info",size:"xs",border:!0})]},P.id)})]})})()]},S.id)};return e.jsx(xn,{children:e.jsxs(dn,{children:[e.jsxs("div",{style:{display:"flex",height:"100vh",position:"relative","--app-sidebar-width":b?"0px":v?"4.375rem":"16.375rem","--app-footer-zindex":b&&z?"40":"999"},children:[b&&e.jsx("div",{style:{position:"fixed",inset:0,backgroundColor:"var(--sa-color-black-alpha-a50, #181a198f)",zIndex:40,opacity:z?.5:0,pointerEvents:z?"auto":"none",transition:"opacity 0.3s"},onClick:()=>R(!1)}),e.jsxs("aside",{style:{width:b?"16.375rem":v?"4.375rem":"16.375rem",position:b?"fixed":"relative",...b&&{inset:0,zIndex:50,transform:z?"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:()=>J(!0),onMouseLeave:()=>J(!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&&v&&!z,N=S&&_;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:N?0:1,pointerEvents:N?"none":"auto"},children:[e.jsx("img",{src:y.logo,alt:"Logo",style:{width:"2rem",height:"2rem",flexShrink:0}}),(!v||z)&&e.jsx("span",{style:{fontWeight:"600",color:"var(--sa-text-primary, #292a2e)",whiteSpace:"nowrap",transition:"opacity 0.3s"},children:y.appName})]}),!b&&!v&&e.jsx("button",{type:"button",onClick:()=>F(!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(Wr,{})}),S&&e.jsx("button",{type:"button",onClick:()=>F(!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:N?1:0,pointerEvents:N?"auto":"none",transition:"opacity 0.2s"},children:e.jsx("span",{style:{width:"1rem",height:"1rem",display:"inline-flex"},children:e.jsx(Wr,{})})}),b&&e.jsx("button",{onClick:()=>R(!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(an,{collapsed:b?!1:v,children:l}),e.jsx("div",{ref:ae,style:{flex:1,overflowY:"auto",paddingTop:"1rem",paddingBottom:"1rem"},children:Ve.map(S=>e.jsxs("div",{style:{marginBottom:"1rem"},children:[!v||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(hn,{slotKey:S.slotKey,fallback:S.items.map(N=>Ee(N))}):S.items.map(N=>Ee(N))})]},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=>Ee(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:b?"1rem":void 0},children:[b&&e.jsx("button",{onClick:()=>R(!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(un,{children:r})]}),e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"0.75rem"},children:[a,e.jsxs(T.Menu,{position:"bottom-right",children:[e.jsx(T.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:s?"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:s?"":(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(B.Icon,{name:"ChevronDown",size:"sm",style:{color:"var(--sa-text-subtle, #8c8f97)"}})]})}),e.jsxs(T.MenuLists,{style:{width:"280px",paddingBlock:"12px",paddingInline:"12px",gap:"8px",marginTop:"16px"},children:[e.jsx(T.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||g)&&e.jsxs(T.MenuBody,{children:[h==null?void 0:h.map((S,N)=>e.jsx(T.MenuButton,{children:e.jsxs("button",{type:"button",onClick:S.onClick,style:Rr,onMouseEnter:U=>{U.currentTarget.style.backgroundColor="var(--sa-background-neutral, #f0f1f2)"},onMouseLeave:U=>{U.currentTarget.style.backgroundColor="transparent"},children:[e.jsx(B.Icon,{name:S.icon,size:"md"}),e.jsx("span",{children:S.label})]})},`${S.label}-${N}`)),g]}),m??e.jsx(T.MenuFooter,{children:e.jsx(T.MenuButton,{children:e.jsxs("button",{type:"button",onClick:me,style:{...Rr,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(B.Icon,{name:"Logout",size:"md",style:{color:"var(--sa-background-error, #c9184a)"}}),e.jsx("span",{children:"Logout"})]})})})]})]})]})]}),e.jsx("main",{ref:ie,style:{flex:1,overflowY:"auto"},children:t||e.jsx(ye.Outlet,{})})]})]}),i&&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(Le.Dialog,{isShow:A,onHide:Te,children:[e.jsx(Le.DialogTitle,{children:"Confirmation Logout"}),e.jsx(Le.DialogBody,{children:"Are you sure you want to end the session and exit the page?"}),e.jsx(Le.DialogFooter,{children:e.jsx(f.Box,{direction:"column",display:"flex",align:"flex-end",justify:"center",children:e.jsxs(ne.Flex,{direction:"row",gap:"sm",align:"center",children:[e.jsx(f.Box,{direction:"column",children:e.jsx(V.Button,{secondary:!0,onClick:Te,children:"Cancel"})}),e.jsx(f.Box,{direction:"column",children:e.jsx(V.Button,{primary:!0,onClick:Oe,children:"Yes, Sure"})})]})})})]}),he&&e.jsxs(e.Fragment,{children:[e.jsx("div",{onClick:()=>se(null),style:{position:"fixed",inset:0,zIndex:60,backgroundColor:"transparent"}}),e.jsxs("div",{role:"dialog","aria-label":he.item.title,style:{position:"fixed",top:he.top,left:he.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:he.item.title}),(et=he.item.children)==null?void 0:et.map(S=>{const N=fe(S.to),U=Bt(S.badge,M[S.id]);return e.jsxs("button",{onClick:()=>{k(S.to),se(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:N?"var(--sa-color-gray-100, #f8f8f8)":"transparent",color:N?"var(--sa-text-primary, #292a2e)":"var(--sa-color-gray-800, #505258)",border:"1px solid transparent",cursor:"pointer",fontSize:"0.875rem",fontWeight:500},onMouseEnter:I=>{N||(I.currentTarget.style.backgroundColor="var(--sa-color-gray-100, #f8f8f8)")},onMouseLeave:I=>{N||(I.currentTarget.style.backgroundColor="transparent")},children:[S.icon&&e.jsx(B.Icon,{name:S.icon,size:"sm",style:{flexShrink:0}}),e.jsx("span",{style:{flex:1,whiteSpace:"nowrap"},children:S.title}),U&&e.jsx(Ue.Badges,{text:String(U.value),variant:U.variant??"info",size:"xs",border:!0})]},S.id)})]})]})]})})}const ht=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})),Ar=({title:t,iconName:r,textColor:n,iconColor:s,hoverTextColor:o,hoverIconColor:i})=>{const[c,l]=u.useState(!1),a=s??"var(--sa-text-subtle, #8c8f97)",d=n??"var(--sa-text-subtle, #8c8f97)",h=i??"var(--sa-text-subtle, #8c8f97)",g=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(B.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?g:d,transition:"color 0.15s ease"},children:t||"Back"})]})},xo=({items:t,separator:r="/",iconName:n,iconColor:s,hoverIconColor:o})=>{const[i,c]=u.useState(!1),l=s??"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),g=e.jsx(B.Icon,{name:n||"ChevronLeft",size:"xs",onMouseEnter:h?()=>c(!0):void 0,onMouseLeave:h?()=>c(!1):void 0,style:{color:h&&i?a:l,transition:"color 0.15s ease",cursor:h?"pointer":void 0}}),m=d!=null&&d.to?e.jsx(ye.Link,{to:d.to,replace:!0,style:{textDecoration:"none"},children:g}):d!=null&&d.onClick?e.jsx(ht,{onClick:d.onClick,children:g}):g;return e.jsxs(f.Box,{direction:"row",gap:"xs",align:"center",children:[m,e.jsx(rt.Breadcrumb,{separator:r,size:"md",children:t.map((j,E)=>{const y=E===t.length-1;return j.to&&!y?e.jsx(rt.BreadcrumbItem,{children:e.jsx(ye.Link,{to:j.to,children:j.label})},E):e.jsx(rt.BreadcrumbItem,{currentPage:y,children:e.jsx(rt.BreadcrumbLink,{onClick:y?void 0:j.onClick,children:j.label})},E)})})]})},ho=t=>{const{items:r,separator:n,onClick:s,navigateTo:o,...i}=t;return r&&r.length>0?e.jsx(xo,{items:r,separator:n,iconName:i.iconName,iconColor:i.iconColor,hoverIconColor:i.hoverIconColor}):o?e.jsx(f.Box,{direction:"row",children:e.jsx(ye.Link,{to:o,replace:!0,style:{textDecoration:"none"},children:e.jsx(Ar,{...i})})}):e.jsx(f.Box,{direction:"row",children:e.jsx(ht,{onClick:s,children:e.jsx(Ar,{...i})})})},Qt=[{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 zr(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 Vr={fontSize:"11px",fontWeight:500,textAlign:"center",overflowWrap:"normal",wordBreak:"normal",color:"var(--sa-background-primary, #ffffff)",lineHeight:"1.3",maxWidth:"80px"},Hr={display:"flex",flexDirection:"column",alignItems:"center",gap:"8px",background:"none",border:"none",cursor:"pointer",padding:0};function mn({isShow:t,onHide:r,menus:n,selectedGroupId:s,onSelect:o}){const[i,c]=u.useState(void 0),l=d=>{o(d),r()},a=Qt[0];return e.jsx(Le.Dialog,{isShow:t,onHide:r,style:{width:560,background:"transparent",boxShadow:"none",border:"none"},children:e.jsx(Le.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:Hr,children:[e.jsx("div",{style:zr(s===null,i==="all",a),children:e.jsx("div",{style:{color:a.icon,display:"flex",alignItems:"center",justifyContent:"center"},children:e.jsx(B.Icon,{name:"Grid",size:"lg",style:{width:32,height:32}})})}),e.jsx("span",{style:Vr,children:"Semua"})]}),n.map((d,h)=>{var y;const g=s===d.id,m=i===d.id,j=((y=d.items[0])==null?void 0:y.icon)??"Grid",E=Qt[(h+1)%Qt.length];return e.jsxs("button",{onClick:()=>l(d.id),onMouseEnter:()=>c(d.id),onMouseLeave:()=>c(void 0),style:Hr,children:[e.jsx("div",{style:zr(g,m,E),children:e.jsx("div",{style:{color:E.icon,display:"flex",alignItems:"center",justifyContent:"center"},children:e.jsx(B.Icon,{name:j,size:"lg",style:{width:32,height:32}})})}),e.jsx("span",{style:Vr,children:d.name})]},d.id)})]})})})}function fo({onSelect:t,"aria-label":r="Pilih module"}={}){const n=cr(),s=ye.useNavigate(),{selectedGroupId:o,setSelectedGroupId:i}=ur(),[c,l]=u.useState(!1),a=d=>{var h;if(i(d),d!==null){const g=n.menus.find(j=>j.id===d),m=(h=g==null?void 0:g.items[0])==null?void 0:h.to;m&&s(m)}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(B.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(mn,{isShow:c,onHide:()=>l(!1),menus:n.menus.filter(d=>d.parentGroupId===void 0),selectedGroupId:o,onSelect:a})]})}const mo=(t,r)=>{const n=[];if(r===0)return n.push(t),n;for(let s=0;s<t.length;s+=r){const o=t.slice(s,s+r);n.push(o)}return n},go=u.memo(({value:t,label:r,separator:n,labelWidth:s,lastIndex:o,labelAlign:i="top"})=>{const c=u.useMemo(()=>({padding:0,paddingBottom:o?0:12,verticalAlign:i}),[o,i]),l=u.useMemo(()=>({padding:0,paddingRight:12,paddingLeft:12,paddingBottom:o?0:12,verticalAlign:i}),[o,i]),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(Y.Tr,{children:[e.jsx(Y.Td,{style:c,width:s,children:a()}),n?e.jsx(Y.Td,{style:l,width:24,children:h()}):null,e.jsx(Y.Td,{style:c,children:d()})]})}),yo=u.memo(({fields:t,separator:r,labelWidth:n})=>e.jsx(Y.Table,{withColumnBorder:!1,withRowBorder:!1,children:t.map((s,o)=>e.jsx(go,{separator:r,labelWidth:n,lastIndex:o===t.length-1,...s},`field-group-field-${o}`))})),po=u.memo(({maxRow:t=0,maxColumn:r=2,separator:n=":",fields:s=[],labelWidth:o=150,bordered:i=!1})=>{const c=u.useMemo(()=>mo(s,t),[s,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:i?"border":void 0,borderStyle:i?"border-solid":void 0,borderColor:i?"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(yo,{labelWidth:o,fields:d,separator:n})},h))})}),jo=({backButton:t})=>{const[r,n]=u.useState(!1),s=(t==null?void 0:t.iconColor)??"var(--sa-text-subtle, #8c8f97)",o=(t==null?void 0:t.textColor)??"var(--sa-text-subtle, #8c8f97)",i=(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(B.Icon,{name:(t==null?void 0:t.iconName)||"ChevronLeft",size:"xs",style:{color:r?i:s,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"})]})},bo=({backButton:t,title:r,titleIcon:n,titleTag:s,children:o,header:i=!0,headerBorder:c=!1,subHeaders:l,action:a,titleTagProps:d,containerProps:h,headerProps:g})=>{const m=ge.useMediaQuery("md"),j=ye.useNavigate(),E=ye.useLocation(),y=t==null?void 0:t.show,M=()=>{if(typeof(t==null?void 0:t.onClick)=="function"){t.onClick();return}j(-1,{replace:!0})},k=()=>{if(!a)return null;if(u.isValidElement(a))return a;const v=a.filter(F=>F&&(F.title||F.icon));return v.length===0?null:m?e.jsx(f.Box,{direction:"row",gap:"md",children:v.map(({title:F,icon:z,buttonProps:R,onClick:_},J)=>e.jsx(V.Button,{iconLeft:z?e.jsx(B.Icon,{name:z,size:"md"}):void 0,onClick:_,...R,children:F},`action-${J}`))}):e.jsxs(T.Menu,{position:"bottom-right",children:[e.jsx(T.MenuButton,{children:e.jsx(V.Button,{variant:"tertiary",size:"sm",iconLeft:e.jsx(B.Icon,{name:"MenuBurger"}),"aria-label":"Actions"})}),e.jsx(T.MenuLists,{children:e.jsx(T.MenuBody,{style:{minWidth:200},children:v.map(({title:F,icon:z,buttonProps:R,onClick:_},J)=>{const te=(R==null?void 0:R.tone)==="error"||(R==null?void 0:R.danger)===!0;return e.jsx(T.MenuItem,{intent:te?"danger":void 0,disabled:R==null?void 0:R.disabled,startIcon:z?e.jsx(B.Icon,{name:z}):void 0,onClick:_,children:F},`action-${J}`)})})})]})},L=()=>{const v=e.jsx(jo,{backButton:t});return t!=null&&t.navigateTo?e.jsx(f.Box,{direction:"row",children:e.jsx(ye.Link,{to:t.navigateTo,replace:!0,style:{textDecoration:"none"},children:v})}):e.jsx(f.Box,{direction:"row",children:e.jsx(ht,{onClick:M,children:v})})},C=()=>{const v=!!r,F=Array.isArray(a)&&a.length>0,z=u.isValidElement(a)?!0:F;if(!v&&!z&&!y)return null;const _=m||!m&&F;return e.jsxs(f.Box,{direction:"column",gap:"xs",paddingBlock:(g==null?void 0:g.paddingBlock)??"sm",paddingInline:(g==null?void 0:g.paddingInline)??"md",...g,style:{...c?{boxShadow:"inset 0 -1px 0 0 var(--sa-border-subtle, #0b120e24)"}:{},...g==null?void 0:g.style},children:[y&&L(),(v||z)&&e.jsxs(f.Box,{direction:_?"row":"column",gap:"sm",justify:"space-between",align:_?"center":"flex-start",children:[v?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(B.Icon,{name:n,size:"md",color:"primary"}),e.jsx(w.Text,{variant:"h3",fontWeight:"semibold",fontFamily:"Poppins",children:r})]}),s&&e.jsx(Ue.Badge,{border:!0,size:"lg",text:s,...d})]}):r:null,k()]})]})},b=()=>{if(!l||l.length===0)return null;const v=l.filter(R=>R.show!==!1);if(v.length===0)return null;let F=0,z=-1/0;return v.forEach((R,_)=>{const J=R.order??0;J>=z&&(z=J,F=_)}),v.map(({content:R,order:_,borderBottom:J=!0,keepBottomPadding:te=!1},xe)=>e.jsx(f.Box,{direction:"column",paddingTop:"sm",paddingBottom:J||te||xe===F?"sm":"spacing-0",paddingInline:"md",style:{...J?{boxShadow:"inset 0 -1px 0 0 var(--sa-border-subtle, #0b120e24)"}:{},..._!==void 0?{order:_}:{}},children:R},`sub-header-${xe}`))},A=()=>{const v=i?C():null,F=b();return!v&&!F?null:e.jsxs(f.Box,{direction:"column",style:{marginBottom:F?"var(--sa-spacing-0)":"var(--sa-spacing-md)"},children:[v,F]})},W=()=>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:[A(),W()]},E.pathname)},vo=u.memo(bo),Co={icon:"Cross",title:""},wo="calc(100vw - 16px)",Pr=t=>t==null?void 0:`min(${typeof t=="number"?`${t}px`:t}, ${wo})`,gn=u.forwardRef(({onHide:t,show:r,withBlur:n=!1,style:s,children:o,closeButton:i=Co,width:c,minWidth:l="357px",maxWidth:a="357px"},d)=>{const h=Pr(c??l),g=Pr(c??a);return e.jsx(Mt.Drawer,{blur:n,isShow:r,position:"right",onHide:t,ref:d,style:{minWidth:h,maxWidth:g,...s},children:e.jsxs(f.Box,{direction:"column",padding:"lg",children:[i?e.jsxs(f.Box,{direction:"row",align:"center",gap:"sm",onClick:t,marginBottom:"lg",cursor:"pointer",children:[e.jsx(B.Icon,{name:i.icon,size:"md",color:"subtle",cursor:"pointer"}),i.title?e.jsx(w.Text,{fontFamily:"Poppins",fontSize:"md",color:"subtlest",children:i.title}):null]}):null,o]})})}),xr=u.memo(({children:t,borderBottom:r=!0,padding:n=!0})=>{const s=ge.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})}),hr=u.memo(({children:t,borderTop:r=!0,padding:n=!0})=>{const s=ge.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})}),Do=u.memo(({children:t,...r})=>e.jsx(f.Box,{direction:"column",padding:"md",paddingLeft:"md",paddingRight:"md",gap:"md",...r,children:t})),So=u.memo(({children:t,title:r,titleTag:n,action:s,header:o,footer:i,actionContainer:c,containerProps:l,bodyProps:a,headerProps:d={borderBottom:!0},footerProps:h={borderTop:!0},variantTag:g="info"})=>{const m=ge.useMediaQuery("lg"),j=()=>n?e.jsxs(f.Box,{direction:"row",gap:"sm",align:"center",children:[e.jsx(w.Text,{fontWeight:"medium",children:r}),e.jsx(Ue.Badges,{border:!0,text:n,variant:g})]}):e.jsx(w.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?j():null}),e.jsx(f.Box,{direction:"column",style:m?{width:"100%",maxWidth:"19.313rem"}:{flex:1},...c,children:s??null})]}),y=!!(o||r||s);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(xr,{...d,children:E()}):null,e.jsx(Do,{...a,children:t}),i?e.jsx(hr,{...h,children:i}):null]})}),ko=t=>e.jsx(w.Text,{variant:"h1",children:t.children,...t.props}),Bo=t=>e.jsx(w.Text,{variant:"h2",children:t.children,...t.props}),Fo=t=>e.jsx(w.Text,{variant:"h3",children:t.children,...t.props}),Eo=t=>e.jsx(w.Text,{variant:"h4",children:t.children,...t.props}),Mo=t=>e.jsx(w.Text,{variant:"h5",children:t.children,...t.props}),Lo=t=>e.jsx(w.Text,{variant:"h6",children:t.children,...t.props}),Io=t=>e.jsx(w.Text,{variant:"sub-h1",children:t.children,...t.props}),To=t=>e.jsx(w.Text,{variant:"sub-h2",children:t.children,...t.props}),Oo=t=>e.jsx(w.Text,{variant:"sub-h3",children:t.children,...t.props}),Wo=t=>e.jsx(w.Text,{variant:"body-1",children:t.children,...t.props}),Ro=t=>e.jsx(w.Text,{variant:"body-2",children:t.children,...t.props}),Ao=t=>e.jsx(w.Text,{variant:"body-3",children:t.children,...t.props}),Ie={H1:ko,H2:Bo,H3:Fo,H4:Eo,H5:Mo,H6:Lo,SubH1:Io,SubH2:To,SubH3:Oo,Body1:Wo,Body2:Ro,Body3:Ao},Se=()=>{const[t,r]=ye.useSearchParams(),n=st.searchParamsToObject(t.toString()),s=ye.useParams(),o=ye.useLocation(),i=s.id;return{setSearchParams:r,searchParams:t,searchQueries:n,isHasQuery:(h,g)=>t.has(h)&&t.get(h)===g,getQueryParam:h=>t.get(h),getRouteParam:h=>s[h],params:s,location:o,id:i,hasId:!!i}},yn=t=>JSON.stringify(t),pn=t=>JSON.stringify(t),jn=t=>JSON.stringify(t),bn=t=>JSON.stringify(t),zo=t=>t,Vo=t=>JSON.stringify(t),xt=({value:t,name:r,type:n,withSearchParam:s=!0,setSearchParams:o,searchQueries:i,dropdownSearchKey:c,filterKey:l="filter",pageKey:a="page"})=>{if(s){let d;switch(n){case"search":d=zo(t);break;case"dropdown":case"dropdown-multiple":d=yn(t);break;case"radio":d=pn(t);break;case"date-range":d=jn(t);break;case"advanced-date-range":d=Vo(t);break;case"date":d=bn(t);break;default:d=t;break}if(typeof d<"u"){const g={...i[l]&&typeof i[l]=="string"?JSON.parse(i[l]):void 0,[r]:d},m={...i};c&&typeof c=="string"&&delete m[c],delete m[a];const j={...m,[l]:JSON.stringify(g)},E=new URLSearchParams(i).toString(),y=new URLSearchParams(j).toString();if(E===y)return;o(j)}}},Ft=({name:t,filterKey:r="filter",searchParams:n,get:s})=>{const o=n.get(r)||void 0,i=o&&typeof o=="string"?JSON.parse(o):void 0,c=i?i[t]:void 0;return s==="label"&&c?JSON.parse(c)[0].label:s==="value"&&c?JSON.parse(c)[0].value:c},vn=({name:t,filterKey:r="filter",searchParams:n,get:s})=>{const o=n.get(r)||void 0,i=o&&typeof o=="string"?JSON.parse(o):void 0,c=i?i[t]:void 0;return s==="label"&&c?JSON.parse(c).map(l=>l.label):s==="value"&&c?JSON.parse(c).map(l=>l.value):s==="array"&&c?JSON.parse(c):c},Ho=({name:t,filterKey:r="filter",searchParams:n,get:s})=>{const o=n.get(r)||void 0,i=o&&typeof o=="string"?JSON.parse(o):void 0,c=i?i[t]:void 0;return s==="id"&&c?JSON.parse(c).id:s==="label"&&c?JSON.parse(c).label:s==="value"&&c?JSON.parse(c).value:c},Tt=(t,r,n)=>{const s=r.get(n||"filter")||void 0,o=s&&typeof s=="string"?JSON.parse(s):void 0;return o?o[t]:void 0},Po=({name:t,filterKey:r="filter",searchParams:n})=>{const s=n.get(r||"filter")||void 0,o=s&&typeof s=="string"?JSON.parse(s):void 0,i=o?o[t]:void 0;return{start:i?JSON.parse(i).from:void 0,end:i?JSON.parse(i).to:void 0}},Cn=({name:t,filterKey:r="filter",searchParams:n})=>{const s=n.get(r||"filter")||void 0,o=s&&typeof s=="string"?JSON.parse(s):void 0,i=o?o[t]:void 0;return i?JSON.parse(i):void 0},No=(t,{filterKey:r="filter",perPageKey:n="perPage",pageKey:s="page"})=>{const o=t.get(r)||void 0,i=t.get(n)||void 0,c=t.get(s)||void 0;return!!o||!!i||!!c},wn=({isOpen:t,onClose:r,filterKey:n,pageKey:s,filters:o})=>{const{searchParams:i,setSearchParams:c,searchQueries:l}=Se(),[a,d]=u.useState({}),h=()=>{i.delete(n||"filter"),c(i)},g=(m,j)=>{switch(m.type){case"radio":{const{show:E=!0}=m;return E&&e.jsx(f.Box,{direction:"column",children:e.jsx(f.Box,{direction:"column",children:m.title})},j)}case"dropdown":{const{show:E=!0}=m;return E&&e.jsx(f.Box,{direction:"column",children:e.jsx(f.Box,{direction:"column",children:m.title})},j)}case"date-range":return e.jsx(f.Box,{direction:"column",children:e.jsx(f.Box,{direction:"column",children:m.title})},j);case"date":return e.jsx(f.Box,{direction:"column",children:e.jsx(f.Box,{direction:"column",children:m.title})},j);case"dropdown-multiple":{const{show:E=!0}=m;return E&&e.jsx(f.Box,{direction:"column",children:e.jsx(f.Box,{direction:"column",children:m.title})},j)}default:return null}};return e.jsx(gn,{onHide:r,show:t||!1,children:e.jsxs(f.Box,{direction:"column",gap:"md",children:[e.jsxs(ne.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((m,j)=>g(m,j))]})})},Dn=({searchKey:t="q",statusKey:r="status",searchPlaceholder:n="Search",searchHighlightPlaceholder:s,extendedFilter:o,showSearchFilter:i=!0,showStatusFilter:c=!0,filterKey:l="filter",pageKey:a="page",customWidthSearch:d,handleOnReset:h,filterConfigs:g,buttonToggleProps:m,position:j="right",titleSearchLabel:E="Work Order",withTitleLabels:y=!1})=>{const k=(m==null?void 0:m.isShowLabel)??!0,[L,C]=u.useState(!1),[b,A]=u.useState(0),W=()=>{A(Q=>Q+1)},{searchParams:v,setSearchParams:F,getQueryParam:z}=Se(),R=st.searchParamsToObject(v.toString()),_=Tt(t,v,l)||"",[J,te]=u.useState(_),xe=z(l),se=!!(xe&&!(()=>{if(xe)try{const Q=JSON.parse(xe);return Object.keys(Q).length===1&&Q[t]===""}catch(Q){console.error("Filter parameter is not a valid JSON:",Q)}return!1})()),Z=ge.useMediaQuery("md");return u.useEffect(()=>{te(_)},[_]),u.useEffect(()=>{if(J===_)return;const Q=window.setTimeout(()=>{xt({value:J,name:t,type:"search",searchQueries:R,setSearchParams:F,filterKey:l,pageKey:a})},350);return()=>{window.clearTimeout(Q)}},[J,_,t,R,F,l,a]),e.jsxs(ne.Flex,{gap:"md",style:{flexDirection:Z&&j==="left"?"row":Z&&j==="right"?"row-reverse":"column"},align:"flex-end",children:[se&&e.jsx(f.Box,{direction:"column",justify:"flex-end",children:e.jsx(V.Button,{onClick:()=>{const Q=new URLSearchParams(v);Q.delete(l),F(Q),te(""),W(),h&&h()},variant:"outline",tone:"neutral",children:e.jsx(w.Text,{color:"error",fontWeight:"semibold",children:"Reset"})})}),o==null?void 0:o.map(({minWidth:Q,content:ae,title:ie,onClickContainer:ue},me)=>e.jsxs(f.Box,{direction:"column",gap:"sm",onClick:ue,style:{minWidth:Q},children:[ie&&e.jsx(Ie.SubH3,{children:ie}),ae]},`extended-filter-${me}-${b}`)),!!(g!=null&&g.length)&&e.jsx(V.Button,{primary:se,secondary:!se,iconLeft:e.jsx(B.Icon,{size:"sm",name:(m==null?void 0:m.icon)||"FilterHorizontal",style:{color:xe?"var(--sa-background-brand, #04254f)":"var(--sa-text-primary, #292a2e)"}}),fullWidth:!Z,onClick:()=>C(!0),children:k?"Filter":void 0}),c&&e.jsxs(f.Box,{direction:"column",gap:"sm",style:{minWidth:"126px"},children:[y&&e.jsx(Ie.SubH3,{children:"Status"}),e.jsx(ot.Dropdown,{dropdownLists:[{label:"Active",value:"active"},{label:"InActive",value:"inactive"}],defaultValue:Ft({get:"value",name:r,searchParams:v,filterKey:l})?[{label:Ft({get:"value",name:r,searchParams:v,filterKey:l})==="active"?"Active":"InActive",value:Ft({get:"value",name:r,searchParams:v,filterKey:l})}]:[],onChange:Q=>xt({value:Q,name:r,type:"dropdown",searchQueries:R,setSearchParams:F,filterKey:l}),placeholder:y?"All":"All Status"},b)]}),i&&e.jsxs(f.Box,{direction:"column",gap:"sm",style:{width:d&&Z?d:Z?"310px":""},children:[y&&e.jsxs(Ie.SubH3,{children:["Search for ",E]}),e.jsx(Je.Input,{placeholder:n,leftIcon:e.jsx(B.Icon,{name:"Search",width:20,height:20}),onChange:Q=>te(Q.target.value),value:J,fullWidth:!0},b+1+l)]}),e.jsx(wn,{isOpen:L,onClose:()=>C(!1),filterKey:l,filters:g,pageKey:a})]})},_o=t=>t==="checkbox-multiple"?"dropdown-multiple":t==="radio"?"dropdown":t==="date-compact"?"date":t;function fr({configs:t,filterKey:r="filter",activeFilterKey:n="filters",pageKey:s="page",searchKey:o="q"}){const{searchParams:i,setSearchParams:c,searchQueries:l}=Se(),a=u.useMemo(()=>Object.fromEntries(t.map(b=>[b.key,b])),[t]),d=u.useMemo(()=>{const b=(i.get(n)||"").split(",").map(W=>W.trim()).filter(Boolean);let A=[];try{const W=i.get(r);W&&(A=Object.keys(JSON.parse(W)).filter(v=>v!==o))}catch{}return t.map(W=>W.key).filter(W=>{const v=a[W];return(v==null?void 0:v.locked)||b.includes(W)||A.includes(W)})},[i,n,r,o,t,a]),h=u.useCallback(b=>{try{return b[r]?JSON.parse(b[r]):{}}catch{return{}}},[r]),g=u.useCallback(b=>{const A={...l};b.length?A[n]=b.join(","):delete A[n],c(A)},[l,n,c]),m=u.useCallback(b=>{d.includes(b)||g([...d,b])},[d,g]),j=u.useCallback(b=>{var F;if((F=a[b])!=null&&F.locked)return;const A={...l},W=d.filter(z=>z!==b);W.length?A[n]=W.join(","):delete A[n];const v=h(A);b in v&&(delete v[b],Object.keys(v).length?A[r]=JSON.stringify(v):delete A[r]),delete A[s],c(A)},[l,d,n,r,s,h,c,a]),E=u.useCallback(b=>d.includes(b)?j(b):m(b),[d,m,j]),y=u.useCallback(b=>{switch(b.type){case"dropdown":case"dropdown-multiple":case"checkbox-multiple":case"radio":return vn({name:b.key,get:"array",searchParams:i,filterKey:r})||[];case"date":{const A=Cn({name:b.key,searchParams:i,filterKey:r});return A?new Date(A):void 0}case"date-compact":{const W=h(Object.fromEntries(i.entries()))[b.key];return W&&typeof W=="object"?W:void 0}default:return}},[i,r,h]),M=u.useCallback((b,A)=>{if(b.type==="date-compact"){const W={...l},v=h(W);A==null?delete v[b.key]:v[b.key]=A,Object.keys(v).length?W[r]=JSON.stringify(v):delete W[r],delete W[s],c(W);return}xt({value:A,name:b.key,type:_o(b.type),searchQueries:l,setSearchParams:c,filterKey:r,pageKey:s})},[l,c,r,s,h]),k=u.useCallback(b=>{const A={...l},W=h(A);b in W&&(delete W[b],Object.keys(W).length?A[r]=JSON.stringify(W):delete A[r]),delete A[s],c(A)},[l,r,s,h,c]),L=u.useCallback(()=>{const b={...l};delete b[r],delete b[n],delete b[s],c(b)},[l,r,n,s,c]),C=d.length>0;return{activeKeys:d,configByKey:a,hasActiveFilter:C,addFilter:m,removeFilter:j,toggleFilter:E,getValue:y,setValue:M,clearValue:k,clearAll:L}}const mr={get(t){return dt.storage.get(t)??null},set(t,r){dt.storage.save(t,r)},remove(t){dt.storage.delete(t)}},ct={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}`},bt=(t,r)=>{const n=new Set(r.map(i=>i.key)),s=t.order.filter(i=>n.has(i));for(const i of r)s.includes(i.key)||s.push(i.key);const o=t.hidden.filter(i=>n.has(i));return{order:s,hidden:o}};function qo({columns:t,scopeId:r,storage:n,onColumnsChange:s,value:o}){const i=u.useMemo(()=>({order:t.map(v=>v.key),hidden:[]}),[t]),c=r?ct.columns(r):void 0,l=(v,F)=>bt({order:v.order??F,hidden:v.hidden??[]},t),[a,d]=u.useState(()=>{if(o&&(o.order||o.hidden))return l(o,t.map(v=>v.key));if(c){const v=n.get(c);if(v&&Array.isArray(v.order))return bt(v,t)}return i}),h=t.map(v=>v.key).join("|");u.useEffect(()=>d(v=>bt(v,t)),[h]);const g=u.useRef(a);g.current=a;const m=o?`${(o.order??[]).join("|")}~${(o.hidden??[]).join("|")}`:null,j=u.useRef(m);u.useEffect(()=>{if(m==null||j.current===m)return;j.current=m;const v=g.current,F=l(o,v.order);F.order.join("|")===v.order.join("|")&&F.hidden.join("|")===v.hidden.join("|")||(d(F),c&&n.set(c,F))},[m,h]);const E=u.useRef(!1);u.useEffect(()=>{E.current||(E.current=!0,s==null||s(a))},[]);const y=u.useCallback(v=>{d(v),c&&n.set(c,v),s==null||s(v)},[c,n,s]),M=u.useMemo(()=>{const v=new Map(t.map(F=>[F.key,F]));return a.order.filter(F=>v.has(F)).map(F=>({...v.get(F),visible:!a.hidden.includes(F)}))},[a,t]),k=u.useCallback(v=>{const F=a.hidden.includes(v)?a.hidden.filter(z=>z!==v):[...a.hidden,v];y({...a,hidden:F})},[a,y]),L=u.useCallback((v,F)=>{if(v===F)return;const z=[...a.order],[R]=z.splice(v,1);z.splice(F,0,R),y({...a,order:z})},[a,y]),C=u.useCallback(v=>{y({...a,hidden:v?t.filter(F=>!F.locked).map(F=>F.key):[]})},[a,t,y]),b=u.useCallback(()=>y(i),[y,i]),A=u.useCallback(v=>y(bt(v,t)),[y,t]),W=a.hidden.length===0;return{state:a,orderedColumns:M,allVisible:W,toggleVisibility:k,reorder:L,setAllHidden:C,reset:b,applyState:A}}function Zo({scopeId:t,storage:r,snapshotKeys:n,pageKey:s="page",getColumns:o,applyColumns:i}){const{searchParams:c,setSearchParams:l}=Se(),a=t?ct.savedViews(t):void 0,[d,h]=u.useState(()=>a?r.get(a)||[]:[]),g=u.useCallback(y=>{h(y),a&&r.set(a,y)},[a]),m=u.useCallback(y=>{const M=y.trim();if(!M)return;const k={};n.forEach(C=>{const b=c.get(C);b!=null&&(k[C]=b)});const L={id:`${Date.now()}`,name:M,query:k,columns:o==null?void 0:o(),createdAt:Date.now()};g([...d,L])},[n,c,o,g,d]),j=u.useCallback(y=>g(d.filter(M=>M.id!==y)),[g,d]),E=u.useCallback(y=>{const M=Object.fromEntries(c.entries());n.forEach(k=>delete M[k]),Object.assign(M,y.query),delete M[s],l(M),y.columns&&(i==null||i(y.columns))},[c,n,s,l,i]);return{enabled:!!a,views:d,saveView:m,deleteView:j,applyView:E}}function Go({scopeId:t,storage:r,snapshotKeys:n,enabled:s=!0}){const{searchParams:o}=Se(),i=t&&s?ct.lastState(t):void 0,c=u.useRef(i),l=u.useRef(!1);u.useEffect(()=>{if(!i){c.current=i;return}if(c.current!==i){c.current=i,l.current=!1;return}const h={};if(n.forEach(g=>{const m=o.get(g);m!=null&&(h[g]=m)}),Object.keys(h).length===0){l.current&&r.remove(i);return}l.current=!0,r.set(i,h)},[o,i,n,r]);const a=u.useCallback(()=>{if(!i)return null;const h=r.get(i);return h&&Object.keys(h).length>0?h:null},[i,r]),d=u.useCallback(()=>{i&&r.remove(i)},[i,r]);return{enabled:!!i,read:a,clear:d}}function Qo({scopeId:t,storage:r,perPageKey:n,pageSizeOptions:s,enabled:o=!0}){const{searchParams:i}=Se(),c=t&&o?ct.perPage(t):void 0,l=i.toString(),a=u.useRef(c);u.useEffect(()=>{if(!c){a.current=c;return}if(a.current!==c){a.current=c;return}const g=i.get(n);if(!g)return;const m=Number(g);!Number.isFinite(m)||m<=0||r.set(c,m)},[l,c,n,r]);const d=u.useCallback(()=>{if(!c)return null;const g=r.get(c);if(g==null)return null;const m=Number(g);return!Number.isFinite(m)||m<=0||s&&!s.includes(m)?null:String(m)},[c,r,s]),h=u.useCallback(()=>{c&&r.remove(c)},[c,r]);return{enabled:!!c,read:d,clear:h}}let Ut={},Jt=!1,Yt=null;const Uo=(t,r)=>{Object.assign(Ut,t),Yt=r,!Jt&&(Jt=!0,queueMicrotask(()=>{const n=Ut,s=Yt;Ut={},Jt=!1,Yt=null,!(!s||Object.keys(n).length===0)&&s(o=>{const i=new URLSearchParams(o);return Object.entries(n).forEach(([c,l])=>i.set(c,l)),i})}))};function Jo({enabled:t,snapshotKeys:r,perPageKey:n,readSnapshot:s,readPerPage:o}){const{searchParams:i,setSearchParams:c,location:l}=Se(),a=u.useRef(null);u.useEffect(()=>{if(!t||a.current===l.pathname)return;a.current=l.pathname;const d={};if(!i.has(n)){const h=o();h&&(d[n]=h)}if(!r.some(h=>i.has(h))){const h=s();h&&Object.assign(d,h)}Object.keys(d).length!==0&&Uo(d,c)},[l.pathname,t])}const Yo=({configs:t,activeKeys:r,onToggle:n,hasActiveFilter:s,onReset:o})=>t.length?e.jsxs(T.Menu,{position:"bottom-left",children:[e.jsx(T.MenuButton,{children:e.jsx(V.Button,{variant:s?"secondary":"outline",tone:"neutral",size:"sm",iconLeft:e.jsx(B.Icon,{name:"FilterHorizontal"}),"aria-label":"Add filter"})}),e.jsx(T.MenuLists,{children:e.jsx(T.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"}),s&&o&&e.jsx(V.Button,{variant:"link",tone:"brand",size:"xs",onClick:o,children:"Reset"})]}),children:t.map(i=>e.jsx(T.MenuItem,{selected:i.locked||r.includes(i.key),disabled:i.locked,closeOnSelect:!1,startIcon:i.icon??void 0,onClick:()=>{i.locked||n(i.key)},children:i.label},i.key))})})]}):null,Ot=({onClear:t,onRemove:r})=>e.jsxs(T.Menu,{position:"bottom-right",children:[e.jsx(T.MenuButton,{children:e.jsx(V.Button,{variant:"link",tone:"neutral",size:"xs",iconLeft:e.jsx(B.Icon,{name:"MenuHorizontal"}),"aria-label":"Filter actions"})}),e.jsx(T.MenuLists,{children:e.jsxs(T.MenuBody,{style:{width:180},children:[e.jsx(T.MenuItem,{startIcon:e.jsx(B.Icon,{name:"CrossCircle"}),onClick:t,children:"Clear value"}),r&&e.jsx(T.MenuItem,{intent:"danger",startIcon:e.jsx(B.Icon,{name:"Trash1"}),onClick:r,children:"Remove filter"})]})})]}),Xo=t=>{const r=new Date(t);return r.setHours(0,0,0,0),r},Nr=(t,r,n)=>{const s=new Date(t);return n==="day"?s.setDate(s.getDate()+r):n==="week"?s.setDate(s.getDate()+r*7):n==="month"?s.setMonth(s.getMonth()+r):s.setFullYear(s.getFullYear()+r),s},Sn=t=>{const r=Xo(new Date);if(t.direction==="this"){const s=new Date(r),o=new Date(r);return t.period==="week"?(s.setDate(r.getDate()-r.getDay()),o.setDate(s.getDate()+6)):t.period==="month"?(s.setDate(1),o.setMonth(o.getMonth()+1,0)):t.period==="year"&&(s.setMonth(0,1),o.setMonth(11,31)),{from:s,to:o}}const n=t.count??1;return t.direction==="past"?{from:Nr(r,-n,t.period),to:r}:{from:r,to:Nr(r,n,t.period)}},_r=24,kn=t=>t.length>_r?`${t.slice(0,_r)}...`:t,Et=t=>t.toLocaleDateString(void 0,{day:"2-digit",month:"short",year:"numeric"}),It={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"},Ko=["is","is-before","is-after","is-on-or-before","is-on-or-after","is-between","is-relative-to-today","is-empty","is-not-empty"],sr={past:"Past",next:"Next",this:"This"},$o=["day","week","month","year"],es=["past","next","this"],ts=t=>t.field.type==="date-compact"?e.jsx(os,{field:t.field,value:t.value,onChange:t.onChange,onClear:t.onClear,onRemove:t.onRemove}):e.jsx(rs,{field:t.field,value:t.value,onChange:t.onChange,onClear:t.onClear,onRemove:t.onRemove}),rs=({field:t,value:r,onChange:n,onClear:s,onRemove:o})=>{const i=r?Et(new Date(r)):null,c=!!i,l=c?e.jsxs(e.Fragment,{children:[e.jsxs("span",{style:{fontWeight:500},children:[t.label,":"]})," ",e.jsx("span",{style:{fontWeight:400},children:kn(i)})]}):t.label;return e.jsxs(T.Menu,{position:"bottom-left",children:[e.jsx(T.MenuButton,{children:e.jsx(V.Button,{variant:c?"secondary":"outline",tone:"neutral",size:"sm",iconLeft:c?e.jsx(B.Icon,{name:"Calendar",size:"sm"}):void 0,iconRight:e.jsx(B.Icon,{name:"ChevronSmallDown"}),children:l})}),e.jsx(T.MenuLists,{children:e.jsx(T.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(Ot,{onClear:s,onRemove:o})]}),children:e.jsx($e.StarasiaDate,{size:"sm",input:!1,clearable:!0,filter:t.mode,value:r,onChange:a=>a==null?s():n(a),withPadding:!1})})})]})},ns=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?`${It[t.op]} ${Et(new Date(t.date))}`:null;case"is-between":return t.from&&t.to?`${Et(new Date(t.from))} - ${Et(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,s=n===1?r.period:`${r.period}s`;return`${sr[r.direction]} ${n} ${s}`}case"is-empty":case"is-not-empty":return It[t.op];default:return null}},os=({field:t,value:r,onChange:n,onClear:s,onRemove:o})=>{const i=(r==null?void 0:r.op)??"is",c=r?ns(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:kn(c)})]}):t.label,d=h=>{if(h!==i){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(T.Menu,{position:"bottom-left",children:[e.jsx(T.MenuButton,{children:e.jsx(V.Button,{variant:l?"secondary":"outline",tone:"neutral",size:"sm",iconLeft:l?e.jsx(B.Icon,{name:"Calendar",size:"sm"}):void 0,iconRight:e.jsx(B.Icon,{name:"ChevronSmallDown"}),children:a})}),e.jsxs(T.MenuLists,{children:[e.jsx(T.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(ss,{op:i,onChange:d})]}),e.jsx(Ot,{onClear:s,onRemove:o})]}),children:e.jsx(is,{value:r,op:i,onChange:n})}),i==="is-relative-to-today"&&e.jsx(T.MenuFooter,{children:e.jsx(w.Text,{fontSize:"xs",color:"subtlest",children:"Filter will update with the current date"})})]})]})},ss=({op:t,onChange:r})=>e.jsxs(T.Menu,{position:"bottom-left",children:[e.jsx(T.MenuButton,{children:e.jsx(V.Button,{variant:"link",tone:"neutral",size:"xs",iconRight:e.jsx(B.Icon,{name:"ChevronSmallDown"}),children:It[t]})}),e.jsx(T.MenuLists,{children:e.jsx(T.MenuBody,{style:{width:200},children:Ko.map(n=>e.jsx(T.MenuItem,{selected:t===n,onClick:()=>r(n),endIcon:t===n?e.jsx(B.Icon,{name:"Check"}):void 0,children:It[n]},n))})})]}),is=({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 s=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($e.StarasiaDate,{size:"sm",input:!1,clearable:!0,rangedDate:!0,value:s,onChange:o=>{if(o==null){n({op:r});return}if(typeof o=="object"&&o!==null&&"from"in o&&"to"in o){let{from:i,to:c}=o;if(!i&&c&&(i=c,c=null),!i&&!c){n({op:r});return}n({op:r,from:i?i.toISOString():void 0,to:c?c.toISOString():void 0})}},withPadding:!1},"range")}return r==="is-relative-to-today"?e.jsx(ls,{value:t==null?void 0:t.relative,onChange:s=>n({op:r,relative:s})}):e.jsx($e.StarasiaDate,{size:"sm",input:!1,clearable:!0,value:t!=null&&t.date?new Date(t.date):void 0,onChange:s=>{if(s==null){n({op:r});return}s instanceof Date&&n({op:r,date:s.toISOString()})},withPadding:!1},"single")},ls=({value:t,onChange:r})=>{const n=(t==null?void 0:t.direction)??"past",s=(t==null?void 0:t.count)??1,o=(t==null?void 0:t.period)??"week",i=n!=="this",c=Sn({direction:n,count:s,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(T.Menu,{position:"bottom-left",children:[e.jsx(T.MenuButton,{children:e.jsx(V.Button,{variant:"outline",tone:"neutral",size:"sm",iconRight:e.jsx(B.Icon,{name:"ChevronSmallDown"}),children:sr[n]})}),e.jsx(T.MenuLists,{children:e.jsx(T.MenuBody,{style:{width:140},children:es.map(l=>e.jsx(T.MenuItem,{selected:n===l,endIcon:n===l?e.jsx(B.Icon,{name:"Check"}):void 0,onClick:()=>r(l==="this"?{direction:l,period:o}:{direction:l,count:s,period:o}),children:sr[l]},l))})})]}),i&&e.jsx(Je.Input,{type:"number",size:"sm",min:1,clearable:!1,value:s,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(T.Menu,{position:"bottom-left",children:[e.jsx(T.MenuButton,{children:e.jsx(V.Button,{variant:"outline",tone:"neutral",size:"sm",iconRight:e.jsx(B.Icon,{name:"ChevronSmallDown"}),children:o})}),e.jsx(T.MenuLists,{children:e.jsx(T.MenuBody,{style:{width:140},children:$o.map(l=>e.jsx(T.MenuItem,{selected:o===l,endIcon:o===l?e.jsx(B.Icon,{name:"Check"}):void 0,onClick:()=>r(n==="this"?{direction:n,period:l}:{direction:n,count:s,period:l}),children:l},l))})})]})]}),e.jsx($e.StarasiaDate,{size:"sm",input:!1,disabled:!0,rangedDate:!0,value:c,onChange:()=>{},withPadding:!1},"relative-preview")]})},qr=18,cs=t=>t.length>qr?`${t.slice(0,qr)}...`:t,as=({field:t,value:r,onChange:n,onClear:s,onRemove:o})=>{const i=t.type==="dropdown-multiple",c=r.length,l=t.searchable!==!1,[a,d]=u.useState(""),h=t.options,g=typeof t.onSearch=="function",m=(()=>{if(g)return h;const k=a.trim().toLowerCase();return k?h.filter(L=>L.label.toLowerCase().includes(k)):h})(),j=k=>r.some(L=>L.value===k.value),E=k=>{if(!i){n([{label:k.label,value:k.value}]),d("");return}n(j(k)?r.filter(L=>L.value!==k.value):[...r,{label:k.label,value:k.value}])},y=k=>{var L;d(k),(L=t.onSearch)==null||L.call(t,k)},M=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?cs(r[0].label):`${c} Selected`})]});return e.jsxs(T.Menu,{position:"bottom-left",children:[e.jsx(T.MenuButton,{children:e.jsx(V.Button,{variant:c>0?"secondary":"outline",tone:"neutral",size:"sm",iconLeft:c>0?e.jsx(B.Icon,{name:"Tag",size:"sm"}):void 0,iconRight:e.jsx(B.Icon,{name:"ChevronSmallDown"}),children:M})}),e.jsx(T.MenuLists,{children:e.jsx(T.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(Ot,{onClear:s,onRemove:o})]}),children:e.jsxs(f.Box,{direction:"column",gap:"sm",children:[l&&e.jsx(ot.Dropdown,{size:"sm",triggerInput:!0,fullWidth:!0,hideChevronIcon:!0,clearable:!0,multiSelect:i,searchAble:!0,searchValue:a,onSearch:y,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(k=>e.jsx(T.MenuItem,{closeOnSelect:!i,selected:j(k),startIcon:k.avatar,endIcon:j(k)?e.jsx(B.Icon,{name:"Check"}):void 0,description:k.description,onClick:()=>E(k),children:k.label},k.value))})]})})})]})},Zr=18,ds=t=>t.length>Zr?`${t.slice(0,Zr)}...`:t,Gr=({checked:t,indeterminate:r})=>e.jsx("span",{style:{pointerEvents:"none",display:"inline-flex"},children:e.jsx(lt.Checkbox,{size:"sm",checked:t,readOnly:!0,onChange:()=>{},variant:r?"indeterminate":"select"})}),us=({field:t,value:r,onChange:n,onClear:s,onRemove:o})=>{const i=new Set(r.map(m=>m.value)),c=r.length,l=t.options.length>0&&t.options.every(m=>i.has(m.value)),a=c>0&&!l,d=m=>{n(i.has(m.value)?r.filter(j=>j.value!==m.value):[...r,{label:m.label,value:m.value}])},h=()=>{n(l?[]:t.options.map(m=>({label:m.label,value:m.value})))},g=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?ds(r[0].label):`${c} Selected`})]});return e.jsxs(T.Menu,{position:"bottom-left",children:[e.jsx(T.MenuButton,{children:e.jsx(V.Button,{variant:c>0?"secondary":"outline",tone:"neutral",size:"sm",iconLeft:c>0?e.jsx(B.Icon,{name:"Tag",size:"sm"}):void 0,iconRight:e.jsx(B.Icon,{name:"ChevronSmallDown"}),children:g})}),e.jsx(T.MenuLists,{children:e.jsxs(T.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(Ot,{onClear:s,onRemove:o})]}),children:[e.jsx(T.MenuItem,{closeOnSelect:!1,selected:l,onClick:h,startIcon:e.jsx(Gr,{checked:l||a,indeterminate:a}),children:"Select All"}),t.options.map(m=>e.jsx(T.MenuItem,{closeOnSelect:!1,selected:i.has(m.value),onClick:()=>d(m),startIcon:e.jsx(Gr,{checked:i.has(m.value)}),children:m.label},m.value))]})})]})},Bn=({activeKeys:t,configByKey:r,getValue:n,setValue:s,clearValue:o,removeFilter:i})=>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:()=>i(c);return l.type==="date"||l.type==="date-compact"?e.jsx(ts,{field:l,value:a,onChange:h=>s(l,h),onClear:()=>o(c),onRemove:d},c):l.type==="checkbox-multiple"?e.jsx(us,{field:l,value:a||[],onChange:h=>s(l,h),onClear:()=>o(c),onRemove:d},c):e.jsx(as,{field:l,value:a||[],onChange:h=>s(l,h),onClear:()=>o(c),onRemove:d},c)})}),Qr=t=>`${t} Rows`,xs=({pagination:t,pageKey:r="page",perPageKey:n="perPage",pageSizeOptions:s=[10,25,50,100],defaultPerPage:o=10,showResultCount:i=!0,showPageSize:c=!0,showPagination:l=!0})=>{var k;const{searchQueries:a,setSearchParams:d,searchParams:h}=Se(),g=h.get(n),m=g?Number(g):o,j=L=>{d({...a,[r]:String(L)})},E=L=>{d({...a,[n]:L,[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:0),M=(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:[i&&e.jsx(w.Text,{fontSize:"sm",fontWeight:"medium",color:"primary",truncate:!0,children:`${y}-${M} of ${((k=t==null?void 0:t.totalData)==null?void 0:k.toLocaleString())||0}`}),c&&e.jsxs(T.Menu,{position:"bottom-left",children:[e.jsx(T.MenuButton,{children:e.jsx(V.Button,{variant:"outline",tone:"neutral",size:"sm",iconRight:e.jsx(B.Icon,{name:"ChevronSmallDown"}),"aria-label":"Rows per page",children:Qr(m)})}),e.jsx(T.MenuLists,{children:e.jsx(T.MenuBody,{children:s.map(L=>e.jsx(T.MenuItem,{selected:L===m,onClick:()=>E(String(L)),children:Qr(L)},L))})})]}),l&&((t==null?void 0:t.totalPage)??0)>1&&e.jsx(f.Box,{direction:"column",display:"flex",align:"center",gap:"sm",paddingRight:"sm",style:{borderRight:"1px solid var(--sa-border-subtle, rgba(11, 18, 14, 0.14))"},children:e.jsx(ut.Pagination,{size:"sm",variant:"neutral",siblingCount:0,currentPage:t!=null&&t.currentPage?Number(t.currentPage):1,totalPages:Number(t==null?void 0:t.totalPage),onPageChange:j})})]})};function hs(t,r,n=!0){u.useEffect(()=>{if(!n)return;const s=o=>{var l;if(o.metaKey||o.ctrlKey||o.altKey||o.key!==t)return;const i=o.target,c=(l=i==null?void 0:i.tagName)==null?void 0:l.toLowerCase();c==="input"||c==="textarea"||i!=null&&i.isContentEditable||(o.preventDefault(),r())};return window.addEventListener("keydown",s),()=>window.removeEventListener("keydown",s)},[t,r,n])}const fs=240,Fn=({searchKey:t="q",filterKey:r="filter",pageKey:n="page",placeholder:s="Search",shortcut:o="/",collapsible:i=!0})=>{const{searchParams:c,setSearchParams:l,searchQueries:a}=Se(),d=Tt(t,c,r)||"",[h,g]=u.useState(!i||!!d),[m,j]=u.useState(i&&!d),[E,y]=u.useState(d),M=ge.useDebounce(E,350),k=u.useRef(null);u.useEffect(()=>{y(d),d&&g(!0)},[d]),u.useEffect(()=>{h&&j(!1)},[h]),u.useEffect(()=>{M!==d&&xt({value:M,name:t,type:"search",searchQueries:a,setSearchParams:l,filterKey:r,pageKey:n})},[M]);const L=u.useCallback(()=>{g(!0),requestAnimationFrame(()=>{var W;return(W=k.current)==null?void 0:W.focus()})},[]);hs(o,L);const C=()=>{i&&!E&&g(!1)},b=W=>{var v;i&&W.key==="Escape"&&!E&&(g(!1),(v=k.current)==null||v.blur())},A=()=>{h||j(!0)};return e.jsxs(f.Box,{display:"flex",direction:"row",align:"center",gap:"spacing-0",children:[m&&e.jsx(V.Button,{variant:"outline",tone:"neutral",size:"sm",iconLeft:e.jsx(B.Icon,{name:"Search",size:"sm"}),"aria-label":"Search","aria-expanded":!1,onClick:L}),e.jsxs(f.Box,{onTransitionEnd:A,style:{position:"relative",width:h?fs:0,overflow:"hidden",transition:"width 220ms ease"},children:[e.jsx(Je.Input,{ref:k,size:"sm",fullWidth:!0,value:E,placeholder:s,leftIcon:e.jsx(B.Icon,{name:"Search",width:16,height:16}),onChange:W=>y(W.target.value),onKeyDown:b,onBlur:C,tabIndex:h?0:-1}),h&&!E&&e.jsx(f.Box,{align:"center",justify:"center",borderColor:"border-subtle",borderWidth:"border",borderStyle:"border-solid",borderRadius:"rounded-xs",paddingInline:"spacing-1",customBackgroundColor:"var(--sa-background-surface-hover, #f1f2f4)",style:{position:"absolute",right:8,top:"50%",transform:"translateY(-50%)",pointerEvents:"none",minWidth:18,height:18,display:"inline-flex"},children:e.jsx(w.Text,{fontSize:"xs",color:"subtle",children:o})})]})]})},En=({columns:t,allVisible:r,onToggle:n,onReorder:s,onSetAllHidden:o})=>{const[i,c]=u.useState(null),[l,a]=u.useState(null),d=()=>{i!==null&&l!==null&&i!==l&&s(i,l),c(null),a(null)},h=(g,m)=>{const j=g+m;j<0||j>=t.length||s(g,j)};return e.jsxs(T.Menu,{position:"bottom-right",children:[e.jsx(T.MenuButton,{children:e.jsx(V.Button,{variant:r?"outline":"secondary",tone:"neutral",size:"sm",iconLeft:e.jsx(B.Icon,{name:"Grid",size:"sm"}),"aria-label":"Customize columns"})}),e.jsx(T.MenuLists,{children:e.jsx(T.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(V.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((g,m)=>{const j=!g.locked,E=l===m&&i!==null&&i!==m;return e.jsxs(f.Box,{direction:"row",display:"flex",align:"center",gap:"sm",paddingBlock:"xs",draggable:j,onDragStart:()=>j&&c(m),onDragOver:y=>{y.preventDefault(),a(m)},onDrop:d,onDragEnd:d,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:j?0:-1,"aria-label":`Reorder ${g.title}`,"aria-disabled":!j||void 0,color:"icon-subtlest",onKeyDown:y=>{j&&(y.key==="ArrowUp"?(y.preventDefault(),h(m,-1)):y.key==="ArrowDown"&&(y.preventDefault(),h(m,1)))},style:{display:"inline-flex",cursor:j?"grab":"default",opacity:j?1:.4},children:e.jsx(B.Icon,{name:"DragVertical",width:16,height:16})}),g.icon&&e.jsx(f.Box,{direction:"column",align:"center",color:"icon-subtle",style:{display:"inline-flex"},children:g.icon}),e.jsx(w.Text,{fontSize:"sm",fontWeight:"medium",color:"primary",truncate:!0,children:g.title}),e.jsx(f.Box,{direction:"column",style:{marginLeft:"auto"},children:e.jsx(it.Toggle,{size:"sm",checked:g.visible,disabled:g.locked,onChange:()=>n(g.key),"aria-label":`Toggle ${g.title} column`})})]},g.key)})})]})})})]})},Mn=({views:t,onApply:r,onDelete:n,onSave:s})=>{const[o,i]=u.useState(""),c=()=>{const l=o.trim();l&&(s(l),i(""))};return e.jsxs(T.Menu,{position:"bottom-right",children:[e.jsx(T.MenuButton,{children:e.jsx(V.Button,{variant:t.length>0?"secondary":"outline",tone:(t.length>0,"neutral"),size:"sm",iconLeft:e.jsx(B.Icon,{name:"Bookmark",size:"sm"}),"aria-label":"Saved views"})}),e.jsxs(T.MenuLists,{style:{width:"260px"},children:[e.jsx(T.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(T.MenuItem,{startIcon:e.jsx(B.Icon,{name:"Bookmark"}),onClick:()=>r(l),endIcon:e.jsx(V.Button,{variant:"link",tone:"error",size:"sm",iconLeft:e.jsx(B.Icon,{name:"Trash2"}),"aria-label":`Delete ${l.name}`,onClick:a=>{a.stopPropagation(),n(l.id)}}),children:l.name},l.id))})]})}),e.jsx(T.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(Je.Input,{size:"sm",fullWidth:!0,placeholder:"Save current view as…",value:o,onChange:l=>i(l.target.value),onKeyDown:l=>{l.key==="Enter"&&c()}})}),e.jsx(V.Button,{variant:"primary",tone:"brand",size:"sm",disabled:!o.trim(),onClick:c,children:"Save"})]})})]})]})},ms=({isOpen:t,onClose:r,configs:n,activeKeys:s,configByKey:o,hasActiveFilter:i,onToggle:c,onReset:l,getValue:a,setValue:d,clearValue:h,removeFilter:g})=>{const m=s.length;return e.jsx(Mt.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"}),m>0&&e.jsxs(w.Text,{fontSize:"sm",color:"subtle",children:["(",m,")"]})]}),e.jsx(V.Button,{variant:"link",tone:"neutral",size:"sm",iconLeft:e.jsx(B.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:[m>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(Bn,{activeKeys:s,configByKey:o,getValue:a,setValue:d,clearValue:h,removeFilter:g})})]}),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(j=>{const E=s.includes(j.key),y=!!j.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:[j.icon&&e.jsx(f.Box,{direction:"column",align:"center",color:"icon-subtle",style:{display:"inline-flex"},children:j.icon}),e.jsx(w.Text,{fontSize:"sm",color:"primary",truncate:!0,children:j.label})]}),e.jsx(it.Toggle,{size:"sm",checked:E||y,disabled:y,onChange:()=>c(j.key),"aria-label":`Toggle ${j.label}`})]},j.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(V.Button,{variant:"outline",tone:"neutral",size:"md",fullWidth:!0,disabled:!i,onClick:l,children:"Reset"})}),e.jsx(f.Box,{direction:"column",style:{flex:"1 1 0"},children:e.jsx(V.Button,{variant:"primary",tone:"brand",size:"md",fullWidth:!0,onClick:r,children:"Selesai"})})]})]})})},gs=t=>`${t} Rows`,ys=({perPageKey:t,pageKey:r,pageSizeOptions:n,defaultPerPage:s=10,showPageSize:o})=>{const{searchQueries:i,setSearchParams:c,searchParams:l}=Se(),a=l.get(t),d=a?Number(a):s,h=g=>{c({...i,[t]:g,[r]:"1"})};return o?e.jsxs(T.Menu,{position:"bottom-right",children:[e.jsx(T.MenuButton,{children:e.jsx(V.Button,{variant:"outline",tone:"neutral",size:"sm",iconLeft:e.jsx(B.Icon,{name:"MenuVertical",size:"sm"}),"aria-label":"More options"})}),e.jsx(T.MenuLists,{children:e.jsxs(T.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(g=>e.jsx(T.MenuItem,{selected:g===d,endIcon:g===d?e.jsx(B.Icon,{name:"Check"}):void 0,onClick:()=>h(String(g)),children:gs(g)},g))]})})]}):null},ps=t=>{var Ee;const{withPadding:r,configs:n,activeKeys:s,configByKey:o,hasActiveFilter:i,toggleFilter:c,removeFilter:l,getValue:a,setValue:d,clearValue:h,onReset:g,searchable:m,searchKey:j,filterKey:E,pageKey:y,searchPlaceholder:M,searchShortcut:k,searchCollapsible:L,pagination:C,perPageKey:b,pageSizeOptions:A,defaultPerPage:W,showPagination:v,showResultCount:F,showPageSize:z,hasColumns:R,orderedColumns:_,allVisible:J,onToggleVisibility:te,onReorder:xe,onSetAllHidden:he,showSavedViews:se,savedViews:Z,onApplyView:Q,onDeleteView:ae,onSaveView:ie}=t,[ue,me]=u.useState(!1),{searchQueries:Te,setSearchParams:Oe}=Se(),Fe=(C==null?void 0:C.rangeStart)??(((C==null?void 0:C.currentPage)||0)>1?(((C==null?void 0:C.currentPage)||0)-1)*((C==null?void 0:C.perPage)||0)+1:1),de=(C==null?void 0:C.rangeEnd)??((C==null?void 0:C.totalCurrentPage)!==(C==null?void 0:C.perPage)?C==null?void 0:C.totalData:((C==null?void 0:C.currentPage)||1)*((C==null?void 0:C.totalCurrentPage)||0)),fe=Re=>{Oe({...Te,[y]:String(Re)})},We=F||v&&!!(C!=null&&C.totalPage),Ve=()=>{g(),me(!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:[m&&e.jsx(Fn,{searchKey:j,filterKey:E,pageKey:y,placeholder:M,shortcut:k,collapsible:L}),e.jsx(V.Button,{variant:i?"secondary":"outline",tone:"neutral",size:"sm",iconLeft:e.jsx(B.Icon,{name:"FilterHorizontal"}),onClick:()=>me(!0),"aria-label":"Open filters",children:i?`Filter: ${s.length}`:null}),e.jsxs(f.Box,{direction:"row",display:"flex",align:"center",gap:"sm",style:{marginLeft:"auto"},children:[se&&e.jsx(Mn,{views:Z,onApply:Q,onDelete:ae,onSave:ie}),R&&e.jsx(En,{columns:_,allVisible:J,onToggle:te,onReorder:xe,onSetAllHidden:he}),e.jsx(ys,{perPageKey:b,pageKey:y,pageSizeOptions:A,defaultPerPage:W,showPageSize:z})]})]}),We&&e.jsxs(f.Box,{direction:"row",display:"flex",align:"center",justify:"space-between",gap:"sm",fullWidth:!0,children:[F?e.jsx(w.Text,{fontSize:"sm",fontWeight:"medium",color:"primary",truncate:!0,children:`${Fe}-${de} of ${((Ee=C==null?void 0:C.totalData)==null?void 0:Ee.toLocaleString())||0}`}):e.jsx(f.Box,{direction:"column"}),v&&!!(C!=null&&C.totalPage)&&e.jsx(ut.Pagination,{size:"xs",variant:"neutral",siblingCount:0,currentPage:C!=null&&C.currentPage?Number(C.currentPage):1,totalPages:Number(C.totalPage),onPageChange:fe})]}),e.jsx(ms,{isOpen:ue,onClose:()=>me(!1),configs:n,activeKeys:s,configByKey:o,hasActiveFilter:i,onToggle:c,onReset:Ve,getValue:a,setValue:d,clearValue:h,removeFilter:l})]})},js=({withPadding:t=!1,filterConfigs:r=[],filterKey:n="filter",activeFilterKey:s="filters",pageKey:o="page",perPageKey:i="perPage",pageSizeOptions:c=[25,50,100],defaultPerPage:l,showPagination:a=!0,showResultCount:d=!0,showPageSize:h=!0,searchable:g=!1,searchKey:m="q",searchPlaceholder:j="Search",searchShortcut:E="/",searchPosition:y="right",searchCollapsible:M=!0,pagination:k,columns:L=[],onColumnsChange:C,columnsState:b,scopeId:A,savedViews:W,persistLastState:v=!0,storage:F=mr,onReset:z})=>{const R=A??(W==null?void 0:W.scopeId),{activeKeys:_,configByKey:J,hasActiveFilter:te,toggleFilter:xe,removeFilter:he,getValue:se,setValue:Z,clearValue:Q,clearAll:ae}=fr({configs:r,filterKey:n,activeFilterKey:s,pageKey:o,searchKey:m}),ie=qo({columns:L,scopeId:R,storage:F,onColumnsChange:C,value:b}),ue=Zo({scopeId:R,storage:F,snapshotKeys:[s,n,i],pageKey:o,getColumns:()=>ie.state,applyColumns:ie.applyState}),me=Go({scopeId:R,storage:F,snapshotKeys:[s,n,o],enabled:v}),Te=Qo({scopeId:R,storage:F,perPageKey:i,pageSizeOptions:c,enabled:v});Jo({enabled:v&&!!R,snapshotKeys:[s,n,o],perPageKey:i,readSnapshot:me.read,readPerPage:Te.read});const Oe=l??c[0]??25,Fe=!!(W!=null&&W.enabled)&&ue.enabled,de=()=>{ae(),me.clear(),z==null||z()},fe=ge.useMediaQuery("md"),We=g?e.jsx(Fn,{searchKey:m,filterKey:n,pageKey:o,placeholder:j,shortcut:E,collapsible:M}):null;return fe?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(Yo,{configs:r,activeKeys:_,onToggle:xe,hasActiveFilter:te,onReset:de}),y==="left"&&We,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(Bn,{activeKeys:_,configByKey:J,getValue:se,setValue:Z,clearValue:Q,removeFilter:he}),te&&e.jsx(V.Button,{variant:"link",tone:"brand",size:"sm",onClick:de,children:"Reset"})]})]}),e.jsxs(f.Box,{direction:"row",display:"flex",align:"center",gap:"sm",children:[e.jsx(xs,{pagination:k,pageKey:o,perPageKey:i,pageSizeOptions:c,defaultPerPage:Oe,showPagination:a,showResultCount:d,showPageSize:h}),y==="right"&&We,Fe&&e.jsx(Mn,{views:ue.views,onApply:ue.applyView,onDelete:ue.deleteView,onSave:ue.saveView}),L.length>0&&e.jsx(En,{columns:ie.orderedColumns,allVisible:ie.allVisible,onToggle:ie.toggleVisibility,onReorder:ie.reorder,onSetAllHidden:ie.setAllHidden})]})]}):e.jsx(ps,{withPadding:t,configs:r,activeKeys:_,configByKey:J,hasActiveFilter:te,toggleFilter:xe,removeFilter:he,getValue:se,setValue:Z,clearValue:Q,onReset:de,searchable:g,searchKey:m,filterKey:n,pageKey:o,searchPlaceholder:j,searchShortcut:E,searchCollapsible:M,pagination:k,perPageKey:i,pageSizeOptions:c,defaultPerPage:Oe,showPagination:a,showResultCount:d,showPageSize:h,hasColumns:L.length>0,orderedColumns:ie.orderedColumns,allVisible:ie.allVisible,onToggleVisibility:ie.toggleVisibility,onReorder:ie.reorder,onSetAllHidden:ie.setAllHidden,showSavedViews:Fe,savedViews:ue.views,onApplyView:ue.applyView,onDeleteView:ue.deleteView,onSaveView:ue.saveView})},bs=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},vs=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},Cs=(t,r)=>{switch(t.type){case"dropdown":case"radio":return bs(r);case"dropdown-multiple":case"checkbox-multiple":return vs(r);case"date":return r instanceof Date?r.toISOString():void 0;case"date-compact":return r;default:return}},Ur=(t,r)=>{if(t==null||t==="")return r;const n=Number(t);return Number.isFinite(n)&&n>0?n:r},ws=t=>{const{filterConfigs:r,filterKey:n="filter",activeFilterKey:s="filters",pageKey:o="page",perPageKey:i="perPage",searchKey:c="q",defaultPage:l=1,defaultPerPage:a=10,paramKeys:d,serialize:h}=t,{activeKeys:g,configByKey:m,hasActiveFilter:j,getValue:E}=fr({configs:r,filterKey:n,activeFilterKey:s,pageKey:o,searchKey:c}),{searchParams:y}=Se(),M=y.toString();return u.useMemo(()=>{const L={},C={},b=Ur(y.get(o),l),A=Ur(y.get(i),a);L[(d==null?void 0:d.page)??"page"]=b,L[(d==null?void 0:d.perPage)??"perPage"]=A;const W=Tt(c,y,n)||"";W&&(L[(d==null?void 0:d.search)??"search"]=W);let v=!1;for(const F of g){const z=m[F];if(!z)continue;const R=E(z);C[F]=R;const _=h==null?void 0:h[F],J=_?_(R):Cs(z,R);if(J==null||Array.isArray(J)&&J.length===0)continue;const te=(d==null?void 0:d[F])??F;L[te]=J,v=!0}return{params:L,raw:C,hasActiveFilter:j||!!W||v}},[M,g.join("|"),n,s,o,i,c,l,a,d,h,m])},Ds=["dropdown","dropdown-multiple","checkbox-multiple","radio"],Ss=({filterConfigs:t,filterKey:r,activeFilterKey:n,pageKey:s,searchKey:o})=>{const{configByKey:i,getValue:c,setValue:l,removeFilter:a,clearAll:d,hasActiveFilter:h}=fr({configs:t,filterKey:r,activeFilterKey:n,pageKey:s,searchKey:o}),g=(k,L)=>{var b;const C=k.options;return((b=C==null?void 0:C.find(A=>A.value===L))==null?void 0:b.label)??L},m=u.useCallback(k=>{const L=i[k];if(!L)return[];const C=c(L);return Array.isArray(C)?C.map(b=>String(b.value)):[]},[i,c]),j=u.useCallback((k,L)=>{const C=i[k];if(!C||!Ds.includes(C.type))return;const b=Array.isArray(L)?L:[L];if(b.length===0){a(k);return}l(C,b.map(A=>({label:g(C,A),value:A})))},[i,l,a]),E=u.useCallback((k,L)=>{const C=m(k);j(k,C.includes(L)?C.filter(b=>b!==L):[...C,L])},[m,j]),y=u.useCallback((k,L)=>m(k).includes(L),[m]),M=u.useCallback(k=>a(k),[a]);return{set:j,toggle:E,clear:M,clearAll:d,isActive:y,values:m,hasActiveFilter:h}},ks=(t,r)=>{if(!t)return{};const{fromKey:n,toKey:s,opKey:o}=r,i={};switch(t.op){case"is":case"is-before":case"is-after":case"is-on-or-before":case"is-on-or-after":return t.date&&(i[n]=new Date(t.date).toISOString()),o&&(i[o]=t.op),i;case"is-between":return t.from&&(i[n]=new Date(t.from).toISOString()),t.to&&(i[s]=new Date(t.to).toISOString()),i;case"is-relative-to-today":{if(!t.relative)return i;const{from:c,to:l}=Sn(t.relative);return i[n]=c.toISOString(),i[s]=l.toISOString(),i}case"is-empty":case"is-not-empty":return o&&(i[o]=t.op==="is-empty"?"empty":"not-empty"),i;default:return i}},Ln=({children:t,borderRadius:r,height:n})=>{const s=u.useRef(null),[o,i]=u.useState("100vh");return u.useEffect(()=>{if(n)return;const c=()=>{if(s.current){const l=s.current.getBoundingClientRect().top;i(`calc(100vh - ${l}px)`)}};return c(),window.addEventListener("resize",c),()=>window.removeEventListener("resize",c)},[n]),e.jsx(f.Box,{ref:s,fullWidth:!0,borderStyle:"border-solid",borderWidth:"border",borderColor:"border-base",borderRadius:r||"rounded-xs",style:{height:n??o,display:"flex",flexDirection:"column"},children:t})},In=({action:t,rightContent:r,leftContent:n,headerSlot:s,advanceFilter:o,showFilter:i=!0})=>{const c=ge.useMediaQuery("md"),l=i?e.jsx(Dn,{...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:g,onClick:m},j)=>!d&&!h?null:e.jsx(V.Button,{fullWidth:!c,iconLeft:h?e.jsx(B.Icon,{name:h}):void 0,onClick:m,...g,children:d},`action-${j}`))}):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:s?s({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()]})]})})},Bs=({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(Ie.Body1,{props:{color:"gray-500"},children:["Total data:"," "]}),e.jsx(Ie.Body1,{children:t||0})]}),Tn=({pagination:t,pageKey:r="page",perPageKey:n="perPage",defaultPerPage:s=10,showPagination:o=!0,totalData:i})=>{const{searchQueries:c,setSearchParams:l,searchParams:a}=Se(),d=a.get(n),h=E=>{l({...c,[r]:String(E)})},g=E=>{l({...c,[n]:E,[r]:"1"})},m=(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),j=(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(ot.Dropdown,{dropdownLists:[{label:"5",value:"5"},{label:"10",value:"10"},{label:"25",value:"25"},{label:"50",value:"50"},{label:"100",value:"100"}],onChange:E=>{g(E[0].value)},value:d?[{label:`${d} per row`,value:d}]:[{label:`${s} per row`,value:`${s}`}],defaultValue:d?[{label:`${d} per row`,value:d}]:[{label:`${s} per row`,value:`${s}`}]}),e.jsx(w.Text,{children:`${m}-${j} of ${(t==null?void 0:t.totalData)||0}`})]}),e.jsx(ut.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(Bs,{totalData:i,withMarginBottom:!1,withMarginTop:!1})})},On=({filter:t,columnTitle:r})=>{const[n,s]=u.useState(!1),o=u.useRef(null),i=u.useRef(null),c=u.useRef(null),[l,a]=u.useState(""),[d,h]=u.useState({top:0,left:0}),g=t.selectedValues,m=u.useMemo(()=>l?t.options.filter(y=>y.label.toLowerCase().includes(l.toLowerCase())):t.options,[t.options,l]);u.useEffect(()=>{if(n&&i.current){const y=i.current.getBoundingClientRect(),M=280,k={top:y.bottom+8};t.position==="left"||y.left+M>window.innerWidth?k.right=window.innerWidth-y.right:k.left=y.left,h(k)}},[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=M=>{o.current&&!o.current.contains(M.target)&&i.current&&!i.current.contains(M.target)&&s(!1)};return n&&document.addEventListener("mousedown",y),()=>document.removeEventListener("mousedown",y)},[n]);const j=y=>{const M=g.includes(y)?g.filter(k=>k!==y):[...g,y];t.onFilterChange(M)},E=()=>t.onFilterChange([]);return e.jsxs(f.Box,{direction:"column",style:{position:"relative"},children:[e.jsx(f.Box,{ref:i,style:{display:"flex",flexDirection:"row",alignItems:"center",cursor:"pointer"},onClick:y=>{var M;y.stopPropagation(),n||(M=t.onOpen)==null||M.call(t),s(k=>!k)},children:e.jsx(B.Icon,{name:n?"ChevronUp":"ChevronDown",size:"sm",style:{color:g.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]}),g.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(),E()},children:"CLEAR"})})]}),!t.hideSearch&&e.jsx(f.Box,{direction:"column",style:{paddingLeft:"16px",paddingRight:"16px",paddingTop:"8px",paddingBottom:"8px"},children:e.jsx(Je.Input,{ref:c,placeholder:`Search ${r.toLowerCase()}...`,leftIcon:e.jsx(B.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(B.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..."})]}):m.length>0?e.jsx(f.Box,{direction:"column",style:{gap:"2px",paddingTop:"4px",paddingBottom:"4px"},children:m.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:g.includes(y.value)?"var(--sa-color-brand-50, #e6edf6)":"transparent"},onClick:M=>{M.stopPropagation(),j(y.value)},onMouseEnter:M=>{g.includes(y.value)||(M.currentTarget.style.backgroundColor="var(--sa-background-primary, #ffffff)"),M.currentTarget.style.transform="translateX(2px)"},onMouseLeave:M=>{M.currentTarget.style.backgroundColor=g.includes(y.value)?"var(--sa-color-brand-50, #e6edf6)":"transparent",M.currentTarget.style.transform="translateX(0)"},children:[e.jsx(lt.Checkbox,{checked:g.includes(y.value),onChange:()=>{}}),e.jsx(w.Text,{fontSize:"sm",fontWeight:g.includes(y.value)?"medium":"normal",color:g.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(B.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"})]})}),g.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:g.length}),e.jsxs(w.Text,{fontSize:"xs",color:"primary",fontWeight:"medium",children:["item",g.length>1?"s":""," selected"]})]})})]})]})},Fs=({direction:t})=>{const r="var(--sa-text-primary, #292a2e)",n="var(--sa-text-subtle, #8c8f97)",s=t==="asc"?r:n,o=t==="desc"?r:n,i=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:s,opacity:i,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"})})]})},Es=({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"})]}),Xt="var(--sa-background-primary, #ffffff)",Jr="var(--sa-background-primary-inverse, #f8f8f8)",Wn=({columns:t,records:r,handleDetail:n,handleUpdate:s,handleDelete:o,isLoading:i,visibleHandleDelete:c,visibleHandleUpdate:l,visibleHandleDetail:a,showHeadBorder:d=!1,scrollParentRef:h,frozenCount:g=0,onFrozenCountChange:m,customActions:j,actionsOrder:E=["detail","update","delete","custom"],customEmptyState:y,enableColumnResize:M=!1,defaultColumnWidths:k,onColumnWidthsChange:L,defaultMinColumnWidth:C=60,sort:b,defaultSort:A,onSortChange:W,showActionDivider:v=!1})=>{const F=b!==void 0,[z,R]=u.useState(A??null),_=F?b??null:z,J=I=>{if(I.sortKey)return I.sortKey;if(typeof I.accessor=="string")return I.accessor},te=I=>{const G=J(I);if(!G)return;let H;!_||_.key!==G?H={key:G,direction:"asc"}:_.direction==="asc"?H={key:G,direction:"desc"}:H=null,F||R(H),W==null||W(H)},he=[n,s,o].filter(I=>I!==void 0).length,se=!!j,Z=!!n||!!s||!!o||se,Q="var(--sa-border-subtle, #0b120e24)",ae=`1px solid ${Q}`,ie=`inset 1px 0 0 ${Q}`,ue=`inset -1px 0 0 ${Q}`,me=he===3?se?"178px":"140px":he===2?se?"140px":"102px":he===1?se?"112px":"74px":se?"74px":"",Te=(I,G)=>{if(!G)return I;if(typeof G=="function")return G(I);if(typeof G=="string")return I[G]},[Oe,Fe]=u.useState(!1);u.useEffect(()=>{if(!(h!=null&&h.current))return;const I=h.current;Fe(I.scrollHeight>I.clientHeight)},[r,h]);const de=u.useRef(null),[fe,We]=u.useState([]),[Ve,Ee]=u.useState(()=>k??{}),Re=u.useRef(null);u.useLayoutEffect(()=>{if(!g||!de.current){We([]);return}const I=Array.from(de.current.querySelectorAll("thead tr th")),G=[];let H=0;I.forEach((q,P)=>{G[P]=H,P<g&&(H+=q.offsetWidth)}),We(G)},[g,t,r,Ve]);const et=I=>{m&&m(I<g?I:I+1)},S=(I,G)=>{const H=Ve[I];if(H!==void 0){const q=`${H}px`;return{width:q,minWidth:q,maxWidth:q}}return G?{width:G}:{}},N=I=>M&&(I.resizable??!0),U=(I,G)=>{I.preventDefault(),I.stopPropagation();const H=I.currentTarget.closest("th");if(!H)return;const q=Math.round(H.getBoundingClientRect().width);Re.current={colIndex:G,startX:I.clientX,startWidth:q};const P=document.body.style.userSelect,pe=document.body.style.cursor;document.body.style.userSelect="none",document.body.style.cursor="col-resize";const De=Be=>{var Qe;const Me=Re.current;if(!Me)return;const Ye=((Qe=t[Me.colIndex])==null?void 0:Qe.minWidth)??C,Ge=Math.max(Ye,Me.startWidth+(Be.clientX-Me.startX));Ee(Pe=>Pe[Me.colIndex]===Ge?Pe:{...Pe,[Me.colIndex]:Ge})},He=()=>{document.removeEventListener("mousemove",De),document.removeEventListener("mouseup",He),document.body.style.userSelect=P,document.body.style.cursor=pe,Re.current=null,L&&Ee(Be=>(L(Be),Be))};document.addEventListener("mousemove",De),document.addEventListener("mouseup",He)};return e.jsx("div",{ref:de,children:e.jsxs(Y.Table,{fullWidth:!0,children:[e.jsx(Y.Thead,{style:{height:"40px",whiteSpace:"nowrap"},children:e.jsxs(Y.Tr,{children:[t.map((I,G)=>{var mt,gt;const H=g>0&&G<g,q=fe[G]??0,P=N(I),De=G===t.length-1&&Z&&v,He=J(I),Be=!!I.sortable&&!!He,Me=Be&&(_==null?void 0:_.key)===He?_.direction:null,Ye=I.title||((mt=I.accessor)==null?void 0:mt.toString())||"",Ge=(gt=I.headerTooltip)!=null&>.showIcon?e.jsx(B.Icon,{name:"InfoCircle",size:"xs",style:{flexShrink:0,color:"var(--sa-icon-subtle, #8c8f97)",opacity:.75}}):null,Qe=e.jsx("span",{style:{flex:1,minWidth:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:Ye}),Pe=Be?e.jsxs("button",{type:"button",onClick:()=>te(I),title:Me==="asc"?"Sorted ascending — click to sort descending":Me==="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:I.textAlign==="text-right"?"right":I.textAlign==="text-center"?"center":"left"},children:[Qe,Ge,e.jsx(Fs,{direction:Me})]}):e.jsxs("span",{style:{flex:1,minWidth:0,display:"flex",alignItems:"center",gap:4},children:[Qe,Ge]});return e.jsxs(Y.Th,{style:{position:"sticky",top:0,left:H?q:void 0,zIndex:H?4:2,paddingLeft:G===0?"12px":"",borderRight:d&&!De&&!H?ae:void 0,borderBottom:d?ae:void 0,boxShadow:d&&H?ue:void 0,backgroundColor:"var(--sa-background-primary-inverse, #f8f8f8)",textAlign:I.textAlign==="text-right"?"right":I.textAlign==="text-center"?"center":"left",...S(G,I.width)},children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"4px",justifyContent:"space-between",minWidth:0},children:[I.headerTooltip?e.jsx(Ce.Tooltip,{label:I.headerTooltip.content,position:"bottom",children:Pe}):Pe,I.filter&&e.jsx(On,{filter:I.filter,columnTitle:I.title}),m&&e.jsx("button",{onClick:()=>et(G),title:H?"Unfreeze column":"Freeze column",style:{background:"none",border:"none",cursor:"pointer",padding:"2px",display:"flex",alignItems:"center",flexShrink:0,color:H?"var(--sa-background-brand, #04254f)":"var(--sa-text-subtle, #8c8f97)",opacity:H?1:.45,transition:"opacity 0.15s"},children:e.jsx(Es,{frozen:H})})]}),P&&e.jsx("div",{onMouseDown:Ne=>U(Ne,G),onClick:Ne=>Ne.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-${G}`)}),Z?e.jsx(Y.Th,{style:{backgroundColor:"var(--sa-background-primary-inverse, #f8f8f8)",position:"sticky",top:0,right:0,zIndex:3,borderBottom:d?ae:void 0,boxShadow:d&&v?ie:void 0}}):null]})}),e.jsx(Y.Tbody,{children:i?e.jsx(Y.Tr,{children:e.jsx(Y.Td,{colSpan:t.length+1,children:e.jsxs(f.Box,{direction:"column",style:{gap:"16px"},children:[e.jsx(ze.Skeleton,{variant:"list"}),e.jsx(ze.Skeleton,{variant:"list"}),e.jsx(ze.Skeleton,{variant:"list"}),e.jsx(ze.Skeleton,{variant:"list"}),e.jsx(ze.Skeleton,{variant:"list"})]})})}):!(r!=null&&r.length)&&y?e.jsx(Y.Tr,{children:e.jsx(Y.Td,{colSpan:t.length+1,children:y})}):r==null?void 0:r.map((I,G)=>e.jsxs(Y.Tr,{style:{transition:"background-color 0.3s ease",padding:0,borderBottom:G===r.length-1&&Oe?void 0:"1px solid var(--sa-border-subtle, #0b120e24)"},onMouseEnter:H=>{const q=H.currentTarget;q.style.backgroundColor=Jr,Array.from(q.querySelectorAll("td")).forEach(P=>{P.style.position==="sticky"&&(P.style.backgroundColor=Jr)})},onMouseLeave:H=>{const q=H.currentTarget;q.style.backgroundColor="",Array.from(q.querySelectorAll("td")).forEach(P=>{P.style.position==="sticky"&&(P.style.backgroundColor=Xt)})},children:[t.map((H,q)=>{const P=H.render?H.render(I,G,r):Te(I,H.accessor),pe=g>0&&q<g,De=fe[q]??0,He=Ve[q]!==void 0,Be=pe&&q===g-1;return e.jsx(Y.Td,{style:{position:pe?"sticky":void 0,left:pe?De:void 0,zIndex:pe?1:void 0,backgroundColor:pe?Xt:void 0,transition:pe?"background-color 0.3s ease":void 0,paddingLeft:q===0?"12px":"",whiteSpace:"nowrap",overflow:He?"hidden":void 0,borderLeft:H.showBorderLeft?ae:void 0,borderRight:H.showBorderRight?ae:void 0,boxShadow:Be?ue:void 0,textAlign:H.textAlign==="text-right"?"right":H.textAlign==="text-center"?"center":"left",...S(q,H.width)},children:typeof P=="string"?e.jsx(w.Text,{style:{whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",textAlign:H.textAlign==="text-right"?"right":H.textAlign==="text-center"?"center":"left"},children:P}):P},`row-${G}-col-${q}`)}),Z?e.jsx(Y.Td,{style:{width:me,position:"sticky",right:0,zIndex:1,backgroundColor:Xt,boxShadow:v?ie:void 0,transition:"background-color 0.3s ease"},children:e.jsx(ne.Flex,{direction:"row",align:"center",justify:"center",gap:"sm",children:E.map(H=>{const q=G===r.length-1?"top":"bottom";return H==="detail"&&n&&(a==null?void 0:a(I))!==!1?e.jsx(Ce.Tooltip,{label:"Detail",position:q,children:e.jsx(V.Button,{size:"xs",variant:"outline",tone:"neutral",onClick:()=>n(I.id,I),iconLeft:e.jsx(B.Icon,{name:"DocumentClean",size:"sm",style:{color:"var(--sa-text-subtle, #8c8f97)"}})})},"detail"):H==="update"&&s&&(l==null?void 0:l(I))!==!1?e.jsx(Ce.Tooltip,{label:"Update",position:q,children:e.jsx(V.Button,{size:"xs",variant:"outline",tone:"neutral",onClick:()=>s(I),iconLeft:e.jsx(B.Icon,{name:"Edit1",size:"sm",style:{color:"var(--sa-text-subtle, #8c8f97)"}})})},"update"):H==="delete"&&o&&(c==null?void 0:c(I))!==!1?e.jsx(Ce.Tooltip,{label:"Delete",position:q,children:e.jsx(V.Button,{size:"xs",variant:"outline",tone:"neutral",onClick:()=>o(I.id,I),iconLeft:e.jsx(B.Icon,{name:"Trash1",size:"sm",style:{color:"var(--sa-color-error-600, #c9184a)"}})})},"delete"):H==="custom"?e.jsx(u.Fragment,{children:j==null?void 0:j(I)},"custom"):null})})}):null]},`${I}${G}`))})]})})},Ms=({wrapperProps:t,dataTableProps:r,headerProps:n,footerProps:s})=>{var g;const o=u.useRef(null),[i,c]=u.useState((r==null?void 0:r.defaultFrozenCount)??0),l=(n==null?void 0:n.show)??!0,a=u.useRef(null),d=(g=r==null?void 0:r.pagination)==null?void 0:g.totalData;typeof d=="number"&&(a.current=d);const h=(s==null?void 0:s.showFooter)??(d===void 0?a.current!==0:d!==0);return e.jsxs(Ln,{...t,children:[l&&e.jsx(In,{...n}),e.jsx(f.Box,{direction:"column",ref:o,style:{flex:1,overflowY:"auto",overflowX:"auto"},children:r?e.jsx(Wn,{...r,scrollParentRef:o,frozenCount:r!=null&&r.enableFreezeColumns?i:0,onFrozenCountChange:r!=null&&r.enableFreezeColumns?c:void 0}):null}),h&&e.jsx(Tn,{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:s==null?void 0:s.totalData})]})};function Ls(t){return u.memo(t)}const Is=Ls(Ms),Yr=200,Kt="1px solid var(--sa-border-subtle, #0b120e24)",Ts=({sortDir:t,frozen:r})=>t==="asc"?e.jsx(B.Icon,{name:"ChevronSmallUp"}):t==="desc"?e.jsx(B.Icon,{name:"ChevronSmallDown"}):r?e.jsx(B.Icon,{name:"LockOn",size:"xs"}):e.jsx(B.Icon,{name:"Filter",size:"xs"}),vt=({icon:t,label:r,active:n,danger:s,onClick:o})=>{const i=s?"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:i,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(B.Icon,{name:t,size:"sm",style:{color:i,flexShrink:0}}),e.jsx(w.Text,{as:"span",style:{color:i},children:r})]})},Rn=({active:t,canSort:r,canHide:n,sortDir:s,frozen:o,onSort:i,onClearSort:c,onToggleFreeze:l,onHide:a})=>{const[d,h]=u.useState(!1),g=u.useRef(null),m=u.useRef(null),[j,E]=u.useState({top:0,left:0});u.useEffect(()=>{if(d&&g.current){const M=g.current.getBoundingClientRect(),k=M.left+Yr>window.innerWidth;E({top:M.bottom+6,...k?{right:window.innerWidth-M.right}:{left:M.left}})}},[d]),u.useEffect(()=>{if(!d)return;const M=k=>{m.current&&!m.current.contains(k.target)&&g.current&&!g.current.contains(k.target)&&h(!1)};return document.addEventListener("mousedown",M),()=>document.removeEventListener("mousedown",M)},[d]);const y=M=>{M(),h(!1)};return e.jsxs(e.Fragment,{children:[e.jsx("button",{ref:g,type:"button",className:"sa-tl-menu-trigger","data-active":t||d?"true":"false",onClick:M=>{M.stopPropagation(),h(k=>!k)},title:"Column options",style:{display:"inline-flex",alignItems:"center",justifyContent:"center",width:22,height:22,borderRadius:"var(--sa-radii-sm, 6px)",border:Kt,background:"var(--sa-background-primary, #ffffff)",cursor:"pointer",color:"var(--sa-text-subtle, #8c8f97)",flexShrink:0},children:e.jsx(Ts,{sortDir:s,frozen:o})}),d&&e.jsxs(f.Box,{ref:m,onClick:M=>M.stopPropagation(),style:{position:"fixed",top:`${j.top}px`,...j.left!==void 0?{left:`${j.left}px`}:{right:`${j.right}px`},minWidth:Yr,backgroundColor:"var(--sa-background-primary, #ffffff)",border:Kt,borderRadius:"var(--sa-radii-sm, 6px)",boxShadow:"0 6px 24px rgba(0,0,0,0.12)",zIndex:9999,padding:"4px",display:"flex",flexDirection:"column"},children:[r&&e.jsxs(e.Fragment,{children:[e.jsx(vt,{icon:"ChevronUp",label:"Ascending",active:s==="asc",onClick:()=>y(()=>s==="asc"?c():i("asc"))}),e.jsx(vt,{icon:"ChevronDown",label:"Descending",active:s==="desc",onClick:()=>y(()=>s==="desc"?c():i("desc"))}),e.jsx("div",{style:{borderTop:Kt,margin:"4px 0"}})]}),e.jsx(vt,{icon:"Pin1",label:o?"Unfreeze":"Freeze",active:o,onClick:()=>y(l)}),n&&e.jsx(vt,{icon:"EyeClosed",label:"Hide column",danger:!0,onClick:()=>y(a)})]})]})},Ct="1px solid var(--sa-border-subtle, #0b120e24)",Os="var(--sa-text-subtle, #8c8f97)",at="var(--sa-background-neutral, #f0f1f2)",Xr="2px 0 4px -2px rgba(0,0,0,0.15)",wt={display:"block",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},Kr="sa-table-layout-styles",Ws=()=>{if(typeof document>"u"||document.getElementById(Kr))return;const t=document.createElement("style");t.id=Kr,t.textContent=`
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const Pr=require("@starasia/alert"),Je=require("@starasia/badges"),f=require("@starasia/box"),it=require("@starasia/breadcrumb"),V=require("@starasia/button"),Nr=require("@starasia/card"),et=require("@starasia/date"),We=require("@starasia/dialog"),Ot=require("@starasia/drawer"),ct=require("@starasia/dropdown"),je=require("@starasia/hooks"),at=require("@starasia/http"),Ye=require("@starasia/input"),O=require("@starasia/menu"),gt=require("@starasia/pagination"),mt=require("@starasia/storage"),Z=require("@starasia/table"),_r=require("@starasia/tabs"),hr=require("@starasia/textarea"),lt=require("@starasia/theme"),qr=require("@starasia/toast"),dt=require("@starasia/toggle"),we=require("@starasia/tooltip"),Ze=require("@starasia/checkbox"),fr=require("@starasia/radio"),D=require("@starasia/text"),B=require("@starasia/icon"),oe=require("@starasia/flex"),Zr=require("@starasia/grid"),Gr=require("@starasia/progress"),Qr=require("@starasia/stepper"),Ur=require("@starasia/accordion"),Jr=require("@starasia/story-record"),Oe=require("@starasia/skeleton"),Yr=require("@starasia/progress-stepper"),e=require("react/jsx-runtime"),u=require("react"),be=require("react-router"),yr=require("react-dom"),Fo=require("react-easy-crop"),Eo={menus:[],menuBottom:void 0,logo:"",appName:"Workspace",userData:null,setUserData:()=>{}},pr=u.createContext(Eo),jr=()=>u.useContext(pr),Cn=t=>{const[r,n]=u.useState((t==null?void 0:t.initialUserData)||null);return{userData:r,setUserData:n}},wn=u.createContext({badges:{},setBadge:()=>{},setBadges:()=>{},clearBadge:()=>{}}),Dn=({children:t})=>{const[r,n]=u.useState({}),s=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}})},[]),i=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:s,clearBadge:i}),[r,o,s,i]);return e.jsx(wn.Provider,{value:c,children:t})},Sn=()=>u.useContext(wn),Lt=(t,r)=>{const n=r!==void 0?r:t;return n==null?null:typeof n=="string"||typeof n=="number"?{value:n}:n},kn=({router:t,menus:r=[],menuBottom:n,logo:s,appName:o="Workspace",initialUserData:i,theme:c})=>{const l=Cn({initialUserData:i}),{theme:a}=lt.useTheme();return e.jsx(pr.Provider,{value:{logo:s,appName:o,menus:r,userData:l.userData,setUserData:l.setUserData,menuBottom:n},children:e.jsx(Dn,{children:c?e.jsx(lt.ThemeProvider,{value:c,children:t}):a?e.jsx(lt.ThemeProvider,{value:a,children:t}):t})})},Mo=u.memo(kn);function Bn({collapsed:t=!1,children:r}){if(!r)return null;const n=typeof r=="function",s=n?r({collapsed:t}):r;return s==null||s===!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?s:e.jsx("div",{style:{opacity:t?0:1,transition:"opacity 0.3s",visibility:t?"hidden":"visible"},children:s})})}const br=u.createContext(null);function Fn({children:t}){const[r,n]=u.useState(null),[s,o]=u.useState(null),[i,c]=u.useState(null),[l,a]=u.useState(0),d=u.useCallback(()=>(a(h=>h+1),()=>a(h=>h-1)),[]);return e.jsx(br.Provider,{value:{prependNode:r,appendNode:s,replaceNode:i,setPrependNode:n,setAppendNode:o,setReplaceNode:c,replaceCount:l,registerReplace:d},children:t})}function En({children:t}){const r=u.useContext(br);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 Lo({children:t,mode:r="append"}){const n=u.useContext(br);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 s=r==="prepend"?n.prependNode:r==="replace"?n.replaceNode:n.appendNode;return s?yr.createPortal(t,s):null}const vr=u.createContext(null);function Mn({children:t}){const[r,n]=u.useState({}),[s,o]=u.useState({}),i=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:i,slotCounts:s,registerSlot:c}),[r,i,s,c]);return e.jsx(vr.Provider,{value:l,children:t})}function Ln({slotKey:t,fallback:r}){const n=u.useContext(vr),s=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 i=u.useCallback(c=>{var l;return(l=o.current)==null?void 0:l.call(o,t,c)},[t]);return e.jsx(e.Fragment,{children:s?e.jsx("div",{ref:i,style:{display:"contents"}}):r})}function To({slotKey:t,children:r}){const n=u.useContext(vr),s=u.useRef(n==null?void 0:n.registerSlot);if(s.current=n==null?void 0:n.registerSlot,u.useEffect(()=>{var i;return(i=s.current)==null?void 0:i.call(s,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?yr.createPortal(r,o):null}const Wt="moduleSwitcherGroupId",mr="sa-module-switcher-change";function Xr(){if(typeof window>"u")return null;const t=window.localStorage.getItem(Wt);if(t===null)return null;const r=Number(t);return Number.isFinite(r)?r:null}function Tn(t){typeof window>"u"||(t===null?window.localStorage.removeItem(Wt):window.localStorage.setItem(Wt,String(t)),window.dispatchEvent(new CustomEvent(mr,{detail:t})))}function Io(){Tn(null)}function Cr(){const[t,r]=u.useState(()=>Xr());return u.useEffect(()=>{const s=()=>{r(Xr())},o=i=>{i.key===Wt&&s()};return window.addEventListener(mr,s),window.addEventListener("storage",o),()=>{window.removeEventListener(mr,s),window.removeEventListener("storage",o)}},[]),{selectedGroupId:t,setSelectedGroupId:s=>{Tn(s),r(s)}}}let wt=0,$e=!1,Kr=new Set;const $r=()=>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"})]}),en={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 Oo({children:t,headerLeftSlot:r,profile:n,isLoadingProfile:s,onLogout:o,isLoggingOut:i,loadingComponent:c,sidebarHeaderContent:l,headerActions:a,profileRole:d,profileMenuButtons:h,profileMenuItems:g,logoutButton:m}){var fe,He;const[j]=be.useSearchParams(),M=j.get("embed")==="true",p=jr(),{badges:L}=Sn(),S=be.useNavigate(),T=be.useLocation(),C=!je.useMediaQuery("md"),[z,W]=u.useState(!1),[b,F]=u.useState(!1),[N,A]=u.useState(!1),[H,U]=u.useState(!1),[re,ne]=u.useState(()=>new Set(Kr)),[ee,ie]=u.useState(null),{selectedGroupId:K,setSelectedGroupId:Q}=Cr();u.useEffect(()=>{Kr=re},[re]);const ue=u.useRef(null),ce=u.useRef(null);u.useEffect(()=>{const k=ue.current;if(!k)return;const _=()=>{$e||(wt=k.scrollTop)};return k.addEventListener("scroll",_),()=>k.removeEventListener("scroll",_)},[]);const xe=()=>{const k=ue.current;k&&wt>0&&($e=!0,k.scrollTop=wt,requestAnimationFrame(()=>{$e=!1}))};u.useLayoutEffect(()=>{$e=!0,xe();const k=setTimeout(()=>{$e=!1},300);return()=>clearTimeout(k)},[]),u.useLayoutEffect(()=>{p.menus.length>0&&(wt>0?xe():requestAnimationFrame(()=>{var _;const k=(_=ue.current)==null?void 0:_.querySelector("[data-menu-active='true']");k&&k.scrollIntoView({block:"center",behavior:"instant"})}))},[p.menus]),u.useEffect(()=>{$e=!0,xe();const k=setTimeout(xe,0),_=setTimeout(xe,50),G=setTimeout(xe,100),I=setTimeout(xe,200),q=setTimeout(()=>{$e=!1},300),R=setTimeout(()=>{const P=ue.current,Y=P==null?void 0:P.querySelector("[data-menu-active='true']");if(P&&Y){const ve=P.getBoundingClientRect(),Se=Y.getBoundingClientRect();Se.top>=ve.top&&Se.bottom<=ve.bottom||Y.scrollIntoView({block:"center",behavior:"smooth"})}},250);return()=>{clearTimeout(k),clearTimeout(_),clearTimeout(G),clearTimeout(I),clearTimeout(q),clearTimeout(R)}},[T.pathname]),u.useEffect(()=>{ce.current&&(ce.current.scrollTop=0)},[T.pathname]),u.useEffect(()=>{C&&A(!1)},[T.pathname,C]),u.useEffect(()=>{C&&F(!0)},[C]);const ge=()=>{W(!0)},ze=()=>{W(!1)},Ae=()=>{W(!1),o()},Ve=k=>{const _=[k.to];return k.children&&_.push(...k.children.map(G=>G.to)),_},Ee=[...p.menus.flatMap(k=>k.items.flatMap(Ve)),...((fe=p.menuBottom)==null?void 0:fe.flatMap(Ve))??[]],he=k=>{if(!T.pathname.startsWith(k))return!1;const _=Ee.filter(G=>T.pathname.startsWith(G)).sort((G,I)=>I.length-G.length)[0];return k===_};u.useEffect(()=>{var _;const k=G=>{var I;(I=G.children)!=null&&I.some(q=>T.pathname.startsWith(q.to))&&ne(q=>{const R=new Set(q);return R.add(G.id),R})};p.menus.forEach(G=>{G.items.forEach(k)}),(_=p.menuBottom)==null||_.forEach(k)},[T.pathname,p.menus,p.menuBottom]);const Te=k=>{ne(_=>{const G=new Set(_);return G.has(k)?G.delete(k):G.add(k),G})};u.useEffect(()=>{p.menus.length!==0&&K!==null&&!p.menus.some(k=>k.id===K)&&Q(null)},[p.menus,K,Q]);const _e=u.useMemo(()=>{if(K!==null)return p.menus.filter(G=>G.id===K||G.parentGroupId===K);const k=p.menus.filter(G=>G.parentGroupId===void 0),_=p.menus.filter(G=>G.parentGroupId!==void 0).flatMap(G=>G.items);return _.length===0?k:[...k,{id:18,name:"Pengaturan",items:_,parentGroupId:void 0}]},[p.menus,K]);if(M)return e.jsx("main",{style:{height:"100vh",overflowY:"auto",backgroundColor:"var(--sa-background-primary-inverse, #f8f8f8)"},children:t||e.jsx(be.Outlet,{})});const Ie=k=>{const _=k.children&&k.children.length>0,G=re.has(k.id),I=_?k.children.some(P=>he(P.to)):he(k.to),q=Lt(k.badge,L[k.id]),R=!!q&&b&&!C;return e.jsxs("div",{"data-menu-active":I||void 0,children:[e.jsxs("button",{onClick:P=>{if(_)if(b&&!C){const Y=P.currentTarget.getBoundingClientRect();ie({item:k,top:Y.top,left:Y.right+8})}else Te(k.id);else S(k.to)},style:{width:"100%",display:"flex",alignItems:"center",justifyContent:b&&!C?"center":void 0,gap:"0.5rem",paddingLeft:b&&!C?"0":"0.5rem",paddingRight:b&&!C?"0":"0.5rem",paddingTop:"0.25rem",paddingBottom:"0.25rem",height:"2rem",borderRadius:I?"var(--sa-radii-sm, 0.375rem)":"var(--sa-radii-md, 0.5rem)",textAlign:"left",border:I?"1px solid var(--sa-border-subtle, #0b120e24)":"1px solid transparent",backgroundColor:I?"var(--sa-background-primary, #ffffff)":"transparent",color:"var(--sa-text-primary, #292a2e)",cursor:"pointer"},title:b&&!C?k.title:void 0,onMouseEnter:P=>{I||(P.currentTarget.style.backgroundColor="var(--sa-background-neutral, #f0f1f2)")},onMouseLeave:P=>{I||(P.currentTarget.style.backgroundColor="transparent")},children:[e.jsxs("span",{style:{position:"relative",display:"inline-flex",flexShrink:0},children:[e.jsx(B.Icon,{name:k.icon,size:"sm",style:{flexShrink:0}}),R&&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)"}})]}),(!b||C)&&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:k.title}),q&&e.jsx(Je.Badges,{text:String(q.value),variant:q.variant??"info",size:"xs",border:!0}),_&&e.jsx("svg",{style:{width:"1rem",height:"1rem",flexShrink:0,transition:"transform 0.2s",transform:G?"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"})})]})]}),_&&(!b||C)&&(()=>{const P=k.children.findIndex(Y=>he(Y.to));return e.jsxs("div",{style:{position:"relative",marginLeft:"0.9375rem",paddingLeft:"1.125rem",overflow:"hidden",transition:"all 0.3s ease-in-out",maxHeight:G?`${k.children.length*36}px`:"0px",opacity:G?1:0,marginTop:G?"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"}}),P>=0&&e.jsx("span",{"aria-hidden":"true",style:{position:"absolute",left:0,top:`${P*32}px`,width:"1.5px",height:"32px",backgroundColor:"var(--sa-text-primary, #292a2e)",transition:"top 0.2s ease-in-out",pointerEvents:"none",zIndex:1}}),k.children.map(Y=>{const ve=Lt(Y.badge,L[Y.id]);return e.jsxs("button",{onClick:()=>S(Y.to),style:{width:"100%",display:"flex",alignItems:"center",gap:"0.5rem",paddingLeft:"0.75rem",paddingRight:"0.5rem",paddingTop:"0.25rem",paddingBottom:"0.25rem",height:"2rem",borderRadius:he(Y.to)?"var(--sa-radii-sm, 0.375rem)":"var(--sa-radii-md, 0.5rem)",textAlign:"left",backgroundColor:he(Y.to)?"var(--sa-background-primary, #ffffff)":"transparent",color:he(Y.to)?"var(--sa-text-primary, #292a2e)":"var(--sa-text-subtle, #505258)",cursor:"pointer",border:he(Y.to)?"1px solid var(--sa-border-subtle, #0b120e24)":"1px solid transparent"},onMouseEnter:Se=>{he(Y.to)||(Se.currentTarget.style.backgroundColor="var(--sa-background-neutral, #f0f1f2)")},onMouseLeave:Se=>{he(Y.to)||(Se.currentTarget.style.backgroundColor="transparent")},children:[e.jsx(B.Icon,{name:Y.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:Y.title}),ve&&e.jsx(Je.Badges,{text:String(ve.value),variant:ve.variant??"info",size:"xs",border:!0})]},Y.id)})]})})()]},k.id)};return e.jsx(Mn,{children:e.jsxs(Fn,{children:[e.jsxs("div",{style:{display:"flex",height:"100vh",position:"relative","--app-sidebar-width":C?"0px":b?"4.375rem":"16.375rem","--app-footer-zindex":C&&N?"40":"999"},children:[C&&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:()=>A(!1)}),e.jsxs("aside",{style:{width:C?"16.375rem":b?"4.375rem":"16.375rem",position:C?"fixed":"relative",...C&&{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:C?void 0:0},children:[e.jsx("div",{onMouseEnter:()=>U(!0),onMouseLeave:()=>U(!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 k=!C&&b&&!N,_=k&&H;return e.jsxs(e.Fragment,{children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"0.5rem",flex:k?1:void 0,justifyContent:k?"center":void 0,transition:"opacity 0.2s",opacity:_?0:1,pointerEvents:_?"none":"auto"},children:[e.jsx("img",{src:p.logo,alt:"Logo",style:{width:"2rem",height:"2rem",flexShrink:0}}),(!b||N)&&e.jsx("span",{style:{fontWeight:"600",color:"var(--sa-text-primary, #292a2e)",whiteSpace:"nowrap",transition:"opacity 0.3s"},children:p.appName})]}),!C&&!b&&e.jsx("button",{type:"button",onClick:()=>F(!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($r,{})}),k&&e.jsx("button",{type:"button",onClick:()=>F(!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:_?1:0,pointerEvents:_?"auto":"none",transition:"opacity 0.2s"},children:e.jsx("span",{style:{width:"1rem",height:"1rem",display:"inline-flex"},children:e.jsx($r,{})})}),C&&e.jsx("button",{onClick:()=>A(!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(Bn,{collapsed:C?!1:b,children:l}),e.jsx("div",{ref:ue,style:{flex:1,overflowY:"auto",paddingTop:"1rem",paddingBottom:"1rem"},children:_e.map(k=>e.jsxs("div",{style:{marginBottom:"1rem"},children:[!b||C?k.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:k.name}):k.name&&e.jsx("div",{"aria-label":k.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:k.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:k.slotKey?e.jsx(Ln,{slotKey:k.slotKey,fallback:k.items.map(_=>Ie(_))}):k.items.map(_=>Ie(_))})]},k.id))}),p.menuBottom&&p.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:p.menuBottom.map(k=>Ie(k))})]}),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:C?"1rem":void 0},children:[C&&e.jsx("button",{onClick:()=>A(!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(En,{children:r})]}),e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"0.75rem"},children:[a,e.jsxs(O.Menu,{position:"bottom-right",children:[e.jsx(O.MenuButton,{children:e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"0.5rem",cursor:"pointer"},children:[e.jsxs("div",{style:{textAlign:"right",maxWidth:"12.5rem"},children:[e.jsx("p",{style:{margin:0,fontSize:"0.875rem",fontWeight:500,color:"var(--sa-text-subtle, #8c8f97)",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:s?"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:s?"":(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(B.Icon,{name:"ChevronDown",size:"sm",style:{color:"var(--sa-text-subtle, #8c8f97)"}})]})}),e.jsxs(O.MenuLists,{style:{width:"280px",paddingBlock:"12px",paddingInline:"12px",gap:"8px",marginTop:"16px"},children:[e.jsx(O.MenuHeading,{children:e.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:"center",textAlign:"center",paddingBlock:"0.5rem"},children:[e.jsx("div",{style:{width:"4rem",height:"4rem",borderRadius:"9999px",display:"flex",alignItems:"center",justifyContent:"center",color:"var(--sa-background-primary, #ffffff)",fontWeight:600,fontSize:"1.25rem",boxShadow:"var(--sa-shadow-sm, 0 1px 2px 0 #0000000d)",marginBottom:"0.75rem",backgroundColor:"var(--sa-background-brand, #04254f)"},children:((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||g)&&e.jsxs(O.MenuBody,{children:[h==null?void 0:h.map((k,_)=>e.jsx(O.MenuButton,{children:e.jsxs("button",{type:"button",onClick:k.onClick,style:en,onMouseEnter:G=>{G.currentTarget.style.backgroundColor="var(--sa-background-neutral, #f0f1f2)"},onMouseLeave:G=>{G.currentTarget.style.backgroundColor="transparent"},children:[e.jsx(B.Icon,{name:k.icon,size:"md"}),e.jsx("span",{children:k.label})]})},`${k.label}-${_}`)),g]}),m??e.jsx(O.MenuFooter,{children:e.jsx(O.MenuButton,{children:e.jsxs("button",{type:"button",onClick:ge,style:{...en,color:"var(--sa-background-error, #c9184a)",fontWeight:500},onMouseEnter:k=>{k.currentTarget.style.backgroundColor="var(--sa-color-error-50, #fff0f3)"},onMouseLeave:k=>{k.currentTarget.style.backgroundColor="transparent"},children:[e.jsx(B.Icon,{name:"Logout",size:"md",style:{color:"var(--sa-background-error, #c9184a)"}}),e.jsx("span",{children:"Logout"})]})})})]})]})]})]}),e.jsx("main",{ref:ce,style:{flex:1,overflowY:"auto"},children:t||e.jsx(be.Outlet,{})})]})]}),i&&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(We.Dialog,{isShow:z,onHide:ze,children:[e.jsx(We.DialogTitle,{children:"Confirmation Logout"}),e.jsx(We.DialogBody,{children:"Are you sure you want to end the session and exit the page?"}),e.jsx(We.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(V.Button,{secondary:!0,onClick:ze,children:"Cancel"})}),e.jsx(f.Box,{direction:"column",children:e.jsx(V.Button,{primary:!0,onClick:Ae,children:"Yes, Sure"})})]})})})]}),ee&&e.jsxs(e.Fragment,{children:[e.jsx("div",{onClick:()=>ie(null),style:{position:"fixed",inset:0,zIndex:60,backgroundColor:"transparent"}}),e.jsxs("div",{role:"dialog","aria-label":ee.item.title,style:{position:"fixed",top:ee.top,left:ee.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:ee.item.title}),(He=ee.item.children)==null?void 0:He.map(k=>{const _=he(k.to),G=Lt(k.badge,L[k.id]);return e.jsxs("button",{onClick:()=>{S(k.to),ie(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:_?"var(--sa-color-gray-100, #f8f8f8)":"transparent",color:_?"var(--sa-text-primary, #292a2e)":"var(--sa-color-gray-800, #505258)",border:"1px solid transparent",cursor:"pointer",fontSize:"0.875rem",fontWeight:500},onMouseEnter:I=>{_||(I.currentTarget.style.backgroundColor="var(--sa-color-gray-100, #f8f8f8)")},onMouseLeave:I=>{_||(I.currentTarget.style.backgroundColor="transparent")},children:[k.icon&&e.jsx(B.Icon,{name:k.icon,size:"sm",style:{flexShrink:0}}),e.jsx("span",{style:{flex:1,whiteSpace:"nowrap"},children:k.title}),G&&e.jsx(Je.Badges,{text:String(G.value),variant:G.variant??"info",size:"xs",border:!0})]},k.id)})]})]})]})})}const pt=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})),tn=({title:t,iconName:r,textColor:n,iconColor:s,hoverTextColor:o,hoverIconColor:i})=>{const[c,l]=u.useState(!1),a=s??"var(--sa-text-subtle, #8c8f97)",d=n??"var(--sa-text-subtle, #8c8f97)",h=i??"var(--sa-text-subtle, #8c8f97)",g=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(B.Icon,{name:r||"ChevronLeft",size:"xs",style:{color:c?h:a,transition:"color 0.15s ease"}}),e.jsx(D.Text,{variant:"sub-h3",style:{color:c?g:d,transition:"color 0.15s ease"},children:t||"Back"})]})},Wo=({items:t,separator:r="/",iconName:n,iconColor:s,hoverIconColor:o})=>{const[i,c]=u.useState(!1),l=s??"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),g=e.jsx(B.Icon,{name:n||"ChevronLeft",size:"xs",onMouseEnter:h?()=>c(!0):void 0,onMouseLeave:h?()=>c(!1):void 0,style:{color:h&&i?a:l,transition:"color 0.15s ease",cursor:h?"pointer":void 0}}),m=d!=null&&d.to?e.jsx(be.Link,{to:d.to,replace:!0,style:{textDecoration:"none"},children:g}):d!=null&&d.onClick?e.jsx(pt,{onClick:d.onClick,children:g}):g;return e.jsxs(f.Box,{direction:"row",gap:"xs",align:"center",children:[m,e.jsx(it.Breadcrumb,{separator:r,size:"md",children:t.map((j,M)=>{const p=M===t.length-1;return j.to&&!p?e.jsx(it.BreadcrumbItem,{children:e.jsx(be.Link,{to:j.to,children:j.label})},M):e.jsx(it.BreadcrumbItem,{currentPage:p,children:e.jsx(it.BreadcrumbLink,{onClick:p?void 0:j.onClick,children:j.label})},M)})})]})},Ro=t=>{const{items:r,separator:n,onClick:s,navigateTo:o,...i}=t;return r&&r.length>0?e.jsx(Wo,{items:r,separator:n,iconName:i.iconName,iconColor:i.iconColor,hoverIconColor:i.hoverIconColor}):o?e.jsx(f.Box,{direction:"row",children:e.jsx(be.Link,{to:o,replace:!0,style:{textDecoration:"none"},children:e.jsx(tn,{...i})})}):e.jsx(f.Box,{direction:"row",children:e.jsx(pt,{onClick:s,children:e.jsx(tn,{...i})})})},nr=[{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 rn(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 nn={fontSize:"11px",fontWeight:500,textAlign:"center",overflowWrap:"normal",wordBreak:"normal",color:"var(--sa-background-primary, #ffffff)",lineHeight:"1.3",maxWidth:"80px"},on={display:"flex",flexDirection:"column",alignItems:"center",gap:"8px",background:"none",border:"none",cursor:"pointer",padding:0};function In({isShow:t,onHide:r,menus:n,selectedGroupId:s,onSelect:o}){const[i,c]=u.useState(void 0),l=d=>{o(d),r()},a=nr[0];return e.jsx(We.Dialog,{isShow:t,onHide:r,style:{width:560,background:"transparent",boxShadow:"none",border:"none"},children:e.jsx(We.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:on,children:[e.jsx("div",{style:rn(s===null,i==="all",a),children:e.jsx("div",{style:{color:a.icon,display:"flex",alignItems:"center",justifyContent:"center"},children:e.jsx(B.Icon,{name:"Grid",size:"lg",style:{width:32,height:32}})})}),e.jsx("span",{style:nn,children:"Semua"})]}),n.map((d,h)=>{var p;const g=s===d.id,m=i===d.id,j=((p=d.items[0])==null?void 0:p.icon)??"Grid",M=nr[(h+1)%nr.length];return e.jsxs("button",{onClick:()=>l(d.id),onMouseEnter:()=>c(d.id),onMouseLeave:()=>c(void 0),style:on,children:[e.jsx("div",{style:rn(g,m,M),children:e.jsx("div",{style:{color:M.icon,display:"flex",alignItems:"center",justifyContent:"center"},children:e.jsx(B.Icon,{name:j,size:"lg",style:{width:32,height:32}})})}),e.jsx("span",{style:nn,children:d.name})]},d.id)})]})})})}function zo({onSelect:t,"aria-label":r="Pilih module"}={}){const n=jr(),s=be.useNavigate(),{selectedGroupId:o,setSelectedGroupId:i}=Cr(),[c,l]=u.useState(!1),a=d=>{var h;if(i(d),d!==null){const g=n.menus.find(j=>j.id===d),m=(h=g==null?void 0:g.items[0])==null?void 0:h.to;m&&s(m)}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(B.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(In,{isShow:c,onHide:()=>l(!1),menus:n.menus.filter(d=>d.parentGroupId===void 0),selectedGroupId:o,onSelect:a})]})}const Ao=(t,r)=>{const n=[];if(r===0)return n.push(t),n;for(let s=0;s<t.length;s+=r){const o=t.slice(s,s+r);n.push(o)}return n},Vo=u.memo(({value:t,label:r,separator:n,labelWidth:s,lastIndex:o,labelAlign:i="top"})=>{const c=u.useMemo(()=>({padding:0,paddingBottom:o?0:12,verticalAlign:i}),[o,i]),l=u.useMemo(()=>({padding:0,paddingRight:12,paddingLeft:12,paddingBottom:o?0:12,verticalAlign:i}),[o,i]),a=()=>typeof r=="string"?e.jsx(D.Text,{fontWeight:"medium",color:"subtlest",children:r}):r,d=()=>typeof t=="string"||typeof t=="number"?e.jsx(D.Text,{color:"primary",fontWeight:"medium",children:t}):t,h=()=>typeof n=="string"||typeof n=="number"?e.jsx(D.Text,{fontWeight:"medium",color:"subtlest",children:n}):n;return e.jsxs(Z.Tr,{children:[e.jsx(Z.Td,{style:c,width:s,children:a()}),n?e.jsx(Z.Td,{style:l,width:24,children:h()}):null,e.jsx(Z.Td,{style:c,children:d()})]})}),Ho=u.memo(({fields:t,separator:r,labelWidth:n})=>e.jsx(Z.Table,{withColumnBorder:!1,withRowBorder:!1,children:t.map((s,o)=>e.jsx(Vo,{separator:r,labelWidth:n,lastIndex:o===t.length-1,...s},`field-group-field-${o}`))})),Po=u.memo(({maxRow:t=0,maxColumn:r=2,separator:n=":",fields:s=[],labelWidth:o=150,bordered:i=!1})=>{const c=u.useMemo(()=>Ao(s,t),[s,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:i?"border":void 0,borderStyle:i?"border-solid":void 0,borderColor:i?"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(Ho,{labelWidth:o,fields:d,separator:n})},h))})}),No=({backButton:t})=>{const[r,n]=u.useState(!1),s=(t==null?void 0:t.iconColor)??"var(--sa-text-subtle, #8c8f97)",o=(t==null?void 0:t.textColor)??"var(--sa-text-subtle, #8c8f97)",i=(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(B.Icon,{name:(t==null?void 0:t.iconName)||"ChevronLeft",size:"xs",style:{color:r?i:s,transition:"color 0.15s ease"}}),e.jsx(D.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"})]})},_o=({backButton:t,title:r,titleIcon:n,titleTag:s,children:o,header:i=!0,headerBorder:c=!1,subHeaders:l,action:a,titleTagProps:d,containerProps:h,headerProps:g})=>{const m=je.useMediaQuery("md"),j=be.useNavigate(),M=be.useLocation(),p=t==null?void 0:t.show,L=()=>{if(typeof(t==null?void 0:t.onClick)=="function"){t.onClick();return}j(-1,{replace:!0})},S=()=>{if(!a)return null;if(u.isValidElement(a))return a;const b=a.filter(F=>F&&(F.title||F.icon));return b.length===0?null:m?e.jsx(f.Box,{direction:"row",gap:"md",children:b.map(({title:F,icon:N,buttonProps:A,onClick:H},U)=>e.jsx(V.Button,{iconLeft:N?e.jsx(B.Icon,{name:N,size:"md"}):void 0,onClick:H,...A,children:F},`action-${U}`))}):e.jsxs(O.Menu,{position:"bottom-right",children:[e.jsx(O.MenuButton,{children:e.jsx(V.Button,{variant:"tertiary",size:"sm",iconLeft:e.jsx(B.Icon,{name:"MenuBurger"}),"aria-label":"Actions"})}),e.jsx(O.MenuLists,{children:e.jsx(O.MenuBody,{style:{minWidth:200},children:b.map(({title:F,icon:N,buttonProps:A,onClick:H},U)=>{const re=(A==null?void 0:A.tone)==="error"||(A==null?void 0:A.danger)===!0;return e.jsx(O.MenuItem,{intent:re?"danger":void 0,disabled:A==null?void 0:A.disabled,startIcon:N?e.jsx(B.Icon,{name:N}):void 0,onClick:H,children:F},`action-${U}`)})})})]})},T=()=>{const b=e.jsx(No,{backButton:t});return t!=null&&t.navigateTo?e.jsx(f.Box,{direction:"row",children:e.jsx(be.Link,{to:t.navigateTo,replace:!0,style:{textDecoration:"none"},children:b})}):e.jsx(f.Box,{direction:"row",children:e.jsx(pt,{onClick:L,children:b})})},w=()=>{const b=!!r,F=Array.isArray(a)&&a.length>0,N=u.isValidElement(a)?!0:F;if(!b&&!N&&!p)return null;const H=m||!m&&F;return e.jsxs(f.Box,{direction:"column",gap:"xs",paddingBlock:(g==null?void 0:g.paddingBlock)??"sm",paddingInline:(g==null?void 0:g.paddingInline)??"md",...g,style:{...c?{boxShadow:"inset 0 -1px 0 0 var(--sa-border-subtle, #0b120e24)"}:{},...g==null?void 0:g.style},children:[p&&T(),(b||N)&&e.jsxs(f.Box,{direction:H?"row":"column",gap:"sm",justify:"space-between",align:H?"center":"flex-start",children:[b?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(B.Icon,{name:n,size:"md",color:"primary"}),e.jsx(D.Text,{variant:"h3",fontWeight:"semibold",fontFamily:"Poppins",children:r})]}),s&&e.jsx(Je.Badge,{border:!0,size:"lg",text:s,...d})]}):r:null,S()]})]})},C=()=>{if(!l||l.length===0)return null;const b=l.filter(A=>A.show!==!1);if(b.length===0)return null;let F=0,N=-1/0;return b.forEach((A,H)=>{const U=A.order??0;U>=N&&(N=U,F=H)}),b.map(({content:A,order:H,borderBottom:U=!0,keepBottomPadding:re=!1},ne)=>e.jsx(f.Box,{direction:"column",paddingTop:"sm",paddingBottom:U||re||ne===F?"sm":"spacing-0",paddingInline:"md",style:{...U?{boxShadow:"inset 0 -1px 0 0 var(--sa-border-subtle, #0b120e24)"}:{},...H!==void 0?{order:H}:{}},children:A},`sub-header-${ne}`))},z=()=>{const b=i?w():null,F=C();return!b&&!F?null:e.jsxs(f.Box,{direction:"column",style:{marginBottom:F?"var(--sa-spacing-0)":"var(--sa-spacing-md)"},children:[b,F]})},W=()=>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:[z(),W()]},M.pathname)},qo=u.memo(_o),Zo={icon:"Cross",title:""},Go="calc(100vw - 16px)",sn=t=>t==null?void 0:`min(${typeof t=="number"?`${t}px`:t}, ${Go})`,On=u.forwardRef(({onHide:t,show:r,withBlur:n=!1,style:s,children:o,closeButton:i=Zo,width:c,minWidth:l="357px",maxWidth:a="357px"},d)=>{const h=sn(c??l),g=sn(c??a);return e.jsx(Ot.Drawer,{blur:n,isShow:r,position:"right",onHide:t,ref:d,style:{minWidth:h,maxWidth:g,...s},children:e.jsxs(f.Box,{direction:"column",padding:"lg",children:[i?e.jsxs(f.Box,{direction:"row",align:"center",gap:"sm",onClick:t,marginBottom:"lg",cursor:"pointer",children:[e.jsx(B.Icon,{name:i.icon,size:"md",color:"subtle",cursor:"pointer"}),i.title?e.jsx(D.Text,{fontFamily:"Poppins",fontSize:"md",color:"subtlest",children:i.title}):null]}):null,o]})})}),wr=u.memo(({children:t,borderBottom:r=!0,padding:n=!0})=>{const s=je.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})}),Dr=u.memo(({children:t,borderTop:r=!0,padding:n=!0})=>{const s=je.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})}),Qo=u.memo(({children:t,...r})=>e.jsx(f.Box,{direction:"column",padding:"md",paddingLeft:"md",paddingRight:"md",gap:"md",...r,children:t})),Uo=u.memo(({children:t,title:r,titleTag:n,action:s,header:o,footer:i,actionContainer:c,containerProps:l,bodyProps:a,headerProps:d={borderBottom:!0},footerProps:h={borderTop:!0},variantTag:g="info"})=>{const m=je.useMediaQuery("lg"),j=()=>n?e.jsxs(f.Box,{direction:"row",gap:"sm",align:"center",children:[e.jsx(D.Text,{fontWeight:"medium",children:r}),e.jsx(Je.Badges,{border:!0,text:n,variant:g})]}):e.jsx(D.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?j():null}),e.jsx(f.Box,{direction:"column",style:m?{width:"100%",maxWidth:"19.313rem"}:{flex:1},...c,children:s??null})]}),p=!!(o||r||s);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&&p?e.jsx(wr,{...d,children:M()}):null,e.jsx(Qo,{...a,children:t}),i?e.jsx(Dr,{...h,children:i}):null]})}),Jo=t=>e.jsx(D.Text,{variant:"h1",children:t.children,...t.props}),Yo=t=>e.jsx(D.Text,{variant:"h2",children:t.children,...t.props}),Xo=t=>e.jsx(D.Text,{variant:"h3",children:t.children,...t.props}),Ko=t=>e.jsx(D.Text,{variant:"h4",children:t.children,...t.props}),$o=t=>e.jsx(D.Text,{variant:"h5",children:t.children,...t.props}),es=t=>e.jsx(D.Text,{variant:"h6",children:t.children,...t.props}),ts=t=>e.jsx(D.Text,{variant:"sub-h1",children:t.children,...t.props}),rs=t=>e.jsx(D.Text,{variant:"sub-h2",children:t.children,...t.props}),ns=t=>e.jsx(D.Text,{variant:"sub-h3",children:t.children,...t.props}),os=t=>e.jsx(D.Text,{variant:"body-1",children:t.children,...t.props}),ss=t=>e.jsx(D.Text,{variant:"body-2",children:t.children,...t.props}),is=t=>e.jsx(D.Text,{variant:"body-3",children:t.children,...t.props}),Re={H1:Jo,H2:Yo,H3:Xo,H4:Ko,H5:$o,H6:es,SubH1:ts,SubH2:rs,SubH3:ns,Body1:os,Body2:ss,Body3:is},Be=()=>{const[t,r]=be.useSearchParams(),n=at.searchParamsToObject(t.toString()),s=be.useParams(),o=be.useLocation(),i=s.id;return{setSearchParams:r,searchParams:t,searchQueries:n,isHasQuery:(h,g)=>t.has(h)&&t.get(h)===g,getQueryParam:h=>t.get(h),getRouteParam:h=>s[h],params:s,location:o,id:i,hasId:!!i}},Wn=t=>JSON.stringify(t),Rn=t=>JSON.stringify(t),zn=t=>JSON.stringify(t),An=t=>JSON.stringify(t),ls=t=>t,cs=t=>JSON.stringify(t),yt=({value:t,name:r,type:n,withSearchParam:s=!0,setSearchParams:o,searchQueries:i,dropdownSearchKey:c,filterKey:l="filter",pageKey:a="page"})=>{if(s){let d;switch(n){case"search":d=ls(t);break;case"dropdown":case"dropdown-multiple":d=Wn(t);break;case"radio":d=Rn(t);break;case"date-range":d=zn(t);break;case"advanced-date-range":d=cs(t);break;case"date":d=An(t);break;default:d=t;break}if(typeof d<"u"){const g={...i[l]&&typeof i[l]=="string"?JSON.parse(i[l]):void 0,[r]:d},m={...i};c&&typeof c=="string"&&delete m[c],delete m[a];const j={...m,[l]:JSON.stringify(g)},M=new URLSearchParams(i).toString(),p=new URLSearchParams(j).toString();if(M===p)return;o(j)}}},Tt=({name:t,filterKey:r="filter",searchParams:n,get:s})=>{const o=n.get(r)||void 0,i=o&&typeof o=="string"?JSON.parse(o):void 0,c=i?i[t]:void 0;return s==="label"&&c?JSON.parse(c)[0].label:s==="value"&&c?JSON.parse(c)[0].value:c},Vn=({name:t,filterKey:r="filter",searchParams:n,get:s})=>{const o=n.get(r)||void 0,i=o&&typeof o=="string"?JSON.parse(o):void 0,c=i?i[t]:void 0;return s==="label"&&c?JSON.parse(c).map(l=>l.label):s==="value"&&c?JSON.parse(c).map(l=>l.value):s==="array"&&c?JSON.parse(c):c},as=({name:t,filterKey:r="filter",searchParams:n,get:s})=>{const o=n.get(r)||void 0,i=o&&typeof o=="string"?JSON.parse(o):void 0,c=i?i[t]:void 0;return s==="id"&&c?JSON.parse(c).id:s==="label"&&c?JSON.parse(c).label:s==="value"&&c?JSON.parse(c).value:c},zt=(t,r,n)=>{const s=r.get(n||"filter")||void 0,o=s&&typeof s=="string"?JSON.parse(s):void 0;return o?o[t]:void 0},ds=({name:t,filterKey:r="filter",searchParams:n})=>{const s=n.get(r||"filter")||void 0,o=s&&typeof s=="string"?JSON.parse(s):void 0,i=o?o[t]:void 0;return{start:i?JSON.parse(i).from:void 0,end:i?JSON.parse(i).to:void 0}},Hn=({name:t,filterKey:r="filter",searchParams:n})=>{const s=n.get(r||"filter")||void 0,o=s&&typeof s=="string"?JSON.parse(s):void 0,i=o?o[t]:void 0;return i?JSON.parse(i):void 0},us=(t,{filterKey:r="filter",perPageKey:n="perPage",pageKey:s="page"})=>{const o=t.get(r)||void 0,i=t.get(n)||void 0,c=t.get(s)||void 0;return!!o||!!i||!!c},Pn=({isOpen:t,onClose:r,filterKey:n,pageKey:s,filters:o})=>{const{searchParams:i,setSearchParams:c,searchQueries:l}=Be(),[a,d]=u.useState({}),h=()=>{i.delete(n||"filter"),c(i)},g=(m,j)=>{switch(m.type){case"radio":{const{show:M=!0}=m;return M&&e.jsx(f.Box,{direction:"column",children:e.jsx(f.Box,{direction:"column",children:m.title})},j)}case"dropdown":{const{show:M=!0}=m;return M&&e.jsx(f.Box,{direction:"column",children:e.jsx(f.Box,{direction:"column",children:m.title})},j)}case"date-range":return e.jsx(f.Box,{direction:"column",children:e.jsx(f.Box,{direction:"column",children:m.title})},j);case"date":return e.jsx(f.Box,{direction:"column",children:e.jsx(f.Box,{direction:"column",children:m.title})},j);case"dropdown-multiple":{const{show:M=!0}=m;return M&&e.jsx(f.Box,{direction:"column",children:e.jsx(f.Box,{direction:"column",children:m.title})},j)}default:return null}};return e.jsx(On,{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((m,j)=>g(m,j))]})})},Nn=({searchKey:t="q",statusKey:r="status",searchPlaceholder:n="Search",searchHighlightPlaceholder:s,extendedFilter:o,showSearchFilter:i=!0,showStatusFilter:c=!0,filterKey:l="filter",pageKey:a="page",customWidthSearch:d,handleOnReset:h,filterConfigs:g,buttonToggleProps:m,position:j="right",titleSearchLabel:M="Work Order",withTitleLabels:p=!1})=>{const S=(m==null?void 0:m.isShowLabel)??!0,[T,w]=u.useState(!1),[C,z]=u.useState(0),W=()=>{z(Q=>Q+1)},{searchParams:b,setSearchParams:F,getQueryParam:N}=Be(),A=at.searchParamsToObject(b.toString()),H=zt(t,b,l)||"",[U,re]=u.useState(H),ne=N(l),ie=!!(ne&&!(()=>{if(ne)try{const Q=JSON.parse(ne);return Object.keys(Q).length===1&&Q[t]===""}catch(Q){console.error("Filter parameter is not a valid JSON:",Q)}return!1})()),K=je.useMediaQuery("md");return u.useEffect(()=>{re(H)},[H]),u.useEffect(()=>{if(U===H)return;const Q=window.setTimeout(()=>{yt({value:U,name:t,type:"search",searchQueries:A,setSearchParams:F,filterKey:l,pageKey:a})},350);return()=>{window.clearTimeout(Q)}},[U,H,t,A,F,l,a]),e.jsxs(oe.Flex,{gap:"md",style:{flexDirection:K&&j==="left"?"row":K&&j==="right"?"row-reverse":"column"},align:"flex-end",children:[ie&&e.jsx(f.Box,{direction:"column",justify:"flex-end",children:e.jsx(V.Button,{onClick:()=>{const Q=new URLSearchParams(b);Q.delete(l),F(Q),re(""),W(),h&&h()},variant:"outline",tone:"neutral",children:e.jsx(D.Text,{color:"error",fontWeight:"semibold",children:"Reset"})})}),o==null?void 0:o.map(({minWidth:Q,content:ue,title:ce,onClickContainer:xe},ge)=>e.jsxs(f.Box,{direction:"column",gap:"sm",onClick:xe,style:{minWidth:Q},children:[ce&&e.jsx(Re.SubH3,{children:ce}),ue]},`extended-filter-${ge}-${C}`)),!!(g!=null&&g.length)&&e.jsx(V.Button,{primary:ie,secondary:!ie,iconLeft:e.jsx(B.Icon,{size:"sm",name:(m==null?void 0:m.icon)||"FilterHorizontal",style:{color:ne?"var(--sa-background-brand, #04254f)":"var(--sa-text-primary, #292a2e)"}}),fullWidth:!K,onClick:()=>w(!0),children:S?"Filter":void 0}),c&&e.jsxs(f.Box,{direction:"column",gap:"sm",style:{minWidth:"126px"},children:[p&&e.jsx(Re.SubH3,{children:"Status"}),e.jsx(ct.Dropdown,{dropdownLists:[{label:"Active",value:"active"},{label:"InActive",value:"inactive"}],defaultValue:Tt({get:"value",name:r,searchParams:b,filterKey:l})?[{label:Tt({get:"value",name:r,searchParams:b,filterKey:l})==="active"?"Active":"InActive",value:Tt({get:"value",name:r,searchParams:b,filterKey:l})}]:[],onChange:Q=>yt({value:Q,name:r,type:"dropdown",searchQueries:A,setSearchParams:F,filterKey:l}),placeholder:p?"All":"All Status"},C)]}),i&&e.jsxs(f.Box,{direction:"column",gap:"sm",style:{width:d&&K?d:K?"310px":""},children:[p&&e.jsxs(Re.SubH3,{children:["Search for ",M]}),e.jsx(Ye.Input,{placeholder:n,leftIcon:e.jsx(B.Icon,{name:"Search",width:20,height:20}),onChange:Q=>re(Q.target.value),value:U,fullWidth:!0},C+1+l)]}),e.jsx(Pn,{isOpen:T,onClose:()=>w(!1),filterKey:l,filters:g,pageKey:a})]})},xs=t=>t==="checkbox-multiple"?"dropdown-multiple":t==="radio"?"dropdown":t==="date-compact"?"date":t;function Sr({configs:t,filterKey:r="filter",activeFilterKey:n="filters",pageKey:s="page",searchKey:o="q"}){const{searchParams:i,setSearchParams:c,searchQueries:l}=Be(),a=u.useMemo(()=>Object.fromEntries(t.map(C=>[C.key,C])),[t]),d=u.useMemo(()=>{const C=(i.get(n)||"").split(",").map(W=>W.trim()).filter(Boolean);let z=[];try{const W=i.get(r);W&&(z=Object.keys(JSON.parse(W)).filter(b=>b!==o))}catch{}return t.map(W=>W.key).filter(W=>{const b=a[W];return(b==null?void 0:b.locked)||C.includes(W)||z.includes(W)})},[i,n,r,o,t,a]),h=u.useCallback(C=>{try{return C[r]?JSON.parse(C[r]):{}}catch{return{}}},[r]),g=u.useCallback(C=>{const z={...l};C.length?z[n]=C.join(","):delete z[n],c(z)},[l,n,c]),m=u.useCallback(C=>{d.includes(C)||g([...d,C])},[d,g]),j=u.useCallback(C=>{var F;if((F=a[C])!=null&&F.locked)return;const z={...l},W=d.filter(N=>N!==C);W.length?z[n]=W.join(","):delete z[n];const b=h(z);C in b&&(delete b[C],Object.keys(b).length?z[r]=JSON.stringify(b):delete z[r]),delete z[s],c(z)},[l,d,n,r,s,h,c,a]),M=u.useCallback(C=>d.includes(C)?j(C):m(C),[d,m,j]),p=u.useCallback(C=>{switch(C.type){case"dropdown":case"dropdown-multiple":case"checkbox-multiple":case"radio":return Vn({name:C.key,get:"array",searchParams:i,filterKey:r})||[];case"date":{const z=Hn({name:C.key,searchParams:i,filterKey:r});return z?new Date(z):void 0}case"date-compact":{const W=h(Object.fromEntries(i.entries()))[C.key];return W&&typeof W=="object"?W:void 0}default:return}},[i,r,h]),L=u.useCallback((C,z)=>{if(C.type==="date-compact"){const W={...l},b=h(W);z==null?delete b[C.key]:b[C.key]=z,Object.keys(b).length?W[r]=JSON.stringify(b):delete W[r],delete W[s],c(W);return}yt({value:z,name:C.key,type:xs(C.type),searchQueries:l,setSearchParams:c,filterKey:r,pageKey:s})},[l,c,r,s,h]),S=u.useCallback(C=>{const z={...l},W=h(z);C in W&&(delete W[C],Object.keys(W).length?z[r]=JSON.stringify(W):delete z[r]),delete z[s],c(z)},[l,r,s,h,c]),T=u.useCallback(()=>{const C={...l};delete C[r],delete C[n],delete C[s],c(C)},[l,r,n,s,c]),w=d.length>0;return{activeKeys:d,configByKey:a,hasActiveFilter:w,addFilter:m,removeFilter:j,toggleFilter:M,getValue:p,setValue:L,clearValue:S,clearAll:T}}const kr={get(t){return mt.storage.get(t)??null},set(t,r){mt.storage.save(t,r)},remove(t){mt.storage.delete(t)}},ut={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}`},Dt=(t,r)=>{const n=new Set(r.map(i=>i.key)),s=t.order.filter(i=>n.has(i));for(const i of r)s.includes(i.key)||s.push(i.key);const o=t.hidden.filter(i=>n.has(i));return{order:s,hidden:o}};function hs({columns:t,scopeId:r,storage:n,onColumnsChange:s,value:o}){const i=u.useMemo(()=>({order:t.map(b=>b.key),hidden:[]}),[t]),c=r?ut.columns(r):void 0,l=(b,F)=>Dt({order:b.order??F,hidden:b.hidden??[]},t),[a,d]=u.useState(()=>{if(o&&(o.order||o.hidden))return l(o,t.map(b=>b.key));if(c){const b=n.get(c);if(b&&Array.isArray(b.order))return Dt(b,t)}return i}),h=t.map(b=>b.key).join("|");u.useEffect(()=>d(b=>Dt(b,t)),[h]);const g=u.useRef(a);g.current=a;const m=o?`${(o.order??[]).join("|")}~${(o.hidden??[]).join("|")}`:null,j=u.useRef(m);u.useEffect(()=>{if(m==null||j.current===m)return;j.current=m;const b=g.current,F=l(o,b.order);F.order.join("|")===b.order.join("|")&&F.hidden.join("|")===b.hidden.join("|")||(d(F),c&&n.set(c,F))},[m,h]);const M=u.useRef(!1);u.useEffect(()=>{M.current||(M.current=!0,s==null||s(a))},[]);const p=u.useCallback(b=>{d(b),c&&n.set(c,b),s==null||s(b)},[c,n,s]),L=u.useMemo(()=>{const b=new Map(t.map(F=>[F.key,F]));return a.order.filter(F=>b.has(F)).map(F=>({...b.get(F),visible:!a.hidden.includes(F)}))},[a,t]),S=u.useCallback(b=>{const F=a.hidden.includes(b)?a.hidden.filter(N=>N!==b):[...a.hidden,b];p({...a,hidden:F})},[a,p]),T=u.useCallback((b,F)=>{if(b===F)return;const N=[...a.order],[A]=N.splice(b,1);N.splice(F,0,A),p({...a,order:N})},[a,p]),w=u.useCallback(b=>{p({...a,hidden:b?t.filter(F=>!F.locked).map(F=>F.key):[]})},[a,t,p]),C=u.useCallback(()=>p(i),[p,i]),z=u.useCallback(b=>p(Dt(b,t)),[p,t]),W=a.hidden.length===0;return{state:a,orderedColumns:L,allVisible:W,toggleVisibility:S,reorder:T,setAllHidden:w,reset:C,applyState:z}}function fs({scopeId:t,storage:r,snapshotKeys:n,pageKey:s="page",getColumns:o,applyColumns:i}){const{searchParams:c,setSearchParams:l}=Be(),a=t?ut.savedViews(t):void 0,[d,h]=u.useState(()=>a?r.get(a)||[]:[]),g=u.useCallback(p=>{h(p),a&&r.set(a,p)},[a]),m=u.useCallback(p=>{const L=p.trim();if(!L)return;const S={};n.forEach(w=>{const C=c.get(w);C!=null&&(S[w]=C)});const T={id:`${Date.now()}`,name:L,query:S,columns:o==null?void 0:o(),createdAt:Date.now()};g([...d,T])},[n,c,o,g,d]),j=u.useCallback(p=>g(d.filter(L=>L.id!==p)),[g,d]),M=u.useCallback(p=>{const L=Object.fromEntries(c.entries());n.forEach(S=>delete L[S]),Object.assign(L,p.query),delete L[s],l(L),p.columns&&(i==null||i(p.columns))},[c,n,s,l,i]);return{enabled:!!a,views:d,saveView:m,deleteView:j,applyView:M}}function ms({scopeId:t,storage:r,snapshotKeys:n,enabled:s=!0}){const{searchParams:o}=Be(),i=t&&s?ut.lastState(t):void 0,c=u.useRef(i),l=u.useRef(!1);u.useEffect(()=>{if(!i){c.current=i;return}if(c.current!==i){c.current=i,l.current=!1;return}const h={};if(n.forEach(g=>{const m=o.get(g);m!=null&&(h[g]=m)}),Object.keys(h).length===0){l.current&&r.remove(i);return}l.current=!0,r.set(i,h)},[o,i,n,r]);const a=u.useCallback(()=>{if(!i)return null;const h=r.get(i);return h&&Object.keys(h).length>0?h:null},[i,r]),d=u.useCallback(()=>{i&&r.remove(i)},[i,r]);return{enabled:!!i,read:a,clear:d}}function gs({scopeId:t,storage:r,perPageKey:n,pageSizeOptions:s,enabled:o=!0}){const{searchParams:i}=Be(),c=t&&o?ut.perPage(t):void 0,l=i.toString(),a=u.useRef(c);u.useEffect(()=>{if(!c){a.current=c;return}if(a.current!==c){a.current=c;return}const g=i.get(n);if(!g)return;const m=Number(g);!Number.isFinite(m)||m<=0||r.set(c,m)},[l,c,n,r]);const d=u.useCallback(()=>{if(!c)return null;const g=r.get(c);if(g==null)return null;const m=Number(g);return!Number.isFinite(m)||m<=0||s&&!s.includes(m)?null:String(m)},[c,r,s]),h=u.useCallback(()=>{c&&r.remove(c)},[c,r]);return{enabled:!!c,read:d,clear:h}}let or={},sr=!1,ir=null;const ys=(t,r)=>{Object.assign(or,t),ir=r,!sr&&(sr=!0,queueMicrotask(()=>{const n=or,s=ir;or={},sr=!1,ir=null,!(!s||Object.keys(n).length===0)&&s(o=>{const i=new URLSearchParams(o);return Object.entries(n).forEach(([c,l])=>i.set(c,l)),i})}))};function ps({enabled:t,snapshotKeys:r,perPageKey:n,readSnapshot:s,readPerPage:o}){const{searchParams:i,setSearchParams:c,location:l}=Be(),a=u.useRef(null);u.useEffect(()=>{if(!t||a.current===l.pathname)return;a.current=l.pathname;const d={};if(!i.has(n)){const h=o();h&&(d[n]=h)}if(!r.some(h=>i.has(h))){const h=s();h&&Object.assign(d,h)}Object.keys(d).length!==0&&ys(d,c)},[l.pathname,t])}const js=({configs:t,activeKeys:r,onToggle:n,hasActiveFilter:s,onReset:o})=>t.length?e.jsxs(O.Menu,{position:"bottom-left",children:[e.jsx(O.MenuButton,{children:e.jsx(V.Button,{variant:s?"secondary":"outline",tone:"neutral",size:"sm",iconLeft:e.jsx(B.Icon,{name:"FilterHorizontal"}),"aria-label":"Add filter"})}),e.jsx(O.MenuLists,{children:e.jsx(O.MenuBody,{style:{minWidth:260},title:e.jsxs(f.Box,{display:"flex",direction:"row",align:"center",justify:"space-between",fullWidth:!0,children:[e.jsx(D.Text,{fontSize:"sm",fontWeight:"medium",color:"subtlest",children:"Add Filter"}),s&&o&&e.jsx(V.Button,{variant:"link",tone:"brand",size:"xs",onClick:o,children:"Reset"})]}),children:t.map(i=>e.jsx(O.MenuItem,{selected:i.locked||r.includes(i.key),disabled:i.locked,closeOnSelect:!1,startIcon:i.icon??void 0,onClick:()=>{i.locked||n(i.key)},children:i.label},i.key))})})]}):null,At=({onClear:t,onRemove:r})=>e.jsxs(O.Menu,{position:"bottom-right",children:[e.jsx(O.MenuButton,{children:e.jsx(V.Button,{variant:"link",tone:"neutral",size:"xs",iconLeft:e.jsx(B.Icon,{name:"MenuHorizontal"}),"aria-label":"Filter actions"})}),e.jsx(O.MenuLists,{children:e.jsxs(O.MenuBody,{style:{width:180},children:[e.jsx(O.MenuItem,{startIcon:e.jsx(B.Icon,{name:"CrossCircle"}),onClick:t,children:"Clear value"}),r&&e.jsx(O.MenuItem,{intent:"danger",startIcon:e.jsx(B.Icon,{name:"Trash1"}),onClick:r,children:"Remove filter"})]})})]}),bs=t=>{const r=new Date(t);return r.setHours(0,0,0,0),r},ln=(t,r,n)=>{const s=new Date(t);return n==="day"?s.setDate(s.getDate()+r):n==="week"?s.setDate(s.getDate()+r*7):n==="month"?s.setMonth(s.getMonth()+r):s.setFullYear(s.getFullYear()+r),s},_n=t=>{const r=bs(new Date);if(t.direction==="this"){const s=new Date(r),o=new Date(r);return t.period==="week"?(s.setDate(r.getDate()-r.getDay()),o.setDate(s.getDate()+6)):t.period==="month"?(s.setDate(1),o.setMonth(o.getMonth()+1,0)):t.period==="year"&&(s.setMonth(0,1),o.setMonth(11,31)),{from:s,to:o}}const n=t.count??1;return t.direction==="past"?{from:ln(r,-n,t.period),to:r}:{from:r,to:ln(r,n,t.period)}},cn=24,qn=t=>t.length>cn?`${t.slice(0,cn)}...`:t,It=t=>t.toLocaleDateString(void 0,{day:"2-digit",month:"short",year:"numeric"}),Rt={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"},vs=["is","is-before","is-after","is-on-or-before","is-on-or-after","is-between","is-relative-to-today","is-empty","is-not-empty"],gr={past:"Past",next:"Next",this:"This"},Cs=["day","week","month","year"],ws=["past","next","this"],Ds=t=>t.field.type==="date-compact"?e.jsx(Bs,{field:t.field,value:t.value,onChange:t.onChange,onClear:t.onClear,onRemove:t.onRemove}):e.jsx(Ss,{field:t.field,value:t.value,onChange:t.onChange,onClear:t.onClear,onRemove:t.onRemove}),Ss=({field:t,value:r,onChange:n,onClear:s,onRemove:o})=>{const i=r?It(new Date(r)):null,c=!!i,l=c?e.jsxs(e.Fragment,{children:[e.jsxs("span",{style:{fontWeight:500},children:[t.label,":"]})," ",e.jsx("span",{style:{fontWeight:400},children:qn(i)})]}):t.label;return e.jsxs(O.Menu,{position:"bottom-left",children:[e.jsx(O.MenuButton,{children:e.jsx(V.Button,{variant:c?"secondary":"outline",tone:"neutral",size:"sm",iconLeft:c?e.jsx(B.Icon,{name:"Calendar",size:"sm"}):void 0,iconRight:e.jsx(B.Icon,{name:"ChevronSmallDown"}),children:l})}),e.jsx(O.MenuLists,{children:e.jsx(O.MenuBody,{style:{width:260},title:e.jsxs(f.Box,{display:"flex",direction:"row",align:"center",justify:"space-between",fullWidth:!0,children:[e.jsx(D.Text,{fontSize:"sm",fontWeight:"medium",color:"subtlest",children:t.label}),e.jsx(At,{onClear:s,onRemove:o})]}),children:e.jsx(et.StarasiaDate,{size:"sm",input:!1,clearable:!0,filter:t.mode,value:r,onChange:a=>a==null?s():n(a),withPadding:!1})})})]})},ks=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?`${Rt[t.op]} ${It(new Date(t.date))}`:null;case"is-between":return t.from&&t.to?`${It(new Date(t.from))} - ${It(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,s=n===1?r.period:`${r.period}s`;return`${gr[r.direction]} ${n} ${s}`}case"is-empty":case"is-not-empty":return Rt[t.op];default:return null}},Bs=({field:t,value:r,onChange:n,onClear:s,onRemove:o})=>{const i=(r==null?void 0:r.op)??"is",c=r?ks(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:qn(c)})]}):t.label,d=h=>{if(h!==i){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(O.Menu,{position:"bottom-left",children:[e.jsx(O.MenuButton,{children:e.jsx(V.Button,{variant:l?"secondary":"outline",tone:"neutral",size:"sm",iconLeft:l?e.jsx(B.Icon,{name:"Calendar",size:"sm"}):void 0,iconRight:e.jsx(B.Icon,{name:"ChevronSmallDown"}),children:a})}),e.jsxs(O.MenuLists,{children:[e.jsx(O.MenuBody,{style:{width:320},title:e.jsxs(f.Box,{display:"flex",direction:"row",align:"center",justify:"space-between",gap:"xs",fullWidth:!0,children:[e.jsxs(f.Box,{display:"flex",direction:"row",align:"center",gap:"xs",style:{minWidth:0},children:[e.jsx(D.Text,{fontSize:"sm",fontWeight:"medium",color:"subtlest",children:t.label}),e.jsx(Fs,{op:i,onChange:d})]}),e.jsx(At,{onClear:s,onRemove:o})]}),children:e.jsx(Es,{value:r,op:i,onChange:n})}),i==="is-relative-to-today"&&e.jsx(O.MenuFooter,{children:e.jsx(D.Text,{fontSize:"xs",color:"subtlest",children:"Filter will update with the current date"})})]})]})},Fs=({op:t,onChange:r})=>e.jsxs(O.Menu,{position:"bottom-left",children:[e.jsx(O.MenuButton,{children:e.jsx(V.Button,{variant:"link",tone:"neutral",size:"xs",iconRight:e.jsx(B.Icon,{name:"ChevronSmallDown"}),children:Rt[t]})}),e.jsx(O.MenuLists,{children:e.jsx(O.MenuBody,{style:{width:200},children:vs.map(n=>e.jsx(O.MenuItem,{selected:t===n,onClick:()=>r(n),endIcon:t===n?e.jsx(B.Icon,{name:"Check"}):void 0,children:Rt[n]},n))})})]}),Es=({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(D.Text,{fontSize:"xs",color:"subtlest",children:"No further input required."})});if(r==="is-between"){const s=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(et.StarasiaDate,{size:"sm",input:!1,clearable:!0,rangedDate:!0,value:s,onChange:o=>{if(o==null){n({op:r});return}if(typeof o=="object"&&o!==null&&"from"in o&&"to"in o){let{from:i,to:c}=o;if(!i&&c&&(i=c,c=null),!i&&!c){n({op:r});return}n({op:r,from:i?i.toISOString():void 0,to:c?c.toISOString():void 0})}},withPadding:!1},"range")}return r==="is-relative-to-today"?e.jsx(Ms,{value:t==null?void 0:t.relative,onChange:s=>n({op:r,relative:s})}):e.jsx(et.StarasiaDate,{size:"sm",input:!1,clearable:!0,value:t!=null&&t.date?new Date(t.date):void 0,onChange:s=>{if(s==null){n({op:r});return}s instanceof Date&&n({op:r,date:s.toISOString()})},withPadding:!1},"single")},Ms=({value:t,onChange:r})=>{const n=(t==null?void 0:t.direction)??"past",s=(t==null?void 0:t.count)??1,o=(t==null?void 0:t.period)??"week",i=n!=="this",c=_n({direction:n,count:s,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(O.Menu,{position:"bottom-left",children:[e.jsx(O.MenuButton,{children:e.jsx(V.Button,{variant:"outline",tone:"neutral",size:"sm",iconRight:e.jsx(B.Icon,{name:"ChevronSmallDown"}),children:gr[n]})}),e.jsx(O.MenuLists,{children:e.jsx(O.MenuBody,{style:{width:140},children:ws.map(l=>e.jsx(O.MenuItem,{selected:n===l,endIcon:n===l?e.jsx(B.Icon,{name:"Check"}):void 0,onClick:()=>r(l==="this"?{direction:l,period:o}:{direction:l,count:s,period:o}),children:gr[l]},l))})})]}),i&&e.jsx(Ye.Input,{type:"number",size:"sm",min:1,clearable:!1,value:s,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(O.Menu,{position:"bottom-left",children:[e.jsx(O.MenuButton,{children:e.jsx(V.Button,{variant:"outline",tone:"neutral",size:"sm",iconRight:e.jsx(B.Icon,{name:"ChevronSmallDown"}),children:o})}),e.jsx(O.MenuLists,{children:e.jsx(O.MenuBody,{style:{width:140},children:Cs.map(l=>e.jsx(O.MenuItem,{selected:o===l,endIcon:o===l?e.jsx(B.Icon,{name:"Check"}):void 0,onClick:()=>r(n==="this"?{direction:n,period:l}:{direction:n,count:s,period:l}),children:l},l))})})]})]}),e.jsx(et.StarasiaDate,{size:"sm",input:!1,disabled:!0,rangedDate:!0,value:c,onChange:()=>{},withPadding:!1},"relative-preview")]})},an=18,Ls=t=>t.length>an?`${t.slice(0,an)}...`:t,Ts=({field:t,value:r,onChange:n,onClear:s,onRemove:o})=>{const i=t.type==="dropdown-multiple",c=r.length,l=t.searchable!==!1,[a,d]=u.useState(""),h=t.options,g=typeof t.onSearch=="function",m=(()=>{if(g)return h;const S=a.trim().toLowerCase();return S?h.filter(T=>T.label.toLowerCase().includes(S)):h})(),j=S=>r.some(T=>T.value===S.value),M=S=>{if(!i){n([{label:S.label,value:S.value}]),d("");return}n(j(S)?r.filter(T=>T.value!==S.value):[...r,{label:S.label,value:S.value}])},p=S=>{var T;d(S),(T=t.onSearch)==null||T.call(t,S)},L=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?Ls(r[0].label):`${c} Selected`})]});return e.jsxs(O.Menu,{position:"bottom-left",children:[e.jsx(O.MenuButton,{children:e.jsx(V.Button,{variant:c>0?"secondary":"outline",tone:"neutral",size:"sm",iconLeft:c>0?e.jsx(B.Icon,{name:"Tag",size:"sm"}):void 0,iconRight:e.jsx(B.Icon,{name:"ChevronSmallDown"}),children:L})}),e.jsx(O.MenuLists,{children:e.jsx(O.MenuBody,{style:{width:260},title:e.jsxs(f.Box,{display:"flex",direction:"row",align:"center",justify:"space-between",fullWidth:!0,children:[e.jsx(D.Text,{fontSize:"sm",fontWeight:"medium",color:"subtlest",children:t.label}),e.jsx(At,{onClear:s,onRemove:o})]}),children:e.jsxs(f.Box,{direction:"column",gap:"sm",children:[l&&e.jsx(ct.Dropdown,{size:"sm",triggerInput:!0,fullWidth:!0,hideChevronIcon:!0,clearable:!0,multiSelect:i,searchAble:!0,searchValue:a,onSearch:p,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(D.Text,{fontSize:"xs",color:"subtlest",children:"Loading…"})}):m.length===0?e.jsx(f.Box,{paddingBlock:"sm",paddingInline:"sm",children:e.jsx(D.Text,{fontSize:"xs",color:"subtlest",children:"No results"})}):m.map(S=>e.jsx(O.MenuItem,{closeOnSelect:!i,selected:j(S),startIcon:S.avatar,endIcon:j(S)?e.jsx(B.Icon,{name:"Check"}):void 0,description:S.description,onClick:()=>M(S),children:S.label},S.value))})]})})})]})},dn=18,Is=t=>t.length>dn?`${t.slice(0,dn)}...`:t,un=({checked:t,indeterminate:r})=>e.jsx("span",{style:{pointerEvents:"none",display:"inline-flex"},children:e.jsx(Ze.Checkbox,{size:"sm",checked:t,readOnly:!0,onChange:()=>{},variant:r?"indeterminate":"select"})}),Os=({field:t,value:r,onChange:n,onClear:s,onRemove:o})=>{const i=new Set(r.map(m=>m.value)),c=r.length,l=t.options.length>0&&t.options.every(m=>i.has(m.value)),a=c>0&&!l,d=m=>{n(i.has(m.value)?r.filter(j=>j.value!==m.value):[...r,{label:m.label,value:m.value}])},h=()=>{n(l?[]:t.options.map(m=>({label:m.label,value:m.value})))},g=c===0?t.label:e.jsxs(e.Fragment,{children:[e.jsxs(D.Text,{as:"span",fontWeight:"semibold",children:[t.label,":"]})," ",e.jsx(D.Text,{as:"span",children:c===1?Is(r[0].label):`${c} Selected`})]});return e.jsxs(O.Menu,{position:"bottom-left",children:[e.jsx(O.MenuButton,{children:e.jsx(V.Button,{variant:c>0?"secondary":"outline",tone:"neutral",size:"sm",iconLeft:c>0?e.jsx(B.Icon,{name:"Tag",size:"sm"}):void 0,iconRight:e.jsx(B.Icon,{name:"ChevronSmallDown"}),children:g})}),e.jsx(O.MenuLists,{children:e.jsxs(O.MenuBody,{style:{width:240},title:e.jsxs(f.Box,{display:"flex",direction:"row",align:"center",justify:"space-between",fullWidth:!0,children:[e.jsx(D.Text,{fontSize:"sm",fontWeight:"medium",color:"subtlest",children:t.label}),e.jsx(At,{onClear:s,onRemove:o})]}),children:[e.jsx(O.MenuItem,{closeOnSelect:!1,selected:l,onClick:h,startIcon:e.jsx(un,{checked:l||a,indeterminate:a}),children:"Select All"}),t.options.map(m=>e.jsx(O.MenuItem,{closeOnSelect:!1,selected:i.has(m.value),onClick:()=>d(m),startIcon:e.jsx(un,{checked:i.has(m.value)}),children:m.label},m.value))]})})]})},Zn=({activeKeys:t,configByKey:r,getValue:n,setValue:s,clearValue:o,removeFilter:i})=>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:()=>i(c);return l.type==="date"||l.type==="date-compact"?e.jsx(Ds,{field:l,value:a,onChange:h=>s(l,h),onClear:()=>o(c),onRemove:d},c):l.type==="checkbox-multiple"?e.jsx(Os,{field:l,value:a||[],onChange:h=>s(l,h),onClear:()=>o(c),onRemove:d},c):e.jsx(Ts,{field:l,value:a||[],onChange:h=>s(l,h),onClear:()=>o(c),onRemove:d},c)})}),xn=t=>`${t} Rows`,Ws=({pagination:t,pageKey:r="page",perPageKey:n="perPage",pageSizeOptions:s=[10,25,50,100],defaultPerPage:o=10,showResultCount:i=!0,showPageSize:c=!0,showPagination:l=!0})=>{var S;const{searchQueries:a,setSearchParams:d,searchParams:h}=Be(),g=h.get(n),m=g?Number(g):o,j=T=>{d({...a,[r]:String(T)})},M=T=>{d({...a,[n]:T,[r]:"1"})},p=(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:0),L=(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:[i&&e.jsx(D.Text,{fontSize:"sm",fontWeight:"medium",color:"primary",truncate:!0,children:`${p}-${L} of ${((S=t==null?void 0:t.totalData)==null?void 0:S.toLocaleString())||0}`}),c&&e.jsxs(O.Menu,{position:"bottom-left",children:[e.jsx(O.MenuButton,{children:e.jsx(V.Button,{variant:"outline",tone:"neutral",size:"sm",iconRight:e.jsx(B.Icon,{name:"ChevronSmallDown"}),"aria-label":"Rows per page",children:xn(m)})}),e.jsx(O.MenuLists,{children:e.jsx(O.MenuBody,{children:s.map(T=>e.jsx(O.MenuItem,{selected:T===m,onClick:()=>M(String(T)),children:xn(T)},T))})})]}),l&&((t==null?void 0:t.totalPage)??0)>1&&e.jsx(f.Box,{direction:"column",display:"flex",align:"center",gap:"sm",paddingRight:"sm",style:{borderRight:"1px solid var(--sa-border-subtle, rgba(11, 18, 14, 0.14))"},children:e.jsx(gt.Pagination,{size:"sm",variant:"neutral",siblingCount:0,currentPage:t!=null&&t.currentPage?Number(t.currentPage):1,totalPages:Number(t==null?void 0:t.totalPage),onPageChange:j})})]})};function Rs(t,r,n=!0){u.useEffect(()=>{if(!n)return;const s=o=>{var l;if(o.metaKey||o.ctrlKey||o.altKey||o.key!==t)return;const i=o.target,c=(l=i==null?void 0:i.tagName)==null?void 0:l.toLowerCase();c==="input"||c==="textarea"||i!=null&&i.isContentEditable||(o.preventDefault(),r())};return window.addEventListener("keydown",s),()=>window.removeEventListener("keydown",s)},[t,r,n])}const zs=240,Gn=({searchKey:t="q",filterKey:r="filter",pageKey:n="page",placeholder:s="Search",shortcut:o="/",collapsible:i=!0})=>{const{searchParams:c,setSearchParams:l,searchQueries:a}=Be(),d=zt(t,c,r)||"",[h,g]=u.useState(!i||!!d),[m,j]=u.useState(i&&!d),[M,p]=u.useState(d),L=je.useDebounce(M,350),S=u.useRef(null);u.useEffect(()=>{p(d),d&&g(!0)},[d]),u.useEffect(()=>{h&&j(!1)},[h]),u.useEffect(()=>{L!==d&&yt({value:L,name:t,type:"search",searchQueries:a,setSearchParams:l,filterKey:r,pageKey:n})},[L]);const T=u.useCallback(()=>{g(!0),requestAnimationFrame(()=>{var W;return(W=S.current)==null?void 0:W.focus()})},[]);Rs(o,T);const w=()=>{i&&!M&&g(!1)},C=W=>{var b;i&&W.key==="Escape"&&!M&&(g(!1),(b=S.current)==null||b.blur())},z=()=>{h||j(!0)};return e.jsxs(f.Box,{display:"flex",direction:"row",align:"center",gap:"spacing-0",children:[m&&e.jsx(V.Button,{variant:"outline",tone:"neutral",size:"sm",iconLeft:e.jsx(B.Icon,{name:"Search",size:"sm"}),"aria-label":"Search","aria-expanded":!1,onClick:T}),e.jsxs(f.Box,{onTransitionEnd:z,style:{position:"relative",width:h?zs:0,overflow:"hidden",transition:"width 220ms ease"},children:[e.jsx(Ye.Input,{ref:S,size:"sm",fullWidth:!0,value:M,placeholder:s,leftIcon:e.jsx(B.Icon,{name:"Search",width:16,height:16}),onChange:W=>p(W.target.value),onKeyDown:C,onBlur:w,tabIndex:h?0:-1}),h&&!M&&e.jsx(f.Box,{align:"center",justify:"center",borderColor:"border-subtle",borderWidth:"border",borderStyle:"border-solid",borderRadius:"rounded-xs",paddingInline:"spacing-1",customBackgroundColor:"var(--sa-background-surface-hover, #f1f2f4)",style:{position:"absolute",right:8,top:"50%",transform:"translateY(-50%)",pointerEvents:"none",minWidth:18,height:18,display:"inline-flex"},children:e.jsx(D.Text,{fontSize:"xs",color:"subtle",children:o})})]})]})},Qn=({columns:t,allVisible:r,onToggle:n,onReorder:s,onSetAllHidden:o})=>{const[i,c]=u.useState(null),[l,a]=u.useState(null),d=()=>{i!==null&&l!==null&&i!==l&&s(i,l),c(null),a(null)},h=(g,m)=>{const j=g+m;j<0||j>=t.length||s(g,j)};return e.jsxs(O.Menu,{position:"bottom-right",children:[e.jsx(O.MenuButton,{children:e.jsx(V.Button,{variant:r?"outline":"secondary",tone:"neutral",size:"sm",iconLeft:e.jsx(B.Icon,{name:"Grid",size:"sm"}),"aria-label":"Customize columns"})}),e.jsx(O.MenuLists,{children:e.jsx(O.MenuBody,{children:e.jsxs(f.Box,{padding:"sm",direction:"column",customWidth:"296px",customMaxHeight:"60vh",overflow:"overflow-hidden",children:[e.jsx(D.Text,{fontWeight:"semibold",color:"primary",children:"Customize Column Table"}),e.jsxs(f.Box,{direction:"row",display:"flex",align:"center",justify:"space-between",paddingBlock:"md",children:[e.jsx(D.Text,{fontSize:"sm",fontWeight:"medium",color:"subtle",children:"Show in table"}),e.jsx(V.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((g,m)=>{const j=!g.locked,M=l===m&&i!==null&&i!==m;return e.jsxs(f.Box,{direction:"row",display:"flex",align:"center",gap:"sm",paddingBlock:"xs",draggable:j,onDragStart:()=>j&&c(m),onDragOver:p=>{p.preventDefault(),a(m)},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:j?0:-1,"aria-label":`Reorder ${g.title}`,"aria-disabled":!j||void 0,color:"icon-subtlest",onKeyDown:p=>{j&&(p.key==="ArrowUp"?(p.preventDefault(),h(m,-1)):p.key==="ArrowDown"&&(p.preventDefault(),h(m,1)))},style:{display:"inline-flex",cursor:j?"grab":"default",opacity:j?1:.4},children:e.jsx(B.Icon,{name:"DragVertical",width:16,height:16})}),g.icon&&e.jsx(f.Box,{direction:"column",align:"center",color:"icon-subtle",style:{display:"inline-flex"},children:g.icon}),e.jsx(D.Text,{fontSize:"sm",fontWeight:"medium",color:"primary",truncate:!0,children:g.title}),e.jsx(f.Box,{direction:"column",style:{marginLeft:"auto"},children:e.jsx(dt.Toggle,{size:"sm",checked:g.visible,disabled:g.locked,onChange:()=>n(g.key),"aria-label":`Toggle ${g.title} column`})})]},g.key)})})]})})})]})},Un=({views:t,onApply:r,onDelete:n,onSave:s})=>{const[o,i]=u.useState(""),c=()=>{const l=o.trim();l&&(s(l),i(""))};return e.jsxs(O.Menu,{position:"bottom-right",children:[e.jsx(O.MenuButton,{children:e.jsx(V.Button,{variant:t.length>0?"secondary":"outline",tone:(t.length>0,"neutral"),size:"sm",iconLeft:e.jsx(B.Icon,{name:"Bookmark",size:"sm"}),"aria-label":"Saved views"})}),e.jsxs(O.MenuLists,{style:{width:"260px"},children:[e.jsx(O.MenuBody,{children:e.jsxs(f.Box,{direction:"column",padding:"xs",gap:"sm",children:[e.jsx(D.Text,{fontWeight:"semibold",color:"primary",children:"Saved Views"}),e.jsx(f.Box,{direction:"column",overflow:"overflow-y-auto",children:t.length===0?e.jsx(f.Box,{direction:"column",paddingBlock:"sm",children:e.jsx(D.Text,{fontSize:"sm",color:"subtlest",children:"No saved views yet"})}):t.map(l=>e.jsx(O.MenuItem,{startIcon:e.jsx(B.Icon,{name:"Bookmark"}),onClick:()=>r(l),endIcon:e.jsx(V.Button,{variant:"link",tone:"error",size:"sm",iconLeft:e.jsx(B.Icon,{name:"Trash2"}),"aria-label":`Delete ${l.name}`,onClick:a=>{a.stopPropagation(),n(l.id)}}),children:l.name},l.id))})]})}),e.jsx(O.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(Ye.Input,{size:"sm",fullWidth:!0,placeholder:"Save current view as…",value:o,onChange:l=>i(l.target.value),onKeyDown:l=>{l.key==="Enter"&&c()}})}),e.jsx(V.Button,{variant:"primary",tone:"brand",size:"sm",disabled:!o.trim(),onClick:c,children:"Save"})]})})]})]})},As=({isOpen:t,onClose:r,configs:n,activeKeys:s,configByKey:o,hasActiveFilter:i,onToggle:c,onReset:l,getValue:a,setValue:d,clearValue:h,removeFilter:g})=>{const m=s.length;return e.jsx(Ot.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(D.Text,{fontWeight:"semibold",color:"primary",children:"Filter"}),m>0&&e.jsxs(D.Text,{fontSize:"sm",color:"subtle",children:["(",m,")"]})]}),e.jsx(V.Button,{variant:"link",tone:"neutral",size:"sm",iconLeft:e.jsx(B.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:[m>0&&e.jsxs(f.Box,{direction:"column",gap:"sm",children:[e.jsx(D.Text,{fontSize:"xs",fontWeight:"medium",color:"subtlest",children:"Filter aktif"}),e.jsx(f.Box,{direction:"row",display:"flex",wrap:"wrap",gap:"sm",align:"center",children:e.jsx(Zn,{activeKeys:s,configByKey:o,getValue:a,setValue:d,clearValue:h,removeFilter:g})})]}),n.length>0&&e.jsxs(f.Box,{direction:"column",gap:"sm",children:[e.jsx(D.Text,{fontSize:"xs",fontWeight:"medium",color:"subtlest",children:"Tambah filter"}),e.jsx(f.Box,{direction:"column",children:n.map(j=>{const M=s.includes(j.key),p=!!j.locked;return e.jsxs(f.Box,{direction:"row",display:"flex",align:"center",justify:"space-between",gap:"sm",paddingBlock:"sm",style:{opacity:p?.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:[j.icon&&e.jsx(f.Box,{direction:"column",align:"center",color:"icon-subtle",style:{display:"inline-flex"},children:j.icon}),e.jsx(D.Text,{fontSize:"sm",color:"primary",truncate:!0,children:j.label})]}),e.jsx(dt.Toggle,{size:"sm",checked:M||p,disabled:p,onChange:()=>c(j.key),"aria-label":`Toggle ${j.label}`})]},j.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(V.Button,{variant:"outline",tone:"neutral",size:"md",fullWidth:!0,disabled:!i,onClick:l,children:"Reset"})}),e.jsx(f.Box,{direction:"column",style:{flex:"1 1 0"},children:e.jsx(V.Button,{variant:"primary",tone:"brand",size:"md",fullWidth:!0,onClick:r,children:"Selesai"})})]})]})})},Vs=t=>`${t} Rows`,Hs=({perPageKey:t,pageKey:r,pageSizeOptions:n,defaultPerPage:s=10,showPageSize:o})=>{const{searchQueries:i,setSearchParams:c,searchParams:l}=Be(),a=l.get(t),d=a?Number(a):s,h=g=>{c({...i,[t]:g,[r]:"1"})};return o?e.jsxs(O.Menu,{position:"bottom-right",children:[e.jsx(O.MenuButton,{children:e.jsx(V.Button,{variant:"outline",tone:"neutral",size:"sm",iconLeft:e.jsx(B.Icon,{name:"MenuVertical",size:"sm"}),"aria-label":"More options"})}),e.jsx(O.MenuLists,{children:e.jsxs(O.MenuBody,{style:{minWidth:200},children:[e.jsx(f.Box,{paddingInline:"sm",paddingBlock:"xs",children:e.jsx(D.Text,{fontSize:"xs",fontWeight:"medium",color:"subtlest",children:"Rows per page"})}),n.map(g=>e.jsx(O.MenuItem,{selected:g===d,endIcon:g===d?e.jsx(B.Icon,{name:"Check"}):void 0,onClick:()=>h(String(g)),children:Vs(g)},g))]})})]}):null},Ps=t=>{var Ie;const{withPadding:r,configs:n,activeKeys:s,configByKey:o,hasActiveFilter:i,toggleFilter:c,removeFilter:l,getValue:a,setValue:d,clearValue:h,onReset:g,searchable:m,searchKey:j,filterKey:M,pageKey:p,searchPlaceholder:L,searchShortcut:S,searchCollapsible:T,pagination:w,perPageKey:C,pageSizeOptions:z,defaultPerPage:W,showPagination:b,showResultCount:F,showPageSize:N,hasColumns:A,orderedColumns:H,allVisible:U,onToggleVisibility:re,onReorder:ne,onSetAllHidden:ee,showSavedViews:ie,savedViews:K,onApplyView:Q,onDeleteView:ue,onSaveView:ce}=t,[xe,ge]=u.useState(!1),{searchQueries:ze,setSearchParams:Ae}=Be(),Ve=(w==null?void 0:w.rangeStart)??(((w==null?void 0:w.currentPage)||0)>1?(((w==null?void 0:w.currentPage)||0)-1)*((w==null?void 0:w.perPage)||0)+1:1),Ee=(w==null?void 0:w.rangeEnd)??((w==null?void 0:w.totalCurrentPage)!==(w==null?void 0:w.perPage)?w==null?void 0:w.totalData:((w==null?void 0:w.currentPage)||1)*((w==null?void 0:w.totalCurrentPage)||0)),he=fe=>{Ae({...ze,[p]:String(fe)})},Te=F||b&&!!(w!=null&&w.totalPage),_e=()=>{g(),ge(!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:[m&&e.jsx(Gn,{searchKey:j,filterKey:M,pageKey:p,placeholder:L,shortcut:S,collapsible:T}),e.jsx(V.Button,{variant:i?"secondary":"outline",tone:"neutral",size:"sm",iconLeft:e.jsx(B.Icon,{name:"FilterHorizontal"}),onClick:()=>ge(!0),"aria-label":"Open filters",children:i?`Filter: ${s.length}`:null}),e.jsxs(f.Box,{direction:"row",display:"flex",align:"center",gap:"sm",style:{marginLeft:"auto"},children:[ie&&e.jsx(Un,{views:K,onApply:Q,onDelete:ue,onSave:ce}),A&&e.jsx(Qn,{columns:H,allVisible:U,onToggle:re,onReorder:ne,onSetAllHidden:ee}),e.jsx(Hs,{perPageKey:C,pageKey:p,pageSizeOptions:z,defaultPerPage:W,showPageSize:N})]})]}),Te&&e.jsxs(f.Box,{direction:"row",display:"flex",align:"center",justify:"space-between",gap:"sm",fullWidth:!0,children:[F?e.jsx(D.Text,{fontSize:"sm",fontWeight:"medium",color:"primary",truncate:!0,children:`${Ve}-${Ee} of ${((Ie=w==null?void 0:w.totalData)==null?void 0:Ie.toLocaleString())||0}`}):e.jsx(f.Box,{direction:"column"}),b&&!!(w!=null&&w.totalPage)&&e.jsx(gt.Pagination,{size:"xs",variant:"neutral",siblingCount:0,currentPage:w!=null&&w.currentPage?Number(w.currentPage):1,totalPages:Number(w.totalPage),onPageChange:he})]}),e.jsx(As,{isOpen:xe,onClose:()=>ge(!1),configs:n,activeKeys:s,configByKey:o,hasActiveFilter:i,onToggle:c,onReset:_e,getValue:a,setValue:d,clearValue:h,removeFilter:l})]})},Ns=({withPadding:t=!1,filterConfigs:r=[],filterKey:n="filter",activeFilterKey:s="filters",pageKey:o="page",perPageKey:i="perPage",pageSizeOptions:c=[25,50,100],defaultPerPage:l,showPagination:a=!0,showResultCount:d=!0,showPageSize:h=!0,searchable:g=!1,searchKey:m="q",searchPlaceholder:j="Search",searchShortcut:M="/",searchPosition:p="right",searchCollapsible:L=!0,pagination:S,columns:T=[],onColumnsChange:w,columnsState:C,scopeId:z,savedViews:W,persistLastState:b=!0,storage:F=kr,onReset:N})=>{const A=z??(W==null?void 0:W.scopeId),{activeKeys:H,configByKey:U,hasActiveFilter:re,toggleFilter:ne,removeFilter:ee,getValue:ie,setValue:K,clearValue:Q,clearAll:ue}=Sr({configs:r,filterKey:n,activeFilterKey:s,pageKey:o,searchKey:m}),ce=hs({columns:T,scopeId:A,storage:F,onColumnsChange:w,value:C}),xe=fs({scopeId:A,storage:F,snapshotKeys:[s,n,i],pageKey:o,getColumns:()=>ce.state,applyColumns:ce.applyState}),ge=ms({scopeId:A,storage:F,snapshotKeys:[s,n,o],enabled:b}),ze=gs({scopeId:A,storage:F,perPageKey:i,pageSizeOptions:c,enabled:b});ps({enabled:b&&!!A,snapshotKeys:[s,n,o],perPageKey:i,readSnapshot:ge.read,readPerPage:ze.read});const Ae=l??c[0]??25,Ve=!!(W!=null&&W.enabled)&&xe.enabled,Ee=()=>{ue(),ge.clear(),N==null||N()},he=je.useMediaQuery("md"),Te=g?e.jsx(Gn,{searchKey:m,filterKey:n,pageKey:o,placeholder:j,shortcut:M,collapsible:L}):null;return he?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(js,{configs:r,activeKeys:H,onToggle:ne,hasActiveFilter:re,onReset:Ee}),p==="left"&&Te,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(Zn,{activeKeys:H,configByKey:U,getValue:ie,setValue:K,clearValue:Q,removeFilter:ee}),re&&e.jsx(V.Button,{variant:"link",tone:"brand",size:"sm",onClick:Ee,children:"Reset"})]})]}),e.jsxs(f.Box,{direction:"row",display:"flex",align:"center",gap:"sm",children:[e.jsx(Ws,{pagination:S,pageKey:o,perPageKey:i,pageSizeOptions:c,defaultPerPage:Ae,showPagination:a,showResultCount:d,showPageSize:h}),p==="right"&&Te,Ve&&e.jsx(Un,{views:xe.views,onApply:xe.applyView,onDelete:xe.deleteView,onSave:xe.saveView}),T.length>0&&e.jsx(Qn,{columns:ce.orderedColumns,allVisible:ce.allVisible,onToggle:ce.toggleVisibility,onReorder:ce.reorder,onSetAllHidden:ce.setAllHidden})]})]}):e.jsx(Ps,{withPadding:t,configs:r,activeKeys:H,configByKey:U,hasActiveFilter:re,toggleFilter:ne,removeFilter:ee,getValue:ie,setValue:K,clearValue:Q,onReset:Ee,searchable:g,searchKey:m,filterKey:n,pageKey:o,searchPlaceholder:j,searchShortcut:M,searchCollapsible:L,pagination:S,perPageKey:i,pageSizeOptions:c,defaultPerPage:Ae,showPagination:a,showResultCount:d,showPageSize:h,hasColumns:T.length>0,orderedColumns:ce.orderedColumns,allVisible:ce.allVisible,onToggleVisibility:ce.toggleVisibility,onReorder:ce.reorder,onSetAllHidden:ce.setAllHidden,showSavedViews:Ve,savedViews:xe.views,onApplyView:xe.applyView,onDeleteView:xe.deleteView,onSaveView:xe.saveView})},_s=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},qs=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},Zs=(t,r)=>{switch(t.type){case"dropdown":case"radio":return _s(r);case"dropdown-multiple":case"checkbox-multiple":return qs(r);case"date":return r instanceof Date?r.toISOString():void 0;case"date-compact":return r;default:return}},hn=(t,r)=>{if(t==null||t==="")return r;const n=Number(t);return Number.isFinite(n)&&n>0?n:r},Gs=t=>{const{filterConfigs:r,filterKey:n="filter",activeFilterKey:s="filters",pageKey:o="page",perPageKey:i="perPage",searchKey:c="q",defaultPage:l=1,defaultPerPage:a=10,paramKeys:d,serialize:h}=t,{activeKeys:g,configByKey:m,hasActiveFilter:j,getValue:M}=Sr({configs:r,filterKey:n,activeFilterKey:s,pageKey:o,searchKey:c}),{searchParams:p}=Be(),L=p.toString();return u.useMemo(()=>{const T={},w={},C=hn(p.get(o),l),z=hn(p.get(i),a);T[(d==null?void 0:d.page)??"page"]=C,T[(d==null?void 0:d.perPage)??"perPage"]=z;const W=zt(c,p,n)||"";W&&(T[(d==null?void 0:d.search)??"search"]=W);let b=!1;for(const F of g){const N=m[F];if(!N)continue;const A=M(N);w[F]=A;const H=h==null?void 0:h[F],U=H?H(A):Zs(N,A);if(U==null||Array.isArray(U)&&U.length===0)continue;const re=(d==null?void 0:d[F])??F;T[re]=U,b=!0}return{params:T,raw:w,hasActiveFilter:j||!!W||b}},[L,g.join("|"),n,s,o,i,c,l,a,d,h,m])},Qs=["dropdown","dropdown-multiple","checkbox-multiple","radio"],Us=({filterConfigs:t,filterKey:r,activeFilterKey:n,pageKey:s,searchKey:o})=>{const{configByKey:i,getValue:c,setValue:l,removeFilter:a,clearAll:d,hasActiveFilter:h}=Sr({configs:t,filterKey:r,activeFilterKey:n,pageKey:s,searchKey:o}),g=(S,T)=>{var C;const w=S.options;return((C=w==null?void 0:w.find(z=>z.value===T))==null?void 0:C.label)??T},m=u.useCallback(S=>{const T=i[S];if(!T)return[];const w=c(T);return Array.isArray(w)?w.map(C=>String(C.value)):[]},[i,c]),j=u.useCallback((S,T)=>{const w=i[S];if(!w||!Qs.includes(w.type))return;const C=Array.isArray(T)?T:[T];if(C.length===0){a(S);return}l(w,C.map(z=>({label:g(w,z),value:z})))},[i,l,a]),M=u.useCallback((S,T)=>{const w=m(S);j(S,w.includes(T)?w.filter(C=>C!==T):[...w,T])},[m,j]),p=u.useCallback((S,T)=>m(S).includes(T),[m]),L=u.useCallback(S=>a(S),[a]);return{set:j,toggle:M,clear:L,clearAll:d,isActive:p,values:m,hasActiveFilter:h}},Js=(t,r)=>{if(!t)return{};const{fromKey:n,toKey:s,opKey:o}=r,i={};switch(t.op){case"is":case"is-before":case"is-after":case"is-on-or-before":case"is-on-or-after":return t.date&&(i[n]=new Date(t.date).toISOString()),o&&(i[o]=t.op),i;case"is-between":return t.from&&(i[n]=new Date(t.from).toISOString()),t.to&&(i[s]=new Date(t.to).toISOString()),i;case"is-relative-to-today":{if(!t.relative)return i;const{from:c,to:l}=_n(t.relative);return i[n]=c.toISOString(),i[s]=l.toISOString(),i}case"is-empty":case"is-not-empty":return o&&(i[o]=t.op==="is-empty"?"empty":"not-empty"),i;default:return i}},Jn=({children:t,borderRadius:r,height:n})=>{const s=u.useRef(null),[o,i]=u.useState("100vh");return u.useEffect(()=>{if(n)return;const c=()=>{if(s.current){const l=s.current.getBoundingClientRect().top;i(`calc(100vh - ${l}px)`)}};return c(),window.addEventListener("resize",c),()=>window.removeEventListener("resize",c)},[n]),e.jsx(f.Box,{ref:s,fullWidth:!0,borderStyle:"border-solid",borderWidth:"border",borderColor:"border-base",borderRadius:r||"rounded-xs",style:{height:n??o,display:"flex",flexDirection:"column"},children:t})},Yn=({action:t,rightContent:r,leftContent:n,headerSlot:s,advanceFilter:o,showFilter:i=!0})=>{const c=je.useMediaQuery("md"),l=i?e.jsx(Nn,{...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:g,onClick:m},j)=>!d&&!h?null:e.jsx(V.Button,{fullWidth:!c,iconLeft:h?e.jsx(B.Icon,{name:h}):void 0,onClick:m,...g,children:d},`action-${j}`))}):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:s?s({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()]})]})})},Ys=({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(Re.Body1,{props:{color:"gray-500"},children:["Total data:"," "]}),e.jsx(Re.Body1,{children:t||0})]}),Xn=({pagination:t,pageKey:r="page",perPageKey:n="perPage",defaultPerPage:s=10,showPagination:o=!0,totalData:i})=>{const{searchQueries:c,setSearchParams:l,searchParams:a}=Be(),d=a.get(n),h=M=>{l({...c,[r]:String(M)})},g=M=>{l({...c,[n]:M,[r]:"1"})},m=(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),j=(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(D.Text,{children:"Rows Per Page: "}),e.jsx(ct.Dropdown,{dropdownLists:[{label:"5",value:"5"},{label:"10",value:"10"},{label:"25",value:"25"},{label:"50",value:"50"},{label:"100",value:"100"}],onChange:M=>{g(M[0].value)},value:d?[{label:`${d} per row`,value:d}]:[{label:`${s} per row`,value:`${s}`}],defaultValue:d?[{label:`${d} per row`,value:d}]:[{label:`${s} per row`,value:`${s}`}]}),e.jsx(D.Text,{children:`${m}-${j} of ${(t==null?void 0:t.totalData)||0}`})]}),e.jsx(gt.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(Ys,{totalData:i,withMarginBottom:!1,withMarginTop:!1})})},Kn=({filter:t,columnTitle:r})=>{const[n,s]=u.useState(!1),o=u.useRef(null),i=u.useRef(null),c=u.useRef(null),[l,a]=u.useState(""),[d,h]=u.useState({top:0,left:0}),g=t.selectedValues,m=u.useMemo(()=>l?t.options.filter(p=>p.label.toLowerCase().includes(l.toLowerCase())):t.options,[t.options,l]);u.useEffect(()=>{if(n&&i.current){const p=i.current.getBoundingClientRect(),L=280,S={top:p.bottom+8};t.position==="left"||p.left+L>window.innerWidth?S.right=window.innerWidth-p.right:S.left=p.left,h(S)}},[n,t.position]),u.useEffect(()=>{n&&c.current?setTimeout(()=>{var p;return(p=c.current)==null?void 0:p.focus()},50):a("")},[n]),u.useEffect(()=>{const p=L=>{o.current&&!o.current.contains(L.target)&&i.current&&!i.current.contains(L.target)&&s(!1)};return n&&document.addEventListener("mousedown",p),()=>document.removeEventListener("mousedown",p)},[n]);const j=p=>{const L=g.includes(p)?g.filter(S=>S!==p):[...g,p];t.onFilterChange(L)},M=()=>t.onFilterChange([]);return e.jsxs(f.Box,{direction:"column",style:{position:"relative"},children:[e.jsx(f.Box,{ref:i,style:{display:"flex",flexDirection:"row",alignItems:"center",cursor:"pointer"},onClick:p=>{var L;p.stopPropagation(),n||(L=t.onOpen)==null||L.call(t),s(S=>!S)},children:e.jsx(B.Icon,{name:n?"ChevronUp":"ChevronDown",size:"sm",style:{color:g.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(D.Text,{fontSize:"sm",fontWeight:"semibold",color:"gray-700",children:["Filter ",r]}),g.length>0&&e.jsx(f.Box,{direction:"column",style:{cursor:"pointer"},children:e.jsx(D.Text,{fontSize:"xs",color:"primary",fontWeight:"semibold",onClick:p=>{p.stopPropagation(),M()},children:"CLEAR"})})]}),!t.hideSearch&&e.jsx(f.Box,{direction:"column",style:{paddingLeft:"16px",paddingRight:"16px",paddingTop:"8px",paddingBottom:"8px"},children:e.jsx(Ye.Input,{ref:c,placeholder:`Search ${r.toLowerCase()}...`,leftIcon:e.jsx(B.Icon,{name:"Search",size:"sm"}),value:l,onChange:p=>a(p.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(B.Icon,{name:"Loading",size:"lg",style:{color:"var(--sa-background-brand, #04254f)",animation:"spin 1s linear infinite"}}),e.jsx(D.Text,{fontSize:"sm",color:"gray-500",style:{textAlign:"center",marginTop:"8px"},children:"Loading options..."})]}):m.length>0?e.jsx(f.Box,{direction:"column",style:{gap:"2px",paddingTop:"4px",paddingBottom:"4px"},children:m.map(p=>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:g.includes(p.value)?"var(--sa-color-brand-50, #e6edf6)":"transparent"},onClick:L=>{L.stopPropagation(),j(p.value)},onMouseEnter:L=>{g.includes(p.value)||(L.currentTarget.style.backgroundColor="var(--sa-background-primary, #ffffff)"),L.currentTarget.style.transform="translateX(2px)"},onMouseLeave:L=>{L.currentTarget.style.backgroundColor=g.includes(p.value)?"var(--sa-color-brand-50, #e6edf6)":"transparent",L.currentTarget.style.transform="translateX(0)"},children:[e.jsx(Ze.Checkbox,{checked:g.includes(p.value),onChange:()=>{}}),e.jsx(D.Text,{fontSize:"sm",fontWeight:g.includes(p.value)?"medium":"normal",color:g.includes(p.value)?"primary":"gray-700",children:p.label})]},p.value))}):e.jsxs(f.Box,{style:{paddingTop:"40px",paddingBottom:"40px",display:"flex",alignItems:"center",justifyContent:"center",flexDirection:"column"},children:[e.jsx(B.Icon,{name:"Search",size:"lg",style:{color:"var(--sa-text-subtle, #8c8f97)"}}),e.jsx(D.Text,{fontSize:"sm",color:"gray-500",style:{textAlign:"center",marginTop:"8px"},children:"No results found"})]})}),g.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:g.length}),e.jsxs(D.Text,{fontSize:"xs",color:"primary",fontWeight:"medium",children:["item",g.length>1?"s":""," selected"]})]})})]})]})},Xs=({direction:t})=>{const r="var(--sa-text-primary, #292a2e)",n="var(--sa-text-subtle, #8c8f97)",s=t==="asc"?r:n,o=t==="desc"?r:n,i=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:s,opacity:i,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"})})]})},Ks=({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"})]}),lr="var(--sa-background-primary, #ffffff)",fn="var(--sa-background-primary-inverse, #f8f8f8)",$n=({columns:t,records:r,handleDetail:n,handleUpdate:s,handleDelete:o,isLoading:i,visibleHandleDelete:c,visibleHandleUpdate:l,visibleHandleDetail:a,showHeadBorder:d=!1,scrollParentRef:h,frozenCount:g=0,onFrozenCountChange:m,customActions:j,actionsOrder:M=["detail","update","delete","custom"],customEmptyState:p,enableColumnResize:L=!1,defaultColumnWidths:S,onColumnWidthsChange:T,defaultMinColumnWidth:w=60,sort:C,defaultSort:z,onSortChange:W,showActionDivider:b=!1})=>{const F=C!==void 0,[N,A]=u.useState(z??null),H=F?C??null:N,U=I=>{if(I.sortKey)return I.sortKey;if(typeof I.accessor=="string")return I.accessor},re=I=>{const q=U(I);if(!q)return;let R;!H||H.key!==q?R={key:q,direction:"asc"}:H.direction==="asc"?R={key:q,direction:"desc"}:R=null,F||A(R),W==null||W(R)},ee=[n,s,o].filter(I=>I!==void 0).length,ie=!!j,K=!!n||!!s||!!o||ie,Q="var(--sa-border-subtle, #0b120e24)",ue=`1px solid ${Q}`,ce=`inset 1px 0 0 ${Q}`,xe=`inset -1px 0 0 ${Q}`,ge=ee===3?ie?"178px":"140px":ee===2?ie?"140px":"102px":ee===1?ie?"112px":"74px":ie?"74px":"",ze=(I,q)=>{if(!q)return I;if(typeof q=="function")return q(I);if(typeof q=="string")return I[q]},[Ae,Ve]=u.useState(!1);u.useEffect(()=>{if(!(h!=null&&h.current))return;const I=h.current;Ve(I.scrollHeight>I.clientHeight)},[r,h]);const Ee=u.useRef(null),[he,Te]=u.useState([]),[_e,Ie]=u.useState(()=>S??{}),fe=u.useRef(null);u.useLayoutEffect(()=>{if(!g||!Ee.current){Te([]);return}const I=Array.from(Ee.current.querySelectorAll("thead tr th")),q=[];let R=0;I.forEach((P,Y)=>{q[Y]=R,Y<g&&(R+=P.offsetWidth)}),Te(q)},[g,t,r,_e]);const He=I=>{m&&m(I<g?I:I+1)},k=(I,q)=>{const R=_e[I];if(R!==void 0){const P=`${R}px`;return{width:P,minWidth:P,maxWidth:P}}return q?{width:q}:{}},_=I=>L&&(I.resizable??!0),G=(I,q)=>{I.preventDefault(),I.stopPropagation();const R=I.currentTarget.closest("th");if(!R)return;const P=Math.round(R.getBoundingClientRect().width);fe.current={colIndex:q,startX:I.clientX,startWidth:P};const Y=document.body.style.userSelect,ve=document.body.style.cursor;document.body.style.userSelect="none",document.body.style.cursor="col-resize";const Se=ke=>{var Ke;const me=fe.current;if(!me)return;const tt=((Ke=t[me.colIndex])==null?void 0:Ke.minWidth)??w,Xe=Math.max(tt,me.startWidth+(ke.clientX-me.startX));Ie(qe=>qe[me.colIndex]===Xe?qe:{...qe,[me.colIndex]:Xe})},Me=()=>{document.removeEventListener("mousemove",Se),document.removeEventListener("mouseup",Me),document.body.style.userSelect=Y,document.body.style.cursor=ve,fe.current=null,T&&Ie(ke=>(T(ke),ke))};document.addEventListener("mousemove",Se),document.addEventListener("mouseup",Me)};return e.jsx("div",{ref:Ee,children:e.jsxs(Z.Table,{fullWidth:!0,children:[e.jsx(Z.Thead,{style:{height:"40px",whiteSpace:"nowrap"},children:e.jsxs(Z.Tr,{children:[t.map((I,q)=>{var bt,rt;const R=g>0&&q<g,P=he[q]??0,Y=_(I),Se=q===t.length-1&&K&&b,Me=U(I),ke=!!I.sortable&&!!Me,me=ke&&(H==null?void 0:H.key)===Me?H.direction:null,tt=I.title||((bt=I.accessor)==null?void 0:bt.toString())||"",Xe=(rt=I.headerTooltip)!=null&&rt.showIcon?e.jsx(B.Icon,{name:"InfoCircle",size:"xs",style:{flexShrink:0,color:"var(--sa-icon-subtle, #8c8f97)",opacity:.75}}):null,Ke=e.jsx("span",{style:{flex:1,minWidth:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:tt}),qe=ke?e.jsxs("button",{type:"button",onClick:()=>re(I),title:me==="asc"?"Sorted ascending — click to sort descending":me==="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:I.textAlign==="text-right"?"right":I.textAlign==="text-center"?"center":"left"},children:[Ke,Xe,e.jsx(Xs,{direction:me})]}):e.jsxs("span",{style:{flex:1,minWidth:0,display:"flex",alignItems:"center",gap:4},children:[Ke,Xe]});return e.jsxs(Z.Th,{style:{position:"sticky",top:0,left:R?P:void 0,zIndex:R?4:2,paddingLeft:q===0?"12px":"",borderRight:d&&!Se&&!R?ue:void 0,borderBottom:d?ue:void 0,boxShadow:d&&R?xe:void 0,backgroundColor:"var(--sa-background-primary-inverse, #f8f8f8)",textAlign:I.textAlign==="text-right"?"right":I.textAlign==="text-center"?"center":"left",...k(q,I.width)},children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"4px",justifyContent:"space-between",minWidth:0},children:[I.headerTooltip?e.jsx(we.Tooltip,{label:I.headerTooltip.content,position:"bottom",children:qe}):qe,I.filter&&e.jsx(Kn,{filter:I.filter,columnTitle:I.title}),m&&e.jsx("button",{onClick:()=>He(q),title:R?"Unfreeze column":"Freeze column",style:{background:"none",border:"none",cursor:"pointer",padding:"2px",display:"flex",alignItems:"center",flexShrink:0,color:R?"var(--sa-background-brand, #04254f)":"var(--sa-text-subtle, #8c8f97)",opacity:R?1:.45,transition:"opacity 0.15s"},children:e.jsx(Ks,{frozen:R})})]}),Y&&e.jsx("div",{onMouseDown:nt=>G(nt,q),onClick:nt=>nt.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-${q}`)}),K?e.jsx(Z.Th,{style:{backgroundColor:"var(--sa-background-primary-inverse, #f8f8f8)",position:"sticky",top:0,right:0,zIndex:3,borderBottom:d?ue:void 0,boxShadow:d&&b?ce:void 0}}):null]})}),e.jsx(Z.Tbody,{children:i?e.jsx(Z.Tr,{children:e.jsx(Z.Td,{colSpan:t.length+1,children:e.jsxs(f.Box,{direction:"column",style:{gap:"16px"},children:[e.jsx(Oe.Skeleton,{variant:"list"}),e.jsx(Oe.Skeleton,{variant:"list"}),e.jsx(Oe.Skeleton,{variant:"list"}),e.jsx(Oe.Skeleton,{variant:"list"}),e.jsx(Oe.Skeleton,{variant:"list"})]})})}):!(r!=null&&r.length)&&p?e.jsx(Z.Tr,{children:e.jsx(Z.Td,{colSpan:t.length+1,children:p})}):r==null?void 0:r.map((I,q)=>e.jsxs(Z.Tr,{style:{transition:"background-color 0.3s ease",padding:0,borderBottom:q===r.length-1&&Ae?void 0:"1px solid var(--sa-border-subtle, #0b120e24)"},onMouseEnter:R=>{const P=R.currentTarget;P.style.backgroundColor=fn,Array.from(P.querySelectorAll("td")).forEach(Y=>{Y.style.position==="sticky"&&(Y.style.backgroundColor=fn)})},onMouseLeave:R=>{const P=R.currentTarget;P.style.backgroundColor="",Array.from(P.querySelectorAll("td")).forEach(Y=>{Y.style.position==="sticky"&&(Y.style.backgroundColor=lr)})},children:[t.map((R,P)=>{const Y=R.render?R.render(I,q,r):ze(I,R.accessor),ve=g>0&&P<g,Se=he[P]??0,Me=_e[P]!==void 0,ke=ve&&P===g-1;return e.jsx(Z.Td,{style:{position:ve?"sticky":void 0,left:ve?Se:void 0,zIndex:ve?1:void 0,backgroundColor:ve?lr:void 0,transition:ve?"background-color 0.3s ease":void 0,paddingLeft:P===0?"12px":"",whiteSpace:"nowrap",overflow:Me?"hidden":void 0,borderLeft:R.showBorderLeft?ue:void 0,borderRight:R.showBorderRight?ue:void 0,boxShadow:ke?xe:void 0,textAlign:R.textAlign==="text-right"?"right":R.textAlign==="text-center"?"center":"left",...k(P,R.width)},children:typeof Y=="string"?e.jsx(D.Text,{style:{whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",textAlign:R.textAlign==="text-right"?"right":R.textAlign==="text-center"?"center":"left"},children:Y}):Y},`row-${q}-col-${P}`)}),K?e.jsx(Z.Td,{style:{width:ge,position:"sticky",right:0,zIndex:1,backgroundColor:lr,boxShadow:b?ce:void 0,transition:"background-color 0.3s ease"},children:e.jsx(oe.Flex,{direction:"row",align:"center",justify:"center",gap:"sm",children:M.map(R=>{const P=q===r.length-1?"top":"bottom";return R==="detail"&&n&&(a==null?void 0:a(I))!==!1?e.jsx(we.Tooltip,{label:"Detail",position:P,children:e.jsx(V.Button,{size:"xs",variant:"outline",tone:"neutral",onClick:()=>n(I.id,I),iconLeft:e.jsx(B.Icon,{name:"DocumentClean",size:"sm",style:{color:"var(--sa-text-subtle, #8c8f97)"}})})},"detail"):R==="update"&&s&&(l==null?void 0:l(I))!==!1?e.jsx(we.Tooltip,{label:"Update",position:P,children:e.jsx(V.Button,{size:"xs",variant:"outline",tone:"neutral",onClick:()=>s(I),iconLeft:e.jsx(B.Icon,{name:"Edit1",size:"sm",style:{color:"var(--sa-text-subtle, #8c8f97)"}})})},"update"):R==="delete"&&o&&(c==null?void 0:c(I))!==!1?e.jsx(we.Tooltip,{label:"Delete",position:P,children:e.jsx(V.Button,{size:"xs",variant:"outline",tone:"neutral",onClick:()=>o(I.id,I),iconLeft:e.jsx(B.Icon,{name:"Trash1",size:"sm",style:{color:"var(--sa-color-error-600, #c9184a)"}})})},"delete"):R==="custom"?e.jsx(u.Fragment,{children:j==null?void 0:j(I)},"custom"):null})})}):null]},`${I}${q}`))})]})})},$s=({wrapperProps:t,dataTableProps:r,headerProps:n,footerProps:s})=>{var g;const o=u.useRef(null),[i,c]=u.useState((r==null?void 0:r.defaultFrozenCount)??0),l=(n==null?void 0:n.show)??!0,a=u.useRef(null),d=(g=r==null?void 0:r.pagination)==null?void 0:g.totalData;typeof d=="number"&&(a.current=d);const h=(s==null?void 0:s.showFooter)??(d===void 0?a.current!==0:d!==0);return e.jsxs(Jn,{...t,children:[l&&e.jsx(Yn,{...n}),e.jsx(f.Box,{direction:"column",ref:o,style:{flex:1,overflowY:"auto",overflowX:"auto"},children:r?e.jsx($n,{...r,scrollParentRef:o,frozenCount:r!=null&&r.enableFreezeColumns?i:0,onFrozenCountChange:r!=null&&r.enableFreezeColumns?c:void 0}):null}),h&&e.jsx(Xn,{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:s==null?void 0:s.totalData})]})};function ei(t){return u.memo(t)}const ti=ei($s),mn=200,cr="1px solid var(--sa-border-subtle, #0b120e24)",ri=({sortDir:t,frozen:r})=>t==="asc"?e.jsx(B.Icon,{name:"ChevronSmallUp"}):t==="desc"?e.jsx(B.Icon,{name:"ChevronSmallDown"}):r?e.jsx(B.Icon,{name:"LockOn",size:"xs"}):e.jsx(B.Icon,{name:"Filter",size:"xs"}),St=({icon:t,label:r,active:n,danger:s,onClick:o})=>{const i=s?"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:i,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(B.Icon,{name:t,size:"sm",style:{color:i,flexShrink:0}}),e.jsx(D.Text,{as:"span",style:{color:i},children:r})]})},eo=({active:t,canSort:r,canHide:n,sortDir:s,frozen:o,onSort:i,onClearSort:c,onToggleFreeze:l,onHide:a})=>{const[d,h]=u.useState(!1),g=u.useRef(null),m=u.useRef(null),[j,M]=u.useState({top:0,left:0});u.useEffect(()=>{if(d&&g.current){const L=g.current.getBoundingClientRect(),S=L.left+mn>window.innerWidth;M({top:L.bottom+6,...S?{right:window.innerWidth-L.right}:{left:L.left}})}},[d]),u.useEffect(()=>{if(!d)return;const L=S=>{m.current&&!m.current.contains(S.target)&&g.current&&!g.current.contains(S.target)&&h(!1)};return document.addEventListener("mousedown",L),()=>document.removeEventListener("mousedown",L)},[d]);const p=L=>{L(),h(!1)};return e.jsxs(e.Fragment,{children:[e.jsx("button",{ref:g,type:"button",className:"sa-tl-menu-trigger","data-active":t||d?"true":"false",onClick:L=>{L.stopPropagation(),h(S=>!S)},title:"Column options",style:{display:"inline-flex",alignItems:"center",justifyContent:"center",width:22,height:22,borderRadius:"var(--sa-radii-sm, 6px)",border:cr,background:"var(--sa-background-primary, #ffffff)",cursor:"pointer",color:"var(--sa-text-subtle, #8c8f97)",flexShrink:0},children:e.jsx(ri,{sortDir:s,frozen:o})}),d&&e.jsxs(f.Box,{ref:m,onClick:L=>L.stopPropagation(),style:{position:"fixed",top:`${j.top}px`,...j.left!==void 0?{left:`${j.left}px`}:{right:`${j.right}px`},minWidth:mn,backgroundColor:"var(--sa-background-primary, #ffffff)",border:cr,borderRadius:"var(--sa-radii-sm, 6px)",boxShadow:"0 6px 24px rgba(0,0,0,0.12)",zIndex:9999,padding:"4px",display:"flex",flexDirection:"column"},children:[r&&e.jsxs(e.Fragment,{children:[e.jsx(St,{icon:"ChevronUp",label:"Ascending",active:s==="asc",onClick:()=>p(()=>s==="asc"?c():i("asc"))}),e.jsx(St,{icon:"ChevronDown",label:"Descending",active:s==="desc",onClick:()=>p(()=>s==="desc"?c():i("desc"))}),e.jsx("div",{style:{borderTop:cr,margin:"4px 0"}})]}),e.jsx(St,{icon:"Pin1",label:o?"Unfreeze":"Freeze",active:o,onClick:()=>p(l)}),n&&e.jsx(St,{icon:"EyeClosed",label:"Hide column",danger:!0,onClick:()=>p(a)})]})]})},kt="1px solid var(--sa-border-subtle, #0b120e24)",ni="var(--sa-text-subtle, #8c8f97)",st="var(--sa-background-neutral, #f0f1f2)",gn="2px 0 4px -2px rgba(0,0,0,0.15)",ft=40,ar="var(--sa-background-brand-subtlest)",Bt={display:"block",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},yn="sa-table-layout-styles",oi=()=>{if(typeof document>"u"||document.getElementById(yn))return;const t=document.createElement("style");t.id=yn,t.textContent=`
|
|
2
2
|
.sa-table-layout tbody td {
|
|
3
3
|
transition: background-color 0.15s ease;
|
|
4
4
|
background-color: var(--sa-tl-bg, transparent);
|
|
@@ -43,8 +43,8 @@
|
|
|
43
43
|
box-shadow: 0 4px 12px rgba(0,0,0,0.12);
|
|
44
44
|
padding: 4px 0;
|
|
45
45
|
}
|
|
46
|
-
`,document.head.appendChild(t)},Dt=t=>t==="right"?"right":t==="center"?"center":"left",Rs=/^(#|rgb|hsl|var\()/,St=t=>t?Rs.test(t)?t:`var(--sa-background-${t})`:void 0,As=(t,r)=>{if(r)return t[r]},zs=(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)),Vs=({columns:t,data:r,getRowKey:n,rowBg:s,size:o="md",resizable:i=!1,layout:c="auto",widthStorageKey:l,columnState:a,onColumnStateChange:d,columnMenu:h=!1,sort:g,defaultSort:m,onSortChange:j,height:E,mobileLayout:y="cards",mobileBreakpoint:M="md",groupSeparator:k,summary:L,emptyState:C,loading:b=!1,loadingRows:A=8,rowActions:W})=>{Ws();const F=!ge.useMediaQuery(M)&&y!=="scroll",z=!!(W!=null&&W.length),[R,_]=u.useState(null);u.useEffect(()=>{if(!R)return;const p=()=>_(null),D=setTimeout(()=>document.addEventListener("click",p),0);return()=>{clearTimeout(D),document.removeEventListener("click",p)}},[R]);const[J,te]=u.useState(()=>new Set),xe=a!==void 0,[he,se]=u.useState({}),Z=a??he,Q=p=>{d==null||d(p),xe||se(p)},ae=g!==void 0,[ie,ue]=u.useState(m??null),me=ae?g??null:ie,Te=!j,Oe=p=>{j==null||j(p),ae||ue(p)},{headerGroups:Fe,leafColumns:de,hasGroups:fe}=u.useMemo(()=>{var ve;const p=new Set(Z.hidden??[]),D=(re,le)=>re.key??(typeof re.accessor=="string"?re.accessor:`col-${le}`),O=t.map((re,le)=>{var _e;if((_e=re.children)!=null&&_e.length){const Xe=re.children.map((qe,tt)=>({col:qe,key:D(qe,`${le}-${tt}`)})).filter(qe=>!p.has(qe.key));return{col:re,key:re.key??`group-${le}`,isGroup:!0,leaves:Xe}}const je={col:re,key:D(re,`${le}`)};return{col:re,key:je.key,isGroup:!1,leaves:p.has(je.key)?[]:[je]}}).filter(re=>re.leaves.length>0),$=O.some(re=>re.isGroup);let X=O.flatMap(re=>re.leaves);if(!$&&((ve=Z.order)!=null&&ve.length)){const re=new Map(Z.order.map((le,je)=>[le,je]));X=[...X].sort((le,je)=>(re.get(le.key)??1/0)-(re.get(je.key)??1/0))}return{headerGroups:O,leafColumns:X,hasGroups:$}},[t,Z]),We=u.useMemo(()=>new Map(de.map((p,D)=>[p.key,D])),[de]),Ve=!fe&&de.some(p=>(p.col.headerColSpan??1)>1),Ee=de.map(p=>p.key).join("|"),Re=(p,D)=>{const O=p.sortKey??(typeof p.accessor=="string"?p.accessor:void 0);return O?D[O]:void 0},et=p=>p.sortable??(!!p.sortKey||typeof p.accessor=="string"),S=u.useMemo(()=>{if(!Te||!me)return r;const p=de.find(O=>O.key===me.key);if(!p)return r;const D=me.direction==="asc"?1:-1;return[...r].sort((O,$)=>zs(Re(p.col,O),Re(p.col,$))*D)},[r,Te,me,de]),N=!fe&&!Ve,U=!!l&&N,[I,G]=Y.useColumnWidths(l??""),H=U?I:void 0,q=u.useRef(null),[P,pe]=u.useState();u.useLayoutEffect(()=>{pe(void 0)},[Ee]),u.useLayoutEffect(()=>{if(!N||P||!q.current)return;const p=q.current.querySelectorAll("th.sa-tl-leaf");pe(Array.from(p).map(D=>D.offsetWidth))},[P,N]);const[De,He]=u.useState(0);u.useLayoutEffect(()=>{if(!fe||!q.current)return;const p=q.current.querySelector(":scope > tr");p&&He(p.offsetHeight)},[fe,Ee]);const Be=(p,D)=>{if((H==null?void 0:H[D])!=null)return H[D];if(p.width!=null)return p.width;if((P==null?void 0:P[D])!=null)return P[D]},Me=(p,D)=>typeof p.width=="number"?p.width:P==null?void 0:P[D],Ye=Z.frozenKey&&!fe&&!Ve?de.findIndex(p=>p.key===Z.frozenKey):-1,Ge=p=>p<=Ye,Qe=p=>{if(!P)return 0;let D=0;for(let O=0;O<p;O++)D+=P[O]??0;return D},Pe=u.useRef(null),[mt,gt]=u.useState("100vh");u.useLayoutEffect(()=>{if(E!==void 0)return;const p=()=>{if(Pe.current){const D=Pe.current.getBoundingClientRect().top;gt(`calc(100vh - ${D}px)`)}};return p(),window.addEventListener("resize",p),()=>window.removeEventListener("resize",p)},[E]);const Ne=(p,D)=>n?n(p,D):D,Ht=(p,D,O)=>p.render?p.render(D,O,S):As(D,p.accessor),Pt=de.length+(z?1:0),gr=["80%","55%","70%","45%","90%","60%"],Nn=(p,D)=>gr[(p*7+D*3)%gr.length],_n=(p,D)=>e.jsx(ze.Skeleton,{height:14,width:Nn(p,D),borderRadius:"rounded-sm"}),qn=Array.from({length:A},(p,D)=>e.jsxs(Y.Tr,{children:[de.map(({col:O,key:$},X)=>e.jsx(Y.Td,{style:{textAlign:Dt(O.align)},children:_n(D,X)},`sa-tl-sk-${D}-${$}`)),z&&e.jsx(Y.Td,{style:{width:1,padding:0,border:"none"}})]},`sa-tl-sk-${D}`)),Zn=(p,D)=>{D||Q({...Z,hidden:[...Z.hidden??[],p]})},Gn=p=>Q({...Z,frozenKey:Z.frozenKey===p?void 0:p}),yt=p=>(W??[]).filter(D=>{var O;return!((O=D.hidden)!=null&&O.call(D,p))}),yr={position:"absolute",right:0,top:0,bottom:0,display:"flex",alignItems:"center",gap:4,paddingRight:16,paddingLeft:40,background:"linear-gradient(to right, transparent, var(--sa-background-primary-inverse, #f8f8f8) 40px)"},pt=(p,D,O,$)=>{var _e;const X=(_e=p.disabled)==null?void 0:_e.call(p,D),ve=($==null?void 0:$.showLabel)??p.showLabel,re=($==null?void 0:$.size)??"xs",le=e.jsx(V.Button,{size:re,variant:p.variant??"tertiary",tone:p.tone??"neutral",disabled:X,onClick:()=>p.onClick(D,O),iconLeft:p.icon?e.jsx(B.Icon,{name:p.icon,size:"sm"}):void 0,children:ve&&p.label}),je=p.tooltip;return je?e.jsx(Ce.Tooltip,{label:je,position:"top-end",children:le}):le},Qn=(p,D)=>{const O=yt(p);if(!O.length)return null;if(O.length>5){const X=Ne(p,D),ve=(R==null?void 0:R.rowKey)===X;return e.jsx("div",{className:"sa-tl-row-actions",style:yr,onClick:re=>re.stopPropagation(),children:e.jsx(Ce.Tooltip,{label:"Aksi lainnya",position:"top",children:e.jsx(V.Button,{size:"xs",variant:"tertiary",onClick:re=>{const le=re.currentTarget.getBoundingClientRect();_(ve?null:{rowKey:X,top:le.bottom+4,right:window.innerWidth-le.right})},children:e.jsx(B.Icon,{name:"MenuVertical",size:"sm"})})})})}return e.jsx("div",{className:"sa-tl-row-actions",style:yr,children:O.map(X=>e.jsx(u.Fragment,{children:pt(X,p,D)},X.key))})},Un=(p,D)=>{const O=yt(p);return O.length?e.jsx("div",{style:{display:"flex",gap:6,flexWrap:"wrap",paddingTop:8,marginTop:8,borderTop:Ct},children:O.map($=>e.jsx(u.Fragment,{children:pt($,p,D,{showLabel:!0,size:"sm"})},$.key))}):null},Jn=(p,D)=>{const O=yt(p);return O.length?e.jsx("div",{style:{display:"flex",gap:4,paddingRight:8,flexShrink:0},children:O.map($=>e.jsx(u.Fragment,{children:pt($,p,D,{showLabel:!1})},$.key))}):null},Nt=(p,D)=>{const{col:O,key:$}=p,X=We.get($)??0,ve=Ge(X),re=ve&&X===Ye,le=(me==null?void 0:me.key)===$?me.direction:null,je=h&&!O.disableMenu?e.jsx(Rn,{active:!!le||ve,canSort:et(O),canHide:!O.locked,sortDir:le,frozen:ve,onSort:tt=>Oe({key:$,direction:tt}),onClearSort:()=>Oe(null),onToggleFreeze:()=>Gn($),onHide:()=>Zn($,O.locked)}):null,_e=O.align==="right",Xe=O.align==="right"?"flex-end":O.align==="center"?"center":"flex-start",qe=e.jsxs("span",{style:{flex:1,minWidth:0,display:"flex",alignItems:"center",gap:6,justifyContent:Xe,overflow:"hidden"},children:[O.icon&&e.jsx(B.Icon,{name:O.icon,size:"sm",style:{flexShrink:0}}),e.jsx("span",{style:wt,children:O.title})]});return e.jsx(Y.Th,{className:`sa-tl-leaf${ve?" sa-tl-frozen":""}`,rowSpan:D==null?void 0:D.rowSpan,colSpan:D==null?void 0:D.colSpan,minWidth:O.minWidth,resizable:N?O.resizable:!1,defaultWidth:Me(O,X),style:{textAlign:Dt(O.align),width:Be(O,X),position:"sticky",top:(D==null?void 0:D.top)??0,left:ve?Qe(X):void 0,zIndex:ve?3:2,backgroundColor:at,boxShadow:re?Xr:void 0},children:e.jsx("div",{style:{display:"flex",alignItems:"center",gap:6,width:"100%"},children:_e?e.jsxs(e.Fragment,{children:[je,qe]}):e.jsxs(e.Fragment,{children:[qe,je]})})},`th-${$}`)},Yn=()=>{const p=[];for(let D=0;D<de.length;){const O=de[D],$=O.col.headerColSpan??1,X=Math.max(1,Math.min($,de.length-D));p.push(Nt(O,X>1?{colSpan:X}:void 0)),D+=X}return p},_t=de.filter(p=>!p.col.hideOnMobile),qt=_t.find(p=>p.col.primary)??_t[0],Xn=_t.filter(p=>p!==qt),Kn=p=>te(D=>{const O=new Set(D);return O.has(p)?O.delete(p):O.add(p),O}),pr=(p,D)=>Xn.map(({col:O,key:$})=>{const X=Ht(O,p,D),ve=typeof X=="string"||typeof X=="number"?e.jsx(w.Text,{style:{minWidth:0,overflow:"hidden",textOverflow:"ellipsis",textAlign:"right"},children:X}):e.jsx("div",{style:{minWidth:0,overflow:"hidden",textOverflow:"ellipsis",textAlign:"right"},children:X});return e.jsxs("div",{style:{display:"flex",gap:12,justifyContent:"space-between",alignItems:"baseline"},children:[typeof O.title=="string"?e.jsx(w.Text,{color:"subtle",fontWeight:"medium",style:{color:Os,flexShrink:0},children:O.title}):e.jsx("div",{style:{flexShrink:0},children:O.title}),ve]},$)}),jr=(p,D)=>{const O=qt?Ht(qt.col,p,D):null;return typeof O=="string"||typeof O=="number"?e.jsx(w.Text,{as:"span",style:wt,children:O}):e.jsx("span",{style:wt,children:O})},$n=e.jsx(f.Box,{style:{display:"flex",flexDirection:"column",gap:8,padding:8},children:Array.from({length:A},(p,D)=>e.jsxs(f.Box,{style:{border:Ct,borderRadius:"var(--sa-radii-sm, 6px)",padding:12,display:"flex",flexDirection:"column",gap:8},children:[e.jsx(ze.Skeleton,{height:16,width:"60%",borderRadius:"rounded-sm"}),e.jsx(ze.Skeleton,{height:12,width:"85%",borderRadius:"rounded-sm"}),e.jsx(ze.Skeleton,{height:12,width:"70%",borderRadius:"rounded-sm"})]},`sa-tl-sk-card-${D}`))}),br=e.jsx(f.Box,{fullWidth:!0,style:{minHeight:(C==null?void 0:C.minHeight)??320,display:"flex",alignItems:"center",justifyContent:"center",padding:16},children:C==null?void 0:C.content}),eo=b?$n:S.length===0?br:y==="expand"?e.jsx(f.Box,{style:{display:"flex",flexDirection:"column"},children:S.map((p,D)=>{const O=Ne(p,D),$=J.has(O),X=St(s==null?void 0:s(p,D));return e.jsxs("div",{style:{borderBottom:Ct,backgroundColor:X},children:[e.jsxs("div",{style:{display:"flex",alignItems:"center"},children:[e.jsxs("button",{type:"button",onClick:()=>Kn(O),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:[jr(p,D),e.jsx(B.Icon,{name:$?"ChevronUp":"ChevronDown",size:"sm",style:{flexShrink:0}})]}),z&&Jn(p,D)]}),$&&e.jsx("div",{style:{padding:"0 12px 12px",display:"flex",flexDirection:"column",gap:6},children:pr(p,D)})]},O)})}):e.jsx(f.Box,{style:{display:"flex",flexDirection:"column",gap:8,padding:8},children:S.map((p,D)=>e.jsxs(f.Box,{style:{border:Ct,borderRadius:"var(--sa-radii-sm, 6px)",padding:12,display:"flex",flexDirection:"column",gap:6,backgroundColor:St(s==null?void 0:s(p,D))},children:[jr(p,D),pr(p,D),z&&Un(p,D)]},Ne(p,D)))}),to=i&&N&&P!==void 0,vr=c==="fixed"&&!i&&(N?P!==void 0:!0),ro=vr&&!N,no=e.jsxs(Y.Table,{className:"sa-table-layout",fullWidth:!0,size:o,resizable:to,style:vr?{tableLayout:"fixed"}:void 0,onWidthsChange:U?G:void 0,children:[ro&&e.jsxs("colgroup",{children:[de.map(({col:p,key:D},O)=>e.jsx("col",{style:{width:Be(p,O)}},`col-${D}`)),z&&e.jsx("col",{style:{width:1}})]}),e.jsx(Y.Thead,{ref:q,children:fe?e.jsxs(e.Fragment,{children:[e.jsxs(Y.Tr,{children:[Fe.map(p=>p.isGroup?e.jsx(Y.Th,{colSpan:p.leaves.length,style:{textAlign:"center",position:"sticky",top:0,zIndex:2,backgroundColor:at},children:e.jsx("span",{style:wt,children:p.col.title})},`grp-${p.key}`):Nt(p.leaves[0],{rowSpan:2})),z&&e.jsx(Y.Th,{rowSpan:2,style:{position:"sticky",top:0,right:0,zIndex:3,width:1,padding:0,border:"none",backgroundColor:at}})]}),e.jsx(Y.Tr,{children:Fe.flatMap(p=>p.isGroup?p.leaves.map(D=>Nt(D,{top:De})):[])})]}):e.jsxs(Y.Tr,{children:[Yn(),z&&e.jsx(Y.Th,{style:{position:"sticky",top:0,right:0,zIndex:3,width:1,padding:0,border:"none",backgroundColor:at}})]})}),e.jsx(Y.Tbody,{children:b?qn:S.length===0?e.jsx(Y.Tr,{children:e.jsx(Y.Td,{colSpan:Pt,children:br})}):e.jsxs(e.Fragment,{children:[S.map((p,D)=>{const O=k==null?void 0:k(p,D,D>0?S[D-1]:void 0),$=St(s==null?void 0:s(p,D));return e.jsxs(u.Fragment,{children:[O!=null&&O!==!1&&e.jsx(Y.Tr,{children:e.jsx(Y.Td,{colSpan:Pt,style:{backgroundColor:at},children:O})}),e.jsxs(Y.Tr,{children:[de.map(({col:X,key:ve},re)=>{var Cr;const le=(Cr=X.cellProps)==null?void 0:Cr.call(X,p,D,S);if(le!=null&&le.hidden)return null;const je=Ge(re),_e=je&&re===Ye,Xe=Ht(X,p,D),qe=typeof X.bg=="function"?X.bg(p,D,S):X.bg,tt=St(qe)??$;return e.jsx(Y.Td,{className:je?"sa-tl-frozen":void 0,colSpan:le==null?void 0:le.colSpan,rowSpan:le==null?void 0:le.rowSpan,style:{textAlign:Dt(X.align),width:Be(X,re),minWidth:X.minWidth,position:je?"sticky":void 0,left:je?Qe(re):void 0,zIndex:je?1:void 0,boxShadow:_e?Xr:void 0,...tt?{"--sa-tl-bg":tt}:{}},children:typeof Xe=="string"?e.jsx(w.Text,{style:{whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",textAlign:Dt(X.align)},children:Xe}):Xe},`tl-cell-${D}-${ve}`)}),z&&e.jsx(Y.Td,{style:{position:"sticky",right:0,width:1,padding:0,overflow:"visible",zIndex:2,border:"none"},children:Qn(p,D)})]})]},Ne(p,D))}),L!=null&&e.jsx(Y.Tr,{children:e.jsx(Y.Td,{colSpan:Pt,children:L})})]})})]}),Zt=R?S.findIndex((p,D)=>Ne(p,D)===R.rowKey):-1,Gt=Zt>=0?S[Zt]:null;return e.jsxs(e.Fragment,{children:[e.jsx(f.Box,{ref:Pe,fullWidth:!0,style:{overflow:"auto",height:E??mt},children:F?eo:no}),R&&Gt&&e.jsx("div",{className:"sa-tl-kebab-menu",style:{top:R.top,right:R.right},onClick:p=>p.stopPropagation(),children:yt(Gt).map(p=>e.jsx("div",{style:{padding:"2px 4px"},children:pt(p,Gt,Zt,{showLabel:!0,size:"sm"})},p.key))})]})},$t=t=>t==="asc"||t==="desc",Hs=(t={})=>{const{sortKeyParam:r="sortBy",sortOrderParam:n="sortOrder",pageKey:s="page",defaultSort:o=null,paramKeys:i,scopeId:c,storage:l=mr}=t,{searchParams:a,setSearchParams:d,searchQueries:h}=Se(),g=a.toString(),m=c?ct.tableSort(c):void 0,j=u.useRef(!1);u.useEffect(()=>{if(j.current||(j.current=!0,!m)||a.has(r)||a.has(n))return;const C=l.get(m);!(C!=null&&C.key)||!$t(C.direction)||d({...Object.fromEntries(a.entries()),[r]:C.key,[n]:C.direction})},[]);const E=u.useMemo(()=>{const C=a.get(r),b=a.get(n);return C&&$t(b)?{key:C,direction:b}:o},[g,r,n,o]);u.useEffect(()=>{if(!m)return;const C=a.get(r),b=a.get(n);C&&$t(b)?l.set(m,{key:C,direction:b}):l.remove(m)},[g,m,r,n,l]);const y=(i==null?void 0:i.sortBy)??"sortBy",M=(i==null?void 0:i.sortOrder)??"sortOrder",k=u.useMemo(()=>E?{[y]:E.key,[M]:E.direction}:{},[E,y,M]),L=u.useCallback(C=>{const b={...h};C?(b[r]=C.key,b[n]=C.direction):(delete b[r],delete b[n]),delete b[s],d(b)},[h,r,n,s,d]);return{sort:E,setSort:L,params:k}},Wt=({of:t,render:r})=>u.Children.toArray(t==null?void 0:t.map((n,s,o)=>r(n,s,o))),oe=({condition:t,fallback:r,children:n,loading:s,isLoading:o})=>e.jsx(e.Fragment,{children:o?s:t?n:r}),ce=t=>e.jsx(w.Text,{...t,fontFamily:"Poppins",fontSize:t.fontSize||"md",fontWeight:t.fontWeight||"medium",color:t.color||"gray-700",children:t.children}),Ze=t=>e.jsx(w.Text,{color:"red-600",fontSize:"sm",children:t.message}),Ps=({size:t="md",direction:r="vertical",requiredTitle:n="(Required)",fullWidth:s=!1,...o})=>{var l,a,d;const i=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(oe,{condition:!!o.inputProps.required,fallback:e.jsxs(f.Box,{direction:"column",customMaxWidth:c,fullWidth:s,children:[e.jsx(ce,{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:s,children:[e.jsxs(ne.Flex,{direction:"row",gap:"xs",align:"center",children:[e.jsx(ce,{fontSize:t,children:o.title}),e.jsx(ce,{color:"error",fontSize:t,children:n}),e.jsx(oe,{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(B.Icon,{name:"InfoCircle",size:t==="lg"?"sm":"xs",style:{color:"var(--sa-color-info-500, #00abeb)",marginTop:"6px"}})})})]}),e.jsx(oe,{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(Je.Input,{ref:o.inputRef,size:t,...o.inputProps,status:o.errorMessage?"error":"default",fullWidth:!0}),!i&&o.errorMessage&&e.jsx(Ze,{message:o.errorMessage}),o.inputProps.extended&&o.inputProps.extended]})]})},Ns=({size:t="md",direction:r="vertical",requiredTitle:n="(Required)",fullWidth:s=!1,...o})=>{var l,a,d;const i=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(oe,{condition:!!o.inputProps.required,fallback:e.jsxs(f.Box,{direction:"column",customMaxWidth:c,fullWidth:s,children:[e.jsx(ce,{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:s,children:[e.jsxs(ne.Flex,{direction:"row",gap:"xs",align:"center",children:[e.jsx(ce,{fontSize:t,children:o.title}),e.jsx(ce,{color:"error",fontSize:t,children:n}),e.jsx(oe,{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(B.Icon,{name:"InfoCircle",size:t==="lg"?"sm":"xs",style:{color:"var(--sa-color-info-500, #00abeb)",marginTop:"6px"}})})})]}),e.jsx(oe,{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(ot.Dropdown,{size:t,...o.inputProps,error:!!o.errorMessage})}),!i&&o.errorMessage&&e.jsx(Ze,{message:o.errorMessage}),o.inputProps.extended&&o.inputProps.extended]})]})},_s=(t,r)=>typeof t=="string"&&t||r==="error"?"var(--sa-border-danger)":"var(--sa-border-subtle)",qs=t=>{var l;const[r,n]=u.useState(!1),s=a=>{a.preventDefault(),a.stopPropagation()},o=a=>{a.preventDefault(),a.stopPropagation(),a.dataTransfer&&t.handleOnFileChange(a.dataTransfer.files.item(0))},i=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:s,onDrop:o,onDragEnter:i,onDragLeave:c,paddingBlock:"md",borderRadius:"rounded-md",style:{border:r?"1px solid var(--sa-border-info)":`1px solid ${_s(t.errorMessage,t.status)}`},children:[e.jsx(B.Icon,{name:"Upload",size:"lg",style:{width:30,height:30}}),e.jsxs(ne.Flex,{direction:"column",gap:"xs",children:[e.jsxs(ne.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 Zs(t){return t.split(" ").map(r=>r[0]).join("").slice(0,2).toUpperCase()}const An=t=>{const r={day:"2-digit",month:"short",year:"numeric"};return t.toLocaleDateString("id-ID",r)},Gs=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 s=parseInt(n[0],10),o=r[n[1]],i=parseInt(n[2],10);return isNaN(s)||isNaN(o)||isNaN(i)?null:new Date(i,o,s)};function Qs(t,r=!0){if(!t)return"Rp 0";const n=typeof t=="number"?t.toString():t;if(isNaN(Number(n)))return"Rp 0";const s=n.split("."),o=s[0].replace(/\B(?=(\d{3})+(?!\d))/g,"."),i=s.length===2?o+"."+s[1]:o;return r?"Rp"+i:i}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 Us=t=>{const r=t.split(" ");let n=r[0].charAt(0);return r.length>1&&(n+=""+r[1].charAt(0)),n.toUpperCase()};function Js(t){const r=typeof t=="string"?new Date(t):t;if(isNaN(r.getTime()))throw new Error("Invalid date format");const n=r.getFullYear(),s=String(r.getMonth()+1).padStart(2,"0"),o=String(r.getDate()).padStart(2,"0");return`${n}-${s}-${o}`}const Ys="sa-admin",Ae=t=>`var(--${Ys}-${t})`,Xs={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")}},Ks=24*60*60*1e3,$s=t=>{const r="14px poppins",s=document.createElement("canvas").getContext("2d");s.font=r;const o=s.measureText(t).width;return Number(Math.ceil(o))},ei=/^[^\s@]+@[^\s@]+\.[^\s@]+$/,ti=/--+/,ri=/-$/;function ni(t,r){return JSON.stringify(t)!==JSON.stringify(r)}function oi(t){return/^(?:\+62|62|0)8[1-9][0-9]{7,10}$/.test(t)}function si(t){return/^[A-Za-z\s]+$/.test(t)}const ii=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()},li=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()},ci=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()},ai=t=>ei.test(t);function di(t){return!(ti.test(t)||ri.test(t))}const ui=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()},xi=t=>{const r=document.getElementById(t);if(r){const n=r.getBoundingClientRect(),s=window.scrollY+n.top-80;window.scrollTo({top:s,behavior:"smooth"})}};function hi(t){const r=t.toLowerCase();if(["kb","mb","gb"].find(i=>r.endsWith(i)))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 fi(t){const r=t.split("/");return r[r.length-1]}const mi=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(ne.Flex,{direction:"row",align:"center",gap:"sm",style:{flex:1,minWidth:0},children:[e.jsx(B.Icon,{name:"DocumentFilled",size:"lg",style:{color:"var(--sa-icon-brand)",width:30,height:30,flexShrink:0}}),e.jsxs(ne.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?fi(t.defaultFile.url):(r=t.fileSelected)==null?void 0:r.name}),t.defaultFile?(t.defaultFile.size||t.defaultFile.date)&&e.jsxs(ne.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(B.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(ne.Flex,{direction:"row",gap:"xs",align:"center",children:[e.jsx(w.Text,{fontSize:"sm",fontWeight:"medium",children:hi(((n=t.fileSelected)==null?void 0:n.size.toString())||"100000")}),e.jsx(B.Icon,{name:"Dot",size:"xs"}),e.jsx(w.Text,{fontSize:"sm",fontWeight:"medium",style:{textWrap:"nowrap"},children:An(new Date)})]})]})]}),e.jsx(V.Button,{size:"xs",variant:"tertiary",tone:"error",type:"button",onClick:s=>{s.stopPropagation(),t.handleOnDeleteFile()},iconLeft:e.jsx(B.Icon,{name:"Trash1"})})]})},zn=({status:t="default",labelPosition:r="outside-top",...n})=>{var m;const s=u.useRef(null),o=()=>{if(n.defaultFile){window.open(n.defaultFile.url);return}s.current&&s.current.click()},i=ge.useMediaQuery("md"),c=t==="error"||typeof n.errorMessage=="string"&&!!n.errorMessage,l=n.label?e.jsxs(ne.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:s,onChange:j=>{var E;return n.handleOnChangeFile(((E=j.target.files)==null?void 0:E.item(0))||null)},accept:(m=n.fileSupportOption)==null?void 0:m.map(j=>"."+(j==null?void 0:j.toLowerCase())).join(", ")}),g=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(mi,{fileSelected:n.fileSelected,defaultFile:n.defaultFile,handleOnDeleteFile:n.handleOnDeleteFile,handleOnClickFile:o}),!n.fileSelected&&!n.defaultFile&&e.jsx(qs,{fileSupports:n.fileSupportOption,isDesktop:i,errorMessage:c?n.errorText||n.errorMessage||" ":void 0,status:c?"error":"default",handleOnClick:o,handleOnFileChange:n.handleOnChangeFile})]});return r==="outside-left"?e.jsxs(ne.Flex,{direction:"row",align:"flex-start",gap:"sm",style:{width:"100%"},children:[e.jsxs(ne.Flex,{direction:"column",gap:"xs",style:{width:"40%",minWidth:"120px",paddingTop:"10px"},children:[l,a]}),e.jsxs(ne.Flex,{direction:"column",gap:"sm",style:{flex:1,minWidth:0},children:[g,d]})]}):e.jsxs(ne.Flex,{direction:"column",gap:"sm",style:{width:"100%"},children:[l,a,g,d]})},gi=({size:t="md",direction:r="vertical",requiredTitle:n="(Required)",fullWidth:s=!1,...o})=>{var l,a,d;const i=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(oe,{condition:!!o.inputProps.required,fallback:e.jsxs(f.Box,{direction:"column",customMaxWidth:c,fullWidth:s,children:[e.jsx(ce,{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:s,children:[e.jsxs(ne.Flex,{direction:"row",gap:"xs",align:"center",children:[e.jsx(ce,{fontSize:t,children:o.title}),e.jsx(ce,{color:"error",fontSize:t,children:n}),e.jsx(oe,{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(B.Icon,{name:"InfoCircle",size:t==="lg"?"sm":"xs",style:{color:"var(--sa-color-info-500, #00abeb)",marginTop:"6px"}})})})]}),e.jsx(oe,{condition:!!o.description,children:e.jsx(w.Text,{fontSize:t,color:"gray-500",children:o.description})})]})}),e.jsxs(ne.Flex,{direction:"column",gap:"xs",children:[e.jsx(zn,{...o.inputProps,status:o.errorMessage?"error":"default"}),!i&&o.errorMessage&&e.jsx(Ze,{message:o.errorMessage})]})]})},yi=({size:t="md",direction:r="vertical",requiredTitle:n="(Required)",fullWidth:s=!1,required:o=!1,...i})=>{var a,d,h,g;const c=i.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",...i.containerProps,children:[i.title&&e.jsx(oe,{condition:!!o,fallback:e.jsxs(f.Box,{direction:"column",customMaxWidth:l,fullWidth:s,children:[e.jsx(ce,{children:i.title}),e.jsx(Ie.Body3,{props:{color:"gray-500"},children:i.description})]}),children:e.jsxs(f.Box,{direction:"column",customMaxWidth:l,fullWidth:s,children:[e.jsxs(ne.Flex,{direction:"row",gap:"xs",align:"center",children:[e.jsx(ce,{fontSize:t,children:i.title}),e.jsx(ce,{color:"error",fontSize:t,children:n}),e.jsx(oe,{condition:!!((a=i.tooltip)!=null&&a.label),children:e.jsx(Ce.Tooltip,{label:(d=i.tooltip)==null?void 0:d.label,arrowPosition:(h=i.tooltip)==null?void 0:h.arrowPosition,...i.tooltip,children:e.jsx(B.Icon,{name:"InfoCircle",size:t==="lg"?"sm":"xs",style:{color:"var(--sa-color-info-500, #00abeb)",marginTop:"6px"}})})})]}),e.jsx(oe,{condition:!!i.description,children:e.jsx(w.Text,{fontSize:t,color:"gray-500",children:i.description})})]})}),e.jsx(f.Box,{gap:r==="horizontal-inline"?"xl":"md",direction:r==="horizontal-inline"?"row":"column",align:"flex-start",children:e.jsx(Wt,{of:(g=i.checkBoxesList)==null?void 0:g.map(m=>({...m,isChecked:i.checkBoxesAreChecked.includes(m.id)})),render:m=>m.renderBadge?e.jsxs(f.Box,{direction:"row",justify:"space-between",gap:"lg",...i.badgeContainerProps,children:[e.jsx(lt.Checkbox,{name:m.name,value:m.id,checked:m.isChecked,onChange:j=>i.onChecked(j.target.value,m),label:m.name,description:m.description}),m.renderBadge]}):e.jsx(lt.Checkbox,{name:m.name,value:m.id,checked:m.isChecked,onChange:j=>i.onChecked(j.target.value,m),label:m.name,description:m.description})})}),!c&&i.errorMessage&&e.jsx(Ze,{message:i.errorMessage})]})},pi=({position:t="vertical",size:r="md",fullWidth:n=!1,...s})=>{var i;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(oe,{condition:!!s.description||!!s.title,children:e.jsxs(f.Box,{direction:"column",customMaxWidth:o,fullWidth:n,children:[s.title&&e.jsx(ce,{children:s.title}),e.jsx(oe,{condition:!!s.description,children:e.jsx(w.Text,{color:"gray-500",children:s.description})})]})}),e.jsx(f.Box,{gap:"sm",direction:t==="horizontal"||t==="horizontal-inline"?"row":"column",align:"flex-start",flexWrap:"wrap",children:e.jsx(Wt,{of:(i=s.radioList)==null?void 0:i.map(c=>({...c,isChecked:s.radioIsChecked===c.id})),render:({value:c,id:l,isChecked:a,subInput:d,label:h,description:g})=>e.jsxs(f.Box,{direction:"column",gap:"xs",customMaxWidth:o,children:[e.jsx(nr.Radio,{id:`${l.toString()}-${c}`,name:s.groupName||h,label:h,value:c,checked:a,onChange:m=>s.onChecked({id:l,label:m.target.name,value:m.target.value}),disabled:s.disableAll},l),g&&e.jsx(w.Text,{color:"gray-500",style:{marginLeft:28},children:g}),d]})})}),s.errorMessage&&e.jsx(Ze,{message:s.errorMessage})]})},ji=({size:t="md",direction:r="vertical",requiredTitle:n="(Required)",fullWidth:s=!1,...o})=>{var l,a,d;const i=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(oe,{condition:!!o.inputProps.required,fallback:e.jsxs(f.Box,{direction:"column",customMaxWidth:c,fullWidth:s,children:[e.jsx(ce,{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:s,children:[e.jsxs(ne.Flex,{direction:"row",gap:"xs",align:"center",children:[e.jsx(ce,{fontSize:t,children:o.title}),e.jsx(ce,{color:"error",fontSize:t,children:n}),e.jsx(oe,{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(B.Icon,{name:"InfoCircle",size:t==="lg"?"sm":"xs",style:{color:"var(--sa-color-info-500, #00abeb)",marginTop:"6px"}})})})]}),e.jsx(oe,{condition:!!o.description,children:e.jsx(w.Text,{fontSize:t,color:"gray-500",children:o.description})})]})}),e.jsxs(ne.Flex,{direction:"column",gap:"xs",children:[e.jsx(rr.Textarea,{ref:o.inputRef,size:t,...o.inputProps,status:o.errorMessage?"error":"default"}),!i&&o.errorMessage&&e.jsx(Ze,{message:o.errorMessage})]})]})},bi=({size:t="md",direction:r="vertical",requiredTitle:n="(Required)",required:s=!1,fullWidth:o=!1,...i})=>{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",...i.containerProps,children:[i.title&&e.jsx(oe,{condition:s,fallback:e.jsxs(f.Box,{direction:"column",customMaxWidth:c,fullWidth:o,children:[e.jsx(ce,{children:i.title}),e.jsx(w.Text,{fontSize:t,color:"gray-500",children:i.titleDescription})]}),children:e.jsxs(f.Box,{direction:"column",customMaxWidth:c,fullWidth:o,children:[e.jsxs(ne.Flex,{direction:"row",gap:"xs",align:"center",children:[e.jsx(ce,{fontSize:t,children:i.title}),e.jsx(ce,{color:"error",fontSize:t,children:n}),e.jsx(oe,{condition:!!((l=i.tooltip)!=null&&l.label),children:e.jsx(Ce.Tooltip,{label:(a=i.tooltip)==null?void 0:a.label,arrowPosition:(d=i.tooltip)==null?void 0:d.arrowPosition,...i.tooltip,children:e.jsx(B.Icon,{name:"InfoCircle",size:t==="lg"?"sm":"xs",style:{color:"var(--sa-color-info-500, #00abeb)",marginTop:"6px"}})})})]}),e.jsx(oe,{condition:!!i.titleDescription,children:e.jsx(w.Text,{fontSize:t,color:"gray-500",children:i.titleDescription})})]})}),e.jsx(it.Toggle,{checked:i.checked,onChange:i.onChange,label:i.label,description:i.description}),i.errorMessage&&e.jsx(Ze,{message:i.errorMessage})]})},vi=({variant:t="primary",size:r="md",...n})=>{const s=nt.useColor(),o=c=>{var a,d,h,g,m,j;if(!c)return;const l=n.disabled?"var(--sa-text-disable, #181a198f)":t==="secondary"?"var(--sa-text-subtle, #8c8f97)":t==="secondary-danger"?(d=(a=s==null?void 0:s.computed)==null?void 0:a.red)==null?void 0:d[600]:t==="secondary-primary"?(g=(h=s==null?void 0:s.computed)==null?void 0:h.blue)==null?void 0:g[700]:(j=(m=s==null?void 0:s.computed)==null?void 0:m.gray)==null?void 0:j[50];return e.jsx(B.Icon,{name:c,size:r,style:{color:l}})},i=()=>{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=s==null?void 0:s.computed)==null?void 0:l.red)==null?void 0:a[600]:(h=(d=s==null?void 0:s.computed)==null?void 0:d.blue)==null?void 0:h[700]};switch(r){case"xs":return e.jsx(Ie.Body2,{props:{style:c},children:n.title});case"sm":case"md":return e.jsx(Ie.SubH3,{props:{style:c},children:n.title});case"lg":return e.jsx(Ie.SubH2,{props:{style:c},children:n.title});default:return n.title}};return e.jsx(V.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:i()})},Ci=t=>e.jsx(Ie.H5,{props:{...t},children:t.title}),wi=({size:t="md",direction:r="vertical",requiredTitle:n="(Required)",fullWidth:s=!1,...o})=>{var l,a,d;const i=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(oe,{condition:!!o.inputProps.required,fallback:e.jsxs(f.Box,{direction:"column",customMaxWidth:c,fullWidth:s,children:[e.jsx(ce,{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:s,children:[e.jsxs(ne.Flex,{direction:"row",gap:"xs",align:"center",children:[e.jsx(ce,{fontSize:t,children:o.title}),e.jsx(ce,{color:"error",fontSize:t,children:n}),e.jsx(oe,{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(B.Icon,{name:"InfoCircle",size:t==="lg"?"sm":"xs",style:{color:"var(--sa-color-info-500, #00abeb)",marginTop:"6px"}})})})]}),e.jsx(oe,{condition:!!o.description,children:e.jsx(w.Text,{fontSize:t,color:"gray-500",children:o.description})})]})}),e.jsxs(ne.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($e.StarasiaDate,{size:t,...o.inputProps,status:o.errorMessage?"error":void 0})}),!i&&o.errorMessage&&e.jsx(Ze,{message:o.errorMessage})]})]})};async function Di(t,r){const n=new Image;n.src=t,await new Promise((i,c)=>{n.onload=i,n.onerror=c});const s=document.createElement("canvas");s.width=r.width,s.height=r.height;const o=s.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((i,c)=>{s.toBlob(l=>{if(!l)return c("Canvas is empty");const a=new File([l],"cropped.png",{type:"image/png"});i(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},Vn=u.forwardRef(({handleUpload:t,urlImage:r,isUploading:n,croppedImage:s,setCroppedImage:o,size:i="96",aspect:c="1:1",containerProps:l,maxFileSize:a=2,onError:d},h)=>{const g=ge.useMediaQuery("md"),[m,j]=u.useState(!1),[E,y]=u.useState(null),[M,k]=u.useState(!1),[L,C]=u.useState({x:0,y:0}),[b,A]=u.useState(1),[W,v]=u.useState(null);u.useEffect(()=>{r===null&&o(null)},[r]);const F=u.useCallback((Z,Q)=>{v(Q)},[]),z=Z=>{var ie;const Q=(ie=Z.target.files)==null?void 0:ie[0];if(!Q)return;const ae=new FileReader;ae.onload=()=>{y(ae.result),k(!0)},ae.readAsDataURL(Q)},R=async()=>{if(!(!E||!W))try{const Z=await Di(E,W);if(a&&Z.size>a*1024*1024){d==null||d(`Ukuran file maksimal ${a}MB`);return}t==null||t(Z);const Q=URL.createObjectURL(Z);o(Q,Z),k(!1)}catch{d==null||d("Gagal memproses gambar")}},_=u.useRef(null),J=()=>{_.current&&_.current.click()};u.useImperativeHandle(h,()=>({openFileDialog:()=>{var Z;(Z=_.current)==null||Z.click()}}));const te=parseInt(i,10),xe=$r[c];let he,se;return xe>=1?(se=te,he=te*xe):(he=te,se=te/xe),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%":`${he}px`,height:l!=null&&l.fullWidth?"auto":`${se}px`,aspectRatio:xe,flexShrink:0},onMouseEnter:()=>j(!0),onMouseLeave:()=>j(!1),children:[s||r?e.jsx("img",{src:s||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(B.Icon,{name:"Image",style:{color:"var(--sa-text-subtle, #8c8f97)",width:Number(i)/2<40?Number(i)/2:40,height:Number(i)/2<40?Number(i)/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:m?1:0,transition:"opacity 0.3s ease-in-out"},onClick:J,children:[e.jsx("input",{ref:_,type:"file",accept:"image/*",onChange:z,disabled:n,style:{display:"none"}}),e.jsxs(f.Box,{display:"flex",align:"center",gap:"spacing-2",direction:"row",children:[e.jsx(B.Icon,{name:"Edit3",style:{color:"var(--sa-background-primary, #ffffff)"}}),e.jsx(oe,{condition:i.toNumber()>80,children:e.jsx(w.Text,{color:"gray-50",fontSize:i.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"})}),M&&ir.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:()=>k(!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:g?c==="1:1"?"min(90vw, 480px)":`min(90vw, ${he*2}px)`:"calc(100vw - 2rem)",display:"flex",flexDirection:"column"},onClick:Z=>Z.stopPropagation(),children:[e.jsx("div",{style:{position:"relative",width:"100%",height:"20rem",backgroundColor:"var(--sa-color-gray-100)"},children:E&&e.jsx(oo,{image:E,crop:L,zoom:b,aspect:c?$r[c]:void 0,onCropChange:C,onZoomChange:A,onCropComplete:F,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(V.Button,{size:"sm",secondary:!0,onClick:()=>k(!1),children:"Cancel"}),e.jsx(V.Button,{size:"sm",primary:!0,onClick:R,children:"Crop"})]})]})}),document.body)]})}),Si=({size:t="md",direction:r="vertical",requiredTitle:n="(Required)",fullWidth:s=!1,required:o=!1,...i})=>{var a,d,h;const c=i.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",...i.containerProps,children:[i.title&&e.jsx(oe,{condition:!!o,fallback:e.jsxs(f.Box,{direction:"column",customMaxWidth:l,fullWidth:s,children:[e.jsx(ce,{children:i.title}),e.jsx(w.Text,{fontSize:t,color:"gray-500",children:i.description})]}),children:e.jsxs(f.Box,{direction:"column",customMaxWidth:l,fullWidth:s,children:[e.jsxs(ne.Flex,{direction:"row",gap:"xs",align:"center",children:[e.jsx(ce,{fontSize:t,children:i.title}),e.jsx(ce,{color:"error",fontSize:t,children:n}),e.jsx(oe,{condition:!!((a=i.tooltip)!=null&&a.label),children:e.jsx(Ce.Tooltip,{label:(d=i.tooltip)==null?void 0:d.label,arrowPosition:(h=i.tooltip)==null?void 0:h.arrowPosition,...i.tooltip,children:e.jsx(B.Icon,{name:"InfoCircle",size:t==="lg"?"sm":"xs",style:{color:"var(--sa-color-info-500, #00abeb)",marginTop:"6px"}})})})]}),e.jsx(oe,{condition:!!i.description,children:e.jsx(w.Text,{fontSize:t,color:"gray-500",children:i.description})})]})}),e.jsxs(ne.Flex,{direction:"column",gap:"xs",children:[e.jsx(Vn,{...i.inputProps}),!c&&i.errorMessage&&e.jsx(Ze,{message:i.errorMessage})]})]})},ki=({size:t="md",direction:r="vertical",requiredTitle:n="(Required)",fullWidth:s=!1,...o})=>{var c,l,a;const i=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(oe,{condition:!!o.inputProps.required,fallback:e.jsxs(f.Box,{direction:"column",customMaxWidth:i,fullWidth:s,children:[e.jsx(ce,{children:o.title}),e.jsx(w.Text,{fontSize:t,color:"gray-500",children:o.description})]}),children:e.jsxs(f.Box,{direction:"column",customMaxWidth:i,fullWidth:s,children:[e.jsxs(ne.Flex,{direction:"row",gap:"xs",align:"center",children:[e.jsx(ce,{fontSize:t,children:o.title}),e.jsx(ce,{color:"error",fontSize:t,children:n}),e.jsx(oe,{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(B.Icon,{name:"InfoCircle",size:t==="lg"?"sm":"xs",style:{color:"var(--sa-color-info-500, #00abeb)",marginTop:"6px"}})})})]}),e.jsx(oe,{condition:!!o.description,children:e.jsx(w.Text,{fontSize:t,color:"gray-500",children:o.description})})]})}),o.inputProps.extended&&o.inputProps.extended]})},Bi=({items:t,id:r,handleOnUpdate:n,width:s,toggleShow:o=!0,disabled:i=!1})=>{var h;const[c,l]=u.useState([]);u.useEffect(()=>{t&&l([...t.map(g=>({id:g.id,isActive:g.isActive}))])},[t]);const a=(h=c.find(g=>g.id===r))==null?void 0:h.isActive,d=u.useCallback(()=>{l(g=>g.map(m=>m.id===r?{...m,isActive:!m.isActive}:m)),n&&n(!a)},[r,n,a]);return e.jsx(f.Box,{direction:"row",gap:"md",style:{width:s},children:o&&e.jsx(it.Toggle,{disabled:i,checked:a,onChange:d,label:a?"Active":"Inactive"})})},Fi={InputText:Ps,InputDropdown:Ns,InputSingleFile:gi,CheckBoxOptions:yi,RadioOptions:pi,InputTextArea:ji,ToggleForm:bi,ActionButton:vi,FormTitle:Ci,InputDate:wi,InputImgFile:Si,Custom:ki},Hn=({customBottom:t})=>{const[r,n]=u.useState(!1),s=()=>{window.scrollY>window.screenY?n(!0):n(!1)},o=()=>{window.scrollTo({top:0,behavior:"smooth"})};return u.useEffect(()=>(window.addEventListener("scroll",s),()=>{window.removeEventListener("scroll",s)}),[]),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(V.Button,{secondary:!0,size:"xs",onClick:o,type:"button",iconLeft:e.jsx(B.Icon,{width:16,size:"xs",name:"ArrowPullUp",style:{color:"var(--sa-background-brand, #04254f)"}})})})})},ke="sa-sidepanel-item",en="sa-sidepanel-item-styles",Ei="inset 3.5px 0 0 0 var(--sa-border-focused, #1a4fa0)",Mi="inset -3.5px 0 0 0 var(--sa-border-focused, #1a4fa0)",Li=`
|
|
47
|
-
.${
|
|
46
|
+
`,document.head.appendChild(t)},Ft=t=>t==="right"?"right":t==="center"?"center":"left",si=/^(#|rgb|hsl|var\()/,Et=t=>t?si.test(t)?t:`var(--sa-background-${t})`:void 0,ii=(t,r)=>{if(r)return t[r]},li=(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)),ci=({columns:t,data:r,getRowKey:n,rowBg:s,size:o="md",resizable:i=!1,layout:c="auto",widthStorageKey:l,columnState:a,onColumnStateChange:d,columnMenu:h=!1,sort:g,defaultSort:m,onSortChange:j,height:M,mobileLayout:p="cards",mobileBreakpoint:L="md",groupSeparator:S,summary:T,emptyState:w,loading:C=!1,loadingRows:z=8,rowActions:W,selectable:b=!1,selectedKeys:F,defaultSelectedKeys:N,onSelectionChange:A,isRowSelectable:H})=>{oi();const re=!je.useMediaQuery(L)&&p!=="scroll",ne=!!(W!=null&&W.length),[ee,ie]=u.useState(null);u.useEffect(()=>{if(!ee)return;const y=()=>ie(null),v=setTimeout(()=>document.addEventListener("click",y),0);return()=>{clearTimeout(v),document.removeEventListener("click",y)}},[ee]);const[K,Q]=u.useState(()=>new Set),ue=a!==void 0,[ce,xe]=u.useState({}),ge=a??ce,ze=y=>{d==null||d(y),ue||xe(y)},Ae=g!==void 0,[Ve,Ee]=u.useState(m??null),he=Ae?g??null:Ve,Te=!j,_e=y=>{j==null||j(y),Ae||Ee(y)},{headerGroups:Ie,leafColumns:fe,hasGroups:He}=u.useMemo(()=>{var ae;const y=new Set(ge.hidden??[]),v=(le,ye)=>le.key??(typeof le.accessor=="string"?le.accessor:`col-${ye}`),E=t.map((le,ye)=>{var Le;if((Le=le.children)!=null&&Le.length){const xt=le.children.map((Pe,ht)=>({col:Pe,key:v(Pe,`${ye}-${ht}`)})).filter(Pe=>!y.has(Pe.key));return{col:le,key:le.key??`group-${ye}`,isGroup:!0,leaves:xt}}const pe={col:le,key:v(le,`${ye}`)};return{col:le,key:pe.key,isGroup:!1,leaves:y.has(pe.key)?[]:[pe]}}).filter(le=>le.leaves.length>0),J=E.some(le=>le.isGroup);let te=E.flatMap(le=>le.leaves);if(!J&&((ae=ge.order)!=null&&ae.length)){const le=new Map(ge.order.map((ye,pe)=>[ye,pe]));te=[...te].sort((ye,pe)=>(le.get(ye.key)??1/0)-(le.get(pe.key)??1/0))}return{headerGroups:E,leafColumns:te,hasGroups:J}},[t,ge]),k=u.useMemo(()=>new Map(fe.map((y,v)=>[y.key,v])),[fe]),_=!He&&fe.some(y=>(y.col.headerColSpan??1)>1),G=fe.map(y=>y.key).join("|"),I=(y,v)=>{const E=y.sortKey??(typeof y.accessor=="string"?y.accessor:void 0);return E?v[E]:void 0},q=y=>y.sortable??(!!y.sortKey||typeof y.accessor=="string"),R=u.useMemo(()=>{if(!Te||!he)return r;const y=fe.find(E=>E.key===he.key);if(!y)return r;const v=he.direction==="asc"?1:-1;return[...r].sort((E,J)=>li(I(y.col,E),I(y.col,J))*v)},[r,Te,he,fe]),P=!He&&!_,Y=!!l&&P,[ve,Se]=Z.useColumnWidths(l??""),Me=Y?ve:void 0,ke=u.useRef(null),[me,tt]=u.useState();u.useLayoutEffect(()=>{tt(void 0)},[G]),u.useLayoutEffect(()=>{if(!P||me||!ke.current)return;const y=ke.current.querySelectorAll("th.sa-tl-leaf");tt(Array.from(y).map(v=>v.offsetWidth))},[me,P]);const[Xe,Ke]=u.useState(0);u.useLayoutEffect(()=>{if(!He||!ke.current)return;const y=ke.current.querySelector(":scope > tr");y&&Ke(y.offsetHeight)},[He,G]);const qe=(y,v)=>{if((Me==null?void 0:Me[v])!=null)return Me[v];if(y.width!=null)return y.width;if((me==null?void 0:me[v])!=null)return me[v]},bt=(y,v)=>typeof y.width=="number"?y.width:me==null?void 0:me[v],rt=ge.frozenKey&&!He&&!_?fe.findIndex(y=>y.key===ge.frozenKey):-1,nt=y=>y<=rt,Br=b?ft:0,Fr=y=>{if(!me)return Br;let v=Br;for(let E=0;E<y;E++)v+=me[E]??0;return v},qt=u.useRef(null),[io,lo]=u.useState("100vh");u.useLayoutEffect(()=>{if(M!==void 0)return;const y=()=>{if(qt.current){const v=qt.current.getBoundingClientRect().top;lo(`calc(100vh - ${v}px)`)}};return y(),window.addEventListener("resize",y),()=>window.removeEventListener("resize",y)},[M]);const Ge=(y,v)=>n?n(y,v):v,Zt=F!==void 0,[Er,co]=u.useState(()=>new Set(N??[])),Qe=u.useMemo(()=>Zt?new Set(F):Er,[Zt,F,Er]);u.useEffect(()=>{b&&!n&&process.env.NODE_ENV!=="production"&&console.warn("[@starasia/admin] TableLayout: `selectable` tanpa `getRowKey` — key default (index) membuat seleksi menempel ke POSISI baris, bukan datanya. Beri `getRowKey` yang stabil (mis. r => r.id).")},[b,!n]);const Mr=y=>{if(Zt||co(y),A){const v=R.filter((E,J)=>y.has(Ge(E,J)));A(Array.from(y),v)}},Gt=(y,v)=>b&&(H?H(y,v):!0),Qt=y=>{const v=new Set(Qe);v.has(y)?v.delete(y):v.add(y),Mr(v)},ot=u.useMemo(()=>b?R.map((y,v)=>({row:y,i:v,key:Ge(y,v)})).filter(({row:y,i:v})=>H?H(y,v):!0).map(({key:y})=>y):[],[b,R,H,n]),Lr=ot.filter(y=>Qe.has(y)),Ut=ot.length>0&&Lr.length===ot.length,Tr=Lr.length>0&&!Ut,ao=()=>{const y=new Set(Qe);Ut?ot.forEach(v=>y.delete(v)):ot.forEach(v=>y.add(v)),Mr(y)},Jt=(y,v,E)=>y.render?y.render(v,E,R):ii(v,y.accessor),Yt=fe.length+(b?1:0)+(ne?1:0),Ir=["80%","55%","70%","45%","90%","60%"],uo=(y,v)=>Ir[(y*7+v*3)%Ir.length],xo=(y,v)=>e.jsx(Oe.Skeleton,{height:14,width:uo(y,v),borderRadius:"rounded-sm"}),ho=Array.from({length:z},(y,v)=>e.jsxs(Z.Tr,{children:[b&&e.jsx(Z.Td,{style:{width:ft,padding:0},children:e.jsx("div",{style:{display:"flex",justifyContent:"center"},children:e.jsx(Oe.Skeleton,{height:14,width:14,borderRadius:"rounded-sm"})})}),fe.map(({col:E,key:J},te)=>e.jsx(Z.Td,{style:{textAlign:Ft(E.align)},children:xo(v,te)},`sa-tl-sk-${v}-${J}`)),ne&&e.jsx(Z.Td,{style:{width:1,padding:0,border:"none"}})]},`sa-tl-sk-${v}`)),fo=(y,v)=>{v||ze({...ge,hidden:[...ge.hidden??[],y]})},mo=y=>ze({...ge,frozenKey:ge.frozenKey===y?void 0:y}),vt=y=>(W??[]).filter(v=>{var E;return!((E=v.hidden)!=null&&E.call(v,y))}),Or={position:"absolute",right:0,top:0,bottom:0,display:"flex",alignItems:"center",gap:4,paddingRight:16,paddingLeft:40,background:"linear-gradient(to right, transparent, var(--sa-background-primary-inverse, #f8f8f8) 40px)"},Ct=(y,v,E,J)=>{var Le;const te=(Le=y.disabled)==null?void 0:Le.call(y,v),ae=(J==null?void 0:J.showLabel)??y.showLabel,le=(J==null?void 0:J.size)??"xs",ye=e.jsx(V.Button,{size:le,variant:y.variant??"tertiary",tone:y.tone??"neutral",disabled:te,onClick:()=>y.onClick(v,E),iconLeft:y.icon?e.jsx(B.Icon,{name:y.icon,size:"sm"}):void 0,children:ae&&y.label}),pe=y.tooltip;return pe?e.jsx(we.Tooltip,{label:pe,position:"top-end",children:ye}):ye},go=(y,v)=>{const E=vt(y);if(!E.length)return null;if(E.length>5){const te=Ge(y,v),ae=(ee==null?void 0:ee.rowKey)===te;return e.jsx("div",{className:"sa-tl-row-actions",style:Or,onClick:le=>le.stopPropagation(),children:e.jsx(we.Tooltip,{label:"Aksi lainnya",position:"top",children:e.jsx(V.Button,{size:"xs",variant:"tertiary",onClick:le=>{const ye=le.currentTarget.getBoundingClientRect();ie(ae?null:{rowKey:te,top:ye.bottom+4,right:window.innerWidth-ye.right})},children:e.jsx(B.Icon,{name:"MenuVertical",size:"sm"})})})})}return e.jsx("div",{className:"sa-tl-row-actions",style:Or,children:E.map(te=>e.jsx(u.Fragment,{children:Ct(te,y,v)},te.key))})},yo=(y,v)=>{const E=vt(y);return E.length?e.jsx("div",{style:{display:"flex",gap:6,flexWrap:"wrap",paddingTop:8,marginTop:8,borderTop:kt},children:E.map(J=>e.jsx(u.Fragment,{children:Ct(J,y,v,{showLabel:!0,size:"sm"})},J.key))}):null},po=(y,v)=>{const E=vt(y);return E.length?e.jsx("div",{style:{display:"flex",gap:4,paddingRight:8,flexShrink:0},children:E.map(J=>e.jsx(u.Fragment,{children:Ct(J,y,v,{showLabel:!1})},J.key))}):null},Xt=(y,v)=>{const{col:E,key:J}=y,te=k.get(J)??0,ae=nt(te),le=ae&&te===rt,ye=(he==null?void 0:he.key)===J?he.direction:null,pe=h&&!E.disableMenu?e.jsx(eo,{active:!!ye||ae,canSort:q(E),canHide:!E.locked,sortDir:ye,frozen:ae,onSort:ht=>_e({key:J,direction:ht}),onClearSort:()=>_e(null),onToggleFreeze:()=>mo(J),onHide:()=>fo(J,E.locked)}):null,Le=E.align==="right",xt=E.align==="right"?"flex-end":E.align==="center"?"center":"flex-start",Pe=e.jsxs("span",{style:{flex:1,minWidth:0,display:"flex",alignItems:"center",gap:6,justifyContent:xt,overflow:"hidden"},children:[E.icon&&e.jsx(B.Icon,{name:E.icon,size:"sm",style:{flexShrink:0}}),e.jsx("span",{style:Bt,children:E.title})]});return e.jsx(Z.Th,{className:`sa-tl-leaf${ae?" sa-tl-frozen":""}`,rowSpan:v==null?void 0:v.rowSpan,colSpan:v==null?void 0:v.colSpan,minWidth:E.minWidth,resizable:P?E.resizable:!1,defaultWidth:bt(E,te),style:{textAlign:Ft(E.align),width:qe(E,te),position:"sticky",top:(v==null?void 0:v.top)??0,left:ae?Fr(te):void 0,zIndex:ae?3:2,backgroundColor:st,boxShadow:le?gn:void 0},children:e.jsx("div",{style:{display:"flex",alignItems:"center",gap:6,width:"100%"},children:Le?e.jsxs(e.Fragment,{children:[pe,Pe]}):e.jsxs(e.Fragment,{children:[Pe,pe]})})},`th-${J}`)},jo=()=>{const y=[];for(let v=0;v<fe.length;){const E=fe[v],J=E.col.headerColSpan??1,te=Math.max(1,Math.min(J,fe.length-v));y.push(Xt(E,te>1?{colSpan:te}:void 0)),v+=te}return y},Wr=y=>e.jsx(Z.Th,{rowSpan:y==null?void 0:y.rowSpan,style:{width:ft,position:"sticky",top:0,left:0,zIndex:4,backgroundColor:st,padding:0},children:e.jsx("div",{style:{display:"flex",alignItems:"center",justifyContent:"center"},onClick:v=>v.stopPropagation(),children:e.jsx(Ze.Checkbox,{size:"sm",variant:Tr?"indeterminate":"select",checked:Ut||Tr,disabled:ot.length===0,onChange:ao,"aria-label":"Pilih semua baris di halaman ini"})})},"th-select"),bo=(y,v,E)=>{const J=Ge(y,v);return e.jsx(Z.Td,{className:"sa-tl-frozen",style:{width:ft,padding:0,position:"sticky",left:0,zIndex:2,...E?{"--sa-tl-bg":E}:{}},children:e.jsx("div",{style:{display:"flex",alignItems:"center",justifyContent:"center"},onClick:te=>te.stopPropagation(),children:e.jsx(Ze.Checkbox,{size:"sm",checked:Qe.has(J),disabled:!Gt(y,v),onChange:()=>Qt(J),"aria-label":"Pilih baris"})})},`tl-select-${v}`)},Kt=fe.filter(y=>!y.col.hideOnMobile),$t=Kt.find(y=>y.col.primary)??Kt[0],vo=Kt.filter(y=>y!==$t),Co=y=>Q(v=>{const E=new Set(v);return E.has(y)?E.delete(y):E.add(y),E}),Rr=(y,v)=>vo.map(({col:E,key:J})=>{const te=Jt(E,y,v),ae=typeof te=="string"||typeof te=="number"?e.jsx(D.Text,{style:{minWidth:0,overflow:"hidden",textOverflow:"ellipsis",textAlign:"right"},children:te}):e.jsx("div",{style:{minWidth:0,overflow:"hidden",textOverflow:"ellipsis",textAlign:"right"},children:te});return e.jsxs("div",{style:{display:"flex",gap:12,justifyContent:"space-between",alignItems:"baseline"},children:[typeof E.title=="string"?e.jsx(D.Text,{color:"subtle",fontWeight:"medium",style:{color:ni,flexShrink:0},children:E.title}):e.jsx("div",{style:{flexShrink:0},children:E.title}),ae]},J)}),er=(y,v)=>{const E=$t?Jt($t.col,y,v):null;return typeof E=="string"||typeof E=="number"?e.jsx(D.Text,{as:"span",style:Bt,children:E}):e.jsx("span",{style:Bt,children:E})},wo=e.jsx(f.Box,{style:{display:"flex",flexDirection:"column",gap:8,padding:8},children:Array.from({length:z},(y,v)=>e.jsxs(f.Box,{style:{border:kt,borderRadius:"var(--sa-radii-sm, 6px)",padding:12,display:"flex",flexDirection:"column",gap:8},children:[e.jsx(Oe.Skeleton,{height:16,width:"60%",borderRadius:"rounded-sm"}),e.jsx(Oe.Skeleton,{height:12,width:"85%",borderRadius:"rounded-sm"}),e.jsx(Oe.Skeleton,{height:12,width:"70%",borderRadius:"rounded-sm"})]},`sa-tl-sk-card-${v}`))}),zr=e.jsx(f.Box,{fullWidth:!0,style:{minHeight:(w==null?void 0:w.minHeight)??320,display:"flex",alignItems:"center",justifyContent:"center",padding:16},children:w==null?void 0:w.content}),Do=C?wo:R.length===0?zr:p==="expand"?e.jsx(f.Box,{style:{display:"flex",flexDirection:"column"},children:R.map((y,v)=>{const E=Ge(y,v),J=K.has(E),ae=b&&Qe.has(E)?ar:Et(s==null?void 0:s(y,v));return e.jsxs("div",{style:{borderBottom:kt,backgroundColor:ae},children:[e.jsxs("div",{style:{display:"flex",alignItems:"center"},children:[b&&e.jsx("div",{style:{display:"flex",alignItems:"center",paddingLeft:12,flexShrink:0},children:e.jsx(Ze.Checkbox,{size:"sm",checked:Qe.has(E),disabled:!Gt(y,v),onChange:()=>Qt(E),"aria-label":"Pilih baris"})}),e.jsxs("button",{type:"button",onClick:()=>Co(E),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:[er(y,v),e.jsx(B.Icon,{name:J?"ChevronUp":"ChevronDown",size:"sm",style:{flexShrink:0}})]}),ne&&po(y,v)]}),J&&e.jsx("div",{style:{padding:"0 12px 12px",display:"flex",flexDirection:"column",gap:6},children:Rr(y,v)})]},E)})}):e.jsx(f.Box,{style:{display:"flex",flexDirection:"column",gap:8,padding:8},children:R.map((y,v)=>{const E=Ge(y,v),J=b&&Qe.has(E);return e.jsxs(f.Box,{style:{border:kt,borderRadius:"var(--sa-radii-sm, 6px)",padding:12,display:"flex",flexDirection:"column",gap:6,backgroundColor:J?ar:Et(s==null?void 0:s(y,v))},children:[b?e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8},children:[e.jsx(Ze.Checkbox,{size:"sm",checked:Qe.has(E),disabled:!Gt(y,v),onChange:()=>Qt(E),"aria-label":"Pilih baris"}),e.jsx("div",{style:{flex:1,minWidth:0},children:er(y,v)})]}):er(y,v),Rr(y,v),ne&&yo(y,v)]},E)})}),So=i&&P&&me!==void 0,Ar=c==="fixed"&&!i&&(P?me!==void 0:!0),ko=Ar&&!P,Bo=e.jsxs(Z.Table,{className:"sa-table-layout",fullWidth:!0,size:o,resizable:So,style:Ar?{tableLayout:"fixed"}:void 0,onWidthsChange:Y?Se:void 0,children:[ko&&e.jsxs("colgroup",{children:[b&&e.jsx("col",{style:{width:ft}}),fe.map(({col:y,key:v},E)=>e.jsx("col",{style:{width:qe(y,E)}},`col-${v}`)),ne&&e.jsx("col",{style:{width:1}})]}),e.jsx(Z.Thead,{ref:ke,children:He?e.jsxs(e.Fragment,{children:[e.jsxs(Z.Tr,{children:[b&&Wr({rowSpan:2}),Ie.map(y=>y.isGroup?e.jsx(Z.Th,{colSpan:y.leaves.length,style:{textAlign:"center",position:"sticky",top:0,zIndex:2,backgroundColor:st},children:e.jsx("span",{style:Bt,children:y.col.title})},`grp-${y.key}`):Xt(y.leaves[0],{rowSpan:2})),ne&&e.jsx(Z.Th,{rowSpan:2,style:{position:"sticky",top:0,right:0,zIndex:3,width:1,padding:0,border:"none",backgroundColor:st}})]}),e.jsx(Z.Tr,{children:Ie.flatMap(y=>y.isGroup?y.leaves.map(v=>Xt(v,{top:Xe})):[])})]}):e.jsxs(Z.Tr,{children:[b&&Wr(),jo(),ne&&e.jsx(Z.Th,{style:{position:"sticky",top:0,right:0,zIndex:3,width:1,padding:0,border:"none",backgroundColor:st}})]})}),e.jsx(Z.Tbody,{children:C?ho:R.length===0?e.jsx(Z.Tr,{children:e.jsx(Z.Td,{colSpan:Yt,children:zr})}):e.jsxs(e.Fragment,{children:[R.map((y,v)=>{const E=S==null?void 0:S(y,v,v>0?R[v-1]:void 0),te=b&&Qe.has(Ge(y,v))?ar:Et(s==null?void 0:s(y,v));return e.jsxs(u.Fragment,{children:[E!=null&&E!==!1&&e.jsx(Z.Tr,{children:e.jsx(Z.Td,{colSpan:Yt,style:{backgroundColor:st},children:E})}),e.jsxs(Z.Tr,{children:[b&&bo(y,v,te),fe.map(({col:ae,key:le},ye)=>{var Hr;const pe=(Hr=ae.cellProps)==null?void 0:Hr.call(ae,y,v,R);if(pe!=null&&pe.hidden)return null;const Le=nt(ye),xt=Le&&ye===rt,Pe=Jt(ae,y,v),ht=typeof ae.bg=="function"?ae.bg(y,v,R):ae.bg,Vr=Et(ht)??te;return e.jsx(Z.Td,{className:Le?"sa-tl-frozen":void 0,colSpan:pe==null?void 0:pe.colSpan,rowSpan:pe==null?void 0:pe.rowSpan,style:{textAlign:Ft(ae.align),width:qe(ae,ye),minWidth:ae.minWidth,position:Le?"sticky":void 0,left:Le?Fr(ye):void 0,zIndex:Le?1:void 0,boxShadow:xt?gn:void 0,...Vr?{"--sa-tl-bg":Vr}:{}},children:typeof Pe=="string"?e.jsx(D.Text,{style:{whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",textAlign:Ft(ae.align)},children:Pe}):Pe},`tl-cell-${v}-${le}`)}),ne&&e.jsx(Z.Td,{style:{position:"sticky",right:0,width:1,padding:0,overflow:"visible",zIndex:2,border:"none"},children:go(y,v)})]})]},Ge(y,v))}),T!=null&&e.jsx(Z.Tr,{children:e.jsx(Z.Td,{colSpan:Yt,children:T})})]})})]}),tr=ee?R.findIndex((y,v)=>Ge(y,v)===ee.rowKey):-1,rr=tr>=0?R[tr]:null;return e.jsxs(e.Fragment,{children:[e.jsx(f.Box,{ref:qt,fullWidth:!0,style:{overflow:"auto",height:M??io},children:re?Do:Bo}),ee&&rr&&e.jsx("div",{className:"sa-tl-kebab-menu",style:{top:ee.top,right:ee.right},onClick:y=>y.stopPropagation(),children:vt(rr).map(y=>e.jsx("div",{style:{padding:"2px 4px"},children:Ct(y,rr,tr,{showLabel:!0,size:"sm"})},y.key))})]})},dr=t=>t==="asc"||t==="desc",ai=(t={})=>{const{sortKeyParam:r="sortBy",sortOrderParam:n="sortOrder",pageKey:s="page",defaultSort:o=null,paramKeys:i,scopeId:c,storage:l=kr}=t,{searchParams:a,setSearchParams:d,searchQueries:h}=Be(),g=a.toString(),m=c?ut.tableSort(c):void 0,j=u.useRef(!1);u.useEffect(()=>{if(j.current||(j.current=!0,!m)||a.has(r)||a.has(n))return;const w=l.get(m);!(w!=null&&w.key)||!dr(w.direction)||d({...Object.fromEntries(a.entries()),[r]:w.key,[n]:w.direction})},[]);const M=u.useMemo(()=>{const w=a.get(r),C=a.get(n);return w&&dr(C)?{key:w,direction:C}:o},[g,r,n,o]);u.useEffect(()=>{if(!m)return;const w=a.get(r),C=a.get(n);w&&dr(C)?l.set(m,{key:w,direction:C}):l.remove(m)},[g,m,r,n,l]);const p=(i==null?void 0:i.sortBy)??"sortBy",L=(i==null?void 0:i.sortOrder)??"sortOrder",S=u.useMemo(()=>M?{[p]:M.key,[L]:M.direction}:{},[M,p,L]),T=u.useCallback(w=>{const C={...h};w?(C[r]=w.key,C[n]=w.direction):(delete C[r],delete C[n]),delete C[s],d(C)},[h,r,n,s,d]);return{sort:M,setSort:T,params:S}},Vt=({of:t,render:r})=>u.Children.toArray(t==null?void 0:t.map((n,s,o)=>r(n,s,o))),se=({condition:t,fallback:r,children:n,loading:s,isLoading:o})=>e.jsx(e.Fragment,{children:o?s:t?n:r}),de=t=>e.jsx(D.Text,{...t,fontFamily:"Poppins",fontSize:t.fontSize||"md",fontWeight:t.fontWeight||"medium",color:t.color||"gray-700",children:t.children}),Ue=t=>e.jsx(D.Text,{color:"red-600",fontSize:"sm",children:t.message}),di=({size:t="md",direction:r="vertical",requiredTitle:n="(Required)",fullWidth:s=!1,...o})=>{var l,a,d;const i=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(se,{condition:!!o.inputProps.required,fallback:e.jsxs(f.Box,{direction:"column",customMaxWidth:c,fullWidth:s,children:[e.jsx(de,{children:o.title}),e.jsx(D.Text,{fontSize:t,color:"gray-500",children:o.description})]}),children:e.jsxs(f.Box,{direction:"column",customMaxWidth:c,fullWidth:s,children:[e.jsxs(oe.Flex,{direction:"row",gap:"xs",align:"center",children:[e.jsx(de,{fontSize:t,children:o.title}),e.jsx(de,{color:"error",fontSize:t,children:n}),e.jsx(se,{condition:!!((l=o.tooltip)!=null&&l.label),children:e.jsx(we.Tooltip,{label:(a=o.tooltip)==null?void 0:a.label,arrowPosition:(d=o.tooltip)==null?void 0:d.arrowPosition,...o.tooltip,children:e.jsx(B.Icon,{name:"InfoCircle",size:t==="lg"?"sm":"xs",style:{color:"var(--sa-color-info-500, #00abeb)",marginTop:"6px"}})})})]}),e.jsx(se,{condition:!!o.description,children:e.jsx(D.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(Ye.Input,{ref:o.inputRef,size:t,...o.inputProps,status:o.errorMessage?"error":"default",fullWidth:!0}),!i&&o.errorMessage&&e.jsx(Ue,{message:o.errorMessage}),o.inputProps.extended&&o.inputProps.extended]})]})},ui=({size:t="md",direction:r="vertical",requiredTitle:n="(Required)",fullWidth:s=!1,...o})=>{var l,a,d;const i=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(se,{condition:!!o.inputProps.required,fallback:e.jsxs(f.Box,{direction:"column",customMaxWidth:c,fullWidth:s,children:[e.jsx(de,{children:o.title}),e.jsx(D.Text,{fontSize:t,color:"gray-500",children:o.description})]}),children:e.jsxs(f.Box,{direction:"column",customMaxWidth:c,fullWidth:s,children:[e.jsxs(oe.Flex,{direction:"row",gap:"xs",align:"center",children:[e.jsx(de,{fontSize:t,children:o.title}),e.jsx(de,{color:"error",fontSize:t,children:n}),e.jsx(se,{condition:!!((l=o.tooltip)!=null&&l.label),children:e.jsx(we.Tooltip,{label:(a=o.tooltip)==null?void 0:a.label,arrowPosition:(d=o.tooltip)==null?void 0:d.arrowPosition,...o.tooltip,children:e.jsx(B.Icon,{name:"InfoCircle",size:t==="lg"?"sm":"xs",style:{color:"var(--sa-color-info-500, #00abeb)",marginTop:"6px"}})})})]}),e.jsx(se,{condition:!!o.description,children:e.jsx(D.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(ct.Dropdown,{size:t,...o.inputProps,error:!!o.errorMessage})}),!i&&o.errorMessage&&e.jsx(Ue,{message:o.errorMessage}),o.inputProps.extended&&o.inputProps.extended]})]})},xi=(t,r)=>typeof t=="string"&&t||r==="error"?"var(--sa-border-danger)":"var(--sa-border-subtle)",hi=t=>{var l;const[r,n]=u.useState(!1),s=a=>{a.preventDefault(),a.stopPropagation()},o=a=>{a.preventDefault(),a.stopPropagation(),a.dataTransfer&&t.handleOnFileChange(a.dataTransfer.files.item(0))},i=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:s,onDrop:o,onDragEnter:i,onDragLeave:c,paddingBlock:"md",borderRadius:"rounded-md",style:{border:r?"1px solid var(--sa-border-info)":`1px solid ${xi(t.errorMessage,t.status)}`},children:[e.jsx(B.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(D.Text,{fontWeight:"medium",color:"gray-500",style:{textWrap:"nowrap"},fontSize:t.isDesktop?"md":"sm",children:"Click your upload"}),e.jsx(D.Text,{fontWeight:"medium",style:{textWrap:"nowrap"},fontSize:t.isDesktop?"md":"sm",children:"or Drag & Drop"})]}),e.jsx(D.Text,{fontSize:"sm",color:"gray-500",children:(l=t.fileSupports)==null?void 0:l.map(a=>a.toLocaleUpperCase()).join(", ")})]})]})};function fi(t){return t.split(" ").map(r=>r[0]).join("").slice(0,2).toUpperCase()}const to=t=>{const r={day:"2-digit",month:"short",year:"numeric"};return t.toLocaleDateString("id-ID",r)},mi=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 s=parseInt(n[0],10),o=r[n[1]],i=parseInt(n[2],10);return isNaN(s)||isNaN(o)||isNaN(i)?null:new Date(i,o,s)};function gi(t,r=!0){if(!t)return"Rp 0";const n=typeof t=="number"?t.toString():t;if(isNaN(Number(n)))return"Rp 0";const s=n.split("."),o=s[0].replace(/\B(?=(\d{3})+(?!\d))/g,"."),i=s.length===2?o+"."+s[1]:o;return r?"Rp"+i:i}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 yi=t=>{const r=t.split(" ");let n=r[0].charAt(0);return r.length>1&&(n+=""+r[1].charAt(0)),n.toUpperCase()};function pi(t){const r=typeof t=="string"?new Date(t):t;if(isNaN(r.getTime()))throw new Error("Invalid date format");const n=r.getFullYear(),s=String(r.getMonth()+1).padStart(2,"0"),o=String(r.getDate()).padStart(2,"0");return`${n}-${s}-${o}`}const ji="sa-admin",Ne=t=>`var(--${ji}-${t})`,bi={base:{borderColor:Ne("base-border-color"),textColor:Ne("base-text-color"),iconColor:Ne("base-icon-color"),placeholderColor:Ne("base-placeholder-color")},document:{bgColor:Ne("document-bg-color")},sidebar:{bgColor:Ne("sidebar-bg-color"),borderColor:Ne("sidebar-border-color"),maxWidth:Ne("sidebar-max-width"),width:Ne("sidebar-width"),collapseWidth:Ne("sidebar-collapse-width"),collapseV2Width:Ne("sidebar-v2-collapse-width")}},vi=24*60*60*1e3,Ci=t=>{const r="14px poppins",s=document.createElement("canvas").getContext("2d");s.font=r;const o=s.measureText(t).width;return Number(Math.ceil(o))},wi=/^[^\s@]+@[^\s@]+\.[^\s@]+$/,Di=/--+/,Si=/-$/;function ki(t,r){return JSON.stringify(t)!==JSON.stringify(r)}function Bi(t){return/^(?:\+62|62|0)8[1-9][0-9]{7,10}$/.test(t)}function Fi(t){return/^[A-Za-z\s]+$/.test(t)}const Ei=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()},Mi=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()},Li=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()},Ti=t=>wi.test(t);function Ii(t){return!(Di.test(t)||Si.test(t))}const Oi=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()},Wi=t=>{const r=document.getElementById(t);if(r){const n=r.getBoundingClientRect(),s=window.scrollY+n.top-80;window.scrollTo({top:s,behavior:"smooth"})}};function Ri(t){const r=t.toLowerCase();if(["kb","mb","gb"].find(i=>r.endsWith(i)))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 Ai=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(B.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(D.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(D.Text,{fontSize:"sm",fontWeight:"medium",children:t.defaultFile.size}),t.defaultFile.size&&t.defaultFile.date&&e.jsx(B.Icon,{name:"Dot",size:"xs"}),t.defaultFile.date&&e.jsx(D.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(D.Text,{fontSize:"sm",fontWeight:"medium",children:Ri(((n=t.fileSelected)==null?void 0:n.size.toString())||"100000")}),e.jsx(B.Icon,{name:"Dot",size:"xs"}),e.jsx(D.Text,{fontSize:"sm",fontWeight:"medium",style:{textWrap:"nowrap"},children:to(new Date)})]})]})]}),e.jsx(V.Button,{size:"xs",variant:"tertiary",tone:"error",type:"button",onClick:s=>{s.stopPropagation(),t.handleOnDeleteFile()},iconLeft:e.jsx(B.Icon,{name:"Trash1"})})]})},ro=({status:t="default",labelPosition:r="outside-top",...n})=>{var m;const s=u.useRef(null),o=()=>{if(n.defaultFile){window.open(n.defaultFile.url);return}s.current&&s.current.click()},i=je.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(D.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(D.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(D.Text,{style:{fontSize:"12px",fontWeight:400,color:"var(--sa-text-subtlest, #6b6e76)",lineHeight:"18px"},children:n.helperText}),n.errorText&&t==="error"&&e.jsx(D.Text,{style:{fontSize:"12px",fontWeight:400,color:"var(--sa-text-error, #a4133c)",lineHeight:"18px"},children:n.errorText}),n.errorMessage&&!n.errorText&&e.jsx(D.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:s,onChange:j=>{var M;return n.handleOnChangeFile(((M=j.target.files)==null?void 0:M.item(0))||null)},accept:(m=n.fileSupportOption)==null?void 0:m.map(j=>"."+(j==null?void 0:j.toLowerCase())).join(", ")}),g=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(Ai,{fileSelected:n.fileSelected,defaultFile:n.defaultFile,handleOnDeleteFile:n.handleOnDeleteFile,handleOnClickFile:o}),!n.fileSelected&&!n.defaultFile&&e.jsx(hi,{fileSupports:n.fileSupportOption,isDesktop:i,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:[g,d]})]}):e.jsxs(oe.Flex,{direction:"column",gap:"sm",style:{width:"100%"},children:[l,a,g,d]})},Vi=({size:t="md",direction:r="vertical",requiredTitle:n="(Required)",fullWidth:s=!1,...o})=>{var l,a,d;const i=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(se,{condition:!!o.inputProps.required,fallback:e.jsxs(f.Box,{direction:"column",customMaxWidth:c,fullWidth:s,children:[e.jsx(de,{children:o.title}),e.jsx(D.Text,{fontSize:t,color:"gray-500",children:o.description})]}),children:e.jsxs(f.Box,{direction:"column",customMaxWidth:c,fullWidth:s,children:[e.jsxs(oe.Flex,{direction:"row",gap:"xs",align:"center",children:[e.jsx(de,{fontSize:t,children:o.title}),e.jsx(de,{color:"error",fontSize:t,children:n}),e.jsx(se,{condition:!!((l=o.tooltip)!=null&&l.label),children:e.jsx(we.Tooltip,{label:(a=o.tooltip)==null?void 0:a.label,arrowPosition:(d=o.tooltip)==null?void 0:d.arrowPosition,...o.tooltip,children:e.jsx(B.Icon,{name:"InfoCircle",size:t==="lg"?"sm":"xs",style:{color:"var(--sa-color-info-500, #00abeb)",marginTop:"6px"}})})})]}),e.jsx(se,{condition:!!o.description,children:e.jsx(D.Text,{fontSize:t,color:"gray-500",children:o.description})})]})}),e.jsxs(oe.Flex,{direction:"column",gap:"xs",children:[e.jsx(ro,{...o.inputProps,status:o.errorMessage?"error":"default"}),!i&&o.errorMessage&&e.jsx(Ue,{message:o.errorMessage})]})]})},Hi=({size:t="md",direction:r="vertical",requiredTitle:n="(Required)",fullWidth:s=!1,required:o=!1,...i})=>{var a,d,h,g;const c=i.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",...i.containerProps,children:[i.title&&e.jsx(se,{condition:!!o,fallback:e.jsxs(f.Box,{direction:"column",customMaxWidth:l,fullWidth:s,children:[e.jsx(de,{children:i.title}),e.jsx(Re.Body3,{props:{color:"gray-500"},children:i.description})]}),children:e.jsxs(f.Box,{direction:"column",customMaxWidth:l,fullWidth:s,children:[e.jsxs(oe.Flex,{direction:"row",gap:"xs",align:"center",children:[e.jsx(de,{fontSize:t,children:i.title}),e.jsx(de,{color:"error",fontSize:t,children:n}),e.jsx(se,{condition:!!((a=i.tooltip)!=null&&a.label),children:e.jsx(we.Tooltip,{label:(d=i.tooltip)==null?void 0:d.label,arrowPosition:(h=i.tooltip)==null?void 0:h.arrowPosition,...i.tooltip,children:e.jsx(B.Icon,{name:"InfoCircle",size:t==="lg"?"sm":"xs",style:{color:"var(--sa-color-info-500, #00abeb)",marginTop:"6px"}})})})]}),e.jsx(se,{condition:!!i.description,children:e.jsx(D.Text,{fontSize:t,color:"gray-500",children:i.description})})]})}),e.jsx(f.Box,{gap:r==="horizontal-inline"?"xl":"md",direction:r==="horizontal-inline"?"row":"column",align:"flex-start",children:e.jsx(Vt,{of:(g=i.checkBoxesList)==null?void 0:g.map(m=>({...m,isChecked:i.checkBoxesAreChecked.includes(m.id)})),render:m=>m.renderBadge?e.jsxs(f.Box,{direction:"row",justify:"space-between",gap:"lg",...i.badgeContainerProps,children:[e.jsx(Ze.Checkbox,{name:m.name,value:m.id,checked:m.isChecked,onChange:j=>i.onChecked(j.target.value,m),label:m.name,description:m.description}),m.renderBadge]}):e.jsx(Ze.Checkbox,{name:m.name,value:m.id,checked:m.isChecked,onChange:j=>i.onChecked(j.target.value,m),label:m.name,description:m.description})})}),!c&&i.errorMessage&&e.jsx(Ue,{message:i.errorMessage})]})},Pi=({position:t="vertical",size:r="md",fullWidth:n=!1,...s})=>{var i;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(se,{condition:!!s.description||!!s.title,children:e.jsxs(f.Box,{direction:"column",customMaxWidth:o,fullWidth:n,children:[s.title&&e.jsx(de,{children:s.title}),e.jsx(se,{condition:!!s.description,children:e.jsx(D.Text,{color:"gray-500",children:s.description})})]})}),e.jsx(f.Box,{gap:"sm",direction:t==="horizontal"||t==="horizontal-inline"?"row":"column",align:"flex-start",flexWrap:"wrap",children:e.jsx(Vt,{of:(i=s.radioList)==null?void 0:i.map(c=>({...c,isChecked:s.radioIsChecked===c.id})),render:({value:c,id:l,isChecked:a,subInput:d,label:h,description:g})=>e.jsxs(f.Box,{direction:"column",gap:"xs",customMaxWidth:o,children:[e.jsx(fr.Radio,{id:`${l.toString()}-${c}`,name:s.groupName||h,label:h,value:c,checked:a,onChange:m=>s.onChecked({id:l,label:m.target.name,value:m.target.value}),disabled:s.disableAll},l),g&&e.jsx(D.Text,{color:"gray-500",style:{marginLeft:28},children:g}),d]})})}),s.errorMessage&&e.jsx(Ue,{message:s.errorMessage})]})},Ni=({size:t="md",direction:r="vertical",requiredTitle:n="(Required)",fullWidth:s=!1,...o})=>{var l,a,d;const i=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(se,{condition:!!o.inputProps.required,fallback:e.jsxs(f.Box,{direction:"column",customMaxWidth:c,fullWidth:s,children:[e.jsx(de,{children:o.title}),e.jsx(D.Text,{fontSize:t,color:"gray-500",children:o.description})]}),children:e.jsxs(f.Box,{direction:"column",customMaxWidth:c,fullWidth:s,children:[e.jsxs(oe.Flex,{direction:"row",gap:"xs",align:"center",children:[e.jsx(de,{fontSize:t,children:o.title}),e.jsx(de,{color:"error",fontSize:t,children:n}),e.jsx(se,{condition:!!((l=o.tooltip)!=null&&l.label),children:e.jsx(we.Tooltip,{label:(a=o.tooltip)==null?void 0:a.label,arrowPosition:(d=o.tooltip)==null?void 0:d.arrowPosition,...o.tooltip,children:e.jsx(B.Icon,{name:"InfoCircle",size:t==="lg"?"sm":"xs",style:{color:"var(--sa-color-info-500, #00abeb)",marginTop:"6px"}})})})]}),e.jsx(se,{condition:!!o.description,children:e.jsx(D.Text,{fontSize:t,color:"gray-500",children:o.description})})]})}),e.jsxs(oe.Flex,{direction:"column",gap:"xs",children:[e.jsx(hr.Textarea,{ref:o.inputRef,size:t,...o.inputProps,status:o.errorMessage?"error":"default"}),!i&&o.errorMessage&&e.jsx(Ue,{message:o.errorMessage})]})]})},_i=({size:t="md",direction:r="vertical",requiredTitle:n="(Required)",required:s=!1,fullWidth:o=!1,...i})=>{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",...i.containerProps,children:[i.title&&e.jsx(se,{condition:s,fallback:e.jsxs(f.Box,{direction:"column",customMaxWidth:c,fullWidth:o,children:[e.jsx(de,{children:i.title}),e.jsx(D.Text,{fontSize:t,color:"gray-500",children:i.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(de,{fontSize:t,children:i.title}),e.jsx(de,{color:"error",fontSize:t,children:n}),e.jsx(se,{condition:!!((l=i.tooltip)!=null&&l.label),children:e.jsx(we.Tooltip,{label:(a=i.tooltip)==null?void 0:a.label,arrowPosition:(d=i.tooltip)==null?void 0:d.arrowPosition,...i.tooltip,children:e.jsx(B.Icon,{name:"InfoCircle",size:t==="lg"?"sm":"xs",style:{color:"var(--sa-color-info-500, #00abeb)",marginTop:"6px"}})})})]}),e.jsx(se,{condition:!!i.titleDescription,children:e.jsx(D.Text,{fontSize:t,color:"gray-500",children:i.titleDescription})})]})}),e.jsx(dt.Toggle,{checked:i.checked,onChange:i.onChange,label:i.label,description:i.description}),i.errorMessage&&e.jsx(Ue,{message:i.errorMessage})]})},qi=({variant:t="primary",size:r="md",...n})=>{const s=lt.useColor(),o=c=>{var a,d,h,g,m,j;if(!c)return;const l=n.disabled?"var(--sa-text-disable, #181a198f)":t==="secondary"?"var(--sa-text-subtle, #8c8f97)":t==="secondary-danger"?(d=(a=s==null?void 0:s.computed)==null?void 0:a.red)==null?void 0:d[600]:t==="secondary-primary"?(g=(h=s==null?void 0:s.computed)==null?void 0:h.blue)==null?void 0:g[700]:(j=(m=s==null?void 0:s.computed)==null?void 0:m.gray)==null?void 0:j[50];return e.jsx(B.Icon,{name:c,size:r,style:{color:l}})},i=()=>{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=s==null?void 0:s.computed)==null?void 0:l.red)==null?void 0:a[600]:(h=(d=s==null?void 0:s.computed)==null?void 0:d.blue)==null?void 0:h[700]};switch(r){case"xs":return e.jsx(Re.Body2,{props:{style:c},children:n.title});case"sm":case"md":return e.jsx(Re.SubH3,{props:{style:c},children:n.title});case"lg":return e.jsx(Re.SubH2,{props:{style:c},children:n.title});default:return n.title}};return e.jsx(V.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:i()})},Zi=t=>e.jsx(Re.H5,{props:{...t},children:t.title}),Gi=({size:t="md",direction:r="vertical",requiredTitle:n="(Required)",fullWidth:s=!1,...o})=>{var l,a,d;const i=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(se,{condition:!!o.inputProps.required,fallback:e.jsxs(f.Box,{direction:"column",customMaxWidth:c,fullWidth:s,children:[e.jsx(de,{children:o.title}),e.jsx(D.Text,{fontSize:t,color:"gray-500",children:o.description})]}),children:e.jsxs(f.Box,{direction:"column",customMaxWidth:c,fullWidth:s,children:[e.jsxs(oe.Flex,{direction:"row",gap:"xs",align:"center",children:[e.jsx(de,{fontSize:t,children:o.title}),e.jsx(de,{color:"error",fontSize:t,children:n}),e.jsx(se,{condition:!!((l=o.tooltip)!=null&&l.label),children:e.jsx(we.Tooltip,{label:(a=o.tooltip)==null?void 0:a.label,arrowPosition:(d=o.tooltip)==null?void 0:d.arrowPosition,...o.tooltip,children:e.jsx(B.Icon,{name:"InfoCircle",size:t==="lg"?"sm":"xs",style:{color:"var(--sa-color-info-500, #00abeb)",marginTop:"6px"}})})})]}),e.jsx(se,{condition:!!o.description,children:e.jsx(D.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(et.StarasiaDate,{size:t,...o.inputProps,status:o.errorMessage?"error":void 0})}),!i&&o.errorMessage&&e.jsx(Ue,{message:o.errorMessage})]})]})};async function Qi(t,r){const n=new Image;n.src=t,await new Promise((i,c)=>{n.onload=i,n.onerror=c});const s=document.createElement("canvas");s.width=r.width,s.height=r.height;const o=s.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((i,c)=>{s.toBlob(l=>{if(!l)return c("Canvas is empty");const a=new File([l],"cropped.png",{type:"image/png"});i(a)},"image/png")})}const pn={"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},no=u.forwardRef(({handleUpload:t,urlImage:r,isUploading:n,croppedImage:s,setCroppedImage:o,size:i="96",aspect:c="1:1",containerProps:l,maxFileSize:a=2,onError:d},h)=>{const g=je.useMediaQuery("md"),[m,j]=u.useState(!1),[M,p]=u.useState(null),[L,S]=u.useState(!1),[T,w]=u.useState({x:0,y:0}),[C,z]=u.useState(1),[W,b]=u.useState(null);u.useEffect(()=>{r===null&&o(null)},[r]);const F=u.useCallback((K,Q)=>{b(Q)},[]),N=K=>{var ce;const Q=(ce=K.target.files)==null?void 0:ce[0];if(!Q)return;const ue=new FileReader;ue.onload=()=>{p(ue.result),S(!0)},ue.readAsDataURL(Q)},A=async()=>{if(!(!M||!W))try{const K=await Qi(M,W);if(a&&K.size>a*1024*1024){d==null||d(`Ukuran file maksimal ${a}MB`);return}t==null||t(K);const Q=URL.createObjectURL(K);o(Q,K),S(!1)}catch{d==null||d("Gagal memproses gambar")}},H=u.useRef(null),U=()=>{H.current&&H.current.click()};u.useImperativeHandle(h,()=>({openFileDialog:()=>{var K;(K=H.current)==null||K.click()}}));const re=parseInt(i,10),ne=pn[c];let ee,ie;return ne>=1?(ie=re,ee=re*ne):(ee=re,ie=re/ne),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%":`${ee}px`,height:l!=null&&l.fullWidth?"auto":`${ie}px`,aspectRatio:ne,flexShrink:0},onMouseEnter:()=>j(!0),onMouseLeave:()=>j(!1),children:[s||r?e.jsx("img",{src:s||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(B.Icon,{name:"Image",style:{color:"var(--sa-text-subtle, #8c8f97)",width:Number(i)/2<40?Number(i)/2:40,height:Number(i)/2<40?Number(i)/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:m?1:0,transition:"opacity 0.3s ease-in-out"},onClick:U,children:[e.jsx("input",{ref:H,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(B.Icon,{name:"Edit3",style:{color:"var(--sa-background-primary, #ffffff)"}}),e.jsx(se,{condition:i.toNumber()>80,children:e.jsx(D.Text,{color:"gray-50",fontSize:i.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"})}),L&&yr.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:()=>S(!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:g?c==="1:1"?"min(90vw, 480px)":`min(90vw, ${ee*2}px)`:"calc(100vw - 2rem)",display:"flex",flexDirection:"column"},onClick:K=>K.stopPropagation(),children:[e.jsx("div",{style:{position:"relative",width:"100%",height:"20rem",backgroundColor:"var(--sa-color-gray-100)"},children:M&&e.jsx(Fo,{image:M,crop:T,zoom:C,aspect:c?pn[c]:void 0,onCropChange:w,onZoomChange:z,onCropComplete:F,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(V.Button,{size:"sm",secondary:!0,onClick:()=>S(!1),children:"Cancel"}),e.jsx(V.Button,{size:"sm",primary:!0,onClick:A,children:"Crop"})]})]})}),document.body)]})}),Ui=({size:t="md",direction:r="vertical",requiredTitle:n="(Required)",fullWidth:s=!1,required:o=!1,...i})=>{var a,d,h;const c=i.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",...i.containerProps,children:[i.title&&e.jsx(se,{condition:!!o,fallback:e.jsxs(f.Box,{direction:"column",customMaxWidth:l,fullWidth:s,children:[e.jsx(de,{children:i.title}),e.jsx(D.Text,{fontSize:t,color:"gray-500",children:i.description})]}),children:e.jsxs(f.Box,{direction:"column",customMaxWidth:l,fullWidth:s,children:[e.jsxs(oe.Flex,{direction:"row",gap:"xs",align:"center",children:[e.jsx(de,{fontSize:t,children:i.title}),e.jsx(de,{color:"error",fontSize:t,children:n}),e.jsx(se,{condition:!!((a=i.tooltip)!=null&&a.label),children:e.jsx(we.Tooltip,{label:(d=i.tooltip)==null?void 0:d.label,arrowPosition:(h=i.tooltip)==null?void 0:h.arrowPosition,...i.tooltip,children:e.jsx(B.Icon,{name:"InfoCircle",size:t==="lg"?"sm":"xs",style:{color:"var(--sa-color-info-500, #00abeb)",marginTop:"6px"}})})})]}),e.jsx(se,{condition:!!i.description,children:e.jsx(D.Text,{fontSize:t,color:"gray-500",children:i.description})})]})}),e.jsxs(oe.Flex,{direction:"column",gap:"xs",children:[e.jsx(no,{...i.inputProps}),!c&&i.errorMessage&&e.jsx(Ue,{message:i.errorMessage})]})]})},Ji=({size:t="md",direction:r="vertical",requiredTitle:n="(Required)",fullWidth:s=!1,...o})=>{var c,l,a;const i=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(se,{condition:!!o.inputProps.required,fallback:e.jsxs(f.Box,{direction:"column",customMaxWidth:i,fullWidth:s,children:[e.jsx(de,{children:o.title}),e.jsx(D.Text,{fontSize:t,color:"gray-500",children:o.description})]}),children:e.jsxs(f.Box,{direction:"column",customMaxWidth:i,fullWidth:s,children:[e.jsxs(oe.Flex,{direction:"row",gap:"xs",align:"center",children:[e.jsx(de,{fontSize:t,children:o.title}),e.jsx(de,{color:"error",fontSize:t,children:n}),e.jsx(se,{condition:!!((c=o.tooltip)!=null&&c.label),children:e.jsx(we.Tooltip,{label:(l=o.tooltip)==null?void 0:l.label,arrowPosition:(a=o.tooltip)==null?void 0:a.arrowPosition,...o.tooltip,children:e.jsx(B.Icon,{name:"InfoCircle",size:t==="lg"?"sm":"xs",style:{color:"var(--sa-color-info-500, #00abeb)",marginTop:"6px"}})})})]}),e.jsx(se,{condition:!!o.description,children:e.jsx(D.Text,{fontSize:t,color:"gray-500",children:o.description})})]})}),o.inputProps.extended&&o.inputProps.extended]})},Yi=({items:t,id:r,handleOnUpdate:n,width:s,toggleShow:o=!0,disabled:i=!1})=>{var h;const[c,l]=u.useState([]);u.useEffect(()=>{t&&l([...t.map(g=>({id:g.id,isActive:g.isActive}))])},[t]);const a=(h=c.find(g=>g.id===r))==null?void 0:h.isActive,d=u.useCallback(()=>{l(g=>g.map(m=>m.id===r?{...m,isActive:!m.isActive}:m)),n&&n(!a)},[r,n,a]);return e.jsx(f.Box,{direction:"row",gap:"md",style:{width:s},children:o&&e.jsx(dt.Toggle,{disabled:i,checked:a,onChange:d,label:a?"Active":"Inactive"})})},Xi={InputText:di,InputDropdown:ui,InputSingleFile:Vi,CheckBoxOptions:Hi,RadioOptions:Pi,InputTextArea:Ni,ToggleForm:_i,ActionButton:qi,FormTitle:Zi,InputDate:Gi,InputImgFile:Ui,Custom:Ji},oo=({customBottom:t})=>{const[r,n]=u.useState(!1),s=()=>{window.scrollY>window.screenY?n(!0):n(!1)},o=()=>{window.scrollTo({top:0,behavior:"smooth"})};return u.useEffect(()=>(window.addEventListener("scroll",s),()=>{window.removeEventListener("scroll",s)}),[]),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(V.Button,{secondary:!0,size:"xs",onClick:o,type:"button",iconLeft:e.jsx(B.Icon,{width:16,size:"xs",name:"ArrowPullUp",style:{color:"var(--sa-background-brand, #04254f)"}})})})})},Fe="sa-sidepanel-item",jn="sa-sidepanel-item-styles",Ki="inset 3.5px 0 0 0 var(--sa-border-focused, #1a4fa0)",$i="inset -3.5px 0 0 0 var(--sa-border-focused, #1a4fa0)",el=`
|
|
47
|
+
.${Fe} {
|
|
48
48
|
display: block;
|
|
49
49
|
box-sizing: border-box;
|
|
50
50
|
width: 100%;
|
|
@@ -59,39 +59,39 @@
|
|
|
59
59
|
outline: none;
|
|
60
60
|
transition: background-color 140ms ease, box-shadow 140ms ease;
|
|
61
61
|
}
|
|
62
|
-
.${
|
|
62
|
+
.${Fe}[data-divider="true"] {
|
|
63
63
|
border-bottom: 1px solid var(--sa-border-subtle, #0b120e24);
|
|
64
64
|
}
|
|
65
65
|
/* The first row also gets a top line so the list is bounded on its own,
|
|
66
66
|
without relying on a wrapping container's border. Adjacent rows still
|
|
67
67
|
share a single 1px line (only border-bottom), never a doubled 2px one. */
|
|
68
|
-
.${
|
|
68
|
+
.${Fe}[data-divider="true"]:first-child {
|
|
69
69
|
border-top: 1px solid var(--sa-border-subtle, #0b120e24);
|
|
70
70
|
}
|
|
71
|
-
.${
|
|
71
|
+
.${Fe}:hover {
|
|
72
72
|
background: var(--sa-background-neutral, #f0f1f2);
|
|
73
73
|
}
|
|
74
|
-
.${
|
|
75
|
-
.${
|
|
74
|
+
.${Fe}:focus-visible,
|
|
75
|
+
.${Fe}[data-active="true"] {
|
|
76
76
|
background: var(--sa-background-brand-subtlest, #e6edf6);
|
|
77
77
|
}
|
|
78
|
-
.${
|
|
78
|
+
.${Fe}:focus-visible {
|
|
79
79
|
background: var(--sa-background-neutral, #f0f1f2);
|
|
80
80
|
}
|
|
81
81
|
/* Accent bar — sign of the offset picks the edge it hugs. */
|
|
82
|
-
.${
|
|
83
|
-
.${
|
|
84
|
-
box-shadow: ${
|
|
82
|
+
.${Fe}[data-accent="left"]:focus-visible,
|
|
83
|
+
.${Fe}[data-accent="left"][data-active="true"] {
|
|
84
|
+
box-shadow: ${Ki};
|
|
85
85
|
}
|
|
86
|
-
.${
|
|
87
|
-
.${
|
|
88
|
-
box-shadow: ${
|
|
86
|
+
.${Fe}[data-accent="right"]:focus-visible,
|
|
87
|
+
.${Fe}[data-accent="right"][data-active="true"] {
|
|
88
|
+
box-shadow: ${$i};
|
|
89
89
|
}
|
|
90
|
-
.${
|
|
90
|
+
.${Fe}[data-active="true"]:hover {
|
|
91
91
|
background: var(--sa-background-brand-subtlest, #e6edf6);
|
|
92
92
|
}
|
|
93
|
-
.${
|
|
93
|
+
.${Fe}:disabled {
|
|
94
94
|
cursor: not-allowed;
|
|
95
95
|
opacity: 0.55;
|
|
96
96
|
}
|
|
97
|
-
`;function Ii(){if(typeof document>"u"||document.getElementById(en))return;const t=document.createElement("style");t.id=en,t.textContent=Li,document.head.appendChild(t)}const Ti=({active:t=!1,accentSide:r="left",onClick:n,title:s,badge:o,heading:i,meta:c,children:l,divider:a=!0,disabled:d,className:h,style:g,"aria-label":m})=>(u.useEffect(Ii,[]),e.jsx("button",{type:"button",className:[ke,h].filter(Boolean).join(" "),"data-active":t?"true":"false","data-accent":r,"data-divider":a?"true":"false","aria-current":t?"true":void 0,"aria-label":m,disabled:d,onClick:n,style:g,children:l??e.jsxs(f.Box,{display:"flex",direction:"column",gap:"spacing-4",fullWidth:!0,style:{minWidth:0},children:[(s||o)&&e.jsxs(ne.Flex,{direction:"row",align:"center",justify:"space-between",gap:"sm",style:{minWidth:0},children:[s?e.jsx(w.Text,{fontSize:"sm",style:{minWidth:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",color:"var(--sa-text-primary, #292a2e)"},children:s}):e.jsx("span",{}),o?e.jsx(f.Box,{style:{flexShrink:0},children:o}):null]}),i?e.jsx(w.Text,{fontSize:"md",fontWeight:"semibold",style:{color:"var(--sa-text-primary, #292a2e)"},children:i}):null,c?e.jsx(w.Text,{fontSize:"sm",style:{color:"var(--sa-text-subtlest, #6b6e76)"},children:c}):null]})})),er=18,Oi=40,tn="280ms cubic-bezier(0.4, 0, 0.2, 1)",Pn="var(--sa-border-subtle, #0b120e24)",Wi=`1px solid ${Pn}`,rn="var(--sa-background-white, #ffffff)",Ri=({children:t,header:r,collapsed:n,defaultCollapsed:s=!1,onToggle:o,width:i=337,side:c="left",offsetTop:l="4rem",height:a,showToggle:d=!0,togglePosition:h="top",toggleOffset:g=40,toggleLabel:m,style:j,bodyStyle:E,className:y,pageLayout:M,overlay:k="mobile",wrapperProps:L,contentProps:C})=>{const b=ge.useMediaQuery("md"),A=n!==void 0,[W,v]=u.useState(s),F=A?n:W,z=()=>{const ae=!F;A||v(ae),o==null||o(ae)},R=c==="left",_=typeof l=="number"?`${l}px`:l,J=a!==void 0?typeof a=="number"?`${a}px`:a:`calc(100vh - ${_})`,te=m??{collapse:"Collapse panel",expand:"Expand panel"},xe=h==="center"?{top:"50%",transform:"translateY(-50%)"}:h==="bottom"?{bottom:g}:{top:g},he=F?R?"ChevronRight":"ChevronLeft":R?"ChevronLeft":"ChevronRight",se=M!==void 0&&(k==="mobile"?!b:k),Z=se?{position:"absolute",top:0,bottom:0,width:i,transform:`translateX(${F?R?"-100%":"100%":"0"})`,transition:`transform ${tn}`,zIndex:50,...R?{left:0}:{right:0},...j}:{position:"sticky",top:_,alignSelf:"flex-start",width:F?0:i,flexShrink:0,height:J,transition:`width ${tn}`,...j},Q=e.jsxs(f.Box,{className:y,style:Z,children:[e.jsx(f.Box,{fullWidth:!0,fullHeight:!0,display:"flex",direction:"column",overflow:"overflow-hidden",borderStyle:F?void 0:R?"border-solid-r":"border-solid-l",borderWidth:F?void 0:R?"border-r":"border-l",style:{backgroundColor:rn,borderColor:Pn},children:e.jsxs(f.Box,{fullHeight:!0,display:"flex",direction:"column",customWidth:i,customMinWidth:i,style:R?void 0:{marginLeft:"auto"},children:[r?e.jsx(f.Box,{padding:"md",style:{flexShrink:0},children:r}):null,e.jsx(f.Box,{display:"block",overflow:"overflow-y-auto",style:{flex:"1 1 0",minHeight:0,...E},children:t})]})}),d&&e.jsx(ht,{display:"inline-flex",align:"center",justify:"center",position:"absolute",onClick:z,"aria-label":F?te.expand:te.collapse,"aria-expanded":!F,"aria-pressed":F,customWidth:er,customHeight:Oi,style:{...xe,backgroundColor:rn,border:Wi,zIndex:5,...R?{right:-er,borderLeft:"none",borderRadius:"0 8px 8px 0"}:{left:-er,borderRight:"none",borderRadius:"8px 0 0 8px"}},children:e.jsx(B.Icon,{name:he,size:"sm"})})]});return M===void 0?Q:e.jsxs(f.Box,{direction:"row",position:"relative",...L,style:{height:`calc(100vh - ${_})`,overflow:"hidden",...(L==null?void 0:L.style)??{}},children:[!se&&R?Q:null,e.jsx(f.Box,{display:"block",...C,style:{flex:"1 1 0",minWidth:0,height:"100%",overflowY:"auto",...(C==null?void 0:C.style)??{}},children:M}),!se&&!R?Q:null,se&&e.jsxs(e.Fragment,{children:[!F&&e.jsx("div",{onClick:z,"aria-hidden":"true",style:{position:"absolute",inset:0,backgroundColor:"rgba(0, 0, 0, 0.4)",zIndex:40}}),Q]})]})},Ai=({pageLayout:t,children:r,wrapperProps:n,containerProps:s})=>{const o=ge.useMediaQuery("md"),i=(s==null?void 0:s.customWidth)??264;return e.jsxs(f.Box,{display:"block",direction:"row",...n,style:{marginRight:o?i: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",...s,style:{marginTop:"4rem",backgroundColor:"var(--sa-background-white, #ffffff)",borderColor:"var(--sa-border-subtle, #0b120e24)",...(s==null?void 0:s.style)??{}},children:r})]})},zi=({children:t,withScrollToTopButton:r=!1,scrollToTopButtonProps:n,containerProps:s})=>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:(s==null?void 0:s.justify)||"flex-end",borderStyle:"border-solid-t",borderWidth:"border-t",children:[r&&e.jsx(Hn,{...n,customBottom:(n==null?void 0:n.customBottom)||"5.7rem"}),t]})}),Vi=({fields:t})=>e.jsx(f.Box,{display:"flex",direction:"column",gap:"lg",children:e.jsx(Wt,{of:t,render:(r,n)=>e.jsx(Hi,{...r},n)})}),Hi=({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(B.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]}),be={silhouette:"#A7B0AC",accent:"#78867F"};function Pi({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:be.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:be.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:be.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:be.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:be.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:be.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:be.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:be.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:be.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:be.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:be.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:be.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:be.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:be.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:be.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:be.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:be.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:be.accent,fillOpacity:"0.65"})]})})}const Ni=({title:t="create",children:r,onClickAction:n,variant:s="primary",variantTitle:o,leftIcon:i,showButton:c=!0,customHeight:l,childrenButton:a,customIcon:d})=>{const h=()=>{switch(s){case"primary":return e.jsx(e.Fragment,{children:i?e.jsx(V.Button,{primary:!0,iconLeft:i,onClick:n,children:a||t}):e.jsx(V.Button,{primary:!0,onClick:n,children:a||t})});case"secondary":return e.jsx(e.Fragment,{children:i?e.jsx(V.Button,{secondary:!0,iconLeft:i,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(V.Button,{secondary:!0,onClick:n,children:a||t})});case"success":return e.jsx(e.Fragment,{children:i?e.jsx(V.Button,{success:!0,iconLeft:i,onClick:n,children:a||t}):e.jsx(V.Button,{success:!0,onClick:n,children:a||t})});default:return e.jsx(e.Fragment,{children:i?e.jsx(V.Button,{primary:!0,iconLeft:i,onClick:n,children:a||t}):e.jsx(V.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(Pi,{}),e.jsx(f.Box,{direction:"column",children:r.map((g,m)=>e.jsx(Ie.Body1,{props:{align:"center",textAlign:"center"},children:m>2?null:g},m))}),c?h():null]})},K={c001A72:"#001A72",c64B5F6:"#64B5F6",c98B4CB:"#98B4CB",cBBDEFB:"#BBDEFB",cD0E5F7:"#D0E5F7",cD6EBFD:"#D6EBFD",c000000:"#000000",cFFFFFF:"#FFFFFF"};function _i({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:K.c64B5F6,strokeWidth:"5",strokeLinecap:"round"}),e.jsx("rect",{x:"216.562",y:"45.5605",width:"55",height:"20",fill:K.cD6EBFD}),e.jsx("rect",{x:"14.4375",y:"89.7803",width:"46",height:"20",fill:K.cD6EBFD}),e.jsx("rect",{x:"0.4375",y:"111.78",width:"46",height:"20",fill:K.cD6EBFD}),e.jsx("rect",{x:"0.4375",y:"67.7803",width:"46",height:"20",fill:K.cD6EBFD}),e.jsx("rect",{x:"344.312",y:"0.5",width:"55",height:"20",fill:K.cD6EBFD}),e.jsx("rect",{x:"549.562",y:"86.7803",width:"55",height:"20",fill:K.cD6EBFD}),e.jsx("rect",{x:"566.562",y:"64.7803",width:"55",height:"20",fill:K.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:K.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:K.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:K.cBBDEFB,fillOpacity:"0.6"}),e.jsx("path",{d:"M349.472 171.5H261.64V186.396H349.472V171.5Z",fill:K.c98B4CB}),e.jsx("path",{d:"M261.64 171.5L244.719 186.396H261.64V171.5Z",fill:K.c98B4CB}),e.jsx("path",{d:"M363.574 186.396L349.472 171.5V186.396H363.574Z",fill:K.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:K.c000000,strokeWidth:"2"}),e.jsx("rect",{x:"246.438",y:"202.5",width:"116",height:"60",fill:K.cFFFFFF}),e.jsx("path",{d:"M245.536 187.5H362.959L369.438 198.5H237.438L245.536 187.5Z",fill:K.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:K.cFFFFFF,stroke:K.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:K.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:K.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:K.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:K.c000000,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}),e.jsx("circle",{cx:"291.724",cy:"118.765",r:"3.1027",fill:K.c000000}),e.jsx("path",{d:"M308.128 122.463C309.123 120.973 309.987 120.418 311.883 120.237",stroke:K.c000000,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}),e.jsx("circle",{cx:"307.681",cy:"118.765",r:"3.1027",fill:K.c000000}),e.jsx("ellipse",{cx:"297.938",cy:"134.5",rx:"2.5",ry:"2",fill:K.c000000}),e.jsx("path",{d:"M340.437 97.5L333.438 104.5M333.438 97.5L340.438 104.5",stroke:K.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:K.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:K.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:K.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:K.c001A72,strokeWidth:"1.2",strokeLinecap:"round",strokeLinejoin:"round"}),e.jsx("circle",{cx:"339.938",cy:"111",r:"2.5",fill:K.c001A72}),e.jsx("circle",{cx:"336.438",cy:"94.5",r:"1",fill:K.c001A72}),e.jsx("circle",{cx:"347.438",cy:"99.5",r:"1",fill:K.c001A72}),e.jsx("circle",{cx:"267.438",cy:"109.5",r:"2",fill:K.c001A72}),e.jsx("circle",{cx:"293.438",cy:"85.5",r:"2",fill:K.c001A72}),e.jsx("circle",{cx:"339.438",cy:"138.5",r:"2",fill:K.c001A72}),e.jsx("circle",{cx:"267.438",cy:"150.5",r:"2",fill:K.c001A72}),e.jsx("circle",{cx:"268.438",cy:"118.5",r:"1",fill:K.c001A72}),e.jsx("circle",{cx:"260.438",cy:"124.5",r:"1",fill:K.c001A72})]})})}function qi({onClick:t}){const r=ge.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(_i,{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(V.Button,{size:r?"md":"xs",onClick:t,children:"Go Back"})]})}const ee={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 Zi({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:ee.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:ee.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:ee.cEFF3F8,stroke:ee.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:ee.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:ee.cCABEB1}),e.jsx("path",{d:"M287.68 218.884L289.354 213.022H378.961L381.473 218.884H287.68Z",fill:ee.cC0B2A2}),e.jsx("path",{d:"M381.944 218.803L381.58 212.266H386.385L386.022 218.803H381.944Z",fill:ee.c956847,stroke:ee.c48504C}),e.jsx("path",{d:"M283.124 218.803L282.768 213.104H287.565L287.209 218.803H283.124Z",fill:ee.c956847,stroke:ee.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:ee.cC8CEF4,stroke:ee.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:ee.cC8CEF4,stroke:ee.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:ee.cC8CEF4,stroke:ee.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:ee.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:ee.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:ee.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:ee.cD6D6D6}),e.jsx("path",{d:"M368.673 152.523H301.336V174.5H368.673V152.523Z",fill:ee.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:ee.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:ee.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:ee.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:ee.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:ee.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:ee.cBBDEFB,fillOpacity:"0.6"}),e.jsx("rect",{x:"43",y:"87.5",width:"46",height:"20",fill:ee.cD6EBFD}),e.jsx("rect",{x:"29",y:"109.5",width:"46",height:"20",fill:ee.cD6EBFD}),e.jsx("rect",{x:"29",y:"65.5",width:"46",height:"20",fill:ee.cD6EBFD}),e.jsx("rect",{x:"356",y:"0.5",width:"55",height:"20",fill:ee.cD6EBFD}),e.jsx("rect",{x:"572",y:"142.5",width:"55",height:"20",fill:ee.cD6EBFD}),e.jsx("rect",{x:"589",y:"120.5",width:"55",height:"20",fill:ee.cD6EBFD}),e.jsx("path",{d:"M3 255.5L651 255.5",stroke:ee.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:ee.cFFFFFF,transform:"translate(246 60.5)"})})})]})})}function Gi({onClick:t}){const r=ge.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(Zi,{width:r?600:300}),e.jsx(w.Text,{fontWeight:"bold",fontSize:r?"3xl":"2xl",children:"We Are Sorry ..."}),t&&e.jsx(V.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 Qi({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 Ui({onClick:t}){const r=ge.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(Qi,{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(V.Button,{size:r?"md":"xs",onClick:t,children:"Go Back"})]})}const Ji=t=>{var n,s,o,i,c;const r=ge.useMediaQuery("md");return e.jsxs(Le.Dialog,{isShow:t.isShow,onHide:t.onHide,style:{...r?{minWidth:t.customMinWidth||"458px"}:{maxWidth:t.customMinWidth||"458px"}},children:[e.jsx(Le.DialogTitle,{...t.dialogTitleProps,children:typeof t.title=="string"?e.jsx(w.Text,{fontSize:"lg",fontWeight:"medium",children:t.title}):t.title}),e.jsx(Le.DialogBody,{children:typeof t.description=="string"?e.jsx(w.Text,{fontSize:"md",lineHeight:"leading-6",color:"brand",children:t.description}):t.description}),e.jsx(Le.DialogFooter,{children:e.jsx(f.Box,{display:"flex",direction:((n=t.containerConfirmBtnProps)==null?void 0:n.direction)||"row",justify:((s=t.containerConfirmBtnProps)==null?void 0:s.justify)||"flex-end",...t.containerConfirmBtnProps,children:e.jsxs(f.Box,{display:"flex",direction:((o=t.wrapperConfirmBtnProps)==null?void 0:o.direction)||"row",justify:((i=t.wrapperConfirmBtnProps)==null?void 0:i.justify)||"flex-end",gap:((c=t.wrapperConfirmBtnProps)==null?void 0:c.gap)||"sm",...t.wrapperConfirmBtnProps,children:[t.onCancel&&e.jsx(V.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(V.Button,{...t.buttonConfirmProps,onClick:t.onConfirm,size:"md",fullWidth:!0,children:t.titleConfirmBtn||"Ok"})})]})})})]},t.key)},Yi=u.memo(({children:t,height:r,minHeight:n,customHeight:s,paddingInline:o="spacing-0",paddingBlock:i="spacing-0",header:c,footer:l,title:a,titleTag:d,action:h,actionContainer:g,containerProps:m,bodyProps:j,headerProps:E={borderBottom:!0},footerProps:y={borderTop:!0},variantTag:M="info"})=>{const k=u.useRef(null),[L,C]=u.useState("100vh");u.useEffect(()=>{const v=()=>{if(k.current){const F=k.current.getBoundingClientRect().top;C(`calc(100vh - ${F}px)`)}};return v(),window.addEventListener("resize",v),()=>window.removeEventListener("resize",v)},[]);const b=()=>d?e.jsxs(f.Box,{direction:"row",gap:"sm",align:"center",children:[e.jsx(w.Text,{fontWeight:"medium",children:a}),e.jsx(Ue.Badges,{border:!0,text:d,variant:M})]}):e.jsx(w.Text,{fontWeight:"medium",children:a}),A=()=>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",...g,children:h??null})]}),W=!!(c||a||h);return e.jsxs(f.Box,{ref:k,height:r,customMinHeight:n,customHeight:s,paddingBlock:i,paddingInline:o,bg:"white",direction:"column",...m,style:{backgroundColor:"var(--sa-background-primary, #ffffff)",display:"flex",minHeight:L,...(m==null?void 0:m.style)??{}},children:[c!==null&&W?e.jsx(xr,{...E,children:A()}):null,e.jsx(f.Box,{direction:"column",padding:"spacing-0",...j,style:{flex:1,overflow:"auto",...(j==null?void 0:j.style)??{}},children:t}),l?e.jsx(hr,{...y,children:l}):null]})}),Xi=u.memo(({value:t,options:r=[],onChange:n,multiple:s})=>{const o=(t==null?void 0:t.map(l=>l.value))||[],i=(r==null?void 0:r.filter(l=>o.includes(l.value)))||[],c=l=>{const a=[...i];let d=[];s?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(V.Button,{...o.includes(l.value)?{primary:!0}:{secondary:!0},onClick:()=>c(l),children:l.label},a))})});function Rt(t){return null}Rt.displayName="LayoutDialog.Header";function At(t){return null}At.displayName="LayoutDialog.Body";function zt(t){return null}zt.displayName="LayoutDialog.Aside";function Vt(t){return null}Vt.displayName="LayoutDialog.Footer";const we={"lyd-root":"_lyd-root_14rlp_1","lyd-backdrop":"_lyd-backdrop_14rlp_34","lyd-panel":"_lyd-panel_14rlp_43","lyd-modal":"_lyd-modal_14rlp_54","lyd-fullscreen":"_lyd-fullscreen_14rlp_64","lyd-sidebar":"_lyd-sidebar_14rlp_72","lyd-header":"_lyd-header_14rlp_100","lyd-header-content":"_lyd-header-content_14rlp_111","lyd-header-actions":"_lyd-header-actions_14rlp_119","lyd-main":"_lyd-main_14rlp_126","lyd-body":"_lyd-body_14rlp_133","lyd-aside":"_lyd-aside_14rlp_139","lyd-footer":"_lyd-footer_14rlp_155","lyd-vm-group":"_lyd-vm-group_14rlp_168","lyd-vm-btn":"_lyd-vm-btn_14rlp_176","lyd-close-btn":"_lyd-close-btn_14rlp_199"},Ki=[{mode:"sidebar",label:"Sidebar",icon:e.jsx(el,{})},{mode:"modal",label:"Modal",icon:e.jsx(B.Icon,{name:"Newscreen",size:"sm"})},{mode:"fullscreen",label:"Fullscreen",icon:e.jsx(B.Icon,{name:"Fullscreen",size:"sm"})}];function $i({value:t,onChange:r}){return e.jsx("div",{className:we["lyd-vm-group"],role:"group","aria-label":"View mode",children:Ki.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 el(){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 tr={md:"768px",lg:"1024px",xl:"1200px","2xl":"1440px"};function tl(t){return t?t in tr?tr[t]:t:tr.xl}function kt(t,r){let n=null;return u.Children.forEach(t,s=>{u.isValidElement(s)&&s.type===r&&(n=s.props.children??null)}),n}function rl(t){const{isOpen:r,onClose:n,viewMode:s,defaultViewMode:o="modal",onViewModeChange:i,showViewModeToggle:c=!0,showCloseButton:l=!0,size:a,asideWidth:d,disableEscapeClose:h=!1,disableBackdropClose:g=!1,lockBodyScroll:m=!0,children:j}=t,[E,y]=u.useState(o),M=s??E,L=ge.useMediaQuery("md")?M:"fullscreen",C=u.useCallback(J=>{s===void 0&&y(J),i==null||i(J)},[s,i]),b=u.useRef(null);u.useEffect(()=>{if(!(!r||!m))return b.current=document.body.style.overflow,document.body.style.overflow="hidden",()=>{document.body.style.overflow=b.current??""}},[r,m]),u.useEffect(()=>{if(!r||h)return;const J=te=>{te.key==="Escape"&&n()};return window.addEventListener("keydown",J),()=>window.removeEventListener("keydown",J)},[r,h,n]);const A=u.useMemo(()=>kt(j,Rt),[j]),W=u.useMemo(()=>kt(j,At),[j]),v=u.useMemo(()=>kt(j,zt),[j]),F=u.useMemo(()=>kt(j,Vt),[j]);if(!r)return null;const z=[we["lyd-panel"],L==="modal"&&we["lyd-modal"],L==="fullscreen"&&we["lyd-fullscreen"],L==="sidebar"&&we["lyd-sidebar"]].filter(Boolean).join(" "),R={"--lyd-max-w":tl(a),...d!==void 0&&{"--lyd-aside-w":d}},_=()=>{g||n()};return e.jsxs("div",{className:we["lyd-root"],style:R,role:"dialog","aria-modal":"true",children:[e.jsx("div",{className:we["lyd-backdrop"],onClick:_,"aria-hidden":"true"}),e.jsxs("div",{className:z,children:[e.jsxs("div",{className:we["lyd-header"],children:[e.jsx("div",{className:we["lyd-header-content"],children:A}),e.jsxs("div",{className:we["lyd-header-actions"],children:[c&&e.jsx($i,{value:M,onChange:C}),l&&e.jsx("button",{type:"button",className:we["lyd-close-btn"],onClick:n,"aria-label":"Close dialog",children:e.jsx(B.Icon,{name:"Cross",size:"md"})})]})]}),e.jsxs("div",{className:we["lyd-main"],children:[e.jsx("div",{className:we["lyd-body"],children:W}),v&&e.jsx("aside",{className:we["lyd-aside"],children:v})]}),F&&e.jsx("div",{className:we["lyd-footer"],children:F})]})]})}const ft=rl;ft.Header=Rt;ft.Body=At;ft.Aside=zt;ft.Footer=Vt;function nl({url:t,filename:r,onClose:n}){return u.useEffect(()=>{const s=o=>{o.key==="Escape"&&n()};return window.addEventListener("keydown",s),()=>window.removeEventListener("keydown",s)},[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:s=>s.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:s=>s.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 ol=t=>{const{defaultTab:r=0,paramKey:n="tab"}=t||{},[s,o]=ye.useSearchParams(),i=st.searchParamsToObject(s.toString());return{activeTab:i[n]?parseInt(i[n]):r,handleTabChange:a=>{o({...i,[n]:a.toString()})},searchQueries:i}};function sl({appName:t,menuConfig:r,formatTitle:n}){const s=ye.useLocation();u.useEffect(()=>{let o=null,i=null;for(const a of r){const d=a.items.find(h=>h.to?h.to==="/"?s.pathname==="/":!!(h.to===s.pathname||s.pathname.startsWith(h.to+"/")):!1);if(d){o=d,i=a;break}}const c=[];o!=null&&o.title&&c.push(o.title),i!=null&&i.name&&c.push(i.name.toTitleCase());const l=(a,d)=>a.length>0?`${a.join(" - ")} | ${d}`:d;document.title=(n||l)(c,t)},[s.pathname])}const il=()=>{const[t,r]=ye.useSearchParams(),n=st.searchParamsToObject(t.toString()),s=ye.useParams(),o=ye.useLocation(),i=s.id;return{setSearchParams:r,searchParams:t,searchQueries:n,isHasQuery:(h,g)=>t.has(h)&&t.get(h)===g,getQueryParam:h=>t.get(h),getRouteParam:h=>s[h],params:s,location:o,id:i,hasId:!!i}};function ll(t){var s,o;const r=t.decodedAccessToken;return u.useMemo(()=>{var a,d;const i=((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,g)=>{const m=`is${g.toLowerCase().replace(/(^\w|_\w)/g,j=>j.replace("_","").toUpperCase())}`;return{...h,[m]:!1}},{});return{...Object.keys(t.role).reduce((h,g)=>{const m=`is${g.toLowerCase().replace(/(^\w|_\w)/g,j=>j.replace("_","").toUpperCase())}`;return{...h,[m]:i===t.role[g]}},c),hasRole:h=>i===t.role[h],getRoleKey:()=>i}},[(o=(s=r==null?void 0:r.access)==null?void 0:s.role)==null?void 0:o.code,t])}exports.AdvanceFilterBar=Dn;exports.App=io;exports.AppComponent=cn;exports.AppContext=lr;exports.AppLayout=uo;exports.AsideBar=Ai;exports.BackButton=ho;exports.ColumnFilterDropdown=On;exports.ColumnMenu=Rn;exports.ConfirmationDialog=Ji;exports.DataTable=Wn;exports.DecisionWrapper=oe;exports.EachUtils=Wt;exports.EmptyStatePage=Ni;exports.FilterBar=js;exports.FilterDrawer=wn;exports.FloatingFooter=zi;exports.ForbiddenPage=Gi;exports.Form=Fi;exports.FullSection=Yi;exports.HeaderLeftSlot=lo;exports.HeaderLeftSlotOutlet=un;exports.HeaderLeftSlotProvider=dn;exports.HorizontalField=po;exports.ImagePreview=nl;exports.InputFile=zn;exports.InputImage=Vn;exports.LayoutDialog=ft;exports.LayoutDialogAside=zt;exports.LayoutDialogBody=At;exports.LayoutDialogFooter=Vt;exports.LayoutDialogHeader=Rt;exports.ModuleSwitcher=fo;exports.ModuleSwitcherModal=mn;exports.NotFoundPage=qi;exports.PageLayout=vo;exports.Pressable=ht;exports.RightDrawer=gn;exports.ScrollToTopButton=Hn;exports.Section=So;exports.SectionFooter=hr;exports.SectionHeader=xr;exports.SelectButton=Xi;exports.ServerErrorPage=Ui;exports.SidePanel=Ri;exports.SidePanelItem=Ti;exports.SidebarBadgesProvider=sn;exports.SidebarGroupSlot=co;exports.SidebarGroupSlotOutlet=hn;exports.SidebarGroupSlotProvider=xn;exports.SidebarHeaderSlot=an;exports.TableFooter=Tn;exports.TableHeader=In;exports.TableLayout=Vs;exports.TableSection=Is;exports.TableWrapper=Ln;exports.ToggleStatus=Bi;exports.Typography=Ie;exports.VerticalField=Vi;exports.clearModuleSelection=ao;exports.createInitialFromUserName=Zs;exports.cssVars=Xs;exports.expandDateCompact=ks;exports.formHasChanged=ni;exports.formatDate=Js;exports.formatDateToIndonesian=An;exports.formatRupiah=Qs;exports.getDateFilterValue=Cn;exports.getDateRangeFilterValue=Po;exports.getInitials=Us;exports.getValueDropdownMultipleFilter=vn;exports.getValueRadioFilter=Ho;exports.getValueSearch=Tt;exports.getValuesFilter=Ft;exports.handleChangeFilter=xt;exports.handleOnScroll=xi;exports.isEmail=ai;exports.isFilterActive=No;exports.isOnlyLettersAndSpaces=si;exports.isPhoneNumber=oi;exports.isSlug=di;exports.localStorageAdapter=mr;exports.oneDayInMs=Ks;exports.parseIndonesianDateToDate=Gs;exports.preventNonCoordinateInput=ui;exports.preventNonNumberAndDecimalInput=ci;exports.preventNonNumberInput=ii;exports.preventNumberInput=li;exports.resolveDateRangeValueToString=jn;exports.resolveDateValueToString=bn;exports.resolveDropdownValueToString=yn;exports.resolveRadioValueToString=pn;exports.resolveSidebarBadge=Bt;exports.storageKeys=ct;exports.textWidth=$s;exports.useApp=cr;exports.useAppState=nn;exports.useAuthRole=ll;exports.useDynamicTitle=sl;exports.useFilterBarApiParams=ws;exports.useFilterBarControls=Ss;exports.useModuleSelection=ur;exports.useRouteInfo=Se;exports.useRouteParams=il;exports.useSidebarBadges=ln;exports.useTabState=ol;exports.useTableSortApiParams=Hs;Object.keys(wr).forEach(t=>{t!=="default"&&!Object.prototype.hasOwnProperty.call(exports,t)&&Object.defineProperty(exports,t,{enumerable:!0,get:()=>wr[t]})});Object.keys(Ue).forEach(t=>{t!=="default"&&!Object.prototype.hasOwnProperty.call(exports,t)&&Object.defineProperty(exports,t,{enumerable:!0,get:()=>Ue[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(rt).forEach(t=>{t!=="default"&&!Object.prototype.hasOwnProperty.call(exports,t)&&Object.defineProperty(exports,t,{enumerable:!0,get:()=>rt[t]})});Object.keys(V).forEach(t=>{t!=="default"&&!Object.prototype.hasOwnProperty.call(exports,t)&&Object.defineProperty(exports,t,{enumerable:!0,get:()=>V[t]})});Object.keys(Dr).forEach(t=>{t!=="default"&&!Object.prototype.hasOwnProperty.call(exports,t)&&Object.defineProperty(exports,t,{enumerable:!0,get:()=>Dr[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(Le).forEach(t=>{t!=="default"&&!Object.prototype.hasOwnProperty.call(exports,t)&&Object.defineProperty(exports,t,{enumerable:!0,get:()=>Le[t]})});Object.keys(Mt).forEach(t=>{t!=="default"&&!Object.prototype.hasOwnProperty.call(exports,t)&&Object.defineProperty(exports,t,{enumerable:!0,get:()=>Mt[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(ge).forEach(t=>{t!=="default"&&!Object.prototype.hasOwnProperty.call(exports,t)&&Object.defineProperty(exports,t,{enumerable:!0,get:()=>ge[t]})});Object.keys(st).forEach(t=>{t!=="default"&&!Object.prototype.hasOwnProperty.call(exports,t)&&Object.defineProperty(exports,t,{enumerable:!0,get:()=>st[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(T).forEach(t=>{t!=="default"&&!Object.prototype.hasOwnProperty.call(exports,t)&&Object.defineProperty(exports,t,{enumerable:!0,get:()=>T[t]})});Object.keys(ut).forEach(t=>{t!=="default"&&!Object.prototype.hasOwnProperty.call(exports,t)&&Object.defineProperty(exports,t,{enumerable:!0,get:()=>ut[t]})});Object.keys(dt).forEach(t=>{t!=="default"&&!Object.prototype.hasOwnProperty.call(exports,t)&&Object.defineProperty(exports,t,{enumerable:!0,get:()=>dt[t]})});Object.keys(Y).forEach(t=>{t!=="default"&&!Object.prototype.hasOwnProperty.call(exports,t)&&Object.defineProperty(exports,t,{enumerable:!0,get:()=>Y[t]})});Object.keys(Sr).forEach(t=>{t!=="default"&&!Object.prototype.hasOwnProperty.call(exports,t)&&Object.defineProperty(exports,t,{enumerable:!0,get:()=>Sr[t]})});Object.keys(rr).forEach(t=>{t!=="default"&&!Object.prototype.hasOwnProperty.call(exports,t)&&Object.defineProperty(exports,t,{enumerable:!0,get:()=>rr[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(kr).forEach(t=>{t!=="default"&&!Object.prototype.hasOwnProperty.call(exports,t)&&Object.defineProperty(exports,t,{enumerable:!0,get:()=>kr[t]})});Object.keys(it).forEach(t=>{t!=="default"&&!Object.prototype.hasOwnProperty.call(exports,t)&&Object.defineProperty(exports,t,{enumerable:!0,get:()=>it[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(lt).forEach(t=>{t!=="default"&&!Object.prototype.hasOwnProperty.call(exports,t)&&Object.defineProperty(exports,t,{enumerable:!0,get:()=>lt[t]})});Object.keys(nr).forEach(t=>{t!=="default"&&!Object.prototype.hasOwnProperty.call(exports,t)&&Object.defineProperty(exports,t,{enumerable:!0,get:()=>nr[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(B).forEach(t=>{t!=="default"&&!Object.prototype.hasOwnProperty.call(exports,t)&&Object.defineProperty(exports,t,{enumerable:!0,get:()=>B[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(Br).forEach(t=>{t!=="default"&&!Object.prototype.hasOwnProperty.call(exports,t)&&Object.defineProperty(exports,t,{enumerable:!0,get:()=>Br[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(Er).forEach(t=>{t!=="default"&&!Object.prototype.hasOwnProperty.call(exports,t)&&Object.defineProperty(exports,t,{enumerable:!0,get:()=>Er[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(Lr).forEach(t=>{t!=="default"&&!Object.prototype.hasOwnProperty.call(exports,t)&&Object.defineProperty(exports,t,{enumerable:!0,get:()=>Lr[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(Ir).forEach(t=>{t!=="default"&&!Object.prototype.hasOwnProperty.call(exports,t)&&Object.defineProperty(exports,t,{enumerable:!0,get:()=>Ir[t]})});
|
|
97
|
+
`;function tl(){if(typeof document>"u"||document.getElementById(jn))return;const t=document.createElement("style");t.id=jn,t.textContent=el,document.head.appendChild(t)}const rl=({active:t=!1,accentSide:r="left",onClick:n,title:s,badge:o,heading:i,meta:c,children:l,divider:a=!0,disabled:d,className:h,style:g,"aria-label":m})=>(u.useEffect(tl,[]),e.jsx("button",{type:"button",className:[Fe,h].filter(Boolean).join(" "),"data-active":t?"true":"false","data-accent":r,"data-divider":a?"true":"false","aria-current":t?"true":void 0,"aria-label":m,disabled:d,onClick:n,style:g,children:l??e.jsxs(f.Box,{display:"flex",direction:"column",gap:"spacing-4",fullWidth:!0,style:{minWidth:0},children:[(s||o)&&e.jsxs(oe.Flex,{direction:"row",align:"center",justify:"space-between",gap:"sm",style:{minWidth:0},children:[s?e.jsx(D.Text,{fontSize:"sm",style:{minWidth:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",color:"var(--sa-text-primary, #292a2e)"},children:s}):e.jsx("span",{}),o?e.jsx(f.Box,{style:{flexShrink:0},children:o}):null]}),i?e.jsx(D.Text,{fontSize:"md",fontWeight:"semibold",style:{color:"var(--sa-text-primary, #292a2e)"},children:i}):null,c?e.jsx(D.Text,{fontSize:"sm",style:{color:"var(--sa-text-subtlest, #6b6e76)"},children:c}):null]})})),ur=18,nl=40,bn="280ms cubic-bezier(0.4, 0, 0.2, 1)",so="var(--sa-border-subtle, #0b120e24)",ol=`1px solid ${so}`,vn="var(--sa-background-white, #ffffff)",sl=({children:t,header:r,collapsed:n,defaultCollapsed:s=!1,onToggle:o,width:i=337,side:c="left",offsetTop:l="4rem",height:a,showToggle:d=!0,togglePosition:h="top",toggleOffset:g=40,toggleLabel:m,style:j,bodyStyle:M,className:p,pageLayout:L,overlay:S="mobile",wrapperProps:T,contentProps:w})=>{const C=je.useMediaQuery("md"),z=n!==void 0,[W,b]=u.useState(s),F=z?n:W,N=()=>{const ue=!F;z||b(ue),o==null||o(ue)},A=c==="left",H=typeof l=="number"?`${l}px`:l,U=a!==void 0?typeof a=="number"?`${a}px`:a:`calc(100vh - ${H})`,re=m??{collapse:"Collapse panel",expand:"Expand panel"},ne=h==="center"?{top:"50%",transform:"translateY(-50%)"}:h==="bottom"?{bottom:g}:{top:g},ee=F?A?"ChevronRight":"ChevronLeft":A?"ChevronLeft":"ChevronRight",ie=L!==void 0&&(S==="mobile"?!C:S),K=ie?{position:"absolute",top:0,bottom:0,width:i,transform:`translateX(${F?A?"-100%":"100%":"0"})`,transition:`transform ${bn}`,zIndex:50,...A?{left:0}:{right:0},...j}:{position:"sticky",top:H,alignSelf:"flex-start",width:F?0:i,flexShrink:0,height:U,transition:`width ${bn}`,...j},Q=e.jsxs(f.Box,{className:p,style:K,children:[e.jsx(f.Box,{fullWidth:!0,fullHeight:!0,display:"flex",direction:"column",overflow:"overflow-hidden",borderStyle:F?void 0:A?"border-solid-r":"border-solid-l",borderWidth:F?void 0:A?"border-r":"border-l",style:{backgroundColor:vn,borderColor:so},children:e.jsxs(f.Box,{fullHeight:!0,display:"flex",direction:"column",customWidth:i,customMinWidth:i,style:A?void 0:{marginLeft:"auto"},children:[r?e.jsx(f.Box,{padding:"md",style:{flexShrink:0},children:r}):null,e.jsx(f.Box,{display:"block",overflow:"overflow-y-auto",style:{flex:"1 1 0",minHeight:0,...M},children:t})]})}),d&&e.jsx(pt,{display:"inline-flex",align:"center",justify:"center",position:"absolute",onClick:N,"aria-label":F?re.expand:re.collapse,"aria-expanded":!F,"aria-pressed":F,customWidth:ur,customHeight:nl,style:{...ne,backgroundColor:vn,border:ol,zIndex:5,...A?{right:-ur,borderLeft:"none",borderRadius:"0 8px 8px 0"}:{left:-ur,borderRight:"none",borderRadius:"8px 0 0 8px"}},children:e.jsx(B.Icon,{name:ee,size:"sm"})})]});return L===void 0?Q:e.jsxs(f.Box,{direction:"row",position:"relative",...T,style:{height:`calc(100vh - ${H})`,overflow:"hidden",...(T==null?void 0:T.style)??{}},children:[!ie&&A?Q:null,e.jsx(f.Box,{display:"block",...w,style:{flex:"1 1 0",minWidth:0,height:"100%",overflowY:"auto",...(w==null?void 0:w.style)??{}},children:L}),!ie&&!A?Q:null,ie&&e.jsxs(e.Fragment,{children:[!F&&e.jsx("div",{onClick:N,"aria-hidden":"true",style:{position:"absolute",inset:0,backgroundColor:"rgba(0, 0, 0, 0.4)",zIndex:40}}),Q]})]})},il=({pageLayout:t,children:r,wrapperProps:n,containerProps:s})=>{const o=je.useMediaQuery("md"),i=(s==null?void 0:s.customWidth)??264;return e.jsxs(f.Box,{display:"block",direction:"row",...n,style:{marginRight:o?i: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",...s,style:{marginTop:"4rem",backgroundColor:"var(--sa-background-white, #ffffff)",borderColor:"var(--sa-border-subtle, #0b120e24)",...(s==null?void 0:s.style)??{}},children:r})]})},ll=({children:t,withScrollToTopButton:r=!1,scrollToTopButtonProps:n,containerProps:s})=>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:(s==null?void 0:s.justify)||"flex-end",borderStyle:"border-solid-t",borderWidth:"border-t",children:[r&&e.jsx(oo,{...n,customBottom:(n==null?void 0:n.customBottom)||"5.7rem"}),t]})}),cl=({fields:t})=>e.jsx(f.Box,{display:"flex",direction:"column",gap:"lg",children:e.jsx(Vt,{of:t,render:(r,n)=>e.jsx(al,{...r},n)})}),al=({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(B.Icon,{name:n,color:"subtle"}),e.jsx(D.Text,{color:"gray-500",variant:"sub-h3",children:t})]}):e.jsx(D.Text,{color:"gray-500",variant:"sub-h3",children:t}),typeof r=="string"?e.jsx(D.Text,{variant:"sub-h3",children:r}):r]}),Ce={silhouette:"#A7B0AC",accent:"#78867F"};function dl({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:Ce.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:Ce.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:Ce.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:Ce.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:Ce.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:Ce.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:Ce.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:Ce.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:Ce.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:Ce.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:Ce.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:Ce.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:Ce.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:Ce.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:Ce.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:Ce.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:Ce.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:Ce.accent,fillOpacity:"0.65"})]})})}const ul=({title:t="create",children:r,onClickAction:n,variant:s="primary",variantTitle:o,leftIcon:i,showButton:c=!0,customHeight:l,childrenButton:a,customIcon:d})=>{const h=()=>{switch(s){case"primary":return e.jsx(e.Fragment,{children:i?e.jsx(V.Button,{primary:!0,iconLeft:i,onClick:n,children:a||t}):e.jsx(V.Button,{primary:!0,onClick:n,children:a||t})});case"secondary":return e.jsx(e.Fragment,{children:i?e.jsx(V.Button,{secondary:!0,iconLeft:i,onClick:n,children:o?e.jsx(D.Text,{fontFamily:"Poppins",fontSize:"md",fontWeight:"medium",style:{color:"var(--sa-background-success, #28ac6e)"},children:a||t}):t}):e.jsx(V.Button,{secondary:!0,onClick:n,children:a||t})});case"success":return e.jsx(e.Fragment,{children:i?e.jsx(V.Button,{success:!0,iconLeft:i,onClick:n,children:a||t}):e.jsx(V.Button,{success:!0,onClick:n,children:a||t})});default:return e.jsx(e.Fragment,{children:i?e.jsx(V.Button,{primary:!0,iconLeft:i,onClick:n,children:a||t}):e.jsx(V.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(dl,{}),e.jsx(f.Box,{direction:"column",children:r.map((g,m)=>e.jsx(Re.Body1,{props:{align:"center",textAlign:"center"},children:m>2?null:g},m))}),c?h():null]})},X={c001A72:"#001A72",c64B5F6:"#64B5F6",c98B4CB:"#98B4CB",cBBDEFB:"#BBDEFB",cD0E5F7:"#D0E5F7",cD6EBFD:"#D6EBFD",c000000:"#000000",cFFFFFF:"#FFFFFF"};function xl({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:X.c64B5F6,strokeWidth:"5",strokeLinecap:"round"}),e.jsx("rect",{x:"216.562",y:"45.5605",width:"55",height:"20",fill:X.cD6EBFD}),e.jsx("rect",{x:"14.4375",y:"89.7803",width:"46",height:"20",fill:X.cD6EBFD}),e.jsx("rect",{x:"0.4375",y:"111.78",width:"46",height:"20",fill:X.cD6EBFD}),e.jsx("rect",{x:"0.4375",y:"67.7803",width:"46",height:"20",fill:X.cD6EBFD}),e.jsx("rect",{x:"344.312",y:"0.5",width:"55",height:"20",fill:X.cD6EBFD}),e.jsx("rect",{x:"549.562",y:"86.7803",width:"55",height:"20",fill:X.cD6EBFD}),e.jsx("rect",{x:"566.562",y:"64.7803",width:"55",height:"20",fill:X.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:X.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:X.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:X.cBBDEFB,fillOpacity:"0.6"}),e.jsx("path",{d:"M349.472 171.5H261.64V186.396H349.472V171.5Z",fill:X.c98B4CB}),e.jsx("path",{d:"M261.64 171.5L244.719 186.396H261.64V171.5Z",fill:X.c98B4CB}),e.jsx("path",{d:"M363.574 186.396L349.472 171.5V186.396H363.574Z",fill:X.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:X.c000000,strokeWidth:"2"}),e.jsx("rect",{x:"246.438",y:"202.5",width:"116",height:"60",fill:X.cFFFFFF}),e.jsx("path",{d:"M245.536 187.5H362.959L369.438 198.5H237.438L245.536 187.5Z",fill:X.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:X.cFFFFFF,stroke:X.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:X.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:X.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:X.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:X.c000000,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}),e.jsx("circle",{cx:"291.724",cy:"118.765",r:"3.1027",fill:X.c000000}),e.jsx("path",{d:"M308.128 122.463C309.123 120.973 309.987 120.418 311.883 120.237",stroke:X.c000000,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}),e.jsx("circle",{cx:"307.681",cy:"118.765",r:"3.1027",fill:X.c000000}),e.jsx("ellipse",{cx:"297.938",cy:"134.5",rx:"2.5",ry:"2",fill:X.c000000}),e.jsx("path",{d:"M340.437 97.5L333.438 104.5M333.438 97.5L340.438 104.5",stroke:X.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:X.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:X.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:X.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:X.c001A72,strokeWidth:"1.2",strokeLinecap:"round",strokeLinejoin:"round"}),e.jsx("circle",{cx:"339.938",cy:"111",r:"2.5",fill:X.c001A72}),e.jsx("circle",{cx:"336.438",cy:"94.5",r:"1",fill:X.c001A72}),e.jsx("circle",{cx:"347.438",cy:"99.5",r:"1",fill:X.c001A72}),e.jsx("circle",{cx:"267.438",cy:"109.5",r:"2",fill:X.c001A72}),e.jsx("circle",{cx:"293.438",cy:"85.5",r:"2",fill:X.c001A72}),e.jsx("circle",{cx:"339.438",cy:"138.5",r:"2",fill:X.c001A72}),e.jsx("circle",{cx:"267.438",cy:"150.5",r:"2",fill:X.c001A72}),e.jsx("circle",{cx:"268.438",cy:"118.5",r:"1",fill:X.c001A72}),e.jsx("circle",{cx:"260.438",cy:"124.5",r:"1",fill:X.c001A72})]})})}function hl({onClick:t}){const r=je.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(xl,{width:r?600:300}),e.jsx(D.Text,{fontWeight:"bold",fontSize:r?"3xl":"2xl",textAlign:"center",children:"Page Not Found"}),e.jsx(D.Text,{fontWeight:"semibold",fontSize:r?"lg":"md",textAlign:"center",children:"Sorry, we couldn't find the page you are looking for"}),t&&e.jsx(V.Button,{size:r?"md":"xs",onClick:t,children:"Go Back"})]})}const $={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 fl({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:$.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:$.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:$.cEFF3F8,stroke:$.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:$.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:$.cCABEB1}),e.jsx("path",{d:"M287.68 218.884L289.354 213.022H378.961L381.473 218.884H287.68Z",fill:$.cC0B2A2}),e.jsx("path",{d:"M381.944 218.803L381.58 212.266H386.385L386.022 218.803H381.944Z",fill:$.c956847,stroke:$.c48504C}),e.jsx("path",{d:"M283.124 218.803L282.768 213.104H287.565L287.209 218.803H283.124Z",fill:$.c956847,stroke:$.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:$.cC8CEF4,stroke:$.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:$.cC8CEF4,stroke:$.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:$.cC8CEF4,stroke:$.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:$.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:$.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:$.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:$.cD6D6D6}),e.jsx("path",{d:"M368.673 152.523H301.336V174.5H368.673V152.523Z",fill:$.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:$.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:$.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:$.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:$.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:$.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:$.cBBDEFB,fillOpacity:"0.6"}),e.jsx("rect",{x:"43",y:"87.5",width:"46",height:"20",fill:$.cD6EBFD}),e.jsx("rect",{x:"29",y:"109.5",width:"46",height:"20",fill:$.cD6EBFD}),e.jsx("rect",{x:"29",y:"65.5",width:"46",height:"20",fill:$.cD6EBFD}),e.jsx("rect",{x:"356",y:"0.5",width:"55",height:"20",fill:$.cD6EBFD}),e.jsx("rect",{x:"572",y:"142.5",width:"55",height:"20",fill:$.cD6EBFD}),e.jsx("rect",{x:"589",y:"120.5",width:"55",height:"20",fill:$.cD6EBFD}),e.jsx("path",{d:"M3 255.5L651 255.5",stroke:$.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:$.cFFFFFF,transform:"translate(246 60.5)"})})})]})})}function ml({onClick:t}){const r=je.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(fl,{width:r?600:300}),e.jsx(D.Text,{fontWeight:"bold",fontSize:r?"3xl":"2xl",children:"We Are Sorry ..."}),t&&e.jsx(V.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 gl({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 yl({onClick:t}){const r=je.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(gl,{width:r?600:300}),e.jsx(D.Text,{fontWeight:"bold",fontSize:r?"3xl":"2xl",textAlign:"center",children:"Server Problem"}),e.jsx(D.Text,{fontWeight:"semibold",fontSize:r?"lg":"md",textAlign:"center",children:"we are trying to fix the problem"}),t&&e.jsx(V.Button,{size:r?"md":"xs",onClick:t,children:"Go Back"})]})}const pl=t=>{var n,s,o,i,c;const r=je.useMediaQuery("md");return e.jsxs(We.Dialog,{isShow:t.isShow,onHide:t.onHide,style:{...r?{minWidth:t.customMinWidth||"458px"}:{maxWidth:t.customMinWidth||"458px"}},children:[e.jsx(We.DialogTitle,{...t.dialogTitleProps,children:typeof t.title=="string"?e.jsx(D.Text,{fontSize:"lg",fontWeight:"medium",children:t.title}):t.title}),e.jsx(We.DialogBody,{children:typeof t.description=="string"?e.jsx(D.Text,{fontSize:"md",lineHeight:"leading-6",color:"brand",children:t.description}):t.description}),e.jsx(We.DialogFooter,{children:e.jsx(f.Box,{display:"flex",direction:((n=t.containerConfirmBtnProps)==null?void 0:n.direction)||"row",justify:((s=t.containerConfirmBtnProps)==null?void 0:s.justify)||"flex-end",...t.containerConfirmBtnProps,children:e.jsxs(f.Box,{display:"flex",direction:((o=t.wrapperConfirmBtnProps)==null?void 0:o.direction)||"row",justify:((i=t.wrapperConfirmBtnProps)==null?void 0:i.justify)||"flex-end",gap:((c=t.wrapperConfirmBtnProps)==null?void 0:c.gap)||"sm",...t.wrapperConfirmBtnProps,children:[t.onCancel&&e.jsx(V.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(V.Button,{...t.buttonConfirmProps,onClick:t.onConfirm,size:"md",fullWidth:!0,children:t.titleConfirmBtn||"Ok"})})]})})})]},t.key)},jl=u.memo(({children:t,height:r,minHeight:n,customHeight:s,paddingInline:o="spacing-0",paddingBlock:i="spacing-0",header:c,footer:l,title:a,titleTag:d,action:h,actionContainer:g,containerProps:m,bodyProps:j,headerProps:M={borderBottom:!0},footerProps:p={borderTop:!0},variantTag:L="info"})=>{const S=u.useRef(null),[T,w]=u.useState("100vh");u.useEffect(()=>{const b=()=>{if(S.current){const F=S.current.getBoundingClientRect().top;w(`calc(100vh - ${F}px)`)}};return b(),window.addEventListener("resize",b),()=>window.removeEventListener("resize",b)},[]);const C=()=>d?e.jsxs(f.Box,{direction:"row",gap:"sm",align:"center",children:[e.jsx(D.Text,{fontWeight:"medium",children:a}),e.jsx(Je.Badges,{border:!0,text:d,variant:L})]}):e.jsx(D.Text,{fontWeight:"medium",children:a}),z=()=>c||e.jsxs(f.Box,{direction:"row",justify:"space-between",align:"flex-start",gap:"md",children:[e.jsx(f.Box,{direction:"column",children:a?C():null}),e.jsx(f.Box,{direction:"column",...g,children:h??null})]}),W=!!(c||a||h);return e.jsxs(f.Box,{ref:S,height:r,customMinHeight:n,customHeight:s,paddingBlock:i,paddingInline:o,bg:"white",direction:"column",...m,style:{backgroundColor:"var(--sa-background-primary, #ffffff)",display:"flex",minHeight:T,...(m==null?void 0:m.style)??{}},children:[c!==null&&W?e.jsx(wr,{...M,children:z()}):null,e.jsx(f.Box,{direction:"column",padding:"spacing-0",...j,style:{flex:1,overflow:"auto",...(j==null?void 0:j.style)??{}},children:t}),l?e.jsx(Dr,{...p,children:l}):null]})}),bl=u.memo(({value:t,options:r=[],onChange:n,multiple:s})=>{const o=(t==null?void 0:t.map(l=>l.value))||[],i=(r==null?void 0:r.filter(l=>o.includes(l.value)))||[],c=l=>{const a=[...i];let d=[];s?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(V.Button,{...o.includes(l.value)?{primary:!0}:{secondary:!0},onClick:()=>c(l),children:l.label},a))})});function Ht(t){return null}Ht.displayName="LayoutDialog.Header";function Pt(t){return null}Pt.displayName="LayoutDialog.Body";function Nt(t){return null}Nt.displayName="LayoutDialog.Aside";function _t(t){return null}_t.displayName="LayoutDialog.Footer";const De={"lyd-root":"_lyd-root_14rlp_1","lyd-backdrop":"_lyd-backdrop_14rlp_34","lyd-panel":"_lyd-panel_14rlp_43","lyd-modal":"_lyd-modal_14rlp_54","lyd-fullscreen":"_lyd-fullscreen_14rlp_64","lyd-sidebar":"_lyd-sidebar_14rlp_72","lyd-header":"_lyd-header_14rlp_100","lyd-header-content":"_lyd-header-content_14rlp_111","lyd-header-actions":"_lyd-header-actions_14rlp_119","lyd-main":"_lyd-main_14rlp_126","lyd-body":"_lyd-body_14rlp_133","lyd-aside":"_lyd-aside_14rlp_139","lyd-footer":"_lyd-footer_14rlp_155","lyd-vm-group":"_lyd-vm-group_14rlp_168","lyd-vm-btn":"_lyd-vm-btn_14rlp_176","lyd-close-btn":"_lyd-close-btn_14rlp_199"},vl=[{mode:"sidebar",label:"Sidebar",icon:e.jsx(wl,{})},{mode:"modal",label:"Modal",icon:e.jsx(B.Icon,{name:"Newscreen",size:"sm"})},{mode:"fullscreen",label:"Fullscreen",icon:e.jsx(B.Icon,{name:"Fullscreen",size:"sm"})}];function Cl({value:t,onChange:r}){return e.jsx("div",{className:De["lyd-vm-group"],role:"group","aria-label":"View mode",children:vl.map(n=>e.jsx("button",{type:"button",className:De["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 wl(){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 xr={md:"768px",lg:"1024px",xl:"1200px","2xl":"1440px"};function Dl(t){return t?t in xr?xr[t]:t:xr.xl}function Mt(t,r){let n=null;return u.Children.forEach(t,s=>{u.isValidElement(s)&&s.type===r&&(n=s.props.children??null)}),n}function Sl(t){const{isOpen:r,onClose:n,viewMode:s,defaultViewMode:o="modal",onViewModeChange:i,showViewModeToggle:c=!0,showCloseButton:l=!0,size:a,asideWidth:d,disableEscapeClose:h=!1,disableBackdropClose:g=!1,lockBodyScroll:m=!0,children:j}=t,[M,p]=u.useState(o),L=s??M,T=je.useMediaQuery("md")?L:"fullscreen",w=u.useCallback(U=>{s===void 0&&p(U),i==null||i(U)},[s,i]),C=u.useRef(null);u.useEffect(()=>{if(!(!r||!m))return C.current=document.body.style.overflow,document.body.style.overflow="hidden",()=>{document.body.style.overflow=C.current??""}},[r,m]),u.useEffect(()=>{if(!r||h)return;const U=re=>{re.key==="Escape"&&n()};return window.addEventListener("keydown",U),()=>window.removeEventListener("keydown",U)},[r,h,n]);const z=u.useMemo(()=>Mt(j,Ht),[j]),W=u.useMemo(()=>Mt(j,Pt),[j]),b=u.useMemo(()=>Mt(j,Nt),[j]),F=u.useMemo(()=>Mt(j,_t),[j]);if(!r)return null;const N=[De["lyd-panel"],T==="modal"&&De["lyd-modal"],T==="fullscreen"&&De["lyd-fullscreen"],T==="sidebar"&&De["lyd-sidebar"]].filter(Boolean).join(" "),A={"--lyd-max-w":Dl(a),...d!==void 0&&{"--lyd-aside-w":d}},H=()=>{g||n()};return e.jsxs("div",{className:De["lyd-root"],style:A,role:"dialog","aria-modal":"true",children:[e.jsx("div",{className:De["lyd-backdrop"],onClick:H,"aria-hidden":"true"}),e.jsxs("div",{className:N,children:[e.jsxs("div",{className:De["lyd-header"],children:[e.jsx("div",{className:De["lyd-header-content"],children:z}),e.jsxs("div",{className:De["lyd-header-actions"],children:[c&&e.jsx(Cl,{value:L,onChange:w}),l&&e.jsx("button",{type:"button",className:De["lyd-close-btn"],onClick:n,"aria-label":"Close dialog",children:e.jsx(B.Icon,{name:"Cross",size:"md"})})]})]}),e.jsxs("div",{className:De["lyd-main"],children:[e.jsx("div",{className:De["lyd-body"],children:W}),b&&e.jsx("aside",{className:De["lyd-aside"],children:b})]}),F&&e.jsx("div",{className:De["lyd-footer"],children:F})]})]})}const jt=Sl;jt.Header=Ht;jt.Body=Pt;jt.Aside=Nt;jt.Footer=_t;function kl({url:t,filename:r,onClose:n}){return u.useEffect(()=>{const s=o=>{o.key==="Escape"&&n()};return window.addEventListener("keydown",s),()=>window.removeEventListener("keydown",s)},[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:s=>s.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:s=>s.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 Bl=t=>{const{defaultTab:r=0,paramKey:n="tab"}=t||{},[s,o]=be.useSearchParams(),i=at.searchParamsToObject(s.toString());return{activeTab:i[n]?parseInt(i[n]):r,handleTabChange:a=>{o({...i,[n]:a.toString()})},searchQueries:i}};function Fl({appName:t,menuConfig:r,formatTitle:n}){const s=be.useLocation();u.useEffect(()=>{let o=null,i=null;for(const a of r){const d=a.items.find(h=>h.to?h.to==="/"?s.pathname==="/":!!(h.to===s.pathname||s.pathname.startsWith(h.to+"/")):!1);if(d){o=d,i=a;break}}const c=[];o!=null&&o.title&&c.push(o.title),i!=null&&i.name&&c.push(i.name.toTitleCase());const l=(a,d)=>a.length>0?`${a.join(" - ")} | ${d}`:d;document.title=(n||l)(c,t)},[s.pathname])}const El=()=>{const[t,r]=be.useSearchParams(),n=at.searchParamsToObject(t.toString()),s=be.useParams(),o=be.useLocation(),i=s.id;return{setSearchParams:r,searchParams:t,searchQueries:n,isHasQuery:(h,g)=>t.has(h)&&t.get(h)===g,getQueryParam:h=>t.get(h),getRouteParam:h=>s[h],params:s,location:o,id:i,hasId:!!i}};function Ml(t){var s,o;const r=t.decodedAccessToken;return u.useMemo(()=>{var a,d;const i=((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,g)=>{const m=`is${g.toLowerCase().replace(/(^\w|_\w)/g,j=>j.replace("_","").toUpperCase())}`;return{...h,[m]:!1}},{});return{...Object.keys(t.role).reduce((h,g)=>{const m=`is${g.toLowerCase().replace(/(^\w|_\w)/g,j=>j.replace("_","").toUpperCase())}`;return{...h,[m]:i===t.role[g]}},c),hasRole:h=>i===t.role[h],getRoleKey:()=>i}},[(o=(s=r==null?void 0:r.access)==null?void 0:s.role)==null?void 0:o.code,t])}exports.AdvanceFilterBar=Nn;exports.App=Mo;exports.AppComponent=kn;exports.AppContext=pr;exports.AppLayout=Oo;exports.AsideBar=il;exports.BackButton=Ro;exports.ColumnFilterDropdown=Kn;exports.ColumnMenu=eo;exports.ConfirmationDialog=pl;exports.DataTable=$n;exports.DecisionWrapper=se;exports.EachUtils=Vt;exports.EmptyStatePage=ul;exports.FilterBar=Ns;exports.FilterDrawer=Pn;exports.FloatingFooter=ll;exports.ForbiddenPage=ml;exports.Form=Xi;exports.FullSection=jl;exports.HeaderLeftSlot=Lo;exports.HeaderLeftSlotOutlet=En;exports.HeaderLeftSlotProvider=Fn;exports.HorizontalField=Po;exports.ImagePreview=kl;exports.InputFile=ro;exports.InputImage=no;exports.LayoutDialog=jt;exports.LayoutDialogAside=Nt;exports.LayoutDialogBody=Pt;exports.LayoutDialogFooter=_t;exports.LayoutDialogHeader=Ht;exports.ModuleSwitcher=zo;exports.ModuleSwitcherModal=In;exports.NotFoundPage=hl;exports.PageLayout=qo;exports.Pressable=pt;exports.RightDrawer=On;exports.ScrollToTopButton=oo;exports.Section=Uo;exports.SectionFooter=Dr;exports.SectionHeader=wr;exports.SelectButton=bl;exports.ServerErrorPage=yl;exports.SidePanel=sl;exports.SidePanelItem=rl;exports.SidebarBadgesProvider=Dn;exports.SidebarGroupSlot=To;exports.SidebarGroupSlotOutlet=Ln;exports.SidebarGroupSlotProvider=Mn;exports.SidebarHeaderSlot=Bn;exports.TableFooter=Xn;exports.TableHeader=Yn;exports.TableLayout=ci;exports.TableSection=ti;exports.TableWrapper=Jn;exports.ToggleStatus=Yi;exports.Typography=Re;exports.VerticalField=cl;exports.clearModuleSelection=Io;exports.createInitialFromUserName=fi;exports.cssVars=bi;exports.expandDateCompact=Js;exports.formHasChanged=ki;exports.formatDate=pi;exports.formatDateToIndonesian=to;exports.formatRupiah=gi;exports.getDateFilterValue=Hn;exports.getDateRangeFilterValue=ds;exports.getInitials=yi;exports.getValueDropdownMultipleFilter=Vn;exports.getValueRadioFilter=as;exports.getValueSearch=zt;exports.getValuesFilter=Tt;exports.handleChangeFilter=yt;exports.handleOnScroll=Wi;exports.isEmail=Ti;exports.isFilterActive=us;exports.isOnlyLettersAndSpaces=Fi;exports.isPhoneNumber=Bi;exports.isSlug=Ii;exports.localStorageAdapter=kr;exports.oneDayInMs=vi;exports.parseIndonesianDateToDate=mi;exports.preventNonCoordinateInput=Oi;exports.preventNonNumberAndDecimalInput=Li;exports.preventNonNumberInput=Ei;exports.preventNumberInput=Mi;exports.resolveDateRangeValueToString=zn;exports.resolveDateValueToString=An;exports.resolveDropdownValueToString=Wn;exports.resolveRadioValueToString=Rn;exports.resolveSidebarBadge=Lt;exports.storageKeys=ut;exports.textWidth=Ci;exports.useApp=jr;exports.useAppState=Cn;exports.useAuthRole=Ml;exports.useDynamicTitle=Fl;exports.useFilterBarApiParams=Gs;exports.useFilterBarControls=Us;exports.useModuleSelection=Cr;exports.useRouteInfo=Be;exports.useRouteParams=El;exports.useSidebarBadges=Sn;exports.useTabState=Bl;exports.useTableSortApiParams=ai;Object.keys(Pr).forEach(t=>{t!=="default"&&!Object.prototype.hasOwnProperty.call(exports,t)&&Object.defineProperty(exports,t,{enumerable:!0,get:()=>Pr[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(f).forEach(t=>{t!=="default"&&!Object.prototype.hasOwnProperty.call(exports,t)&&Object.defineProperty(exports,t,{enumerable:!0,get:()=>f[t]})});Object.keys(it).forEach(t=>{t!=="default"&&!Object.prototype.hasOwnProperty.call(exports,t)&&Object.defineProperty(exports,t,{enumerable:!0,get:()=>it[t]})});Object.keys(V).forEach(t=>{t!=="default"&&!Object.prototype.hasOwnProperty.call(exports,t)&&Object.defineProperty(exports,t,{enumerable:!0,get:()=>V[t]})});Object.keys(Nr).forEach(t=>{t!=="default"&&!Object.prototype.hasOwnProperty.call(exports,t)&&Object.defineProperty(exports,t,{enumerable:!0,get:()=>Nr[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(We).forEach(t=>{t!=="default"&&!Object.prototype.hasOwnProperty.call(exports,t)&&Object.defineProperty(exports,t,{enumerable:!0,get:()=>We[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(ct).forEach(t=>{t!=="default"&&!Object.prototype.hasOwnProperty.call(exports,t)&&Object.defineProperty(exports,t,{enumerable:!0,get:()=>ct[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(at).forEach(t=>{t!=="default"&&!Object.prototype.hasOwnProperty.call(exports,t)&&Object.defineProperty(exports,t,{enumerable:!0,get:()=>at[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(O).forEach(t=>{t!=="default"&&!Object.prototype.hasOwnProperty.call(exports,t)&&Object.defineProperty(exports,t,{enumerable:!0,get:()=>O[t]})});Object.keys(gt).forEach(t=>{t!=="default"&&!Object.prototype.hasOwnProperty.call(exports,t)&&Object.defineProperty(exports,t,{enumerable:!0,get:()=>gt[t]})});Object.keys(mt).forEach(t=>{t!=="default"&&!Object.prototype.hasOwnProperty.call(exports,t)&&Object.defineProperty(exports,t,{enumerable:!0,get:()=>mt[t]})});Object.keys(Z).forEach(t=>{t!=="default"&&!Object.prototype.hasOwnProperty.call(exports,t)&&Object.defineProperty(exports,t,{enumerable:!0,get:()=>Z[t]})});Object.keys(_r).forEach(t=>{t!=="default"&&!Object.prototype.hasOwnProperty.call(exports,t)&&Object.defineProperty(exports,t,{enumerable:!0,get:()=>_r[t]})});Object.keys(hr).forEach(t=>{t!=="default"&&!Object.prototype.hasOwnProperty.call(exports,t)&&Object.defineProperty(exports,t,{enumerable:!0,get:()=>hr[t]})});Object.keys(lt).forEach(t=>{t!=="default"&&!Object.prototype.hasOwnProperty.call(exports,t)&&Object.defineProperty(exports,t,{enumerable:!0,get:()=>lt[t]})});Object.keys(qr).forEach(t=>{t!=="default"&&!Object.prototype.hasOwnProperty.call(exports,t)&&Object.defineProperty(exports,t,{enumerable:!0,get:()=>qr[t]})});Object.keys(dt).forEach(t=>{t!=="default"&&!Object.prototype.hasOwnProperty.call(exports,t)&&Object.defineProperty(exports,t,{enumerable:!0,get:()=>dt[t]})});Object.keys(we).forEach(t=>{t!=="default"&&!Object.prototype.hasOwnProperty.call(exports,t)&&Object.defineProperty(exports,t,{enumerable:!0,get:()=>we[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(fr).forEach(t=>{t!=="default"&&!Object.prototype.hasOwnProperty.call(exports,t)&&Object.defineProperty(exports,t,{enumerable:!0,get:()=>fr[t]})});Object.keys(D).forEach(t=>{t!=="default"&&!Object.prototype.hasOwnProperty.call(exports,t)&&Object.defineProperty(exports,t,{enumerable:!0,get:()=>D[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(oe).forEach(t=>{t!=="default"&&!Object.prototype.hasOwnProperty.call(exports,t)&&Object.defineProperty(exports,t,{enumerable:!0,get:()=>oe[t]})});Object.keys(Zr).forEach(t=>{t!=="default"&&!Object.prototype.hasOwnProperty.call(exports,t)&&Object.defineProperty(exports,t,{enumerable:!0,get:()=>Zr[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(Qr).forEach(t=>{t!=="default"&&!Object.prototype.hasOwnProperty.call(exports,t)&&Object.defineProperty(exports,t,{enumerable:!0,get:()=>Qr[t]})});Object.keys(Ur).forEach(t=>{t!=="default"&&!Object.prototype.hasOwnProperty.call(exports,t)&&Object.defineProperty(exports,t,{enumerable:!0,get:()=>Ur[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(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]})});
|