@powerhousedao/connect 6.0.0-dev.35 → 6.0.0-dev.36

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (36) hide show
  1. package/dist/assets/{AddDriveModal-DgWDjHk6.js → AddDriveModal-CbbhwoK5.js} +1 -1
  2. package/dist/assets/{ClearStorageModal-NiCExsdP.js → ClearStorageModal-D9ImX_Y2.js} +1 -1
  3. package/dist/assets/{CookiesPolicyModal-Cn_Rk_ws.js → CookiesPolicyModal-DZyR4I6Q.js} +1 -1
  4. package/dist/assets/{CreateDocumentModal-D-zj8JuH.js → CreateDocumentModal-cuFCUL54.js} +1 -1
  5. package/dist/assets/{DebugSettingsModal-B0NXumlG.js → DebugSettingsModal-VZC-kyV4.js} +1 -1
  6. package/dist/assets/{DeleteDriveModal-vJtB3esF.js → DeleteDriveModal-CZ8ybNGd.js} +1 -1
  7. package/dist/assets/{DeleteItemModal-CceF4AQk.js → DeleteItemModal-C4TMzdIM.js} +1 -1
  8. package/dist/assets/{DisclaimerModal-q1BWMBgA.js → DisclaimerModal-C5IAgg0F.js} +1 -1
  9. package/dist/assets/{DriveSettingsModal-BgNxsvW0.js → DriveSettingsModal-CZUaaimi.js} +1 -1
  10. package/dist/assets/{ExportDocumentWithErrorsModal-ChOpQgZG.js → ExportDocumentWithErrorsModal-DGqH3ZUh.js} +1 -1
  11. package/dist/assets/{SettingsModal-vuXP88Mg.js → SettingsModal-BAwPX5lx.js} +1 -1
  12. package/dist/assets/{UpgradeDriveModal-O7dF2Bbv.js → UpgradeDriveModal-CqiN9g24.js} +1 -1
  13. package/dist/assets/{design_system-DJpOmF2E.js → design_system-2B9-gBoy.js} +1 -1
  14. package/dist/assets/design_system_connect-BDSRzEbz.js +47 -0
  15. package/dist/assets/{design_system_ui-BXlYYDQC.js → design_system_ui-DfgQWIF6.js} +1 -1
  16. package/dist/assets/{document_engineering-D5yCrHRS.js → document_engineering-Ml4bCoxs.js} +1 -1
  17. package/dist/assets/{document_model_editor-DNCGY7nR.js → document_model_editor-HMgNrWzH.js} +4 -4
  18. package/dist/assets/{drive_explorer-CtTqBc39.js → drive_explorer-Ci_KsiFF.js} +2 -2
  19. package/dist/assets/{graphql-editor-BlN69xIT.js → graphql-editor-D6R-QKan.js} +1 -1
  20. package/dist/assets/{hooks-C39wEEgX.js → hooks-BAkpcESF.js} +1 -1
  21. package/dist/assets/index-B6A7sjLB.css +1 -0
  22. package/dist/assets/{index-Cg3B8BbM.js → index-Cunlfu9j.js} +2 -2
  23. package/dist/assets/{index-0XDY9XMU.js → index-Do-t7JyC.js} +3 -3
  24. package/dist/assets/{json-editor-DGIQ_sB8.js → json-editor-Bmu8AdkO.js} +1 -1
  25. package/dist/assets/{nodefs-B7r3fzXQ.js → nodefs-DzwRvn5F.js} +1 -1
  26. package/dist/assets/{opfs-ahp-BICmUVJu.js → opfs-ahp-W4_dEVA8.js} +1 -1
  27. package/dist/assets/{reactor_browser-CQckBDAv.js → reactor_browser-DKT7DitQ.js} +14 -12
  28. package/dist/assets/{state-schemas-wgDPnzsE.js → state-schemas-CGHq7g1z.js} +2 -2
  29. package/dist/index.html +8 -8
  30. package/lib/package.copy.json +1 -1
  31. package/lib/style.css +0 -3
  32. package/lib/tsconfig.tsbuildinfo +1 -1
  33. package/package.copy.json +1 -1
  34. package/package.json +10 -10
  35. package/dist/assets/design_system_connect-Bf5zyCf6.js +0 -47
  36. package/dist/assets/index-CCYUx14G.css +0 -1
@@ -1,47 +0,0 @@
1
- import{r as b,R as So,a as Q}from"./sentry_react-cODD7zWc.js";import{j as i,u as ni,r as ri,C as si,b as Ds,a as Ue}from"./document_model_editor-DNCGY7nR.js";import{c as Rs,d as oi,e as ai,f as iu,s as cu,g as ht,h as lu,i as uu,j as du,k as ar,l as fu,m as pu,n as hu,o as mu,p as gu,q as bu,r as yu,t as xu,v as vu,w as wu,x as ii,y as Cu,S as De,G as Su,I as ju,Q as Nu,z as Pu}from"./reactor_browser-CQckBDAv.js";import{P as vt,a as ci,b as li,u as ui,d as di,R as Eu,A as Iu,e as Te,f as Ls,g as Ou,D as ku,C as Mu,h as Tu,i as Au,j as Du,I,k as Ru,m as ce,l as Ce,M as Fe,n as Lu,o as fi,p as Fu,q as zu,r as $u,s as Vu,t as Bu,v as Uu,c as pi,w as Hu,x as _u,S as Wu,y as Gu,z as Yu,B as qu}from"./design_system-DJpOmF2E.js";import{t as k,a as Fs}from"./tailwind_merge-Dr4f9Rms.js";import{X as Ju,Y as Qu,T as jo,Z as Xu,_ as Ku}from"./document_model-DxDgOZQk.js";import{c as xn,g as hi}from"./react-DQSxOgtG.js";import{l as Xr,m as Zu}from"./document_drive-CDMxtf9f.js";import{o as ed,r as No,s as jt}from"./zod-9j67vCAu.js";import{P as td,a as nd,b as rd,S as mi,I as sd,c as od}from"./design_system_ui-BXlYYDQC.js";import{_ as ad}from"./drive_explorer-CtTqBc39.js";var id=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),cd="VisuallyHidden",gi=b.forwardRef((e,t)=>i.jsx(vt.span,{...e,ref:t,style:{...id,...e.style}}));gi.displayName=cd;var ld=gi,[ir]=ci("Tooltip",[li]),cr=li(),bi="TooltipProvider",ud=700,Kr="tooltip.open",[dd,zs]=ir(bi),yi=e=>{const{__scopeTooltip:t,delayDuration:n=ud,skipDelayDuration:s=300,disableHoverableContent:r=!1,children:o}=e,a=b.useRef(!0),c=b.useRef(!1),l=b.useRef(0);return b.useEffect(()=>{const u=l.current;return()=>window.clearTimeout(u)},[]),i.jsx(dd,{scope:t,isOpenDelayedRef:a,delayDuration:n,onOpen:b.useCallback(()=>{window.clearTimeout(l.current),a.current=!1},[]),onClose:b.useCallback(()=>{window.clearTimeout(l.current),l.current=window.setTimeout(()=>a.current=!0,s)},[s]),isPointerInTransitRef:c,onPointerInTransitChange:b.useCallback(u=>{c.current=u},[]),disableHoverableContent:r,children:o})};yi.displayName=bi;var Rt="Tooltip",[fd,un]=ir(Rt),xi=e=>{const{__scopeTooltip:t,children:n,open:s,defaultOpen:r,onOpenChange:o,disableHoverableContent:a,delayDuration:c}=e,l=zs(Rt,e.__scopeTooltip),u=cr(t),[d,p]=b.useState(null),f=ui(),h=b.useRef(0),m=a??l.disableHoverableContent,g=c??l.delayDuration,y=b.useRef(!1),[x,v]=di({prop:s,defaultProp:r??!1,onChange:C=>{C?(l.onOpen(),document.dispatchEvent(new CustomEvent(Kr))):l.onClose(),o?.(C)},caller:Rt}),S=b.useMemo(()=>x?y.current?"delayed-open":"instant-open":"closed",[x]),N=b.useCallback(()=>{window.clearTimeout(h.current),h.current=0,y.current=!1,v(!0)},[v]),w=b.useCallback(()=>{window.clearTimeout(h.current),h.current=0,v(!1)},[v]),j=b.useCallback(()=>{window.clearTimeout(h.current),h.current=window.setTimeout(()=>{y.current=!0,v(!0),h.current=0},g)},[g,v]);return b.useEffect(()=>()=>{h.current&&(window.clearTimeout(h.current),h.current=0)},[]),i.jsx(Eu,{...u,children:i.jsx(fd,{scope:t,contentId:f,open:x,stateAttribute:S,trigger:d,onTriggerChange:p,onTriggerEnter:b.useCallback(()=>{l.isOpenDelayedRef.current?j():N()},[l.isOpenDelayedRef,j,N]),onTriggerLeave:b.useCallback(()=>{m?w():(window.clearTimeout(h.current),h.current=0)},[w,m]),onOpen:N,onClose:w,disableHoverableContent:m,children:n})})};xi.displayName=Rt;var Zr="TooltipTrigger",vi=b.forwardRef((e,t)=>{const{__scopeTooltip:n,...s}=e,r=un(Zr,n),o=zs(Zr,n),a=cr(n),c=b.useRef(null),l=ni(t,c,r.onTriggerChange),u=b.useRef(!1),d=b.useRef(!1),p=b.useCallback(()=>u.current=!1,[]);return b.useEffect(()=>()=>document.removeEventListener("pointerup",p),[p]),i.jsx(Iu,{asChild:!0,...a,children:i.jsx(vt.button,{"aria-describedby":r.open?r.contentId:void 0,"data-state":r.stateAttribute,...s,ref:l,onPointerMove:Te(e.onPointerMove,f=>{f.pointerType!=="touch"&&!d.current&&!o.isPointerInTransitRef.current&&(r.onTriggerEnter(),d.current=!0)}),onPointerLeave:Te(e.onPointerLeave,()=>{r.onTriggerLeave(),d.current=!1}),onPointerDown:Te(e.onPointerDown,()=>{r.open&&r.onClose(),u.current=!0,document.addEventListener("pointerup",p,{once:!0})}),onFocus:Te(e.onFocus,()=>{u.current||r.onOpen()}),onBlur:Te(e.onBlur,r.onClose),onClick:Te(e.onClick,r.onClose)})})});vi.displayName=Zr;var $s="TooltipPortal",[pd,hd]=ir($s,{forceMount:void 0}),wi=e=>{const{__scopeTooltip:t,forceMount:n,children:s,container:r}=e,o=un($s,t);return i.jsx(pd,{scope:t,forceMount:n,children:i.jsx(Ls,{present:n||o.open,children:i.jsx(Ou,{asChild:!0,container:r,children:s})})})};wi.displayName=$s;var mt="TooltipContent",Ci=b.forwardRef((e,t)=>{const n=hd(mt,e.__scopeTooltip),{forceMount:s=n.forceMount,side:r="top",...o}=e,a=un(mt,e.__scopeTooltip);return i.jsx(Ls,{present:s||a.open,children:a.disableHoverableContent?i.jsx(Si,{side:r,...o,ref:t}):i.jsx(md,{side:r,...o,ref:t})})}),md=b.forwardRef((e,t)=>{const n=un(mt,e.__scopeTooltip),s=zs(mt,e.__scopeTooltip),r=b.useRef(null),o=ni(t,r),[a,c]=b.useState(null),{trigger:l,onClose:u}=n,d=r.current,{onPointerInTransitChange:p}=s,f=b.useCallback(()=>{c(null),p(!1)},[p]),h=b.useCallback((m,g)=>{const y=m.currentTarget,x={x:m.clientX,y:m.clientY},v=vd(x,y.getBoundingClientRect()),S=wd(x,v),N=Cd(g.getBoundingClientRect()),w=jd([...S,...N]);c(w),p(!0)},[p]);return b.useEffect(()=>()=>f(),[f]),b.useEffect(()=>{if(l&&d){const m=y=>h(y,d),g=y=>h(y,l);return l.addEventListener("pointerleave",m),d.addEventListener("pointerleave",g),()=>{l.removeEventListener("pointerleave",m),d.removeEventListener("pointerleave",g)}}},[l,d,h,f]),b.useEffect(()=>{if(a){const m=g=>{const y=g.target,x={x:g.clientX,y:g.clientY},v=l?.contains(y)||d?.contains(y),S=!Sd(x,a);v?f():S&&(f(),u())};return document.addEventListener("pointermove",m),()=>document.removeEventListener("pointermove",m)}},[l,d,a,u,f]),i.jsx(Si,{...e,ref:o})}),[gd,bd]=ir(Rt,{isInside:!1}),yd=Tu("TooltipContent"),Si=b.forwardRef((e,t)=>{const{__scopeTooltip:n,children:s,"aria-label":r,onEscapeKeyDown:o,onPointerDownOutside:a,...c}=e,l=un(mt,n),u=cr(n),{onClose:d}=l;return b.useEffect(()=>(document.addEventListener(Kr,d),()=>document.removeEventListener(Kr,d)),[d]),b.useEffect(()=>{if(l.trigger){const p=f=>{f.target?.contains(l.trigger)&&d()};return window.addEventListener("scroll",p,{capture:!0}),()=>window.removeEventListener("scroll",p,{capture:!0})}},[l.trigger,d]),i.jsx(ku,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:o,onPointerDownOutside:a,onFocusOutside:p=>p.preventDefault(),onDismiss:d,children:i.jsxs(Mu,{"data-state":l.stateAttribute,...u,...c,ref:t,style:{...c.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[i.jsx(yd,{children:s}),i.jsx(gd,{scope:n,isInside:!0,children:i.jsx(ld,{id:l.contentId,role:"tooltip",children:r||s})})]})})});Ci.displayName=mt;var ji="TooltipArrow",xd=b.forwardRef((e,t)=>{const{__scopeTooltip:n,...s}=e,r=cr(n);return bd(ji,n).isInside?null:i.jsx(Au,{...r,...s,ref:t})});xd.displayName=ji;function vd(e,t){const n=Math.abs(t.top-e.y),s=Math.abs(t.bottom-e.y),r=Math.abs(t.right-e.x),o=Math.abs(t.left-e.x);switch(Math.min(n,s,r,o)){case o:return"left";case r:return"right";case n:return"top";case s:return"bottom";default:throw new Error("unreachable")}}function wd(e,t,n=5){const s=[];switch(t){case"top":s.push({x:e.x-n,y:e.y+n},{x:e.x+n,y:e.y+n});break;case"bottom":s.push({x:e.x-n,y:e.y-n},{x:e.x+n,y:e.y-n});break;case"left":s.push({x:e.x+n,y:e.y-n},{x:e.x+n,y:e.y+n});break;case"right":s.push({x:e.x-n,y:e.y-n},{x:e.x-n,y:e.y+n});break}return s}function Cd(e){const{top:t,right:n,bottom:s,left:r}=e;return[{x:r,y:t},{x:n,y:t},{x:n,y:s},{x:r,y:s}]}function Sd(e,t){const{x:n,y:s}=e;let r=!1;for(let o=0,a=t.length-1;o<t.length;a=o++){const c=t[o],l=t[a],u=c.x,d=c.y,p=l.x,f=l.y;d>s!=f>s&&n<(p-u)*(s-d)/(f-d)+u&&(r=!r)}return r}function jd(e){const t=e.slice();return t.sort((n,s)=>n.x<s.x?-1:n.x>s.x?1:n.y<s.y?-1:n.y>s.y?1:0),Nd(t)}function Nd(e){if(e.length<=1)return e.slice();const t=[];for(let s=0;s<e.length;s++){const r=e[s];for(;t.length>=2;){const o=t[t.length-1],a=t[t.length-2];if((o.x-a.x)*(r.y-a.y)>=(o.y-a.y)*(r.x-a.x))t.pop();else break}t.push(r)}t.pop();const n=[];for(let s=e.length-1;s>=0;s--){const r=e[s];for(;n.length>=2;){const o=n[n.length-1],a=n[n.length-2];if((o.x-a.x)*(r.y-a.y)>=(o.y-a.y)*(r.x-a.x))n.pop();else break}n.push(r)}return n.pop(),t.length===1&&n.length===1&&t[0].x===n[0].x&&t[0].y===n[0].y?t:t.concat(n)}var Pd=yi,Ed=xi,Id=vi,Od=wi,kd=Ci;const Ni=6048e5,Md=864e5,Pi=6e4,Ei=36e5,vn=43200,Po=1440,Eo=Symbol.for("constructDateFrom");function Ie(e,t){return typeof e=="function"?e(t):e&&typeof e=="object"&&Eo in e?e[Eo](t):e instanceof Date?new e.constructor(t):new Date(t)}function ie(e,t){return Ie(t||e,e)}let Td={};function dn(){return Td}function Lt(e,t){const n=dn(),s=t?.weekStartsOn??t?.locale?.options?.weekStartsOn??n.weekStartsOn??n.locale?.options?.weekStartsOn??0,r=ie(e,t?.in),o=r.getDay(),a=(o<s?7:0)+o-s;return r.setDate(r.getDate()-a),r.setHours(0,0,0,0),r}function _n(e,t){return Lt(e,{...t,weekStartsOn:1})}function Ii(e,t){const n=ie(e,t?.in),s=n.getFullYear(),r=Ie(n,0);r.setFullYear(s+1,0,4),r.setHours(0,0,0,0);const o=_n(r),a=Ie(n,0);a.setFullYear(s,0,4),a.setHours(0,0,0,0);const c=_n(a);return n.getTime()>=o.getTime()?s+1:n.getTime()>=c.getTime()?s:s-1}function Wn(e){const t=ie(e),n=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return n.setUTCFullYear(t.getFullYear()),+e-+n}function lr(e,...t){const n=Ie.bind(null,e||t.find(s=>typeof s=="object"));return t.map(n)}function Io(e,t){const n=ie(e,t?.in);return n.setHours(0,0,0,0),n}function Ad(e,t,n){const[s,r]=lr(n?.in,e,t),o=Io(s),a=Io(r),c=+o-Wn(o),l=+a-Wn(a);return Math.round((c-l)/Md)}function Dd(e,t){const n=Ii(e,t),s=Ie(e,0);return s.setFullYear(n,0,4),s.setHours(0,0,0,0),_n(s)}function Rn(e,t){const n=+ie(e)-+ie(t);return n<0?-1:n>0?1:n}function Rd(e){return Ie(e,Date.now())}function Ld(e){return e instanceof Date||typeof e=="object"&&Object.prototype.toString.call(e)==="[object Date]"}function Fd(e){return!(!Ld(e)&&typeof e!="number"||isNaN(+ie(e)))}function zd(e,t,n){const[s,r]=lr(n?.in,e,t),o=s.getFullYear()-r.getFullYear(),a=s.getMonth()-r.getMonth();return o*12+a}function $d(e){return t=>{const s=(e?Math[e]:Math.trunc)(t);return s===0?0:s}}function Vd(e,t){return+ie(e)-+ie(t)}function Bd(e,t){const n=ie(e,t?.in);return n.setHours(23,59,59,999),n}function Ud(e,t){const n=ie(e,t?.in),s=n.getMonth();return n.setFullYear(n.getFullYear(),s+1,0),n.setHours(23,59,59,999),n}function Hd(e,t){const n=ie(e,t?.in);return+Bd(n,t)==+Ud(n,t)}function _d(e,t,n){const[s,r,o]=lr(n?.in,e,e,t),a=Rn(r,o),c=Math.abs(zd(r,o));if(c<1)return 0;r.getMonth()===1&&r.getDate()>27&&r.setDate(30),r.setMonth(r.getMonth()-a*c);let l=Rn(r,o)===-a;Hd(s)&&c===1&&Rn(s,o)===1&&(l=!1);const u=a*(c-+l);return u===0?0:u}function Wd(e,t,n){const s=Vd(e,t)/1e3;return $d(n?.roundingMethod)(s)}function Gd(e,t){const n=ie(e,t?.in);return n.setFullYear(n.getFullYear(),0,1),n.setHours(0,0,0,0),n}const Yd={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},qd=(e,t,n)=>{let s;const r=Yd[e];return typeof r=="string"?s=r:t===1?s=r.one:s=r.other.replace("{{count}}",t.toString()),n?.addSuffix?n.comparison&&n.comparison>0?"in "+s:s+" ago":s};function Nr(e){return(t={})=>{const n=t.width?String(t.width):e.defaultWidth;return e.formats[n]||e.formats[e.defaultWidth]}}const Jd={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},Qd={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},Xd={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},Kd={date:Nr({formats:Jd,defaultWidth:"full"}),time:Nr({formats:Qd,defaultWidth:"full"}),dateTime:Nr({formats:Xd,defaultWidth:"full"})},Zd={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},ef=(e,t,n,s)=>Zd[e];function Nt(e){return(t,n)=>{const s=n?.context?String(n.context):"standalone";let r;if(s==="formatting"&&e.formattingValues){const a=e.defaultFormattingWidth||e.defaultWidth,c=n?.width?String(n.width):a;r=e.formattingValues[c]||e.formattingValues[a]}else{const a=e.defaultWidth,c=n?.width?String(n.width):e.defaultWidth;r=e.values[c]||e.values[a]}const o=e.argumentCallback?e.argumentCallback(t):t;return r[o]}}const tf={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},nf={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},rf={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},sf={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},of={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},af={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},cf=(e,t)=>{const n=Number(e),s=n%100;if(s>20||s<10)switch(s%10){case 1:return n+"st";case 2:return n+"nd";case 3:return n+"rd"}return n+"th"},lf={ordinalNumber:cf,era:Nt({values:tf,defaultWidth:"wide"}),quarter:Nt({values:nf,defaultWidth:"wide",argumentCallback:e=>e-1}),month:Nt({values:rf,defaultWidth:"wide"}),day:Nt({values:sf,defaultWidth:"wide"}),dayPeriod:Nt({values:of,defaultWidth:"wide",formattingValues:af,defaultFormattingWidth:"wide"})};function Pt(e){return(t,n={})=>{const s=n.width,r=s&&e.matchPatterns[s]||e.matchPatterns[e.defaultMatchWidth],o=t.match(r);if(!o)return null;const a=o[0],c=s&&e.parsePatterns[s]||e.parsePatterns[e.defaultParseWidth],l=Array.isArray(c)?df(c,p=>p.test(a)):uf(c,p=>p.test(a));let u;u=e.valueCallback?e.valueCallback(l):l,u=n.valueCallback?n.valueCallback(u):u;const d=t.slice(a.length);return{value:u,rest:d}}}function uf(e,t){for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&t(e[n]))return n}function df(e,t){for(let n=0;n<e.length;n++)if(t(e[n]))return n}function ff(e){return(t,n={})=>{const s=t.match(e.matchPattern);if(!s)return null;const r=s[0],o=t.match(e.parsePattern);if(!o)return null;let a=e.valueCallback?e.valueCallback(o[0]):o[0];a=n.valueCallback?n.valueCallback(a):a;const c=t.slice(r.length);return{value:a,rest:c}}}const pf=/^(\d+)(th|st|nd|rd)?/i,hf=/\d+/i,mf={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},gf={any:[/^b/i,/^(a|c)/i]},bf={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},yf={any:[/1/i,/2/i,/3/i,/4/i]},xf={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},vf={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},wf={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},Cf={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},Sf={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},jf={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},Nf={ordinalNumber:ff({matchPattern:pf,parsePattern:hf,valueCallback:e=>parseInt(e,10)}),era:Pt({matchPatterns:mf,defaultMatchWidth:"wide",parsePatterns:gf,defaultParseWidth:"any"}),quarter:Pt({matchPatterns:bf,defaultMatchWidth:"wide",parsePatterns:yf,defaultParseWidth:"any",valueCallback:e=>e+1}),month:Pt({matchPatterns:xf,defaultMatchWidth:"wide",parsePatterns:vf,defaultParseWidth:"any"}),day:Pt({matchPatterns:wf,defaultMatchWidth:"wide",parsePatterns:Cf,defaultParseWidth:"any"}),dayPeriod:Pt({matchPatterns:Sf,defaultMatchWidth:"any",parsePatterns:jf,defaultParseWidth:"any"})},Oi={code:"en-US",formatDistance:qd,formatLong:Kd,formatRelative:ef,localize:lf,match:Nf,options:{weekStartsOn:0,firstWeekContainsDate:1}};function Pf(e,t){const n=ie(e,t?.in);return Ad(n,Gd(n))+1}function Ef(e,t){const n=ie(e,t?.in),s=+_n(n)-+Dd(n);return Math.round(s/Ni)+1}function ki(e,t){const n=ie(e,t?.in),s=n.getFullYear(),r=dn(),o=t?.firstWeekContainsDate??t?.locale?.options?.firstWeekContainsDate??r.firstWeekContainsDate??r.locale?.options?.firstWeekContainsDate??1,a=Ie(t?.in||e,0);a.setFullYear(s+1,0,o),a.setHours(0,0,0,0);const c=Lt(a,t),l=Ie(t?.in||e,0);l.setFullYear(s,0,o),l.setHours(0,0,0,0);const u=Lt(l,t);return+n>=+c?s+1:+n>=+u?s:s-1}function If(e,t){const n=dn(),s=t?.firstWeekContainsDate??t?.locale?.options?.firstWeekContainsDate??n.firstWeekContainsDate??n.locale?.options?.firstWeekContainsDate??1,r=ki(e,t),o=Ie(t?.in||e,0);return o.setFullYear(r,0,s),o.setHours(0,0,0,0),Lt(o,t)}function Of(e,t){const n=ie(e,t?.in),s=+Lt(n,t)-+If(n,t);return Math.round(s/Ni)+1}function X(e,t){const n=e<0?"-":"",s=Math.abs(e).toString().padStart(t,"0");return n+s}const Be={y(e,t){const n=e.getFullYear(),s=n>0?n:1-n;return X(t==="yy"?s%100:s,t.length)},M(e,t){const n=e.getMonth();return t==="M"?String(n+1):X(n+1,2)},d(e,t){return X(e.getDate(),t.length)},a(e,t){const n=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.toUpperCase();case"aaa":return n;case"aaaaa":return n[0];case"aaaa":default:return n==="am"?"a.m.":"p.m."}},h(e,t){return X(e.getHours()%12||12,t.length)},H(e,t){return X(e.getHours(),t.length)},m(e,t){return X(e.getMinutes(),t.length)},s(e,t){return X(e.getSeconds(),t.length)},S(e,t){const n=t.length,s=e.getMilliseconds(),r=Math.trunc(s*Math.pow(10,n-3));return X(r,t.length)}},ot={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},Oo={G:function(e,t,n){const s=e.getFullYear()>0?1:0;switch(t){case"G":case"GG":case"GGG":return n.era(s,{width:"abbreviated"});case"GGGGG":return n.era(s,{width:"narrow"});case"GGGG":default:return n.era(s,{width:"wide"})}},y:function(e,t,n){if(t==="yo"){const s=e.getFullYear(),r=s>0?s:1-s;return n.ordinalNumber(r,{unit:"year"})}return Be.y(e,t)},Y:function(e,t,n,s){const r=ki(e,s),o=r>0?r:1-r;if(t==="YY"){const a=o%100;return X(a,2)}return t==="Yo"?n.ordinalNumber(o,{unit:"year"}):X(o,t.length)},R:function(e,t){const n=Ii(e);return X(n,t.length)},u:function(e,t){const n=e.getFullYear();return X(n,t.length)},Q:function(e,t,n){const s=Math.ceil((e.getMonth()+1)/3);switch(t){case"Q":return String(s);case"QQ":return X(s,2);case"Qo":return n.ordinalNumber(s,{unit:"quarter"});case"QQQ":return n.quarter(s,{width:"abbreviated",context:"formatting"});case"QQQQQ":return n.quarter(s,{width:"narrow",context:"formatting"});case"QQQQ":default:return n.quarter(s,{width:"wide",context:"formatting"})}},q:function(e,t,n){const s=Math.ceil((e.getMonth()+1)/3);switch(t){case"q":return String(s);case"qq":return X(s,2);case"qo":return n.ordinalNumber(s,{unit:"quarter"});case"qqq":return n.quarter(s,{width:"abbreviated",context:"standalone"});case"qqqqq":return n.quarter(s,{width:"narrow",context:"standalone"});case"qqqq":default:return n.quarter(s,{width:"wide",context:"standalone"})}},M:function(e,t,n){const s=e.getMonth();switch(t){case"M":case"MM":return Be.M(e,t);case"Mo":return n.ordinalNumber(s+1,{unit:"month"});case"MMM":return n.month(s,{width:"abbreviated",context:"formatting"});case"MMMMM":return n.month(s,{width:"narrow",context:"formatting"});case"MMMM":default:return n.month(s,{width:"wide",context:"formatting"})}},L:function(e,t,n){const s=e.getMonth();switch(t){case"L":return String(s+1);case"LL":return X(s+1,2);case"Lo":return n.ordinalNumber(s+1,{unit:"month"});case"LLL":return n.month(s,{width:"abbreviated",context:"standalone"});case"LLLLL":return n.month(s,{width:"narrow",context:"standalone"});case"LLLL":default:return n.month(s,{width:"wide",context:"standalone"})}},w:function(e,t,n,s){const r=Of(e,s);return t==="wo"?n.ordinalNumber(r,{unit:"week"}):X(r,t.length)},I:function(e,t,n){const s=Ef(e);return t==="Io"?n.ordinalNumber(s,{unit:"week"}):X(s,t.length)},d:function(e,t,n){return t==="do"?n.ordinalNumber(e.getDate(),{unit:"date"}):Be.d(e,t)},D:function(e,t,n){const s=Pf(e);return t==="Do"?n.ordinalNumber(s,{unit:"dayOfYear"}):X(s,t.length)},E:function(e,t,n){const s=e.getDay();switch(t){case"E":case"EE":case"EEE":return n.day(s,{width:"abbreviated",context:"formatting"});case"EEEEE":return n.day(s,{width:"narrow",context:"formatting"});case"EEEEEE":return n.day(s,{width:"short",context:"formatting"});case"EEEE":default:return n.day(s,{width:"wide",context:"formatting"})}},e:function(e,t,n,s){const r=e.getDay(),o=(r-s.weekStartsOn+8)%7||7;switch(t){case"e":return String(o);case"ee":return X(o,2);case"eo":return n.ordinalNumber(o,{unit:"day"});case"eee":return n.day(r,{width:"abbreviated",context:"formatting"});case"eeeee":return n.day(r,{width:"narrow",context:"formatting"});case"eeeeee":return n.day(r,{width:"short",context:"formatting"});case"eeee":default:return n.day(r,{width:"wide",context:"formatting"})}},c:function(e,t,n,s){const r=e.getDay(),o=(r-s.weekStartsOn+8)%7||7;switch(t){case"c":return String(o);case"cc":return X(o,t.length);case"co":return n.ordinalNumber(o,{unit:"day"});case"ccc":return n.day(r,{width:"abbreviated",context:"standalone"});case"ccccc":return n.day(r,{width:"narrow",context:"standalone"});case"cccccc":return n.day(r,{width:"short",context:"standalone"});case"cccc":default:return n.day(r,{width:"wide",context:"standalone"})}},i:function(e,t,n){const s=e.getDay(),r=s===0?7:s;switch(t){case"i":return String(r);case"ii":return X(r,t.length);case"io":return n.ordinalNumber(r,{unit:"day"});case"iii":return n.day(s,{width:"abbreviated",context:"formatting"});case"iiiii":return n.day(s,{width:"narrow",context:"formatting"});case"iiiiii":return n.day(s,{width:"short",context:"formatting"});case"iiii":default:return n.day(s,{width:"wide",context:"formatting"})}},a:function(e,t,n){const r=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"aaa":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return n.dayPeriod(r,{width:"narrow",context:"formatting"});case"aaaa":default:return n.dayPeriod(r,{width:"wide",context:"formatting"})}},b:function(e,t,n){const s=e.getHours();let r;switch(s===12?r=ot.noon:s===0?r=ot.midnight:r=s/12>=1?"pm":"am",t){case"b":case"bb":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"bbb":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return n.dayPeriod(r,{width:"narrow",context:"formatting"});case"bbbb":default:return n.dayPeriod(r,{width:"wide",context:"formatting"})}},B:function(e,t,n){const s=e.getHours();let r;switch(s>=17?r=ot.evening:s>=12?r=ot.afternoon:s>=4?r=ot.morning:r=ot.night,t){case"B":case"BB":case"BBB":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"BBBBB":return n.dayPeriod(r,{width:"narrow",context:"formatting"});case"BBBB":default:return n.dayPeriod(r,{width:"wide",context:"formatting"})}},h:function(e,t,n){if(t==="ho"){let s=e.getHours()%12;return s===0&&(s=12),n.ordinalNumber(s,{unit:"hour"})}return Be.h(e,t)},H:function(e,t,n){return t==="Ho"?n.ordinalNumber(e.getHours(),{unit:"hour"}):Be.H(e,t)},K:function(e,t,n){const s=e.getHours()%12;return t==="Ko"?n.ordinalNumber(s,{unit:"hour"}):X(s,t.length)},k:function(e,t,n){let s=e.getHours();return s===0&&(s=24),t==="ko"?n.ordinalNumber(s,{unit:"hour"}):X(s,t.length)},m:function(e,t,n){return t==="mo"?n.ordinalNumber(e.getMinutes(),{unit:"minute"}):Be.m(e,t)},s:function(e,t,n){return t==="so"?n.ordinalNumber(e.getSeconds(),{unit:"second"}):Be.s(e,t)},S:function(e,t){return Be.S(e,t)},X:function(e,t,n){const s=e.getTimezoneOffset();if(s===0)return"Z";switch(t){case"X":return Mo(s);case"XXXX":case"XX":return Ye(s);case"XXXXX":case"XXX":default:return Ye(s,":")}},x:function(e,t,n){const s=e.getTimezoneOffset();switch(t){case"x":return Mo(s);case"xxxx":case"xx":return Ye(s);case"xxxxx":case"xxx":default:return Ye(s,":")}},O:function(e,t,n){const s=e.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+ko(s,":");case"OOOO":default:return"GMT"+Ye(s,":")}},z:function(e,t,n){const s=e.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+ko(s,":");case"zzzz":default:return"GMT"+Ye(s,":")}},t:function(e,t,n){const s=Math.trunc(+e/1e3);return X(s,t.length)},T:function(e,t,n){return X(+e,t.length)}};function ko(e,t=""){const n=e>0?"-":"+",s=Math.abs(e),r=Math.trunc(s/60),o=s%60;return o===0?n+String(r):n+String(r)+t+X(o,2)}function Mo(e,t){return e%60===0?(e>0?"-":"+")+X(Math.abs(e)/60,2):Ye(e,t)}function Ye(e,t=""){const n=e>0?"-":"+",s=Math.abs(e),r=X(Math.trunc(s/60),2),o=X(s%60,2);return n+r+t+o}const To=(e,t)=>{switch(e){case"P":return t.date({width:"short"});case"PP":return t.date({width:"medium"});case"PPP":return t.date({width:"long"});case"PPPP":default:return t.date({width:"full"})}},Mi=(e,t)=>{switch(e){case"p":return t.time({width:"short"});case"pp":return t.time({width:"medium"});case"ppp":return t.time({width:"long"});case"pppp":default:return t.time({width:"full"})}},kf=(e,t)=>{const n=e.match(/(P+)(p+)?/)||[],s=n[1],r=n[2];if(!r)return To(e,t);let o;switch(s){case"P":o=t.dateTime({width:"short"});break;case"PP":o=t.dateTime({width:"medium"});break;case"PPP":o=t.dateTime({width:"long"});break;case"PPPP":default:o=t.dateTime({width:"full"});break}return o.replace("{{date}}",To(s,t)).replace("{{time}}",Mi(r,t))},Mf={p:Mi,P:kf},Tf=/^D+$/,Af=/^Y+$/,Df=["D","DD","YY","YYYY"];function Rf(e){return Tf.test(e)}function Lf(e){return Af.test(e)}function Ff(e,t,n){const s=zf(e,t,n);if(console.warn(s),Df.includes(e))throw new RangeError(s)}function zf(e,t,n){const s=e[0]==="Y"?"years":"days of the month";return`Use \`${e.toLowerCase()}\` instead of \`${e}\` (in \`${t}\`) for formatting ${s} to the input \`${n}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}const $f=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,Vf=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,Bf=/^'([^]*?)'?$/,Uf=/''/g,Hf=/[a-zA-Z]/;function Gn(e,t,n){const s=dn(),r=s.locale??Oi,o=s.firstWeekContainsDate??s.locale?.options?.firstWeekContainsDate??1,a=s.weekStartsOn??s.locale?.options?.weekStartsOn??0,c=ie(e,n?.in);if(!Fd(c))throw new RangeError("Invalid time value");let l=t.match(Vf).map(d=>{const p=d[0];if(p==="p"||p==="P"){const f=Mf[p];return f(d,r.formatLong)}return d}).join("").match($f).map(d=>{if(d==="''")return{isToken:!1,value:"'"};const p=d[0];if(p==="'")return{isToken:!1,value:_f(d)};if(Oo[p])return{isToken:!0,value:d};if(p.match(Hf))throw new RangeError("Format string contains an unescaped latin alphabet character `"+p+"`");return{isToken:!1,value:d}});r.localize.preprocessor&&(l=r.localize.preprocessor(c,l));const u={firstWeekContainsDate:o,weekStartsOn:a,locale:r};return l.map(d=>{if(!d.isToken)return d.value;const p=d.value;(Lf(p)||Rf(p))&&Ff(p,t,String(e));const f=Oo[p[0]];return f(c,p,r.localize,u)}).join("")}function _f(e){const t=e.match(Bf);return t?t[1].replace(Uf,"'"):e}function Wf(e,t,n){const s=dn(),r=n?.locale??s.locale??Oi,o=2520,a=Rn(e,t);if(isNaN(a))throw new RangeError("Invalid time value");const c=Object.assign({},n,{addSuffix:n?.addSuffix,comparison:a}),[l,u]=lr(n?.in,...a>0?[t,e]:[e,t]),d=Wd(u,l),p=(Wn(u)-Wn(l))/1e3,f=Math.round((d-p)/60);let h;if(f<2)return n?.includeSeconds?d<5?r.formatDistance("lessThanXSeconds",5,c):d<10?r.formatDistance("lessThanXSeconds",10,c):d<20?r.formatDistance("lessThanXSeconds",20,c):d<40?r.formatDistance("halfAMinute",0,c):d<60?r.formatDistance("lessThanXMinutes",1,c):r.formatDistance("xMinutes",1,c):f===0?r.formatDistance("lessThanXMinutes",1,c):r.formatDistance("xMinutes",f,c);if(f<45)return r.formatDistance("xMinutes",f,c);if(f<90)return r.formatDistance("aboutXHours",1,c);if(f<Po){const m=Math.round(f/60);return r.formatDistance("aboutXHours",m,c)}else{if(f<o)return r.formatDistance("xDays",1,c);if(f<vn){const m=Math.round(f/Po);return r.formatDistance("xDays",m,c)}else if(f<vn*2)return h=Math.round(f/vn),r.formatDistance("aboutXMonths",h,c)}if(h=_d(u,l),h<12){const m=Math.round(f/vn);return r.formatDistance("xMonths",m,c)}else{const m=h%12,g=Math.trunc(h/12);return m<3?r.formatDistance("aboutXYears",g,c):m<9?r.formatDistance("overXYears",g,c):r.formatDistance("almostXYears",g+1,c)}}function Gf(e,t){return Wf(e,Rd(e),t)}function Yf(e,t){const n=()=>Ie(t?.in,NaN),r=Xf(e);let o;if(r.date){const u=Kf(r.date,2);o=Zf(u.restDateString,u.year)}if(!o||isNaN(+o))return n();const a=+o;let c=0,l;if(r.time&&(c=e0(r.time),isNaN(c)))return n();if(r.timezone){if(l=t0(r.timezone),isNaN(l))return n()}else{const u=new Date(a+c),d=ie(0,t?.in);return d.setFullYear(u.getUTCFullYear(),u.getUTCMonth(),u.getUTCDate()),d.setHours(u.getUTCHours(),u.getUTCMinutes(),u.getUTCSeconds(),u.getUTCMilliseconds()),d}return ie(a+c+l,t?.in)}const wn={dateTimeDelimiter:/[T ]/,timeZoneDelimiter:/[Z ]/i,timezone:/([Z+-].*)$/},qf=/^-?(?:(\d{3})|(\d{2})(?:-?(\d{2}))?|W(\d{2})(?:-?(\d{1}))?|)$/,Jf=/^(\d{2}(?:[.,]\d*)?)(?::?(\d{2}(?:[.,]\d*)?))?(?::?(\d{2}(?:[.,]\d*)?))?$/,Qf=/^([+-])(\d{2})(?::?(\d{2}))?$/;function Xf(e){const t={},n=e.split(wn.dateTimeDelimiter);let s;if(n.length>2)return t;if(/:/.test(n[0])?s=n[0]:(t.date=n[0],s=n[1],wn.timeZoneDelimiter.test(t.date)&&(t.date=e.split(wn.timeZoneDelimiter)[0],s=e.substr(t.date.length,e.length))),s){const r=wn.timezone.exec(s);r?(t.time=s.replace(r[1],""),t.timezone=r[1]):t.time=s}return t}function Kf(e,t){const n=new RegExp("^(?:(\\d{4}|[+-]\\d{"+(4+t)+"})|(\\d{2}|[+-]\\d{"+(2+t)+"})$)"),s=e.match(n);if(!s)return{year:NaN,restDateString:""};const r=s[1]?parseInt(s[1]):null,o=s[2]?parseInt(s[2]):null;return{year:o===null?r:o*100,restDateString:e.slice((s[1]||s[2]).length)}}function Zf(e,t){if(t===null)return new Date(NaN);const n=e.match(qf);if(!n)return new Date(NaN);const s=!!n[4],r=Et(n[1]),o=Et(n[2])-1,a=Et(n[3]),c=Et(n[4]),l=Et(n[5])-1;if(s)return a0(t,c,l)?n0(t,c,l):new Date(NaN);{const u=new Date(0);return!s0(t,o,a)||!o0(t,r)?new Date(NaN):(u.setUTCFullYear(t,o,Math.max(r,a)),u)}}function Et(e){return e?parseInt(e):1}function e0(e){const t=e.match(Jf);if(!t)return NaN;const n=Pr(t[1]),s=Pr(t[2]),r=Pr(t[3]);return i0(n,s,r)?n*Ei+s*Pi+r*1e3:NaN}function Pr(e){return e&&parseFloat(e.replace(",","."))||0}function t0(e){if(e==="Z")return 0;const t=e.match(Qf);if(!t)return 0;const n=t[1]==="+"?-1:1,s=parseInt(t[2]),r=t[3]&&parseInt(t[3])||0;return c0(s,r)?n*(s*Ei+r*Pi):NaN}function n0(e,t,n){const s=new Date(0);s.setUTCFullYear(e,0,4);const r=s.getUTCDay()||7,o=(t-1)*7+n+1-r;return s.setUTCDate(s.getUTCDate()+o),s}const r0=[31,null,31,30,31,30,31,31,30,31,30,31];function Ti(e){return e%400===0||e%4===0&&e%100!==0}function s0(e,t,n){return t>=0&&t<=11&&n>=1&&n<=(r0[t]||(Ti(e)?29:28))}function o0(e,t){return t>=1&&t<=(Ti(e)?366:365)}function a0(e,t,n){return t>=1&&t<=53&&n>=0&&n<=6}function i0(e,t,n){return e===24?t===0&&n===0:n>=0&&n<60&&t>=0&&t<60&&e>=0&&e<25}function c0(e,t){return t>=0&&t<=59}var Er,Ao;function l0(){if(Ao)return Er;Ao=1;var e="Expected a function",t=NaN,n="[object Symbol]",s=/^\s+|\s+$/g,r=/^[-+]0x[0-9a-f]+$/i,o=/^0b[01]+$/i,a=/^0o[0-7]+$/i,c=parseInt,l=typeof xn=="object"&&xn&&xn.Object===Object&&xn,u=typeof self=="object"&&self&&self.Object===Object&&self,d=l||u||Function("return this")(),p=Object.prototype,f=p.toString,h=Math.max,m=Math.min,g=function(){return d.Date.now()};function y(w,j,C){var P,E,M,O,T,D,F=0,V=!1,B=!1,_=!0;if(typeof w!="function")throw new TypeError(e);j=N(j)||0,x(C)&&(V=!!C.leading,B="maxWait"in C,M=B?h(N(C.maxWait)||0,j):M,_="trailing"in C?!!C.trailing:_);function Y(G){var oe=P,Se=E;return P=E=void 0,F=G,O=w.apply(Se,oe),O}function W(G){return F=G,T=setTimeout(U,j),V?Y(G):O}function ee(G){var oe=G-D,Se=G-F,yn=j-oe;return B?m(yn,M-Se):yn}function re(G){var oe=G-D,Se=G-F;return D===void 0||oe>=j||oe<0||B&&Se>=M}function U(){var G=g();if(re(G))return R(G);T=setTimeout(U,ee(G))}function R(G){return T=void 0,_&&P?Y(G):(P=E=void 0,O)}function H(){T!==void 0&&clearTimeout(T),F=0,P=D=E=T=void 0}function te(){return T===void 0?O:R(g())}function ne(){var G=g(),oe=re(G);if(P=arguments,E=this,D=G,oe){if(T===void 0)return W(D);if(B)return T=setTimeout(U,j),Y(D)}return T===void 0&&(T=setTimeout(U,j)),O}return ne.cancel=H,ne.flush=te,ne}function x(w){var j=typeof w;return!!w&&(j=="object"||j=="function")}function v(w){return!!w&&typeof w=="object"}function S(w){return typeof w=="symbol"||v(w)&&f.call(w)==n}function N(w){if(typeof w=="number")return w;if(S(w))return t;if(x(w)){var j=typeof w.valueOf=="function"?w.valueOf():w;w=x(j)?j+"":j}if(typeof w!="string")return w===0?w:+w;w=w.replace(s,"");var C=o.test(w);return C||a.test(w)?c(w.slice(2),C?2:8):r.test(w)?t:+w}return Er=y,Er}var u0=l0();const Do=hi(u0);var Ai=typeof window<"u"?b.useLayoutEffect:b.useEffect;function Di(e,t,n,s){const r=b.useRef(t);Ai(()=>{r.current=t},[t]),b.useEffect(()=>{const o=window;if(!(o&&o.addEventListener))return;const a=c=>{r.current(c)};return o.addEventListener(e,a,s),()=>{o.removeEventListener(e,a,s)}},[e,n,s])}function ur(){const[e,t]=b.useState(null),n=b.useCallback(async s=>{if(!navigator?.clipboard)return console.warn("Clipboard not supported"),!1;try{return await navigator.clipboard.writeText(s),t(s),!0}catch(r){return console.warn("Copy failed",r),t(null),!1}},[]);return[e,n]}var d0=typeof window>"u";function s6(e,{defaultValue:t=!1,initializeWithValue:n=!0}={}){const s=c=>d0?t:window.matchMedia(c).matches,[r,o]=b.useState(()=>n?s(e):t);function a(){o(s(e))}return Ai(()=>{const c=window.matchMedia(e);return a(),c.addListener?c.addListener(a):c.addEventListener("change",a),()=>{c.removeListener?c.removeListener(a):c.removeEventListener("change",a)}},[e]),r}function f0(e){const t=b.useRef(e);t.current=e,b.useEffect(()=>()=>{t.current()},[])}function p0(e,t=500,n){const s=b.useRef();f0(()=>{s.current&&s.current.cancel()});const r=b.useMemo(()=>{const o=Do(e,t,n),a=(...c)=>o(...c);return a.cancel=()=>{o.cancel()},a.isPending=()=>!!s.current,a.flush=()=>o.flush(),a},[e,t,n]);return b.useEffect(()=>{s.current=Do(e,t,n)},[e,t,n]),r}function h0(e,t,n){const s=((u,d)=>u===d),r=e instanceof Function?e():e,[o,a]=b.useState(r),c=b.useRef(r),l=p0(a,t,n);return s(c.current,r)||(l(r),c.current=r),[o,l]}function m0(e,t,n="mousedown",s={}){Di(n,r=>{const o=r.target;if(!o||!o.isConnected)return;(Array.isArray(e)?e.filter(c=>!!c.current).every(c=>c.current&&!c.current.contains(o)):e.current&&!e.current.contains(o))&&t(r)},void 0,s)}const Ri=({children:e,content:t})=>i.jsxs(td,{children:[i.jsx(nd,{asChild:!0,children:i.jsx("button",{type:"button","aria-label":"Open Account",className:"cursor-pointer",children:e})}),i.jsx(rd,{className:"w-52 p-0",align:"start",children:t})]}),g0="/assets/connect-loader-CvOC68Ih.mp4";function b0(e){const{style:t,size:n=100,...s}=e,r=Du(n),o={objectFit:"contain",pointerEvents:"none",...r,...t},a=r.width?.replace("px",""),c=r.height?.replace("px","");return i.jsx("video",{autoPlay:!0,height:c,loop:!0,muted:!0,playsInline:!0,width:a,...s,style:o,children:i.jsx("source",{src:g0,type:"video/mp4"})})}function dr(e){const{onSubmit:t,onCancel:n,defaultValue:s,className:r,minLength:o=1,...a}=e,[c,l]=b.useState(s??""),u=b.useRef(null);m0(u,d),Di("keyup",p=>{p.key==="Enter"&&d(),p.key==="Escape"&&n()}),b.useLayoutEffect(()=>{setTimeout(()=>{u.current?.focus(),u.current?.select(),u.current?.scroll({left:9999})},100)},[]);function d(){c.length>=o&&t(c)}return i.jsx("input",{...a,autoFocus:!0,className:k("bg-inherit text-inherit outline-none",r),minLength:o,onChange:p=>l(p.target.value),ref:u,required:!0,type:"text",value:c})}function o6(){const{isAllowedToCreateDocuments:e}=Rs(),[t]=oi(),n=ai(),s=iu(),[r,o]=b.useState(!1);function a(){o(!0)}function c(p){!e||!n||lu(n,p,s.at(-1)?.id).then(f=>{ht(f)}).catch(f=>{console.error(f)}).finally(()=>{o(!1)})}function l(){o(!1)}const u=!!t,d=!!s.length;return i.jsxs("div",{className:"flex h-9 flex-row items-center gap-2 p-6 text-gray-500",children:[u&&i.jsxs(i.Fragment,{children:[i.jsx(Ro,{name:t.state.global.name,onClick:()=>cu(t)}),i.jsx("span",{children:"/"})]}),d&&s.map(p=>i.jsxs(b.Fragment,{children:[i.jsx(Ro,{name:p.name,onClick:()=>ht(p)}),i.jsx("span",{children:"/"})]},p.id)),e&&(r?i.jsx(dr,{className:"text-gray-800",defaultValue:"New Folder",onCancel:l,onSubmit:c,placeholder:"New Folder"}):i.jsxs("button",{type:"button",className:"ml-1 flex items-center justify-center gap-2 rounded-md bg-gray-50 px-2 py-1.5 transition-colors hover:bg-gray-200 hover:text-gray-800",onClick:a,children:[i.jsx(I,{name:"Plus",size:14}),"Add new"]}))]})}function Ro(e){const{name:t,onClick:n}=e;return i.jsx("div",{className:"transition-colors last-of-type:text-gray-800 hover:text-gray-800",onClick:n,role:"button",children:t})}function Ze(e){"@babel/helpers - typeof";return Ze=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ze(e)}function y0(e,t){if(Ze(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var s=n.call(e,t);if(Ze(s)!="object")return s;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Li(e){var t=y0(e,"string");return Ze(t)=="symbol"?t:t+""}function Tt(e,t,n){return(t=Li(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Lo(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);t&&(s=s.filter(function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable})),n.push.apply(n,s)}return n}function z(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Lo(Object(n),!0).forEach(function(s){Tt(e,s,n[s])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Lo(Object(n)).forEach(function(s){Object.defineProperty(e,s,Object.getOwnPropertyDescriptor(n,s))})}return e}function x0(e){if(Array.isArray(e))return e}function v0(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var s,r,o,a,c=[],l=!0,u=!1;try{if(o=(n=n.call(e)).next,t===0){if(Object(n)!==n)return;l=!1}else for(;!(l=(s=o.call(n)).done)&&(c.push(s.value),c.length!==t);l=!0);}catch(d){u=!0,r=d}finally{try{if(!l&&n.return!=null&&(a=n.return(),Object(a)!==a))return}finally{if(u)throw r}}return c}}function es(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,s=Array(t);n<t;n++)s[n]=e[n];return s}function Fi(e,t){if(e){if(typeof e=="string")return es(e,t);var n={}.toString.call(e).slice(8,-1);return n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set"?Array.from(e):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?es(e,t):void 0}}function w0(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
2
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Re(e,t){return x0(e)||v0(e,t)||Fi(e,t)||w0()}function C0(e,t){if(e==null)return{};var n={};for(var s in e)if({}.hasOwnProperty.call(e,s)){if(t.indexOf(s)!==-1)continue;n[s]=e[s]}return n}function ze(e,t){if(e==null)return{};var n,s,r=C0(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(s=0;s<o.length;s++)n=o[s],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var S0=["defaultInputValue","defaultMenuIsOpen","defaultValue","inputValue","menuIsOpen","onChange","onInputChange","onMenuClose","onMenuOpen","value"];function j0(e){var t=e.defaultInputValue,n=t===void 0?"":t,s=e.defaultMenuIsOpen,r=s===void 0?!1:s,o=e.defaultValue,a=o===void 0?null:o,c=e.inputValue,l=e.menuIsOpen,u=e.onChange,d=e.onInputChange,p=e.onMenuClose,f=e.onMenuOpen,h=e.value,m=ze(e,S0),g=b.useState(c!==void 0?c:n),y=Re(g,2),x=y[0],v=y[1],S=b.useState(l!==void 0?l:r),N=Re(S,2),w=N[0],j=N[1],C=b.useState(h!==void 0?h:a),P=Re(C,2),E=P[0],M=P[1],O=b.useCallback(function(Y,W){typeof u=="function"&&u(Y,W),M(Y)},[u]),T=b.useCallback(function(Y,W){var ee;typeof d=="function"&&(ee=d(Y,W)),v(ee!==void 0?ee:Y)},[d]),D=b.useCallback(function(){typeof f=="function"&&f(),j(!0)},[f]),F=b.useCallback(function(){typeof p=="function"&&p(),j(!1)},[p]),V=c!==void 0?c:x,B=l!==void 0?l:w,_=h!==void 0?h:E;return z(z({},m),{},{inputValue:V,menuIsOpen:B,onChange:O,onInputChange:T,onMenuClose:F,onMenuOpen:D,value:_})}function $(){return $=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var s in n)({}).hasOwnProperty.call(n,s)&&(e[s]=n[s])}return e},$.apply(null,arguments)}function N0(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Fo(e,t){for(var n=0;n<t.length;n++){var s=t[n];s.enumerable=s.enumerable||!1,s.configurable=!0,"value"in s&&(s.writable=!0),Object.defineProperty(e,Li(s.key),s)}}function P0(e,t,n){return t&&Fo(e.prototype,t),n&&Fo(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function ts(e,t){return ts=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,s){return n.__proto__=s,n},ts(e,t)}function E0(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&ts(e,t)}function Yn(e){return Yn=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Yn(e)}function zi(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(zi=function(){return!!e})()}function I0(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function O0(e,t){if(t&&(Ze(t)=="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return I0(e)}function k0(e){var t=zi();return function(){var n,s=Yn(e);if(t){var r=Yn(this).constructor;n=Reflect.construct(s,arguments,r)}else n=s.apply(this,arguments);return O0(this,n)}}function M0(e){if(Array.isArray(e))return es(e)}function T0(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function A0(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
3
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Vs(e){return M0(e)||T0(e)||Fi(e)||A0()}function D0(e){if(e.sheet)return e.sheet;for(var t=0;t<document.styleSheets.length;t++)if(document.styleSheets[t].ownerNode===e)return document.styleSheets[t]}function R0(e){var t=document.createElement("style");return t.setAttribute("data-emotion",e.key),e.nonce!==void 0&&t.setAttribute("nonce",e.nonce),t.appendChild(document.createTextNode("")),t.setAttribute("data-s",""),t}var L0=(function(){function e(n){var s=this;this._insertTag=function(r){var o;s.tags.length===0?s.insertionPoint?o=s.insertionPoint.nextSibling:s.prepend?o=s.container.firstChild:o=s.before:o=s.tags[s.tags.length-1].nextSibling,s.container.insertBefore(r,o),s.tags.push(r)},this.isSpeedy=n.speedy===void 0?!0:n.speedy,this.tags=[],this.ctr=0,this.nonce=n.nonce,this.key=n.key,this.container=n.container,this.prepend=n.prepend,this.insertionPoint=n.insertionPoint,this.before=null}var t=e.prototype;return t.hydrate=function(s){s.forEach(this._insertTag)},t.insert=function(s){this.ctr%(this.isSpeedy?65e3:1)===0&&this._insertTag(R0(this));var r=this.tags[this.tags.length-1];if(this.isSpeedy){var o=D0(r);try{o.insertRule(s,o.cssRules.length)}catch{}}else r.appendChild(document.createTextNode(s));this.ctr++},t.flush=function(){this.tags.forEach(function(s){var r;return(r=s.parentNode)==null?void 0:r.removeChild(s)}),this.tags=[],this.ctr=0},e})(),ue="-ms-",qn="-moz-",q="-webkit-",$i="comm",Bs="rule",Us="decl",F0="@import",Vi="@keyframes",z0="@layer",$0=Math.abs,fr=String.fromCharCode,V0=Object.assign;function B0(e,t){return le(e,0)^45?(((t<<2^le(e,0))<<2^le(e,1))<<2^le(e,2))<<2^le(e,3):0}function Bi(e){return e.trim()}function U0(e,t){return(e=t.exec(e))?e[0]:e}function J(e,t,n){return e.replace(t,n)}function ns(e,t){return e.indexOf(t)}function le(e,t){return e.charCodeAt(t)|0}function Ft(e,t,n){return e.slice(t,n)}function je(e){return e.length}function Hs(e){return e.length}function Cn(e,t){return t.push(e),e}function H0(e,t){return e.map(t).join("")}var pr=1,gt=1,Ui=0,he=0,ae=0,wt="";function hr(e,t,n,s,r,o,a){return{value:e,root:t,parent:n,type:s,props:r,children:o,line:pr,column:gt,length:a,return:""}}function It(e,t){return V0(hr("",null,null,"",null,null,0),e,{length:-e.length},t)}function _0(){return ae}function W0(){return ae=he>0?le(wt,--he):0,gt--,ae===10&&(gt=1,pr--),ae}function be(){return ae=he<Ui?le(wt,he++):0,gt++,ae===10&&(gt=1,pr++),ae}function Pe(){return le(wt,he)}function Ln(){return he}function fn(e,t){return Ft(wt,e,t)}function zt(e){switch(e){case 0:case 9:case 10:case 13:case 32:return 5;case 33:case 43:case 44:case 47:case 62:case 64:case 126:case 59:case 123:case 125:return 4;case 58:return 3;case 34:case 39:case 40:case 91:return 2;case 41:case 93:return 1}return 0}function Hi(e){return pr=gt=1,Ui=je(wt=e),he=0,[]}function _i(e){return wt="",e}function Fn(e){return Bi(fn(he-1,rs(e===91?e+2:e===40?e+1:e)))}function G0(e){for(;(ae=Pe())&&ae<33;)be();return zt(e)>2||zt(ae)>3?"":" "}function Y0(e,t){for(;--t&&be()&&!(ae<48||ae>102||ae>57&&ae<65||ae>70&&ae<97););return fn(e,Ln()+(t<6&&Pe()==32&&be()==32))}function rs(e){for(;be();)switch(ae){case e:return he;case 34:case 39:e!==34&&e!==39&&rs(ae);break;case 40:e===41&&rs(e);break;case 92:be();break}return he}function q0(e,t){for(;be()&&e+ae!==57;)if(e+ae===84&&Pe()===47)break;return"/*"+fn(t,he-1)+"*"+fr(e===47?e:be())}function J0(e){for(;!zt(Pe());)be();return fn(e,he)}function Q0(e){return _i(zn("",null,null,null,[""],e=Hi(e),0,[0],e))}function zn(e,t,n,s,r,o,a,c,l){for(var u=0,d=0,p=a,f=0,h=0,m=0,g=1,y=1,x=1,v=0,S="",N=r,w=o,j=s,C=S;y;)switch(m=v,v=be()){case 40:if(m!=108&&le(C,p-1)==58){ns(C+=J(Fn(v),"&","&\f"),"&\f")!=-1&&(x=-1);break}case 34:case 39:case 91:C+=Fn(v);break;case 9:case 10:case 13:case 32:C+=G0(m);break;case 92:C+=Y0(Ln()-1,7);continue;case 47:switch(Pe()){case 42:case 47:Cn(X0(q0(be(),Ln()),t,n),l);break;default:C+="/"}break;case 123*g:c[u++]=je(C)*x;case 125*g:case 59:case 0:switch(v){case 0:case 125:y=0;case 59+d:x==-1&&(C=J(C,/\f/g,"")),h>0&&je(C)-p&&Cn(h>32?$o(C+";",s,n,p-1):$o(J(C," ","")+";",s,n,p-2),l);break;case 59:C+=";";default:if(Cn(j=zo(C,t,n,u,d,r,c,S,N=[],w=[],p),o),v===123)if(d===0)zn(C,t,j,j,N,o,p,c,w);else switch(f===99&&le(C,3)===110?100:f){case 100:case 108:case 109:case 115:zn(e,j,j,s&&Cn(zo(e,j,j,0,0,r,c,S,r,N=[],p),w),r,w,p,c,s?N:w);break;default:zn(C,j,j,j,[""],w,0,c,w)}}u=d=h=0,g=x=1,S=C="",p=a;break;case 58:p=1+je(C),h=m;default:if(g<1){if(v==123)--g;else if(v==125&&g++==0&&W0()==125)continue}switch(C+=fr(v),v*g){case 38:x=d>0?1:(C+="\f",-1);break;case 44:c[u++]=(je(C)-1)*x,x=1;break;case 64:Pe()===45&&(C+=Fn(be())),f=Pe(),d=p=je(S=C+=J0(Ln())),v++;break;case 45:m===45&&je(C)==2&&(g=0)}}return o}function zo(e,t,n,s,r,o,a,c,l,u,d){for(var p=r-1,f=r===0?o:[""],h=Hs(f),m=0,g=0,y=0;m<s;++m)for(var x=0,v=Ft(e,p+1,p=$0(g=a[m])),S=e;x<h;++x)(S=Bi(g>0?f[x]+" "+v:J(v,/&\f/g,f[x])))&&(l[y++]=S);return hr(e,t,n,r===0?Bs:c,l,u,d)}function X0(e,t,n){return hr(e,t,n,$i,fr(_0()),Ft(e,2,-2),0)}function $o(e,t,n,s){return hr(e,t,n,Us,Ft(e,0,s),Ft(e,s+1,-1),s)}function dt(e,t){for(var n="",s=Hs(e),r=0;r<s;r++)n+=t(e[r],r,e,t)||"";return n}function K0(e,t,n,s){switch(e.type){case z0:if(e.children.length)break;case F0:case Us:return e.return=e.return||e.value;case $i:return"";case Vi:return e.return=e.value+"{"+dt(e.children,s)+"}";case Bs:e.value=e.props.join(",")}return je(n=dt(e.children,s))?e.return=e.value+"{"+n+"}":""}function Z0(e){var t=Hs(e);return function(n,s,r,o){for(var a="",c=0;c<t;c++)a+=e[c](n,s,r,o)||"";return a}}function ep(e){return function(t){t.root||(t=t.return)&&e(t)}}function tp(e){var t=Object.create(null);return function(n){return t[n]===void 0&&(t[n]=e(n)),t[n]}}var np=function(t,n,s){for(var r=0,o=0;r=o,o=Pe(),r===38&&o===12&&(n[s]=1),!zt(o);)be();return fn(t,he)},rp=function(t,n){var s=-1,r=44;do switch(zt(r)){case 0:r===38&&Pe()===12&&(n[s]=1),t[s]+=np(he-1,n,s);break;case 2:t[s]+=Fn(r);break;case 4:if(r===44){t[++s]=Pe()===58?"&\f":"",n[s]=t[s].length;break}default:t[s]+=fr(r)}while(r=be());return t},sp=function(t,n){return _i(rp(Hi(t),n))},Vo=new WeakMap,op=function(t){if(!(t.type!=="rule"||!t.parent||t.length<1)){for(var n=t.value,s=t.parent,r=t.column===s.column&&t.line===s.line;s.type!=="rule";)if(s=s.parent,!s)return;if(!(t.props.length===1&&n.charCodeAt(0)!==58&&!Vo.get(s))&&!r){Vo.set(t,!0);for(var o=[],a=sp(n,o),c=s.props,l=0,u=0;l<a.length;l++)for(var d=0;d<c.length;d++,u++)t.props[u]=o[l]?a[l].replace(/&\f/g,c[d]):c[d]+" "+a[l]}}},ap=function(t){if(t.type==="decl"){var n=t.value;n.charCodeAt(0)===108&&n.charCodeAt(2)===98&&(t.return="",t.value="")}};function Wi(e,t){switch(B0(e,t)){case 5103:return q+"print-"+e+e;case 5737:case 4201:case 3177:case 3433:case 1641:case 4457:case 2921:case 5572:case 6356:case 5844:case 3191:case 6645:case 3005:case 6391:case 5879:case 5623:case 6135:case 4599:case 4855:case 4215:case 6389:case 5109:case 5365:case 5621:case 3829:return q+e+e;case 5349:case 4246:case 4810:case 6968:case 2756:return q+e+qn+e+ue+e+e;case 6828:case 4268:return q+e+ue+e+e;case 6165:return q+e+ue+"flex-"+e+e;case 5187:return q+e+J(e,/(\w+).+(:[^]+)/,q+"box-$1$2"+ue+"flex-$1$2")+e;case 5443:return q+e+ue+"flex-item-"+J(e,/flex-|-self/,"")+e;case 4675:return q+e+ue+"flex-line-pack"+J(e,/align-content|flex-|-self/,"")+e;case 5548:return q+e+ue+J(e,"shrink","negative")+e;case 5292:return q+e+ue+J(e,"basis","preferred-size")+e;case 6060:return q+"box-"+J(e,"-grow","")+q+e+ue+J(e,"grow","positive")+e;case 4554:return q+J(e,/([^-])(transform)/g,"$1"+q+"$2")+e;case 6187:return J(J(J(e,/(zoom-|grab)/,q+"$1"),/(image-set)/,q+"$1"),e,"")+e;case 5495:case 3959:return J(e,/(image-set\([^]*)/,q+"$1$`$1");case 4968:return J(J(e,/(.+:)(flex-)?(.*)/,q+"box-pack:$3"+ue+"flex-pack:$3"),/s.+-b[^;]+/,"justify")+q+e+e;case 4095:case 3583:case 4068:case 2532:return J(e,/(.+)-inline(.+)/,q+"$1$2")+e;case 8116:case 7059:case 5753:case 5535:case 5445:case 5701:case 4933:case 4677:case 5533:case 5789:case 5021:case 4765:if(je(e)-1-t>6)switch(le(e,t+1)){case 109:if(le(e,t+4)!==45)break;case 102:return J(e,/(.+:)(.+)-([^]+)/,"$1"+q+"$2-$3$1"+qn+(le(e,t+3)==108?"$3":"$2-$3"))+e;case 115:return~ns(e,"stretch")?Wi(J(e,"stretch","fill-available"),t)+e:e}break;case 4949:if(le(e,t+1)!==115)break;case 6444:switch(le(e,je(e)-3-(~ns(e,"!important")&&10))){case 107:return J(e,":",":"+q)+e;case 101:return J(e,/(.+:)([^;!]+)(;|!.+)?/,"$1"+q+(le(e,14)===45?"inline-":"")+"box$3$1"+q+"$2$3$1"+ue+"$2box$3")+e}break;case 5936:switch(le(e,t+11)){case 114:return q+e+ue+J(e,/[svh]\w+-[tblr]{2}/,"tb")+e;case 108:return q+e+ue+J(e,/[svh]\w+-[tblr]{2}/,"tb-rl")+e;case 45:return q+e+ue+J(e,/[svh]\w+-[tblr]{2}/,"lr")+e}return q+e+ue+e+e}return e}var ip=function(t,n,s,r){if(t.length>-1&&!t.return)switch(t.type){case Us:t.return=Wi(t.value,t.length);break;case Vi:return dt([It(t,{value:J(t.value,"@","@"+q)})],r);case Bs:if(t.length)return H0(t.props,function(o){switch(U0(o,/(::plac\w+|:read-\w+)/)){case":read-only":case":read-write":return dt([It(t,{props:[J(o,/:(read-\w+)/,":"+qn+"$1")]})],r);case"::placeholder":return dt([It(t,{props:[J(o,/:(plac\w+)/,":"+q+"input-$1")]}),It(t,{props:[J(o,/:(plac\w+)/,":"+qn+"$1")]}),It(t,{props:[J(o,/:(plac\w+)/,ue+"input-$1")]})],r)}return""})}},cp=[ip],lp=function(t){var n=t.key;if(n==="css"){var s=document.querySelectorAll("style[data-emotion]:not([data-s])");Array.prototype.forEach.call(s,function(g){var y=g.getAttribute("data-emotion");y.indexOf(" ")!==-1&&(document.head.appendChild(g),g.setAttribute("data-s",""))})}var r=t.stylisPlugins||cp,o={},a,c=[];a=t.container||document.head,Array.prototype.forEach.call(document.querySelectorAll('style[data-emotion^="'+n+' "]'),function(g){for(var y=g.getAttribute("data-emotion").split(" "),x=1;x<y.length;x++)o[y[x]]=!0;c.push(g)});var l,u=[op,ap];{var d,p=[K0,ep(function(g){d.insert(g)})],f=Z0(u.concat(r,p)),h=function(y){return dt(Q0(y),f)};l=function(y,x,v,S){d=v,h(y?y+"{"+x.styles+"}":x.styles),S&&(m.inserted[x.name]=!0)}}var m={key:n,sheet:new L0({key:n,container:a,nonce:t.nonce,speedy:t.speedy,prepend:t.prepend,insertionPoint:t.insertionPoint}),nonce:t.nonce,inserted:o,registered:{},insert:l};return m.sheet.hydrate(c),m},up=!0;function dp(e,t,n){var s="";return n.split(" ").forEach(function(r){e[r]!==void 0?t.push(e[r]+";"):r&&(s+=r+" ")}),s}var Gi=function(t,n,s){var r=t.key+"-"+n.name;(s===!1||up===!1)&&t.registered[r]===void 0&&(t.registered[r]=n.styles)},fp=function(t,n,s){Gi(t,n,s);var r=t.key+"-"+n.name;if(t.inserted[n.name]===void 0){var o=n;do t.insert(n===o?"."+r:"",o,t.sheet,!0),o=o.next;while(o!==void 0)}};function pp(e){for(var t=0,n,s=0,r=e.length;r>=4;++s,r-=4)n=e.charCodeAt(s)&255|(e.charCodeAt(++s)&255)<<8|(e.charCodeAt(++s)&255)<<16|(e.charCodeAt(++s)&255)<<24,n=(n&65535)*1540483477+((n>>>16)*59797<<16),n^=n>>>24,t=(n&65535)*1540483477+((n>>>16)*59797<<16)^(t&65535)*1540483477+((t>>>16)*59797<<16);switch(r){case 3:t^=(e.charCodeAt(s+2)&255)<<16;case 2:t^=(e.charCodeAt(s+1)&255)<<8;case 1:t^=e.charCodeAt(s)&255,t=(t&65535)*1540483477+((t>>>16)*59797<<16)}return t^=t>>>13,t=(t&65535)*1540483477+((t>>>16)*59797<<16),((t^t>>>15)>>>0).toString(36)}var hp={animationIterationCount:1,aspectRatio:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,scale:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1},mp=/[A-Z]|^ms/g,gp=/_EMO_([^_]+?)_([^]*?)_EMO_/g,Yi=function(t){return t.charCodeAt(1)===45},Bo=function(t){return t!=null&&typeof t!="boolean"},Ir=tp(function(e){return Yi(e)?e:e.replace(mp,"-$&").toLowerCase()}),Uo=function(t,n){switch(t){case"animation":case"animationName":if(typeof n=="string")return n.replace(gp,function(s,r,o){return Ne={name:r,styles:o,next:Ne},r})}return hp[t]!==1&&!Yi(t)&&typeof n=="number"&&n!==0?n+"px":n};function $t(e,t,n){if(n==null)return"";var s=n;if(s.__emotion_styles!==void 0)return s;switch(typeof n){case"boolean":return"";case"object":{var r=n;if(r.anim===1)return Ne={name:r.name,styles:r.styles,next:Ne},r.name;var o=n;if(o.styles!==void 0){var a=o.next;if(a!==void 0)for(;a!==void 0;)Ne={name:a.name,styles:a.styles,next:Ne},a=a.next;var c=o.styles+";";return c}return bp(e,t,n)}case"function":{if(e!==void 0){var l=Ne,u=n(e);return Ne=l,$t(e,t,u)}break}}var d=n;return d}function bp(e,t,n){var s="";if(Array.isArray(n))for(var r=0;r<n.length;r++)s+=$t(e,t,n[r])+";";else for(var o in n){var a=n[o];if(typeof a!="object"){var c=a;Bo(c)&&(s+=Ir(o)+":"+Uo(o,c)+";")}else if(Array.isArray(a)&&typeof a[0]=="string"&&t==null)for(var l=0;l<a.length;l++)Bo(a[l])&&(s+=Ir(o)+":"+Uo(o,a[l])+";");else{var u=$t(e,t,a);switch(o){case"animation":case"animationName":{s+=Ir(o)+":"+u+";";break}default:s+=o+"{"+u+"}"}}}return s}var Ho=/label:\s*([^\s;{]+)\s*(;|$)/g,Ne;function qi(e,t,n){if(e.length===1&&typeof e[0]=="object"&&e[0]!==null&&e[0].styles!==void 0)return e[0];var s=!0,r="";Ne=void 0;var o=e[0];if(o==null||o.raw===void 0)s=!1,r+=$t(n,t,o);else{var a=o;r+=a[0]}for(var c=1;c<e.length;c++)if(r+=$t(n,t,e[c]),s){var l=o;r+=l[c]}Ho.lastIndex=0;for(var u="",d;(d=Ho.exec(r))!==null;)u+="-"+d[1];var p=pp(r)+u;return{name:p,styles:r,next:Ne}}var yp=function(t){return t()},xp=So.useInsertionEffect?So.useInsertionEffect:!1,vp=xp||yp,Ji=b.createContext(typeof HTMLElement<"u"?lp({key:"css"}):null);Ji.Provider;var wp=function(t){return b.forwardRef(function(n,s){var r=b.useContext(Ji);return t(n,r,s)})},Cp=b.createContext({}),_s={}.hasOwnProperty,ss="__EMOTION_TYPE_PLEASE_DO_NOT_USE__",Sp=function(t,n){var s={};for(var r in n)_s.call(n,r)&&(s[r]=n[r]);return s[ss]=t,s},jp=function(t){var n=t.cache,s=t.serialized,r=t.isStringTag;return Gi(n,s,r),vp(function(){return fp(n,s,r)}),null},Np=wp(function(e,t,n){var s=e.css;typeof s=="string"&&t.registered[s]!==void 0&&(s=t.registered[s]);var r=e[ss],o=[s],a="";typeof e.className=="string"?a=dp(t.registered,o,e.className):e.className!=null&&(a=e.className+" ");var c=qi(o,void 0,b.useContext(Cp));a+=t.key+"-"+c.name;var l={};for(var u in e)_s.call(e,u)&&u!=="css"&&u!==ss&&(l[u]=e[u]);return l.className=a,n&&(l.ref=n),b.createElement(b.Fragment,null,b.createElement(jp,{cache:t,serialized:c,isStringTag:typeof r=="string"}),b.createElement(r,l))}),Pp=Np,L=function(t,n){var s=arguments;if(n==null||!_s.call(n,"css"))return b.createElement.apply(void 0,s);var r=s.length,o=new Array(r);o[0]=Pp,o[1]=Sp(t,n);for(var a=2;a<r;a++)o[a]=s[a];return b.createElement.apply(null,o)};(function(e){var t;t||(t=e.JSX||(e.JSX={}))})(L||(L={}));function Ws(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return qi(t)}function Ep(){var e=Ws.apply(void 0,arguments),t="animation-"+e.name;return{name:t,styles:"@keyframes "+t+"{"+e.styles+"}",anim:1,toString:function(){return"_EMO_"+this.name+"_"+this.styles+"_EMO_"}}}function Ip(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}var os=b.useLayoutEffect,Op=["className","clearValue","cx","getStyles","getClassNames","getValue","hasValue","isMulti","isRtl","options","selectOption","selectProps","setValue","theme"],Jn=function(){};function kp(e,t){return t?t[0]==="-"?e+t:e+"__"+t:e}function Mp(e,t){for(var n=arguments.length,s=new Array(n>2?n-2:0),r=2;r<n;r++)s[r-2]=arguments[r];var o=[].concat(s);if(t&&e)for(var a in t)t.hasOwnProperty(a)&&t[a]&&o.push("".concat(kp(e,a)));return o.filter(function(c){return c}).map(function(c){return String(c).trim()}).join(" ")}var _o=function(t){return Vp(t)?t.filter(Boolean):Ze(t)==="object"&&t!==null?[t]:[]},Qi=function(t){t.className,t.clearValue,t.cx,t.getStyles,t.getClassNames,t.getValue,t.hasValue,t.isMulti,t.isRtl,t.options,t.selectOption,t.selectProps,t.setValue,t.theme;var n=ze(t,Op);return z({},n)},se=function(t,n,s){var r=t.cx,o=t.getStyles,a=t.getClassNames,c=t.className;return{css:o(n,t),className:r(s??{},a(n,t),c)}};function mr(e){return[document.documentElement,document.body,window].indexOf(e)>-1}function Tp(e){return mr(e)?window.innerHeight:e.clientHeight}function Xi(e){return mr(e)?window.pageYOffset:e.scrollTop}function Qn(e,t){if(mr(e)){window.scrollTo(0,t);return}e.scrollTop=t}function Ap(e){var t=getComputedStyle(e),n=t.position==="absolute",s=/(auto|scroll)/;if(t.position==="fixed")return document.documentElement;for(var r=e;r=r.parentElement;)if(t=getComputedStyle(r),!(n&&t.position==="static")&&s.test(t.overflow+t.overflowY+t.overflowX))return r;return document.documentElement}function Dp(e,t,n,s){return n*((e=e/s-1)*e*e+1)+t}function Sn(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:200,s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:Jn,r=Xi(e),o=t-r,a=10,c=0;function l(){c+=a;var u=Dp(c,r,o,n);Qn(e,u),c<n?window.requestAnimationFrame(l):s(e)}l()}function Wo(e,t){var n=e.getBoundingClientRect(),s=t.getBoundingClientRect(),r=t.offsetHeight/3;s.bottom+r>n.bottom?Qn(e,Math.min(t.offsetTop+t.clientHeight-e.offsetHeight+r,e.scrollHeight)):s.top-r<n.top&&Qn(e,Math.max(t.offsetTop-r,0))}function Rp(e){var t=e.getBoundingClientRect();return{bottom:t.bottom,height:t.height,left:t.left,right:t.right,top:t.top,width:t.width}}function Go(){try{return document.createEvent("TouchEvent"),!0}catch{return!1}}function Lp(){try{return/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)}catch{return!1}}var Ki=!1,Fp={get passive(){return Ki=!0}},jn=typeof window<"u"?window:{};jn.addEventListener&&jn.removeEventListener&&(jn.addEventListener("p",Jn,Fp),jn.removeEventListener("p",Jn,!1));var zp=Ki;function $p(e){return e!=null}function Vp(e){return Array.isArray(e)}function Nn(e,t,n){return e?t:n}var Bp=function(t){for(var n=arguments.length,s=new Array(n>1?n-1:0),r=1;r<n;r++)s[r-1]=arguments[r];var o=Object.entries(t).filter(function(a){var c=Re(a,1),l=c[0];return!s.includes(l)});return o.reduce(function(a,c){var l=Re(c,2),u=l[0],d=l[1];return a[u]=d,a},{})},Up=["children","innerProps"],Hp=["children","innerProps"];function _p(e){var t=e.maxHeight,n=e.menuEl,s=e.minHeight,r=e.placement,o=e.shouldScroll,a=e.isFixedPosition,c=e.controlHeight,l=Ap(n),u={placement:"bottom",maxHeight:t};if(!n||!n.offsetParent)return u;var d=l.getBoundingClientRect(),p=d.height,f=n.getBoundingClientRect(),h=f.bottom,m=f.height,g=f.top,y=n.offsetParent.getBoundingClientRect(),x=y.top,v=a?window.innerHeight:Tp(l),S=Xi(l),N=parseInt(getComputedStyle(n).marginBottom,10),w=parseInt(getComputedStyle(n).marginTop,10),j=x-w,C=v-g,P=j+S,E=p-S-g,M=h-v+S+N,O=S+g-w,T=160;switch(r){case"auto":case"bottom":if(C>=m)return{placement:"bottom",maxHeight:t};if(E>=m&&!a)return o&&Sn(l,M,T),{placement:"bottom",maxHeight:t};if(!a&&E>=s||a&&C>=s){o&&Sn(l,M,T);var D=a?C-N:E-N;return{placement:"bottom",maxHeight:D}}if(r==="auto"||a){var F=t,V=a?j:P;return V>=s&&(F=Math.min(V-N-c,t)),{placement:"top",maxHeight:F}}if(r==="bottom")return o&&Qn(l,M),{placement:"bottom",maxHeight:t};break;case"top":if(j>=m)return{placement:"top",maxHeight:t};if(P>=m&&!a)return o&&Sn(l,O,T),{placement:"top",maxHeight:t};if(!a&&P>=s||a&&j>=s){var B=t;return(!a&&P>=s||a&&j>=s)&&(B=a?j-w:P-w),o&&Sn(l,O,T),{placement:"top",maxHeight:B}}return{placement:"bottom",maxHeight:t};default:throw new Error('Invalid placement provided "'.concat(r,'".'))}return u}function Wp(e){var t={bottom:"top",top:"bottom"};return e?t[e]:"bottom"}var Zi=function(t){return t==="auto"?"bottom":t},Gp=function(t,n){var s,r=t.placement,o=t.theme,a=o.borderRadius,c=o.spacing,l=o.colors;return z((s={label:"menu"},Tt(s,Wp(r),"100%"),Tt(s,"position","absolute"),Tt(s,"width","100%"),Tt(s,"zIndex",1),s),n?{}:{backgroundColor:l.neutral0,borderRadius:a,boxShadow:"0 0 0 1px hsla(0, 0%, 0%, 0.1), 0 4px 11px hsla(0, 0%, 0%, 0.1)",marginBottom:c.menuGutter,marginTop:c.menuGutter})},ec=b.createContext(null),Yp=function(t){var n=t.children,s=t.minMenuHeight,r=t.maxMenuHeight,o=t.menuPlacement,a=t.menuPosition,c=t.menuShouldScrollIntoView,l=t.theme,u=b.useContext(ec)||{},d=u.setPortalPlacement,p=b.useRef(null),f=b.useState(r),h=Re(f,2),m=h[0],g=h[1],y=b.useState(null),x=Re(y,2),v=x[0],S=x[1],N=l.spacing.controlHeight;return os(function(){var w=p.current;if(w){var j=a==="fixed",C=c&&!j,P=_p({maxHeight:r,menuEl:w,minHeight:s,placement:o,shouldScroll:C,isFixedPosition:j,controlHeight:N});g(P.maxHeight),S(P.placement),d?.(P.placement)}},[r,o,a,c,s,d,N]),n({ref:p,placerProps:z(z({},t),{},{placement:v||Zi(o),maxHeight:m})})},qp=function(t){var n=t.children,s=t.innerRef,r=t.innerProps;return L("div",$({},se(t,"menu",{menu:!0}),{ref:s},r),n)},Jp=qp,Qp=function(t,n){var s=t.maxHeight,r=t.theme.spacing.baseUnit;return z({maxHeight:s,overflowY:"auto",position:"relative",WebkitOverflowScrolling:"touch"},n?{}:{paddingBottom:r,paddingTop:r})},Xp=function(t){var n=t.children,s=t.innerProps,r=t.innerRef,o=t.isMulti;return L("div",$({},se(t,"menuList",{"menu-list":!0,"menu-list--is-multi":o}),{ref:r},s),n)},tc=function(t,n){var s=t.theme,r=s.spacing.baseUnit,o=s.colors;return z({textAlign:"center"},n?{}:{color:o.neutral40,padding:"".concat(r*2,"px ").concat(r*3,"px")})},Kp=tc,Zp=tc,eh=function(t){var n=t.children,s=n===void 0?"No options":n,r=t.innerProps,o=ze(t,Up);return L("div",$({},se(z(z({},o),{},{children:s,innerProps:r}),"noOptionsMessage",{"menu-notice":!0,"menu-notice--no-options":!0}),r),s)},th=function(t){var n=t.children,s=n===void 0?"Loading...":n,r=t.innerProps,o=ze(t,Hp);return L("div",$({},se(z(z({},o),{},{children:s,innerProps:r}),"loadingMessage",{"menu-notice":!0,"menu-notice--loading":!0}),r),s)},nh=function(t){var n=t.rect,s=t.offset,r=t.position;return{left:n.left,position:r,top:s,width:n.width,zIndex:1}},rh=function(t){var n=t.appendTo,s=t.children,r=t.controlElement,o=t.innerProps,a=t.menuPlacement,c=t.menuPosition,l=b.useRef(null),u=b.useRef(null),d=b.useState(Zi(a)),p=Re(d,2),f=p[0],h=p[1],m=b.useMemo(function(){return{setPortalPlacement:h}},[]),g=b.useState(null),y=Re(g,2),x=y[0],v=y[1],S=b.useCallback(function(){if(r){var C=Rp(r),P=c==="fixed"?0:window.pageYOffset,E=C[f]+P;(E!==x?.offset||C.left!==x?.rect.left||C.width!==x?.rect.width)&&v({offset:E,rect:C})}},[r,c,f,x?.offset,x?.rect.left,x?.rect.width]);os(function(){S()},[S]);var N=b.useCallback(function(){typeof u.current=="function"&&(u.current(),u.current=null),r&&l.current&&(u.current=Ru(r,l.current,S,{elementResize:"ResizeObserver"in window}))},[r,S]);os(function(){N()},[N]);var w=b.useCallback(function(C){l.current=C,N()},[N]);if(!n&&c!=="fixed"||!x)return null;var j=L("div",$({ref:w},se(z(z({},t),{},{offset:x.offset,position:c,rect:x.rect}),"menuPortal",{"menu-portal":!0}),o),s);return L(ec.Provider,{value:m},n?ri.createPortal(j,n):j)},sh=function(t){var n=t.isDisabled,s=t.isRtl;return{label:"container",direction:s?"rtl":void 0,pointerEvents:n?"none":void 0,position:"relative"}},oh=function(t){var n=t.children,s=t.innerProps,r=t.isDisabled,o=t.isRtl;return L("div",$({},se(t,"container",{"--is-disabled":r,"--is-rtl":o}),s),n)},ah=function(t,n){var s=t.theme.spacing,r=t.isMulti,o=t.hasValue,a=t.selectProps.controlShouldRenderValue;return z({alignItems:"center",display:r&&o&&a?"flex":"grid",flex:1,flexWrap:"wrap",WebkitOverflowScrolling:"touch",position:"relative",overflow:"hidden"},n?{}:{padding:"".concat(s.baseUnit/2,"px ").concat(s.baseUnit*2,"px")})},ih=function(t){var n=t.children,s=t.innerProps,r=t.isMulti,o=t.hasValue;return L("div",$({},se(t,"valueContainer",{"value-container":!0,"value-container--is-multi":r,"value-container--has-value":o}),s),n)},ch=function(){return{alignItems:"center",alignSelf:"stretch",display:"flex",flexShrink:0}},lh=function(t){var n=t.children,s=t.innerProps;return L("div",$({},se(t,"indicatorsContainer",{indicators:!0}),s),n)},Yo,uh=["size"],dh=["innerProps","isRtl","size"],fh={name:"8mmkcg",styles:"display:inline-block;fill:currentColor;line-height:1;stroke:currentColor;stroke-width:0"},nc=function(t){var n=t.size,s=ze(t,uh);return L("svg",$({height:n,width:n,viewBox:"0 0 20 20","aria-hidden":"true",focusable:"false",css:fh},s))},Gs=function(t){return L(nc,$({size:20},t),L("path",{d:"M14.348 14.849c-0.469 0.469-1.229 0.469-1.697 0l-2.651-3.030-2.651 3.029c-0.469 0.469-1.229 0.469-1.697 0-0.469-0.469-0.469-1.229 0-1.697l2.758-3.15-2.759-3.152c-0.469-0.469-0.469-1.228 0-1.697s1.228-0.469 1.697 0l2.652 3.031 2.651-3.031c0.469-0.469 1.228-0.469 1.697 0s0.469 1.229 0 1.697l-2.758 3.152 2.758 3.15c0.469 0.469 0.469 1.229 0 1.698z"}))},rc=function(t){return L(nc,$({size:20},t),L("path",{d:"M4.516 7.548c0.436-0.446 1.043-0.481 1.576 0l3.908 3.747 3.908-3.747c0.533-0.481 1.141-0.446 1.574 0 0.436 0.445 0.408 1.197 0 1.615-0.406 0.418-4.695 4.502-4.695 4.502-0.217 0.223-0.502 0.335-0.787 0.335s-0.57-0.112-0.789-0.335c0 0-4.287-4.084-4.695-4.502s-0.436-1.17 0-1.615z"}))},sc=function(t,n){var s=t.isFocused,r=t.theme,o=r.spacing.baseUnit,a=r.colors;return z({label:"indicatorContainer",display:"flex",transition:"color 150ms"},n?{}:{color:s?a.neutral60:a.neutral20,padding:o*2,":hover":{color:s?a.neutral80:a.neutral40}})},ph=sc,hh=function(t){var n=t.children,s=t.innerProps;return L("div",$({},se(t,"dropdownIndicator",{indicator:!0,"dropdown-indicator":!0}),s),n||L(rc,null))},mh=sc,gh=function(t){var n=t.children,s=t.innerProps;return L("div",$({},se(t,"clearIndicator",{indicator:!0,"clear-indicator":!0}),s),n||L(Gs,null))},bh=function(t,n){var s=t.isDisabled,r=t.theme,o=r.spacing.baseUnit,a=r.colors;return z({label:"indicatorSeparator",alignSelf:"stretch",width:1},n?{}:{backgroundColor:s?a.neutral10:a.neutral20,marginBottom:o*2,marginTop:o*2})},yh=function(t){var n=t.innerProps;return L("span",$({},n,se(t,"indicatorSeparator",{"indicator-separator":!0})))},xh=Ep(Yo||(Yo=Ip([`
4
- 0%, 80%, 100% { opacity: 0; }
5
- 40% { opacity: 1; }
6
- `]))),vh=function(t,n){var s=t.isFocused,r=t.size,o=t.theme,a=o.colors,c=o.spacing.baseUnit;return z({label:"loadingIndicator",display:"flex",transition:"color 150ms",alignSelf:"center",fontSize:r,lineHeight:1,marginRight:r,textAlign:"center",verticalAlign:"middle"},n?{}:{color:s?a.neutral60:a.neutral20,padding:c*2})},Or=function(t){var n=t.delay,s=t.offset;return L("span",{css:Ws({animation:"".concat(xh," 1s ease-in-out ").concat(n,"ms infinite;"),backgroundColor:"currentColor",borderRadius:"1em",display:"inline-block",marginLeft:s?"1em":void 0,height:"1em",verticalAlign:"top",width:"1em"},"","")})},wh=function(t){var n=t.innerProps,s=t.isRtl,r=t.size,o=r===void 0?4:r,a=ze(t,dh);return L("div",$({},se(z(z({},a),{},{innerProps:n,isRtl:s,size:o}),"loadingIndicator",{indicator:!0,"loading-indicator":!0}),n),L(Or,{delay:0,offset:s}),L(Or,{delay:160,offset:!0}),L(Or,{delay:320,offset:!s}))},Ch=function(t,n){var s=t.isDisabled,r=t.isFocused,o=t.theme,a=o.colors,c=o.borderRadius,l=o.spacing;return z({label:"control",alignItems:"center",cursor:"default",display:"flex",flexWrap:"wrap",justifyContent:"space-between",minHeight:l.controlHeight,outline:"0 !important",position:"relative",transition:"all 100ms"},n?{}:{backgroundColor:s?a.neutral5:a.neutral0,borderColor:s?a.neutral10:r?a.primary:a.neutral20,borderRadius:c,borderStyle:"solid",borderWidth:1,boxShadow:r?"0 0 0 1px ".concat(a.primary):void 0,"&:hover":{borderColor:r?a.primary:a.neutral30}})},Sh=function(t){var n=t.children,s=t.isDisabled,r=t.isFocused,o=t.innerRef,a=t.innerProps,c=t.menuIsOpen;return L("div",$({ref:o},se(t,"control",{control:!0,"control--is-disabled":s,"control--is-focused":r,"control--menu-is-open":c}),a,{"aria-disabled":s||void 0}),n)},jh=Sh,Nh=["data"],Ph=function(t,n){var s=t.theme.spacing;return n?{}:{paddingBottom:s.baseUnit*2,paddingTop:s.baseUnit*2}},Eh=function(t){var n=t.children,s=t.cx,r=t.getStyles,o=t.getClassNames,a=t.Heading,c=t.headingProps,l=t.innerProps,u=t.label,d=t.theme,p=t.selectProps;return L("div",$({},se(t,"group",{group:!0}),l),L(a,$({},c,{selectProps:p,theme:d,getStyles:r,getClassNames:o,cx:s}),u),L("div",null,n))},Ih=function(t,n){var s=t.theme,r=s.colors,o=s.spacing;return z({label:"group",cursor:"default",display:"block"},n?{}:{color:r.neutral40,fontSize:"75%",fontWeight:500,marginBottom:"0.25em",paddingLeft:o.baseUnit*3,paddingRight:o.baseUnit*3,textTransform:"uppercase"})},Oh=function(t){var n=Qi(t);n.data;var s=ze(n,Nh);return L("div",$({},se(t,"groupHeading",{"group-heading":!0}),s))},kh=Eh,Mh=["innerRef","isDisabled","isHidden","inputClassName"],Th=function(t,n){var s=t.isDisabled,r=t.value,o=t.theme,a=o.spacing,c=o.colors;return z(z({visibility:s?"hidden":"visible",transform:r?"translateZ(0)":""},Ah),n?{}:{margin:a.baseUnit/2,paddingBottom:a.baseUnit/2,paddingTop:a.baseUnit/2,color:c.neutral80})},oc={gridArea:"1 / 2",font:"inherit",minWidth:"2px",border:0,margin:0,outline:0,padding:0},Ah={flex:"1 1 auto",display:"inline-grid",gridArea:"1 / 1 / 2 / 3",gridTemplateColumns:"0 min-content","&:after":z({content:'attr(data-value) " "',visibility:"hidden",whiteSpace:"pre"},oc)},Dh=function(t){return z({label:"input",color:"inherit",background:0,opacity:t?0:1,width:"100%"},oc)},Rh=function(t){var n=t.cx,s=t.value,r=Qi(t),o=r.innerRef,a=r.isDisabled,c=r.isHidden,l=r.inputClassName,u=ze(r,Mh);return L("div",$({},se(t,"input",{"input-container":!0}),{"data-value":s||""}),L("input",$({className:n({input:!0},l),ref:o,style:Dh(c),disabled:a},u)))},Lh=Rh,Fh=function(t,n){var s=t.theme,r=s.spacing,o=s.borderRadius,a=s.colors;return z({label:"multiValue",display:"flex",minWidth:0},n?{}:{backgroundColor:a.neutral10,borderRadius:o/2,margin:r.baseUnit/2})},zh=function(t,n){var s=t.theme,r=s.borderRadius,o=s.colors,a=t.cropWithEllipsis;return z({overflow:"hidden",textOverflow:a||a===void 0?"ellipsis":void 0,whiteSpace:"nowrap"},n?{}:{borderRadius:r/2,color:o.neutral80,fontSize:"85%",padding:3,paddingLeft:6})},$h=function(t,n){var s=t.theme,r=s.spacing,o=s.borderRadius,a=s.colors,c=t.isFocused;return z({alignItems:"center",display:"flex"},n?{}:{borderRadius:o/2,backgroundColor:c?a.dangerLight:void 0,paddingLeft:r.baseUnit,paddingRight:r.baseUnit,":hover":{backgroundColor:a.dangerLight,color:a.danger}})},ac=function(t){var n=t.children,s=t.innerProps;return L("div",s,n)},Vh=ac,Bh=ac;function Uh(e){var t=e.children,n=e.innerProps;return L("div",$({role:"button"},n),t||L(Gs,{size:14}))}var Hh=function(t){var n=t.children,s=t.components,r=t.data,o=t.innerProps,a=t.isDisabled,c=t.removeProps,l=t.selectProps,u=s.Container,d=s.Label,p=s.Remove;return L(u,{data:r,innerProps:z(z({},se(t,"multiValue",{"multi-value":!0,"multi-value--is-disabled":a})),o),selectProps:l},L(d,{data:r,innerProps:z({},se(t,"multiValueLabel",{"multi-value__label":!0})),selectProps:l},n),L(p,{data:r,innerProps:z(z({},se(t,"multiValueRemove",{"multi-value__remove":!0})),{},{"aria-label":"Remove ".concat(n||"option")},c),selectProps:l}))},_h=Hh,Wh=function(t,n){var s=t.isDisabled,r=t.isFocused,o=t.isSelected,a=t.theme,c=a.spacing,l=a.colors;return z({label:"option",cursor:"default",display:"block",fontSize:"inherit",width:"100%",userSelect:"none",WebkitTapHighlightColor:"rgba(0, 0, 0, 0)"},n?{}:{backgroundColor:o?l.primary:r?l.primary25:"transparent",color:s?l.neutral20:o?l.neutral0:"inherit",padding:"".concat(c.baseUnit*2,"px ").concat(c.baseUnit*3,"px"),":active":{backgroundColor:s?void 0:o?l.primary:l.primary50}})},Gh=function(t){var n=t.children,s=t.isDisabled,r=t.isFocused,o=t.isSelected,a=t.innerRef,c=t.innerProps;return L("div",$({},se(t,"option",{option:!0,"option--is-disabled":s,"option--is-focused":r,"option--is-selected":o}),{ref:a,"aria-disabled":s},c),n)},Yh=Gh,qh=function(t,n){var s=t.theme,r=s.spacing,o=s.colors;return z({label:"placeholder",gridArea:"1 / 1 / 2 / 3"},n?{}:{color:o.neutral50,marginLeft:r.baseUnit/2,marginRight:r.baseUnit/2})},Jh=function(t){var n=t.children,s=t.innerProps;return L("div",$({},se(t,"placeholder",{placeholder:!0}),s),n)},Qh=Jh,Xh=function(t,n){var s=t.isDisabled,r=t.theme,o=r.spacing,a=r.colors;return z({label:"singleValue",gridArea:"1 / 1 / 2 / 3",maxWidth:"100%",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},n?{}:{color:s?a.neutral40:a.neutral80,marginLeft:o.baseUnit/2,marginRight:o.baseUnit/2})},Kh=function(t){var n=t.children,s=t.isDisabled,r=t.innerProps;return L("div",$({},se(t,"singleValue",{"single-value":!0,"single-value--is-disabled":s}),r),n)},Zh=Kh,gr={ClearIndicator:gh,Control:jh,DropdownIndicator:hh,DownChevron:rc,CrossIcon:Gs,Group:kh,GroupHeading:Oh,IndicatorsContainer:lh,IndicatorSeparator:yh,Input:Lh,LoadingIndicator:wh,Menu:Jp,MenuList:Xp,MenuPortal:rh,LoadingMessage:th,NoOptionsMessage:eh,MultiValue:_h,MultiValueContainer:Vh,MultiValueLabel:Bh,MultiValueRemove:Uh,Option:Yh,Placeholder:Qh,SelectContainer:oh,SingleValue:Zh,ValueContainer:ih},em=function(t){return z(z({},gr),t.components)},qo=Number.isNaN||function(t){return typeof t=="number"&&t!==t};function tm(e,t){return!!(e===t||qo(e)&&qo(t))}function nm(e,t){if(e.length!==t.length)return!1;for(var n=0;n<e.length;n++)if(!tm(e[n],t[n]))return!1;return!0}function rm(e,t){t===void 0&&(t=nm);var n=null;function s(){for(var r=[],o=0;o<arguments.length;o++)r[o]=arguments[o];if(n&&n.lastThis===this&&t(r,n.lastArgs))return n.lastResult;var a=e.apply(this,r);return n={lastResult:a,lastArgs:r,lastThis:this},a}return s.clear=function(){n=null},s}var sm={name:"7pg0cj-a11yText",styles:"label:a11yText;z-index:9999;border:0;clip:rect(1px, 1px, 1px, 1px);height:1px;width:1px;position:absolute;overflow:hidden;padding:0;white-space:nowrap"},om=function(t){return L("span",$({css:sm},t))},Jo=om,am={guidance:function(t){var n=t.isSearchable,s=t.isMulti,r=t.tabSelectsValue,o=t.context,a=t.isInitialFocus;switch(o){case"menu":return"Use Up and Down to choose options, press Enter to select the currently focused option, press Escape to exit the menu".concat(r?", press Tab to select the option and exit the menu":"",".");case"input":return a?"".concat(t["aria-label"]||"Select"," is focused ").concat(n?",type to refine list":"",", press Down to open the menu, ").concat(s?" press left to focus selected values":""):"";case"value":return"Use left and right to toggle between focused values, press Backspace to remove the currently focused value";default:return""}},onChange:function(t){var n=t.action,s=t.label,r=s===void 0?"":s,o=t.labels,a=t.isDisabled;switch(n){case"deselect-option":case"pop-value":case"remove-value":return"option ".concat(r,", deselected.");case"clear":return"All selected options have been cleared.";case"initial-input-focus":return"option".concat(o.length>1?"s":""," ").concat(o.join(","),", selected.");case"select-option":return a?"option ".concat(r," is disabled. Select another option."):"option ".concat(r,", selected.");default:return""}},onFocus:function(t){var n=t.context,s=t.focused,r=t.options,o=t.label,a=o===void 0?"":o,c=t.selectValue,l=t.isDisabled,u=t.isSelected,d=t.isAppleDevice,p=function(g,y){return g&&g.length?"".concat(g.indexOf(y)+1," of ").concat(g.length):""};if(n==="value"&&c)return"value ".concat(a," focused, ").concat(p(c,s),".");if(n==="menu"&&d){var f=l?" disabled":"",h="".concat(u?" selected":"").concat(f);return"".concat(a).concat(h,", ").concat(p(r,s),".")}return""},onFilter:function(t){var n=t.inputValue,s=t.resultsMessage;return"".concat(s).concat(n?" for search term "+n:"",".")}},im=function(t){var n=t.ariaSelection,s=t.focusedOption,r=t.focusedValue,o=t.focusableOptions,a=t.isFocused,c=t.selectValue,l=t.selectProps,u=t.id,d=t.isAppleDevice,p=l.ariaLiveMessages,f=l.getOptionLabel,h=l.inputValue,m=l.isMulti,g=l.isOptionDisabled,y=l.isSearchable,x=l.menuIsOpen,v=l.options,S=l.screenReaderStatus,N=l.tabSelectsValue,w=l.isLoading,j=l["aria-label"],C=l["aria-live"],P=b.useMemo(function(){return z(z({},am),p||{})},[p]),E=b.useMemo(function(){var V="";if(n&&P.onChange){var B=n.option,_=n.options,Y=n.removedValue,W=n.removedValues,ee=n.value,re=function(oe){return Array.isArray(oe)?null:oe},U=Y||B||re(ee),R=U?f(U):"",H=_||W||void 0,te=H?H.map(f):[],ne=z({isDisabled:U&&g(U,c),label:R,labels:te},n);V=P.onChange(ne)}return V},[n,P,g,c,f]),M=b.useMemo(function(){var V="",B=s||r,_=!!(s&&c&&c.includes(s));if(B&&P.onFocus){var Y={focused:B,label:f(B),isDisabled:g(B,c),isSelected:_,options:o,context:B===s?"menu":"value",selectValue:c,isAppleDevice:d};V=P.onFocus(Y)}return V},[s,r,f,g,P,o,c,d]),O=b.useMemo(function(){var V="";if(x&&v.length&&!w&&P.onFilter){var B=S({count:o.length});V=P.onFilter({inputValue:h,resultsMessage:B})}return V},[o,h,x,P,v,S,w]),T=n?.action==="initial-input-focus",D=b.useMemo(function(){var V="";if(P.guidance){var B=r?"value":x?"menu":"input";V=P.guidance({"aria-label":j,context:B,isDisabled:s&&g(s,c),isMulti:m,isSearchable:y,tabSelectsValue:N,isInitialFocus:T})}return V},[j,s,r,m,g,y,x,P,c,N,T]),F=L(b.Fragment,null,L("span",{id:"aria-selection"},E),L("span",{id:"aria-focused"},M),L("span",{id:"aria-results"},O),L("span",{id:"aria-guidance"},D));return L(b.Fragment,null,L(Jo,{id:u},T&&F),L(Jo,{"aria-live":C,"aria-atomic":"false","aria-relevant":"additions text",role:"log"},a&&!T&&F))},cm=im,as=[{base:"A",letters:"AⒶAÀÁÂẦẤẪẨÃĀĂẰẮẴẲȦǠÄǞẢÅǺǍȀȂẠẬẶḀĄȺⱯ"},{base:"AA",letters:"Ꜳ"},{base:"AE",letters:"ÆǼǢ"},{base:"AO",letters:"Ꜵ"},{base:"AU",letters:"Ꜷ"},{base:"AV",letters:"ꜸꜺ"},{base:"AY",letters:"Ꜽ"},{base:"B",letters:"BⒷBḂḄḆɃƂƁ"},{base:"C",letters:"CⒸCĆĈĊČÇḈƇȻꜾ"},{base:"D",letters:"DⒹDḊĎḌḐḒḎĐƋƊƉꝹ"},{base:"DZ",letters:"DZDŽ"},{base:"Dz",letters:"DzDž"},{base:"E",letters:"EⒺEÈÉÊỀẾỄỂẼĒḔḖĔĖËẺĚȄȆẸỆȨḜĘḘḚƐƎ"},{base:"F",letters:"FⒻFḞƑꝻ"},{base:"G",letters:"GⒼGǴĜḠĞĠǦĢǤƓꞠꝽꝾ"},{base:"H",letters:"HⒽHĤḢḦȞḤḨḪĦⱧⱵꞍ"},{base:"I",letters:"IⒾIÌÍÎĨĪĬİÏḮỈǏȈȊỊĮḬƗ"},{base:"J",letters:"JⒿJĴɈ"},{base:"K",letters:"KⓀKḰǨḲĶḴƘⱩꝀꝂꝄꞢ"},{base:"L",letters:"LⓁLĿĹĽḶḸĻḼḺŁȽⱢⱠꝈꝆꞀ"},{base:"LJ",letters:"LJ"},{base:"Lj",letters:"Lj"},{base:"M",letters:"MⓂMḾṀṂⱮƜ"},{base:"N",letters:"NⓃNǸŃÑṄŇṆŅṊṈȠƝꞐꞤ"},{base:"NJ",letters:"NJ"},{base:"Nj",letters:"Nj"},{base:"O",letters:"OⓄOÒÓÔỒỐỖỔÕṌȬṎŌṐṒŎȮȰÖȪỎŐǑȌȎƠỜỚỠỞỢỌỘǪǬØǾƆƟꝊꝌ"},{base:"OI",letters:"Ƣ"},{base:"OO",letters:"Ꝏ"},{base:"OU",letters:"Ȣ"},{base:"P",letters:"PⓅPṔṖƤⱣꝐꝒꝔ"},{base:"Q",letters:"QⓆQꝖꝘɊ"},{base:"R",letters:"RⓇRŔṘŘȐȒṚṜŖṞɌⱤꝚꞦꞂ"},{base:"S",letters:"SⓈSẞŚṤŜṠŠṦṢṨȘŞⱾꞨꞄ"},{base:"T",letters:"TⓉTṪŤṬȚŢṰṮŦƬƮȾꞆ"},{base:"TZ",letters:"Ꜩ"},{base:"U",letters:"UⓊUÙÚÛŨṸŪṺŬÜǛǗǕǙỦŮŰǓȔȖƯỪỨỮỬỰỤṲŲṶṴɄ"},{base:"V",letters:"VⓋVṼṾƲꝞɅ"},{base:"VY",letters:"Ꝡ"},{base:"W",letters:"WⓌWẀẂŴẆẄẈⱲ"},{base:"X",letters:"XⓍXẊẌ"},{base:"Y",letters:"YⓎYỲÝŶỸȲẎŸỶỴƳɎỾ"},{base:"Z",letters:"ZⓏZŹẐŻŽẒẔƵȤⱿⱫꝢ"},{base:"a",letters:"aⓐaẚàáâầấẫẩãāăằắẵẳȧǡäǟảåǻǎȁȃạậặḁąⱥɐ"},{base:"aa",letters:"ꜳ"},{base:"ae",letters:"æǽǣ"},{base:"ao",letters:"ꜵ"},{base:"au",letters:"ꜷ"},{base:"av",letters:"ꜹꜻ"},{base:"ay",letters:"ꜽ"},{base:"b",letters:"bⓑbḃḅḇƀƃɓ"},{base:"c",letters:"cⓒcćĉċčçḉƈȼꜿↄ"},{base:"d",letters:"dⓓdḋďḍḑḓḏđƌɖɗꝺ"},{base:"dz",letters:"dzdž"},{base:"e",letters:"eⓔeèéêềếễểẽēḕḗĕėëẻěȅȇẹệȩḝęḙḛɇɛǝ"},{base:"f",letters:"fⓕfḟƒꝼ"},{base:"g",letters:"gⓖgǵĝḡğġǧģǥɠꞡᵹꝿ"},{base:"h",letters:"hⓗhĥḣḧȟḥḩḫẖħⱨⱶɥ"},{base:"hv",letters:"ƕ"},{base:"i",letters:"iⓘiìíîĩīĭïḯỉǐȉȋịįḭɨı"},{base:"j",letters:"jⓙjĵǰɉ"},{base:"k",letters:"kⓚkḱǩḳķḵƙⱪꝁꝃꝅꞣ"},{base:"l",letters:"lⓛlŀĺľḷḹļḽḻſłƚɫⱡꝉꞁꝇ"},{base:"lj",letters:"lj"},{base:"m",letters:"mⓜmḿṁṃɱɯ"},{base:"n",letters:"nⓝnǹńñṅňṇņṋṉƞɲʼnꞑꞥ"},{base:"nj",letters:"nj"},{base:"o",letters:"oⓞoòóôồốỗổõṍȭṏōṑṓŏȯȱöȫỏőǒȍȏơờớỡởợọộǫǭøǿɔꝋꝍɵ"},{base:"oi",letters:"ƣ"},{base:"ou",letters:"ȣ"},{base:"oo",letters:"ꝏ"},{base:"p",letters:"pⓟpṕṗƥᵽꝑꝓꝕ"},{base:"q",letters:"qⓠqɋꝗꝙ"},{base:"r",letters:"rⓡrŕṙřȑȓṛṝŗṟɍɽꝛꞧꞃ"},{base:"s",letters:"sⓢsßśṥŝṡšṧṣṩșşȿꞩꞅẛ"},{base:"t",letters:"tⓣtṫẗťṭțţṱṯŧƭʈⱦꞇ"},{base:"tz",letters:"ꜩ"},{base:"u",letters:"uⓤuùúûũṹūṻŭüǜǘǖǚủůűǔȕȗưừứữửựụṳųṷṵʉ"},{base:"v",letters:"vⓥvṽṿʋꝟʌ"},{base:"vy",letters:"ꝡ"},{base:"w",letters:"wⓦwẁẃŵẇẅẘẉⱳ"},{base:"x",letters:"xⓧxẋẍ"},{base:"y",letters:"yⓨyỳýŷỹȳẏÿỷẙỵƴɏỿ"},{base:"z",letters:"zⓩzźẑżžẓẕƶȥɀⱬꝣ"}],lm=new RegExp("["+as.map(function(e){return e.letters}).join("")+"]","g"),ic={};for(var kr=0;kr<as.length;kr++)for(var Mr=as[kr],Tr=0;Tr<Mr.letters.length;Tr++)ic[Mr.letters[Tr]]=Mr.base;var cc=function(t){return t.replace(lm,function(n){return ic[n]})},um=rm(cc),Qo=function(t){return t.replace(/^\s+|\s+$/g,"")},dm=function(t){return"".concat(t.label," ").concat(t.value)},fm=function(t){return function(n,s){if(n.data.__isNew__)return!0;var r=z({ignoreCase:!0,ignoreAccents:!0,stringify:dm,trim:!0,matchFrom:"any"},t),o=r.ignoreCase,a=r.ignoreAccents,c=r.stringify,l=r.trim,u=r.matchFrom,d=l?Qo(s):s,p=l?Qo(c(n)):c(n);return o&&(d=d.toLowerCase(),p=p.toLowerCase()),a&&(d=um(d),p=cc(p)),u==="start"?p.substr(0,d.length)===d:p.indexOf(d)>-1}},pm=["innerRef"];function hm(e){var t=e.innerRef,n=ze(e,pm),s=Bp(n,"onExited","in","enter","exit","appear");return L("input",$({ref:t},s,{css:Ws({label:"dummyInput",background:0,border:0,caretColor:"transparent",fontSize:"inherit",gridArea:"1 / 1 / 2 / 3",outline:0,padding:0,width:1,color:"transparent",left:-100,opacity:0,position:"relative",transform:"scale(.01)"},"","")}))}var mm=function(t){t.cancelable&&t.preventDefault(),t.stopPropagation()};function gm(e){var t=e.isEnabled,n=e.onBottomArrive,s=e.onBottomLeave,r=e.onTopArrive,o=e.onTopLeave,a=b.useRef(!1),c=b.useRef(!1),l=b.useRef(0),u=b.useRef(null),d=b.useCallback(function(y,x){if(u.current!==null){var v=u.current,S=v.scrollTop,N=v.scrollHeight,w=v.clientHeight,j=u.current,C=x>0,P=N-w-S,E=!1;P>x&&a.current&&(s&&s(y),a.current=!1),C&&c.current&&(o&&o(y),c.current=!1),C&&x>P?(n&&!a.current&&n(y),j.scrollTop=N,E=!0,a.current=!0):!C&&-x>S&&(r&&!c.current&&r(y),j.scrollTop=0,E=!0,c.current=!0),E&&mm(y)}},[n,s,r,o]),p=b.useCallback(function(y){d(y,y.deltaY)},[d]),f=b.useCallback(function(y){l.current=y.changedTouches[0].clientY},[]),h=b.useCallback(function(y){var x=l.current-y.changedTouches[0].clientY;d(y,x)},[d]),m=b.useCallback(function(y){if(y){var x=zp?{passive:!1}:!1;y.addEventListener("wheel",p,x),y.addEventListener("touchstart",f,x),y.addEventListener("touchmove",h,x)}},[h,f,p]),g=b.useCallback(function(y){y&&(y.removeEventListener("wheel",p,!1),y.removeEventListener("touchstart",f,!1),y.removeEventListener("touchmove",h,!1))},[h,f,p]);return b.useEffect(function(){if(t){var y=u.current;return m(y),function(){g(y)}}},[t,m,g]),function(y){u.current=y}}var Xo=["boxSizing","height","overflow","paddingRight","position"],Ko={boxSizing:"border-box",overflow:"hidden",position:"relative",height:"100%"};function Zo(e){e.cancelable&&e.preventDefault()}function ea(e){e.stopPropagation()}function ta(){var e=this.scrollTop,t=this.scrollHeight,n=e+this.offsetHeight;e===0?this.scrollTop=1:n===t&&(this.scrollTop=e-1)}function na(){return"ontouchstart"in window||navigator.maxTouchPoints}var ra=!!(typeof window<"u"&&window.document&&window.document.createElement),Ot=0,at={capture:!1,passive:!1};function bm(e){var t=e.isEnabled,n=e.accountForScrollbars,s=n===void 0?!0:n,r=b.useRef({}),o=b.useRef(null),a=b.useCallback(function(l){if(ra){var u=document.body,d=u&&u.style;if(s&&Xo.forEach(function(m){var g=d&&d[m];r.current[m]=g}),s&&Ot<1){var p=parseInt(r.current.paddingRight,10)||0,f=document.body?document.body.clientWidth:0,h=window.innerWidth-f+p||0;Object.keys(Ko).forEach(function(m){var g=Ko[m];d&&(d[m]=g)}),d&&(d.paddingRight="".concat(h,"px"))}u&&na()&&(u.addEventListener("touchmove",Zo,at),l&&(l.addEventListener("touchstart",ta,at),l.addEventListener("touchmove",ea,at))),Ot+=1}},[s]),c=b.useCallback(function(l){if(ra){var u=document.body,d=u&&u.style;Ot=Math.max(Ot-1,0),s&&Ot<1&&Xo.forEach(function(p){var f=r.current[p];d&&(d[p]=f)}),u&&na()&&(u.removeEventListener("touchmove",Zo,at),l&&(l.removeEventListener("touchstart",ta,at),l.removeEventListener("touchmove",ea,at)))}},[s]);return b.useEffect(function(){if(t){var l=o.current;return a(l),function(){c(l)}}},[t,a,c]),function(l){o.current=l}}var ym=function(t){var n=t.target;return n.ownerDocument.activeElement&&n.ownerDocument.activeElement.blur()},xm={name:"1kfdb0e",styles:"position:fixed;left:0;bottom:0;right:0;top:0"};function vm(e){var t=e.children,n=e.lockEnabled,s=e.captureEnabled,r=s===void 0?!0:s,o=e.onBottomArrive,a=e.onBottomLeave,c=e.onTopArrive,l=e.onTopLeave,u=gm({isEnabled:r,onBottomArrive:o,onBottomLeave:a,onTopArrive:c,onTopLeave:l}),d=bm({isEnabled:n}),p=function(h){u(h),d(h)};return L(b.Fragment,null,n&&L("div",{onClick:ym,css:xm}),t(p))}var wm={name:"1a0ro4n-requiredInput",styles:"label:requiredInput;opacity:0;pointer-events:none;position:absolute;bottom:0;left:0;right:0;width:100%"},Cm=function(t){var n=t.name,s=t.onFocus;return L("input",{required:!0,name:n,tabIndex:-1,"aria-hidden":"true",onFocus:s,css:wm,value:"",onChange:function(){}})},Sm=Cm;function Ys(e){var t;return typeof window<"u"&&window.navigator!=null?e.test(((t=window.navigator.userAgentData)===null||t===void 0?void 0:t.platform)||window.navigator.platform):!1}function jm(){return Ys(/^iPhone/i)}function lc(){return Ys(/^Mac/i)}function Nm(){return Ys(/^iPad/i)||lc()&&navigator.maxTouchPoints>1}function Pm(){return jm()||Nm()}function Em(){return lc()||Pm()}var Im=function(t){return t.label},Om=function(t){return t.label},km=function(t){return t.value},Mm=function(t){return!!t.isDisabled},Tm={clearIndicator:mh,container:sh,control:Ch,dropdownIndicator:ph,group:Ph,groupHeading:Ih,indicatorsContainer:ch,indicatorSeparator:bh,input:Th,loadingIndicator:vh,loadingMessage:Zp,menu:Gp,menuList:Qp,menuPortal:nh,multiValue:Fh,multiValueLabel:zh,multiValueRemove:$h,noOptionsMessage:Kp,option:Wh,placeholder:qh,singleValue:Xh,valueContainer:ah},Am={primary:"#2684FF",primary75:"#4C9AFF",primary50:"#B2D4FF",primary25:"#DEEBFF",danger:"#DE350B",dangerLight:"#FFBDAD",neutral0:"hsl(0, 0%, 100%)",neutral5:"hsl(0, 0%, 95%)",neutral10:"hsl(0, 0%, 90%)",neutral20:"hsl(0, 0%, 80%)",neutral30:"hsl(0, 0%, 70%)",neutral40:"hsl(0, 0%, 60%)",neutral50:"hsl(0, 0%, 50%)",neutral60:"hsl(0, 0%, 40%)",neutral70:"hsl(0, 0%, 30%)",neutral80:"hsl(0, 0%, 20%)",neutral90:"hsl(0, 0%, 10%)"},Dm=4,uc=4,Rm=38,Lm=uc*2,Fm={baseUnit:uc,controlHeight:Rm,menuGutter:Lm},Ar={borderRadius:Dm,colors:Am,spacing:Fm},zm={"aria-live":"polite",backspaceRemovesValue:!0,blurInputOnSelect:Go(),captureMenuScroll:!Go(),classNames:{},closeMenuOnSelect:!0,closeMenuOnScroll:!1,components:{},controlShouldRenderValue:!0,escapeClearsValue:!1,filterOption:fm(),formatGroupLabel:Im,getOptionLabel:Om,getOptionValue:km,isDisabled:!1,isLoading:!1,isMulti:!1,isRtl:!1,isSearchable:!0,isOptionDisabled:Mm,loadingMessage:function(){return"Loading..."},maxMenuHeight:300,minMenuHeight:140,menuIsOpen:!1,menuPlacement:"bottom",menuPosition:"absolute",menuShouldBlockScroll:!1,menuShouldScrollIntoView:!Lp(),noOptionsMessage:function(){return"No options"},openMenuOnFocus:!1,openMenuOnClick:!0,options:[],pageSize:5,placeholder:"Select...",screenReaderStatus:function(t){var n=t.count;return"".concat(n," result").concat(n!==1?"s":""," available")},styles:{},tabIndex:0,tabSelectsValue:!0,unstyled:!1};function sa(e,t,n,s){var r=pc(e,t,n),o=hc(e,t,n),a=fc(e,t),c=Xn(e,t);return{type:"option",data:t,isDisabled:r,isSelected:o,label:a,value:c,index:s}}function $n(e,t){return e.options.map(function(n,s){if("options"in n){var r=n.options.map(function(a,c){return sa(e,a,t,c)}).filter(function(a){return aa(e,a)});return r.length>0?{type:"group",data:n,options:r,index:s}:void 0}var o=sa(e,n,t,s);return aa(e,o)?o:void 0}).filter($p)}function dc(e){return e.reduce(function(t,n){return n.type==="group"?t.push.apply(t,Vs(n.options.map(function(s){return s.data}))):t.push(n.data),t},[])}function oa(e,t){return e.reduce(function(n,s){return s.type==="group"?n.push.apply(n,Vs(s.options.map(function(r){return{data:r.data,id:"".concat(t,"-").concat(s.index,"-").concat(r.index)}}))):n.push({data:s.data,id:"".concat(t,"-").concat(s.index)}),n},[])}function $m(e,t){return dc($n(e,t))}function aa(e,t){var n=e.inputValue,s=n===void 0?"":n,r=t.data,o=t.isSelected,a=t.label,c=t.value;return(!gc(e)||!o)&&mc(e,{label:a,value:c,data:r},s)}function Vm(e,t){var n=e.focusedValue,s=e.selectValue,r=s.indexOf(n);if(r>-1){var o=t.indexOf(n);if(o>-1)return n;if(r<t.length)return t[r]}return null}function Bm(e,t){var n=e.focusedOption;return n&&t.indexOf(n)>-1?n:t[0]}var Dr=function(t,n){var s,r=(s=t.find(function(o){return o.data===n}))===null||s===void 0?void 0:s.id;return r||null},fc=function(t,n){return t.getOptionLabel(n)},Xn=function(t,n){return t.getOptionValue(n)};function pc(e,t,n){return typeof e.isOptionDisabled=="function"?e.isOptionDisabled(t,n):!1}function hc(e,t,n){if(n.indexOf(t)>-1)return!0;if(typeof e.isOptionSelected=="function")return e.isOptionSelected(t,n);var s=Xn(e,t);return n.some(function(r){return Xn(e,r)===s})}function mc(e,t,n){return e.filterOption?e.filterOption(t,n):!0}var gc=function(t){var n=t.hideSelectedOptions,s=t.isMulti;return n===void 0?s:n},Um=1,bc=(function(e){E0(n,e);var t=k0(n);function n(s){var r;if(N0(this,n),r=t.call(this,s),r.state={ariaSelection:null,focusedOption:null,focusedOptionId:null,focusableOptionsWithIds:[],focusedValue:null,inputIsHidden:!1,isFocused:!1,selectValue:[],clearFocusValueOnUpdate:!1,prevWasFocused:!1,inputIsHiddenAfterUpdate:void 0,prevProps:void 0,instancePrefix:"",isAppleDevice:!1},r.blockOptionHover=!1,r.isComposing=!1,r.commonProps=void 0,r.initialTouchX=0,r.initialTouchY=0,r.openAfterFocus=!1,r.scrollToFocusedOptionOnUpdate=!1,r.userIsDragging=void 0,r.controlRef=null,r.getControlRef=function(l){r.controlRef=l},r.focusedOptionRef=null,r.getFocusedOptionRef=function(l){r.focusedOptionRef=l},r.menuListRef=null,r.getMenuListRef=function(l){r.menuListRef=l},r.inputRef=null,r.getInputRef=function(l){r.inputRef=l},r.focus=r.focusInput,r.blur=r.blurInput,r.onChange=function(l,u){var d=r.props,p=d.onChange,f=d.name;u.name=f,r.ariaOnChange(l,u),p(l,u)},r.setValue=function(l,u,d){var p=r.props,f=p.closeMenuOnSelect,h=p.isMulti,m=p.inputValue;r.onInputChange("",{action:"set-value",prevInputValue:m}),f&&(r.setState({inputIsHiddenAfterUpdate:!h}),r.onMenuClose()),r.setState({clearFocusValueOnUpdate:!0}),r.onChange(l,{action:u,option:d})},r.selectOption=function(l){var u=r.props,d=u.blurInputOnSelect,p=u.isMulti,f=u.name,h=r.state.selectValue,m=p&&r.isOptionSelected(l,h),g=r.isOptionDisabled(l,h);if(m){var y=r.getOptionValue(l);r.setValue(h.filter(function(x){return r.getOptionValue(x)!==y}),"deselect-option",l)}else if(!g)p?r.setValue([].concat(Vs(h),[l]),"select-option",l):r.setValue(l,"select-option");else{r.ariaOnChange(l,{action:"select-option",option:l,name:f});return}d&&r.blurInput()},r.removeValue=function(l){var u=r.props.isMulti,d=r.state.selectValue,p=r.getOptionValue(l),f=d.filter(function(m){return r.getOptionValue(m)!==p}),h=Nn(u,f,f[0]||null);r.onChange(h,{action:"remove-value",removedValue:l}),r.focusInput()},r.clearValue=function(){var l=r.state.selectValue;r.onChange(Nn(r.props.isMulti,[],null),{action:"clear",removedValues:l})},r.popValue=function(){var l=r.props.isMulti,u=r.state.selectValue,d=u[u.length-1],p=u.slice(0,u.length-1),f=Nn(l,p,p[0]||null);d&&r.onChange(f,{action:"pop-value",removedValue:d})},r.getFocusedOptionId=function(l){return Dr(r.state.focusableOptionsWithIds,l)},r.getFocusableOptionsWithIds=function(){return oa($n(r.props,r.state.selectValue),r.getElementId("option"))},r.getValue=function(){return r.state.selectValue},r.cx=function(){for(var l=arguments.length,u=new Array(l),d=0;d<l;d++)u[d]=arguments[d];return Mp.apply(void 0,[r.props.classNamePrefix].concat(u))},r.getOptionLabel=function(l){return fc(r.props,l)},r.getOptionValue=function(l){return Xn(r.props,l)},r.getStyles=function(l,u){var d=r.props.unstyled,p=Tm[l](u,d);p.boxSizing="border-box";var f=r.props.styles[l];return f?f(p,u):p},r.getClassNames=function(l,u){var d,p;return(d=(p=r.props.classNames)[l])===null||d===void 0?void 0:d.call(p,u)},r.getElementId=function(l){return"".concat(r.state.instancePrefix,"-").concat(l)},r.getComponents=function(){return em(r.props)},r.buildCategorizedOptions=function(){return $n(r.props,r.state.selectValue)},r.getCategorizedOptions=function(){return r.props.menuIsOpen?r.buildCategorizedOptions():[]},r.buildFocusableOptions=function(){return dc(r.buildCategorizedOptions())},r.getFocusableOptions=function(){return r.props.menuIsOpen?r.buildFocusableOptions():[]},r.ariaOnChange=function(l,u){r.setState({ariaSelection:z({value:l},u)})},r.onMenuMouseDown=function(l){l.button===0&&(l.stopPropagation(),l.preventDefault(),r.focusInput())},r.onMenuMouseMove=function(l){r.blockOptionHover=!1},r.onControlMouseDown=function(l){if(!l.defaultPrevented){var u=r.props.openMenuOnClick;r.state.isFocused?r.props.menuIsOpen?l.target.tagName!=="INPUT"&&l.target.tagName!=="TEXTAREA"&&r.onMenuClose():u&&r.openMenu("first"):(u&&(r.openAfterFocus=!0),r.focusInput()),l.target.tagName!=="INPUT"&&l.target.tagName!=="TEXTAREA"&&l.preventDefault()}},r.onDropdownIndicatorMouseDown=function(l){if(!(l&&l.type==="mousedown"&&l.button!==0)&&!r.props.isDisabled){var u=r.props,d=u.isMulti,p=u.menuIsOpen;r.focusInput(),p?(r.setState({inputIsHiddenAfterUpdate:!d}),r.onMenuClose()):r.openMenu("first"),l.preventDefault()}},r.onClearIndicatorMouseDown=function(l){l&&l.type==="mousedown"&&l.button!==0||(r.clearValue(),l.preventDefault(),r.openAfterFocus=!1,l.type==="touchend"?r.focusInput():setTimeout(function(){return r.focusInput()}))},r.onScroll=function(l){typeof r.props.closeMenuOnScroll=="boolean"?l.target instanceof HTMLElement&&mr(l.target)&&r.props.onMenuClose():typeof r.props.closeMenuOnScroll=="function"&&r.props.closeMenuOnScroll(l)&&r.props.onMenuClose()},r.onCompositionStart=function(){r.isComposing=!0},r.onCompositionEnd=function(){r.isComposing=!1},r.onTouchStart=function(l){var u=l.touches,d=u&&u.item(0);d&&(r.initialTouchX=d.clientX,r.initialTouchY=d.clientY,r.userIsDragging=!1)},r.onTouchMove=function(l){var u=l.touches,d=u&&u.item(0);if(d){var p=Math.abs(d.clientX-r.initialTouchX),f=Math.abs(d.clientY-r.initialTouchY),h=5;r.userIsDragging=p>h||f>h}},r.onTouchEnd=function(l){r.userIsDragging||(r.controlRef&&!r.controlRef.contains(l.target)&&r.menuListRef&&!r.menuListRef.contains(l.target)&&r.blurInput(),r.initialTouchX=0,r.initialTouchY=0)},r.onControlTouchEnd=function(l){r.userIsDragging||r.onControlMouseDown(l)},r.onClearIndicatorTouchEnd=function(l){r.userIsDragging||r.onClearIndicatorMouseDown(l)},r.onDropdownIndicatorTouchEnd=function(l){r.userIsDragging||r.onDropdownIndicatorMouseDown(l)},r.handleInputChange=function(l){var u=r.props.inputValue,d=l.currentTarget.value;r.setState({inputIsHiddenAfterUpdate:!1}),r.onInputChange(d,{action:"input-change",prevInputValue:u}),r.props.menuIsOpen||r.onMenuOpen()},r.onInputFocus=function(l){r.props.onFocus&&r.props.onFocus(l),r.setState({inputIsHiddenAfterUpdate:!1,isFocused:!0}),(r.openAfterFocus||r.props.openMenuOnFocus)&&r.openMenu("first"),r.openAfterFocus=!1},r.onInputBlur=function(l){var u=r.props.inputValue;if(r.menuListRef&&r.menuListRef.contains(document.activeElement)){r.inputRef.focus();return}r.props.onBlur&&r.props.onBlur(l),r.onInputChange("",{action:"input-blur",prevInputValue:u}),r.onMenuClose(),r.setState({focusedValue:null,isFocused:!1})},r.onOptionHover=function(l){if(!(r.blockOptionHover||r.state.focusedOption===l)){var u=r.getFocusableOptions(),d=u.indexOf(l);r.setState({focusedOption:l,focusedOptionId:d>-1?r.getFocusedOptionId(l):null})}},r.shouldHideSelectedOptions=function(){return gc(r.props)},r.onValueInputFocus=function(l){l.preventDefault(),l.stopPropagation(),r.focus()},r.onKeyDown=function(l){var u=r.props,d=u.isMulti,p=u.backspaceRemovesValue,f=u.escapeClearsValue,h=u.inputValue,m=u.isClearable,g=u.isDisabled,y=u.menuIsOpen,x=u.onKeyDown,v=u.tabSelectsValue,S=u.openMenuOnFocus,N=r.state,w=N.focusedOption,j=N.focusedValue,C=N.selectValue;if(!g&&!(typeof x=="function"&&(x(l),l.defaultPrevented))){switch(r.blockOptionHover=!0,l.key){case"ArrowLeft":if(!d||h)return;r.focusValue("previous");break;case"ArrowRight":if(!d||h)return;r.focusValue("next");break;case"Delete":case"Backspace":if(h)return;if(j)r.removeValue(j);else{if(!p)return;d?r.popValue():m&&r.clearValue()}break;case"Tab":if(r.isComposing||l.shiftKey||!y||!v||!w||S&&r.isOptionSelected(w,C))return;r.selectOption(w);break;case"Enter":if(l.keyCode===229)break;if(y){if(!w||r.isComposing)return;r.selectOption(w);break}return;case"Escape":y?(r.setState({inputIsHiddenAfterUpdate:!1}),r.onInputChange("",{action:"menu-close",prevInputValue:h}),r.onMenuClose()):m&&f&&r.clearValue();break;case" ":if(h)return;if(!y){r.openMenu("first");break}if(!w)return;r.selectOption(w);break;case"ArrowUp":y?r.focusOption("up"):r.openMenu("last");break;case"ArrowDown":y?r.focusOption("down"):r.openMenu("first");break;case"PageUp":if(!y)return;r.focusOption("pageup");break;case"PageDown":if(!y)return;r.focusOption("pagedown");break;case"Home":if(!y)return;r.focusOption("first");break;case"End":if(!y)return;r.focusOption("last");break;default:return}l.preventDefault()}},r.state.instancePrefix="react-select-"+(r.props.instanceId||++Um),r.state.selectValue=_o(s.value),s.menuIsOpen&&r.state.selectValue.length){var o=r.getFocusableOptionsWithIds(),a=r.buildFocusableOptions(),c=a.indexOf(r.state.selectValue[0]);r.state.focusableOptionsWithIds=o,r.state.focusedOption=a[c],r.state.focusedOptionId=Dr(o,a[c])}return r}return P0(n,[{key:"componentDidMount",value:function(){this.startListeningComposition(),this.startListeningToTouch(),this.props.closeMenuOnScroll&&document&&document.addEventListener&&document.addEventListener("scroll",this.onScroll,!0),this.props.autoFocus&&this.focusInput(),this.props.menuIsOpen&&this.state.focusedOption&&this.menuListRef&&this.focusedOptionRef&&Wo(this.menuListRef,this.focusedOptionRef),Em()&&this.setState({isAppleDevice:!0})}},{key:"componentDidUpdate",value:function(r){var o=this.props,a=o.isDisabled,c=o.menuIsOpen,l=this.state.isFocused;(l&&!a&&r.isDisabled||l&&c&&!r.menuIsOpen)&&this.focusInput(),l&&a&&!r.isDisabled?this.setState({isFocused:!1},this.onMenuClose):!l&&!a&&r.isDisabled&&this.inputRef===document.activeElement&&this.setState({isFocused:!0}),this.menuListRef&&this.focusedOptionRef&&this.scrollToFocusedOptionOnUpdate&&(Wo(this.menuListRef,this.focusedOptionRef),this.scrollToFocusedOptionOnUpdate=!1)}},{key:"componentWillUnmount",value:function(){this.stopListeningComposition(),this.stopListeningToTouch(),document.removeEventListener("scroll",this.onScroll,!0)}},{key:"onMenuOpen",value:function(){this.props.onMenuOpen()}},{key:"onMenuClose",value:function(){this.onInputChange("",{action:"menu-close",prevInputValue:this.props.inputValue}),this.props.onMenuClose()}},{key:"onInputChange",value:function(r,o){this.props.onInputChange(r,o)}},{key:"focusInput",value:function(){this.inputRef&&this.inputRef.focus()}},{key:"blurInput",value:function(){this.inputRef&&this.inputRef.blur()}},{key:"openMenu",value:function(r){var o=this,a=this.state,c=a.selectValue,l=a.isFocused,u=this.buildFocusableOptions(),d=r==="first"?0:u.length-1;if(!this.props.isMulti){var p=u.indexOf(c[0]);p>-1&&(d=p)}this.scrollToFocusedOptionOnUpdate=!(l&&this.menuListRef),this.setState({inputIsHiddenAfterUpdate:!1,focusedValue:null,focusedOption:u[d],focusedOptionId:this.getFocusedOptionId(u[d])},function(){return o.onMenuOpen()})}},{key:"focusValue",value:function(r){var o=this.state,a=o.selectValue,c=o.focusedValue;if(this.props.isMulti){this.setState({focusedOption:null});var l=a.indexOf(c);c||(l=-1);var u=a.length-1,d=-1;if(a.length){switch(r){case"previous":l===0?d=0:l===-1?d=u:d=l-1;break;case"next":l>-1&&l<u&&(d=l+1);break}this.setState({inputIsHidden:d!==-1,focusedValue:a[d]})}}}},{key:"focusOption",value:function(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"first",o=this.props.pageSize,a=this.state.focusedOption,c=this.getFocusableOptions();if(c.length){var l=0,u=c.indexOf(a);a||(u=-1),r==="up"?l=u>0?u-1:c.length-1:r==="down"?l=(u+1)%c.length:r==="pageup"?(l=u-o,l<0&&(l=0)):r==="pagedown"?(l=u+o,l>c.length-1&&(l=c.length-1)):r==="last"&&(l=c.length-1),this.scrollToFocusedOptionOnUpdate=!0,this.setState({focusedOption:c[l],focusedValue:null,focusedOptionId:this.getFocusedOptionId(c[l])})}}},{key:"getTheme",value:(function(){return this.props.theme?typeof this.props.theme=="function"?this.props.theme(Ar):z(z({},Ar),this.props.theme):Ar})},{key:"getCommonProps",value:function(){var r=this.clearValue,o=this.cx,a=this.getStyles,c=this.getClassNames,l=this.getValue,u=this.selectOption,d=this.setValue,p=this.props,f=p.isMulti,h=p.isRtl,m=p.options,g=this.hasValue();return{clearValue:r,cx:o,getStyles:a,getClassNames:c,getValue:l,hasValue:g,isMulti:f,isRtl:h,options:m,selectOption:u,selectProps:p,setValue:d,theme:this.getTheme()}}},{key:"hasValue",value:function(){var r=this.state.selectValue;return r.length>0}},{key:"hasOptions",value:function(){return!!this.getFocusableOptions().length}},{key:"isClearable",value:function(){var r=this.props,o=r.isClearable,a=r.isMulti;return o===void 0?a:o}},{key:"isOptionDisabled",value:function(r,o){return pc(this.props,r,o)}},{key:"isOptionSelected",value:function(r,o){return hc(this.props,r,o)}},{key:"filterOption",value:function(r,o){return mc(this.props,r,o)}},{key:"formatOptionLabel",value:function(r,o){if(typeof this.props.formatOptionLabel=="function"){var a=this.props.inputValue,c=this.state.selectValue;return this.props.formatOptionLabel(r,{context:o,inputValue:a,selectValue:c})}else return this.getOptionLabel(r)}},{key:"formatGroupLabel",value:function(r){return this.props.formatGroupLabel(r)}},{key:"startListeningComposition",value:(function(){document&&document.addEventListener&&(document.addEventListener("compositionstart",this.onCompositionStart,!1),document.addEventListener("compositionend",this.onCompositionEnd,!1))})},{key:"stopListeningComposition",value:function(){document&&document.removeEventListener&&(document.removeEventListener("compositionstart",this.onCompositionStart),document.removeEventListener("compositionend",this.onCompositionEnd))}},{key:"startListeningToTouch",value:(function(){document&&document.addEventListener&&(document.addEventListener("touchstart",this.onTouchStart,!1),document.addEventListener("touchmove",this.onTouchMove,!1),document.addEventListener("touchend",this.onTouchEnd,!1))})},{key:"stopListeningToTouch",value:function(){document&&document.removeEventListener&&(document.removeEventListener("touchstart",this.onTouchStart),document.removeEventListener("touchmove",this.onTouchMove),document.removeEventListener("touchend",this.onTouchEnd))}},{key:"renderInput",value:(function(){var r=this.props,o=r.isDisabled,a=r.isSearchable,c=r.inputId,l=r.inputValue,u=r.tabIndex,d=r.form,p=r.menuIsOpen,f=r.required,h=this.getComponents(),m=h.Input,g=this.state,y=g.inputIsHidden,x=g.ariaSelection,v=this.commonProps,S=c||this.getElementId("input"),N=z(z(z({"aria-autocomplete":"list","aria-expanded":p,"aria-haspopup":!0,"aria-errormessage":this.props["aria-errormessage"],"aria-invalid":this.props["aria-invalid"],"aria-label":this.props["aria-label"],"aria-labelledby":this.props["aria-labelledby"],"aria-required":f,role:"combobox","aria-activedescendant":this.state.isAppleDevice?void 0:this.state.focusedOptionId||""},p&&{"aria-controls":this.getElementId("listbox")}),!a&&{"aria-readonly":!0}),this.hasValue()?x?.action==="initial-input-focus"&&{"aria-describedby":this.getElementId("live-region")}:{"aria-describedby":this.getElementId("placeholder")});return a?b.createElement(m,$({},v,{autoCapitalize:"none",autoComplete:"off",autoCorrect:"off",id:S,innerRef:this.getInputRef,isDisabled:o,isHidden:y,onBlur:this.onInputBlur,onChange:this.handleInputChange,onFocus:this.onInputFocus,spellCheck:"false",tabIndex:u,form:d,type:"text",value:l},N)):b.createElement(hm,$({id:S,innerRef:this.getInputRef,onBlur:this.onInputBlur,onChange:Jn,onFocus:this.onInputFocus,disabled:o,tabIndex:u,inputMode:"none",form:d,value:""},N))})},{key:"renderPlaceholderOrValue",value:function(){var r=this,o=this.getComponents(),a=o.MultiValue,c=o.MultiValueContainer,l=o.MultiValueLabel,u=o.MultiValueRemove,d=o.SingleValue,p=o.Placeholder,f=this.commonProps,h=this.props,m=h.controlShouldRenderValue,g=h.isDisabled,y=h.isMulti,x=h.inputValue,v=h.placeholder,S=this.state,N=S.selectValue,w=S.focusedValue,j=S.isFocused;if(!this.hasValue()||!m)return x?null:b.createElement(p,$({},f,{key:"placeholder",isDisabled:g,isFocused:j,innerProps:{id:this.getElementId("placeholder")}}),v);if(y)return N.map(function(P,E){var M=P===w,O="".concat(r.getOptionLabel(P),"-").concat(r.getOptionValue(P));return b.createElement(a,$({},f,{components:{Container:c,Label:l,Remove:u},isFocused:M,isDisabled:g,key:O,index:E,removeProps:{onClick:function(){return r.removeValue(P)},onTouchEnd:function(){return r.removeValue(P)},onMouseDown:function(D){D.preventDefault()}},data:P}),r.formatOptionLabel(P,"value"))});if(x)return null;var C=N[0];return b.createElement(d,$({},f,{data:C,isDisabled:g}),this.formatOptionLabel(C,"value"))}},{key:"renderClearIndicator",value:function(){var r=this.getComponents(),o=r.ClearIndicator,a=this.commonProps,c=this.props,l=c.isDisabled,u=c.isLoading,d=this.state.isFocused;if(!this.isClearable()||!o||l||!this.hasValue()||u)return null;var p={onMouseDown:this.onClearIndicatorMouseDown,onTouchEnd:this.onClearIndicatorTouchEnd,"aria-hidden":"true"};return b.createElement(o,$({},a,{innerProps:p,isFocused:d}))}},{key:"renderLoadingIndicator",value:function(){var r=this.getComponents(),o=r.LoadingIndicator,a=this.commonProps,c=this.props,l=c.isDisabled,u=c.isLoading,d=this.state.isFocused;if(!o||!u)return null;var p={"aria-hidden":"true"};return b.createElement(o,$({},a,{innerProps:p,isDisabled:l,isFocused:d}))}},{key:"renderIndicatorSeparator",value:function(){var r=this.getComponents(),o=r.DropdownIndicator,a=r.IndicatorSeparator;if(!o||!a)return null;var c=this.commonProps,l=this.props.isDisabled,u=this.state.isFocused;return b.createElement(a,$({},c,{isDisabled:l,isFocused:u}))}},{key:"renderDropdownIndicator",value:function(){var r=this.getComponents(),o=r.DropdownIndicator;if(!o)return null;var a=this.commonProps,c=this.props.isDisabled,l=this.state.isFocused,u={onMouseDown:this.onDropdownIndicatorMouseDown,onTouchEnd:this.onDropdownIndicatorTouchEnd,"aria-hidden":"true"};return b.createElement(o,$({},a,{innerProps:u,isDisabled:c,isFocused:l}))}},{key:"renderMenu",value:function(){var r=this,o=this.getComponents(),a=o.Group,c=o.GroupHeading,l=o.Menu,u=o.MenuList,d=o.MenuPortal,p=o.LoadingMessage,f=o.NoOptionsMessage,h=o.Option,m=this.commonProps,g=this.state.focusedOption,y=this.props,x=y.captureMenuScroll,v=y.inputValue,S=y.isLoading,N=y.loadingMessage,w=y.minMenuHeight,j=y.maxMenuHeight,C=y.menuIsOpen,P=y.menuPlacement,E=y.menuPosition,M=y.menuPortalTarget,O=y.menuShouldBlockScroll,T=y.menuShouldScrollIntoView,D=y.noOptionsMessage,F=y.onMenuScrollToTop,V=y.onMenuScrollToBottom;if(!C)return null;var B=function(R,H){var te=R.type,ne=R.data,G=R.isDisabled,oe=R.isSelected,Se=R.label,yn=R.value,vo=g===ne,wo=G?void 0:function(){return r.onOptionHover(ne)},ou=G?void 0:function(){return r.selectOption(ne)},Co="".concat(r.getElementId("option"),"-").concat(H),au={id:Co,onClick:ou,onMouseMove:wo,onMouseOver:wo,tabIndex:-1,role:"option","aria-selected":r.state.isAppleDevice?void 0:oe};return b.createElement(h,$({},m,{innerProps:au,data:ne,isDisabled:G,isSelected:oe,key:Co,label:Se,type:te,value:yn,isFocused:vo,innerRef:vo?r.getFocusedOptionRef:void 0}),r.formatOptionLabel(R.data,"menu"))},_;if(this.hasOptions())_=this.getCategorizedOptions().map(function(U){if(U.type==="group"){var R=U.data,H=U.options,te=U.index,ne="".concat(r.getElementId("group"),"-").concat(te),G="".concat(ne,"-heading");return b.createElement(a,$({},m,{key:ne,data:R,options:H,Heading:c,headingProps:{id:G,data:U.data},label:r.formatGroupLabel(U.data)}),U.options.map(function(oe){return B(oe,"".concat(te,"-").concat(oe.index))}))}else if(U.type==="option")return B(U,"".concat(U.index))});else if(S){var Y=N({inputValue:v});if(Y===null)return null;_=b.createElement(p,m,Y)}else{var W=D({inputValue:v});if(W===null)return null;_=b.createElement(f,m,W)}var ee={minMenuHeight:w,maxMenuHeight:j,menuPlacement:P,menuPosition:E,menuShouldScrollIntoView:T},re=b.createElement(Yp,$({},m,ee),function(U){var R=U.ref,H=U.placerProps,te=H.placement,ne=H.maxHeight;return b.createElement(l,$({},m,ee,{innerRef:R,innerProps:{onMouseDown:r.onMenuMouseDown,onMouseMove:r.onMenuMouseMove},isLoading:S,placement:te}),b.createElement(vm,{captureEnabled:x,onTopArrive:F,onBottomArrive:V,lockEnabled:O},function(G){return b.createElement(u,$({},m,{innerRef:function(Se){r.getMenuListRef(Se),G(Se)},innerProps:{role:"listbox","aria-multiselectable":m.isMulti,id:r.getElementId("listbox")},isLoading:S,maxHeight:ne,focusedOption:g}),_)}))});return M||E==="fixed"?b.createElement(d,$({},m,{appendTo:M,controlElement:this.controlRef,menuPlacement:P,menuPosition:E}),re):re}},{key:"renderFormField",value:function(){var r=this,o=this.props,a=o.delimiter,c=o.isDisabled,l=o.isMulti,u=o.name,d=o.required,p=this.state.selectValue;if(d&&!this.hasValue()&&!c)return b.createElement(Sm,{name:u,onFocus:this.onValueInputFocus});if(!(!u||c))if(l)if(a){var f=p.map(function(g){return r.getOptionValue(g)}).join(a);return b.createElement("input",{name:u,type:"hidden",value:f})}else{var h=p.length>0?p.map(function(g,y){return b.createElement("input",{key:"i-".concat(y),name:u,type:"hidden",value:r.getOptionValue(g)})}):b.createElement("input",{name:u,type:"hidden",value:""});return b.createElement("div",null,h)}else{var m=p[0]?this.getOptionValue(p[0]):"";return b.createElement("input",{name:u,type:"hidden",value:m})}}},{key:"renderLiveRegion",value:function(){var r=this.commonProps,o=this.state,a=o.ariaSelection,c=o.focusedOption,l=o.focusedValue,u=o.isFocused,d=o.selectValue,p=this.getFocusableOptions();return b.createElement(cm,$({},r,{id:this.getElementId("live-region"),ariaSelection:a,focusedOption:c,focusedValue:l,isFocused:u,selectValue:d,focusableOptions:p,isAppleDevice:this.state.isAppleDevice}))}},{key:"render",value:function(){var r=this.getComponents(),o=r.Control,a=r.IndicatorsContainer,c=r.SelectContainer,l=r.ValueContainer,u=this.props,d=u.className,p=u.id,f=u.isDisabled,h=u.menuIsOpen,m=this.state.isFocused,g=this.commonProps=this.getCommonProps();return b.createElement(c,$({},g,{className:d,innerProps:{id:p,onKeyDown:this.onKeyDown},isDisabled:f,isFocused:m}),this.renderLiveRegion(),b.createElement(o,$({},g,{innerRef:this.getControlRef,innerProps:{onMouseDown:this.onControlMouseDown,onTouchEnd:this.onControlTouchEnd},isDisabled:f,isFocused:m,menuIsOpen:h}),b.createElement(l,$({},g,{isDisabled:f}),this.renderPlaceholderOrValue(),this.renderInput()),b.createElement(a,$({},g,{isDisabled:f}),this.renderClearIndicator(),this.renderLoadingIndicator(),this.renderIndicatorSeparator(),this.renderDropdownIndicator())),this.renderMenu(),this.renderFormField())}}],[{key:"getDerivedStateFromProps",value:function(r,o){var a=o.prevProps,c=o.clearFocusValueOnUpdate,l=o.inputIsHiddenAfterUpdate,u=o.ariaSelection,d=o.isFocused,p=o.prevWasFocused,f=o.instancePrefix,h=r.options,m=r.value,g=r.menuIsOpen,y=r.inputValue,x=r.isMulti,v=_o(m),S={};if(a&&(m!==a.value||h!==a.options||g!==a.menuIsOpen||y!==a.inputValue)){var N=g?$m(r,v):[],w=g?oa($n(r,v),"".concat(f,"-option")):[],j=c?Vm(o,v):null,C=Bm(o,N),P=Dr(w,C);S={selectValue:v,focusedOption:C,focusedOptionId:P,focusableOptionsWithIds:w,focusedValue:j,clearFocusValueOnUpdate:!1}}var E=l!=null&&r!==a?{inputIsHidden:l,inputIsHiddenAfterUpdate:void 0}:{},M=u,O=d&&p;return d&&!O&&(M={value:Nn(x,v,v[0]||null),options:v,action:"initial-input-focus"},O=!p),u?.action==="initial-input-focus"&&(M=null),z(z(z({},S),E),{},{prevProps:r,ariaSelection:M,prevWasFocused:O})}}]),n})(b.Component);bc.defaultProps=zm;var Hm=b.forwardRef(function(e,t){var n=j0(e);return b.createElement(bc,$({ref:t},n))}),_m=Hm;function Wm(e){return i.jsx(gr.DropdownIndicator,{...e,children:i.jsx(I,{name:"ChevronDown",size:16})})}function Gm(e){return i.jsx(gr.ClearIndicator,{...e,children:i.jsx(I,{name:"Xmark",size:16})})}function Ym(e){const{label:t,onClick:n,...s}=e,r=!!t&&!!n;return i.jsxs(gr.MenuList,{...s,children:[e.children,r?i.jsx("button",{className:"w-full px-2 py-3 hover:bg-slate-50",onClick:n,children:t}):null]})}function a6(e){const t=e["aria-invalid"]==="true",{addItemButtonProps:n,...s}=e;return i.jsx(_m,{...s,components:{DropdownIndicator:Wm,ClearIndicator:Gm,MenuList:r=>Ym({...r,...n})},styles:{dropdownIndicator:()=>({label:"indicatorContainer",display:"flex",transition:"color 150ms",color:"var(color-gray-900)",padding:8,boxSizing:"border-box"}),clearIndicator:r=>({...r,color:"var(color-gray-900)"}),container:r=>({...r,borderColor:"var(color-gray-200)",fontSize:12}),placeholder:r=>({...r,color:t?"var(color-red-800)":"var(color-gray-500)"}),control:()=>({label:"control",alignItems:"center",cursor:"default",display:"flex",flexWrap:"wrap",justifyContent:"space-between",minHeight:32,outline:"0 !important",position:"relative",transition:"all 100ms",backgroundColor:"var(--color-white)",borderColor:t?"var(--color-red-900)":"var(--color-gray-200)",borderStyle:"solid",borderWidth:1,borderRadius:"6px",boxSizing:"border-box"}),option:(r,o)=>({...r,backgroundColor:o.isSelected?"var(--color-slate-50)":"var(--color-white)",color:"var(--color-gray-800)",":hover":{backgroundColor:"var(--color-slate-50)"}}),menuList:r=>({...r,padding:0,borderRadius:"6px"})},theme:r=>({...r,colors:{...r.colors,primary:"var(--color-slate-100)",primary25:"var(--color-slate-50)",primary50:"var(--color-slate-100)",primary75:"var(--color-slate-100)",danger:"var(--color-red-900)",dangerLight:"var(--color-red-100)",neutral0:"var(--color-white)",neutral5:"var(--color-gray-50)",neutral10:"var(--color-gray-100)",neutral20:"var(--color-gray-200)",neutral30:"var(--color-gray-300)",neutral40:"var(--color-gray-400)",neutral50:"var(--color-gray-500)",neutral60:"var(--color-gray-600)",neutral70:"var(--color-gray-700)",neutral80:"var(--color-gray-800)",neutral90:"var(--color-gray-900)"}})})}const i6=e=>{const{children:t,cookies:n,submitLabel:s,rejectLabel:r,onSubmit:o=()=>{},onReject:a=()=>{},...c}=e,[l,u]=b.useState(n),d=f=>{const{id:h,checked:m}=f.target;u(g=>g.map(y=>y.id===h?{...y,value:m}:y))},p="min-w-64 h-8 text-base";return i.jsxs("div",{...ce(c,"flex flex-col items-center"),children:[i.jsx("div",{className:"text-center",children:t}),i.jsx("div",{className:"my-8 flex gap-x-16 text-sm font-medium",children:l.map((f,h)=>i.jsxs("div",{className:"cursor-pointer",children:[i.jsx("input",{checked:f.value,className:"mr-1 size-3 cursor-pointer rounded-sm border-2 border-gray-900 accent-gray-900 focus:outline-none",id:f.id,onChange:d,type:"checkbox"}),i.jsx("label",{className:"cursor-pointer select-none",htmlFor:f.id,children:f.label})]},h))}),i.jsxs("div",{className:"flex gap-x-8",children:[i.jsx(Ce,{className:p,color:"light",onClick:()=>a(),size:"small",children:r},"button-reject"),i.jsx(Ce,{className:p,onClick:()=>o(l),size:"small",children:s},"button-submit")]})]})},ia="min-h-[48px] min-w-[142px] text-base font-semibold py-3 px-6 rounded-xl outline-none active:opacity-75 hover:scale-105 transform transition-all";function qs(e){const{body:t,header:n,children:s,onCancel:r,onOpenChange:o,onContinue:a,cancelLabel:c,continueLabel:l,overlayProps:u,contentProps:d,bodyProps:p={},headerProps:f={},containerProps:h={},cancelButtonProps:m={},continueButtonProps:g={},buttonContainerProps:y={},...x}=e;return i.jsx(Fe,{contentProps:{...d,className:k("rounded-3xl",d?.className)},onOpenChange:o,overlayProps:{...u,className:u?.className},...x,children:i.jsxs("div",{...ce(h,"w-[400px] p-6 text-slate-300"),children:[i.jsx("div",{...ce(f,"border-b border-slate-50 pb-2 text-2xl font-bold text-gray-800"),children:n}),i.jsxs("div",{...ce(p,"my-6 rounded-md bg-slate-50 p-4 text-center"),children:[t,s]}),i.jsxs("div",{...ce(y,"mt-8 flex justify-between gap-3"),children:[i.jsx("button",{onClick:r,...ce(m,k(ia,"flex-1 bg-slate-50 text-slate-800")),children:c}),i.jsx("button",{onClick:a,...ce(g,k(ia,"flex-1 bg-gray-800 text-gray-50")),children:l})]})]})})}const yc=16;function ca({label:e,depth:t,expanded:n,selected:s,hasChildren:r,icon:o,onToggle:a,onClick:c,children:l}){const u=d=>{d.stopPropagation(),a?.()};return i.jsxs("div",{children:[i.jsxs("div",{className:k("flex cursor-pointer items-center gap-1 py-1 pr-2 text-sm hover:bg-gray-100",s&&"bg-blue-50"),style:{paddingLeft:t*yc+4},onClick:c,children:[r?i.jsx("button",{className:"flex h-4 w-4 shrink-0 items-center justify-center text-gray-500 hover:text-gray-700",onClick:u,type:"button",children:i.jsx(I,{className:k("transition-transform",n&&"rotate-90"),name:"CaretRight",size:12})}):i.jsx("span",{className:"w-4 shrink-0"}),o&&i.jsx("span",{className:"shrink-0 text-gray-500",children:o}),i.jsx("span",{className:"min-w-0 flex-1 truncate text-gray-700",children:e}),s&&i.jsx("span",{className:"ml-auto h-2 w-2 shrink-0 rounded-full bg-blue-500"})]}),n&&l]})}function qm({column:e,depth:t}){const n=e.dataType.length>10?e.dataType.slice(0,10)+"…":e.dataType;return i.jsxs("div",{className:"flex items-center gap-1 py-0.5 pr-2 text-xs text-gray-500",style:{paddingLeft:t*yc+4},children:[i.jsx("span",{className:"w-4 shrink-0"}),i.jsx("span",{className:"truncate",children:e.name}),i.jsxs("span",{className:"ml-auto shrink-0 text-gray-400",children:["(",n,")"]})]})}function Jm({schema:e,tables:t,selectedTable:n,onSelectTable:s,onRefresh:r,loading:o}){const[a,c]=b.useState({[e]:!0}),l=f=>{c(h=>({...h,[f]:!h[f]}))},u=f=>{s(f),c(h=>({...h,[f]:!h[f]}))},d=a[e]??!1,p=f=>{f.stopPropagation(),r?.()};return i.jsx("div",{className:"flex flex-col overflow-auto pt-4 text-sm",children:i.jsx(ca,{depth:0,expanded:d,hasChildren:t.length>0,icon:i.jsx(I,{name:d?"FolderOpen":"FolderClose",size:16}),label:i.jsxs("div",{className:"flex flex-1 items-center",children:[i.jsx("span",{className:"truncate",children:e}),r&&i.jsx("button",{className:"ml-auto p-0.5 text-gray-400 hover:text-gray-600",onClick:p,type:"button",disabled:o,children:i.jsx(I,{name:"Reload",size:14,className:o?"animate-spin":void 0})})]}),onClick:()=>l(e),onToggle:()=>l(e),children:t.map(f=>{const h=a[f.name]??!1,m=n===f.name;return i.jsx(ca,{depth:1,expanded:h,hasChildren:f.columns.length>0,icon:i.jsx(I,{name:"TreeViewSlash",size:16}),label:f.name,selected:m,onClick:()=>u(f.name),onToggle:()=>l(f.name),children:f.columns.map(g=>i.jsx(qm,{column:g,depth:2},g.name))},f.name)})})})}function Qm(e){return b.forwardRef(e)}const ft=Qm(function(t,n){const{items:s,value:r,id:o,onChange:a,containerClassName:c,menuClassName:l,itemClassName:u,absolutePositionMenu:d=!1,borderRadius:p="6px"}=t,[f,h]=b.useState(!1),m=y(r)??s[0];function g(v){v.disabled||(a(v.value),h(!1))}function y(v){return s.find(S=>S.value===v)}const x=s.filter(v=>v.value!==r);return i.jsxs("div",{className:k("border border-gray-200 bg-gray-50 text-gray-800 transition-[border-radius]",d&&"relative",c),"data-open":f,ref:n,style:{borderRadius:p},children:[i.jsxs("div",{className:k("flex min-w-[360px] cursor-pointer items-center justify-between pr-3 text-gray-800 outline-none",l),id:o,onClick:()=>h(!f),children:[i.jsx(la,{...m,className:u}),i.jsx(I,{className:Fs("transition",f?"":"-rotate-90"),name:"ChevronDown"})]}),i.jsx("div",{className:k("max-h-0 w-full overflow-hidden bg-inherit transition-[max-height] ease-in-out",f&&"max-h-screen",d&&"absolute"),style:{borderRadius:`0 0 ${p} ${p}`},children:x.map(v=>i.jsx(la,{...v,className:u,onItemClick:()=>g(v)},v.value))})]})});function la(e){const{className:t,disabled:n,onItemClick:s,icon:r,displayValue:o,value:a,description:c}=e;return i.jsxs("div",{className:k(n?"cursor-not-allowed text-gray-500":"text-gray-800","flex size-full cursor-pointer items-center gap-2 bg-inherit py-3 pl-3 text-start outline-none",t),onClick:s,children:[r,i.jsxs("div",{children:[i.jsx("p",{className:"capitalize text-inherit",children:o??a.toLowerCase()}),i.jsx("p",{className:"text-xs text-gray-600",children:c})]})]})}function ua(e){const t=["=","!=",">","<",">=","<=","IS NULL","IS NOT NULL"],n=e.dataType.toLowerCase();return n.includes("varchar")||n.includes("text")||n.includes("char")?[...t,"LIKE","ILIKE"]:(n.includes("int")||n.includes("decimal")||n.includes("numeric")||n.includes("real")||n.includes("double")||n.includes("float")||n.includes("bigint")||n.includes("smallint"),t)}function Xm(e,t){if(t==="IS NULL"||t==="IS NOT NULL")return"text";const n=e.dataType.toLowerCase();return n.includes("int")||n.includes("decimal")||n.includes("numeric")||n.includes("real")||n.includes("double")||n.includes("float")||n.includes("bigint")||n.includes("smallint")?"number":n.includes("timestamp")||n.includes("date")||n.includes("time")?"datetime-local":"text"}function Km({clause:e,columns:t,onUpdate:n,onRemove:s,showConnector:r,connector:o,onConnectorChange:a}){const c=t.find(x=>x.name===e.column),l=c?ua(c):["=","!="],u=c?Xm(c,e.operator):"text",d=e.operator!=="IS NULL"&&e.operator!=="IS NOT NULL",p=b.useMemo(()=>t.map(x=>({value:x.name,displayValue:x.name})),[t]),f=b.useMemo(()=>l.map(x=>({value:x,displayValue:x})),[l]),h=b.useMemo(()=>[{value:"AND",displayValue:"AND"},{value:"OR",displayValue:"OR"}],[]),m=b.useCallback(x=>{const v=t.find(w=>w.name===x);if(!v)return;const S=ua(v),N=S.includes(e.operator)?e.operator:S[0];n({...e,column:x,operator:N,value:""})},[e,t,n]),g=b.useCallback(x=>{n({...e,operator:x,value:x==="IS NULL"||x==="IS NOT NULL"?"":e.value})},[e,n]),y=b.useCallback(x=>{n({...e,value:x})},[e,n]);return i.jsxs("div",{className:"flex items-center gap-2",children:[r&&i.jsx(ft,{absolutePositionMenu:!0,borderRadius:"4px",containerClassName:"min-w-[80px]",id:`connector-${e.id}`,items:h,itemClassName:"px-2 py-1 text-xs",menuClassName:"px-2 py-1 text-xs min-w-[80px]",value:o,onChange:a}),i.jsx(ft,{absolutePositionMenu:!0,borderRadius:"4px",containerClassName:"min-w-[150px]",id:`column-${e.id}`,items:p,itemClassName:"px-2 py-1 text-xs",menuClassName:"px-2 py-1 text-xs min-w-[150px]",value:e.column,onChange:m}),i.jsx(ft,{absolutePositionMenu:!0,borderRadius:"4px",containerClassName:"min-w-[100px]",id:`operator-${e.id}`,items:f,itemClassName:"px-2 py-1 text-xs",menuClassName:"px-2 py-1 text-xs min-w-[100px]",value:e.operator,onChange:g}),d&&i.jsx("input",{className:"min-w-[150px] rounded border border-gray-300 bg-white px-2 py-1 text-xs text-gray-900",type:u,value:e.value,onChange:x=>y(x.target.value)}),i.jsx("button",{className:"flex items-center justify-center rounded p-1 text-gray-500 hover:bg-gray-200 hover:text-gray-700",onClick:s,title:"Remove filter",type:"button",children:i.jsx(I,{name:"Xmark",size:14})})]})}function Zm({columns:e,filters:t,onFiltersChange:n}){const[s,r]=b.useState(!1),o=b.useCallback(()=>{const d={id:`filter-${Date.now()}-${Math.random()}`,column:e[0]?.name??"",operator:"=",value:""};n(t?{clauses:[...t.clauses,d],connectors:[...t.connectors,(t.clauses.length>0,"AND")]}:{clauses:[d],connectors:[]}),r(!0)},[e,t,n]),a=b.useCallback((d,p)=>{if(!t)return;const f=[...t.clauses];f[d]=p,n({...t,clauses:f})},[t,n]),c=b.useCallback(d=>{if(!t)return;const p=t.clauses.filter((h,m)=>m!==d),f=t.connectors.filter((h,m)=>m!==d-1);p.length===0?n(void 0):n({clauses:p,connectors:f})},[t,n]),l=b.useCallback((d,p)=>{if(!t)return;const f=[...t.connectors];f[d]=p,n({...t,connectors:f})},[t,n]),u=t&&t.clauses.length>0;return i.jsxs("div",{className:"flex shrink-0 flex-col gap-2 rounded-lg border border-gray-300 bg-white p-2",children:[i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsxs("button",{className:"flex items-center gap-1 text-xs text-gray-700 hover:text-gray-900",onClick:()=>r(!s),type:"button",children:[i.jsx(I,{className:k("transition-transform",s&&"rotate-90"),name:"ChevronDown",size:12}),i.jsx("span",{children:"Filters"}),u&&i.jsx("span",{className:"rounded bg-blue-100 px-1.5 py-0.5 text-xs text-blue-700",children:t.clauses.length})]}),i.jsxs("button",{className:"flex items-center gap-1 rounded border border-gray-300 bg-white px-2 py-1 text-xs text-gray-700 hover:bg-gray-100",onClick:o,type:"button",children:[i.jsx(I,{name:"Plus",size:12}),"Add Filter"]})]}),s&&u&&i.jsx("div",{className:"flex flex-col gap-2",children:t.clauses.map((d,p)=>i.jsx(Km,{clause:d,columns:e,connector:p>0?t.connectors[p-1]??"AND":"AND",onConnectorChange:f=>l(p-1,f),onRemove:()=>c(p),onUpdate:f=>a(p,f),showConnector:p>0},d.id))})]})}function is(e){return e===null?"NULL":e===void 0?"":typeof e=="object"?JSON.stringify(e):typeof e=="function"?"[function]":typeof e=="symbol"?e.toString():String(e)}function xc(e){return e.includes(",")||e.includes(`
7
- `)||e.includes('"')?`"${e.replace(/"/g,'""')}"`:e}function vc(e,t){return t.map(n=>{const s=is(e[n.name]);return xc(s)}).join(",")}function wc(e,t){const n=t.map(r=>xc(r.name)).join(","),s=e.map(r=>vc(r,t));return[n,...s].join(`
8
- `)}async function da(e){await navigator.clipboard.writeText(e)}function eg({direction:e,active:t}){return t?i.jsx(I,{className:e==="asc"?"rotate-180":void 0,name:"TriangleDown",size:12}):i.jsx(I,{className:"opacity-0 group-hover:opacity-50",name:"CaretSort",size:12})}function tg({columns:e,rows:t,pagination:n,onPageChange:s,onSort:r,currentSort:o,loading:a=!1,filters:c,onFiltersChange:l,onCopyAll:u}){const{offset:d,limit:p,total:f}=n,h=Math.floor(d/p),m=f!==null?Math.ceil(f/p):0,g=f===0?0:d+1,y=f!==null?Math.min(d+p,f):d+t.length,x=O=>{s(O*p)},v=O=>{if(!r)return;const T=o?.column===O&&o.direction==="asc"?"desc":"asc";r({column:O,direction:T})},N=(()=>{if(m<=3)return Array.from({length:m},(V,B)=>B);const T=Math.max(0,Math.min(h-1,m-3)),D=Math.min(m-1,T+3-1),F=[];for(let V=T;V<=D;V++)F.push(V);return F})(),[w,j]=b.useState(!1),[C,P]=b.useState(null),E=async()=>{if(t.length!==0){j(!0);try{const O=u?await u():wc(t,e);await da(O),setTimeout(()=>j(!1),1e3)}catch(O){console.error("Failed to copy to clipboard:",O),j(!1)}}},M=async O=>{if(!(O<0||O>=t.length)){P(O);try{const T=vc(t[O],e);await da(T),setTimeout(()=>P(null),1e3)}catch(T){console.error("Failed to copy to clipboard:",T),P(null)}}};return i.jsxs("div",{className:"flex h-full flex-col gap-2",children:[l&&i.jsx(Zm,{columns:e,filters:c,onFiltersChange:l}),i.jsxs("div",{className:"flex shrink-0 items-center justify-between text-sm",children:[i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx("span",{className:"text-gray-600",children:a?"Loading...":f!==null?`Showing ${g.toLocaleString()}-${y.toLocaleString()} of ${f.toLocaleString()}`:`Showing ${t.length.toLocaleString()} rows`}),t.length>0&&i.jsxs("button",{className:"flex items-center gap-1 rounded border border-gray-300 bg-white px-2 py-1 text-xs text-gray-700 hover:bg-gray-100 disabled:cursor-not-allowed disabled:opacity-50",disabled:a||w,onClick:E,title:"Copy all rows as CSV",type:"button",children:[i.jsx(I,{name:w?"Check":"Copy",size:14}),w?"Copied!":"Copy All"]})]}),f!==null&&f>p&&i.jsxs("div",{className:"flex gap-1",children:[i.jsx("button",{className:"rounded border border-gray-300 bg-white px-2 py-1 text-xs text-gray-700 hover:bg-gray-100 disabled:cursor-not-allowed disabled:opacity-50",disabled:h===0,onClick:()=>x(0),type:"button",children:"First"}),i.jsx("button",{className:"rounded border border-gray-300 bg-white px-2 py-1 text-xs text-gray-700 hover:bg-gray-100 disabled:cursor-not-allowed disabled:opacity-50",disabled:h===0,onClick:()=>x(h-1),type:"button",children:i.jsx(I,{className:"rotate-90",name:"ChevronDown",size:14})}),N[0]>0&&i.jsx("span",{className:"flex items-center px-1 text-xs text-gray-500",children:"..."}),N.map(O=>i.jsx("button",{className:k("min-w-8 rounded border px-2 py-1 text-xs",O===h?"border-blue-500 bg-blue-50 text-blue-700":"border-gray-300 bg-white text-gray-700 hover:bg-gray-100"),onClick:()=>x(O),type:"button",children:O+1},O)),N[N.length-1]<m-1&&i.jsx("span",{className:"flex items-center px-1 text-xs text-gray-500",children:"..."}),i.jsx("button",{className:"rounded border border-gray-300 bg-white px-2 py-1 text-xs text-gray-700 hover:bg-gray-100 disabled:cursor-not-allowed disabled:opacity-50",disabled:h>=m-1,onClick:()=>x(h+1),type:"button",children:i.jsx(I,{className:"-rotate-90",name:"ChevronDown",size:14})}),i.jsx("button",{className:"rounded border border-gray-300 bg-white px-2 py-1 text-xs text-gray-700 hover:bg-gray-100 disabled:cursor-not-allowed disabled:opacity-50",disabled:h>=m-1,onClick:()=>x(m-1),type:"button",children:"Last"})]})]}),i.jsx("div",{className:k("max-h-full overflow-auto rounded-lg border border-gray-300 transition-opacity",a&&"pointer-events-none opacity-50"),children:i.jsxs("table",{className:"w-full border-collapse",children:[i.jsx("thead",{className:"sticky top-0 bg-gray-100",children:i.jsxs("tr",{children:[i.jsx("th",{className:"w-12 px-2 py-2 text-center text-xs font-medium text-gray-600",children:i.jsx("span",{className:"sr-only",children:"Copy"})}),e.map((O,T)=>{const D=o?.column===O.name,F=D?o.direction:"asc";return i.jsx("th",{className:k("group px-3 py-2 text-left text-xs font-medium text-gray-600",T>0&&"border-l border-gray-300",r&&"cursor-pointer hover:bg-gray-200 hover:text-gray-900"),onClick:()=>r&&v(O.name),children:i.jsxs("div",{className:"flex items-center gap-1",children:[i.jsx("span",{className:"truncate",children:O.name}),r&&i.jsx(eg,{active:D,direction:F})]})},O.name)})]})}),i.jsx("tbody",{children:t.length===0?i.jsx("tr",{children:i.jsx("td",{className:"px-3 py-8 text-center text-sm text-gray-500",colSpan:e.length+1,children:"No data"})}):t.map((O,T)=>i.jsxs("tr",{className:"odd:bg-white even:bg-gray-50 hover:bg-blue-50",children:[i.jsx("td",{className:"px-2 py-2 text-center",children:i.jsx("button",{className:"flex items-center justify-center rounded p-1 text-gray-500 hover:bg-gray-200 hover:text-gray-700",onClick:()=>void M(T),title:"Copy row as CSV",type:"button",children:i.jsx(I,{name:C===T?"Check":"Copy",size:14})})}),e.map((D,F)=>i.jsx("td",{className:k("px-3 py-2 text-xs text-gray-900",F>0&&"border-l border-gray-300"),children:i.jsx("span",{className:k("block truncate",O[D.name]===null&&"italic text-gray-400"),title:is(O[D.name]),children:is(O[D.name])})},D.name))]},T))})]})})]})}const ng=50;function rg({schema:e,getTables:t,getTableRows:n,getDefaultSort:s,pageSize:r=ng,onImportDb:o,onExportDb:a}){const c=b.useRef(null),[l,u]=b.useState([]),[d,p]=b.useState(!0),[f,h]=b.useState(),[m,g]=b.useState(null),[y,x]=b.useState({offset:0,limit:r,total:null}),[v,S]=b.useState(),[N,w]=b.useState(),[j,C]=b.useState(!1),[P,E]=b.useState(null),M=l.find(R=>R.name===f)?.columns??[],O=b.useCallback(async()=>{if(!f)return;C(!0);const R=await n(f,{schema:e,limit:y.limit,offset:y.offset,sort:v,filters:N});g(R),x(H=>({...H,total:R.total})),C(!1)},[f,e,y.limit,y.offset,v,N,n]),T=b.useCallback(async()=>{if(!f)return"";const R=y.total??1e6,H=await n(f,{schema:e,limit:R,offset:0,sort:v,filters:N});return wc(H.rows,M)},[f,e,y.total,v,N,n,M]),D=b.useCallback(async()=>{p(!0);const R=await t();return u(R),p(!1),R},[t]),F=b.useCallback(async()=>{const R=await D();if(f&&!R.some(H=>H.name===f)){h(void 0),g(null);return}f&&await O()},[D,f,O]);b.useEffect(()=>{D()},[D]),b.useEffect(()=>{f&&O()},[f,y.offset,v,N,O]);const V=R=>{R!==f&&(h(R),x(H=>({...H,offset:0,total:null})),S(s?.(R)),w(void 0),g(null))},B=R=>{x(H=>({...H,offset:R}))},_=R=>{S(R),x(H=>({...H,offset:0}))},Y=()=>{c.current?.click()},W=R=>{const H=R.target.files?.[0];H&&(H.text().then(te=>{E(te)}),R.target.value="")},ee=async()=>{P&&(h(void 0),g(null),await o?.(P),E(null),await D())},re=()=>{E(null)},U=()=>{a?.()};return i.jsxs("div",{className:"flex h-full",children:[i.jsx("input",{ref:c,type:"file",accept:".sql,.txt,text/plain",className:"hidden",onChange:W}),i.jsx(qs,{open:!!P,onOpenChange:R=>!R&&E(null),header:"Replace Database?",body:"This will delete all existing data and replace it with the imported file. This action cannot be undone.",cancelLabel:"Cancel",continueLabel:"Replace Data",onCancel:re,onContinue:()=>void ee(),continueButtonProps:{className:"bg-red-900 text-white hover:bg-red-800"}}),i.jsxs("div",{className:"flex w-64 shrink-0 flex-col border-r border-gray-200",children:[i.jsx("div",{className:"flex-1 overflow-auto",children:i.jsx(Jm,{schema:e,tables:l,selectedTable:f,onSelectTable:V,onRefresh:F,loading:d||j})}),(o||a)&&i.jsxs("div",{className:"flex shrink-0 flex-col gap-2 border-t border-gray-200 p-2",children:[o&&i.jsx("button",{className:"rounded border border-gray-300 bg-white px-3 py-1.5 text-sm text-gray-700 hover:bg-gray-100",onClick:Y,type:"button",children:"Import DB"}),a&&i.jsx("button",{className:"rounded border border-gray-300 bg-white px-3 py-1.5 text-sm text-gray-700 hover:bg-gray-100",onClick:U,type:"button",children:"Export DB"})]})]}),i.jsx("div",{className:"flex-1 overflow-auto p-4",children:f?!m&&j?i.jsx("div",{className:"text-sm text-gray-500",children:"Loading..."}):m?i.jsx(tg,{columns:M,rows:m.rows,pagination:y,onPageChange:B,onSort:_,currentSort:v,loading:j,filters:N,onFiltersChange:R=>{w(R),x(H=>({...H,offset:0}))},onCopyAll:T}):null:i.jsx("div",{className:"text-sm text-gray-500",children:"Select a table to view data"})})]})}function c6(e){const{message:t="Loading editor",...n}=e;return i.jsx("div",{className:"grid h-full place-items-center",...n,children:i.jsxs("div",{className:"-mt-20 grid place-items-center",children:[i.jsx("h3",{className:"mb-4 text-xl",children:t}),i.jsx(b0,{})]})})}function Kn(e){const{title:t,isOpen:n,onOpenChange:s,children:r,containerClassName:o,toggleClassName:a,contentClassName:c}=e;return i.jsxs("div",{className:k(o),children:[i.jsxs("div",{className:k("flex cursor-pointer justify-between text-gray-500",a),onClick:s,children:[i.jsx("h2",{className:"font-semibold text-inherit",children:t}),i.jsx(I,{className:Fs("transition",n?"":"-rotate-90"),size:16,name:"ChevronDown"})]}),i.jsx("div",{className:k("max-h-0 overflow-hidden transition-[max-height] duration-300 ease-in-out",n&&"max-h-screen",c),children:r})]})}function lt(e){return i.jsx("div",{...e,className:k("h-px bg-gray-200",e.className)})}function At(e){const{label:t,children:n}=e;return i.jsx("div",{className:"h-full",children:n})}var br="Tabs",[sg]=ci(br,[fi]),Cc=fi(),[og,Js]=sg(br),Sc=b.forwardRef((e,t)=>{const{__scopeTabs:n,value:s,onValueChange:r,defaultValue:o,orientation:a="horizontal",dir:c,activationMode:l="automatic",...u}=e,d=Lu(c),[p,f]=di({prop:s,onChange:r,defaultProp:o??"",caller:br});return i.jsx(og,{scope:n,baseId:ui(),value:p,onValueChange:f,orientation:a,dir:d,activationMode:l,children:i.jsx(vt.div,{dir:d,"data-orientation":a,...u,ref:t})})});Sc.displayName=br;var jc="TabsList",Nc=b.forwardRef((e,t)=>{const{__scopeTabs:n,loop:s=!0,...r}=e,o=Js(jc,n),a=Cc(n);return i.jsx(Fu,{asChild:!0,...a,orientation:o.orientation,dir:o.dir,loop:s,children:i.jsx(vt.div,{role:"tablist","aria-orientation":o.orientation,...r,ref:t})})});Nc.displayName=jc;var Pc="TabsTrigger",Ec=b.forwardRef((e,t)=>{const{__scopeTabs:n,value:s,disabled:r=!1,...o}=e,a=Js(Pc,n),c=Cc(n),l=kc(a.baseId,s),u=Mc(a.baseId,s),d=s===a.value;return i.jsx(zu,{asChild:!0,...c,focusable:!r,active:d,children:i.jsx(vt.button,{type:"button",role:"tab","aria-selected":d,"aria-controls":u,"data-state":d?"active":"inactive","data-disabled":r?"":void 0,disabled:r,id:l,...o,ref:t,onMouseDown:Te(e.onMouseDown,p=>{!r&&p.button===0&&p.ctrlKey===!1?a.onValueChange(s):p.preventDefault()}),onKeyDown:Te(e.onKeyDown,p=>{[" ","Enter"].includes(p.key)&&a.onValueChange(s)}),onFocus:Te(e.onFocus,()=>{const p=a.activationMode!=="manual";!d&&!r&&p&&a.onValueChange(s)})})})});Ec.displayName=Pc;var Ic="TabsContent",Oc=b.forwardRef((e,t)=>{const{__scopeTabs:n,value:s,forceMount:r,children:o,...a}=e,c=Js(Ic,n),l=kc(c.baseId,s),u=Mc(c.baseId,s),d=s===c.value,p=b.useRef(d);return b.useEffect(()=>{const f=requestAnimationFrame(()=>p.current=!1);return()=>cancelAnimationFrame(f)},[]),i.jsx(Ls,{present:r||d,children:({present:f})=>i.jsx(vt.div,{"data-state":d?"active":"inactive","data-orientation":c.orientation,role:"tabpanel","aria-labelledby":l,hidden:!f,id:u,tabIndex:0,...a,ref:t,style:{...e.style,animationDuration:p.current?"0s":void 0},children:f&&o})})});Oc.displayName=Ic;function kc(e,t){return`${e}-trigger-${t}`}function Mc(e,t){return`${e}-content-${t}`}var ag=Sc,ig=Nc,cg=Ec,lg=Oc;function Tc({children:e,defaultValue:t}){return i.jsxs(ag,{defaultValue:t,className:"flex min-h-0 flex-1 flex-col gap-2",children:[i.jsx("div",{className:"flex w-full shrink-0 justify-between",children:i.jsx(ig,{className:"flex w-full gap-x-2 rounded-xl bg-slate-50 p-1 text-sm font-semibold text-gray-600 outline-none",children:Q.Children.map(e,(n,s)=>{if(!Q.isValidElement(n))return;const{label:r,disabled:o}=n.props;return i.jsx(cg,{className:"data-[state='active']:tab-shadow ata-disabled:cursor-not-allowed data-disabled:text-gray-400 flex h-7 flex-1 items-center justify-center rounded-lg transition duration-300 data-[state='active']:bg-gray-50 data-[state='active']:text-gray-900",value:r,disabled:o??!1,children:r},r)})})}),i.jsx("div",{className:"mt-3 min-h-0 flex-1 rounded-md bg-white",children:Q.Children.map(e,(n,s)=>{if(!Q.isValidElement(n))return;const{label:r}=n.props;return i.jsx(lg,{className:"h-full",value:r,children:n},s)})})]})}function $e(e){const{children:t,content:n,open:s,defaultOpen:r,onOpenChange:o,className:a,side:c="top",sideOffset:l=5,delayDuration:u,...d}=e;return i.jsxs(Ed,{defaultOpen:r,delayDuration:u,onOpenChange:o,open:s,children:[i.jsx(Id,{asChild:!0,children:t}),i.jsx(Od,{children:i.jsx(kd,{...d,side:c,sideOffset:l,className:k("shadow-tooltip rounded-lg border border-gray-200 bg-white p-2 text-xs",a),children:n})})]})}const Ac=Pd,ug=e=>{const{className:t,timestampUtcMs:n,title:s,subtitle:r,onClick:o,isSelected:a=!1}=e,[c,l]=b.useState(!1),u=!!s||!!r||!!n;b.useEffect(()=>{c&&(l(!1),setTimeout(()=>u&&l(!0),50))},[s,r,n,u]);const d=m=>{if(!m)return"";try{return Gf(new Date(m),{addSuffix:!0})}catch{return m}},p=i.jsxs("div",{className:"flex flex-col text-xs",children:[!!s&&i.jsx("div",{children:s}),!!r&&i.jsx("div",{className:"text-gray-300",children:r}),!!n&&i.jsx("div",{children:d(n)})]}),f=()=>{u&&l(!0)},h=()=>{l(!1)};return i.jsxs("div",{className:"relative",onMouseEnter:f,onMouseLeave:h,children:[a&&i.jsx(I,{name:"TimelineCaret",color:"#4EA9FF",size:10,className:"absolute top-[-11px] z-40"}),i.jsx($e,{className:"rounded-md bg-gray-900 text-white",content:p,open:c&&u,onOpenChange:l,delayDuration:0,side:"bottom",sideOffset:5,children:i.jsx("div",{className:k("mx-0.5 flex h-[25px] w-1.5 cursor-pointer flex-col items-center justify-center rounded-[2px] hover:bg-blue-300",a&&"bg-blue-300",t),onClick:o,"data-title":s,"data-subtitle":r,"data-timestamp":n,children:i.jsx("div",{className:"h-0.5 w-1 rounded-full bg-gray-500"})})})]})},fa=(e=0)=>{switch(!0){case e<=0:return"h-[1px]";case e===1:return"h-[3px]";case e===2:return"h-[6px]";case e===3:return"h-[9px]";case e>=4:return"h-[12px]";default:return"h-[1px]"}},dg=e=>{if(!e)return"";try{const t=Yf(e);return Gn(t,"HH:mm, dd, MMMM")}catch{return e}},fg=({onClick:e,className:t,timestampUtcMs:n,additions:s,deletions:r,addSize:o=0,delSize:a=0,isSelected:c=!1})=>{const[l,u]=b.useState(!1),d=o===0&&a===0,p=fa(o),f=fa(a),h=i.jsxs("div",{className:"flex flex-col text-xs",children:[i.jsx("div",{children:dg(n)}),i.jsx("div",{className:"text-green-900",children:`${s} additions +`}),i.jsx("div",{className:"text-red-700",children:`${r} deletions -`})]}),m=()=>{d||u(!0)},g=()=>{u(!1)};return i.jsxs("div",{className:"relative",onMouseEnter:m,onMouseLeave:g,children:[c&&i.jsx(I,{name:"TimelineCaret",color:"#4EA9FF",size:10,className:"absolute left-[-2px] top-[-11px] z-40"}),d?i.jsx("div",{className:k("flex h-[25px] w-1.5 cursor-pointer flex-col items-center justify-center rounded-[2px] hover:bg-blue-300",t),"data-timestamp":n,onClick:e,children:i.jsx("div",{className:"size-[3px] rounded-full bg-gray-500"})}):i.jsx($e,{className:"rounded-md bg-gray-900 text-white",content:h,open:l,onOpenChange:u,delayDuration:0,side:"bottom",sideOffset:5,children:i.jsxs("div",{className:k("flex h-[25px] w-1.5 cursor-pointer flex-col items-center justify-center rounded-[2px] hover:bg-blue-300",t,c&&"bg-blue-300"),"data-timestamp":n,onClick:e,children:[i.jsx("div",{className:"flex h-3 w-0.5 items-end",children:i.jsx("div",{className:k("h-3 w-0.5 rounded-t-full bg-green-600",p)})}),i.jsx("div",{className:"flex h-3 w-0.5 items-start",children:i.jsx("div",{className:k("h-3 w-0.5 rounded-b-full bg-red-600",f)})})]})})]})},pa={id:"default",type:"bar",addSize:0,delSize:0},pg=e=>{const{timeline:t=[],onItemClick:n}=e,[s,r]=b.useState(null),o=b.useRef(null),a=h=>{h.id===s||h.id===pa.id?(n?.(null),r(null)):(n?.(h),r(h.id))},c=[...t,pa],[l,u]=b.useMemo(()=>{const h=c.findIndex(m=>m.id===s);return h===-1?[c,[]]:[c.slice(0,h),c.slice(h)]},[c,s]),d=b.useCallback(h=>h.map(m=>{if(m.type==="divider"){const{timestampUtcMs:g,title:y,subtitle:x}=m;return i.jsx(ug,{timestampUtcMs:g,title:y,subtitle:x,onClick:()=>a(m),isSelected:m.id===s},m.id)}return i.jsx(fg,{timestampUtcMs:m.timestampUtcMs,addSize:m.addSize,delSize:m.delSize,additions:m.additions,deletions:m.deletions,isSelected:m.id===s,onClick:()=>a(m)},m.id)}),[a,s]),p=b.useMemo(()=>d(l),[l,d]),f=b.useMemo(()=>d(u),[u,d]);return b.useEffect(()=>{o.current&&(o.current.scrollLeft=o.current.scrollWidth)},[]),i.jsx(Ac,{delayDuration:0,skipDelayDuration:0,children:i.jsxs("div",{className:"relative h-[36px] w-full",children:[i.jsx("div",{className:"absolute left-[0px] z-[20] h-[17px] w-[6px] bg-white",children:i.jsx("div",{className:"mt-[11px] h-[6px] w-[6px] rounded-tl-md bg-slate-50"})}),i.jsx("div",{className:"absolute right-[0px] top-[11px] z-[20] h-[6px] w-[6px] bg-white",children:i.jsx("div",{className:"h-[6px] w-[6px] rounded-tr-md bg-slate-50"})}),i.jsx("div",{className:"absolute inset-x-0 bottom-0 h-[25px] rounded-md bg-slate-50"}),i.jsx("div",{className:"absolute inset-x-0 bottom-0 h-[36px]",children:i.jsx("div",{ref:o,className:"h-full overflow-x-auto rounded-md",children:i.jsxs("div",{className:"ml-auto flex h-[36px] w-max items-end px-2 pb-0",children:[i.jsx("div",{className:"flex",children:p}),i.jsx("div",{className:"flex rounded-sm bg-blue-200",children:f})]})})}),i.jsx("div",{className:"pointer-events-none absolute bottom-0 left-0 z-10 h-[25px] w-2 rounded-l-md bg-slate-50"}),i.jsx("div",{className:"pointer-events-none absolute bottom-0 right-0 z-10 h-[25px] w-2 rounded-r-md bg-slate-50"})]})})};function hg(e){const[t,n]=uu(e),s=t?.header.revision.global??0,r=t?.header.revision.local??0,o=s>0||r>0,a=!!t?.clipboard.length;return{undo:()=>{n(Qu())},redo:()=>{n(Ju())},canUndo:o,canRedo:a}}function mg(e){return[]}const l6=e=>{const{onClose:t,children:n,onExport:s,className:r,document:o,onSwitchboardLinkClick:a,enabledControls:c=["undo","redo","export","history"],defaultTimelineVisible:l=!0,disableRevisionHistory:u=!1,initialTimelineVisible:d=!1,...p}=e,[f]=du(),h=o??f,{onRenameNode:m,onRenameDriveNodes:g}=ar(),y=h?.header.name||void 0,[x,v]=b.useState(!1),S=fu(h?.header.id),N=t??(()=>ht(S)),w=async W=>{W&&(s?s(W):await gu(W))},j=hg(h?.header.id),C=!j.canUndo,P=!j.canRedo,E=mg(h?.header.id),[M,O]=b.useState(d),T=pu(h),F=a??(T?async()=>{if(T)try{const W=await T();window.open(W,"_blank")}catch(W){console.error("Error opening switchboard link:",W)}}:void 0),V=!h,B=!F,_=E.length===0;b.useEffect(()=>{typeof d=="boolean"&&O(d)},[d]);const Y=()=>{_||O(!M)};return i.jsxs("div",{className:"flex w-full flex-col",...p,children:[i.jsxs("div",{className:k("flex h-12 w-full items-center justify-between rounded-xl border border-gray-200 bg-slate-50 px-4",r),children:[i.jsxs("div",{className:"flex items-center gap-x-2",children:[c.includes("undo")&&i.jsx("button",{className:k("grid size-8 place-items-center rounded-lg border border-gray-200 bg-white",C?"cursor-not-allowed":"cursor-pointer active:opacity-70"),onClick:j.undo,disabled:C,children:i.jsx(I,{name:"ArrowCouterclockwise",size:16,className:C?"text-gray-500":"text-gray-900"})}),c.includes("redo")&&i.jsx("button",{className:k("grid size-8 place-items-center rounded-lg border border-gray-200 bg-white",P?"cursor-not-allowed":"cursor-pointer active:opacity-70"),onClick:j.redo,disabled:P,children:i.jsx("div",{className:"-scale-x-100",children:i.jsx(I,{name:"ArrowCouterclockwise",size:16,className:P?"text-gray-500":"text-gray-900"})})}),c.includes("export")&&i.jsx("button",{className:k("flex h-8 items-center rounded-lg border border-gray-200 bg-white px-3 text-sm",V?"cursor-not-allowed":"cursor-pointer active:opacity-70"),onClick:()=>void w(h),disabled:V,children:i.jsx("span",{className:V?"text-gray-500":"text-gray-900",children:"Export"})})]}),i.jsx("div",{className:"flex items-center",children:x&&h?i.jsx(dr,{defaultValue:y,className:"text-center text-sm font-medium text-gray-500","aria-label":"Document name",onCancel:()=>v(!1),onSubmit:W=>{const ee={id:h.header.id};Promise.all([m(W,ee),g(W,h.header.id)]).then(()=>v(!1)).catch(re=>{console.error("Failed to rename document:",re),v(!1)})}}):i.jsx("h1",{className:k("text-sm font-medium text-gray-500",h&&"cursor-pointer hover:text-gray-700"),onDoubleClick:h?()=>v(!0):void 0,title:h?"Double-click to edit":void 0,children:y})}),i.jsxs("div",{className:"flex items-center gap-x-2",children:[!B&&i.jsx("button",{className:k("grid size-8 place-items-center rounded-lg border border-gray-200 bg-white","cursor-pointer active:opacity-70"),onClick:F,disabled:B,children:i.jsx(I,{name:"Drive",size:16,className:"text-gray-900"})}),c.includes("history")&&i.jsx("button",{className:k("grid size-8 place-items-center rounded-lg border border-gray-200 bg-white",u?"cursor-not-allowed":"cursor-pointer active:opacity-70"),onClick:hu,disabled:u,children:i.jsx(I,{name:"History",size:16,className:u?"text-gray-500":"text-gray-900"})}),c.includes("timeline")&&l&&i.jsx("button",{className:k("grid size-8 place-items-center rounded-lg border border-gray-200 bg-white",_?"cursor-not-allowed":"cursor-pointer active:opacity-70"),onClick:Y,disabled:_,"aria-pressed":M,children:i.jsx(I,{name:"Timeline",size:16,className:k("text-gray-900",_&&"opacity-50",M&&"text-blue-600")})}),i.jsx("button",{id:"close-document-button","aria-label":"Close document",className:"grid size-8 cursor-pointer place-items-center rounded-lg border border-gray-200 bg-white active:opacity-70",onClick:N,children:i.jsx(I,{name:"XmarkLight",size:16,className:"text-gray-900"})})]})]}),M&&i.jsx("div",{className:"mt-2 w-full",children:i.jsx(pg,{timeline:E,onItemClick:mu})}),n]})};function Dc(e){const{target:t,onAddFileOverride:n,trackNestedDrag:s=!1,acceptedFileExtensions:r}=e??{},[o,a]=b.useState(!1),c=b.useRef(0),{onMoveNode:l,onCopyNode:u,onAddFile:d}=ar(),p=n??d,f=b.useCallback(v=>{if(!r||r.length===0||v.types.includes("UI_NODE"))return!0;if(v.types.includes("Files")){const S=Array.from(v.items);return S.length===0?!0:S.some(N=>{if(N.kind==="file"){if(N.type==="application/zip"||N.type==="application/x-zip-compressed")return r.includes(".zip");if(N.type===""||N.type==="application/octet-stream")return!0}return!1})}return!1},[r]),h=b.useCallback(v=>{v.preventDefault(),v.stopPropagation(),f(v.dataTransfer)?a(!0):v.dataTransfer.dropEffect="none"},[f]),m=b.useCallback(v=>{v.preventDefault(),v.stopPropagation(),f(v.dataTransfer)&&(c.current+=1,a(!0))},[f]),g=b.useCallback(v=>{v.preventDefault(),v.stopPropagation(),c.current=Math.max(0,c.current-1),c.current===0&&a(!1)},[]),y=b.useCallback(()=>{a(!1)},[]),x=b.useCallback(async v=>{v.preventDefault();const N=v.target.closest("[data-drop-zone]"),w=t?.id||"root";if((N?.getAttribute("data-drop-zone")||"root")!==w){a(!1);return}try{let C=gg(v.dataTransfer.items).filter(Boolean);if(r&&r.length>0&&(C=C.filter(O=>{if(!O)return!1;const T=O.name.toLowerCase();return r.some(D=>T.endsWith(D.toLowerCase()))})),C.length){for(const O of C)O&&await p(O,t);return}const P=v.getModifierState("Alt"),E=v.dataTransfer.getData("UI_NODE"),M=JSON.parse(E);P?await u(M,t):await l(M,t)}catch(C){console.error(C)}finally{s&&(c.current=0),a(!1)}},[p,u,l,t,s]);return b.useMemo(()=>{const v={onDragOver:h,onDrop:x,"data-drop-zone":t?.id||"root"};return s?(v.onDragEnter=m,v.onDragLeave=g):v.onDragLeave=y,{isDropTarget:o,dropProps:v}},[o,t?.id,m,g,y,h,x,s])}function gg(e){return Array.from(e).map(n=>n.kind==="file"?n.getAsFile():null).filter(Boolean)}const ha="min-h-[48px] min-w-[142px] text-base font-semibold py-3 px-6 rounded-xl outline-none active:opacity-75 hover:scale-105 transform transition-all";function bg(e){const{title:t="Document Already Exists",fileName:n,message:s,children:r,onReplace:o,onOpenChange:a,onDuplicate:c,replaceLabel:l="Replace",duplicateLabel:u="Create Copy",overlayProps:d,contentProps:p,bodyProps:f={},headerProps:h={},containerProps:m={},replaceButtonProps:g={},duplicateButtonProps:y={},buttonContainerProps:x={},...v}=e,S=n?`A document named "${n}" already exists in this location. Would you like to replace it or create a copy?`:"A document with the same name already exists in this location. Would you like to replace it or create a copy?";return i.jsx(Fe,{contentProps:{...p,className:k("rounded-3xl",p?.className)},onOpenChange:a,overlayProps:{...d,className:d?.className},...v,children:i.jsxs("div",{...ce(m,"w-[450px] p-6 text-slate-300"),children:[i.jsxs("div",{className:"flex items-center justify-between border-b border-slate-50 pb-2",children:[i.jsx("div",{...ce(h,"text-2xl font-bold text-gray-800"),children:t}),i.jsx("button",{type:"button",className:"flex size-6 items-center justify-center rounded-md outline-none hover:bg-slate-100",onClick:()=>a?.(!1),children:i.jsx(I,{name:"XmarkLight",size:24})})]}),i.jsxs("div",{...ce(f,"my-6 rounded-md bg-slate-50 p-4 text-center"),children:[s||S,r]}),i.jsxs("div",{...ce(x,"mt-8 flex justify-between gap-3"),children:[i.jsx("button",{onClick:o,...ce(g,k(ha,"flex-1 bg-slate-50 text-slate-800")),children:l}),i.jsx("button",{onClick:c,...ce(y,k(ha,"flex-1 bg-gray-800 text-gray-50")),children:u})]})]})})}function yg(e){const{status:t,errorDetails:n}=e;return(t==="failed"||t==="unsupported-document-type")&&n?i.jsx("div",{className:"break-words text-xs leading-[18px] text-gray-500",children:n}):null}function xg(e){switch(e){case"analytics-processor":return"AnalyticsProcessorModule";case"relational-processor":return"RelationalProcessorModule";case"codegen-processor":return"CodegenProcessorModule";case"app":return"AppModule";case"document-model":return"DocumentModelModule";case"editor":return"EditorModule";case"package":return"PackageModule";case"subgraph":return"SubgraphModule";default:return"PowerhouseDocumentModule"}}function vg(e){const{fileName:t,fileSize:n,documentType:s,onClose:r,...o}=e;return i.jsxs("div",{className:"flex items-center gap-2",...o,children:[i.jsx("div",{className:"flex h-9 w-7 flex-shrink-0 items-center justify-center",children:i.jsx(I,{name:xg(s),size:48,className:"text-gray-600"})}),i.jsxs("div",{className:"flex flex-1 flex-col gap-0.5",children:[i.jsx("div",{className:"text-xs font-medium leading-[18px] text-gray-900",children:t}),i.jsx("div",{className:"text-xs font-medium leading-[18px] text-gray-500",children:n})]}),r&&i.jsx("div",{className:"flex h-9 w-[18px] flex-shrink-0 items-start justify-center",children:i.jsx("button",{type:"button",onClick:r,className:"flex h-[18px] w-[18px] items-center justify-center text-gray-600 hover:text-gray-800","aria-label":"Close",children:i.jsx(I,{name:"XmarkLight",size:18})})})]})}function wg(e){const{status:t,progress:n=0}=e;if(t!=="uploading")return null;const s=Math.min(100,Math.max(0,n));return i.jsx("div",{className:"h-2 w-full overflow-hidden rounded-sm bg-gray-200",children:i.jsx("div",{className:"h-full bg-blue-900 transition-all duration-300 ease-out",style:{width:`${s}%`}})})}function Cg(e){switch(e){case"success":return"Upload successful";case"failed":return"Upload failed";case"unsupported-document-type":return"Document not supported by this drive";case"pending":return"Pending resolution";case"conflict":return"Pending Resolution";case"uploading":return"Uploading...";default:return""}}function Sg(e){switch(e){case"success":return"text-green-700";case"failed":case"unsupported-document-type":case"pending":case"conflict":return"text-red-900";case"uploading":return"text-gray-900";default:return"text-gray-900"}}function jg(e,t,n){return e==="success"&&!!t||e==="pending"&&!!n||e==="conflict"&&!!n}function Ng(e){return e==="success"?"Open Document":e==="pending"||e==="conflict"?"Find resolution":""}function Pg(e){const{status:t,progress:n=0,onOpenDocument:s,onFindResolution:r}=e,o=()=>{t==="success"&&s?s():(t==="pending"||t==="conflict")&&r&&r()};return i.jsxs("div",{className:"flex items-center justify-between gap-2",children:[i.jsx("div",{className:k("text-xs leading-[18px]",Sg(t)),children:Cg(t)}),t==="uploading"&&i.jsxs("div",{className:"text-xs font-medium leading-[18px] text-gray-900",children:[Math.round(n),"%"]}),jg(t,s,r)&&i.jsx("button",{type:"button",onClick:o,className:"text-xs leading-[18px] text-blue-900 hover:opacity-80",children:Ng(t)})]})}const Eg=b.forwardRef(function(t,n){const{fileName:s,fileSize:r,status:o,documentType:a,progress:c=0,errorDetails:l,onClose:u,onOpenDocument:d,onFindResolution:p,className:f,...h}=t;return i.jsxs("div",{ref:n,className:k("flex w-full flex-col gap-0.5 rounded-md border border-gray-100 bg-white p-2 shadow-[0_2px_12px_rgba(37,42,52,0.1)]",f),...h,children:[i.jsx(vg,{fileName:s,fileSize:r,documentType:a,onClose:u}),i.jsxs("div",{className:"flex flex-col gap-1",children:[i.jsx(Pg,{status:o,progress:c,onOpenDocument:d,onFindResolution:p}),i.jsx(wg,{status:o,progress:c}),i.jsx(yg,{status:o,errorDetails:l})]})]})});function Ig(e,t){return t||`Uploading ${e} document${e===1?"":"s"}`}function Og(e){const{items:t,title:n,defaultCollapsed:s=!1,onClose:r,className:o,...a}=e,[c,l]=b.useState(s),u=b.useMemo(()=>Ig(t.length,n),[t.length,n]);return i.jsxs("div",{className:k("w-[358px] rounded-md border border-gray-100 bg-gray-50 p-4 shadow-[1px_4px_15px_rgba(74,88,115,0.25)]",o),...a,children:[i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsx("button",{type:"button","aria-expanded":!c,"aria-label":c?"Expand list":"Collapse list",onClick:()=>l(d=>!d),className:"min-w-0 flex-1 text-left text-sm font-medium leading-4 text-gray-900 hover:opacity-80",children:u}),i.jsxs("div",{className:"flex shrink-0 items-center gap-4",children:[i.jsx("button",{type:"button","aria-label":c?"Expand":"Collapse",onClick:()=>l(d=>!d),className:"text-gray-900 hover:opacity-80",children:i.jsx("span",{className:k("inline-block h-4 w-4 select-none transition-transform",c?"-rotate-90":"rotate-0"),children:i.jsx(I,{name:"CaretDown",size:16,"aria-hidden":"true"})})}),r&&i.jsx("button",{type:"button","aria-label":"Close",onClick:r,className:"text-gray-900 hover:opacity-80",children:i.jsx("span",{className:"inline-block h-4 w-4 select-none",children:i.jsx(I,{name:"XmarkLight",size:16,"aria-hidden":"true"})})})]})]}),!c&&i.jsx("div",{className:"mt-4 flex max-h-[404px] flex-col gap-4 overflow-y-auto overflow-x-visible px-2 py-2",children:t.map((d,p)=>i.jsx(Eg,{...d},`${d.fileName}-${p}`))})]})}function kg(){return`upload_${Date.now()}_${Math.random().toString(36).substring(2,9)}`}function Mg(e){if(e===0)return"0 Bytes";const t=1024,n=["Bytes","KB","MB","GB"],s=Math.floor(Math.log(e)/Math.log(t));return`${parseFloat((e/Math.pow(t,s)).toFixed(2))} ${n[s]}`}function Tg(e){switch(e){case"loading":case"initializing":return"pending";case"uploading":return"uploading";case"complete":return"success";case"failed":return"failed";case"conflict":return"conflict";case"unsupported-document-type":return"unsupported-document-type";default:return"pending"}}function Ag(e,t,n,s){return e.filter(r=>r!==void 0).map(r=>({fileName:r.fileName,fileSize:r.fileSize,status:r.status,progress:r.progress,errorDetails:r.errorDetails,documentType:r.documentType,onClose:()=>{t(r.id)},onOpenDocument:r.status==="success"?()=>{r.fileNode&&n?n(r.fileNode):console.error("Opening document for upload:",r.id,"- fileNode not available or setSelectedNode not provided")}:void 0,onFindResolution:r.status==="failed"?()=>{console.log("Finding resolution for upload:",r.id)}:r.status==="conflict"?()=>{console.log("Finding conflict resolution for upload:",r.id),s?.(r.id)}:void 0}))}function Dg(e){const{uploadsArray:t,uploadsCount:n,removeUpload:s,clearAllUploads:r,setSelectedNode:o,onClose:a,onConflictResolution:c,className:l,...u}=e;if(n===0)return null;const d=Ag(t,s,o,c),p=a??r;return i.jsx("div",{className:k("fixed bottom-4 right-4 z-[1001]",l),...u,children:i.jsx(Og,{items:d,onClose:p})})}function Rg(e,t){switch(t.type){case"ADD_UPLOAD":return{...e,[t.payload.id]:{id:t.payload.id,fileName:t.payload.fileName,fileSize:t.payload.fileSize,status:"pending",progress:0,fileNode:void 0}};case"UPDATE_PROGRESS":{const n=e[t.payload.id];return n?{...e,[t.payload.id]:{...n,status:Tg(t.payload.progress.stage),progress:t.payload.progress.progress,errorDetails:t.payload.progress.error,...t.payload.progress.documentType&&{documentType:t.payload.progress.documentType},...t.payload.progress.duplicateType&&{duplicateType:t.payload.progress.duplicateType}}}:e}case"SET_FILE_NODE":{const n=e[t.payload.id];return n?{...e,[t.payload.id]:{...n,fileNode:t.payload.fileNode}}:e}case"SET_ERROR":{const n=e[t.payload.id];return n?{...e,[t.payload.id]:{...n,status:n.status||"failed",errorDetails:t.payload.error}}:e}case"REMOVE_UPLOAD":{const{[t.payload.id]:n,...s}=e;return s}case"CLEAR_ALL_UPLOADS":return{};case"SET_CONFLICT_DATA":{const n=e[t.payload.id];return n?{...e,[t.payload.id]:{...n,file:t.payload.file,parentNode:t.payload.parentNode}}:e}case"CLEAR_CONFLICTED_UPLOADS":{const n={};for(const[s,r]of Object.entries(e))r&&r.status!=="conflict"&&(n[s]=r);return n}default:return e}}function Lg(e=!1,t){const n=b.useCallback(()=>{if(e&&t)try{const f=localStorage.getItem(`uploadTracker_${t}`);return f?JSON.parse(f):{}}catch(f){return console.error("Failed to load upload tracker from localStorage:",f),{}}return{}},[e,t]),[s,r]=b.useReducer(Rg,n());b.useEffect(()=>{if(e&&t)try{localStorage.setItem(`uploadTracker_${t}`,JSON.stringify(s))}catch(f){console.error("Failed to save upload tracker to localStorage:",f)}},[s,e,t]);const o=b.useCallback(f=>{if(f)return async(h,m)=>{const g=kg();r({type:"ADD_UPLOAD",payload:{id:g,fileName:h.name,fileSize:Mg(h.size)}});const y=x=>{r({type:"UPDATE_PROGRESS",payload:{id:g,progress:x}}),x.stage==="conflict"&&r({type:"SET_CONFLICT_DATA",payload:{id:g,file:h,parentNode:m}})};try{const x=await f(h,m,y);r({type:"SET_FILE_NODE",payload:{id:g,fileNode:x||void 0}})}catch(x){r({type:"SET_ERROR",payload:{id:g,error:x instanceof Error?x.message:"Unknown error"}})}}},[]),a=b.useCallback(f=>{r({type:"REMOVE_UPLOAD",payload:{id:f}})},[]),c=b.useCallback(()=>{r({type:"CLEAR_ALL_UPLOADS"})},[]),l=b.useCallback(()=>{r({type:"CLEAR_CONFLICTED_UPLOADS"})},[]),u=b.useCallback(()=>Object.values(s),[s]),d=b.useCallback(()=>Object.keys(s).length,[s]),p=b.useCallback((f,h,m)=>{const g=s[f];if(!g?.file||!m){console.error("Cannot resolve conflict: missing upload data or onAddFile function");return}const y=v=>{r({type:"UPDATE_PROGRESS",payload:{id:f,progress:v}})},x=m(g.file,g.parentNode,y,h);Promise.resolve(x).then(v=>{v&&r({type:"SET_FILE_NODE",payload:{id:f,fileNode:v}})}).catch(v=>{r({type:"SET_ERROR",payload:{id:f,error:v instanceof Error?v.message:"Unknown error"}})})},[s]);return{uploads:s,uploadsArray:u(),uploadsCount:d(),createUploadHandler:o,removeUpload:a,clearAllUploads:c,clearConflictedUploads:l,resolveConflict:p}}function Fg(e){const{title:t="Drag your documents",subtitle:n="to drop them in the currently selected folder.",node:s,enable:r=!0,children:o,onAddFile:a,useLocalStorage:c=!1,driveId:l,acceptedFileExtensions:u=[".zip",".phd",".phdm"],className:d,...p}=e,[f,h]=b.useState(!1),[m,g]=b.useState(null),{uploadsArray:y,uploadsCount:x,createUploadHandler:v,clearAllUploads:S,clearConflictedUploads:N,removeUpload:w,resolveConflict:j}=Lg(c,l);b.useEffect(()=>{N()},[]);const C=v(a)??(async()=>{}),P=F=>{g(F),h(!0)},E=()=>{m&&a&&j(m,"replace",a),h(!1),g(null)},M=()=>{m&&a&&j(m,"duplicate",a),h(!1),g(null)},O=()=>{h(!1),g(null)},{isDropTarget:T,dropProps:D}=Dc({target:s,onAddFileOverride:C,trackNestedDrag:!0,acceptedFileExtensions:u});return i.jsxs("div",{className:k("relative",d),...r?D:{},...p,children:[o,r&&T&&i.jsx("div",{className:"fixed inset-0 z-[1000] flex min-h-screen w-screen items-center justify-center bg-black/50",children:i.jsx("div",{className:"rounded-[24px] bg-white p-6 shadow-[1px_4px_15px_rgba(74,88,115,0.25)]",children:i.jsxs("div",{className:"relative flex h-[130px] w-[400px] flex-col items-center justify-start overflow-visible rounded-lg border border-dashed border-black px-4 py-6",children:[i.jsx("div",{className:"text-center text-base leading-5 text-zinc-500",children:t}),i.jsx("div",{className:"text-center text-base leading-5 text-zinc-500",children:n}),i.jsx("span",{className:"pointer-events-none absolute -bottom-16 left-1/2 z-10 -translate-x-1/2",children:i.jsx(I,{name:"DocumentIcons",size:144,"aria-hidden":"true"})})]})})}),i.jsx(Dg,{uploadsArray:y,uploadsCount:x,removeUpload:w,clearAllUploads:S,setSelectedNode:ht,onConflictResolution:P}),i.jsx(bg,{open:f,onOpenChange:O,fileName:m?y.find(F=>F?.id===m)?.fileName:void 0,onReplace:E,onDuplicate:M})]})}function u6({children:e,...t}){const n=bu(),s=ai(),r=yu(),o=async(a,c,l,u)=>await r(a,l,u);return!n||!s?i.jsx(i.Fragment,{children:e}):i.jsx(Fg,{onAddFile:o,driveId:s,useLocalStorage:!0,...t,children:e})}function yr(e){const{children:t,items:n,open:s,onItemClick:r,onOpenChange:o,menuClassName:a}=e;return i.jsxs($u,{onOpenChange:o,open:s,children:[i.jsx(Vu,{asChild:!0,className:"outline-none",children:t}),i.jsx(Bu,{className:k("modal-shadow cursor-pointer rounded-2xl bg-white text-sm font-medium text-slate-500",a),children:n.map(({id:c,label:l,icon:u,className:d})=>i.jsxs(Uu,{className:k("flex items-center px-5 py-2 outline-none first-of-type:rounded-t-2xl first-of-type:pt-3 last-of-type:rounded-b-2xl last-of-type:pb-3 hover:bg-slate-50",d),onClick:p=>p.stopPropagation(),onSelect:()=>r(c),children:[u?i.jsx("span",{className:"mr-2 inline-block",children:u}):null,l]},c))})]})}const zg="/assets/powerhouse-rounded-CeKGGUG4.png",ma=[{inputs:[{components:[{name:"target",type:"address"},{name:"allowFailure",type:"bool"},{name:"callData",type:"bytes"}],name:"calls",type:"tuple[]"}],name:"aggregate3",outputs:[{components:[{name:"success",type:"bool"},{name:"returnData",type:"bytes"}],name:"returnData",type:"tuple[]"}],stateMutability:"view",type:"function"},{inputs:[],name:"getCurrentBlockTimestamp",outputs:[{internalType:"uint256",name:"timestamp",type:"uint256"}],stateMutability:"view",type:"function"}],cs=[{name:"query",type:"function",stateMutability:"view",inputs:[{type:"tuple[]",name:"queries",components:[{type:"address",name:"sender"},{type:"string[]",name:"urls"},{type:"bytes",name:"data"}]}],outputs:[{type:"bool[]",name:"failures"},{type:"bytes[]",name:"responses"}]},{name:"HttpError",type:"error",inputs:[{type:"uint16",name:"status"},{type:"string",name:"message"}]}],Rc=[{inputs:[{name:"dns",type:"bytes"}],name:"DNSDecodingFailed",type:"error"},{inputs:[{name:"ens",type:"string"}],name:"DNSEncodingFailed",type:"error"},{inputs:[],name:"EmptyAddress",type:"error"},{inputs:[{name:"status",type:"uint16"},{name:"message",type:"string"}],name:"HttpError",type:"error"},{inputs:[],name:"InvalidBatchGatewayResponse",type:"error"},{inputs:[{name:"errorData",type:"bytes"}],name:"ResolverError",type:"error"},{inputs:[{name:"name",type:"bytes"},{name:"resolver",type:"address"}],name:"ResolverNotContract",type:"error"},{inputs:[{name:"name",type:"bytes"}],name:"ResolverNotFound",type:"error"},{inputs:[{name:"primary",type:"string"},{name:"primaryAddress",type:"bytes"}],name:"ReverseAddressMismatch",type:"error"},{inputs:[{internalType:"bytes4",name:"selector",type:"bytes4"}],name:"UnsupportedResolverProfile",type:"error"}],$g=[...Rc,{name:"resolveWithGateways",type:"function",stateMutability:"view",inputs:[{name:"name",type:"bytes"},{name:"data",type:"bytes"},{name:"gateways",type:"string[]"}],outputs:[{name:"",type:"bytes"},{name:"address",type:"address"}]}],Vg=[...Rc,{name:"reverseWithGateways",type:"function",stateMutability:"view",inputs:[{type:"bytes",name:"reverseName"},{type:"uint256",name:"coinType"},{type:"string[]",name:"gateways"}],outputs:[{type:"string",name:"resolvedName"},{type:"address",name:"resolver"},{type:"address",name:"reverseResolver"}]}],ga=[{name:"text",type:"function",stateMutability:"view",inputs:[{name:"name",type:"bytes32"},{name:"key",type:"string"}],outputs:[{name:"",type:"string"}]}];function We(e,{includeName:t=!1}={}){if(e.type!=="function"&&e.type!=="event"&&e.type!=="error")throw new Kg(e.type);return`${e.name}(${Qs(e.inputs,{includeName:t})})`}function Qs(e,{includeName:t=!1}={}){return e?e.map(n=>Bg(n,{includeName:t})).join(t?", ":","):""}function Bg(e,{includeName:t}){return e.type.startsWith("tuple")?`(${Qs(e.components,{includeName:t})})${e.type.slice(5)}`:e.type+(t&&e.name?` ${e.name}`:"")}function st(e,{strict:t=!0}={}){return!e||typeof e!="string"?!1:t?/^0x[0-9a-fA-F]*$/.test(e):e.startsWith("0x")}function de(e){return st(e,{strict:!1})?Math.ceil((e.length-2)/2):e.length}const Lc="2.38.6";let Rr={getDocsUrl:({docsBaseUrl:e,docsPath:t="",docsSlug:n})=>t?`${e??"https://viem.sh"}${t}${n?`#${n}`:""}`:void 0,version:`viem@${Lc}`},A=class ls extends Error{constructor(t,n={}){const s=n.cause instanceof ls?n.cause.details:n.cause?.message?n.cause.message:n.details,r=n.cause instanceof ls&&n.cause.docsPath||n.docsPath,o=Rr.getDocsUrl?.({...n,docsPath:r}),a=[t||"An error occurred.","",...n.metaMessages?[...n.metaMessages,""]:[],...o?[`Docs: ${o}`]:[],...s?[`Details: ${s}`]:[],...Rr.version?[`Version: ${Rr.version}`]:[]].join(`
9
- `);super(a,n.cause?{cause:n.cause}:void 0),Object.defineProperty(this,"details",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"docsPath",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"metaMessages",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"shortMessage",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"version",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"BaseError"}),this.details=s,this.docsPath=r,this.metaMessages=n.metaMessages,this.name=n.name??this.name,this.shortMessage=t,this.version=Lc}walk(t){return Fc(this,t)}};function Fc(e,t){return t?.(e)?e:e&&typeof e=="object"&&"cause"in e&&e.cause!==void 0?Fc(e.cause,t):t?null:e}class Ug extends A{constructor({docsPath:t}){super(["A constructor was not found on the ABI.","Make sure you are using the correct ABI and that the constructor exists on it."].join(`
10
- `),{docsPath:t,name:"AbiConstructorNotFoundError"})}}class ba extends A{constructor({docsPath:t}){super(["Constructor arguments were provided (`args`), but a constructor parameters (`inputs`) were not found on the ABI.","Make sure you are using the correct ABI, and that the `inputs` attribute on the constructor exists."].join(`
11
- `),{docsPath:t,name:"AbiConstructorParamsNotFoundError"})}}class Hg extends A{constructor({data:t,params:n,size:s}){super([`Data size of ${s} bytes is too small for given parameters.`].join(`
12
- `),{metaMessages:[`Params: (${Qs(n,{includeName:!0})})`,`Data: ${t} (${s} bytes)`],name:"AbiDecodingDataSizeTooSmallError"}),Object.defineProperty(this,"data",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"params",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"size",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.data=t,this.params=n,this.size=s}}class Xs extends A{constructor(){super('Cannot decode zero data ("0x") with ABI parameters.',{name:"AbiDecodingZeroDataError"})}}class _g extends A{constructor({expectedLength:t,givenLength:n,type:s}){super([`ABI encoding array length mismatch for type ${s}.`,`Expected length: ${t}`,`Given length: ${n}`].join(`
13
- `),{name:"AbiEncodingArrayLengthMismatchError"})}}class Wg extends A{constructor({expectedSize:t,value:n}){super(`Size of bytes "${n}" (bytes${de(n)}) does not match expected size (bytes${t}).`,{name:"AbiEncodingBytesSizeMismatchError"})}}class Gg extends A{constructor({expectedLength:t,givenLength:n}){super(["ABI encoding params/values length mismatch.",`Expected length (params): ${t}`,`Given length (values): ${n}`].join(`
14
- `),{name:"AbiEncodingLengthMismatchError"})}}class Yg extends A{constructor(t,{docsPath:n}){super([`Arguments (\`args\`) were provided to "${t}", but "${t}" on the ABI does not contain any parameters (\`inputs\`).`,"Cannot encode error result without knowing what the parameter types are.","Make sure you are using the correct ABI and that the inputs exist on it."].join(`
15
- `),{docsPath:n,name:"AbiErrorInputsNotFoundError"})}}class ya extends A{constructor(t,{docsPath:n}={}){super([`Error ${t?`"${t}" `:""}not found on ABI.`,"Make sure you are using the correct ABI and that the error exists on it."].join(`
16
- `),{docsPath:n,name:"AbiErrorNotFoundError"})}}class zc extends A{constructor(t,{docsPath:n}){super([`Encoded error signature "${t}" not found on ABI.`,"Make sure you are using the correct ABI and that the error exists on it.",`You can look up the decoded signature here: https://openchain.xyz/signatures?query=${t}.`].join(`
17
- `),{docsPath:n,name:"AbiErrorSignatureNotFoundError"}),Object.defineProperty(this,"signature",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.signature=t}}class bt extends A{constructor(t,{docsPath:n}={}){super([`Function ${t?`"${t}" `:""}not found on ABI.`,"Make sure you are using the correct ABI and that the function exists on it."].join(`
18
- `),{docsPath:n,name:"AbiFunctionNotFoundError"})}}class $c extends A{constructor(t,{docsPath:n}){super([`Function "${t}" does not contain any \`outputs\` on ABI.`,"Cannot decode function result without knowing what the parameter types are.","Make sure you are using the correct ABI and that the function exists on it."].join(`
19
- `),{docsPath:n,name:"AbiFunctionOutputsNotFoundError"})}}class qg extends A{constructor(t,{docsPath:n}){super([`Encoded function signature "${t}" not found on ABI.`,"Make sure you are using the correct ABI and that the function exists on it.",`You can look up the signature here: https://openchain.xyz/signatures?query=${t}.`].join(`
20
- `),{docsPath:n,name:"AbiFunctionSignatureNotFoundError"})}}class Jg extends A{constructor(t,n){super("Found ambiguous types in overloaded ABI items.",{metaMessages:[`\`${t.type}\` in \`${We(t.abiItem)}\`, and`,`\`${n.type}\` in \`${We(n.abiItem)}\``,"","These types encode differently and cannot be distinguished at runtime.","Remove one of the ambiguous items in the ABI."],name:"AbiItemAmbiguityError"})}}class Qg extends A{constructor(t,{docsPath:n}){super([`Type "${t}" is not a valid encoding type.`,"Please provide a valid ABI type."].join(`
21
- `),{docsPath:n,name:"InvalidAbiEncodingType"})}}class Xg extends A{constructor(t,{docsPath:n}){super([`Type "${t}" is not a valid decoding type.`,"Please provide a valid ABI type."].join(`
22
- `),{docsPath:n,name:"InvalidAbiDecodingType"})}}class Vc extends A{constructor(t){super([`Value "${t}" is not a valid array.`].join(`
23
- `),{name:"InvalidArrayError"})}}class Kg extends A{constructor(t){super([`"${t}" is not a valid definition type.`,'Valid types: "function", "event", "error"'].join(`
24
- `),{name:"InvalidDefinitionTypeError"})}}class et extends A{constructor({address:t}){super(`Address "${t}" is invalid.`,{metaMessages:["- Address must be a hex value of 20 bytes (40 hex characters).","- Address must match its checksum counterpart."],name:"InvalidAddressError"})}}class Bc extends A{constructor({offset:t,position:n,size:s}){super(`Slice ${n==="start"?"starting":"ending"} at offset "${t}" is out-of-bounds (size: ${s}).`,{name:"SliceOffsetOutOfBoundsError"})}}let Uc=class extends A{constructor({size:t,targetSize:n,type:s}){super(`${s.charAt(0).toUpperCase()}${s.slice(1).toLowerCase()} size (${t}) exceeds padding size (${n}).`,{name:"SizeExceedsPaddingSizeError"})}};class xa extends A{constructor({size:t,targetSize:n,type:s}){super(`${s.charAt(0).toUpperCase()}${s.slice(1).toLowerCase()} is expected to be ${n} ${s} long, but is ${t} ${s} long.`,{name:"InvalidBytesLengthError"})}}function Ct(e,{dir:t,size:n=32}={}){return typeof e=="string"?He(e,{dir:t,size:n}):Zg(e,{dir:t,size:n})}function He(e,{dir:t,size:n=32}={}){if(n===null)return e;const s=e.replace("0x","");if(s.length>n*2)throw new Uc({size:Math.ceil(s.length/2),targetSize:n,type:"hex"});return`0x${s[t==="right"?"padEnd":"padStart"](n*2,"0")}`}function Zg(e,{dir:t,size:n=32}={}){if(n===null)return e;if(e.length>n)throw new Uc({size:e.length,targetSize:n,type:"bytes"});const s=new Uint8Array(n);for(let r=0;r<n;r++){const o=t==="right";s[o?r:n-r-1]=e[o?r:e.length-r-1]}return s}let Hc=class extends A{constructor({max:t,min:n,signed:s,size:r,value:o}){super(`Number "${o}" is not in safe ${r?`${r*8}-bit ${s?"signed":"unsigned"} `:""}integer range ${t?`(${n} to ${t})`:`(above ${n})`}`,{name:"IntegerOutOfRangeError"})}};class eb extends A{constructor(t){super(`Bytes value "${t}" is not a valid boolean. The bytes array must contain a single byte of either a 0 or 1 value.`,{name:"InvalidBytesBooleanError"})}}class tb extends A{constructor({givenSize:t,maxSize:n}){super(`Size cannot exceed ${n} bytes. Given size: ${t} bytes.`,{name:"SizeOverflowError"})}}function Ks(e,{dir:t="left"}={}){let n=typeof e=="string"?e.replace("0x",""):e,s=0;for(let r=0;r<n.length-1&&n[t==="left"?r:n.length-r-1].toString()==="0";r++)s++;return n=t==="left"?n.slice(s):n.slice(0,n.length-s),typeof e=="string"?(n.length===1&&t==="right"&&(n=`${n}0`),`0x${n.length%2===1?`0${n}`:n}`):n}function ke(e,{size:t}){if(de(e)>t)throw new tb({givenSize:de(e),maxSize:t})}function _c(e,t={}){const{signed:n}=t;t.size&&ke(e,{size:t.size});const s=BigInt(e);if(!n)return s;const r=(e.length-2)/2,o=(1n<<BigInt(r)*8n-1n)-1n;return s<=o?s:s-BigInt(`0x${"f".padStart(r*2,"f")}`)-1n}function nb(e,t={}){return Number(_c(e,t))}const rb=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0"));function Wc(e,t={}){return typeof e=="number"||typeof e=="bigint"?Z(e,t):typeof e=="string"?Zs(e,t):typeof e=="boolean"?Gc(e,t):xe(e,t)}function Gc(e,t={}){const n=`0x${Number(e)}`;return typeof t.size=="number"?(ke(n,{size:t.size}),Ct(n,{size:t.size})):n}function xe(e,t={}){let n="";for(let r=0;r<e.length;r++)n+=rb[e[r]];const s=`0x${n}`;return typeof t.size=="number"?(ke(s,{size:t.size}),Ct(s,{dir:"right",size:t.size})):s}function Z(e,t={}){const{signed:n,size:s}=t,r=BigInt(e);let o;s?n?o=(1n<<BigInt(s)*8n-1n)-1n:o=2n**(BigInt(s)*8n)-1n:typeof e=="number"&&(o=BigInt(Number.MAX_SAFE_INTEGER));const a=typeof o=="bigint"&&n?-o-1n:0;if(o&&r>o||r<a){const l=typeof e=="bigint"?"n":"";throw new Hc({max:o?`${o}${l}`:void 0,min:`${a}${l}`,signed:n,size:s,value:`${e}${l}`})}const c=`0x${(n&&r<0?(1n<<BigInt(s*8))+BigInt(r):r).toString(16)}`;return s?Ct(c,{size:s}):c}const sb=new TextEncoder;function Zs(e,t={}){const n=sb.encode(e);return xe(n,t)}const ob=new TextEncoder;function eo(e,t={}){return typeof e=="number"||typeof e=="bigint"?ib(e,t):typeof e=="boolean"?ab(e,t):st(e)?to(e,t):Je(e,t)}function ab(e,t={}){const n=new Uint8Array(1);return n[0]=Number(e),typeof t.size=="number"?(ke(n,{size:t.size}),Ct(n,{size:t.size})):n}const Me={zero:48,nine:57,A:65,F:70,a:97,f:102};function va(e){if(e>=Me.zero&&e<=Me.nine)return e-Me.zero;if(e>=Me.A&&e<=Me.F)return e-(Me.A-10);if(e>=Me.a&&e<=Me.f)return e-(Me.a-10)}function to(e,t={}){let n=e;t.size&&(ke(n,{size:t.size}),n=Ct(n,{dir:"right",size:t.size}));let s=n.slice(2);s.length%2&&(s=`0${s}`);const r=s.length/2,o=new Uint8Array(r);for(let a=0,c=0;a<r;a++){const l=va(s.charCodeAt(c++)),u=va(s.charCodeAt(c++));if(l===void 0||u===void 0)throw new A(`Invalid byte sequence ("${s[c-2]}${s[c-1]}" in "${s}").`);o[a]=l*16+u}return o}function ib(e,t){const n=Z(e,t);return to(n)}function Je(e,t={}){const n=ob.encode(e);return typeof t.size=="number"?(ke(n,{size:t.size}),Ct(n,{dir:"right",size:t.size})):n}function Vt(e,t){const n=t||"hex",s=xu(st(e,{strict:!1})?eo(e):e);return n==="bytes"?s:Wc(s)}class no extends Map{constructor(t){super(),Object.defineProperty(this,"maxSize",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.maxSize=t}get(t){const n=super.get(t);return super.has(t)&&n!==void 0&&(this.delete(t),super.set(t,n)),n}set(t,n){if(super.set(t,n),this.maxSize&&this.size>this.maxSize){const s=this.keys().next().value;s&&this.delete(s)}return this}}const cb=/^0x[a-fA-F0-9]{40}$/,Lr=new no(8192);function Oe(e,t){const{strict:n=!0}=t??{},s=`${e}.${n}`;if(Lr.has(s))return Lr.get(s);const r=cb.test(e)?e.toLowerCase()===e?!0:n?ro(e)===e:!0:!1;return Lr.set(s,r),r}const Fr=new no(8192);function ro(e,t){if(Fr.has(`${e}.${t}`))return Fr.get(`${e}.${t}`);const n=e.substring(2).toLowerCase(),s=Vt(Je(n),"bytes"),r=n.split("");for(let a=0;a<40;a+=2)s[a>>1]>>4>=8&&r[a]&&(r[a]=r[a].toUpperCase()),(s[a>>1]&15)>=8&&r[a+1]&&(r[a+1]=r[a+1].toUpperCase());const o=`0x${r.join("")}`;return Fr.set(`${e}.${t}`,o),o}function Pn(e,t){if(!Oe(e,{strict:!1}))throw new et({address:e});return ro(e,t)}class wa extends A{constructor({offset:t}){super(`Offset \`${t}\` cannot be negative.`,{name:"NegativeOffsetError"})}}class lb extends A{constructor({length:t,position:n}){super(`Position \`${n}\` is out of bounds (\`0 < position < ${t}\`).`,{name:"PositionOutOfBoundsError"})}}class ub extends A{constructor({count:t,limit:n}){super(`Recursive read limit of \`${n}\` exceeded (recursive read count: \`${t}\`).`,{name:"RecursiveReadLimitExceededError"})}}const db={bytes:new Uint8Array,dataView:new DataView(new ArrayBuffer(0)),position:0,positionReadCount:new Map,recursiveReadCount:0,recursiveReadLimit:Number.POSITIVE_INFINITY,assertReadLimit(){if(this.recursiveReadCount>=this.recursiveReadLimit)throw new ub({count:this.recursiveReadCount+1,limit:this.recursiveReadLimit})},assertPosition(e){if(e<0||e>this.bytes.length-1)throw new lb({length:this.bytes.length,position:e})},decrementPosition(e){if(e<0)throw new wa({offset:e});const t=this.position-e;this.assertPosition(t),this.position=t},getReadCount(e){return this.positionReadCount.get(e||this.position)||0},incrementPosition(e){if(e<0)throw new wa({offset:e});const t=this.position+e;this.assertPosition(t),this.position=t},inspectByte(e){const t=e??this.position;return this.assertPosition(t),this.bytes[t]},inspectBytes(e,t){const n=t??this.position;return this.assertPosition(n+e-1),this.bytes.subarray(n,n+e)},inspectUint8(e){const t=e??this.position;return this.assertPosition(t),this.bytes[t]},inspectUint16(e){const t=e??this.position;return this.assertPosition(t+1),this.dataView.getUint16(t)},inspectUint24(e){const t=e??this.position;return this.assertPosition(t+2),(this.dataView.getUint16(t)<<8)+this.dataView.getUint8(t+2)},inspectUint32(e){const t=e??this.position;return this.assertPosition(t+3),this.dataView.getUint32(t)},pushByte(e){this.assertPosition(this.position),this.bytes[this.position]=e,this.position++},pushBytes(e){this.assertPosition(this.position+e.length-1),this.bytes.set(e,this.position),this.position+=e.length},pushUint8(e){this.assertPosition(this.position),this.bytes[this.position]=e,this.position++},pushUint16(e){this.assertPosition(this.position+1),this.dataView.setUint16(this.position,e),this.position+=2},pushUint24(e){this.assertPosition(this.position+2),this.dataView.setUint16(this.position,e>>8),this.dataView.setUint8(this.position+2,e&255),this.position+=3},pushUint32(e){this.assertPosition(this.position+3),this.dataView.setUint32(this.position,e),this.position+=4},readByte(){this.assertReadLimit(),this._touch();const e=this.inspectByte();return this.position++,e},readBytes(e,t){this.assertReadLimit(),this._touch();const n=this.inspectBytes(e);return this.position+=t??e,n},readUint8(){this.assertReadLimit(),this._touch();const e=this.inspectUint8();return this.position+=1,e},readUint16(){this.assertReadLimit(),this._touch();const e=this.inspectUint16();return this.position+=2,e},readUint24(){this.assertReadLimit(),this._touch();const e=this.inspectUint24();return this.position+=3,e},readUint32(){this.assertReadLimit(),this._touch();const e=this.inspectUint32();return this.position+=4,e},get remaining(){return this.bytes.length-this.position},setPosition(e){const t=this.position;return this.assertPosition(e),this.position=e,()=>this.position=t},_touch(){if(this.recursiveReadLimit===Number.POSITIVE_INFINITY)return;const e=this.getReadCount();this.positionReadCount.set(this.position,e+1),e>0&&this.recursiveReadCount++}};function fb(e,{recursiveReadLimit:t=8192}={}){const n=Object.create(db);return n.bytes=e,n.dataView=new DataView(e.buffer,e.byteOffset,e.byteLength),n.positionReadCount=new Map,n.recursiveReadLimit=t,n}function yt(e,t,n,{strict:s}={}){return st(e,{strict:!1})?pb(e,t,n,{strict:s}):Jc(e,t,n,{strict:s})}function Yc(e,t){if(typeof t=="number"&&t>0&&t>de(e)-1)throw new Bc({offset:t,position:"start",size:de(e)})}function qc(e,t,n){if(typeof t=="number"&&typeof n=="number"&&de(e)!==n-t)throw new Bc({offset:n,position:"end",size:de(e)})}function Jc(e,t,n,{strict:s}={}){Yc(e,t);const r=e.slice(t,n);return s&&qc(r,t,n),r}function pb(e,t,n,{strict:s}={}){Yc(e,t);const r=`0x${e.replace("0x","").slice((t??0)*2,(n??e.length)*2)}`;return s&&qc(r,t,n),r}function hb(e,t={}){typeof t.size<"u"&&ke(e,{size:t.size});const n=xe(e,t);return _c(n,t)}function mb(e,t={}){let n=e;if(typeof t.size<"u"&&(ke(n,{size:t.size}),n=Ks(n)),n.length>1||n[0]>1)throw new eb(n);return!!n[0]}function Le(e,t={}){typeof t.size<"u"&&ke(e,{size:t.size});const n=xe(e,t);return nb(n,t)}function gb(e,t={}){let n=e;return typeof t.size<"u"&&(ke(n,{size:t.size}),n=Ks(n,{dir:"right"})),new TextDecoder().decode(n)}function Ge(e){return typeof e[0]=="string"?xr(e):bb(e)}function bb(e){let t=0;for(const r of e)t+=r.length;const n=new Uint8Array(t);let s=0;for(const r of e)n.set(r,s),s+=r.length;return n}function xr(e){return`0x${e.reduce((t,n)=>t+n.replace("0x",""),"")}`}const yb=/^(u?int)(8|16|24|32|40|48|56|64|72|80|88|96|104|112|120|128|136|144|152|160|168|176|184|192|200|208|216|224|232|240|248|256)?$/;function pn(e,t){if(e.length!==t.length)throw new Gg({expectedLength:e.length,givenLength:t.length});const n=xb({params:e,values:t}),s=oo(n);return s.length===0?"0x":s}function xb({params:e,values:t}){const n=[];for(let s=0;s<e.length;s++)n.push(so({param:e[s],value:t[s]}));return n}function so({param:e,value:t}){const n=ao(e.type);if(n){const[s,r]=n;return wb(t,{length:s,param:{...e,type:r}})}if(e.type==="tuple")return Pb(t,{param:e});if(e.type==="address")return vb(t);if(e.type==="bool")return Sb(t);if(e.type.startsWith("uint")||e.type.startsWith("int")){const s=e.type.startsWith("int"),[,,r="256"]=yb.exec(e.type)??[];return jb(t,{signed:s,size:Number(r)})}if(e.type.startsWith("bytes"))return Cb(t,{param:e});if(e.type==="string")return Nb(t);throw new Qg(e.type,{docsPath:"/docs/contract/encodeAbiParameters"})}function oo(e){let t=0;for(let o=0;o<e.length;o++){const{dynamic:a,encoded:c}=e[o];a?t+=32:t+=de(c)}const n=[],s=[];let r=0;for(let o=0;o<e.length;o++){const{dynamic:a,encoded:c}=e[o];a?(n.push(Z(t+r,{size:32})),s.push(c),r+=de(c)):n.push(c)}return Ge([...n,...s])}function vb(e){if(!Oe(e))throw new et({address:e});return{dynamic:!1,encoded:He(e.toLowerCase())}}function wb(e,{length:t,param:n}){const s=t===null;if(!Array.isArray(e))throw new Vc(e);if(!s&&e.length!==t)throw new _g({expectedLength:t,givenLength:e.length,type:`${n.type}[${t}]`});let r=!1;const o=[];for(let a=0;a<e.length;a++){const c=so({param:n,value:e[a]});c.dynamic&&(r=!0),o.push(c)}if(s||r){const a=oo(o);if(s){const c=Z(o.length,{size:32});return{dynamic:!0,encoded:o.length>0?Ge([c,a]):c}}if(r)return{dynamic:!0,encoded:a}}return{dynamic:!1,encoded:Ge(o.map(({encoded:a})=>a))}}function Cb(e,{param:t}){const[,n]=t.type.split("bytes"),s=de(e);if(!n){let r=e;return s%32!==0&&(r=He(r,{dir:"right",size:Math.ceil((e.length-2)/2/32)*32})),{dynamic:!0,encoded:Ge([He(Z(s,{size:32})),r])}}if(s!==Number.parseInt(n,10))throw new Wg({expectedSize:Number.parseInt(n,10),value:e});return{dynamic:!1,encoded:He(e,{dir:"right"})}}function Sb(e){if(typeof e!="boolean")throw new A(`Invalid boolean value: "${e}" (type: ${typeof e}). Expected: \`true\` or \`false\`.`);return{dynamic:!1,encoded:He(Gc(e))}}function jb(e,{signed:t,size:n=256}){if(typeof n=="number"){const s=2n**(BigInt(n)-(t?1n:0n))-1n,r=t?-s-1n:0n;if(e>s||e<r)throw new Hc({max:s.toString(),min:r.toString(),signed:t,size:n/8,value:e.toString()})}return{dynamic:!1,encoded:Z(e,{size:32,signed:t})}}function Nb(e){const t=Zs(e),n=Math.ceil(de(t)/32),s=[];for(let r=0;r<n;r++)s.push(He(yt(t,r*32,(r+1)*32),{dir:"right"}));return{dynamic:!0,encoded:Ge([He(Z(de(t),{size:32})),...s])}}function Pb(e,{param:t}){let n=!1;const s=[];for(let r=0;r<t.components.length;r++){const o=t.components[r],a=Array.isArray(e)?r:o.name,c=so({param:o,value:e[a]});s.push(c),c.dynamic&&(n=!0)}return{dynamic:n,encoded:n?oo(s):Ge(s.map(({encoded:r})=>r))}}function ao(e){const t=e.match(/^(.*)\[(\d+)?\]$/);return t?[t[2]?Number(t[2]):null,t[1]]:void 0}function io(e,t){const n=typeof t=="string"?to(t):t,s=fb(n);if(de(n)===0&&e.length>0)throw new Xs;if(de(t)&&de(t)<32)throw new Hg({data:typeof t=="string"?t:xe(t),params:e,size:de(t)});let r=0;const o=[];for(let a=0;a<e.length;++a){const c=e[a];s.setPosition(r);const[l,u]=pt(s,c,{staticPosition:0});r+=u,o.push(l)}return o}function pt(e,t,{staticPosition:n}){const s=ao(t.type);if(s){const[r,o]=s;return Ib(e,{...t,type:o},{length:r,staticPosition:n})}if(t.type==="tuple")return Tb(e,t,{staticPosition:n});if(t.type==="address")return Eb(e);if(t.type==="bool")return Ob(e);if(t.type.startsWith("bytes"))return kb(e,t,{staticPosition:n});if(t.type.startsWith("uint")||t.type.startsWith("int"))return Mb(e,t);if(t.type==="string")return Ab(e,{staticPosition:n});throw new Xg(t.type,{docsPath:"/docs/contract/decodeAbiParameters"})}const Ca=32,us=32;function Eb(e){const t=e.readBytes(32);return[ro(xe(Jc(t,-20))),32]}function Ib(e,t,{length:n,staticPosition:s}){if(!n){const a=Le(e.readBytes(us)),c=s+a,l=c+Ca;e.setPosition(c);const u=Le(e.readBytes(Ca)),d=Bt(t);let p=0;const f=[];for(let h=0;h<u;++h){e.setPosition(l+(d?h*32:p));const[m,g]=pt(e,t,{staticPosition:l});p+=g,f.push(m)}return e.setPosition(s+32),[f,32]}if(Bt(t)){const a=Le(e.readBytes(us)),c=s+a,l=[];for(let u=0;u<n;++u){e.setPosition(c+u*32);const[d]=pt(e,t,{staticPosition:c});l.push(d)}return e.setPosition(s+32),[l,32]}let r=0;const o=[];for(let a=0;a<n;++a){const[c,l]=pt(e,t,{staticPosition:s+r});r+=l,o.push(c)}return[o,r]}function Ob(e){return[mb(e.readBytes(32),{size:32}),32]}function kb(e,t,{staticPosition:n}){const[s,r]=t.type.split("bytes");if(!r){const a=Le(e.readBytes(32));e.setPosition(n+a);const c=Le(e.readBytes(32));if(c===0)return e.setPosition(n+32),["0x",32];const l=e.readBytes(c);return e.setPosition(n+32),[xe(l),32]}return[xe(e.readBytes(Number.parseInt(r,10),32)),32]}function Mb(e,t){const n=t.type.startsWith("int"),s=Number.parseInt(t.type.split("int")[1]||"256",10),r=e.readBytes(32);return[s>48?hb(r,{signed:n}):Le(r,{signed:n}),32]}function Tb(e,t,{staticPosition:n}){const s=t.components.length===0||t.components.some(({name:a})=>!a),r=s?[]:{};let o=0;if(Bt(t)){const a=Le(e.readBytes(us)),c=n+a;for(let l=0;l<t.components.length;++l){const u=t.components[l];e.setPosition(c+o);const[d,p]=pt(e,u,{staticPosition:c});o+=p,r[s?l:u?.name]=d}return e.setPosition(n+32),[r,32]}for(let a=0;a<t.components.length;++a){const c=t.components[a],[l,u]=pt(e,c,{staticPosition:n});r[s?a:c?.name]=l,o+=u}return[r,o]}function Ab(e,{staticPosition:t}){const n=Le(e.readBytes(32)),s=t+n;e.setPosition(s);const r=Le(e.readBytes(32));if(r===0)return e.setPosition(t+32),["",32];const o=e.readBytes(r,32),a=gb(Ks(o));return e.setPosition(t+32),[a,32]}function Bt(e){const{type:t}=e;if(t==="string"||t==="bytes"||t.endsWith("[]"))return!0;if(t==="tuple")return e.components?.some(Bt);const n=ao(e.type);return!!(n&&Bt({...e,type:n[1]}))}const Db=e=>Vt(eo(e));function Rb(e){return Db(e)}const Lb="1.1.0";let ve=class ds extends Error{constructor(t,n={}){const s=n.cause instanceof ds?n.cause.details:n.cause?.message?n.cause.message:n.details,r=n.cause instanceof ds&&n.cause.docsPath||n.docsPath,o=[t||"An error occurred.","",...n.metaMessages?[...n.metaMessages,""]:[],...r?[`Docs: https://abitype.dev${r}`]:[],...s?[`Details: ${s}`]:[],`Version: abitype@${Lb}`].join(`
25
- `);super(o),Object.defineProperty(this,"details",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"docsPath",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"metaMessages",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"shortMessage",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiTypeError"}),n.cause&&(this.cause=n.cause),this.details=s,this.docsPath=r,this.metaMessages=n.metaMessages,this.shortMessage=t}};function Ve(e,t){return e.exec(t)?.groups}const Qc=/^bytes([1-9]|1[0-9]|2[0-9]|3[0-2])?$/,Xc=/^u?int(8|16|24|32|40|48|56|64|72|80|88|96|104|112|120|128|136|144|152|160|168|176|184|192|200|208|216|224|232|240|248|256)?$/,Kc=/^\(.+?\).*?$/,Sa=/^tuple(?<array>(\[(\d*)\])*)$/;function fs(e){let t=e.type;if(Sa.test(e.type)&&"components"in e){t="(";const n=e.components.length;for(let r=0;r<n;r++){const o=e.components[r];t+=fs(o),r<n-1&&(t+=", ")}const s=Ve(Sa,e.type);return t+=`)${s?.array??""}`,fs({...e,type:t})}return"indexed"in e&&e.indexed&&(t=`${t} indexed`),e.name?`${t} ${e.name}`:t}function kt(e){let t="";const n=e.length;for(let s=0;s<n;s++){const r=e[s];t+=fs(r),s!==n-1&&(t+=", ")}return t}function Fb(e){return e.type==="function"?`function ${e.name}(${kt(e.inputs)})${e.stateMutability&&e.stateMutability!=="nonpayable"?` ${e.stateMutability}`:""}${e.outputs?.length?` returns (${kt(e.outputs)})`:""}`:e.type==="event"?`event ${e.name}(${kt(e.inputs)})`:e.type==="error"?`error ${e.name}(${kt(e.inputs)})`:e.type==="constructor"?`constructor(${kt(e.inputs)})${e.stateMutability==="payable"?" payable":""}`:e.type==="fallback"?`fallback() external${e.stateMutability==="payable"?" payable":""}`:"receive() external payable"}const Zc=/^error (?<name>[a-zA-Z$_][a-zA-Z0-9$_]*)\((?<parameters>.*?)\)$/;function zb(e){return Zc.test(e)}function $b(e){return Ve(Zc,e)}const el=/^event (?<name>[a-zA-Z$_][a-zA-Z0-9$_]*)\((?<parameters>.*?)\)$/;function Vb(e){return el.test(e)}function Bb(e){return Ve(el,e)}const tl=/^function (?<name>[a-zA-Z$_][a-zA-Z0-9$_]*)\((?<parameters>.*?)\)(?: (?<scope>external|public{1}))?(?: (?<stateMutability>pure|view|nonpayable|payable{1}))?(?: returns\s?\((?<returns>.*?)\))?$/;function Ub(e){return tl.test(e)}function Hb(e){return Ve(tl,e)}const nl=/^struct (?<name>[a-zA-Z$_][a-zA-Z0-9$_]*) \{(?<properties>.*?)\}$/;function rl(e){return nl.test(e)}function _b(e){return Ve(nl,e)}const sl=/^constructor\((?<parameters>.*?)\)(?:\s(?<stateMutability>payable{1}))?$/;function Wb(e){return sl.test(e)}function Gb(e){return Ve(sl,e)}const ol=/^fallback\(\) external(?:\s(?<stateMutability>payable{1}))?$/;function Yb(e){return ol.test(e)}function qb(e){return Ve(ol,e)}const Jb=/^receive\(\) external payable$/;function Qb(e){return Jb.test(e)}const Xb=new Set(["indexed"]),ps=new Set(["calldata","memory","storage"]);class Kb extends ve{constructor({type:t}){super("Unknown type.",{metaMessages:[`Type "${t}" is not a valid ABI type. Perhaps you forgot to include a struct signature?`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"UnknownTypeError"})}}class Zb extends ve{constructor({type:t}){super("Unknown type.",{metaMessages:[`Type "${t}" is not a valid ABI type.`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"UnknownSolidityTypeError"})}}class e1 extends ve{constructor({param:t}){super("Invalid ABI parameter.",{details:t}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidParameterError"})}}class t1 extends ve{constructor({param:t,name:n}){super("Invalid ABI parameter.",{details:t,metaMessages:[`"${n}" is a protected Solidity keyword. More info: https://docs.soliditylang.org/en/latest/cheatsheet.html`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"SolidityProtectedKeywordError"})}}class n1 extends ve{constructor({param:t,type:n,modifier:s}){super("Invalid ABI parameter.",{details:t,metaMessages:[`Modifier "${s}" not allowed${n?` in "${n}" type`:""}.`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidModifierError"})}}class r1 extends ve{constructor({param:t,type:n,modifier:s}){super("Invalid ABI parameter.",{details:t,metaMessages:[`Modifier "${s}" not allowed${n?` in "${n}" type`:""}.`,`Data location can only be specified for array, struct, or mapping types, but "${s}" was given.`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidFunctionModifierError"})}}class s1 extends ve{constructor({abiParameter:t}){super("Invalid ABI parameter.",{details:JSON.stringify(t,null,2),metaMessages:["ABI parameter type is invalid."]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidAbiTypeParameterError"})}}class St extends ve{constructor({signature:t,type:n}){super(`Invalid ${n} signature.`,{details:t}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidSignatureError"})}}class o1 extends ve{constructor({signature:t}){super("Unknown signature.",{details:t}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"UnknownSignatureError"})}}class a1 extends ve{constructor({signature:t}){super("Invalid struct signature.",{details:t,metaMessages:["No properties exist."]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidStructSignatureError"})}}class i1 extends ve{constructor({type:t}){super("Circular reference detected.",{metaMessages:[`Struct "${t}" is a circular reference.`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"CircularReferenceError"})}}class c1 extends ve{constructor({current:t,depth:n}){super("Unbalanced parentheses.",{metaMessages:[`"${t.trim()}" has too many ${n>0?"opening":"closing"} parentheses.`],details:`Depth "${n}"`}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidParenthesisError"})}}function l1(e,t,n){let s="";if(n)for(const r of Object.entries(n)){if(!r)continue;let o="";for(const a of r[1])o+=`[${a.type}${a.name?`:${a.name}`:""}]`;s+=`(${r[0]}{${o}})`}return t?`${t}:${e}${s}`:e}const zr=new Map([["address",{type:"address"}],["bool",{type:"bool"}],["bytes",{type:"bytes"}],["bytes32",{type:"bytes32"}],["int",{type:"int256"}],["int256",{type:"int256"}],["string",{type:"string"}],["uint",{type:"uint256"}],["uint8",{type:"uint8"}],["uint16",{type:"uint16"}],["uint24",{type:"uint24"}],["uint32",{type:"uint32"}],["uint64",{type:"uint64"}],["uint96",{type:"uint96"}],["uint112",{type:"uint112"}],["uint160",{type:"uint160"}],["uint192",{type:"uint192"}],["uint256",{type:"uint256"}],["address owner",{type:"address",name:"owner"}],["address to",{type:"address",name:"to"}],["bool approved",{type:"bool",name:"approved"}],["bytes _data",{type:"bytes",name:"_data"}],["bytes data",{type:"bytes",name:"data"}],["bytes signature",{type:"bytes",name:"signature"}],["bytes32 hash",{type:"bytes32",name:"hash"}],["bytes32 r",{type:"bytes32",name:"r"}],["bytes32 root",{type:"bytes32",name:"root"}],["bytes32 s",{type:"bytes32",name:"s"}],["string name",{type:"string",name:"name"}],["string symbol",{type:"string",name:"symbol"}],["string tokenURI",{type:"string",name:"tokenURI"}],["uint tokenId",{type:"uint256",name:"tokenId"}],["uint8 v",{type:"uint8",name:"v"}],["uint256 balance",{type:"uint256",name:"balance"}],["uint256 tokenId",{type:"uint256",name:"tokenId"}],["uint256 value",{type:"uint256",name:"value"}],["event:address indexed from",{type:"address",name:"from",indexed:!0}],["event:address indexed to",{type:"address",name:"to",indexed:!0}],["event:uint indexed tokenId",{type:"uint256",name:"tokenId",indexed:!0}],["event:uint256 indexed tokenId",{type:"uint256",name:"tokenId",indexed:!0}]]);function u1(e,t={}){if(Ub(e))return d1(e,t);if(Vb(e))return f1(e,t);if(zb(e))return p1(e,t);if(Wb(e))return h1(e,t);if(Yb(e))return m1(e);if(Qb(e))return{type:"receive",stateMutability:"payable"};throw new o1({signature:e})}function d1(e,t={}){const n=Hb(e);if(!n)throw new St({signature:e,type:"function"});const s=we(n.parameters),r=[],o=s.length;for(let c=0;c<o;c++)r.push(tt(s[c],{modifiers:ps,structs:t,type:"function"}));const a=[];if(n.returns){const c=we(n.returns),l=c.length;for(let u=0;u<l;u++)a.push(tt(c[u],{modifiers:ps,structs:t,type:"function"}))}return{name:n.name,type:"function",stateMutability:n.stateMutability??"nonpayable",inputs:r,outputs:a}}function f1(e,t={}){const n=Bb(e);if(!n)throw new St({signature:e,type:"event"});const s=we(n.parameters),r=[],o=s.length;for(let a=0;a<o;a++)r.push(tt(s[a],{modifiers:Xb,structs:t,type:"event"}));return{name:n.name,type:"event",inputs:r}}function p1(e,t={}){const n=$b(e);if(!n)throw new St({signature:e,type:"error"});const s=we(n.parameters),r=[],o=s.length;for(let a=0;a<o;a++)r.push(tt(s[a],{structs:t,type:"error"}));return{name:n.name,type:"error",inputs:r}}function h1(e,t={}){const n=Gb(e);if(!n)throw new St({signature:e,type:"constructor"});const s=we(n.parameters),r=[],o=s.length;for(let a=0;a<o;a++)r.push(tt(s[a],{structs:t,type:"constructor"}));return{type:"constructor",stateMutability:n.stateMutability??"nonpayable",inputs:r}}function m1(e){const t=qb(e);if(!t)throw new St({signature:e,type:"fallback"});return{type:"fallback",stateMutability:t.stateMutability??"nonpayable"}}const g1=/^(?<type>[a-zA-Z$_][a-zA-Z0-9$_]*(?:\spayable)?)(?<array>(?:\[\d*?\])+?)?(?:\s(?<modifier>calldata|indexed|memory|storage{1}))?(?:\s(?<name>[a-zA-Z$_][a-zA-Z0-9$_]*))?$/,b1=/^\((?<type>.+?)\)(?<array>(?:\[\d*?\])+?)?(?:\s(?<modifier>calldata|indexed|memory|storage{1}))?(?:\s(?<name>[a-zA-Z$_][a-zA-Z0-9$_]*))?$/,y1=/^u?int$/;function tt(e,t){const n=l1(e,t?.type,t?.structs);if(zr.has(n))return zr.get(n);const s=Kc.test(e),r=Ve(s?b1:g1,e);if(!r)throw new e1({param:e});if(r.name&&v1(r.name))throw new t1({param:e,name:r.name});const o=r.name?{name:r.name}:{},a=r.modifier==="indexed"?{indexed:!0}:{},c=t?.structs??{};let l,u={};if(s){l="tuple";const p=we(r.type),f=[],h=p.length;for(let m=0;m<h;m++)f.push(tt(p[m],{structs:c}));u={components:f}}else if(r.type in c)l="tuple",u={components:c[r.type]};else if(y1.test(r.type))l=`${r.type}256`;else if(r.type==="address payable")l="address";else if(l=r.type,t?.type!=="struct"&&!al(l))throw new Zb({type:l});if(r.modifier){if(!t?.modifiers?.has?.(r.modifier))throw new n1({param:e,type:t?.type,modifier:r.modifier});if(ps.has(r.modifier)&&!w1(l,!!r.array))throw new r1({param:e,type:t?.type,modifier:r.modifier})}const d={type:`${l}${r.array??""}`,...o,...a,...u};return zr.set(n,d),d}function we(e,t=[],n="",s=0){const r=e.trim().length;for(let o=0;o<r;o++){const a=e[o],c=e.slice(o+1);switch(a){case",":return s===0?we(c,[...t,n.trim()]):we(c,t,`${n}${a}`,s);case"(":return we(c,t,`${n}${a}`,s+1);case")":return we(c,t,`${n}${a}`,s-1);default:return we(c,t,`${n}${a}`,s)}}if(n==="")return t;if(s!==0)throw new c1({current:n,depth:s});return t.push(n.trim()),t}function al(e){return e==="address"||e==="bool"||e==="function"||e==="string"||Qc.test(e)||Xc.test(e)}const x1=/^(?:after|alias|anonymous|apply|auto|byte|calldata|case|catch|constant|copyof|default|defined|error|event|external|false|final|function|immutable|implements|in|indexed|inline|internal|let|mapping|match|memory|mutable|null|of|override|partial|private|promise|public|pure|reference|relocatable|return|returns|sizeof|static|storage|struct|super|supports|switch|this|true|try|typedef|typeof|var|view|virtual)$/;function v1(e){return e==="address"||e==="bool"||e==="function"||e==="string"||e==="tuple"||Qc.test(e)||Xc.test(e)||x1.test(e)}function w1(e,t){return t||e==="bytes"||e==="string"||e==="tuple"}function C1(e){const t={},n=e.length;for(let a=0;a<n;a++){const c=e[a];if(!rl(c))continue;const l=_b(c);if(!l)throw new St({signature:c,type:"struct"});const u=l.properties.split(";"),d=[],p=u.length;for(let f=0;f<p;f++){const m=u[f].trim();if(!m)continue;const g=tt(m,{type:"struct"});d.push(g)}if(!d.length)throw new a1({signature:c});t[l.name]=d}const s={},r=Object.entries(t),o=r.length;for(let a=0;a<o;a++){const[c,l]=r[a];s[c]=il(l,t)}return s}const S1=/^(?<type>[a-zA-Z$_][a-zA-Z0-9$_]*)(?<array>(?:\[\d*?\])+?)?$/;function il(e,t,n=new Set){const s=[],r=e.length;for(let o=0;o<r;o++){const a=e[o];if(Kc.test(a.type))s.push(a);else{const l=Ve(S1,a.type);if(!l?.type)throw new s1({abiParameter:a});const{array:u,type:d}=l;if(d in t){if(n.has(d))throw new i1({type:d});s.push({...a,type:`tuple${u??""}`,components:il(t[d]??[],t,new Set([...n,d]))})}else if(al(d))s.push(a);else throw new Kb({type:d})}}return s}function cl(e){const t=C1(e),n=[],s=e.length;for(let r=0;r<s;r++){const o=e[r];rl(o)||n.push(u1(o,t))}return n}function j1(e){let t=!0,n="",s=0,r="",o=!1;for(let a=0;a<e.length;a++){const c=e[a];if(["(",")",","].includes(c)&&(t=!0),c==="("&&s++,c===")"&&s--,!!t){if(s===0){if(c===" "&&["event","function",""].includes(r))r="";else if(r+=c,c===")"){o=!0;break}continue}if(c===" "){e[a-1]!==","&&n!==","&&n!==",("&&(n="",t=!1);continue}r+=c,n+=c}}if(!o)throw new A("Unable to normalize signature.");return r}const N1=e=>{const t=typeof e=="string"?e:Fb(e);return j1(t)};function ll(e){return Rb(N1(e))}const P1=ll,hn=e=>yt(ll(e),0,4);function mn(e){const{abi:t,args:n=[],name:s}=e,r=st(s,{strict:!1}),o=t.filter(c=>r?c.type==="function"?hn(c)===s:c.type==="event"?P1(c)===s:!1:"name"in c&&c.name===s);if(o.length===0)return;if(o.length===1)return o[0];let a;for(const c of o){if(!("inputs"in c))continue;if(!n||n.length===0){if(!c.inputs||c.inputs.length===0)return c;continue}if(!c.inputs||c.inputs.length===0||c.inputs.length!==n.length)continue;if(n.every((u,d)=>{const p="inputs"in c&&c.inputs[d];return p?hs(u,p):!1})){if(a&&"inputs"in a&&a.inputs){const u=ul(c.inputs,a.inputs,n);if(u)throw new Jg({abiItem:c,type:u[0]},{abiItem:a,type:u[1]})}a=c}}return a||o[0]}function hs(e,t){const n=typeof e,s=t.type;switch(s){case"address":return Oe(e,{strict:!1});case"bool":return n==="boolean";case"function":return n==="string";case"string":return n==="string";default:return s==="tuple"&&"components"in t?Object.values(t.components).every((r,o)=>hs(Object.values(e)[o],r)):/^u?int(8|16|24|32|40|48|56|64|72|80|88|96|104|112|120|128|136|144|152|160|168|176|184|192|200|208|216|224|232|240|248|256)?$/.test(s)?n==="number"||n==="bigint":/^bytes([1-9]|1[0-9]|2[0-9]|3[0-2])?$/.test(s)?n==="string"||e instanceof Uint8Array:/[a-z]+[1-9]{0,3}(\[[0-9]{0,}\])+$/.test(s)?Array.isArray(e)&&e.every(r=>hs(r,{...t,type:s.replace(/(\[[0-9]{0,}\])$/,"")})):!1}}function ul(e,t,n){for(const s in e){const r=e[s],o=t[s];if(r.type==="tuple"&&o.type==="tuple"&&"components"in r&&"components"in o)return ul(r.components,o.components,n[s]);const a=[r.type,o.type];if(a.includes("address")&&a.includes("bytes20")?!0:a.includes("address")&&a.includes("string")?Oe(n[s],{strict:!1}):a.includes("address")&&a.includes("bytes")?Oe(n[s],{strict:!1}):!1)return a}}const $r="/docs/contract/decodeFunctionResult";function co(e){const{abi:t,args:n,functionName:s,data:r}=e;let o=t[0];if(s){const c=mn({abi:t,args:n,name:s});if(!c)throw new bt(s,{docsPath:$r});o=c}if(o.type!=="function")throw new bt(void 0,{docsPath:$r});if(!o.outputs)throw new $c(o.name,{docsPath:$r});const a=io(o.outputs,r);if(a&&a.length>1)return a;if(a&&a.length===1)return a[0]}const ja="/docs/contract/encodeFunctionData";function E1(e){const{abi:t,args:n,functionName:s}=e;let r=t[0];if(s){const o=mn({abi:t,args:n,name:s});if(!o)throw new bt(s,{docsPath:ja});r=o}if(r.type!=="function")throw new bt(void 0,{docsPath:ja});return{abi:[r],functionName:hn(We(r))}}function lo(e){const{args:t}=e,{abi:n,functionName:s}=e.abi.length===1&&e.functionName?.startsWith("0x")?e:E1(e),r=n[0],o=s,a="inputs"in r&&r.inputs?pn(r.inputs,t??[]):void 0;return xr([o,a??"0x"])}class ms extends A{constructor({blockNumber:t,chain:n,contract:s}){super(`Chain "${n.name}" does not support contract "${s.name}".`,{metaMessages:["This could be due to any of the following:",...t&&s.blockCreated&&s.blockCreated>t?[`- The contract "${s.name}" was not deployed until block ${s.blockCreated} (current block ${t}).`]:[`- The chain does not have the contract "${s.name}" configured.`]],name:"ChainDoesNotSupportContract"})}}class dl extends A{constructor(){super("No chain was provided to the Client.",{name:"ClientChainNotConfiguredError"})}}function uo({blockNumber:e,chain:t,contract:n}){const s=t?.contracts?.[n];if(!s)throw new ms({chain:t,contract:{name:n}});if(e&&s.blockCreated&&s.blockCreated>e)throw new ms({blockNumber:e,chain:t,contract:{name:n,blockCreated:s.blockCreated}});return s.address}function vr(e){return typeof e=="string"?{address:e,type:"json-rpc"}:e}const I1={1:"An `assert` condition failed.",17:"Arithmetic operation resulted in underflow or overflow.",18:"Division or modulo by zero (e.g. `5 / 0` or `23 % 0`).",33:"Attempted to convert to an invalid type.",34:"Attempted to access a storage byte array that is incorrectly encoded.",49:"Performed `.pop()` on an empty array",50:"Array index is out of bounds.",65:"Allocated too much memory or created an array which is too large.",81:"Attempted to call a zero-initialized variable of internal function type."},fl={inputs:[{name:"message",type:"string"}],name:"Error",type:"error"},O1={inputs:[{name:"reason",type:"uint256"}],name:"Panic",type:"error"};function pl(e){const{abi:t,data:n}=e,s=yt(n,0,4);if(s==="0x")throw new Xs;const o=[...t||[],fl,O1].find(a=>a.type==="error"&&s===hn(We(a)));if(!o)throw new zc(s,{docsPath:"/docs/contract/decodeErrorResult"});return{abiItem:o,args:"inputs"in o&&o.inputs&&o.inputs.length>0?io(o.inputs,yt(n,4)):void 0,errorName:o.name}}const Ee=(e,t,n)=>JSON.stringify(e,(s,r)=>typeof r=="bigint"?r.toString():r,n);function hl({abiItem:e,args:t,includeFunctionName:n=!0,includeName:s=!1}){if("name"in e&&"inputs"in e&&e.inputs)return`${n?e.name:""}(${e.inputs.map((r,o)=>`${s&&r.name?`${r.name}: `:""}${typeof t[o]=="object"?Ee(t[o]):t[o]}`).join(", ")})`}const k1={gwei:9,wei:18},M1={ether:-9,wei:9};function ml(e,t){let n=e.toString();const s=n.startsWith("-");s&&(n=n.slice(1)),n=n.padStart(t,"0");let[r,o]=[n.slice(0,n.length-t),n.slice(n.length-t)];return o=o.replace(/(0+)$/,""),`${s?"-":""}${r||"0"}${o?`.${o}`:""}`}function T1(e,t="wei"){return ml(e,k1[t])}function Qe(e,t="wei"){return ml(e,M1[t])}class A1 extends A{constructor({address:t}){super(`State for account "${t}" is set multiple times.`,{name:"AccountStateConflictError"})}}class D1 extends A{constructor(){super("state and stateDiff are set on the same account.",{name:"StateAssignmentConflictError"})}}function Na(e){return e.reduce((t,{slot:n,value:s})=>`${t} ${n}: ${s}
26
- `,"")}function R1(e){return e.reduce((t,{address:n,...s})=>{let r=`${t} ${n}:
27
- `;return s.nonce&&(r+=` nonce: ${s.nonce}
28
- `),s.balance&&(r+=` balance: ${s.balance}
29
- `),s.code&&(r+=` code: ${s.code}
30
- `),s.state&&(r+=` state:
31
- `,r+=Na(s.state)),s.stateDiff&&(r+=` stateDiff:
32
- `,r+=Na(s.stateDiff)),r},` State Override:
33
- `).slice(0,-1)}function gl(e){const t=Object.entries(e).map(([s,r])=>r===void 0||r===!1?null:[s,r]).filter(Boolean),n=t.reduce((s,[r])=>Math.max(s,r.length),0);return t.map(([s,r])=>` ${`${s}:`.padEnd(n+1)} ${r}`).join(`
34
- `)}class L1 extends A{constructor(){super(["Cannot specify both a `gasPrice` and a `maxFeePerGas`/`maxPriorityFeePerGas`.","Use `maxFeePerGas`/`maxPriorityFeePerGas` for EIP-1559 compatible networks, and `gasPrice` for others."].join(`
35
- `),{name:"FeeConflictError"})}}const F1=e=>e,gn=e=>e;class z1 extends A{constructor(t,{account:n,docsPath:s,chain:r,data:o,gas:a,gasPrice:c,maxFeePerGas:l,maxPriorityFeePerGas:u,nonce:d,to:p,value:f,stateOverride:h}){const m=n?vr(n):void 0;let g=gl({from:m?.address,to:p,value:typeof f<"u"&&`${T1(f)} ${r?.nativeCurrency?.symbol||"ETH"}`,data:o,gas:a,gasPrice:typeof c<"u"&&`${Qe(c)} gwei`,maxFeePerGas:typeof l<"u"&&`${Qe(l)} gwei`,maxPriorityFeePerGas:typeof u<"u"&&`${Qe(u)} gwei`,nonce:d});h&&(g+=`
36
- ${R1(h)}`),super(t.shortMessage,{cause:t,docsPath:s,metaMessages:[...t.metaMessages?[...t.metaMessages," "]:[],"Raw Call Arguments:",g].filter(Boolean),name:"CallExecutionError"}),Object.defineProperty(this,"cause",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.cause=t}}class $1 extends A{constructor(t,{abi:n,args:s,contractAddress:r,docsPath:o,functionName:a,sender:c}){const l=mn({abi:n,args:s,name:a}),u=l?hl({abiItem:l,args:s,includeFunctionName:!1,includeName:!1}):void 0,d=l?We(l,{includeName:!0}):void 0,p=gl({address:r&&F1(r),function:d,args:u&&u!=="()"&&`${[...Array(a?.length??0).keys()].map(()=>" ").join("")}${u}`,sender:c});super(t.shortMessage||`An unknown error occurred while executing the contract function "${a}".`,{cause:t,docsPath:o,metaMessages:[...t.metaMessages?[...t.metaMessages," "]:[],p&&"Contract Call:",p].filter(Boolean),name:"ContractFunctionExecutionError"}),Object.defineProperty(this,"abi",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"args",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"cause",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"contractAddress",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"formattedArgs",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"functionName",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"sender",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.abi=n,this.args=s,this.cause=t,this.contractAddress=r,this.functionName=a,this.sender=c}}class gs extends A{constructor({abi:t,data:n,functionName:s,message:r}){let o,a,c,l;if(n&&n!=="0x")try{a=pl({abi:t,data:n});const{abiItem:d,errorName:p,args:f}=a;if(p==="Error")l=f[0];else if(p==="Panic"){const[h]=f;l=I1[h]}else{const h=d?We(d,{includeName:!0}):void 0,m=d&&f?hl({abiItem:d,args:f,includeFunctionName:!1,includeName:!1}):void 0;c=[h?`Error: ${h}`:"",m&&m!=="()"?` ${[...Array(p?.length??0).keys()].map(()=>" ").join("")}${m}`:""]}}catch(d){o=d}else r&&(l=r);let u;o instanceof zc&&(u=o.signature,c=[`Unable to decode signature "${u}" as it was not found on the provided ABI.`,"Make sure you are using the correct ABI and that the error exists on it.",`You can look up the decoded signature here: https://openchain.xyz/signatures?query=${u}.`]),super(l&&l!=="execution reverted"||u?[`The contract function "${s}" reverted with the following ${u?"signature":"reason"}:`,l||u].join(`
37
- `):`The contract function "${s}" reverted.`,{cause:o,metaMessages:c,name:"ContractFunctionRevertedError"}),Object.defineProperty(this,"data",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"raw",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"reason",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"signature",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.data=a,this.raw=n,this.reason=l,this.signature=u}}class V1 extends A{constructor({functionName:t}){super(`The contract function "${t}" returned no data ("0x").`,{metaMessages:["This could be due to any of the following:",` - The contract does not have the function "${t}",`," - The parameters passed to the contract function may be invalid, or"," - The address is not a contract."],name:"ContractFunctionZeroDataError"})}}class B1 extends A{constructor({factory:t}){super(`Deployment for counterfactual contract call failed${t?` for factory "${t}".`:""}`,{metaMessages:["Please ensure:","- The `factory` is a valid contract deployment factory (ie. Create2 Factory, ERC-4337 Factory, etc).","- The `factoryData` is a valid encoded function call for contract deployment function on the factory."],name:"CounterfactualDeploymentFailedError"})}}class bl extends A{constructor({data:t,message:n}){super(n||"",{name:"RawContractError"}),Object.defineProperty(this,"code",{enumerable:!0,configurable:!0,writable:!0,value:3}),Object.defineProperty(this,"data",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.data=t}}function yl(e){if(!(e instanceof A))return!1;const t=e.walk(n=>n instanceof gs);return t instanceof gs?t.data?.errorName==="HttpError"||t.data?.errorName==="ResolverError"||t.data?.errorName==="ResolverNotContract"||t.data?.errorName==="ResolverNotFound"||t.data?.errorName==="ReverseAddressMismatch"||t.data?.errorName==="UnsupportedResolverProfile":!1}function U1(e){const{abi:t,data:n}=e,s=yt(n,0,4),r=t.find(o=>o.type==="function"&&s===hn(We(o)));if(!r)throw new qg(s,{docsPath:"/docs/contract/decodeFunctionData"});return{functionName:r.name,args:"inputs"in r&&r.inputs&&r.inputs.length>0?io(r.inputs,yt(n,4)):void 0}}const Vr="/docs/contract/encodeErrorResult";function Pa(e){const{abi:t,errorName:n,args:s}=e;let r=t[0];if(n){const l=mn({abi:t,args:s,name:n});if(!l)throw new ya(n,{docsPath:Vr});r=l}if(r.type!=="error")throw new ya(void 0,{docsPath:Vr});const o=We(r),a=hn(o);let c="0x";if(s&&s.length>0){if(!r.inputs)throw new Yg(r.name,{docsPath:Vr});c=pn(r.inputs,s)}return xr([a,c])}const Br="/docs/contract/encodeFunctionResult";function H1(e){const{abi:t,functionName:n,result:s}=e;let r=t[0];if(n){const a=mn({abi:t,name:n});if(!a)throw new bt(n,{docsPath:Br});r=a}if(r.type!=="function")throw new bt(void 0,{docsPath:Br});if(!r.outputs)throw new $c(r.name,{docsPath:Br});const o=(()=>{if(r.outputs.length===0)return[];if(r.outputs.length===1)return[s];if(Array.isArray(s))return s;throw new Vc(s)})();return pn(r.outputs,o)}const wr="x-batch-gateway:true";async function xl(e){const{data:t,ccipRequest:n}=e,{args:[s]}=U1({abi:cs,data:t}),r=[],o=[];return await Promise.all(s.map(async(a,c)=>{try{o[c]=a.urls.includes(wr)?await xl({data:a.data,ccipRequest:n}):await n(a),r[c]=!1}catch(l){r[c]=!0,o[c]=_1(l)}})),H1({abi:cs,functionName:"query",result:[r,o]})}function _1(e){return e.name==="HttpRequestError"&&e.status?Pa({abi:cs,errorName:"HttpError",args:[e.status,e.shortMessage]}):Pa({abi:[fl],errorName:"Error",args:["shortMessage"in e?e.shortMessage:e.message]})}function vl(e){if(e.length!==66||e.indexOf("[")!==0||e.indexOf("]")!==65)return null;const t=`0x${e.slice(1,65)}`;return st(t)?t:null}function W1(e){let t=new Uint8Array(32).fill(0);if(!e)return xe(t);const n=e.split(".");for(let s=n.length-1;s>=0;s-=1){const r=vl(n[s]),o=r?eo(r):Vt(Je(n[s]),"bytes");t=Vt(Ge([t,o]),"bytes")}return xe(t)}function G1(e){return`[${e.slice(2)}]`}function Y1(e){const t=new Uint8Array(32).fill(0);return e?vl(e)||Vt(Je(e)):xe(t)}function q1(e){const t=e.replace(/^\.|\.$/gm,"");if(t.length===0)return new Uint8Array(1);const n=new Uint8Array(Je(t).byteLength+2);let s=0;const r=t.split(".");for(let o=0;o<r.length;o++){let a=Je(r[o]);a.byteLength>255&&(a=Je(G1(Y1(r[o])))),n[s]=a.length,n.set(a,s+1),s+=a.length+1}return n.byteLength!==s+1?n.slice(0,s+1):n}function Cr(e,t,n){const s=e[t.name];if(typeof s=="function")return s;const r=e[n];return typeof r=="function"?r:o=>t(e,o)}class Xe extends A{constructor({body:t,cause:n,details:s,headers:r,status:o,url:a}){super("HTTP request failed.",{cause:n,details:s,metaMessages:[o&&`Status: ${o}`,`URL: ${gn(a)}`,t&&`Request body: ${Ee(t)}`].filter(Boolean),name:"HttpRequestError"}),Object.defineProperty(this,"body",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"headers",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"status",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"url",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.body=t,this.headers=r,this.status=o,this.url=a}}class fo extends A{constructor({body:t,error:n,url:s}){super("RPC Request failed.",{cause:n,details:n.message,metaMessages:[`URL: ${gn(s)}`,`Request body: ${Ee(t)}`],name:"RpcRequestError"}),Object.defineProperty(this,"code",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"data",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.code=n.code,this.data=n.data}}class Ea extends A{constructor({body:t,url:n}){super("The request took too long to respond.",{details:"The request timed out.",metaMessages:[`URL: ${gn(n)}`,`Request body: ${Ee(t)}`],name:"TimeoutError"})}}const J1=-1;class me extends A{constructor(t,{code:n,docsPath:s,metaMessages:r,name:o,shortMessage:a}){super(a,{cause:t,docsPath:s,metaMessages:r||t?.metaMessages,name:o||"RpcError"}),Object.defineProperty(this,"code",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.name=o||t.name,this.code=t instanceof fo?t.code:n??J1}}class ye extends me{constructor(t,n){super(t,n),Object.defineProperty(this,"data",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.data=n.data}}class Ut extends me{constructor(t){super(t,{code:Ut.code,name:"ParseRpcError",shortMessage:"Invalid JSON was received by the server. An error occurred on the server while parsing the JSON text."})}}Object.defineProperty(Ut,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32700});class Ht extends me{constructor(t){super(t,{code:Ht.code,name:"InvalidRequestRpcError",shortMessage:"JSON is not a valid request object."})}}Object.defineProperty(Ht,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32600});class _t extends me{constructor(t,{method:n}={}){super(t,{code:_t.code,name:"MethodNotFoundRpcError",shortMessage:`The method${n?` "${n}"`:""} does not exist / is not available.`})}}Object.defineProperty(_t,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32601});class Wt extends me{constructor(t){super(t,{code:Wt.code,name:"InvalidParamsRpcError",shortMessage:["Invalid parameters were provided to the RPC method.","Double check you have provided the correct parameters."].join(`
38
- `)})}}Object.defineProperty(Wt,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32602});class nt extends me{constructor(t){super(t,{code:nt.code,name:"InternalRpcError",shortMessage:"An internal error was received."})}}Object.defineProperty(nt,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32603});class Gt extends me{constructor(t){super(t,{code:Gt.code,name:"InvalidInputRpcError",shortMessage:["Missing or invalid parameters.","Double check you have provided the correct parameters."].join(`
39
- `)})}}Object.defineProperty(Gt,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32e3});class Yt extends me{constructor(t){super(t,{code:Yt.code,name:"ResourceNotFoundRpcError",shortMessage:"Requested resource not found."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ResourceNotFoundRpcError"})}}Object.defineProperty(Yt,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32001});class _e extends me{constructor(t){super(t,{code:_e.code,name:"ResourceUnavailableRpcError",shortMessage:"Requested resource not available."})}}Object.defineProperty(_e,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32002});class qt extends me{constructor(t){super(t,{code:qt.code,name:"TransactionRejectedRpcError",shortMessage:"Transaction creation failed."})}}Object.defineProperty(qt,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32003});class qe extends me{constructor(t,{method:n}={}){super(t,{code:qe.code,name:"MethodNotSupportedRpcError",shortMessage:`Method${n?` "${n}"`:""} is not supported.`})}}Object.defineProperty(qe,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32004});class xt extends me{constructor(t){super(t,{code:xt.code,name:"LimitExceededRpcError",shortMessage:"Request exceeds defined limit."})}}Object.defineProperty(xt,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32005});class Jt extends me{constructor(t){super(t,{code:Jt.code,name:"JsonRpcVersionUnsupportedError",shortMessage:"Version of JSON-RPC protocol is not supported."})}}Object.defineProperty(Jt,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32006});class fe extends ye{constructor(t){super(t,{code:fe.code,name:"UserRejectedRequestError",shortMessage:"User rejected the request."})}}Object.defineProperty(fe,"code",{enumerable:!0,configurable:!0,writable:!0,value:4001});class Qt extends ye{constructor(t){super(t,{code:Qt.code,name:"UnauthorizedProviderError",shortMessage:"The requested method and/or account has not been authorized by the user."})}}Object.defineProperty(Qt,"code",{enumerable:!0,configurable:!0,writable:!0,value:4100});class Xt extends ye{constructor(t,{method:n}={}){super(t,{code:Xt.code,name:"UnsupportedProviderMethodError",shortMessage:`The Provider does not support the requested method${n?` " ${n}"`:""}.`})}}Object.defineProperty(Xt,"code",{enumerable:!0,configurable:!0,writable:!0,value:4200});class Kt extends ye{constructor(t){super(t,{code:Kt.code,name:"ProviderDisconnectedError",shortMessage:"The Provider is disconnected from all chains."})}}Object.defineProperty(Kt,"code",{enumerable:!0,configurable:!0,writable:!0,value:4900});class Zt extends ye{constructor(t){super(t,{code:Zt.code,name:"ChainDisconnectedError",shortMessage:"The Provider is not connected to the requested chain."})}}Object.defineProperty(Zt,"code",{enumerable:!0,configurable:!0,writable:!0,value:4901});class rt extends ye{constructor(t){super(t,{code:rt.code,name:"SwitchChainError",shortMessage:"An error occurred when attempting to switch chain."})}}Object.defineProperty(rt,"code",{enumerable:!0,configurable:!0,writable:!0,value:4902});class en extends ye{constructor(t){super(t,{code:en.code,name:"UnsupportedNonOptionalCapabilityError",shortMessage:"This Wallet does not support a capability that was not marked as optional."})}}Object.defineProperty(en,"code",{enumerable:!0,configurable:!0,writable:!0,value:5700});class tn extends ye{constructor(t){super(t,{code:tn.code,name:"UnsupportedChainIdError",shortMessage:"This Wallet does not support the requested chain ID."})}}Object.defineProperty(tn,"code",{enumerable:!0,configurable:!0,writable:!0,value:5710});class nn extends ye{constructor(t){super(t,{code:nn.code,name:"DuplicateIdError",shortMessage:"There is already a bundle submitted with this ID."})}}Object.defineProperty(nn,"code",{enumerable:!0,configurable:!0,writable:!0,value:5720});class rn extends ye{constructor(t){super(t,{code:rn.code,name:"UnknownBundleIdError",shortMessage:"This bundle id is unknown / has not been submitted"})}}Object.defineProperty(rn,"code",{enumerable:!0,configurable:!0,writable:!0,value:5730});class sn extends ye{constructor(t){super(t,{code:sn.code,name:"BundleTooLargeError",shortMessage:"The call bundle is too large for the Wallet to process."})}}Object.defineProperty(sn,"code",{enumerable:!0,configurable:!0,writable:!0,value:5740});class on extends ye{constructor(t){super(t,{code:on.code,name:"AtomicReadyWalletRejectedUpgradeError",shortMessage:"The Wallet can support atomicity after an upgrade, but the user rejected the upgrade."})}}Object.defineProperty(on,"code",{enumerable:!0,configurable:!0,writable:!0,value:5750});class an extends ye{constructor(t){super(t,{code:an.code,name:"AtomicityNotSupportedError",shortMessage:"The wallet does not support atomic execution but the request requires it."})}}Object.defineProperty(an,"code",{enumerable:!0,configurable:!0,writable:!0,value:5760});class Q1 extends me{constructor(t){super(t,{name:"UnknownRpcError",shortMessage:"An unknown RPC error occurred."})}}const X1=3;function K1(e,{abi:t,address:n,args:s,docsPath:r,functionName:o,sender:a}){const c=e instanceof bl?e:e instanceof A?e.walk(m=>"data"in m)||e.walk():{},{code:l,data:u,details:d,message:p,shortMessage:f}=c,h=e instanceof Xs?new V1({functionName:o}):[X1,nt.code].includes(l)&&(u||d||p||f)?new gs({abi:t,data:typeof u=="object"?u.data:u,functionName:o,message:c instanceof fo?d:f??p}):e;return new $1(h,{abi:t,args:s,contractAddress:n,docsPath:r,functionName:o,sender:a})}const Z1="0.1.1";function ey(){return Z1}let wl=class bs extends Error{constructor(t,n={}){const s=(()=>{if(n.cause instanceof bs){if(n.cause.details)return n.cause.details;if(n.cause.shortMessage)return n.cause.shortMessage}return n.cause&&"details"in n.cause&&typeof n.cause.details=="string"?n.cause.details:n.cause?.message?n.cause.message:n.details})(),r=n.cause instanceof bs&&n.cause.docsPath||n.docsPath,a=`https://oxlib.sh${r??""}`,c=[t||"An error occurred.",...n.metaMessages?["",...n.metaMessages]:[],...s||r?["",s?`Details: ${s}`:void 0,r?`See: ${a}`:void 0]:[]].filter(l=>typeof l=="string").join(`
40
- `);super(c,n.cause?{cause:n.cause}:void 0),Object.defineProperty(this,"details",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"docs",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"docsPath",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"shortMessage",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"cause",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"BaseError"}),Object.defineProperty(this,"version",{enumerable:!0,configurable:!0,writable:!0,value:`ox@${ey()}`}),this.cause=n.cause,this.details=s,this.docs=a,this.docsPath=r,this.shortMessage=t}walk(t){return Cl(this,t)}};function Cl(e,t){return t?.(e)?e:e&&typeof e=="object"&&"cause"in e&&e.cause?Cl(e.cause,t):t?null:e}function ty(e,t={}){const{dir:n,size:s=32}=t;if(s===0)return e;const r=e.replace("0x","");if(r.length>s*2)throw new sy({size:Math.ceil(r.length/2),targetSize:s,type:"Hex"});return`0x${r[n==="right"?"padEnd":"padStart"](s*2,"0")}`}function Ae(e,t={}){const{signed:n,size:s}=t,r=BigInt(e);let o;s?n?o=(1n<<BigInt(s)*8n-1n)-1n:o=2n**(BigInt(s)*8n)-1n:typeof e=="number"&&(o=BigInt(Number.MAX_SAFE_INTEGER));const a=typeof o=="bigint"&&n?-o-1n:0;if(o&&r>o||r<a){const u=typeof e=="bigint"?"n":"";throw new ry({max:o?`${o}${u}`:void 0,min:`${a}${u}`,signed:n,size:s,value:`${e}${u}`})}const l=`0x${(n&&r<0?(1n<<BigInt(s*8))+BigInt(r):r).toString(16)}`;return s?ny(l,s):l}function ny(e,t){return ty(e,{dir:"left",size:t})}class ry extends wl{constructor({max:t,min:n,signed:s,size:r,value:o}){super(`Number \`${o}\` is not in safe${r?` ${r*8}-bit`:""}${s?" signed":" unsigned"} integer range ${t?`(\`${n}\` to \`${t}\`)`:`(above \`${n}\`)`}`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Hex.IntegerOutOfRangeError"})}}class sy extends wl{constructor({size:t,targetSize:n,type:s}){super(`${s.charAt(0).toUpperCase()}${s.slice(1).toLowerCase()} size (\`${t}\`) exceeds padding size (\`${n}\`).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Hex.SizeExceedsPaddingSizeError"})}}function oy(e){return{address:e.address,amount:Ae(e.amount),index:Ae(e.index),validatorIndex:Ae(e.validatorIndex)}}function ay(e){return{...typeof e.baseFeePerGas=="bigint"&&{baseFeePerGas:Ae(e.baseFeePerGas)},...typeof e.blobBaseFee=="bigint"&&{blobBaseFee:Ae(e.blobBaseFee)},...typeof e.feeRecipient=="string"&&{feeRecipient:e.feeRecipient},...typeof e.gasLimit=="bigint"&&{gasLimit:Ae(e.gasLimit)},...typeof e.number=="bigint"&&{number:Ae(e.number)},...typeof e.prevRandao=="bigint"&&{prevRandao:Ae(e.prevRandao)},...typeof e.time=="bigint"&&{time:Ae(e.time)},...e.withdrawals&&{withdrawals:e.withdrawals.map(oy)}}}const iy="0x82ad56cb",cy="0x608060405234801561001057600080fd5b5060405161018e38038061018e83398101604081905261002f91610124565b6000808351602085016000f59050803b61004857600080fd5b6000808351602085016000855af16040513d6000823e81610067573d81fd5b3d81f35b634e487b7160e01b600052604160045260246000fd5b600082601f83011261009257600080fd5b81516001600160401b038111156100ab576100ab61006b565b604051601f8201601f19908116603f011681016001600160401b03811182821017156100d9576100d961006b565b6040528181528382016020018510156100f157600080fd5b60005b82811015610110576020818601810151838301820152016100f4565b506000918101602001919091529392505050565b6000806040838503121561013757600080fd5b82516001600160401b0381111561014d57600080fd5b61015985828601610081565b602085015190935090506001600160401b0381111561017757600080fd5b61018385828601610081565b915050925092905056fe",ly="0x608060405234801561001057600080fd5b506040516102c03803806102c083398101604081905261002f916101e6565b836001600160a01b03163b6000036100e457600080836001600160a01b03168360405161005c9190610270565b6000604051808303816000865af19150503d8060008114610099576040519150601f19603f3d011682016040523d82523d6000602084013e61009e565b606091505b50915091508115806100b857506001600160a01b0386163b155b156100e1578060405163101bb98d60e01b81526004016100d8919061028c565b60405180910390fd5b50505b6000808451602086016000885af16040513d6000823e81610103573d81fd5b3d81f35b80516001600160a01b038116811461011e57600080fd5b919050565b634e487b7160e01b600052604160045260246000fd5b60005b8381101561015457818101518382015260200161013c565b50506000910152565b600082601f83011261016e57600080fd5b81516001600160401b0381111561018757610187610123565b604051601f8201601f19908116603f011681016001600160401b03811182821017156101b5576101b5610123565b6040528181528382016020018510156101cd57600080fd5b6101de826020830160208701610139565b949350505050565b600080600080608085870312156101fc57600080fd5b61020585610107565b60208601519094506001600160401b0381111561022157600080fd5b61022d8782880161015d565b93505061023c60408601610107565b60608601519092506001600160401b0381111561025857600080fd5b6102648782880161015d565b91505092959194509250565b60008251610282818460208701610139565b9190910192915050565b60208152600082518060208401526102ab816040850160208701610139565b601f01601f1916919091016040019291505056fe",uy="0x608060405234801561001057600080fd5b506115b9806100206000396000f3fe6080604052600436106100f35760003560e01c80634d2301cc1161008a578063a8b0574e11610059578063a8b0574e14610325578063bce38bd714610350578063c3077fa914610380578063ee82ac5e146103b2576100f3565b80634d2301cc1461026257806372425d9d1461029f57806382ad56cb146102ca57806386d516e8146102fa576100f3565b80633408e470116100c65780633408e470146101af578063399542e9146101da5780633e64a6961461020c57806342cbb15c14610237576100f3565b80630f28c97d146100f8578063174dea7114610123578063252dba421461015357806327e86d6e14610184575b600080fd5b34801561010457600080fd5b5061010d6103ef565b60405161011a9190610c0a565b60405180910390f35b61013d60048036038101906101389190610c94565b6103f7565b60405161014a9190610e94565b60405180910390f35b61016d60048036038101906101689190610f0c565b610615565b60405161017b92919061101b565b60405180910390f35b34801561019057600080fd5b506101996107ab565b6040516101a69190611064565b60405180910390f35b3480156101bb57600080fd5b506101c46107b7565b6040516101d19190610c0a565b60405180910390f35b6101f460048036038101906101ef91906110ab565b6107bf565b6040516102039392919061110b565b60405180910390f35b34801561021857600080fd5b506102216107e1565b60405161022e9190610c0a565b60405180910390f35b34801561024357600080fd5b5061024c6107e9565b6040516102599190610c0a565b60405180910390f35b34801561026e57600080fd5b50610289600480360381019061028491906111a7565b6107f1565b6040516102969190610c0a565b60405180910390f35b3480156102ab57600080fd5b506102b4610812565b6040516102c19190610c0a565b60405180910390f35b6102e460048036038101906102df919061122a565b61081a565b6040516102f19190610e94565b60405180910390f35b34801561030657600080fd5b5061030f6109e4565b60405161031c9190610c0a565b60405180910390f35b34801561033157600080fd5b5061033a6109ec565b6040516103479190611286565b60405180910390f35b61036a600480360381019061036591906110ab565b6109f4565b6040516103779190610e94565b60405180910390f35b61039a60048036038101906103959190610f0c565b610ba6565b6040516103a99392919061110b565b60405180910390f35b3480156103be57600080fd5b506103d960048036038101906103d491906112cd565b610bca565b6040516103e69190611064565b60405180910390f35b600042905090565b60606000808484905090508067ffffffffffffffff81111561041c5761041b6112fa565b5b60405190808252806020026020018201604052801561045557816020015b610442610bd5565b81526020019060019003908161043a5790505b5092503660005b828110156105c957600085828151811061047957610478611329565b5b6020026020010151905087878381811061049657610495611329565b5b90506020028101906104a89190611367565b925060008360400135905080860195508360000160208101906104cb91906111a7565b73ffffffffffffffffffffffffffffffffffffffff16818580606001906104f2919061138f565b604051610500929190611431565b60006040518083038185875af1925050503d806000811461053d576040519150601f19603f3d011682016040523d82523d6000602084013e610542565b606091505b5083600001846020018290528215151515815250505081516020850135176105bc577f08c379a000000000000000000000000000000000000000000000000000000000600052602060045260176024527f4d756c746963616c6c333a2063616c6c206661696c656400000000000000000060445260846000fd5b826001019250505061045c565b5082341461060c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610603906114a7565b60405180910390fd5b50505092915050565b6000606043915060008484905090508067ffffffffffffffff81111561063e5761063d6112fa565b5b60405190808252806020026020018201604052801561067157816020015b606081526020019060019003908161065c5790505b5091503660005b828110156107a157600087878381811061069557610694611329565b5b90506020028101906106a791906114c7565b92508260000160208101906106bc91906111a7565b73ffffffffffffffffffffffffffffffffffffffff168380602001906106e2919061138f565b6040516106f0929190611431565b6000604051808303816000865af19150503d806000811461072d576040519150601f19603f3d011682016040523d82523d6000602084013e610732565b606091505b5086848151811061074657610745611329565b5b60200260200101819052819250505080610795576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161078c9061153b565b60405180910390fd5b81600101915050610678565b5050509250929050565b60006001430340905090565b600046905090565b6000806060439250434091506107d68686866109f4565b905093509350939050565b600048905090565b600043905090565b60008173ffffffffffffffffffffffffffffffffffffffff16319050919050565b600044905090565b606060008383905090508067ffffffffffffffff81111561083e5761083d6112fa565b5b60405190808252806020026020018201604052801561087757816020015b610864610bd5565b81526020019060019003908161085c5790505b5091503660005b828110156109db57600084828151811061089b5761089a611329565b5b602002602001015190508686838181106108b8576108b7611329565b5b90506020028101906108ca919061155b565b92508260000160208101906108df91906111a7565b73ffffffffffffffffffffffffffffffffffffffff16838060400190610905919061138f565b604051610913929190611431565b6000604051808303816000865af19150503d8060008114610950576040519150601f19603f3d011682016040523d82523d6000602084013e610955565b606091505b5082600001836020018290528215151515815250505080516020840135176109cf577f08c379a000000000000000000000000000000000000000000000000000000000600052602060045260176024527f4d756c746963616c6c333a2063616c6c206661696c656400000000000000000060445260646000fd5b8160010191505061087e565b50505092915050565b600045905090565b600041905090565b606060008383905090508067ffffffffffffffff811115610a1857610a176112fa565b5b604051908082528060200260200182016040528015610a5157816020015b610a3e610bd5565b815260200190600190039081610a365790505b5091503660005b82811015610b9c576000848281518110610a7557610a74611329565b5b60200260200101519050868683818110610a9257610a91611329565b5b9050602002810190610aa491906114c7565b9250826000016020810190610ab991906111a7565b73ffffffffffffffffffffffffffffffffffffffff16838060200190610adf919061138f565b604051610aed929190611431565b6000604051808303816000865af19150503d8060008114610b2a576040519150601f19603f3d011682016040523d82523d6000602084013e610b2f565b606091505b508260000183602001829052821515151581525050508715610b90578060000151610b8f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b869061153b565b60405180910390fd5b5b81600101915050610a58565b5050509392505050565b6000806060610bb7600186866107bf565b8093508194508295505050509250925092565b600081409050919050565b6040518060400160405280600015158152602001606081525090565b6000819050919050565b610c0481610bf1565b82525050565b6000602082019050610c1f6000830184610bfb565b92915050565b600080fd5b600080fd5b600080fd5b600080fd5b600080fd5b60008083601f840112610c5457610c53610c2f565b5b8235905067ffffffffffffffff811115610c7157610c70610c34565b5b602083019150836020820283011115610c8d57610c8c610c39565b5b9250929050565b60008060208385031215610cab57610caa610c25565b5b600083013567ffffffffffffffff811115610cc957610cc8610c2a565b5b610cd585828601610c3e565b92509250509250929050565b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b60008115159050919050565b610d2281610d0d565b82525050565b600081519050919050565b600082825260208201905092915050565b60005b83811015610d62578082015181840152602081019050610d47565b83811115610d71576000848401525b50505050565b6000601f19601f8301169050919050565b6000610d9382610d28565b610d9d8185610d33565b9350610dad818560208601610d44565b610db681610d77565b840191505092915050565b6000604083016000830151610dd96000860182610d19565b5060208301518482036020860152610df18282610d88565b9150508091505092915050565b6000610e0a8383610dc1565b905092915050565b6000602082019050919050565b6000610e2a82610ce1565b610e348185610cec565b935083602082028501610e4685610cfd565b8060005b85811015610e825784840389528151610e638582610dfe565b9450610e6e83610e12565b925060208a01995050600181019050610e4a565b50829750879550505050505092915050565b60006020820190508181036000830152610eae8184610e1f565b905092915050565b60008083601f840112610ecc57610ecb610c2f565b5b8235905067ffffffffffffffff811115610ee957610ee8610c34565b5b602083019150836020820283011115610f0557610f04610c39565b5b9250929050565b60008060208385031215610f2357610f22610c25565b5b600083013567ffffffffffffffff811115610f4157610f40610c2a565b5b610f4d85828601610eb6565b92509250509250929050565b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b6000610f918383610d88565b905092915050565b6000602082019050919050565b6000610fb182610f59565b610fbb8185610f64565b935083602082028501610fcd85610f75565b8060005b858110156110095784840389528151610fea8582610f85565b9450610ff583610f99565b925060208a01995050600181019050610fd1565b50829750879550505050505092915050565b60006040820190506110306000830185610bfb565b81810360208301526110428184610fa6565b90509392505050565b6000819050919050565b61105e8161104b565b82525050565b60006020820190506110796000830184611055565b92915050565b61108881610d0d565b811461109357600080fd5b50565b6000813590506110a58161107f565b92915050565b6000806000604084860312156110c4576110c3610c25565b5b60006110d286828701611096565b935050602084013567ffffffffffffffff8111156110f3576110f2610c2a565b5b6110ff86828701610eb6565b92509250509250925092565b60006060820190506111206000830186610bfb565b61112d6020830185611055565b818103604083015261113f8184610e1f565b9050949350505050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b600061117482611149565b9050919050565b61118481611169565b811461118f57600080fd5b50565b6000813590506111a18161117b565b92915050565b6000602082840312156111bd576111bc610c25565b5b60006111cb84828501611192565b91505092915050565b60008083601f8401126111ea576111e9610c2f565b5b8235905067ffffffffffffffff81111561120757611206610c34565b5b60208301915083602082028301111561122357611222610c39565b5b9250929050565b6000806020838503121561124157611240610c25565b5b600083013567ffffffffffffffff81111561125f5761125e610c2a565b5b61126b858286016111d4565b92509250509250929050565b61128081611169565b82525050565b600060208201905061129b6000830184611277565b92915050565b6112aa81610bf1565b81146112b557600080fd5b50565b6000813590506112c7816112a1565b92915050565b6000602082840312156112e3576112e2610c25565b5b60006112f1848285016112b8565b91505092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b600080fd5b600080fd5b600080fd5b60008235600160800383360303811261138357611382611358565b5b80830191505092915050565b600080833560016020038436030381126113ac576113ab611358565b5b80840192508235915067ffffffffffffffff8211156113ce576113cd61135d565b5b6020830192506001820236038313156113ea576113e9611362565b5b509250929050565b600081905092915050565b82818337600083830152505050565b600061141883856113f2565b93506114258385846113fd565b82840190509392505050565b600061143e82848661140c565b91508190509392505050565b600082825260208201905092915050565b7f4d756c746963616c6c333a2076616c7565206d69736d61746368000000000000600082015250565b6000611491601a8361144a565b915061149c8261145b565b602082019050919050565b600060208201905081810360008301526114c081611484565b9050919050565b6000823560016040038336030381126114e3576114e2611358565b5b80830191505092915050565b7f4d756c746963616c6c333a2063616c6c206661696c6564000000000000000000600082015250565b600061152560178361144a565b9150611530826114ef565b602082019050919050565b6000602082019050818103600083015261155481611518565b9050919050565b60008235600160600383360303811261157757611576611358565b5b8083019150509291505056fea264697066735822122020c1bc9aacf8e4a6507193432a895a8e77094f45a1395583f07b24e860ef06cd64736f6c634300080c0033",Ur="/docs/contract/encodeDeployData";function Sl(e){const{abi:t,args:n,bytecode:s}=e;if(!n||n.length===0)return s;const r=t.find(a=>"type"in a&&a.type==="constructor");if(!r)throw new Ug({docsPath:Ur});if(!("inputs"in r))throw new ba({docsPath:Ur});if(!r.inputs||r.inputs.length===0)throw new ba({docsPath:Ur});const o=pn(r.inputs,n);return xr([s,o])}class ut extends A{constructor({cause:t,message:n}={}){const s=n?.replace("execution reverted: ","")?.replace("execution reverted","");super(`Execution reverted ${s?`with reason: ${s}`:"for an unknown reason"}.`,{cause:t,name:"ExecutionRevertedError"})}}Object.defineProperty(ut,"code",{enumerable:!0,configurable:!0,writable:!0,value:3});Object.defineProperty(ut,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/execution reverted/});class Zn extends A{constructor({cause:t,maxFeePerGas:n}={}){super(`The fee cap (\`maxFeePerGas\`${n?` = ${Qe(n)} gwei`:""}) cannot be higher than the maximum allowed value (2^256-1).`,{cause:t,name:"FeeCapTooHighError"})}}Object.defineProperty(Zn,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/max fee per gas higher than 2\^256-1|fee cap higher than 2\^256-1/});class ys extends A{constructor({cause:t,maxFeePerGas:n}={}){super(`The fee cap (\`maxFeePerGas\`${n?` = ${Qe(n)}`:""} gwei) cannot be lower than the block base fee.`,{cause:t,name:"FeeCapTooLowError"})}}Object.defineProperty(ys,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/max fee per gas less than block base fee|fee cap less than block base fee|transaction is outdated/});class xs extends A{constructor({cause:t,nonce:n}={}){super(`Nonce provided for the transaction ${n?`(${n}) `:""}is higher than the next one expected.`,{cause:t,name:"NonceTooHighError"})}}Object.defineProperty(xs,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/nonce too high/});class vs extends A{constructor({cause:t,nonce:n}={}){super([`Nonce provided for the transaction ${n?`(${n}) `:""}is lower than the current nonce of the account.`,"Try increasing the nonce or find the latest nonce with `getTransactionCount`."].join(`
41
- `),{cause:t,name:"NonceTooLowError"})}}Object.defineProperty(vs,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/nonce too low|transaction already imported|already known/});class ws extends A{constructor({cause:t,nonce:n}={}){super(`Nonce provided for the transaction ${n?`(${n}) `:""}exceeds the maximum allowed nonce.`,{cause:t,name:"NonceMaxValueError"})}}Object.defineProperty(ws,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/nonce has max value/});class Cs extends A{constructor({cause:t}={}){super(["The total cost (gas * gas fee + value) of executing this transaction exceeds the balance of the account."].join(`
42
- `),{cause:t,metaMessages:["This error could arise when the account does not have enough funds to:"," - pay for the total gas fee,"," - pay for the value to send."," ","The cost of the transaction is calculated as `gas * gas fee + value`, where:"," - `gas` is the amount of gas needed for transaction to execute,"," - `gas fee` is the gas fee,"," - `value` is the amount of ether to send to the recipient."],name:"InsufficientFundsError"})}}Object.defineProperty(Cs,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/insufficient funds|exceeds transaction sender account balance/});class Ss extends A{constructor({cause:t,gas:n}={}){super(`The amount of gas ${n?`(${n}) `:""}provided for the transaction exceeds the limit allowed for the block.`,{cause:t,name:"IntrinsicGasTooHighError"})}}Object.defineProperty(Ss,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/intrinsic gas too high|gas limit reached/});class js extends A{constructor({cause:t,gas:n}={}){super(`The amount of gas ${n?`(${n}) `:""}provided for the transaction is too low.`,{cause:t,name:"IntrinsicGasTooLowError"})}}Object.defineProperty(js,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/intrinsic gas too low/});class Ns extends A{constructor({cause:t}){super("The transaction type is not supported for this chain.",{cause:t,name:"TransactionTypeNotSupportedError"})}}Object.defineProperty(Ns,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/transaction type not valid/});class er extends A{constructor({cause:t,maxPriorityFeePerGas:n,maxFeePerGas:s}={}){super([`The provided tip (\`maxPriorityFeePerGas\`${n?` = ${Qe(n)} gwei`:""}) cannot be higher than the fee cap (\`maxFeePerGas\`${s?` = ${Qe(s)} gwei`:""}).`].join(`
43
- `),{cause:t,name:"TipAboveFeeCapError"})}}Object.defineProperty(er,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/max priority fee per gas higher than max fee per gas|tip higher than fee cap/});class jl extends A{constructor({cause:t}){super(`An error occurred while executing: ${t?.shortMessage}`,{cause:t,name:"UnknownNodeError"})}}function dy(e,t){const n=(e.details||"").toLowerCase(),s=e instanceof A?e.walk(r=>r?.code===ut.code):e;return s instanceof A?new ut({cause:e,message:s.details}):ut.nodeMessage.test(n)?new ut({cause:e,message:e.details}):Zn.nodeMessage.test(n)?new Zn({cause:e,maxFeePerGas:t?.maxFeePerGas}):ys.nodeMessage.test(n)?new ys({cause:e,maxFeePerGas:t?.maxFeePerGas}):xs.nodeMessage.test(n)?new xs({cause:e,nonce:t?.nonce}):vs.nodeMessage.test(n)?new vs({cause:e,nonce:t?.nonce}):ws.nodeMessage.test(n)?new ws({cause:e,nonce:t?.nonce}):Cs.nodeMessage.test(n)?new Cs({cause:e}):Ss.nodeMessage.test(n)?new Ss({cause:e,gas:t?.gas}):js.nodeMessage.test(n)?new js({cause:e,gas:t?.gas}):Ns.nodeMessage.test(n)?new Ns({cause:e}):er.nodeMessage.test(n)?new er({cause:e,maxFeePerGas:t?.maxFeePerGas,maxPriorityFeePerGas:t?.maxPriorityFeePerGas}):new jl({cause:e})}function fy(e,{docsPath:t,...n}){const s=(()=>{const r=dy(e,n);return r instanceof jl?e:r})();return new z1(s,{docsPath:t,...n})}function py(e,{format:t}){if(!t)return{};const n={};function s(o){const a=Object.keys(o);for(const c of a)c in e&&(n[c]=e[c]),o[c]&&typeof o[c]=="object"&&!Array.isArray(o[c])&&s(o[c])}const r=t(e||{});return s(r),n}const hy={legacy:"0x0",eip2930:"0x1",eip1559:"0x2",eip4844:"0x3",eip7702:"0x4"};function my(e,t){const n={};return typeof e.authorizationList<"u"&&(n.authorizationList=gy(e.authorizationList)),typeof e.accessList<"u"&&(n.accessList=e.accessList),typeof e.blobVersionedHashes<"u"&&(n.blobVersionedHashes=e.blobVersionedHashes),typeof e.blobs<"u"&&(typeof e.blobs[0]!="string"?n.blobs=e.blobs.map(s=>xe(s)):n.blobs=e.blobs),typeof e.data<"u"&&(n.data=e.data),e.account&&(n.from=e.account.address),typeof e.from<"u"&&(n.from=e.from),typeof e.gas<"u"&&(n.gas=Z(e.gas)),typeof e.gasPrice<"u"&&(n.gasPrice=Z(e.gasPrice)),typeof e.maxFeePerBlobGas<"u"&&(n.maxFeePerBlobGas=Z(e.maxFeePerBlobGas)),typeof e.maxFeePerGas<"u"&&(n.maxFeePerGas=Z(e.maxFeePerGas)),typeof e.maxPriorityFeePerGas<"u"&&(n.maxPriorityFeePerGas=Z(e.maxPriorityFeePerGas)),typeof e.nonce<"u"&&(n.nonce=Z(e.nonce)),typeof e.to<"u"&&(n.to=e.to),typeof e.type<"u"&&(n.type=hy[e.type]),typeof e.value<"u"&&(n.value=Z(e.value)),n}function gy(e){return e.map(t=>({address:t.address,r:t.r?Z(BigInt(t.r)):t.r,s:t.s?Z(BigInt(t.s)):t.s,chainId:Z(t.chainId),nonce:Z(t.nonce),...typeof t.yParity<"u"?{yParity:Z(t.yParity)}:{},...typeof t.v<"u"&&typeof t.yParity>"u"?{v:Z(t.v)}:{}}))}function by(){let e=()=>{},t=()=>{};return{promise:new Promise((s,r)=>{e=s,t=r}),resolve:e,reject:t}}const Hr=new Map;function Nl({fn:e,id:t,shouldSplitBatch:n,wait:s=0,sort:r}){const o=async()=>{const d=l();a();const p=d.map(({args:f})=>f);p.length!==0&&e(p).then(f=>{r&&Array.isArray(f)&&f.sort(r);for(let h=0;h<d.length;h++){const{resolve:m}=d[h];m?.([f[h],f])}}).catch(f=>{for(let h=0;h<d.length;h++){const{reject:m}=d[h];m?.(f)}})},a=()=>Hr.delete(t),c=()=>l().map(({args:d})=>d),l=()=>Hr.get(t)||[],u=d=>Hr.set(t,[...l(),d]);return{flush:a,async schedule(d){const{promise:p,resolve:f,reject:h}=by();return n?.([...c(),d])&&o(),l().length>0?(u({args:d,resolve:f,reject:h}),p):(u({args:d,resolve:f,reject:h}),setTimeout(o,s),p)}}}function Ia(e){if(!(!e||e.length===0))return e.reduce((t,{slot:n,value:s})=>{if(n.length!==66)throw new xa({size:n.length,targetSize:66,type:"hex"});if(s.length!==66)throw new xa({size:s.length,targetSize:66,type:"hex"});return t[n]=s,t},{})}function yy(e){const{balance:t,nonce:n,state:s,stateDiff:r,code:o}=e,a={};if(o!==void 0&&(a.code=o),t!==void 0&&(a.balance=Z(t)),n!==void 0&&(a.nonce=Z(n)),s!==void 0&&(a.state=Ia(s)),r!==void 0){if(a.state)throw new D1;a.stateDiff=Ia(r)}return a}function xy(e){if(!e)return;const t={};for(const{address:n,...s}of e){if(!Oe(n,{strict:!1}))throw new et({address:n});if(t[n])throw new A1({address:n});t[n]=yy(s)}return t}const vy=2n**256n-1n;function wy(e){const{account:t,gasPrice:n,maxFeePerGas:s,maxPriorityFeePerGas:r,to:o}=e,a=t?vr(t):void 0;if(a&&!Oe(a.address))throw new et({address:a.address});if(o&&!Oe(o))throw new et({address:o});if(typeof n<"u"&&(typeof s<"u"||typeof r<"u"))throw new L1;if(s&&s>vy)throw new Zn({maxFeePerGas:s});if(r&&s&&r>s)throw new er({maxFeePerGas:s,maxPriorityFeePerGas:r})}async function Pl(e,t){const{account:n=e.account,authorizationList:s,batch:r=!!e.batch?.multicall,blockNumber:o,blockTag:a=e.experimental_blockTag??"latest",accessList:c,blobs:l,blockOverrides:u,code:d,data:p,factory:f,factoryData:h,gas:m,gasPrice:g,maxFeePerBlobGas:y,maxFeePerGas:x,maxPriorityFeePerGas:v,nonce:S,to:N,value:w,stateOverride:j,...C}=t,P=n?vr(n):void 0;if(d&&(f||h))throw new A("Cannot provide both `code` & `factory`/`factoryData` as parameters.");if(d&&N)throw new A("Cannot provide both `code` & `to` as parameters.");const E=d&&p,M=f&&h&&N&&p,O=E||M,T=E?El({code:d,data:p}):M?jy({data:p,factory:f,factoryData:h,to:N}):p;try{wy(t);const F=(typeof o=="bigint"?Z(o):void 0)||a,V=u?ay(u):void 0,B=xy(j),_=e.chain?.formatters?.transactionRequest?.format,W=(_||my)({...py(C,{format:_}),accessList:c,account:P,authorizationList:s,blobs:l,data:T,gas:m,gasPrice:g,maxFeePerBlobGas:y,maxFeePerGas:x,maxPriorityFeePerGas:v,nonce:S,to:O?void 0:N,value:w},"call");if(r&&Cy({request:W})&&!B&&!V)try{return await Sy(e,{...W,blockNumber:o,blockTag:a})}catch(U){if(!(U instanceof dl)&&!(U instanceof ms))throw U}const ee=(()=>{const U=[W,F];return B&&V?[...U,B,V]:B?[...U,B]:V?[...U,{},V]:U})(),re=await e.request({method:"eth_call",params:ee});return re==="0x"?{data:void 0}:{data:re}}catch(D){const F=Ny(D),{offchainLookup:V,offchainLookupSignature:B}=await ad(async()=>{const{offchainLookup:_,offchainLookupSignature:Y}=await Promise.resolve().then(()=>Xy);return{offchainLookup:_,offchainLookupSignature:Y}},void 0);if(e.ccipRead!==!1&&F?.slice(0,10)===B&&N)return{data:await V(e,{data:F,to:N})};throw O&&F?.slice(0,10)==="0x101bb98d"?new B1({factory:f}):fy(D,{...t,account:P,chain:e.chain})}}function Cy({request:e}){const{data:t,to:n,...s}=e;return!(!t||t.startsWith(iy)||!n||Object.values(s).filter(r=>typeof r<"u").length>0)}async function Sy(e,t){const{batchSize:n=1024,deployless:s=!1,wait:r=0}=typeof e.batch?.multicall=="object"?e.batch.multicall:{},{blockNumber:o,blockTag:a=e.experimental_blockTag??"latest",data:c,to:l}=t,u=(()=>{if(s)return null;if(t.multicallAddress)return t.multicallAddress;if(e.chain)return uo({blockNumber:o,chain:e.chain,contract:"multicall3"});throw new dl})(),p=(typeof o=="bigint"?Z(o):void 0)||a,{schedule:f}=Nl({id:`${e.uid}.${p}`,wait:r,shouldSplitBatch(g){return g.reduce((x,{data:v})=>x+(v.length-2),0)>n*2},fn:async g=>{const y=g.map(S=>({allowFailure:!0,callData:S.data,target:S.to})),x=lo({abi:ma,args:[y],functionName:"aggregate3"}),v=await e.request({method:"eth_call",params:[{...u===null?{data:El({code:uy,data:x})}:{to:u,data:x}},p]});return co({abi:ma,args:[y],functionName:"aggregate3",data:v||"0x"})}}),[{returnData:h,success:m}]=await f({data:c,to:l});if(!m)throw new bl({data:h});return h==="0x"?{data:void 0}:{data:h}}function El(e){const{code:t,data:n}=e;return Sl({abi:cl(["constructor(bytes, bytes)"]),bytecode:cy,args:[t,n]})}function jy(e){const{data:t,factory:n,factoryData:s,to:r}=e;return Sl({abi:cl(["constructor(address, bytes, address, bytes)"]),bytecode:ly,args:[r,t,n,s]})}function Ny(e){if(!(e instanceof A))return;const t=e.walk();return typeof t?.data=="object"?t.data?.data:t.data}async function tr(e,t){const{abi:n,address:s,args:r,functionName:o,...a}=t,c=lo({abi:n,args:r,functionName:o});try{const{data:l}=await Cr(e,Pl,"call")({...a,data:c,to:s});return co({abi:n,args:r,functionName:o,data:l||"0x"})}catch(l){throw K1(l,{abi:n,address:s,args:r,docsPath:"/docs/contract/readContract",functionName:o})}}class Py extends A{constructor({data:t}){super("Unable to extract image from metadata. The metadata may be malformed or invalid.",{metaMessages:["- Metadata must be a JSON object with at least an `image`, `image_url` or `image_data` property.","",`Provided data: ${JSON.stringify(t)}`],name:"EnsAvatarInvalidMetadataError"})}}class Mt extends A{constructor({reason:t}){super(`ENS NFT avatar URI is invalid. ${t}`,{name:"EnsAvatarInvalidNftUriError"})}}class po extends A{constructor({uri:t}){super(`Unable to resolve ENS avatar URI "${t}". The URI may be malformed, invalid, or does not respond with a valid image.`,{name:"EnsAvatarUriResolutionError"})}}class Ey extends A{constructor({namespace:t}){super(`ENS NFT avatar namespace "${t}" is not supported. Must be "erc721" or "erc1155".`,{name:"EnsAvatarUnsupportedNamespaceError"})}}const Iy=/(?<protocol>https?:\/\/[^/]*|ipfs:\/|ipns:\/|ar:\/)?(?<root>\/)?(?<subpath>ipfs\/|ipns\/)?(?<target>[\w\-.]+)(?<subtarget>\/.*)?/,Oy=/^(Qm[1-9A-HJ-NP-Za-km-z]{44,}|b[A-Za-z2-7]{58,}|B[A-Z2-7]{58,}|z[1-9A-HJ-NP-Za-km-z]{48,}|F[0-9A-F]{50,})(\/(?<target>[\w\-.]+))?(?<subtarget>\/.*)?$/,ky=/^data:([a-zA-Z\-/+]*);base64,([^"].*)/,My=/^data:([a-zA-Z\-/+]*)?(;[a-zA-Z0-9].*?)?(,)/;async function Ty(e){try{const t=await fetch(e,{method:"HEAD"});return t.status===200?t.headers.get("content-type")?.startsWith("image/"):!1}catch(t){return typeof t=="object"&&typeof t.response<"u"||!Object.hasOwn(globalThis,"Image")?!1:new Promise(n=>{const s=new Image;s.onload=()=>{n(!0)},s.onerror=()=>{n(!1)},s.src=e})}}function Oa(e,t){return e?e.endsWith("/")?e.slice(0,-1):e:t}function Il({uri:e,gatewayUrls:t}){const n=ky.test(e);if(n)return{uri:e,isOnChain:!0,isEncoded:n};const s=Oa(t?.ipfs,"https://ipfs.io"),r=Oa(t?.arweave,"https://arweave.net"),o=e.match(Iy),{protocol:a,subpath:c,target:l,subtarget:u=""}=o?.groups||{},d=a==="ipns:/"||c==="ipns/",p=a==="ipfs:/"||c==="ipfs/"||Oy.test(e);if(e.startsWith("http")&&!d&&!p){let h=e;return t?.arweave&&(h=e.replace(/https:\/\/arweave.net/g,t?.arweave)),{uri:h,isOnChain:!1,isEncoded:!1}}if((d||p)&&l)return{uri:`${s}/${d?"ipns":"ipfs"}/${l}${u}`,isOnChain:!1,isEncoded:!1};if(a==="ar:/"&&l)return{uri:`${r}/${l}${u||""}`,isOnChain:!1,isEncoded:!1};let f=e.replace(My,"");if(f.startsWith("<svg")&&(f=`data:image/svg+xml;base64,${btoa(f)}`),f.startsWith("data:")||f.startsWith("{"))return{uri:f,isOnChain:!0,isEncoded:!1};throw new po({uri:e})}function Ol(e){if(typeof e!="object"||!("image"in e)&&!("image_url"in e)&&!("image_data"in e))throw new Py({data:e});return e.image||e.image_url||e.image_data}async function Ay({gatewayUrls:e,uri:t}){try{const n=await fetch(t).then(r=>r.json());return await ho({gatewayUrls:e,uri:Ol(n)})}catch{throw new po({uri:t})}}async function ho({gatewayUrls:e,uri:t}){const{uri:n,isOnChain:s}=Il({uri:t,gatewayUrls:e});if(s||await Ty(n))return n;throw new po({uri:t})}function Dy(e){let t=e;t.startsWith("did:nft:")&&(t=t.replace("did:nft:","").replace(/_/g,"/"));const[n,s,r]=t.split("/"),[o,a]=n.split(":"),[c,l]=s.split(":");if(!o||o.toLowerCase()!=="eip155")throw new Mt({reason:"Only EIP-155 supported"});if(!a)throw new Mt({reason:"Chain ID not found"});if(!l)throw new Mt({reason:"Contract address not found"});if(!r)throw new Mt({reason:"Token ID not found"});if(!c)throw new Mt({reason:"ERC namespace not found"});return{chainID:Number.parseInt(a,10),namespace:c.toLowerCase(),contractAddress:l,tokenID:r}}async function Ry(e,{nft:t}){if(t.namespace==="erc721")return tr(e,{address:t.contractAddress,abi:[{name:"tokenURI",type:"function",stateMutability:"view",inputs:[{name:"tokenId",type:"uint256"}],outputs:[{name:"",type:"string"}]}],functionName:"tokenURI",args:[BigInt(t.tokenID)]});if(t.namespace==="erc1155")return tr(e,{address:t.contractAddress,abi:[{name:"uri",type:"function",stateMutability:"view",inputs:[{name:"_id",type:"uint256"}],outputs:[{name:"",type:"string"}]}],functionName:"uri",args:[BigInt(t.tokenID)]});throw new Ey({namespace:t.namespace})}async function Ly(e,{gatewayUrls:t,record:n}){return/eip155:/i.test(n)?Fy(e,{gatewayUrls:t,record:n}):ho({uri:n,gatewayUrls:t})}async function Fy(e,{gatewayUrls:t,record:n}){const s=Dy(n),r=await Ry(e,{nft:s}),{uri:o,isOnChain:a,isEncoded:c}=Il({uri:r,gatewayUrls:t});if(a&&(o.includes("data:application/json;base64,")||o.startsWith("{"))){const u=c?atob(o.replace("data:application/json;base64,","")):o,d=JSON.parse(u);return ho({uri:Ol(d),gatewayUrls:t})}let l=s.tokenID;return s.namespace==="erc1155"&&(l=l.replace("0x","").padStart(64,"0")),Ay({gatewayUrls:t,uri:o.replace(/(?:0x)?{id}/,l)})}async function zy(e,t){const{blockNumber:n,blockTag:s,key:r,name:o,gatewayUrls:a,strict:c}=t,{chain:l}=e,u=(()=>{if(t.universalResolverAddress)return t.universalResolverAddress;if(!l)throw new Error("client chain not configured. universalResolverAddress is required.");return uo({blockNumber:n,chain:l,contract:"ensUniversalResolver"})})(),d=l?.ensTlds;if(d&&!d.some(p=>o.endsWith(p)))return null;try{const p={address:u,abi:$g,args:[Wc(q1(o)),lo({abi:ga,functionName:"text",args:[W1(o),r]}),a??[wr]],functionName:"resolveWithGateways",blockNumber:n,blockTag:s},h=await Cr(e,tr,"readContract")(p);if(h[0]==="0x")return null;const m=co({abi:ga,functionName:"text",data:h[0]});return m===""?null:m}catch(p){if(c)throw p;if(yl(p))return null;throw p}}async function $y(e,{blockNumber:t,blockTag:n,assetGatewayUrls:s,name:r,gatewayUrls:o,strict:a,universalResolverAddress:c}){const l=await Cr(e,zy,"getEnsText")({blockNumber:t,blockTag:n,key:"avatar",name:r,universalResolverAddress:c,gatewayUrls:o,strict:a});if(!l)return null;try{return await Ly(e,{record:l,gatewayUrls:s})}catch{return null}}async function Vy(e,t){const{address:n,blockNumber:s,blockTag:r,coinType:o=60n,gatewayUrls:a,strict:c}=t,{chain:l}=e,u=(()=>{if(t.universalResolverAddress)return t.universalResolverAddress;if(!l)throw new Error("client chain not configured. universalResolverAddress is required.");return uo({blockNumber:s,chain:l,contract:"ensUniversalResolver"})})();try{const d={address:u,abi:Vg,args:[n,o,a??[wr]],functionName:"reverseWithGateways",blockNumber:s,blockTag:r},p=Cr(e,tr,"readContract"),[f]=await p(d);return f||null}catch(d){if(c)throw d;if(yl(d))return null;throw d}}function By(e,t){if(!Oe(e,{strict:!1}))throw new et({address:e});if(!Oe(t,{strict:!1}))throw new et({address:t});return e.toLowerCase()===t.toLowerCase()}const En=new no(8192);function Uy(e,{enabled:t=!0,id:n}){if(!t||!n)return e();if(En.get(n))return En.get(n);const s=e().finally(()=>En.delete(n));return En.set(n,s),s}async function Hy(e){return new Promise(t=>setTimeout(t,e))}function kl(e,{delay:t=100,retryCount:n=2,shouldRetry:s=()=>!0}={}){return new Promise((r,o)=>{const a=async({count:c=0}={})=>{const l=async({error:u})=>{const d=typeof t=="function"?t({count:c,error:u}):t;d&&await Hy(d),a({count:c+1})};try{const u=await e();r(u)}catch(u){if(c<n&&await s({count:c,error:u}))return l({error:u});o(u)}};a()})}function _y(e,t={}){return async(n,s={})=>{const{dedupe:r=!1,methods:o,retryDelay:a=150,retryCount:c=3,uid:l}={...t,...s},{method:u}=n;if(o?.exclude?.includes(u))throw new qe(new Error("method not supported"),{method:u});if(o?.include&&!o.include.includes(u))throw new qe(new Error("method not supported"),{method:u});const d=r?Zs(`${l}.${Ee(n)}`):void 0;return Uy(()=>kl(async()=>{try{return await e(n)}catch(p){const f=p;switch(f.code){case Ut.code:throw new Ut(f);case Ht.code:throw new Ht(f);case _t.code:throw new _t(f,{method:n.method});case Wt.code:throw new Wt(f);case nt.code:throw new nt(f);case Gt.code:throw new Gt(f);case Yt.code:throw new Yt(f);case _e.code:throw new _e(f);case qt.code:throw new qt(f);case qe.code:throw new qe(f,{method:n.method});case xt.code:throw new xt(f);case Jt.code:throw new Jt(f);case fe.code:throw new fe(f);case Qt.code:throw new Qt(f);case Xt.code:throw new Xt(f);case Kt.code:throw new Kt(f);case Zt.code:throw new Zt(f);case rt.code:throw new rt(f);case en.code:throw new en(f);case tn.code:throw new tn(f);case nn.code:throw new nn(f);case rn.code:throw new rn(f);case sn.code:throw new sn(f);case on.code:throw new on(f);case an.code:throw new an(f);case 5e3:throw new fe(f);default:throw p instanceof A?p:new Q1(f)}}},{delay:({count:p,error:f})=>{if(f&&f instanceof Xe){const h=f?.headers?.get("Retry-After");if(h?.match(/\d/))return Number.parseInt(h,10)*1e3}return~~(1<<p)*a},retryCount:c,shouldRetry:({error:p})=>Wy(p)}),{enabled:r,id:d})}}function Wy(e){return"code"in e&&typeof e.code=="number"?e.code===-1||e.code===xt.code||e.code===nt.code:e instanceof Xe&&e.status?e.status===403||e.status===408||e.status===413||e.status===429||e.status===500||e.status===502||e.status===503||e.status===504:!0}class Gy extends A{constructor({callbackSelector:t,cause:n,data:s,extraData:r,sender:o,urls:a}){super(n.shortMessage||"An error occurred while fetching for an offchain result.",{cause:n,metaMessages:[...n.metaMessages||[],n.metaMessages?.length?"":[],"Offchain Gateway Call:",a&&[" Gateway URL(s):",...a.map(c=>` ${gn(c)}`)],` Sender: ${o}`,` Data: ${s}`,` Callback selector: ${t}`,` Extra data: ${r}`].flat(),name:"OffchainLookupError"})}}class Yy extends A{constructor({result:t,url:n}){super("Offchain gateway response is malformed. Response data must be a hex value.",{metaMessages:[`Gateway URL: ${gn(n)}`,`Response: ${Ee(t)}`],name:"OffchainLookupResponseMalformedError"})}}class qy extends A{constructor({sender:t,to:n}){super("Reverted sender address does not match target contract address (`to`).",{metaMessages:[`Contract address: ${n}`,`OffchainLookup sender address: ${t}`],name:"OffchainLookupSenderMismatchError"})}}const Jy="0x556f1830",Ml={name:"OffchainLookup",type:"error",inputs:[{name:"sender",type:"address"},{name:"urls",type:"string[]"},{name:"callData",type:"bytes"},{name:"callbackFunction",type:"bytes4"},{name:"extraData",type:"bytes"}]};async function Qy(e,{blockNumber:t,blockTag:n,data:s,to:r}){const{args:o}=pl({data:s,abi:[Ml]}),[a,c,l,u,d]=o,{ccipRead:p}=e,f=p&&typeof p?.request=="function"?p.request:Tl;try{if(!By(r,a))throw new qy({sender:a,to:r});const h=c.includes(wr)?await xl({data:l,ccipRequest:f}):await f({data:l,sender:a,urls:c}),{data:m}=await Pl(e,{blockNumber:t,blockTag:n,data:Ge([u,pn([{type:"bytes"},{type:"bytes"}],[h,d])]),to:r});return m}catch(h){throw new Gy({callbackSelector:u,cause:h,data:s,extraData:d,sender:a,urls:c})}}async function Tl({data:e,sender:t,urls:n}){let s=new Error("An unknown error occurred.");for(let r=0;r<n.length;r++){const o=n[r],a=o.includes("{data}")?"GET":"POST",c=a==="POST"?{data:e,sender:t}:void 0,l=a==="POST"?{"Content-Type":"application/json"}:{};try{const u=await fetch(o.replace("{sender}",t.toLowerCase()).replace("{data}",e),{body:JSON.stringify(c),headers:l,method:a});let d;if(u.headers.get("Content-Type")?.startsWith("application/json")?d=(await u.json()).data:d=await u.text(),!u.ok){s=new Xe({body:c,details:d?.error?Ee(d.error):u.statusText,headers:u.headers,status:u.status,url:o});continue}if(!st(d)){s=new Yy({result:d,url:o});continue}return d}catch(u){s=new Xe({body:c,details:u.message,url:o})}}throw s}const Xy=Object.freeze(Object.defineProperty({__proto__:null,ccipRequest:Tl,offchainLookup:Qy,offchainLookupAbiItem:Ml,offchainLookupSignature:Jy},Symbol.toStringTag,{value:"Module"}));function Ky(e){return{formatters:void 0,fees:void 0,serializers:void 0,...e}}function Al(e,{errorInstance:t=new Error("timed out"),timeout:n,signal:s}){return new Promise((r,o)=>{(async()=>{let a;try{const c=new AbortController;n>0&&(a=setTimeout(()=>{s?c.abort():o(t)},n)),r(await e({signal:c?.signal||null}))}catch(c){c?.name==="AbortError"&&o(t),o(c)}finally{clearTimeout(a)}})()})}function Zy(){return{current:0,take(){return this.current++},reset(){this.current=0}}}const ka=Zy();function ex(e,t={}){return{async request(n){const{body:s,fetchFn:r=t.fetchFn??fetch,onRequest:o=t.onRequest,onResponse:a=t.onResponse,timeout:c=t.timeout??1e4}=n,l={...t.fetchOptions??{},...n.fetchOptions??{}},{headers:u,method:d,signal:p}=l;try{const f=await Al(async({signal:m})=>{const g={...l,body:Array.isArray(s)?Ee(s.map(S=>({jsonrpc:"2.0",id:S.id??ka.take(),...S}))):Ee({jsonrpc:"2.0",id:s.id??ka.take(),...s}),headers:{"Content-Type":"application/json",...u},method:d||"POST",signal:p||(c>0?m:null)},y=new Request(e,g),x=await o?.(y,g)??{...g,url:e};return await r(x.url??e,x)},{errorInstance:new Ea({body:s,url:e}),timeout:c,signal:!0});a&&await a(f);let h;if(f.headers.get("Content-Type")?.startsWith("application/json"))h=await f.json();else{h=await f.text();try{h=JSON.parse(h||"{}")}catch(m){if(f.ok)throw m;h={error:h}}}if(!f.ok)throw new Xe({body:s,details:Ee(h.error)||f.statusText,headers:f.headers,status:f.status,url:e});return h}catch(f){throw f instanceof Xe||f instanceof Ea?f:new Xe({body:s,cause:f,url:e})}}}}function Dl(e,t,n){const s=e[t.name];if(typeof s=="function")return s;const r=e[n];return typeof r=="function"?r:o=>t(e,o)}const Vn="2.22.1",tx=()=>`@wagmi/core@${Vn}`;var Rl=function(e,t,n,s){if(n==="a"&&!s)throw new TypeError("Private accessor was defined without a getter");if(typeof t=="function"?e!==t||!s:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return n==="m"?s:n==="a"?s.call(e):s?s.value:t.get(e)},nr,Ll;let mo=class Ps extends Error{get docsBaseUrl(){return"https://wagmi.sh/core"}get version(){return tx()}constructor(t,n={}){super(),nr.add(this),Object.defineProperty(this,"details",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"docsPath",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"metaMessages",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"shortMessage",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"WagmiCoreError"});const s=n.cause instanceof Ps?n.cause.details:n.cause?.message?n.cause.message:n.details,r=n.cause instanceof Ps&&n.cause.docsPath||n.docsPath;this.message=[t||"An error occurred.","",...n.metaMessages?[...n.metaMessages,""]:[],...r?[`Docs: ${this.docsBaseUrl}${r}.html${n.docsSlug?`#${n.docsSlug}`:""}`]:[],...s?[`Details: ${s}`]:[],`Version: ${this.version}`].join(`
44
- `),n.cause&&(this.cause=n.cause),this.details=s,this.docsPath=r,this.metaMessages=n.metaMessages,this.shortMessage=t}walk(t){return Rl(this,nr,"m",Ll).call(this,this,t)}};nr=new WeakSet,Ll=function e(t,n){return n?.(t)?t:t.cause?Rl(this,nr,"m",e).call(this,t.cause,n):t};class Es extends mo{constructor(){super("Chain not configured."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ChainNotConfiguredError"})}}const Is=256;let In=Is,On;function Fl(e=11){if(!On||In+e>Is*2){On="",In=0;for(let t=0;t<Is;t++)On+=(256+Math.random()*256|0).toString(16).substring(1)}return On.substring(In,In+++e)}function nx(e){const{batch:t,chain:n,ccipRead:s,key:r="base",name:o="Base Client",type:a="base"}=e,c=e.experimental_blockTag??(typeof n?.experimental_preconfirmationTime=="number"?"pending":void 0),l=n?.blockTime??12e3,u=Math.min(Math.max(Math.floor(l/2),500),4e3),d=e.pollingInterval??u,p=e.cacheTime??d,f=e.account?vr(e.account):void 0,{config:h,request:m,value:g}=e.transport({chain:n,pollingInterval:d}),y={...h,...g},x={account:f,batch:t,cacheTime:p,ccipRead:s,chain:n,key:r,name:o,pollingInterval:d,request:m,transport:y,type:a,uid:Fl(),...c?{experimental_blockTag:c}:{}};function v(S){return N=>{const w=N(S);for(const C in x)delete w[C];const j={...S,...w};return Object.assign(j,{extend:v(j)})}}return Object.assign(x,{extend:v(x)})}function rx({key:e,methods:t,name:n,request:s,retryCount:r=3,retryDelay:o=150,timeout:a,type:c},l){const u=Fl();return{config:{key:e,methods:t,name:n,request:s,retryCount:r,retryDelay:o,timeout:a,type:c},request:_y(s,{methods:t,retryCount:r,retryDelay:o,uid:u}),value:l}}class sx extends A{constructor(){super("No URL was provided to the Transport. Please provide a valid RPC URL to the Transport.",{docsPath:"/docs/clients/intro",name:"UrlRequiredError"})}}function ox(e,t={}){const{batch:n,fetchFn:s,fetchOptions:r,key:o="http",methods:a,name:c="HTTP JSON-RPC",onFetchRequest:l,onFetchResponse:u,retryDelay:d,raw:p}=t;return({chain:f,retryCount:h,timeout:m})=>{const{batchSize:g=1e3,wait:y=0}=typeof n=="object"?n:{},x=t.retryCount??h,v=m??t.timeout??1e4,S=f?.rpcUrls.default.http[0];if(!S)throw new sx;const N=ex(S,{fetchFn:s,fetchOptions:r,onRequest:l,onResponse:u,timeout:v});return rx({key:o,methods:a,name:c,async request({method:w,params:j}){const C={method:w,params:j},{schedule:P}=Nl({id:S,wait:y,shouldSplitBatch(T){return T.length>g},fn:T=>N.request({body:T}),sort:(T,D)=>T.id-D.id}),E=async T=>n?P(T):[await N.request({body:T})],[{error:M,result:O}]=await E(C);if(p)return{error:M,result:O};if(M)throw new fo({body:C,error:M,url:S});return O},retryCount:x,retryDelay:d,timeout:v,type:"http"},{fetchOptions:r,url:S})}}function Ma(e){return e.state.chainId}function ax(e,t){const{chainId:n,...s}=t,r=e.getClient({chainId:n});return Dl(r,$y,"getEnsAvatar")(s)}function ix(e,t){const{chainId:n,...s}=t,r=e.getClient({chainId:n});return Dl(r,Vy,"getEnsName")(s)}let _r=!1;async function cx(e,t={}){if(_r)return[];_r=!0,e.setState(u=>({...u,status:u.current?"reconnecting":"connecting"}));const n=[];if(t.connectors?.length)for(const u of t.connectors){let d;typeof u=="function"?d=e._internal.connectors.setup(u):d=u,n.push(d)}else n.push(...e.connectors);let s;try{s=await e.storage?.getItem("recentConnectorId")}catch{}const r={};for(const[,u]of e.state.connections)r[u.connector.id]=1;s&&(r[s]=0);const o=Object.keys(r).length>0?[...n].sort((u,d)=>(r[u.id]??10)-(r[d.id]??10)):n;let a=!1;const c=[],l=[];for(const u of o){const d=await u.getProvider().catch(()=>{});if(!d||l.some(h=>h===d)||!await u.isAuthorized())continue;const f=await u.connect({isReconnecting:!0}).catch(()=>null);f&&(u.emitter.off("connect",e._internal.events.connect),u.emitter.on("change",e._internal.events.change),u.emitter.on("disconnect",e._internal.events.disconnect),e.setState(h=>{const m=new Map(a?h.connections:new Map).set(u.uid,{accounts:f.accounts,chainId:f.chainId,connector:u});return{...h,current:a?h.current:u.uid,connections:m}}),c.push({accounts:f.accounts,chainId:f.chainId,connector:u}),l.push(d),a=!0)}return(e.state.status==="reconnecting"||e.state.status==="connecting")&&(a?e.setState(u=>({...u,status:"connected"})):e.setState(u=>({...u,connections:new Map,current:null,status:"disconnected"}))),_r=!1,c}class it extends mo{constructor(){super("Provider not found."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ProviderNotFoundError"})}}function lx(e,t){const{onChange:n}=t;return e.subscribe(s=>s.chainId,n)}go.type="injected";function go(e={}){const{shimDisconnect:t=!0,unstable_shimAsyncInject:n}=e;function s(){const l=e.target;if(typeof l=="function"){const u=l();if(u)return u}return typeof l=="object"?l:typeof l=="string"?{...ux[l]??{id:l,name:`${l[0].toUpperCase()}${l.slice(1)}`,provider:`is${l[0].toUpperCase()}${l.slice(1)}`}}:{id:"injected",name:"Injected",provider(u){return u?.ethereum}}}let r,o,a,c;return l=>({get icon(){return s().icon},get id(){return s().id},get name(){return s().name},get supportsSimulation(){return!0},type:go.type,async setup(){const u=await this.getProvider();u?.on&&e.target&&(a||(a=this.onConnect.bind(this),u.on("connect",a)),r||(r=this.onAccountsChanged.bind(this),u.on("accountsChanged",r)))},async connect({chainId:u,isReconnecting:d,withCapabilities:p}={}){const f=await this.getProvider();if(!f)throw new it;let h=[];if(d)h=await this.getAccounts().catch(()=>[]);else if(t)try{h=(await f.request({method:"wallet_requestPermissions",params:[{eth_accounts:{}}]}))[0]?.caveats?.[0]?.value?.map(g=>Pn(g)),h.length>0&&(h=await this.getAccounts())}catch(m){const g=m;if(g.code===fe.code)throw new fe(g);if(g.code===_e.code)throw g}try{!h?.length&&!d&&(h=(await f.request({method:"eth_requestAccounts"})).map(y=>Pn(y))),a&&(f.removeListener("connect",a),a=void 0),r||(r=this.onAccountsChanged.bind(this),f.on("accountsChanged",r)),o||(o=this.onChainChanged.bind(this),f.on("chainChanged",o)),c||(c=this.onDisconnect.bind(this),f.on("disconnect",c));let m=await this.getChainId();return u&&m!==u&&(m=(await this.switchChain({chainId:u}).catch(y=>{if(y.code===fe.code)throw y;return{id:m}}))?.id??m),t&&await l.storage?.removeItem(`${this.id}.disconnected`),e.target||await l.storage?.setItem("injected.connected",!0),{accounts:p?h.map(g=>({address:g,capabilities:{}})):h,chainId:m}}catch(m){const g=m;throw g.code===fe.code?new fe(g):g.code===_e.code?new _e(g):g}},async disconnect(){const u=await this.getProvider();if(!u)throw new it;o&&(u.removeListener("chainChanged",o),o=void 0),c&&(u.removeListener("disconnect",c),c=void 0),a||(a=this.onConnect.bind(this),u.on("connect",a));try{await Al(()=>u.request({method:"wallet_revokePermissions",params:[{eth_accounts:{}}]}),{timeout:100})}catch{}t&&await l.storage?.setItem(`${this.id}.disconnected`,!0),e.target||await l.storage?.removeItem("injected.connected")},async getAccounts(){const u=await this.getProvider();if(!u)throw new it;return(await u.request({method:"eth_accounts"})).map(p=>Pn(p))},async getChainId(){const u=await this.getProvider();if(!u)throw new it;const d=await u.request({method:"eth_chainId"});return Number(d)},async getProvider(){if(typeof window>"u")return;let u;const d=s();return typeof d.provider=="function"?u=d.provider(window):typeof d.provider=="string"?u=Bn(window,d.provider):u=d.provider,u&&!u.removeListener&&("off"in u&&typeof u.off=="function"?u.removeListener=u.off:u.removeListener=()=>{}),u},async isAuthorized(){try{if(t&&await l.storage?.getItem(`${this.id}.disconnected`)||!e.target&&!await l.storage?.getItem("injected.connected"))return!1;if(!await this.getProvider()){if(n!==void 0&&n!==!1){const f=async()=>(typeof window<"u"&&window.removeEventListener("ethereum#initialized",f),!!await this.getProvider()),h=typeof n=="number"?n:1e3;if(await Promise.race([...typeof window<"u"?[new Promise(g=>window.addEventListener("ethereum#initialized",()=>g(f()),{once:!0}))]:[],new Promise(g=>setTimeout(()=>g(f()),h))]))return!0}throw new it}return!!(await kl(()=>this.getAccounts())).length}catch{return!1}},async switchChain({addEthereumChainParameter:u,chainId:d}){const p=await this.getProvider();if(!p)throw new it;const f=l.chains.find(m=>m.id===d);if(!f)throw new rt(new Es);const h=new Promise(m=>{const g=(y=>{"chainId"in y&&y.chainId===d&&(l.emitter.off("change",g),m())});l.emitter.on("change",g)});try{return await Promise.all([p.request({method:"wallet_switchEthereumChain",params:[{chainId:Z(d)}]}).then(async()=>{await this.getChainId()===d&&l.emitter.emit("change",{chainId:d})}),h]),f}catch(m){const g=m;if(g.code===4902||g?.data?.originalError?.code===4902)try{const{default:y,...x}=f.blockExplorers??{};let v;u?.blockExplorerUrls?v=u.blockExplorerUrls:y&&(v=[y.url,...Object.values(x).map(w=>w.url)]);let S;u?.rpcUrls?.length?S=u.rpcUrls:S=[f.rpcUrls.default?.http[0]??""];const N={blockExplorerUrls:v,chainId:Z(d),chainName:u?.chainName??f.name,iconUrls:u?.iconUrls,nativeCurrency:u?.nativeCurrency??f.nativeCurrency,rpcUrls:S};return await Promise.all([p.request({method:"wallet_addEthereumChain",params:[N]}).then(async()=>{if(await this.getChainId()===d)l.emitter.emit("change",{chainId:d});else throw new fe(new Error("User rejected switch after adding network."))}),h]),f}catch(y){throw new fe(y)}throw g.code===fe.code?new fe(g):new rt(g)}},async onAccountsChanged(u){if(u.length===0)this.onDisconnect();else if(l.emitter.listenerCount("connect")){const d=(await this.getChainId()).toString();this.onConnect({chainId:d}),t&&await l.storage?.removeItem(`${this.id}.disconnected`)}else l.emitter.emit("change",{accounts:u.map(d=>Pn(d))})},onChainChanged(u){const d=Number(u);l.emitter.emit("change",{chainId:d})},async onConnect(u){const d=await this.getAccounts();if(d.length===0)return;const p=Number(u.chainId);l.emitter.emit("connect",{accounts:d,chainId:p});const f=await this.getProvider();f&&(a&&(f.removeListener("connect",a),a=void 0),r||(r=this.onAccountsChanged.bind(this),f.on("accountsChanged",r)),o||(o=this.onChainChanged.bind(this),f.on("chainChanged",o)),c||(c=this.onDisconnect.bind(this),f.on("disconnect",c)))},async onDisconnect(u){const d=await this.getProvider();u&&u.code===1013&&d&&(await this.getAccounts()).length||(l.emitter.emit("disconnect"),d&&(o&&(d.removeListener("chainChanged",o),o=void 0),c&&(d.removeListener("disconnect",c),c=void 0),a||(a=this.onConnect.bind(this),d.on("connect",a))))}})}const ux={coinbaseWallet:{id:"coinbaseWallet",name:"Coinbase Wallet",provider(e){return e?.coinbaseWalletExtension?e.coinbaseWalletExtension:Bn(e,"isCoinbaseWallet")}},metaMask:{id:"metaMask",name:"MetaMask",provider(e){return Bn(e,t=>{if(!t.isMetaMask||t.isBraveWallet&&!t._events&&!t._state)return!1;const n=["isApexWallet","isAvalanche","isBitKeep","isBlockWallet","isKuCoinWallet","isMathWallet","isOkxWallet","isOKExWallet","isOneInchIOSWallet","isOneInchAndroidWallet","isOpera","isPhantom","isPortal","isRabby","isTokenPocket","isTokenary","isUniswapWallet","isZerion"];for(const s of n)if(t[s])return!1;return!0})}},phantom:{id:"phantom",name:"Phantom",provider(e){return e?.phantom?.ethereum?e.phantom?.ethereum:Bn(e,"isPhantom")}}};function Bn(e,t){function n(r){return typeof t=="function"?t(r):typeof t=="string"?r[t]:!0}const s=e.ethereum;if(s?.providers)return s.providers.find(r=>n(r));if(s&&n(s))return s}function dx(e){if(typeof window>"u")return;const t=n=>e(n.detail);return window.addEventListener("eip6963:announceProvider",t),window.dispatchEvent(new CustomEvent("eip6963:requestProvider")),()=>window.removeEventListener("eip6963:announceProvider",t)}function fx(){const e=new Set;let t=[];const n=()=>dx(r=>{t.some(({info:o})=>o.uuid===r.info.uuid)||(t=[...t,r],e.forEach(o=>o(t,{added:[r]})))});let s=n();return{_listeners(){return e},clear(){e.forEach(r=>r([],{removed:[...t]})),t=[]},destroy(){this.clear(),e.clear(),s?.()},findProvider({rdns:r}){return t.find(o=>o.info.rdns===r)},getProviders(){return t},reset(){this.clear(),s?.(),s=n()},subscribe(r,{emitImmediately:o}={}){return e.add(r),o&&r(t,{added:t}),()=>e.delete(r)}}}const px=e=>(t,n,s)=>{const r=s.subscribe;return s.subscribe=(a,c,l)=>{let u=a;if(c){const d=l?.equalityFn||Object.is;let p=a(s.getState());u=f=>{const h=a(f);if(!d(p,h)){const m=p;c(p=h,m)}},l?.fireImmediately&&c(p,p)}return r(u)},e(t,n,s)},hx=px;function mx(e,t){let n;try{n=e()}catch{return}return{getItem:r=>{var o;const a=l=>l===null?null:JSON.parse(l,void 0),c=(o=n.getItem(r))!=null?o:null;return c instanceof Promise?c.then(a):a(c)},setItem:(r,o)=>n.setItem(r,JSON.stringify(o,void 0)),removeItem:r=>n.removeItem(r)}}const Os=e=>t=>{try{const n=e(t);return n instanceof Promise?n:{then(s){return Os(s)(n)},catch(s){return this}}}catch(n){return{then(s){return this},catch(s){return Os(s)(n)}}}},gx=(e,t)=>(n,s,r)=>{let o={storage:mx(()=>localStorage),partialize:g=>g,version:0,merge:(g,y)=>({...y,...g}),...t},a=!1;const c=new Set,l=new Set;let u=o.storage;if(!u)return e((...g)=>{console.warn(`[zustand persist middleware] Unable to update item '${o.name}', the given storage is currently unavailable.`),n(...g)},s,r);const d=()=>{const g=o.partialize({...s()});return u.setItem(o.name,{state:g,version:o.version})},p=r.setState;r.setState=(g,y)=>{p(g,y),d()};const f=e((...g)=>{n(...g),d()},s,r);r.getInitialState=()=>f;let h;const m=()=>{var g,y;if(!u)return;a=!1,c.forEach(v=>{var S;return v((S=s())!=null?S:f)});const x=((y=o.onRehydrateStorage)==null?void 0:y.call(o,(g=s())!=null?g:f))||void 0;return Os(u.getItem.bind(u))(o.name).then(v=>{if(v)if(typeof v.version=="number"&&v.version!==o.version){if(o.migrate)return[!0,o.migrate(v.state,v.version)];console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}else return[!1,v.state];return[!1,void 0]}).then(v=>{var S;const[N,w]=v;if(h=o.merge(w,(S=s())!=null?S:f),n(h,!0),N)return d()}).then(()=>{x?.(h,void 0),h=s(),a=!0,l.forEach(v=>v(h))}).catch(v=>{x?.(void 0,v)})};return r.persist={setOptions:g=>{o={...o,...g},g.storage&&(u=g.storage)},clearStorage:()=>{u?.removeItem(o.name)},getOptions:()=>o,rehydrate:()=>m(),hasHydrated:()=>a,onHydrate:g=>(c.add(g),()=>{c.delete(g)}),onFinishHydration:g=>(l.add(g),()=>{l.delete(g)})},o.skipHydration||m(),h||f},bx=gx,Ta=e=>{let t;const n=new Set,s=(u,d)=>{const p=typeof u=="function"?u(t):u;if(!Object.is(p,t)){const f=t;t=d??(typeof p!="object"||p===null)?p:Object.assign({},t,p),n.forEach(h=>h(t,f))}},r=()=>t,c={setState:s,getState:r,getInitialState:()=>l,subscribe:u=>(n.add(u),()=>n.delete(u))},l=t=e(s,r,c);return c},Wr=e=>e?Ta(e):Ta;var Gr={exports:{}},Aa;function yx(){return Aa||(Aa=1,(function(e){var t=Object.prototype.hasOwnProperty,n="~";function s(){}Object.create&&(s.prototype=Object.create(null),new s().__proto__||(n=!1));function r(l,u,d){this.fn=l,this.context=u,this.once=d||!1}function o(l,u,d,p,f){if(typeof d!="function")throw new TypeError("The listener must be a function");var h=new r(d,p||l,f),m=n?n+u:u;return l._events[m]?l._events[m].fn?l._events[m]=[l._events[m],h]:l._events[m].push(h):(l._events[m]=h,l._eventsCount++),l}function a(l,u){--l._eventsCount===0?l._events=new s:delete l._events[u]}function c(){this._events=new s,this._eventsCount=0}c.prototype.eventNames=function(){var u=[],d,p;if(this._eventsCount===0)return u;for(p in d=this._events)t.call(d,p)&&u.push(n?p.slice(1):p);return Object.getOwnPropertySymbols?u.concat(Object.getOwnPropertySymbols(d)):u},c.prototype.listeners=function(u){var d=n?n+u:u,p=this._events[d];if(!p)return[];if(p.fn)return[p.fn];for(var f=0,h=p.length,m=new Array(h);f<h;f++)m[f]=p[f].fn;return m},c.prototype.listenerCount=function(u){var d=n?n+u:u,p=this._events[d];return p?p.fn?1:p.length:0},c.prototype.emit=function(u,d,p,f,h,m){var g=n?n+u:u;if(!this._events[g])return!1;var y=this._events[g],x=arguments.length,v,S;if(y.fn){switch(y.once&&this.removeListener(u,y.fn,void 0,!0),x){case 1:return y.fn.call(y.context),!0;case 2:return y.fn.call(y.context,d),!0;case 3:return y.fn.call(y.context,d,p),!0;case 4:return y.fn.call(y.context,d,p,f),!0;case 5:return y.fn.call(y.context,d,p,f,h),!0;case 6:return y.fn.call(y.context,d,p,f,h,m),!0}for(S=1,v=new Array(x-1);S<x;S++)v[S-1]=arguments[S];y.fn.apply(y.context,v)}else{var N=y.length,w;for(S=0;S<N;S++)switch(y[S].once&&this.removeListener(u,y[S].fn,void 0,!0),x){case 1:y[S].fn.call(y[S].context);break;case 2:y[S].fn.call(y[S].context,d);break;case 3:y[S].fn.call(y[S].context,d,p);break;case 4:y[S].fn.call(y[S].context,d,p,f);break;default:if(!v)for(w=1,v=new Array(x-1);w<x;w++)v[w-1]=arguments[w];y[S].fn.apply(y[S].context,v)}}return!0},c.prototype.on=function(u,d,p){return o(this,u,d,p,!1)},c.prototype.once=function(u,d,p){return o(this,u,d,p,!0)},c.prototype.removeListener=function(u,d,p,f){var h=n?n+u:u;if(!this._events[h])return this;if(!d)return a(this,h),this;var m=this._events[h];if(m.fn)m.fn===d&&(!f||m.once)&&(!p||m.context===p)&&a(this,h);else{for(var g=0,y=[],x=m.length;g<x;g++)(m[g].fn!==d||f&&!m[g].once||p&&m[g].context!==p)&&y.push(m[g]);y.length?this._events[h]=y.length===1?y[0]:y:a(this,h)}return this},c.prototype.removeAllListeners=function(u){var d;return u?(d=n?n+u:u,this._events[d]&&a(this,d)):(this._events=new s,this._eventsCount=0),this},c.prototype.off=c.prototype.removeListener,c.prototype.addListener=c.prototype.on,c.prefixed=n,c.EventEmitter=c,e.exports=c})(Gr)),Gr.exports}var xx=yx();const vx=hi(xx);class wx{constructor(t){Object.defineProperty(this,"uid",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"_emitter",{enumerable:!0,configurable:!0,writable:!0,value:new vx})}on(t,n){this._emitter.on(t,n)}once(t,n){this._emitter.once(t,n)}off(t,n){this._emitter.off(t,n)}emit(t,...n){const s=n[0];this._emitter.emit(t,{uid:this.uid,...s})}listenerCount(t){return this._emitter.listenerCount(t)}}function Cx(e){return new wx(e)}function Sx(e,t){return JSON.parse(e,(n,s)=>{let r=s;return r?.__type==="bigint"&&(r=BigInt(r.value)),r?.__type==="Map"&&(r=new Map(r.value)),t?.(n,r)??r})}function Da(e,t){return e.slice(0,t).join(".")||"."}function Ra(e,t){const{length:n}=e;for(let s=0;s<n;++s)if(e[s]===t)return s+1;return 0}function jx(e,t){const n=typeof e=="function",s=typeof t=="function",r=[],o=[];return function(c,l){if(typeof l=="object")if(r.length){const u=Ra(r,this);u===0?r[r.length]=this:(r.splice(u),o.splice(u)),o[o.length]=c;const d=Ra(r,l);if(d!==0)return s?t.call(this,c,l,Da(o,d)):`[ref=${Da(o,d)}]`}else r[0]=l,o[0]=c;return n?e.call(this,c,l):l}}function Nx(e,t,n,s){return JSON.stringify(e,jx((r,o)=>{let a=o;return typeof a=="bigint"&&(a={__type:"bigint",value:o.toString()}),a instanceof Map&&(a={__type:"Map",value:Array.from(o.entries())}),t?.(r,a)??a},s),n??void 0)}function Px(e){const{deserialize:t=Sx,key:n="wagmi",serialize:s=Nx,storage:r=zl}=e;function o(a){return a instanceof Promise?a.then(c=>c).catch(()=>null):a}return{...r,key:n,async getItem(a,c){const l=r.getItem(`${n}.${a}`),u=await o(l);return u?t(u)??null:c??null},async setItem(a,c){const l=`${n}.${a}`;c===null?await o(r.removeItem(l)):await o(r.setItem(l,s(c)))},async removeItem(a){await o(r.removeItem(`${n}.${a}`))}}}const zl={getItem:()=>null,setItem:()=>{},removeItem:()=>{}};function Ex(){const e=typeof window<"u"&&window.localStorage?window.localStorage:zl;return{getItem(t){return e.getItem(t)},removeItem(t){e.removeItem(t)},setItem(t,n){try{e.setItem(t,n)}catch{}}}}const ks=256;let kn=ks,Mn;function Ix(e=11){if(!Mn||kn+e>ks*2){Mn="",kn=0;for(let t=0;t<ks;t++)Mn+=(256+Math.random()*256|0).toString(16).substring(1)}return Mn.substring(kn,kn+++e)}function Ox(e){const{multiInjectedProviderDiscovery:t=!0,storage:n=Px({storage:Ex()}),syncConnectedChain:s=!0,ssr:r=!1,...o}=e,a=typeof window<"u"&&t?fx():void 0,c=Wr(()=>o.chains),l=Wr(()=>{const w=[],j=new Set;for(const C of o.connectors??[]){const P=u(C);if(w.push(P),!r&&P.rdns){const E=typeof P.rdns=="string"?[P.rdns]:P.rdns;for(const M of E)j.add(M)}}if(!r&&a){const C=a.getProviders();for(const P of C)j.has(P.info.rdns)||w.push(u(d(P)))}return w});function u(w){const j=Cx(Ix()),C={...w({emitter:j,chains:c.getState(),storage:n,transports:o.transports}),emitter:j,uid:j.uid};return j.on("connect",S),C.setup?.(),C}function d(w){const{info:j}=w,C=w.provider;return go({target:{...j,id:j.rdns,provider:C}})}const p=new Map;function f(w={}){const j=w.chainId??y.getState().chainId,C=c.getState().find(E=>E.id===j);if(w.chainId&&!C)throw new Es;{const E=p.get(y.getState().chainId);if(E&&!C)return E;if(!C)throw new Es}{const E=p.get(j);if(E)return E}let P;if(o.client)P=o.client({chain:C});else{const E=C.id,M=c.getState().map(D=>D.id),O={},T=Object.entries(o);for(const[D,F]of T)if(!(D==="chains"||D==="client"||D==="connectors"||D==="transports"))if(typeof F=="object")if(E in F)O[D]=F[E];else{if(M.some(B=>B in F))continue;O[D]=F}else O[D]=F;P=nx({...O,chain:C,batch:O.batch??{multicall:!0},transport:D=>o.transports[E]({...D,connectors:l})})}return p.set(j,P),P}function h(){return{chainId:c.getState()[0].id,connections:new Map,current:null,status:"disconnected"}}let m;const g="0.0.0-canary-";Vn.startsWith(g)?m=Number.parseInt(Vn.replace(g,""),10):m=Number.parseInt(Vn.split(".")[0]??"0",10);const y=Wr(hx(n?bx(h,{migrate(w,j){if(j===m)return w;const C=h(),P=x(w,C.chainId);return{...C,chainId:P}},name:"store",partialize(w){return{connections:{__type:"Map",value:Array.from(w.connections.entries()).map(([j,C])=>{const{id:P,name:E,type:M,uid:O}=C.connector;return[j,{...C,connector:{id:P,name:E,type:M,uid:O}}]})},chainId:w.chainId,current:w.current}},merge(w,j){typeof w=="object"&&w&&"status"in w&&delete w.status;const C=x(w,j.chainId);return{...j,...w,chainId:C}},skipHydration:r,storage:n,version:m}):h));y.setState(h());function x(w,j){return w&&typeof w=="object"&&"chainId"in w&&typeof w.chainId=="number"&&c.getState().some(C=>C.id===w.chainId)?w.chainId:j}s&&y.subscribe(({connections:w,current:j})=>j?w.get(j)?.chainId:void 0,w=>{if(c.getState().some(C=>C.id===w))return y.setState(C=>({...C,chainId:w??C.chainId}))}),a?.subscribe(w=>{const j=new Set,C=new Set;for(const E of l.getState())if(j.add(E.id),E.rdns){const M=typeof E.rdns=="string"?[E.rdns]:E.rdns;for(const O of M)C.add(O)}const P=[];for(const E of w){if(C.has(E.info.rdns))continue;const M=u(d(E));j.has(M.id)||P.push(M)}n&&!y.persist.hasHydrated()||l.setState(E=>[...E,...P],!0)});function v(w){y.setState(j=>{const C=j.connections.get(w.uid);return C?{...j,connections:new Map(j.connections).set(w.uid,{accounts:w.accounts??C.accounts,chainId:w.chainId??C.chainId,connector:C.connector})}:j})}function S(w){y.getState().status==="connecting"||y.getState().status==="reconnecting"||y.setState(j=>{const C=l.getState().find(P=>P.uid===w.uid);return C?(C.emitter.listenerCount("connect")&&C.emitter.off("connect",v),C.emitter.listenerCount("change")||C.emitter.on("change",v),C.emitter.listenerCount("disconnect")||C.emitter.on("disconnect",N),{...j,connections:new Map(j.connections).set(w.uid,{accounts:w.accounts,chainId:w.chainId,connector:C}),current:w.uid,status:"connected"}):j})}function N(w){y.setState(j=>{const C=j.connections.get(w.uid);if(C){const E=C.connector;E.emitter.listenerCount("change")&&C.connector.emitter.off("change",v),E.emitter.listenerCount("disconnect")&&C.connector.emitter.off("disconnect",N),E.emitter.listenerCount("connect")||C.connector.emitter.on("connect",S)}if(j.connections.delete(w.uid),j.connections.size===0)return{...j,connections:new Map,current:null,status:"disconnected"};const P=j.connections.values().next().value;return{...j,connections:new Map(j.connections),current:P.connector.uid}})}return{get chains(){return c.getState()},get connectors(){return l.getState()},storage:n,getClient:f,get state(){return y.getState()},setState(w){let j;typeof w=="function"?j=w(y.getState()):j=w;const C=h();typeof j!="object"&&(j=C),Object.keys(C).some(E=>!(E in j))&&(j=C),y.setState(j,!0)},subscribe(w,j,C){return y.subscribe(w,j,C?{...C,fireImmediately:C.emitImmediately}:void 0)},_internal:{mipd:a,async revalidate(){const w=y.getState(),j=w.connections;let C=w.current;for(const[,P]of j){const E=P.connector;E.isAuthorized&&await E.isAuthorized()||(j.delete(E.uid),C===E.uid&&(C=null))}y.setState(P=>({...P,connections:j,current:C}))},store:y,ssr:!!r,syncConnectedChain:s,transports:o.transports,chains:{setState(w){const j=typeof w=="function"?w(c.getState()):w;if(j.length!==0)return c.setState(j,!0)},subscribe(w){return c.subscribe(w)}},connectors:{providerDetailToConnector:d,setup:u,setState(w){return l.setState(typeof w=="function"?w(l.getState()):w,!0)},subscribe(w){return l.subscribe(w)}},events:{change:v,connect:S,disconnect:N}}}}function kx(e,t){const{initialState:n,reconnectOnMount:s}=t;return n&&!e._internal.store.persist.hasHydrated()&&e.setState({...n,chainId:e.chains.some(r=>r.id===n.chainId)?n.chainId:e.chains[0].id,connections:s?n.connections:new Map,status:s?"reconnecting":"disconnected"}),{async onMount(){e._internal.ssr&&(await e._internal.store.persist.rehydrate(),e._internal.mipd&&e._internal.connectors.setState(r=>{const o=new Set;for(const l of r??[])if(l.rdns){const u=Array.isArray(l.rdns)?l.rdns:[l.rdns];for(const d of u)o.add(d)}const a=[],c=e._internal.mipd?.getProviders()??[];for(const l of c){if(o.has(l.info.rdns))continue;const u=e._internal.connectors.providerDetailToConnector(l),d=e._internal.connectors.setup(u);a.push(d)}return[...r,...a]})),s?cx(e):e.storage&&e.setState(r=>({...r,connections:new Map}))}}}function Mx(e){const{children:t,config:n,initialState:s,reconnectOnMount:r=!0}=e,{onMount:o}=kx(n,{initialState:s,reconnectOnMount:r});n._internal.ssr||o();const a=b.useRef(!0);return b.useEffect(()=>{if(a.current&&n._internal.ssr)return o(),()=>{a.current=!1}},[]),t}const $l=b.createContext(void 0);function Tx(e){const{children:t,config:n}=e,s={value:n};return b.createElement(Mx,e,b.createElement($l.Provider,s,t))}const Ax="2.19.2",Dx=()=>`wagmi@${Ax}`;class Rx extends mo{constructor(){super(...arguments),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"WagmiError"})}get docsBaseUrl(){return"https://wagmi.sh/react"}get version(){return Dx()}}class Lx extends Rx{constructor(){super("`useConfig` must be used within `WagmiProvider`.",{docsPath:"/api/WagmiProvider"}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"WagmiProviderNotFoundError"})}}function bo(e={}){const t=e.config??b.useContext($l);if(!t)throw new Lx;return t}function Fx(e){return JSON.stringify(e,(t,n)=>zx(n)?Object.keys(n).sort().reduce((s,r)=>(s[r]=n[r],s),{}):typeof n=="bigint"?n.toString():n)}function zx(e){if(!La(e))return!1;const t=e.constructor;if(typeof t>"u")return!0;const n=t.prototype;return!(!La(n)||!n.hasOwnProperty("isPrototypeOf"))}function La(e){return Object.prototype.toString.call(e)==="[object Object]"}function Vl(e){const{_defaulted:t,behavior:n,gcTime:s,initialData:r,initialDataUpdatedAt:o,maxPages:a,meta:c,networkMode:l,queryFn:u,queryHash:d,queryKey:p,queryKeyHashFn:f,retry:h,retryDelay:m,structuralSharing:g,getPreviousPageParam:y,getNextPageParam:x,initialPageParam:v,_optimisticResults:S,enabled:N,notifyOnChangeProps:w,placeholderData:j,refetchInterval:C,refetchIntervalInBackground:P,refetchOnMount:E,refetchOnReconnect:M,refetchOnWindowFocus:O,retryOnMount:T,select:D,staleTime:F,suspense:V,throwOnError:B,config:_,connector:Y,query:W,...ee}=e;return ee}function $x(e,t={}){return{async queryFn({queryKey:n}){const{name:s,scopeKey:r,...o}=n[1];if(!s)throw new Error("name is required");return ax(e,{...o,name:s})},queryKey:Vx(t)}}function Vx(e={}){return["ensAvatar",Vl(e)]}function Bx(e,t={}){return{async queryFn({queryKey:n}){const{address:s,scopeKey:r,...o}=n[1];if(!s)throw new Error("address is required");return ix(e,{...o,address:s})},queryKey:Ux(t)}}function Ux(e={}){return["ensName",Vl(e)]}function Bl(e){const t=vu({...e,queryKeyHashFn:Fx});return t.queryKey=e.queryKey,t}function Ul(e={}){const t=bo(e);return b.useSyncExternalStore(n=>lx(t,{onChange:n}),()=>Ma(t),()=>Ma(t))}function Hx(e={}){const{name:t,query:n={}}=e,s=bo(e),r=Ul({config:s}),o=$x(s,{...e,chainId:e.chainId??r}),a=!!(t&&(n.enabled??!0));return Bl({...n,...o,enabled:a})}function Hl(e={}){const{address:t,query:n={}}=e,s=bo(e),r=Ul({config:s}),o=Bx(s,{...e,chainId:e.chainId??r}),a=!!(t&&(n.enabled??!0));return Bl({...n,...o,enabled:a})}function _l(e){const{address:t,chainId:n=1,size:s="14px"}=e,r={width:s,height:s},o=Hl({address:t,chainId:n}),a=o.data??void 0,c=Hx({name:a}),l=c.data??zg;return o.isLoading||c.isLoading?i.jsx("div",{className:"fade-out flex-none animate-pulse rounded-full bg-gray-400",style:r}):i.jsx("img",{alt:"ENS Avatar",className:"flex-none rounded-full object-contain",src:l,style:r})}const Wl=["RENAME","DELETE","DUPLICATE"],_x=[{value:"LOCAL",icon:i.jsx(I,{name:"Lock",size:16}),description:"Only available to you"},{value:"CLOUD",icon:i.jsx(I,{name:"People",size:16}),description:"Only available to people in this drive"},{value:"PUBLIC",icon:i.jsx(I,{name:"Globe",size:16}),description:"Available to everyone",disabled:!0}],Wx={CLOUD:{title:"Secure cloud",description:"End to end encryption between members.",icon:i.jsx(I,{name:"Lock",size:16})},LOCAL:{title:"Local",description:"Private and only available to you.",icon:i.jsx(I,{name:"Hdd",size:16})},SWITCHBOARD:{title:"Switchboard",description:"Public and available to everyone.",icon:i.jsx(I,{name:"Drive",size:16})}},Gx={ADD_TRIGGER:{label:"Add Trigger",icon:i.jsx(I,{className:"text-orange-900",name:"Plus",size:16})},REMOVE_TRIGGER:{label:"Remove Trigger",icon:i.jsx(I,{className:"text-orange-900",name:"Xmark",size:16})},ADD_INVALID_TRIGGER:{label:"Add Trigger",icon:i.jsx(I,{className:"text-orange-900",name:"Exclamation",size:16})}},Yx={DUPLICATE:{label:"Duplicate",icon:i.jsx(I,{name:"FilesEarmark",size:16})},RENAME:{label:"Rename",icon:i.jsx(I,{name:"Pencil",size:16})},DELETE:{label:"Delete",icon:i.jsx(I,{name:"Trash",size:16}),className:"text-red-900"},SETTINGS:{label:"Settings",icon:i.jsx(I,{name:"Gear",size:16})}},Gl={...Gx,...Yx};function Yl(e){const{node:t}=e,[n,s]=b.useState(!1),r=b.useCallback(a=>{a.dataTransfer.setData("UI_NODE",JSON.stringify(t))},[t]),o=b.useCallback(()=>{s(!1)},[]);return b.useMemo(()=>({isDragging:n,dragProps:{draggable:!0,onDragStart:r,onDragEnd:o}}),[n,o,r])}const ql="powerhouse/budget-statement",yo="powerhouse/default",Jl="makerdao/rwa-portfolio",qx=[ql,yo,Jl],Jx="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGwAAAB4CAYAAAAXIRdAAAAACXBIWXMAACE4AAAhOAFFljFgAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAzWSURBVHgB7V1dbBXHFZ5d/wI1WMhuVBUJq1GlAg9QlZSngNU2D9BIreoYGikKUdVKjaoSklSRWol4TdWmUgs0SFVTVaqUELUKhDTlIUFqiDA8lKQ8QCvMS5PaVRAN14kMjrGN7TuZb5izPne89/r+7HrXvvNJ17s7O3v3er89Z845M3PGE+XDw58j372+Pi8bv+3n5WZV0i2l1y6EbBfLFNKT/U8fvycQGYFXznkppTi8O7fXF95eKWS3qDN4irQnM0LaPMIUOWGZ53ni0O7r3Z5o+JOQokvUMYyk9dOhSAkFhHGyfvXg/9pbVq7oU7tP8DotqzzRsb5R3Lu1Sazb2CTaOnxdtpxw9OGPI8st0nSRWGT4dgGk6je7P+xSZL0tGFkgZVvPCvHY8+2i50Cb2LKzVRHXsOzIKgVPen1HdufwEosgCPCPL/o/79n7v+79f1eD57/NVeCWnS2KrJV1Q04xCSOol7p//ysd/Xi5LSQucY1Qg3Tj57453G6Ttf3RlVqaHOagnlnf4T03sNtvnfJgoKnnmRhxPn9LdJvFyHrgh6scWUUA9Xho94d988rN8+T2QJwI27BDvTf2CtZmQbI27GgRDsURRRokTGjeIGzxkxYSpl6M8MYbtrc4ySoTNmlcwrAfN2masMMPXX+MVOHqTl9se2iFcCgfUZJG7VjcpN2VMK9xHxVAukCaQ2WwSANZBQEIEZML4MOMV9+/hQpcu1U9GGnaWjS+mt6atq32exzak9vv5eURHHxha7N48OnPiHrHQn7YQkBEZGzj7w8qokKWjLkvajX7fV+KHXSwbmOjcKgdkLS2wcefLSgzxkiEs10RfMn8rk4VanKIB8VMfjL7qzVElEjJLjpAUNdBiDZldI3l8qJWmNijuLnxdwf18V3fTJh9Mv0rUo8wB8POx3oK5JbC6s74NA3CWGuUeuzr6+PEhCZ/pXD2ewTWbYhX0yhBQuyxD9YiSFJbPzxVoWp0hEVgy674ozxkiIA0Zj16lUqZIywCLSs98XnVORs3QNqawR8diDxVpqQ5wooAPRVJtOmKmKBYlL8c0hxhRaBjqj3JxFTJ5C8S/ShJmiOsBNBjkSRpv90z8iwnrZz2zBG2ANBzgb7BpNQj98OMQVLyRt7h3hvhBfv+slY4ROOWcqTfeXVCXD03JeLEUyc+61OcEWD7kfrShTbKBNq0Bx5fpSXu/Yt3xHsXp8XI8IyYGq89Ct/f3w+GyvoiR1iFAHFo22rpka+lN8C1YRkAOdIUCRFWByiHIyxD4BGQYnUcYSmDzHqyDi3fTI8u5g61IyxlQAeCLBPNl9wA4V0xwkidIyxlKLK0KjRE0RgQzUtEX5nnrMQMAJKkCNP7fByImD+7yElY2oCE8ZAUb8t41IMsSCdhGYEiBGMSwmFxRh3ysJXedxKWMiBhCjA8fDaOURaLKToJywAMabTVkma1ZSGchGUExlpcsBPTEZYyGFHyypUrHh/kYdSiLOgzq7fulWuD0+LCycmSkXaM59i4vTmxeQY8+Ku6VxpIJYKwTZs2UVxR8m4XQl1J2DsnJ8TJn49p0kp1i+D8318Y1/UXAR4RxsnSJyyy6soPuzowpTsgK4HusByIt8PSRm9vb2S57YNhCwLrhrDBc3dENaj2unIBqYKE0chgZubP88GAuiEMbVY1gHpMEmi3sEUskQwQBfLDwn4yql83flgcXflJgVuKZjY7BX5DR5rqOrM+ZZw4cUISYZAy1aZFDt8mKXORjpRBFiIA9QgCTTk3OiRJmSMsZXCSYICoT9hHFlXfqcSUociCaa9VIYspenxCO6+/ZCQMRsOl05NiUPlFxWZHYggaohTbelpjnZSXJLgkQbpYmTY6eLcLsCQk7FZuVvz5pze1I1tqKitG58LRfU1FM3DNUgBUIkmR2Q/nQZsqBRK2JAhDOKmSOccgDqQtFRijIrQYjU8WEmUI1L5Z5gmD41rNBHGQ9kHCTm8cQBtG4BYjV5U0agplmScsN1y9ars2WF10YzERZQ1aE9gLkHmjI8sRijhAISge7aBym0w3aioDoGg9GRyeN9eHac/QrKtofVZB0XoW4cBGS5dJEbH0rMTlDJIsFqkHiqpFR1hGwC1Ec8zJCklbFKMjC+Mosg5LykKyDHEhgYkThnER5XTNg1R8bo3kE5u5n0XAD7NVot3bzHMsJqoSszqOIsugHmiAgsDc+EhUwmoZR1EvqpHMekgXDXOj6IclaXn18ROVsKyOo8giSB0iylEsQw5IS5Sw5R6liANMmrQvxh3nCGQ/+LvcwaxBO/gbzhNjEpf94G+9ICicwRIGgCFtZjqtPnRjOlIGWYXUF0bHMOPZMAE3zC0rQBsGy5DGdFBsEaDRUtwIcRKWMmDWG4K4CR8mCQvmps9qOAlLGTRqyrLlJVmKLvibMYAQMudtSzEKjrCUQQRBwniPszk3b8qRa8NSBhFGs1d46qIgYspRohIWR9rVuFK3ZnXVC2a60/G8pCq8XqIShrVcqokL8kV7OmpYwKej4Htq/y1JgKxE5oNJK4UsVKW/KBKGIdPVgGf7xGrs1ST9x7Dte+9rjvW3JAE+LpHNceap+LxFc5zX6XHulXVGor7dtYKk/20VLPMIsr5zYHUivyVuMD+Md2RGTkoHErcSkdQYD7yUlKB9wXnUi1owFQT0KAKwPmcp4tpMPl6QFbWOZxy/JW7waH3A5joTyGikIPCiWIl4S2t9UymrdRZ+S5ygDkwTmuK5fgtTkxppc35YBkAxRDqWd6H3KTzl/LCMwYxPLGi7WDwxNEYcYSmDulUUJE9dBLBVacPVaZ1KzAjsGKKVoDkkzRGWMqgfLGDj66OSgrk2LCOwMgeQpIVp95jRIZXJ71Y3SgNW+r1Gu88LvlixkVNOJaYMPpCUtjToJioA7FRixsBDU5bkaZXoJCwDCIr0MvOwlDBLCDvCUgb3u2ziuElP6tERljKMBciP57VdHK4NSxm8A5NgIvZewBI1owx1HGEpg/wwgIjzIhYtJbXoVGJGQWoRJj71hQVLIRNOPSCYn0WAz3GWPHrvCEsZlPaBEBQZTArSnFmfIfAgMElX1ExMZ3SkDPLDeBCYLENrQW493M1JWEbA1SC1WcaUDyfzOaMjo+CqMHCzV7KFoHDCg97avcwAbRVh3ihd4Gb9J4+p2wXPeDQq0gHYo6aIvEbhyVHVrLXjJNIGda5aGtmolypGhgpylwwbo4MbFxrWyrPhaCpfitlzdKIeE5osNgpT4sohSA9fzqMYQpWoDMhLVPjexWSXXnIQBYmj854cCExG7Yhoh0bA1g4D/Lw3dopOjgzNisnxyjNYO5SHmzdmxfsX5wibuJM7xZOBwXnGNmCrQhhCw5G//jOvfHFIcT2AAzSIl96cFA7xAyrtakGyNHn5zOiPh/l0I5ZGVlpkhekffFgpMj/7El10+c0pJ2UxAw9ar1pxjqUVlPnnOzs7pb2kYmDlTAzYItza6ADDF/z9L6r9IRRCypCzsEhGMYcKQc/x3ZNzy5DgWZ8aefgY1WEkFVwbRGTCwao62o7/qjiyo0E0n6ET9z+yQmzZ1WpukM35wVkHkYVm5vwxluhTzn7vqVc/p7WaHckwy1Pl7e+ZN93oXfHkgMznj9Lx+ZfvZga1sok5lAl6bliNiZMlZf7oP7x9YRNkRzqOHz8+rz1iycG0w6YlDLr0yzMH21sb1yop8zZThfsfaRWbd7YWhEscosFfbOxfPl1Iliodzn387688d+YbOrqEZw7HmWat0OJvZi3M0Erk9wglDG3Zz/66YXTGv9VD7Rlw/uVJ8dYL48okndE/Ip/Ph2+P+0R/Jj6ZFeeO3S4gS73mQ6Jp8mv/WfuHkCz27MMuFl2XpS0KrBFUYNA3JzWbYPm+6V92NTWveUvdu4sqtnX44kvbm9SnWaxW+7ak8eOo2Rc2eJ2o+nYZHZdTt1JUe70tUTDYIFX/On3HihnKyzPTt3qeeR0uVHHJ4hfY9yJ+NFnkvKEwl8t5+OKJ6Y+2Qt/SBWMqzvjP16bEsf1j4o0j47oh/eDKtH6bSPLoYx9HfXidqPrFvrOcupV+qr0e/3vuvzP6Wbz+i0/0s8Ez4mRJOXN0cmbo62+M/mDYJoBS7VH6PVMe+VKQtKGSz8Mi3POGmjzUc22v39B0gEubw8KACrwjJ75/0fvJWSojJ5nUIUkVyCLyqP0i2O2YNuvZtE0yK8MLuru7vbNnz8rDe64/KvL+E9wgcYjEgPSmX7og97/ICYLmUs8yH6H+eAwxckIfJ01LGF1EWxJP3ATeOPZxc5C3654/rm/Ir/qWumyH8rvXe8Jbr5radlGHUP/7qFKmN1XTMaC6qS7fnh7/2wHVnNBLbkcxAHssPUlXqTlhAJH4Kc1sL4jISlnaAAAAAElFTkSuQmCC",Qx="/assets/rwa-report-Bb0W5-ac.png",Xx="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGwAAAB4CAYAAAAXIRdAAAAACXBIWXMAACE4AAAhOAFFljFgAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAzzSURBVHgB7V1dbFxHFT5zdwNt+lCTJq1EItkPBKmJlCK1JW+JBTzQgkTAtUPlKAGUhzit0ki88JL4biseeCEiLQG1AqlpEaqdP/riIBFk961VHwhVUkErYUsND7FjuT9J1Nq+0zmzc8Znx/fau/buvbP2fNJm7996N/e758w538ycEVA/BP4jj/+0Ez6X+yBKHgEputWRDnW4A9YsREWcGYrBE4h6zkspAZ7pO6T2DoGEblhviBRpL/lB2iLCFDn2mBACZo/2dZcB/qzOdME6RqIsrXRmqGJ2JRSEGsI4WR8f/WHH/WLjoNp8ruYT994HcmsnyF2PAXxjB8gHNutjawmlY09nnNHuscIO5E7cIsLQqu4e7u2656twQf2cb9mTSFT39yHpfmLNEeQimzAg91iJ41ioFxKWK2nC3ZbP9nZBIv7JXaBUJCVP9Kx5oghLEoZQpMGLb1Tw4XbQcvLKZFWImYEfdCwi6ycHq1YVsIBEDsIz+3Gr4pwRGKCp+9ky4iL+lFTbLEZW/5FAVibk4PzRvkH3KN1PHg80E5H9+qO9h4AFGNqydu+FgGxEKaTpFEjzhsbWfNKihU1hv1ju3hMsq064pHELw+1mk6YJmxt46mfWFW7aogKMpyCgfiBp0rE0aseaTZomrBSJY3QArQtJC2gUNaQhWTUCBCyvKtWFCHMunm+Fdms1sO5RR4uYq+FRfDdt26oh5MD+4yCSU/rrlHqRHP4lrHcsm4ctC1GpPLjjeZNYa5hwH1Yb9keKMmtSUklNAc2AHDxx8/pJfoSCkZRkuyEgYV12T2mEAc1BWiCC1kVh/0oDkbJqv7rsH9wWCENIFXSJ6UlYPRRpz/ZBZfOO53HP5GZgtin0b8g9YpS40Pm4TrTCZdHMKFnJWINT108ODg5yYmzI3ygiCFgEuf1haCqq2uMgRotIknqn+96wGhIIS4HsfhKaD2VpKhBh3TII0aiVBcLScO/GFkXMmrQTKSfqDkICYRlIDhxpUZsu4yyVvx7SAmFZ0JpqD7QCJBhnqB9i6c8GZAJ72mULSVOByElOWj3tWSBsGWDPRaL6BlvlHnkeZgKSJVkTquPSfmD+9F8hIAMqkY5GzoF4+y1oJsSZ4Yh0RgTbTvWXZQioD9im9Q8AKIsT/363+roxAXD3NqwWlUoFGapL8QiENQpFnG7bVtEjv5regNCGeQBKpEkJAacDlCMQ5hG4ApJ1TSCsYFBYT9Ghk5vhsRoVJBBWMNAHIllGzZc8AOFdMWCsLhBWMBRZ2hUaomgMiOYlpa9MhCjRA6AlKcL0Nh8HAosnqwQLKxpoYVyS4m0ZVz0oggwW5gkUIQksuEQaOsBlK70dLKxgoIUpYOARsXGMMktTLNTCxB0l63z4PogPrwPcuQPNBo6z1DNF+XcaWQk2Vjsp3fNFwJBG79rSnLbMojDCxMh5iEZHmqLFZUFP53UJuTEO4p2x6m/A70eNcPfelnWj1AsTLYIK75ccNpC7SxS3JqH0m19p5buVZNUNo8KX4mP6t+UNIgpH41y7dk1wtoxblDyZzpUwvCHRiy+op3wCvMO0+W0FPERImMnDiEC9bZLpGovLl7DL5/WN8RZI2iu/hZwhqA3buXMnicCp4xZzzcPE22P65TswABIfXIe80Nvbm3rczcHwHQnMkbDm9tS2EhgQ5QW0KhNskHXpn8CjRL6dC2HYdunQvU2gf2tObRkGGviObRgFIICDPUzAgTvc2vIJ630MMpYB5moyp8mNPFI0s9lJ+LWJNF2bj0tUuU/b4W7zE/k0DA8PSyIMrUy1aal5GFmZN1oiJq6ygVkjOjhoZbuYk0ukCBGB7hEJNMd50CHJyrwgbCXVdtBdia1dEF04C+0MThIGIOpl+8jSrvdC/F1pTRC5BibQK7IwtNeukGmKgk9o59f74RLR/axgZK0Wj9sc3JLQutgxHXTwbheEFxYWnX8NVgJxsb3dIQJdIlmR2bbzoM0l/lkYquclFURg4cx6LU28964f4nETYIIK3JQULfJ2jMJ87DPzp8dZ6XjCZ52xRcA2jLlCe5y7Sho1hcdCj3PBSIsGnQnsNQhjOgoGSVBc7aDjLplh1JQHILWeAg4hFvow3RmaXo2a8k7pyAksWeZJs6BAxLW0oHQUDFI6yCVStIj/pLnFoHR4Ah4hmn1OVs5q/XJYYT61FpQOQlw71M2SZYIS4ZVaj0qHrovRINaC0oF5mOMOwe1t5jUWg9LhGUwPdE0Xi1E5tNUFpaNgUFiP1oVkYdSIVmeOcUtLUJoKeZgnIHeIKkdWhRwkLRBWMJg16eECPHFOgQiEFQwWDbrir50nxizOnzZsvSodBB7Wx2acopGqrN4IvkyZXe9KB76T2kH7FBnidpz7MLdlsN7HdGBkSGM6aCQwwuiJNUFIGNNRMDCs5/ohgoYJkDvk1QTCmI6CQaOmnFheUqToir9B6SgY1I1iCqzURIppyIewekjwTenIqYY/EcTG1XPrqhGB85Om2nGJkJx+MxFGI6V46aI4ZcpRLm2Y3NbVdqtOyO35LBzEQnfaX1RUhV+Xk0vcCHLXo22T6OpF73ICRYksB5NOCVk9HjFXC0O00zKNef5W0hIRbI4zL8VX0JgOrIehFA3flQldryPHJSXRwvhA0piN+E0TgXPNw1pZB74ZwN+Wtyfgaj1piPw8pWckAueeh+ENwackz4nf9aCoFeGpA9NIU7zWb21pUmNthSgdSNp8fLrauBcZParvRqvH31LkutWkIdK+rEJvkzyVb5SYBqoD3w/Vuhg4p7jJyoVOJ9xjux6HRKn8upy5RysSmpG/NW0X0xNtMOJH98r2HBdLVQmx9CiRp24VBUljOugcW5XWTjkKPc6ewNUQnQLNlrRAWMGgfjAa04HH+FoshOLbsAANp3IAWZotu8eCDqlC/rC6URHga6+IM8Nlt88Lc7GskVPBJRYMPpCU3lntxEUCcHCJnoFLU47laZcYLMwDxBm9zFyWAlOZNBBWMHje5RLHQ3pyj4GwgmEiQL6/qO3iCFFiAeBRYt8klJnaoYFRohkyIB2lI+RhRYPyMATlYSJl0VJyi8Elegpyi2hp1BcWh0o4fsBRORB8eJvk6n0grGBQQRVCnDGYFEkLYb1H4CJwzKq4uQhBR8GgPIyLwBQROgty6+FuwcI8AXeD1GaZSX220GUIOjwFd4Wxj6WL1jPi2nLn+t3tZUbQOxI2Yz+9BguVeIfaBQxm+FBtDnfUFJGngg6hCJMd+uz0FMDW9pq00G4QH43bbXX/J0zQwYOL6nW1K8/a0VRRIsHOUMhzGaZ1C7YOjbr/42g9vPxeFhZcooR/2T+Ai3kGtBbMKBIQY/FCIctU1xiztcMQ0aeJeJNOihvjINdQSTvvcOsmRO8tGMXU3BdvUpkHBCbP+B6zVSEMoXbkb9Tx8hvjytjG9CdUg6hXfg1oOnQyzObHqd2r+/87M8GnG7GFcqRDli3/EGGUMpckdg5QNDYSrKzJ0O0PzuF+Z4GwBOTvtmzZIt0lFWOnZmLMFuHWQQcy3H8relXtjusr0cpGzkFGRbGABmGDhZHzbNK9GP/e+1O21gUfMcURp1TCwVV1Srhx9gHYe08EV+hE8uMDkHQ/Wb1oiYWgA7JhcynVzJQuLtQimZfyF+U/nNNezVUyTNHmxP07i6YbHbwFYwkkp2k/uvi6XhXWqSYWUCfovuE95GQpV3j66SlhmyBX6RgaGkrcv0XjFBG4oS0MfempB+c6vg7lK0LCI3TB/L4Deu4Ul0sC0sEfbB0gjF2uIUudnfjPZ9OPPnz2ilaXzHRZO2uFSqJTrY54qTLo2JZt+/3FmU9mox7bnimULr0O0V/+CHLqpv4RSZLYpye8Ml63P4Powms1ZCmMfy43fOfk3U2WLHbvbRcLvvOyRbEzggoZjMxJzSay/MrXZrvuL3/lH+qZ6LJPx6bNMP/4HpDf3qO3XUvj+2mzL1zwa9Kud4/Rfj3XNoqVft61KAzYSsqqorcug2CaoRRw9ZPZ2Z6Oly+N436WZfE/7X4X8aPJouQND05OTgr8wzfE7GPob+kDQumM5b9fgA0vHIfyn04BqIZUfnBNP01kefRy99Ne/Jq067P+Zj3XNvpa6ef1//2j/+l7UX7p1/relNQ94mThPfw/zH13n8q5XAKo1B6V3zPHUx8Ksja8KOKyCM+80U1+caTn0IaodIJbW0BdGL89Lw//fFqM0gFKkskdklUhWUQetV8Etx3TYT0fyGjM036gu7tbjI6OyrmB/QejKHmOByQBi4Gq0ZwQZ/tvylc5Qei51L1MUtwf1xBTJ/Rx0rSF0YfoncwTvwSzcdzGL0fyLn3zoc77RPIjEcHeKIJORWCnOt0B6xMz6uZ8rNzemJwXV6fl7N8eUs0JPeSuioFwx9KTdS01JwxBJH4JoOdEKaNKcdAAAAAASUVORK5CYII=",Fa={[ql]:Jx,[yo]:Xx,[Jl]:Qx};function Kx(e,t){return t||(qx.includes(e)?Fa[e]:Fa[yo])}const za="SYNCING",$a="SUCCESS",Va="CONFLICT",Ba="MISSING",Ua="ERROR",Ha="INITIAL_SYNC",Zx={SYNCING:"Syncing",SUCCESS:"Synced",CONFLICT:"Error",MISSING:"Circle",ERROR:"Error",INITIAL_SYNC:"Syncing"};function ev(e){const{syncStatus:t,className:n,overrideSyncIcons:s={},...r}=e,o={...Zx,...s};return{[Ha]:i.jsx(I,{size:16,...r,className:k("text-blue-900",n),name:o[Ha]}),[za]:i.jsx(I,{size:16,...r,className:k("text-blue-900",n),name:o[za]}),[$a]:i.jsx(I,{size:16,...r,className:k("text-green-900",n),name:o[$a]}),[Va]:i.jsx(I,{size:16,...r,className:k("text-orange-900",n),name:o[Va]}),[Ba]:i.jsx(I,{size:16,...r,className:k("text-red-900",n),name:o[Ba]}),[Ua]:i.jsx(I,{size:16,...r,className:k("text-red-900",n),name:o[Ua]})}[t]}function p6(e){const{fileNode:t,className:n,customDocumentIconSrc:s}=e,[r,o]=b.useState("READ"),[a,c]=b.useState(!1),[l]=oi(),u=l?Xr(l):"LOCAL",{dragProps:d}=Yl({node:t}),{isAllowedToCreateDocuments:p}=Rs(),{onRenameNode:f,onRenameDriveNodes:h,onDuplicateNode:m}=ar(),g=r==="READ",y=wu(t.id,u),x={DUPLICATE:()=>m(t),RENAME:()=>o("WRITE"),DELETE:()=>ii(t)},v=Object.entries(Gl).map(([M,O])=>({...O,id:M})).filter(M=>Wl.includes(M.id));function S(M){Promise.all([f(M,t),h(M,t.id)]).catch(O=>{console.error(O)}).finally(()=>{o("READ")})}function N(){o("READ")}function w(M){const O=x[M];if(!O){console.error(`No handler found for dropdown menu item: ${M}`);return}O(),c(!1)}const j=Kx(t.documentType,s),C=i.jsxs("div",{className:"relative",children:[i.jsx("img",{alt:"file icon",className:"max-w-none",height:34,src:j,width:32}),g&&y&&i.jsx("div",{className:"absolute bottom-[-2px] right-0 size-3 rounded-full bg-white",children:i.jsx("div",{className:"absolute left-[-2px] top-[-2px]",children:i.jsx(ev,{overrideSyncIcons:{SUCCESS:"CheckCircleFill"},syncStatus:y})})})]}),P=k("group flex h-12 cursor-pointer select-none items-center rounded-lg bg-gray-200 px-2 text-gray-600 hover:text-gray-800",n),E=g?i.jsxs("div",{className:"flex w-52 items-center justify-between",children:[i.jsxs("div",{className:"mr-2 truncate group-hover:mr-0",children:[i.jsx("div",{className:"max-h-6 truncate text-sm font-medium group-hover:text-gray-800",children:t.name}),i.jsx("div",{className:"max-h-6 truncate text-xs font-medium text-gray-600 group-hover:text-gray-800",children:t.documentType})]}),p?i.jsx(yr,{items:v,onItemClick:w,onOpenChange:c,open:a,children:i.jsx("button",{className:k("hidden group-hover:block",a&&"block"),onClick:M=>{M.stopPropagation(),c(!0)},children:i.jsx(I,{className:"text-gray-600",name:"VerticalDots"})})}):null]}):i.jsx(dr,{className:"ml-3 flex-1 font-medium",defaultValue:t.name,onCancel:N,onSubmit:S});return i.jsx("div",{className:"relative w-64",onClick:g?()=>ht(t):void 0,children:i.jsx("div",{...d,className:P,children:i.jsxs("div",{className:"flex items-center",children:[i.jsx("div",{className:"mr-1.5",children:C}),E]})})})}function h6(e){const{folderNode:t,className:n}=e,{isAllowedToCreateDocuments:s}=Rs(),[r,o]=b.useState("READ"),[a,c]=b.useState(!1),{dragProps:l}=Yl({node:t}),{onRenameNode:u,onRenameDriveNodes:d,onDuplicateNode:p}=ar(),{isDropTarget:f,dropProps:h}=Dc({target:t}),m=r==="READ";function g(){o("READ")}function y(j){Promise.all([u(j,t),d(j,t.id)]).catch(C=>{console.error(C)}).finally(()=>{o("READ")})}const x={DUPLICATE:()=>p(t),RENAME:()=>o("WRITE"),DELETE:()=>ii(t)},v=Object.entries(Gl).map(([j,C])=>({...C,id:j})).filter(j=>Wl.includes(j.id));function S(j){const C=x[j];if(!C){console.error(`No handler found for dropdown menu item: ${j}`);return}C(),c(!1)}const N=m||!s?i.jsx("div",{className:"ml-3 max-h-6 truncate font-medium text-gray-600 group-hover:text-gray-800",children:t.name}):i.jsx(dr,{className:"ml-3 font-medium",defaultValue:t.name,onCancel:g,onSubmit:y}),w=k("group flex h-12 cursor-pointer select-none items-center rounded-lg bg-gray-200 px-2",n,f&&"bg-blue-100");return i.jsx("div",{className:"relative w-64",onClick:m?()=>ht(t):void 0,children:i.jsxs("div",{...l,...h,className:w,children:[i.jsxs("div",{className:"flex items-center overflow-hidden",children:[i.jsx("div",{className:"p-1",children:i.jsx("div",{className:"relative",children:i.jsx(I,{name:"FolderClose",size:24})})}),N]}),m&&s?i.jsx(yr,{items:v,onItemClick:S,onOpenChange:c,open:a,children:i.jsx("button",{className:k("ml-auto hidden group-hover:block",a&&"block"),onClick:j=>{j.stopPropagation(),c(!0)},children:i.jsx(I,{className:"text-gray-600",name:"VerticalDots"})})}):null]})})}const bn=b.forwardRef(function(t,n){const{icon:s,errorMessage:r,isDirty:o,containerClassName:a,inputClassName:c,errorMessageClassName:l,hideErrors:u=!1,...d}=t,p=t.type??"text",f=!!r;return i.jsxs("div",{children:[i.jsxs("div",{className:k("mb-1 flex gap-2 rounded-md border border-gray-200 bg-gray-50 p-3 text-black placeholder:text-gray-50",f&&"border-red-900",a),children:[s&&i.jsx("span",{className:Fs((!o||f)&&"text-slate-200"),children:s}),i.jsx("input",{...d,className:k("w-full bg-transparent font-semibold outline-none",c),ref:n,type:p})]}),i.jsx("p",{className:k("hidden min-h-4 text-xs text-red-900",f&&"block",u&&"hidden",l),children:r})]})});function tv(e){return{value:e.id,displayValue:e.name,icon:i.jsx(I,{name:"PowerhouseLogoSmall"}),description:"Built by Powerhouse"}}function nv(e){const{control:t,appOptions:n,...s}=e,r=n.map(tv);return i.jsx(si,{control:t,name:"appId",render:({field:o})=>i.jsx(ft,{...s,...o,id:"appId",items:r})})}const rv=b.forwardRef(function(t,n){return i.jsxs("label",{className:"relative cursor-pointer items-center",htmlFor:t.id,children:[i.jsx("input",{className:"peer sr-only",ref:n,type:"checkbox",value:"",...t}),i.jsx("div",{className:"peer h-6 w-11 rounded-full bg-gray-500 after:absolute after:start-0.5 after:top-0.5 after:size-5 after:rounded-full after:border after:border-none after:bg-gray-50 after:transition-all peer-checked:bg-blue-900 peer-checked:after:translate-x-full peer-focus:outline-none"})]})}),xo=b.forwardRef(function(t,n){return i.jsxs("div",{className:"flex items-center rounded-md border border-gray-200 bg-gray-50 p-3 text-gray-900",children:[i.jsxs("div",{className:"flex-1",children:[i.jsx("label",{className:"font-medium text-gray-900",htmlFor:"availableOffline",children:"Make available offline"}),i.jsxs("p",{className:"text-xs text-gray-600",children:["Check this options if you keep a local backup",i.jsx("br",{}),"available at all times."]})]}),i.jsx(rv,{id:"availableOffline",ref:n,...t})]})});function Un(e){const{children:t,className:n,...s}=e;return i.jsx("label",{...s,className:k("block font-semibold text-gray-500",n),children:t})}function Ql(e){const{control:t,...n}=e;return i.jsx(si,{control:t,name:"sharingType",render:({field:s})=>i.jsx(ft,{...n,...s,id:"sharingType",items:_x})})}function sv(e){const{register:t,handleSubmit:n,control:s,formState:{errors:r}}=Ds({defaultValues:{name:"",sharingType:"LOCAL",availableOffline:!1,appId:e.appOptions[0].id}});return i.jsx("form",{name:"add-local-drive",onSubmit:n(e.onSubmit),className:"flex flex-col gap-4",children:i.jsxs("div",{className:"flex flex-col gap-4",children:[i.jsxs("div",{children:[i.jsx(Un,{htmlFor:"name",className:"text-sm font-medium text-gray-800",children:"Drive Name"}),i.jsx(bn,{...t("name",{required:"Drive name is required"}),errorMessage:r.name?.message,placeholder:"Drive name"})]}),i.jsxs("div",{children:[i.jsx(Un,{htmlFor:"driveApp",className:"text-sm font-medium text-gray-800",children:"Drive App"}),i.jsx(nv,{control:s,appOptions:e.appOptions})]}),i.jsxs("div",{children:[i.jsx(Un,{htmlFor:"sharingType",className:"text-sm font-medium text-gray-800",children:"Location"}),i.jsx(Ql,{control:s})]}),i.jsx("div",{children:i.jsx(xo,{...t("availableOffline")})}),i.jsx(Ce,{className:"mt-2 w-full",type:"submit",children:"Create new drive"})]})})}function ov(e){return i.jsxs("div",{className:"flex gap-2 rounded-xl bg-gray-100 p-3 font-semibold text-gray-500",children:[i.jsx(I,{className:"text-gray-600",name:"Drive"}),e.driveName]})}function Xl(e){const{location:t,className:n,...s}=e,r=Wx[t];return i.jsxs("div",{...s,className:k("my-3 flex items-center gap-2 rounded-xl border border-gray-100 p-3 text-gray-800 shadow",n),children:[r.icon,i.jsxs("div",{children:[i.jsx("p",{children:r.title}),i.jsx("p",{className:"text-xs text-slate-200",children:r.description})]})]})}function av(e){const{sharingType:t="PUBLIC",requestPublicDrive:n}=e,[s,r]=b.useState(),[o,a]=b.useState(!1),[c,l]=b.useState(!0),[u,d]=b.useState(!1),[p,f]=b.useState(""),[h,m]=b.useState(""),[g,y]=h0(h,500),{register:x,handleSubmit:v,setValue:S}=Ds({mode:"onBlur",defaultValues:{availableOffline:s?.availableOffline??!1}});b.useEffect(()=>{y(h)},[h]),b.useEffect(()=>{if(d(!1),g==="")return;w().catch(console.error);async function w(){try{const{id:j,name:C}=await n(g);r({id:j,name:C,sharingType:t,location:"SWITCHBOARD",availableOffline:!0}),S("availableOffline",!0),l(!0),f("")}catch(j){r(void 0),l(!1),f(j.message)}}},[g,S,t]);function N({availableOffline:w}){s&&e.onSubmit({...s,availableOffline:w,url:g})}return i.jsx("form",{onSubmit:v(N),children:u?i.jsxs(i.Fragment,{children:[i.jsx(ov,{driveName:s?.name??"New drive"}),i.jsx(lt,{className:"my-3"}),i.jsxs(Kn,{isOpen:o,onOpenChange:()=>a(!o),title:"Location",children:[i.jsx(Xl,{location:"SWITCHBOARD"}),i.jsx(xo,{...x("availableOffline")})]}),i.jsx(Ce,{className:"mt-4 w-full",color:"dark",type:"submit",children:"Add new drive"})]}):i.jsxs(i.Fragment,{children:[i.jsx(bn,{errorMessage:p,onChange:w=>m(w.target.value),placeholder:"Drive URL",required:!0,type:"url",value:h}),i.jsx(Ce,{className:"mt-4 w-full py-2 text-base",color:"dark",size:"small",disabled:!c||h==="",onClick:w=>{w.preventDefault(),d(!0)},type:"button",children:"Add drive"})]})})}const iv="/assets/home-bg-BRYzhkhi.avif",cv="/assets/home-bg-BEhF9NuW.png";function lv(){return i.jsxs("picture",{className:"pointer-events-none absolute inset-8 z-0 size-[calc(100%-32px)] object-contain",children:[i.jsx("source",{srcSet:iv,type:"image/avif"}),i.jsx("img",{src:cv,alt:"background",className:"object-contain"})]})}const uv=function(t){const{icon:n,title:s,description:r,containerClassName:o,shareable:a,onClick:c}=t;return i.jsxs("div",{className:k("hover-bg-transparent relative flex h-24 w-40 cursor-pointer flex-col items-center justify-center overflow-hidden rounded-md p-2 text-center text-sm text-black",o,c&&"cursor-pointer"),onClick:c,children:[i.jsx("div",{className:"mx-auto pb-2",children:n||i.jsx("div",{className:"size-8 items-center justify-center rounded-lg bg-black pt-1",children:i.jsx("span",{className:"text-6 w-6 text-white",children:s.slice(0,1).toUpperCase()})})}),i.jsxs("div",{className:"w-full max-w-full",children:[i.jsx("h3",{className:"w-full max-w-full truncate px-2",children:s}),r&&i.jsx("p",{className:"text-gray-500",children:r})]}),a&&i.jsx("div",{className:"absolute left-2 top-0 mb-2",children:i.jsx(I,{name:"PeopleFill",width:12,height:12})})]})},m6=function(t){const{containerClassName:n}=t;return i.jsx(uv,{title:"Create New Drive",icon:i.jsx(I,{name:"PlusSquare",size:32}),onClick:()=>Cu({type:"addDrive"}),containerClassName:n})},g6=function(t){const{children:n,containerClassName:s}=t;return i.jsx("div",{className:k("container relative mx-auto flex h-full flex-col",s),children:i.jsxs("div",{className:"m-8 flex flex-wrap justify-center gap-4 pt-12",children:[i.jsx(lv,{}),n]})})};function b6(e){function t(){s(!1)}const{open:n,onOpenChange:s,onAddRemoteDrive:r,onAddLocalDrive:o,requestPublicDrive:a,modalProps:c,containerProps:l}=e;return i.jsx(Fe,{...c,overlayProps:{className:"items-start pt-[15vh]"},contentProps:{className:"rounded-2xl"},onOpenChange:s,open:n,children:i.jsx("div",{...l,className:k("w-[408px] rounded-2xl p-6",l?.className),children:i.jsxs(Tc,{defaultValue:"Create Drive",children:[i.jsx(At,{label:"Create Drive",description:"Create a new drive",children:i.jsx(sv,{onCancel:t,onSubmit:o,appOptions:e.appOptions})}),i.jsx(At,{label:"Add Drive",description:"Add a drive",children:i.jsx(av,{sharingType:"PUBLIC",onSubmit:r,onCancel:t,requestPublicDrive:a})})]})})})}const _a="min-h-[48px] min-w-[142px] text-base font-semibold py-3 px-6 rounded-xl outline-none active:opacity-75 hover:scale-105 transform transition-all",Wa=300;function y6(e){const{onOpenChange:t,onContinue:n,overlayProps:s,contentProps:r,...o}=e,[a,c]=b.useState(""),[l,u]=b.useState(!1),d=()=>{t?.(!1),setTimeout(()=>c(""),Wa)},p=b.useCallback(()=>{l&&(n(a),setTimeout(()=>c(""),Wa))},[l,a,n]),f=b.useCallback(h=>{h.preventDefault(),p()},[p]);return i.jsx(Fe,{contentProps:{...r,className:k("rounded-3xl",r?.className)},onOpenChange:t,overlayProps:{...s,className:s?.className},...o,children:i.jsxs("form",{name:"create-document",className:"w-[400px] p-6 text-slate-300",onSubmit:f,children:[i.jsx("div",{className:"border-b border-slate-50 pb-2 text-2xl font-bold text-gray-800",children:"Create a new document"}),i.jsxs("div",{className:"my-6",children:[!l&&a&&i.jsx("div",{className:"mb-2 text-red-500",children:"Document name must be valid URL characters."}),i.jsx(bn,{icon:i.jsx(I,{name:"BrickGlobe"}),onChange:h=>{const m=h.target.value;c(m),u(Zu(m))},placeholder:"Document name",required:!0,value:a})]}),i.jsxs("div",{className:"mt-8 flex justify-between gap-3",children:[i.jsx("button",{type:"button",className:k(_a,"flex-1 bg-slate-50 text-slate-800"),onClick:d,children:"Cancel"}),i.jsx(Ce,{type:"submit",className:k(_a,"flex-1 bg-gray-800 text-gray-50"),disabled:!l,children:"Create"})]})]})})}const x6=e=>{const{inputPlaceholder:t,body:n,driveName:s,...r}=e,[o,a]=b.useState("");return i.jsx(qs,{bodyProps:{className:"p-0 bg-white my-0"},containerProps:{className:"w-[450px]"},continueButtonProps:{disabled:o!==s,className:o!==s?"bg-red-600 hover:scale-100 cursor-not-allowed active:opacity-100":"bg-red-900"},...r,children:i.jsxs("div",{children:[i.jsx("div",{className:"my-6 rounded-md bg-slate-50 p-4 text-center",children:n}),i.jsx("div",{children:i.jsx(bn,{hideErrors:!0,icon:i.jsx(I,{name:"Lock"}),onChange:c=>a(c.target.value),placeholder:t,value:o})})]})})};function v6(e){const{onDelete:t,deleteLabel:n,...s}=e;return i.jsx(qs,{...s,containerProps:{className:"w-[450px]"},continueButtonProps:{className:"bg-red-900"},continueLabel:n,onContinue:t})}const Kl=b.forwardRef(function(t,n){return i.jsx(bn,{...t,icon:t.icon??i.jsx(I,{name:"Drive"}),id:"driveName",placeholder:"Drive name",ref:n})});function dv(e){const{drive:t,handleDeleteDrive:n,onCancel:s}=e,[r,o]=b.useState(""),a=r===t.header.name;function c(){a&&n()}return i.jsxs("div",{children:[i.jsx("p",{className:"mb-2 rounded-md bg-slate-50 p-4 text-center text-slate-200",children:"Are you sure you want to delete this drive? All files and subfolders within it will be removed. Do you want to proceed?"}),i.jsx(Kl,{icon:i.jsx(I,{name:"Lock"}),onChange:l=>o(l.target.value),placeholder:"Enter drive name...",value:r}),i.jsxs("div",{className:"flex gap-3",children:[i.jsx(Ce,{className:"w-full",color:"light",onClick:s,children:"Cancel"}),i.jsx(Ce,{className:"w-full",color:"red",disabled:!a,onClick:c,children:"Delete"})]})]})}function fv(e){const{drive:t,sharingType:n,availableOffline:s,onSubmit:r,handleDeleteDrive:o}=e,a=t.header.name,[c,l]=b.useState(!1),[u,d]=b.useState(!1),[p,f]=b.useState(!1),{register:h,handleSubmit:m,control:g}=Ds({mode:"onBlur",defaultValues:{name:a,sharingType:n,availableOffline:s}}),y=n==="PUBLIC"?"SWITCHBOARD":n;return i.jsxs("form",{onSubmit:m(r),children:[i.jsx(Kl,{...h("name")}),i.jsx(lt,{className:"my-4"}),i.jsx(Un,{htmlFor:"sharingType",children:"Sharing settings"}),i.jsx(Ql,{control:g}),i.jsx(lt,{className:"my-3"}),i.jsxs(Kn,{isOpen:c,onOpenChange:()=>l(!c),title:"Location",children:[i.jsx(Xl,{location:y}),i.jsx(xo,{...h("availableOffline")})]}),i.jsx(lt,{className:"my-3"}),i.jsx(Kn,{isOpen:u,onOpenChange:()=>d(!u),title:"Danger zone",children:i.jsxs("button",{className:"flex gap-2 py-3 font-semibold text-red-900 transition hover:brightness-125",onClick:()=>f(!0),type:"button",children:[i.jsx(I,{name:"Trash"}),"Delete drive"]})}),p&&u?i.jsx(dv,{drive:t,handleDeleteDrive:o,onCancel:()=>f(!1)}):i.jsxs(i.Fragment,{children:[i.jsx(lt,{className:"my-3"}),i.jsx(Ce,{className:"mb-4 w-full",type:"submit",children:"Confirm"})]})]})}function w6(e){const{drive:t,open:n,sharingType:s,availableOffline:r,onOpenChange:o,onDeleteDrive:a,onRenameDrive:c,onChangeSharingType:l,onChangeAvailableOffline:u,modalProps:d,containerProps:p}=e,f=g=>{g.name!==t.header.name&&c(t,g.name),g.sharingType!==s&&l(t,g.sharingType),g.availableOffline!==r&&u(t,g.availableOffline),o(!1)};function h(){a(t),o(!1)}function m(){o(!1)}return i.jsx(Fe,{...d,contentProps:{className:"rounded-2xl"},onOpenChange:o,open:n,children:i.jsxs("div",{...p,className:k("max-w-[408px] rounded-2xl p-6",p?.className),children:[i.jsxs("div",{className:"flex justify-between",children:[i.jsx("h1",{className:"text-xl font-bold",children:"Drive settings"}),i.jsx("button",{className:"flex size-8 items-center justify-center rounded-md bg-gray-100 text-gray-500 outline-none hover:text-gray-900",onClick:m,tabIndex:-1,children:i.jsx(I,{name:"XmarkLight",size:24})})]}),i.jsx(lt,{className:"my-4"}),i.jsx(fv,{handleCancel:m,handleDeleteDrive:h,onSubmit:f,drive:t,sharingType:s,availableOffline:r})]})})}const Yr=[{key:"id",label:"ID",width:"120px"},{key:"kind",label:"Kind",width:"80px"},{key:"documentId",label:"Document ID",width:"150px"},{key:"scope",label:"Scope",width:"100px"},{key:"branch",label:"Branch",width:"100px"},{key:"createdAt",label:"Created At",width:"160px"},{key:"retryCount",label:"Retries",width:"70px"},{key:"status",label:"Status",width:"100px"}];function Ga(e,t=12){return e.length<=t?e:e.slice(0,t)+"..."}function pv(e){return new Date(e).toLocaleString()}function hv(e,t){return t?[...e].sort((n,s)=>{let r=0;switch(t.column){case"id":r=n.id.localeCompare(s.id);break;case"kind":r=n.kind.localeCompare(s.kind);break;case"documentId":r=n.documentId.localeCompare(s.documentId);break;case"scope":r=n.scope.localeCompare(s.scope);break;case"branch":r=n.branch.localeCompare(s.branch);break;case"createdAt":r=n.createdAt.localeCompare(s.createdAt);break;case"retryCount":r=(n.retryCount??0)-(s.retryCount??0);break;case"status":r=n.status.localeCompare(s.status);break;default:return 0}return t.direction==="asc"?r:-r}):e}function mv({direction:e,active:t}){return t?i.jsx(I,{className:e==="asc"?"rotate-180":void 0,name:"TriangleDown",size:12}):i.jsx(I,{className:"opacity-0 group-hover:opacity-50",name:"CaretSort",size:12})}function gv({getQueueState:e,onPause:t,onResume:n}){const[s,r]=b.useState({isPaused:!1,pendingJobs:[],executingJobs:[],totalPending:0,totalExecuting:0}),[o,a]=b.useState(!0),[c,l]=b.useState(),[u,d]=b.useState(!1),p=b.useCallback(async()=>{const x=await e();r(x),a(!1)},[e]);b.useEffect(()=>{p();const x=setInterval(()=>{p()},2e3);return()=>clearInterval(x)},[p]);const f=b.useCallback(async()=>{a(!0),await p()},[p]),h=b.useCallback(async()=>{d(!0),s.isPaused?await n():await t(),await p(),d(!1)},[s.isPaused,t,n,p]),m=x=>{const v=c?.column===x&&c.direction==="asc"?"desc":"asc";l({column:x,direction:v})},g=[...s.executingJobs.map(x=>({...x,status:"executing"})),...s.pendingJobs.map(x=>({...x,status:"pending"}))],y=hv(g,c);return i.jsxs("div",{className:"flex h-full flex-col gap-2",children:[i.jsxs("div",{className:"flex shrink-0 items-center justify-between",children:[i.jsx("h2",{className:"text-lg font-semibold text-gray-900",children:"Queue Inspector"}),i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsxs("button",{className:k("flex items-center gap-1 rounded border px-3 py-1.5 text-sm disabled:opacity-50",s.isPaused?"border-green-300 bg-green-50 text-green-700 hover:bg-green-100":"border-yellow-300 bg-yellow-50 text-yellow-700 hover:bg-yellow-100"),disabled:u,onClick:()=>void h(),type:"button",children:[i.jsx(I,{name:s.isPaused?"ArrowFilledRight":"Ellipsis",size:14}),s.isPaused?"Resume":"Pause"]}),i.jsxs("button",{className:"flex items-center gap-1 rounded border border-gray-300 bg-white px-3 py-1.5 text-sm text-gray-700 hover:bg-gray-100 disabled:opacity-50",disabled:o,onClick:()=>void f(),type:"button",children:[i.jsx(I,{name:"Reload",size:14}),"Refresh"]})]})]}),i.jsxs("div",{className:"flex shrink-0 items-center gap-4 rounded-lg bg-gray-100 px-4 py-2 text-sm",children:[i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx("span",{className:k("size-2 rounded-full",s.isPaused?"bg-yellow-500":"bg-green-500")}),i.jsx("span",{className:"font-medium text-gray-700",children:s.isPaused?"Paused":"Running"})]}),i.jsxs("div",{className:"text-gray-600",children:["Pending: ",i.jsx("span",{className:"font-medium",children:s.totalPending})]}),i.jsxs("div",{className:"text-gray-600",children:["Executing: ",i.jsx("span",{className:"font-medium",children:s.totalExecuting})]})]}),i.jsx("div",{className:"max-h-full overflow-auto rounded-lg border border-gray-300",children:i.jsxs("table",{className:"w-full border-collapse",children:[i.jsx("thead",{className:"sticky top-0 bg-gray-100",children:i.jsx("tr",{children:Yr.map((x,v)=>{const S=c?.column===x.key,N=S?c.direction:"asc";return i.jsx("th",{className:k("group cursor-pointer px-3 py-2 text-left text-xs font-medium text-gray-600 hover:bg-gray-200 hover:text-gray-900",v>0&&"border-l border-gray-300"),onClick:()=>m(x.key),style:{width:x.width},children:i.jsxs("div",{className:"flex items-center gap-1",children:[i.jsx("span",{className:"truncate",children:x.label}),i.jsx(mv,{active:S,direction:N})]})},x.key)})})}),i.jsx("tbody",{children:o&&y.length===0?i.jsx("tr",{children:i.jsx("td",{className:"px-3 py-8 text-center text-sm text-gray-500",colSpan:Yr.length,children:"Loading..."})}):y.length===0?i.jsx("tr",{children:i.jsx("td",{className:"px-3 py-8 text-center text-sm text-gray-500",colSpan:Yr.length,children:"No jobs in queue"})}):y.map(x=>i.jsxs("tr",{className:"odd:bg-white even:bg-gray-50 hover:bg-blue-50",children:[i.jsx("td",{className:"px-3 py-2 text-xs text-gray-900",children:i.jsx("span",{className:"block truncate",title:x.id,children:Ga(x.id)})}),i.jsx("td",{className:"border-l border-gray-300 px-3 py-2 text-xs text-gray-900",children:i.jsx("span",{className:k("inline-block rounded px-1.5 py-0.5",x.kind==="mutation"?"bg-purple-100 text-purple-700":"bg-blue-100 text-blue-700"),children:x.kind})}),i.jsx("td",{className:"border-l border-gray-300 px-3 py-2 text-xs text-gray-900",children:i.jsx("span",{className:"block truncate",title:x.documentId,children:Ga(x.documentId)})}),i.jsx("td",{className:"border-l border-gray-300 px-3 py-2 text-xs text-gray-900",children:i.jsx("span",{className:"block truncate",title:x.scope,children:x.scope})}),i.jsx("td",{className:"border-l border-gray-300 px-3 py-2 text-xs text-gray-900",children:i.jsx("span",{className:"block truncate",title:x.branch,children:x.branch})}),i.jsx("td",{className:"border-l border-gray-300 px-3 py-2 text-xs text-gray-900",children:i.jsx("span",{className:"block truncate",title:x.createdAt,children:pv(x.createdAt)})}),i.jsx("td",{className:"border-l border-gray-300 px-3 py-2 text-xs text-gray-900",children:x.retryCount??0}),i.jsx("td",{className:"border-l border-gray-300 px-3 py-2 text-xs",children:i.jsxs("span",{className:k("inline-flex items-center gap-1 rounded px-1.5 py-0.5",x.status==="executing"?"bg-green-100 text-green-700":"bg-gray-100 text-gray-600"),children:[x.status==="executing"&&i.jsx("span",{className:"inline-block size-1.5 animate-pulse rounded-full bg-green-500"}),x.status]})})]},x.id))})]})}),i.jsxs("div",{className:"shrink-0 text-sm text-gray-600",children:["Showing ",y.length," job(s)"]})]})}function Ms(e,t=12){return e.length<=t?e:e.slice(0,t)+"..."}function Zl({direction:e,active:t}){return t?i.jsx(I,{className:e==="asc"?"rotate-180":void 0,name:"TriangleDown",size:12}):i.jsx(I,{className:"opacity-0 group-hover:opacity-50",name:"CaretSort",size:12})}const bv=[{key:"id",label:"ID",width:"120px"},{key:"documentId",label:"Document ID",width:"150px"},{key:"branch",label:"Branch",width:"100px"},{key:"status",label:"Status",width:"150px"},{key:"opsCount",label:"Ops Count",width:"80px"}],yv=[{key:"id",label:"ID",width:"120px"},{key:"documentId",label:"Document ID",width:"150px"},{key:"branch",label:"Branch",width:"100px"},{key:"error",label:"Error",width:"200px"}];function xv(e){switch(e){case De.Unknown:return"Unknown";case De.TransportPending:return"Transport Pending";case De.ExecutionPending:return"Execution Pending";case De.Applied:return"Applied";case De.Error:return"Error";default:return"Unknown"}}function vv(e){switch(e){case De.TransportPending:case De.ExecutionPending:return i.jsx("span",{children:"⏳"});case De.Applied:return i.jsx("span",{children:"✅"});case De.Error:return i.jsx("span",{children:"❌"});default:return i.jsx("span",{children:"❓"})}}function rr(e){return e?e.error.message:""}function wv(e,t){const n=[...e];return t?n.sort((s,r)=>{let o=0;switch(t.column){case"id":o=s.id.localeCompare(r.id);break;case"documentId":o=s.documentId.localeCompare(r.documentId);break;case"branch":o=s.branch.localeCompare(r.branch);break;case"status":o=s.status-r.status;break;case"opsCount":o=s.operations.length-r.operations.length;break;case"error":o=rr(s.error).localeCompare(rr(r.error));break;default:return 0}return t.direction==="asc"?o:-o}):n}function qr({title:e,mailboxType:t,operations:n,sort:s,onSort:r,collapsed:o,onToggleCollapse:a}){const c=t==="deadLetter"?yv:bv,l=wv(n,s),u=d=>{r(t,d)};return i.jsxs("div",{className:"flex flex-col gap-2",children:[i.jsxs("button",{className:"flex items-center gap-2 text-left text-sm font-medium text-gray-700 hover:text-gray-900",onClick:a,type:"button",children:[i.jsx(I,{className:k("transition-transform",o&&"-rotate-90"),name:"ChevronDown",size:14}),e," (",n.length," item",n.length!==1?"s":"",")"]}),!o&&i.jsx("div",{className:"max-h-64 overflow-auto rounded-lg border border-gray-300",children:i.jsxs("table",{className:"w-full border-collapse",children:[i.jsx("thead",{className:"sticky top-0 bg-gray-100",children:i.jsx("tr",{children:c.map((d,p)=>{const f=s?.column===d.key,h=f?s.direction:"asc";return i.jsx("th",{className:k("group cursor-pointer px-3 py-2 text-left text-xs font-medium text-gray-600 hover:bg-gray-200 hover:text-gray-900",p>0&&"border-l border-gray-300"),onClick:()=>u(d.key),style:{width:d.width},children:i.jsxs("div",{className:"flex items-center gap-1",children:[i.jsx("span",{className:"truncate",children:d.label}),i.jsx(Zl,{active:f,direction:h})]})},d.key)})})}),i.jsx("tbody",{children:l.length===0?i.jsx("tr",{children:i.jsx("td",{className:"px-3 py-4 text-center text-sm text-gray-500",colSpan:c.length,children:"No operations"})}):l.map(d=>i.jsxs("tr",{className:"odd:bg-white even:bg-gray-50 hover:bg-blue-50",children:[i.jsx("td",{className:"px-3 py-2 text-xs text-gray-900",children:i.jsx("span",{className:"block truncate",title:d.id,children:Ms(d.id)})}),i.jsx("td",{className:"border-l border-gray-300 px-3 py-2 text-xs text-gray-900",children:i.jsx("span",{className:"block truncate",title:d.documentId,children:Ms(d.documentId)})}),i.jsx("td",{className:"border-l border-gray-300 px-3 py-2 text-xs text-gray-900",children:i.jsx("span",{className:"block truncate",title:d.branch,children:d.branch})}),t==="deadLetter"?i.jsx("td",{className:"border-l border-gray-300 px-3 py-2 text-xs",children:i.jsxs("span",{className:"block truncate text-red-600",title:rr(d.error),children:["❌ ",rr(d.error)||"Unknown error"]})}):i.jsxs(i.Fragment,{children:[i.jsx("td",{className:"border-l border-gray-300 px-3 py-2 text-xs text-gray-900",children:i.jsxs("span",{className:"flex items-center gap-1",children:[vv(d.status),xv(d.status)]})}),i.jsx("td",{className:"border-l border-gray-300 px-3 py-2 text-xs text-gray-900",children:d.operations.length})]})]},d.id))})]})})]})}function Cv({remoteName:e,channel:t,onBack:n,onRefresh:s}){const[r,o]=b.useState({inbox:void 0,outbox:void 0,deadLetter:void 0}),[a,c]=b.useState({inbox:!1,outbox:!1,deadLetter:!1}),l=j=>{c(C=>({...C,[j]:!C[j]}))},u=(j,C)=>{o(P=>{const E=P[j],M=E?.column===C&&E.direction==="asc"?"desc":"asc";return{...P,[j]:{column:C,direction:M}}})},p=b.useCallback(()=>{if(!(t instanceof Su))return null;const j=t.poller;return j instanceof ju?j:null},[t])(),[f,h]=b.useState(()=>({isPaused:p?.isPaused()??!1,isRunning:p?.isRunning()??!1})),[m,g]=b.useState(()=>({inbox:{isPaused:t.inbox.isPaused()},outbox:{isPaused:t.outbox.isPaused()}})),y=b.useCallback(()=>{p&&(p.pause(),h({isPaused:p.isPaused(),isRunning:p.isRunning()}))},[p]),x=b.useCallback(()=>{p&&(p.resume(),h({isPaused:p.isPaused(),isRunning:p.isRunning()}))},[p]),v=b.useCallback(()=>{p&&p.triggerNow()},[p]),S=b.useCallback(j=>{const C=j==="inbox"?t.inbox:t.outbox;C.pause(),g(P=>({...P,[j]:{isPaused:C.isPaused()}}))},[t]),N=b.useCallback(j=>{const C=j==="inbox"?t.inbox:t.outbox;C.resume(),g(P=>({...P,[j]:{isPaused:C.isPaused()}}))},[t]),w=b.useCallback(j=>{(j==="inbox"?t.inbox:t.outbox).flush(),s?.()},[t,s]);return i.jsxs("div",{className:"flex h-full flex-col gap-3",children:[i.jsxs("div",{className:"flex shrink-0 items-center justify-between",children:[i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsxs("button",{className:"flex items-center gap-1 rounded border border-gray-300 bg-white px-2 py-1 text-sm text-gray-700 hover:bg-gray-100",onClick:n,type:"button",children:[i.jsx(I,{className:"rotate-90",name:"ChevronDown",size:14}),"Back"]}),i.jsxs("h2",{className:"text-lg font-semibold text-gray-900",children:["Channel: ",e]})]}),s&&i.jsxs("button",{className:"flex items-center gap-1 rounded border border-gray-300 bg-white px-3 py-1.5 text-sm text-gray-700 hover:bg-gray-100",onClick:s,type:"button",children:[i.jsx(I,{name:"Reload",size:14}),"Refresh"]})]}),p&&i.jsxs("div",{className:"shrink-0 rounded border border-gray-200 bg-white p-4",children:[i.jsx("h3",{className:"mb-3 text-sm font-semibold text-gray-900",children:"Poller"}),i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsxs("div",{className:"text-sm text-gray-600",children:["Status:"," ",i.jsx("span",{className:f.isPaused?"text-yellow-600":"text-green-600",children:f.isPaused?"Paused":"Running"})]}),i.jsxs("div",{className:"flex gap-2",children:[f.isPaused?i.jsx("button",{className:"flex items-center gap-1 rounded border border-gray-300 bg-white px-3 py-1.5 text-sm text-gray-700 hover:bg-gray-100",onClick:x,type:"button",children:"Resume"}):i.jsx("button",{className:"flex items-center gap-1 rounded border border-gray-300 bg-white px-3 py-1.5 text-sm text-gray-700 hover:bg-gray-100",onClick:y,type:"button",children:"Pause"}),i.jsx("button",{className:"flex items-center gap-1 rounded border border-gray-300 bg-white px-3 py-1.5 text-sm text-gray-700 hover:bg-gray-100 disabled:cursor-not-allowed disabled:opacity-50",disabled:!f.isPaused,onClick:v,type:"button",children:"Poll Now"})]})]})]}),i.jsxs("div",{className:"shrink-0 rounded border border-gray-200 bg-white p-4",children:[i.jsx("h3",{className:"mb-3 text-sm font-semibold text-gray-900",children:"Mailbox Processing"}),i.jsxs("div",{className:"flex flex-col gap-3",children:[i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsxs("div",{className:"text-sm text-gray-600",children:["Inbox:"," ",i.jsx("span",{className:m.inbox.isPaused?"text-yellow-600":"text-green-600",children:m.inbox.isPaused?"Paused":"Active"})]}),i.jsxs("div",{className:"flex gap-2",children:[m.inbox.isPaused?i.jsx("button",{className:"flex items-center gap-1 rounded border border-gray-300 bg-white px-3 py-1.5 text-sm text-gray-700 hover:bg-gray-100",onClick:()=>N("inbox"),type:"button",children:"Resume"}):i.jsx("button",{className:"flex items-center gap-1 rounded border border-gray-300 bg-white px-3 py-1.5 text-sm text-gray-700 hover:bg-gray-100",onClick:()=>S("inbox"),type:"button",children:"Pause"}),i.jsx("button",{className:"flex items-center gap-1 rounded border border-gray-300 bg-white px-3 py-1.5 text-sm text-gray-700 hover:bg-gray-100 disabled:cursor-not-allowed disabled:opacity-50",disabled:!m.inbox.isPaused,onClick:()=>w("inbox"),type:"button",children:"Flush"})]})]}),i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsxs("div",{className:"text-sm text-gray-600",children:["Outbox:"," ",i.jsx("span",{className:m.outbox.isPaused?"text-yellow-600":"text-green-600",children:m.outbox.isPaused?"Paused":"Active"})]}),i.jsxs("div",{className:"flex gap-2",children:[m.outbox.isPaused?i.jsx("button",{className:"flex items-center gap-1 rounded border border-gray-300 bg-white px-3 py-1.5 text-sm text-gray-700 hover:bg-gray-100",onClick:()=>N("outbox"),type:"button",children:"Resume"}):i.jsx("button",{className:"flex items-center gap-1 rounded border border-gray-300 bg-white px-3 py-1.5 text-sm text-gray-700 hover:bg-gray-100",onClick:()=>S("outbox"),type:"button",children:"Pause"}),i.jsx("button",{className:"flex items-center gap-1 rounded border border-gray-300 bg-white px-3 py-1.5 text-sm text-gray-700 hover:bg-gray-100 disabled:cursor-not-allowed disabled:opacity-50",disabled:!m.outbox.isPaused,onClick:()=>w("outbox"),type:"button",children:"Flush"})]})]})]})]}),i.jsxs("div",{className:"flex min-h-0 flex-1 flex-col gap-6 overflow-auto",children:[i.jsx(qr,{collapsed:a.inbox,mailboxType:"inbox",onSort:u,onToggleCollapse:()=>l("inbox"),operations:t.inbox.items,sort:r.inbox,title:"Inbox"}),i.jsx(qr,{collapsed:a.outbox,mailboxType:"outbox",onSort:u,onToggleCollapse:()=>l("outbox"),operations:t.outbox.items,sort:r.outbox,title:"Outbox"}),i.jsx(qr,{collapsed:a.deadLetter,mailboxType:"deadLetter",onSort:u,onToggleCollapse:()=>l("deadLetter"),operations:t.deadLetter.items,sort:r.deadLetter,title:"Dead Letter"})]})]})}const Jr=[{key:"id",label:"ID",width:"120px"},{key:"name",label:"Name",width:"150px"},{key:"collectionId",label:"Collection ID",width:"200px"},{key:"filter",label:"Filter",width:"200px"},{key:"channel",label:"Channel",width:"100px"}];function sr(e){const t=[];return e.branch&&t.push(`branch:${e.branch}`),e.documentId.length>0&&t.push(`${e.documentId.length} doc(s)`),e.scope.length>0&&t.push(`${e.scope.length} scope(s)`),t.length>0?t.join(", "):"-"}function Sv(e,t){return t?[...e].sort((n,s)=>{let r,o;switch(t.column){case"id":r=n.id,o=s.id;break;case"name":r=n.name,o=s.name;break;case"collectionId":r=n.collectionId,o=s.collectionId;break;case"filter":r=sr(n.filter),o=sr(s.filter);break;default:return 0}const a=r.localeCompare(o);return t.direction==="asc"?a:-a}):e}function jv({getRemotes:e}){const[t,n]=b.useState([]),[s,r]=b.useState(!0),[o,a]=b.useState(),[c,l]=b.useState(),u=b.useCallback(async()=>{r(!0);const g=await e();n(g),r(!1)},[e]);b.useEffect(()=>{u()},[u]);const d=b.useCallback(async()=>{if(await u(),c){const g=t.find(y=>y.id===c.id);l(g)}},[u,c,t]),p=g=>{if(g==="channel")return;const y=o?.column===g&&o.direction==="asc"?"desc":"asc";a({column:g,direction:y})},f=g=>{l(g)},h=()=>{l(void 0)};if(c)return i.jsx(Cv,{channel:c.channel,onBack:h,onRefresh:()=>void d(),remoteName:c.name});const m=Sv(t,o);return i.jsxs("div",{className:"flex h-full flex-col gap-2",children:[i.jsxs("div",{className:"flex shrink-0 items-center justify-between",children:[i.jsx("h2",{className:"text-lg font-semibold text-gray-900",children:"Remotes Inspector"}),i.jsxs("button",{className:"flex items-center gap-1 rounded border border-gray-300 bg-white px-3 py-1.5 text-sm text-gray-700 hover:bg-gray-100 disabled:opacity-50",disabled:s,onClick:()=>void d(),type:"button",children:[i.jsx(I,{name:"Reload",size:14}),"Refresh"]})]}),i.jsx("div",{className:"max-h-full overflow-auto rounded-lg border border-gray-300",children:i.jsxs("table",{className:"w-full border-collapse",children:[i.jsx("thead",{className:"sticky top-0 bg-gray-100",children:i.jsx("tr",{children:Jr.map((g,y)=>{const x=o?.column===g.key,v=x?o.direction:"asc",S=g.key!=="channel";return i.jsx("th",{className:k("group px-3 py-2 text-left text-xs font-medium text-gray-600",y>0&&"border-l border-gray-300",S&&"cursor-pointer hover:bg-gray-200 hover:text-gray-900"),onClick:()=>S&&p(g.key),style:{width:g.width},children:i.jsxs("div",{className:"flex items-center gap-1",children:[i.jsx("span",{className:"truncate",children:g.label}),S&&i.jsx(Zl,{active:x,direction:v})]})},g.key)})})}),i.jsx("tbody",{children:s&&m.length===0?i.jsx("tr",{children:i.jsx("td",{className:"px-3 py-8 text-center text-sm text-gray-500",colSpan:Jr.length,children:"Loading..."})}):m.length===0?i.jsx("tr",{children:i.jsx("td",{className:"px-3 py-8 text-center text-sm text-gray-500",colSpan:Jr.length,children:"No remotes configured"})}):m.map(g=>i.jsxs("tr",{className:"odd:bg-white even:bg-gray-50 hover:bg-blue-50",children:[i.jsx("td",{className:"px-3 py-2 text-xs text-gray-900",children:i.jsx("span",{className:"block truncate",title:g.id,children:Ms(g.id)})}),i.jsx("td",{className:"border-l border-gray-300 px-3 py-2 text-xs text-gray-900",children:i.jsx("span",{className:"block truncate",title:g.name,children:g.name})}),i.jsx("td",{className:"border-l border-gray-300 px-3 py-2 text-xs text-gray-900",children:i.jsx("span",{className:"block truncate",title:g.collectionId,children:g.collectionId})}),i.jsx("td",{className:"border-l border-gray-300 px-3 py-2 text-xs text-gray-900",children:i.jsx("span",{className:"block truncate",title:sr(g.filter),children:sr(g.filter)})}),i.jsx("td",{className:"border-l border-gray-300 px-3 py-2",children:i.jsxs("button",{className:"flex items-center gap-1 rounded bg-blue-50 px-2 py-1 text-xs text-blue-700 hover:bg-blue-100",onClick:()=>f(g),type:"button",children:["View",i.jsx(I,{name:"CaretRight",size:12})]})})]},g.id))})]})}),i.jsxs("div",{className:"shrink-0 text-sm text-gray-600",children:["Showing ",m.length," remote(s)"]})]})}function C6({open:e,onOpenChange:t,modalProps:n,containerProps:s,dbExplorerProps:r,remotesInspectorProps:o,queueInspectorProps:a,defaultTab:c="Database"}){return i.jsx(Fe,{...n,contentProps:{className:"rounded-2xl",style:{height:"90vh",width:"90vw",maxWidth:"1400px"}},onOpenChange:t,open:e,children:i.jsxs("div",{...s,className:k("flex h-full w-full flex-col",s?.className),children:[i.jsx("div",{className:"flex shrink-0 items-center justify-end px-3 pt-3",children:i.jsx("button",{className:"flex size-6 cursor-pointer items-center justify-center rounded-md text-gray-500 outline-none hover:text-gray-900",onClick:()=>t(!1),type:"button",children:i.jsx(I,{name:"XmarkLight",size:24})})}),i.jsx("div",{className:"flex min-h-0 flex-1 flex-col overflow-hidden px-3 pb-3",children:i.jsxs(Tc,{defaultValue:c,children:[i.jsx(At,{description:"Database explorer",label:"Database",children:i.jsx("div",{className:"h-full",children:i.jsx(rg,{...r})})}),i.jsx(At,{description:"Remotes inspector",label:"Remotes",children:i.jsx("div",{className:"h-full",children:i.jsx(jv,{...o})})}),a&&i.jsx(At,{description:"Queue inspector",label:"Queue",children:i.jsx("div",{className:"h-full",children:i.jsx(gv,{...a})})})]})})]})})}const Nv="min-h-[48px] min-w-[142px] text-base font-semibold py-3 px-6 rounded-xl outline-none active:opacity-75 hover:scale-105 transform transition-all";function S6(e){const{body:t,header:n,children:s,onOpenChange:r,onContinue:o,closeLabel:a,overlayProps:c,contentProps:l,bodyProps:u={},headerProps:d={},containerProps:p={},continueButtonProps:f={},buttonContainerProps:h={},...m}=e,[g,y]=b.useState(!0),x=b.useRef(null);return b.useEffect(()=>{const v=()=>{const N=x.current;N&&(N.scrollHeight>N.clientHeight?(y(!0),N.addEventListener("scroll",S)):y(!1))},S=()=>{const N=x.current;N&&N.scrollHeight-Math.ceil(N.scrollTop)===N.clientHeight&&y(!1)};return requestAnimationFrame(v),()=>{const N=x.current;N&&N.removeEventListener("scroll",S)}},[]),i.jsx(Fe,{contentProps:{...l,className:k("rounded-3xl outline-none",l?.className)},onOpenChange:r,overlayProps:{...c,className:c?.className},...m,children:i.jsxs("div",{...ce(p,"w-[500px] p-6 text-slate-300"),children:[i.jsx("div",{...ce(d,"border-b border-slate-50 pb-2 text-2xl font-bold text-gray-800"),children:n}),i.jsxs("div",{ref:x,...ce(u,"my-6 max-h-[245px] overflow-scroll rounded-md bg-slate-50 p-4 text-center"),children:[t,s]}),i.jsx("div",{...ce(h,"mt-8 flex justify-between gap-3"),children:i.jsx("button",{disabled:g,onClick:o,...ce(f,k(Nv,"flex-1 bg-gray-800 text-gray-50",g&&"cursor-not-allowed bg-gray-300 hover:scale-100")),children:a})})]})})}const Pv=[/^@powerhousedao\/.+$/,"document-drive","document-model"],Ev=ed({version:jt({message:"Missing version field in package.json"}),dependencies:No(jt(),jt()).nullable(),devDependencies:No(jt(),jt()).nullable()}).refine(e=>e.dependencies!=null||e.devDependencies!=null,"package.json must have either dependencies or devDependencies").transform(e=>{const t={...e.dependencies,...e.devDependencies};return{version:e.version,dependencies:Object.fromEntries(Object.entries(t).filter(([n])=>Pv.some(s=>typeof s=="string"?s===n:s.test(n))))}});function Iv(e){const t=Ev.safeParse(e);return t.success?t.data:(console.error("Package.json validation failed:",t.error.format()),!1)}function Ov(e){const[t,n]=b.useState(!1),{packageJson:s,phCliVersion:r}=e,o=Iv(s);return o?i.jsx(Kn,{isOpen:t,onOpenChange:()=>n(!t),title:`App version: ${o.version}`,toggleClassName:"text-gray-900 text-sm",children:i.jsxs("ul",{className:"text-sm text-gray-600",children:[Object.entries(o.dependencies).map(([a,c])=>i.jsxs("li",{className:"my-1 flex justify-between pr-1",children:[i.jsxs("span",{children:[a.replace("@powerhousedao/",""),":"]}),i.jsx("span",{className:"font-normal",children:c})]},a)),r&&i.jsxs("li",{className:"my-1 flex justify-between pr-1",children:[i.jsx("span",{children:"@powerhousedao/ph-cli:"}),i.jsx("span",{className:"font-normal",children:r})]},"ph-cli")]})}):(console.error("Failed to validate package.json data"),null)}function j6(e){const{packageJson:t,phCliVersion:n}=e;return i.jsxs("div",{className:"bg-white p-3",children:[i.jsx("h2",{className:"font-semibold",children:"About"}),i.jsx("p",{className:"text-sm font-normal text-gray-600",children:"Connect is the hub for your most important documents and processes translated into software. Easily capture data in a structured way with Connect."}),i.jsx("div",{className:"my-4",children:i.jsx(Ov,{packageJson:t,phCliVersion:n})})]})}function N6(e){const{className:t,...n}=e;return i.jsxs("div",{className:pi("h-full rounded-lg bg-white p-3",t),children:[i.jsx("h2",{className:"mb-4 font-semibold",children:"Modify Drives"}),i.jsx(kv,{...n}),i.jsx("h2",{className:"my-4 font-semibold",children:"Local Storage"}),i.jsx(Av,{...n})]})}function kv(e){const{className:t,...n}=e;return i.jsx("div",{className:t,children:i.jsx(Mv,{...n})})}function Mv(e){const{className:t,...n}=e;return i.jsx("div",{className:t,children:e.drives.map(s=>i.jsx(Tv,{drive:s,...n},s.header.id))})}function Tv(e){const{drive:t,className:n,onDeleteDrive:s}=e,[r,o]=b.useState(!1),a=i.jsx(I,{name:"Hdd",size:16,className:"flex-none"}),c=i.jsx(I,{name:"Server",size:16,className:"flex-none"}),l=t.state.global.icon?i.jsx("img",{alt:"drive icon",className:"size-4 flex-none object-contain",src:t.state.global.icon}):i.jsx(I,{name:"M",size:16,className:"flex-none"});function u(){const p=Xr(t);return p==="PUBLIC"?l:p==="CLOUD"?c:a}const d=u();return i.jsxs("div",{className:pi("mb-4 flex w-96 items-center gap-2 rounded-md border border-gray-200 bg-gray-50 px-3 py-2 shadow-sm last-of-type:mb-0",n),children:[d,i.jsxs("div",{children:[i.jsx("span",{className:"block text-sm font-medium leading-[18px]",children:jo(t.header.name)}),i.jsxs("div",{className:"flex items-baseline gap-x-2 leading-[18px]",children:[i.jsxs("span",{className:"text-sm text-gray-600",children:[jo(Xr(t))," App"]}),i.jsxs("a",{className:"group flex items-center gap-x-2 text-sm text-slate-500 transition-colors hover:text-[#9896FF]",children:["By Powerhouse",i.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 12 12",className:"size-4 text-gray-400 transition-colors group-hover:text-inherit",children:i.jsx("path",{d:"M7.99365 11.9939C9.46632 11.9939 10.6603 10.7999 10.6603 9.32722V7.32722C10.6603 6.95922 10.3617 6.66056 9.99365 6.66056C9.62565 6.66056 9.32699 6.95922 9.32699 7.32722V9.32722C9.32699 10.0639 8.73032 10.6606 7.99365 10.6606H2.66032C1.92365 10.6606 1.32699 10.0639 1.32699 9.32722V3.99389C1.32699 3.25723 1.92365 2.66056 2.66032 2.66056H4.66032C5.02832 2.66056 5.32699 2.36189 5.32699 1.99389C5.32699 1.6259 5.02832 1.32723 4.66032 1.32723H2.66032C1.18765 1.32723 -0.00634766 2.52123 -0.00634766 3.99389V9.32722C-0.00634766 10.7999 1.18765 11.9939 2.66032 11.9939H7.99365ZM5.32699 7.32722C5.49765 7.32722 5.67565 7.26989 5.80632 7.13989L10.1396 2.80656L11.9937 4.66056V-0.00610352H7.32699L9.18099 1.8479L4.84766 6.18123C4.58766 6.4419 4.58766 6.87922 4.84766 7.13989C4.97832 7.26989 5.15632 7.32722 5.32699 7.32722Z",fill:"currentColor"})})]})]})]}),i.jsx(yr,{items:[{id:"delete-drive",label:"Delete",icon:i.jsx(I,{name:"Trash"}),className:"text-red-900"}],onItemClick:p=>{p==="delete-drive"&&s(t)},onOpenChange:o,open:r,children:i.jsx("button",{className:"group ml-auto flex-none",onClick:p=>{p.stopPropagation(),o(!0)},children:i.jsx(I,{className:"text-gray-600 group-hover:text-gray-900",name:"VerticalDots",size:16})})})]})}function Av(e){const{onClearStorage:t}=e;return i.jsx("div",{children:i.jsxs("button",{className:"flex items-center gap-x-2 rounded-md border border-gray-300 bg-transparent px-3 py-1 text-sm font-medium text-red-900 transition-colors hover:bg-gray-100",onClick:t,children:["Clear Storage ",i.jsx(I,{name:"Trash",size:16})]})})}function P6(e){const{className:t,...n}=e;return i.jsx("div",{className:k("rounded-lg p-3",t),children:i.jsx(Dv,{...n})})}function Dv(e){const{documentModelEditor:t,setDocumentModelEditor:n,documentModelEditorOptions:s,className:r}=e;return i.jsxs("div",{children:[i.jsx("h3",{className:"mb-4 font-semibold text-gray-900",children:"Default Editor Selection"}),i.jsx(mi,{className:k("min-w-36 max-w-fit",r),name:"default-editor",required:!0,value:t,options:s,multiple:!1,onChange:o=>n(o)})]})}const Rv={npm:{icon:"Npm"},github:{icon:"Github",size:28},local:{icon:"Hdd"}},Lv=({packageName:e,provider:t})=>{const n=t&&Rv[t];return i.jsxs("div",{className:"flex w-full items-center justify-between px-2 py-1",children:[i.jsx("p",{className:"font-medium",children:e}),n&&i.jsx(I,{name:n.icon,size:n.size})]})},Fv=e=>{const{onInstall:t,packageOptions:n,className:s}=e,[r,o]=b.useState(""),[a,c]=b.useState(!1),[l,u]=b.useState(),d=b.useCallback(()=>{const m=t(r);m?(c(!0),m.then(()=>o("")).catch(u).finally(()=>c(!1))):(o(""),u(void 0))},[t,r]),p=b.useCallback(m=>{o(m.target.value)},[]),f=l?typeof l=="string"?l:l instanceof Error?l.message:l:" ",h=b.useMemo(()=>{const m=n?.map(g=>({...g,value:g.packageName}));return n?.length?{autoComplete:!0,initialOptions:m,fetchOptionsCallback:g=>m?.filter(y=>y.packageName.toLowerCase().includes(g.toLowerCase()))??[],renderOption:g=>i.jsx(Lv,{...g})}:{autoComplete:!1}},[n]);return i.jsxs("div",{className:s,children:[i.jsx("h3",{className:"mb-4 font-semibold text-gray-900",children:"Install Package"}),i.jsxs("div",{className:"flex items-center gap-4",children:[n?.length?i.jsx(od,{...h,onChange:o}):i.jsx(sd,{name:"package",className:"max-w-xs text-gray-700",value:r,onChange:p,onSubmit:d,disabled:a}),i.jsx(Ce,{className:"h-9 rounded-md text-sm",onClick:d,disabled:a,children:"Install"})]}),i.jsx("p",{className:"mb-3 ml-2 h-3 text-sm text-red-800",children:f})]})},Tn=({label:e,value:t})=>i.jsxs("div",{className:"flex items-start gap-2 text-sm",children:[i.jsxs("p",{className:"text-gray-600",children:[e,":"]}),i.jsx("p",{className:"text-gray-600",children:t})]}),zv=e=>{const{package:{name:t,description:n,category:s,publisher:r,publisherUrl:o,modules:a,id:c,removable:l},mutable:u,onUninstall:d,className:p}=e,[f,h]=b.useState(!1);return i.jsxs("li",{className:k("relative flex flex-col items-start rounded-md border border-gray-200 p-3 text-sm leading-5 shadow-sm",p),children:[i.jsx("h3",{className:"font-semibold text-gray-900",children:t}),i.jsx(Tn,{label:"Description",value:n}),i.jsx(Tn,{label:"Category",value:s}),i.jsx(Tn,{label:"Publisher",value:r}),i.jsx(Tn,{label:"Publisher URL",value:i.jsx("a",{className:"underline",href:o,children:o})}),i.jsx("p",{className:"text-sm text-gray-600",children:"Modules included:"}),i.jsx("ul",{className:"list-disc pl-5",children:a.map(m=>i.jsx("li",{children:i.jsx("span",{className:"text-gray-600",children:m})},m))}),u&&l&&i.jsx(yr,{items:[{id:"uninstall",label:"Uninstall",icon:i.jsx(I,{name:"Trash"}),className:"text-red-900"}],onItemClick:m=>{m==="uninstall"&&d(c)},onOpenChange:h,open:f,children:i.jsx("button",{className:"group absolute right-3 top-3",onClick:m=>{m.stopPropagation(),h(!0)},children:i.jsx(I,{className:"text-gray-600 group-hover:text-gray-900",name:"VerticalDots"})})})]})},$v=e=>{const{className:t,packages:n,onUninstall:s,mutable:r,...o}=e,[a,c]=b.useState();b.useLayoutEffect(()=>{const u=()=>{const p=window.innerHeight-516;c(Math.max(200,p))};return u(),window.addEventListener("resize",u),()=>window.removeEventListener("resize",u)},[]);const l=b.useCallback(u=>{s(u)},[s]);return i.jsxs("div",{...o,className:k("flex flex-col items-stretch overflow-hidden",t),style:{maxHeight:a},children:[i.jsx("h3",{className:"mb-4 font-semibold text-gray-900",children:"Installed Packages"}),i.jsx("div",{className:"flex-1 overflow-y-auto pr-2",children:i.jsx("ul",{className:"flex flex-col items-stretch gap-4 pr-2",children:n.map(u=>i.jsx(zv,{package:u,onUninstall:l,mutable:r},u.id))})})]})},Vv=e=>{const{reactorOptions:t,reactor:n,onReactorChange:s,...r}=e,o=b.useCallback(a=>{s(Array.isArray(a)?a.at(-1):a)},[s]);return i.jsxs("div",{...r,children:[i.jsx("h3",{className:"mb-4 font-semibold text-gray-900",children:"Select Reactor"}),i.jsx(mi,{className:"min-w-36 max-w-fit",name:"reactor",required:!0,value:n,options:t,multiple:!1,onChange:o})]})},E6=e=>{const{className:t,reactorOptions:n,reactor:s,onReactorChange:r,onInstall:o,packages:a,onUninstall:c,mutable:l,packageOptions:u,...d}=e,p=b.useMemo(()=>u?.filter(f=>!a.find(h=>h.name===f.packageName)),[a,u]);return i.jsxs("div",{...d,className:k("flex h-full flex-1 flex-col rounded-lg p-3",t),children:[i.jsx(Vv,{reactor:s,reactorOptions:n,onReactorChange:r,className:"mb-4"}),l&&i.jsx(Fv,{onInstall:o,packageOptions:p}),i.jsx($v,{packages:a,onUninstall:c,mutable:l})]})};function I6(e){const{title:t,overlayProps:n,contentProps:s,onOpenChange:r,tabs:o,defaultTab:a,...c}=e,[l,u]=b.useState(a??o.at(0)?.id),d=o.map(h=>i.jsx("button",{type:"button",onClick:()=>u(h.id),children:i.jsxs("div",{className:k("flex h-9 w-48 cursor-pointer items-center gap-x-2 rounded-md pl-3 hover:bg-slate-50",l===h.id?"bg-slate-50":"bg-transparent"),children:[h.icon,i.jsx("span",{children:h.label})]})},h.id)),f=o.find(h=>h.id===l)?.content;return i.jsxs(Fe,{contentProps:{...s,className:k("min-h-full w-full max-w-4xl rounded-xl",s?.className),style:{...s?.style,boxShadow:"0px 0px 16px 4px rgba(0, 0, 0, 0.04), 0px 33px 32px -16px rgba(0, 0, 0, 0.10)"}},onOpenChange:r,overlayProps:{...n,className:k("py-28",n?.className)},...c,children:[i.jsxs("div",{className:"flex justify-between border-b border-slate-50 p-4",children:[i.jsx("h1",{className:"text-center text-xl font-semibold",children:t}),i.jsx("button",{type:"button",className:"flex size-6 items-center justify-center rounded-md outline-none",onClick:()=>r?.(!1),children:i.jsx(I,{name:"XmarkLight",size:24})})]}),i.jsxs("div",{className:"flex flex-1",children:[i.jsx("div",{className:"flex flex-col gap-y-1 p-3 pt-6",children:d}),i.jsx("div",{className:"m-6 flex h-full flex-1 flex-col overflow-hidden rounded-lg border border-slate-50",children:typeof f=="function"?i.jsx(f,{}):f})]})]})}const Ya="min-h-[48px] min-w-[142px] text-base font-semibold py-3 px-6 rounded-xl outline-none active:opacity-75 hover:scale-105 transform transition-all";function O6(e){const{body:t,header:n,onOpenChange:s,onContinue:r,cancelLabel:o,continueLabel:a,overlayProps:c,contentProps:l,...u}=e;return i.jsx(Fe,{contentProps:{...l,className:k("rounded-3xl",l?.className)},onOpenChange:s,overlayProps:{...c,className:c?.className},...u,children:i.jsxs("div",{className:"w-[400px] p-6 text-slate-300",children:[i.jsx("div",{className:"border-b border-slate-50 pb-2 text-2xl font-bold text-gray-800",children:n}),i.jsx("div",{className:"my-6 rounded-md bg-slate-50 p-4 text-center",children:t}),i.jsxs("div",{className:"mt-8 flex justify-between gap-3",children:[i.jsx("button",{className:k(Ya,"flex-1 bg-slate-50 text-slate-800"),onClick:()=>s?.(!1),children:o}),i.jsx("button",{className:k(Ya,"flex-1 bg-gray-800 text-gray-50"),onClick:r,children:a})]})]})})}function Bv(e){const{branch:t="main"}=e;return i.jsxs("button",{className:"flex h-8 w-fit items-center gap-1 rounded-lg bg-slate-50 pl-1 pr-2 text-xs text-stone-300",children:[i.jsx(I,{name:"Branch"}),i.jsx("span",{children:"BRANCH"}),i.jsx("span",{className:"text-gray-900",children:t})]})}function Uv(e){const{docId:t,onCopy:n}=e,[,s]=ur();function r(o){return()=>{s(o).then(()=>{n?.()}).catch(a=>{console.error("Failed to copy!",a)})}}return i.jsxs("button",{className:"flex h-8 w-fit items-center gap-1 rounded-lg bg-slate-50 pl-1 pr-2 text-xs text-stone-300",onClick:r(t),children:[i.jsx(I,{name:"Link"}),"DOC ID",i.jsx("span",{className:"text-gray-900",children:t})]})}const Hv=e=>{const{documentState:t,onCopyState:n}=e,[,s]=ur();function r(){const o=JSON.stringify(t,null,2);s(o).then(()=>{n?.()}).catch(a=>{console.error("Failed to copy document state!",a)})}return i.jsx("button",{className:"rounded-lg bg-slate-50 p-1 text-stone-300",onClick:r,children:i.jsx(I,{name:"CurlyBrackets"})})};function _v(e){const{value:t,onChange:n}=e,s=[{displayValue:"Global scope",value:"global"},{displayValue:"Local scope",value:"local"}];return i.jsx(ft,{absolutePositionMenu:!0,containerClassName:"bg-slate-50 text-gray-500 rounded-lg w-fit text-xs z-10",id:"scope select",itemClassName:"py-2 text-gray-500 grid grid-cols-[auto,auto] gap-1",items:s,menuClassName:"min-w-0 text-gray-500",onChange:n,value:t})}function Wv(e){const{title:t,docId:n,scope:s,onChangeScope:r,onClose:o,className:a,documentState:c,onCopyState:l,onCopyDocId:u,...d}=e;return i.jsxs("header",{className:k("flex items-center justify-between bg-transparent",a),...d,children:[i.jsxs("div",{className:"flex items-center gap-3",children:[i.jsx("button",{name:"close-revision-history",className:"shadow-button rounded-lg bg-gray-50 p-1 text-stone-300",onClick:o,children:i.jsx(I,{name:"VariantArrowLeft"})}),i.jsx("h1",{className:"text-xs",children:t})]}),i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx(Uv,{docId:n,onCopy:u}),c&&i.jsx(Hv,{documentState:c,onCopyState:l}),i.jsx(Bv,{}),i.jsx(_v,{onChange:r,value:s})]})]})}function ct(e,t,n){let s=n.initialDeps??[],r;function o(){var a,c,l,u;let d;n.key&&((a=n.debug)!=null&&a.call(n))&&(d=Date.now());const p=e();if(!(p.length!==s.length||p.some((m,g)=>s[g]!==m)))return r;s=p;let h;if(n.key&&((c=n.debug)!=null&&c.call(n))&&(h=Date.now()),r=t(...p),n.key&&((l=n.debug)!=null&&l.call(n))){const m=Math.round((Date.now()-d)*100)/100,g=Math.round((Date.now()-h)*100)/100,y=g/16,x=(v,S)=>{for(v=String(v);v.length<S;)v=" "+v;return v};console.info(`%c⏱ ${x(g,5)} /${x(m,5)} ms`,`
45
- font-size: .6rem;
46
- font-weight: bold;
47
- color: hsl(${Math.max(0,Math.min(120-120*y,120))}deg 100% 31%);`,n?.key)}return(u=n?.onChange)==null||u.call(n,r),r}return o.updateDeps=a=>{s=a},o}function qa(e,t){if(e===void 0)throw new Error("Unexpected undefined");return e}const Gv=(e,t)=>Math.abs(e-t)<1.01,Yv=(e,t,n)=>{let s;return function(...r){e.clearTimeout(s),s=e.setTimeout(()=>t.apply(this,r),n)}},Ja=e=>{const{offsetWidth:t,offsetHeight:n}=e;return{width:t,height:n}},qv=e=>e,Jv=e=>{const t=Math.max(e.startIndex-e.overscan,0),n=Math.min(e.endIndex+e.overscan,e.count-1),s=[];for(let r=t;r<=n;r++)s.push(r);return s},Qv=(e,t)=>{const n=e.scrollElement;if(!n)return;const s=e.targetWindow;if(!s)return;const r=a=>{const{width:c,height:l}=a;t({width:Math.round(c),height:Math.round(l)})};if(r(Ja(n)),!s.ResizeObserver)return()=>{};const o=new s.ResizeObserver(a=>{const c=()=>{const l=a[0];if(l?.borderBoxSize){const u=l.borderBoxSize[0];if(u){r({width:u.inlineSize,height:u.blockSize});return}}r(Ja(n))};e.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(c):c()});return o.observe(n,{box:"border-box"}),()=>{o.unobserve(n)}},Qa={passive:!0},Xa=typeof window>"u"?!0:"onscrollend"in window,Xv=(e,t)=>{const n=e.scrollElement;if(!n)return;const s=e.targetWindow;if(!s)return;let r=0;const o=e.options.useScrollendEvent&&Xa?()=>{}:Yv(s,()=>{t(r,!1)},e.options.isScrollingResetDelay),a=d=>()=>{const{horizontal:p,isRtl:f}=e.options;r=p?n.scrollLeft*(f&&-1||1):n.scrollTop,o(),t(r,d)},c=a(!0),l=a(!1);l(),n.addEventListener("scroll",c,Qa);const u=e.options.useScrollendEvent&&Xa;return u&&n.addEventListener("scrollend",l,Qa),()=>{n.removeEventListener("scroll",c),u&&n.removeEventListener("scrollend",l)}},Kv=(e,t,n)=>{if(t?.borderBoxSize){const s=t.borderBoxSize[0];if(s)return Math.round(s[n.options.horizontal?"inlineSize":"blockSize"])}return e[n.options.horizontal?"offsetWidth":"offsetHeight"]},Zv=(e,{adjustments:t=0,behavior:n},s)=>{var r,o;const a=e+t;(o=(r=s.scrollElement)==null?void 0:r.scrollTo)==null||o.call(r,{[s.options.horizontal?"left":"top"]:a,behavior:n})};class e5{constructor(t){this.unsubs=[],this.scrollElement=null,this.targetWindow=null,this.isScrolling=!1,this.measurementsCache=[],this.itemSizeCache=new Map,this.pendingMeasuredCacheIndexes=[],this.scrollRect=null,this.scrollOffset=null,this.scrollDirection=null,this.scrollAdjustments=0,this.elementsCache=new Map,this.observer=(()=>{let n=null;const s=()=>n||(!this.targetWindow||!this.targetWindow.ResizeObserver?null:n=new this.targetWindow.ResizeObserver(r=>{r.forEach(o=>{const a=()=>{this._measureElement(o.target,o)};this.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(a):a()})}));return{disconnect:()=>{var r;(r=s())==null||r.disconnect(),n=null},observe:r=>{var o;return(o=s())==null?void 0:o.observe(r,{box:"border-box"})},unobserve:r=>{var o;return(o=s())==null?void 0:o.unobserve(r)}}})(),this.range=null,this.setOptions=n=>{Object.entries(n).forEach(([s,r])=>{typeof r>"u"&&delete n[s]}),this.options={debug:!1,initialOffset:0,overscan:1,paddingStart:0,paddingEnd:0,scrollPaddingStart:0,scrollPaddingEnd:0,horizontal:!1,getItemKey:qv,rangeExtractor:Jv,onChange:()=>{},measureElement:Kv,initialRect:{width:0,height:0},scrollMargin:0,gap:0,indexAttribute:"data-index",initialMeasurementsCache:[],lanes:1,isScrollingResetDelay:150,enabled:!0,isRtl:!1,useScrollendEvent:!1,useAnimationFrameWithResizeObserver:!1,...n}},this.notify=n=>{var s,r;(r=(s=this.options).onChange)==null||r.call(s,this,n)},this.maybeNotify=ct(()=>(this.calculateRange(),[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]),n=>{this.notify(n)},{key:!1,debug:()=>this.options.debug,initialDeps:[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]}),this.cleanup=()=>{this.unsubs.filter(Boolean).forEach(n=>n()),this.unsubs=[],this.observer.disconnect(),this.scrollElement=null,this.targetWindow=null},this._didMount=()=>()=>{this.cleanup()},this._willUpdate=()=>{var n;const s=this.options.enabled?this.options.getScrollElement():null;if(this.scrollElement!==s){if(this.cleanup(),!s){this.maybeNotify();return}this.scrollElement=s,this.scrollElement&&"ownerDocument"in this.scrollElement?this.targetWindow=this.scrollElement.ownerDocument.defaultView:this.targetWindow=((n=this.scrollElement)==null?void 0:n.window)??null,this.elementsCache.forEach(r=>{this.observer.observe(r)}),this._scrollToOffset(this.getScrollOffset(),{adjustments:void 0,behavior:void 0}),this.unsubs.push(this.options.observeElementRect(this,r=>{this.scrollRect=r,this.maybeNotify()})),this.unsubs.push(this.options.observeElementOffset(this,(r,o)=>{this.scrollAdjustments=0,this.scrollDirection=o?this.getScrollOffset()<r?"forward":"backward":null,this.scrollOffset=r,this.isScrolling=o,this.maybeNotify()}))}},this.getSize=()=>this.options.enabled?(this.scrollRect=this.scrollRect??this.options.initialRect,this.scrollRect[this.options.horizontal?"width":"height"]):(this.scrollRect=null,0),this.getScrollOffset=()=>this.options.enabled?(this.scrollOffset=this.scrollOffset??(typeof this.options.initialOffset=="function"?this.options.initialOffset():this.options.initialOffset),this.scrollOffset):(this.scrollOffset=null,0),this.getFurthestMeasurement=(n,s)=>{const r=new Map,o=new Map;for(let a=s-1;a>=0;a--){const c=n[a];if(r.has(c.lane))continue;const l=o.get(c.lane);if(l==null||c.end>l.end?o.set(c.lane,c):c.end<l.end&&r.set(c.lane,!0),r.size===this.options.lanes)break}return o.size===this.options.lanes?Array.from(o.values()).sort((a,c)=>a.end===c.end?a.index-c.index:a.end-c.end)[0]:void 0},this.getMeasurementOptions=ct(()=>[this.options.count,this.options.paddingStart,this.options.scrollMargin,this.options.getItemKey,this.options.enabled],(n,s,r,o,a)=>(this.pendingMeasuredCacheIndexes=[],{count:n,paddingStart:s,scrollMargin:r,getItemKey:o,enabled:a}),{key:!1}),this.getMeasurements=ct(()=>[this.getMeasurementOptions(),this.itemSizeCache],({count:n,paddingStart:s,scrollMargin:r,getItemKey:o,enabled:a},c)=>{if(!a)return this.measurementsCache=[],this.itemSizeCache.clear(),[];this.measurementsCache.length===0&&(this.measurementsCache=this.options.initialMeasurementsCache,this.measurementsCache.forEach(d=>{this.itemSizeCache.set(d.key,d.size)}));const l=this.pendingMeasuredCacheIndexes.length>0?Math.min(...this.pendingMeasuredCacheIndexes):0;this.pendingMeasuredCacheIndexes=[];const u=this.measurementsCache.slice(0,l);for(let d=l;d<n;d++){const p=o(d),f=this.options.lanes===1?u[d-1]:this.getFurthestMeasurement(u,d),h=f?f.end+this.options.gap:s+r,m=c.get(p),g=typeof m=="number"?m:this.options.estimateSize(d),y=h+g,x=f?f.lane:d%this.options.lanes;u[d]={index:d,start:h,size:g,end:y,key:p,lane:x}}return this.measurementsCache=u,u},{key:!1,debug:()=>this.options.debug}),this.calculateRange=ct(()=>[this.getMeasurements(),this.getSize(),this.getScrollOffset(),this.options.lanes],(n,s,r,o)=>this.range=n.length>0&&s>0?t5({measurements:n,outerSize:s,scrollOffset:r,lanes:o}):null,{key:!1,debug:()=>this.options.debug}),this.getVirtualIndexes=ct(()=>{let n=null,s=null;const r=this.calculateRange();return r&&(n=r.startIndex,s=r.endIndex),this.maybeNotify.updateDeps([this.isScrolling,n,s]),[this.options.rangeExtractor,this.options.overscan,this.options.count,n,s]},(n,s,r,o,a)=>o===null||a===null?[]:n({startIndex:o,endIndex:a,overscan:s,count:r}),{key:!1,debug:()=>this.options.debug}),this.indexFromElement=n=>{const s=this.options.indexAttribute,r=n.getAttribute(s);return r?parseInt(r,10):(console.warn(`Missing attribute name '${s}={index}' on measured element.`),-1)},this._measureElement=(n,s)=>{const r=this.indexFromElement(n),o=this.measurementsCache[r];if(!o)return;const a=o.key,c=this.elementsCache.get(a);c!==n&&(c&&this.observer.unobserve(c),this.observer.observe(n),this.elementsCache.set(a,n)),n.isConnected&&this.resizeItem(r,this.options.measureElement(n,s,this))},this.resizeItem=(n,s)=>{const r=this.measurementsCache[n];if(!r)return;const o=this.itemSizeCache.get(r.key)??r.size,a=s-o;a!==0&&((this.shouldAdjustScrollPositionOnItemSizeChange!==void 0?this.shouldAdjustScrollPositionOnItemSizeChange(r,a,this):r.start<this.getScrollOffset()+this.scrollAdjustments)&&this._scrollToOffset(this.getScrollOffset(),{adjustments:this.scrollAdjustments+=a,behavior:void 0}),this.pendingMeasuredCacheIndexes.push(r.index),this.itemSizeCache=new Map(this.itemSizeCache.set(r.key,s)),this.notify(!1))},this.measureElement=n=>{if(!n){this.elementsCache.forEach((s,r)=>{s.isConnected||(this.observer.unobserve(s),this.elementsCache.delete(r))});return}this._measureElement(n,void 0)},this.getVirtualItems=ct(()=>[this.getVirtualIndexes(),this.getMeasurements()],(n,s)=>{const r=[];for(let o=0,a=n.length;o<a;o++){const c=n[o],l=s[c];r.push(l)}return r},{key:!1,debug:()=>this.options.debug}),this.getVirtualItemForOffset=n=>{const s=this.getMeasurements();if(s.length!==0)return qa(s[eu(0,s.length-1,r=>qa(s[r]).start,n)])},this.getOffsetForAlignment=(n,s,r=0)=>{const o=this.getSize(),a=this.getScrollOffset();s==="auto"&&(s=n>=a+o?"end":"start"),s==="center"?n+=(r-o)/2:s==="end"&&(n-=o);const c=this.getTotalSize()+this.options.scrollMargin-o;return Math.max(Math.min(c,n),0)},this.getOffsetForIndex=(n,s="auto")=>{n=Math.max(0,Math.min(n,this.options.count-1));const r=this.measurementsCache[n];if(!r)return;const o=this.getSize(),a=this.getScrollOffset();if(s==="auto")if(r.end>=a+o-this.options.scrollPaddingEnd)s="end";else if(r.start<=a+this.options.scrollPaddingStart)s="start";else return[a,s];const c=s==="end"?r.end+this.options.scrollPaddingEnd:r.start-this.options.scrollPaddingStart;return[this.getOffsetForAlignment(c,s,r.size),s]},this.isDynamicMode=()=>this.elementsCache.size>0,this.scrollToOffset=(n,{align:s="start",behavior:r}={})=>{r==="smooth"&&this.isDynamicMode()&&console.warn("The `smooth` scroll behavior is not fully supported with dynamic size."),this._scrollToOffset(this.getOffsetForAlignment(n,s),{adjustments:void 0,behavior:r})},this.scrollToIndex=(n,{align:s="auto",behavior:r}={})=>{r==="smooth"&&this.isDynamicMode()&&console.warn("The `smooth` scroll behavior is not fully supported with dynamic size."),n=Math.max(0,Math.min(n,this.options.count-1));let o=0;const a=10,c=u=>{if(!this.targetWindow)return;const d=this.getOffsetForIndex(n,u);if(!d){console.warn("Failed to get offset for index:",n);return}const[p,f]=d;this._scrollToOffset(p,{adjustments:void 0,behavior:r}),this.targetWindow.requestAnimationFrame(()=>{const h=this.getScrollOffset(),m=this.getOffsetForIndex(n,f);if(!m){console.warn("Failed to get offset for index:",n);return}Gv(m[0],h)||l(f)})},l=u=>{this.targetWindow&&(o++,o<a?this.targetWindow.requestAnimationFrame(()=>c(u)):console.warn(`Failed to scroll to index ${n} after ${a} attempts.`))};c(s)},this.scrollBy=(n,{behavior:s}={})=>{s==="smooth"&&this.isDynamicMode()&&console.warn("The `smooth` scroll behavior is not fully supported with dynamic size."),this._scrollToOffset(this.getScrollOffset()+n,{adjustments:void 0,behavior:s})},this.getTotalSize=()=>{var n;const s=this.getMeasurements();let r;if(s.length===0)r=this.options.paddingStart;else if(this.options.lanes===1)r=((n=s[s.length-1])==null?void 0:n.end)??0;else{const o=Array(this.options.lanes).fill(null);let a=s.length-1;for(;a>=0&&o.some(c=>c===null);){const c=s[a];o[c.lane]===null&&(o[c.lane]=c.end),a--}r=Math.max(...o.filter(c=>c!==null))}return Math.max(r-this.options.scrollMargin+this.options.paddingEnd,0)},this._scrollToOffset=(n,{adjustments:s,behavior:r})=>{this.options.scrollToFn(n,{behavior:r,adjustments:s},this)},this.measure=()=>{this.itemSizeCache=new Map,this.notify(!1)},this.setOptions(t)}}const eu=(e,t,n,s)=>{for(;e<=t;){const r=(e+t)/2|0,o=n(r);if(o<s)e=r+1;else if(o>s)t=r-1;else return r}return e>0?e-1:0};function t5({measurements:e,outerSize:t,scrollOffset:n,lanes:s}){const r=e.length-1,o=l=>e[l].start;if(e.length<=s)return{startIndex:0,endIndex:r};let a=eu(0,r,o,n),c=a;if(s===1)for(;c<r&&e[c].end<n+t;)c++;else if(s>1){const l=Array(s).fill(0);for(;c<r&&l.some(d=>d<n+t);){const d=e[c];l[d.lane]=d.end,c++}const u=Array(s).fill(n+t);for(;a>=0&&u.some(d=>d>=n);){const d=e[a];u[d.lane]=d.start,a--}a=Math.max(0,a-a%s),c=Math.min(r,c+(s-1-c%s))}return{startIndex:a,endIndex:c}}const Ka=typeof document<"u"?b.useLayoutEffect:b.useEffect;function n5(e){const t=b.useReducer(()=>({}),{})[1],n={...e,onChange:(r,o)=>{var a;o?ri.flushSync(t):t(),(a=e.onChange)==null||a.call(e,r,o)}},[s]=b.useState(()=>new e5(n));return s.setOptions(n),Ka(()=>s._didMount(),[]),Ka(()=>s._willUpdate()),s}function r5(e){return n5({observeElementRect:Qv,observeElementOffset:Xv,scrollToFn:Zv,...e})}function s5(e){return`${e.slice(0,7)}...${e.slice(-5)}`}function o5(e){const{address:t,chainId:n}=e,[,s]=ur();if(!t)return null;const r=s5(t);function o(c){return()=>{s(c).catch(l=>{console.error("Failed to copy!",l)})}}const a=i.jsxs("button",{className:"flex items-center gap-1",onClick:o(t),children:[t,i.jsx(I,{className:"inline-block text-gray-600",name:"FilesEarmark",size:16})]});return i.jsx($e,{content:a,children:i.jsxs("span",{className:"flex w-fit cursor-pointer items-center gap-1 rounded-lg bg-gray-100 p-1 text-xs text-slate-100",children:[i.jsx(_l,{address:t,chainId:n}),r]})})}function a5(e){const{errors:t}=e,n=!!t?.length,s=n?"text-red-800":"text-green-700",r=n?i.jsx(I,{name:"Exclamation",size:16}):i.jsx(I,{name:"Check",size:16}),o=n?`Error: ${t[0]}`:"No errors",a=i.jsxs("span",{className:k("flex w-fit items-center rounded-lg border border-gray-200 px-2 py-1 text-xs",s,n&&"cursor-pointer"),children:[r,i.jsx("span",{className:k("inline-block max-w-36 truncate"),children:o})]}),c=t?.map((l,u)=>i.jsxs("p",{className:"text-red-800",children:["Error: ",l]},u));return n?i.jsx($e,{content:c,children:a}):a}function i5(e){const{operationType:t,operationInput:n}=e,s=i.jsx("code",{children:i.jsx("pre",{children:JSON.stringify(n,null,2)})});return i.jsx($e,{content:s,children:i.jsxs("span",{className:"flex cursor-pointer items-center gap-2 text-xs",children:[t,i.jsx(I,{className:"text-gray-300",name:"Braces",size:16})]})})}function c5(e){const{operationIndex:t,eventId:n,stateHash:s}=e,[,r]=ur(),o=t+1,a=i.jsxs("button",{className:"flex items-center gap-1",onClick:c(s),children:["Revision ",o," - Event ID: ",n," - State Hash: ",s,i.jsx(I,{className:"inline-block text-gray-600",name:"FilesEarmark",size:16})]});function c(l){return()=>{r(l).catch(u=>{console.error("Failed to copy!",u)})}}return i.jsx($e,{content:a,children:i.jsxs("span",{className:"flex cursor-pointer items-center gap-2 text-xs text-gray-600",children:["Revision ",o,".",i.jsx("a",{children:i.jsx(I,{className:"cursor-pointer text-slate-100",name:"Ellipsis",size:14})})]})})}function l5(e){const{signatures:t}=e;if(!t?.length)return null;const n=i.jsxs("div",{className:"text-xs text-slate-300",children:[i.jsx("h3",{className:"mb-2",children:"Signature details:"}),t.map((s,r)=>i.jsxs("div",{className:"mb-2 last:mb-0",children:[i.jsxs("h4",{children:["Signature #",r+1," -"," ",s.isVerified?"verified":"unverified"]}),i.jsx("code",{children:i.jsx("pre",{children:JSON.stringify(s,null,2)})})]},s.hash))]});return i.jsx($e,{content:n,children:i.jsxs("span",{className:"flex w-fit cursor-pointer items-center gap-1 rounded-lg border border-gray-200 px-2 py-1",children:[i.jsx(u5,{signatures:t})," ",i.jsx(I,{className:"text-gray-300",name:"InfoSquare",size:16})]})})}function u5(e){const{signatures:t}=e;if(!t?.length)return null;const n=t.length,s=t.filter(c=>c.isVerified).length,o=`${s}/${n} ${n===1?"signature":"signatures"} verified`,a=s===0?"text-red-800":s===n?"text-green-700":"text-orange-700";return i.jsx("span",{className:`text-xs ${a}`,children:o})}function d5(e){const{timestampUtcMs:t}=e,n=typeof t=="string"&&!t.includes("-")?parseInt(t):t,s=new Date(n),r=Gn(s,"HH:mm 'UTC'"),o=Gn(s,"eee, dd MMM yyyy HH:mm:ss 'UTC'"),a=i.jsx("div",{children:o});return i.jsx($e,{content:a,children:i.jsxs("span",{className:"cursor-pointer text-xs",children:["committed at ",r]})})}function f5(e){return i.jsxs("article",{className:"flex items-center justify-between rounded-xl border border-gray-200 bg-white px-4 py-2",children:[i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx(c5,{...e}),i.jsx(i5,{...e}),i.jsx(o5,{...e}),i.jsx(d5,{...e})]}),i.jsxs("div",{className:"flex items-center gap-1",children:[i.jsx(l5,{...e}),i.jsx(a5,{...e})]})]})}const p5=b.memo(f5);function h5(e){const{operationIndex:t,skipCount:n}=e,s=t,r=n===1?`${s}`:`${s} - ${s+1-n}`;return i.jsxs("article",{className:"grid grid-cols-[1fr,auto,1fr] items-center py-2",children:[i.jsx("div",{className:"h-px rounded-full bg-slate-100"}),i.jsxs("div",{className:"mx-3 text-xs text-slate-100",children:["[Skipped Revision ",r,"]"]}),i.jsx("div",{className:"h-px rounded-full bg-slate-100"})]})}function m5(e){const t=[],n=new Set;for(const s of e){if(!s.timestampUtcMs)continue;const r=s.timestampUtcMs.split("T")[0];n.has(r)||(n.add(r),t.push({type:"day",height:32,timestampUtcMs:r})),t.push({type:"revision",height:46,operationIndex:s.index,eventId:s.id??"EVENT_ID_NOT_FOUND",stateHash:s.hash,operationType:s.action.type,operationInput:s.action.input??{},address:s.action?.context?.signer?.user.address,chainId:s.action?.context?.signer?.user.chainId,timestampUtcMs:s.timestampUtcMs,signatures:b5(s.action?.context?.signer?.signatures??[]),errors:s.error?[s.error]:void 0}),s.skip>0&&t.push({type:"skip",height:34,operationIndex:s.index,skipCount:s.skip,timestampUtcMs:s.timestampUtcMs})}return t}function g5(e){const[t,n,s,r]=e;return{signerAddress:t,hash:n,prevStateHash:s,signatureBytes:r,isVerified:!0}}function b5(e){return e?.map(g5)}function y5(e){const{timestampUtcMs:t}=e,n=Gn(t,"MMM dd, yyyy");return i.jsxs("h2",{className:"-ml-6 flex items-center gap-1 bg-slate-50 py-2 text-xs text-slate-100",children:[i.jsx(I,{name:"Ring",size:16})," Changes on ",n]})}function x5(e){const{localOperations:t,globalOperations:n,scope:s}=e,r=s==="local"?t:n,o=100,a=b.useMemo(()=>m5(r),[r]),[c,l]=b.useState(0),[u,d]=b.useState(o),[p,f]=b.useState(()=>a.slice(0,u)),h=b.useRef(null),m=p.length<a.length,g=r5({count:p.length,getScrollElement:()=>h.current,estimateSize:x=>a[x].height,gap:8});b.useEffect(()=>{if(!m)return;const x=Math.floor(c/46),v=o+x;d(S=>v>S?v:S)},[c,m]),b.useEffect(()=>{f(a.slice(0,u))},[a,u]);const y=x=>{l(v=>{const S=v+x.deltaY;return S<0?0:S})};return b.useEffect(()=>(window.addEventListener("wheel",y),()=>{window.removeEventListener("wheel",y)}),[]),i.jsx("div",{className:"border-l border-slate-100",ref:h,style:{height:`${g.getTotalSize()}px`,width:"100%",position:"relative"},children:g.getVirtualItems().map(x=>{const v=p[x.index];return i.jsxs("div",{style:{position:"absolute",top:0,left:16,width:"100%",height:`${x.size}px`,transform:`translateY(${x.start}px)`},children:[v.type==="revision"&&b.createElement(p5,{...v,key:x.key}),v.type==="skip"&&i.jsx(h5,{...v},x.key),v.type==="day"&&i.jsx(y5,{...v},x.key)]},x.index)})})}function k6(e){const{documentTitle:t,documentId:n,globalOperations:s,localOperations:r,onClose:o,itemsPerPage:a=100,documentState:c,onCopyState:l,onCopyDocId:u}=e,[d,p]=b.useState("global"),f=b.useMemo(()=>Xu(Ku(d==="global"?s:r)).sort((O,T)=>T.index-O.index),[s,r,d]),{pageItems:h,pages:m,goToPage:g,goToNextPage:y,goToPreviousPage:x,goToFirstPage:v,goToLastPage:S,hiddenNextPages:N,isNextPageAvailable:w,isPreviousPageAvailable:j}=Hu(f,{itemsPerPage:a});function C(M){v(),p(M)}const E=f.length>a?i.jsx("div",{className:"mt-4 flex w-full justify-end",children:i.jsx(_u,{firstPageLabel:"First Page",goToFirstPage:v,goToLastPage:S,goToNextPage:y,goToPage:g,goToPreviousPage:x,hiddenNextPages:N,isNextPageAvailable:w,isPreviousPageAvailable:j,lastPageLabel:"Last Page",nextPageLabel:"Next",pages:m,previousPageLabel:"Previous"})}):i.jsx("hr",{className:"h-12 border-none"});return i.jsx(Ac,{children:i.jsxs("div",{className:"p-6",children:[i.jsx(Wv,{docId:n,onChangeScope:C,onClose:o,scope:d,title:t,documentState:c,onCopyState:l,onCopyDocId:u}),E,i.jsx("div",{className:"mt-4 flex justify-center rounded-md bg-slate-50 p-4",children:f.length>0?i.jsx("div",{className:"grid grid-cols-[minmax(min-content,1018px)]",children:i.jsx(x5,{globalOperations:d==="global"?h:[],localOperations:d==="local"?h:[],scope:d})}):i.jsx("h3",{className:"my-40 text-gray-600",children:"This document has no recorded operations yet."})}),E]})})}const v5=function(t){const{icon:n,title:s,description:r,containerClassName:o,active:a,onClick:c}=t;return i.jsx($e,{content:s,side:"right",sideOffset:12,className:"border-none bg-gray-800 px-3 py-2 text-sm text-white",children:i.jsxs("div",{className:k("group/sidebar-item relative flex cursor-pointer flex-col items-center justify-center text-center text-sm text-black",o,a&&"bg-white",c&&"cursor-pointer"),onClick:c,children:[a?i.jsx("div",{className:"absolute left-0 top-1/2 h-10 w-1 -translate-y-1/2 rounded-r-sm bg-violet-400"}):i.jsx("div",{className:"absolute left-0 top-1/2 h-6 w-1 -translate-y-1/2 rounded-r-sm bg-zinc-300 opacity-0 transition-opacity group-hover/sidebar-item:opacity-100"}),i.jsx("div",{className:"mx-auto py-4",children:n||i.jsx("div",{className:"flex size-8 items-center justify-center rounded-lg bg-black",children:i.jsx("span",{className:"text-sm font-medium text-white",children:s.slice(0,1).toUpperCase()})})})]})})},M6=function(t){const{containerClassName:n,onClick:s}=t;return i.jsx(v5,{title:"Create New Drive",icon:i.jsx(I,{name:"PlusSquare",size:32}),onClick:s,containerClassName:n})},w5="/assets/renown-short-hover-BiSLBV7L.png",C5="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAJAAAACQCAYAAADnRuK4AAAACXBIWXMAACxLAAAsSwGlPZapAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAtmSURBVHgB7Z3dbtvmGcefl5LsqHYCq0C6tEUCZ0kDzAFqd0NTYAmweAfr0YD0CrpeQboriH0H6RUsu4ChAYodtCdJD3LQBGttILEBJ4tdJ2uzBoi0yIpsi+S790+ZDkmREilSHySfX6FKpkgliH5+nuf9pKAEkFLO1Bu7VzRNzEuiWfXzglDHSIgZYsYC9b1sCaEeJFZMU66WCnS7XC5vUUwE9Qmk2dndvar+ZpetB5NCxIr6Hr+II1NkgQ7FMeTnHGGygxLhRkGj5agiRRKo3mxeY3EyjkZLR8vl5bCnhxKo2WzOGqb4UpJcCDpH1T+E/wpKY+3gU4XoO0MyCaKyhvVsqifTNNWzVM8y8Hz1rW2pr3ExTDTq+Q3vNPc/lYZ+3S/qwI+iVlDSCJYlZcgDiVqGQdLXJVGTJD47NjV5s9vndP3W6429a8rZpY6LIE6hoB4aMenHMMxgkXqktECBguSBNHhwxMkWiEgt3SRDpbgOukjka8HLxt4VQeaX3uOlIkedrKPr7WjkRWiFv0yXJ/7ecdx7AAWzbsgfnDUPgs1EsWgVykz2QTTaa+melCZqRU1+4C2sO8KJSoe3vAXzZInlyRMoTxAw3MgZXbXEvee6BELdg6EI5zGkLa538gcCRkk1lNzIhXqjseQ8cmiGlbpM2nS+WdA0migViMkvKKx1V00kavr+5OlKRdTw02EEUqnrmvNCBJ1SkQvmvFMsauROQHKmOPHqc/sn6y2/6MMtLsams2X2OgpZhrQM92h6u6OQ5WHadItCliWqSL7quqDAdQ/jpqB5nBDaH6wnv/R1ZKLILS/GBbqEdvdarmP6/pGK5k1f1qg6y8N4gBHevsBSafeKOuSeoqGxPEwAXjcwvUfVQGLedZLGxTPjj9cNKWhWw/9cJ3EAYgLwuqHaZvM4Nus+zAYxAXSkMDGj9TiHYQ7pVEP1BxEzFL6+9T3tvGrS4u/fpzcrRykrcMU8BLb/85yePa/STmOX1h49oSzBAg2BJ0qgw9dPn1OWYIEGzH5LtyKQ8+dnv1QpK7BAA2ZbRRxI42T1wSZlBRZowKw/2u44hnpov9WiLMACDRCI8qK64/ve2sZTygIs0ABZvf848L31je1MRCEWaEA82vxZRaBa4Puoi1bvp78WYoEGxOra457nrD18kvoWGQs0AFYfPLY6DcOdm+4oxAIlzE6jSSsRpEChvbaR3t5pFihBUBR/fft7isq9lY3UpjIWKEHufLceOnV1XHtvzYpeaYMFSgjUPds/9T/OBfEQvdLWtGeBEgDyrCRQDFsS3UqXRCxQTJKSx+ZFbSdVErFAMbi38jBReWwg0Vff3E1FTcQC9YHV2lJRYm1jmwaFXRONu0Si3mi69qEqT5aICQb9NnfurvXd2uqHhfO/pvnzp2kcaHpWp7JAIUHUWX2wNdCo0403Z6Zp8eL7ND1VplHCAvXBuuopXlHFsndi2Cg4O/u2FY1GJRILFBJEnEebz2j94fZQ01UYpqeO0InjlZGIxAL1ADUOJsFjOsY4RJxenHr3OJ05/Tadeuc4DQMWKAC0dtqtnvGKNmGZKBXp4oU5S6hB4hWIm/EHoO8lrfIAa/XHT8NfMsQCHXDirYqqK9J7FytEoLmzp2jYcArzgCiEqRWYUTjuEQnSWPWPSlsoqocB10ARwIJATH7vNrd5FECc35w7SXPnTlmvhwkL1AdokY1DRBqlODYsUAzQmTiqOcwnVTP90kdzIxPHhgWKSXuQ819Di0YQ5sMPzlk90OMAC5QQd1c2rCGOQYIe548v/856Hhe8AvEGU31yYeGcFR0GldLQpbB4aX7kKasXLFAMMM0CJC3RGZWuLqle5TQwcoGGUUsMMgUkLVGa5AEjF+gf/7xDwwQyTb9RpomJIlVmpg96oON1wiUlEeb8pEkekLsUhohnRz10FNpfOiRCr26/rR1IhPGofgtriL14cZ7SBtdAB2AaBx5YZXF29p2+ppBCov/+UlMDs3WKyri1tsLCg6keEJ3QYYjU+mjr50jXosWEaadRW04fLryXSnkACxQARMLk+ah1DUSYP6iJwoDmOoYm0goL1ANEI4gUhTk1XhV2asjFC+cpzbBAIUAqiypRmCiEc9KaumxYoJBAoij7+PSaoAZxxmV8Kw4sUASwj8+LavgWVrcodEa19NIefQALFBGshw9LtyiUhegDWKCIWP1FEXYT84tCGK7IQvQBqe1IxBdwJuRvcbW6Qy/+V09s3A1Ne0SXMODWTugXcq4xO3s6G9EHpFcgNZ61EKG/BSQ1NRU9zVi5OlHqPXfKnvhuD3HYq0qzQq5SGH7z//ynj2LXH+077oSfaO9cNfqrDMkDclcD2Ss4464BQy0UFqS7k+8et0bbo0bNcSe3g6noAf7qm+/6Xv8eNQ3+UY2RZZHctsKsIjxGMVvtY8Q9i+S6GR9nR4s0r6NPklwLlKW7J4+KXAs07ise0gD3RDOxyLVAadiBbNzJtUAvYrSksjKWFZdcC/TvzWhznp1gKIXJsUDYEzFKb7KXSmWamBwLtP7waay+nCwNiMYhlwJh7VfcHedPvJXe/RSTJFcdIdbCwfubsVIXwDykMFM58kBqBdp51bSW3IShgY0zlTRJDT9kaUJYXNIrkJJhFNvNofbh+uc13BMdkYsp2z1j0LBAEcjCQsCkYYFCghmMC2Ny07dxggUKgXWzt0vp27tnGPB8hh6My/7M4wr/qwQAYbDJVJq3XhkGLJAPuJ0AVk9w1OkN10A+oJeZ5QkHC+QD7tCDladMb1L7a4be4I8Xfxv4fpwbo2Cm4trGU262hyCzESjuLZE4CoUjswLZ99bqFzsKMd3JdA3EUWjwZFogjkKDJ/OtMI5CgyXzAtkbPPULR6Hu5KIfaO69eMMRHIWCyYVA7W3l+p8Ez1EomNz0RM/H3BmMo5A/uRGo187xveAo5E+uxsI4CiVPrgTiKJQ8uRuN5yiULLkTiKNQsuRyPhDulBMHjkKvyaVAWJocZ30XR6HX5HZG4pmYtzvgKNQmtwLFHWTlKNQmtwLFneoBOArlfFI9R6H4iHqjKZ0HypO8cRITTHPPHXFVBJKuG19JSQzji58amiRR630awygzTLcbgmhLE0KsOA+a7A8TgFcNKZRAZJo/Og8apkkM44fpdcOUq0hhrggkuQhiAjA9bsAdzWjt3nSdpHIYO8R4QWAxPfWNUaDbWqVSqSmVbjvf0E2DGMaJ2VFAy5VKubzV7kiU9K3zTUPnOohx0zLcTphSfIFnSyBd373u7A+Ca7rBUYhpYyh5vLUx0heeLYGsNGa2jbLRdZNrIcYSxxt9BGk3kL7arw+oVqszxYnJTXXocLpesahRqVAgJr/s64YVgZzoGp22BTocTA2KQpzK8ouuxPHKo6qfZVseILwX1Ru7P6jAteA8NqlGrDVNEJMfkLp29933lBWq53n6jbJr27aO6Ry6Jj/xDrBi2gJ3MOYHQzXZ91rezCNrLUGL3nM7BEJ4klL81XWpesBGTmfZB2nLL2BIKnzmTF02vhPKjk2Xb5BJy97jLVUToajiaJQ9rNaW+m7x6MRcPjY1edPvuq6FTb3eXFKKXeu4SCXDYkGzHkz6QdTRffp62pjLR6emloKu7VkZv3zZuCIK4m/O5v3hxQciFVSBjddMeoAsuolWlgwQR9aEKmWmkY26EOpbrzabsyVJt9SfMxt0DlppmmiLhNf4YJZqPLAFQXGMEXW/gVEnmCPWEvITv5qn41yKQFBKY7KCtPoCjx4tL4W9InKIQDQqGOaSENqnxGSEtjj69JHrFeGd4tydvnNMWyS6rMLdVW/HI5MShBoQNejbfsR5/REJcCiTJZKYl4Jm1QfPEjMmyBoWT2AOj+rQ+REzCY2pIzf7lcbJ/wH9VD8KK3ri6QAAAABJRU5ErkJggg==",S5=({onLogin:e})=>{const[t,n]=b.useState(!1),s=!t&&!!e,r=t?i.jsx(I,{name:"Reload",size:14,className:"animate-spin"}):i.jsx("span",{children:"Connect"}),o=()=>{e&&(n(!0),e())};return i.jsxs("div",{className:"p-4",children:[i.jsx("div",{className:"mb-4 flex justify-center",children:i.jsx("div",{className:"flex h-[22px] w-[83px] items-center justify-center overflow-hidden",children:i.jsx(I,{name:"RenownLight",size:83})})}),i.jsx("button",{onClick:s?o:void 0,className:k("mt-4 flex h-7 w-full cursor-pointer items-center justify-center rounded-lg border border-gray-300 bg-transparent text-sm active:opacity-70",s?"cursor-pointer":"cursor-wait"),type:"button",children:r})]})},j5=({onLogin:e})=>{const t=i.jsx(S5,{onLogin:e});return i.jsx(Ri,{content:t,children:i.jsxs("div",{className:k("group/sidebar-footer flex w-full items-baseline justify-start text-sm font-semibold leading-10 text-gray-600",e?"cursor-pointer":"cursor-wait"),children:[i.jsx("img",{width:42,height:42,loading:"lazy",className:"group-hover/sidebar-footer:hidden",src:C5,alt:"Renown Login"}),i.jsx("img",{width:42,height:42,loading:"lazy",className:"hidden group-hover/sidebar-footer:block",src:w5,alt:"Renown Login Hover"})]})})},N5=e=>`${e.slice(0,7)}...${e.slice(-5)}`,P5=({address:e,onDisconnect:t,etherscanUrl:n,username:s=""})=>{const[r,o]=b.useState(!1),a=b.useCallback(async c=>{try{await navigator.clipboard.writeText(c),o(!0),setTimeout(()=>o(!1),2e3)}catch(l){console.error("Failed to copy address:",l)}},[]);return i.jsxs("div",{className:"flex flex-col divide-y divide-gray-200 text-gray-900",children:[i.jsxs("div",{className:"px-3 py-2",children:[s&&i.jsx("div",{className:"text-sm font-medium",children:s}),i.jsx("div",{className:"mt-1 flex items-center gap-2",children:i.jsx(Ce,{size:"small",color:"light",onClick:a.bind(null,e),className:"w-full cursor-pointer bg-transparent p-0 active:opacity-70",type:"button",children:i.jsxs("div",{className:"relative flex w-full items-center gap-1",children:[i.jsxs("div",{className:`flex items-center gap-1 transition-opacity duration-150 ${r?"opacity-0":"opacity-100"}`,children:[i.jsx("span",{className:"text-xs",children:N5(e)}),i.jsx(I,{name:"FilesEarmark",color:"#9EA0A1",size:14})]}),i.jsx("div",{className:`absolute left-0 text-xs transition-opacity duration-150 ${r?"opacity-100":"opacity-0"}`,children:"Copied to clipboard!"})]})})})]}),n&&i.jsx("div",{className:"px-3 py-2",children:i.jsxs("a",{href:n,target:"_blank",rel:"noopener noreferrer",className:"flex items-center gap-2 text-sm text-gray-900 hover:text-gray-600",children:[i.jsx(I,{name:"Ethscan",size:14}),"View on Etherscan"]})}),i.jsx("div",{className:"px-3 py-2",children:i.jsxs("button",{onClick:t,className:k("flex w-full items-center gap-2 text-sm text-red-900",t?"cursor-pointer hover:text-red-700":"pointer-events-none cursor-wait"),type:"button",children:[i.jsx(I,{name:"Disconnect",size:14,color:"#EA4335"}),"Disconnect"]})})]})},E5=({address:e,etherscanUrl:t,onDisconnect:n})=>{const{data:s}=Hl({address:e}),r=s,o=i.jsx(P5,{address:e,username:r,onDisconnect:n,etherscanUrl:t});return i.jsx(Ri,{content:o,children:i.jsx("div",{className:"flex items-center justify-center rounded-sm",children:i.jsx(_l,{address:e,size:"40px"})})})},I5=({address:e,className:t,onLogin:n,onClickSettings:s,onInspectorClick:r,onDisconnect:o,onHomeClick:a,showDebug:c,onDebugClick:l,etherscanUrl:u="",...d})=>i.jsxs(Wu,{...d,className:k("flex flex-col gap-2 border-t border-gray-300 px-2 py-4",t),children:[a&&i.jsx("button",{"aria-label":"Home",type:"button",className:"flex w-full cursor-pointer items-center justify-center outline-none",onClick:a,children:i.jsx(I,{className:"text-gray-600",name:"ConnectSmall",size:24})}),c&&l&&i.jsx("button",{"aria-label":"Debug Settings",type:"button",id:"connect-debug-button",className:"mt-3 flex w-full cursor-pointer items-center justify-center outline-none",onClick:l,children:i.jsx(I,{className:"text-gray-600",name:"Tube"})}),i.jsx("div",{className:a?"mt-3":"",children:e?i.jsx(E5,{address:e,onDisconnect:o,etherscanUrl:u}):i.jsx(j5,{onLogin:n})}),r&&i.jsx("button",{"aria-label":"Inspector",type:"button",className:"mt-3 flex w-full cursor-pointer items-center justify-center outline-none",onClick:r,children:i.jsx(I,{className:"text-gray-600",name:"CircleInfo"})}),i.jsxs("button",{"aria-label":"Settings",type:"button",className:k("mt-3 flex w-full items-center justify-center outline-none",s?"cursor-pointer":"cursor-wait"),onClick:s,children:[i.jsx(I,{className:"text-gray-600",name:"Settings"}),i.jsx("span",{className:"hidden text-sm font-semibold leading-6 text-gray-800",children:"Settings"})]})]}),O5=({className:e,children:t,...n})=>t?i.jsx(Gu,{...n,className:k("flex justify-center gap-4 border-b border-gray-300 py-4",e),children:t}):null,T6=({onClick:e,address:t,headerContent:n,onClickSettings:s,onInspectorClick:r,maxWidth:o="304px",minWidth:a="58px",onLogin:c,onDisconnect:l,etherscanUrl:u,showDebug:d,onDebugClick:p,...f})=>i.jsxs(Yu,{...f,maxWidth:o,minWidth:a,children:[i.jsxs(qu,{children:[i.jsx(O5,{children:n}),i.jsx("div",{className:"flex flex-col",children:f.children})]}),i.jsx(I5,{address:t,onClickSettings:s,onInspectorClick:r,onLogin:c,onDisconnect:l,etherscanUrl:u,onHomeClick:e,showDebug:d,onDebugClick:p})]}),cn=e=>typeof e=="number"&&!isNaN(e),Ke=e=>typeof e=="string",ge=e=>typeof e=="function",Hn=e=>Ke(e)||ge(e)?e:null,Ts=e=>b.isValidElement(e)||Ke(e)||ge(e)||cn(e);function k5(e,t,n){n===void 0&&(n=300);const{scrollHeight:s,style:r}=e;requestAnimationFrame(()=>{r.minHeight="initial",r.height=s+"px",r.transition=`all ${n}ms`,requestAnimationFrame(()=>{r.height="0",r.padding="0",r.margin="0",setTimeout(t,n)})})}function Sr(e){let{enter:t,exit:n,appendPosition:s=!1,collapse:r=!0,collapseDuration:o=300}=e;return function(a){let{children:c,position:l,preventExitTransition:u,done:d,nodeRef:p,isIn:f,playToast:h}=a;const m=s?`${t}--${l}`:t,g=s?`${n}--${l}`:n,y=b.useRef(0);return b.useLayoutEffect(()=>{const x=p.current,v=m.split(" "),S=N=>{N.target===p.current&&(h(),x.removeEventListener("animationend",S),x.removeEventListener("animationcancel",S),y.current===0&&N.type!=="animationcancel"&&x.classList.remove(...v))};x.classList.add(...v),x.addEventListener("animationend",S),x.addEventListener("animationcancel",S)},[]),b.useEffect(()=>{const x=p.current,v=()=>{x.removeEventListener("animationend",v),r?k5(x,d,o):d()};f||(u?v():(y.current=1,x.className+=` ${g}`,x.addEventListener("animationend",v)))},[f]),Q.createElement(Q.Fragment,null,c)}}function Za(e,t){return e!=null?{content:e.content,containerId:e.props.containerId,id:e.props.toastId,theme:e.props.theme,type:e.props.type,data:e.props.data||{},isLoading:e.props.isLoading,icon:e.props.icon,status:t}:{}}const pe=new Map;let ln=[];const As=new Set,M5=e=>As.forEach(t=>t(e)),tu=()=>pe.size>0;function nu(e,t){var n;if(t)return!((n=pe.get(t))==null||!n.isToastActive(e));let s=!1;return pe.forEach(r=>{r.isToastActive(e)&&(s=!0)}),s}function ru(e,t){Ts(e)&&(tu()||ln.push({content:e,options:t}),pe.forEach(n=>{n.buildToast(e,t)}))}function ei(e,t){pe.forEach(n=>{t!=null&&t!=null&&t.containerId?t?.containerId===n.id&&n.toggle(e,t?.id):n.toggle(e,t?.id)})}function T5(e){const{subscribe:t,getSnapshot:n,setProps:s}=b.useRef((function(o){const a=o.containerId||1;return{subscribe(c){const l=(function(d,p,f){let h=1,m=0,g=[],y=[],x=[],v=p;const S=new Map,N=new Set,w=()=>{x=Array.from(S.values()),N.forEach(P=>P())},j=P=>{y=P==null?[]:y.filter(E=>E!==P),w()},C=P=>{const{toastId:E,onOpen:M,updateId:O,children:T}=P.props,D=O==null;P.staleId&&S.delete(P.staleId),S.set(E,P),y=[...y,P.props.toastId].filter(F=>F!==P.staleId),w(),f(Za(P,D?"added":"updated")),D&&ge(M)&&M(b.isValidElement(T)&&T.props)};return{id:d,props:v,observe:P=>(N.add(P),()=>N.delete(P)),toggle:(P,E)=>{S.forEach(M=>{E!=null&&E!==M.props.toastId||ge(M.toggle)&&M.toggle(P)})},removeToast:j,toasts:S,clearQueue:()=>{m-=g.length,g=[]},buildToast:(P,E)=>{if((U=>{let{containerId:R,toastId:H,updateId:te}=U;const ne=R?R!==d:d!==1,G=S.has(H)&&te==null;return ne||G})(E))return;const{toastId:M,updateId:O,data:T,staleId:D,delay:F}=E,V=()=>{j(M)},B=O==null;B&&m++;const _={...v,style:v.toastStyle,key:h++,...Object.fromEntries(Object.entries(E).filter(U=>{let[R,H]=U;return H!=null})),toastId:M,updateId:O,data:T,closeToast:V,isIn:!1,className:Hn(E.className||v.toastClassName),bodyClassName:Hn(E.bodyClassName||v.bodyClassName),progressClassName:Hn(E.progressClassName||v.progressClassName),autoClose:!E.isLoading&&(Y=E.autoClose,W=v.autoClose,Y===!1||cn(Y)&&Y>0?Y:W),deleteToast(){const U=S.get(M),{onClose:R,children:H}=U.props;ge(R)&&R(b.isValidElement(H)&&H.props),f(Za(U,"removed")),S.delete(M),m--,m<0&&(m=0),g.length>0?C(g.shift()):w()}};var Y,W;_.closeButton=v.closeButton,E.closeButton===!1||Ts(E.closeButton)?_.closeButton=E.closeButton:E.closeButton===!0&&(_.closeButton=!Ts(v.closeButton)||v.closeButton);let ee=P;b.isValidElement(P)&&!Ke(P.type)?ee=b.cloneElement(P,{closeToast:V,toastProps:_,data:T}):ge(P)&&(ee=P({closeToast:V,toastProps:_,data:T}));const re={content:ee,props:_,staleId:D};v.limit&&v.limit>0&&m>v.limit&&B?g.push(re):cn(F)?setTimeout(()=>{C(re)},F):C(re)},setProps(P){v=P},setToggle:(P,E)=>{S.get(P).toggle=E},isToastActive:P=>y.some(E=>E===P),getSnapshot:()=>x}})(a,o,M5);pe.set(a,l);const u=l.observe(c);return ln.forEach(d=>ru(d.content,d.options)),ln=[],()=>{u(),pe.delete(a)}},setProps(c){var l;(l=pe.get(a))==null||l.setProps(c)},getSnapshot(){var c;return(c=pe.get(a))==null?void 0:c.getSnapshot()}}})(e)).current;s(e);const r=b.useSyncExternalStore(t,n,n);return{getToastToRender:function(o){if(!r)return[];const a=new Map;return e.newestOnTop&&r.reverse(),r.forEach(c=>{const{position:l}=c.props;a.has(l)||a.set(l,[]),a.get(l).push(c)}),Array.from(a,c=>o(c[0],c[1]))},isToastActive:nu,count:r?.length}}function A5(e){const[t,n]=b.useState(!1),[s,r]=b.useState(!1),o=b.useRef(null),a=b.useRef({start:0,delta:0,removalDistance:0,canCloseOnClick:!0,canDrag:!1,didMove:!1}).current,{autoClose:c,pauseOnHover:l,closeToast:u,onClick:d,closeOnClick:p}=e;var f,h;function m(){n(!0)}function g(){n(!1)}function y(S){const N=o.current;a.canDrag&&N&&(a.didMove=!0,t&&g(),a.delta=e.draggableDirection==="x"?S.clientX-a.start:S.clientY-a.start,a.start!==S.clientX&&(a.canCloseOnClick=!1),N.style.transform=`translate3d(${e.draggableDirection==="x"?`${a.delta}px, var(--y)`:`0, calc(${a.delta}px + var(--y))`},0)`,N.style.opacity=""+(1-Math.abs(a.delta/a.removalDistance)))}function x(){document.removeEventListener("pointermove",y),document.removeEventListener("pointerup",x);const S=o.current;if(a.canDrag&&a.didMove&&S){if(a.canDrag=!1,Math.abs(a.delta)>a.removalDistance)return r(!0),e.closeToast(),void e.collapseAll();S.style.transition="transform 0.2s, opacity 0.2s",S.style.removeProperty("transform"),S.style.removeProperty("opacity")}}(h=pe.get((f={id:e.toastId,containerId:e.containerId,fn:n}).containerId||1))==null||h.setToggle(f.id,f.fn),b.useEffect(()=>{if(e.pauseOnFocusLoss)return document.hasFocus()||g(),window.addEventListener("focus",m),window.addEventListener("blur",g),()=>{window.removeEventListener("focus",m),window.removeEventListener("blur",g)}},[e.pauseOnFocusLoss]);const v={onPointerDown:function(S){if(e.draggable===!0||e.draggable===S.pointerType){a.didMove=!1,document.addEventListener("pointermove",y),document.addEventListener("pointerup",x);const N=o.current;a.canCloseOnClick=!0,a.canDrag=!0,N.style.transition="none",e.draggableDirection==="x"?(a.start=S.clientX,a.removalDistance=N.offsetWidth*(e.draggablePercent/100)):(a.start=S.clientY,a.removalDistance=N.offsetHeight*(e.draggablePercent===80?1.5*e.draggablePercent:e.draggablePercent)/100)}},onPointerUp:function(S){const{top:N,bottom:w,left:j,right:C}=o.current.getBoundingClientRect();S.nativeEvent.type!=="touchend"&&e.pauseOnHover&&S.clientX>=j&&S.clientX<=C&&S.clientY>=N&&S.clientY<=w?g():m()}};return c&&l&&(v.onMouseEnter=g,e.stacked||(v.onMouseLeave=m)),p&&(v.onClick=S=>{d&&d(S),a.canCloseOnClick&&u()}),{playToast:m,pauseToast:g,isRunning:t,preventExitTransition:s,toastRef:o,eventHandlers:v}}function D5(e){let{delay:t,isRunning:n,closeToast:s,type:r="default",hide:o,className:a,style:c,controlledProgress:l,progress:u,rtl:d,isIn:p,theme:f}=e;const h=o||l&&u===0,m={...c,animationDuration:`${t}ms`,animationPlayState:n?"running":"paused"};l&&(m.transform=`scaleX(${u})`);const g=Ue("Toastify__progress-bar",l?"Toastify__progress-bar--controlled":"Toastify__progress-bar--animated",`Toastify__progress-bar-theme--${f}`,`Toastify__progress-bar--${r}`,{"Toastify__progress-bar--rtl":d}),y=ge(a)?a({rtl:d,type:r,defaultClassName:g}):Ue(g,a),x={[l&&u>=1?"onTransitionEnd":"onAnimationEnd"]:l&&u<1?null:()=>{p&&s()}};return Q.createElement("div",{className:"Toastify__progress-bar--wrp","data-hidden":h},Q.createElement("div",{className:`Toastify__progress-bar--bg Toastify__progress-bar-theme--${f} Toastify__progress-bar--${r}`}),Q.createElement("div",{role:"progressbar","aria-hidden":h?"true":"false","aria-label":"notification timer",className:y,style:m,...x}))}let R5=1;const su=()=>""+R5++;function L5(e){return e&&(Ke(e.toastId)||cn(e.toastId))?e.toastId:su()}function Dt(e,t){return ru(e,t),t.toastId}function or(e,t){return{...t,type:t&&t.type||e,toastId:L5(t)}}function An(e){return(t,n)=>Dt(t,or(e,n))}function K(e,t){return Dt(e,or("default",t))}K.loading=(e,t)=>Dt(e,or("default",{isLoading:!0,autoClose:!1,closeOnClick:!1,closeButton:!1,draggable:!1,...t})),K.promise=function(e,t,n){let s,{pending:r,error:o,success:a}=t;r&&(s=Ke(r)?K.loading(r,n):K.loading(r.render,{...n,...r}));const c={isLoading:null,autoClose:null,closeOnClick:null,closeButton:null,draggable:null},l=(d,p,f)=>{if(p==null)return void K.dismiss(s);const h={type:d,...c,...n,data:f},m=Ke(p)?{render:p}:p;return s?K.update(s,{...h,...m}):K(m.render,{...h,...m}),f},u=ge(e)?e():e;return u.then(d=>l("success",a,d)).catch(d=>l("error",o,d)),u},K.success=An("success"),K.info=An("info"),K.error=An("error"),K.warning=An("warning"),K.warn=K.warning,K.dark=(e,t)=>Dt(e,or("default",{theme:"dark",...t})),K.dismiss=function(e){(function(t){var n;if(tu()){if(t==null||Ke(n=t)||cn(n))pe.forEach(s=>{s.removeToast(t)});else if(t&&("containerId"in t||"id"in t)){const s=pe.get(t.containerId);s?s.removeToast(t.id):pe.forEach(r=>{r.removeToast(t.id)})}}else ln=ln.filter(s=>t!=null&&s.options.toastId!==t)})(e)},K.clearWaitingQueue=function(e){e===void 0&&(e={}),pe.forEach(t=>{!t.props.limit||e.containerId&&t.id!==e.containerId||t.clearQueue()})},K.isActive=nu,K.update=function(e,t){t===void 0&&(t={});const n=((s,r)=>{var o;let{containerId:a}=r;return(o=pe.get(a||1))==null?void 0:o.toasts.get(s)})(e,t);if(n){const{props:s,content:r}=n,o={delay:100,...s,...t,toastId:t.toastId||e,updateId:su()};o.toastId!==e&&(o.staleId=e);const a=o.render||r;delete o.render,Dt(a,o)}},K.done=e=>{K.update(e,{progress:1})},K.onChange=function(e){return As.add(e),()=>{As.delete(e)}},K.play=e=>ei(!0,e),K.pause=e=>ei(!1,e);const F5=typeof window<"u"?b.useLayoutEffect:b.useEffect,Dn=e=>{let{theme:t,type:n,isLoading:s,...r}=e;return Q.createElement("svg",{viewBox:"0 0 24 24",width:"100%",height:"100%",fill:t==="colored"?"currentColor":`var(--toastify-icon-color-${n})`,...r})},Qr={info:function(e){return Q.createElement(Dn,{...e},Q.createElement("path",{d:"M12 0a12 12 0 1012 12A12.013 12.013 0 0012 0zm.25 5a1.5 1.5 0 11-1.5 1.5 1.5 1.5 0 011.5-1.5zm2.25 13.5h-4a1 1 0 010-2h.75a.25.25 0 00.25-.25v-4.5a.25.25 0 00-.25-.25h-.75a1 1 0 010-2h1a2 2 0 012 2v4.75a.25.25 0 00.25.25h.75a1 1 0 110 2z"}))},warning:function(e){return Q.createElement(Dn,{...e},Q.createElement("path",{d:"M23.32 17.191L15.438 2.184C14.728.833 13.416 0 11.996 0c-1.42 0-2.733.833-3.443 2.184L.533 17.448a4.744 4.744 0 000 4.368C1.243 23.167 2.555 24 3.975 24h16.05C22.22 24 24 22.044 24 19.632c0-.904-.251-1.746-.68-2.44zm-9.622 1.46c0 1.033-.724 1.823-1.698 1.823s-1.698-.79-1.698-1.822v-.043c0-1.028.724-1.822 1.698-1.822s1.698.79 1.698 1.822v.043zm.039-12.285l-.84 8.06c-.057.581-.408.943-.897.943-.49 0-.84-.367-.896-.942l-.84-8.065c-.057-.624.25-1.095.779-1.095h1.91c.528.005.84.476.784 1.1z"}))},success:function(e){return Q.createElement(Dn,{...e},Q.createElement("path",{d:"M12 0a12 12 0 1012 12A12.014 12.014 0 0012 0zm6.927 8.2l-6.845 9.289a1.011 1.011 0 01-1.43.188l-4.888-3.908a1 1 0 111.25-1.562l4.076 3.261 6.227-8.451a1 1 0 111.61 1.183z"}))},error:function(e){return Q.createElement(Dn,{...e},Q.createElement("path",{d:"M11.983 0a12.206 12.206 0 00-8.51 3.653A11.8 11.8 0 000 12.207 11.779 11.779 0 0011.8 24h.214A12.111 12.111 0 0024 11.791 11.766 11.766 0 0011.983 0zM10.5 16.542a1.476 1.476 0 011.449-1.53h.027a1.527 1.527 0 011.523 1.47 1.475 1.475 0 01-1.449 1.53h-.027a1.529 1.529 0 01-1.523-1.47zM11 12.5v-6a1 1 0 012 0v6a1 1 0 11-2 0z"}))},spinner:function(){return Q.createElement("div",{className:"Toastify__spinner"})}},z5=e=>{const{isRunning:t,preventExitTransition:n,toastRef:s,eventHandlers:r,playToast:o}=A5(e),{closeButton:a,children:c,autoClose:l,onClick:u,type:d,hideProgressBar:p,closeToast:f,transition:h,position:m,className:g,style:y,bodyClassName:x,bodyStyle:v,progressClassName:S,progressStyle:N,updateId:w,role:j,progress:C,rtl:P,toastId:E,deleteToast:M,isIn:O,isLoading:T,closeOnClick:D,theme:F}=e,V=Ue("Toastify__toast",`Toastify__toast-theme--${F}`,`Toastify__toast--${d}`,{"Toastify__toast--rtl":P},{"Toastify__toast--close-on-click":D}),B=ge(g)?g({rtl:P,position:m,type:d,defaultClassName:V}):Ue(V,g),_=(function(re){let{theme:U,type:R,isLoading:H,icon:te}=re,ne=null;const G={theme:U,type:R};return te===!1||(ge(te)?ne=te({...G,isLoading:H}):b.isValidElement(te)?ne=b.cloneElement(te,G):H?ne=Qr.spinner():(oe=>oe in Qr)(R)&&(ne=Qr[R](G))),ne})(e),Y=!!C||!l,W={closeToast:f,type:d,theme:F};let ee=null;return a===!1||(ee=ge(a)?a(W):b.isValidElement(a)?b.cloneElement(a,W):(function(re){let{closeToast:U,theme:R,ariaLabel:H="close"}=re;return Q.createElement("button",{className:`Toastify__close-button Toastify__close-button--${R}`,type:"button",onClick:te=>{te.stopPropagation(),U(te)},"aria-label":H},Q.createElement("svg",{"aria-hidden":"true",viewBox:"0 0 14 16"},Q.createElement("path",{fillRule:"evenodd",d:"M7.71 8.23l3.75 3.75-1.48 1.48-3.75-3.75-3.75 3.75L1 11.98l3.75-3.75L1 4.48 2.48 3l3.75 3.75L9.98 3l1.48 1.48-3.75 3.75z"})))})(W)),Q.createElement(h,{isIn:O,done:M,position:m,preventExitTransition:n,nodeRef:s,playToast:o},Q.createElement("div",{id:E,onClick:u,"data-in":O,className:B,...r,style:y,ref:s},Q.createElement("div",{...O&&{role:j},className:ge(x)?x({type:d}):Ue("Toastify__toast-body",x),style:v},_!=null&&Q.createElement("div",{className:Ue("Toastify__toast-icon",{"Toastify--animate-icon Toastify__zoom-enter":!T})},_),Q.createElement("div",null,c)),ee,Q.createElement(D5,{...w&&!Y?{key:`pb-${w}`}:{},rtl:P,theme:F,delay:l,isRunning:t,isIn:O,closeToast:f,hide:p,type:d,style:N,className:S,controlledProgress:Y,progress:C||0})))},jr=function(e,t){return t===void 0&&(t=!1),{enter:`Toastify--animate Toastify__${e}-enter`,exit:`Toastify--animate Toastify__${e}-exit`,appendPosition:t}},$5=Sr(jr("bounce",!0));Sr(jr("slide",!0));Sr(jr("zoom"));Sr(jr("flip"));const V5={position:"top-right",transition:$5,autoClose:5e3,closeButton:!0,pauseOnHover:!0,pauseOnFocusLoss:!0,draggable:"touch",draggablePercent:80,draggableDirection:"x",role:"alert",theme:"light"};function B5(e){let t={...V5,...e};const n=e.stacked,[s,r]=b.useState(!0),o=b.useRef(null),{getToastToRender:a,isToastActive:c,count:l}=T5(t),{className:u,style:d,rtl:p,containerId:f}=t;function h(g){const y=Ue("Toastify__toast-container",`Toastify__toast-container--${g}`,{"Toastify__toast-container--rtl":p});return ge(u)?u({position:g,rtl:p,defaultClassName:y}):Ue(y,Hn(u))}function m(){n&&(r(!0),K.play())}return F5(()=>{if(n){var g;const y=o.current.querySelectorAll('[data-in="true"]'),x=12,v=(g=t.position)==null?void 0:g.includes("top");let S=0,N=0;Array.from(y).reverse().forEach((w,j)=>{const C=w;C.classList.add("Toastify__toast--stacked"),j>0&&(C.dataset.collapsed=`${s}`),C.dataset.pos||(C.dataset.pos=v?"top":"bot");const P=S*(s?.2:1)+(s?0:x*j);C.style.setProperty("--y",`${v?P:-1*P}px`),C.style.setProperty("--g",`${x}`),C.style.setProperty("--s",""+(1-(s?N:0))),S+=C.offsetHeight,N+=.025})}},[s,l,n]),Q.createElement("div",{ref:o,className:"Toastify",id:f,onMouseEnter:()=>{n&&(r(!1),K.pause())},onMouseLeave:m},a((g,y)=>{const x=y.length?{...d}:{...d,pointerEvents:"none"};return Q.createElement("div",{className:h(g),style:x,key:`container-${g}`},y.map(v=>{let{content:S,props:N}=v;return Q.createElement(z5,{...N,stacked:n,collapseAll:m,isIn:c(N.toastId,N.containerId),style:N.style,key:`toast-${N.key}`},S)}))}))}function U5(e){return e==="connect-success"||e==="connect-warning"||e==="connect-loading"||e==="connect-deleted"}function H5(e){if(U5(e)){const t={};switch(e){case"connect-success":t.type="success",t.icon=i.jsx(I,{className:"text-green-800",name:"CheckCircleFill",size:24});break;case"connect-warning":t.type="warning",t.icon=i.jsx(I,{className:"text-gray-600",name:"WarningFill",size:24});break;case"connect-loading":t.type="default",t.icon=i.jsx(I,{className:"text-gray-600",name:"ClockFill",size:24});break;case"connect-deleted":t.type="error",t.icon=i.jsx(I,{className:"text-red-800",name:"TrashFill",size:24});break}return t}return{type:e}}function A6(e,t){const{type:n="default",...s}=t||{},r=H5(n);return K(e,{...r,...s})}const _5=({closeToast:e})=>i.jsx("button",{className:"flex items-center text-gray-500 hover:text-gray-600",onClick:e,children:i.jsx(I,{name:"XmarkLight",size:16})}),D6=e=>i.jsx(B5,{closeButton:_5,...e}),ti=Ky({id:1,name:"Ethereum",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},blockTime:12e3,rpcUrls:{default:{http:["https://eth.merkle.io"]}},blockExplorers:{default:{name:"Etherscan",url:"https://etherscan.io",apiUrl:"https://api.etherscan.io/api"}},contracts:{ensUniversalResolver:{address:"0xeeeeeeee14d718c2b47d9923deab1335e144eeee",blockCreated:23085558},multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:14353601}}}),W5=Ox({chains:[ti],transports:{[ti.id]:ox()}}),G5=new Nu;function R6(e){const{children:t,wagmiProviderProps:n,queryClientProviderProps:s}=e,{config:r=W5,...o}=n??{},{client:a=G5,...c}=s??{};return i.jsx(Tx,{config:r,...o,children:i.jsx(Pu,{client:a,...c,children:t})})}export{b0 as A,o6 as B,kd as C,l6 as D,j6 as E,p6 as F,N6 as G,g6 as H,P6 as I,E6 as J,I6 as K,O6 as L,C6 as M,ag as N,ig as O,Od as P,cg as Q,Ed as R,v5 as S,Id as T,lg as U,R6 as W,Pd as a,p0 as b,T6 as c,D6 as d,i6 as e,c6 as f,u6 as g,k6 as h,r5 as i,Dc as j,h6 as k,m6 as l,uv as m,Ac as n,M6 as o,b6 as p,qs as q,S6 as r,y6 as s,A6 as t,s6 as u,a6 as v,bn as w,x6 as x,v6 as y,w6 as z};