@powerhousedao/connect 5.0.12 → 5.1.0-dev.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/{AddDriveModal-CYJidw-7.js → AddDriveModal-BcKP3tRe.js} +1 -1
- package/dist/assets/{ClearStorageModal-BTgndKDN.js → ClearStorageModal-DTsvgkvC.js} +1 -1
- package/dist/assets/CookiesPolicyModal-CRZwgxod.js +1 -0
- package/dist/assets/CreateDocumentModal-DnYQnJIJ.js +1 -0
- package/dist/assets/{DebugSettingsModal-exIYZ2PV.js → DebugSettingsModal-D1lmoZeA.js} +1 -1
- package/dist/assets/{DeleteDriveModal-BxOHeGcK.js → DeleteDriveModal-Dko0j8XY.js} +1 -1
- package/dist/assets/{DeleteItemModal-CN4eJOT2.js → DeleteItemModal-CGpOWuYv.js} +1 -1
- package/dist/assets/DisclaimerModal-DvHxIKeX.js +1 -0
- package/dist/assets/DriveSettingsModal-Bw_uVXsp.js +1 -0
- package/dist/assets/{ExportDocumentWithErrorsModal-DqTJLmZT.js → ExportDocumentWithErrorsModal-p3fkHZfU.js} +1 -1
- package/dist/assets/SettingsModal--ZRZ8Ppf.js +1 -0
- package/dist/assets/UpgradeDriveModal-DdA909jM.js +1 -0
- package/dist/assets/{design_system-CM4kPPv0.js → design_system-DnTVxPr0.js} +1 -1
- package/dist/assets/{design_system_connect-De3UEu1g.js → design_system_connect-BEZiOxEn.js} +3 -3
- package/dist/assets/design_system_ui-Bqq8Fu01.js +1 -0
- package/dist/assets/{document_engineering-BJAlCK27.js → document_engineering-C2p9jHIj.js} +1 -1
- package/dist/assets/{document_model_editor-DdzmV0ae.js → document_model_editor-7tmqOIHK.js} +4 -4
- package/dist/assets/{drive_explorer-BfFbgUlu.js → drive_explorer-DzIBsVp8.js} +2 -2
- package/dist/assets/{graphql-editor-CTzOKkuK.js → graphql-editor-BQvJ6Fu2.js} +2 -2
- package/dist/assets/{hooks-C3C7hg0A.js → hooks-BAZes8kG.js} +1 -1
- package/dist/assets/index-DmgPEV3W.js +18 -0
- package/dist/assets/json-editor-BV-qLD2_.js +1 -0
- package/dist/assets/{reactor_browser-Bt9tJ6zC.js → reactor_browser-D8KSw52x.js} +1 -1
- package/dist/assets/state-schemas-Il25Ux8q.js +2 -0
- package/dist/index.html +7 -7
- package/heroku/Dockerfile +1 -1
- package/lib/package.copy.json +3 -2
- package/lib/src/components/app-skeleton.js +1 -1
- package/lib/src/components/app-skeleton.js.map +1 -1
- package/lib/src/components/root.js +1 -1
- package/lib/src/components/root.js.map +1 -1
- package/lib/tsconfig.tsbuildinfo +1 -1
- package/package.copy.json +3 -2
- package/package.json +11 -10
- package/dist/assets/CookiesPolicyModal-_pT9oerc.js +0 -1
- package/dist/assets/CreateDocumentModal-DjZz9Qv3.js +0 -1
- package/dist/assets/DisclaimerModal-Dfa_zW6i.js +0 -1
- package/dist/assets/DriveSettingsModal-CGzNOhxi.js +0 -1
- package/dist/assets/SettingsModal-hc-4IJid.js +0 -1
- package/dist/assets/UpgradeDriveModal-kxjlIOKK.js +0 -1
- package/dist/assets/design_system_ui-DJRKc_U2.js +0 -1
- package/dist/assets/index-CnAD5290.js +0 -18
- package/dist/assets/json-editor-C9fzOy-g.js +0 -1
- package/dist/assets/state-schemas-Dq3cHtLM.js +0 -2
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import{j as u,u as Ci,r as Si,C as Ei,b as Us,a as Ve}from"./document_model_editor-DdzmV0ae.js";import{r as b,R as ko,a as W}from"./sentry_react-cODD7zWc.js";import{b as Bs,c as Pi,d as Oi,e as Tu,s as Au,f as vt,g as Ru,h as Du,i as ku,j as Lu,k as Fu,l as $u,m as zu,n as Uu,o as Vs,p as Bu,q as Vu,r as Hu,t as _u,v as ji,w as Wu}from"./reactor_browser-Bt9tJ6zC.js";import{P as Et,a as Ii,b as Ni,u as Mi,d as Ti,R as Gu,A as qu,e as ke,f as Hs,g as Yu,D as Qu,C as Ku,h as Ju,i as Xu,j as Zu,I,k as ed,m as ce,l as Pe,M as Ye,n as td,o as nd,p as rd,q as sd,r as od,s as Ai,t as ad,v as id,c as Ri,w as cd,x as ld,S as ud,y as dd,z as fd,B as hd}from"./design_system-CM4kPPv0.js";import{t as N,a as _s}from"./tailwind_merge-Dr4f9Rms.js";import{a3 as pd,a4 as md,$ as Lo,n as gd,s as bd}from"./document_model-DXcLJEjZ.js";import{c as Pn,g as Di}from"./react-DQSxOgtG.js";import{o as Xr,p as vd}from"./document_drive-BEIKnuGM.js";import{o as yd,r as Fo,s as It}from"./zod-C6yxFxyo.js";import{P as xd,a as wd,b as Cd,S as ki,I as Sd,c as Ed}from"./design_system_ui-DJRKc_U2.js";import{_ as Pd}from"./drive_explorer-BfFbgUlu.js";var Od=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"}),jd="VisuallyHidden",Li=b.forwardRef((e,t)=>u.jsx(Et.span,{...e,ref:t,style:{...Od,...e.style}}));Li.displayName=jd;var Id=Li,[fr]=Ii("Tooltip",[Ni]),hr=Ni(),Fi="TooltipProvider",Nd=700,Zr="tooltip.open",[Md,Ws]=fr(Fi),$i=e=>{const{__scopeTooltip:t,delayDuration:n=Nd,skipDelayDuration:s=300,disableHoverableContent:r=!1,children:o}=e,a=b.useRef(!0),i=b.useRef(!1),c=b.useRef(0);return b.useEffect(()=>{const l=c.current;return()=>window.clearTimeout(l)},[]),u.jsx(Md,{scope:t,isOpenDelayedRef:a,delayDuration:n,onOpen:b.useCallback(()=>{window.clearTimeout(c.current),a.current=!1},[]),onClose:b.useCallback(()=>{window.clearTimeout(c.current),c.current=window.setTimeout(()=>a.current=!0,s)},[s]),isPointerInTransitRef:i,onPointerInTransitChange:b.useCallback(l=>{i.current=l},[]),disableHoverableContent:r,children:o})};$i.displayName=Fi;var $t="Tooltip",[Td,mn]=fr($t),zi=e=>{const{__scopeTooltip:t,children:n,open:s,defaultOpen:r,onOpenChange:o,disableHoverableContent:a,delayDuration:i}=e,c=Ws($t,e.__scopeTooltip),l=hr(t),[d,f]=b.useState(null),h=Mi(),p=b.useRef(0),m=a??c.disableHoverableContent,g=i??c.delayDuration,v=b.useRef(!1),[x,y]=Ti({prop:s,defaultProp:r??!1,onChange:S=>{S?(c.onOpen(),document.dispatchEvent(new CustomEvent(Zr))):c.onClose(),o?.(S)},caller:$t}),C=b.useMemo(()=>x?v.current?"delayed-open":"instant-open":"closed",[x]),O=b.useCallback(()=>{window.clearTimeout(p.current),p.current=0,v.current=!1,y(!0)},[y]),w=b.useCallback(()=>{window.clearTimeout(p.current),p.current=0,y(!1)},[y]),E=b.useCallback(()=>{window.clearTimeout(p.current),p.current=window.setTimeout(()=>{v.current=!0,y(!0),p.current=0},g)},[g,y]);return b.useEffect(()=>()=>{p.current&&(window.clearTimeout(p.current),p.current=0)},[]),u.jsx(Gu,{...l,children:u.jsx(Td,{scope:t,contentId:h,open:x,stateAttribute:C,trigger:d,onTriggerChange:f,onTriggerEnter:b.useCallback(()=>{c.isOpenDelayedRef.current?E():O()},[c.isOpenDelayedRef,E,O]),onTriggerLeave:b.useCallback(()=>{m?w():(window.clearTimeout(p.current),p.current=0)},[w,m]),onOpen:O,onClose:w,disableHoverableContent:m,children:n})})};zi.displayName=$t;var es="TooltipTrigger",Ui=b.forwardRef((e,t)=>{const{__scopeTooltip:n,...s}=e,r=mn(es,n),o=Ws(es,n),a=hr(n),i=b.useRef(null),c=Ci(t,i,r.onTriggerChange),l=b.useRef(!1),d=b.useRef(!1),f=b.useCallback(()=>l.current=!1,[]);return b.useEffect(()=>()=>document.removeEventListener("pointerup",f),[f]),u.jsx(qu,{asChild:!0,...a,children:u.jsx(Et.button,{"aria-describedby":r.open?r.contentId:void 0,"data-state":r.stateAttribute,...s,ref:c,onPointerMove:ke(e.onPointerMove,h=>{h.pointerType!=="touch"&&!d.current&&!o.isPointerInTransitRef.current&&(r.onTriggerEnter(),d.current=!0)}),onPointerLeave:ke(e.onPointerLeave,()=>{r.onTriggerLeave(),d.current=!1}),onPointerDown:ke(e.onPointerDown,()=>{r.open&&r.onClose(),l.current=!0,document.addEventListener("pointerup",f,{once:!0})}),onFocus:ke(e.onFocus,()=>{l.current||r.onOpen()}),onBlur:ke(e.onBlur,r.onClose),onClick:ke(e.onClick,r.onClose)})})});Ui.displayName=es;var Gs="TooltipPortal",[Ad,Rd]=fr(Gs,{forceMount:void 0}),Bi=e=>{const{__scopeTooltip:t,forceMount:n,children:s,container:r}=e,o=mn(Gs,t);return u.jsx(Ad,{scope:t,forceMount:n,children:u.jsx(Hs,{present:n||o.open,children:u.jsx(Yu,{asChild:!0,container:r,children:s})})})};Bi.displayName=Gs;var yt="TooltipContent",Vi=b.forwardRef((e,t)=>{const n=Rd(yt,e.__scopeTooltip),{forceMount:s=n.forceMount,side:r="top",...o}=e,a=mn(yt,e.__scopeTooltip);return u.jsx(Hs,{present:s||a.open,children:a.disableHoverableContent?u.jsx(Hi,{side:r,...o,ref:t}):u.jsx(Dd,{side:r,...o,ref:t})})}),Dd=b.forwardRef((e,t)=>{const n=mn(yt,e.__scopeTooltip),s=Ws(yt,e.__scopeTooltip),r=b.useRef(null),o=Ci(t,r),[a,i]=b.useState(null),{trigger:c,onClose:l}=n,d=r.current,{onPointerInTransitChange:f}=s,h=b.useCallback(()=>{i(null),f(!1)},[f]),p=b.useCallback((m,g)=>{const v=m.currentTarget,x={x:m.clientX,y:m.clientY},y=zd(x,v.getBoundingClientRect()),C=Ud(x,y),O=Bd(g.getBoundingClientRect()),w=Hd([...C,...O]);i(w),f(!0)},[f]);return b.useEffect(()=>()=>h(),[h]),b.useEffect(()=>{if(c&&d){const m=v=>p(v,d),g=v=>p(v,c);return c.addEventListener("pointerleave",m),d.addEventListener("pointerleave",g),()=>{c.removeEventListener("pointerleave",m),d.removeEventListener("pointerleave",g)}}},[c,d,p,h]),b.useEffect(()=>{if(a){const m=g=>{const v=g.target,x={x:g.clientX,y:g.clientY},y=c?.contains(v)||d?.contains(v),C=!Vd(x,a);y?h():C&&(h(),l())};return document.addEventListener("pointermove",m),()=>document.removeEventListener("pointermove",m)}},[c,d,a,l,h]),u.jsx(Hi,{...e,ref:o})}),[kd,Ld]=fr($t,{isInside:!1}),Fd=Ju("TooltipContent"),Hi=b.forwardRef((e,t)=>{const{__scopeTooltip:n,children:s,"aria-label":r,onEscapeKeyDown:o,onPointerDownOutside:a,...i}=e,c=mn(yt,n),l=hr(n),{onClose:d}=c;return b.useEffect(()=>(document.addEventListener(Zr,d),()=>document.removeEventListener(Zr,d)),[d]),b.useEffect(()=>{if(c.trigger){const f=h=>{h.target?.contains(c.trigger)&&d()};return window.addEventListener("scroll",f,{capture:!0}),()=>window.removeEventListener("scroll",f,{capture:!0})}},[c.trigger,d]),u.jsx(Qu,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:o,onPointerDownOutside:a,onFocusOutside:f=>f.preventDefault(),onDismiss:d,children:u.jsxs(Ku,{"data-state":c.stateAttribute,...l,...i,ref:t,style:{...i.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:[u.jsx(Fd,{children:s}),u.jsx(kd,{scope:n,isInside:!0,children:u.jsx(Id,{id:c.contentId,role:"tooltip",children:r||s})})]})})});Vi.displayName=yt;var _i="TooltipArrow",$d=b.forwardRef((e,t)=>{const{__scopeTooltip:n,...s}=e,r=hr(n);return Ld(_i,n).isInside?null:u.jsx(Xu,{...r,...s,ref:t})});$d.displayName=_i;function zd(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 Ud(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 Bd(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 Vd(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 i=t[o],c=t[a],l=i.x,d=i.y,f=c.x,h=c.y;d>s!=h>s&&n<(f-l)*(s-d)/(h-d)+l&&(r=!r)}return r}function Hd(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),_d(t)}function _d(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 Wd=$i,Gd=zi,qd=Ui,Yd=Bi,Qd=Vi;const Wi=6048e5,Kd=864e5,Gi=6e4,qi=36e5,On=43200,$o=1440,zo=Symbol.for("constructDateFrom");function Te(e,t){return typeof e=="function"?e(t):e&&typeof e=="object"&&zo in e?e[zo](t):e instanceof Date?new e.constructor(t):new Date(t)}function ae(e,t){return Te(t||e,e)}let Jd={};function gn(){return Jd}function zt(e,t){const n=gn(),s=t?.weekStartsOn??t?.locale?.options?.weekStartsOn??n.weekStartsOn??n.locale?.options?.weekStartsOn??0,r=ae(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 Jn(e,t){return zt(e,{...t,weekStartsOn:1})}function Yi(e,t){const n=ae(e,t?.in),s=n.getFullYear(),r=Te(n,0);r.setFullYear(s+1,0,4),r.setHours(0,0,0,0);const o=Jn(r),a=Te(n,0);a.setFullYear(s,0,4),a.setHours(0,0,0,0);const i=Jn(a);return n.getTime()>=o.getTime()?s+1:n.getTime()>=i.getTime()?s:s-1}function Xn(e){const t=ae(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 pr(e,...t){const n=Te.bind(null,e||t.find(s=>typeof s=="object"));return t.map(n)}function Uo(e,t){const n=ae(e,t?.in);return n.setHours(0,0,0,0),n}function Xd(e,t,n){const[s,r]=pr(n?.in,e,t),o=Uo(s),a=Uo(r),i=+o-Xn(o),c=+a-Xn(a);return Math.round((i-c)/Kd)}function Zd(e,t){const n=Yi(e,t),s=Te(e,0);return s.setFullYear(n,0,4),s.setHours(0,0,0,0),Jn(s)}function Vn(e,t){const n=+ae(e)-+ae(t);return n<0?-1:n>0?1:n}function ef(e){return Te(e,Date.now())}function tf(e){return e instanceof Date||typeof e=="object"&&Object.prototype.toString.call(e)==="[object Date]"}function nf(e){return!(!tf(e)&&typeof e!="number"||isNaN(+ae(e)))}function rf(e,t,n){const[s,r]=pr(n?.in,e,t),o=s.getFullYear()-r.getFullYear(),a=s.getMonth()-r.getMonth();return o*12+a}function sf(e){return t=>{const s=(e?Math[e]:Math.trunc)(t);return s===0?0:s}}function of(e,t){return+ae(e)-+ae(t)}function af(e,t){const n=ae(e,t?.in);return n.setHours(23,59,59,999),n}function cf(e,t){const n=ae(e,t?.in),s=n.getMonth();return n.setFullYear(n.getFullYear(),s+1,0),n.setHours(23,59,59,999),n}function lf(e,t){const n=ae(e,t?.in);return+af(n,t)==+cf(n,t)}function uf(e,t,n){const[s,r,o]=pr(n?.in,e,e,t),a=Vn(r,o),i=Math.abs(rf(r,o));if(i<1)return 0;r.getMonth()===1&&r.getDate()>27&&r.setDate(30),r.setMonth(r.getMonth()-a*i);let c=Vn(r,o)===-a;lf(s)&&i===1&&Vn(s,o)===1&&(c=!1);const l=a*(i-+c);return l===0?0:l}function df(e,t,n){const s=of(e,t)/1e3;return sf(n?.roundingMethod)(s)}function ff(e,t){const n=ae(e,t?.in);return n.setFullYear(n.getFullYear(),0,1),n.setHours(0,0,0,0),n}const hf={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"}},pf=(e,t,n)=>{let s;const r=hf[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 mf={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},gf={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},bf={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},vf={date:Nr({formats:mf,defaultWidth:"full"}),time:Nr({formats:gf,defaultWidth:"full"}),dateTime:Nr({formats:bf,defaultWidth:"full"})},yf={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},xf=(e,t,n,s)=>yf[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,i=n?.width?String(n.width):a;r=e.formattingValues[i]||e.formattingValues[a]}else{const a=e.defaultWidth,i=n?.width?String(n.width):e.defaultWidth;r=e.values[i]||e.values[a]}const o=e.argumentCallback?e.argumentCallback(t):t;return r[o]}}const wf={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},Cf={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},Sf={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"]},Ef={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"]},Pf={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"}},Of={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"}},jf=(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"},If={ordinalNumber:jf,era:Nt({values:wf,defaultWidth:"wide"}),quarter:Nt({values:Cf,defaultWidth:"wide",argumentCallback:e=>e-1}),month:Nt({values:Sf,defaultWidth:"wide"}),day:Nt({values:Ef,defaultWidth:"wide"}),dayPeriod:Nt({values:Pf,defaultWidth:"wide",formattingValues:Of,defaultFormattingWidth:"wide"})};function Mt(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],i=s&&e.parsePatterns[s]||e.parsePatterns[e.defaultParseWidth],c=Array.isArray(i)?Mf(i,f=>f.test(a)):Nf(i,f=>f.test(a));let l;l=e.valueCallback?e.valueCallback(c):c,l=n.valueCallback?n.valueCallback(l):l;const d=t.slice(a.length);return{value:l,rest:d}}}function Nf(e,t){for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&t(e[n]))return n}function Mf(e,t){for(let n=0;n<e.length;n++)if(t(e[n]))return n}function Tf(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 i=t.slice(r.length);return{value:a,rest:i}}}const Af=/^(\d+)(th|st|nd|rd)?/i,Rf=/\d+/i,Df={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},kf={any:[/^b/i,/^(a|c)/i]},Lf={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},Ff={any:[/1/i,/2/i,/3/i,/4/i]},$f={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},zf={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]},Uf={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},Bf={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]},Vf={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},Hf={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}},_f={ordinalNumber:Tf({matchPattern:Af,parsePattern:Rf,valueCallback:e=>parseInt(e,10)}),era:Mt({matchPatterns:Df,defaultMatchWidth:"wide",parsePatterns:kf,defaultParseWidth:"any"}),quarter:Mt({matchPatterns:Lf,defaultMatchWidth:"wide",parsePatterns:Ff,defaultParseWidth:"any",valueCallback:e=>e+1}),month:Mt({matchPatterns:$f,defaultMatchWidth:"wide",parsePatterns:zf,defaultParseWidth:"any"}),day:Mt({matchPatterns:Uf,defaultMatchWidth:"wide",parsePatterns:Bf,defaultParseWidth:"any"}),dayPeriod:Mt({matchPatterns:Vf,defaultMatchWidth:"any",parsePatterns:Hf,defaultParseWidth:"any"})},Qi={code:"en-US",formatDistance:pf,formatLong:vf,formatRelative:xf,localize:If,match:_f,options:{weekStartsOn:0,firstWeekContainsDate:1}};function Wf(e,t){const n=ae(e,t?.in);return Xd(n,ff(n))+1}function Gf(e,t){const n=ae(e,t?.in),s=+Jn(n)-+Zd(n);return Math.round(s/Wi)+1}function Ki(e,t){const n=ae(e,t?.in),s=n.getFullYear(),r=gn(),o=t?.firstWeekContainsDate??t?.locale?.options?.firstWeekContainsDate??r.firstWeekContainsDate??r.locale?.options?.firstWeekContainsDate??1,a=Te(t?.in||e,0);a.setFullYear(s+1,0,o),a.setHours(0,0,0,0);const i=zt(a,t),c=Te(t?.in||e,0);c.setFullYear(s,0,o),c.setHours(0,0,0,0);const l=zt(c,t);return+n>=+i?s+1:+n>=+l?s:s-1}function qf(e,t){const n=gn(),s=t?.firstWeekContainsDate??t?.locale?.options?.firstWeekContainsDate??n.firstWeekContainsDate??n.locale?.options?.firstWeekContainsDate??1,r=Ki(e,t),o=Te(t?.in||e,0);return o.setFullYear(r,0,s),o.setHours(0,0,0,0),zt(o,t)}function Yf(e,t){const n=ae(e,t?.in),s=+zt(n,t)-+qf(n,t);return Math.round(s/Wi)+1}function Q(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 Q(t==="yy"?s%100:s,t.length)},M(e,t){const n=e.getMonth();return t==="M"?String(n+1):Q(n+1,2)},d(e,t){return Q(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 Q(e.getHours()%12||12,t.length)},H(e,t){return Q(e.getHours(),t.length)},m(e,t){return Q(e.getMinutes(),t.length)},s(e,t){return Q(e.getSeconds(),t.length)},S(e,t){const n=t.length,s=e.getMilliseconds(),r=Math.trunc(s*Math.pow(10,n-3));return Q(r,t.length)}},ut={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},Bo={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 Q(a,2)}return t==="Yo"?n.ordinalNumber(o,{unit:"year"}):Q(o,t.length)},R:function(e,t){const n=Yi(e);return Q(n,t.length)},u:function(e,t){const n=e.getFullYear();return Q(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 Q(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 Q(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 Q(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=Yf(e,s);return t==="wo"?n.ordinalNumber(r,{unit:"week"}):Q(r,t.length)},I:function(e,t,n){const s=Gf(e);return t==="Io"?n.ordinalNumber(s,{unit:"week"}):Q(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=Wf(e);return t==="Do"?n.ordinalNumber(s,{unit:"dayOfYear"}):Q(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 Q(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 Q(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 Q(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=ut.noon:s===0?r=ut.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=ut.evening:s>=12?r=ut.afternoon:s>=4?r=ut.morning:r=ut.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"}):Q(s,t.length)},k:function(e,t,n){let s=e.getHours();return s===0&&(s=24),t==="ko"?n.ordinalNumber(s,{unit:"hour"}):Q(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 Ho(s);case"XXXX":case"XX":return Ke(s);case"XXXXX":case"XXX":default:return Ke(s,":")}},x:function(e,t,n){const s=e.getTimezoneOffset();switch(t){case"x":return Ho(s);case"xxxx":case"xx":return Ke(s);case"xxxxx":case"xxx":default:return Ke(s,":")}},O:function(e,t,n){const s=e.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+Vo(s,":");case"OOOO":default:return"GMT"+Ke(s,":")}},z:function(e,t,n){const s=e.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+Vo(s,":");case"zzzz":default:return"GMT"+Ke(s,":")}},t:function(e,t,n){const s=Math.trunc(+e/1e3);return Q(s,t.length)},T:function(e,t,n){return Q(+e,t.length)}};function Vo(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+Q(o,2)}function Ho(e,t){return e%60===0?(e>0?"-":"+")+Q(Math.abs(e)/60,2):Ke(e,t)}function Ke(e,t=""){const n=e>0?"-":"+",s=Math.abs(e),r=Q(Math.trunc(s/60),2),o=Q(s%60,2);return n+r+t+o}const _o=(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"})}},Ji=(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"})}},Qf=(e,t)=>{const n=e.match(/(P+)(p+)?/)||[],s=n[1],r=n[2];if(!r)return _o(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}}",_o(s,t)).replace("{{time}}",Ji(r,t))},Kf={p:Ji,P:Qf},Jf=/^D+$/,Xf=/^Y+$/,Zf=["D","DD","YY","YYYY"];function e0(e){return Jf.test(e)}function t0(e){return Xf.test(e)}function n0(e,t,n){const s=r0(e,t,n);if(console.warn(s),Zf.includes(e))throw new RangeError(s)}function r0(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 s0=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,o0=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,a0=/^'([^]*?)'?$/,i0=/''/g,c0=/[a-zA-Z]/;function Zn(e,t,n){const s=gn(),r=s.locale??Qi,o=s.firstWeekContainsDate??s.locale?.options?.firstWeekContainsDate??1,a=s.weekStartsOn??s.locale?.options?.weekStartsOn??0,i=ae(e,n?.in);if(!nf(i))throw new RangeError("Invalid time value");let c=t.match(o0).map(d=>{const f=d[0];if(f==="p"||f==="P"){const h=Kf[f];return h(d,r.formatLong)}return d}).join("").match(s0).map(d=>{if(d==="''")return{isToken:!1,value:"'"};const f=d[0];if(f==="'")return{isToken:!1,value:l0(d)};if(Bo[f])return{isToken:!0,value:d};if(f.match(c0))throw new RangeError("Format string contains an unescaped latin alphabet character `"+f+"`");return{isToken:!1,value:d}});r.localize.preprocessor&&(c=r.localize.preprocessor(i,c));const l={firstWeekContainsDate:o,weekStartsOn:a,locale:r};return c.map(d=>{if(!d.isToken)return d.value;const f=d.value;(t0(f)||e0(f))&&n0(f,t,String(e));const h=Bo[f[0]];return h(i,f,r.localize,l)}).join("")}function l0(e){const t=e.match(a0);return t?t[1].replace(i0,"'"):e}function u0(e,t,n){const s=gn(),r=n?.locale??s.locale??Qi,o=2520,a=Vn(e,t);if(isNaN(a))throw new RangeError("Invalid time value");const i=Object.assign({},n,{addSuffix:n?.addSuffix,comparison:a}),[c,l]=pr(n?.in,...a>0?[t,e]:[e,t]),d=df(l,c),f=(Xn(l)-Xn(c))/1e3,h=Math.round((d-f)/60);let p;if(h<2)return n?.includeSeconds?d<5?r.formatDistance("lessThanXSeconds",5,i):d<10?r.formatDistance("lessThanXSeconds",10,i):d<20?r.formatDistance("lessThanXSeconds",20,i):d<40?r.formatDistance("halfAMinute",0,i):d<60?r.formatDistance("lessThanXMinutes",1,i):r.formatDistance("xMinutes",1,i):h===0?r.formatDistance("lessThanXMinutes",1,i):r.formatDistance("xMinutes",h,i);if(h<45)return r.formatDistance("xMinutes",h,i);if(h<90)return r.formatDistance("aboutXHours",1,i);if(h<$o){const m=Math.round(h/60);return r.formatDistance("aboutXHours",m,i)}else{if(h<o)return r.formatDistance("xDays",1,i);if(h<On){const m=Math.round(h/$o);return r.formatDistance("xDays",m,i)}else if(h<On*2)return p=Math.round(h/On),r.formatDistance("aboutXMonths",p,i)}if(p=uf(l,c),p<12){const m=Math.round(h/On);return r.formatDistance("xMonths",m,i)}else{const m=p%12,g=Math.trunc(p/12);return m<3?r.formatDistance("aboutXYears",g,i):m<9?r.formatDistance("overXYears",g,i):r.formatDistance("almostXYears",g+1,i)}}function d0(e,t){return u0(e,ef(e),t)}function f0(e,t){const n=()=>Te(t?.in,NaN),r=g0(e);let o;if(r.date){const l=b0(r.date,2);o=v0(l.restDateString,l.year)}if(!o||isNaN(+o))return n();const a=+o;let i=0,c;if(r.time&&(i=y0(r.time),isNaN(i)))return n();if(r.timezone){if(c=x0(r.timezone),isNaN(c))return n()}else{const l=new Date(a+i),d=ae(0,t?.in);return d.setFullYear(l.getUTCFullYear(),l.getUTCMonth(),l.getUTCDate()),d.setHours(l.getUTCHours(),l.getUTCMinutes(),l.getUTCSeconds(),l.getUTCMilliseconds()),d}return ae(a+i+c,t?.in)}const jn={dateTimeDelimiter:/[T ]/,timeZoneDelimiter:/[Z ]/i,timezone:/([Z+-].*)$/},h0=/^-?(?:(\d{3})|(\d{2})(?:-?(\d{2}))?|W(\d{2})(?:-?(\d{1}))?|)$/,p0=/^(\d{2}(?:[.,]\d*)?)(?::?(\d{2}(?:[.,]\d*)?))?(?::?(\d{2}(?:[.,]\d*)?))?$/,m0=/^([+-])(\d{2})(?::?(\d{2}))?$/;function g0(e){const t={},n=e.split(jn.dateTimeDelimiter);let s;if(n.length>2)return t;if(/:/.test(n[0])?s=n[0]:(t.date=n[0],s=n[1],jn.timeZoneDelimiter.test(t.date)&&(t.date=e.split(jn.timeZoneDelimiter)[0],s=e.substr(t.date.length,e.length))),s){const r=jn.timezone.exec(s);r?(t.time=s.replace(r[1],""),t.timezone=r[1]):t.time=s}return t}function b0(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 v0(e,t){if(t===null)return new Date(NaN);const n=e.match(h0);if(!n)return new Date(NaN);const s=!!n[4],r=Tt(n[1]),o=Tt(n[2])-1,a=Tt(n[3]),i=Tt(n[4]),c=Tt(n[5])-1;if(s)return P0(t,i,c)?w0(t,i,c):new Date(NaN);{const l=new Date(0);return!S0(t,o,a)||!E0(t,r)?new Date(NaN):(l.setUTCFullYear(t,o,Math.max(r,a)),l)}}function Tt(e){return e?parseInt(e):1}function y0(e){const t=e.match(p0);if(!t)return NaN;const n=Mr(t[1]),s=Mr(t[2]),r=Mr(t[3]);return O0(n,s,r)?n*qi+s*Gi+r*1e3:NaN}function Mr(e){return e&&parseFloat(e.replace(",","."))||0}function x0(e){if(e==="Z")return 0;const t=e.match(m0);if(!t)return 0;const n=t[1]==="+"?-1:1,s=parseInt(t[2]),r=t[3]&&parseInt(t[3])||0;return j0(s,r)?n*(s*qi+r*Gi):NaN}function w0(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 C0=[31,null,31,30,31,30,31,31,30,31,30,31];function Xi(e){return e%400===0||e%4===0&&e%100!==0}function S0(e,t,n){return t>=0&&t<=11&&n>=1&&n<=(C0[t]||(Xi(e)?29:28))}function E0(e,t){return t>=1&&t<=(Xi(e)?366:365)}function P0(e,t,n){return t>=1&&t<=53&&n>=0&&n<=6}function O0(e,t,n){return e===24?t===0&&n===0:n>=0&&n<60&&t>=0&&t<60&&e>=0&&e<25}function j0(e,t){return t>=0&&t<=59}var Tr,Wo;function I0(){if(Wo)return Tr;Wo=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,i=parseInt,c=typeof Pn=="object"&&Pn&&Pn.Object===Object&&Pn,l=typeof self=="object"&&self&&self.Object===Object&&self,d=c||l||Function("return this")(),f=Object.prototype,h=f.toString,p=Math.max,m=Math.min,g=function(){return d.Date.now()};function v(w,E,S){var P,j,M,A,R,k,z=0,$=!1,B=!1,G=!0;if(typeof w!="function")throw new TypeError(e);E=O(E)||0,x(S)&&($=!!S.leading,B="maxWait"in S,M=B?p(O(S.maxWait)||0,E):M,G="trailing"in S?!!S.trailing:G);function q(V){var se=P,Oe=j;return P=j=void 0,z=V,A=w.apply(Oe,se),A}function ee(V){return z=V,R=setTimeout(U,E),$?q(V):A}function ne(V){var se=V-k,Oe=V-z,En=E-se;return B?m(En,M-Oe):En}function ie(V){var se=V-k,Oe=V-z;return k===void 0||se>=E||se<0||B&&Oe>=M}function U(){var V=g();if(ie(V))return Y(V);R=setTimeout(U,ne(V))}function Y(V){return R=void 0,G&&P?q(V):(P=j=void 0,A)}function X(){R!==void 0&&clearTimeout(R),z=0,P=k=j=R=void 0}function re(){return R===void 0?A:Y(g())}function Z(){var V=g(),se=ie(V);if(P=arguments,j=this,k=V,se){if(R===void 0)return ee(k);if(B)return R=setTimeout(U,E),q(k)}return R===void 0&&(R=setTimeout(U,E)),A}return Z.cancel=X,Z.flush=re,Z}function x(w){var E=typeof w;return!!w&&(E=="object"||E=="function")}function y(w){return!!w&&typeof w=="object"}function C(w){return typeof w=="symbol"||y(w)&&h.call(w)==n}function O(w){if(typeof w=="number")return w;if(C(w))return t;if(x(w)){var E=typeof w.valueOf=="function"?w.valueOf():w;w=x(E)?E+"":E}if(typeof w!="string")return w===0?w:+w;w=w.replace(s,"");var S=o.test(w);return S||a.test(w)?i(w.slice(2),S?2:8):r.test(w)?t:+w}return Tr=v,Tr}var N0=I0();const Go=Di(N0);var Zi=typeof window<"u"?b.useLayoutEffect:b.useEffect;function ec(e,t,n,s){const r=b.useRef(t);Zi(()=>{r.current=t},[t]),b.useEffect(()=>{const o=window;if(!(o&&o.addEventListener))return;const a=i=>{r.current(i)};return o.addEventListener(e,a,s),()=>{o.removeEventListener(e,a,s)}},[e,n,s])}function mr(){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 M0=typeof window>"u";function B6(e,{defaultValue:t=!1,initializeWithValue:n=!0}={}){const s=i=>M0?t:window.matchMedia(i).matches,[r,o]=b.useState(()=>n?s(e):t);function a(){o(s(e))}return Zi(()=>{const i=window.matchMedia(e);return a(),i.addListener?i.addListener(a):i.addEventListener("change",a),()=>{i.removeListener?i.removeListener(a):i.removeEventListener("change",a)}},[e]),r}function T0(e){const t=b.useRef(e);t.current=e,b.useEffect(()=>()=>{t.current()},[])}function A0(e,t=500,n){const s=b.useRef();T0(()=>{s.current&&s.current.cancel()});const r=b.useMemo(()=>{const o=Go(e,t,n),a=(...i)=>o(...i);return a.cancel=()=>{o.cancel()},a.isPending=()=>!!s.current,a.flush=()=>o.flush(),a},[e,t,n]);return b.useEffect(()=>{s.current=Go(e,t,n)},[e,t,n]),r}function R0(e,t,n){const s=((l,d)=>l===d),r=e instanceof Function?e():e,[o,a]=b.useState(r),i=b.useRef(r),c=A0(a,t,n);return s(i.current,r)||(c(r),i.current=r),[o,c]}function D0(e,t,n="mousedown",s={}){ec(n,r=>{const o=r.target;if(!o||!o.isConnected)return;(Array.isArray(e)?e.filter(i=>!!i.current).every(i=>i.current&&!i.current.contains(o)):e.current&&!e.current.contains(o))&&t(r)},void 0,s)}const tc=({children:e,content:t})=>u.jsxs(xd,{children:[u.jsx(wd,{asChild:!0,children:u.jsx("button",{type:"button","aria-label":"Open Account",className:"cursor-pointer",children:e})}),u.jsx(Cd,{className:"w-52 p-0",align:"start",children:t})]}),k0="/assets/connect-loader-CvOC68Ih.mp4";function L0(e){const{style:t,size:n=100,...s}=e,r=Zu(n),o={objectFit:"contain",pointerEvents:"none",...r,...t},a=r.width?.replace("px",""),i=r.height?.replace("px","");return u.jsx("video",{autoPlay:!0,height:i,loop:!0,muted:!0,playsInline:!0,width:a,...s,style:o,children:u.jsx("source",{src:k0,type:"video/mp4"})})}function qs(e){const{onSubmit:t,onCancel:n,defaultValue:s,className:r,minLength:o=1,...a}=e,[i,c]=b.useState(s??""),l=b.useRef(null);D0(l,d),ec("keyup",f=>{f.key==="Enter"&&d(),f.key==="Escape"&&n()}),b.useLayoutEffect(()=>{setTimeout(()=>{l.current?.focus(),l.current?.select(),l.current?.scroll({left:9999})},100)},[]);function d(){i.length>=o&&t(i)}return u.jsx("input",{...a,autoFocus:!0,className:N("bg-inherit text-inherit outline-none",r),minLength:o,onChange:f=>c(f.target.value),ref:l,required:!0,type:"text",value:i})}function V6(){const{isAllowedToCreateDocuments:e}=Bs(),[t]=Pi(),n=Oi(),s=Tu(),[r,o]=b.useState(!1);function a(){o(!0)}function i(f){!e||!n||Ru(n,f,s.at(-1)?.id).then(h=>{vt(h)}).catch(h=>{console.error(h)}).finally(()=>{o(!1)})}function c(){o(!1)}const l=!!t,d=!!s.length;return u.jsxs("div",{className:"flex h-9 flex-row items-center gap-2 p-6 text-gray-500",children:[l&&u.jsxs(u.Fragment,{children:[u.jsx(qo,{name:t.state.global.name,onClick:()=>Au(t)}),u.jsx("span",{children:"/"})]}),d&&s.map(f=>u.jsxs(b.Fragment,{children:[u.jsx(qo,{name:f.name,onClick:()=>vt(f)}),u.jsx("span",{children:"/"})]},f.id)),e&&(r?u.jsx(qs,{className:"text-gray-800",defaultValue:"New Folder",onCancel:c,onSubmit:i,placeholder:"New Folder"}):u.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:[u.jsx(I,{name:"Plus",size:14}),"Add new"]}))]})}function qo(e){const{name:t,onClick:n}=e;return u.jsx("div",{className:"transition-colors last-of-type:text-gray-800 hover:text-gray-800",onClick:n,role:"button",children:t})}function rt(e){"@babel/helpers - typeof";return rt=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},rt(e)}function F0(e,t){if(rt(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var s=n.call(e,t);if(rt(s)!="object")return s;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function nc(e){var t=F0(e,"string");return rt(t)=="symbol"?t:t+""}function Lt(e,t,n){return(t=nc(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Yo(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 L(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Yo(Object(n),!0).forEach(function(s){Lt(e,s,n[s])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Yo(Object(n)).forEach(function(s){Object.defineProperty(e,s,Object.getOwnPropertyDescriptor(n,s))})}return e}function $0(e){if(Array.isArray(e))return e}function z0(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var s,r,o,a,i=[],c=!0,l=!1;try{if(o=(n=n.call(e)).next,t===0){if(Object(n)!==n)return;c=!1}else for(;!(c=(s=o.call(n)).done)&&(i.push(s.value),i.length!==t);c=!0);}catch(d){l=!0,r=d}finally{try{if(!c&&n.return!=null&&(a=n.return(),Object(a)!==a))return}finally{if(l)throw r}}return i}}function ts(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 rc(e,t){if(e){if(typeof e=="string")return ts(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)?ts(e,t):void 0}}function U0(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
1
|
+
import{j as u,u as Ci,r as Si,C as Ei,b as Us,a as Ve}from"./document_model_editor-7tmqOIHK.js";import{r as b,R as ko,a as W}from"./sentry_react-cODD7zWc.js";import{b as Bs,c as Pi,d as Oi,e as Tu,s as Au,f as vt,g as Ru,h as Du,i as ku,j as Lu,k as Fu,l as $u,m as zu,n as Uu,o as Vs,p as Bu,q as Vu,r as Hu,t as _u,v as ji,w as Wu}from"./reactor_browser-D8KSw52x.js";import{P as Et,a as Ii,b as Ni,u as Mi,d as Ti,R as Gu,A as qu,e as ke,f as Hs,g as Yu,D as Qu,C as Ku,h as Ju,i as Xu,j as Zu,I,k as ed,m as ce,l as Pe,M as Ye,n as td,o as nd,p as rd,q as sd,r as od,s as Ai,t as ad,v as id,c as Ri,w as cd,x as ld,S as ud,y as dd,z as fd,B as hd}from"./design_system-DnTVxPr0.js";import{t as N,a as _s}from"./tailwind_merge-Dr4f9Rms.js";import{a3 as pd,a4 as md,$ as Lo,n as gd,s as bd}from"./document_model-DXcLJEjZ.js";import{c as Pn,g as Di}from"./react-DQSxOgtG.js";import{o as Xr,p as vd}from"./document_drive-BEIKnuGM.js";import{o as yd,r as Fo,s as It}from"./zod-C6yxFxyo.js";import{P as xd,a as wd,b as Cd,S as ki,I as Sd,c as Ed}from"./design_system_ui-Bqq8Fu01.js";import{_ as Pd}from"./drive_explorer-DzIBsVp8.js";var Od=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"}),jd="VisuallyHidden",Li=b.forwardRef((e,t)=>u.jsx(Et.span,{...e,ref:t,style:{...Od,...e.style}}));Li.displayName=jd;var Id=Li,[fr]=Ii("Tooltip",[Ni]),hr=Ni(),Fi="TooltipProvider",Nd=700,Zr="tooltip.open",[Md,Ws]=fr(Fi),$i=e=>{const{__scopeTooltip:t,delayDuration:n=Nd,skipDelayDuration:s=300,disableHoverableContent:r=!1,children:o}=e,a=b.useRef(!0),i=b.useRef(!1),c=b.useRef(0);return b.useEffect(()=>{const l=c.current;return()=>window.clearTimeout(l)},[]),u.jsx(Md,{scope:t,isOpenDelayedRef:a,delayDuration:n,onOpen:b.useCallback(()=>{window.clearTimeout(c.current),a.current=!1},[]),onClose:b.useCallback(()=>{window.clearTimeout(c.current),c.current=window.setTimeout(()=>a.current=!0,s)},[s]),isPointerInTransitRef:i,onPointerInTransitChange:b.useCallback(l=>{i.current=l},[]),disableHoverableContent:r,children:o})};$i.displayName=Fi;var $t="Tooltip",[Td,mn]=fr($t),zi=e=>{const{__scopeTooltip:t,children:n,open:s,defaultOpen:r,onOpenChange:o,disableHoverableContent:a,delayDuration:i}=e,c=Ws($t,e.__scopeTooltip),l=hr(t),[d,f]=b.useState(null),h=Mi(),p=b.useRef(0),m=a??c.disableHoverableContent,g=i??c.delayDuration,v=b.useRef(!1),[x,y]=Ti({prop:s,defaultProp:r??!1,onChange:S=>{S?(c.onOpen(),document.dispatchEvent(new CustomEvent(Zr))):c.onClose(),o?.(S)},caller:$t}),C=b.useMemo(()=>x?v.current?"delayed-open":"instant-open":"closed",[x]),O=b.useCallback(()=>{window.clearTimeout(p.current),p.current=0,v.current=!1,y(!0)},[y]),w=b.useCallback(()=>{window.clearTimeout(p.current),p.current=0,y(!1)},[y]),E=b.useCallback(()=>{window.clearTimeout(p.current),p.current=window.setTimeout(()=>{v.current=!0,y(!0),p.current=0},g)},[g,y]);return b.useEffect(()=>()=>{p.current&&(window.clearTimeout(p.current),p.current=0)},[]),u.jsx(Gu,{...l,children:u.jsx(Td,{scope:t,contentId:h,open:x,stateAttribute:C,trigger:d,onTriggerChange:f,onTriggerEnter:b.useCallback(()=>{c.isOpenDelayedRef.current?E():O()},[c.isOpenDelayedRef,E,O]),onTriggerLeave:b.useCallback(()=>{m?w():(window.clearTimeout(p.current),p.current=0)},[w,m]),onOpen:O,onClose:w,disableHoverableContent:m,children:n})})};zi.displayName=$t;var es="TooltipTrigger",Ui=b.forwardRef((e,t)=>{const{__scopeTooltip:n,...s}=e,r=mn(es,n),o=Ws(es,n),a=hr(n),i=b.useRef(null),c=Ci(t,i,r.onTriggerChange),l=b.useRef(!1),d=b.useRef(!1),f=b.useCallback(()=>l.current=!1,[]);return b.useEffect(()=>()=>document.removeEventListener("pointerup",f),[f]),u.jsx(qu,{asChild:!0,...a,children:u.jsx(Et.button,{"aria-describedby":r.open?r.contentId:void 0,"data-state":r.stateAttribute,...s,ref:c,onPointerMove:ke(e.onPointerMove,h=>{h.pointerType!=="touch"&&!d.current&&!o.isPointerInTransitRef.current&&(r.onTriggerEnter(),d.current=!0)}),onPointerLeave:ke(e.onPointerLeave,()=>{r.onTriggerLeave(),d.current=!1}),onPointerDown:ke(e.onPointerDown,()=>{r.open&&r.onClose(),l.current=!0,document.addEventListener("pointerup",f,{once:!0})}),onFocus:ke(e.onFocus,()=>{l.current||r.onOpen()}),onBlur:ke(e.onBlur,r.onClose),onClick:ke(e.onClick,r.onClose)})})});Ui.displayName=es;var Gs="TooltipPortal",[Ad,Rd]=fr(Gs,{forceMount:void 0}),Bi=e=>{const{__scopeTooltip:t,forceMount:n,children:s,container:r}=e,o=mn(Gs,t);return u.jsx(Ad,{scope:t,forceMount:n,children:u.jsx(Hs,{present:n||o.open,children:u.jsx(Yu,{asChild:!0,container:r,children:s})})})};Bi.displayName=Gs;var yt="TooltipContent",Vi=b.forwardRef((e,t)=>{const n=Rd(yt,e.__scopeTooltip),{forceMount:s=n.forceMount,side:r="top",...o}=e,a=mn(yt,e.__scopeTooltip);return u.jsx(Hs,{present:s||a.open,children:a.disableHoverableContent?u.jsx(Hi,{side:r,...o,ref:t}):u.jsx(Dd,{side:r,...o,ref:t})})}),Dd=b.forwardRef((e,t)=>{const n=mn(yt,e.__scopeTooltip),s=Ws(yt,e.__scopeTooltip),r=b.useRef(null),o=Ci(t,r),[a,i]=b.useState(null),{trigger:c,onClose:l}=n,d=r.current,{onPointerInTransitChange:f}=s,h=b.useCallback(()=>{i(null),f(!1)},[f]),p=b.useCallback((m,g)=>{const v=m.currentTarget,x={x:m.clientX,y:m.clientY},y=zd(x,v.getBoundingClientRect()),C=Ud(x,y),O=Bd(g.getBoundingClientRect()),w=Hd([...C,...O]);i(w),f(!0)},[f]);return b.useEffect(()=>()=>h(),[h]),b.useEffect(()=>{if(c&&d){const m=v=>p(v,d),g=v=>p(v,c);return c.addEventListener("pointerleave",m),d.addEventListener("pointerleave",g),()=>{c.removeEventListener("pointerleave",m),d.removeEventListener("pointerleave",g)}}},[c,d,p,h]),b.useEffect(()=>{if(a){const m=g=>{const v=g.target,x={x:g.clientX,y:g.clientY},y=c?.contains(v)||d?.contains(v),C=!Vd(x,a);y?h():C&&(h(),l())};return document.addEventListener("pointermove",m),()=>document.removeEventListener("pointermove",m)}},[c,d,a,l,h]),u.jsx(Hi,{...e,ref:o})}),[kd,Ld]=fr($t,{isInside:!1}),Fd=Ju("TooltipContent"),Hi=b.forwardRef((e,t)=>{const{__scopeTooltip:n,children:s,"aria-label":r,onEscapeKeyDown:o,onPointerDownOutside:a,...i}=e,c=mn(yt,n),l=hr(n),{onClose:d}=c;return b.useEffect(()=>(document.addEventListener(Zr,d),()=>document.removeEventListener(Zr,d)),[d]),b.useEffect(()=>{if(c.trigger){const f=h=>{h.target?.contains(c.trigger)&&d()};return window.addEventListener("scroll",f,{capture:!0}),()=>window.removeEventListener("scroll",f,{capture:!0})}},[c.trigger,d]),u.jsx(Qu,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:o,onPointerDownOutside:a,onFocusOutside:f=>f.preventDefault(),onDismiss:d,children:u.jsxs(Ku,{"data-state":c.stateAttribute,...l,...i,ref:t,style:{...i.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:[u.jsx(Fd,{children:s}),u.jsx(kd,{scope:n,isInside:!0,children:u.jsx(Id,{id:c.contentId,role:"tooltip",children:r||s})})]})})});Vi.displayName=yt;var _i="TooltipArrow",$d=b.forwardRef((e,t)=>{const{__scopeTooltip:n,...s}=e,r=hr(n);return Ld(_i,n).isInside?null:u.jsx(Xu,{...r,...s,ref:t})});$d.displayName=_i;function zd(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 Ud(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 Bd(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 Vd(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 i=t[o],c=t[a],l=i.x,d=i.y,f=c.x,h=c.y;d>s!=h>s&&n<(f-l)*(s-d)/(h-d)+l&&(r=!r)}return r}function Hd(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),_d(t)}function _d(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 Wd=$i,Gd=zi,qd=Ui,Yd=Bi,Qd=Vi;const Wi=6048e5,Kd=864e5,Gi=6e4,qi=36e5,On=43200,$o=1440,zo=Symbol.for("constructDateFrom");function Te(e,t){return typeof e=="function"?e(t):e&&typeof e=="object"&&zo in e?e[zo](t):e instanceof Date?new e.constructor(t):new Date(t)}function ae(e,t){return Te(t||e,e)}let Jd={};function gn(){return Jd}function zt(e,t){const n=gn(),s=t?.weekStartsOn??t?.locale?.options?.weekStartsOn??n.weekStartsOn??n.locale?.options?.weekStartsOn??0,r=ae(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 Jn(e,t){return zt(e,{...t,weekStartsOn:1})}function Yi(e,t){const n=ae(e,t?.in),s=n.getFullYear(),r=Te(n,0);r.setFullYear(s+1,0,4),r.setHours(0,0,0,0);const o=Jn(r),a=Te(n,0);a.setFullYear(s,0,4),a.setHours(0,0,0,0);const i=Jn(a);return n.getTime()>=o.getTime()?s+1:n.getTime()>=i.getTime()?s:s-1}function Xn(e){const t=ae(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 pr(e,...t){const n=Te.bind(null,e||t.find(s=>typeof s=="object"));return t.map(n)}function Uo(e,t){const n=ae(e,t?.in);return n.setHours(0,0,0,0),n}function Xd(e,t,n){const[s,r]=pr(n?.in,e,t),o=Uo(s),a=Uo(r),i=+o-Xn(o),c=+a-Xn(a);return Math.round((i-c)/Kd)}function Zd(e,t){const n=Yi(e,t),s=Te(e,0);return s.setFullYear(n,0,4),s.setHours(0,0,0,0),Jn(s)}function Vn(e,t){const n=+ae(e)-+ae(t);return n<0?-1:n>0?1:n}function ef(e){return Te(e,Date.now())}function tf(e){return e instanceof Date||typeof e=="object"&&Object.prototype.toString.call(e)==="[object Date]"}function nf(e){return!(!tf(e)&&typeof e!="number"||isNaN(+ae(e)))}function rf(e,t,n){const[s,r]=pr(n?.in,e,t),o=s.getFullYear()-r.getFullYear(),a=s.getMonth()-r.getMonth();return o*12+a}function sf(e){return t=>{const s=(e?Math[e]:Math.trunc)(t);return s===0?0:s}}function of(e,t){return+ae(e)-+ae(t)}function af(e,t){const n=ae(e,t?.in);return n.setHours(23,59,59,999),n}function cf(e,t){const n=ae(e,t?.in),s=n.getMonth();return n.setFullYear(n.getFullYear(),s+1,0),n.setHours(23,59,59,999),n}function lf(e,t){const n=ae(e,t?.in);return+af(n,t)==+cf(n,t)}function uf(e,t,n){const[s,r,o]=pr(n?.in,e,e,t),a=Vn(r,o),i=Math.abs(rf(r,o));if(i<1)return 0;r.getMonth()===1&&r.getDate()>27&&r.setDate(30),r.setMonth(r.getMonth()-a*i);let c=Vn(r,o)===-a;lf(s)&&i===1&&Vn(s,o)===1&&(c=!1);const l=a*(i-+c);return l===0?0:l}function df(e,t,n){const s=of(e,t)/1e3;return sf(n?.roundingMethod)(s)}function ff(e,t){const n=ae(e,t?.in);return n.setFullYear(n.getFullYear(),0,1),n.setHours(0,0,0,0),n}const hf={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"}},pf=(e,t,n)=>{let s;const r=hf[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 mf={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},gf={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},bf={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},vf={date:Nr({formats:mf,defaultWidth:"full"}),time:Nr({formats:gf,defaultWidth:"full"}),dateTime:Nr({formats:bf,defaultWidth:"full"})},yf={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},xf=(e,t,n,s)=>yf[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,i=n?.width?String(n.width):a;r=e.formattingValues[i]||e.formattingValues[a]}else{const a=e.defaultWidth,i=n?.width?String(n.width):e.defaultWidth;r=e.values[i]||e.values[a]}const o=e.argumentCallback?e.argumentCallback(t):t;return r[o]}}const wf={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},Cf={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},Sf={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"]},Ef={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"]},Pf={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"}},Of={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"}},jf=(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"},If={ordinalNumber:jf,era:Nt({values:wf,defaultWidth:"wide"}),quarter:Nt({values:Cf,defaultWidth:"wide",argumentCallback:e=>e-1}),month:Nt({values:Sf,defaultWidth:"wide"}),day:Nt({values:Ef,defaultWidth:"wide"}),dayPeriod:Nt({values:Pf,defaultWidth:"wide",formattingValues:Of,defaultFormattingWidth:"wide"})};function Mt(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],i=s&&e.parsePatterns[s]||e.parsePatterns[e.defaultParseWidth],c=Array.isArray(i)?Mf(i,f=>f.test(a)):Nf(i,f=>f.test(a));let l;l=e.valueCallback?e.valueCallback(c):c,l=n.valueCallback?n.valueCallback(l):l;const d=t.slice(a.length);return{value:l,rest:d}}}function Nf(e,t){for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&t(e[n]))return n}function Mf(e,t){for(let n=0;n<e.length;n++)if(t(e[n]))return n}function Tf(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 i=t.slice(r.length);return{value:a,rest:i}}}const Af=/^(\d+)(th|st|nd|rd)?/i,Rf=/\d+/i,Df={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},kf={any:[/^b/i,/^(a|c)/i]},Lf={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},Ff={any:[/1/i,/2/i,/3/i,/4/i]},$f={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},zf={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]},Uf={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},Bf={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]},Vf={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},Hf={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}},_f={ordinalNumber:Tf({matchPattern:Af,parsePattern:Rf,valueCallback:e=>parseInt(e,10)}),era:Mt({matchPatterns:Df,defaultMatchWidth:"wide",parsePatterns:kf,defaultParseWidth:"any"}),quarter:Mt({matchPatterns:Lf,defaultMatchWidth:"wide",parsePatterns:Ff,defaultParseWidth:"any",valueCallback:e=>e+1}),month:Mt({matchPatterns:$f,defaultMatchWidth:"wide",parsePatterns:zf,defaultParseWidth:"any"}),day:Mt({matchPatterns:Uf,defaultMatchWidth:"wide",parsePatterns:Bf,defaultParseWidth:"any"}),dayPeriod:Mt({matchPatterns:Vf,defaultMatchWidth:"any",parsePatterns:Hf,defaultParseWidth:"any"})},Qi={code:"en-US",formatDistance:pf,formatLong:vf,formatRelative:xf,localize:If,match:_f,options:{weekStartsOn:0,firstWeekContainsDate:1}};function Wf(e,t){const n=ae(e,t?.in);return Xd(n,ff(n))+1}function Gf(e,t){const n=ae(e,t?.in),s=+Jn(n)-+Zd(n);return Math.round(s/Wi)+1}function Ki(e,t){const n=ae(e,t?.in),s=n.getFullYear(),r=gn(),o=t?.firstWeekContainsDate??t?.locale?.options?.firstWeekContainsDate??r.firstWeekContainsDate??r.locale?.options?.firstWeekContainsDate??1,a=Te(t?.in||e,0);a.setFullYear(s+1,0,o),a.setHours(0,0,0,0);const i=zt(a,t),c=Te(t?.in||e,0);c.setFullYear(s,0,o),c.setHours(0,0,0,0);const l=zt(c,t);return+n>=+i?s+1:+n>=+l?s:s-1}function qf(e,t){const n=gn(),s=t?.firstWeekContainsDate??t?.locale?.options?.firstWeekContainsDate??n.firstWeekContainsDate??n.locale?.options?.firstWeekContainsDate??1,r=Ki(e,t),o=Te(t?.in||e,0);return o.setFullYear(r,0,s),o.setHours(0,0,0,0),zt(o,t)}function Yf(e,t){const n=ae(e,t?.in),s=+zt(n,t)-+qf(n,t);return Math.round(s/Wi)+1}function Q(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 Q(t==="yy"?s%100:s,t.length)},M(e,t){const n=e.getMonth();return t==="M"?String(n+1):Q(n+1,2)},d(e,t){return Q(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 Q(e.getHours()%12||12,t.length)},H(e,t){return Q(e.getHours(),t.length)},m(e,t){return Q(e.getMinutes(),t.length)},s(e,t){return Q(e.getSeconds(),t.length)},S(e,t){const n=t.length,s=e.getMilliseconds(),r=Math.trunc(s*Math.pow(10,n-3));return Q(r,t.length)}},ut={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},Bo={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 Q(a,2)}return t==="Yo"?n.ordinalNumber(o,{unit:"year"}):Q(o,t.length)},R:function(e,t){const n=Yi(e);return Q(n,t.length)},u:function(e,t){const n=e.getFullYear();return Q(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 Q(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 Q(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 Q(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=Yf(e,s);return t==="wo"?n.ordinalNumber(r,{unit:"week"}):Q(r,t.length)},I:function(e,t,n){const s=Gf(e);return t==="Io"?n.ordinalNumber(s,{unit:"week"}):Q(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=Wf(e);return t==="Do"?n.ordinalNumber(s,{unit:"dayOfYear"}):Q(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 Q(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 Q(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 Q(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=ut.noon:s===0?r=ut.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=ut.evening:s>=12?r=ut.afternoon:s>=4?r=ut.morning:r=ut.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"}):Q(s,t.length)},k:function(e,t,n){let s=e.getHours();return s===0&&(s=24),t==="ko"?n.ordinalNumber(s,{unit:"hour"}):Q(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 Ho(s);case"XXXX":case"XX":return Ke(s);case"XXXXX":case"XXX":default:return Ke(s,":")}},x:function(e,t,n){const s=e.getTimezoneOffset();switch(t){case"x":return Ho(s);case"xxxx":case"xx":return Ke(s);case"xxxxx":case"xxx":default:return Ke(s,":")}},O:function(e,t,n){const s=e.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+Vo(s,":");case"OOOO":default:return"GMT"+Ke(s,":")}},z:function(e,t,n){const s=e.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+Vo(s,":");case"zzzz":default:return"GMT"+Ke(s,":")}},t:function(e,t,n){const s=Math.trunc(+e/1e3);return Q(s,t.length)},T:function(e,t,n){return Q(+e,t.length)}};function Vo(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+Q(o,2)}function Ho(e,t){return e%60===0?(e>0?"-":"+")+Q(Math.abs(e)/60,2):Ke(e,t)}function Ke(e,t=""){const n=e>0?"-":"+",s=Math.abs(e),r=Q(Math.trunc(s/60),2),o=Q(s%60,2);return n+r+t+o}const _o=(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"})}},Ji=(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"})}},Qf=(e,t)=>{const n=e.match(/(P+)(p+)?/)||[],s=n[1],r=n[2];if(!r)return _o(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}}",_o(s,t)).replace("{{time}}",Ji(r,t))},Kf={p:Ji,P:Qf},Jf=/^D+$/,Xf=/^Y+$/,Zf=["D","DD","YY","YYYY"];function e0(e){return Jf.test(e)}function t0(e){return Xf.test(e)}function n0(e,t,n){const s=r0(e,t,n);if(console.warn(s),Zf.includes(e))throw new RangeError(s)}function r0(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 s0=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,o0=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,a0=/^'([^]*?)'?$/,i0=/''/g,c0=/[a-zA-Z]/;function Zn(e,t,n){const s=gn(),r=s.locale??Qi,o=s.firstWeekContainsDate??s.locale?.options?.firstWeekContainsDate??1,a=s.weekStartsOn??s.locale?.options?.weekStartsOn??0,i=ae(e,n?.in);if(!nf(i))throw new RangeError("Invalid time value");let c=t.match(o0).map(d=>{const f=d[0];if(f==="p"||f==="P"){const h=Kf[f];return h(d,r.formatLong)}return d}).join("").match(s0).map(d=>{if(d==="''")return{isToken:!1,value:"'"};const f=d[0];if(f==="'")return{isToken:!1,value:l0(d)};if(Bo[f])return{isToken:!0,value:d};if(f.match(c0))throw new RangeError("Format string contains an unescaped latin alphabet character `"+f+"`");return{isToken:!1,value:d}});r.localize.preprocessor&&(c=r.localize.preprocessor(i,c));const l={firstWeekContainsDate:o,weekStartsOn:a,locale:r};return c.map(d=>{if(!d.isToken)return d.value;const f=d.value;(t0(f)||e0(f))&&n0(f,t,String(e));const h=Bo[f[0]];return h(i,f,r.localize,l)}).join("")}function l0(e){const t=e.match(a0);return t?t[1].replace(i0,"'"):e}function u0(e,t,n){const s=gn(),r=n?.locale??s.locale??Qi,o=2520,a=Vn(e,t);if(isNaN(a))throw new RangeError("Invalid time value");const i=Object.assign({},n,{addSuffix:n?.addSuffix,comparison:a}),[c,l]=pr(n?.in,...a>0?[t,e]:[e,t]),d=df(l,c),f=(Xn(l)-Xn(c))/1e3,h=Math.round((d-f)/60);let p;if(h<2)return n?.includeSeconds?d<5?r.formatDistance("lessThanXSeconds",5,i):d<10?r.formatDistance("lessThanXSeconds",10,i):d<20?r.formatDistance("lessThanXSeconds",20,i):d<40?r.formatDistance("halfAMinute",0,i):d<60?r.formatDistance("lessThanXMinutes",1,i):r.formatDistance("xMinutes",1,i):h===0?r.formatDistance("lessThanXMinutes",1,i):r.formatDistance("xMinutes",h,i);if(h<45)return r.formatDistance("xMinutes",h,i);if(h<90)return r.formatDistance("aboutXHours",1,i);if(h<$o){const m=Math.round(h/60);return r.formatDistance("aboutXHours",m,i)}else{if(h<o)return r.formatDistance("xDays",1,i);if(h<On){const m=Math.round(h/$o);return r.formatDistance("xDays",m,i)}else if(h<On*2)return p=Math.round(h/On),r.formatDistance("aboutXMonths",p,i)}if(p=uf(l,c),p<12){const m=Math.round(h/On);return r.formatDistance("xMonths",m,i)}else{const m=p%12,g=Math.trunc(p/12);return m<3?r.formatDistance("aboutXYears",g,i):m<9?r.formatDistance("overXYears",g,i):r.formatDistance("almostXYears",g+1,i)}}function d0(e,t){return u0(e,ef(e),t)}function f0(e,t){const n=()=>Te(t?.in,NaN),r=g0(e);let o;if(r.date){const l=b0(r.date,2);o=v0(l.restDateString,l.year)}if(!o||isNaN(+o))return n();const a=+o;let i=0,c;if(r.time&&(i=y0(r.time),isNaN(i)))return n();if(r.timezone){if(c=x0(r.timezone),isNaN(c))return n()}else{const l=new Date(a+i),d=ae(0,t?.in);return d.setFullYear(l.getUTCFullYear(),l.getUTCMonth(),l.getUTCDate()),d.setHours(l.getUTCHours(),l.getUTCMinutes(),l.getUTCSeconds(),l.getUTCMilliseconds()),d}return ae(a+i+c,t?.in)}const jn={dateTimeDelimiter:/[T ]/,timeZoneDelimiter:/[Z ]/i,timezone:/([Z+-].*)$/},h0=/^-?(?:(\d{3})|(\d{2})(?:-?(\d{2}))?|W(\d{2})(?:-?(\d{1}))?|)$/,p0=/^(\d{2}(?:[.,]\d*)?)(?::?(\d{2}(?:[.,]\d*)?))?(?::?(\d{2}(?:[.,]\d*)?))?$/,m0=/^([+-])(\d{2})(?::?(\d{2}))?$/;function g0(e){const t={},n=e.split(jn.dateTimeDelimiter);let s;if(n.length>2)return t;if(/:/.test(n[0])?s=n[0]:(t.date=n[0],s=n[1],jn.timeZoneDelimiter.test(t.date)&&(t.date=e.split(jn.timeZoneDelimiter)[0],s=e.substr(t.date.length,e.length))),s){const r=jn.timezone.exec(s);r?(t.time=s.replace(r[1],""),t.timezone=r[1]):t.time=s}return t}function b0(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 v0(e,t){if(t===null)return new Date(NaN);const n=e.match(h0);if(!n)return new Date(NaN);const s=!!n[4],r=Tt(n[1]),o=Tt(n[2])-1,a=Tt(n[3]),i=Tt(n[4]),c=Tt(n[5])-1;if(s)return P0(t,i,c)?w0(t,i,c):new Date(NaN);{const l=new Date(0);return!S0(t,o,a)||!E0(t,r)?new Date(NaN):(l.setUTCFullYear(t,o,Math.max(r,a)),l)}}function Tt(e){return e?parseInt(e):1}function y0(e){const t=e.match(p0);if(!t)return NaN;const n=Mr(t[1]),s=Mr(t[2]),r=Mr(t[3]);return O0(n,s,r)?n*qi+s*Gi+r*1e3:NaN}function Mr(e){return e&&parseFloat(e.replace(",","."))||0}function x0(e){if(e==="Z")return 0;const t=e.match(m0);if(!t)return 0;const n=t[1]==="+"?-1:1,s=parseInt(t[2]),r=t[3]&&parseInt(t[3])||0;return j0(s,r)?n*(s*qi+r*Gi):NaN}function w0(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 C0=[31,null,31,30,31,30,31,31,30,31,30,31];function Xi(e){return e%400===0||e%4===0&&e%100!==0}function S0(e,t,n){return t>=0&&t<=11&&n>=1&&n<=(C0[t]||(Xi(e)?29:28))}function E0(e,t){return t>=1&&t<=(Xi(e)?366:365)}function P0(e,t,n){return t>=1&&t<=53&&n>=0&&n<=6}function O0(e,t,n){return e===24?t===0&&n===0:n>=0&&n<60&&t>=0&&t<60&&e>=0&&e<25}function j0(e,t){return t>=0&&t<=59}var Tr,Wo;function I0(){if(Wo)return Tr;Wo=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,i=parseInt,c=typeof Pn=="object"&&Pn&&Pn.Object===Object&&Pn,l=typeof self=="object"&&self&&self.Object===Object&&self,d=c||l||Function("return this")(),f=Object.prototype,h=f.toString,p=Math.max,m=Math.min,g=function(){return d.Date.now()};function v(w,E,S){var P,j,M,A,R,k,z=0,$=!1,B=!1,G=!0;if(typeof w!="function")throw new TypeError(e);E=O(E)||0,x(S)&&($=!!S.leading,B="maxWait"in S,M=B?p(O(S.maxWait)||0,E):M,G="trailing"in S?!!S.trailing:G);function q(V){var se=P,Oe=j;return P=j=void 0,z=V,A=w.apply(Oe,se),A}function ee(V){return z=V,R=setTimeout(U,E),$?q(V):A}function ne(V){var se=V-k,Oe=V-z,En=E-se;return B?m(En,M-Oe):En}function ie(V){var se=V-k,Oe=V-z;return k===void 0||se>=E||se<0||B&&Oe>=M}function U(){var V=g();if(ie(V))return Y(V);R=setTimeout(U,ne(V))}function Y(V){return R=void 0,G&&P?q(V):(P=j=void 0,A)}function X(){R!==void 0&&clearTimeout(R),z=0,P=k=j=R=void 0}function re(){return R===void 0?A:Y(g())}function Z(){var V=g(),se=ie(V);if(P=arguments,j=this,k=V,se){if(R===void 0)return ee(k);if(B)return R=setTimeout(U,E),q(k)}return R===void 0&&(R=setTimeout(U,E)),A}return Z.cancel=X,Z.flush=re,Z}function x(w){var E=typeof w;return!!w&&(E=="object"||E=="function")}function y(w){return!!w&&typeof w=="object"}function C(w){return typeof w=="symbol"||y(w)&&h.call(w)==n}function O(w){if(typeof w=="number")return w;if(C(w))return t;if(x(w)){var E=typeof w.valueOf=="function"?w.valueOf():w;w=x(E)?E+"":E}if(typeof w!="string")return w===0?w:+w;w=w.replace(s,"");var S=o.test(w);return S||a.test(w)?i(w.slice(2),S?2:8):r.test(w)?t:+w}return Tr=v,Tr}var N0=I0();const Go=Di(N0);var Zi=typeof window<"u"?b.useLayoutEffect:b.useEffect;function ec(e,t,n,s){const r=b.useRef(t);Zi(()=>{r.current=t},[t]),b.useEffect(()=>{const o=window;if(!(o&&o.addEventListener))return;const a=i=>{r.current(i)};return o.addEventListener(e,a,s),()=>{o.removeEventListener(e,a,s)}},[e,n,s])}function mr(){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 M0=typeof window>"u";function B6(e,{defaultValue:t=!1,initializeWithValue:n=!0}={}){const s=i=>M0?t:window.matchMedia(i).matches,[r,o]=b.useState(()=>n?s(e):t);function a(){o(s(e))}return Zi(()=>{const i=window.matchMedia(e);return a(),i.addListener?i.addListener(a):i.addEventListener("change",a),()=>{i.removeListener?i.removeListener(a):i.removeEventListener("change",a)}},[e]),r}function T0(e){const t=b.useRef(e);t.current=e,b.useEffect(()=>()=>{t.current()},[])}function A0(e,t=500,n){const s=b.useRef();T0(()=>{s.current&&s.current.cancel()});const r=b.useMemo(()=>{const o=Go(e,t,n),a=(...i)=>o(...i);return a.cancel=()=>{o.cancel()},a.isPending=()=>!!s.current,a.flush=()=>o.flush(),a},[e,t,n]);return b.useEffect(()=>{s.current=Go(e,t,n)},[e,t,n]),r}function R0(e,t,n){const s=((l,d)=>l===d),r=e instanceof Function?e():e,[o,a]=b.useState(r),i=b.useRef(r),c=A0(a,t,n);return s(i.current,r)||(c(r),i.current=r),[o,c]}function D0(e,t,n="mousedown",s={}){ec(n,r=>{const o=r.target;if(!o||!o.isConnected)return;(Array.isArray(e)?e.filter(i=>!!i.current).every(i=>i.current&&!i.current.contains(o)):e.current&&!e.current.contains(o))&&t(r)},void 0,s)}const tc=({children:e,content:t})=>u.jsxs(xd,{children:[u.jsx(wd,{asChild:!0,children:u.jsx("button",{type:"button","aria-label":"Open Account",className:"cursor-pointer",children:e})}),u.jsx(Cd,{className:"w-52 p-0",align:"start",children:t})]}),k0="/assets/connect-loader-CvOC68Ih.mp4";function L0(e){const{style:t,size:n=100,...s}=e,r=Zu(n),o={objectFit:"contain",pointerEvents:"none",...r,...t},a=r.width?.replace("px",""),i=r.height?.replace("px","");return u.jsx("video",{autoPlay:!0,height:i,loop:!0,muted:!0,playsInline:!0,width:a,...s,style:o,children:u.jsx("source",{src:k0,type:"video/mp4"})})}function qs(e){const{onSubmit:t,onCancel:n,defaultValue:s,className:r,minLength:o=1,...a}=e,[i,c]=b.useState(s??""),l=b.useRef(null);D0(l,d),ec("keyup",f=>{f.key==="Enter"&&d(),f.key==="Escape"&&n()}),b.useLayoutEffect(()=>{setTimeout(()=>{l.current?.focus(),l.current?.select(),l.current?.scroll({left:9999})},100)},[]);function d(){i.length>=o&&t(i)}return u.jsx("input",{...a,autoFocus:!0,className:N("bg-inherit text-inherit outline-none",r),minLength:o,onChange:f=>c(f.target.value),ref:l,required:!0,type:"text",value:i})}function V6(){const{isAllowedToCreateDocuments:e}=Bs(),[t]=Pi(),n=Oi(),s=Tu(),[r,o]=b.useState(!1);function a(){o(!0)}function i(f){!e||!n||Ru(n,f,s.at(-1)?.id).then(h=>{vt(h)}).catch(h=>{console.error(h)}).finally(()=>{o(!1)})}function c(){o(!1)}const l=!!t,d=!!s.length;return u.jsxs("div",{className:"flex h-9 flex-row items-center gap-2 p-6 text-gray-500",children:[l&&u.jsxs(u.Fragment,{children:[u.jsx(qo,{name:t.state.global.name,onClick:()=>Au(t)}),u.jsx("span",{children:"/"})]}),d&&s.map(f=>u.jsxs(b.Fragment,{children:[u.jsx(qo,{name:f.name,onClick:()=>vt(f)}),u.jsx("span",{children:"/"})]},f.id)),e&&(r?u.jsx(qs,{className:"text-gray-800",defaultValue:"New Folder",onCancel:c,onSubmit:i,placeholder:"New Folder"}):u.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:[u.jsx(I,{name:"Plus",size:14}),"Add new"]}))]})}function qo(e){const{name:t,onClick:n}=e;return u.jsx("div",{className:"transition-colors last-of-type:text-gray-800 hover:text-gray-800",onClick:n,role:"button",children:t})}function rt(e){"@babel/helpers - typeof";return rt=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},rt(e)}function F0(e,t){if(rt(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var s=n.call(e,t);if(rt(s)!="object")return s;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function nc(e){var t=F0(e,"string");return rt(t)=="symbol"?t:t+""}function Lt(e,t,n){return(t=nc(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Yo(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 L(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Yo(Object(n),!0).forEach(function(s){Lt(e,s,n[s])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Yo(Object(n)).forEach(function(s){Object.defineProperty(e,s,Object.getOwnPropertyDescriptor(n,s))})}return e}function $0(e){if(Array.isArray(e))return e}function z0(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var s,r,o,a,i=[],c=!0,l=!1;try{if(o=(n=n.call(e)).next,t===0){if(Object(n)!==n)return;c=!1}else for(;!(c=(s=o.call(n)).done)&&(i.push(s.value),i.length!==t);c=!0);}catch(d){l=!0,r=d}finally{try{if(!c&&n.return!=null&&(a=n.return(),Object(a)!==a))return}finally{if(l)throw r}}return i}}function ts(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 rc(e,t){if(e){if(typeof e=="string")return ts(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)?ts(e,t):void 0}}function U0(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
2
2
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Fe(e,t){return $0(e)||z0(e,t)||rc(e,t)||U0()}function B0(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=B0(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 V0=["defaultInputValue","defaultMenuIsOpen","defaultValue","inputValue","menuIsOpen","onChange","onInputChange","onMenuClose","onMenuOpen","value"];function H0(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,i=e.inputValue,c=e.menuIsOpen,l=e.onChange,d=e.onInputChange,f=e.onMenuClose,h=e.onMenuOpen,p=e.value,m=ze(e,V0),g=b.useState(i!==void 0?i:n),v=Fe(g,2),x=v[0],y=v[1],C=b.useState(c!==void 0?c:r),O=Fe(C,2),w=O[0],E=O[1],S=b.useState(p!==void 0?p:a),P=Fe(S,2),j=P[0],M=P[1],A=b.useCallback(function(q,ee){typeof l=="function"&&l(q,ee),M(q)},[l]),R=b.useCallback(function(q,ee){var ne;typeof d=="function"&&(ne=d(q,ee)),y(ne!==void 0?ne:q)},[d]),k=b.useCallback(function(){typeof h=="function"&&h(),E(!0)},[h]),z=b.useCallback(function(){typeof f=="function"&&f(),E(!1)},[f]),$=i!==void 0?i:x,B=c!==void 0?c:w,G=p!==void 0?p:j;return L(L({},m),{},{inputValue:$,menuIsOpen:B,onChange:A,onInputChange:R,onMenuClose:z,onMenuOpen:k,value:G})}function F(){return F=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},F.apply(null,arguments)}function _0(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Qo(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,nc(s.key),s)}}function W0(e,t,n){return t&&Qo(e.prototype,t),n&&Qo(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function ns(e,t){return ns=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,s){return n.__proto__=s,n},ns(e,t)}function G0(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&&ns(e,t)}function er(e){return er=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},er(e)}function sc(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(sc=function(){return!!e})()}function q0(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Y0(e,t){if(t&&(rt(t)=="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return q0(e)}function Q0(e){var t=sc();return function(){var n,s=er(e);if(t){var r=er(this).constructor;n=Reflect.construct(s,arguments,r)}else n=s.apply(this,arguments);return Y0(this,n)}}function K0(e){if(Array.isArray(e))return ts(e)}function J0(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function X0(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
|
3
3
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Ys(e){return K0(e)||J0(e)||rc(e)||X0()}function Z0(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 eh(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 th=(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(eh(this));var r=this.tags[this.tags.length-1];if(this.isSpeedy){var o=Z0(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})(),de="-ms-",tr="-moz-",H="-webkit-",oc="comm",Qs="rule",Ks="decl",nh="@import",ac="@keyframes",rh="@layer",sh=Math.abs,gr=String.fromCharCode,oh=Object.assign;function ah(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 ic(e){return e.trim()}function ih(e,t){return(e=t.exec(e))?e[0]:e}function _(e,t,n){return e.replace(t,n)}function rs(e,t){return e.indexOf(t)}function le(e,t){return e.charCodeAt(t)|0}function Ut(e,t,n){return e.slice(t,n)}function je(e){return e.length}function Js(e){return e.length}function In(e,t){return t.push(e),e}function ch(e,t){return e.map(t).join("")}var br=1,xt=1,cc=0,ge=0,oe=0,Pt="";function vr(e,t,n,s,r,o,a){return{value:e,root:t,parent:n,type:s,props:r,children:o,line:br,column:xt,length:a,return:""}}function At(e,t){return oh(vr("",null,null,"",null,null,0),e,{length:-e.length},t)}function lh(){return oe}function uh(){return oe=ge>0?le(Pt,--ge):0,xt--,oe===10&&(xt=1,br--),oe}function ye(){return oe=ge<cc?le(Pt,ge++):0,xt++,oe===10&&(xt=1,br++),oe}function Ne(){return le(Pt,ge)}function Hn(){return ge}function bn(e,t){return Ut(Pt,e,t)}function Bt(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 lc(e){return br=xt=1,cc=je(Pt=e),ge=0,[]}function uc(e){return Pt="",e}function _n(e){return ic(bn(ge-1,ss(e===91?e+2:e===40?e+1:e)))}function dh(e){for(;(oe=Ne())&&oe<33;)ye();return Bt(e)>2||Bt(oe)>3?"":" "}function fh(e,t){for(;--t&&ye()&&!(oe<48||oe>102||oe>57&&oe<65||oe>70&&oe<97););return bn(e,Hn()+(t<6&&Ne()==32&&ye()==32))}function ss(e){for(;ye();)switch(oe){case e:return ge;case 34:case 39:e!==34&&e!==39&&ss(oe);break;case 40:e===41&&ss(e);break;case 92:ye();break}return ge}function hh(e,t){for(;ye()&&e+oe!==57;)if(e+oe===84&&Ne()===47)break;return"/*"+bn(t,ge-1)+"*"+gr(e===47?e:ye())}function ph(e){for(;!Bt(Ne());)ye();return bn(e,ge)}function mh(e){return uc(Wn("",null,null,null,[""],e=lc(e),0,[0],e))}function Wn(e,t,n,s,r,o,a,i,c){for(var l=0,d=0,f=a,h=0,p=0,m=0,g=1,v=1,x=1,y=0,C="",O=r,w=o,E=s,S=C;v;)switch(m=y,y=ye()){case 40:if(m!=108&&le(S,f-1)==58){rs(S+=_(_n(y),"&","&\f"),"&\f")!=-1&&(x=-1);break}case 34:case 39:case 91:S+=_n(y);break;case 9:case 10:case 13:case 32:S+=dh(m);break;case 92:S+=fh(Hn()-1,7);continue;case 47:switch(Ne()){case 42:case 47:In(gh(hh(ye(),Hn()),t,n),c);break;default:S+="/"}break;case 123*g:i[l++]=je(S)*x;case 125*g:case 59:case 0:switch(y){case 0:case 125:v=0;case 59+d:x==-1&&(S=_(S,/\f/g,"")),p>0&&je(S)-f&&In(p>32?Jo(S+";",s,n,f-1):Jo(_(S," ","")+";",s,n,f-2),c);break;case 59:S+=";";default:if(In(E=Ko(S,t,n,l,d,r,i,C,O=[],w=[],f),o),y===123)if(d===0)Wn(S,t,E,E,O,o,f,i,w);else switch(h===99&&le(S,3)===110?100:h){case 100:case 108:case 109:case 115:Wn(e,E,E,s&&In(Ko(e,E,E,0,0,r,i,C,r,O=[],f),w),r,w,f,i,s?O:w);break;default:Wn(S,E,E,E,[""],w,0,i,w)}}l=d=p=0,g=x=1,C=S="",f=a;break;case 58:f=1+je(S),p=m;default:if(g<1){if(y==123)--g;else if(y==125&&g++==0&&uh()==125)continue}switch(S+=gr(y),y*g){case 38:x=d>0?1:(S+="\f",-1);break;case 44:i[l++]=(je(S)-1)*x,x=1;break;case 64:Ne()===45&&(S+=_n(ye())),h=Ne(),d=f=je(C=S+=ph(Hn())),y++;break;case 45:m===45&&je(S)==2&&(g=0)}}return o}function Ko(e,t,n,s,r,o,a,i,c,l,d){for(var f=r-1,h=r===0?o:[""],p=Js(h),m=0,g=0,v=0;m<s;++m)for(var x=0,y=Ut(e,f+1,f=sh(g=a[m])),C=e;x<p;++x)(C=ic(g>0?h[x]+" "+y:_(y,/&\f/g,h[x])))&&(c[v++]=C);return vr(e,t,n,r===0?Qs:i,c,l,d)}function gh(e,t,n){return vr(e,t,n,oc,gr(lh()),Ut(e,2,-2),0)}function Jo(e,t,n,s){return vr(e,t,n,Ks,Ut(e,0,s),Ut(e,s+1,-1),s)}function gt(e,t){for(var n="",s=Js(e),r=0;r<s;r++)n+=t(e[r],r,e,t)||"";return n}function bh(e,t,n,s){switch(e.type){case rh:if(e.children.length)break;case nh:case Ks:return e.return=e.return||e.value;case oc:return"";case ac:return e.return=e.value+"{"+gt(e.children,s)+"}";case Qs:e.value=e.props.join(",")}return je(n=gt(e.children,s))?e.return=e.value+"{"+n+"}":""}function vh(e){var t=Js(e);return function(n,s,r,o){for(var a="",i=0;i<t;i++)a+=e[i](n,s,r,o)||"";return a}}function yh(e){return function(t){t.root||(t=t.return)&&e(t)}}function xh(e){var t=Object.create(null);return function(n){return t[n]===void 0&&(t[n]=e(n)),t[n]}}var wh=function(t,n,s){for(var r=0,o=0;r=o,o=Ne(),r===38&&o===12&&(n[s]=1),!Bt(o);)ye();return bn(t,ge)},Ch=function(t,n){var s=-1,r=44;do switch(Bt(r)){case 0:r===38&&Ne()===12&&(n[s]=1),t[s]+=wh(ge-1,n,s);break;case 2:t[s]+=_n(r);break;case 4:if(r===44){t[++s]=Ne()===58?"&\f":"",n[s]=t[s].length;break}default:t[s]+=gr(r)}while(r=ye());return t},Sh=function(t,n){return uc(Ch(lc(t),n))},Xo=new WeakMap,Eh=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&&!Xo.get(s))&&!r){Xo.set(t,!0);for(var o=[],a=Sh(n,o),i=s.props,c=0,l=0;c<a.length;c++)for(var d=0;d<i.length;d++,l++)t.props[l]=o[c]?a[c].replace(/&\f/g,i[d]):i[d]+" "+a[c]}}},Ph=function(t){if(t.type==="decl"){var n=t.value;n.charCodeAt(0)===108&&n.charCodeAt(2)===98&&(t.return="",t.value="")}};function dc(e,t){switch(ah(e,t)){case 5103:return H+"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 H+e+e;case 5349:case 4246:case 4810:case 6968:case 2756:return H+e+tr+e+de+e+e;case 6828:case 4268:return H+e+de+e+e;case 6165:return H+e+de+"flex-"+e+e;case 5187:return H+e+_(e,/(\w+).+(:[^]+)/,H+"box-$1$2"+de+"flex-$1$2")+e;case 5443:return H+e+de+"flex-item-"+_(e,/flex-|-self/,"")+e;case 4675:return H+e+de+"flex-line-pack"+_(e,/align-content|flex-|-self/,"")+e;case 5548:return H+e+de+_(e,"shrink","negative")+e;case 5292:return H+e+de+_(e,"basis","preferred-size")+e;case 6060:return H+"box-"+_(e,"-grow","")+H+e+de+_(e,"grow","positive")+e;case 4554:return H+_(e,/([^-])(transform)/g,"$1"+H+"$2")+e;case 6187:return _(_(_(e,/(zoom-|grab)/,H+"$1"),/(image-set)/,H+"$1"),e,"")+e;case 5495:case 3959:return _(e,/(image-set\([^]*)/,H+"$1$`$1");case 4968:return _(_(e,/(.+:)(flex-)?(.*)/,H+"box-pack:$3"+de+"flex-pack:$3"),/s.+-b[^;]+/,"justify")+H+e+e;case 4095:case 3583:case 4068:case 2532:return _(e,/(.+)-inline(.+)/,H+"$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 _(e,/(.+:)(.+)-([^]+)/,"$1"+H+"$2-$3$1"+tr+(le(e,t+3)==108?"$3":"$2-$3"))+e;case 115:return~rs(e,"stretch")?dc(_(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-(~rs(e,"!important")&&10))){case 107:return _(e,":",":"+H)+e;case 101:return _(e,/(.+:)([^;!]+)(;|!.+)?/,"$1"+H+(le(e,14)===45?"inline-":"")+"box$3$1"+H+"$2$3$1"+de+"$2box$3")+e}break;case 5936:switch(le(e,t+11)){case 114:return H+e+de+_(e,/[svh]\w+-[tblr]{2}/,"tb")+e;case 108:return H+e+de+_(e,/[svh]\w+-[tblr]{2}/,"tb-rl")+e;case 45:return H+e+de+_(e,/[svh]\w+-[tblr]{2}/,"lr")+e}return H+e+de+e+e}return e}var Oh=function(t,n,s,r){if(t.length>-1&&!t.return)switch(t.type){case Ks:t.return=dc(t.value,t.length);break;case ac:return gt([At(t,{value:_(t.value,"@","@"+H)})],r);case Qs:if(t.length)return ch(t.props,function(o){switch(ih(o,/(::plac\w+|:read-\w+)/)){case":read-only":case":read-write":return gt([At(t,{props:[_(o,/:(read-\w+)/,":"+tr+"$1")]})],r);case"::placeholder":return gt([At(t,{props:[_(o,/:(plac\w+)/,":"+H+"input-$1")]}),At(t,{props:[_(o,/:(plac\w+)/,":"+tr+"$1")]}),At(t,{props:[_(o,/:(plac\w+)/,de+"input-$1")]})],r)}return""})}},jh=[Oh],Ih=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 v=g.getAttribute("data-emotion");v.indexOf(" ")!==-1&&(document.head.appendChild(g),g.setAttribute("data-s",""))})}var r=t.stylisPlugins||jh,o={},a,i=[];a=t.container||document.head,Array.prototype.forEach.call(document.querySelectorAll('style[data-emotion^="'+n+' "]'),function(g){for(var v=g.getAttribute("data-emotion").split(" "),x=1;x<v.length;x++)o[v[x]]=!0;i.push(g)});var c,l=[Eh,Ph];{var d,f=[bh,yh(function(g){d.insert(g)})],h=vh(l.concat(r,f)),p=function(v){return gt(mh(v),h)};c=function(v,x,y,C){d=y,p(v?v+"{"+x.styles+"}":x.styles),C&&(m.inserted[x.name]=!0)}}var m={key:n,sheet:new th({key:n,container:a,nonce:t.nonce,speedy:t.speedy,prepend:t.prepend,insertionPoint:t.insertionPoint}),nonce:t.nonce,inserted:o,registered:{},insert:c};return m.sheet.hydrate(i),m},Nh=!0;function Mh(e,t,n){var s="";return n.split(" ").forEach(function(r){e[r]!==void 0?t.push(e[r]+";"):r&&(s+=r+" ")}),s}var fc=function(t,n,s){var r=t.key+"-"+n.name;(s===!1||Nh===!1)&&t.registered[r]===void 0&&(t.registered[r]=n.styles)},Th=function(t,n,s){fc(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 Ah(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 Rh={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},Dh=/[A-Z]|^ms/g,kh=/_EMO_([^_]+?)_([^]*?)_EMO_/g,hc=function(t){return t.charCodeAt(1)===45},Zo=function(t){return t!=null&&typeof t!="boolean"},Ar=xh(function(e){return hc(e)?e:e.replace(Dh,"-$&").toLowerCase()}),ea=function(t,n){switch(t){case"animation":case"animationName":if(typeof n=="string")return n.replace(kh,function(s,r,o){return Ie={name:r,styles:o,next:Ie},r})}return Rh[t]!==1&&!hc(t)&&typeof n=="number"&&n!==0?n+"px":n};function Vt(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 Ie={name:r.name,styles:r.styles,next:Ie},r.name;var o=n;if(o.styles!==void 0){var a=o.next;if(a!==void 0)for(;a!==void 0;)Ie={name:a.name,styles:a.styles,next:Ie},a=a.next;var i=o.styles+";";return i}return Lh(e,t,n)}case"function":{if(e!==void 0){var c=Ie,l=n(e);return Ie=c,Vt(e,t,l)}break}}var d=n;return d}function Lh(e,t,n){var s="";if(Array.isArray(n))for(var r=0;r<n.length;r++)s+=Vt(e,t,n[r])+";";else for(var o in n){var a=n[o];if(typeof a!="object"){var i=a;Zo(i)&&(s+=Ar(o)+":"+ea(o,i)+";")}else if(Array.isArray(a)&&typeof a[0]=="string"&&t==null)for(var c=0;c<a.length;c++)Zo(a[c])&&(s+=Ar(o)+":"+ea(o,a[c])+";");else{var l=Vt(e,t,a);switch(o){case"animation":case"animationName":{s+=Ar(o)+":"+l+";";break}default:s+=o+"{"+l+"}"}}}return s}var ta=/label:\s*([^\s;{]+)\s*(;|$)/g,Ie;function pc(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="";Ie=void 0;var o=e[0];if(o==null||o.raw===void 0)s=!1,r+=Vt(n,t,o);else{var a=o;r+=a[0]}for(var i=1;i<e.length;i++)if(r+=Vt(n,t,e[i]),s){var c=o;r+=c[i]}ta.lastIndex=0;for(var l="",d;(d=ta.exec(r))!==null;)l+="-"+d[1];var f=Ah(r)+l;return{name:f,styles:r,next:Ie}}var Fh=function(t){return t()},$h=ko.useInsertionEffect?ko.useInsertionEffect:!1,zh=$h||Fh,mc=b.createContext(typeof HTMLElement<"u"?Ih({key:"css"}):null);mc.Provider;var Uh=function(t){return b.forwardRef(function(n,s){var r=b.useContext(mc);return t(n,r,s)})},Bh=b.createContext({}),Xs={}.hasOwnProperty,os="__EMOTION_TYPE_PLEASE_DO_NOT_USE__",Vh=function(t,n){var s={};for(var r in n)Xs.call(n,r)&&(s[r]=n[r]);return s[os]=t,s},Hh=function(t){var n=t.cache,s=t.serialized,r=t.isStringTag;return fc(n,s,r),zh(function(){return Th(n,s,r)}),null},_h=Uh(function(e,t,n){var s=e.css;typeof s=="string"&&t.registered[s]!==void 0&&(s=t.registered[s]);var r=e[os],o=[s],a="";typeof e.className=="string"?a=Mh(t.registered,o,e.className):e.className!=null&&(a=e.className+" ");var i=pc(o,void 0,b.useContext(Bh));a+=t.key+"-"+i.name;var c={};for(var l in e)Xs.call(e,l)&&l!=="css"&&l!==os&&(c[l]=e[l]);return c.className=a,n&&(c.ref=n),b.createElement(b.Fragment,null,b.createElement(Hh,{cache:t,serialized:i,isStringTag:typeof r=="string"}),b.createElement(r,c))}),Wh=_h,D=function(t,n){var s=arguments;if(n==null||!Xs.call(n,"css"))return b.createElement.apply(void 0,s);var r=s.length,o=new Array(r);o[0]=Wh,o[1]=Vh(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={}))})(D||(D={}));function Zs(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return pc(t)}function Gh(){var e=Zs.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 qh(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}var as=b.useLayoutEffect,Yh=["className","clearValue","cx","getStyles","getClassNames","getValue","hasValue","isMulti","isRtl","options","selectOption","selectProps","setValue","theme"],nr=function(){};function Qh(e,t){return t?t[0]==="-"?e+t:e+"__"+t:e}function Kh(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(Qh(e,a)));return o.filter(function(i){return i}).map(function(i){return String(i).trim()}).join(" ")}var na=function(t){return op(t)?t.filter(Boolean):rt(t)==="object"&&t!==null?[t]:[]},gc=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,Yh);return L({},n)},te=function(t,n,s){var r=t.cx,o=t.getStyles,a=t.getClassNames,i=t.className;return{css:o(n,t),className:r(s??{},a(n,t),i)}};function yr(e){return[document.documentElement,document.body,window].indexOf(e)>-1}function Jh(e){return yr(e)?window.innerHeight:e.clientHeight}function bc(e){return yr(e)?window.pageYOffset:e.scrollTop}function rr(e,t){if(yr(e)){window.scrollTo(0,t);return}e.scrollTop=t}function Xh(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 Zh(e,t,n,s){return n*((e=e/s-1)*e*e+1)+t}function Nn(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:200,s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:nr,r=bc(e),o=t-r,a=10,i=0;function c(){i+=a;var l=Zh(i,r,o,n);rr(e,l),i<n?window.requestAnimationFrame(c):s(e)}c()}function ra(e,t){var n=e.getBoundingClientRect(),s=t.getBoundingClientRect(),r=t.offsetHeight/3;s.bottom+r>n.bottom?rr(e,Math.min(t.offsetTop+t.clientHeight-e.offsetHeight+r,e.scrollHeight)):s.top-r<n.top&&rr(e,Math.max(t.offsetTop-r,0))}function ep(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 sa(){try{return document.createEvent("TouchEvent"),!0}catch{return!1}}function tp(){try{return/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)}catch{return!1}}var vc=!1,np={get passive(){return vc=!0}},Mn=typeof window<"u"?window:{};Mn.addEventListener&&Mn.removeEventListener&&(Mn.addEventListener("p",nr,np),Mn.removeEventListener("p",nr,!1));var rp=vc;function sp(e){return e!=null}function op(e){return Array.isArray(e)}function Tn(e,t,n){return e?t:n}var ap=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 i=Fe(a,1),c=i[0];return!s.includes(c)});return o.reduce(function(a,i){var c=Fe(i,2),l=c[0],d=c[1];return a[l]=d,a},{})},ip=["children","innerProps"],cp=["children","innerProps"];function lp(e){var t=e.maxHeight,n=e.menuEl,s=e.minHeight,r=e.placement,o=e.shouldScroll,a=e.isFixedPosition,i=e.controlHeight,c=Xh(n),l={placement:"bottom",maxHeight:t};if(!n||!n.offsetParent)return l;var d=c.getBoundingClientRect(),f=d.height,h=n.getBoundingClientRect(),p=h.bottom,m=h.height,g=h.top,v=n.offsetParent.getBoundingClientRect(),x=v.top,y=a?window.innerHeight:Jh(c),C=bc(c),O=parseInt(getComputedStyle(n).marginBottom,10),w=parseInt(getComputedStyle(n).marginTop,10),E=x-w,S=y-g,P=E+C,j=f-C-g,M=p-y+C+O,A=C+g-w,R=160;switch(r){case"auto":case"bottom":if(S>=m)return{placement:"bottom",maxHeight:t};if(j>=m&&!a)return o&&Nn(c,M,R),{placement:"bottom",maxHeight:t};if(!a&&j>=s||a&&S>=s){o&&Nn(c,M,R);var k=a?S-O:j-O;return{placement:"bottom",maxHeight:k}}if(r==="auto"||a){var z=t,$=a?E:P;return $>=s&&(z=Math.min($-O-i,t)),{placement:"top",maxHeight:z}}if(r==="bottom")return o&&rr(c,M),{placement:"bottom",maxHeight:t};break;case"top":if(E>=m)return{placement:"top",maxHeight:t};if(P>=m&&!a)return o&&Nn(c,A,R),{placement:"top",maxHeight:t};if(!a&&P>=s||a&&E>=s){var B=t;return(!a&&P>=s||a&&E>=s)&&(B=a?E-w:P-w),o&&Nn(c,A,R),{placement:"top",maxHeight:B}}return{placement:"bottom",maxHeight:t};default:throw new Error('Invalid placement provided "'.concat(r,'".'))}return l}function up(e){var t={bottom:"top",top:"bottom"};return e?t[e]:"bottom"}var yc=function(t){return t==="auto"?"bottom":t},dp=function(t,n){var s,r=t.placement,o=t.theme,a=o.borderRadius,i=o.spacing,c=o.colors;return L((s={label:"menu"},Lt(s,up(r),"100%"),Lt(s,"position","absolute"),Lt(s,"width","100%"),Lt(s,"zIndex",1),s),n?{}:{backgroundColor:c.neutral0,borderRadius:a,boxShadow:"0 0 0 1px hsla(0, 0%, 0%, 0.1), 0 4px 11px hsla(0, 0%, 0%, 0.1)",marginBottom:i.menuGutter,marginTop:i.menuGutter})},xc=b.createContext(null),fp=function(t){var n=t.children,s=t.minMenuHeight,r=t.maxMenuHeight,o=t.menuPlacement,a=t.menuPosition,i=t.menuShouldScrollIntoView,c=t.theme,l=b.useContext(xc)||{},d=l.setPortalPlacement,f=b.useRef(null),h=b.useState(r),p=Fe(h,2),m=p[0],g=p[1],v=b.useState(null),x=Fe(v,2),y=x[0],C=x[1],O=c.spacing.controlHeight;return as(function(){var w=f.current;if(w){var E=a==="fixed",S=i&&!E,P=lp({maxHeight:r,menuEl:w,minHeight:s,placement:o,shouldScroll:S,isFixedPosition:E,controlHeight:O});g(P.maxHeight),C(P.placement),d?.(P.placement)}},[r,o,a,i,s,d,O]),n({ref:f,placerProps:L(L({},t),{},{placement:y||yc(o),maxHeight:m})})},hp=function(t){var n=t.children,s=t.innerRef,r=t.innerProps;return D("div",F({},te(t,"menu",{menu:!0}),{ref:s},r),n)},pp=hp,mp=function(t,n){var s=t.maxHeight,r=t.theme.spacing.baseUnit;return L({maxHeight:s,overflowY:"auto",position:"relative",WebkitOverflowScrolling:"touch"},n?{}:{paddingBottom:r,paddingTop:r})},gp=function(t){var n=t.children,s=t.innerProps,r=t.innerRef,o=t.isMulti;return D("div",F({},te(t,"menuList",{"menu-list":!0,"menu-list--is-multi":o}),{ref:r},s),n)},wc=function(t,n){var s=t.theme,r=s.spacing.baseUnit,o=s.colors;return L({textAlign:"center"},n?{}:{color:o.neutral40,padding:"".concat(r*2,"px ").concat(r*3,"px")})},bp=wc,vp=wc,yp=function(t){var n=t.children,s=n===void 0?"No options":n,r=t.innerProps,o=ze(t,ip);return D("div",F({},te(L(L({},o),{},{children:s,innerProps:r}),"noOptionsMessage",{"menu-notice":!0,"menu-notice--no-options":!0}),r),s)},xp=function(t){var n=t.children,s=n===void 0?"Loading...":n,r=t.innerProps,o=ze(t,cp);return D("div",F({},te(L(L({},o),{},{children:s,innerProps:r}),"loadingMessage",{"menu-notice":!0,"menu-notice--loading":!0}),r),s)},wp=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}},Cp=function(t){var n=t.appendTo,s=t.children,r=t.controlElement,o=t.innerProps,a=t.menuPlacement,i=t.menuPosition,c=b.useRef(null),l=b.useRef(null),d=b.useState(yc(a)),f=Fe(d,2),h=f[0],p=f[1],m=b.useMemo(function(){return{setPortalPlacement:p}},[]),g=b.useState(null),v=Fe(g,2),x=v[0],y=v[1],C=b.useCallback(function(){if(r){var S=ep(r),P=i==="fixed"?0:window.pageYOffset,j=S[h]+P;(j!==x?.offset||S.left!==x?.rect.left||S.width!==x?.rect.width)&&y({offset:j,rect:S})}},[r,i,h,x?.offset,x?.rect.left,x?.rect.width]);as(function(){C()},[C]);var O=b.useCallback(function(){typeof l.current=="function"&&(l.current(),l.current=null),r&&c.current&&(l.current=ed(r,c.current,C,{elementResize:"ResizeObserver"in window}))},[r,C]);as(function(){O()},[O]);var w=b.useCallback(function(S){c.current=S,O()},[O]);if(!n&&i!=="fixed"||!x)return null;var E=D("div",F({ref:w},te(L(L({},t),{},{offset:x.offset,position:i,rect:x.rect}),"menuPortal",{"menu-portal":!0}),o),s);return D(xc.Provider,{value:m},n?Si.createPortal(E,n):E)},Sp=function(t){var n=t.isDisabled,s=t.isRtl;return{label:"container",direction:s?"rtl":void 0,pointerEvents:n?"none":void 0,position:"relative"}},Ep=function(t){var n=t.children,s=t.innerProps,r=t.isDisabled,o=t.isRtl;return D("div",F({},te(t,"container",{"--is-disabled":r,"--is-rtl":o}),s),n)},Pp=function(t,n){var s=t.theme.spacing,r=t.isMulti,o=t.hasValue,a=t.selectProps.controlShouldRenderValue;return L({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")})},Op=function(t){var n=t.children,s=t.innerProps,r=t.isMulti,o=t.hasValue;return D("div",F({},te(t,"valueContainer",{"value-container":!0,"value-container--is-multi":r,"value-container--has-value":o}),s),n)},jp=function(){return{alignItems:"center",alignSelf:"stretch",display:"flex",flexShrink:0}},Ip=function(t){var n=t.children,s=t.innerProps;return D("div",F({},te(t,"indicatorsContainer",{indicators:!0}),s),n)},oa,Np=["size"],Mp=["innerProps","isRtl","size"],Tp={name:"8mmkcg",styles:"display:inline-block;fill:currentColor;line-height:1;stroke:currentColor;stroke-width:0"},Cc=function(t){var n=t.size,s=ze(t,Np);return D("svg",F({height:n,width:n,viewBox:"0 0 20 20","aria-hidden":"true",focusable:"false",css:Tp},s))},eo=function(t){return D(Cc,F({size:20},t),D("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"}))},Sc=function(t){return D(Cc,F({size:20},t),D("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"}))},Ec=function(t,n){var s=t.isFocused,r=t.theme,o=r.spacing.baseUnit,a=r.colors;return L({label:"indicatorContainer",display:"flex",transition:"color 150ms"},n?{}:{color:s?a.neutral60:a.neutral20,padding:o*2,":hover":{color:s?a.neutral80:a.neutral40}})},Ap=Ec,Rp=function(t){var n=t.children,s=t.innerProps;return D("div",F({},te(t,"dropdownIndicator",{indicator:!0,"dropdown-indicator":!0}),s),n||D(Sc,null))},Dp=Ec,kp=function(t){var n=t.children,s=t.innerProps;return D("div",F({},te(t,"clearIndicator",{indicator:!0,"clear-indicator":!0}),s),n||D(eo,null))},Lp=function(t,n){var s=t.isDisabled,r=t.theme,o=r.spacing.baseUnit,a=r.colors;return L({label:"indicatorSeparator",alignSelf:"stretch",width:1},n?{}:{backgroundColor:s?a.neutral10:a.neutral20,marginBottom:o*2,marginTop:o*2})},Fp=function(t){var n=t.innerProps;return D("span",F({},n,te(t,"indicatorSeparator",{"indicator-separator":!0})))},$p=Gh(oa||(oa=qh([`
|
|
4
4
|
0%, 80%, 100% { opacity: 0; }
|
|
5
5
|
40% { opacity: 1; }
|
|
6
|
-
`]))),zp=function(t,n){var s=t.isFocused,r=t.size,o=t.theme,a=o.colors,i=o.spacing.baseUnit;return L({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:i*2})},Rr=function(t){var n=t.delay,s=t.offset;return D("span",{css:Zs({animation:"".concat($p," 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"},"","")})},Up=function(t){var n=t.innerProps,s=t.isRtl,r=t.size,o=r===void 0?4:r,a=ze(t,Mp);return D("div",F({},te(L(L({},a),{},{innerProps:n,isRtl:s,size:o}),"loadingIndicator",{indicator:!0,"loading-indicator":!0}),n),D(Rr,{delay:0,offset:s}),D(Rr,{delay:160,offset:!0}),D(Rr,{delay:320,offset:!s}))},Bp=function(t,n){var s=t.isDisabled,r=t.isFocused,o=t.theme,a=o.colors,i=o.borderRadius,c=o.spacing;return L({label:"control",alignItems:"center",cursor:"default",display:"flex",flexWrap:"wrap",justifyContent:"space-between",minHeight:c.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:i,borderStyle:"solid",borderWidth:1,boxShadow:r?"0 0 0 1px ".concat(a.primary):void 0,"&:hover":{borderColor:r?a.primary:a.neutral30}})},Vp=function(t){var n=t.children,s=t.isDisabled,r=t.isFocused,o=t.innerRef,a=t.innerProps,i=t.menuIsOpen;return D("div",F({ref:o},te(t,"control",{control:!0,"control--is-disabled":s,"control--is-focused":r,"control--menu-is-open":i}),a,{"aria-disabled":s||void 0}),n)},Hp=Vp,_p=["data"],Wp=function(t,n){var s=t.theme.spacing;return n?{}:{paddingBottom:s.baseUnit*2,paddingTop:s.baseUnit*2}},Gp=function(t){var n=t.children,s=t.cx,r=t.getStyles,o=t.getClassNames,a=t.Heading,i=t.headingProps,c=t.innerProps,l=t.label,d=t.theme,f=t.selectProps;return D("div",F({},te(t,"group",{group:!0}),c),D(a,F({},i,{selectProps:f,theme:d,getStyles:r,getClassNames:o,cx:s}),l),D("div",null,n))},qp=function(t,n){var s=t.theme,r=s.colors,o=s.spacing;return L({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"})},Yp=function(t){var n=gc(t);n.data;var s=ze(n,_p);return D("div",F({},te(t,"groupHeading",{"group-heading":!0}),s))},Qp=Gp,Kp=["innerRef","isDisabled","isHidden","inputClassName"],Jp=function(t,n){var s=t.isDisabled,r=t.value,o=t.theme,a=o.spacing,i=o.colors;return L(L({visibility:s?"hidden":"visible",transform:r?"translateZ(0)":""},Xp),n?{}:{margin:a.baseUnit/2,paddingBottom:a.baseUnit/2,paddingTop:a.baseUnit/2,color:i.neutral80})},Pc={gridArea:"1 / 2",font:"inherit",minWidth:"2px",border:0,margin:0,outline:0,padding:0},Xp={flex:"1 1 auto",display:"inline-grid",gridArea:"1 / 1 / 2 / 3",gridTemplateColumns:"0 min-content","&:after":L({content:'attr(data-value) " "',visibility:"hidden",whiteSpace:"pre"},Pc)},Zp=function(t){return L({label:"input",color:"inherit",background:0,opacity:t?0:1,width:"100%"},Pc)},em=function(t){var n=t.cx,s=t.value,r=gc(t),o=r.innerRef,a=r.isDisabled,i=r.isHidden,c=r.inputClassName,l=ze(r,Kp);return D("div",F({},te(t,"input",{"input-container":!0}),{"data-value":s||""}),D("input",F({className:n({input:!0},c),ref:o,style:Zp(i),disabled:a},l)))},tm=em,nm=function(t,n){var s=t.theme,r=s.spacing,o=s.borderRadius,a=s.colors;return L({label:"multiValue",display:"flex",minWidth:0},n?{}:{backgroundColor:a.neutral10,borderRadius:o/2,margin:r.baseUnit/2})},rm=function(t,n){var s=t.theme,r=s.borderRadius,o=s.colors,a=t.cropWithEllipsis;return L({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})},sm=function(t,n){var s=t.theme,r=s.spacing,o=s.borderRadius,a=s.colors,i=t.isFocused;return L({alignItems:"center",display:"flex"},n?{}:{borderRadius:o/2,backgroundColor:i?a.dangerLight:void 0,paddingLeft:r.baseUnit,paddingRight:r.baseUnit,":hover":{backgroundColor:a.dangerLight,color:a.danger}})},Oc=function(t){var n=t.children,s=t.innerProps;return D("div",s,n)},om=Oc,am=Oc;function im(e){var t=e.children,n=e.innerProps;return D("div",F({role:"button"},n),t||D(eo,{size:14}))}var cm=function(t){var n=t.children,s=t.components,r=t.data,o=t.innerProps,a=t.isDisabled,i=t.removeProps,c=t.selectProps,l=s.Container,d=s.Label,f=s.Remove;return D(l,{data:r,innerProps:L(L({},te(t,"multiValue",{"multi-value":!0,"multi-value--is-disabled":a})),o),selectProps:c},D(d,{data:r,innerProps:L({},te(t,"multiValueLabel",{"multi-value__label":!0})),selectProps:c},n),D(f,{data:r,innerProps:L(L({},te(t,"multiValueRemove",{"multi-value__remove":!0})),{},{"aria-label":"Remove ".concat(n||"option")},i),selectProps:c}))},lm=cm,um=function(t,n){var s=t.isDisabled,r=t.isFocused,o=t.isSelected,a=t.theme,i=a.spacing,c=a.colors;return L({label:"option",cursor:"default",display:"block",fontSize:"inherit",width:"100%",userSelect:"none",WebkitTapHighlightColor:"rgba(0, 0, 0, 0)"},n?{}:{backgroundColor:o?c.primary:r?c.primary25:"transparent",color:s?c.neutral20:o?c.neutral0:"inherit",padding:"".concat(i.baseUnit*2,"px ").concat(i.baseUnit*3,"px"),":active":{backgroundColor:s?void 0:o?c.primary:c.primary50}})},dm=function(t){var n=t.children,s=t.isDisabled,r=t.isFocused,o=t.isSelected,a=t.innerRef,i=t.innerProps;return D("div",F({},te(t,"option",{option:!0,"option--is-disabled":s,"option--is-focused":r,"option--is-selected":o}),{ref:a,"aria-disabled":s},i),n)},fm=dm,hm=function(t,n){var s=t.theme,r=s.spacing,o=s.colors;return L({label:"placeholder",gridArea:"1 / 1 / 2 / 3"},n?{}:{color:o.neutral50,marginLeft:r.baseUnit/2,marginRight:r.baseUnit/2})},pm=function(t){var n=t.children,s=t.innerProps;return D("div",F({},te(t,"placeholder",{placeholder:!0}),s),n)},mm=pm,gm=function(t,n){var s=t.isDisabled,r=t.theme,o=r.spacing,a=r.colors;return L({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})},bm=function(t){var n=t.children,s=t.isDisabled,r=t.innerProps;return D("div",F({},te(t,"singleValue",{"single-value":!0,"single-value--is-disabled":s}),r),n)},vm=bm,xr={ClearIndicator:kp,Control:Hp,DropdownIndicator:Rp,DownChevron:Sc,CrossIcon:eo,Group:Qp,GroupHeading:Yp,IndicatorsContainer:Ip,IndicatorSeparator:Fp,Input:tm,LoadingIndicator:Up,Menu:pp,MenuList:gp,MenuPortal:Cp,LoadingMessage:xp,NoOptionsMessage:yp,MultiValue:lm,MultiValueContainer:om,MultiValueLabel:am,MultiValueRemove:im,Option:fm,Placeholder:mm,SelectContainer:Ep,SingleValue:vm,ValueContainer:Op},ym=function(t){return L(L({},xr),t.components)},aa=Number.isNaN||function(t){return typeof t=="number"&&t!==t};function xm(e,t){return!!(e===t||aa(e)&&aa(t))}function wm(e,t){if(e.length!==t.length)return!1;for(var n=0;n<e.length;n++)if(!xm(e[n],t[n]))return!1;return!0}function Cm(e,t){t===void 0&&(t=wm);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"},Em=function(t){return D("span",F({css:Sm},t))},ia=Em,Pm={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,i=t.selectValue,c=t.isDisabled,l=t.isSelected,d=t.isAppleDevice,f=function(g,v){return g&&g.length?"".concat(g.indexOf(v)+1," of ").concat(g.length):""};if(n==="value"&&i)return"value ".concat(a," focused, ").concat(f(i,s),".");if(n==="menu"&&d){var h=c?" disabled":"",p="".concat(l?" selected":"").concat(h);return"".concat(a).concat(p,", ").concat(f(r,s),".")}return""},onFilter:function(t){var n=t.inputValue,s=t.resultsMessage;return"".concat(s).concat(n?" for search term "+n:"",".")}},Om=function(t){var n=t.ariaSelection,s=t.focusedOption,r=t.focusedValue,o=t.focusableOptions,a=t.isFocused,i=t.selectValue,c=t.selectProps,l=t.id,d=t.isAppleDevice,f=c.ariaLiveMessages,h=c.getOptionLabel,p=c.inputValue,m=c.isMulti,g=c.isOptionDisabled,v=c.isSearchable,x=c.menuIsOpen,y=c.options,C=c.screenReaderStatus,O=c.tabSelectsValue,w=c.isLoading,E=c["aria-label"],S=c["aria-live"],P=b.useMemo(function(){return L(L({},Pm),f||{})},[f]),j=b.useMemo(function(){var $="";if(n&&P.onChange){var B=n.option,G=n.options,q=n.removedValue,ee=n.removedValues,ne=n.value,ie=function(se){return Array.isArray(se)?null:se},U=q||B||ie(ne),Y=U?h(U):"",X=G||ee||void 0,re=X?X.map(h):[],Z=L({isDisabled:U&&g(U,i),label:Y,labels:re},n);$=P.onChange(Z)}return $},[n,P,g,i,h]),M=b.useMemo(function(){var $="",B=s||r,G=!!(s&&i&&i.includes(s));if(B&&P.onFocus){var q={focused:B,label:h(B),isDisabled:g(B,i),isSelected:G,options:o,context:B===s?"menu":"value",selectValue:i,isAppleDevice:d};$=P.onFocus(q)}return $},[s,r,h,g,P,o,i,d]),A=b.useMemo(function(){var $="";if(x&&y.length&&!w&&P.onFilter){var B=C({count:o.length});$=P.onFilter({inputValue:p,resultsMessage:B})}return $},[o,p,x,P,y,C,w]),R=n?.action==="initial-input-focus",k=b.useMemo(function(){var $="";if(P.guidance){var B=r?"value":x?"menu":"input";$=P.guidance({"aria-label":E,context:B,isDisabled:s&&g(s,i),isMulti:m,isSearchable:v,tabSelectsValue:O,isInitialFocus:R})}return $},[E,s,r,m,g,v,x,P,i,O,R]),z=D(b.Fragment,null,D("span",{id:"aria-selection"},j),D("span",{id:"aria-focused"},M),D("span",{id:"aria-results"},A),D("span",{id:"aria-guidance"},k));return D(b.Fragment,null,D(ia,{id:l},R&&z),D(ia,{"aria-live":S,"aria-atomic":"false","aria-relevant":"additions text",role:"log"},a&&!R&&z))},jm=Om,is=[{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źẑżžẓẕƶȥɀⱬꝣ"}],Im=new RegExp("["+is.map(function(e){return e.letters}).join("")+"]","g"),jc={};for(var Dr=0;Dr<is.length;Dr++)for(var kr=is[Dr],Lr=0;Lr<kr.letters.length;Lr++)jc[kr.letters[Lr]]=kr.base;var Ic=function(t){return t.replace(Im,function(n){return jc[n]})},Nm=Cm(Ic),ca=function(t){return t.replace(/^\s+|\s+$/g,"")},Mm=function(t){return"".concat(t.label," ").concat(t.value)},Tm=function(t){return function(n,s){if(n.data.__isNew__)return!0;var r=L({ignoreCase:!0,ignoreAccents:!0,stringify:Mm,trim:!0,matchFrom:"any"},t),o=r.ignoreCase,a=r.ignoreAccents,i=r.stringify,c=r.trim,l=r.matchFrom,d=c?ca(s):s,f=c?ca(i(n)):i(n);return o&&(d=d.toLowerCase(),f=f.toLowerCase()),a&&(d=Nm(d),f=Ic(f)),l==="start"?f.substr(0,d.length)===d:f.indexOf(d)>-1}},Am=["innerRef"];function Rm(e){var t=e.innerRef,n=ze(e,Am),s=ap(n,"onExited","in","enter","exit","appear");return D("input",F({ref:t},s,{css:Zs({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 Dm=function(t){t.cancelable&&t.preventDefault(),t.stopPropagation()};function km(e){var t=e.isEnabled,n=e.onBottomArrive,s=e.onBottomLeave,r=e.onTopArrive,o=e.onTopLeave,a=b.useRef(!1),i=b.useRef(!1),c=b.useRef(0),l=b.useRef(null),d=b.useCallback(function(v,x){if(l.current!==null){var y=l.current,C=y.scrollTop,O=y.scrollHeight,w=y.clientHeight,E=l.current,S=x>0,P=O-w-C,j=!1;P>x&&a.current&&(s&&s(v),a.current=!1),S&&i.current&&(o&&o(v),i.current=!1),S&&x>P?(n&&!a.current&&n(v),E.scrollTop=O,j=!0,a.current=!0):!S&&-x>C&&(r&&!i.current&&r(v),E.scrollTop=0,j=!0,i.current=!0),j&&Dm(v)}},[n,s,r,o]),f=b.useCallback(function(v){d(v,v.deltaY)},[d]),h=b.useCallback(function(v){c.current=v.changedTouches[0].clientY},[]),p=b.useCallback(function(v){var x=c.current-v.changedTouches[0].clientY;d(v,x)},[d]),m=b.useCallback(function(v){if(v){var x=rp?{passive:!1}:!1;v.addEventListener("wheel",f,x),v.addEventListener("touchstart",h,x),v.addEventListener("touchmove",p,x)}},[p,h,f]),g=b.useCallback(function(v){v&&(v.removeEventListener("wheel",f,!1),v.removeEventListener("touchstart",h,!1),v.removeEventListener("touchmove",p,!1))},[p,h,f]);return b.useEffect(function(){if(t){var v=l.current;return m(v),function(){g(v)}}},[t,m,g]),function(v){l.current=v}}var la=["boxSizing","height","overflow","paddingRight","position"],ua={boxSizing:"border-box",overflow:"hidden",position:"relative",height:"100%"};function da(e){e.cancelable&&e.preventDefault()}function fa(e){e.stopPropagation()}function ha(){var e=this.scrollTop,t=this.scrollHeight,n=e+this.offsetHeight;e===0?this.scrollTop=1:n===t&&(this.scrollTop=e-1)}function pa(){return"ontouchstart"in window||navigator.maxTouchPoints}var ma=!!(typeof window<"u"&&window.document&&window.document.createElement),Rt=0,dt={capture:!1,passive:!1};function Lm(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(c){if(ma){var l=document.body,d=l&&l.style;if(s&&la.forEach(function(m){var g=d&&d[m];r.current[m]=g}),s&&Rt<1){var f=parseInt(r.current.paddingRight,10)||0,h=document.body?document.body.clientWidth:0,p=window.innerWidth-h+f||0;Object.keys(ua).forEach(function(m){var g=ua[m];d&&(d[m]=g)}),d&&(d.paddingRight="".concat(p,"px"))}l&&pa()&&(l.addEventListener("touchmove",da,dt),c&&(c.addEventListener("touchstart",ha,dt),c.addEventListener("touchmove",fa,dt))),Rt+=1}},[s]),i=b.useCallback(function(c){if(ma){var l=document.body,d=l&&l.style;Rt=Math.max(Rt-1,0),s&&Rt<1&&la.forEach(function(f){var h=r.current[f];d&&(d[f]=h)}),l&&pa()&&(l.removeEventListener("touchmove",da,dt),c&&(c.removeEventListener("touchstart",ha,dt),c.removeEventListener("touchmove",fa,dt)))}},[s]);return b.useEffect(function(){if(t){var c=o.current;return a(c),function(){i(c)}}},[t,a,i]),function(c){o.current=c}}var Fm=function(t){var n=t.target;return n.ownerDocument.activeElement&&n.ownerDocument.activeElement.blur()},$m={name:"1kfdb0e",styles:"position:fixed;left:0;bottom:0;right:0;top:0"};function zm(e){var t=e.children,n=e.lockEnabled,s=e.captureEnabled,r=s===void 0?!0:s,o=e.onBottomArrive,a=e.onBottomLeave,i=e.onTopArrive,c=e.onTopLeave,l=km({isEnabled:r,onBottomArrive:o,onBottomLeave:a,onTopArrive:i,onTopLeave:c}),d=Lm({isEnabled:n}),f=function(p){l(p),d(p)};return D(b.Fragment,null,n&&D("div",{onClick:Fm,css:$m}),t(f))}var Um={name:"1a0ro4n-requiredInput",styles:"label:requiredInput;opacity:0;pointer-events:none;position:absolute;bottom:0;left:0;right:0;width:100%"},Bm=function(t){var n=t.name,s=t.onFocus;return D("input",{required:!0,name:n,tabIndex:-1,"aria-hidden":"true",onFocus:s,css:Um,value:"",onChange:function(){}})},Vm=Bm;function to(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 Hm(){return to(/^iPhone/i)}function Nc(){return to(/^Mac/i)}function _m(){return to(/^iPad/i)||Nc()&&navigator.maxTouchPoints>1}function Wm(){return Hm()||_m()}function Gm(){return Nc()||Wm()}var qm=function(t){return t.label},Ym=function(t){return t.label},Qm=function(t){return t.value},Km=function(t){return!!t.isDisabled},Jm={clearIndicator:Dp,container:Sp,control:Bp,dropdownIndicator:Ap,group:Wp,groupHeading:qp,indicatorsContainer:jp,indicatorSeparator:Lp,input:Jp,loadingIndicator:zp,loadingMessage:vp,menu:dp,menuList:mp,menuPortal:wp,multiValue:nm,multiValueLabel:rm,multiValueRemove:sm,noOptionsMessage:bp,option:um,placeholder:hm,singleValue:gm,valueContainer:Pp},Xm={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%)"},Zm=4,Mc=4,eg=38,tg=Mc*2,ng={baseUnit:Mc,controlHeight:eg,menuGutter:tg},Fr={borderRadius:Zm,colors:Xm,spacing:ng},rg={"aria-live":"polite",backspaceRemovesValue:!0,blurInputOnSelect:sa(),captureMenuScroll:!sa(),classNames:{},closeMenuOnSelect:!0,closeMenuOnScroll:!1,components:{},controlShouldRenderValue:!0,escapeClearsValue:!1,filterOption:Tm(),formatGroupLabel:qm,getOptionLabel:Ym,getOptionValue:Qm,isDisabled:!1,isLoading:!1,isMulti:!1,isRtl:!1,isSearchable:!0,isOptionDisabled:Km,loadingMessage:function(){return"Loading..."},maxMenuHeight:300,minMenuHeight:140,menuIsOpen:!1,menuPlacement:"bottom",menuPosition:"absolute",menuShouldBlockScroll:!1,menuShouldScrollIntoView:!tp(),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 ga(e,t,n,s){var r=Rc(e,t,n),o=Dc(e,t,n),a=Ac(e,t),i=sr(e,t);return{type:"option",data:t,isDisabled:r,isSelected:o,label:a,value:i,index:s}}function Gn(e,t){return e.options.map(function(n,s){if("options"in n){var r=n.options.map(function(a,i){return ga(e,a,t,i)}).filter(function(a){return va(e,a)});return r.length>0?{type:"group",data:n,options:r,index:s}:void 0}var o=ga(e,n,t,s);return va(e,o)?o:void 0}).filter(sp)}function Tc(e){return e.reduce(function(t,n){return n.type==="group"?t.push.apply(t,Ys(n.options.map(function(s){return s.data}))):t.push(n.data),t},[])}function ba(e,t){return e.reduce(function(n,s){return s.type==="group"?n.push.apply(n,Ys(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 sg(e,t){return Tc(Gn(e,t))}function va(e,t){var n=e.inputValue,s=n===void 0?"":n,r=t.data,o=t.isSelected,a=t.label,i=t.value;return(!Lc(e)||!o)&&kc(e,{label:a,value:i,data:r},s)}function og(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 ag(e,t){var n=e.focusedOption;return n&&t.indexOf(n)>-1?n:t[0]}var $r=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},Ac=function(t,n){return t.getOptionLabel(n)},sr=function(t,n){return t.getOptionValue(n)};function Rc(e,t,n){return typeof e.isOptionDisabled=="function"?e.isOptionDisabled(t,n):!1}function Dc(e,t,n){if(n.indexOf(t)>-1)return!0;if(typeof e.isOptionSelected=="function")return e.isOptionSelected(t,n);var s=sr(e,t);return n.some(function(r){return sr(e,r)===s})}function kc(e,t,n){return e.filterOption?e.filterOption(t,n):!0}var Lc=function(t){var n=t.hideSelectedOptions,s=t.isMulti;return n===void 0?s:n},ig=1,Fc=(function(e){G0(n,e);var t=Q0(n);function n(s){var r;if(_0(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(c){r.controlRef=c},r.focusedOptionRef=null,r.getFocusedOptionRef=function(c){r.focusedOptionRef=c},r.menuListRef=null,r.getMenuListRef=function(c){r.menuListRef=c},r.inputRef=null,r.getInputRef=function(c){r.inputRef=c},r.focus=r.focusInput,r.blur=r.blurInput,r.onChange=function(c,l){var d=r.props,f=d.onChange,h=d.name;l.name=h,r.ariaOnChange(c,l),f(c,l)},r.setValue=function(c,l,d){var f=r.props,h=f.closeMenuOnSelect,p=f.isMulti,m=f.inputValue;r.onInputChange("",{action:"set-value",prevInputValue:m}),h&&(r.setState({inputIsHiddenAfterUpdate:!p}),r.onMenuClose()),r.setState({clearFocusValueOnUpdate:!0}),r.onChange(c,{action:l,option:d})},r.selectOption=function(c){var l=r.props,d=l.blurInputOnSelect,f=l.isMulti,h=l.name,p=r.state.selectValue,m=f&&r.isOptionSelected(c,p),g=r.isOptionDisabled(c,p);if(m){var v=r.getOptionValue(c);r.setValue(p.filter(function(x){return r.getOptionValue(x)!==v}),"deselect-option",c)}else if(!g)f?r.setValue([].concat(Ys(p),[c]),"select-option",c):r.setValue(c,"select-option");else{r.ariaOnChange(c,{action:"select-option",option:c,name:h});return}d&&r.blurInput()},r.removeValue=function(c){var l=r.props.isMulti,d=r.state.selectValue,f=r.getOptionValue(c),h=d.filter(function(m){return r.getOptionValue(m)!==f}),p=Tn(l,h,h[0]||null);r.onChange(p,{action:"remove-value",removedValue:c}),r.focusInput()},r.clearValue=function(){var c=r.state.selectValue;r.onChange(Tn(r.props.isMulti,[],null),{action:"clear",removedValues:c})},r.popValue=function(){var c=r.props.isMulti,l=r.state.selectValue,d=l[l.length-1],f=l.slice(0,l.length-1),h=Tn(c,f,f[0]||null);d&&r.onChange(h,{action:"pop-value",removedValue:d})},r.getFocusedOptionId=function(c){return $r(r.state.focusableOptionsWithIds,c)},r.getFocusableOptionsWithIds=function(){return ba(Gn(r.props,r.state.selectValue),r.getElementId("option"))},r.getValue=function(){return r.state.selectValue},r.cx=function(){for(var c=arguments.length,l=new Array(c),d=0;d<c;d++)l[d]=arguments[d];return Kh.apply(void 0,[r.props.classNamePrefix].concat(l))},r.getOptionLabel=function(c){return Ac(r.props,c)},r.getOptionValue=function(c){return sr(r.props,c)},r.getStyles=function(c,l){var d=r.props.unstyled,f=Jm[c](l,d);f.boxSizing="border-box";var h=r.props.styles[c];return h?h(f,l):f},r.getClassNames=function(c,l){var d,f;return(d=(f=r.props.classNames)[c])===null||d===void 0?void 0:d.call(f,l)},r.getElementId=function(c){return"".concat(r.state.instancePrefix,"-").concat(c)},r.getComponents=function(){return ym(r.props)},r.buildCategorizedOptions=function(){return Gn(r.props,r.state.selectValue)},r.getCategorizedOptions=function(){return r.props.menuIsOpen?r.buildCategorizedOptions():[]},r.buildFocusableOptions=function(){return Tc(r.buildCategorizedOptions())},r.getFocusableOptions=function(){return r.props.menuIsOpen?r.buildFocusableOptions():[]},r.ariaOnChange=function(c,l){r.setState({ariaSelection:L({value:c},l)})},r.onMenuMouseDown=function(c){c.button===0&&(c.stopPropagation(),c.preventDefault(),r.focusInput())},r.onMenuMouseMove=function(c){r.blockOptionHover=!1},r.onControlMouseDown=function(c){if(!c.defaultPrevented){var l=r.props.openMenuOnClick;r.state.isFocused?r.props.menuIsOpen?c.target.tagName!=="INPUT"&&c.target.tagName!=="TEXTAREA"&&r.onMenuClose():l&&r.openMenu("first"):(l&&(r.openAfterFocus=!0),r.focusInput()),c.target.tagName!=="INPUT"&&c.target.tagName!=="TEXTAREA"&&c.preventDefault()}},r.onDropdownIndicatorMouseDown=function(c){if(!(c&&c.type==="mousedown"&&c.button!==0)&&!r.props.isDisabled){var l=r.props,d=l.isMulti,f=l.menuIsOpen;r.focusInput(),f?(r.setState({inputIsHiddenAfterUpdate:!d}),r.onMenuClose()):r.openMenu("first"),c.preventDefault()}},r.onClearIndicatorMouseDown=function(c){c&&c.type==="mousedown"&&c.button!==0||(r.clearValue(),c.preventDefault(),r.openAfterFocus=!1,c.type==="touchend"?r.focusInput():setTimeout(function(){return r.focusInput()}))},r.onScroll=function(c){typeof r.props.closeMenuOnScroll=="boolean"?c.target instanceof HTMLElement&&yr(c.target)&&r.props.onMenuClose():typeof r.props.closeMenuOnScroll=="function"&&r.props.closeMenuOnScroll(c)&&r.props.onMenuClose()},r.onCompositionStart=function(){r.isComposing=!0},r.onCompositionEnd=function(){r.isComposing=!1},r.onTouchStart=function(c){var l=c.touches,d=l&&l.item(0);d&&(r.initialTouchX=d.clientX,r.initialTouchY=d.clientY,r.userIsDragging=!1)},r.onTouchMove=function(c){var l=c.touches,d=l&&l.item(0);if(d){var f=Math.abs(d.clientX-r.initialTouchX),h=Math.abs(d.clientY-r.initialTouchY),p=5;r.userIsDragging=f>p||h>p}},r.onTouchEnd=function(c){r.userIsDragging||(r.controlRef&&!r.controlRef.contains(c.target)&&r.menuListRef&&!r.menuListRef.contains(c.target)&&r.blurInput(),r.initialTouchX=0,r.initialTouchY=0)},r.onControlTouchEnd=function(c){r.userIsDragging||r.onControlMouseDown(c)},r.onClearIndicatorTouchEnd=function(c){r.userIsDragging||r.onClearIndicatorMouseDown(c)},r.onDropdownIndicatorTouchEnd=function(c){r.userIsDragging||r.onDropdownIndicatorMouseDown(c)},r.handleInputChange=function(c){var l=r.props.inputValue,d=c.currentTarget.value;r.setState({inputIsHiddenAfterUpdate:!1}),r.onInputChange(d,{action:"input-change",prevInputValue:l}),r.props.menuIsOpen||r.onMenuOpen()},r.onInputFocus=function(c){r.props.onFocus&&r.props.onFocus(c),r.setState({inputIsHiddenAfterUpdate:!1,isFocused:!0}),(r.openAfterFocus||r.props.openMenuOnFocus)&&r.openMenu("first"),r.openAfterFocus=!1},r.onInputBlur=function(c){var l=r.props.inputValue;if(r.menuListRef&&r.menuListRef.contains(document.activeElement)){r.inputRef.focus();return}r.props.onBlur&&r.props.onBlur(c),r.onInputChange("",{action:"input-blur",prevInputValue:l}),r.onMenuClose(),r.setState({focusedValue:null,isFocused:!1})},r.onOptionHover=function(c){if(!(r.blockOptionHover||r.state.focusedOption===c)){var l=r.getFocusableOptions(),d=l.indexOf(c);r.setState({focusedOption:c,focusedOptionId:d>-1?r.getFocusedOptionId(c):null})}},r.shouldHideSelectedOptions=function(){return Lc(r.props)},r.onValueInputFocus=function(c){c.preventDefault(),c.stopPropagation(),r.focus()},r.onKeyDown=function(c){var l=r.props,d=l.isMulti,f=l.backspaceRemovesValue,h=l.escapeClearsValue,p=l.inputValue,m=l.isClearable,g=l.isDisabled,v=l.menuIsOpen,x=l.onKeyDown,y=l.tabSelectsValue,C=l.openMenuOnFocus,O=r.state,w=O.focusedOption,E=O.focusedValue,S=O.selectValue;if(!g&&!(typeof x=="function"&&(x(c),c.defaultPrevented))){switch(r.blockOptionHover=!0,c.key){case"ArrowLeft":if(!d||p)return;r.focusValue("previous");break;case"ArrowRight":if(!d||p)return;r.focusValue("next");break;case"Delete":case"Backspace":if(p)return;if(E)r.removeValue(E);else{if(!f)return;d?r.popValue():m&&r.clearValue()}break;case"Tab":if(r.isComposing||c.shiftKey||!v||!y||!w||C&&r.isOptionSelected(w,S))return;r.selectOption(w);break;case"Enter":if(c.keyCode===229)break;if(v){if(!w||r.isComposing)return;r.selectOption(w);break}return;case"Escape":v?(r.setState({inputIsHiddenAfterUpdate:!1}),r.onInputChange("",{action:"menu-close",prevInputValue:p}),r.onMenuClose()):m&&h&&r.clearValue();break;case" ":if(p)return;if(!v){r.openMenu("first");break}if(!w)return;r.selectOption(w);break;case"ArrowUp":v?r.focusOption("up"):r.openMenu("last");break;case"ArrowDown":v?r.focusOption("down"):r.openMenu("first");break;case"PageUp":if(!v)return;r.focusOption("pageup");break;case"PageDown":if(!v)return;r.focusOption("pagedown");break;case"Home":if(!v)return;r.focusOption("first");break;case"End":if(!v)return;r.focusOption("last");break;default:return}c.preventDefault()}},r.state.instancePrefix="react-select-"+(r.props.instanceId||++ig),r.state.selectValue=na(s.value),s.menuIsOpen&&r.state.selectValue.length){var o=r.getFocusableOptionsWithIds(),a=r.buildFocusableOptions(),i=a.indexOf(r.state.selectValue[0]);r.state.focusableOptionsWithIds=o,r.state.focusedOption=a[i],r.state.focusedOptionId=$r(o,a[i])}return r}return W0(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&&ra(this.menuListRef,this.focusedOptionRef),Gm()&&this.setState({isAppleDevice:!0})}},{key:"componentDidUpdate",value:function(r){var o=this.props,a=o.isDisabled,i=o.menuIsOpen,c=this.state.isFocused;(c&&!a&&r.isDisabled||c&&i&&!r.menuIsOpen)&&this.focusInput(),c&&a&&!r.isDisabled?this.setState({isFocused:!1},this.onMenuClose):!c&&!a&&r.isDisabled&&this.inputRef===document.activeElement&&this.setState({isFocused:!0}),this.menuListRef&&this.focusedOptionRef&&this.scrollToFocusedOptionOnUpdate&&(ra(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,i=a.selectValue,c=a.isFocused,l=this.buildFocusableOptions(),d=r==="first"?0:l.length-1;if(!this.props.isMulti){var f=l.indexOf(i[0]);f>-1&&(d=f)}this.scrollToFocusedOptionOnUpdate=!(c&&this.menuListRef),this.setState({inputIsHiddenAfterUpdate:!1,focusedValue:null,focusedOption:l[d],focusedOptionId:this.getFocusedOptionId(l[d])},function(){return o.onMenuOpen()})}},{key:"focusValue",value:function(r){var o=this.state,a=o.selectValue,i=o.focusedValue;if(this.props.isMulti){this.setState({focusedOption:null});var c=a.indexOf(i);i||(c=-1);var l=a.length-1,d=-1;if(a.length){switch(r){case"previous":c===0?d=0:c===-1?d=l:d=c-1;break;case"next":c>-1&&c<l&&(d=c+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,i=this.getFocusableOptions();if(i.length){var c=0,l=i.indexOf(a);a||(l=-1),r==="up"?c=l>0?l-1:i.length-1:r==="down"?c=(l+1)%i.length:r==="pageup"?(c=l-o,c<0&&(c=0)):r==="pagedown"?(c=l+o,c>i.length-1&&(c=i.length-1)):r==="last"&&(c=i.length-1),this.scrollToFocusedOptionOnUpdate=!0,this.setState({focusedOption:i[c],focusedValue:null,focusedOptionId:this.getFocusedOptionId(i[c])})}}},{key:"getTheme",value:(function(){return this.props.theme?typeof this.props.theme=="function"?this.props.theme(Fr):L(L({},Fr),this.props.theme):Fr})},{key:"getCommonProps",value:function(){var r=this.clearValue,o=this.cx,a=this.getStyles,i=this.getClassNames,c=this.getValue,l=this.selectOption,d=this.setValue,f=this.props,h=f.isMulti,p=f.isRtl,m=f.options,g=this.hasValue();return{clearValue:r,cx:o,getStyles:a,getClassNames:i,getValue:c,hasValue:g,isMulti:h,isRtl:p,options:m,selectOption:l,selectProps:f,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 Rc(this.props,r,o)}},{key:"isOptionSelected",value:function(r,o){return Dc(this.props,r,o)}},{key:"filterOption",value:function(r,o){return kc(this.props,r,o)}},{key:"formatOptionLabel",value:function(r,o){if(typeof this.props.formatOptionLabel=="function"){var a=this.props.inputValue,i=this.state.selectValue;return this.props.formatOptionLabel(r,{context:o,inputValue:a,selectValue:i})}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,i=r.inputId,c=r.inputValue,l=r.tabIndex,d=r.form,f=r.menuIsOpen,h=r.required,p=this.getComponents(),m=p.Input,g=this.state,v=g.inputIsHidden,x=g.ariaSelection,y=this.commonProps,C=i||this.getElementId("input"),O=L(L(L({"aria-autocomplete":"list","aria-expanded":f,"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":h,role:"combobox","aria-activedescendant":this.state.isAppleDevice?void 0:this.state.focusedOptionId||""},f&&{"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,F({},y,{autoCapitalize:"none",autoComplete:"off",autoCorrect:"off",id:C,innerRef:this.getInputRef,isDisabled:o,isHidden:v,onBlur:this.onInputBlur,onChange:this.handleInputChange,onFocus:this.onInputFocus,spellCheck:"false",tabIndex:l,form:d,type:"text",value:c},O)):b.createElement(Rm,F({id:C,innerRef:this.getInputRef,onBlur:this.onInputBlur,onChange:nr,onFocus:this.onInputFocus,disabled:o,tabIndex:l,inputMode:"none",form:d,value:""},O))})},{key:"renderPlaceholderOrValue",value:function(){var r=this,o=this.getComponents(),a=o.MultiValue,i=o.MultiValueContainer,c=o.MultiValueLabel,l=o.MultiValueRemove,d=o.SingleValue,f=o.Placeholder,h=this.commonProps,p=this.props,m=p.controlShouldRenderValue,g=p.isDisabled,v=p.isMulti,x=p.inputValue,y=p.placeholder,C=this.state,O=C.selectValue,w=C.focusedValue,E=C.isFocused;if(!this.hasValue()||!m)return x?null:b.createElement(f,F({},h,{key:"placeholder",isDisabled:g,isFocused:E,innerProps:{id:this.getElementId("placeholder")}}),y);if(v)return O.map(function(P,j){var M=P===w,A="".concat(r.getOptionLabel(P),"-").concat(r.getOptionValue(P));return b.createElement(a,F({},h,{components:{Container:i,Label:c,Remove:l},isFocused:M,isDisabled:g,key:A,index:j,removeProps:{onClick:function(){return r.removeValue(P)},onTouchEnd:function(){return r.removeValue(P)},onMouseDown:function(k){k.preventDefault()}},data:P}),r.formatOptionLabel(P,"value"))});if(x)return null;var S=O[0];return b.createElement(d,F({},h,{data:S,isDisabled:g}),this.formatOptionLabel(S,"value"))}},{key:"renderClearIndicator",value:function(){var r=this.getComponents(),o=r.ClearIndicator,a=this.commonProps,i=this.props,c=i.isDisabled,l=i.isLoading,d=this.state.isFocused;if(!this.isClearable()||!o||c||!this.hasValue()||l)return null;var f={onMouseDown:this.onClearIndicatorMouseDown,onTouchEnd:this.onClearIndicatorTouchEnd,"aria-hidden":"true"};return b.createElement(o,F({},a,{innerProps:f,isFocused:d}))}},{key:"renderLoadingIndicator",value:function(){var r=this.getComponents(),o=r.LoadingIndicator,a=this.commonProps,i=this.props,c=i.isDisabled,l=i.isLoading,d=this.state.isFocused;if(!o||!l)return null;var f={"aria-hidden":"true"};return b.createElement(o,F({},a,{innerProps:f,isDisabled:c,isFocused:d}))}},{key:"renderIndicatorSeparator",value:function(){var r=this.getComponents(),o=r.DropdownIndicator,a=r.IndicatorSeparator;if(!o||!a)return null;var i=this.commonProps,c=this.props.isDisabled,l=this.state.isFocused;return b.createElement(a,F({},i,{isDisabled:c,isFocused:l}))}},{key:"renderDropdownIndicator",value:function(){var r=this.getComponents(),o=r.DropdownIndicator;if(!o)return null;var a=this.commonProps,i=this.props.isDisabled,c=this.state.isFocused,l={onMouseDown:this.onDropdownIndicatorMouseDown,onTouchEnd:this.onDropdownIndicatorTouchEnd,"aria-hidden":"true"};return b.createElement(o,F({},a,{innerProps:l,isDisabled:i,isFocused:c}))}},{key:"renderMenu",value:function(){var r=this,o=this.getComponents(),a=o.Group,i=o.GroupHeading,c=o.Menu,l=o.MenuList,d=o.MenuPortal,f=o.LoadingMessage,h=o.NoOptionsMessage,p=o.Option,m=this.commonProps,g=this.state.focusedOption,v=this.props,x=v.captureMenuScroll,y=v.inputValue,C=v.isLoading,O=v.loadingMessage,w=v.minMenuHeight,E=v.maxMenuHeight,S=v.menuIsOpen,P=v.menuPlacement,j=v.menuPosition,M=v.menuPortalTarget,A=v.menuShouldBlockScroll,R=v.menuShouldScrollIntoView,k=v.noOptionsMessage,z=v.onMenuScrollToTop,$=v.onMenuScrollToBottom;if(!S)return null;var B=function(Y,X){var re=Y.type,Z=Y.data,V=Y.isDisabled,se=Y.isSelected,Oe=Y.label,En=Y.value,Ao=g===Z,Ro=V?void 0:function(){return r.onOptionHover(Z)},Nu=V?void 0:function(){return r.selectOption(Z)},Do="".concat(r.getElementId("option"),"-").concat(X),Mu={id:Do,onClick:Nu,onMouseMove:Ro,onMouseOver:Ro,tabIndex:-1,role:"option","aria-selected":r.state.isAppleDevice?void 0:se};return b.createElement(p,F({},m,{innerProps:Mu,data:Z,isDisabled:V,isSelected:se,key:Do,label:Oe,type:re,value:En,isFocused:Ao,innerRef:Ao?r.getFocusedOptionRef:void 0}),r.formatOptionLabel(Y.data,"menu"))},G;if(this.hasOptions())G=this.getCategorizedOptions().map(function(U){if(U.type==="group"){var Y=U.data,X=U.options,re=U.index,Z="".concat(r.getElementId("group"),"-").concat(re),V="".concat(Z,"-heading");return b.createElement(a,F({},m,{key:Z,data:Y,options:X,Heading:i,headingProps:{id:V,data:U.data},label:r.formatGroupLabel(U.data)}),U.options.map(function(se){return B(se,"".concat(re,"-").concat(se.index))}))}else if(U.type==="option")return B(U,"".concat(U.index))});else if(C){var q=O({inputValue:y});if(q===null)return null;G=b.createElement(f,m,q)}else{var ee=k({inputValue:y});if(ee===null)return null;G=b.createElement(h,m,ee)}var ne={minMenuHeight:w,maxMenuHeight:E,menuPlacement:P,menuPosition:j,menuShouldScrollIntoView:R},ie=b.createElement(fp,F({},m,ne),function(U){var Y=U.ref,X=U.placerProps,re=X.placement,Z=X.maxHeight;return b.createElement(c,F({},m,ne,{innerRef:Y,innerProps:{onMouseDown:r.onMenuMouseDown,onMouseMove:r.onMenuMouseMove},isLoading:C,placement:re}),b.createElement(zm,{captureEnabled:x,onTopArrive:z,onBottomArrive:$,lockEnabled:A},function(V){return b.createElement(l,F({},m,{innerRef:function(Oe){r.getMenuListRef(Oe),V(Oe)},innerProps:{role:"listbox","aria-multiselectable":m.isMulti,id:r.getElementId("listbox")},isLoading:C,maxHeight:Z,focusedOption:g}),G)}))});return M||j==="fixed"?b.createElement(d,F({},m,{appendTo:M,controlElement:this.controlRef,menuPlacement:P,menuPosition:j}),ie):ie}},{key:"renderFormField",value:function(){var r=this,o=this.props,a=o.delimiter,i=o.isDisabled,c=o.isMulti,l=o.name,d=o.required,f=this.state.selectValue;if(d&&!this.hasValue()&&!i)return b.createElement(Vm,{name:l,onFocus:this.onValueInputFocus});if(!(!l||i))if(c)if(a){var h=f.map(function(g){return r.getOptionValue(g)}).join(a);return b.createElement("input",{name:l,type:"hidden",value:h})}else{var p=f.length>0?f.map(function(g,v){return b.createElement("input",{key:"i-".concat(v),name:l,type:"hidden",value:r.getOptionValue(g)})}):b.createElement("input",{name:l,type:"hidden",value:""});return b.createElement("div",null,p)}else{var m=f[0]?this.getOptionValue(f[0]):"";return b.createElement("input",{name:l,type:"hidden",value:m})}}},{key:"renderLiveRegion",value:function(){var r=this.commonProps,o=this.state,a=o.ariaSelection,i=o.focusedOption,c=o.focusedValue,l=o.isFocused,d=o.selectValue,f=this.getFocusableOptions();return b.createElement(jm,F({},r,{id:this.getElementId("live-region"),ariaSelection:a,focusedOption:i,focusedValue:c,isFocused:l,selectValue:d,focusableOptions:f,isAppleDevice:this.state.isAppleDevice}))}},{key:"render",value:function(){var r=this.getComponents(),o=r.Control,a=r.IndicatorsContainer,i=r.SelectContainer,c=r.ValueContainer,l=this.props,d=l.className,f=l.id,h=l.isDisabled,p=l.menuIsOpen,m=this.state.isFocused,g=this.commonProps=this.getCommonProps();return b.createElement(i,F({},g,{className:d,innerProps:{id:f,onKeyDown:this.onKeyDown},isDisabled:h,isFocused:m}),this.renderLiveRegion(),b.createElement(o,F({},g,{innerRef:this.getControlRef,innerProps:{onMouseDown:this.onControlMouseDown,onTouchEnd:this.onControlTouchEnd},isDisabled:h,isFocused:m,menuIsOpen:p}),b.createElement(c,F({},g,{isDisabled:h}),this.renderPlaceholderOrValue(),this.renderInput()),b.createElement(a,F({},g,{isDisabled:h}),this.renderClearIndicator(),this.renderLoadingIndicator(),this.renderIndicatorSeparator(),this.renderDropdownIndicator())),this.renderMenu(),this.renderFormField())}}],[{key:"getDerivedStateFromProps",value:function(r,o){var a=o.prevProps,i=o.clearFocusValueOnUpdate,c=o.inputIsHiddenAfterUpdate,l=o.ariaSelection,d=o.isFocused,f=o.prevWasFocused,h=o.instancePrefix,p=r.options,m=r.value,g=r.menuIsOpen,v=r.inputValue,x=r.isMulti,y=na(m),C={};if(a&&(m!==a.value||p!==a.options||g!==a.menuIsOpen||v!==a.inputValue)){var O=g?sg(r,y):[],w=g?ba(Gn(r,y),"".concat(h,"-option")):[],E=i?og(o,y):null,S=ag(o,O),P=$r(w,S);C={selectValue:y,focusedOption:S,focusedOptionId:P,focusableOptionsWithIds:w,focusedValue:E,clearFocusValueOnUpdate:!1}}var j=c!=null&&r!==a?{inputIsHidden:c,inputIsHiddenAfterUpdate:void 0}:{},M=l,A=d&&f;return d&&!A&&(M={value:Tn(x,y,y[0]||null),options:y,action:"initial-input-focus"},A=!f),l?.action==="initial-input-focus"&&(M=null),L(L(L({},C),j),{},{prevProps:r,ariaSelection:M,prevWasFocused:A})}}]),n})(b.Component);Fc.defaultProps=rg;var cg=b.forwardRef(function(e,t){var n=H0(e);return b.createElement(Fc,F({ref:t},n))}),lg=cg;function ug(e){return u.jsx(xr.DropdownIndicator,{...e,children:u.jsx(I,{name:"ChevronDown",size:16})})}function dg(e){return u.jsx(xr.ClearIndicator,{...e,children:u.jsx(I,{name:"Xmark",size:16})})}function fg(e){const{label:t,onClick:n,...s}=e,r=!!t&&!!n;return u.jsxs(xr.MenuList,{...s,children:[e.children,r?u.jsx("button",{className:"w-full px-2 py-3 hover:bg-slate-50",onClick:n,children:t}):null]})}function H6(e){const t=e["aria-invalid"]==="true",{addItemButtonProps:n,...s}=e;return u.jsx(lg,{...s,components:{DropdownIndicator:ug,ClearIndicator:dg,MenuList:r=>fg({...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 _6=e=>{const{children:t,cookies:n,submitLabel:s,rejectLabel:r,onSubmit:o=()=>{},onReject:a=()=>{},...i}=e,[c,l]=b.useState(n),d=h=>{const{id:p,checked:m}=h.target;l(g=>g.map(v=>v.id===p?{...v,value:m}:v))},f="min-w-64 h-8 text-base";return u.jsxs("div",{...ce(i,"flex flex-col items-center"),children:[u.jsx("div",{className:"text-center",children:t}),u.jsx("div",{className:"my-8 flex gap-x-16 text-sm font-medium",children:c.map((h,p)=>u.jsxs("div",{className:"cursor-pointer",children:[u.jsx("input",{checked:h.value,className:"mr-1 size-3 cursor-pointer rounded-sm border-2 border-gray-900 accent-gray-900 focus:outline-none",id:h.id,onChange:d,type:"checkbox"}),u.jsx("label",{className:"cursor-pointer select-none",htmlFor:h.id,children:h.label})]},p))}),u.jsxs("div",{className:"flex gap-x-8",children:[u.jsx(Pe,{className:f,color:"light",onClick:()=>a(),size:"small",children:r},"button-reject"),u.jsx(Pe,{className:f,onClick:()=>o(c),size:"small",children:s},"button-submit")]})]})};function W6(e){const{message:t="Loading editor",...n}=e;return u.jsx("div",{className:"grid h-full place-items-center",...n,children:u.jsxs("div",{className:"-mt-20 grid place-items-center",children:[u.jsx("h3",{className:"mb-4 text-xl",children:t}),u.jsx(L0,{})]})})}function or(e){const{title:t,isOpen:n,onOpenChange:s,children:r,containerClassName:o,toggleClassName:a,contentClassName:i}=e;return u.jsxs("div",{className:N(o),children:[u.jsxs("div",{className:N("flex cursor-pointer justify-between text-gray-500",a),onClick:s,children:[u.jsx("h2",{className:"font-semibold text-inherit",children:t}),u.jsx(I,{className:_s("transition",n?"":"-rotate-90"),size:16,name:"ChevronDown"})]}),u.jsx("div",{className:N("max-h-0 overflow-hidden transition-[max-height] duration-300 ease-in-out",n&&"max-h-screen",i),children:r})]})}function pt(e){return u.jsx("div",{...e,className:N("h-px bg-gray-200",e.className)})}function Qe(e){const{children:t,content:n,open:s,defaultOpen:r,onOpenChange:o,className:a,side:i="top",sideOffset:c=5,delayDuration:l,...d}=e;return u.jsxs(Gd,{defaultOpen:r,delayDuration:l,onOpenChange:o,open:s,children:[u.jsx(qd,{asChild:!0,children:t}),u.jsx(Yd,{children:u.jsx(Qd,{...d,side:i,sideOffset:c,className:N("shadow-tooltip rounded-lg border border-gray-200 bg-white p-2 text-xs",a),children:n})})]})}const $c=Wd,hg=e=>{const{className:t,timestampUtcMs:n,title:s,subtitle:r,onClick:o,isSelected:a=!1}=e,[i,c]=b.useState(!1),l=!!s||!!r||!!n;b.useEffect(()=>{i&&(c(!1),setTimeout(()=>l&&c(!0),50))},[s,r,n,l]);const d=m=>{if(!m)return"";try{return d0(new Date(m),{addSuffix:!0})}catch{return m}},f=u.jsxs("div",{className:"flex flex-col text-xs",children:[!!s&&u.jsx("div",{children:s}),!!r&&u.jsx("div",{className:"text-gray-300",children:r}),!!n&&u.jsx("div",{children:d(n)})]}),h=()=>{l&&c(!0)},p=()=>{c(!1)};return u.jsxs("div",{className:"relative",onMouseEnter:h,onMouseLeave:p,children:[a&&u.jsx(I,{name:"TimelineCaret",color:"#4EA9FF",size:10,className:"absolute top-[-11px] z-40"}),u.jsx(Qe,{className:"rounded-md bg-gray-900 text-white",content:f,open:i&&l,onOpenChange:c,delayDuration:0,side:"bottom",sideOffset:5,children:u.jsx("div",{className:N("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:u.jsx("div",{className:"h-0.5 w-1 rounded-full bg-gray-500"})})})]})},ya=(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]"}},pg=e=>{if(!e)return"";try{const t=f0(e);return Zn(t,"HH:mm, dd, MMMM")}catch{return e}},mg=({onClick:e,className:t,timestampUtcMs:n,additions:s,deletions:r,addSize:o=0,delSize:a=0,isSelected:i=!1})=>{const[c,l]=b.useState(!1),d=o===0&&a===0,f=ya(o),h=ya(a),p=u.jsxs("div",{className:"flex flex-col text-xs",children:[u.jsx("div",{children:pg(n)}),u.jsx("div",{className:"text-green-900",children:`${s} additions +`}),u.jsx("div",{className:"text-red-700",children:`${r} deletions -`})]}),m=()=>{d||l(!0)},g=()=>{l(!1)};return u.jsxs("div",{className:"relative",onMouseEnter:m,onMouseLeave:g,children:[i&&u.jsx(I,{name:"TimelineCaret",color:"#4EA9FF",size:10,className:"absolute left-[-2px] top-[-11px] z-40"}),d?u.jsx("div",{className:N("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:u.jsx("div",{className:"size-[3px] rounded-full bg-gray-500"})}):u.jsx(Qe,{className:"rounded-md bg-gray-900 text-white",content:p,open:c,onOpenChange:l,delayDuration:0,side:"bottom",sideOffset:5,children:u.jsxs("div",{className:N("flex h-[25px] w-1.5 cursor-pointer flex-col items-center justify-center rounded-[2px] hover:bg-blue-300",t,i&&"bg-blue-300"),"data-timestamp":n,onClick:e,children:[u.jsx("div",{className:"flex h-3 w-0.5 items-end",children:u.jsx("div",{className:N("h-3 w-0.5 rounded-t-full bg-green-600",f)})}),u.jsx("div",{className:"flex h-3 w-0.5 items-start",children:u.jsx("div",{className:N("h-3 w-0.5 rounded-b-full bg-red-600",h)})})]})})]})},xa={id:"default",type:"bar",addSize:0,delSize:0},gg=e=>{const{timeline:t=[],onItemClick:n}=e,[s,r]=b.useState(null),o=b.useRef(null),a=p=>{p.id===s||p.id===xa.id?(n?.(null),r(null)):(n?.(p),r(p.id))},i=[...t,xa],[c,l]=b.useMemo(()=>{const p=i.findIndex(m=>m.id===s);return p===-1?[i,[]]:[i.slice(0,p),i.slice(p)]},[i,s]),d=b.useCallback(p=>p.map(m=>{if(m.type==="divider"){const{timestampUtcMs:g,title:v,subtitle:x}=m;return u.jsx(hg,{timestampUtcMs:g,title:v,subtitle:x,onClick:()=>a(m),isSelected:m.id===s},m.id)}return u.jsx(mg,{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]),f=b.useMemo(()=>d(c),[c,d]),h=b.useMemo(()=>d(l),[l,d]);return b.useEffect(()=>{o.current&&(o.current.scrollLeft=o.current.scrollWidth)},[]),u.jsx($c,{delayDuration:0,skipDelayDuration:0,children:u.jsxs("div",{className:"relative h-[36px] w-full",children:[u.jsx("div",{className:"absolute left-[0px] z-[20] h-[17px] w-[6px] bg-white",children:u.jsx("div",{className:"mt-[11px] h-[6px] w-[6px] rounded-tl-md bg-slate-50"})}),u.jsx("div",{className:"absolute right-[0px] top-[11px] z-[20] h-[6px] w-[6px] bg-white",children:u.jsx("div",{className:"h-[6px] w-[6px] rounded-tr-md bg-slate-50"})}),u.jsx("div",{className:"absolute inset-x-0 bottom-0 h-[25px] rounded-md bg-slate-50"}),u.jsx("div",{className:"absolute inset-x-0 bottom-0 h-[36px]",children:u.jsx("div",{ref:o,className:"h-full overflow-x-auto rounded-md",children:u.jsxs("div",{className:"ml-auto flex h-[36px] w-max items-end px-2 pb-0",children:[u.jsx("div",{className:"flex",children:f}),u.jsx("div",{className:"flex rounded-sm bg-blue-200",children:h})]})})}),u.jsx("div",{className:"pointer-events-none absolute bottom-0 left-0 z-10 h-[25px] w-2 rounded-l-md bg-slate-50"}),u.jsx("div",{className:"pointer-events-none absolute bottom-0 right-0 z-10 h-[25px] w-2 rounded-r-md bg-slate-50"})]})})};function bg(e){const[t,n]=Du(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(md())},redo:()=>{n(pd())},canUndo:o,canRedo:a}}function vg(e){return[]}const G6=e=>{const{onClose:t,children:n,onExport:s,className:r,document:o,onSwitchboardLinkClick:a,enabledControls:i=["undo","redo","export","history"],defaultTimelineVisible:c=!0,disableRevisionHistory:l=!1,initialTimelineVisible:d=!1,...f}=e,[h]=ku(),p=o??h,m=p?.header.name||void 0,g=Lu(p?.header.id),v=t??(()=>vt(g)),x=async $=>{$&&(s?s($):await Uu($))},y=bg(p?.header.id),C=!y.canUndo,O=!y.canRedo,w=vg(p?.header.id),[E,S]=b.useState(d),P=Fu(p),M=a??(P?async()=>{if(P)try{const $=await P();window.open($,"_blank")}catch($){console.error("Error opening switchboard link:",$)}}:void 0),A=!p,R=!M,k=w.length===0;b.useEffect(()=>{typeof d=="boolean"&&S(d)},[d]);const z=()=>{k||S(!E)};return u.jsxs("div",{className:"flex w-full flex-col",...f,children:[u.jsxs("div",{className:N("flex h-12 w-full items-center justify-between rounded-xl border border-gray-200 bg-slate-50 px-4",r),children:[u.jsxs("div",{className:"flex items-center gap-x-2",children:[i.includes("undo")&&u.jsx("button",{className:N("grid size-8 place-items-center rounded-lg border border-gray-200 bg-white",C?"cursor-not-allowed":"cursor-pointer active:opacity-70"),onClick:y.undo,disabled:C,children:u.jsx(I,{name:"ArrowCouterclockwise",size:16,className:C?"text-gray-500":"text-gray-900"})}),i.includes("redo")&&u.jsx("button",{className:N("grid size-8 place-items-center rounded-lg border border-gray-200 bg-white",O?"cursor-not-allowed":"cursor-pointer active:opacity-70"),onClick:y.redo,disabled:O,children:u.jsx("div",{className:"-scale-x-100",children:u.jsx(I,{name:"ArrowCouterclockwise",size:16,className:O?"text-gray-500":"text-gray-900"})})}),i.includes("export")&&u.jsx("button",{className:N("flex h-8 items-center rounded-lg border border-gray-200 bg-white px-3 text-sm",A?"cursor-not-allowed":"cursor-pointer active:opacity-70"),onClick:()=>void x(p),disabled:A,children:u.jsx("span",{className:A?"text-gray-500":"text-gray-900",children:"Export"})})]}),u.jsx("div",{className:"flex items-center",children:u.jsx("h1",{className:"text-sm font-medium text-gray-500",children:m})}),u.jsxs("div",{className:"flex items-center gap-x-2",children:[!R&&u.jsx("button",{className:N("grid size-8 place-items-center rounded-lg border border-gray-200 bg-white","cursor-pointer active:opacity-70"),onClick:M,disabled:R,children:u.jsx(I,{name:"Drive",size:16,className:"text-gray-900"})}),i.includes("history")&&u.jsx("button",{className:N("grid size-8 place-items-center rounded-lg border border-gray-200 bg-white",l?"cursor-not-allowed":"cursor-pointer active:opacity-70"),onClick:$u,disabled:l,children:u.jsx(I,{name:"History",size:16,className:l?"text-gray-500":"text-gray-900"})}),i.includes("timeline")&&c&&u.jsx("button",{className:N("grid size-8 place-items-center rounded-lg border border-gray-200 bg-white",k?"cursor-not-allowed":"cursor-pointer active:opacity-70"),onClick:z,disabled:k,"aria-pressed":E,children:u.jsx(I,{name:"Timeline",size:16,className:N("text-gray-900",k&&"opacity-50",E&&"text-blue-600")})}),u.jsx("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:v,children:u.jsx(I,{name:"XmarkLight",size:16,className:"text-gray-900"})})]})]}),E&&u.jsx("div",{className:"mt-2 w-full",children:u.jsx(gg,{timeline:w,onItemClick:zu})}),n]})};function zc(e){const{target:t,onAddFileOverride:n,trackNestedDrag:s=!1,acceptedFileExtensions:r}=e??{},[o,a]=b.useState(!1),i=b.useRef(0),{onMoveNode:c,onCopyNode:l,onAddFile:d}=Vs(),f=n??d,h=b.useCallback(y=>!r||r.length===0||y.types.includes("UI_NODE")?!0:y.types.includes("Files")?Array.from(y.items).some(O=>{if(O.kind==="file"){if(O.type==="application/zip"||O.type==="application/x-zip-compressed")return r.includes(".zip");if(O.type===""||O.type==="application/octet-stream")return!0}return!1}):!1,[r]),p=b.useCallback(y=>{y.preventDefault(),y.stopPropagation(),h(y.dataTransfer)?a(!0):y.dataTransfer.dropEffect="none"},[h]),m=b.useCallback(y=>{y.preventDefault(),y.stopPropagation(),h(y.dataTransfer)&&(i.current+=1,a(!0))},[h]),g=b.useCallback(y=>{y.preventDefault(),y.stopPropagation(),i.current=Math.max(0,i.current-1),i.current===0&&a(!1)},[]),v=b.useCallback(()=>{a(!1)},[]),x=b.useCallback(async y=>{y.preventDefault();const O=y.target.closest("[data-drop-zone]"),w=t?.id||"root";if((O?.getAttribute("data-drop-zone")||"root")!==w){a(!1);return}try{let S=yg(y.dataTransfer.items).filter(Boolean);if(r&&r.length>0&&(S=S.filter(A=>{if(!A)return!1;const R=A.name.toLowerCase();return r.some(k=>R.endsWith(k.toLowerCase()))})),S.length){for(const A of S)A&&await f(A,t);return}const P=y.getModifierState("Alt"),j=y.dataTransfer.getData("UI_NODE"),M=JSON.parse(j);P?await l(M,t):await c(M,t)}catch(S){console.error(S)}finally{s&&(i.current=0),a(!1)}},[f,l,c,t,s]);return b.useMemo(()=>{const y={onDragOver:p,onDrop:x,"data-drop-zone":t?.id||"root"};return s?(y.onDragEnter=m,y.onDragLeave=g):y.onDragLeave=v,{isDropTarget:o,dropProps:y}},[o,t?.id,m,g,v,p,x,s])}function yg(e){return Array.from(e).map(n=>n.kind==="file"?n.getAsFile():null).filter(Boolean)}const wa="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 xg(e){const{title:t="Document Already Exists",fileName:n,message:s,children:r,onReplace:o,onOpenChange:a,onDuplicate:i,replaceLabel:c="Replace",duplicateLabel:l="Create Copy",overlayProps:d,contentProps:f,bodyProps:h={},headerProps:p={},containerProps:m={},replaceButtonProps:g={},duplicateButtonProps:v={},buttonContainerProps:x={},...y}=e,C=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 u.jsx(Ye,{contentProps:{...f,className:N("rounded-3xl",f?.className)},onOpenChange:a,overlayProps:{...d,className:d?.className},...y,children:u.jsxs("div",{...ce(m,"w-[450px] p-6 text-slate-300"),children:[u.jsxs("div",{className:"flex items-center justify-between border-b border-slate-50 pb-2",children:[u.jsx("div",{...ce(p,"text-2xl font-bold text-gray-800"),children:t}),u.jsx("button",{type:"button",className:"flex size-6 items-center justify-center rounded-md outline-none hover:bg-slate-100",onClick:()=>a?.(!1),children:u.jsx(I,{name:"XmarkLight",size:24})})]}),u.jsxs("div",{...ce(h,"my-6 rounded-md bg-slate-50 p-4 text-center"),children:[s||C,r]}),u.jsxs("div",{...ce(x,"mt-8 flex justify-between gap-3"),children:[u.jsx("button",{onClick:o,...ce(g,N(wa,"flex-1 bg-slate-50 text-slate-800")),children:c}),u.jsx("button",{onClick:i,...ce(v,N(wa,"flex-1 bg-gray-800 text-gray-50")),children:l})]})]})})}function wg(e){const{status:t,errorDetails:n}=e;return(t==="failed"||t==="unsupported-document-type")&&n?u.jsx("div",{className:"break-words text-xs leading-[18px] text-gray-500",children:n}):null}function Cg(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 Sg(e){const{fileName:t,fileSize:n,documentType:s,onClose:r,...o}=e;return u.jsxs("div",{className:"flex items-center gap-2",...o,children:[u.jsx("div",{className:"flex h-9 w-7 flex-shrink-0 items-center justify-center",children:u.jsx(I,{name:Cg(s),size:48,className:"text-gray-600"})}),u.jsxs("div",{className:"flex flex-1 flex-col gap-0.5",children:[u.jsx("div",{className:"text-xs font-medium leading-[18px] text-gray-900",children:t}),u.jsx("div",{className:"text-xs font-medium leading-[18px] text-gray-500",children:n})]}),r&&u.jsx("div",{className:"flex h-9 w-[18px] flex-shrink-0 items-start justify-center",children:u.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:u.jsx(I,{name:"XmarkLight",size:18})})})]})}function Eg(e){const{status:t,progress:n=0}=e;if(t!=="uploading")return null;const s=Math.min(100,Math.max(0,n));return u.jsx("div",{className:"h-2 w-full overflow-hidden rounded-sm bg-gray-200",children:u.jsx("div",{className:"h-full bg-blue-900 transition-all duration-300 ease-out",style:{width:`${s}%`}})})}function Pg(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 Og(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 Ig(e){return e==="success"?"Open Document":e==="pending"||e==="conflict"?"Find resolution":""}function Ng(e){const{status:t,progress:n=0,onOpenDocument:s,onFindResolution:r}=e,o=()=>{t==="success"&&s?s():(t==="pending"||t==="conflict")&&r&&r()};return u.jsxs("div",{className:"flex items-center justify-between gap-2",children:[u.jsx("div",{className:N("text-xs leading-[18px]",Og(t)),children:Pg(t)}),t==="uploading"&&u.jsxs("div",{className:"text-xs font-medium leading-[18px] text-gray-900",children:[Math.round(n),"%"]}),jg(t,s,r)&&u.jsx("button",{type:"button",onClick:o,className:"text-xs leading-[18px] text-blue-900 hover:opacity-80",children:Ig(t)})]})}const Mg=b.forwardRef(function(t,n){const{fileName:s,fileSize:r,status:o,documentType:a,progress:i=0,errorDetails:c,onClose:l,onOpenDocument:d,onFindResolution:f,className:h,...p}=t;return u.jsxs("div",{ref:n,className:N("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)]",h),...p,children:[u.jsx(Sg,{fileName:s,fileSize:r,documentType:a,onClose:l}),u.jsxs("div",{className:"flex flex-col gap-1",children:[u.jsx(Ng,{status:o,progress:i,onOpenDocument:d,onFindResolution:f}),u.jsx(Eg,{status:o,progress:i}),u.jsx(wg,{status:o,errorDetails:c})]})]})});function Tg(e,t){return t||`Uploading ${e} document${e===1?"":"s"}`}function Ag(e){const{items:t,title:n,defaultCollapsed:s=!1,onClose:r,className:o,...a}=e,[i,c]=b.useState(s),l=b.useMemo(()=>Tg(t.length,n),[t.length,n]);return u.jsxs("div",{className:N("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:[u.jsxs("div",{className:"flex items-center justify-between",children:[u.jsx("button",{type:"button","aria-expanded":!i,"aria-label":i?"Expand list":"Collapse list",onClick:()=>c(d=>!d),className:"min-w-0 flex-1 text-left text-sm font-medium leading-4 text-gray-900 hover:opacity-80",children:l}),u.jsxs("div",{className:"flex shrink-0 items-center gap-4",children:[u.jsx("button",{type:"button","aria-label":i?"Expand":"Collapse",onClick:()=>c(d=>!d),className:"text-gray-900 hover:opacity-80",children:u.jsx("span",{className:N("inline-block h-4 w-4 select-none transition-transform",i?"-rotate-90":"rotate-0"),children:u.jsx(I,{name:"CaretDown",size:16,"aria-hidden":"true"})})}),r&&u.jsx("button",{type:"button","aria-label":"Close",onClick:r,className:"text-gray-900 hover:opacity-80",children:u.jsx("span",{className:"inline-block h-4 w-4 select-none",children:u.jsx(I,{name:"XmarkLight",size:16,"aria-hidden":"true"})})})]})]}),!i&&u.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,f)=>u.jsx(Mg,{...d},`${d.fileName}-${f}`))})]})}function Rg(){return`upload_${Date.now()}_${Math.random().toString(36).substring(2,9)}`}function Dg(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 kg(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 Lg(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 Fg(e){const{uploadsArray:t,uploadsCount:n,removeUpload:s,clearAllUploads:r,setSelectedNode:o,onClose:a,onConflictResolution:i,className:c,...l}=e;if(n===0)return null;const d=Lg(t,s,o,i),f=a??r;return u.jsx("div",{className:N("fixed bottom-4 right-4 z-[1001]",c),...l,children:u.jsx(Ag,{items:d,onClose:f})})}function $g(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:kg(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 zg(e=!1,t){const n=b.useCallback(()=>{if(e&&t)try{const h=localStorage.getItem(`uploadTracker_${t}`);return h?JSON.parse(h):{}}catch(h){return console.error("Failed to load upload tracker from localStorage:",h),{}}return{}},[e,t]),[s,r]=b.useReducer($g,n());b.useEffect(()=>{if(e&&t)try{localStorage.setItem(`uploadTracker_${t}`,JSON.stringify(s))}catch(h){console.error("Failed to save upload tracker to localStorage:",h)}},[s,e,t]);const o=b.useCallback(h=>{if(h)return async(p,m)=>{const g=Rg();r({type:"ADD_UPLOAD",payload:{id:g,fileName:p.name,fileSize:Dg(p.size)}});const v=x=>{r({type:"UPDATE_PROGRESS",payload:{id:g,progress:x}}),x.stage==="conflict"&&r({type:"SET_CONFLICT_DATA",payload:{id:g,file:p,parentNode:m}})};try{const x=await h(p,m,v);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(h=>{r({type:"REMOVE_UPLOAD",payload:{id:h}})},[]),i=b.useCallback(()=>{r({type:"CLEAR_ALL_UPLOADS"})},[]),c=b.useCallback(()=>{r({type:"CLEAR_CONFLICTED_UPLOADS"})},[]),l=b.useCallback(()=>Object.values(s),[s]),d=b.useCallback(()=>Object.keys(s).length,[s]),f=b.useCallback((h,p,m)=>{const g=s[h];if(!g?.file||!m){console.error("Cannot resolve conflict: missing upload data or onAddFile function");return}const v=y=>{r({type:"UPDATE_PROGRESS",payload:{id:h,progress:y}})},x=m(g.file,g.parentNode,v,p);Promise.resolve(x).then(y=>{y&&r({type:"SET_FILE_NODE",payload:{id:h,fileNode:y}})}).catch(y=>{r({type:"SET_ERROR",payload:{id:h,error:y instanceof Error?y.message:"Unknown error"}})})},[s]);return{uploads:s,uploadsArray:l(),uploadsCount:d(),createUploadHandler:o,removeUpload:a,clearAllUploads:i,clearConflictedUploads:c,resolveConflict:f}}function Ug(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:i=!1,driveId:c,acceptedFileExtensions:l=[".zip",".phd",".phdm"],className:d,...f}=e,[h,p]=b.useState(!1),[m,g]=b.useState(null),{uploadsArray:v,uploadsCount:x,createUploadHandler:y,clearAllUploads:C,clearConflictedUploads:O,removeUpload:w,resolveConflict:E}=zg(i,c);b.useEffect(()=>{O()},[]);const S=y(a)??(async()=>{}),P=z=>{g(z),p(!0)},j=()=>{m&&a&&E(m,"replace",a),p(!1),g(null)},M=()=>{m&&a&&E(m,"duplicate",a),p(!1),g(null)},A=()=>{p(!1),g(null)},{isDropTarget:R,dropProps:k}=zc({target:s,onAddFileOverride:S,trackNestedDrag:!0,acceptedFileExtensions:l});return u.jsxs("div",{className:N("relative",d),...r?k:{},...f,children:[o,r&&R&&u.jsx("div",{className:"fixed inset-0 z-[1000] flex min-h-screen w-screen items-center justify-center bg-black/50",children:u.jsx("div",{className:"rounded-[24px] bg-white p-6 shadow-[1px_4px_15px_rgba(74,88,115,0.25)]",children:u.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:[u.jsx("div",{className:"text-center text-base leading-5 text-zinc-500",children:t}),u.jsx("div",{className:"text-center text-base leading-5 text-zinc-500",children:n}),u.jsx("span",{className:"pointer-events-none absolute -bottom-16 left-1/2 z-10 -translate-x-1/2",children:u.jsx(I,{name:"DocumentIcons",size:144,"aria-hidden":"true"})})]})})}),u.jsx(Fg,{uploadsArray:v,uploadsCount:x,removeUpload:w,clearAllUploads:C,setSelectedNode:vt,onConflictResolution:P}),u.jsx(xg,{open:h,onOpenChange:A,fileName:m?v.find(z=>z?.id===m)?.fileName:void 0,onReplace:j,onDuplicate:M})]})}function q6({children:e,...t}){const n=Bu(),s=Oi(),r=Vu(),o=async(a,i,c,l)=>await r(a,c,l);return!n||!s?u.jsx(u.Fragment,{children:e}):u.jsx(Ug,{onAddFile:o,driveId:s,useLocalStorage:!0,...t,children:e})}function wr(e){const{children:t,items:n,open:s,onItemClick:r,onOpenChange:o,menuClassName:a}=e;return u.jsxs(td,{onOpenChange:o,open:s,children:[u.jsx(nd,{asChild:!0,className:"outline-none",children:t}),u.jsx(rd,{className:N("modal-shadow cursor-pointer rounded-2xl bg-white text-sm font-medium text-slate-500",a),children:n.map(({id:i,label:c,icon:l,className:d})=>u.jsxs(sd,{className:N("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:f=>f.stopPropagation(),onSelect:()=>r(i),children:[l?u.jsx("span",{className:"mr-2 inline-block",children:l}):null,c]},i))})]})}const Bg="/assets/powerhouse-rounded-CeKGGUG4.png",Ca=[{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"}]}],Uc=[{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"}],Vg=[...Uc,{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"}]}],Hg=[...Uc,{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"}]}],Sa=[{name:"text",type:"function",stateMutability:"view",inputs:[{name:"name",type:"bytes32"},{name:"key",type:"string"}],outputs:[{name:"",type:"string"}]}];function Ge(e,{includeName:t=!1}={}){if(e.type!=="function"&&e.type!=="event"&&e.type!=="error")throw new tb(e.type);return`${e.name}(${no(e.inputs,{includeName:t})})`}function no(e,{includeName:t=!1}={}){return e?e.map(n=>_g(n,{includeName:t})).join(t?", ":","):""}function _g(e,{includeName:t}){return e.type.startsWith("tuple")?`(${no(e.components,{includeName:t})})${e.type.slice(5)}`:e.type+(t&&e.name?` ${e.name}`:"")}function lt(e,{strict:t=!0}={}){return!e||typeof e!="string"?!1:t?/^0x[0-9a-fA-F]*$/.test(e):e.startsWith("0x")}function fe(e){return lt(e,{strict:!1})?Math.ceil((e.length-2)/2):e.length}const Bc="2.38.6";let zr={getDocsUrl:({docsBaseUrl:e,docsPath:t="",docsSlug:n})=>t?`${e??"https://viem.sh"}${t}${n?`#${n}`:""}`:void 0,version:`viem@${Bc}`},T=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=zr.getDocsUrl?.({...n,docsPath:r}),a=[t||"An error occurred.","",...n.metaMessages?[...n.metaMessages,""]:[],...o?[`Docs: ${o}`]:[],...s?[`Details: ${s}`]:[],...zr.version?[`Version: ${zr.version}`]:[]].join(`
|
|
6
|
+
`]))),zp=function(t,n){var s=t.isFocused,r=t.size,o=t.theme,a=o.colors,i=o.spacing.baseUnit;return L({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:i*2})},Rr=function(t){var n=t.delay,s=t.offset;return D("span",{css:Zs({animation:"".concat($p," 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"},"","")})},Up=function(t){var n=t.innerProps,s=t.isRtl,r=t.size,o=r===void 0?4:r,a=ze(t,Mp);return D("div",F({},te(L(L({},a),{},{innerProps:n,isRtl:s,size:o}),"loadingIndicator",{indicator:!0,"loading-indicator":!0}),n),D(Rr,{delay:0,offset:s}),D(Rr,{delay:160,offset:!0}),D(Rr,{delay:320,offset:!s}))},Bp=function(t,n){var s=t.isDisabled,r=t.isFocused,o=t.theme,a=o.colors,i=o.borderRadius,c=o.spacing;return L({label:"control",alignItems:"center",cursor:"default",display:"flex",flexWrap:"wrap",justifyContent:"space-between",minHeight:c.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:i,borderStyle:"solid",borderWidth:1,boxShadow:r?"0 0 0 1px ".concat(a.primary):void 0,"&:hover":{borderColor:r?a.primary:a.neutral30}})},Vp=function(t){var n=t.children,s=t.isDisabled,r=t.isFocused,o=t.innerRef,a=t.innerProps,i=t.menuIsOpen;return D("div",F({ref:o},te(t,"control",{control:!0,"control--is-disabled":s,"control--is-focused":r,"control--menu-is-open":i}),a,{"aria-disabled":s||void 0}),n)},Hp=Vp,_p=["data"],Wp=function(t,n){var s=t.theme.spacing;return n?{}:{paddingBottom:s.baseUnit*2,paddingTop:s.baseUnit*2}},Gp=function(t){var n=t.children,s=t.cx,r=t.getStyles,o=t.getClassNames,a=t.Heading,i=t.headingProps,c=t.innerProps,l=t.label,d=t.theme,f=t.selectProps;return D("div",F({},te(t,"group",{group:!0}),c),D(a,F({},i,{selectProps:f,theme:d,getStyles:r,getClassNames:o,cx:s}),l),D("div",null,n))},qp=function(t,n){var s=t.theme,r=s.colors,o=s.spacing;return L({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"})},Yp=function(t){var n=gc(t);n.data;var s=ze(n,_p);return D("div",F({},te(t,"groupHeading",{"group-heading":!0}),s))},Qp=Gp,Kp=["innerRef","isDisabled","isHidden","inputClassName"],Jp=function(t,n){var s=t.isDisabled,r=t.value,o=t.theme,a=o.spacing,i=o.colors;return L(L({visibility:s?"hidden":"visible",transform:r?"translateZ(0)":""},Xp),n?{}:{margin:a.baseUnit/2,paddingBottom:a.baseUnit/2,paddingTop:a.baseUnit/2,color:i.neutral80})},Pc={gridArea:"1 / 2",font:"inherit",minWidth:"2px",border:0,margin:0,outline:0,padding:0},Xp={flex:"1 1 auto",display:"inline-grid",gridArea:"1 / 1 / 2 / 3",gridTemplateColumns:"0 min-content","&:after":L({content:'attr(data-value) " "',visibility:"hidden",whiteSpace:"pre"},Pc)},Zp=function(t){return L({label:"input",color:"inherit",background:0,opacity:t?0:1,width:"100%"},Pc)},em=function(t){var n=t.cx,s=t.value,r=gc(t),o=r.innerRef,a=r.isDisabled,i=r.isHidden,c=r.inputClassName,l=ze(r,Kp);return D("div",F({},te(t,"input",{"input-container":!0}),{"data-value":s||""}),D("input",F({className:n({input:!0},c),ref:o,style:Zp(i),disabled:a},l)))},tm=em,nm=function(t,n){var s=t.theme,r=s.spacing,o=s.borderRadius,a=s.colors;return L({label:"multiValue",display:"flex",minWidth:0},n?{}:{backgroundColor:a.neutral10,borderRadius:o/2,margin:r.baseUnit/2})},rm=function(t,n){var s=t.theme,r=s.borderRadius,o=s.colors,a=t.cropWithEllipsis;return L({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})},sm=function(t,n){var s=t.theme,r=s.spacing,o=s.borderRadius,a=s.colors,i=t.isFocused;return L({alignItems:"center",display:"flex"},n?{}:{borderRadius:o/2,backgroundColor:i?a.dangerLight:void 0,paddingLeft:r.baseUnit,paddingRight:r.baseUnit,":hover":{backgroundColor:a.dangerLight,color:a.danger}})},Oc=function(t){var n=t.children,s=t.innerProps;return D("div",s,n)},om=Oc,am=Oc;function im(e){var t=e.children,n=e.innerProps;return D("div",F({role:"button"},n),t||D(eo,{size:14}))}var cm=function(t){var n=t.children,s=t.components,r=t.data,o=t.innerProps,a=t.isDisabled,i=t.removeProps,c=t.selectProps,l=s.Container,d=s.Label,f=s.Remove;return D(l,{data:r,innerProps:L(L({},te(t,"multiValue",{"multi-value":!0,"multi-value--is-disabled":a})),o),selectProps:c},D(d,{data:r,innerProps:L({},te(t,"multiValueLabel",{"multi-value__label":!0})),selectProps:c},n),D(f,{data:r,innerProps:L(L({},te(t,"multiValueRemove",{"multi-value__remove":!0})),{},{"aria-label":"Remove ".concat(n||"option")},i),selectProps:c}))},lm=cm,um=function(t,n){var s=t.isDisabled,r=t.isFocused,o=t.isSelected,a=t.theme,i=a.spacing,c=a.colors;return L({label:"option",cursor:"default",display:"block",fontSize:"inherit",width:"100%",userSelect:"none",WebkitTapHighlightColor:"rgba(0, 0, 0, 0)"},n?{}:{backgroundColor:o?c.primary:r?c.primary25:"transparent",color:s?c.neutral20:o?c.neutral0:"inherit",padding:"".concat(i.baseUnit*2,"px ").concat(i.baseUnit*3,"px"),":active":{backgroundColor:s?void 0:o?c.primary:c.primary50}})},dm=function(t){var n=t.children,s=t.isDisabled,r=t.isFocused,o=t.isSelected,a=t.innerRef,i=t.innerProps;return D("div",F({},te(t,"option",{option:!0,"option--is-disabled":s,"option--is-focused":r,"option--is-selected":o}),{ref:a,"aria-disabled":s},i),n)},fm=dm,hm=function(t,n){var s=t.theme,r=s.spacing,o=s.colors;return L({label:"placeholder",gridArea:"1 / 1 / 2 / 3"},n?{}:{color:o.neutral50,marginLeft:r.baseUnit/2,marginRight:r.baseUnit/2})},pm=function(t){var n=t.children,s=t.innerProps;return D("div",F({},te(t,"placeholder",{placeholder:!0}),s),n)},mm=pm,gm=function(t,n){var s=t.isDisabled,r=t.theme,o=r.spacing,a=r.colors;return L({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})},bm=function(t){var n=t.children,s=t.isDisabled,r=t.innerProps;return D("div",F({},te(t,"singleValue",{"single-value":!0,"single-value--is-disabled":s}),r),n)},vm=bm,xr={ClearIndicator:kp,Control:Hp,DropdownIndicator:Rp,DownChevron:Sc,CrossIcon:eo,Group:Qp,GroupHeading:Yp,IndicatorsContainer:Ip,IndicatorSeparator:Fp,Input:tm,LoadingIndicator:Up,Menu:pp,MenuList:gp,MenuPortal:Cp,LoadingMessage:xp,NoOptionsMessage:yp,MultiValue:lm,MultiValueContainer:om,MultiValueLabel:am,MultiValueRemove:im,Option:fm,Placeholder:mm,SelectContainer:Ep,SingleValue:vm,ValueContainer:Op},ym=function(t){return L(L({},xr),t.components)},aa=Number.isNaN||function(t){return typeof t=="number"&&t!==t};function xm(e,t){return!!(e===t||aa(e)&&aa(t))}function wm(e,t){if(e.length!==t.length)return!1;for(var n=0;n<e.length;n++)if(!xm(e[n],t[n]))return!1;return!0}function Cm(e,t){t===void 0&&(t=wm);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"},Em=function(t){return D("span",F({css:Sm},t))},ia=Em,Pm={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,i=t.selectValue,c=t.isDisabled,l=t.isSelected,d=t.isAppleDevice,f=function(g,v){return g&&g.length?"".concat(g.indexOf(v)+1," of ").concat(g.length):""};if(n==="value"&&i)return"value ".concat(a," focused, ").concat(f(i,s),".");if(n==="menu"&&d){var h=c?" disabled":"",p="".concat(l?" selected":"").concat(h);return"".concat(a).concat(p,", ").concat(f(r,s),".")}return""},onFilter:function(t){var n=t.inputValue,s=t.resultsMessage;return"".concat(s).concat(n?" for search term "+n:"",".")}},Om=function(t){var n=t.ariaSelection,s=t.focusedOption,r=t.focusedValue,o=t.focusableOptions,a=t.isFocused,i=t.selectValue,c=t.selectProps,l=t.id,d=t.isAppleDevice,f=c.ariaLiveMessages,h=c.getOptionLabel,p=c.inputValue,m=c.isMulti,g=c.isOptionDisabled,v=c.isSearchable,x=c.menuIsOpen,y=c.options,C=c.screenReaderStatus,O=c.tabSelectsValue,w=c.isLoading,E=c["aria-label"],S=c["aria-live"],P=b.useMemo(function(){return L(L({},Pm),f||{})},[f]),j=b.useMemo(function(){var $="";if(n&&P.onChange){var B=n.option,G=n.options,q=n.removedValue,ee=n.removedValues,ne=n.value,ie=function(se){return Array.isArray(se)?null:se},U=q||B||ie(ne),Y=U?h(U):"",X=G||ee||void 0,re=X?X.map(h):[],Z=L({isDisabled:U&&g(U,i),label:Y,labels:re},n);$=P.onChange(Z)}return $},[n,P,g,i,h]),M=b.useMemo(function(){var $="",B=s||r,G=!!(s&&i&&i.includes(s));if(B&&P.onFocus){var q={focused:B,label:h(B),isDisabled:g(B,i),isSelected:G,options:o,context:B===s?"menu":"value",selectValue:i,isAppleDevice:d};$=P.onFocus(q)}return $},[s,r,h,g,P,o,i,d]),A=b.useMemo(function(){var $="";if(x&&y.length&&!w&&P.onFilter){var B=C({count:o.length});$=P.onFilter({inputValue:p,resultsMessage:B})}return $},[o,p,x,P,y,C,w]),R=n?.action==="initial-input-focus",k=b.useMemo(function(){var $="";if(P.guidance){var B=r?"value":x?"menu":"input";$=P.guidance({"aria-label":E,context:B,isDisabled:s&&g(s,i),isMulti:m,isSearchable:v,tabSelectsValue:O,isInitialFocus:R})}return $},[E,s,r,m,g,v,x,P,i,O,R]),z=D(b.Fragment,null,D("span",{id:"aria-selection"},j),D("span",{id:"aria-focused"},M),D("span",{id:"aria-results"},A),D("span",{id:"aria-guidance"},k));return D(b.Fragment,null,D(ia,{id:l},R&&z),D(ia,{"aria-live":S,"aria-atomic":"false","aria-relevant":"additions text",role:"log"},a&&!R&&z))},jm=Om,is=[{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źẑżžẓẕƶȥɀⱬꝣ"}],Im=new RegExp("["+is.map(function(e){return e.letters}).join("")+"]","g"),jc={};for(var Dr=0;Dr<is.length;Dr++)for(var kr=is[Dr],Lr=0;Lr<kr.letters.length;Lr++)jc[kr.letters[Lr]]=kr.base;var Ic=function(t){return t.replace(Im,function(n){return jc[n]})},Nm=Cm(Ic),ca=function(t){return t.replace(/^\s+|\s+$/g,"")},Mm=function(t){return"".concat(t.label," ").concat(t.value)},Tm=function(t){return function(n,s){if(n.data.__isNew__)return!0;var r=L({ignoreCase:!0,ignoreAccents:!0,stringify:Mm,trim:!0,matchFrom:"any"},t),o=r.ignoreCase,a=r.ignoreAccents,i=r.stringify,c=r.trim,l=r.matchFrom,d=c?ca(s):s,f=c?ca(i(n)):i(n);return o&&(d=d.toLowerCase(),f=f.toLowerCase()),a&&(d=Nm(d),f=Ic(f)),l==="start"?f.substr(0,d.length)===d:f.indexOf(d)>-1}},Am=["innerRef"];function Rm(e){var t=e.innerRef,n=ze(e,Am),s=ap(n,"onExited","in","enter","exit","appear");return D("input",F({ref:t},s,{css:Zs({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 Dm=function(t){t.cancelable&&t.preventDefault(),t.stopPropagation()};function km(e){var t=e.isEnabled,n=e.onBottomArrive,s=e.onBottomLeave,r=e.onTopArrive,o=e.onTopLeave,a=b.useRef(!1),i=b.useRef(!1),c=b.useRef(0),l=b.useRef(null),d=b.useCallback(function(v,x){if(l.current!==null){var y=l.current,C=y.scrollTop,O=y.scrollHeight,w=y.clientHeight,E=l.current,S=x>0,P=O-w-C,j=!1;P>x&&a.current&&(s&&s(v),a.current=!1),S&&i.current&&(o&&o(v),i.current=!1),S&&x>P?(n&&!a.current&&n(v),E.scrollTop=O,j=!0,a.current=!0):!S&&-x>C&&(r&&!i.current&&r(v),E.scrollTop=0,j=!0,i.current=!0),j&&Dm(v)}},[n,s,r,o]),f=b.useCallback(function(v){d(v,v.deltaY)},[d]),h=b.useCallback(function(v){c.current=v.changedTouches[0].clientY},[]),p=b.useCallback(function(v){var x=c.current-v.changedTouches[0].clientY;d(v,x)},[d]),m=b.useCallback(function(v){if(v){var x=rp?{passive:!1}:!1;v.addEventListener("wheel",f,x),v.addEventListener("touchstart",h,x),v.addEventListener("touchmove",p,x)}},[p,h,f]),g=b.useCallback(function(v){v&&(v.removeEventListener("wheel",f,!1),v.removeEventListener("touchstart",h,!1),v.removeEventListener("touchmove",p,!1))},[p,h,f]);return b.useEffect(function(){if(t){var v=l.current;return m(v),function(){g(v)}}},[t,m,g]),function(v){l.current=v}}var la=["boxSizing","height","overflow","paddingRight","position"],ua={boxSizing:"border-box",overflow:"hidden",position:"relative",height:"100%"};function da(e){e.cancelable&&e.preventDefault()}function fa(e){e.stopPropagation()}function ha(){var e=this.scrollTop,t=this.scrollHeight,n=e+this.offsetHeight;e===0?this.scrollTop=1:n===t&&(this.scrollTop=e-1)}function pa(){return"ontouchstart"in window||navigator.maxTouchPoints}var ma=!!(typeof window<"u"&&window.document&&window.document.createElement),Rt=0,dt={capture:!1,passive:!1};function Lm(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(c){if(ma){var l=document.body,d=l&&l.style;if(s&&la.forEach(function(m){var g=d&&d[m];r.current[m]=g}),s&&Rt<1){var f=parseInt(r.current.paddingRight,10)||0,h=document.body?document.body.clientWidth:0,p=window.innerWidth-h+f||0;Object.keys(ua).forEach(function(m){var g=ua[m];d&&(d[m]=g)}),d&&(d.paddingRight="".concat(p,"px"))}l&&pa()&&(l.addEventListener("touchmove",da,dt),c&&(c.addEventListener("touchstart",ha,dt),c.addEventListener("touchmove",fa,dt))),Rt+=1}},[s]),i=b.useCallback(function(c){if(ma){var l=document.body,d=l&&l.style;Rt=Math.max(Rt-1,0),s&&Rt<1&&la.forEach(function(f){var h=r.current[f];d&&(d[f]=h)}),l&&pa()&&(l.removeEventListener("touchmove",da,dt),c&&(c.removeEventListener("touchstart",ha,dt),c.removeEventListener("touchmove",fa,dt)))}},[s]);return b.useEffect(function(){if(t){var c=o.current;return a(c),function(){i(c)}}},[t,a,i]),function(c){o.current=c}}var Fm=function(t){var n=t.target;return n.ownerDocument.activeElement&&n.ownerDocument.activeElement.blur()},$m={name:"1kfdb0e",styles:"position:fixed;left:0;bottom:0;right:0;top:0"};function zm(e){var t=e.children,n=e.lockEnabled,s=e.captureEnabled,r=s===void 0?!0:s,o=e.onBottomArrive,a=e.onBottomLeave,i=e.onTopArrive,c=e.onTopLeave,l=km({isEnabled:r,onBottomArrive:o,onBottomLeave:a,onTopArrive:i,onTopLeave:c}),d=Lm({isEnabled:n}),f=function(p){l(p),d(p)};return D(b.Fragment,null,n&&D("div",{onClick:Fm,css:$m}),t(f))}var Um={name:"1a0ro4n-requiredInput",styles:"label:requiredInput;opacity:0;pointer-events:none;position:absolute;bottom:0;left:0;right:0;width:100%"},Bm=function(t){var n=t.name,s=t.onFocus;return D("input",{required:!0,name:n,tabIndex:-1,"aria-hidden":"true",onFocus:s,css:Um,value:"",onChange:function(){}})},Vm=Bm;function to(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 Hm(){return to(/^iPhone/i)}function Nc(){return to(/^Mac/i)}function _m(){return to(/^iPad/i)||Nc()&&navigator.maxTouchPoints>1}function Wm(){return Hm()||_m()}function Gm(){return Nc()||Wm()}var qm=function(t){return t.label},Ym=function(t){return t.label},Qm=function(t){return t.value},Km=function(t){return!!t.isDisabled},Jm={clearIndicator:Dp,container:Sp,control:Bp,dropdownIndicator:Ap,group:Wp,groupHeading:qp,indicatorsContainer:jp,indicatorSeparator:Lp,input:Jp,loadingIndicator:zp,loadingMessage:vp,menu:dp,menuList:mp,menuPortal:wp,multiValue:nm,multiValueLabel:rm,multiValueRemove:sm,noOptionsMessage:bp,option:um,placeholder:hm,singleValue:gm,valueContainer:Pp},Xm={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%)"},Zm=4,Mc=4,eg=38,tg=Mc*2,ng={baseUnit:Mc,controlHeight:eg,menuGutter:tg},Fr={borderRadius:Zm,colors:Xm,spacing:ng},rg={"aria-live":"polite",backspaceRemovesValue:!0,blurInputOnSelect:sa(),captureMenuScroll:!sa(),classNames:{},closeMenuOnSelect:!0,closeMenuOnScroll:!1,components:{},controlShouldRenderValue:!0,escapeClearsValue:!1,filterOption:Tm(),formatGroupLabel:qm,getOptionLabel:Ym,getOptionValue:Qm,isDisabled:!1,isLoading:!1,isMulti:!1,isRtl:!1,isSearchable:!0,isOptionDisabled:Km,loadingMessage:function(){return"Loading..."},maxMenuHeight:300,minMenuHeight:140,menuIsOpen:!1,menuPlacement:"bottom",menuPosition:"absolute",menuShouldBlockScroll:!1,menuShouldScrollIntoView:!tp(),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 ga(e,t,n,s){var r=Rc(e,t,n),o=Dc(e,t,n),a=Ac(e,t),i=sr(e,t);return{type:"option",data:t,isDisabled:r,isSelected:o,label:a,value:i,index:s}}function Gn(e,t){return e.options.map(function(n,s){if("options"in n){var r=n.options.map(function(a,i){return ga(e,a,t,i)}).filter(function(a){return va(e,a)});return r.length>0?{type:"group",data:n,options:r,index:s}:void 0}var o=ga(e,n,t,s);return va(e,o)?o:void 0}).filter(sp)}function Tc(e){return e.reduce(function(t,n){return n.type==="group"?t.push.apply(t,Ys(n.options.map(function(s){return s.data}))):t.push(n.data),t},[])}function ba(e,t){return e.reduce(function(n,s){return s.type==="group"?n.push.apply(n,Ys(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 sg(e,t){return Tc(Gn(e,t))}function va(e,t){var n=e.inputValue,s=n===void 0?"":n,r=t.data,o=t.isSelected,a=t.label,i=t.value;return(!Lc(e)||!o)&&kc(e,{label:a,value:i,data:r},s)}function og(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 ag(e,t){var n=e.focusedOption;return n&&t.indexOf(n)>-1?n:t[0]}var $r=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},Ac=function(t,n){return t.getOptionLabel(n)},sr=function(t,n){return t.getOptionValue(n)};function Rc(e,t,n){return typeof e.isOptionDisabled=="function"?e.isOptionDisabled(t,n):!1}function Dc(e,t,n){if(n.indexOf(t)>-1)return!0;if(typeof e.isOptionSelected=="function")return e.isOptionSelected(t,n);var s=sr(e,t);return n.some(function(r){return sr(e,r)===s})}function kc(e,t,n){return e.filterOption?e.filterOption(t,n):!0}var Lc=function(t){var n=t.hideSelectedOptions,s=t.isMulti;return n===void 0?s:n},ig=1,Fc=(function(e){G0(n,e);var t=Q0(n);function n(s){var r;if(_0(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(c){r.controlRef=c},r.focusedOptionRef=null,r.getFocusedOptionRef=function(c){r.focusedOptionRef=c},r.menuListRef=null,r.getMenuListRef=function(c){r.menuListRef=c},r.inputRef=null,r.getInputRef=function(c){r.inputRef=c},r.focus=r.focusInput,r.blur=r.blurInput,r.onChange=function(c,l){var d=r.props,f=d.onChange,h=d.name;l.name=h,r.ariaOnChange(c,l),f(c,l)},r.setValue=function(c,l,d){var f=r.props,h=f.closeMenuOnSelect,p=f.isMulti,m=f.inputValue;r.onInputChange("",{action:"set-value",prevInputValue:m}),h&&(r.setState({inputIsHiddenAfterUpdate:!p}),r.onMenuClose()),r.setState({clearFocusValueOnUpdate:!0}),r.onChange(c,{action:l,option:d})},r.selectOption=function(c){var l=r.props,d=l.blurInputOnSelect,f=l.isMulti,h=l.name,p=r.state.selectValue,m=f&&r.isOptionSelected(c,p),g=r.isOptionDisabled(c,p);if(m){var v=r.getOptionValue(c);r.setValue(p.filter(function(x){return r.getOptionValue(x)!==v}),"deselect-option",c)}else if(!g)f?r.setValue([].concat(Ys(p),[c]),"select-option",c):r.setValue(c,"select-option");else{r.ariaOnChange(c,{action:"select-option",option:c,name:h});return}d&&r.blurInput()},r.removeValue=function(c){var l=r.props.isMulti,d=r.state.selectValue,f=r.getOptionValue(c),h=d.filter(function(m){return r.getOptionValue(m)!==f}),p=Tn(l,h,h[0]||null);r.onChange(p,{action:"remove-value",removedValue:c}),r.focusInput()},r.clearValue=function(){var c=r.state.selectValue;r.onChange(Tn(r.props.isMulti,[],null),{action:"clear",removedValues:c})},r.popValue=function(){var c=r.props.isMulti,l=r.state.selectValue,d=l[l.length-1],f=l.slice(0,l.length-1),h=Tn(c,f,f[0]||null);d&&r.onChange(h,{action:"pop-value",removedValue:d})},r.getFocusedOptionId=function(c){return $r(r.state.focusableOptionsWithIds,c)},r.getFocusableOptionsWithIds=function(){return ba(Gn(r.props,r.state.selectValue),r.getElementId("option"))},r.getValue=function(){return r.state.selectValue},r.cx=function(){for(var c=arguments.length,l=new Array(c),d=0;d<c;d++)l[d]=arguments[d];return Kh.apply(void 0,[r.props.classNamePrefix].concat(l))},r.getOptionLabel=function(c){return Ac(r.props,c)},r.getOptionValue=function(c){return sr(r.props,c)},r.getStyles=function(c,l){var d=r.props.unstyled,f=Jm[c](l,d);f.boxSizing="border-box";var h=r.props.styles[c];return h?h(f,l):f},r.getClassNames=function(c,l){var d,f;return(d=(f=r.props.classNames)[c])===null||d===void 0?void 0:d.call(f,l)},r.getElementId=function(c){return"".concat(r.state.instancePrefix,"-").concat(c)},r.getComponents=function(){return ym(r.props)},r.buildCategorizedOptions=function(){return Gn(r.props,r.state.selectValue)},r.getCategorizedOptions=function(){return r.props.menuIsOpen?r.buildCategorizedOptions():[]},r.buildFocusableOptions=function(){return Tc(r.buildCategorizedOptions())},r.getFocusableOptions=function(){return r.props.menuIsOpen?r.buildFocusableOptions():[]},r.ariaOnChange=function(c,l){r.setState({ariaSelection:L({value:c},l)})},r.onMenuMouseDown=function(c){c.button===0&&(c.stopPropagation(),c.preventDefault(),r.focusInput())},r.onMenuMouseMove=function(c){r.blockOptionHover=!1},r.onControlMouseDown=function(c){if(!c.defaultPrevented){var l=r.props.openMenuOnClick;r.state.isFocused?r.props.menuIsOpen?c.target.tagName!=="INPUT"&&c.target.tagName!=="TEXTAREA"&&r.onMenuClose():l&&r.openMenu("first"):(l&&(r.openAfterFocus=!0),r.focusInput()),c.target.tagName!=="INPUT"&&c.target.tagName!=="TEXTAREA"&&c.preventDefault()}},r.onDropdownIndicatorMouseDown=function(c){if(!(c&&c.type==="mousedown"&&c.button!==0)&&!r.props.isDisabled){var l=r.props,d=l.isMulti,f=l.menuIsOpen;r.focusInput(),f?(r.setState({inputIsHiddenAfterUpdate:!d}),r.onMenuClose()):r.openMenu("first"),c.preventDefault()}},r.onClearIndicatorMouseDown=function(c){c&&c.type==="mousedown"&&c.button!==0||(r.clearValue(),c.preventDefault(),r.openAfterFocus=!1,c.type==="touchend"?r.focusInput():setTimeout(function(){return r.focusInput()}))},r.onScroll=function(c){typeof r.props.closeMenuOnScroll=="boolean"?c.target instanceof HTMLElement&&yr(c.target)&&r.props.onMenuClose():typeof r.props.closeMenuOnScroll=="function"&&r.props.closeMenuOnScroll(c)&&r.props.onMenuClose()},r.onCompositionStart=function(){r.isComposing=!0},r.onCompositionEnd=function(){r.isComposing=!1},r.onTouchStart=function(c){var l=c.touches,d=l&&l.item(0);d&&(r.initialTouchX=d.clientX,r.initialTouchY=d.clientY,r.userIsDragging=!1)},r.onTouchMove=function(c){var l=c.touches,d=l&&l.item(0);if(d){var f=Math.abs(d.clientX-r.initialTouchX),h=Math.abs(d.clientY-r.initialTouchY),p=5;r.userIsDragging=f>p||h>p}},r.onTouchEnd=function(c){r.userIsDragging||(r.controlRef&&!r.controlRef.contains(c.target)&&r.menuListRef&&!r.menuListRef.contains(c.target)&&r.blurInput(),r.initialTouchX=0,r.initialTouchY=0)},r.onControlTouchEnd=function(c){r.userIsDragging||r.onControlMouseDown(c)},r.onClearIndicatorTouchEnd=function(c){r.userIsDragging||r.onClearIndicatorMouseDown(c)},r.onDropdownIndicatorTouchEnd=function(c){r.userIsDragging||r.onDropdownIndicatorMouseDown(c)},r.handleInputChange=function(c){var l=r.props.inputValue,d=c.currentTarget.value;r.setState({inputIsHiddenAfterUpdate:!1}),r.onInputChange(d,{action:"input-change",prevInputValue:l}),r.props.menuIsOpen||r.onMenuOpen()},r.onInputFocus=function(c){r.props.onFocus&&r.props.onFocus(c),r.setState({inputIsHiddenAfterUpdate:!1,isFocused:!0}),(r.openAfterFocus||r.props.openMenuOnFocus)&&r.openMenu("first"),r.openAfterFocus=!1},r.onInputBlur=function(c){var l=r.props.inputValue;if(r.menuListRef&&r.menuListRef.contains(document.activeElement)){r.inputRef.focus();return}r.props.onBlur&&r.props.onBlur(c),r.onInputChange("",{action:"input-blur",prevInputValue:l}),r.onMenuClose(),r.setState({focusedValue:null,isFocused:!1})},r.onOptionHover=function(c){if(!(r.blockOptionHover||r.state.focusedOption===c)){var l=r.getFocusableOptions(),d=l.indexOf(c);r.setState({focusedOption:c,focusedOptionId:d>-1?r.getFocusedOptionId(c):null})}},r.shouldHideSelectedOptions=function(){return Lc(r.props)},r.onValueInputFocus=function(c){c.preventDefault(),c.stopPropagation(),r.focus()},r.onKeyDown=function(c){var l=r.props,d=l.isMulti,f=l.backspaceRemovesValue,h=l.escapeClearsValue,p=l.inputValue,m=l.isClearable,g=l.isDisabled,v=l.menuIsOpen,x=l.onKeyDown,y=l.tabSelectsValue,C=l.openMenuOnFocus,O=r.state,w=O.focusedOption,E=O.focusedValue,S=O.selectValue;if(!g&&!(typeof x=="function"&&(x(c),c.defaultPrevented))){switch(r.blockOptionHover=!0,c.key){case"ArrowLeft":if(!d||p)return;r.focusValue("previous");break;case"ArrowRight":if(!d||p)return;r.focusValue("next");break;case"Delete":case"Backspace":if(p)return;if(E)r.removeValue(E);else{if(!f)return;d?r.popValue():m&&r.clearValue()}break;case"Tab":if(r.isComposing||c.shiftKey||!v||!y||!w||C&&r.isOptionSelected(w,S))return;r.selectOption(w);break;case"Enter":if(c.keyCode===229)break;if(v){if(!w||r.isComposing)return;r.selectOption(w);break}return;case"Escape":v?(r.setState({inputIsHiddenAfterUpdate:!1}),r.onInputChange("",{action:"menu-close",prevInputValue:p}),r.onMenuClose()):m&&h&&r.clearValue();break;case" ":if(p)return;if(!v){r.openMenu("first");break}if(!w)return;r.selectOption(w);break;case"ArrowUp":v?r.focusOption("up"):r.openMenu("last");break;case"ArrowDown":v?r.focusOption("down"):r.openMenu("first");break;case"PageUp":if(!v)return;r.focusOption("pageup");break;case"PageDown":if(!v)return;r.focusOption("pagedown");break;case"Home":if(!v)return;r.focusOption("first");break;case"End":if(!v)return;r.focusOption("last");break;default:return}c.preventDefault()}},r.state.instancePrefix="react-select-"+(r.props.instanceId||++ig),r.state.selectValue=na(s.value),s.menuIsOpen&&r.state.selectValue.length){var o=r.getFocusableOptionsWithIds(),a=r.buildFocusableOptions(),i=a.indexOf(r.state.selectValue[0]);r.state.focusableOptionsWithIds=o,r.state.focusedOption=a[i],r.state.focusedOptionId=$r(o,a[i])}return r}return W0(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&&ra(this.menuListRef,this.focusedOptionRef),Gm()&&this.setState({isAppleDevice:!0})}},{key:"componentDidUpdate",value:function(r){var o=this.props,a=o.isDisabled,i=o.menuIsOpen,c=this.state.isFocused;(c&&!a&&r.isDisabled||c&&i&&!r.menuIsOpen)&&this.focusInput(),c&&a&&!r.isDisabled?this.setState({isFocused:!1},this.onMenuClose):!c&&!a&&r.isDisabled&&this.inputRef===document.activeElement&&this.setState({isFocused:!0}),this.menuListRef&&this.focusedOptionRef&&this.scrollToFocusedOptionOnUpdate&&(ra(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,i=a.selectValue,c=a.isFocused,l=this.buildFocusableOptions(),d=r==="first"?0:l.length-1;if(!this.props.isMulti){var f=l.indexOf(i[0]);f>-1&&(d=f)}this.scrollToFocusedOptionOnUpdate=!(c&&this.menuListRef),this.setState({inputIsHiddenAfterUpdate:!1,focusedValue:null,focusedOption:l[d],focusedOptionId:this.getFocusedOptionId(l[d])},function(){return o.onMenuOpen()})}},{key:"focusValue",value:function(r){var o=this.state,a=o.selectValue,i=o.focusedValue;if(this.props.isMulti){this.setState({focusedOption:null});var c=a.indexOf(i);i||(c=-1);var l=a.length-1,d=-1;if(a.length){switch(r){case"previous":c===0?d=0:c===-1?d=l:d=c-1;break;case"next":c>-1&&c<l&&(d=c+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,i=this.getFocusableOptions();if(i.length){var c=0,l=i.indexOf(a);a||(l=-1),r==="up"?c=l>0?l-1:i.length-1:r==="down"?c=(l+1)%i.length:r==="pageup"?(c=l-o,c<0&&(c=0)):r==="pagedown"?(c=l+o,c>i.length-1&&(c=i.length-1)):r==="last"&&(c=i.length-1),this.scrollToFocusedOptionOnUpdate=!0,this.setState({focusedOption:i[c],focusedValue:null,focusedOptionId:this.getFocusedOptionId(i[c])})}}},{key:"getTheme",value:(function(){return this.props.theme?typeof this.props.theme=="function"?this.props.theme(Fr):L(L({},Fr),this.props.theme):Fr})},{key:"getCommonProps",value:function(){var r=this.clearValue,o=this.cx,a=this.getStyles,i=this.getClassNames,c=this.getValue,l=this.selectOption,d=this.setValue,f=this.props,h=f.isMulti,p=f.isRtl,m=f.options,g=this.hasValue();return{clearValue:r,cx:o,getStyles:a,getClassNames:i,getValue:c,hasValue:g,isMulti:h,isRtl:p,options:m,selectOption:l,selectProps:f,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 Rc(this.props,r,o)}},{key:"isOptionSelected",value:function(r,o){return Dc(this.props,r,o)}},{key:"filterOption",value:function(r,o){return kc(this.props,r,o)}},{key:"formatOptionLabel",value:function(r,o){if(typeof this.props.formatOptionLabel=="function"){var a=this.props.inputValue,i=this.state.selectValue;return this.props.formatOptionLabel(r,{context:o,inputValue:a,selectValue:i})}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,i=r.inputId,c=r.inputValue,l=r.tabIndex,d=r.form,f=r.menuIsOpen,h=r.required,p=this.getComponents(),m=p.Input,g=this.state,v=g.inputIsHidden,x=g.ariaSelection,y=this.commonProps,C=i||this.getElementId("input"),O=L(L(L({"aria-autocomplete":"list","aria-expanded":f,"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":h,role:"combobox","aria-activedescendant":this.state.isAppleDevice?void 0:this.state.focusedOptionId||""},f&&{"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,F({},y,{autoCapitalize:"none",autoComplete:"off",autoCorrect:"off",id:C,innerRef:this.getInputRef,isDisabled:o,isHidden:v,onBlur:this.onInputBlur,onChange:this.handleInputChange,onFocus:this.onInputFocus,spellCheck:"false",tabIndex:l,form:d,type:"text",value:c},O)):b.createElement(Rm,F({id:C,innerRef:this.getInputRef,onBlur:this.onInputBlur,onChange:nr,onFocus:this.onInputFocus,disabled:o,tabIndex:l,inputMode:"none",form:d,value:""},O))})},{key:"renderPlaceholderOrValue",value:function(){var r=this,o=this.getComponents(),a=o.MultiValue,i=o.MultiValueContainer,c=o.MultiValueLabel,l=o.MultiValueRemove,d=o.SingleValue,f=o.Placeholder,h=this.commonProps,p=this.props,m=p.controlShouldRenderValue,g=p.isDisabled,v=p.isMulti,x=p.inputValue,y=p.placeholder,C=this.state,O=C.selectValue,w=C.focusedValue,E=C.isFocused;if(!this.hasValue()||!m)return x?null:b.createElement(f,F({},h,{key:"placeholder",isDisabled:g,isFocused:E,innerProps:{id:this.getElementId("placeholder")}}),y);if(v)return O.map(function(P,j){var M=P===w,A="".concat(r.getOptionLabel(P),"-").concat(r.getOptionValue(P));return b.createElement(a,F({},h,{components:{Container:i,Label:c,Remove:l},isFocused:M,isDisabled:g,key:A,index:j,removeProps:{onClick:function(){return r.removeValue(P)},onTouchEnd:function(){return r.removeValue(P)},onMouseDown:function(k){k.preventDefault()}},data:P}),r.formatOptionLabel(P,"value"))});if(x)return null;var S=O[0];return b.createElement(d,F({},h,{data:S,isDisabled:g}),this.formatOptionLabel(S,"value"))}},{key:"renderClearIndicator",value:function(){var r=this.getComponents(),o=r.ClearIndicator,a=this.commonProps,i=this.props,c=i.isDisabled,l=i.isLoading,d=this.state.isFocused;if(!this.isClearable()||!o||c||!this.hasValue()||l)return null;var f={onMouseDown:this.onClearIndicatorMouseDown,onTouchEnd:this.onClearIndicatorTouchEnd,"aria-hidden":"true"};return b.createElement(o,F({},a,{innerProps:f,isFocused:d}))}},{key:"renderLoadingIndicator",value:function(){var r=this.getComponents(),o=r.LoadingIndicator,a=this.commonProps,i=this.props,c=i.isDisabled,l=i.isLoading,d=this.state.isFocused;if(!o||!l)return null;var f={"aria-hidden":"true"};return b.createElement(o,F({},a,{innerProps:f,isDisabled:c,isFocused:d}))}},{key:"renderIndicatorSeparator",value:function(){var r=this.getComponents(),o=r.DropdownIndicator,a=r.IndicatorSeparator;if(!o||!a)return null;var i=this.commonProps,c=this.props.isDisabled,l=this.state.isFocused;return b.createElement(a,F({},i,{isDisabled:c,isFocused:l}))}},{key:"renderDropdownIndicator",value:function(){var r=this.getComponents(),o=r.DropdownIndicator;if(!o)return null;var a=this.commonProps,i=this.props.isDisabled,c=this.state.isFocused,l={onMouseDown:this.onDropdownIndicatorMouseDown,onTouchEnd:this.onDropdownIndicatorTouchEnd,"aria-hidden":"true"};return b.createElement(o,F({},a,{innerProps:l,isDisabled:i,isFocused:c}))}},{key:"renderMenu",value:function(){var r=this,o=this.getComponents(),a=o.Group,i=o.GroupHeading,c=o.Menu,l=o.MenuList,d=o.MenuPortal,f=o.LoadingMessage,h=o.NoOptionsMessage,p=o.Option,m=this.commonProps,g=this.state.focusedOption,v=this.props,x=v.captureMenuScroll,y=v.inputValue,C=v.isLoading,O=v.loadingMessage,w=v.minMenuHeight,E=v.maxMenuHeight,S=v.menuIsOpen,P=v.menuPlacement,j=v.menuPosition,M=v.menuPortalTarget,A=v.menuShouldBlockScroll,R=v.menuShouldScrollIntoView,k=v.noOptionsMessage,z=v.onMenuScrollToTop,$=v.onMenuScrollToBottom;if(!S)return null;var B=function(Y,X){var re=Y.type,Z=Y.data,V=Y.isDisabled,se=Y.isSelected,Oe=Y.label,En=Y.value,Ao=g===Z,Ro=V?void 0:function(){return r.onOptionHover(Z)},Nu=V?void 0:function(){return r.selectOption(Z)},Do="".concat(r.getElementId("option"),"-").concat(X),Mu={id:Do,onClick:Nu,onMouseMove:Ro,onMouseOver:Ro,tabIndex:-1,role:"option","aria-selected":r.state.isAppleDevice?void 0:se};return b.createElement(p,F({},m,{innerProps:Mu,data:Z,isDisabled:V,isSelected:se,key:Do,label:Oe,type:re,value:En,isFocused:Ao,innerRef:Ao?r.getFocusedOptionRef:void 0}),r.formatOptionLabel(Y.data,"menu"))},G;if(this.hasOptions())G=this.getCategorizedOptions().map(function(U){if(U.type==="group"){var Y=U.data,X=U.options,re=U.index,Z="".concat(r.getElementId("group"),"-").concat(re),V="".concat(Z,"-heading");return b.createElement(a,F({},m,{key:Z,data:Y,options:X,Heading:i,headingProps:{id:V,data:U.data},label:r.formatGroupLabel(U.data)}),U.options.map(function(se){return B(se,"".concat(re,"-").concat(se.index))}))}else if(U.type==="option")return B(U,"".concat(U.index))});else if(C){var q=O({inputValue:y});if(q===null)return null;G=b.createElement(f,m,q)}else{var ee=k({inputValue:y});if(ee===null)return null;G=b.createElement(h,m,ee)}var ne={minMenuHeight:w,maxMenuHeight:E,menuPlacement:P,menuPosition:j,menuShouldScrollIntoView:R},ie=b.createElement(fp,F({},m,ne),function(U){var Y=U.ref,X=U.placerProps,re=X.placement,Z=X.maxHeight;return b.createElement(c,F({},m,ne,{innerRef:Y,innerProps:{onMouseDown:r.onMenuMouseDown,onMouseMove:r.onMenuMouseMove},isLoading:C,placement:re}),b.createElement(zm,{captureEnabled:x,onTopArrive:z,onBottomArrive:$,lockEnabled:A},function(V){return b.createElement(l,F({},m,{innerRef:function(Oe){r.getMenuListRef(Oe),V(Oe)},innerProps:{role:"listbox","aria-multiselectable":m.isMulti,id:r.getElementId("listbox")},isLoading:C,maxHeight:Z,focusedOption:g}),G)}))});return M||j==="fixed"?b.createElement(d,F({},m,{appendTo:M,controlElement:this.controlRef,menuPlacement:P,menuPosition:j}),ie):ie}},{key:"renderFormField",value:function(){var r=this,o=this.props,a=o.delimiter,i=o.isDisabled,c=o.isMulti,l=o.name,d=o.required,f=this.state.selectValue;if(d&&!this.hasValue()&&!i)return b.createElement(Vm,{name:l,onFocus:this.onValueInputFocus});if(!(!l||i))if(c)if(a){var h=f.map(function(g){return r.getOptionValue(g)}).join(a);return b.createElement("input",{name:l,type:"hidden",value:h})}else{var p=f.length>0?f.map(function(g,v){return b.createElement("input",{key:"i-".concat(v),name:l,type:"hidden",value:r.getOptionValue(g)})}):b.createElement("input",{name:l,type:"hidden",value:""});return b.createElement("div",null,p)}else{var m=f[0]?this.getOptionValue(f[0]):"";return b.createElement("input",{name:l,type:"hidden",value:m})}}},{key:"renderLiveRegion",value:function(){var r=this.commonProps,o=this.state,a=o.ariaSelection,i=o.focusedOption,c=o.focusedValue,l=o.isFocused,d=o.selectValue,f=this.getFocusableOptions();return b.createElement(jm,F({},r,{id:this.getElementId("live-region"),ariaSelection:a,focusedOption:i,focusedValue:c,isFocused:l,selectValue:d,focusableOptions:f,isAppleDevice:this.state.isAppleDevice}))}},{key:"render",value:function(){var r=this.getComponents(),o=r.Control,a=r.IndicatorsContainer,i=r.SelectContainer,c=r.ValueContainer,l=this.props,d=l.className,f=l.id,h=l.isDisabled,p=l.menuIsOpen,m=this.state.isFocused,g=this.commonProps=this.getCommonProps();return b.createElement(i,F({},g,{className:d,innerProps:{id:f,onKeyDown:this.onKeyDown},isDisabled:h,isFocused:m}),this.renderLiveRegion(),b.createElement(o,F({},g,{innerRef:this.getControlRef,innerProps:{onMouseDown:this.onControlMouseDown,onTouchEnd:this.onControlTouchEnd},isDisabled:h,isFocused:m,menuIsOpen:p}),b.createElement(c,F({},g,{isDisabled:h}),this.renderPlaceholderOrValue(),this.renderInput()),b.createElement(a,F({},g,{isDisabled:h}),this.renderClearIndicator(),this.renderLoadingIndicator(),this.renderIndicatorSeparator(),this.renderDropdownIndicator())),this.renderMenu(),this.renderFormField())}}],[{key:"getDerivedStateFromProps",value:function(r,o){var a=o.prevProps,i=o.clearFocusValueOnUpdate,c=o.inputIsHiddenAfterUpdate,l=o.ariaSelection,d=o.isFocused,f=o.prevWasFocused,h=o.instancePrefix,p=r.options,m=r.value,g=r.menuIsOpen,v=r.inputValue,x=r.isMulti,y=na(m),C={};if(a&&(m!==a.value||p!==a.options||g!==a.menuIsOpen||v!==a.inputValue)){var O=g?sg(r,y):[],w=g?ba(Gn(r,y),"".concat(h,"-option")):[],E=i?og(o,y):null,S=ag(o,O),P=$r(w,S);C={selectValue:y,focusedOption:S,focusedOptionId:P,focusableOptionsWithIds:w,focusedValue:E,clearFocusValueOnUpdate:!1}}var j=c!=null&&r!==a?{inputIsHidden:c,inputIsHiddenAfterUpdate:void 0}:{},M=l,A=d&&f;return d&&!A&&(M={value:Tn(x,y,y[0]||null),options:y,action:"initial-input-focus"},A=!f),l?.action==="initial-input-focus"&&(M=null),L(L(L({},C),j),{},{prevProps:r,ariaSelection:M,prevWasFocused:A})}}]),n})(b.Component);Fc.defaultProps=rg;var cg=b.forwardRef(function(e,t){var n=H0(e);return b.createElement(Fc,F({ref:t},n))}),lg=cg;function ug(e){return u.jsx(xr.DropdownIndicator,{...e,children:u.jsx(I,{name:"ChevronDown",size:16})})}function dg(e){return u.jsx(xr.ClearIndicator,{...e,children:u.jsx(I,{name:"Xmark",size:16})})}function fg(e){const{label:t,onClick:n,...s}=e,r=!!t&&!!n;return u.jsxs(xr.MenuList,{...s,children:[e.children,r?u.jsx("button",{className:"w-full px-2 py-3 hover:bg-slate-50",onClick:n,children:t}):null]})}function H6(e){const t=e["aria-invalid"]==="true",{addItemButtonProps:n,...s}=e;return u.jsx(lg,{...s,components:{DropdownIndicator:ug,ClearIndicator:dg,MenuList:r=>fg({...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 _6=e=>{const{children:t,cookies:n,submitLabel:s,rejectLabel:r,onSubmit:o=()=>{},onReject:a=()=>{},...i}=e,[c,l]=b.useState(n),d=h=>{const{id:p,checked:m}=h.target;l(g=>g.map(v=>v.id===p?{...v,value:m}:v))},f="min-w-64 h-8 text-base";return u.jsxs("div",{...ce(i,"flex flex-col items-center"),children:[u.jsx("div",{className:"text-center",children:t}),u.jsx("div",{className:"my-8 flex gap-x-16 text-sm font-medium",children:c.map((h,p)=>u.jsxs("div",{className:"cursor-pointer",children:[u.jsx("input",{checked:h.value,className:"mr-1 size-3 cursor-pointer rounded-sm border-2 border-gray-900 accent-gray-900 focus:outline-none",id:h.id,onChange:d,type:"checkbox"}),u.jsx("label",{className:"cursor-pointer select-none",htmlFor:h.id,children:h.label})]},p))}),u.jsxs("div",{className:"flex gap-x-8",children:[u.jsx(Pe,{className:f,color:"light",onClick:()=>a(),size:"small",children:r},"button-reject"),u.jsx(Pe,{className:f,onClick:()=>o(c),size:"small",children:s},"button-submit")]})]})};function W6(e){const{message:t="Loading editor",...n}=e;return u.jsx("div",{className:"grid h-full place-items-center",...n,children:u.jsxs("div",{className:"-mt-20 grid place-items-center",children:[u.jsx("h3",{className:"mb-4 text-xl",children:t}),u.jsx(L0,{})]})})}function or(e){const{title:t,isOpen:n,onOpenChange:s,children:r,containerClassName:o,toggleClassName:a,contentClassName:i}=e;return u.jsxs("div",{className:N(o),children:[u.jsxs("div",{className:N("flex cursor-pointer justify-between text-gray-500",a),onClick:s,children:[u.jsx("h2",{className:"font-semibold text-inherit",children:t}),u.jsx(I,{className:_s("transition",n?"":"-rotate-90"),size:16,name:"ChevronDown"})]}),u.jsx("div",{className:N("max-h-0 overflow-hidden transition-[max-height] duration-300 ease-in-out",n&&"max-h-screen",i),children:r})]})}function pt(e){return u.jsx("div",{...e,className:N("h-px bg-gray-200",e.className)})}function Qe(e){const{children:t,content:n,open:s,defaultOpen:r,onOpenChange:o,className:a,side:i="top",sideOffset:c=5,delayDuration:l,...d}=e;return u.jsxs(Gd,{defaultOpen:r,delayDuration:l,onOpenChange:o,open:s,children:[u.jsx(qd,{asChild:!0,children:t}),u.jsx(Yd,{children:u.jsx(Qd,{...d,side:i,sideOffset:c,className:N("shadow-tooltip rounded-lg border border-gray-200 bg-white p-2 text-xs",a),children:n})})]})}const $c=Wd,hg=e=>{const{className:t,timestampUtcMs:n,title:s,subtitle:r,onClick:o,isSelected:a=!1}=e,[i,c]=b.useState(!1),l=!!s||!!r||!!n;b.useEffect(()=>{i&&(c(!1),setTimeout(()=>l&&c(!0),50))},[s,r,n,l]);const d=m=>{if(!m)return"";try{return d0(new Date(m),{addSuffix:!0})}catch{return m}},f=u.jsxs("div",{className:"flex flex-col text-xs",children:[!!s&&u.jsx("div",{children:s}),!!r&&u.jsx("div",{className:"text-gray-300",children:r}),!!n&&u.jsx("div",{children:d(n)})]}),h=()=>{l&&c(!0)},p=()=>{c(!1)};return u.jsxs("div",{className:"relative",onMouseEnter:h,onMouseLeave:p,children:[a&&u.jsx(I,{name:"TimelineCaret",color:"#4EA9FF",size:10,className:"absolute top-[-11px] z-40"}),u.jsx(Qe,{className:"rounded-md bg-gray-900 text-white",content:f,open:i&&l,onOpenChange:c,delayDuration:0,side:"bottom",sideOffset:5,children:u.jsx("div",{className:N("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:u.jsx("div",{className:"h-0.5 w-1 rounded-full bg-gray-500"})})})]})},ya=(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]"}},pg=e=>{if(!e)return"";try{const t=f0(e);return Zn(t,"HH:mm, dd, MMMM")}catch{return e}},mg=({onClick:e,className:t,timestampUtcMs:n,additions:s,deletions:r,addSize:o=0,delSize:a=0,isSelected:i=!1})=>{const[c,l]=b.useState(!1),d=o===0&&a===0,f=ya(o),h=ya(a),p=u.jsxs("div",{className:"flex flex-col text-xs",children:[u.jsx("div",{children:pg(n)}),u.jsx("div",{className:"text-green-900",children:`${s} additions +`}),u.jsx("div",{className:"text-red-700",children:`${r} deletions -`})]}),m=()=>{d||l(!0)},g=()=>{l(!1)};return u.jsxs("div",{className:"relative",onMouseEnter:m,onMouseLeave:g,children:[i&&u.jsx(I,{name:"TimelineCaret",color:"#4EA9FF",size:10,className:"absolute left-[-2px] top-[-11px] z-40"}),d?u.jsx("div",{className:N("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:u.jsx("div",{className:"size-[3px] rounded-full bg-gray-500"})}):u.jsx(Qe,{className:"rounded-md bg-gray-900 text-white",content:p,open:c,onOpenChange:l,delayDuration:0,side:"bottom",sideOffset:5,children:u.jsxs("div",{className:N("flex h-[25px] w-1.5 cursor-pointer flex-col items-center justify-center rounded-[2px] hover:bg-blue-300",t,i&&"bg-blue-300"),"data-timestamp":n,onClick:e,children:[u.jsx("div",{className:"flex h-3 w-0.5 items-end",children:u.jsx("div",{className:N("h-3 w-0.5 rounded-t-full bg-green-600",f)})}),u.jsx("div",{className:"flex h-3 w-0.5 items-start",children:u.jsx("div",{className:N("h-3 w-0.5 rounded-b-full bg-red-600",h)})})]})})]})},xa={id:"default",type:"bar",addSize:0,delSize:0},gg=e=>{const{timeline:t=[],onItemClick:n}=e,[s,r]=b.useState(null),o=b.useRef(null),a=p=>{p.id===s||p.id===xa.id?(n?.(null),r(null)):(n?.(p),r(p.id))},i=[...t,xa],[c,l]=b.useMemo(()=>{const p=i.findIndex(m=>m.id===s);return p===-1?[i,[]]:[i.slice(0,p),i.slice(p)]},[i,s]),d=b.useCallback(p=>p.map(m=>{if(m.type==="divider"){const{timestampUtcMs:g,title:v,subtitle:x}=m;return u.jsx(hg,{timestampUtcMs:g,title:v,subtitle:x,onClick:()=>a(m),isSelected:m.id===s},m.id)}return u.jsx(mg,{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]),f=b.useMemo(()=>d(c),[c,d]),h=b.useMemo(()=>d(l),[l,d]);return b.useEffect(()=>{o.current&&(o.current.scrollLeft=o.current.scrollWidth)},[]),u.jsx($c,{delayDuration:0,skipDelayDuration:0,children:u.jsxs("div",{className:"relative h-[36px] w-full",children:[u.jsx("div",{className:"absolute left-[0px] z-[20] h-[17px] w-[6px] bg-white",children:u.jsx("div",{className:"mt-[11px] h-[6px] w-[6px] rounded-tl-md bg-slate-50"})}),u.jsx("div",{className:"absolute right-[0px] top-[11px] z-[20] h-[6px] w-[6px] bg-white",children:u.jsx("div",{className:"h-[6px] w-[6px] rounded-tr-md bg-slate-50"})}),u.jsx("div",{className:"absolute inset-x-0 bottom-0 h-[25px] rounded-md bg-slate-50"}),u.jsx("div",{className:"absolute inset-x-0 bottom-0 h-[36px]",children:u.jsx("div",{ref:o,className:"h-full overflow-x-auto rounded-md",children:u.jsxs("div",{className:"ml-auto flex h-[36px] w-max items-end px-2 pb-0",children:[u.jsx("div",{className:"flex",children:f}),u.jsx("div",{className:"flex rounded-sm bg-blue-200",children:h})]})})}),u.jsx("div",{className:"pointer-events-none absolute bottom-0 left-0 z-10 h-[25px] w-2 rounded-l-md bg-slate-50"}),u.jsx("div",{className:"pointer-events-none absolute bottom-0 right-0 z-10 h-[25px] w-2 rounded-r-md bg-slate-50"})]})})};function bg(e){const[t,n]=Du(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(md())},redo:()=>{n(pd())},canUndo:o,canRedo:a}}function vg(e){return[]}const G6=e=>{const{onClose:t,children:n,onExport:s,className:r,document:o,onSwitchboardLinkClick:a,enabledControls:i=["undo","redo","export","history"],defaultTimelineVisible:c=!0,disableRevisionHistory:l=!1,initialTimelineVisible:d=!1,...f}=e,[h]=ku(),p=o??h,m=p?.header.name||void 0,g=Lu(p?.header.id),v=t??(()=>vt(g)),x=async $=>{$&&(s?s($):await Uu($))},y=bg(p?.header.id),C=!y.canUndo,O=!y.canRedo,w=vg(p?.header.id),[E,S]=b.useState(d),P=Fu(p),M=a??(P?async()=>{if(P)try{const $=await P();window.open($,"_blank")}catch($){console.error("Error opening switchboard link:",$)}}:void 0),A=!p,R=!M,k=w.length===0;b.useEffect(()=>{typeof d=="boolean"&&S(d)},[d]);const z=()=>{k||S(!E)};return u.jsxs("div",{className:"flex w-full flex-col",...f,children:[u.jsxs("div",{className:N("flex h-12 w-full items-center justify-between rounded-xl border border-gray-200 bg-slate-50 px-4",r),children:[u.jsxs("div",{className:"flex items-center gap-x-2",children:[i.includes("undo")&&u.jsx("button",{className:N("grid size-8 place-items-center rounded-lg border border-gray-200 bg-white",C?"cursor-not-allowed":"cursor-pointer active:opacity-70"),onClick:y.undo,disabled:C,children:u.jsx(I,{name:"ArrowCouterclockwise",size:16,className:C?"text-gray-500":"text-gray-900"})}),i.includes("redo")&&u.jsx("button",{className:N("grid size-8 place-items-center rounded-lg border border-gray-200 bg-white",O?"cursor-not-allowed":"cursor-pointer active:opacity-70"),onClick:y.redo,disabled:O,children:u.jsx("div",{className:"-scale-x-100",children:u.jsx(I,{name:"ArrowCouterclockwise",size:16,className:O?"text-gray-500":"text-gray-900"})})}),i.includes("export")&&u.jsx("button",{className:N("flex h-8 items-center rounded-lg border border-gray-200 bg-white px-3 text-sm",A?"cursor-not-allowed":"cursor-pointer active:opacity-70"),onClick:()=>void x(p),disabled:A,children:u.jsx("span",{className:A?"text-gray-500":"text-gray-900",children:"Export"})})]}),u.jsx("div",{className:"flex items-center",children:u.jsx("h1",{className:"text-sm font-medium text-gray-500",children:m})}),u.jsxs("div",{className:"flex items-center gap-x-2",children:[!R&&u.jsx("button",{className:N("grid size-8 place-items-center rounded-lg border border-gray-200 bg-white","cursor-pointer active:opacity-70"),onClick:M,disabled:R,children:u.jsx(I,{name:"Drive",size:16,className:"text-gray-900"})}),i.includes("history")&&u.jsx("button",{className:N("grid size-8 place-items-center rounded-lg border border-gray-200 bg-white",l?"cursor-not-allowed":"cursor-pointer active:opacity-70"),onClick:$u,disabled:l,children:u.jsx(I,{name:"History",size:16,className:l?"text-gray-500":"text-gray-900"})}),i.includes("timeline")&&c&&u.jsx("button",{className:N("grid size-8 place-items-center rounded-lg border border-gray-200 bg-white",k?"cursor-not-allowed":"cursor-pointer active:opacity-70"),onClick:z,disabled:k,"aria-pressed":E,children:u.jsx(I,{name:"Timeline",size:16,className:N("text-gray-900",k&&"opacity-50",E&&"text-blue-600")})}),u.jsx("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:v,children:u.jsx(I,{name:"XmarkLight",size:16,className:"text-gray-900"})})]})]}),E&&u.jsx("div",{className:"mt-2 w-full",children:u.jsx(gg,{timeline:w,onItemClick:zu})}),n]})};function zc(e){const{target:t,onAddFileOverride:n,trackNestedDrag:s=!1,acceptedFileExtensions:r}=e??{},[o,a]=b.useState(!1),i=b.useRef(0),{onMoveNode:c,onCopyNode:l,onAddFile:d}=Vs(),f=n??d,h=b.useCallback(y=>{if(!r||r.length===0||y.types.includes("UI_NODE"))return!0;if(y.types.includes("Files")){const C=Array.from(y.items);return C.length===0?!0:C.some(O=>{if(O.kind==="file"){if(O.type==="application/zip"||O.type==="application/x-zip-compressed")return r.includes(".zip");if(O.type===""||O.type==="application/octet-stream")return!0}return!1})}return!1},[r]),p=b.useCallback(y=>{y.preventDefault(),y.stopPropagation(),h(y.dataTransfer)?a(!0):y.dataTransfer.dropEffect="none"},[h]),m=b.useCallback(y=>{y.preventDefault(),y.stopPropagation(),h(y.dataTransfer)&&(i.current+=1,a(!0))},[h]),g=b.useCallback(y=>{y.preventDefault(),y.stopPropagation(),i.current=Math.max(0,i.current-1),i.current===0&&a(!1)},[]),v=b.useCallback(()=>{a(!1)},[]),x=b.useCallback(async y=>{y.preventDefault();const O=y.target.closest("[data-drop-zone]"),w=t?.id||"root";if((O?.getAttribute("data-drop-zone")||"root")!==w){a(!1);return}try{let S=yg(y.dataTransfer.items).filter(Boolean);if(r&&r.length>0&&(S=S.filter(A=>{if(!A)return!1;const R=A.name.toLowerCase();return r.some(k=>R.endsWith(k.toLowerCase()))})),S.length){for(const A of S)A&&await f(A,t);return}const P=y.getModifierState("Alt"),j=y.dataTransfer.getData("UI_NODE"),M=JSON.parse(j);P?await l(M,t):await c(M,t)}catch(S){console.error(S)}finally{s&&(i.current=0),a(!1)}},[f,l,c,t,s]);return b.useMemo(()=>{const y={onDragOver:p,onDrop:x,"data-drop-zone":t?.id||"root"};return s?(y.onDragEnter=m,y.onDragLeave=g):y.onDragLeave=v,{isDropTarget:o,dropProps:y}},[o,t?.id,m,g,v,p,x,s])}function yg(e){return Array.from(e).map(n=>n.kind==="file"?n.getAsFile():null).filter(Boolean)}const wa="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 xg(e){const{title:t="Document Already Exists",fileName:n,message:s,children:r,onReplace:o,onOpenChange:a,onDuplicate:i,replaceLabel:c="Replace",duplicateLabel:l="Create Copy",overlayProps:d,contentProps:f,bodyProps:h={},headerProps:p={},containerProps:m={},replaceButtonProps:g={},duplicateButtonProps:v={},buttonContainerProps:x={},...y}=e,C=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 u.jsx(Ye,{contentProps:{...f,className:N("rounded-3xl",f?.className)},onOpenChange:a,overlayProps:{...d,className:d?.className},...y,children:u.jsxs("div",{...ce(m,"w-[450px] p-6 text-slate-300"),children:[u.jsxs("div",{className:"flex items-center justify-between border-b border-slate-50 pb-2",children:[u.jsx("div",{...ce(p,"text-2xl font-bold text-gray-800"),children:t}),u.jsx("button",{type:"button",className:"flex size-6 items-center justify-center rounded-md outline-none hover:bg-slate-100",onClick:()=>a?.(!1),children:u.jsx(I,{name:"XmarkLight",size:24})})]}),u.jsxs("div",{...ce(h,"my-6 rounded-md bg-slate-50 p-4 text-center"),children:[s||C,r]}),u.jsxs("div",{...ce(x,"mt-8 flex justify-between gap-3"),children:[u.jsx("button",{onClick:o,...ce(g,N(wa,"flex-1 bg-slate-50 text-slate-800")),children:c}),u.jsx("button",{onClick:i,...ce(v,N(wa,"flex-1 bg-gray-800 text-gray-50")),children:l})]})]})})}function wg(e){const{status:t,errorDetails:n}=e;return(t==="failed"||t==="unsupported-document-type")&&n?u.jsx("div",{className:"break-words text-xs leading-[18px] text-gray-500",children:n}):null}function Cg(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 Sg(e){const{fileName:t,fileSize:n,documentType:s,onClose:r,...o}=e;return u.jsxs("div",{className:"flex items-center gap-2",...o,children:[u.jsx("div",{className:"flex h-9 w-7 flex-shrink-0 items-center justify-center",children:u.jsx(I,{name:Cg(s),size:48,className:"text-gray-600"})}),u.jsxs("div",{className:"flex flex-1 flex-col gap-0.5",children:[u.jsx("div",{className:"text-xs font-medium leading-[18px] text-gray-900",children:t}),u.jsx("div",{className:"text-xs font-medium leading-[18px] text-gray-500",children:n})]}),r&&u.jsx("div",{className:"flex h-9 w-[18px] flex-shrink-0 items-start justify-center",children:u.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:u.jsx(I,{name:"XmarkLight",size:18})})})]})}function Eg(e){const{status:t,progress:n=0}=e;if(t!=="uploading")return null;const s=Math.min(100,Math.max(0,n));return u.jsx("div",{className:"h-2 w-full overflow-hidden rounded-sm bg-gray-200",children:u.jsx("div",{className:"h-full bg-blue-900 transition-all duration-300 ease-out",style:{width:`${s}%`}})})}function Pg(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 Og(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 Ig(e){return e==="success"?"Open Document":e==="pending"||e==="conflict"?"Find resolution":""}function Ng(e){const{status:t,progress:n=0,onOpenDocument:s,onFindResolution:r}=e,o=()=>{t==="success"&&s?s():(t==="pending"||t==="conflict")&&r&&r()};return u.jsxs("div",{className:"flex items-center justify-between gap-2",children:[u.jsx("div",{className:N("text-xs leading-[18px]",Og(t)),children:Pg(t)}),t==="uploading"&&u.jsxs("div",{className:"text-xs font-medium leading-[18px] text-gray-900",children:[Math.round(n),"%"]}),jg(t,s,r)&&u.jsx("button",{type:"button",onClick:o,className:"text-xs leading-[18px] text-blue-900 hover:opacity-80",children:Ig(t)})]})}const Mg=b.forwardRef(function(t,n){const{fileName:s,fileSize:r,status:o,documentType:a,progress:i=0,errorDetails:c,onClose:l,onOpenDocument:d,onFindResolution:f,className:h,...p}=t;return u.jsxs("div",{ref:n,className:N("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)]",h),...p,children:[u.jsx(Sg,{fileName:s,fileSize:r,documentType:a,onClose:l}),u.jsxs("div",{className:"flex flex-col gap-1",children:[u.jsx(Ng,{status:o,progress:i,onOpenDocument:d,onFindResolution:f}),u.jsx(Eg,{status:o,progress:i}),u.jsx(wg,{status:o,errorDetails:c})]})]})});function Tg(e,t){return t||`Uploading ${e} document${e===1?"":"s"}`}function Ag(e){const{items:t,title:n,defaultCollapsed:s=!1,onClose:r,className:o,...a}=e,[i,c]=b.useState(s),l=b.useMemo(()=>Tg(t.length,n),[t.length,n]);return u.jsxs("div",{className:N("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:[u.jsxs("div",{className:"flex items-center justify-between",children:[u.jsx("button",{type:"button","aria-expanded":!i,"aria-label":i?"Expand list":"Collapse list",onClick:()=>c(d=>!d),className:"min-w-0 flex-1 text-left text-sm font-medium leading-4 text-gray-900 hover:opacity-80",children:l}),u.jsxs("div",{className:"flex shrink-0 items-center gap-4",children:[u.jsx("button",{type:"button","aria-label":i?"Expand":"Collapse",onClick:()=>c(d=>!d),className:"text-gray-900 hover:opacity-80",children:u.jsx("span",{className:N("inline-block h-4 w-4 select-none transition-transform",i?"-rotate-90":"rotate-0"),children:u.jsx(I,{name:"CaretDown",size:16,"aria-hidden":"true"})})}),r&&u.jsx("button",{type:"button","aria-label":"Close",onClick:r,className:"text-gray-900 hover:opacity-80",children:u.jsx("span",{className:"inline-block h-4 w-4 select-none",children:u.jsx(I,{name:"XmarkLight",size:16,"aria-hidden":"true"})})})]})]}),!i&&u.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,f)=>u.jsx(Mg,{...d},`${d.fileName}-${f}`))})]})}function Rg(){return`upload_${Date.now()}_${Math.random().toString(36).substring(2,9)}`}function Dg(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 kg(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 Lg(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 Fg(e){const{uploadsArray:t,uploadsCount:n,removeUpload:s,clearAllUploads:r,setSelectedNode:o,onClose:a,onConflictResolution:i,className:c,...l}=e;if(n===0)return null;const d=Lg(t,s,o,i),f=a??r;return u.jsx("div",{className:N("fixed bottom-4 right-4 z-[1001]",c),...l,children:u.jsx(Ag,{items:d,onClose:f})})}function $g(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:kg(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 zg(e=!1,t){const n=b.useCallback(()=>{if(e&&t)try{const h=localStorage.getItem(`uploadTracker_${t}`);return h?JSON.parse(h):{}}catch(h){return console.error("Failed to load upload tracker from localStorage:",h),{}}return{}},[e,t]),[s,r]=b.useReducer($g,n());b.useEffect(()=>{if(e&&t)try{localStorage.setItem(`uploadTracker_${t}`,JSON.stringify(s))}catch(h){console.error("Failed to save upload tracker to localStorage:",h)}},[s,e,t]);const o=b.useCallback(h=>{if(h)return async(p,m)=>{const g=Rg();r({type:"ADD_UPLOAD",payload:{id:g,fileName:p.name,fileSize:Dg(p.size)}});const v=x=>{r({type:"UPDATE_PROGRESS",payload:{id:g,progress:x}}),x.stage==="conflict"&&r({type:"SET_CONFLICT_DATA",payload:{id:g,file:p,parentNode:m}})};try{const x=await h(p,m,v);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(h=>{r({type:"REMOVE_UPLOAD",payload:{id:h}})},[]),i=b.useCallback(()=>{r({type:"CLEAR_ALL_UPLOADS"})},[]),c=b.useCallback(()=>{r({type:"CLEAR_CONFLICTED_UPLOADS"})},[]),l=b.useCallback(()=>Object.values(s),[s]),d=b.useCallback(()=>Object.keys(s).length,[s]),f=b.useCallback((h,p,m)=>{const g=s[h];if(!g?.file||!m){console.error("Cannot resolve conflict: missing upload data or onAddFile function");return}const v=y=>{r({type:"UPDATE_PROGRESS",payload:{id:h,progress:y}})},x=m(g.file,g.parentNode,v,p);Promise.resolve(x).then(y=>{y&&r({type:"SET_FILE_NODE",payload:{id:h,fileNode:y}})}).catch(y=>{r({type:"SET_ERROR",payload:{id:h,error:y instanceof Error?y.message:"Unknown error"}})})},[s]);return{uploads:s,uploadsArray:l(),uploadsCount:d(),createUploadHandler:o,removeUpload:a,clearAllUploads:i,clearConflictedUploads:c,resolveConflict:f}}function Ug(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:i=!1,driveId:c,acceptedFileExtensions:l=[".zip",".phd",".phdm"],className:d,...f}=e,[h,p]=b.useState(!1),[m,g]=b.useState(null),{uploadsArray:v,uploadsCount:x,createUploadHandler:y,clearAllUploads:C,clearConflictedUploads:O,removeUpload:w,resolveConflict:E}=zg(i,c);b.useEffect(()=>{O()},[]);const S=y(a)??(async()=>{}),P=z=>{g(z),p(!0)},j=()=>{m&&a&&E(m,"replace",a),p(!1),g(null)},M=()=>{m&&a&&E(m,"duplicate",a),p(!1),g(null)},A=()=>{p(!1),g(null)},{isDropTarget:R,dropProps:k}=zc({target:s,onAddFileOverride:S,trackNestedDrag:!0,acceptedFileExtensions:l});return u.jsxs("div",{className:N("relative",d),...r?k:{},...f,children:[o,r&&R&&u.jsx("div",{className:"fixed inset-0 z-[1000] flex min-h-screen w-screen items-center justify-center bg-black/50",children:u.jsx("div",{className:"rounded-[24px] bg-white p-6 shadow-[1px_4px_15px_rgba(74,88,115,0.25)]",children:u.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:[u.jsx("div",{className:"text-center text-base leading-5 text-zinc-500",children:t}),u.jsx("div",{className:"text-center text-base leading-5 text-zinc-500",children:n}),u.jsx("span",{className:"pointer-events-none absolute -bottom-16 left-1/2 z-10 -translate-x-1/2",children:u.jsx(I,{name:"DocumentIcons",size:144,"aria-hidden":"true"})})]})})}),u.jsx(Fg,{uploadsArray:v,uploadsCount:x,removeUpload:w,clearAllUploads:C,setSelectedNode:vt,onConflictResolution:P}),u.jsx(xg,{open:h,onOpenChange:A,fileName:m?v.find(z=>z?.id===m)?.fileName:void 0,onReplace:j,onDuplicate:M})]})}function q6({children:e,...t}){const n=Bu(),s=Oi(),r=Vu(),o=async(a,i,c,l)=>await r(a,c,l);return!n||!s?u.jsx(u.Fragment,{children:e}):u.jsx(Ug,{onAddFile:o,driveId:s,useLocalStorage:!0,...t,children:e})}function wr(e){const{children:t,items:n,open:s,onItemClick:r,onOpenChange:o,menuClassName:a}=e;return u.jsxs(td,{onOpenChange:o,open:s,children:[u.jsx(nd,{asChild:!0,className:"outline-none",children:t}),u.jsx(rd,{className:N("modal-shadow cursor-pointer rounded-2xl bg-white text-sm font-medium text-slate-500",a),children:n.map(({id:i,label:c,icon:l,className:d})=>u.jsxs(sd,{className:N("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:f=>f.stopPropagation(),onSelect:()=>r(i),children:[l?u.jsx("span",{className:"mr-2 inline-block",children:l}):null,c]},i))})]})}const Bg="/assets/powerhouse-rounded-CeKGGUG4.png",Ca=[{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"}]}],Uc=[{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"}],Vg=[...Uc,{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"}]}],Hg=[...Uc,{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"}]}],Sa=[{name:"text",type:"function",stateMutability:"view",inputs:[{name:"name",type:"bytes32"},{name:"key",type:"string"}],outputs:[{name:"",type:"string"}]}];function Ge(e,{includeName:t=!1}={}){if(e.type!=="function"&&e.type!=="event"&&e.type!=="error")throw new tb(e.type);return`${e.name}(${no(e.inputs,{includeName:t})})`}function no(e,{includeName:t=!1}={}){return e?e.map(n=>_g(n,{includeName:t})).join(t?", ":","):""}function _g(e,{includeName:t}){return e.type.startsWith("tuple")?`(${no(e.components,{includeName:t})})${e.type.slice(5)}`:e.type+(t&&e.name?` ${e.name}`:"")}function lt(e,{strict:t=!0}={}){return!e||typeof e!="string"?!1:t?/^0x[0-9a-fA-F]*$/.test(e):e.startsWith("0x")}function fe(e){return lt(e,{strict:!1})?Math.ceil((e.length-2)/2):e.length}const Bc="2.38.6";let zr={getDocsUrl:({docsBaseUrl:e,docsPath:t="",docsSlug:n})=>t?`${e??"https://viem.sh"}${t}${n?`#${n}`:""}`:void 0,version:`viem@${Bc}`},T=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=zr.getDocsUrl?.({...n,docsPath:r}),a=[t||"An error occurred.","",...n.metaMessages?[...n.metaMessages,""]:[],...o?[`Docs: ${o}`]:[],...s?[`Details: ${s}`]:[],...zr.version?[`Version: ${zr.version}`]:[]].join(`
|
|
7
7
|
`);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=Bc}walk(t){return Vc(this,t)}};function Vc(e,t){return t?.(e)?e:e&&typeof e=="object"&&"cause"in e&&e.cause!==void 0?Vc(e.cause,t):t?null:e}class Wg extends T{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(`
|
|
8
8
|
`),{docsPath:t,name:"AbiConstructorNotFoundError"})}}class Ea extends T{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(`
|
|
9
9
|
`),{docsPath:t,name:"AbiConstructorParamsNotFoundError"})}}class Gg extends T{constructor({data:t,params:n,size:s}){super([`Data size of ${s} bytes is too small for given parameters.`].join(`
|
|
@@ -39,7 +39,7 @@ ${$1(p)}`),super(t.shortMessage,{cause:t,docsPath:s,metaMessages:[...t.metaMessa
|
|
|
39
39
|
`),{cause:t,name:"NonceTooLowError"})}}Object.defineProperty(xs,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/nonce too low|transaction already imported|already known/});class ws extends T{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 T{constructor({cause:t}={}){super(["The total cost (gas * gas fee + value) of executing this transaction exceeds the balance of the account."].join(`
|
|
40
40
|
`),{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 T{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 Es extends T{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(Es,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/intrinsic gas too low/});class Ps extends T{constructor({cause:t}){super("The transaction type is not supported for this chain.",{cause:t,name:"TransactionTypeNotSupportedError"})}}Object.defineProperty(Ps,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/transaction type not valid/});class ir extends T{constructor({cause:t,maxPriorityFeePerGas:n,maxFeePerGas:s}={}){super([`The provided tip (\`maxPriorityFeePerGas\`${n?` = ${et(n)} gwei`:""}) cannot be higher than the fee cap (\`maxFeePerGas\`${s?` = ${et(s)} gwei`:""}).`].join(`
|
|
41
41
|
`),{cause:t,name:"TipAboveFeeCapError"})}}Object.defineProperty(ir,"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 Nl extends T{constructor({cause:t}){super(`An error occurred while executing: ${t?.shortMessage}`,{cause:t,name:"UnknownNodeError"})}}function pv(e,t){const n=(e.details||"").toLowerCase(),s=e instanceof T?e.walk(r=>r?.code===mt.code):e;return s instanceof T?new mt({cause:e,message:s.details}):mt.nodeMessage.test(n)?new mt({cause:e,message:e.details}):ar.nodeMessage.test(n)?new ar({cause:e,maxFeePerGas:t?.maxFeePerGas}):vs.nodeMessage.test(n)?new vs({cause:e,maxFeePerGas:t?.maxFeePerGas}):ys.nodeMessage.test(n)?new ys({cause:e,nonce:t?.nonce}):xs.nodeMessage.test(n)?new xs({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}):Es.nodeMessage.test(n)?new Es({cause:e,gas:t?.gas}):Ps.nodeMessage.test(n)?new Ps({cause:e}):ir.nodeMessage.test(n)?new ir({cause:e,maxFeePerGas:t?.maxFeePerGas,maxPriorityFeePerGas:t?.maxPriorityFeePerGas}):new Nl({cause:e})}function mv(e,{docsPath:t,...n}){const s=(()=>{const r=pv(e,n);return r instanceof Nl?e:r})();return new B1(s,{docsPath:t,...n})}function gv(e,{format:t}){if(!t)return{};const n={};function s(o){const a=Object.keys(o);for(const i of a)i in e&&(n[i]=e[i]),o[i]&&typeof o[i]=="object"&&!Array.isArray(o[i])&&s(o[i])}const r=t(e||{});return s(r),n}const bv={legacy:"0x0",eip2930:"0x1",eip1559:"0x2",eip4844:"0x3",eip7702:"0x4"};function vv(e,t){const n={};return typeof e.authorizationList<"u"&&(n.authorizationList=yv(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=>Ce(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=J(e.gas)),typeof e.gasPrice<"u"&&(n.gasPrice=J(e.gasPrice)),typeof e.maxFeePerBlobGas<"u"&&(n.maxFeePerBlobGas=J(e.maxFeePerBlobGas)),typeof e.maxFeePerGas<"u"&&(n.maxFeePerGas=J(e.maxFeePerGas)),typeof e.maxPriorityFeePerGas<"u"&&(n.maxPriorityFeePerGas=J(e.maxPriorityFeePerGas)),typeof e.nonce<"u"&&(n.nonce=J(e.nonce)),typeof e.to<"u"&&(n.to=e.to),typeof e.type<"u"&&(n.type=bv[e.type]),typeof e.value<"u"&&(n.value=J(e.value)),n}function yv(e){return e.map(t=>({address:t.address,r:t.r?J(BigInt(t.r)):t.r,s:t.s?J(BigInt(t.s)):t.s,chainId:J(t.chainId),nonce:J(t.nonce),...typeof t.yParity<"u"?{yParity:J(t.yParity)}:{},...typeof t.v<"u"&&typeof t.yParity>"u"?{v:J(t.v)}:{}}))}function xv(){let e=()=>{},t=()=>{};return{promise:new Promise((s,r)=>{e=s,t=r}),resolve:e,reject:t}}const qr=new Map;function Ml({fn:e,id:t,shouldSplitBatch:n,wait:s=0,sort:r}){const o=async()=>{const d=c();a();const f=d.map(({args:h})=>h);f.length!==0&&e(f).then(h=>{r&&Array.isArray(h)&&h.sort(r);for(let p=0;p<d.length;p++){const{resolve:m}=d[p];m?.([h[p],h])}}).catch(h=>{for(let p=0;p<d.length;p++){const{reject:m}=d[p];m?.(h)}})},a=()=>qr.delete(t),i=()=>c().map(({args:d})=>d),c=()=>qr.get(t)||[],l=d=>qr.set(t,[...c(),d]);return{flush:a,async schedule(d){const{promise:f,resolve:h,reject:p}=xv();return n?.([...i(),d])&&o(),c().length>0?(l({args:d,resolve:h,reject:p}),f):(l({args:d,resolve:h,reject:p}),setTimeout(o,s),f)}}}function ka(e){if(!(!e||e.length===0))return e.reduce((t,{slot:n,value:s})=>{if(n.length!==66)throw new Oa({size:n.length,targetSize:66,type:"hex"});if(s.length!==66)throw new Oa({size:s.length,targetSize:66,type:"hex"});return t[n]=s,t},{})}function wv(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=J(t)),n!==void 0&&(a.nonce=J(n)),s!==void 0&&(a.state=ka(s)),r!==void 0){if(a.state)throw new F1;a.stateDiff=ka(r)}return a}function Cv(e){if(!e)return;const t={};for(const{address:n,...s}of e){if(!Ae(n,{strict:!1}))throw new st({address:n});if(t[n])throw new L1({address:n});t[n]=wv(s)}return t}const Sv=2n**256n-1n;function Ev(e){const{account:t,gasPrice:n,maxFeePerGas:s,maxPriorityFeePerGas:r,to:o}=e,a=t?Sr(t):void 0;if(a&&!Ae(a.address))throw new st({address:a.address});if(o&&!Ae(o))throw new st({address:o});if(typeof n<"u"&&(typeof s<"u"||typeof r<"u"))throw new z1;if(s&&s>Sv)throw new ar({maxFeePerGas:s});if(r&&s&&r>s)throw new ir({maxFeePerGas:s,maxPriorityFeePerGas:r})}async function Tl(e,t){const{account:n=e.account,authorizationList:s,batch:r=!!e.batch?.multicall,blockNumber:o,blockTag:a=e.experimental_blockTag??"latest",accessList:i,blobs:c,blockOverrides:l,code:d,data:f,factory:h,factoryData:p,gas:m,gasPrice:g,maxFeePerBlobGas:v,maxFeePerGas:x,maxPriorityFeePerGas:y,nonce:C,to:O,value:w,stateOverride:E,...S}=t,P=n?Sr(n):void 0;if(d&&(h||p))throw new T("Cannot provide both `code` & `factory`/`factoryData` as parameters.");if(d&&O)throw new T("Cannot provide both `code` & `to` as parameters.");const j=d&&f,M=h&&p&&O&&f,A=j||M,R=j?Al({code:d,data:f}):M?jv({data:f,factory:h,factoryData:p,to:O}):f;try{Ev(t);const z=(typeof o=="bigint"?J(o):void 0)||a,$=l?lv(l):void 0,B=Cv(E),G=e.chain?.formatters?.transactionRequest?.format,ee=(G||vv)({...gv(S,{format:G}),accessList:i,account:P,authorizationList:s,blobs:c,data:R,gas:m,gasPrice:g,maxFeePerBlobGas:v,maxFeePerGas:x,maxPriorityFeePerGas:y,nonce:C,to:A?void 0:O,value:w},"call");if(r&&Pv({request:ee})&&!B&&!$)try{return await Ov(e,{...ee,blockNumber:o,blockTag:a})}catch(U){if(!(U instanceof gl)&&!(U instanceof ms))throw U}const ne=(()=>{const U=[ee,z];return B&&$?[...U,B,$]:B?[...U,B]:$?[...U,{},$]:U})(),ie=await e.request({method:"eth_call",params:ne});return ie==="0x"?{data:void 0}:{data:ie}}catch(k){const z=Iv(k),{offchainLookup:$,offchainLookupSignature:B}=await Pd(async()=>{const{offchainLookup:G,offchainLookupSignature:q}=await Promise.resolve().then(()=>ey);return{offchainLookup:G,offchainLookupSignature:q}},void 0);if(e.ccipRead!==!1&&z?.slice(0,10)===B&&O)return{data:await $(e,{data:z,to:O})};throw A&&z?.slice(0,10)==="0x101bb98d"?new _1({factory:h}):mv(k,{...t,account:P,chain:e.chain})}}function Pv({request:e}){const{data:t,to:n,...s}=e;return!(!t||t.startsWith(uv)||!n||Object.values(s).filter(r=>typeof r<"u").length>0)}async function Ov(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:i,to:c}=t,l=(()=>{if(s)return null;if(t.multicallAddress)return t.multicallAddress;if(e.chain)return bo({blockNumber:o,chain:e.chain,contract:"multicall3"});throw new gl})(),f=(typeof o=="bigint"?J(o):void 0)||a,{schedule:h}=Ml({id:`${e.uid}.${f}`,wait:r,shouldSplitBatch(g){return g.reduce((x,{data:y})=>x+(y.length-2),0)>n*2},fn:async g=>{const v=g.map(C=>({allowFailure:!0,callData:C.data,target:C.to})),x=go({abi:Ca,args:[v],functionName:"aggregate3"}),y=await e.request({method:"eth_call",params:[{...l===null?{data:Al({code:hv,data:x})}:{to:l,data:x}},f]});return mo({abi:Ca,args:[v],functionName:"aggregate3",data:y||"0x"})}}),[{returnData:p,success:m}]=await h({data:i,to:c});if(!m)throw new Cl({data:p});return p==="0x"?{data:void 0}:{data:p}}function Al(e){const{code:t,data:n}=e;return Il({abi:hl(["constructor(bytes, bytes)"]),bytecode:dv,args:[t,n]})}function jv(e){const{data:t,factory:n,factoryData:s,to:r}=e;return Il({abi:hl(["constructor(address, bytes, address, bytes)"]),bytecode:fv,args:[r,t,n,s]})}function Iv(e){if(!(e instanceof T))return;const t=e.walk();return typeof t?.data=="object"?t.data?.data:t.data}async function cr(e,t){const{abi:n,address:s,args:r,functionName:o,...a}=t,i=go({abi:n,args:r,functionName:o});try{const{data:c}=await Pr(e,Tl,"call")({...a,data:i,to:s});return mo({abi:n,args:r,functionName:o,data:c||"0x"})}catch(c){throw tv(c,{abi:n,address:s,args:r,docsPath:"/docs/contract/readContract",functionName:o})}}class Nv extends T{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 kt extends T{constructor({reason:t}){super(`ENS NFT avatar URI is invalid. ${t}`,{name:"EnsAvatarInvalidNftUriError"})}}class yo extends T{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 Mv extends T{constructor({namespace:t}){super(`ENS NFT avatar namespace "${t}" is not supported. Must be "erc721" or "erc1155".`,{name:"EnsAvatarUnsupportedNamespaceError"})}}const Tv=/(?<protocol>https?:\/\/[^/]*|ipfs:\/|ipns:\/|ar:\/)?(?<root>\/)?(?<subpath>ipfs\/|ipns\/)?(?<target>[\w\-.]+)(?<subtarget>\/.*)?/,Av=/^(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>\/.*)?$/,Rv=/^data:([a-zA-Z\-/+]*);base64,([^"].*)/,Dv=/^data:([a-zA-Z\-/+]*)?(;[a-zA-Z0-9].*?)?(,)/;async function kv(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 La(e,t){return e?e.endsWith("/")?e.slice(0,-1):e:t}function Rl({uri:e,gatewayUrls:t}){const n=Rv.test(e);if(n)return{uri:e,isOnChain:!0,isEncoded:n};const s=La(t?.ipfs,"https://ipfs.io"),r=La(t?.arweave,"https://arweave.net"),o=e.match(Tv),{protocol:a,subpath:i,target:c,subtarget:l=""}=o?.groups||{},d=a==="ipns:/"||i==="ipns/",f=a==="ipfs:/"||i==="ipfs/"||Av.test(e);if(e.startsWith("http")&&!d&&!f){let p=e;return t?.arweave&&(p=e.replace(/https:\/\/arweave.net/g,t?.arweave)),{uri:p,isOnChain:!1,isEncoded:!1}}if((d||f)&&c)return{uri:`${s}/${d?"ipns":"ipfs"}/${c}${l}`,isOnChain:!1,isEncoded:!1};if(a==="ar:/"&&c)return{uri:`${r}/${c}${l||""}`,isOnChain:!1,isEncoded:!1};let h=e.replace(Dv,"");if(h.startsWith("<svg")&&(h=`data:image/svg+xml;base64,${btoa(h)}`),h.startsWith("data:")||h.startsWith("{"))return{uri:h,isOnChain:!0,isEncoded:!1};throw new yo({uri:e})}function Dl(e){if(typeof e!="object"||!("image"in e)&&!("image_url"in e)&&!("image_data"in e))throw new Nv({data:e});return e.image||e.image_url||e.image_data}async function Lv({gatewayUrls:e,uri:t}){try{const n=await fetch(t).then(r=>r.json());return await xo({gatewayUrls:e,uri:Dl(n)})}catch{throw new yo({uri:t})}}async function xo({gatewayUrls:e,uri:t}){const{uri:n,isOnChain:s}=Rl({uri:t,gatewayUrls:e});if(s||await kv(n))return n;throw new yo({uri:t})}function Fv(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(":"),[i,c]=s.split(":");if(!o||o.toLowerCase()!=="eip155")throw new kt({reason:"Only EIP-155 supported"});if(!a)throw new kt({reason:"Chain ID not found"});if(!c)throw new kt({reason:"Contract address not found"});if(!r)throw new kt({reason:"Token ID not found"});if(!i)throw new kt({reason:"ERC namespace not found"});return{chainID:Number.parseInt(a,10),namespace:i.toLowerCase(),contractAddress:c,tokenID:r}}async function $v(e,{nft:t}){if(t.namespace==="erc721")return cr(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 cr(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 Mv({namespace:t.namespace})}async function zv(e,{gatewayUrls:t,record:n}){return/eip155:/i.test(n)?Uv(e,{gatewayUrls:t,record:n}):xo({uri:n,gatewayUrls:t})}async function Uv(e,{gatewayUrls:t,record:n}){const s=Fv(n),r=await $v(e,{nft:s}),{uri:o,isOnChain:a,isEncoded:i}=Rl({uri:r,gatewayUrls:t});if(a&&(o.includes("data:application/json;base64,")||o.startsWith("{"))){const l=i?atob(o.replace("data:application/json;base64,","")):o,d=JSON.parse(l);return xo({uri:Dl(d),gatewayUrls:t})}let c=s.tokenID;return s.namespace==="erc1155"&&(c=c.replace("0x","").padStart(64,"0")),Lv({gatewayUrls:t,uri:o.replace(/(?:0x)?{id}/,c)})}async function Bv(e,t){const{blockNumber:n,blockTag:s,key:r,name:o,gatewayUrls:a,strict:i}=t,{chain:c}=e,l=(()=>{if(t.universalResolverAddress)return t.universalResolverAddress;if(!c)throw new Error("client chain not configured. universalResolverAddress is required.");return bo({blockNumber:n,chain:c,contract:"ensUniversalResolver"})})(),d=c?.ensTlds;if(d&&!d.some(f=>o.endsWith(f)))return null;try{const f={address:l,abi:Vg,args:[Kc(J1(o)),go({abi:Sa,functionName:"text",args:[Y1(o),r]}),a??[Er]],functionName:"resolveWithGateways",blockNumber:n,blockTag:s},p=await Pr(e,cr,"readContract")(f);if(p[0]==="0x")return null;const m=mo({abi:Sa,functionName:"text",data:p[0]});return m===""?null:m}catch(f){if(i)throw f;if(Sl(f))return null;throw f}}async function Vv(e,{blockNumber:t,blockTag:n,assetGatewayUrls:s,name:r,gatewayUrls:o,strict:a,universalResolverAddress:i}){const c=await Pr(e,Bv,"getEnsText")({blockNumber:t,blockTag:n,key:"avatar",name:r,universalResolverAddress:i,gatewayUrls:o,strict:a});if(!c)return null;try{return await zv(e,{record:c,gatewayUrls:s})}catch{return null}}async function Hv(e,t){const{address:n,blockNumber:s,blockTag:r,coinType:o=60n,gatewayUrls:a,strict:i}=t,{chain:c}=e,l=(()=>{if(t.universalResolverAddress)return t.universalResolverAddress;if(!c)throw new Error("client chain not configured. universalResolverAddress is required.");return bo({blockNumber:s,chain:c,contract:"ensUniversalResolver"})})();try{const d={address:l,abi:Hg,args:[n,o,a??[Er]],functionName:"reverseWithGateways",blockNumber:s,blockTag:r},f=Pr(e,cr,"readContract"),[h]=await f(d);return h||null}catch(d){if(i)throw d;if(Sl(d))return null;throw d}}function _v(e,t){if(!Ae(e,{strict:!1}))throw new st({address:e});if(!Ae(t,{strict:!1}))throw new st({address:t});return e.toLowerCase()===t.toLowerCase()}const Rn=new co(8192);function Wv(e,{enabled:t=!0,id:n}){if(!t||!n)return e();if(Rn.get(n))return Rn.get(n);const s=e().finally(()=>Rn.delete(n));return Rn.set(n,s),s}async function Gv(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:i=0}={})=>{const c=async({error:l})=>{const d=typeof t=="function"?t({count:i,error:l}):t;d&&await Gv(d),a({count:i+1})};try{const l=await e();r(l)}catch(l){if(i<n&&await s({count:i,error:l}))return c({error:l});o(l)}};a()})}function qv(e,t={}){return async(n,s={})=>{const{dedupe:r=!1,methods:o,retryDelay:a=150,retryCount:i=3,uid:c}={...t,...s},{method:l}=n;if(o?.exclude?.includes(l))throw new Je(new Error("method not supported"),{method:l});if(o?.include&&!o.include.includes(l))throw new Je(new Error("method not supported"),{method:l});const d=r?oo(`${c}.${Me(n)}`):void 0;return Wv(()=>kl(async()=>{try{return await e(n)}catch(f){const h=f;switch(h.code){case Wt.code:throw new Wt(h);case Gt.code:throw new Gt(h);case qt.code:throw new qt(h,{method:n.method});case Yt.code:throw new Yt(h);case at.code:throw new at(h);case Qt.code:throw new Qt(h);case Kt.code:throw new Kt(h);case _e.code:throw new _e(h);case Jt.code:throw new Jt(h);case Je.code:throw new Je(h,{method:n.method});case St.code:throw new St(h);case Xt.code:throw new Xt(h);case he.code:throw new he(h);case Zt.code:throw new Zt(h);case en.code:throw new en(h);case tn.code:throw new tn(h);case nn.code:throw new nn(h);case it.code:throw new it(h);case rn.code:throw new rn(h);case sn.code:throw new sn(h);case on.code:throw new on(h);case an.code:throw new an(h);case cn.code:throw new cn(h);case ln.code:throw new ln(h);case un.code:throw new un(h);case 5e3:throw new he(h);default:throw f instanceof T?f:new Z1(h)}}},{delay:({count:f,error:h})=>{if(h&&h instanceof tt){const p=h?.headers?.get("Retry-After");if(p?.match(/\d/))return Number.parseInt(p,10)*1e3}return~~(1<<f)*a},retryCount:i,shouldRetry:({error:f})=>Yv(f)}),{enabled:r,id:d})}}function Yv(e){return"code"in e&&typeof e.code=="number"?e.code===-1||e.code===St.code||e.code===at.code:e instanceof tt&&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 Qv extends T{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(i=>` ${wn(i)}`)],` Sender: ${o}`,` Data: ${s}`,` Callback selector: ${t}`,` Extra data: ${r}`].flat(),name:"OffchainLookupError"})}}class Kv extends T{constructor({result:t,url:n}){super("Offchain gateway response is malformed. Response data must be a hex value.",{metaMessages:[`Gateway URL: ${wn(n)}`,`Response: ${Me(t)}`],name:"OffchainLookupResponseMalformedError"})}}class Jv extends T{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 Xv="0x556f1830",Ll={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 Zv(e,{blockNumber:t,blockTag:n,data:s,to:r}){const{args:o}=vl({data:s,abi:[Ll]}),[a,i,c,l,d]=o,{ccipRead:f}=e,h=f&&typeof f?.request=="function"?f.request:Fl;try{if(!_v(r,a))throw new Jv({sender:a,to:r});const p=i.includes(Er)?await El({data:c,ccipRequest:h}):await h({data:c,sender:a,urls:i}),{data:m}=await Tl(e,{blockNumber:t,blockTag:n,data:qe([l,vn([{type:"bytes"},{type:"bytes"}],[p,d])]),to:r});return m}catch(p){throw new Qv({callbackSelector:l,cause:p,data:s,extraData:d,sender:a,urls:i})}}async function Fl({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",i=a==="POST"?{data:e,sender:t}:void 0,c=a==="POST"?{"Content-Type":"application/json"}:{};try{const l=await fetch(o.replace("{sender}",t.toLowerCase()).replace("{data}",e),{body:JSON.stringify(i),headers:c,method:a});let d;if(l.headers.get("Content-Type")?.startsWith("application/json")?d=(await l.json()).data:d=await l.text(),!l.ok){s=new tt({body:i,details:d?.error?Me(d.error):l.statusText,headers:l.headers,status:l.status,url:o});continue}if(!lt(d)){s=new Kv({result:d,url:o});continue}return d}catch(l){s=new tt({body:i,details:l.message,url:o})}}throw s}const ey=Object.freeze(Object.defineProperty({__proto__:null,ccipRequest:Fl,offchainLookup:Zv,offchainLookupAbiItem:Ll,offchainLookupSignature:Xv},Symbol.toStringTag,{value:"Module"}));function ty(e){return{formatters:void 0,fees:void 0,serializers:void 0,...e}}function $l(e,{errorInstance:t=new Error("timed out"),timeout:n,signal:s}){return new Promise((r,o)=>{(async()=>{let a;try{const i=new AbortController;n>0&&(a=setTimeout(()=>{s?i.abort():o(t)},n)),r(await e({signal:i?.signal||null}))}catch(i){i?.name==="AbortError"&&o(t),o(i)}finally{clearTimeout(a)}})()})}function ny(){return{current:0,take(){return this.current++},reset(){this.current=0}}}const Fa=ny();function ry(e,t={}){return{async request(n){const{body:s,fetchFn:r=t.fetchFn??fetch,onRequest:o=t.onRequest,onResponse:a=t.onResponse,timeout:i=t.timeout??1e4}=n,c={...t.fetchOptions??{},...n.fetchOptions??{}},{headers:l,method:d,signal:f}=c;try{const h=await $l(async({signal:m})=>{const g={...c,body:Array.isArray(s)?Me(s.map(C=>({jsonrpc:"2.0",id:C.id??Fa.take(),...C}))):Me({jsonrpc:"2.0",id:s.id??Fa.take(),...s}),headers:{"Content-Type":"application/json",...l},method:d||"POST",signal:f||(i>0?m:null)},v=new Request(e,g),x=await o?.(v,g)??{...g,url:e};return await r(x.url??e,x)},{errorInstance:new Da({body:s,url:e}),timeout:i,signal:!0});a&&await a(h);let p;if(h.headers.get("Content-Type")?.startsWith("application/json"))p=await h.json();else{p=await h.text();try{p=JSON.parse(p||"{}")}catch(m){if(h.ok)throw m;p={error:p}}}if(!h.ok)throw new tt({body:s,details:Me(p.error)||h.statusText,headers:h.headers,status:h.status,url:e});return p}catch(h){throw h instanceof tt||h instanceof Da?h:new tt({body:s,cause:h,url:e})}}}}function zl(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 qn="2.22.1",sy=()=>`@wagmi/core@${qn}`;var Ul=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)},lr,Bl;let wo=class Os extends Error{get docsBaseUrl(){return"https://wagmi.sh/core"}get version(){return sy()}constructor(t,n={}){super(),lr.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 Os?n.cause.details:n.cause?.message?n.cause.message:n.details,r=n.cause instanceof Os&&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(`
|
|
42
|
-
`),n.cause&&(this.cause=n.cause),this.details=s,this.docsPath=r,this.metaMessages=n.metaMessages,this.shortMessage=t}walk(t){return Ul(this,lr,"m",Bl).call(this,this,t)}};lr=new WeakSet,Bl=function e(t,n){return n?.(t)?t:t.cause?Ul(this,lr,"m",e).call(this,t.cause,n):t};class js extends wo{constructor(){super("Chain not configured."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ChainNotConfiguredError"})}}const Is=256;let Dn=Is,kn;function Vl(e=11){if(!kn||Dn+e>Is*2){kn="",Dn=0;for(let t=0;t<Is;t++)kn+=(256+Math.random()*256|0).toString(16).substring(1)}return kn.substring(Dn,Dn+++e)}function oy(e){const{batch:t,chain:n,ccipRead:s,key:r="base",name:o="Base Client",type:a="base"}=e,i=e.experimental_blockTag??(typeof n?.experimental_preconfirmationTime=="number"?"pending":void 0),c=n?.blockTime??12e3,l=Math.min(Math.max(Math.floor(c/2),500),4e3),d=e.pollingInterval??l,f=e.cacheTime??d,h=e.account?Sr(e.account):void 0,{config:p,request:m,value:g}=e.transport({chain:n,pollingInterval:d}),v={...p,...g},x={account:h,batch:t,cacheTime:f,ccipRead:s,chain:n,key:r,name:o,pollingInterval:d,request:m,transport:v,type:a,uid:Vl(),...i?{experimental_blockTag:i}:{}};function y(C){return O=>{const w=O(C);for(const S in x)delete w[S];const E={...C,...w};return Object.assign(E,{extend:y(E)})}}return Object.assign(x,{extend:y(x)})}function ay({key:e,methods:t,name:n,request:s,retryCount:r=3,retryDelay:o=150,timeout:a,type:i},c){const l=Vl();return{config:{key:e,methods:t,name:n,request:s,retryCount:r,retryDelay:o,timeout:a,type:i},request:qv(s,{methods:t,retryCount:r,retryDelay:o,uid:l}),value:c}}class iy extends T{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 cy(e,t={}){const{batch:n,fetchFn:s,fetchOptions:r,key:o="http",methods:a,name:i="HTTP JSON-RPC",onFetchRequest:c,onFetchResponse:l,retryDelay:d,raw:f}=t;return({chain:h,retryCount:p,timeout:m})=>{const{batchSize:g=1e3,wait:v=0}=typeof n=="object"?n:{},x=t.retryCount??p,y=m??t.timeout??1e4,C=h?.rpcUrls.default.http[0];if(!C)throw new iy;const O=ry(C,{fetchFn:s,fetchOptions:r,onRequest:c,onResponse:l,timeout:y});return ay({key:o,methods:a,name:i,async request({method:w,params:E}){const S={method:w,params:E},{schedule:P}=Ml({id:C,wait:v,shouldSplitBatch(R){return R.length>g},fn:R=>O.request({body:R}),sort:(R,k)=>R.id-k.id}),j=async R=>n?P(R):[await O.request({body:R})],[{error:M,result:A}]=await j(S);if(f)return{error:M,result:A};if(M)throw new vo({body:S,error:M,url:C});return A},retryCount:x,retryDelay:d,timeout:y,type:"http"},{fetchOptions:r,url:C})}}function $a(e){return e.state.chainId}function ly(e,t){const{chainId:n,...s}=t,r=e.getClient({chainId:n});return zl(r,Vv,"getEnsAvatar")(s)}function uy(e,t){const{chainId:n,...s}=t,r=e.getClient({chainId:n});return zl(r,Hv,"getEnsName")(s)}let Yr=!1;async function dy(e,t={}){if(Yr)return[];Yr=!0,e.setState(l=>({...l,status:l.current?"reconnecting":"connecting"}));const n=[];if(t.connectors?.length)for(const l of t.connectors){let d;typeof l=="function"?d=e._internal.connectors.setup(l):d=l,n.push(d)}else n.push(...e.connectors);let s;try{s=await e.storage?.getItem("recentConnectorId")}catch{}const r={};for(const[,l]of e.state.connections)r[l.connector.id]=1;s&&(r[s]=0);const o=Object.keys(r).length>0?[...n].sort((l,d)=>(r[l.id]??10)-(r[d.id]??10)):n;let a=!1;const i=[],c=[];for(const l of o){const d=await l.getProvider().catch(()=>{});if(!d||c.some(p=>p===d)||!await l.isAuthorized())continue;const h=await l.connect({isReconnecting:!0}).catch(()=>null);h&&(l.emitter.off("connect",e._internal.events.connect),l.emitter.on("change",e._internal.events.change),l.emitter.on("disconnect",e._internal.events.disconnect),e.setState(p=>{const m=new Map(a?p.connections:new Map).set(l.uid,{accounts:h.accounts,chainId:h.chainId,connector:l});return{...p,current:a?p.current:l.uid,connections:m}}),i.push({accounts:h.accounts,chainId:h.chainId,connector:l}),c.push(d),a=!0)}return(e.state.status==="reconnecting"||e.state.status==="connecting")&&(a?e.setState(l=>({...l,status:"connected"})):e.setState(l=>({...l,connections:new Map,current:null,status:"disconnected"}))),Yr=!1,i}class ft extends wo{constructor(){super("Provider not found."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ProviderNotFoundError"})}}function fy(e,t){const{onChange:n}=t;return e.subscribe(s=>s.chainId,n)}Co.type="injected";function Co(e={}){const{shimDisconnect:t=!0,unstable_shimAsyncInject:n}=e;function s(){const c=e.target;if(typeof c=="function"){const l=c();if(l)return l}return typeof c=="object"?c:typeof c=="string"?{...hy[c]??{id:c,name:`${c[0].toUpperCase()}${c.slice(1)}`,provider:`is${c[0].toUpperCase()}${c.slice(1)}`}}:{id:"injected",name:"Injected",provider(l){return l?.ethereum}}}let r,o,a,i;return c=>({get icon(){return s().icon},get id(){return s().id},get name(){return s().name},get supportsSimulation(){return!0},type:Co.type,async setup(){const l=await this.getProvider();l?.on&&e.target&&(a||(a=this.onConnect.bind(this),l.on("connect",a)),r||(r=this.onAccountsChanged.bind(this),l.on("accountsChanged",r)))},async connect({chainId:l,isReconnecting:d,withCapabilities:f}={}){const h=await this.getProvider();if(!h)throw new ft;let p=[];if(d)p=await this.getAccounts().catch(()=>[]);else if(t)try{p=(await h.request({method:"wallet_requestPermissions",params:[{eth_accounts:{}}]}))[0]?.caveats?.[0]?.value?.map(g=>An(g)),p.length>0&&(p=await this.getAccounts())}catch(m){const g=m;if(g.code===he.code)throw new he(g);if(g.code===_e.code)throw g}try{!p?.length&&!d&&(p=(await h.request({method:"eth_requestAccounts"})).map(v=>An(v))),a&&(h.removeListener("connect",a),a=void 0),r||(r=this.onAccountsChanged.bind(this),h.on("accountsChanged",r)),o||(o=this.onChainChanged.bind(this),h.on("chainChanged",o)),i||(i=this.onDisconnect.bind(this),h.on("disconnect",i));let m=await this.getChainId();return l&&m!==l&&(m=(await this.switchChain({chainId:l}).catch(v=>{if(v.code===he.code)throw v;return{id:m}}))?.id??m),t&&await c.storage?.removeItem(`${this.id}.disconnected`),e.target||await c.storage?.setItem("injected.connected",!0),{accounts:f?p.map(g=>({address:g,capabilities:{}})):p,chainId:m}}catch(m){const g=m;throw g.code===he.code?new he(g):g.code===_e.code?new _e(g):g}},async disconnect(){const l=await this.getProvider();if(!l)throw new ft;o&&(l.removeListener("chainChanged",o),o=void 0),i&&(l.removeListener("disconnect",i),i=void 0),a||(a=this.onConnect.bind(this),l.on("connect",a));try{await $l(()=>l.request({method:"wallet_revokePermissions",params:[{eth_accounts:{}}]}),{timeout:100})}catch{}t&&await c.storage?.setItem(`${this.id}.disconnected`,!0),e.target||await c.storage?.removeItem("injected.connected")},async getAccounts(){const l=await this.getProvider();if(!l)throw new ft;return(await l.request({method:"eth_accounts"})).map(f=>An(f))},async getChainId(){const l=await this.getProvider();if(!l)throw new ft;const d=await l.request({method:"eth_chainId"});return Number(d)},async getProvider(){if(typeof window>"u")return;let l;const d=s();return typeof d.provider=="function"?l=d.provider(window):typeof d.provider=="string"?l=Yn(window,d.provider):l=d.provider,l&&!l.removeListener&&("off"in l&&typeof l.off=="function"?l.removeListener=l.off:l.removeListener=()=>{}),l},async isAuthorized(){try{if(t&&await c.storage?.getItem(`${this.id}.disconnected`)||!e.target&&!await c.storage?.getItem("injected.connected"))return!1;if(!await this.getProvider()){if(n!==void 0&&n!==!1){const h=async()=>(typeof window<"u"&&window.removeEventListener("ethereum#initialized",h),!!await this.getProvider()),p=typeof n=="number"?n:1e3;if(await Promise.race([...typeof window<"u"?[new Promise(g=>window.addEventListener("ethereum#initialized",()=>g(h()),{once:!0}))]:[],new Promise(g=>setTimeout(()=>g(h()),p))]))return!0}throw new ft}return!!(await kl(()=>this.getAccounts())).length}catch{return!1}},async switchChain({addEthereumChainParameter:l,chainId:d}){const f=await this.getProvider();if(!f)throw new ft;const h=c.chains.find(m=>m.id===d);if(!h)throw new it(new js);const p=new Promise(m=>{const g=(v=>{"chainId"in v&&v.chainId===d&&(c.emitter.off("change",g),m())});c.emitter.on("change",g)});try{return await Promise.all([f.request({method:"wallet_switchEthereumChain",params:[{chainId:J(d)}]}).then(async()=>{await this.getChainId()===d&&c.emitter.emit("change",{chainId:d})}),p]),h}catch(m){const g=m;if(g.code===4902||g?.data?.originalError?.code===4902)try{const{default:v,...x}=h.blockExplorers??{};let y;l?.blockExplorerUrls?y=l.blockExplorerUrls:v&&(y=[v.url,...Object.values(x).map(w=>w.url)]);let C;l?.rpcUrls?.length?C=l.rpcUrls:C=[h.rpcUrls.default?.http[0]??""];const O={blockExplorerUrls:y,chainId:J(d),chainName:l?.chainName??h.name,iconUrls:l?.iconUrls,nativeCurrency:l?.nativeCurrency??h.nativeCurrency,rpcUrls:C};return await Promise.all([f.request({method:"wallet_addEthereumChain",params:[O]}).then(async()=>{if(await this.getChainId()===d)c.emitter.emit("change",{chainId:d});else throw new he(new Error("User rejected switch after adding network."))}),p]),h}catch(v){throw new he(v)}throw g.code===he.code?new he(g):new it(g)}},async onAccountsChanged(l){if(l.length===0)this.onDisconnect();else if(c.emitter.listenerCount("connect")){const d=(await this.getChainId()).toString();this.onConnect({chainId:d}),t&&await c.storage?.removeItem(`${this.id}.disconnected`)}else c.emitter.emit("change",{accounts:l.map(d=>An(d))})},onChainChanged(l){const d=Number(l);c.emitter.emit("change",{chainId:d})},async onConnect(l){const d=await this.getAccounts();if(d.length===0)return;const f=Number(l.chainId);c.emitter.emit("connect",{accounts:d,chainId:f});const h=await this.getProvider();h&&(a&&(h.removeListener("connect",a),a=void 0),r||(r=this.onAccountsChanged.bind(this),h.on("accountsChanged",r)),o||(o=this.onChainChanged.bind(this),h.on("chainChanged",o)),i||(i=this.onDisconnect.bind(this),h.on("disconnect",i)))},async onDisconnect(l){const d=await this.getProvider();l&&l.code===1013&&d&&(await this.getAccounts()).length||(c.emitter.emit("disconnect"),d&&(o&&(d.removeListener("chainChanged",o),o=void 0),i&&(d.removeListener("disconnect",i),i=void 0),a||(a=this.onConnect.bind(this),d.on("connect",a))))}})}const hy={coinbaseWallet:{id:"coinbaseWallet",name:"Coinbase Wallet",provider(e){return e?.coinbaseWalletExtension?e.coinbaseWalletExtension:Yn(e,"isCoinbaseWallet")}},metaMask:{id:"metaMask",name:"MetaMask",provider(e){return Yn(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:Yn(e,"isPhantom")}}};function Yn(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 py(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 my(){const e=new Set;let t=[];const n=()=>py(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 gy=e=>(t,n,s)=>{const r=s.subscribe;return s.subscribe=(a,i,c)=>{let l=a;if(i){const d=c?.equalityFn||Object.is;let f=a(s.getState());l=h=>{const p=a(h);if(!d(f,p)){const m=f;i(f=p,m)}},c?.fireImmediately&&i(f,f)}return r(l)},e(t,n,s)},by=gy;function vy(e,t){let n;try{n=e()}catch{return}return{getItem:r=>{var o;const a=c=>c===null?null:JSON.parse(c,void 0),i=(o=n.getItem(r))!=null?o:null;return i instanceof Promise?i.then(a):a(i)},setItem:(r,o)=>n.setItem(r,JSON.stringify(o,void 0)),removeItem:r=>n.removeItem(r)}}const Ns=e=>t=>{try{const n=e(t);return n instanceof Promise?n:{then(s){return Ns(s)(n)},catch(s){return this}}}catch(n){return{then(s){return this},catch(s){return Ns(s)(n)}}}},yy=(e,t)=>(n,s,r)=>{let o={storage:vy(()=>localStorage),partialize:g=>g,version:0,merge:(g,v)=>({...v,...g}),...t},a=!1;const i=new Set,c=new Set;let l=o.storage;if(!l)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 l.setItem(o.name,{state:g,version:o.version})},f=r.setState;r.setState=(g,v)=>{f(g,v),d()};const h=e((...g)=>{n(...g),d()},s,r);r.getInitialState=()=>h;let p;const m=()=>{var g,v;if(!l)return;a=!1,i.forEach(y=>{var C;return y((C=s())!=null?C:h)});const x=((v=o.onRehydrateStorage)==null?void 0:v.call(o,(g=s())!=null?g:h))||void 0;return Ns(l.getItem.bind(l))(o.name).then(y=>{if(y)if(typeof y.version=="number"&&y.version!==o.version){if(o.migrate)return[!0,o.migrate(y.state,y.version)];console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}else return[!1,y.state];return[!1,void 0]}).then(y=>{var C;const[O,w]=y;if(p=o.merge(w,(C=s())!=null?C:h),n(p,!0),O)return d()}).then(()=>{x?.(p,void 0),p=s(),a=!0,c.forEach(y=>y(p))}).catch(y=>{x?.(void 0,y)})};return r.persist={setOptions:g=>{o={...o,...g},g.storage&&(l=g.storage)},clearStorage:()=>{l?.removeItem(o.name)},getOptions:()=>o,rehydrate:()=>m(),hasHydrated:()=>a,onHydrate:g=>(i.add(g),()=>{i.delete(g)}),onFinishHydration:g=>(c.add(g),()=>{c.delete(g)})},o.skipHydration||m(),p||h},xy=yy,za=e=>{let t;const n=new Set,s=(l,d)=>{const f=typeof l=="function"?l(t):l;if(!Object.is(f,t)){const h=t;t=d??(typeof f!="object"||f===null)?f:Object.assign({},t,f),n.forEach(p=>p(t,h))}},r=()=>t,i={setState:s,getState:r,getInitialState:()=>c,subscribe:l=>(n.add(l),()=>n.delete(l))},c=t=e(s,r,i);return i},Qr=e=>e?za(e):za;var Kr={exports:{}},Ua;function wy(){return Ua||(Ua=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(c,l,d){this.fn=c,this.context=l,this.once=d||!1}function o(c,l,d,f,h){if(typeof d!="function")throw new TypeError("The listener must be a function");var p=new r(d,f||c,h),m=n?n+l:l;return c._events[m]?c._events[m].fn?c._events[m]=[c._events[m],p]:c._events[m].push(p):(c._events[m]=p,c._eventsCount++),c}function a(c,l){--c._eventsCount===0?c._events=new s:delete c._events[l]}function i(){this._events=new s,this._eventsCount=0}i.prototype.eventNames=function(){var l=[],d,f;if(this._eventsCount===0)return l;for(f in d=this._events)t.call(d,f)&&l.push(n?f.slice(1):f);return Object.getOwnPropertySymbols?l.concat(Object.getOwnPropertySymbols(d)):l},i.prototype.listeners=function(l){var d=n?n+l:l,f=this._events[d];if(!f)return[];if(f.fn)return[f.fn];for(var h=0,p=f.length,m=new Array(p);h<p;h++)m[h]=f[h].fn;return m},i.prototype.listenerCount=function(l){var d=n?n+l:l,f=this._events[d];return f?f.fn?1:f.length:0},i.prototype.emit=function(l,d,f,h,p,m){var g=n?n+l:l;if(!this._events[g])return!1;var v=this._events[g],x=arguments.length,y,C;if(v.fn){switch(v.once&&this.removeListener(l,v.fn,void 0,!0),x){case 1:return v.fn.call(v.context),!0;case 2:return v.fn.call(v.context,d),!0;case 3:return v.fn.call(v.context,d,f),!0;case 4:return v.fn.call(v.context,d,f,h),!0;case 5:return v.fn.call(v.context,d,f,h,p),!0;case 6:return v.fn.call(v.context,d,f,h,p,m),!0}for(C=1,y=new Array(x-1);C<x;C++)y[C-1]=arguments[C];v.fn.apply(v.context,y)}else{var O=v.length,w;for(C=0;C<O;C++)switch(v[C].once&&this.removeListener(l,v[C].fn,void 0,!0),x){case 1:v[C].fn.call(v[C].context);break;case 2:v[C].fn.call(v[C].context,d);break;case 3:v[C].fn.call(v[C].context,d,f);break;case 4:v[C].fn.call(v[C].context,d,f,h);break;default:if(!y)for(w=1,y=new Array(x-1);w<x;w++)y[w-1]=arguments[w];v[C].fn.apply(v[C].context,y)}}return!0},i.prototype.on=function(l,d,f){return o(this,l,d,f,!1)},i.prototype.once=function(l,d,f){return o(this,l,d,f,!0)},i.prototype.removeListener=function(l,d,f,h){var p=n?n+l:l;if(!this._events[p])return this;if(!d)return a(this,p),this;var m=this._events[p];if(m.fn)m.fn===d&&(!h||m.once)&&(!f||m.context===f)&&a(this,p);else{for(var g=0,v=[],x=m.length;g<x;g++)(m[g].fn!==d||h&&!m[g].once||f&&m[g].context!==f)&&v.push(m[g]);v.length?this._events[p]=v.length===1?v[0]:v:a(this,p)}return this},i.prototype.removeAllListeners=function(l){var d;return l?(d=n?n+l:l,this._events[d]&&a(this,d)):(this._events=new s,this._eventsCount=0),this},i.prototype.off=i.prototype.removeListener,i.prototype.addListener=i.prototype.on,i.prefixed=n,i.EventEmitter=i,e.exports=i})(Kr)),Kr.exports}var Cy=wy();const Sy=Di(Cy);class Ey{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 Sy})}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 Py(e){return new Ey(e)}function Oy(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 Ba(e,t){return e.slice(0,t).join(".")||"."}function Va(e,t){const{length:n}=e;for(let s=0;s<n;++s)if(e[s]===t)return s+1;return 0}function jy(e,t){const n=typeof e=="function",s=typeof t=="function",r=[],o=[];return function(i,c){if(typeof c=="object")if(r.length){const l=Va(r,this);l===0?r[r.length]=this:(r.splice(l),o.splice(l)),o[o.length]=i;const d=Va(r,c);if(d!==0)return s?t.call(this,i,c,Ba(o,d)):`[ref=${Ba(o,d)}]`}else r[0]=c,o[0]=i;return n?e.call(this,i,c):c}}function Iy(e,t,n,s){return JSON.stringify(e,jy((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 Ny(e){const{deserialize:t=Oy,key:n="wagmi",serialize:s=Iy,storage:r=Hl}=e;function o(a){return a instanceof Promise?a.then(i=>i).catch(()=>null):a}return{...r,key:n,async getItem(a,i){const c=r.getItem(`${n}.${a}`),l=await o(c);return l?t(l)??null:i??null},async setItem(a,i){const c=`${n}.${a}`;i===null?await o(r.removeItem(c)):await o(r.setItem(c,s(i)))},async removeItem(a){await o(r.removeItem(`${n}.${a}`))}}}const Hl={getItem:()=>null,setItem:()=>{},removeItem:()=>{}};function My(){const e=typeof window<"u"&&window.localStorage?window.localStorage:Hl;return{getItem(t){return e.getItem(t)},removeItem(t){e.removeItem(t)},setItem(t,n){try{e.setItem(t,n)}catch{}}}}const Ms=256;let Ln=Ms,Fn;function Ty(e=11){if(!Fn||Ln+e>Ms*2){Fn="",Ln=0;for(let t=0;t<Ms;t++)Fn+=(256+Math.random()*256|0).toString(16).substring(1)}return Fn.substring(Ln,Ln+++e)}function Ay(e){const{multiInjectedProviderDiscovery:t=!0,storage:n=Ny({storage:My()}),syncConnectedChain:s=!0,ssr:r=!1,...o}=e,a=typeof window<"u"&&t?my():void 0,i=Qr(()=>o.chains),c=Qr(()=>{const w=[],E=new Set;for(const S of o.connectors??[]){const P=l(S);if(w.push(P),!r&&P.rdns){const j=typeof P.rdns=="string"?[P.rdns]:P.rdns;for(const M of j)E.add(M)}}if(!r&&a){const S=a.getProviders();for(const P of S)E.has(P.info.rdns)||w.push(l(d(P)))}return w});function l(w){const E=Py(Ty()),S={...w({emitter:E,chains:i.getState(),storage:n,transports:o.transports}),emitter:E,uid:E.uid};return E.on("connect",C),S.setup?.(),S}function d(w){const{info:E}=w,S=w.provider;return Co({target:{...E,id:E.rdns,provider:S}})}const f=new Map;function h(w={}){const E=w.chainId??v.getState().chainId,S=i.getState().find(j=>j.id===E);if(w.chainId&&!S)throw new js;{const j=f.get(v.getState().chainId);if(j&&!S)return j;if(!S)throw new js}{const j=f.get(E);if(j)return j}let P;if(o.client)P=o.client({chain:S});else{const j=S.id,M=i.getState().map(k=>k.id),A={},R=Object.entries(o);for(const[k,z]of R)if(!(k==="chains"||k==="client"||k==="connectors"||k==="transports"))if(typeof z=="object")if(j in z)A[k]=z[j];else{if(M.some(B=>B in z))continue;A[k]=z}else A[k]=z;P=oy({...A,chain:S,batch:A.batch??{multicall:!0},transport:k=>o.transports[j]({...k,connectors:c})})}return f.set(E,P),P}function p(){return{chainId:i.getState()[0].id,connections:new Map,current:null,status:"disconnected"}}let m;const g="0.0.0-canary-";qn.startsWith(g)?m=Number.parseInt(qn.replace(g,""),10):m=Number.parseInt(qn.split(".")[0]??"0",10);const v=Qr(by(n?xy(p,{migrate(w,E){if(E===m)return w;const S=p(),P=x(w,S.chainId);return{...S,chainId:P}},name:"store",partialize(w){return{connections:{__type:"Map",value:Array.from(w.connections.entries()).map(([E,S])=>{const{id:P,name:j,type:M,uid:A}=S.connector;return[E,{...S,connector:{id:P,name:j,type:M,uid:A}}]})},chainId:w.chainId,current:w.current}},merge(w,E){typeof w=="object"&&w&&"status"in w&&delete w.status;const S=x(w,E.chainId);return{...E,...w,chainId:S}},skipHydration:r,storage:n,version:m}):p));v.setState(p());function x(w,E){return w&&typeof w=="object"&&"chainId"in w&&typeof w.chainId=="number"&&i.getState().some(S=>S.id===w.chainId)?w.chainId:E}s&&v.subscribe(({connections:w,current:E})=>E?w.get(E)?.chainId:void 0,w=>{if(i.getState().some(S=>S.id===w))return v.setState(S=>({...S,chainId:w??S.chainId}))}),a?.subscribe(w=>{const E=new Set,S=new Set;for(const j of c.getState())if(E.add(j.id),j.rdns){const M=typeof j.rdns=="string"?[j.rdns]:j.rdns;for(const A of M)S.add(A)}const P=[];for(const j of w){if(S.has(j.info.rdns))continue;const M=l(d(j));E.has(M.id)||P.push(M)}n&&!v.persist.hasHydrated()||c.setState(j=>[...j,...P],!0)});function y(w){v.setState(E=>{const S=E.connections.get(w.uid);return S?{...E,connections:new Map(E.connections).set(w.uid,{accounts:w.accounts??S.accounts,chainId:w.chainId??S.chainId,connector:S.connector})}:E})}function C(w){v.getState().status==="connecting"||v.getState().status==="reconnecting"||v.setState(E=>{const S=c.getState().find(P=>P.uid===w.uid);return S?(S.emitter.listenerCount("connect")&&S.emitter.off("connect",y),S.emitter.listenerCount("change")||S.emitter.on("change",y),S.emitter.listenerCount("disconnect")||S.emitter.on("disconnect",O),{...E,connections:new Map(E.connections).set(w.uid,{accounts:w.accounts,chainId:w.chainId,connector:S}),current:w.uid,status:"connected"}):E})}function O(w){v.setState(E=>{const S=E.connections.get(w.uid);if(S){const j=S.connector;j.emitter.listenerCount("change")&&S.connector.emitter.off("change",y),j.emitter.listenerCount("disconnect")&&S.connector.emitter.off("disconnect",O),j.emitter.listenerCount("connect")||S.connector.emitter.on("connect",C)}if(E.connections.delete(w.uid),E.connections.size===0)return{...E,connections:new Map,current:null,status:"disconnected"};const P=E.connections.values().next().value;return{...E,connections:new Map(E.connections),current:P.connector.uid}})}return{get chains(){return i.getState()},get connectors(){return c.getState()},storage:n,getClient:h,get state(){return v.getState()},setState(w){let E;typeof w=="function"?E=w(v.getState()):E=w;const S=p();typeof E!="object"&&(E=S),Object.keys(S).some(j=>!(j in E))&&(E=S),v.setState(E,!0)},subscribe(w,E,S){return v.subscribe(w,E,S?{...S,fireImmediately:S.emitImmediately}:void 0)},_internal:{mipd:a,async revalidate(){const w=v.getState(),E=w.connections;let S=w.current;for(const[,P]of E){const j=P.connector;j.isAuthorized&&await j.isAuthorized()||(E.delete(j.uid),S===j.uid&&(S=null))}v.setState(P=>({...P,connections:E,current:S}))},store:v,ssr:!!r,syncConnectedChain:s,transports:o.transports,chains:{setState(w){const E=typeof w=="function"?w(i.getState()):w;if(E.length!==0)return i.setState(E,!0)},subscribe(w){return i.subscribe(w)}},connectors:{providerDetailToConnector:d,setup:l,setState(w){return c.setState(typeof w=="function"?w(c.getState()):w,!0)},subscribe(w){return c.subscribe(w)}},events:{change:y,connect:C,disconnect:O}}}}function Ry(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 c of r??[])if(c.rdns){const l=Array.isArray(c.rdns)?c.rdns:[c.rdns];for(const d of l)o.add(d)}const a=[],i=e._internal.mipd?.getProviders()??[];for(const c of i){if(o.has(c.info.rdns))continue;const l=e._internal.connectors.providerDetailToConnector(c),d=e._internal.connectors.setup(l);a.push(d)}return[...r,...a]})),s?dy(e):e.storage&&e.setState(r=>({...r,connections:new Map}))}}}function Dy(e){const{children:t,config:n,initialState:s,reconnectOnMount:r=!0}=e,{onMount:o}=Ry(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 ky(e){const{children:t,config:n}=e,s={value:n};return b.createElement(Dy,e,b.createElement(_l.Provider,s,t))}const Ly="2.19.2",Fy=()=>`wagmi@${Ly}`;class $y extends wo{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 Fy()}}class zy extends $y{constructor(){super("`useConfig` must be used within `WagmiProvider`.",{docsPath:"/api/WagmiProvider"}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"WagmiProviderNotFoundError"})}}function So(e={}){const t=e.config??b.useContext(_l);if(!t)throw new zy;return t}var Cn=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},Uy={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},By=class{#e=Uy;#t=!1;setTimeoutProvider(e){this.#e=e}setTimeout(e,t){return this.#e.setTimeout(e,t)}clearTimeout(e){this.#e.clearTimeout(e)}setInterval(e,t){return this.#e.setInterval(e,t)}clearInterval(e){this.#e.clearInterval(e)}},Xe=new By;function Vy(e){setTimeout(e,0)}var ct=typeof window>"u"||"Deno"in globalThis;function me(){}function Hy(e,t){return typeof e=="function"?e(t):e}function Ts(e){return typeof e=="number"&&e>=0&&e!==1/0}function Wl(e,t){return Math.max(e+(t||0)-Date.now(),0)}function We(e,t){return typeof e=="function"?e(t):e}function we(e,t){return typeof e=="function"?e(t):e}function Ha(e,t){const{type:n="all",exact:s,fetchStatus:r,predicate:o,queryKey:a,stale:i}=e;if(a){if(s){if(t.queryHash!==Eo(a,t.options))return!1}else if(!fn(t.queryKey,a))return!1}if(n!=="all"){const c=t.isActive();if(n==="active"&&!c||n==="inactive"&&c)return!1}return!(typeof i=="boolean"&&t.isStale()!==i||r&&r!==t.state.fetchStatus||o&&!o(t))}function _a(e,t){const{exact:n,status:s,predicate:r,mutationKey:o}=e;if(o){if(!t.options.mutationKey)return!1;if(n){if(dn(t.options.mutationKey)!==dn(o))return!1}else if(!fn(t.options.mutationKey,o))return!1}return!(s&&t.state.status!==s||r&&!r(t))}function Eo(e,t){return(t?.queryKeyHashFn||dn)(e)}function dn(e){return JSON.stringify(e,(t,n)=>Rs(n)?Object.keys(n).sort().reduce((s,r)=>(s[r]=n[r],s),{}):n)}function fn(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?Object.keys(t).every(n=>fn(e[n],t[n])):!1}var _y=Object.prototype.hasOwnProperty;function Gl(e,t){if(e===t)return e;const n=Wa(e)&&Wa(t);if(!n&&!(Rs(e)&&Rs(t)))return t;const r=(n?e:Object.keys(e)).length,o=n?t:Object.keys(t),a=o.length,i=n?new Array(a):{};let c=0;for(let l=0;l<a;l++){const d=n?l:o[l],f=e[d],h=t[d];if(f===h){i[d]=f,(n?l<r:_y.call(e,d))&&c++;continue}if(f===null||h===null||typeof f!="object"||typeof h!="object"){i[d]=h;continue}const p=Gl(f,h);i[d]=p,p===f&&c++}return r===a&&c===r?e:i}function As(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(const n in e)if(e[n]!==t[n])return!1;return!0}function Wa(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function Rs(e){if(!Ga(e))return!1;const t=e.constructor;if(t===void 0)return!0;const n=t.prototype;return!(!Ga(n)||!n.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function Ga(e){return Object.prototype.toString.call(e)==="[object Object]"}function Wy(e){return new Promise(t=>{Xe.setTimeout(t,e)})}function Ds(e,t,n){return typeof n.structuralSharing=="function"?n.structuralSharing(e,t):n.structuralSharing!==!1?Gl(e,t):t}function Gy(e,t,n=0){const s=[...e,t];return n&&s.length>n?s.slice(1):s}function qy(e,t,n=0){const s=[t,...e];return n&&s.length>n?s.slice(0,-1):s}var Po=Symbol();function ql(e,t){return!e.queryFn&&t?.initialPromise?()=>t.initialPromise:!e.queryFn||e.queryFn===Po?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function Yy(e,t){return typeof e=="function"?e(...t):!!e}var Qy=class extends Cn{#e;#t;#n;constructor(){super(),this.#n=e=>{if(!ct&&window.addEventListener){const t=()=>e();return window.addEventListener("visibilitychange",t,!1),()=>{window.removeEventListener("visibilitychange",t)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(t=>{typeof t=="boolean"?this.setFocused(t):this.onFocus()})}setFocused(e){this.#e!==e&&(this.#e=e,this.onFocus())}onFocus(){const e=this.isFocused();this.listeners.forEach(t=>{t(e)})}isFocused(){return typeof this.#e=="boolean"?this.#e:globalThis.document?.visibilityState!=="hidden"}},Oo=new Qy;function ks(){let e,t;const n=new Promise((r,o)=>{e=r,t=o});n.status="pending",n.catch(()=>{});function s(r){Object.assign(n,r),delete n.resolve,delete n.reject}return n.resolve=r=>{s({status:"fulfilled",value:r}),e(r)},n.reject=r=>{s({status:"rejected",reason:r}),t(r)},n}var Ky=Vy;function Jy(){let e=[],t=0,n=i=>{i()},s=i=>{i()},r=Ky;const o=i=>{t?e.push(i):r(()=>{n(i)})},a=()=>{const i=e;e=[],i.length&&r(()=>{s(()=>{i.forEach(c=>{n(c)})})})};return{batch:i=>{let c;t++;try{c=i()}finally{t--,t||a()}return c},batchCalls:i=>(...c)=>{o(()=>{i(...c)})},schedule:o,setNotifyFunction:i=>{n=i},setBatchNotifyFunction:i=>{s=i},setScheduler:i=>{r=i}}}var ue=Jy(),Xy=class extends Cn{#e=!0;#t;#n;constructor(){super(),this.#n=e=>{if(!ct&&window.addEventListener){const t=()=>e(!0),n=()=>e(!1);return window.addEventListener("online",t,!1),window.addEventListener("offline",n,!1),()=>{window.removeEventListener("online",t),window.removeEventListener("offline",n)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(this.setOnline.bind(this))}setOnline(e){this.#e!==e&&(this.#e=e,this.listeners.forEach(n=>{n(e)}))}isOnline(){return this.#e}},ur=new Xy;function Zy(e){return Math.min(1e3*2**e,3e4)}function Yl(e){return(e??"online")==="online"?ur.isOnline():!0}var Ls=class extends Error{constructor(e){super("CancelledError"),this.revert=e?.revert,this.silent=e?.silent}};function Ql(e){let t=!1,n=0,s;const r=ks(),o=()=>r.status!=="pending",a=g=>{if(!o()){const v=new Ls(g);h(v),e.onCancel?.(v)}},i=()=>{t=!0},c=()=>{t=!1},l=()=>Oo.isFocused()&&(e.networkMode==="always"||ur.isOnline())&&e.canRun(),d=()=>Yl(e.networkMode)&&e.canRun(),f=g=>{o()||(s?.(),r.resolve(g))},h=g=>{o()||(s?.(),r.reject(g))},p=()=>new Promise(g=>{s=v=>{(o()||l())&&g(v)},e.onPause?.()}).then(()=>{s=void 0,o()||e.onContinue?.()}),m=()=>{if(o())return;let g;const v=n===0?e.initialPromise:void 0;try{g=v??e.fn()}catch(x){g=Promise.reject(x)}Promise.resolve(g).then(f).catch(x=>{if(o())return;const y=e.retry??(ct?0:3),C=e.retryDelay??Zy,O=typeof C=="function"?C(n,x):C,w=y===!0||typeof y=="number"&&n<y||typeof y=="function"&&y(n,x);if(t||!w){h(x);return}n++,e.onFail?.(n,x),Wy(O).then(()=>l()?void 0:p()).then(()=>{t?h(x):m()})})};return{promise:r,status:()=>r.status,cancel:a,continue:()=>(s?.(),r),cancelRetry:i,continueRetry:c,canStart:d,start:()=>(d()?m():p().then(m),r)}}var Kl=class{#e;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),Ts(this.gcTime)&&(this.#e=Xe.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(ct?1/0:300*1e3))}clearGcTimeout(){this.#e&&(Xe.clearTimeout(this.#e),this.#e=void 0)}},ex=class extends Kl{#e;#t;#n;#s;#r;#i;#a;constructor(e){super(),this.#a=!1,this.#i=e.defaultOptions,this.setOptions(e.options),this.observers=[],this.#s=e.client,this.#n=this.#s.getQueryCache(),this.queryKey=e.queryKey,this.queryHash=e.queryHash,this.#e=Ya(this.options),this.state=e.state??this.#e,this.scheduleGc()}get meta(){return this.options.meta}get promise(){return this.#r?.promise}setOptions(e){if(this.options={...this.#i,...e},this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const t=Ya(this.options);t.data!==void 0&&(this.setState(qa(t.data,t.dataUpdatedAt)),this.#e=t)}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&this.#n.remove(this)}setData(e,t){const n=Ds(this.state.data,e,this.options);return this.#o({data:n,type:"success",dataUpdatedAt:t?.updatedAt,manual:t?.manual}),n}setState(e,t){this.#o({type:"setState",state:e,setStateOptions:t})}cancel(e){const t=this.#r?.promise;return this.#r?.cancel(e),t?t.then(me).catch(me):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(this.#e)}isActive(){return this.observers.some(e=>we(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===Po||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStatic(){return this.getObserversCount()>0?this.observers.some(e=>We(e.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(e=>e.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(e=0){return this.state.data===void 0?!0:e==="static"?!1:this.state.isInvalidated?!0:!Wl(this.state.dataUpdatedAt,e)}onFocus(){this.observers.find(t=>t.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:!1}),this.#r?.continue()}onOnline(){this.observers.find(t=>t.shouldFetchOnReconnect())?.refetch({cancelRefetch:!1}),this.#r?.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),this.#n.notify({type:"observerAdded",query:this,observer:e}))}removeObserver(e){this.observers.includes(e)&&(this.observers=this.observers.filter(t=>t!==e),this.observers.length||(this.#r&&(this.#a?this.#r.cancel({revert:!0}):this.#r.cancelRetry()),this.scheduleGc()),this.#n.notify({type:"observerRemoved",query:this,observer:e}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||this.#o({type:"invalidate"})}async fetch(e,t){if(this.state.fetchStatus!=="idle"&&this.#r?.status()!=="rejected"){if(this.state.data!==void 0&&t?.cancelRefetch)this.cancel({silent:!0});else if(this.#r)return this.#r.continueRetry(),this.#r.promise}if(e&&this.setOptions(e),!this.options.queryFn){const i=this.observers.find(c=>c.options.queryFn);i&&this.setOptions(i.options)}const n=new AbortController,s=i=>{Object.defineProperty(i,"signal",{enumerable:!0,get:()=>(this.#a=!0,n.signal)})},r=()=>{const i=ql(this.options,t),l=(()=>{const d={client:this.#s,queryKey:this.queryKey,meta:this.meta};return s(d),d})();return this.#a=!1,this.options.persister?this.options.persister(i,l,this):i(l)},a=(()=>{const i={fetchOptions:t,options:this.options,queryKey:this.queryKey,client:this.#s,state:this.state,fetchFn:r};return s(i),i})();this.options.behavior?.onFetch(a,this),this.#t=this.state,(this.state.fetchStatus==="idle"||this.state.fetchMeta!==a.fetchOptions?.meta)&&this.#o({type:"fetch",meta:a.fetchOptions?.meta}),this.#r=Ql({initialPromise:t?.initialPromise,fn:a.fetchFn,onCancel:i=>{i instanceof Ls&&i.revert&&this.setState({...this.#t,fetchStatus:"idle"}),n.abort()},onFail:(i,c)=>{this.#o({type:"failed",failureCount:i,error:c})},onPause:()=>{this.#o({type:"pause"})},onContinue:()=>{this.#o({type:"continue"})},retry:a.options.retry,retryDelay:a.options.retryDelay,networkMode:a.options.networkMode,canRun:()=>!0});try{const i=await this.#r.start();if(i===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(i),this.#n.config.onSuccess?.(i,this),this.#n.config.onSettled?.(i,this.state.error,this),i}catch(i){if(i instanceof Ls){if(i.silent)return this.#r.promise;if(i.revert){if(this.state.data===void 0)throw i;return this.state.data}}throw this.#o({type:"error",error:i}),this.#n.config.onError?.(i,this),this.#n.config.onSettled?.(this.state.data,i,this),i}finally{this.scheduleGc()}}#o(e){const t=n=>{switch(e.type){case"failed":return{...n,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case"pause":return{...n,fetchStatus:"paused"};case"continue":return{...n,fetchStatus:"fetching"};case"fetch":return{...n,...Jl(n.data,this.options),fetchMeta:e.meta??null};case"success":const s={...n,...qa(e.data,e.dataUpdatedAt),dataUpdateCount:n.dataUpdateCount+1,...!e.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return this.#t=e.manual?s:void 0,s;case"error":const r=e.error;return{...n,error:r,errorUpdateCount:n.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:n.fetchFailureCount+1,fetchFailureReason:r,fetchStatus:"idle",status:"error"};case"invalidate":return{...n,isInvalidated:!0};case"setState":return{...n,...e.state}}};this.state=t(this.state),ue.batch(()=>{this.observers.forEach(n=>{n.onQueryUpdate()}),this.#n.notify({query:this,type:"updated",action:e})})}};function Jl(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:Yl(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function qa(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:"success"}}function Ya(e){const t=typeof e.initialData=="function"?e.initialData():e.initialData,n=t!==void 0,s=n?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?s??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?"success":"pending",fetchStatus:"idle"}}var tx=class extends Cn{constructor(e,t){super(),this.options=t,this.#e=e,this.#o=null,this.#a=ks(),this.bindMethods(),this.setOptions(t)}#e;#t=void 0;#n=void 0;#s=void 0;#r;#i;#a;#o;#m;#f;#h;#l;#u;#c;#p=new Set;bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(this.#t.addObserver(this),Qa(this.#t,this.options)?this.#d():this.updateResult(),this.#y())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return Fs(this.#t,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return Fs(this.#t,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#x(),this.#w(),this.#t.removeObserver(this)}setOptions(e){const t=this.options,n=this.#t;if(this.options=this.#e.defaultQueryOptions(e),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof we(this.options.enabled,this.#t)!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");this.#C(),this.#t.setOptions(this.options),t._defaulted&&!As(this.options,t)&&this.#e.getQueryCache().notify({type:"observerOptionsUpdated",query:this.#t,observer:this});const s=this.hasListeners();s&&Ka(this.#t,n,this.options,t)&&this.#d(),this.updateResult(),s&&(this.#t!==n||we(this.options.enabled,this.#t)!==we(t.enabled,this.#t)||We(this.options.staleTime,this.#t)!==We(t.staleTime,this.#t))&&this.#g();const r=this.#b();s&&(this.#t!==n||we(this.options.enabled,this.#t)!==we(t.enabled,this.#t)||r!==this.#c)&&this.#v(r)}getOptimisticResult(e){const t=this.#e.getQueryCache().build(this.#e,e),n=this.createResult(t,e);return rx(this,n)&&(this.#s=n,this.#i=this.options,this.#r=this.#t.state),n}getCurrentResult(){return this.#s}trackResult(e,t){return new Proxy(e,{get:(n,s)=>(this.trackProp(s),t?.(s),s==="promise"&&(this.trackProp("data"),!this.options.experimental_prefetchInRender&&this.#a.status==="pending"&&this.#a.reject(new Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(n,s))})}trackProp(e){this.#p.add(e)}getCurrentQuery(){return this.#t}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){const t=this.#e.defaultQueryOptions(e),n=this.#e.getQueryCache().build(this.#e,t);return n.fetch().then(()=>this.createResult(n,t))}fetch(e){return this.#d({...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#s))}#d(e){this.#C();let t=this.#t.fetch(this.options,e);return e?.throwOnError||(t=t.catch(me)),t}#g(){this.#x();const e=We(this.options.staleTime,this.#t);if(ct||this.#s.isStale||!Ts(e))return;const n=Wl(this.#s.dataUpdatedAt,e)+1;this.#l=Xe.setTimeout(()=>{this.#s.isStale||this.updateResult()},n)}#b(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(this.#t):this.options.refetchInterval)??!1}#v(e){this.#w(),this.#c=e,!(ct||we(this.options.enabled,this.#t)===!1||!Ts(this.#c)||this.#c===0)&&(this.#u=Xe.setInterval(()=>{(this.options.refetchIntervalInBackground||Oo.isFocused())&&this.#d()},this.#c))}#y(){this.#g(),this.#v(this.#b())}#x(){this.#l&&(Xe.clearTimeout(this.#l),this.#l=void 0)}#w(){this.#u&&(Xe.clearInterval(this.#u),this.#u=void 0)}createResult(e,t){const n=this.#t,s=this.options,r=this.#s,o=this.#r,a=this.#i,c=e!==n?e.state:this.#n,{state:l}=e;let d={...l},f=!1,h;if(t._optimisticResults){const P=this.hasListeners(),j=!P&&Qa(e,t),M=P&&Ka(e,n,t,s);(j||M)&&(d={...d,...Jl(l.data,e.options)}),t._optimisticResults==="isRestoring"&&(d.fetchStatus="idle")}let{error:p,errorUpdatedAt:m,status:g}=d;h=d.data;let v=!1;if(t.placeholderData!==void 0&&h===void 0&&g==="pending"){let P;r?.isPlaceholderData&&t.placeholderData===a?.placeholderData?(P=r.data,v=!0):P=typeof t.placeholderData=="function"?t.placeholderData(this.#h?.state.data,this.#h):t.placeholderData,P!==void 0&&(g="success",h=Ds(r?.data,P,t),f=!0)}if(t.select&&h!==void 0&&!v)if(r&&h===o?.data&&t.select===this.#m)h=this.#f;else try{this.#m=t.select,h=t.select(h),h=Ds(r?.data,h,t),this.#f=h,this.#o=null}catch(P){this.#o=P}this.#o&&(p=this.#o,h=this.#f,m=Date.now(),g="error");const x=d.fetchStatus==="fetching",y=g==="pending",C=g==="error",O=y&&x,w=h!==void 0,S={status:g,fetchStatus:d.fetchStatus,isPending:y,isSuccess:g==="success",isError:C,isInitialLoading:O,isLoading:O,data:h,dataUpdatedAt:d.dataUpdatedAt,error:p,errorUpdatedAt:m,failureCount:d.fetchFailureCount,failureReason:d.fetchFailureReason,errorUpdateCount:d.errorUpdateCount,isFetched:d.dataUpdateCount>0||d.errorUpdateCount>0,isFetchedAfterMount:d.dataUpdateCount>c.dataUpdateCount||d.errorUpdateCount>c.errorUpdateCount,isFetching:x,isRefetching:x&&!y,isLoadingError:C&&!w,isPaused:d.fetchStatus==="paused",isPlaceholderData:f,isRefetchError:C&&w,isStale:jo(e,t),refetch:this.refetch,promise:this.#a,isEnabled:we(t.enabled,e)!==!1};if(this.options.experimental_prefetchInRender){const P=A=>{S.status==="error"?A.reject(S.error):S.data!==void 0&&A.resolve(S.data)},j=()=>{const A=this.#a=S.promise=ks();P(A)},M=this.#a;switch(M.status){case"pending":e.queryHash===n.queryHash&&P(M);break;case"fulfilled":(S.status==="error"||S.data!==M.value)&&j();break;case"rejected":(S.status!=="error"||S.error!==M.reason)&&j();break}}return S}updateResult(){const e=this.#s,t=this.createResult(this.#t,this.options);if(this.#r=this.#t.state,this.#i=this.options,this.#r.data!==void 0&&(this.#h=this.#t),As(t,e))return;this.#s=t;const n=()=>{if(!e)return!0;const{notifyOnChangeProps:s}=this.options,r=typeof s=="function"?s():s;if(r==="all"||!r&&!this.#p.size)return!0;const o=new Set(r??this.#p);return this.options.throwOnError&&o.add("error"),Object.keys(this.#s).some(a=>{const i=a;return this.#s[i]!==e[i]&&o.has(i)})};this.#S({listeners:n()})}#C(){const e=this.#e.getQueryCache().build(this.#e,this.options);if(e===this.#t)return;const t=this.#t;this.#t=e,this.#n=e.state,this.hasListeners()&&(t?.removeObserver(this),e.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#y()}#S(e){ue.batch(()=>{e.listeners&&this.listeners.forEach(t=>{t(this.#s)}),this.#e.getQueryCache().notify({query:this.#t,type:"observerResultsUpdated"})})}};function nx(e,t){return we(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&t.retryOnMount===!1)}function Qa(e,t){return nx(e,t)||e.state.data!==void 0&&Fs(e,t,t.refetchOnMount)}function Fs(e,t,n){if(we(t.enabled,e)!==!1&&We(t.staleTime,e)!=="static"){const s=typeof n=="function"?n(e):n;return s==="always"||s!==!1&&jo(e,t)}return!1}function Ka(e,t,n,s){return(e!==t||we(s.enabled,e)===!1)&&(!n.suspense||e.state.status!=="error")&&jo(e,n)}function jo(e,t){return we(t.enabled,e)!==!1&&e.isStaleByTime(We(t.staleTime,e))}function rx(e,t){return!As(e.getCurrentResult(),t)}function Ja(e){return{onFetch:(t,n)=>{const s=t.options,r=t.fetchOptions?.meta?.fetchMore?.direction,o=t.state.data?.pages||[],a=t.state.data?.pageParams||[];let i={pages:[],pageParams:[]},c=0;const l=async()=>{let d=!1;const f=m=>{Object.defineProperty(m,"signal",{enumerable:!0,get:()=>(t.signal.aborted?d=!0:t.signal.addEventListener("abort",()=>{d=!0}),t.signal)})},h=ql(t.options,t.fetchOptions),p=async(m,g,v)=>{if(d)return Promise.reject();if(g==null&&m.pages.length)return Promise.resolve(m);const y=(()=>{const E={client:t.client,queryKey:t.queryKey,pageParam:g,direction:v?"backward":"forward",meta:t.options.meta};return f(E),E})(),C=await h(y),{maxPages:O}=t.options,w=v?qy:Gy;return{pages:w(m.pages,C,O),pageParams:w(m.pageParams,g,O)}};if(r&&o.length){const m=r==="backward",g=m?sx:Xa,v={pages:o,pageParams:a},x=g(s,v);i=await p(v,x,m)}else{const m=e??o.length;do{const g=c===0?a[0]??s.initialPageParam:Xa(s,i);if(c>0&&g==null)break;i=await p(i,g),c++}while(c<m)}return i};t.options.persister?t.fetchFn=()=>t.options.persister?.(l,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n):t.fetchFn=l}}}function Xa(e,{pages:t,pageParams:n}){const s=t.length-1;return t.length>0?e.getNextPageParam(t[s],t,n[s],n):void 0}function sx(e,{pages:t,pageParams:n}){return t.length>0?e.getPreviousPageParam?.(t[0],t,n[0],n):void 0}var ox=class extends Kl{#e;#t;#n;#s;constructor(e){super(),this.#e=e.client,this.mutationId=e.mutationId,this.#n=e.mutationCache,this.#t=[],this.state=e.state||ax(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){this.#t.includes(e)||(this.#t.push(e),this.clearGcTimeout(),this.#n.notify({type:"observerAdded",mutation:this,observer:e}))}removeObserver(e){this.#t=this.#t.filter(t=>t!==e),this.scheduleGc(),this.#n.notify({type:"observerRemoved",mutation:this,observer:e})}optionalRemove(){this.#t.length||(this.state.status==="pending"?this.scheduleGc():this.#n.remove(this))}continue(){return this.#s?.continue()??this.execute(this.state.variables)}async execute(e){const t=()=>{this.#r({type:"continue"})},n={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};this.#s=Ql({fn:()=>this.options.mutationFn?this.options.mutationFn(e,n):Promise.reject(new Error("No mutationFn found")),onFail:(o,a)=>{this.#r({type:"failed",failureCount:o,error:a})},onPause:()=>{this.#r({type:"pause"})},onContinue:t,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#n.canRun(this)});const s=this.state.status==="pending",r=!this.#s.canStart();try{if(s)t();else{this.#r({type:"pending",variables:e,isPaused:r}),await this.#n.config.onMutate?.(e,this,n);const a=await this.options.onMutate?.(e,n);a!==this.state.context&&this.#r({type:"pending",context:a,variables:e,isPaused:r})}const o=await this.#s.start();return await this.#n.config.onSuccess?.(o,e,this.state.context,this,n),await this.options.onSuccess?.(o,e,this.state.context,n),await this.#n.config.onSettled?.(o,null,this.state.variables,this.state.context,this,n),await this.options.onSettled?.(o,null,e,this.state.context,n),this.#r({type:"success",data:o}),o}catch(o){try{throw await this.#n.config.onError?.(o,e,this.state.context,this,n),await this.options.onError?.(o,e,this.state.context,n),await this.#n.config.onSettled?.(void 0,o,this.state.variables,this.state.context,this,n),await this.options.onSettled?.(void 0,o,e,this.state.context,n),o}finally{this.#r({type:"error",error:o})}}finally{this.#n.runNext(this)}}#r(e){const t=n=>{switch(e.type){case"failed":return{...n,failureCount:e.failureCount,failureReason:e.error};case"pause":return{...n,isPaused:!0};case"continue":return{...n,isPaused:!1};case"pending":return{...n,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:"pending",variables:e.variables,submittedAt:Date.now()};case"success":return{...n,data:e.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...n,data:void 0,error:e.error,failureCount:n.failureCount+1,failureReason:e.error,isPaused:!1,status:"error"}}};this.state=t(this.state),ue.batch(()=>{this.#t.forEach(n=>{n.onMutationUpdate(e)}),this.#n.notify({mutation:this,type:"updated",action:e})})}};function ax(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var ix=class extends Cn{constructor(e={}){super(),this.config=e,this.#e=new Set,this.#t=new Map,this.#n=0}#e;#t;#n;build(e,t,n){const s=new ox({client:e,mutationCache:this,mutationId:++this.#n,options:e.defaultMutationOptions(t),state:n});return this.add(s),s}add(e){this.#e.add(e);const t=$n(e);if(typeof t=="string"){const n=this.#t.get(t);n?n.push(e):this.#t.set(t,[e])}this.notify({type:"added",mutation:e})}remove(e){if(this.#e.delete(e)){const t=$n(e);if(typeof t=="string"){const n=this.#t.get(t);if(n)if(n.length>1){const s=n.indexOf(e);s!==-1&&n.splice(s,1)}else n[0]===e&&this.#t.delete(t)}}this.notify({type:"removed",mutation:e})}canRun(e){const t=$n(e);if(typeof t=="string"){const s=this.#t.get(t)?.find(r=>r.state.status==="pending");return!s||s===e}else return!0}runNext(e){const t=$n(e);return typeof t=="string"?this.#t.get(t)?.find(s=>s!==e&&s.state.isPaused)?.continue()??Promise.resolve():Promise.resolve()}clear(){ue.batch(()=>{this.#e.forEach(e=>{this.notify({type:"removed",mutation:e})}),this.#e.clear(),this.#t.clear()})}getAll(){return Array.from(this.#e)}find(e){const t={exact:!0,...e};return this.getAll().find(n=>_a(t,n))}findAll(e={}){return this.getAll().filter(t=>_a(e,t))}notify(e){ue.batch(()=>{this.listeners.forEach(t=>{t(e)})})}resumePausedMutations(){const e=this.getAll().filter(t=>t.state.isPaused);return ue.batch(()=>Promise.all(e.map(t=>t.continue().catch(me))))}};function $n(e){return e.options.scope?.id}var cx=class extends Cn{constructor(e={}){super(),this.config=e,this.#e=new Map}#e;build(e,t,n){const s=t.queryKey,r=t.queryHash??Eo(s,t);let o=this.get(r);return o||(o=new ex({client:e,queryKey:s,queryHash:r,options:e.defaultQueryOptions(t),state:n,defaultOptions:e.getQueryDefaults(s)}),this.add(o)),o}add(e){this.#e.has(e.queryHash)||(this.#e.set(e.queryHash,e),this.notify({type:"added",query:e}))}remove(e){const t=this.#e.get(e.queryHash);t&&(e.destroy(),t===e&&this.#e.delete(e.queryHash),this.notify({type:"removed",query:e}))}clear(){ue.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return this.#e.get(e)}getAll(){return[...this.#e.values()]}find(e){const t={exact:!0,...e};return this.getAll().find(n=>Ha(t,n))}findAll(e={}){const t=this.getAll();return Object.keys(e).length>0?t.filter(n=>Ha(e,n)):t}notify(e){ue.batch(()=>{this.listeners.forEach(t=>{t(e)})})}onFocus(){ue.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){ue.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},lx=class{#e;#t;#n;#s;#r;#i;#a;#o;constructor(e={}){this.#e=e.queryCache||new cx,this.#t=e.mutationCache||new ix,this.#n=e.defaultOptions||{},this.#s=new Map,this.#r=new Map,this.#i=0}mount(){this.#i++,this.#i===1&&(this.#a=Oo.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onFocus())}),this.#o=ur.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onOnline())}))}unmount(){this.#i--,this.#i===0&&(this.#a?.(),this.#a=void 0,this.#o?.(),this.#o=void 0)}isFetching(e){return this.#e.findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return this.#t.findAll({...e,status:"pending"}).length}getQueryData(e){const t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state.data}ensureQueryData(e){const t=this.defaultQueryOptions(e),n=this.#e.build(this,t),s=n.state.data;return s===void 0?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime(We(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(s))}getQueriesData(e){return this.#e.findAll(e).map(({queryKey:t,state:n})=>{const s=n.data;return[t,s]})}setQueryData(e,t,n){const s=this.defaultQueryOptions({queryKey:e}),o=this.#e.get(s.queryHash)?.state.data,a=Hy(t,o);if(a!==void 0)return this.#e.build(this,s).setData(a,{...n,manual:!0})}setQueriesData(e,t,n){return ue.batch(()=>this.#e.findAll(e).map(({queryKey:s})=>[s,this.setQueryData(s,t,n)]))}getQueryState(e){const t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state}removeQueries(e){const t=this.#e;ue.batch(()=>{t.findAll(e).forEach(n=>{t.remove(n)})})}resetQueries(e,t){const n=this.#e;return ue.batch(()=>(n.findAll(e).forEach(s=>{s.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){const n={revert:!0,...t},s=ue.batch(()=>this.#e.findAll(e).map(r=>r.cancel(n)));return Promise.all(s).then(me).catch(me)}invalidateQueries(e,t={}){return ue.batch(()=>(this.#e.findAll(e).forEach(n=>{n.invalidate()}),e?.refetchType==="none"?Promise.resolve():this.refetchQueries({...e,type:e?.refetchType??e?.type??"active"},t)))}refetchQueries(e,t={}){const n={...t,cancelRefetch:t.cancelRefetch??!0},s=ue.batch(()=>this.#e.findAll(e).filter(r=>!r.isDisabled()&&!r.isStatic()).map(r=>{let o=r.fetch(void 0,n);return n.throwOnError||(o=o.catch(me)),r.state.fetchStatus==="paused"?Promise.resolve():o}));return Promise.all(s).then(me)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const n=this.#e.build(this,t);return n.isStaleByTime(We(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(me).catch(me)}fetchInfiniteQuery(e){return e.behavior=Ja(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(me).catch(me)}ensureInfiniteQueryData(e){return e.behavior=Ja(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return ur.isOnline()?this.#t.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#e}getMutationCache(){return this.#t}getDefaultOptions(){return this.#n}setDefaultOptions(e){this.#n=e}setQueryDefaults(e,t){this.#s.set(dn(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...this.#s.values()],n={};return t.forEach(s=>{fn(e,s.queryKey)&&Object.assign(n,s.defaultOptions)}),n}setMutationDefaults(e,t){this.#r.set(dn(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...this.#r.values()],n={};return t.forEach(s=>{fn(e,s.mutationKey)&&Object.assign(n,s.defaultOptions)}),n}defaultQueryOptions(e){if(e._defaulted)return e;const t={...this.#n.queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=Eo(t.queryKey,t)),t.refetchOnReconnect===void 0&&(t.refetchOnReconnect=t.networkMode!=="always"),t.throwOnError===void 0&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode="offlineFirst"),t.queryFn===Po&&(t.enabled=!1),t}defaultMutationOptions(e){return e?._defaulted?e:{...this.#n.mutations,...e?.mutationKey&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){this.#e.clear(),this.#t.clear()}};function ux(e){return JSON.stringify(e,(t,n)=>dx(n)?Object.keys(n).sort().reduce((s,r)=>(s[r]=n[r],s),{}):typeof n=="bigint"?n.toString():n)}function dx(e){if(!Za(e))return!1;const t=e.constructor;if(typeof t>"u")return!0;const n=t.prototype;return!(!Za(n)||!n.hasOwnProperty("isPrototypeOf"))}function Za(e){return Object.prototype.toString.call(e)==="[object Object]"}function Xl(e){const{_defaulted:t,behavior:n,gcTime:s,initialData:r,initialDataUpdatedAt:o,maxPages:a,meta:i,networkMode:c,queryFn:l,queryHash:d,queryKey:f,queryKeyHashFn:h,retry:p,retryDelay:m,structuralSharing:g,getPreviousPageParam:v,getNextPageParam:x,initialPageParam:y,_optimisticResults:C,enabled:O,notifyOnChangeProps:w,placeholderData:E,refetchInterval:S,refetchIntervalInBackground:P,refetchOnMount:j,refetchOnReconnect:M,refetchOnWindowFocus:A,retryOnMount:R,select:k,staleTime:z,suspense:$,throwOnError:B,config:G,connector:q,query:ee,...ne}=e;return ne}function fx(e,t={}){return{async queryFn({queryKey:n}){const{name:s,scopeKey:r,...o}=n[1];if(!s)throw new Error("name is required");return ly(e,{...o,name:s})},queryKey:hx(t)}}function hx(e={}){return["ensAvatar",Xl(e)]}function px(e,t={}){return{async queryFn({queryKey:n}){const{address:s,scopeKey:r,...o}=n[1];if(!s)throw new Error("address is required");return uy(e,{...o,address:s})},queryKey:mx(t)}}function mx(e={}){return["ensName",Xl(e)]}var Zl=b.createContext(void 0),gx=e=>{const t=b.useContext(Zl);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},bx=({client:e,children:t})=>(b.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),u.jsx(Zl.Provider,{value:e,children:t})),eu=b.createContext(!1),vx=()=>b.useContext(eu);eu.Provider;function yx(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var xx=b.createContext(yx()),wx=()=>b.useContext(xx),Cx=(e,t)=>{(e.suspense||e.throwOnError||e.experimental_prefetchInRender)&&(t.isReset()||(e.retryOnMount=!1))},Sx=e=>{b.useEffect(()=>{e.clearReset()},[e])},Ex=({result:e,errorResetBoundary:t,throwOnError:n,query:s,suspense:r})=>e.isError&&!t.isReset()&&!e.isFetching&&s&&(r&&e.data===void 0||Yy(n,[e.error,s])),Px=e=>{if(e.suspense){const n=r=>r==="static"?r:Math.max(r??1e3,1e3),s=e.staleTime;e.staleTime=typeof s=="function"?(...r)=>n(s(...r)):n(s),typeof e.gcTime=="number"&&(e.gcTime=Math.max(e.gcTime,1e3))}},Ox=(e,t)=>e.isLoading&&e.isFetching&&!t,jx=(e,t)=>e?.suspense&&t.isPending,ei=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function Ix(e,t,n){const s=vx(),r=wx(),o=gx(),a=o.defaultQueryOptions(e);o.getDefaultOptions().queries?._experimental_beforeQuery?.(a),a._optimisticResults=s?"isRestoring":"optimistic",Px(a),Cx(a,r),Sx(r);const i=!o.getQueryCache().get(a.queryHash),[c]=b.useState(()=>new t(o,a)),l=c.getOptimisticResult(a),d=!s&&e.subscribed!==!1;if(b.useSyncExternalStore(b.useCallback(f=>{const h=d?c.subscribe(ue.batchCalls(f)):me;return c.updateResult(),h},[c,d]),()=>c.getCurrentResult(),()=>c.getCurrentResult()),b.useEffect(()=>{c.setOptions(a)},[a,c]),jx(a,l))throw ei(a,c,r);if(Ex({result:l,errorResetBoundary:r,throwOnError:a.throwOnError,query:o.getQueryCache().get(a.queryHash),suspense:a.suspense}))throw l.error;return o.getDefaultOptions().queries?._experimental_afterQuery?.(a,l),a.experimental_prefetchInRender&&!ct&&Ox(l,s)&&(i?ei(a,c,r):o.getQueryCache().get(a.queryHash)?.promise)?.catch(me).finally(()=>{c.updateResult()}),a.notifyOnChangeProps?l:c.trackResult(l)}function Nx(e,t){return Ix(e,tx)}function tu(e){const t=Nx({...e,queryKeyHashFn:ux});return t.queryKey=e.queryKey,t}function nu(e={}){const t=So(e);return b.useSyncExternalStore(n=>fy(t,{onChange:n}),()=>$a(t),()=>$a(t))}function Mx(e={}){const{name:t,query:n={}}=e,s=So(e),r=nu({config:s}),o=fx(s,{...e,chainId:e.chainId??r}),a=!!(t&&(n.enabled??!0));return tu({...n,...o,enabled:a})}function ru(e={}){const{address:t,query:n={}}=e,s=So(e),r=nu({config:s}),o=px(s,{...e,chainId:e.chainId??r}),a=!!(t&&(n.enabled??!0));return tu({...n,...o,enabled:a})}function su(e){const{address:t,chainId:n=1,size:s="14px"}=e,r={width:s,height:s},o=ru({address:t,chainId:n}),a=o.data??void 0,i=Mx({name:a}),c=i.data??Bg;return o.isLoading||i.isLoading?u.jsx("div",{className:"fade-out flex-none animate-pulse rounded-full bg-gray-400",style:r}):u.jsx("img",{alt:"ENS Avatar",className:"flex-none rounded-full object-contain",src:c,style:r})}const ou=["RENAME","DELETE","DUPLICATE"],Tx=[{value:"LOCAL",icon:u.jsx(I,{name:"Lock"}),description:"Only available to you"},{value:"CLOUD",icon:u.jsx(I,{name:"People"}),description:"Only available to people in this drive"},{value:"PUBLIC",icon:u.jsx(I,{name:"Globe"}),description:"Available to everyone",disabled:!0}],Ax={CLOUD:{title:"Secure cloud",description:"End to end encryption between members.",icon:u.jsx(I,{name:"Lock"})},LOCAL:{title:"Local",description:"Private and only available to you.",icon:u.jsx(I,{name:"Hdd"})},SWITCHBOARD:{title:"Switchboard",description:"Public and available to everyone.",icon:u.jsx(I,{name:"Drive"})}},Rx={ADD_TRIGGER:{label:"Add Trigger",icon:u.jsx(I,{className:"text-orange-900",name:"Plus"})},REMOVE_TRIGGER:{label:"Remove Trigger",icon:u.jsx(I,{className:"text-orange-900",name:"Xmark"})},ADD_INVALID_TRIGGER:{label:"Add Trigger",icon:u.jsx(I,{className:"text-orange-900",name:"Exclamation"})}},Dx={DUPLICATE:{label:"Duplicate",icon:u.jsx(I,{name:"FilesEarmark"})},RENAME:{label:"Rename",icon:u.jsx(I,{name:"Pencil"})},DELETE:{label:"Delete",icon:u.jsx(I,{name:"Trash"}),className:"text-red-900"},SETTINGS:{label:"Settings",icon:u.jsx(I,{name:"Gear"})}},au={...Rx,...Dx};function iu(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 cu="powerhouse/budget-statement",Io="powerhouse/default",lu="makerdao/rwa-portfolio",kx=[cu,Io,lu],Lx="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",Fx="/assets/rwa-report-Bb0W5-ac.png",$x="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=",ti={[cu]:Lx,[Io]:$x,[lu]:Fx};function zx(e,t){return t||(kx.includes(e)?ti[e]:ti[Io])}const ni="SYNCING",ri="SUCCESS",si="CONFLICT",oi="MISSING",ai="ERROR",ii="INITIAL_SYNC",Ux={SYNCING:"Syncing",SUCCESS:"Synced",CONFLICT:"Error",MISSING:"Circle",ERROR:"Error",INITIAL_SYNC:"Syncing"};function Bx(e){const{syncStatus:t,className:n,overrideSyncIcons:s={},...r}=e,o={...Ux,...s};return{[ii]:u.jsx(I,{size:16,...r,className:N("text-blue-900",n),name:o[ii]}),[ni]:u.jsx(I,{size:16,...r,className:N("text-blue-900",n),name:o[ni]}),[ri]:u.jsx(I,{size:16,...r,className:N("text-green-900",n),name:o[ri]}),[si]:u.jsx(I,{size:16,...r,className:N("text-orange-900",n),name:o[si]}),[oi]:u.jsx(I,{size:16,...r,className:N("text-red-900",n),name:o[oi]}),[ai]:u.jsx(I,{size:16,...r,className:N("text-red-900",n),name:o[ai]})}[t]}function K6(e){const{fileNode:t,className:n,customDocumentIconSrc:s}=e,[r,o]=b.useState("READ"),[a,i]=b.useState(!1),[c]=Pi(),l=c?Xr(c):"LOCAL",{dragProps:d}=iu({node:t}),{isAllowedToCreateDocuments:f}=Bs(),{onRenameNode:h,onDuplicateNode:p}=Vs(),m=r==="READ",g=_u(t.id,l),v={DUPLICATE:()=>p(t),RENAME:()=>o("WRITE"),DELETE:()=>ji(t)},x=Object.entries(au).map(([j,M])=>({...M,id:j})).filter(j=>ou.includes(j.id));function y(j){h(j,t).catch(M=>{console.error(M)}).finally(()=>{o("READ")})}function C(){o("READ")}function O(j){const M=v[j];if(!M){console.error(`No handler found for dropdown menu item: ${j}`);return}M(),i(!1)}const w=zx(t.documentType,s),E=u.jsxs("div",{className:"relative",children:[u.jsx("img",{alt:"file icon",className:"max-w-none",height:34,src:w,width:32}),m&&g&&u.jsx("div",{className:"absolute bottom-[-2px] right-0 size-3 rounded-full bg-white",children:u.jsx("div",{className:"absolute left-[-2px] top-[-2px]",children:u.jsx(Bx,{overrideSyncIcons:{SUCCESS:"CheckCircleFill"},syncStatus:g})})})]}),S=N("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),P=m?u.jsxs("div",{className:"flex w-52 items-center justify-between",children:[u.jsxs("div",{className:"mr-2 truncate group-hover:mr-0",children:[u.jsx("div",{className:"max-h-6 truncate text-sm font-medium group-hover:text-gray-800",children:t.name}),u.jsx("div",{className:"max-h-6 truncate text-xs font-medium text-gray-600 group-hover:text-gray-800",children:t.documentType})]}),f?u.jsx(wr,{items:x,onItemClick:O,onOpenChange:i,open:a,children:u.jsx("button",{className:N("hidden group-hover:block",a&&"block"),onClick:j=>{j.stopPropagation(),i(!0)},children:u.jsx(I,{className:"text-gray-600",name:"VerticalDots"})})}):null]}):u.jsx(qs,{className:"ml-3 flex-1 font-medium",defaultValue:t.name,onCancel:C,onSubmit:y});return u.jsx("div",{className:"relative w-64",onClick:()=>vt(t),children:u.jsx("div",{...d,className:S,children:u.jsxs("div",{className:"flex items-center",children:[u.jsx("div",{className:"mr-1.5",children:E}),P]})})})}function J6(e){const{folderNode:t,className:n}=e,{isAllowedToCreateDocuments:s}=Bs(),[r,o]=b.useState("READ"),[a,i]=b.useState(!1),{dragProps:c}=iu({node:t}),{onRenameNode:l,onDuplicateNode:d}=Vs(),{isDropTarget:f,dropProps:h}=zc({target:t}),p=r==="READ";function m(){o("READ")}function g(w){l(w,t).catch(E=>{console.error(E)}).finally(()=>{o("READ")})}const v={DUPLICATE:()=>d(t),RENAME:()=>o("WRITE"),DELETE:()=>ji(t)},x=Object.entries(au).map(([w,E])=>({...E,id:w})).filter(w=>ou.includes(w.id));function y(w){const E=v[w];if(!E){console.error(`No handler found for dropdown menu item: ${w}`);return}E(),i(!1)}const C=p||!s?u.jsx("div",{className:"ml-3 max-h-6 truncate font-medium text-gray-600 group-hover:text-gray-800",children:t.name}):u.jsx(qs,{className:"ml-3 font-medium",defaultValue:t.name,onCancel:m,onSubmit:g}),O=N("group flex h-12 cursor-pointer select-none items-center rounded-lg bg-gray-200 px-2",n,f&&"bg-blue-100");return u.jsx("div",{className:"relative w-64",onClick:()=>vt(t),children:u.jsxs("div",{...c,...h,className:O,children:[u.jsxs("div",{className:"flex items-center overflow-hidden",children:[u.jsx("div",{className:"p-1",children:u.jsx("div",{className:"relative",children:u.jsx(I,{name:"FolderClose",size:24})})}),C]}),p&&s?u.jsx(wr,{items:x,onItemClick:y,onOpenChange:i,open:a,children:u.jsx("button",{className:N("ml-auto hidden group-hover:block",a&&"block"),onClick:w=>{w.stopPropagation(),i(!0)},children:u.jsx(I,{className:"text-gray-600",name:"VerticalDots"})})}):null]})})}const Sn=b.forwardRef(function(t,n){const{icon:s,errorMessage:r,isDirty:o,containerClassName:a,inputClassName:i,errorMessageClassName:c,hideErrors:l=!1,...d}=t,f=t.type??"text",h=!!r;return u.jsxs("div",{children:[u.jsxs("div",{className:N("mb-1 flex gap-2 rounded-md border border-gray-200 bg-gray-50 p-3 text-black placeholder:text-gray-50",h&&"border-red-900",a),children:[s&&u.jsx("span",{className:_s((!o||h)&&"text-slate-200"),children:s}),u.jsx("input",{...d,className:N("w-full bg-transparent font-semibold outline-none",i),ref:n,type:f})]}),u.jsx("p",{className:N("hidden min-h-4 text-xs text-red-900",h&&"block",l&&"hidden",c),children:r})]})});function Vx(e){return b.forwardRef(e)}const No=Vx(function(t,n){const{items:s,value:r,id:o,onChange:a,containerClassName:i,menuClassName:c,itemClassName:l,absolutePositionMenu:d=!1,borderRadius:f="6px"}=t,[h,p]=b.useState(!1),m=v(r)??s[0];function g(y){y.disabled||(a(y.value),p(!1))}function v(y){return s.find(C=>C.value===y)}const x=s.filter(y=>y.value!==r);return u.jsxs("div",{className:N("border border-gray-200 bg-gray-50 text-gray-800 transition-[border-radius]",d&&"relative",i),"data-open":h,ref:n,style:{borderRadius:f},children:[u.jsxs("div",{className:N("flex min-w-[360px] cursor-pointer items-center justify-between pr-3 text-gray-800 outline-none",c),id:o,onClick:()=>p(!h),children:[u.jsx(ci,{...m,className:l}),u.jsx(I,{className:_s("transition",h?"":"-rotate-90"),name:"ChevronDown"})]}),u.jsx("div",{className:N("max-h-0 w-full overflow-hidden bg-inherit transition-[max-height] ease-in-out",h&&"max-h-screen",d&&"absolute"),style:{borderRadius:`0 0 ${f} ${f}`},children:x.map(y=>u.jsx(ci,{...y,className:l,onItemClick:()=>g(y)},y.value))})]})});function ci(e){const{className:t,disabled:n,onItemClick:s,icon:r,displayValue:o,value:a,description:i}=e;return u.jsxs("div",{className:N(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,u.jsxs("div",{children:[u.jsx("p",{className:"capitalize text-inherit",children:o??a.toLowerCase()}),u.jsx("p",{className:"text-xs text-gray-600",children:i})]})]})}function Hx(e){return{value:e.id,displayValue:e.name,icon:u.jsx(I,{name:"PowerhouseLogoSmall"}),description:"Built by Powerhouse"}}function _x(e){const{control:t,appOptions:n,...s}=e,r=n.map(Hx);return u.jsx(Ei,{control:t,name:"appId",render:({field:o})=>u.jsx(No,{...s,...o,id:"appId",items:r})})}const Wx=b.forwardRef(function(t,n){return u.jsxs("label",{className:"relative cursor-pointer items-center",htmlFor:t.id,children:[u.jsx("input",{className:"peer sr-only",ref:n,type:"checkbox",value:"",...t}),u.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"})]})}),Mo=b.forwardRef(function(t,n){return u.jsxs("div",{className:"flex items-center rounded-md border border-gray-200 bg-gray-50 p-3 text-gray-900",children:[u.jsxs("div",{className:"flex-1",children:[u.jsx("label",{className:"font-medium text-gray-900",htmlFor:"availableOffline",children:"Make available offline"}),u.jsxs("p",{className:"text-xs text-gray-600",children:["Check this options if you keep a local backup",u.jsx("br",{}),"available at all times."]})]}),u.jsx(Wx,{id:"availableOffline",ref:n,...t})]})});function Qn(e){const{children:t,className:n,...s}=e;return u.jsx("label",{...s,className:N("block font-semibold text-gray-500",n),children:t})}function uu(e){const{control:t,...n}=e;return u.jsx(Ei,{control:t,name:"sharingType",render:({field:s})=>u.jsx(No,{...n,...s,id:"sharingType",items:Tx})})}function Gx(e){const{register:t,handleSubmit:n,control:s,formState:{errors:r}}=Us({defaultValues:{name:"",sharingType:"LOCAL",availableOffline:!1,appId:e.appOptions[0].id}});return u.jsx("form",{name:"add-local-drive",onSubmit:n(e.onSubmit),className:"flex flex-col gap-4",children:u.jsxs("div",{className:"flex flex-col gap-4",children:[u.jsxs("div",{children:[u.jsx(Qn,{htmlFor:"name",className:"text-sm font-medium text-gray-800",children:"Drive Name"}),u.jsx(Sn,{...t("name",{required:"Drive name is required"}),errorMessage:r.name?.message,placeholder:"Drive name"})]}),u.jsxs("div",{children:[u.jsx(Qn,{htmlFor:"driveApp",className:"text-sm font-medium text-gray-800",children:"Drive App"}),u.jsx(_x,{control:s,appOptions:e.appOptions})]}),u.jsxs("div",{children:[u.jsx(Qn,{htmlFor:"sharingType",className:"text-sm font-medium text-gray-800",children:"Location"}),u.jsx(uu,{control:s})]}),u.jsx("div",{children:u.jsx(Mo,{...t("availableOffline")})}),u.jsx(Pe,{className:"mt-2 w-full",type:"submit",children:"Create new drive"})]})})}function qx(e){return u.jsxs("div",{className:"flex gap-2 rounded-xl bg-gray-100 p-3 font-semibold text-gray-500",children:[u.jsx(I,{className:"text-gray-600",name:"Drive"}),e.driveName]})}function du(e){const{location:t,className:n,...s}=e,r=Ax[t];return u.jsxs("div",{...s,className:N("my-3 flex items-center gap-2 rounded-xl border border-gray-100 p-3 text-gray-800 shadow",n),children:[r.icon,u.jsxs("div",{children:[u.jsx("p",{children:r.title}),u.jsx("p",{className:"text-xs text-slate-200",children:r.description})]})]})}function Yx(e){const{sharingType:t="PUBLIC",requestPublicDrive:n}=e,[s,r]=b.useState(),[o,a]=b.useState(!1),[i,c]=b.useState(!0),[l,d]=b.useState(!1),[f,h]=b.useState(""),[p,m]=b.useState(""),[g,v]=R0(p,500),{register:x,handleSubmit:y,setValue:C}=Us({mode:"onBlur",defaultValues:{availableOffline:s?.availableOffline??!1}});b.useEffect(()=>{v(p)},[p]),b.useEffect(()=>{if(d(!1),g==="")return;w().catch(console.error);async function w(){try{const{id:E,name:S}=await n(g);r({id:E,name:S,sharingType:t,location:"SWITCHBOARD",availableOffline:!0}),C("availableOffline",!0),c(!0),h("")}catch(E){r(void 0),c(!1),h(E.message)}}},[g,C,t]);function O({availableOffline:w}){s&&e.onSubmit({...s,availableOffline:w,url:g})}return u.jsx("form",{onSubmit:y(O),children:l?u.jsxs(u.Fragment,{children:[u.jsx(qx,{driveName:s?.name??"New drive"}),u.jsx(pt,{className:"my-3"}),u.jsxs(or,{isOpen:o,onOpenChange:()=>a(!o),title:"Location",children:[u.jsx(du,{location:"SWITCHBOARD"}),u.jsx(Mo,{...x("availableOffline")})]}),u.jsx(Pe,{className:"mt-4 w-full",color:"dark",type:"submit",children:"Add new drive"})]}):u.jsxs(u.Fragment,{children:[u.jsx(Sn,{errorMessage:f,onChange:w=>m(w.target.value),placeholder:"Drive URL",required:!0,type:"url",value:p}),u.jsx(Pe,{className:"mt-4 w-full py-2 text-base",color:"dark",size:"small",disabled:!i||p==="",onClick:w=>{w.preventDefault(),d(!0)},type:"button",children:"Add drive"})]})})}const Qx="/assets/home-bg-BRYzhkhi.avif",Kx="/assets/home-bg-BEhF9NuW.png";function Jx(){return u.jsxs("picture",{className:"pointer-events-none absolute inset-8 z-0 size-[calc(100%-32px)] object-contain",children:[u.jsx("source",{srcSet:Qx,type:"image/avif"}),u.jsx("img",{src:Kx,alt:"background",className:"object-contain"})]})}const Xx=function(t){const{icon:n,title:s,description:r,containerClassName:o,shareable:a,onClick:i}=t;return u.jsxs("div",{className:N("relative flex h-24 cursor-pointer flex-col items-center justify-center text-center text-sm text-black",o,i&&"cursor-pointer"),onClick:i,children:[u.jsx("div",{className:"mx-auto pb-2",children:n||u.jsx("div",{className:"size-8 items-center justify-center rounded-lg bg-black pt-1",children:u.jsx("span",{className:"text-6 w-6 text-white",children:s.slice(0,1).toUpperCase()})})}),u.jsxs("div",{children:[u.jsx("h3",{children:s}),r&&u.jsx("p",{className:"text-gray-500",children:r})]}),a&&u.jsx("div",{className:"absolute left-2 top-0 mb-2",children:u.jsx(I,{name:"PeopleFill",width:12,height:12})})]})},X6=function(t){const{containerClassName:n}=t;return u.jsx(Xx,{title:"Create New Drive",icon:u.jsx(I,{name:"PlusSquare",size:32}),onClick:()=>Wu({type:"addDrive"}),containerClassName:n})},Z6=function(t){const{children:n,containerClassName:s}=t;return u.jsx("div",{className:N("container relative mx-auto flex h-full flex-col bg-white",s),children:u.jsxs("div",{className:"m-8 flex flex-wrap justify-center gap-4 pt-12",children:[u.jsx(Jx,{}),n]})})};function li(e){const{label:t,children:n}=e;return u.jsx("div",{children:n})}var Or="Tabs",[Zx]=Ii(Or,[Ai]),fu=Ai(),[e5,To]=Zx(Or),hu=b.forwardRef((e,t)=>{const{__scopeTabs:n,value:s,onValueChange:r,defaultValue:o,orientation:a="horizontal",dir:i,activationMode:c="automatic",...l}=e,d=od(i),[f,h]=Ti({prop:s,onChange:r,defaultProp:o??"",caller:Or});return u.jsx(e5,{scope:n,baseId:Mi(),value:f,onValueChange:h,orientation:a,dir:d,activationMode:c,children:u.jsx(Et.div,{dir:d,"data-orientation":a,...l,ref:t})})});hu.displayName=Or;var pu="TabsList",mu=b.forwardRef((e,t)=>{const{__scopeTabs:n,loop:s=!0,...r}=e,o=To(pu,n),a=fu(n);return u.jsx(ad,{asChild:!0,...a,orientation:o.orientation,dir:o.dir,loop:s,children:u.jsx(Et.div,{role:"tablist","aria-orientation":o.orientation,...r,ref:t})})});mu.displayName=pu;var gu="TabsTrigger",bu=b.forwardRef((e,t)=>{const{__scopeTabs:n,value:s,disabled:r=!1,...o}=e,a=To(gu,n),i=fu(n),c=xu(a.baseId,s),l=wu(a.baseId,s),d=s===a.value;return u.jsx(id,{asChild:!0,...i,focusable:!r,active:d,children:u.jsx(Et.button,{type:"button",role:"tab","aria-selected":d,"aria-controls":l,"data-state":d?"active":"inactive","data-disabled":r?"":void 0,disabled:r,id:c,...o,ref:t,onMouseDown:ke(e.onMouseDown,f=>{!r&&f.button===0&&f.ctrlKey===!1?a.onValueChange(s):f.preventDefault()}),onKeyDown:ke(e.onKeyDown,f=>{[" ","Enter"].includes(f.key)&&a.onValueChange(s)}),onFocus:ke(e.onFocus,()=>{const f=a.activationMode!=="manual";!d&&!r&&f&&a.onValueChange(s)})})})});bu.displayName=gu;var vu="TabsContent",yu=b.forwardRef((e,t)=>{const{__scopeTabs:n,value:s,forceMount:r,children:o,...a}=e,i=To(vu,n),c=xu(i.baseId,s),l=wu(i.baseId,s),d=s===i.value,f=b.useRef(d);return b.useEffect(()=>{const h=requestAnimationFrame(()=>f.current=!1);return()=>cancelAnimationFrame(h)},[]),u.jsx(Hs,{present:r||d,children:({present:h})=>u.jsx(Et.div,{"data-state":d?"active":"inactive","data-orientation":i.orientation,role:"tabpanel","aria-labelledby":c,hidden:!h,id:l,tabIndex:0,...a,ref:t,style:{...e.style,animationDuration:f.current?"0s":void 0},children:h&&o})})});yu.displayName=vu;function xu(e,t){return`${e}-trigger-${t}`}function wu(e,t){return`${e}-content-${t}`}var t5=hu,n5=mu,r5=bu,s5=yu;function o5({children:e,defaultValue:t}){return u.jsxs(t5,{defaultValue:t,className:"flex flex-col gap-2",children:[u.jsx("div",{className:"flex w-full justify-between",children:u.jsx(n5,{className:"flex w-full gap-x-2 rounded-xl bg-slate-50 p-1 text-sm font-semibold text-gray-600 outline-none",children:W.Children.map(e,(n,s)=>{if(!W.isValidElement(n))return;const{label:r,disabled:o}=n.props;return u.jsx(r5,{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)})})}),u.jsx("div",{className:"mt-3 rounded-md bg-white",children:W.Children.map(e,(n,s)=>{if(!W.isValidElement(n))return;const{label:r}=n.props;return u.jsx(s5,{value:r,children:n},s)})})]})}function ew(e){function t(){s(!1)}const{open:n,onOpenChange:s,onAddRemoteDrive:r,onAddLocalDrive:o,requestPublicDrive:a,modalProps:i,containerProps:c}=e;return u.jsx(Ye,{...i,contentProps:{className:"rounded-2xl"},onOpenChange:s,open:n,children:u.jsx("div",{...c,className:N("w-[408px] rounded-2xl p-6",c?.className),children:u.jsxs(o5,{defaultValue:"Create Drive",children:[u.jsx(li,{label:"Create Drive",description:"Create a new drive",children:u.jsx(Gx,{onCancel:t,onSubmit:o,appOptions:e.appOptions})}),u.jsx(li,{label:"Add Drive",description:"Add a drive",children:u.jsx(Yx,{sharingType:"PUBLIC",onSubmit:r,onCancel:t,requestPublicDrive:a})})]})})})}const ui="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 Cu(e){const{body:t,header:n,children:s,onCancel:r,onOpenChange:o,onContinue:a,cancelLabel:i,continueLabel:c,overlayProps:l,contentProps:d,bodyProps:f={},headerProps:h={},containerProps:p={},cancelButtonProps:m={},continueButtonProps:g={},buttonContainerProps:v={},...x}=e;return u.jsx(Ye,{contentProps:{...d,className:N("rounded-3xl",d?.className)},onOpenChange:o,overlayProps:{...l,className:l?.className},...x,children:u.jsxs("div",{...ce(p,"w-[400px] p-6 text-slate-300"),children:[u.jsx("div",{...ce(h,"border-b border-slate-50 pb-2 text-2xl font-bold text-gray-800"),children:n}),u.jsxs("div",{...ce(f,"my-6 rounded-md bg-slate-50 p-4 text-center"),children:[t,s]}),u.jsxs("div",{...ce(v,"mt-8 flex justify-between gap-3"),children:[u.jsx("button",{onClick:r,...ce(m,N(ui,"flex-1 bg-slate-50 text-slate-800")),children:i}),u.jsx("button",{onClick:a,...ce(g,N(ui,"flex-1 bg-gray-800 text-gray-50")),children:c})]})]})})}const di="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",fi=300;function tw(e){const{onOpenChange:t,onContinue:n,overlayProps:s,contentProps:r,...o}=e,[a,i]=b.useState(""),[c,l]=b.useState(!1),d=()=>{t?.(!1),setTimeout(()=>i(""),fi)},f=b.useCallback(()=>{c&&(n(a),setTimeout(()=>i(""),fi))},[c,a,n]),h=b.useCallback(p=>{p.preventDefault(),f()},[f]);return u.jsx(Ye,{contentProps:{...r,className:N("rounded-3xl",r?.className)},onOpenChange:t,overlayProps:{...s,className:s?.className},...o,children:u.jsxs("form",{name:"create-document",className:"w-[400px] p-6 text-slate-300",onSubmit:h,children:[u.jsx("div",{className:"border-b border-slate-50 pb-2 text-2xl font-bold text-gray-800",children:"Create a new document"}),u.jsxs("div",{className:"my-6",children:[!c&&a&&u.jsx("div",{className:"mb-2 text-red-500",children:"Document name must be valid URL characters."}),u.jsx(Sn,{icon:u.jsx(I,{name:"BrickGlobe"}),onChange:p=>{const m=p.target.value;i(m),l(vd(m))},placeholder:"Document name",required:!0,value:a})]}),u.jsxs("div",{className:"mt-8 flex justify-between gap-3",children:[u.jsx("button",{type:"button",className:N(di,"flex-1 bg-slate-50 text-slate-800"),onClick:d,children:"Cancel"}),u.jsx(Pe,{type:"submit",className:N(di,"flex-1 bg-gray-800 text-gray-50"),disabled:!c,children:"Create"})]})]})})}const nw=e=>{const{inputPlaceholder:t,body:n,driveName:s,...r}=e,[o,a]=b.useState("");return u.jsx(Cu,{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:u.jsxs("div",{children:[u.jsx("div",{className:"my-6 rounded-md bg-slate-50 p-4 text-center",children:n}),u.jsx("div",{children:u.jsx(Sn,{hideErrors:!0,icon:u.jsx(I,{name:"Lock"}),onChange:i=>a(i.target.value),placeholder:t,value:o})})]})})};function rw(e){const{onDelete:t,deleteLabel:n,...s}=e;return u.jsx(Cu,{...s,containerProps:{className:"w-[450px]"},continueButtonProps:{className:"bg-red-900"},continueLabel:n,onContinue:t})}const Su=b.forwardRef(function(t,n){return u.jsx(Sn,{...t,icon:t.icon??u.jsx(I,{name:"Drive"}),id:"driveName",placeholder:"Drive name",ref:n})});function a5(e){const{drive:t,handleDeleteDrive:n,onCancel:s}=e,[r,o]=b.useState(""),a=r===t.header.name;function i(){a&&n()}return u.jsxs("div",{children:[u.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?"}),u.jsx(Su,{icon:u.jsx(I,{name:"Lock"}),onChange:c=>o(c.target.value),placeholder:"Enter drive name...",value:r}),u.jsxs("div",{className:"flex gap-3",children:[u.jsx(Pe,{className:"w-full",color:"light",onClick:s,children:"Cancel"}),u.jsx(Pe,{className:"w-full",color:"red",disabled:!a,onClick:i,children:"Delete"})]})]})}function i5(e){const{drive:t,sharingType:n,availableOffline:s,onSubmit:r,handleDeleteDrive:o}=e,a=t.header.name,[i,c]=b.useState(!1),[l,d]=b.useState(!1),[f,h]=b.useState(!1),{register:p,handleSubmit:m,control:g}=Us({mode:"onBlur",defaultValues:{name:a,sharingType:n,availableOffline:s}}),v=n==="PUBLIC"?"SWITCHBOARD":n;return u.jsxs("form",{onSubmit:m(r),children:[u.jsx(Su,{...p("name")}),u.jsx(pt,{className:"my-4"}),u.jsx(Qn,{htmlFor:"sharingType",children:"Sharing settings"}),u.jsx(uu,{control:g}),u.jsx(pt,{className:"my-3"}),u.jsxs(or,{isOpen:i,onOpenChange:()=>c(!i),title:"Location",children:[u.jsx(du,{location:v}),u.jsx(Mo,{...p("availableOffline")})]}),u.jsx(pt,{className:"my-3"}),u.jsx(or,{isOpen:l,onOpenChange:()=>d(!l),title:"Danger zone",children:u.jsxs("button",{className:"flex gap-2 py-3 font-semibold text-red-900 transition hover:brightness-125",onClick:()=>h(!0),type:"button",children:[u.jsx(I,{name:"Trash"}),"Delete drive"]})}),f&&l?u.jsx(a5,{drive:t,handleDeleteDrive:o,onCancel:()=>h(!1)}):u.jsxs(u.Fragment,{children:[u.jsx(pt,{className:"my-3"}),u.jsx(Pe,{className:"mb-4 w-full",type:"submit",children:"Confirm"})]})]})}function sw(e){const{drive:t,open:n,sharingType:s,availableOffline:r,onOpenChange:o,onDeleteDrive:a,onRenameDrive:i,onChangeSharingType:c,onChangeAvailableOffline:l,modalProps:d,containerProps:f}=e,h=g=>{g.name!==t.header.name&&i(t,g.name),g.sharingType!==s&&c(t,g.sharingType),g.availableOffline!==r&&l(t,g.availableOffline),o(!1)};function p(){a(t),o(!1)}function m(){o(!1)}return u.jsx(Ye,{...d,contentProps:{className:"rounded-2xl"},onOpenChange:o,open:n,children:u.jsxs("div",{...f,className:N("max-w-[408px] rounded-2xl p-6",f?.className),children:[u.jsxs("div",{className:"flex justify-between",children:[u.jsx("h1",{className:"text-xl font-bold",children:"Drive settings"}),u.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:u.jsx(I,{name:"XmarkLight",size:24})})]}),u.jsx(pt,{className:"my-4"}),u.jsx(i5,{handleCancel:m,handleDeleteDrive:p,onSubmit:h,drive:t,sharingType:s,availableOffline:r})]})})}const c5="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 ow(e){const{body:t,header:n,children:s,onOpenChange:r,onContinue:o,closeLabel:a,overlayProps:i,contentProps:c,bodyProps:l={},headerProps:d={},containerProps:f={},continueButtonProps:h={},buttonContainerProps:p={},...m}=e,[g,v]=b.useState(!0),x=b.useRef(null);return b.useEffect(()=>{const y=()=>{const O=x.current;O&&(O.scrollHeight>O.clientHeight?(v(!0),O.addEventListener("scroll",C)):v(!1))},C=()=>{const O=x.current;O&&O.scrollHeight-Math.ceil(O.scrollTop)===O.clientHeight&&v(!1)};return requestAnimationFrame(y),()=>{const O=x.current;O&&O.removeEventListener("scroll",C)}},[]),u.jsx(Ye,{contentProps:{...c,className:N("rounded-3xl outline-none",c?.className)},onOpenChange:r,overlayProps:{...i,className:i?.className},...m,children:u.jsxs("div",{...ce(f,"w-[500px] p-6 text-slate-300"),children:[u.jsx("div",{...ce(d,"border-b border-slate-50 pb-2 text-2xl font-bold text-gray-800"),children:n}),u.jsxs("div",{ref:x,...ce(l,"my-6 max-h-[245px] overflow-scroll rounded-md bg-slate-50 p-4 text-center"),children:[t,s]}),u.jsx("div",{...ce(p,"mt-8 flex justify-between gap-3"),children:u.jsx("button",{disabled:g,onClick:o,...ce(h,N(c5,"flex-1 bg-gray-800 text-gray-50",g&&"cursor-not-allowed bg-gray-300 hover:scale-100")),children:a})})]})})}const l5=[/^@powerhousedao\/.+$/,"document-drive","document-model"],u5=yd({version:It({message:"Missing version field in package.json"}),dependencies:Fo(It(),It()).nullable(),devDependencies:Fo(It(),It()).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])=>l5.some(s=>typeof s=="string"?s===n:s.test(n))))}});function d5(e){const t=u5.safeParse(e);return t.success?t.data:(console.error("Package.json validation failed:",t.error.format()),!1)}function f5(e){const[t,n]=b.useState(!1),{packageJson:s,phCliVersion:r}=e,o=d5(s);return o?u.jsx(or,{isOpen:t,onOpenChange:()=>n(!t),title:`App version: ${o.version}`,toggleClassName:"text-gray-900 text-sm",children:u.jsxs("ul",{className:"text-sm text-gray-600",children:[Object.entries(o.dependencies).map(([a,i])=>u.jsxs("li",{className:"my-1 flex justify-between pr-1",children:[u.jsxs("span",{children:[a.replace("@powerhousedao/",""),":"]}),u.jsx("span",{className:"font-normal",children:i})]},a)),r&&u.jsxs("li",{className:"my-1 flex justify-between pr-1",children:[u.jsx("span",{children:"@powerhousedao/ph-cli:"}),u.jsx("span",{className:"font-normal",children:r})]},"ph-cli")]})}):(console.error("Failed to validate package.json data"),null)}function aw(e){const{packageJson:t,phCliVersion:n}=e;return u.jsxs("div",{className:"bg-white p-3",children:[u.jsx("h2",{className:"font-semibold",children:"About"}),u.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."}),u.jsx("div",{className:"my-4",children:u.jsx(f5,{packageJson:t,phCliVersion:n})})]})}function iw(e){const{className:t,...n}=e;return u.jsxs("div",{className:Ri("h-full rounded-lg bg-white p-3",t),children:[u.jsx("h2",{className:"mb-4 font-semibold",children:"Modify Drives"}),u.jsx(h5,{...n}),u.jsx("h2",{className:"my-4 font-semibold",children:"Local Storage"}),u.jsx(g5,{...n})]})}function h5(e){const{className:t,...n}=e;return u.jsx("div",{className:t,children:u.jsx(p5,{...n})})}function p5(e){const{className:t,...n}=e;return u.jsx("div",{className:t,children:e.drives.map(s=>u.jsx(m5,{drive:s,...n},s.header.id))})}function m5(e){const{drive:t,className:n,onDeleteDrive:s}=e,[r,o]=b.useState(!1),a=u.jsx(I,{name:"Hdd",size:16,className:"flex-none"}),i=u.jsx(I,{name:"Server",size:16,className:"flex-none"}),c=t.state.global.icon?u.jsx("img",{alt:"drive icon",className:"size-4 flex-none object-contain",src:t.state.global.icon}):u.jsx(I,{name:"M",size:16,className:"flex-none"});function l(){const f=Xr(t);return f==="PUBLIC"?c:f==="CLOUD"?i:a}const d=l();return u.jsxs("div",{className:Ri("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,u.jsxs("div",{children:[u.jsx("span",{className:"block text-sm font-medium leading-[18px]",children:Lo(t.header.name)}),u.jsxs("div",{className:"flex items-baseline gap-x-2 leading-[18px]",children:[u.jsxs("span",{className:"text-sm text-gray-600",children:[Lo(Xr(t))," App"]}),u.jsxs("a",{className:"group flex items-center gap-x-2 text-sm text-slate-500 transition-colors hover:text-[#9896FF]",children:["By Powerhouse",u.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:u.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"})})]})]})]}),u.jsx(wr,{items:[{id:"delete-drive",label:"Delete",icon:u.jsx(I,{name:"Trash"}),className:"text-red-900"}],onItemClick:f=>{f==="delete-drive"&&s(t)},onOpenChange:o,open:r,children:u.jsx("button",{className:"group ml-auto flex-none",onClick:f=>{f.stopPropagation(),o(!0)},children:u.jsx(I,{className:"text-gray-600 group-hover:text-gray-900",name:"VerticalDots",size:16})})})]})}function g5(e){const{onClearStorage:t}=e;return u.jsx("div",{children:u.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 ",u.jsx(I,{name:"Trash",size:16})]})})}function cw(e){const{className:t,...n}=e;return u.jsx("div",{className:N("rounded-lg p-3",t),children:u.jsx(b5,{...n})})}function b5(e){const{documentModelEditor:t,setDocumentModelEditor:n,documentModelEditorOptions:s,className:r}=e;return u.jsxs("div",{children:[u.jsx("h3",{className:"mb-4 font-semibold text-gray-900",children:"Default Editor Selection"}),u.jsx(ki,{className:N("min-w-36 max-w-fit",r),name:"default-editor",required:!0,value:t,options:s,multiple:!1,onChange:o=>n(o)})]})}const v5={npm:{icon:"Npm"},github:{icon:"Github",size:28},local:{icon:"Hdd"}},y5=({packageName:e,provider:t})=>{const n=t&&v5[t];return u.jsxs("div",{className:"flex w-full items-center justify-between px-2 py-1",children:[u.jsx("p",{className:"font-medium",children:e}),n&&u.jsx(I,{name:n.icon,size:n.size})]})},x5=e=>{const{onInstall:t,packageOptions:n,className:s}=e,[r,o]=b.useState(""),[a,i]=b.useState(!1),[c,l]=b.useState(),d=b.useCallback(()=>{const m=t(r);m?(i(!0),m.then(()=>o("")).catch(l).finally(()=>i(!1))):(o(""),l(void 0))},[t,r]),f=b.useCallback(m=>{o(m.target.value)},[]),h=c?typeof c=="string"?c:c instanceof Error?c.message:c:" ",p=b.useMemo(()=>{const m=n?.map(g=>({...g,value:g.packageName}));return n?.length?{autoComplete:!0,initialOptions:m,fetchOptionsCallback:g=>m?.filter(v=>v.packageName.toLowerCase().includes(g.toLowerCase()))??[],renderOption:g=>u.jsx(y5,{...g})}:{autoComplete:!1}},[n]);return u.jsxs("div",{className:s,children:[u.jsx("h3",{className:"mb-4 font-semibold text-gray-900",children:"Install Package"}),u.jsxs("div",{className:"flex items-center gap-4",children:[n?.length?u.jsx(Ed,{...p,onChange:o}):u.jsx(Sd,{name:"package",className:"max-w-xs text-gray-700",value:r,onChange:f,onSubmit:d,disabled:a}),u.jsx(Pe,{className:"h-9 rounded-md text-sm",onClick:d,disabled:a,children:"Install"})]}),u.jsx("p",{className:"mb-3 ml-2 h-3 text-sm text-red-800",children:h})]})},zn=({label:e,value:t})=>u.jsxs("div",{className:"flex items-start gap-2 text-sm",children:[u.jsxs("p",{className:"text-gray-600",children:[e,":"]}),u.jsx("p",{className:"text-gray-600",children:t})]}),w5=e=>{const{package:{name:t,description:n,category:s,publisher:r,publisherUrl:o,modules:a,id:i,removable:c},mutable:l,onUninstall:d,className:f}=e,[h,p]=b.useState(!1);return u.jsxs("li",{className:N("relative flex flex-col items-start rounded-md border border-gray-200 p-3 text-sm leading-5 shadow-sm",f),children:[u.jsx("h3",{className:"font-semibold text-gray-900",children:t}),u.jsx(zn,{label:"Description",value:n}),u.jsx(zn,{label:"Category",value:s}),u.jsx(zn,{label:"Publisher",value:r}),u.jsx(zn,{label:"Publisher URL",value:u.jsx("a",{className:"underline",href:o,children:o})}),u.jsx("p",{className:"text-sm text-gray-600",children:"Modules included:"}),u.jsx("ul",{className:"list-disc pl-5",children:a.map(m=>u.jsx("li",{children:u.jsx("span",{className:"text-gray-600",children:m})},m))}),l&&c&&u.jsx(wr,{items:[{id:"uninstall",label:"Uninstall",icon:u.jsx(I,{name:"Trash"}),className:"text-red-900"}],onItemClick:m=>{m==="uninstall"&&d(i)},onOpenChange:p,open:h,children:u.jsx("button",{className:"group absolute right-3 top-3",onClick:m=>{m.stopPropagation(),p(!0)},children:u.jsx(I,{className:"text-gray-600 group-hover:text-gray-900",name:"VerticalDots"})})})]})},C5=e=>{const{className:t,packages:n,onUninstall:s,mutable:r,...o}=e,a=b.useCallback(i=>{s(i)},[s]);return u.jsxs("div",{...o,className:N("flex max-h-[370px] flex-col items-stretch overflow-hidden",t),children:[u.jsx("h3",{className:"mb-4 font-semibold text-gray-900",children:"Installed Packages"}),u.jsx("div",{className:"flex-1 overflow-y-auto pr-2",children:u.jsx("ul",{className:"flex flex-col items-stretch gap-4 pr-2",children:n.map(i=>u.jsx(w5,{package:i,onUninstall:a,mutable:r},i.id))})})]})},S5=e=>{const{reactorOptions:t,reactor:n,onReactorChange:s,...r}=e,o=b.useCallback(a=>{s(Array.isArray(a)?a.at(-1):a)},[s]);return u.jsxs("div",{...r,children:[u.jsx("h3",{className:"mb-4 font-semibold text-gray-900",children:"Select Reactor"}),u.jsx(ki,{className:"min-w-36 max-w-fit",name:"reactor",required:!0,value:n,options:t,multiple:!1,onChange:o})]})},lw=e=>{const{className:t,reactorOptions:n,reactor:s,onReactorChange:r,onInstall:o,packages:a,onUninstall:i,mutable:c,packageOptions:l,...d}=e,f=b.useMemo(()=>l?.filter(h=>!a.find(p=>p.name===h.packageName)),[a,l]);return u.jsxs("div",{...d,className:N("flex h-full flex-1 flex-col rounded-lg p-3",t),children:[u.jsx(S5,{reactor:s,reactorOptions:n,onReactorChange:r,className:"mb-4"}),c&&u.jsx(x5,{onInstall:o,packageOptions:f}),u.jsx(C5,{packages:a,onUninstall:i,mutable:c})]})};function uw(e){const{title:t,overlayProps:n,contentProps:s,onOpenChange:r,tabs:o,defaultTab:a,...i}=e,[c,l]=b.useState(a??o.at(0)?.id),d=o.map(p=>u.jsx("button",{type:"button",onClick:()=>l(p.id),children:u.jsxs("div",{className:N("flex h-9 w-48 cursor-pointer items-center gap-x-2 rounded-md pl-3 hover:bg-slate-50",c===p.id?"bg-slate-50":"bg-transparent"),children:[p.icon,u.jsx("span",{children:p.label})]})},p.id)),h=o.find(p=>p.id===c)?.content;return u.jsxs(Ye,{contentProps:{...s,className:N("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:N("py-28",n?.className)},...i,children:[u.jsxs("div",{className:"flex justify-between border-b border-slate-50 p-4",children:[u.jsx("h1",{className:"text-center text-xl font-semibold",children:t}),u.jsx("button",{type:"button",className:"flex size-6 items-center justify-center rounded-md outline-none",onClick:()=>r?.(!1),children:u.jsx(I,{name:"XmarkLight",size:24})})]}),u.jsxs("div",{className:"flex flex-1",children:[u.jsx("div",{className:"flex flex-col gap-y-1 p-3 pt-6",children:d}),u.jsx("div",{className:"m-6 flex h-full flex-1 flex-col overflow-hidden rounded-lg border border-slate-50",children:typeof h=="function"?u.jsx(h,{}):h})]})]})}const hi="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 dw(e){const{body:t,header:n,onOpenChange:s,onContinue:r,cancelLabel:o,continueLabel:a,overlayProps:i,contentProps:c,...l}=e;return u.jsx(Ye,{contentProps:{...c,className:N("rounded-3xl",c?.className)},onOpenChange:s,overlayProps:{...i,className:i?.className},...l,children:u.jsxs("div",{className:"w-[400px] p-6 text-slate-300",children:[u.jsx("div",{className:"border-b border-slate-50 pb-2 text-2xl font-bold text-gray-800",children:n}),u.jsx("div",{className:"my-6 rounded-md bg-slate-50 p-4 text-center",children:t}),u.jsxs("div",{className:"mt-8 flex justify-between gap-3",children:[u.jsx("button",{className:N(hi,"flex-1 bg-slate-50 text-slate-800"),onClick:()=>s?.(!1),children:o}),u.jsx("button",{className:N(hi,"flex-1 bg-gray-800 text-gray-50"),onClick:r,children:a})]})]})})}function E5(e){const{branch:t="main"}=e;return u.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:[u.jsx(I,{name:"Branch"}),u.jsx("span",{children:"BRANCH"}),u.jsx("span",{className:"text-gray-900",children:t})]})}function P5(e){const{docId:t}=e,[,n]=mr();function s(r){return()=>{n(r).catch(o=>{console.error("Failed to copy!",o)})}}return u.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:s(t),children:[u.jsx(I,{name:"Link"}),"DOC ID",u.jsx("span",{className:"text-gray-900",children:t})]})}const O5=e=>{const{documentState:t,onCopyState:n}=e,[,s]=mr();function r(){const o=JSON.stringify(t,null,2);s(o).then(()=>{n?.()}).catch(a=>{console.error("Failed to copy document state!",a)})}return u.jsx("button",{className:"rounded-lg bg-slate-50 p-1 text-stone-300",onClick:r,children:u.jsx(I,{name:"CurlyBrackets"})})};function j5(e){const{value:t,onChange:n}=e,s=[{displayValue:"Global scope",value:"global"},{displayValue:"Local scope",value:"local"}];return u.jsx(No,{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 I5(e){const{title:t,docId:n,scope:s,onChangeScope:r,onClose:o,className:a,documentState:i,onCopyState:c,...l}=e;return u.jsxs("header",{className:N("flex items-center justify-between bg-transparent",a),...l,children:[u.jsxs("div",{className:"flex items-center gap-3",children:[u.jsx("button",{name:"close-revision-history",className:"shadow-button rounded-lg bg-gray-50 p-1 text-stone-300",onClick:o,children:u.jsx(I,{name:"VariantArrowLeft"})}),u.jsx("h1",{className:"text-xs",children:t})]}),u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsx(P5,{docId:n}),i&&u.jsx(O5,{documentState:i,onCopyState:c}),u.jsx(E5,{}),u.jsx(j5,{onChange:r,value:s})]})]})}function ht(e,t,n){let s=n.initialDeps??[],r;function o(){var a,i,c,l;let d;n.key&&((a=n.debug)!=null&&a.call(n))&&(d=Date.now());const f=e();if(!(f.length!==s.length||f.some((m,g)=>s[g]!==m)))return r;s=f;let p;if(n.key&&((i=n.debug)!=null&&i.call(n))&&(p=Date.now()),r=t(...f),n.key&&((c=n.debug)!=null&&c.call(n))){const m=Math.round((Date.now()-d)*100)/100,g=Math.round((Date.now()-p)*100)/100,v=g/16,x=(y,C)=>{for(y=String(y);y.length<C;)y=" "+y;return y};console.info(`%c⏱ ${x(g,5)} /${x(m,5)} ms`,`
|
|
42
|
+
`),n.cause&&(this.cause=n.cause),this.details=s,this.docsPath=r,this.metaMessages=n.metaMessages,this.shortMessage=t}walk(t){return Ul(this,lr,"m",Bl).call(this,this,t)}};lr=new WeakSet,Bl=function e(t,n){return n?.(t)?t:t.cause?Ul(this,lr,"m",e).call(this,t.cause,n):t};class js extends wo{constructor(){super("Chain not configured."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ChainNotConfiguredError"})}}const Is=256;let Dn=Is,kn;function Vl(e=11){if(!kn||Dn+e>Is*2){kn="",Dn=0;for(let t=0;t<Is;t++)kn+=(256+Math.random()*256|0).toString(16).substring(1)}return kn.substring(Dn,Dn+++e)}function oy(e){const{batch:t,chain:n,ccipRead:s,key:r="base",name:o="Base Client",type:a="base"}=e,i=e.experimental_blockTag??(typeof n?.experimental_preconfirmationTime=="number"?"pending":void 0),c=n?.blockTime??12e3,l=Math.min(Math.max(Math.floor(c/2),500),4e3),d=e.pollingInterval??l,f=e.cacheTime??d,h=e.account?Sr(e.account):void 0,{config:p,request:m,value:g}=e.transport({chain:n,pollingInterval:d}),v={...p,...g},x={account:h,batch:t,cacheTime:f,ccipRead:s,chain:n,key:r,name:o,pollingInterval:d,request:m,transport:v,type:a,uid:Vl(),...i?{experimental_blockTag:i}:{}};function y(C){return O=>{const w=O(C);for(const S in x)delete w[S];const E={...C,...w};return Object.assign(E,{extend:y(E)})}}return Object.assign(x,{extend:y(x)})}function ay({key:e,methods:t,name:n,request:s,retryCount:r=3,retryDelay:o=150,timeout:a,type:i},c){const l=Vl();return{config:{key:e,methods:t,name:n,request:s,retryCount:r,retryDelay:o,timeout:a,type:i},request:qv(s,{methods:t,retryCount:r,retryDelay:o,uid:l}),value:c}}class iy extends T{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 cy(e,t={}){const{batch:n,fetchFn:s,fetchOptions:r,key:o="http",methods:a,name:i="HTTP JSON-RPC",onFetchRequest:c,onFetchResponse:l,retryDelay:d,raw:f}=t;return({chain:h,retryCount:p,timeout:m})=>{const{batchSize:g=1e3,wait:v=0}=typeof n=="object"?n:{},x=t.retryCount??p,y=m??t.timeout??1e4,C=h?.rpcUrls.default.http[0];if(!C)throw new iy;const O=ry(C,{fetchFn:s,fetchOptions:r,onRequest:c,onResponse:l,timeout:y});return ay({key:o,methods:a,name:i,async request({method:w,params:E}){const S={method:w,params:E},{schedule:P}=Ml({id:C,wait:v,shouldSplitBatch(R){return R.length>g},fn:R=>O.request({body:R}),sort:(R,k)=>R.id-k.id}),j=async R=>n?P(R):[await O.request({body:R})],[{error:M,result:A}]=await j(S);if(f)return{error:M,result:A};if(M)throw new vo({body:S,error:M,url:C});return A},retryCount:x,retryDelay:d,timeout:y,type:"http"},{fetchOptions:r,url:C})}}function $a(e){return e.state.chainId}function ly(e,t){const{chainId:n,...s}=t,r=e.getClient({chainId:n});return zl(r,Vv,"getEnsAvatar")(s)}function uy(e,t){const{chainId:n,...s}=t,r=e.getClient({chainId:n});return zl(r,Hv,"getEnsName")(s)}let Yr=!1;async function dy(e,t={}){if(Yr)return[];Yr=!0,e.setState(l=>({...l,status:l.current?"reconnecting":"connecting"}));const n=[];if(t.connectors?.length)for(const l of t.connectors){let d;typeof l=="function"?d=e._internal.connectors.setup(l):d=l,n.push(d)}else n.push(...e.connectors);let s;try{s=await e.storage?.getItem("recentConnectorId")}catch{}const r={};for(const[,l]of e.state.connections)r[l.connector.id]=1;s&&(r[s]=0);const o=Object.keys(r).length>0?[...n].sort((l,d)=>(r[l.id]??10)-(r[d.id]??10)):n;let a=!1;const i=[],c=[];for(const l of o){const d=await l.getProvider().catch(()=>{});if(!d||c.some(p=>p===d)||!await l.isAuthorized())continue;const h=await l.connect({isReconnecting:!0}).catch(()=>null);h&&(l.emitter.off("connect",e._internal.events.connect),l.emitter.on("change",e._internal.events.change),l.emitter.on("disconnect",e._internal.events.disconnect),e.setState(p=>{const m=new Map(a?p.connections:new Map).set(l.uid,{accounts:h.accounts,chainId:h.chainId,connector:l});return{...p,current:a?p.current:l.uid,connections:m}}),i.push({accounts:h.accounts,chainId:h.chainId,connector:l}),c.push(d),a=!0)}return(e.state.status==="reconnecting"||e.state.status==="connecting")&&(a?e.setState(l=>({...l,status:"connected"})):e.setState(l=>({...l,connections:new Map,current:null,status:"disconnected"}))),Yr=!1,i}class ft extends wo{constructor(){super("Provider not found."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ProviderNotFoundError"})}}function fy(e,t){const{onChange:n}=t;return e.subscribe(s=>s.chainId,n)}Co.type="injected";function Co(e={}){const{shimDisconnect:t=!0,unstable_shimAsyncInject:n}=e;function s(){const c=e.target;if(typeof c=="function"){const l=c();if(l)return l}return typeof c=="object"?c:typeof c=="string"?{...hy[c]??{id:c,name:`${c[0].toUpperCase()}${c.slice(1)}`,provider:`is${c[0].toUpperCase()}${c.slice(1)}`}}:{id:"injected",name:"Injected",provider(l){return l?.ethereum}}}let r,o,a,i;return c=>({get icon(){return s().icon},get id(){return s().id},get name(){return s().name},get supportsSimulation(){return!0},type:Co.type,async setup(){const l=await this.getProvider();l?.on&&e.target&&(a||(a=this.onConnect.bind(this),l.on("connect",a)),r||(r=this.onAccountsChanged.bind(this),l.on("accountsChanged",r)))},async connect({chainId:l,isReconnecting:d,withCapabilities:f}={}){const h=await this.getProvider();if(!h)throw new ft;let p=[];if(d)p=await this.getAccounts().catch(()=>[]);else if(t)try{p=(await h.request({method:"wallet_requestPermissions",params:[{eth_accounts:{}}]}))[0]?.caveats?.[0]?.value?.map(g=>An(g)),p.length>0&&(p=await this.getAccounts())}catch(m){const g=m;if(g.code===he.code)throw new he(g);if(g.code===_e.code)throw g}try{!p?.length&&!d&&(p=(await h.request({method:"eth_requestAccounts"})).map(v=>An(v))),a&&(h.removeListener("connect",a),a=void 0),r||(r=this.onAccountsChanged.bind(this),h.on("accountsChanged",r)),o||(o=this.onChainChanged.bind(this),h.on("chainChanged",o)),i||(i=this.onDisconnect.bind(this),h.on("disconnect",i));let m=await this.getChainId();return l&&m!==l&&(m=(await this.switchChain({chainId:l}).catch(v=>{if(v.code===he.code)throw v;return{id:m}}))?.id??m),t&&await c.storage?.removeItem(`${this.id}.disconnected`),e.target||await c.storage?.setItem("injected.connected",!0),{accounts:f?p.map(g=>({address:g,capabilities:{}})):p,chainId:m}}catch(m){const g=m;throw g.code===he.code?new he(g):g.code===_e.code?new _e(g):g}},async disconnect(){const l=await this.getProvider();if(!l)throw new ft;o&&(l.removeListener("chainChanged",o),o=void 0),i&&(l.removeListener("disconnect",i),i=void 0),a||(a=this.onConnect.bind(this),l.on("connect",a));try{await $l(()=>l.request({method:"wallet_revokePermissions",params:[{eth_accounts:{}}]}),{timeout:100})}catch{}t&&await c.storage?.setItem(`${this.id}.disconnected`,!0),e.target||await c.storage?.removeItem("injected.connected")},async getAccounts(){const l=await this.getProvider();if(!l)throw new ft;return(await l.request({method:"eth_accounts"})).map(f=>An(f))},async getChainId(){const l=await this.getProvider();if(!l)throw new ft;const d=await l.request({method:"eth_chainId"});return Number(d)},async getProvider(){if(typeof window>"u")return;let l;const d=s();return typeof d.provider=="function"?l=d.provider(window):typeof d.provider=="string"?l=Yn(window,d.provider):l=d.provider,l&&!l.removeListener&&("off"in l&&typeof l.off=="function"?l.removeListener=l.off:l.removeListener=()=>{}),l},async isAuthorized(){try{if(t&&await c.storage?.getItem(`${this.id}.disconnected`)||!e.target&&!await c.storage?.getItem("injected.connected"))return!1;if(!await this.getProvider()){if(n!==void 0&&n!==!1){const h=async()=>(typeof window<"u"&&window.removeEventListener("ethereum#initialized",h),!!await this.getProvider()),p=typeof n=="number"?n:1e3;if(await Promise.race([...typeof window<"u"?[new Promise(g=>window.addEventListener("ethereum#initialized",()=>g(h()),{once:!0}))]:[],new Promise(g=>setTimeout(()=>g(h()),p))]))return!0}throw new ft}return!!(await kl(()=>this.getAccounts())).length}catch{return!1}},async switchChain({addEthereumChainParameter:l,chainId:d}){const f=await this.getProvider();if(!f)throw new ft;const h=c.chains.find(m=>m.id===d);if(!h)throw new it(new js);const p=new Promise(m=>{const g=(v=>{"chainId"in v&&v.chainId===d&&(c.emitter.off("change",g),m())});c.emitter.on("change",g)});try{return await Promise.all([f.request({method:"wallet_switchEthereumChain",params:[{chainId:J(d)}]}).then(async()=>{await this.getChainId()===d&&c.emitter.emit("change",{chainId:d})}),p]),h}catch(m){const g=m;if(g.code===4902||g?.data?.originalError?.code===4902)try{const{default:v,...x}=h.blockExplorers??{};let y;l?.blockExplorerUrls?y=l.blockExplorerUrls:v&&(y=[v.url,...Object.values(x).map(w=>w.url)]);let C;l?.rpcUrls?.length?C=l.rpcUrls:C=[h.rpcUrls.default?.http[0]??""];const O={blockExplorerUrls:y,chainId:J(d),chainName:l?.chainName??h.name,iconUrls:l?.iconUrls,nativeCurrency:l?.nativeCurrency??h.nativeCurrency,rpcUrls:C};return await Promise.all([f.request({method:"wallet_addEthereumChain",params:[O]}).then(async()=>{if(await this.getChainId()===d)c.emitter.emit("change",{chainId:d});else throw new he(new Error("User rejected switch after adding network."))}),p]),h}catch(v){throw new he(v)}throw g.code===he.code?new he(g):new it(g)}},async onAccountsChanged(l){if(l.length===0)this.onDisconnect();else if(c.emitter.listenerCount("connect")){const d=(await this.getChainId()).toString();this.onConnect({chainId:d}),t&&await c.storage?.removeItem(`${this.id}.disconnected`)}else c.emitter.emit("change",{accounts:l.map(d=>An(d))})},onChainChanged(l){const d=Number(l);c.emitter.emit("change",{chainId:d})},async onConnect(l){const d=await this.getAccounts();if(d.length===0)return;const f=Number(l.chainId);c.emitter.emit("connect",{accounts:d,chainId:f});const h=await this.getProvider();h&&(a&&(h.removeListener("connect",a),a=void 0),r||(r=this.onAccountsChanged.bind(this),h.on("accountsChanged",r)),o||(o=this.onChainChanged.bind(this),h.on("chainChanged",o)),i||(i=this.onDisconnect.bind(this),h.on("disconnect",i)))},async onDisconnect(l){const d=await this.getProvider();l&&l.code===1013&&d&&(await this.getAccounts()).length||(c.emitter.emit("disconnect"),d&&(o&&(d.removeListener("chainChanged",o),o=void 0),i&&(d.removeListener("disconnect",i),i=void 0),a||(a=this.onConnect.bind(this),d.on("connect",a))))}})}const hy={coinbaseWallet:{id:"coinbaseWallet",name:"Coinbase Wallet",provider(e){return e?.coinbaseWalletExtension?e.coinbaseWalletExtension:Yn(e,"isCoinbaseWallet")}},metaMask:{id:"metaMask",name:"MetaMask",provider(e){return Yn(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:Yn(e,"isPhantom")}}};function Yn(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 py(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 my(){const e=new Set;let t=[];const n=()=>py(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 gy=e=>(t,n,s)=>{const r=s.subscribe;return s.subscribe=(a,i,c)=>{let l=a;if(i){const d=c?.equalityFn||Object.is;let f=a(s.getState());l=h=>{const p=a(h);if(!d(f,p)){const m=f;i(f=p,m)}},c?.fireImmediately&&i(f,f)}return r(l)},e(t,n,s)},by=gy;function vy(e,t){let n;try{n=e()}catch{return}return{getItem:r=>{var o;const a=c=>c===null?null:JSON.parse(c,void 0),i=(o=n.getItem(r))!=null?o:null;return i instanceof Promise?i.then(a):a(i)},setItem:(r,o)=>n.setItem(r,JSON.stringify(o,void 0)),removeItem:r=>n.removeItem(r)}}const Ns=e=>t=>{try{const n=e(t);return n instanceof Promise?n:{then(s){return Ns(s)(n)},catch(s){return this}}}catch(n){return{then(s){return this},catch(s){return Ns(s)(n)}}}},yy=(e,t)=>(n,s,r)=>{let o={storage:vy(()=>localStorage),partialize:g=>g,version:0,merge:(g,v)=>({...v,...g}),...t},a=!1;const i=new Set,c=new Set;let l=o.storage;if(!l)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 l.setItem(o.name,{state:g,version:o.version})},f=r.setState;r.setState=(g,v)=>{f(g,v),d()};const h=e((...g)=>{n(...g),d()},s,r);r.getInitialState=()=>h;let p;const m=()=>{var g,v;if(!l)return;a=!1,i.forEach(y=>{var C;return y((C=s())!=null?C:h)});const x=((v=o.onRehydrateStorage)==null?void 0:v.call(o,(g=s())!=null?g:h))||void 0;return Ns(l.getItem.bind(l))(o.name).then(y=>{if(y)if(typeof y.version=="number"&&y.version!==o.version){if(o.migrate)return[!0,o.migrate(y.state,y.version)];console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}else return[!1,y.state];return[!1,void 0]}).then(y=>{var C;const[O,w]=y;if(p=o.merge(w,(C=s())!=null?C:h),n(p,!0),O)return d()}).then(()=>{x?.(p,void 0),p=s(),a=!0,c.forEach(y=>y(p))}).catch(y=>{x?.(void 0,y)})};return r.persist={setOptions:g=>{o={...o,...g},g.storage&&(l=g.storage)},clearStorage:()=>{l?.removeItem(o.name)},getOptions:()=>o,rehydrate:()=>m(),hasHydrated:()=>a,onHydrate:g=>(i.add(g),()=>{i.delete(g)}),onFinishHydration:g=>(c.add(g),()=>{c.delete(g)})},o.skipHydration||m(),p||h},xy=yy,za=e=>{let t;const n=new Set,s=(l,d)=>{const f=typeof l=="function"?l(t):l;if(!Object.is(f,t)){const h=t;t=d??(typeof f!="object"||f===null)?f:Object.assign({},t,f),n.forEach(p=>p(t,h))}},r=()=>t,i={setState:s,getState:r,getInitialState:()=>c,subscribe:l=>(n.add(l),()=>n.delete(l))},c=t=e(s,r,i);return i},Qr=e=>e?za(e):za;var Kr={exports:{}},Ua;function wy(){return Ua||(Ua=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(c,l,d){this.fn=c,this.context=l,this.once=d||!1}function o(c,l,d,f,h){if(typeof d!="function")throw new TypeError("The listener must be a function");var p=new r(d,f||c,h),m=n?n+l:l;return c._events[m]?c._events[m].fn?c._events[m]=[c._events[m],p]:c._events[m].push(p):(c._events[m]=p,c._eventsCount++),c}function a(c,l){--c._eventsCount===0?c._events=new s:delete c._events[l]}function i(){this._events=new s,this._eventsCount=0}i.prototype.eventNames=function(){var l=[],d,f;if(this._eventsCount===0)return l;for(f in d=this._events)t.call(d,f)&&l.push(n?f.slice(1):f);return Object.getOwnPropertySymbols?l.concat(Object.getOwnPropertySymbols(d)):l},i.prototype.listeners=function(l){var d=n?n+l:l,f=this._events[d];if(!f)return[];if(f.fn)return[f.fn];for(var h=0,p=f.length,m=new Array(p);h<p;h++)m[h]=f[h].fn;return m},i.prototype.listenerCount=function(l){var d=n?n+l:l,f=this._events[d];return f?f.fn?1:f.length:0},i.prototype.emit=function(l,d,f,h,p,m){var g=n?n+l:l;if(!this._events[g])return!1;var v=this._events[g],x=arguments.length,y,C;if(v.fn){switch(v.once&&this.removeListener(l,v.fn,void 0,!0),x){case 1:return v.fn.call(v.context),!0;case 2:return v.fn.call(v.context,d),!0;case 3:return v.fn.call(v.context,d,f),!0;case 4:return v.fn.call(v.context,d,f,h),!0;case 5:return v.fn.call(v.context,d,f,h,p),!0;case 6:return v.fn.call(v.context,d,f,h,p,m),!0}for(C=1,y=new Array(x-1);C<x;C++)y[C-1]=arguments[C];v.fn.apply(v.context,y)}else{var O=v.length,w;for(C=0;C<O;C++)switch(v[C].once&&this.removeListener(l,v[C].fn,void 0,!0),x){case 1:v[C].fn.call(v[C].context);break;case 2:v[C].fn.call(v[C].context,d);break;case 3:v[C].fn.call(v[C].context,d,f);break;case 4:v[C].fn.call(v[C].context,d,f,h);break;default:if(!y)for(w=1,y=new Array(x-1);w<x;w++)y[w-1]=arguments[w];v[C].fn.apply(v[C].context,y)}}return!0},i.prototype.on=function(l,d,f){return o(this,l,d,f,!1)},i.prototype.once=function(l,d,f){return o(this,l,d,f,!0)},i.prototype.removeListener=function(l,d,f,h){var p=n?n+l:l;if(!this._events[p])return this;if(!d)return a(this,p),this;var m=this._events[p];if(m.fn)m.fn===d&&(!h||m.once)&&(!f||m.context===f)&&a(this,p);else{for(var g=0,v=[],x=m.length;g<x;g++)(m[g].fn!==d||h&&!m[g].once||f&&m[g].context!==f)&&v.push(m[g]);v.length?this._events[p]=v.length===1?v[0]:v:a(this,p)}return this},i.prototype.removeAllListeners=function(l){var d;return l?(d=n?n+l:l,this._events[d]&&a(this,d)):(this._events=new s,this._eventsCount=0),this},i.prototype.off=i.prototype.removeListener,i.prototype.addListener=i.prototype.on,i.prefixed=n,i.EventEmitter=i,e.exports=i})(Kr)),Kr.exports}var Cy=wy();const Sy=Di(Cy);class Ey{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 Sy})}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 Py(e){return new Ey(e)}function Oy(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 Ba(e,t){return e.slice(0,t).join(".")||"."}function Va(e,t){const{length:n}=e;for(let s=0;s<n;++s)if(e[s]===t)return s+1;return 0}function jy(e,t){const n=typeof e=="function",s=typeof t=="function",r=[],o=[];return function(i,c){if(typeof c=="object")if(r.length){const l=Va(r,this);l===0?r[r.length]=this:(r.splice(l),o.splice(l)),o[o.length]=i;const d=Va(r,c);if(d!==0)return s?t.call(this,i,c,Ba(o,d)):`[ref=${Ba(o,d)}]`}else r[0]=c,o[0]=i;return n?e.call(this,i,c):c}}function Iy(e,t,n,s){return JSON.stringify(e,jy((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 Ny(e){const{deserialize:t=Oy,key:n="wagmi",serialize:s=Iy,storage:r=Hl}=e;function o(a){return a instanceof Promise?a.then(i=>i).catch(()=>null):a}return{...r,key:n,async getItem(a,i){const c=r.getItem(`${n}.${a}`),l=await o(c);return l?t(l)??null:i??null},async setItem(a,i){const c=`${n}.${a}`;i===null?await o(r.removeItem(c)):await o(r.setItem(c,s(i)))},async removeItem(a){await o(r.removeItem(`${n}.${a}`))}}}const Hl={getItem:()=>null,setItem:()=>{},removeItem:()=>{}};function My(){const e=typeof window<"u"&&window.localStorage?window.localStorage:Hl;return{getItem(t){return e.getItem(t)},removeItem(t){e.removeItem(t)},setItem(t,n){try{e.setItem(t,n)}catch{}}}}const Ms=256;let Ln=Ms,Fn;function Ty(e=11){if(!Fn||Ln+e>Ms*2){Fn="",Ln=0;for(let t=0;t<Ms;t++)Fn+=(256+Math.random()*256|0).toString(16).substring(1)}return Fn.substring(Ln,Ln+++e)}function Ay(e){const{multiInjectedProviderDiscovery:t=!0,storage:n=Ny({storage:My()}),syncConnectedChain:s=!0,ssr:r=!1,...o}=e,a=typeof window<"u"&&t?my():void 0,i=Qr(()=>o.chains),c=Qr(()=>{const w=[],E=new Set;for(const S of o.connectors??[]){const P=l(S);if(w.push(P),!r&&P.rdns){const j=typeof P.rdns=="string"?[P.rdns]:P.rdns;for(const M of j)E.add(M)}}if(!r&&a){const S=a.getProviders();for(const P of S)E.has(P.info.rdns)||w.push(l(d(P)))}return w});function l(w){const E=Py(Ty()),S={...w({emitter:E,chains:i.getState(),storage:n,transports:o.transports}),emitter:E,uid:E.uid};return E.on("connect",C),S.setup?.(),S}function d(w){const{info:E}=w,S=w.provider;return Co({target:{...E,id:E.rdns,provider:S}})}const f=new Map;function h(w={}){const E=w.chainId??v.getState().chainId,S=i.getState().find(j=>j.id===E);if(w.chainId&&!S)throw new js;{const j=f.get(v.getState().chainId);if(j&&!S)return j;if(!S)throw new js}{const j=f.get(E);if(j)return j}let P;if(o.client)P=o.client({chain:S});else{const j=S.id,M=i.getState().map(k=>k.id),A={},R=Object.entries(o);for(const[k,z]of R)if(!(k==="chains"||k==="client"||k==="connectors"||k==="transports"))if(typeof z=="object")if(j in z)A[k]=z[j];else{if(M.some(B=>B in z))continue;A[k]=z}else A[k]=z;P=oy({...A,chain:S,batch:A.batch??{multicall:!0},transport:k=>o.transports[j]({...k,connectors:c})})}return f.set(E,P),P}function p(){return{chainId:i.getState()[0].id,connections:new Map,current:null,status:"disconnected"}}let m;const g="0.0.0-canary-";qn.startsWith(g)?m=Number.parseInt(qn.replace(g,""),10):m=Number.parseInt(qn.split(".")[0]??"0",10);const v=Qr(by(n?xy(p,{migrate(w,E){if(E===m)return w;const S=p(),P=x(w,S.chainId);return{...S,chainId:P}},name:"store",partialize(w){return{connections:{__type:"Map",value:Array.from(w.connections.entries()).map(([E,S])=>{const{id:P,name:j,type:M,uid:A}=S.connector;return[E,{...S,connector:{id:P,name:j,type:M,uid:A}}]})},chainId:w.chainId,current:w.current}},merge(w,E){typeof w=="object"&&w&&"status"in w&&delete w.status;const S=x(w,E.chainId);return{...E,...w,chainId:S}},skipHydration:r,storage:n,version:m}):p));v.setState(p());function x(w,E){return w&&typeof w=="object"&&"chainId"in w&&typeof w.chainId=="number"&&i.getState().some(S=>S.id===w.chainId)?w.chainId:E}s&&v.subscribe(({connections:w,current:E})=>E?w.get(E)?.chainId:void 0,w=>{if(i.getState().some(S=>S.id===w))return v.setState(S=>({...S,chainId:w??S.chainId}))}),a?.subscribe(w=>{const E=new Set,S=new Set;for(const j of c.getState())if(E.add(j.id),j.rdns){const M=typeof j.rdns=="string"?[j.rdns]:j.rdns;for(const A of M)S.add(A)}const P=[];for(const j of w){if(S.has(j.info.rdns))continue;const M=l(d(j));E.has(M.id)||P.push(M)}n&&!v.persist.hasHydrated()||c.setState(j=>[...j,...P],!0)});function y(w){v.setState(E=>{const S=E.connections.get(w.uid);return S?{...E,connections:new Map(E.connections).set(w.uid,{accounts:w.accounts??S.accounts,chainId:w.chainId??S.chainId,connector:S.connector})}:E})}function C(w){v.getState().status==="connecting"||v.getState().status==="reconnecting"||v.setState(E=>{const S=c.getState().find(P=>P.uid===w.uid);return S?(S.emitter.listenerCount("connect")&&S.emitter.off("connect",y),S.emitter.listenerCount("change")||S.emitter.on("change",y),S.emitter.listenerCount("disconnect")||S.emitter.on("disconnect",O),{...E,connections:new Map(E.connections).set(w.uid,{accounts:w.accounts,chainId:w.chainId,connector:S}),current:w.uid,status:"connected"}):E})}function O(w){v.setState(E=>{const S=E.connections.get(w.uid);if(S){const j=S.connector;j.emitter.listenerCount("change")&&S.connector.emitter.off("change",y),j.emitter.listenerCount("disconnect")&&S.connector.emitter.off("disconnect",O),j.emitter.listenerCount("connect")||S.connector.emitter.on("connect",C)}if(E.connections.delete(w.uid),E.connections.size===0)return{...E,connections:new Map,current:null,status:"disconnected"};const P=E.connections.values().next().value;return{...E,connections:new Map(E.connections),current:P.connector.uid}})}return{get chains(){return i.getState()},get connectors(){return c.getState()},storage:n,getClient:h,get state(){return v.getState()},setState(w){let E;typeof w=="function"?E=w(v.getState()):E=w;const S=p();typeof E!="object"&&(E=S),Object.keys(S).some(j=>!(j in E))&&(E=S),v.setState(E,!0)},subscribe(w,E,S){return v.subscribe(w,E,S?{...S,fireImmediately:S.emitImmediately}:void 0)},_internal:{mipd:a,async revalidate(){const w=v.getState(),E=w.connections;let S=w.current;for(const[,P]of E){const j=P.connector;j.isAuthorized&&await j.isAuthorized()||(E.delete(j.uid),S===j.uid&&(S=null))}v.setState(P=>({...P,connections:E,current:S}))},store:v,ssr:!!r,syncConnectedChain:s,transports:o.transports,chains:{setState(w){const E=typeof w=="function"?w(i.getState()):w;if(E.length!==0)return i.setState(E,!0)},subscribe(w){return i.subscribe(w)}},connectors:{providerDetailToConnector:d,setup:l,setState(w){return c.setState(typeof w=="function"?w(c.getState()):w,!0)},subscribe(w){return c.subscribe(w)}},events:{change:y,connect:C,disconnect:O}}}}function Ry(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 c of r??[])if(c.rdns){const l=Array.isArray(c.rdns)?c.rdns:[c.rdns];for(const d of l)o.add(d)}const a=[],i=e._internal.mipd?.getProviders()??[];for(const c of i){if(o.has(c.info.rdns))continue;const l=e._internal.connectors.providerDetailToConnector(c),d=e._internal.connectors.setup(l);a.push(d)}return[...r,...a]})),s?dy(e):e.storage&&e.setState(r=>({...r,connections:new Map}))}}}function Dy(e){const{children:t,config:n,initialState:s,reconnectOnMount:r=!0}=e,{onMount:o}=Ry(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 ky(e){const{children:t,config:n}=e,s={value:n};return b.createElement(Dy,e,b.createElement(_l.Provider,s,t))}const Ly="2.19.2",Fy=()=>`wagmi@${Ly}`;class $y extends wo{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 Fy()}}class zy extends $y{constructor(){super("`useConfig` must be used within `WagmiProvider`.",{docsPath:"/api/WagmiProvider"}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"WagmiProviderNotFoundError"})}}function So(e={}){const t=e.config??b.useContext(_l);if(!t)throw new zy;return t}var Cn=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},Uy={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},By=class{#e=Uy;#t=!1;setTimeoutProvider(e){this.#e=e}setTimeout(e,t){return this.#e.setTimeout(e,t)}clearTimeout(e){this.#e.clearTimeout(e)}setInterval(e,t){return this.#e.setInterval(e,t)}clearInterval(e){this.#e.clearInterval(e)}},Xe=new By;function Vy(e){setTimeout(e,0)}var ct=typeof window>"u"||"Deno"in globalThis;function me(){}function Hy(e,t){return typeof e=="function"?e(t):e}function Ts(e){return typeof e=="number"&&e>=0&&e!==1/0}function Wl(e,t){return Math.max(e+(t||0)-Date.now(),0)}function We(e,t){return typeof e=="function"?e(t):e}function we(e,t){return typeof e=="function"?e(t):e}function Ha(e,t){const{type:n="all",exact:s,fetchStatus:r,predicate:o,queryKey:a,stale:i}=e;if(a){if(s){if(t.queryHash!==Eo(a,t.options))return!1}else if(!fn(t.queryKey,a))return!1}if(n!=="all"){const c=t.isActive();if(n==="active"&&!c||n==="inactive"&&c)return!1}return!(typeof i=="boolean"&&t.isStale()!==i||r&&r!==t.state.fetchStatus||o&&!o(t))}function _a(e,t){const{exact:n,status:s,predicate:r,mutationKey:o}=e;if(o){if(!t.options.mutationKey)return!1;if(n){if(dn(t.options.mutationKey)!==dn(o))return!1}else if(!fn(t.options.mutationKey,o))return!1}return!(s&&t.state.status!==s||r&&!r(t))}function Eo(e,t){return(t?.queryKeyHashFn||dn)(e)}function dn(e){return JSON.stringify(e,(t,n)=>Rs(n)?Object.keys(n).sort().reduce((s,r)=>(s[r]=n[r],s),{}):n)}function fn(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?Object.keys(t).every(n=>fn(e[n],t[n])):!1}var _y=Object.prototype.hasOwnProperty;function Gl(e,t){if(e===t)return e;const n=Wa(e)&&Wa(t);if(!n&&!(Rs(e)&&Rs(t)))return t;const r=(n?e:Object.keys(e)).length,o=n?t:Object.keys(t),a=o.length,i=n?new Array(a):{};let c=0;for(let l=0;l<a;l++){const d=n?l:o[l],f=e[d],h=t[d];if(f===h){i[d]=f,(n?l<r:_y.call(e,d))&&c++;continue}if(f===null||h===null||typeof f!="object"||typeof h!="object"){i[d]=h;continue}const p=Gl(f,h);i[d]=p,p===f&&c++}return r===a&&c===r?e:i}function As(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(const n in e)if(e[n]!==t[n])return!1;return!0}function Wa(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function Rs(e){if(!Ga(e))return!1;const t=e.constructor;if(t===void 0)return!0;const n=t.prototype;return!(!Ga(n)||!n.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function Ga(e){return Object.prototype.toString.call(e)==="[object Object]"}function Wy(e){return new Promise(t=>{Xe.setTimeout(t,e)})}function Ds(e,t,n){return typeof n.structuralSharing=="function"?n.structuralSharing(e,t):n.structuralSharing!==!1?Gl(e,t):t}function Gy(e,t,n=0){const s=[...e,t];return n&&s.length>n?s.slice(1):s}function qy(e,t,n=0){const s=[t,...e];return n&&s.length>n?s.slice(0,-1):s}var Po=Symbol();function ql(e,t){return!e.queryFn&&t?.initialPromise?()=>t.initialPromise:!e.queryFn||e.queryFn===Po?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function Yy(e,t){return typeof e=="function"?e(...t):!!e}var Qy=class extends Cn{#e;#t;#n;constructor(){super(),this.#n=e=>{if(!ct&&window.addEventListener){const t=()=>e();return window.addEventListener("visibilitychange",t,!1),()=>{window.removeEventListener("visibilitychange",t)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(t=>{typeof t=="boolean"?this.setFocused(t):this.onFocus()})}setFocused(e){this.#e!==e&&(this.#e=e,this.onFocus())}onFocus(){const e=this.isFocused();this.listeners.forEach(t=>{t(e)})}isFocused(){return typeof this.#e=="boolean"?this.#e:globalThis.document?.visibilityState!=="hidden"}},Oo=new Qy;function ks(){let e,t;const n=new Promise((r,o)=>{e=r,t=o});n.status="pending",n.catch(()=>{});function s(r){Object.assign(n,r),delete n.resolve,delete n.reject}return n.resolve=r=>{s({status:"fulfilled",value:r}),e(r)},n.reject=r=>{s({status:"rejected",reason:r}),t(r)},n}var Ky=Vy;function Jy(){let e=[],t=0,n=i=>{i()},s=i=>{i()},r=Ky;const o=i=>{t?e.push(i):r(()=>{n(i)})},a=()=>{const i=e;e=[],i.length&&r(()=>{s(()=>{i.forEach(c=>{n(c)})})})};return{batch:i=>{let c;t++;try{c=i()}finally{t--,t||a()}return c},batchCalls:i=>(...c)=>{o(()=>{i(...c)})},schedule:o,setNotifyFunction:i=>{n=i},setBatchNotifyFunction:i=>{s=i},setScheduler:i=>{r=i}}}var ue=Jy(),Xy=class extends Cn{#e=!0;#t;#n;constructor(){super(),this.#n=e=>{if(!ct&&window.addEventListener){const t=()=>e(!0),n=()=>e(!1);return window.addEventListener("online",t,!1),window.addEventListener("offline",n,!1),()=>{window.removeEventListener("online",t),window.removeEventListener("offline",n)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(this.setOnline.bind(this))}setOnline(e){this.#e!==e&&(this.#e=e,this.listeners.forEach(n=>{n(e)}))}isOnline(){return this.#e}},ur=new Xy;function Zy(e){return Math.min(1e3*2**e,3e4)}function Yl(e){return(e??"online")==="online"?ur.isOnline():!0}var Ls=class extends Error{constructor(e){super("CancelledError"),this.revert=e?.revert,this.silent=e?.silent}};function Ql(e){let t=!1,n=0,s;const r=ks(),o=()=>r.status!=="pending",a=g=>{if(!o()){const v=new Ls(g);h(v),e.onCancel?.(v)}},i=()=>{t=!0},c=()=>{t=!1},l=()=>Oo.isFocused()&&(e.networkMode==="always"||ur.isOnline())&&e.canRun(),d=()=>Yl(e.networkMode)&&e.canRun(),f=g=>{o()||(s?.(),r.resolve(g))},h=g=>{o()||(s?.(),r.reject(g))},p=()=>new Promise(g=>{s=v=>{(o()||l())&&g(v)},e.onPause?.()}).then(()=>{s=void 0,o()||e.onContinue?.()}),m=()=>{if(o())return;let g;const v=n===0?e.initialPromise:void 0;try{g=v??e.fn()}catch(x){g=Promise.reject(x)}Promise.resolve(g).then(f).catch(x=>{if(o())return;const y=e.retry??(ct?0:3),C=e.retryDelay??Zy,O=typeof C=="function"?C(n,x):C,w=y===!0||typeof y=="number"&&n<y||typeof y=="function"&&y(n,x);if(t||!w){h(x);return}n++,e.onFail?.(n,x),Wy(O).then(()=>l()?void 0:p()).then(()=>{t?h(x):m()})})};return{promise:r,status:()=>r.status,cancel:a,continue:()=>(s?.(),r),cancelRetry:i,continueRetry:c,canStart:d,start:()=>(d()?m():p().then(m),r)}}var Kl=class{#e;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),Ts(this.gcTime)&&(this.#e=Xe.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(ct?1/0:300*1e3))}clearGcTimeout(){this.#e&&(Xe.clearTimeout(this.#e),this.#e=void 0)}},ex=class extends Kl{#e;#t;#n;#s;#r;#i;#a;constructor(e){super(),this.#a=!1,this.#i=e.defaultOptions,this.setOptions(e.options),this.observers=[],this.#s=e.client,this.#n=this.#s.getQueryCache(),this.queryKey=e.queryKey,this.queryHash=e.queryHash,this.#e=Ya(this.options),this.state=e.state??this.#e,this.scheduleGc()}get meta(){return this.options.meta}get promise(){return this.#r?.promise}setOptions(e){if(this.options={...this.#i,...e},this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const t=Ya(this.options);t.data!==void 0&&(this.setState(qa(t.data,t.dataUpdatedAt)),this.#e=t)}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&this.#n.remove(this)}setData(e,t){const n=Ds(this.state.data,e,this.options);return this.#o({data:n,type:"success",dataUpdatedAt:t?.updatedAt,manual:t?.manual}),n}setState(e,t){this.#o({type:"setState",state:e,setStateOptions:t})}cancel(e){const t=this.#r?.promise;return this.#r?.cancel(e),t?t.then(me).catch(me):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(this.#e)}isActive(){return this.observers.some(e=>we(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===Po||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStatic(){return this.getObserversCount()>0?this.observers.some(e=>We(e.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(e=>e.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(e=0){return this.state.data===void 0?!0:e==="static"?!1:this.state.isInvalidated?!0:!Wl(this.state.dataUpdatedAt,e)}onFocus(){this.observers.find(t=>t.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:!1}),this.#r?.continue()}onOnline(){this.observers.find(t=>t.shouldFetchOnReconnect())?.refetch({cancelRefetch:!1}),this.#r?.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),this.#n.notify({type:"observerAdded",query:this,observer:e}))}removeObserver(e){this.observers.includes(e)&&(this.observers=this.observers.filter(t=>t!==e),this.observers.length||(this.#r&&(this.#a?this.#r.cancel({revert:!0}):this.#r.cancelRetry()),this.scheduleGc()),this.#n.notify({type:"observerRemoved",query:this,observer:e}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||this.#o({type:"invalidate"})}async fetch(e,t){if(this.state.fetchStatus!=="idle"&&this.#r?.status()!=="rejected"){if(this.state.data!==void 0&&t?.cancelRefetch)this.cancel({silent:!0});else if(this.#r)return this.#r.continueRetry(),this.#r.promise}if(e&&this.setOptions(e),!this.options.queryFn){const i=this.observers.find(c=>c.options.queryFn);i&&this.setOptions(i.options)}const n=new AbortController,s=i=>{Object.defineProperty(i,"signal",{enumerable:!0,get:()=>(this.#a=!0,n.signal)})},r=()=>{const i=ql(this.options,t),l=(()=>{const d={client:this.#s,queryKey:this.queryKey,meta:this.meta};return s(d),d})();return this.#a=!1,this.options.persister?this.options.persister(i,l,this):i(l)},a=(()=>{const i={fetchOptions:t,options:this.options,queryKey:this.queryKey,client:this.#s,state:this.state,fetchFn:r};return s(i),i})();this.options.behavior?.onFetch(a,this),this.#t=this.state,(this.state.fetchStatus==="idle"||this.state.fetchMeta!==a.fetchOptions?.meta)&&this.#o({type:"fetch",meta:a.fetchOptions?.meta}),this.#r=Ql({initialPromise:t?.initialPromise,fn:a.fetchFn,onCancel:i=>{i instanceof Ls&&i.revert&&this.setState({...this.#t,fetchStatus:"idle"}),n.abort()},onFail:(i,c)=>{this.#o({type:"failed",failureCount:i,error:c})},onPause:()=>{this.#o({type:"pause"})},onContinue:()=>{this.#o({type:"continue"})},retry:a.options.retry,retryDelay:a.options.retryDelay,networkMode:a.options.networkMode,canRun:()=>!0});try{const i=await this.#r.start();if(i===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(i),this.#n.config.onSuccess?.(i,this),this.#n.config.onSettled?.(i,this.state.error,this),i}catch(i){if(i instanceof Ls){if(i.silent)return this.#r.promise;if(i.revert){if(this.state.data===void 0)throw i;return this.state.data}}throw this.#o({type:"error",error:i}),this.#n.config.onError?.(i,this),this.#n.config.onSettled?.(this.state.data,i,this),i}finally{this.scheduleGc()}}#o(e){const t=n=>{switch(e.type){case"failed":return{...n,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case"pause":return{...n,fetchStatus:"paused"};case"continue":return{...n,fetchStatus:"fetching"};case"fetch":return{...n,...Jl(n.data,this.options),fetchMeta:e.meta??null};case"success":const s={...n,...qa(e.data,e.dataUpdatedAt),dataUpdateCount:n.dataUpdateCount+1,...!e.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return this.#t=e.manual?s:void 0,s;case"error":const r=e.error;return{...n,error:r,errorUpdateCount:n.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:n.fetchFailureCount+1,fetchFailureReason:r,fetchStatus:"idle",status:"error"};case"invalidate":return{...n,isInvalidated:!0};case"setState":return{...n,...e.state}}};this.state=t(this.state),ue.batch(()=>{this.observers.forEach(n=>{n.onQueryUpdate()}),this.#n.notify({query:this,type:"updated",action:e})})}};function Jl(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:Yl(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function qa(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:"success"}}function Ya(e){const t=typeof e.initialData=="function"?e.initialData():e.initialData,n=t!==void 0,s=n?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?s??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?"success":"pending",fetchStatus:"idle"}}var tx=class extends Cn{constructor(e,t){super(),this.options=t,this.#e=e,this.#o=null,this.#a=ks(),this.bindMethods(),this.setOptions(t)}#e;#t=void 0;#n=void 0;#s=void 0;#r;#i;#a;#o;#m;#f;#h;#l;#u;#c;#p=new Set;bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(this.#t.addObserver(this),Qa(this.#t,this.options)?this.#d():this.updateResult(),this.#y())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return Fs(this.#t,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return Fs(this.#t,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#x(),this.#w(),this.#t.removeObserver(this)}setOptions(e){const t=this.options,n=this.#t;if(this.options=this.#e.defaultQueryOptions(e),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof we(this.options.enabled,this.#t)!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");this.#C(),this.#t.setOptions(this.options),t._defaulted&&!As(this.options,t)&&this.#e.getQueryCache().notify({type:"observerOptionsUpdated",query:this.#t,observer:this});const s=this.hasListeners();s&&Ka(this.#t,n,this.options,t)&&this.#d(),this.updateResult(),s&&(this.#t!==n||we(this.options.enabled,this.#t)!==we(t.enabled,this.#t)||We(this.options.staleTime,this.#t)!==We(t.staleTime,this.#t))&&this.#g();const r=this.#b();s&&(this.#t!==n||we(this.options.enabled,this.#t)!==we(t.enabled,this.#t)||r!==this.#c)&&this.#v(r)}getOptimisticResult(e){const t=this.#e.getQueryCache().build(this.#e,e),n=this.createResult(t,e);return rx(this,n)&&(this.#s=n,this.#i=this.options,this.#r=this.#t.state),n}getCurrentResult(){return this.#s}trackResult(e,t){return new Proxy(e,{get:(n,s)=>(this.trackProp(s),t?.(s),s==="promise"&&(this.trackProp("data"),!this.options.experimental_prefetchInRender&&this.#a.status==="pending"&&this.#a.reject(new Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(n,s))})}trackProp(e){this.#p.add(e)}getCurrentQuery(){return this.#t}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){const t=this.#e.defaultQueryOptions(e),n=this.#e.getQueryCache().build(this.#e,t);return n.fetch().then(()=>this.createResult(n,t))}fetch(e){return this.#d({...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#s))}#d(e){this.#C();let t=this.#t.fetch(this.options,e);return e?.throwOnError||(t=t.catch(me)),t}#g(){this.#x();const e=We(this.options.staleTime,this.#t);if(ct||this.#s.isStale||!Ts(e))return;const n=Wl(this.#s.dataUpdatedAt,e)+1;this.#l=Xe.setTimeout(()=>{this.#s.isStale||this.updateResult()},n)}#b(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(this.#t):this.options.refetchInterval)??!1}#v(e){this.#w(),this.#c=e,!(ct||we(this.options.enabled,this.#t)===!1||!Ts(this.#c)||this.#c===0)&&(this.#u=Xe.setInterval(()=>{(this.options.refetchIntervalInBackground||Oo.isFocused())&&this.#d()},this.#c))}#y(){this.#g(),this.#v(this.#b())}#x(){this.#l&&(Xe.clearTimeout(this.#l),this.#l=void 0)}#w(){this.#u&&(Xe.clearInterval(this.#u),this.#u=void 0)}createResult(e,t){const n=this.#t,s=this.options,r=this.#s,o=this.#r,a=this.#i,c=e!==n?e.state:this.#n,{state:l}=e;let d={...l},f=!1,h;if(t._optimisticResults){const P=this.hasListeners(),j=!P&&Qa(e,t),M=P&&Ka(e,n,t,s);(j||M)&&(d={...d,...Jl(l.data,e.options)}),t._optimisticResults==="isRestoring"&&(d.fetchStatus="idle")}let{error:p,errorUpdatedAt:m,status:g}=d;h=d.data;let v=!1;if(t.placeholderData!==void 0&&h===void 0&&g==="pending"){let P;r?.isPlaceholderData&&t.placeholderData===a?.placeholderData?(P=r.data,v=!0):P=typeof t.placeholderData=="function"?t.placeholderData(this.#h?.state.data,this.#h):t.placeholderData,P!==void 0&&(g="success",h=Ds(r?.data,P,t),f=!0)}if(t.select&&h!==void 0&&!v)if(r&&h===o?.data&&t.select===this.#m)h=this.#f;else try{this.#m=t.select,h=t.select(h),h=Ds(r?.data,h,t),this.#f=h,this.#o=null}catch(P){this.#o=P}this.#o&&(p=this.#o,h=this.#f,m=Date.now(),g="error");const x=d.fetchStatus==="fetching",y=g==="pending",C=g==="error",O=y&&x,w=h!==void 0,S={status:g,fetchStatus:d.fetchStatus,isPending:y,isSuccess:g==="success",isError:C,isInitialLoading:O,isLoading:O,data:h,dataUpdatedAt:d.dataUpdatedAt,error:p,errorUpdatedAt:m,failureCount:d.fetchFailureCount,failureReason:d.fetchFailureReason,errorUpdateCount:d.errorUpdateCount,isFetched:d.dataUpdateCount>0||d.errorUpdateCount>0,isFetchedAfterMount:d.dataUpdateCount>c.dataUpdateCount||d.errorUpdateCount>c.errorUpdateCount,isFetching:x,isRefetching:x&&!y,isLoadingError:C&&!w,isPaused:d.fetchStatus==="paused",isPlaceholderData:f,isRefetchError:C&&w,isStale:jo(e,t),refetch:this.refetch,promise:this.#a,isEnabled:we(t.enabled,e)!==!1};if(this.options.experimental_prefetchInRender){const P=A=>{S.status==="error"?A.reject(S.error):S.data!==void 0&&A.resolve(S.data)},j=()=>{const A=this.#a=S.promise=ks();P(A)},M=this.#a;switch(M.status){case"pending":e.queryHash===n.queryHash&&P(M);break;case"fulfilled":(S.status==="error"||S.data!==M.value)&&j();break;case"rejected":(S.status!=="error"||S.error!==M.reason)&&j();break}}return S}updateResult(){const e=this.#s,t=this.createResult(this.#t,this.options);if(this.#r=this.#t.state,this.#i=this.options,this.#r.data!==void 0&&(this.#h=this.#t),As(t,e))return;this.#s=t;const n=()=>{if(!e)return!0;const{notifyOnChangeProps:s}=this.options,r=typeof s=="function"?s():s;if(r==="all"||!r&&!this.#p.size)return!0;const o=new Set(r??this.#p);return this.options.throwOnError&&o.add("error"),Object.keys(this.#s).some(a=>{const i=a;return this.#s[i]!==e[i]&&o.has(i)})};this.#S({listeners:n()})}#C(){const e=this.#e.getQueryCache().build(this.#e,this.options);if(e===this.#t)return;const t=this.#t;this.#t=e,this.#n=e.state,this.hasListeners()&&(t?.removeObserver(this),e.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#y()}#S(e){ue.batch(()=>{e.listeners&&this.listeners.forEach(t=>{t(this.#s)}),this.#e.getQueryCache().notify({query:this.#t,type:"observerResultsUpdated"})})}};function nx(e,t){return we(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&t.retryOnMount===!1)}function Qa(e,t){return nx(e,t)||e.state.data!==void 0&&Fs(e,t,t.refetchOnMount)}function Fs(e,t,n){if(we(t.enabled,e)!==!1&&We(t.staleTime,e)!=="static"){const s=typeof n=="function"?n(e):n;return s==="always"||s!==!1&&jo(e,t)}return!1}function Ka(e,t,n,s){return(e!==t||we(s.enabled,e)===!1)&&(!n.suspense||e.state.status!=="error")&&jo(e,n)}function jo(e,t){return we(t.enabled,e)!==!1&&e.isStaleByTime(We(t.staleTime,e))}function rx(e,t){return!As(e.getCurrentResult(),t)}function Ja(e){return{onFetch:(t,n)=>{const s=t.options,r=t.fetchOptions?.meta?.fetchMore?.direction,o=t.state.data?.pages||[],a=t.state.data?.pageParams||[];let i={pages:[],pageParams:[]},c=0;const l=async()=>{let d=!1;const f=m=>{Object.defineProperty(m,"signal",{enumerable:!0,get:()=>(t.signal.aborted?d=!0:t.signal.addEventListener("abort",()=>{d=!0}),t.signal)})},h=ql(t.options,t.fetchOptions),p=async(m,g,v)=>{if(d)return Promise.reject();if(g==null&&m.pages.length)return Promise.resolve(m);const y=(()=>{const E={client:t.client,queryKey:t.queryKey,pageParam:g,direction:v?"backward":"forward",meta:t.options.meta};return f(E),E})(),C=await h(y),{maxPages:O}=t.options,w=v?qy:Gy;return{pages:w(m.pages,C,O),pageParams:w(m.pageParams,g,O)}};if(r&&o.length){const m=r==="backward",g=m?sx:Xa,v={pages:o,pageParams:a},x=g(s,v);i=await p(v,x,m)}else{const m=e??o.length;do{const g=c===0?a[0]??s.initialPageParam:Xa(s,i);if(c>0&&g==null)break;i=await p(i,g),c++}while(c<m)}return i};t.options.persister?t.fetchFn=()=>t.options.persister?.(l,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n):t.fetchFn=l}}}function Xa(e,{pages:t,pageParams:n}){const s=t.length-1;return t.length>0?e.getNextPageParam(t[s],t,n[s],n):void 0}function sx(e,{pages:t,pageParams:n}){return t.length>0?e.getPreviousPageParam?.(t[0],t,n[0],n):void 0}var ox=class extends Kl{#e;#t;#n;#s;constructor(e){super(),this.#e=e.client,this.mutationId=e.mutationId,this.#n=e.mutationCache,this.#t=[],this.state=e.state||ax(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){this.#t.includes(e)||(this.#t.push(e),this.clearGcTimeout(),this.#n.notify({type:"observerAdded",mutation:this,observer:e}))}removeObserver(e){this.#t=this.#t.filter(t=>t!==e),this.scheduleGc(),this.#n.notify({type:"observerRemoved",mutation:this,observer:e})}optionalRemove(){this.#t.length||(this.state.status==="pending"?this.scheduleGc():this.#n.remove(this))}continue(){return this.#s?.continue()??this.execute(this.state.variables)}async execute(e){const t=()=>{this.#r({type:"continue"})},n={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};this.#s=Ql({fn:()=>this.options.mutationFn?this.options.mutationFn(e,n):Promise.reject(new Error("No mutationFn found")),onFail:(o,a)=>{this.#r({type:"failed",failureCount:o,error:a})},onPause:()=>{this.#r({type:"pause"})},onContinue:t,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#n.canRun(this)});const s=this.state.status==="pending",r=!this.#s.canStart();try{if(s)t();else{this.#r({type:"pending",variables:e,isPaused:r}),await this.#n.config.onMutate?.(e,this,n);const a=await this.options.onMutate?.(e,n);a!==this.state.context&&this.#r({type:"pending",context:a,variables:e,isPaused:r})}const o=await this.#s.start();return await this.#n.config.onSuccess?.(o,e,this.state.context,this,n),await this.options.onSuccess?.(o,e,this.state.context,n),await this.#n.config.onSettled?.(o,null,this.state.variables,this.state.context,this,n),await this.options.onSettled?.(o,null,e,this.state.context,n),this.#r({type:"success",data:o}),o}catch(o){try{throw await this.#n.config.onError?.(o,e,this.state.context,this,n),await this.options.onError?.(o,e,this.state.context,n),await this.#n.config.onSettled?.(void 0,o,this.state.variables,this.state.context,this,n),await this.options.onSettled?.(void 0,o,e,this.state.context,n),o}finally{this.#r({type:"error",error:o})}}finally{this.#n.runNext(this)}}#r(e){const t=n=>{switch(e.type){case"failed":return{...n,failureCount:e.failureCount,failureReason:e.error};case"pause":return{...n,isPaused:!0};case"continue":return{...n,isPaused:!1};case"pending":return{...n,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:"pending",variables:e.variables,submittedAt:Date.now()};case"success":return{...n,data:e.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...n,data:void 0,error:e.error,failureCount:n.failureCount+1,failureReason:e.error,isPaused:!1,status:"error"}}};this.state=t(this.state),ue.batch(()=>{this.#t.forEach(n=>{n.onMutationUpdate(e)}),this.#n.notify({mutation:this,type:"updated",action:e})})}};function ax(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var ix=class extends Cn{constructor(e={}){super(),this.config=e,this.#e=new Set,this.#t=new Map,this.#n=0}#e;#t;#n;build(e,t,n){const s=new ox({client:e,mutationCache:this,mutationId:++this.#n,options:e.defaultMutationOptions(t),state:n});return this.add(s),s}add(e){this.#e.add(e);const t=$n(e);if(typeof t=="string"){const n=this.#t.get(t);n?n.push(e):this.#t.set(t,[e])}this.notify({type:"added",mutation:e})}remove(e){if(this.#e.delete(e)){const t=$n(e);if(typeof t=="string"){const n=this.#t.get(t);if(n)if(n.length>1){const s=n.indexOf(e);s!==-1&&n.splice(s,1)}else n[0]===e&&this.#t.delete(t)}}this.notify({type:"removed",mutation:e})}canRun(e){const t=$n(e);if(typeof t=="string"){const s=this.#t.get(t)?.find(r=>r.state.status==="pending");return!s||s===e}else return!0}runNext(e){const t=$n(e);return typeof t=="string"?this.#t.get(t)?.find(s=>s!==e&&s.state.isPaused)?.continue()??Promise.resolve():Promise.resolve()}clear(){ue.batch(()=>{this.#e.forEach(e=>{this.notify({type:"removed",mutation:e})}),this.#e.clear(),this.#t.clear()})}getAll(){return Array.from(this.#e)}find(e){const t={exact:!0,...e};return this.getAll().find(n=>_a(t,n))}findAll(e={}){return this.getAll().filter(t=>_a(e,t))}notify(e){ue.batch(()=>{this.listeners.forEach(t=>{t(e)})})}resumePausedMutations(){const e=this.getAll().filter(t=>t.state.isPaused);return ue.batch(()=>Promise.all(e.map(t=>t.continue().catch(me))))}};function $n(e){return e.options.scope?.id}var cx=class extends Cn{constructor(e={}){super(),this.config=e,this.#e=new Map}#e;build(e,t,n){const s=t.queryKey,r=t.queryHash??Eo(s,t);let o=this.get(r);return o||(o=new ex({client:e,queryKey:s,queryHash:r,options:e.defaultQueryOptions(t),state:n,defaultOptions:e.getQueryDefaults(s)}),this.add(o)),o}add(e){this.#e.has(e.queryHash)||(this.#e.set(e.queryHash,e),this.notify({type:"added",query:e}))}remove(e){const t=this.#e.get(e.queryHash);t&&(e.destroy(),t===e&&this.#e.delete(e.queryHash),this.notify({type:"removed",query:e}))}clear(){ue.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return this.#e.get(e)}getAll(){return[...this.#e.values()]}find(e){const t={exact:!0,...e};return this.getAll().find(n=>Ha(t,n))}findAll(e={}){const t=this.getAll();return Object.keys(e).length>0?t.filter(n=>Ha(e,n)):t}notify(e){ue.batch(()=>{this.listeners.forEach(t=>{t(e)})})}onFocus(){ue.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){ue.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},lx=class{#e;#t;#n;#s;#r;#i;#a;#o;constructor(e={}){this.#e=e.queryCache||new cx,this.#t=e.mutationCache||new ix,this.#n=e.defaultOptions||{},this.#s=new Map,this.#r=new Map,this.#i=0}mount(){this.#i++,this.#i===1&&(this.#a=Oo.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onFocus())}),this.#o=ur.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onOnline())}))}unmount(){this.#i--,this.#i===0&&(this.#a?.(),this.#a=void 0,this.#o?.(),this.#o=void 0)}isFetching(e){return this.#e.findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return this.#t.findAll({...e,status:"pending"}).length}getQueryData(e){const t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state.data}ensureQueryData(e){const t=this.defaultQueryOptions(e),n=this.#e.build(this,t),s=n.state.data;return s===void 0?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime(We(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(s))}getQueriesData(e){return this.#e.findAll(e).map(({queryKey:t,state:n})=>{const s=n.data;return[t,s]})}setQueryData(e,t,n){const s=this.defaultQueryOptions({queryKey:e}),o=this.#e.get(s.queryHash)?.state.data,a=Hy(t,o);if(a!==void 0)return this.#e.build(this,s).setData(a,{...n,manual:!0})}setQueriesData(e,t,n){return ue.batch(()=>this.#e.findAll(e).map(({queryKey:s})=>[s,this.setQueryData(s,t,n)]))}getQueryState(e){const t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state}removeQueries(e){const t=this.#e;ue.batch(()=>{t.findAll(e).forEach(n=>{t.remove(n)})})}resetQueries(e,t){const n=this.#e;return ue.batch(()=>(n.findAll(e).forEach(s=>{s.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){const n={revert:!0,...t},s=ue.batch(()=>this.#e.findAll(e).map(r=>r.cancel(n)));return Promise.all(s).then(me).catch(me)}invalidateQueries(e,t={}){return ue.batch(()=>(this.#e.findAll(e).forEach(n=>{n.invalidate()}),e?.refetchType==="none"?Promise.resolve():this.refetchQueries({...e,type:e?.refetchType??e?.type??"active"},t)))}refetchQueries(e,t={}){const n={...t,cancelRefetch:t.cancelRefetch??!0},s=ue.batch(()=>this.#e.findAll(e).filter(r=>!r.isDisabled()&&!r.isStatic()).map(r=>{let o=r.fetch(void 0,n);return n.throwOnError||(o=o.catch(me)),r.state.fetchStatus==="paused"?Promise.resolve():o}));return Promise.all(s).then(me)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const n=this.#e.build(this,t);return n.isStaleByTime(We(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(me).catch(me)}fetchInfiniteQuery(e){return e.behavior=Ja(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(me).catch(me)}ensureInfiniteQueryData(e){return e.behavior=Ja(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return ur.isOnline()?this.#t.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#e}getMutationCache(){return this.#t}getDefaultOptions(){return this.#n}setDefaultOptions(e){this.#n=e}setQueryDefaults(e,t){this.#s.set(dn(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...this.#s.values()],n={};return t.forEach(s=>{fn(e,s.queryKey)&&Object.assign(n,s.defaultOptions)}),n}setMutationDefaults(e,t){this.#r.set(dn(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...this.#r.values()],n={};return t.forEach(s=>{fn(e,s.mutationKey)&&Object.assign(n,s.defaultOptions)}),n}defaultQueryOptions(e){if(e._defaulted)return e;const t={...this.#n.queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=Eo(t.queryKey,t)),t.refetchOnReconnect===void 0&&(t.refetchOnReconnect=t.networkMode!=="always"),t.throwOnError===void 0&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode="offlineFirst"),t.queryFn===Po&&(t.enabled=!1),t}defaultMutationOptions(e){return e?._defaulted?e:{...this.#n.mutations,...e?.mutationKey&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){this.#e.clear(),this.#t.clear()}};function ux(e){return JSON.stringify(e,(t,n)=>dx(n)?Object.keys(n).sort().reduce((s,r)=>(s[r]=n[r],s),{}):typeof n=="bigint"?n.toString():n)}function dx(e){if(!Za(e))return!1;const t=e.constructor;if(typeof t>"u")return!0;const n=t.prototype;return!(!Za(n)||!n.hasOwnProperty("isPrototypeOf"))}function Za(e){return Object.prototype.toString.call(e)==="[object Object]"}function Xl(e){const{_defaulted:t,behavior:n,gcTime:s,initialData:r,initialDataUpdatedAt:o,maxPages:a,meta:i,networkMode:c,queryFn:l,queryHash:d,queryKey:f,queryKeyHashFn:h,retry:p,retryDelay:m,structuralSharing:g,getPreviousPageParam:v,getNextPageParam:x,initialPageParam:y,_optimisticResults:C,enabled:O,notifyOnChangeProps:w,placeholderData:E,refetchInterval:S,refetchIntervalInBackground:P,refetchOnMount:j,refetchOnReconnect:M,refetchOnWindowFocus:A,retryOnMount:R,select:k,staleTime:z,suspense:$,throwOnError:B,config:G,connector:q,query:ee,...ne}=e;return ne}function fx(e,t={}){return{async queryFn({queryKey:n}){const{name:s,scopeKey:r,...o}=n[1];if(!s)throw new Error("name is required");return ly(e,{...o,name:s})},queryKey:hx(t)}}function hx(e={}){return["ensAvatar",Xl(e)]}function px(e,t={}){return{async queryFn({queryKey:n}){const{address:s,scopeKey:r,...o}=n[1];if(!s)throw new Error("address is required");return uy(e,{...o,address:s})},queryKey:mx(t)}}function mx(e={}){return["ensName",Xl(e)]}var Zl=b.createContext(void 0),gx=e=>{const t=b.useContext(Zl);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},bx=({client:e,children:t})=>(b.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),u.jsx(Zl.Provider,{value:e,children:t})),eu=b.createContext(!1),vx=()=>b.useContext(eu);eu.Provider;function yx(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var xx=b.createContext(yx()),wx=()=>b.useContext(xx),Cx=(e,t)=>{(e.suspense||e.throwOnError||e.experimental_prefetchInRender)&&(t.isReset()||(e.retryOnMount=!1))},Sx=e=>{b.useEffect(()=>{e.clearReset()},[e])},Ex=({result:e,errorResetBoundary:t,throwOnError:n,query:s,suspense:r})=>e.isError&&!t.isReset()&&!e.isFetching&&s&&(r&&e.data===void 0||Yy(n,[e.error,s])),Px=e=>{if(e.suspense){const n=r=>r==="static"?r:Math.max(r??1e3,1e3),s=e.staleTime;e.staleTime=typeof s=="function"?(...r)=>n(s(...r)):n(s),typeof e.gcTime=="number"&&(e.gcTime=Math.max(e.gcTime,1e3))}},Ox=(e,t)=>e.isLoading&&e.isFetching&&!t,jx=(e,t)=>e?.suspense&&t.isPending,ei=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function Ix(e,t,n){const s=vx(),r=wx(),o=gx(),a=o.defaultQueryOptions(e);o.getDefaultOptions().queries?._experimental_beforeQuery?.(a),a._optimisticResults=s?"isRestoring":"optimistic",Px(a),Cx(a,r),Sx(r);const i=!o.getQueryCache().get(a.queryHash),[c]=b.useState(()=>new t(o,a)),l=c.getOptimisticResult(a),d=!s&&e.subscribed!==!1;if(b.useSyncExternalStore(b.useCallback(f=>{const h=d?c.subscribe(ue.batchCalls(f)):me;return c.updateResult(),h},[c,d]),()=>c.getCurrentResult(),()=>c.getCurrentResult()),b.useEffect(()=>{c.setOptions(a)},[a,c]),jx(a,l))throw ei(a,c,r);if(Ex({result:l,errorResetBoundary:r,throwOnError:a.throwOnError,query:o.getQueryCache().get(a.queryHash),suspense:a.suspense}))throw l.error;return o.getDefaultOptions().queries?._experimental_afterQuery?.(a,l),a.experimental_prefetchInRender&&!ct&&Ox(l,s)&&(i?ei(a,c,r):o.getQueryCache().get(a.queryHash)?.promise)?.catch(me).finally(()=>{c.updateResult()}),a.notifyOnChangeProps?l:c.trackResult(l)}function Nx(e,t){return Ix(e,tx)}function tu(e){const t=Nx({...e,queryKeyHashFn:ux});return t.queryKey=e.queryKey,t}function nu(e={}){const t=So(e);return b.useSyncExternalStore(n=>fy(t,{onChange:n}),()=>$a(t),()=>$a(t))}function Mx(e={}){const{name:t,query:n={}}=e,s=So(e),r=nu({config:s}),o=fx(s,{...e,chainId:e.chainId??r}),a=!!(t&&(n.enabled??!0));return tu({...n,...o,enabled:a})}function ru(e={}){const{address:t,query:n={}}=e,s=So(e),r=nu({config:s}),o=px(s,{...e,chainId:e.chainId??r}),a=!!(t&&(n.enabled??!0));return tu({...n,...o,enabled:a})}function su(e){const{address:t,chainId:n=1,size:s="14px"}=e,r={width:s,height:s},o=ru({address:t,chainId:n}),a=o.data??void 0,i=Mx({name:a}),c=i.data??Bg;return o.isLoading||i.isLoading?u.jsx("div",{className:"fade-out flex-none animate-pulse rounded-full bg-gray-400",style:r}):u.jsx("img",{alt:"ENS Avatar",className:"flex-none rounded-full object-contain",src:c,style:r})}const ou=["RENAME","DELETE","DUPLICATE"],Tx=[{value:"LOCAL",icon:u.jsx(I,{name:"Lock"}),description:"Only available to you"},{value:"CLOUD",icon:u.jsx(I,{name:"People"}),description:"Only available to people in this drive"},{value:"PUBLIC",icon:u.jsx(I,{name:"Globe"}),description:"Available to everyone",disabled:!0}],Ax={CLOUD:{title:"Secure cloud",description:"End to end encryption between members.",icon:u.jsx(I,{name:"Lock"})},LOCAL:{title:"Local",description:"Private and only available to you.",icon:u.jsx(I,{name:"Hdd"})},SWITCHBOARD:{title:"Switchboard",description:"Public and available to everyone.",icon:u.jsx(I,{name:"Drive"})}},Rx={ADD_TRIGGER:{label:"Add Trigger",icon:u.jsx(I,{className:"text-orange-900",name:"Plus"})},REMOVE_TRIGGER:{label:"Remove Trigger",icon:u.jsx(I,{className:"text-orange-900",name:"Xmark"})},ADD_INVALID_TRIGGER:{label:"Add Trigger",icon:u.jsx(I,{className:"text-orange-900",name:"Exclamation"})}},Dx={DUPLICATE:{label:"Duplicate",icon:u.jsx(I,{name:"FilesEarmark"})},RENAME:{label:"Rename",icon:u.jsx(I,{name:"Pencil"})},DELETE:{label:"Delete",icon:u.jsx(I,{name:"Trash"}),className:"text-red-900"},SETTINGS:{label:"Settings",icon:u.jsx(I,{name:"Gear"})}},au={...Rx,...Dx};function iu(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 cu="powerhouse/budget-statement",Io="powerhouse/default",lu="makerdao/rwa-portfolio",kx=[cu,Io,lu],Lx="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",Fx="/assets/rwa-report-Bb0W5-ac.png",$x="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=",ti={[cu]:Lx,[Io]:$x,[lu]:Fx};function zx(e,t){return t||(kx.includes(e)?ti[e]:ti[Io])}const ni="SYNCING",ri="SUCCESS",si="CONFLICT",oi="MISSING",ai="ERROR",ii="INITIAL_SYNC",Ux={SYNCING:"Syncing",SUCCESS:"Synced",CONFLICT:"Error",MISSING:"Circle",ERROR:"Error",INITIAL_SYNC:"Syncing"};function Bx(e){const{syncStatus:t,className:n,overrideSyncIcons:s={},...r}=e,o={...Ux,...s};return{[ii]:u.jsx(I,{size:16,...r,className:N("text-blue-900",n),name:o[ii]}),[ni]:u.jsx(I,{size:16,...r,className:N("text-blue-900",n),name:o[ni]}),[ri]:u.jsx(I,{size:16,...r,className:N("text-green-900",n),name:o[ri]}),[si]:u.jsx(I,{size:16,...r,className:N("text-orange-900",n),name:o[si]}),[oi]:u.jsx(I,{size:16,...r,className:N("text-red-900",n),name:o[oi]}),[ai]:u.jsx(I,{size:16,...r,className:N("text-red-900",n),name:o[ai]})}[t]}function K6(e){const{fileNode:t,className:n,customDocumentIconSrc:s}=e,[r,o]=b.useState("READ"),[a,i]=b.useState(!1),[c]=Pi(),l=c?Xr(c):"LOCAL",{dragProps:d}=iu({node:t}),{isAllowedToCreateDocuments:f}=Bs(),{onRenameNode:h,onDuplicateNode:p}=Vs(),m=r==="READ",g=_u(t.id,l),v={DUPLICATE:()=>p(t),RENAME:()=>o("WRITE"),DELETE:()=>ji(t)},x=Object.entries(au).map(([j,M])=>({...M,id:j})).filter(j=>ou.includes(j.id));function y(j){h(j,t).catch(M=>{console.error(M)}).finally(()=>{o("READ")})}function C(){o("READ")}function O(j){const M=v[j];if(!M){console.error(`No handler found for dropdown menu item: ${j}`);return}M(),i(!1)}const w=zx(t.documentType,s),E=u.jsxs("div",{className:"relative",children:[u.jsx("img",{alt:"file icon",className:"max-w-none",height:34,src:w,width:32}),m&&g&&u.jsx("div",{className:"absolute bottom-[-2px] right-0 size-3 rounded-full bg-white",children:u.jsx("div",{className:"absolute left-[-2px] top-[-2px]",children:u.jsx(Bx,{overrideSyncIcons:{SUCCESS:"CheckCircleFill"},syncStatus:g})})})]}),S=N("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),P=m?u.jsxs("div",{className:"flex w-52 items-center justify-between",children:[u.jsxs("div",{className:"mr-2 truncate group-hover:mr-0",children:[u.jsx("div",{className:"max-h-6 truncate text-sm font-medium group-hover:text-gray-800",children:t.name}),u.jsx("div",{className:"max-h-6 truncate text-xs font-medium text-gray-600 group-hover:text-gray-800",children:t.documentType})]}),f?u.jsx(wr,{items:x,onItemClick:O,onOpenChange:i,open:a,children:u.jsx("button",{className:N("hidden group-hover:block",a&&"block"),onClick:j=>{j.stopPropagation(),i(!0)},children:u.jsx(I,{className:"text-gray-600",name:"VerticalDots"})})}):null]}):u.jsx(qs,{className:"ml-3 flex-1 font-medium",defaultValue:t.name,onCancel:C,onSubmit:y});return u.jsx("div",{className:"relative w-64",onClick:()=>vt(t),children:u.jsx("div",{...d,className:S,children:u.jsxs("div",{className:"flex items-center",children:[u.jsx("div",{className:"mr-1.5",children:E}),P]})})})}function J6(e){const{folderNode:t,className:n}=e,{isAllowedToCreateDocuments:s}=Bs(),[r,o]=b.useState("READ"),[a,i]=b.useState(!1),{dragProps:c}=iu({node:t}),{onRenameNode:l,onDuplicateNode:d}=Vs(),{isDropTarget:f,dropProps:h}=zc({target:t}),p=r==="READ";function m(){o("READ")}function g(w){l(w,t).catch(E=>{console.error(E)}).finally(()=>{o("READ")})}const v={DUPLICATE:()=>d(t),RENAME:()=>o("WRITE"),DELETE:()=>ji(t)},x=Object.entries(au).map(([w,E])=>({...E,id:w})).filter(w=>ou.includes(w.id));function y(w){const E=v[w];if(!E){console.error(`No handler found for dropdown menu item: ${w}`);return}E(),i(!1)}const C=p||!s?u.jsx("div",{className:"ml-3 max-h-6 truncate font-medium text-gray-600 group-hover:text-gray-800",children:t.name}):u.jsx(qs,{className:"ml-3 font-medium",defaultValue:t.name,onCancel:m,onSubmit:g}),O=N("group flex h-12 cursor-pointer select-none items-center rounded-lg bg-gray-200 px-2",n,f&&"bg-blue-100");return u.jsx("div",{className:"relative w-64",onClick:()=>vt(t),children:u.jsxs("div",{...c,...h,className:O,children:[u.jsxs("div",{className:"flex items-center overflow-hidden",children:[u.jsx("div",{className:"p-1",children:u.jsx("div",{className:"relative",children:u.jsx(I,{name:"FolderClose",size:24})})}),C]}),p&&s?u.jsx(wr,{items:x,onItemClick:y,onOpenChange:i,open:a,children:u.jsx("button",{className:N("ml-auto hidden group-hover:block",a&&"block"),onClick:w=>{w.stopPropagation(),i(!0)},children:u.jsx(I,{className:"text-gray-600",name:"VerticalDots"})})}):null]})})}const Sn=b.forwardRef(function(t,n){const{icon:s,errorMessage:r,isDirty:o,containerClassName:a,inputClassName:i,errorMessageClassName:c,hideErrors:l=!1,...d}=t,f=t.type??"text",h=!!r;return u.jsxs("div",{children:[u.jsxs("div",{className:N("mb-1 flex gap-2 rounded-md border border-gray-200 bg-gray-50 p-3 text-black placeholder:text-gray-50",h&&"border-red-900",a),children:[s&&u.jsx("span",{className:_s((!o||h)&&"text-slate-200"),children:s}),u.jsx("input",{...d,className:N("w-full bg-transparent font-semibold outline-none",i),ref:n,type:f})]}),u.jsx("p",{className:N("hidden min-h-4 text-xs text-red-900",h&&"block",l&&"hidden",c),children:r})]})});function Vx(e){return b.forwardRef(e)}const No=Vx(function(t,n){const{items:s,value:r,id:o,onChange:a,containerClassName:i,menuClassName:c,itemClassName:l,absolutePositionMenu:d=!1,borderRadius:f="6px"}=t,[h,p]=b.useState(!1),m=v(r)??s[0];function g(y){y.disabled||(a(y.value),p(!1))}function v(y){return s.find(C=>C.value===y)}const x=s.filter(y=>y.value!==r);return u.jsxs("div",{className:N("border border-gray-200 bg-gray-50 text-gray-800 transition-[border-radius]",d&&"relative",i),"data-open":h,ref:n,style:{borderRadius:f},children:[u.jsxs("div",{className:N("flex min-w-[360px] cursor-pointer items-center justify-between pr-3 text-gray-800 outline-none",c),id:o,onClick:()=>p(!h),children:[u.jsx(ci,{...m,className:l}),u.jsx(I,{className:_s("transition",h?"":"-rotate-90"),name:"ChevronDown"})]}),u.jsx("div",{className:N("max-h-0 w-full overflow-hidden bg-inherit transition-[max-height] ease-in-out",h&&"max-h-screen",d&&"absolute"),style:{borderRadius:`0 0 ${f} ${f}`},children:x.map(y=>u.jsx(ci,{...y,className:l,onItemClick:()=>g(y)},y.value))})]})});function ci(e){const{className:t,disabled:n,onItemClick:s,icon:r,displayValue:o,value:a,description:i}=e;return u.jsxs("div",{className:N(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,u.jsxs("div",{children:[u.jsx("p",{className:"capitalize text-inherit",children:o??a.toLowerCase()}),u.jsx("p",{className:"text-xs text-gray-600",children:i})]})]})}function Hx(e){return{value:e.id,displayValue:e.name,icon:u.jsx(I,{name:"PowerhouseLogoSmall"}),description:"Built by Powerhouse"}}function _x(e){const{control:t,appOptions:n,...s}=e,r=n.map(Hx);return u.jsx(Ei,{control:t,name:"appId",render:({field:o})=>u.jsx(No,{...s,...o,id:"appId",items:r})})}const Wx=b.forwardRef(function(t,n){return u.jsxs("label",{className:"relative cursor-pointer items-center",htmlFor:t.id,children:[u.jsx("input",{className:"peer sr-only",ref:n,type:"checkbox",value:"",...t}),u.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"})]})}),Mo=b.forwardRef(function(t,n){return u.jsxs("div",{className:"flex items-center rounded-md border border-gray-200 bg-gray-50 p-3 text-gray-900",children:[u.jsxs("div",{className:"flex-1",children:[u.jsx("label",{className:"font-medium text-gray-900",htmlFor:"availableOffline",children:"Make available offline"}),u.jsxs("p",{className:"text-xs text-gray-600",children:["Check this options if you keep a local backup",u.jsx("br",{}),"available at all times."]})]}),u.jsx(Wx,{id:"availableOffline",ref:n,...t})]})});function Qn(e){const{children:t,className:n,...s}=e;return u.jsx("label",{...s,className:N("block font-semibold text-gray-500",n),children:t})}function uu(e){const{control:t,...n}=e;return u.jsx(Ei,{control:t,name:"sharingType",render:({field:s})=>u.jsx(No,{...n,...s,id:"sharingType",items:Tx})})}function Gx(e){const{register:t,handleSubmit:n,control:s,formState:{errors:r}}=Us({defaultValues:{name:"",sharingType:"LOCAL",availableOffline:!1,appId:e.appOptions[0].id}});return u.jsx("form",{name:"add-local-drive",onSubmit:n(e.onSubmit),className:"flex flex-col gap-4",children:u.jsxs("div",{className:"flex flex-col gap-4",children:[u.jsxs("div",{children:[u.jsx(Qn,{htmlFor:"name",className:"text-sm font-medium text-gray-800",children:"Drive Name"}),u.jsx(Sn,{...t("name",{required:"Drive name is required"}),errorMessage:r.name?.message,placeholder:"Drive name"})]}),u.jsxs("div",{children:[u.jsx(Qn,{htmlFor:"driveApp",className:"text-sm font-medium text-gray-800",children:"Drive App"}),u.jsx(_x,{control:s,appOptions:e.appOptions})]}),u.jsxs("div",{children:[u.jsx(Qn,{htmlFor:"sharingType",className:"text-sm font-medium text-gray-800",children:"Location"}),u.jsx(uu,{control:s})]}),u.jsx("div",{children:u.jsx(Mo,{...t("availableOffline")})}),u.jsx(Pe,{className:"mt-2 w-full",type:"submit",children:"Create new drive"})]})})}function qx(e){return u.jsxs("div",{className:"flex gap-2 rounded-xl bg-gray-100 p-3 font-semibold text-gray-500",children:[u.jsx(I,{className:"text-gray-600",name:"Drive"}),e.driveName]})}function du(e){const{location:t,className:n,...s}=e,r=Ax[t];return u.jsxs("div",{...s,className:N("my-3 flex items-center gap-2 rounded-xl border border-gray-100 p-3 text-gray-800 shadow",n),children:[r.icon,u.jsxs("div",{children:[u.jsx("p",{children:r.title}),u.jsx("p",{className:"text-xs text-slate-200",children:r.description})]})]})}function Yx(e){const{sharingType:t="PUBLIC",requestPublicDrive:n}=e,[s,r]=b.useState(),[o,a]=b.useState(!1),[i,c]=b.useState(!0),[l,d]=b.useState(!1),[f,h]=b.useState(""),[p,m]=b.useState(""),[g,v]=R0(p,500),{register:x,handleSubmit:y,setValue:C}=Us({mode:"onBlur",defaultValues:{availableOffline:s?.availableOffline??!1}});b.useEffect(()=>{v(p)},[p]),b.useEffect(()=>{if(d(!1),g==="")return;w().catch(console.error);async function w(){try{const{id:E,name:S}=await n(g);r({id:E,name:S,sharingType:t,location:"SWITCHBOARD",availableOffline:!0}),C("availableOffline",!0),c(!0),h("")}catch(E){r(void 0),c(!1),h(E.message)}}},[g,C,t]);function O({availableOffline:w}){s&&e.onSubmit({...s,availableOffline:w,url:g})}return u.jsx("form",{onSubmit:y(O),children:l?u.jsxs(u.Fragment,{children:[u.jsx(qx,{driveName:s?.name??"New drive"}),u.jsx(pt,{className:"my-3"}),u.jsxs(or,{isOpen:o,onOpenChange:()=>a(!o),title:"Location",children:[u.jsx(du,{location:"SWITCHBOARD"}),u.jsx(Mo,{...x("availableOffline")})]}),u.jsx(Pe,{className:"mt-4 w-full",color:"dark",type:"submit",children:"Add new drive"})]}):u.jsxs(u.Fragment,{children:[u.jsx(Sn,{errorMessage:f,onChange:w=>m(w.target.value),placeholder:"Drive URL",required:!0,type:"url",value:p}),u.jsx(Pe,{className:"mt-4 w-full py-2 text-base",color:"dark",size:"small",disabled:!i||p==="",onClick:w=>{w.preventDefault(),d(!0)},type:"button",children:"Add drive"})]})})}const Qx="/assets/home-bg-BRYzhkhi.avif",Kx="/assets/home-bg-BEhF9NuW.png";function Jx(){return u.jsxs("picture",{className:"pointer-events-none absolute inset-8 z-0 size-[calc(100%-32px)] object-contain",children:[u.jsx("source",{srcSet:Qx,type:"image/avif"}),u.jsx("img",{src:Kx,alt:"background",className:"object-contain"})]})}const Xx=function(t){const{icon:n,title:s,description:r,containerClassName:o,shareable:a,onClick:i}=t;return u.jsxs("div",{className:N("relative flex h-24 cursor-pointer flex-col items-center justify-center text-center text-sm text-black",o,i&&"cursor-pointer"),onClick:i,children:[u.jsx("div",{className:"mx-auto pb-2",children:n||u.jsx("div",{className:"size-8 items-center justify-center rounded-lg bg-black pt-1",children:u.jsx("span",{className:"text-6 w-6 text-white",children:s.slice(0,1).toUpperCase()})})}),u.jsxs("div",{children:[u.jsx("h3",{children:s}),r&&u.jsx("p",{className:"text-gray-500",children:r})]}),a&&u.jsx("div",{className:"absolute left-2 top-0 mb-2",children:u.jsx(I,{name:"PeopleFill",width:12,height:12})})]})},X6=function(t){const{containerClassName:n}=t;return u.jsx(Xx,{title:"Create New Drive",icon:u.jsx(I,{name:"PlusSquare",size:32}),onClick:()=>Wu({type:"addDrive"}),containerClassName:n})},Z6=function(t){const{children:n,containerClassName:s}=t;return u.jsx("div",{className:N("container relative mx-auto flex h-full flex-col",s),children:u.jsxs("div",{className:"m-8 flex flex-wrap justify-center gap-4 pt-12",children:[u.jsx(Jx,{}),n]})})};function li(e){const{label:t,children:n}=e;return u.jsx("div",{children:n})}var Or="Tabs",[Zx]=Ii(Or,[Ai]),fu=Ai(),[e5,To]=Zx(Or),hu=b.forwardRef((e,t)=>{const{__scopeTabs:n,value:s,onValueChange:r,defaultValue:o,orientation:a="horizontal",dir:i,activationMode:c="automatic",...l}=e,d=od(i),[f,h]=Ti({prop:s,onChange:r,defaultProp:o??"",caller:Or});return u.jsx(e5,{scope:n,baseId:Mi(),value:f,onValueChange:h,orientation:a,dir:d,activationMode:c,children:u.jsx(Et.div,{dir:d,"data-orientation":a,...l,ref:t})})});hu.displayName=Or;var pu="TabsList",mu=b.forwardRef((e,t)=>{const{__scopeTabs:n,loop:s=!0,...r}=e,o=To(pu,n),a=fu(n);return u.jsx(ad,{asChild:!0,...a,orientation:o.orientation,dir:o.dir,loop:s,children:u.jsx(Et.div,{role:"tablist","aria-orientation":o.orientation,...r,ref:t})})});mu.displayName=pu;var gu="TabsTrigger",bu=b.forwardRef((e,t)=>{const{__scopeTabs:n,value:s,disabled:r=!1,...o}=e,a=To(gu,n),i=fu(n),c=xu(a.baseId,s),l=wu(a.baseId,s),d=s===a.value;return u.jsx(id,{asChild:!0,...i,focusable:!r,active:d,children:u.jsx(Et.button,{type:"button",role:"tab","aria-selected":d,"aria-controls":l,"data-state":d?"active":"inactive","data-disabled":r?"":void 0,disabled:r,id:c,...o,ref:t,onMouseDown:ke(e.onMouseDown,f=>{!r&&f.button===0&&f.ctrlKey===!1?a.onValueChange(s):f.preventDefault()}),onKeyDown:ke(e.onKeyDown,f=>{[" ","Enter"].includes(f.key)&&a.onValueChange(s)}),onFocus:ke(e.onFocus,()=>{const f=a.activationMode!=="manual";!d&&!r&&f&&a.onValueChange(s)})})})});bu.displayName=gu;var vu="TabsContent",yu=b.forwardRef((e,t)=>{const{__scopeTabs:n,value:s,forceMount:r,children:o,...a}=e,i=To(vu,n),c=xu(i.baseId,s),l=wu(i.baseId,s),d=s===i.value,f=b.useRef(d);return b.useEffect(()=>{const h=requestAnimationFrame(()=>f.current=!1);return()=>cancelAnimationFrame(h)},[]),u.jsx(Hs,{present:r||d,children:({present:h})=>u.jsx(Et.div,{"data-state":d?"active":"inactive","data-orientation":i.orientation,role:"tabpanel","aria-labelledby":c,hidden:!h,id:l,tabIndex:0,...a,ref:t,style:{...e.style,animationDuration:f.current?"0s":void 0},children:h&&o})})});yu.displayName=vu;function xu(e,t){return`${e}-trigger-${t}`}function wu(e,t){return`${e}-content-${t}`}var t5=hu,n5=mu,r5=bu,s5=yu;function o5({children:e,defaultValue:t}){return u.jsxs(t5,{defaultValue:t,className:"flex flex-col gap-2",children:[u.jsx("div",{className:"flex w-full justify-between",children:u.jsx(n5,{className:"flex w-full gap-x-2 rounded-xl bg-slate-50 p-1 text-sm font-semibold text-gray-600 outline-none",children:W.Children.map(e,(n,s)=>{if(!W.isValidElement(n))return;const{label:r,disabled:o}=n.props;return u.jsx(r5,{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)})})}),u.jsx("div",{className:"mt-3 rounded-md bg-white",children:W.Children.map(e,(n,s)=>{if(!W.isValidElement(n))return;const{label:r}=n.props;return u.jsx(s5,{value:r,children:n},s)})})]})}function ew(e){function t(){s(!1)}const{open:n,onOpenChange:s,onAddRemoteDrive:r,onAddLocalDrive:o,requestPublicDrive:a,modalProps:i,containerProps:c}=e;return u.jsx(Ye,{...i,contentProps:{className:"rounded-2xl"},onOpenChange:s,open:n,children:u.jsx("div",{...c,className:N("w-[408px] rounded-2xl p-6",c?.className),children:u.jsxs(o5,{defaultValue:"Create Drive",children:[u.jsx(li,{label:"Create Drive",description:"Create a new drive",children:u.jsx(Gx,{onCancel:t,onSubmit:o,appOptions:e.appOptions})}),u.jsx(li,{label:"Add Drive",description:"Add a drive",children:u.jsx(Yx,{sharingType:"PUBLIC",onSubmit:r,onCancel:t,requestPublicDrive:a})})]})})})}const ui="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 Cu(e){const{body:t,header:n,children:s,onCancel:r,onOpenChange:o,onContinue:a,cancelLabel:i,continueLabel:c,overlayProps:l,contentProps:d,bodyProps:f={},headerProps:h={},containerProps:p={},cancelButtonProps:m={},continueButtonProps:g={},buttonContainerProps:v={},...x}=e;return u.jsx(Ye,{contentProps:{...d,className:N("rounded-3xl",d?.className)},onOpenChange:o,overlayProps:{...l,className:l?.className},...x,children:u.jsxs("div",{...ce(p,"w-[400px] p-6 text-slate-300"),children:[u.jsx("div",{...ce(h,"border-b border-slate-50 pb-2 text-2xl font-bold text-gray-800"),children:n}),u.jsxs("div",{...ce(f,"my-6 rounded-md bg-slate-50 p-4 text-center"),children:[t,s]}),u.jsxs("div",{...ce(v,"mt-8 flex justify-between gap-3"),children:[u.jsx("button",{onClick:r,...ce(m,N(ui,"flex-1 bg-slate-50 text-slate-800")),children:i}),u.jsx("button",{onClick:a,...ce(g,N(ui,"flex-1 bg-gray-800 text-gray-50")),children:c})]})]})})}const di="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",fi=300;function tw(e){const{onOpenChange:t,onContinue:n,overlayProps:s,contentProps:r,...o}=e,[a,i]=b.useState(""),[c,l]=b.useState(!1),d=()=>{t?.(!1),setTimeout(()=>i(""),fi)},f=b.useCallback(()=>{c&&(n(a),setTimeout(()=>i(""),fi))},[c,a,n]),h=b.useCallback(p=>{p.preventDefault(),f()},[f]);return u.jsx(Ye,{contentProps:{...r,className:N("rounded-3xl",r?.className)},onOpenChange:t,overlayProps:{...s,className:s?.className},...o,children:u.jsxs("form",{name:"create-document",className:"w-[400px] p-6 text-slate-300",onSubmit:h,children:[u.jsx("div",{className:"border-b border-slate-50 pb-2 text-2xl font-bold text-gray-800",children:"Create a new document"}),u.jsxs("div",{className:"my-6",children:[!c&&a&&u.jsx("div",{className:"mb-2 text-red-500",children:"Document name must be valid URL characters."}),u.jsx(Sn,{icon:u.jsx(I,{name:"BrickGlobe"}),onChange:p=>{const m=p.target.value;i(m),l(vd(m))},placeholder:"Document name",required:!0,value:a})]}),u.jsxs("div",{className:"mt-8 flex justify-between gap-3",children:[u.jsx("button",{type:"button",className:N(di,"flex-1 bg-slate-50 text-slate-800"),onClick:d,children:"Cancel"}),u.jsx(Pe,{type:"submit",className:N(di,"flex-1 bg-gray-800 text-gray-50"),disabled:!c,children:"Create"})]})]})})}const nw=e=>{const{inputPlaceholder:t,body:n,driveName:s,...r}=e,[o,a]=b.useState("");return u.jsx(Cu,{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:u.jsxs("div",{children:[u.jsx("div",{className:"my-6 rounded-md bg-slate-50 p-4 text-center",children:n}),u.jsx("div",{children:u.jsx(Sn,{hideErrors:!0,icon:u.jsx(I,{name:"Lock"}),onChange:i=>a(i.target.value),placeholder:t,value:o})})]})})};function rw(e){const{onDelete:t,deleteLabel:n,...s}=e;return u.jsx(Cu,{...s,containerProps:{className:"w-[450px]"},continueButtonProps:{className:"bg-red-900"},continueLabel:n,onContinue:t})}const Su=b.forwardRef(function(t,n){return u.jsx(Sn,{...t,icon:t.icon??u.jsx(I,{name:"Drive"}),id:"driveName",placeholder:"Drive name",ref:n})});function a5(e){const{drive:t,handleDeleteDrive:n,onCancel:s}=e,[r,o]=b.useState(""),a=r===t.header.name;function i(){a&&n()}return u.jsxs("div",{children:[u.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?"}),u.jsx(Su,{icon:u.jsx(I,{name:"Lock"}),onChange:c=>o(c.target.value),placeholder:"Enter drive name...",value:r}),u.jsxs("div",{className:"flex gap-3",children:[u.jsx(Pe,{className:"w-full",color:"light",onClick:s,children:"Cancel"}),u.jsx(Pe,{className:"w-full",color:"red",disabled:!a,onClick:i,children:"Delete"})]})]})}function i5(e){const{drive:t,sharingType:n,availableOffline:s,onSubmit:r,handleDeleteDrive:o}=e,a=t.header.name,[i,c]=b.useState(!1),[l,d]=b.useState(!1),[f,h]=b.useState(!1),{register:p,handleSubmit:m,control:g}=Us({mode:"onBlur",defaultValues:{name:a,sharingType:n,availableOffline:s}}),v=n==="PUBLIC"?"SWITCHBOARD":n;return u.jsxs("form",{onSubmit:m(r),children:[u.jsx(Su,{...p("name")}),u.jsx(pt,{className:"my-4"}),u.jsx(Qn,{htmlFor:"sharingType",children:"Sharing settings"}),u.jsx(uu,{control:g}),u.jsx(pt,{className:"my-3"}),u.jsxs(or,{isOpen:i,onOpenChange:()=>c(!i),title:"Location",children:[u.jsx(du,{location:v}),u.jsx(Mo,{...p("availableOffline")})]}),u.jsx(pt,{className:"my-3"}),u.jsx(or,{isOpen:l,onOpenChange:()=>d(!l),title:"Danger zone",children:u.jsxs("button",{className:"flex gap-2 py-3 font-semibold text-red-900 transition hover:brightness-125",onClick:()=>h(!0),type:"button",children:[u.jsx(I,{name:"Trash"}),"Delete drive"]})}),f&&l?u.jsx(a5,{drive:t,handleDeleteDrive:o,onCancel:()=>h(!1)}):u.jsxs(u.Fragment,{children:[u.jsx(pt,{className:"my-3"}),u.jsx(Pe,{className:"mb-4 w-full",type:"submit",children:"Confirm"})]})]})}function sw(e){const{drive:t,open:n,sharingType:s,availableOffline:r,onOpenChange:o,onDeleteDrive:a,onRenameDrive:i,onChangeSharingType:c,onChangeAvailableOffline:l,modalProps:d,containerProps:f}=e,h=g=>{g.name!==t.header.name&&i(t,g.name),g.sharingType!==s&&c(t,g.sharingType),g.availableOffline!==r&&l(t,g.availableOffline),o(!1)};function p(){a(t),o(!1)}function m(){o(!1)}return u.jsx(Ye,{...d,contentProps:{className:"rounded-2xl"},onOpenChange:o,open:n,children:u.jsxs("div",{...f,className:N("max-w-[408px] rounded-2xl p-6",f?.className),children:[u.jsxs("div",{className:"flex justify-between",children:[u.jsx("h1",{className:"text-xl font-bold",children:"Drive settings"}),u.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:u.jsx(I,{name:"XmarkLight",size:24})})]}),u.jsx(pt,{className:"my-4"}),u.jsx(i5,{handleCancel:m,handleDeleteDrive:p,onSubmit:h,drive:t,sharingType:s,availableOffline:r})]})})}const c5="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 ow(e){const{body:t,header:n,children:s,onOpenChange:r,onContinue:o,closeLabel:a,overlayProps:i,contentProps:c,bodyProps:l={},headerProps:d={},containerProps:f={},continueButtonProps:h={},buttonContainerProps:p={},...m}=e,[g,v]=b.useState(!0),x=b.useRef(null);return b.useEffect(()=>{const y=()=>{const O=x.current;O&&(O.scrollHeight>O.clientHeight?(v(!0),O.addEventListener("scroll",C)):v(!1))},C=()=>{const O=x.current;O&&O.scrollHeight-Math.ceil(O.scrollTop)===O.clientHeight&&v(!1)};return requestAnimationFrame(y),()=>{const O=x.current;O&&O.removeEventListener("scroll",C)}},[]),u.jsx(Ye,{contentProps:{...c,className:N("rounded-3xl outline-none",c?.className)},onOpenChange:r,overlayProps:{...i,className:i?.className},...m,children:u.jsxs("div",{...ce(f,"w-[500px] p-6 text-slate-300"),children:[u.jsx("div",{...ce(d,"border-b border-slate-50 pb-2 text-2xl font-bold text-gray-800"),children:n}),u.jsxs("div",{ref:x,...ce(l,"my-6 max-h-[245px] overflow-scroll rounded-md bg-slate-50 p-4 text-center"),children:[t,s]}),u.jsx("div",{...ce(p,"mt-8 flex justify-between gap-3"),children:u.jsx("button",{disabled:g,onClick:o,...ce(h,N(c5,"flex-1 bg-gray-800 text-gray-50",g&&"cursor-not-allowed bg-gray-300 hover:scale-100")),children:a})})]})})}const l5=[/^@powerhousedao\/.+$/,"document-drive","document-model"],u5=yd({version:It({message:"Missing version field in package.json"}),dependencies:Fo(It(),It()).nullable(),devDependencies:Fo(It(),It()).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])=>l5.some(s=>typeof s=="string"?s===n:s.test(n))))}});function d5(e){const t=u5.safeParse(e);return t.success?t.data:(console.error("Package.json validation failed:",t.error.format()),!1)}function f5(e){const[t,n]=b.useState(!1),{packageJson:s,phCliVersion:r}=e,o=d5(s);return o?u.jsx(or,{isOpen:t,onOpenChange:()=>n(!t),title:`App version: ${o.version}`,toggleClassName:"text-gray-900 text-sm",children:u.jsxs("ul",{className:"text-sm text-gray-600",children:[Object.entries(o.dependencies).map(([a,i])=>u.jsxs("li",{className:"my-1 flex justify-between pr-1",children:[u.jsxs("span",{children:[a.replace("@powerhousedao/",""),":"]}),u.jsx("span",{className:"font-normal",children:i})]},a)),r&&u.jsxs("li",{className:"my-1 flex justify-between pr-1",children:[u.jsx("span",{children:"@powerhousedao/ph-cli:"}),u.jsx("span",{className:"font-normal",children:r})]},"ph-cli")]})}):(console.error("Failed to validate package.json data"),null)}function aw(e){const{packageJson:t,phCliVersion:n}=e;return u.jsxs("div",{className:"bg-white p-3",children:[u.jsx("h2",{className:"font-semibold",children:"About"}),u.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."}),u.jsx("div",{className:"my-4",children:u.jsx(f5,{packageJson:t,phCliVersion:n})})]})}function iw(e){const{className:t,...n}=e;return u.jsxs("div",{className:Ri("h-full rounded-lg bg-white p-3",t),children:[u.jsx("h2",{className:"mb-4 font-semibold",children:"Modify Drives"}),u.jsx(h5,{...n}),u.jsx("h2",{className:"my-4 font-semibold",children:"Local Storage"}),u.jsx(g5,{...n})]})}function h5(e){const{className:t,...n}=e;return u.jsx("div",{className:t,children:u.jsx(p5,{...n})})}function p5(e){const{className:t,...n}=e;return u.jsx("div",{className:t,children:e.drives.map(s=>u.jsx(m5,{drive:s,...n},s.header.id))})}function m5(e){const{drive:t,className:n,onDeleteDrive:s}=e,[r,o]=b.useState(!1),a=u.jsx(I,{name:"Hdd",size:16,className:"flex-none"}),i=u.jsx(I,{name:"Server",size:16,className:"flex-none"}),c=t.state.global.icon?u.jsx("img",{alt:"drive icon",className:"size-4 flex-none object-contain",src:t.state.global.icon}):u.jsx(I,{name:"M",size:16,className:"flex-none"});function l(){const f=Xr(t);return f==="PUBLIC"?c:f==="CLOUD"?i:a}const d=l();return u.jsxs("div",{className:Ri("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,u.jsxs("div",{children:[u.jsx("span",{className:"block text-sm font-medium leading-[18px]",children:Lo(t.header.name)}),u.jsxs("div",{className:"flex items-baseline gap-x-2 leading-[18px]",children:[u.jsxs("span",{className:"text-sm text-gray-600",children:[Lo(Xr(t))," App"]}),u.jsxs("a",{className:"group flex items-center gap-x-2 text-sm text-slate-500 transition-colors hover:text-[#9896FF]",children:["By Powerhouse",u.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:u.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"})})]})]})]}),u.jsx(wr,{items:[{id:"delete-drive",label:"Delete",icon:u.jsx(I,{name:"Trash"}),className:"text-red-900"}],onItemClick:f=>{f==="delete-drive"&&s(t)},onOpenChange:o,open:r,children:u.jsx("button",{className:"group ml-auto flex-none",onClick:f=>{f.stopPropagation(),o(!0)},children:u.jsx(I,{className:"text-gray-600 group-hover:text-gray-900",name:"VerticalDots",size:16})})})]})}function g5(e){const{onClearStorage:t}=e;return u.jsx("div",{children:u.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 ",u.jsx(I,{name:"Trash",size:16})]})})}function cw(e){const{className:t,...n}=e;return u.jsx("div",{className:N("rounded-lg p-3",t),children:u.jsx(b5,{...n})})}function b5(e){const{documentModelEditor:t,setDocumentModelEditor:n,documentModelEditorOptions:s,className:r}=e;return u.jsxs("div",{children:[u.jsx("h3",{className:"mb-4 font-semibold text-gray-900",children:"Default Editor Selection"}),u.jsx(ki,{className:N("min-w-36 max-w-fit",r),name:"default-editor",required:!0,value:t,options:s,multiple:!1,onChange:o=>n(o)})]})}const v5={npm:{icon:"Npm"},github:{icon:"Github",size:28},local:{icon:"Hdd"}},y5=({packageName:e,provider:t})=>{const n=t&&v5[t];return u.jsxs("div",{className:"flex w-full items-center justify-between px-2 py-1",children:[u.jsx("p",{className:"font-medium",children:e}),n&&u.jsx(I,{name:n.icon,size:n.size})]})},x5=e=>{const{onInstall:t,packageOptions:n,className:s}=e,[r,o]=b.useState(""),[a,i]=b.useState(!1),[c,l]=b.useState(),d=b.useCallback(()=>{const m=t(r);m?(i(!0),m.then(()=>o("")).catch(l).finally(()=>i(!1))):(o(""),l(void 0))},[t,r]),f=b.useCallback(m=>{o(m.target.value)},[]),h=c?typeof c=="string"?c:c instanceof Error?c.message:c:" ",p=b.useMemo(()=>{const m=n?.map(g=>({...g,value:g.packageName}));return n?.length?{autoComplete:!0,initialOptions:m,fetchOptionsCallback:g=>m?.filter(v=>v.packageName.toLowerCase().includes(g.toLowerCase()))??[],renderOption:g=>u.jsx(y5,{...g})}:{autoComplete:!1}},[n]);return u.jsxs("div",{className:s,children:[u.jsx("h3",{className:"mb-4 font-semibold text-gray-900",children:"Install Package"}),u.jsxs("div",{className:"flex items-center gap-4",children:[n?.length?u.jsx(Ed,{...p,onChange:o}):u.jsx(Sd,{name:"package",className:"max-w-xs text-gray-700",value:r,onChange:f,onSubmit:d,disabled:a}),u.jsx(Pe,{className:"h-9 rounded-md text-sm",onClick:d,disabled:a,children:"Install"})]}),u.jsx("p",{className:"mb-3 ml-2 h-3 text-sm text-red-800",children:h})]})},zn=({label:e,value:t})=>u.jsxs("div",{className:"flex items-start gap-2 text-sm",children:[u.jsxs("p",{className:"text-gray-600",children:[e,":"]}),u.jsx("p",{className:"text-gray-600",children:t})]}),w5=e=>{const{package:{name:t,description:n,category:s,publisher:r,publisherUrl:o,modules:a,id:i,removable:c},mutable:l,onUninstall:d,className:f}=e,[h,p]=b.useState(!1);return u.jsxs("li",{className:N("relative flex flex-col items-start rounded-md border border-gray-200 p-3 text-sm leading-5 shadow-sm",f),children:[u.jsx("h3",{className:"font-semibold text-gray-900",children:t}),u.jsx(zn,{label:"Description",value:n}),u.jsx(zn,{label:"Category",value:s}),u.jsx(zn,{label:"Publisher",value:r}),u.jsx(zn,{label:"Publisher URL",value:u.jsx("a",{className:"underline",href:o,children:o})}),u.jsx("p",{className:"text-sm text-gray-600",children:"Modules included:"}),u.jsx("ul",{className:"list-disc pl-5",children:a.map(m=>u.jsx("li",{children:u.jsx("span",{className:"text-gray-600",children:m})},m))}),l&&c&&u.jsx(wr,{items:[{id:"uninstall",label:"Uninstall",icon:u.jsx(I,{name:"Trash"}),className:"text-red-900"}],onItemClick:m=>{m==="uninstall"&&d(i)},onOpenChange:p,open:h,children:u.jsx("button",{className:"group absolute right-3 top-3",onClick:m=>{m.stopPropagation(),p(!0)},children:u.jsx(I,{className:"text-gray-600 group-hover:text-gray-900",name:"VerticalDots"})})})]})},C5=e=>{const{className:t,packages:n,onUninstall:s,mutable:r,...o}=e,a=b.useCallback(i=>{s(i)},[s]);return u.jsxs("div",{...o,className:N("flex max-h-[370px] flex-col items-stretch overflow-hidden",t),children:[u.jsx("h3",{className:"mb-4 font-semibold text-gray-900",children:"Installed Packages"}),u.jsx("div",{className:"flex-1 overflow-y-auto pr-2",children:u.jsx("ul",{className:"flex flex-col items-stretch gap-4 pr-2",children:n.map(i=>u.jsx(w5,{package:i,onUninstall:a,mutable:r},i.id))})})]})},S5=e=>{const{reactorOptions:t,reactor:n,onReactorChange:s,...r}=e,o=b.useCallback(a=>{s(Array.isArray(a)?a.at(-1):a)},[s]);return u.jsxs("div",{...r,children:[u.jsx("h3",{className:"mb-4 font-semibold text-gray-900",children:"Select Reactor"}),u.jsx(ki,{className:"min-w-36 max-w-fit",name:"reactor",required:!0,value:n,options:t,multiple:!1,onChange:o})]})},lw=e=>{const{className:t,reactorOptions:n,reactor:s,onReactorChange:r,onInstall:o,packages:a,onUninstall:i,mutable:c,packageOptions:l,...d}=e,f=b.useMemo(()=>l?.filter(h=>!a.find(p=>p.name===h.packageName)),[a,l]);return u.jsxs("div",{...d,className:N("flex h-full flex-1 flex-col rounded-lg p-3",t),children:[u.jsx(S5,{reactor:s,reactorOptions:n,onReactorChange:r,className:"mb-4"}),c&&u.jsx(x5,{onInstall:o,packageOptions:f}),u.jsx(C5,{packages:a,onUninstall:i,mutable:c})]})};function uw(e){const{title:t,overlayProps:n,contentProps:s,onOpenChange:r,tabs:o,defaultTab:a,...i}=e,[c,l]=b.useState(a??o.at(0)?.id),d=o.map(p=>u.jsx("button",{type:"button",onClick:()=>l(p.id),children:u.jsxs("div",{className:N("flex h-9 w-48 cursor-pointer items-center gap-x-2 rounded-md pl-3 hover:bg-slate-50",c===p.id?"bg-slate-50":"bg-transparent"),children:[p.icon,u.jsx("span",{children:p.label})]})},p.id)),h=o.find(p=>p.id===c)?.content;return u.jsxs(Ye,{contentProps:{...s,className:N("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:N("py-28",n?.className)},...i,children:[u.jsxs("div",{className:"flex justify-between border-b border-slate-50 p-4",children:[u.jsx("h1",{className:"text-center text-xl font-semibold",children:t}),u.jsx("button",{type:"button",className:"flex size-6 items-center justify-center rounded-md outline-none",onClick:()=>r?.(!1),children:u.jsx(I,{name:"XmarkLight",size:24})})]}),u.jsxs("div",{className:"flex flex-1",children:[u.jsx("div",{className:"flex flex-col gap-y-1 p-3 pt-6",children:d}),u.jsx("div",{className:"m-6 flex h-full flex-1 flex-col overflow-hidden rounded-lg border border-slate-50",children:typeof h=="function"?u.jsx(h,{}):h})]})]})}const hi="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 dw(e){const{body:t,header:n,onOpenChange:s,onContinue:r,cancelLabel:o,continueLabel:a,overlayProps:i,contentProps:c,...l}=e;return u.jsx(Ye,{contentProps:{...c,className:N("rounded-3xl",c?.className)},onOpenChange:s,overlayProps:{...i,className:i?.className},...l,children:u.jsxs("div",{className:"w-[400px] p-6 text-slate-300",children:[u.jsx("div",{className:"border-b border-slate-50 pb-2 text-2xl font-bold text-gray-800",children:n}),u.jsx("div",{className:"my-6 rounded-md bg-slate-50 p-4 text-center",children:t}),u.jsxs("div",{className:"mt-8 flex justify-between gap-3",children:[u.jsx("button",{className:N(hi,"flex-1 bg-slate-50 text-slate-800"),onClick:()=>s?.(!1),children:o}),u.jsx("button",{className:N(hi,"flex-1 bg-gray-800 text-gray-50"),onClick:r,children:a})]})]})})}function E5(e){const{branch:t="main"}=e;return u.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:[u.jsx(I,{name:"Branch"}),u.jsx("span",{children:"BRANCH"}),u.jsx("span",{className:"text-gray-900",children:t})]})}function P5(e){const{docId:t}=e,[,n]=mr();function s(r){return()=>{n(r).catch(o=>{console.error("Failed to copy!",o)})}}return u.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:s(t),children:[u.jsx(I,{name:"Link"}),"DOC ID",u.jsx("span",{className:"text-gray-900",children:t})]})}const O5=e=>{const{documentState:t,onCopyState:n}=e,[,s]=mr();function r(){const o=JSON.stringify(t,null,2);s(o).then(()=>{n?.()}).catch(a=>{console.error("Failed to copy document state!",a)})}return u.jsx("button",{className:"rounded-lg bg-slate-50 p-1 text-stone-300",onClick:r,children:u.jsx(I,{name:"CurlyBrackets"})})};function j5(e){const{value:t,onChange:n}=e,s=[{displayValue:"Global scope",value:"global"},{displayValue:"Local scope",value:"local"}];return u.jsx(No,{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 I5(e){const{title:t,docId:n,scope:s,onChangeScope:r,onClose:o,className:a,documentState:i,onCopyState:c,...l}=e;return u.jsxs("header",{className:N("flex items-center justify-between bg-transparent",a),...l,children:[u.jsxs("div",{className:"flex items-center gap-3",children:[u.jsx("button",{name:"close-revision-history",className:"shadow-button rounded-lg bg-gray-50 p-1 text-stone-300",onClick:o,children:u.jsx(I,{name:"VariantArrowLeft"})}),u.jsx("h1",{className:"text-xs",children:t})]}),u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsx(P5,{docId:n}),i&&u.jsx(O5,{documentState:i,onCopyState:c}),u.jsx(E5,{}),u.jsx(j5,{onChange:r,value:s})]})]})}function ht(e,t,n){let s=n.initialDeps??[],r;function o(){var a,i,c,l;let d;n.key&&((a=n.debug)!=null&&a.call(n))&&(d=Date.now());const f=e();if(!(f.length!==s.length||f.some((m,g)=>s[g]!==m)))return r;s=f;let p;if(n.key&&((i=n.debug)!=null&&i.call(n))&&(p=Date.now()),r=t(...f),n.key&&((c=n.debug)!=null&&c.call(n))){const m=Math.round((Date.now()-d)*100)/100,g=Math.round((Date.now()-p)*100)/100,v=g/16,x=(y,C)=>{for(y=String(y);y.length<C;)y=" "+y;return y};console.info(`%c⏱ ${x(g,5)} /${x(m,5)} ms`,`
|
|
43
43
|
font-size: .6rem;
|
|
44
44
|
font-weight: bold;
|
|
45
45
|
color: hsl(${Math.max(0,Math.min(120-120*v,120))}deg 100% 31%);`,n?.key)}return(l=n?.onChange)==null||l.call(n,r),r}return o.updateDeps=a=>{s=a},o}function pi(e,t){if(e===void 0)throw new Error("Unexpected undefined");return e}const N5=(e,t)=>Math.abs(e-t)<1.01,M5=(e,t,n)=>{let s;return function(...r){e.clearTimeout(s),s=e.setTimeout(()=>t.apply(this,r),n)}},mi=e=>{const{offsetWidth:t,offsetHeight:n}=e;return{width:t,height:n}},T5=e=>e,A5=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},R5=(e,t)=>{const n=e.scrollElement;if(!n)return;const s=e.targetWindow;if(!s)return;const r=a=>{const{width:i,height:c}=a;t({width:Math.round(i),height:Math.round(c)})};if(r(mi(n)),!s.ResizeObserver)return()=>{};const o=new s.ResizeObserver(a=>{const i=()=>{const c=a[0];if(c?.borderBoxSize){const l=c.borderBoxSize[0];if(l){r({width:l.inlineSize,height:l.blockSize});return}}r(mi(n))};e.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(i):i()});return o.observe(n,{box:"border-box"}),()=>{o.unobserve(n)}},gi={passive:!0},bi=typeof window>"u"?!0:"onscrollend"in window,D5=(e,t)=>{const n=e.scrollElement;if(!n)return;const s=e.targetWindow;if(!s)return;let r=0;const o=e.options.useScrollendEvent&&bi?()=>{}:M5(s,()=>{t(r,!1)},e.options.isScrollingResetDelay),a=d=>()=>{const{horizontal:f,isRtl:h}=e.options;r=f?n.scrollLeft*(h&&-1||1):n.scrollTop,o(),t(r,d)},i=a(!0),c=a(!1);c(),n.addEventListener("scroll",i,gi);const l=e.options.useScrollendEvent&&bi;return l&&n.addEventListener("scrollend",c,gi),()=>{n.removeEventListener("scroll",i),l&&n.removeEventListener("scrollend",c)}},k5=(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"]},L5=(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 F5{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:T5,rangeExtractor:A5,onChange:()=>{},measureElement:k5,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=ht(()=>(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 i=n[a];if(r.has(i.lane))continue;const c=o.get(i.lane);if(c==null||i.end>c.end?o.set(i.lane,i):i.end<c.end&&r.set(i.lane,!0),r.size===this.options.lanes)break}return o.size===this.options.lanes?Array.from(o.values()).sort((a,i)=>a.end===i.end?a.index-i.index:a.end-i.end)[0]:void 0},this.getMeasurementOptions=ht(()=>[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=ht(()=>[this.getMeasurementOptions(),this.itemSizeCache],({count:n,paddingStart:s,scrollMargin:r,getItemKey:o,enabled:a},i)=>{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 c=this.pendingMeasuredCacheIndexes.length>0?Math.min(...this.pendingMeasuredCacheIndexes):0;this.pendingMeasuredCacheIndexes=[];const l=this.measurementsCache.slice(0,c);for(let d=c;d<n;d++){const f=o(d),h=this.options.lanes===1?l[d-1]:this.getFurthestMeasurement(l,d),p=h?h.end+this.options.gap:s+r,m=i.get(f),g=typeof m=="number"?m:this.options.estimateSize(d),v=p+g,x=h?h.lane:d%this.options.lanes;l[d]={index:d,start:p,size:g,end:v,key:f,lane:x}}return this.measurementsCache=l,l},{key:!1,debug:()=>this.options.debug}),this.calculateRange=ht(()=>[this.getMeasurements(),this.getSize(),this.getScrollOffset(),this.options.lanes],(n,s,r,o)=>this.range=n.length>0&&s>0?$5({measurements:n,outerSize:s,scrollOffset:r,lanes:o}):null,{key:!1,debug:()=>this.options.debug}),this.getVirtualIndexes=ht(()=>{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,i=this.elementsCache.get(a);i!==n&&(i&&this.observer.unobserve(i),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=ht(()=>[this.getVirtualIndexes(),this.getMeasurements()],(n,s)=>{const r=[];for(let o=0,a=n.length;o<a;o++){const i=n[o],c=s[i];r.push(c)}return r},{key:!1,debug:()=>this.options.debug}),this.getVirtualItemForOffset=n=>{const s=this.getMeasurements();if(s.length!==0)return pi(s[Eu(0,s.length-1,r=>pi(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 i=this.getTotalSize()+this.options.scrollMargin-o;return Math.max(Math.min(i,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 i=s==="end"?r.end+this.options.scrollPaddingEnd:r.start-this.options.scrollPaddingStart;return[this.getOffsetForAlignment(i,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,i=l=>{if(!this.targetWindow)return;const d=this.getOffsetForIndex(n,l);if(!d){console.warn("Failed to get offset for index:",n);return}const[f,h]=d;this._scrollToOffset(f,{adjustments:void 0,behavior:r}),this.targetWindow.requestAnimationFrame(()=>{const p=this.getScrollOffset(),m=this.getOffsetForIndex(n,h);if(!m){console.warn("Failed to get offset for index:",n);return}N5(m[0],p)||c(h)})},c=l=>{this.targetWindow&&(o++,o<a?this.targetWindow.requestAnimationFrame(()=>i(l)):console.warn(`Failed to scroll to index ${n} after ${a} attempts.`))};i(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(i=>i===null);){const i=s[a];o[i.lane]===null&&(o[i.lane]=i.end),a--}r=Math.max(...o.filter(i=>i!==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 $5({measurements:e,outerSize:t,scrollOffset:n,lanes:s}){const r=e.length-1,o=c=>e[c].start;if(e.length<=s)return{startIndex:0,endIndex:r};let a=Eu(0,r,o,n),i=a;if(s===1)for(;i<r&&e[i].end<n+t;)i++;else if(s>1){const c=Array(s).fill(0);for(;i<r&&c.some(d=>d<n+t);){const d=e[i];c[d.lane]=d.end,i++}const l=Array(s).fill(n+t);for(;a>=0&&l.some(d=>d>=n);){const d=e[a];l[d.lane]=d.start,a--}a=Math.max(0,a-a%s),i=Math.min(r,i+(s-1-i%s))}return{startIndex:a,endIndex:i}}const vi=typeof document<"u"?b.useLayoutEffect:b.useEffect;function z5(e){const t=b.useReducer(()=>({}),{})[1],n={...e,onChange:(r,o)=>{var a;o?Si.flushSync(t):t(),(a=e.onChange)==null||a.call(e,r,o)}},[s]=b.useState(()=>new F5(n));return s.setOptions(n),vi(()=>s._didMount(),[]),vi(()=>s._willUpdate()),s}function U5(e){return z5({observeElementRect:R5,observeElementOffset:D5,scrollToFn:L5,...e})}function B5(e){return`${e.slice(0,7)}...${e.slice(-5)}`}function V5(e){const{address:t,chainId:n}=e,[,s]=mr();if(!t)return null;const r=B5(t);function o(i){return()=>{s(i).catch(c=>{console.error("Failed to copy!",c)})}}const a=u.jsxs("button",{className:"flex items-center gap-1",onClick:o(t),children:[t,u.jsx(I,{className:"inline-block text-gray-600",name:"FilesEarmark",size:16})]});return u.jsx(Qe,{content:a,children:u.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:[u.jsx(su,{address:t,chainId:n}),r]})})}function H5(e){const{errors:t}=e,n=!!t?.length,s=n?"text-red-800":"text-green-700",r=n?u.jsx(I,{name:"Exclamation",size:16}):u.jsx(I,{name:"Check",size:16}),o=n?`Error: ${t[0]}`:"No errors",a=u.jsxs("span",{className:N("flex w-fit items-center rounded-lg border border-gray-200 px-2 py-1 text-xs",s,n&&"cursor-pointer"),children:[r,u.jsx("span",{className:N("inline-block max-w-36 truncate"),children:o})]}),i=t?.map((c,l)=>u.jsxs("p",{className:"text-red-800",children:["Error: ",c]},l));return n?u.jsx(Qe,{content:i,children:a}):a}function _5(e){const{operationType:t,operationInput:n}=e,s=u.jsx("code",{children:u.jsx("pre",{children:JSON.stringify(n,null,2)})});return u.jsx(Qe,{content:s,children:u.jsxs("span",{className:"flex cursor-pointer items-center gap-2 text-xs",children:[t,u.jsx(I,{className:"text-gray-300",name:"Braces",size:16})]})})}function W5(e){const{operationIndex:t,eventId:n,stateHash:s}=e,[,r]=mr(),o=t+1,a=u.jsxs("button",{className:"flex items-center gap-1",onClick:i(s),children:["Revision ",o," - Event ID: ",n," - State Hash: ",s,u.jsx(I,{className:"inline-block text-gray-600",name:"FilesEarmark",size:16})]});function i(c){return()=>{r(c).catch(l=>{console.error("Failed to copy!",l)})}}return u.jsx(Qe,{content:a,children:u.jsxs("span",{className:"flex cursor-pointer items-center gap-2 text-xs text-gray-600",children:["Revision ",o,".",u.jsx("a",{children:u.jsx(I,{className:"cursor-pointer text-slate-100",name:"Ellipsis",size:14})})]})})}function G5(e){const{signatures:t}=e;if(!t?.length)return null;const n=u.jsxs("div",{className:"text-xs text-slate-300",children:[u.jsx("h3",{className:"mb-2",children:"Signature details:"}),t.map((s,r)=>u.jsxs("div",{className:"mb-2 last:mb-0",children:[u.jsxs("h4",{children:["Signature #",r+1," -"," ",s.isVerified?"verified":"unverified"]}),u.jsx("code",{children:u.jsx("pre",{children:JSON.stringify(s,null,2)})})]},s.hash))]});return u.jsx(Qe,{content:n,children:u.jsxs("span",{className:"flex w-fit cursor-pointer items-center gap-1 rounded-lg border border-gray-200 px-2 py-1",children:[u.jsx(q5,{signatures:t})," ",u.jsx(I,{className:"text-gray-300",name:"InfoSquare",size:16})]})})}function q5(e){const{signatures:t}=e;if(!t?.length)return null;const n=t.length,s=t.filter(i=>i.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 u.jsx("span",{className:`text-xs ${a}`,children:o})}function Y5(e){const{timestampUtcMs:t}=e,n=typeof t=="string"&&!t.includes("-")?parseInt(t):t,s=new Date(n),r=Zn(s,"HH:mm 'UTC'"),o=Zn(s,"eee, dd MMM yyyy HH:mm:ss 'UTC'"),a=u.jsx("div",{children:o});return u.jsx(Qe,{content:a,children:u.jsxs("span",{className:"cursor-pointer text-xs",children:["committed at ",r]})})}function Q5(e){return u.jsxs("article",{className:"flex items-center justify-between rounded-xl border border-gray-200 bg-white px-4 py-2",children:[u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsx(W5,{...e}),u.jsx(_5,{...e}),u.jsx(V5,{...e}),u.jsx(Y5,{...e})]}),u.jsxs("div",{className:"flex items-center gap-1",children:[u.jsx(G5,{...e}),u.jsx(H5,{...e})]})]})}const K5=b.memo(Q5);function J5(e){const{operationIndex:t,skipCount:n}=e,s=t,r=n===1?`${s}`:`${s} - ${s+1-n}`;return u.jsxs("article",{className:"grid grid-cols-[1fr,auto,1fr] items-center py-2",children:[u.jsx("div",{className:"h-px rounded-full bg-slate-100"}),u.jsxs("div",{className:"mx-3 text-xs text-slate-100",children:["[Skipped Revision ",r,"]"]}),u.jsx("div",{className:"h-px rounded-full bg-slate-100"})]})}function X5(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:e6(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 Z5(e){const[t,n,s,r]=e;return{signerAddress:t,hash:n,prevStateHash:s,signatureBytes:r,isVerified:!0}}function e6(e){return e?.map(Z5)}function t6(e){const{timestampUtcMs:t}=e,n=Zn(t,"MMM dd, yyyy");return u.jsxs("h2",{className:"-ml-6 flex items-center gap-1 bg-slate-50 py-2 text-xs text-slate-100",children:[u.jsx(I,{name:"Ring",size:16})," Changes on ",n]})}function n6(e){const{localOperations:t,globalOperations:n,scope:s}=e,r=s==="local"?t:n,o=100,a=b.useMemo(()=>X5(r),[r]),[i,c]=b.useState(0),[l,d]=b.useState(o),[f,h]=b.useState(()=>a.slice(0,l)),p=b.useRef(null),m=f.length<a.length,g=U5({count:f.length,getScrollElement:()=>p.current,estimateSize:x=>a[x].height,gap:8});b.useEffect(()=>{if(!m)return;const x=Math.floor(i/46),y=o+x;d(C=>y>C?y:C)},[i,m]),b.useEffect(()=>{h(a.slice(0,l))},[a,l]);const v=x=>{c(y=>{const C=y+x.deltaY;return C<0?0:C})};return b.useEffect(()=>(window.addEventListener("wheel",v),()=>{window.removeEventListener("wheel",v)}),[]),u.jsx("div",{className:"border-l border-slate-100",ref:p,style:{height:`${g.getTotalSize()}px`,width:"100%",position:"relative"},children:g.getVirtualItems().map(x=>{const y=f[x.index];return u.jsxs("div",{style:{position:"absolute",top:0,left:16,width:"100%",height:`${x.size}px`,transform:`translateY(${x.start}px)`},children:[y.type==="revision"&&b.createElement(K5,{...y,key:x.key}),y.type==="skip"&&u.jsx(J5,{...y},x.key),y.type==="day"&&u.jsx(t6,{...y},x.key)]},x.index)})})}function fw(e){const{documentTitle:t,documentId:n,globalOperations:s,localOperations:r,onClose:o,itemsPerPage:a=100,documentState:i,onCopyState:c}=e,[l,d]=b.useState("global"),f=b.useMemo(()=>gd(bd(l==="global"?s:r)).sort((M,A)=>A.index-M.index),[s,r,l]),{pageItems:h,pages:p,goToPage:m,goToNextPage:g,goToPreviousPage:v,goToFirstPage:x,goToLastPage:y,hiddenNextPages:C,isNextPageAvailable:O,isPreviousPageAvailable:w}=cd(f,{itemsPerPage:a});function E(j){x(),d(j)}const P=f.length>a?u.jsx("div",{className:"mt-4 flex w-full justify-end",children:u.jsx(ld,{firstPageLabel:"First Page",goToFirstPage:x,goToLastPage:y,goToNextPage:g,goToPage:m,goToPreviousPage:v,hiddenNextPages:C,isNextPageAvailable:O,isPreviousPageAvailable:w,lastPageLabel:"Last Page",nextPageLabel:"Next",pages:p,previousPageLabel:"Previous"})}):u.jsx("hr",{className:"h-12 border-none"});return u.jsxs($c,{children:[u.jsx(I5,{docId:n,onChangeScope:E,onClose:o,scope:l,title:t,documentState:i,onCopyState:c}),P,u.jsx("div",{className:"mt-4 flex justify-center rounded-md bg-slate-50 p-4",children:f.length>0?u.jsx("div",{className:"grid grid-cols-[minmax(min-content,1018px)]",children:u.jsx(n6,{globalOperations:l==="global"?h:[],localOperations:l==="local"?h:[],scope:l})}):u.jsx("h3",{className:"my-40 text-gray-600",children:"This document has no recorded operations yet."})}),P]})}const r6=function(t){const{icon:n,title:s,description:r,containerClassName:o,active:a,onClick:i}=t;return u.jsx("div",{className:N("relative flex cursor-pointer flex-col items-center justify-center text-center text-sm text-black",o,a&&"bg-white",i&&"cursor-pointer"),onClick:i,children:u.jsx("div",{className:"mx-auto py-4",children:n||u.jsx("div",{className:"size-8 items-center justify-center rounded-lg bg-black pt-1",children:u.jsx("span",{className:"text-6 w-6 text-white",children:s.slice(0,1).toUpperCase()})})})})},hw=function(t){const{containerClassName:n,onClick:s}=t;return u.jsx(r6,{title:"Create New Drive",icon:u.jsx(I,{name:"PlusSquare",size:32}),onClick:s,containerClassName:n})},s6="/assets/renown-short-hover-BiSLBV7L.png",o6="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==",a6=({onLogin:e})=>{const[t,n]=b.useState(!1),s=!t&&!!e,r=t?u.jsx(I,{name:"Reload",size:14,className:"animate-spin"}):u.jsx("span",{children:"Connect"}),o=()=>{e&&(n(!0),e())};return u.jsxs("div",{className:"p-4",children:[u.jsx("div",{className:"mb-4 flex justify-center",children:u.jsx("div",{className:"flex h-[22px] w-[83px] items-center justify-center overflow-hidden",children:u.jsx(I,{name:"RenownLight",size:83})})}),u.jsx("button",{onClick:s?o:void 0,className:N("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})]})},i6=({onLogin:e})=>{const t=u.jsx(a6,{onLogin:e});return u.jsx(tc,{content:t,children:u.jsxs("div",{className:N("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:[u.jsx("img",{width:42,height:42,loading:"lazy",className:"group-hover/sidebar-footer:hidden",src:o6,alt:"Renown Login"}),u.jsx("img",{width:42,height:42,loading:"lazy",className:"hidden group-hover/sidebar-footer:block",src:s6,alt:"Renown Login Hover"})]})})},c6=e=>`${e.slice(0,7)}...${e.slice(-5)}`,l6=({address:e,onDisconnect:t,etherscanUrl:n,username:s=""})=>{const[r,o]=b.useState(!1),a=b.useCallback(async i=>{try{await navigator.clipboard.writeText(i),o(!0),setTimeout(()=>o(!1),2e3)}catch(c){console.error("Failed to copy address:",c)}},[]);return u.jsxs("div",{className:"flex flex-col divide-y divide-gray-200 text-gray-900",children:[u.jsxs("div",{className:"px-3 py-2",children:[s&&u.jsx("div",{className:"text-sm font-medium",children:s}),u.jsx("div",{className:"mt-1 flex items-center gap-2",children:u.jsx(Pe,{size:"small",color:"light",onClick:a.bind(null,e),className:"w-full cursor-pointer bg-transparent p-0 active:opacity-70",type:"button",children:u.jsxs("div",{className:"relative flex w-full items-center gap-1",children:[u.jsxs("div",{className:`flex items-center gap-1 transition-opacity duration-150 ${r?"opacity-0":"opacity-100"}`,children:[u.jsx("span",{className:"text-xs",children:c6(e)}),u.jsx(I,{name:"FilesEarmark",color:"#9EA0A1",size:14})]}),u.jsx("div",{className:`absolute left-0 text-xs transition-opacity duration-150 ${r?"opacity-100":"opacity-0"}`,children:"Copied to clipboard!"})]})})})]}),n&&u.jsx("div",{className:"px-3 py-2",children:u.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:[u.jsx(I,{name:"Ethscan",size:14}),"View on Etherscan"]})}),u.jsx("div",{className:"px-3 py-2",children:u.jsxs("button",{onClick:t,className:N("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:[u.jsx(I,{name:"Disconnect",size:14,color:"#EA4335"}),"Disconnect"]})})]})},u6=({address:e,etherscanUrl:t,onDisconnect:n})=>{const{data:s}=ru({address:e}),r=s,o=u.jsx(l6,{address:e,username:r,onDisconnect:n,etherscanUrl:t});return u.jsx(tc,{content:o,children:u.jsx("div",{className:"flex items-center justify-center rounded-sm",children:u.jsx(su,{address:e,size:"40px"})})})},d6=({address:e,className:t,onLogin:n,onClickSettings:s,onDisconnect:r,etherscanUrl:o="",...a})=>u.jsxs(ud,{...a,className:N("flex flex-col gap-2 border-t border-gray-300 px-2 py-4",t),children:[u.jsx("div",{children:e?u.jsx(u6,{address:e,onDisconnect:r,etherscanUrl:o}):u.jsx(i6,{onLogin:n})}),u.jsxs("button",{"aria-label":"Settings",type:"button",className:N("mt-3 flex w-full items-center justify-center outline-none",s?"cursor-pointer":"cursor-wait"),onClick:s,children:[u.jsx(I,{className:"text-gray-600",name:"Settings"}),u.jsx("span",{className:"hidden text-sm font-semibold leading-6 text-gray-800",children:"Settings"})]})]}),f6=({onClick:e,className:t,children:n,...s})=>u.jsx(dd,{...s,className:N("flex justify-center gap-4 border-b border-gray-300 py-4",t),children:u.jsx("button",{"aria-label":"Home",className:e?"cursor-pointer":"cursor-wait",onClick:e,type:"button",children:u.jsx(I,{className:"text-gray-600",name:"ConnectSmall",size:24})})}),pw=({onClick:e,address:t,headerContent:n,onClickSettings:s,maxWidth:r="304px",minWidth:o="58px",onLogin:a,onDisconnect:i,etherscanUrl:c,...l})=>u.jsxs(fd,{...l,maxWidth:r,minWidth:o,children:[u.jsxs(hd,{children:[u.jsx(f6,{onClick:e,children:n}),u.jsx("div",{className:"flex flex-col",children:l.children})]}),u.jsx(d6,{address:t,onClickSettings:s,onLogin:a,onDisconnect:i,etherscanUrl:c})]}),hn=e=>typeof e=="number"&&!isNaN(e),nt=e=>typeof e=="string",ve=e=>typeof e=="function",Kn=e=>nt(e)||ve(e)?e:null,$s=e=>b.isValidElement(e)||nt(e)||ve(e)||hn(e);function h6(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 jr(e){let{enter:t,exit:n,appendPosition:s=!1,collapse:r=!0,collapseDuration:o=300}=e;return function(a){let{children:i,position:c,preventExitTransition:l,done:d,nodeRef:f,isIn:h,playToast:p}=a;const m=s?`${t}--${c}`:t,g=s?`${n}--${c}`:n,v=b.useRef(0);return b.useLayoutEffect(()=>{const x=f.current,y=m.split(" "),C=O=>{O.target===f.current&&(p(),x.removeEventListener("animationend",C),x.removeEventListener("animationcancel",C),v.current===0&&O.type!=="animationcancel"&&x.classList.remove(...y))};x.classList.add(...y),x.addEventListener("animationend",C),x.addEventListener("animationcancel",C)},[]),b.useEffect(()=>{const x=f.current,y=()=>{x.removeEventListener("animationend",y),r?h6(x,d,o):d()};h||(l?y():(v.current=1,x.className+=` ${g}`,x.addEventListener("animationend",y)))},[h]),W.createElement(W.Fragment,null,i)}}function yi(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 pn=[];const zs=new Set,p6=e=>zs.forEach(t=>t(e)),Pu=()=>pe.size>0;function Ou(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 ju(e,t){$s(e)&&(Pu()||pn.push({content:e,options:t}),pe.forEach(n=>{n.buildToast(e,t)}))}function xi(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 m6(e){const{subscribe:t,getSnapshot:n,setProps:s}=b.useRef((function(o){const a=o.containerId||1;return{subscribe(i){const c=(function(d,f,h){let p=1,m=0,g=[],v=[],x=[],y=f;const C=new Map,O=new Set,w=()=>{x=Array.from(C.values()),O.forEach(P=>P())},E=P=>{v=P==null?[]:v.filter(j=>j!==P),w()},S=P=>{const{toastId:j,onOpen:M,updateId:A,children:R}=P.props,k=A==null;P.staleId&&C.delete(P.staleId),C.set(j,P),v=[...v,P.props.toastId].filter(z=>z!==P.staleId),w(),h(yi(P,k?"added":"updated")),k&&ve(M)&&M(b.isValidElement(R)&&R.props)};return{id:d,props:y,observe:P=>(O.add(P),()=>O.delete(P)),toggle:(P,j)=>{C.forEach(M=>{j!=null&&j!==M.props.toastId||ve(M.toggle)&&M.toggle(P)})},removeToast:E,toasts:C,clearQueue:()=>{m-=g.length,g=[]},buildToast:(P,j)=>{if((U=>{let{containerId:Y,toastId:X,updateId:re}=U;const Z=Y?Y!==d:d!==1,V=C.has(X)&&re==null;return Z||V})(j))return;const{toastId:M,updateId:A,data:R,staleId:k,delay:z}=j,$=()=>{E(M)},B=A==null;B&&m++;const G={...y,style:y.toastStyle,key:p++,...Object.fromEntries(Object.entries(j).filter(U=>{let[Y,X]=U;return X!=null})),toastId:M,updateId:A,data:R,closeToast:$,isIn:!1,className:Kn(j.className||y.toastClassName),bodyClassName:Kn(j.bodyClassName||y.bodyClassName),progressClassName:Kn(j.progressClassName||y.progressClassName),autoClose:!j.isLoading&&(q=j.autoClose,ee=y.autoClose,q===!1||hn(q)&&q>0?q:ee),deleteToast(){const U=C.get(M),{onClose:Y,children:X}=U.props;ve(Y)&&Y(b.isValidElement(X)&&X.props),h(yi(U,"removed")),C.delete(M),m--,m<0&&(m=0),g.length>0?S(g.shift()):w()}};var q,ee;G.closeButton=y.closeButton,j.closeButton===!1||$s(j.closeButton)?G.closeButton=j.closeButton:j.closeButton===!0&&(G.closeButton=!$s(y.closeButton)||y.closeButton);let ne=P;b.isValidElement(P)&&!nt(P.type)?ne=b.cloneElement(P,{closeToast:$,toastProps:G,data:R}):ve(P)&&(ne=P({closeToast:$,toastProps:G,data:R}));const ie={content:ne,props:G,staleId:k};y.limit&&y.limit>0&&m>y.limit&&B?g.push(ie):hn(z)?setTimeout(()=>{S(ie)},z):S(ie)},setProps(P){y=P},setToggle:(P,j)=>{C.get(P).toggle=j},isToastActive:P=>v.some(j=>j===P),getSnapshot:()=>x}})(a,o,p6);pe.set(a,c);const l=c.observe(i);return pn.forEach(d=>ju(d.content,d.options)),pn=[],()=>{l(),pe.delete(a)}},setProps(i){var c;(c=pe.get(a))==null||c.setProps(i)},getSnapshot(){var i;return(i=pe.get(a))==null?void 0:i.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(i=>{const{position:c}=i.props;a.has(c)||a.set(c,[]),a.get(c).push(i)}),Array.from(a,i=>o(i[0],i[1]))},isToastActive:Ou,count:r?.length}}function g6(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:i,pauseOnHover:c,closeToast:l,onClick:d,closeOnClick:f}=e;var h,p;function m(){n(!0)}function g(){n(!1)}function v(C){const O=o.current;a.canDrag&&O&&(a.didMove=!0,t&&g(),a.delta=e.draggableDirection==="x"?C.clientX-a.start:C.clientY-a.start,a.start!==C.clientX&&(a.canCloseOnClick=!1),O.style.transform=`translate3d(${e.draggableDirection==="x"?`${a.delta}px, var(--y)`:`0, calc(${a.delta}px + var(--y))`},0)`,O.style.opacity=""+(1-Math.abs(a.delta/a.removalDistance)))}function x(){document.removeEventListener("pointermove",v),document.removeEventListener("pointerup",x);const C=o.current;if(a.canDrag&&a.didMove&&C){if(a.canDrag=!1,Math.abs(a.delta)>a.removalDistance)return r(!0),e.closeToast(),void e.collapseAll();C.style.transition="transform 0.2s, opacity 0.2s",C.style.removeProperty("transform"),C.style.removeProperty("opacity")}}(p=pe.get((h={id:e.toastId,containerId:e.containerId,fn:n}).containerId||1))==null||p.setToggle(h.id,h.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 y={onPointerDown:function(C){if(e.draggable===!0||e.draggable===C.pointerType){a.didMove=!1,document.addEventListener("pointermove",v),document.addEventListener("pointerup",x);const O=o.current;a.canCloseOnClick=!0,a.canDrag=!0,O.style.transition="none",e.draggableDirection==="x"?(a.start=C.clientX,a.removalDistance=O.offsetWidth*(e.draggablePercent/100)):(a.start=C.clientY,a.removalDistance=O.offsetHeight*(e.draggablePercent===80?1.5*e.draggablePercent:e.draggablePercent)/100)}},onPointerUp:function(C){const{top:O,bottom:w,left:E,right:S}=o.current.getBoundingClientRect();C.nativeEvent.type!=="touchend"&&e.pauseOnHover&&C.clientX>=E&&C.clientX<=S&&C.clientY>=O&&C.clientY<=w?g():m()}};return i&&c&&(y.onMouseEnter=g,e.stacked||(y.onMouseLeave=m)),f&&(y.onClick=C=>{d&&d(C),a.canCloseOnClick&&l()}),{playToast:m,pauseToast:g,isRunning:t,preventExitTransition:s,toastRef:o,eventHandlers:y}}function b6(e){let{delay:t,isRunning:n,closeToast:s,type:r="default",hide:o,className:a,style:i,controlledProgress:c,progress:l,rtl:d,isIn:f,theme:h}=e;const p=o||c&&l===0,m={...i,animationDuration:`${t}ms`,animationPlayState:n?"running":"paused"};c&&(m.transform=`scaleX(${l})`);const g=Ve("Toastify__progress-bar",c?"Toastify__progress-bar--controlled":"Toastify__progress-bar--animated",`Toastify__progress-bar-theme--${h}`,`Toastify__progress-bar--${r}`,{"Toastify__progress-bar--rtl":d}),v=ve(a)?a({rtl:d,type:r,defaultClassName:g}):Ve(g,a),x={[c&&l>=1?"onTransitionEnd":"onAnimationEnd"]:c&&l<1?null:()=>{f&&s()}};return W.createElement("div",{className:"Toastify__progress-bar--wrp","data-hidden":p},W.createElement("div",{className:`Toastify__progress-bar--bg Toastify__progress-bar-theme--${h} Toastify__progress-bar--${r}`}),W.createElement("div",{role:"progressbar","aria-hidden":p?"true":"false","aria-label":"notification timer",className:v,style:m,...x}))}let v6=1;const Iu=()=>""+v6++;function y6(e){return e&&(nt(e.toastId)||hn(e.toastId))?e.toastId:Iu()}function Ft(e,t){return ju(e,t),t.toastId}function dr(e,t){return{...t,type:t&&t.type||e,toastId:y6(t)}}function Un(e){return(t,n)=>Ft(t,dr(e,n))}function K(e,t){return Ft(e,dr("default",t))}K.loading=(e,t)=>Ft(e,dr("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=nt(r)?K.loading(r,n):K.loading(r.render,{...n,...r}));const i={isLoading:null,autoClose:null,closeOnClick:null,closeButton:null,draggable:null},c=(d,f,h)=>{if(f==null)return void K.dismiss(s);const p={type:d,...i,...n,data:h},m=nt(f)?{render:f}:f;return s?K.update(s,{...p,...m}):K(m.render,{...p,...m}),h},l=ve(e)?e():e;return l.then(d=>c("success",a,d)).catch(d=>c("error",o,d)),l},K.success=Un("success"),K.info=Un("info"),K.error=Un("error"),K.warning=Un("warning"),K.warn=K.warning,K.dark=(e,t)=>Ft(e,dr("default",{theme:"dark",...t})),K.dismiss=function(e){(function(t){var n;if(Pu()){if(t==null||nt(n=t)||hn(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 pn=pn.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=Ou,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:Iu()};o.toastId!==e&&(o.staleId=e);const a=o.render||r;delete o.render,Ft(a,o)}},K.done=e=>{K.update(e,{progress:1})},K.onChange=function(e){return zs.add(e),()=>{zs.delete(e)}},K.play=e=>xi(!0,e),K.pause=e=>xi(!1,e);const x6=typeof window<"u"?b.useLayoutEffect:b.useEffect,Bn=e=>{let{theme:t,type:n,isLoading:s,...r}=e;return W.createElement("svg",{viewBox:"0 0 24 24",width:"100%",height:"100%",fill:t==="colored"?"currentColor":`var(--toastify-icon-color-${n})`,...r})},Jr={info:function(e){return W.createElement(Bn,{...e},W.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 W.createElement(Bn,{...e},W.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 W.createElement(Bn,{...e},W.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 W.createElement(Bn,{...e},W.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 W.createElement("div",{className:"Toastify__spinner"})}},w6=e=>{const{isRunning:t,preventExitTransition:n,toastRef:s,eventHandlers:r,playToast:o}=g6(e),{closeButton:a,children:i,autoClose:c,onClick:l,type:d,hideProgressBar:f,closeToast:h,transition:p,position:m,className:g,style:v,bodyClassName:x,bodyStyle:y,progressClassName:C,progressStyle:O,updateId:w,role:E,progress:S,rtl:P,toastId:j,deleteToast:M,isIn:A,isLoading:R,closeOnClick:k,theme:z}=e,$=Ve("Toastify__toast",`Toastify__toast-theme--${z}`,`Toastify__toast--${d}`,{"Toastify__toast--rtl":P},{"Toastify__toast--close-on-click":k}),B=ve(g)?g({rtl:P,position:m,type:d,defaultClassName:$}):Ve($,g),G=(function(ie){let{theme:U,type:Y,isLoading:X,icon:re}=ie,Z=null;const V={theme:U,type:Y};return re===!1||(ve(re)?Z=re({...V,isLoading:X}):b.isValidElement(re)?Z=b.cloneElement(re,V):X?Z=Jr.spinner():(se=>se in Jr)(Y)&&(Z=Jr[Y](V))),Z})(e),q=!!S||!c,ee={closeToast:h,type:d,theme:z};let ne=null;return a===!1||(ne=ve(a)?a(ee):b.isValidElement(a)?b.cloneElement(a,ee):(function(ie){let{closeToast:U,theme:Y,ariaLabel:X="close"}=ie;return W.createElement("button",{className:`Toastify__close-button Toastify__close-button--${Y}`,type:"button",onClick:re=>{re.stopPropagation(),U(re)},"aria-label":X},W.createElement("svg",{"aria-hidden":"true",viewBox:"0 0 14 16"},W.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"})))})(ee)),W.createElement(p,{isIn:A,done:M,position:m,preventExitTransition:n,nodeRef:s,playToast:o},W.createElement("div",{id:j,onClick:l,"data-in":A,className:B,...r,style:v,ref:s},W.createElement("div",{...A&&{role:E},className:ve(x)?x({type:d}):Ve("Toastify__toast-body",x),style:y},G!=null&&W.createElement("div",{className:Ve("Toastify__toast-icon",{"Toastify--animate-icon Toastify__zoom-enter":!R})},G),W.createElement("div",null,i)),ne,W.createElement(b6,{...w&&!q?{key:`pb-${w}`}:{},rtl:P,theme:z,delay:c,isRunning:t,isIn:A,closeToast:h,hide:f,type:d,style:O,className:C,controlledProgress:q,progress:S||0})))},Ir=function(e,t){return t===void 0&&(t=!1),{enter:`Toastify--animate Toastify__${e}-enter`,exit:`Toastify--animate Toastify__${e}-exit`,appendPosition:t}},C6=jr(Ir("bounce",!0));jr(Ir("slide",!0));jr(Ir("zoom"));jr(Ir("flip"));const S6={position:"top-right",transition:C6,autoClose:5e3,closeButton:!0,pauseOnHover:!0,pauseOnFocusLoss:!0,draggable:"touch",draggablePercent:80,draggableDirection:"x",role:"alert",theme:"light"};function E6(e){let t={...S6,...e};const n=e.stacked,[s,r]=b.useState(!0),o=b.useRef(null),{getToastToRender:a,isToastActive:i,count:c}=m6(t),{className:l,style:d,rtl:f,containerId:h}=t;function p(g){const v=Ve("Toastify__toast-container",`Toastify__toast-container--${g}`,{"Toastify__toast-container--rtl":f});return ve(l)?l({position:g,rtl:f,defaultClassName:v}):Ve(v,Kn(l))}function m(){n&&(r(!0),K.play())}return x6(()=>{if(n){var g;const v=o.current.querySelectorAll('[data-in="true"]'),x=12,y=(g=t.position)==null?void 0:g.includes("top");let C=0,O=0;Array.from(v).reverse().forEach((w,E)=>{const S=w;S.classList.add("Toastify__toast--stacked"),E>0&&(S.dataset.collapsed=`${s}`),S.dataset.pos||(S.dataset.pos=y?"top":"bot");const P=C*(s?.2:1)+(s?0:x*E);S.style.setProperty("--y",`${y?P:-1*P}px`),S.style.setProperty("--g",`${x}`),S.style.setProperty("--s",""+(1-(s?O:0))),C+=S.offsetHeight,O+=.025})}},[s,c,n]),W.createElement("div",{ref:o,className:"Toastify",id:h,onMouseEnter:()=>{n&&(r(!1),K.pause())},onMouseLeave:m},a((g,v)=>{const x=v.length?{...d}:{...d,pointerEvents:"none"};return W.createElement("div",{className:p(g),style:x,key:`container-${g}`},v.map(y=>{let{content:C,props:O}=y;return W.createElement(w6,{...O,stacked:n,collapseAll:m,isIn:i(O.toastId,O.containerId),style:O.style,key:`toast-${O.key}`},C)}))}))}function P6(e){return e==="connect-success"||e==="connect-warning"||e==="connect-loading"||e==="connect-deleted"}function O6(e){if(P6(e)){const t={};switch(e){case"connect-success":t.type="success",t.icon=u.jsx(I,{className:"text-green-800",name:"CheckCircleFill",size:24});break;case"connect-warning":t.type="warning",t.icon=u.jsx(I,{className:"text-gray-600",name:"WarningFill",size:24});break;case"connect-loading":t.type="default",t.icon=u.jsx(I,{className:"text-gray-600",name:"ClockFill",size:24});break;case"connect-deleted":t.type="error",t.icon=u.jsx(I,{className:"text-red-800",name:"TrashFill",size:24});break}return t}return{type:e}}function mw(e,t){const{type:n="default",...s}=t||{},r=O6(n);return K(e,{...r,...s})}const j6=({closeToast:e})=>u.jsx("button",{className:"flex items-center text-gray-500 hover:text-gray-600",onClick:e,children:u.jsx(I,{name:"XmarkLight",size:16})}),gw=e=>u.jsx(E6,{closeButton:j6,...e}),wi=ty({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}}}),I6=Ay({chains:[wi],transports:{[wi.id]:cy()}}),N6=new lx;function bw(e){const{children:t,wagmiProviderProps:n,queryClientProviderProps:s}=e,{config:r=I6,...o}=n??{},{client:a=N6,...i}=s??{};return u.jsx(ky,{config:r,...o,children:u.jsx(bx,{client:a,...i,children:t})})}export{L0 as A,V6 as B,Qd as C,G6 as D,iw as E,K6 as F,cw as G,Z6 as H,lw as I,uw as J,dw as K,t5 as L,n5 as M,r5 as N,s5 as O,Yd as P,Gd as R,r6 as S,qd as T,bw as W,Wd as a,A0 as b,pw as c,gw as d,_6 as e,W6 as f,q6 as g,fw as h,U5 as i,zc as j,J6 as k,X6 as l,Xx as m,hw as n,ew as o,Cu as p,ow as q,tw as r,H6 as s,mw as t,B6 as u,Sn as v,nw as w,rw as x,sw as y,aw as z};
|