@ensofinance/checkout-widget 0.0.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.
Files changed (128) hide show
  1. package/dist/checkout-widget.es.js +52889 -0
  2. package/dist/checkout-widget.es.js.map +1 -0
  3. package/dist/checkout-widget.umd.js +203 -0
  4. package/dist/checkout-widget.umd.js.map +1 -0
  5. package/dist/index.d.ts +23 -0
  6. package/enso-api.yaml +1982 -0
  7. package/orval.config.ts +25 -0
  8. package/package.json +79 -0
  9. package/src/assets/BinanceBadge.svg +4 -0
  10. package/src/assets/CoinbaseIcon.svg +4 -0
  11. package/src/assets/USD Coin (USDC).svg +5 -0
  12. package/src/assets/avecIcon.svg +5 -0
  13. package/src/assets/base.webp +0 -0
  14. package/src/assets/depositIcon.svg +6 -0
  15. package/src/assets/eth.webp +0 -0
  16. package/src/assets/ethMainnetIcon.svg +10 -0
  17. package/src/assets/fail.svg +5 -0
  18. package/src/assets/kraken.png +0 -0
  19. package/src/assets/logo.svg +10 -0
  20. package/src/assets/mastercard.png +0 -0
  21. package/src/assets/metamask.png +0 -0
  22. package/src/assets/rabby.png +0 -0
  23. package/src/assets/success.svg +4 -0
  24. package/src/assets/usdc.webp +0 -0
  25. package/src/assets/usdt.webp +0 -0
  26. package/src/assets/visa.png +0 -0
  27. package/src/assets/visa.webp +0 -0
  28. package/src/components/BridgeFee.tsx +58 -0
  29. package/src/components/ChakraProvider.tsx +372 -0
  30. package/src/components/Checkout.tsx +127 -0
  31. package/src/components/CheckoutModal.tsx +22 -0
  32. package/src/components/CircleTimer.tsx +66 -0
  33. package/src/components/CurrencySwapDisplay.tsx +153 -0
  34. package/src/components/DepositProcessing.tsx +116 -0
  35. package/src/components/ExchangeConfirmSecurity.tsx +110 -0
  36. package/src/components/QuoteParameters.tsx +341 -0
  37. package/src/components/TransactionDetailRow.tsx +124 -0
  38. package/src/components/cards/AssetCard.tsx +167 -0
  39. package/src/components/cards/ExchangeCard.tsx +53 -0
  40. package/src/components/cards/OptionCard.tsx +59 -0
  41. package/src/components/cards/WalletCard.tsx +99 -0
  42. package/src/components/cards/index.ts +6 -0
  43. package/src/components/modal.tsx +83 -0
  44. package/src/components/steps/ExchangeFlow.tsx +1402 -0
  45. package/src/components/steps/InitialStep.tsx +169 -0
  46. package/src/components/steps/QuoteStep.tsx +121 -0
  47. package/src/components/steps/WalletAmountStep.tsx +258 -0
  48. package/src/components/steps/WalletConfirmStep.tsx +404 -0
  49. package/src/components/steps/WalletTokenStep.tsx +128 -0
  50. package/src/components/ui/index.tsx +394 -0
  51. package/src/components/ui/styled.tsx +85 -0
  52. package/src/components/ui/toaster.tsx +43 -0
  53. package/src/components/ui/tooltip.tsx +46 -0
  54. package/src/enso-api/api.ts +173 -0
  55. package/src/enso-api/custom-instance.ts +35 -0
  56. package/src/enso-api/index.ts +5119 -0
  57. package/src/enso-api/model/action.ts +17 -0
  58. package/src/enso-api/model/actionAction.ts +52 -0
  59. package/src/enso-api/model/actionInputs.ts +12 -0
  60. package/src/enso-api/model/actionToBundle.ts +19 -0
  61. package/src/enso-api/model/actionToBundleAction.ts +53 -0
  62. package/src/enso-api/model/actionToBundleArgs.ts +12 -0
  63. package/src/enso-api/model/bundleControllerBundleShortcutTransactionParams.ts +53 -0
  64. package/src/enso-api/model/bundleControllerBundleShortcutTransactionRoutingStrategy.ts +23 -0
  65. package/src/enso-api/model/bundleShortcutTransaction.ts +35 -0
  66. package/src/enso-api/model/bundleShortcutTransactionAmountsOut.ts +15 -0
  67. package/src/enso-api/model/bundleShortcutTransactionFeeAmount.ts +12 -0
  68. package/src/enso-api/model/connectedNetwork.ts +16 -0
  69. package/src/enso-api/model/hop.ts +24 -0
  70. package/src/enso-api/model/hopArgs.ts +12 -0
  71. package/src/enso-api/model/index.ts +70 -0
  72. package/src/enso-api/model/iporControllerIporShortcutTransactionParams.ts +21 -0
  73. package/src/enso-api/model/iporShortcutInput.ts +33 -0
  74. package/src/enso-api/model/iporShortcutTransaction.ts +22 -0
  75. package/src/enso-api/model/lZDestinationTokenData.ts +19 -0
  76. package/src/enso-api/model/lZPoolLookupResponse.ts +26 -0
  77. package/src/enso-api/model/layerZeroControllerGetPoolAddressParams.ts +29 -0
  78. package/src/enso-api/model/network.ts +15 -0
  79. package/src/enso-api/model/networksControllerNetworksParams.ts +21 -0
  80. package/src/enso-api/model/nonTokenizedControllerTokens200.ts +15 -0
  81. package/src/enso-api/model/nonTokenizedControllerTokens200AllOf.ts +16 -0
  82. package/src/enso-api/model/nonTokenizedControllerTokensParams.ts +41 -0
  83. package/src/enso-api/model/nonTokenizedModel.ts +27 -0
  84. package/src/enso-api/model/nontokenizedControllerRouteNontokenizedShorcutTransactionParams.ts +64 -0
  85. package/src/enso-api/model/nontokenizedControllerRouteNontokenizedShorcutTransactionRoutingStrategy.ts +22 -0
  86. package/src/enso-api/model/paginatedResult.ts +16 -0
  87. package/src/enso-api/model/paginationMeta.ts +27 -0
  88. package/src/enso-api/model/positionModel.ts +77 -0
  89. package/src/enso-api/model/price.ts +20 -0
  90. package/src/enso-api/model/pricesControllerGetPricesParams.ts +17 -0
  91. package/src/enso-api/model/project.ts +15 -0
  92. package/src/enso-api/model/protocol.ts +15 -0
  93. package/src/enso-api/model/protocolModel.ts +26 -0
  94. package/src/enso-api/model/protocolsControllerFindAllParams.ts +21 -0
  95. package/src/enso-api/model/routeShortcutTransaction.ts +33 -0
  96. package/src/enso-api/model/routeShortcutVariableInputs.ts +68 -0
  97. package/src/enso-api/model/routeShortcutVariableInputsRoutingStrategy.ts +27 -0
  98. package/src/enso-api/model/routeShortcutVariableInputsVariableEstimates.ts +14 -0
  99. package/src/enso-api/model/routerControllerRouteShortcutTransactionParams.ts +91 -0
  100. package/src/enso-api/model/routerControllerRouteShortcutTransactionRoutingStrategy.ts +23 -0
  101. package/src/enso-api/model/standard.ts +18 -0
  102. package/src/enso-api/model/standardAction.ts +20 -0
  103. package/src/enso-api/model/standardActionAction.ts +53 -0
  104. package/src/enso-api/model/tokenModel.ts +36 -0
  105. package/src/enso-api/model/tokensControllerTokens200.ts +15 -0
  106. package/src/enso-api/model/tokensControllerTokens200AllOf.ts +16 -0
  107. package/src/enso-api/model/tokensControllerTokensParams.ts +91 -0
  108. package/src/enso-api/model/tokensControllerTokensType.ts +19 -0
  109. package/src/enso-api/model/transaction.ts +17 -0
  110. package/src/enso-api/model/userOperation.ts +28 -0
  111. package/src/enso-api/model/walletApproveTransaction.ts +24 -0
  112. package/src/enso-api/model/walletApproveTransactionTx.ts +15 -0
  113. package/src/enso-api/model/walletBalance.ts +29 -0
  114. package/src/enso-api/model/walletControllerCreateApproveTransactionParams.ts +35 -0
  115. package/src/enso-api/model/walletControllerCreateApproveTransactionRoutingStrategy.ts +23 -0
  116. package/src/enso-api/model/walletControllerWalletBalancesParams.ts +25 -0
  117. package/src/index.ts +17 -0
  118. package/src/store.ts +68 -0
  119. package/src/types/assets.d.ts +29 -0
  120. package/src/types/index.ts +21 -0
  121. package/src/util/common.tsx +324 -0
  122. package/src/util/constants.tsx +213 -0
  123. package/src/util/enso-hooks.tsx +203 -0
  124. package/src/util/index.tsx +68 -0
  125. package/src/util/tx-tracker.tsx +301 -0
  126. package/src/util/wallet.tsx +258 -0
  127. package/tsconfig.json +13 -0
  128. package/vite.config.ts +51 -0
@@ -0,0 +1,203 @@
1
+ (function(_e,k){typeof exports=="object"&&typeof module!="undefined"?k(exports,require("react/jsx-runtime"),require("react"),require("wagmi"),require("react-dom"),require("react-dom/server"),require("@tanstack/react-query")):typeof define=="function"&&define.amd?define(["exports","react/jsx-runtime","react","wagmi","react-dom","react-dom/server","@tanstack/react-query"],k):(_e=typeof globalThis!="undefined"?globalThis:_e||self,k(_e.CheckoutWidget={},_e.ReactJsxRuntime,_e.React,_e.wagmi,_e.ReactDOM,_e.require$$4,_e.reactQuery))})(this,function(_e,k,J,Xe,Ds,BT,Ki){"use strict";var wK=Object.defineProperty;var AT=_e=>{throw TypeError(_e)};var xK=(_e,k,J)=>k in _e?wK(_e,k,{enumerable:!0,configurable:!0,writable:!0,value:J}):_e[k]=J;var oe=(_e,k,J)=>xK(_e,typeof k!="symbol"?k+"":k,J),Hb=(_e,k,J)=>k.has(_e)||AT("Cannot "+J);var F=(_e,k,J)=>(Hb(_e,k,"read from private field"),J?J.call(_e):k.get(_e)),ce=(_e,k,J)=>k.has(_e)?AT("Cannot add the same private member more than once"):k instanceof WeakSet?k.add(_e):k.set(_e,J),K=(_e,k,J,Xe)=>(Hb(_e,k,"write to private field"),Xe?Xe.call(_e,J):k.set(_e,J),J),be=(_e,k,J)=>(Hb(_e,k,"access private method"),J);var Hd=(_e,k,J,Xe)=>({set _(Ds){K(_e,k,Ds,J)},get _(){return F(_e,k,Xe)}});var sO,aO,lO,cO,uO,dO,fO,hO,pO,gO,mO,yO,bO,vO,wO,xO,EO,SO,AO,kO,CO,IO,OO,TO,PO,NO,BO,RO,MO,LO,FO,_O,VO,DO,zO,UO,$O,HO,WO,GO,jO,KO,qO,YO,QO,XO,JO,ZO,eT,tT,nT,rT,iT,oT,sT,aT,lT,cT,uT,dT,fT,hT,pT,hc,Ra,xs,pc,gc,ai,Oo,mc,yc,fn,xr,To,Ma,La,Fa,Fi,li,Es,_a,Wd,Pd,Nd,Bd,Er,bc,Va,vc,Po,Da,xc,ng,sr,Sr,za,Ua,Ss,$a,Wb,OT,Ec,_i,Sc,Ha,No,Ga,ui,Ac,kc,Cc,Ic,Oc,Tc,Pc,Nc,Bc,Rc,Mc,ja,As,Vi,ks,Lc,Fc,rg,Ar,Rd,Ro,_c,Kp,TT,Sn,di,Md,Gb,Vc,ig,Cs,nu,Di,zi,Ui,Rn,$i,og,sg,Mo,Ld,Is,Dc,Fd,_d,gT,Os,qa,Ts,ru,Qp,PT,Dd,zd,Uc,$c,Ps,Lo,zr,Ns,Hi,Wc,ag,Ya,Qa,Bs,Gc,Fo,Xp,jc,_o,Kc,qc,Rs,Ur,Jp,NT,Mn,Ms,Ln,Yc,kr,Xa,Ls,Vo,Ud,$r,Qc,Xc,He,Cr,jb,Kb,Gd,qb,jd,lg,Kn,Wi,Ja,Fs,Za,Jc,_s,Yb,Qb,el,tl,Zc,Do,Gi,fi,Hr,ar,$d,Xb,Vs,eu,tu;function RT(t){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const n in t)if(n!=="default"){const r=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(e,n,r.get?r:{enumerable:!0,get:()=>t[n]})}}return e.default=t,Object.freeze(e)}const Ke=RT(J);function Jb(t){var e=Object.create(null);return function(n){return e[n]===void 0&&(e[n]=t(n)),e[n]}}var MT=/^((children|dangerouslySetInnerHTML|key|ref|autoFocus|defaultValue|defaultChecked|innerHTML|suppressContentEditableWarning|suppressHydrationWarning|valueLink|abbr|accept|acceptCharset|accessKey|action|allow|allowUserMedia|allowPaymentRequest|allowFullScreen|allowTransparency|alt|async|autoComplete|autoPlay|capture|cellPadding|cellSpacing|challenge|charSet|checked|cite|classID|className|cols|colSpan|content|contentEditable|contextMenu|controls|controlsList|coords|crossOrigin|data|dateTime|decoding|default|defer|dir|disabled|disablePictureInPicture|disableRemotePlayback|download|draggable|encType|enterKeyHint|fetchpriority|fetchPriority|form|formAction|formEncType|formMethod|formNoValidate|formTarget|frameBorder|headers|height|hidden|high|href|hrefLang|htmlFor|httpEquiv|id|inputMode|integrity|is|keyParams|keyType|kind|label|lang|list|loading|loop|low|marginHeight|marginWidth|max|maxLength|media|mediaGroup|method|min|minLength|multiple|muted|name|nonce|noValidate|open|optimum|pattern|placeholder|playsInline|poster|preload|profile|radioGroup|readOnly|referrerPolicy|rel|required|reversed|role|rows|rowSpan|sandbox|scope|scoped|scrolling|seamless|selected|shape|size|sizes|slot|span|spellCheck|src|srcDoc|srcLang|srcSet|start|step|style|summary|tabIndex|target|title|translate|type|useMap|value|width|wmode|wrap|about|datatype|inlist|prefix|property|resource|typeof|vocab|autoCapitalize|autoCorrect|autoSave|color|incremental|fallback|inert|itemProp|itemScope|itemType|itemID|itemRef|on|option|results|security|unselectable|accentHeight|accumulate|additive|alignmentBaseline|allowReorder|alphabetic|amplitude|arabicForm|ascent|attributeName|attributeType|autoReverse|azimuth|baseFrequency|baselineShift|baseProfile|bbox|begin|bias|by|calcMode|capHeight|clip|clipPathUnits|clipPath|clipRule|colorInterpolation|colorInterpolationFilters|colorProfile|colorRendering|contentScriptType|contentStyleType|cursor|cx|cy|d|decelerate|descent|diffuseConstant|direction|display|divisor|dominantBaseline|dur|dx|dy|edgeMode|elevation|enableBackground|end|exponent|externalResourcesRequired|fill|fillOpacity|fillRule|filter|filterRes|filterUnits|floodColor|floodOpacity|focusable|fontFamily|fontSize|fontSizeAdjust|fontStretch|fontStyle|fontVariant|fontWeight|format|from|fr|fx|fy|g1|g2|glyphName|glyphOrientationHorizontal|glyphOrientationVertical|glyphRef|gradientTransform|gradientUnits|hanging|horizAdvX|horizOriginX|ideographic|imageRendering|in|in2|intercept|k|k1|k2|k3|k4|kernelMatrix|kernelUnitLength|kerning|keyPoints|keySplines|keyTimes|lengthAdjust|letterSpacing|lightingColor|limitingConeAngle|local|markerEnd|markerMid|markerStart|markerHeight|markerUnits|markerWidth|mask|maskContentUnits|maskUnits|mathematical|mode|numOctaves|offset|opacity|operator|order|orient|orientation|origin|overflow|overlinePosition|overlineThickness|panose1|paintOrder|pathLength|patternContentUnits|patternTransform|patternUnits|pointerEvents|points|pointsAtX|pointsAtY|pointsAtZ|preserveAlpha|preserveAspectRatio|primitiveUnits|r|radius|refX|refY|renderingIntent|repeatCount|repeatDur|requiredExtensions|requiredFeatures|restart|result|rotate|rx|ry|scale|seed|shapeRendering|slope|spacing|specularConstant|specularExponent|speed|spreadMethod|startOffset|stdDeviation|stemh|stemv|stitchTiles|stopColor|stopOpacity|strikethroughPosition|strikethroughThickness|string|stroke|strokeDasharray|strokeDashoffset|strokeLinecap|strokeLinejoin|strokeMiterlimit|strokeOpacity|strokeWidth|surfaceScale|systemLanguage|tableValues|targetX|targetY|textAnchor|textDecoration|textRendering|textLength|to|transform|u1|u2|underlinePosition|underlineThickness|unicode|unicodeBidi|unicodeRange|unitsPerEm|vAlphabetic|vHanging|vIdeographic|vMathematical|values|vectorEffect|version|vertAdvY|vertOriginX|vertOriginY|viewBox|viewTarget|visibility|widths|wordSpacing|writingMode|x|xHeight|x1|x2|xChannelSelector|xlinkActuate|xlinkArcrole|xlinkHref|xlinkRole|xlinkShow|xlinkTitle|xlinkType|xmlBase|xmlns|xmlnsXlink|xmlLang|xmlSpace|y|y1|y2|yChannelSelector|z|zoomAndPan|for|class|autofocus)|(([Dd][Aa][Tt][Aa]|[Aa][Rr][Ii][Aa]|x)-.*))$/,LT=Jb(function(t){return MT.test(t)||t.charCodeAt(0)===111&&t.charCodeAt(1)===110&&t.charCodeAt(2)<91});function FT(t){if(t.sheet)return t.sheet;for(var e=0;e<document.styleSheets.length;e++)if(document.styleSheets[e].ownerNode===t)return document.styleSheets[e]}function _T(t){var e=document.createElement("style");return e.setAttribute("data-emotion",t.key),t.nonce!==void 0&&e.setAttribute("nonce",t.nonce),e.appendChild(document.createTextNode("")),e.setAttribute("data-s",""),e}var VT=function(){function t(n){var r=this;this._insertTag=function(i){var o;r.tags.length===0?r.insertionPoint?o=r.insertionPoint.nextSibling:r.prepend?o=r.container.firstChild:o=r.before:o=r.tags[r.tags.length-1].nextSibling,r.container.insertBefore(i,o),r.tags.push(i)},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 e=t.prototype;return e.hydrate=function(r){r.forEach(this._insertTag)},e.insert=function(r){this.ctr%(this.isSpeedy?65e3:1)===0&&this._insertTag(_T(this));var i=this.tags[this.tags.length-1];if(this.isSpeedy){var o=FT(i);try{o.insertRule(r,o.cssRules.length)}catch(s){}}else i.appendChild(document.createTextNode(r));this.ctr++},e.flush=function(){this.tags.forEach(function(r){var i;return(i=r.parentNode)==null?void 0:i.removeChild(r)}),this.tags=[],this.ctr=0},t}(),An="-ms-",Kd="-moz-",Ze="-webkit-",Zb="comm",cg="rule",ug="decl",DT="@import",ev="@keyframes",zT="@layer",UT=Math.abs,qd=String.fromCharCode,$T=Object.assign;function HT(t,e){return pn(t,0)^45?(((e<<2^pn(t,0))<<2^pn(t,1))<<2^pn(t,2))<<2^pn(t,3):0}function tv(t){return t.trim()}function WT(t,e){return(t=e.exec(t))?t[0]:t}function et(t,e,n){return t.replace(e,n)}function dg(t,e){return t.indexOf(e)}function pn(t,e){return t.charCodeAt(e)|0}function iu(t,e,n){return t.slice(e,n)}function pi(t){return t.length}function fg(t){return t.length}function Yd(t,e){return e.push(t),t}function GT(t,e){return t.map(e).join("")}var Qd=1,rl=1,nv=0,qn=0,Bt=0,il="";function Xd(t,e,n,r,i,o,s){return{value:t,root:e,parent:n,type:r,props:i,children:o,line:Qd,column:rl,length:s,return:""}}function ou(t,e){return $T(Xd("",null,null,"",null,null,0),t,{length:-t.length},e)}function jT(){return Bt}function KT(){return Bt=qn>0?pn(il,--qn):0,rl--,Bt===10&&(rl=1,Qd--),Bt}function lr(){return Bt=qn<nv?pn(il,qn++):0,rl++,Bt===10&&(rl=1,Qd++),Bt}function gi(){return pn(il,qn)}function Jd(){return qn}function su(t,e){return iu(il,t,e)}function au(t){switch(t){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 rv(t){return Qd=rl=1,nv=pi(il=t),qn=0,[]}function iv(t){return il="",t}function Zd(t){return tv(su(qn-1,hg(t===91?t+2:t===40?t+1:t)))}function qT(t){for(;(Bt=gi())&&Bt<33;)lr();return au(t)>2||au(Bt)>3?"":" "}function YT(t,e){for(;--e&&lr()&&!(Bt<48||Bt>102||Bt>57&&Bt<65||Bt>70&&Bt<97););return su(t,Jd()+(e<6&&gi()==32&&lr()==32))}function hg(t){for(;lr();)switch(Bt){case t:return qn;case 34:case 39:t!==34&&t!==39&&hg(Bt);break;case 40:t===41&&hg(t);break;case 92:lr();break}return qn}function QT(t,e){for(;lr()&&t+Bt!==57;)if(t+Bt===84&&gi()===47)break;return"/*"+su(e,qn-1)+"*"+qd(t===47?t:lr())}function XT(t){for(;!au(gi());)lr();return su(t,qn)}function JT(t){return iv(ef("",null,null,null,[""],t=rv(t),0,[0],t))}function ef(t,e,n,r,i,o,s,a,l){for(var c=0,u=0,d=s,h=0,g=0,b=0,p=1,w=1,S=1,O=0,T="",$=i,R=o,j=r,q=T;w;)switch(b=O,O=lr()){case 40:if(b!=108&&pn(q,d-1)==58){dg(q+=et(Zd(O),"&","&\f"),"&\f")!=-1&&(S=-1);break}case 34:case 39:case 91:q+=Zd(O);break;case 9:case 10:case 13:case 32:q+=qT(b);break;case 92:q+=YT(Jd()-1,7);continue;case 47:switch(gi()){case 42:case 47:Yd(ZT(QT(lr(),Jd()),e,n),l);break;default:q+="/"}break;case 123*p:a[c++]=pi(q)*S;case 125*p:case 59:case 0:switch(O){case 0:case 125:w=0;case 59+u:S==-1&&(q=et(q,/\f/g,"")),g>0&&pi(q)-d&&Yd(g>32?sv(q+";",r,n,d-1):sv(et(q," ","")+";",r,n,d-2),l);break;case 59:q+=";";default:if(Yd(j=ov(q,e,n,c,u,i,a,T,$=[],R=[],d),o),O===123)if(u===0)ef(q,e,j,j,$,o,d,a,R);else switch(h===99&&pn(q,3)===110?100:h){case 100:case 108:case 109:case 115:ef(t,j,j,r&&Yd(ov(t,j,j,0,0,i,a,T,i,$=[],d),R),i,R,d,a,r?$:R);break;default:ef(q,j,j,j,[""],R,0,a,R)}}c=u=g=0,p=S=1,T=q="",d=s;break;case 58:d=1+pi(q),g=b;default:if(p<1){if(O==123)--p;else if(O==125&&p++==0&&KT()==125)continue}switch(q+=qd(O),O*p){case 38:S=u>0?1:(q+="\f",-1);break;case 44:a[c++]=(pi(q)-1)*S,S=1;break;case 64:gi()===45&&(q+=Zd(lr())),h=gi(),u=d=pi(T=q+=XT(Jd())),O++;break;case 45:b===45&&pi(q)==2&&(p=0)}}return o}function ov(t,e,n,r,i,o,s,a,l,c,u){for(var d=i-1,h=i===0?o:[""],g=fg(h),b=0,p=0,w=0;b<r;++b)for(var S=0,O=iu(t,d+1,d=UT(p=s[b])),T=t;S<g;++S)(T=tv(p>0?h[S]+" "+O:et(O,/&\f/g,h[S])))&&(l[w++]=T);return Xd(t,e,n,i===0?cg:a,l,c,u)}function ZT(t,e,n){return Xd(t,e,n,Zb,qd(jT()),iu(t,2,-2),0)}function sv(t,e,n,r){return Xd(t,e,n,ug,iu(t,0,r),iu(t,r+1,-1),r)}function ol(t,e){for(var n="",r=fg(t),i=0;i<r;i++)n+=e(t[i],i,t,e)||"";return n}function eP(t,e,n,r){switch(t.type){case zT:if(t.children.length)break;case DT:case ug:return t.return=t.return||t.value;case Zb:return"";case ev:return t.return=t.value+"{"+ol(t.children,r)+"}";case cg:t.value=t.props.join(",")}return pi(n=ol(t.children,r))?t.return=t.value+"{"+n+"}":""}function tP(t){var e=fg(t);return function(n,r,i,o){for(var s="",a=0;a<e;a++)s+=t[a](n,r,i,o)||"";return s}}function nP(t){return function(e){e.root||(e=e.return)&&t(e)}}var av=function(e){var n=new WeakMap;return function(r){if(n.has(r))return n.get(r);var i=e(r);return n.set(r,i),i}},rP=function(e,n,r){for(var i=0,o=0;i=o,o=gi(),i===38&&o===12&&(n[r]=1),!au(o);)lr();return su(e,qn)},iP=function(e,n){var r=-1,i=44;do switch(au(i)){case 0:i===38&&gi()===12&&(n[r]=1),e[r]+=rP(qn-1,n,r);break;case 2:e[r]+=Zd(i);break;case 4:if(i===44){e[++r]=gi()===58?"&\f":"",n[r]=e[r].length;break}default:e[r]+=qd(i)}while(i=lr());return e},oP=function(e,n){return iv(iP(rv(e),n))},lv=new WeakMap,sP=function(e){if(!(e.type!=="rule"||!e.parent||e.length<1)){for(var n=e.value,r=e.parent,i=e.column===r.column&&e.line===r.line;r.type!=="rule";)if(r=r.parent,!r)return;if(!(e.props.length===1&&n.charCodeAt(0)!==58&&!lv.get(r))&&!i){lv.set(e,!0);for(var o=[],s=oP(n,o),a=r.props,l=0,c=0;l<s.length;l++)for(var u=0;u<a.length;u++,c++)e.props[c]=o[l]?s[l].replace(/&\f/g,a[u]):a[u]+" "+s[l]}}},aP=function(e){if(e.type==="decl"){var n=e.value;n.charCodeAt(0)===108&&n.charCodeAt(2)===98&&(e.return="",e.value="")}};function cv(t,e){switch(HT(t,e)){case 5103:return Ze+"print-"+t+t;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 Ze+t+t;case 5349:case 4246:case 4810:case 6968:case 2756:return Ze+t+Kd+t+An+t+t;case 6828:case 4268:return Ze+t+An+t+t;case 6165:return Ze+t+An+"flex-"+t+t;case 5187:return Ze+t+et(t,/(\w+).+(:[^]+)/,Ze+"box-$1$2"+An+"flex-$1$2")+t;case 5443:return Ze+t+An+"flex-item-"+et(t,/flex-|-self/,"")+t;case 4675:return Ze+t+An+"flex-line-pack"+et(t,/align-content|flex-|-self/,"")+t;case 5548:return Ze+t+An+et(t,"shrink","negative")+t;case 5292:return Ze+t+An+et(t,"basis","preferred-size")+t;case 6060:return Ze+"box-"+et(t,"-grow","")+Ze+t+An+et(t,"grow","positive")+t;case 4554:return Ze+et(t,/([^-])(transform)/g,"$1"+Ze+"$2")+t;case 6187:return et(et(et(t,/(zoom-|grab)/,Ze+"$1"),/(image-set)/,Ze+"$1"),t,"")+t;case 5495:case 3959:return et(t,/(image-set\([^]*)/,Ze+"$1$`$1");case 4968:return et(et(t,/(.+:)(flex-)?(.*)/,Ze+"box-pack:$3"+An+"flex-pack:$3"),/s.+-b[^;]+/,"justify")+Ze+t+t;case 4095:case 3583:case 4068:case 2532:return et(t,/(.+)-inline(.+)/,Ze+"$1$2")+t;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(pi(t)-1-e>6)switch(pn(t,e+1)){case 109:if(pn(t,e+4)!==45)break;case 102:return et(t,/(.+:)(.+)-([^]+)/,"$1"+Ze+"$2-$3$1"+Kd+(pn(t,e+3)==108?"$3":"$2-$3"))+t;case 115:return~dg(t,"stretch")?cv(et(t,"stretch","fill-available"),e)+t:t}break;case 4949:if(pn(t,e+1)!==115)break;case 6444:switch(pn(t,pi(t)-3-(~dg(t,"!important")&&10))){case 107:return et(t,":",":"+Ze)+t;case 101:return et(t,/(.+:)([^;!]+)(;|!.+)?/,"$1"+Ze+(pn(t,14)===45?"inline-":"")+"box$3$1"+Ze+"$2$3$1"+An+"$2box$3")+t}break;case 5936:switch(pn(t,e+11)){case 114:return Ze+t+An+et(t,/[svh]\w+-[tblr]{2}/,"tb")+t;case 108:return Ze+t+An+et(t,/[svh]\w+-[tblr]{2}/,"tb-rl")+t;case 45:return Ze+t+An+et(t,/[svh]\w+-[tblr]{2}/,"lr")+t}return Ze+t+An+t+t}return t}var lP=function(e,n,r,i){if(e.length>-1&&!e.return)switch(e.type){case ug:e.return=cv(e.value,e.length);break;case ev:return ol([ou(e,{value:et(e.value,"@","@"+Ze)})],i);case cg:if(e.length)return GT(e.props,function(o){switch(WT(o,/(::plac\w+|:read-\w+)/)){case":read-only":case":read-write":return ol([ou(e,{props:[et(o,/:(read-\w+)/,":"+Kd+"$1")]})],i);case"::placeholder":return ol([ou(e,{props:[et(o,/:(plac\w+)/,":"+Ze+"input-$1")]}),ou(e,{props:[et(o,/:(plac\w+)/,":"+Kd+"$1")]}),ou(e,{props:[et(o,/:(plac\w+)/,An+"input-$1")]})],i)}return""})}},cP=[lP],pg=function(e){var n=e.key;if(n==="css"){var r=document.querySelectorAll("style[data-emotion]:not([data-s])");Array.prototype.forEach.call(r,function(p){var w=p.getAttribute("data-emotion");w.indexOf(" ")!==-1&&(document.head.appendChild(p),p.setAttribute("data-s",""))})}var i=e.stylisPlugins||cP,o={},s,a=[];s=e.container||document.head,Array.prototype.forEach.call(document.querySelectorAll('style[data-emotion^="'+n+' "]'),function(p){for(var w=p.getAttribute("data-emotion").split(" "),S=1;S<w.length;S++)o[w[S]]=!0;a.push(p)});var l,c=[sP,aP];{var u,d=[eP,nP(function(p){u.insert(p)})],h=tP(c.concat(i,d)),g=function(w){return ol(JT(w),h)};l=function(w,S,O,T){u=O,g(w?w+"{"+S.styles+"}":S.styles),T&&(b.inserted[S.name]=!0)}}var b={key:n,sheet:new VT({key:n,container:s,nonce:e.nonce,speedy:e.speedy,prepend:e.prepend,insertionPoint:e.insertionPoint}),nonce:e.nonce,inserted:o,registered:{},insert:l};return b.sheet.hydrate(a),b};const uP=Object.freeze(Object.defineProperty({__proto__:null,default:pg},Symbol.toStringTag,{value:"Module"}));function tf(){return tf=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)({}).hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},tf.apply(null,arguments)}var uv=typeof globalThis!="undefined"?globalThis:typeof window!="undefined"?window:typeof global!="undefined"?global:typeof self!="undefined"?self:{};function sl(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function lu(t){if(Object.prototype.hasOwnProperty.call(t,"__esModule"))return t;var e=t.default;if(typeof e=="function"){var n=function r(){return this instanceof r?Reflect.construct(e,arguments,this.constructor):e.apply(this,arguments)};n.prototype=e.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(t).forEach(function(r){var i=Object.getOwnPropertyDescriptor(t,r);Object.defineProperty(n,r,i.get?i:{enumerable:!0,get:function(){return t[r]}})}),n}var nf={exports:{}},tt={};/** @license React v16.13.1
2
+ * react-is.production.min.js
3
+ *
4
+ * Copyright (c) Facebook, Inc. and its affiliates.
5
+ *
6
+ * This source code is licensed under the MIT license found in the
7
+ * LICENSE file in the root directory of this source tree.
8
+ */var dv;function dP(){if(dv)return tt;dv=1;var t=typeof Symbol=="function"&&Symbol.for,e=t?Symbol.for("react.element"):60103,n=t?Symbol.for("react.portal"):60106,r=t?Symbol.for("react.fragment"):60107,i=t?Symbol.for("react.strict_mode"):60108,o=t?Symbol.for("react.profiler"):60114,s=t?Symbol.for("react.provider"):60109,a=t?Symbol.for("react.context"):60110,l=t?Symbol.for("react.async_mode"):60111,c=t?Symbol.for("react.concurrent_mode"):60111,u=t?Symbol.for("react.forward_ref"):60112,d=t?Symbol.for("react.suspense"):60113,h=t?Symbol.for("react.suspense_list"):60120,g=t?Symbol.for("react.memo"):60115,b=t?Symbol.for("react.lazy"):60116,p=t?Symbol.for("react.block"):60121,w=t?Symbol.for("react.fundamental"):60117,S=t?Symbol.for("react.responder"):60118,O=t?Symbol.for("react.scope"):60119;function T(R){if(typeof R=="object"&&R!==null){var j=R.$$typeof;switch(j){case e:switch(R=R.type,R){case l:case c:case r:case o:case i:case d:return R;default:switch(R=R&&R.$$typeof,R){case a:case u:case b:case g:case s:return R;default:return j}}case n:return j}}}function $(R){return T(R)===c}return tt.AsyncMode=l,tt.ConcurrentMode=c,tt.ContextConsumer=a,tt.ContextProvider=s,tt.Element=e,tt.ForwardRef=u,tt.Fragment=r,tt.Lazy=b,tt.Memo=g,tt.Portal=n,tt.Profiler=o,tt.StrictMode=i,tt.Suspense=d,tt.isAsyncMode=function(R){return $(R)||T(R)===l},tt.isConcurrentMode=$,tt.isContextConsumer=function(R){return T(R)===a},tt.isContextProvider=function(R){return T(R)===s},tt.isElement=function(R){return typeof R=="object"&&R!==null&&R.$$typeof===e},tt.isForwardRef=function(R){return T(R)===u},tt.isFragment=function(R){return T(R)===r},tt.isLazy=function(R){return T(R)===b},tt.isMemo=function(R){return T(R)===g},tt.isPortal=function(R){return T(R)===n},tt.isProfiler=function(R){return T(R)===o},tt.isStrictMode=function(R){return T(R)===i},tt.isSuspense=function(R){return T(R)===d},tt.isValidElementType=function(R){return typeof R=="string"||typeof R=="function"||R===r||R===c||R===o||R===i||R===d||R===h||typeof R=="object"&&R!==null&&(R.$$typeof===b||R.$$typeof===g||R.$$typeof===s||R.$$typeof===a||R.$$typeof===u||R.$$typeof===w||R.$$typeof===S||R.$$typeof===O||R.$$typeof===p)},tt.typeOf=T,tt}var nt={};/** @license React v16.13.1
9
+ * react-is.development.js
10
+ *
11
+ * Copyright (c) Facebook, Inc. and its affiliates.
12
+ *
13
+ * This source code is licensed under the MIT license found in the
14
+ * LICENSE file in the root directory of this source tree.
15
+ */var fv;function fP(){return fv||(fv=1,process.env.NODE_ENV!=="production"&&function(){var t=typeof Symbol=="function"&&Symbol.for,e=t?Symbol.for("react.element"):60103,n=t?Symbol.for("react.portal"):60106,r=t?Symbol.for("react.fragment"):60107,i=t?Symbol.for("react.strict_mode"):60108,o=t?Symbol.for("react.profiler"):60114,s=t?Symbol.for("react.provider"):60109,a=t?Symbol.for("react.context"):60110,l=t?Symbol.for("react.async_mode"):60111,c=t?Symbol.for("react.concurrent_mode"):60111,u=t?Symbol.for("react.forward_ref"):60112,d=t?Symbol.for("react.suspense"):60113,h=t?Symbol.for("react.suspense_list"):60120,g=t?Symbol.for("react.memo"):60115,b=t?Symbol.for("react.lazy"):60116,p=t?Symbol.for("react.block"):60121,w=t?Symbol.for("react.fundamental"):60117,S=t?Symbol.for("react.responder"):60118,O=t?Symbol.for("react.scope"):60119;function T(se){return typeof se=="string"||typeof se=="function"||se===r||se===c||se===o||se===i||se===d||se===h||typeof se=="object"&&se!==null&&(se.$$typeof===b||se.$$typeof===g||se.$$typeof===s||se.$$typeof===a||se.$$typeof===u||se.$$typeof===w||se.$$typeof===S||se.$$typeof===O||se.$$typeof===p)}function $(se){if(typeof se=="object"&&se!==null){var me=se.$$typeof;switch(me){case e:var Ae=se.type;switch(Ae){case l:case c:case r:case o:case i:case d:return Ae;default:var Re=Ae&&Ae.$$typeof;switch(Re){case a:case u:case b:case g:case s:return Re;default:return me}}case n:return me}}}var R=l,j=c,q=a,G=s,L=e,V=u,W=r,z=b,C=g,f=n,y=o,E=i,I=d,N=!1;function D(se){return N||(N=!0,console.warn("The ReactIs.isAsyncMode() alias has been deprecated, and will be removed in React 17+. Update your code to use ReactIs.isConcurrentMode() instead. It has the exact same API.")),M(se)||$(se)===l}function M(se){return $(se)===c}function P(se){return $(se)===a}function m(se){return $(se)===s}function v(se){return typeof se=="object"&&se!==null&&se.$$typeof===e}function B(se){return $(se)===u}function U(se){return $(se)===r}function Q(se){return $(se)===b}function ee(se){return $(se)===g}function Z(se){return $(se)===n}function Y(se){return $(se)===o}function re(se){return $(se)===i}function de(se){return $(se)===d}nt.AsyncMode=R,nt.ConcurrentMode=j,nt.ContextConsumer=q,nt.ContextProvider=G,nt.Element=L,nt.ForwardRef=V,nt.Fragment=W,nt.Lazy=z,nt.Memo=C,nt.Portal=f,nt.Profiler=y,nt.StrictMode=E,nt.Suspense=I,nt.isAsyncMode=D,nt.isConcurrentMode=M,nt.isContextConsumer=P,nt.isContextProvider=m,nt.isElement=v,nt.isForwardRef=B,nt.isFragment=U,nt.isLazy=Q,nt.isMemo=ee,nt.isPortal=Z,nt.isProfiler=Y,nt.isStrictMode=re,nt.isSuspense=de,nt.isValidElementType=T,nt.typeOf=$}()),nt}var hv;function gg(){return hv||(hv=1,process.env.NODE_ENV==="production"?nf.exports=dP():nf.exports=fP()),nf.exports}var mg,pv;function hP(){if(pv)return mg;pv=1;var t=gg(),e={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},n={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},r={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},i={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},o={};o[t.ForwardRef]=r,o[t.Memo]=i;function s(b){return t.isMemo(b)?i:o[b.$$typeof]||e}var a=Object.defineProperty,l=Object.getOwnPropertyNames,c=Object.getOwnPropertySymbols,u=Object.getOwnPropertyDescriptor,d=Object.getPrototypeOf,h=Object.prototype;function g(b,p,w){if(typeof p!="string"){if(h){var S=d(p);S&&S!==h&&g(b,S,w)}var O=l(p);c&&(O=O.concat(c(p)));for(var T=s(b),$=s(p),R=0;R<O.length;++R){var j=O[R];if(!n[j]&&!(w&&w[j])&&!($&&$[j])&&!(T&&T[j])){var q=u(p,j);try{a(b,j,q)}catch(G){}}}}return b}return mg=g,mg}var pP=hP();const gP=sl(pP);var mP=function(t,e){return gP(t,e)},yP=!0;function yg(t,e,n){var r="";return n.split(" ").forEach(function(i){t[i]!==void 0?e.push(t[i]+";"):i&&(r+=i+" ")}),r}var rf=function(e,n,r){var i=e.key+"-"+n.name;(r===!1||yP===!1)&&e.registered[i]===void 0&&(e.registered[i]=n.styles)},of=function(e,n,r){rf(e,n,r);var i=e.key+"-"+n.name;if(e.inserted[n.name]===void 0){var o=n;do e.insert(n===o?"."+i:"",o,e.sheet,!0),o=o.next;while(o!==void 0)}};function bP(t){for(var e=0,n,r=0,i=t.length;i>=4;++r,i-=4)n=t.charCodeAt(r)&255|(t.charCodeAt(++r)&255)<<8|(t.charCodeAt(++r)&255)<<16|(t.charCodeAt(++r)&255)<<24,n=(n&65535)*1540483477+((n>>>16)*59797<<16),n^=n>>>24,e=(n&65535)*1540483477+((n>>>16)*59797<<16)^(e&65535)*1540483477+((e>>>16)*59797<<16);switch(i){case 3:e^=(t.charCodeAt(r+2)&255)<<16;case 2:e^=(t.charCodeAt(r+1)&255)<<8;case 1:e^=t.charCodeAt(r)&255,e=(e&65535)*1540483477+((e>>>16)*59797<<16)}return e^=e>>>13,e=(e&65535)*1540483477+((e>>>16)*59797<<16),((e^e>>>15)>>>0).toString(36)}var vP={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},wP=/[A-Z]|^ms/g,xP=/_EMO_([^_]+?)_([^]*?)_EMO_/g,gv=function(e){return e.charCodeAt(1)===45},mv=function(e){return e!=null&&typeof e!="boolean"},bg=Jb(function(t){return gv(t)?t:t.replace(wP,"-$&").toLowerCase()}),yv=function(e,n){switch(e){case"animation":case"animationName":if(typeof n=="string")return n.replace(xP,function(r,i,o){return mi={name:i,styles:o,next:mi},i})}return vP[e]!==1&&!gv(e)&&typeof n=="number"&&n!==0?n+"px":n};function cu(t,e,n){if(n==null)return"";var r=n;if(r.__emotion_styles!==void 0)return r;switch(typeof n){case"boolean":return"";case"object":{var i=n;if(i.anim===1)return mi={name:i.name,styles:i.styles,next:mi},i.name;var o=n;if(o.styles!==void 0){var s=o.next;if(s!==void 0)for(;s!==void 0;)mi={name:s.name,styles:s.styles,next:mi},s=s.next;var a=o.styles+";";return a}return EP(t,e,n)}case"function":{if(t!==void 0){var l=mi,c=n(t);return mi=l,cu(t,e,c)}break}}var u=n;if(e==null)return u;var d=e[u];return d!==void 0?d:u}function EP(t,e,n){var r="";if(Array.isArray(n))for(var i=0;i<n.length;i++)r+=cu(t,e,n[i])+";";else for(var o in n){var s=n[o];if(typeof s!="object"){var a=s;e!=null&&e[a]!==void 0?r+=o+"{"+e[a]+"}":mv(a)&&(r+=bg(o)+":"+yv(o,a)+";")}else if(Array.isArray(s)&&typeof s[0]=="string"&&(e==null||e[s[0]]===void 0))for(var l=0;l<s.length;l++)mv(s[l])&&(r+=bg(o)+":"+yv(o,s[l])+";");else{var c=cu(t,e,s);switch(o){case"animation":case"animationName":{r+=bg(o)+":"+c+";";break}default:r+=o+"{"+c+"}"}}}return r}var bv=/label:\s*([^\s;{]+)\s*(;|$)/g,mi;function uu(t,e,n){if(t.length===1&&typeof t[0]=="object"&&t[0]!==null&&t[0].styles!==void 0)return t[0];var r=!0,i="";mi=void 0;var o=t[0];if(o==null||o.raw===void 0)r=!1,i+=cu(n,e,o);else{var s=o;i+=s[0]}for(var a=1;a<t.length;a++)if(i+=cu(n,e,t[a]),r){var l=o;i+=l[a]}bv.lastIndex=0;for(var c="",u;(u=bv.exec(i))!==null;)c+="-"+u[1];var d=bP(i)+c;return{name:d,styles:i,next:mi}}var SP=function(e){return e()},vv=Ke.useInsertionEffect?Ke.useInsertionEffect:!1,vg=vv||SP,wv=vv||Ke.useLayoutEffect,wg=Ke.createContext(typeof HTMLElement!="undefined"?pg({key:"css"}):null),xv=wg.Provider,AP=function(){return J.useContext(wg)},du=function(e){return J.forwardRef(function(n,r){var i=J.useContext(wg);return e(n,i,r)})},qi=Ke.createContext({}),kP=function(){return Ke.useContext(qi)},CP=function(e,n){if(typeof n=="function"){var r=n(e);return r}return tf({},e,n)},IP=av(function(t){return av(function(e){return CP(t,e)})}),OP=function(e){var n=Ke.useContext(qi);return e.theme!==n&&(n=IP(n)(e.theme)),Ke.createElement(qi.Provider,{value:n},e.children)};function TP(t){var e=t.displayName||t.name||"Component",n=Ke.forwardRef(function(i,o){var s=Ke.useContext(qi);return Ke.createElement(t,tf({theme:s,ref:o},i))});return n.displayName="WithTheme("+e+")",mP(n,t)}var xg={}.hasOwnProperty,Eg="__EMOTION_TYPE_PLEASE_DO_NOT_USE__",PP=function(e,n){var r={};for(var i in n)xg.call(n,i)&&(r[i]=n[i]);return r[Eg]=e,r},NP=function(e){var n=e.cache,r=e.serialized,i=e.isStringTag;return rf(n,r,i),vg(function(){return of(n,r,i)}),null},BP=du(function(t,e,n){var r=t.css;typeof r=="string"&&e.registered[r]!==void 0&&(r=e.registered[r]);var i=t[Eg],o=[r],s="";typeof t.className=="string"?s=yg(e.registered,o,t.className):t.className!=null&&(s=t.className+" ");var a=uu(o,void 0,Ke.useContext(qi));s+=e.key+"-"+a.name;var l={};for(var c in t)xg.call(t,c)&&c!=="css"&&c!==Eg&&(l[c]=t[c]);return l.className=s,n&&(l.ref=n),Ke.createElement(Ke.Fragment,null,Ke.createElement(NP,{cache:e,serialized:a,isStringTag:typeof i=="string"}),Ke.createElement(i,l))}),RP=BP,sf=function(e,n){var r=arguments;if(n==null||!xg.call(n,"css"))return Ke.createElement.apply(void 0,r);var i=r.length,o=new Array(i);o[0]=RP,o[1]=PP(e,n);for(var s=2;s<i;s++)o[s]=r[s];return Ke.createElement.apply(null,o)};(function(t){var e;e||(e=t.JSX||(t.JSX={}))})(sf||(sf={}));var Sg=du(function(t,e){var n=t.styles,r=uu([n],void 0,Ke.useContext(qi)),i=Ke.useRef();return wv(function(){var o=e.key+"-global",s=new e.sheet.constructor({key:o,nonce:e.sheet.nonce,container:e.sheet.container,speedy:e.sheet.isSpeedy}),a=!1,l=document.querySelector('style[data-emotion="'+o+" "+r.name+'"]');return e.sheet.tags.length&&(s.before=e.sheet.tags[0]),l!==null&&(a=!0,l.setAttribute("data-emotion",o),s.hydrate([l])),i.current=[s,a],function(){s.flush()}},[e]),wv(function(){var o=i.current,s=o[0],a=o[1];if(a){o[1]=!1;return}if(r.next!==void 0&&of(e,r.next,!0),s.tags.length){var l=s.tags[s.tags.length-1].nextElementSibling;s.before=l,s.flush()}e.insert("",r,s,!1)},[e,r.name]),null});function Ev(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return uu(e)}function MP(){var t=Ev.apply(void 0,arguments),e="animation-"+t.name;return{name:e,styles:"@keyframes "+e+"{"+t.styles+"}",anim:1,toString:function(){return"_EMO_"+this.name+"_"+this.styles+"_EMO_"}}}var LP=function t(e){for(var n=e.length,r=0,i="";r<n;r++){var o=e[r];if(o!=null){var s=void 0;switch(typeof o){case"boolean":break;case"object":{if(Array.isArray(o))s=t(o);else{s="";for(var a in o)o[a]&&a&&(s&&(s+=" "),s+=a)}break}default:s=o}s&&(i&&(i+=" "),i+=s)}}return i};function FP(t,e,n){var r=[],i=yg(t,r,n);return r.length<2?n:i+e(r)}var _P=function(e){var n=e.cache,r=e.serializedArr;return vg(function(){for(var i=0;i<r.length;i++)of(n,r[i],!1)}),null},VP=du(function(t,e){var n=[],r=function(){for(var l=arguments.length,c=new Array(l),u=0;u<l;u++)c[u]=arguments[u];var d=uu(c,e.registered);return n.push(d),rf(e,d,!1),e.key+"-"+d.name},i=function(){for(var l=arguments.length,c=new Array(l),u=0;u<l;u++)c[u]=arguments[u];return FP(e.registered,r,LP(c))},o={css:r,cx:i,theme:Ke.useContext(qi)},s=t.children(o);return Ke.createElement(Ke.Fragment,null,Ke.createElement(_P,{cache:e,serializedArr:n}),s)});const DP=Object.freeze(Object.defineProperty({__proto__:null,CacheProvider:xv,ClassNames:VP,Global:Sg,ThemeContext:qi,ThemeProvider:OP,__unsafe_useEmotionCache:AP,get createElement(){return sf},css:Ev,get jsx(){return sf},keyframes:MP,useTheme:kP,withEmotionCache:du,withTheme:TP},Symbol.toStringTag,{value:"Module"}));function zP(...t){return function(...n){t.forEach(r=>r==null?void 0:r(...n))}}const UP=(...t)=>t.map(e=>{var n;return(n=e==null?void 0:e.trim)==null?void 0:n.call(e)}).filter(Boolean).join(" "),$P=/^on[A-Z]/;function fu(...t){var n,r;let e={};for(let i of t){for(let o in e){if($P.test(o)&&typeof e[o]=="function"&&typeof i[o]=="function"){e[o]=zP(e[o],i[o]);continue}if(o==="className"||o==="class"){e[o]=UP(e[o],i[o]);continue}if(o==="style"){e[o]=Object.assign({},(n=e[o])!=null?n:{},(r=i[o])!=null?r:{});continue}e[o]=i[o]!==void 0?i[o]:e[o]}for(let o in i)e[o]===void 0&&(e[o]=i[o])}return e}function HP(t,e){if(t!=null){if(typeof t=="function"){t(e);return}try{t.current=e}catch(n){throw new Error(`Cannot assign value '${e}' to ref '${t}'`)}}}function WP(...t){return e=>{t.forEach(n=>{HP(n,e)})}}function hu(t){const e=Object.assign({},t);for(let n in e)e[n]===void 0&&delete e[n];return e}const Yn=(...t)=>t.filter(Boolean).map(e=>e.trim()).join(" ");function GP(t){return t.default||t}const Qn=t=>t!=null&&typeof t=="object"&&!Array.isArray(t),yi=t=>typeof t=="string",Ag=t=>typeof t=="function";function jP(t){var n;const e=Ke.version;return!yi(e)||e.startsWith("18.")?t==null?void 0:t.ref:(n=t==null?void 0:t.props)==null?void 0:n.ref}const Sv=(...t)=>{const e=t.reduce((n,r)=>(r!=null&&r.forEach(i=>n.add(i)),n),new Set([]));return Array.from(e)};function KP(t,e){return`${t} returned \`undefined\`. Seems you forgot to wrap component within ${e}`}function pu(t={}){const{name:e,strict:n=!0,hookName:r="useContext",providerName:i="Provider",errorMessage:o,defaultValue:s}=t,a=J.createContext(s);a.displayName=e;function l(){var u;const c=J.useContext(a);if(!c&&n){const d=new Error(o!=null?o:KP(r,i));throw d.name="ContextError",(u=Error.captureStackTrace)==null||u.call(Error,d,l),d}return c}return[a.Provider,l,a]}const[qP,af]=pu({name:"ChakraContext",strict:!0,providerName:"<ChakraProvider />"});function YP(t){const{value:e,children:n}=t;return k.jsxs(qP,{value:e,children:[!e._config.disableLayers&&k.jsx(Sg,{styles:e.layers.atRule}),k.jsx(Sg,{styles:e._global}),n]})}const QP=(t,e)=>{const n={},r={},i=Object.keys(t);for(const o of i)e(o)?r[o]=t[o]:n[o]=t[o];return[r,n]},al=(t,e)=>{const n=Ag(e)?e:r=>e.includes(r);return QP(t,n)},XP=new Set(["htmlWidth","htmlHeight","htmlSize","htmlTranslate"]);function JP(t){return typeof t=="string"&&XP.has(t)}function ZP(t,e,n){const{css:r,isValidProperty:i}=af(),{children:o,...s}=t,a=J.useMemo(()=>{const[h,g]=al(s,O=>n(O,e.variantKeys)),[b,p]=al(g,e.variantKeys),[w,S]=al(p,i);return{forwardedProps:h,variantProps:b,styleProps:w,elementProps:S}},[e.variantKeys,n,s,i]),{css:l,...c}=a.styleProps,u=J.useMemo(()=>{const h={...a.variantProps};return e.variantKeys.includes("colorPalette")||(h.colorPalette=s.colorPalette),e.variantKeys.includes("orientation")||(h.orientation=s.orientation),e(h)},[e,a.variantProps,s.colorPalette,s.orientation]);return{styles:J.useMemo(()=>r(u,...e3(l),c),[r,u,l,c]),props:{...a.forwardedProps,...a.elementProps,children:o}}}const e3=t=>(Array.isArray(t)?t:[t]).filter(Boolean).flat(),t3=GP(LT),n3=t=>t!=="theme",r3=(t,e,n)=>{let r;if(e){const i=e.shouldForwardProp;r=t.__emotion_forwardProp&&i?o=>t.__emotion_forwardProp(o)&&i(o):i}return typeof r!="function"&&n&&(r=t.__emotion_forwardProp),r};let i3=typeof document!="undefined";const Av=({cache:t,serialized:e,isStringTag:n})=>{rf(t,e,n);const r=vg(()=>of(t,e,n));if(!i3&&r!==void 0){let i=e.name,o=e.next;for(;o!==void 0;)i=Yn(i,o.name),o=o.next;return k.jsx("style",{"data-emotion":Yn(t.key,i),dangerouslySetInnerHTML:{__html:r},nonce:t.sheet.nonce})}return null},kv={path:["d"],text:["x","y"],circle:["cx","cy","r"],rect:["width","height","x","y","rx","ry"],ellipse:["cx","cy","rx","ry"],g:["transform"],stop:["offset","stopOpacity"]},o3=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),kg=((t,e={},n={})=>{if(process.env.NODE_ENV!=="production"&&t===void 0)throw new Error(`You are trying to create a styled element with an undefined component.
16
+ You may have forgotten to import it.`);if(o3(kv,t)){n.forwardProps||(n.forwardProps=[]);const c=kv[t];n.forwardProps=Sv([...n.forwardProps,...c])}const r=t.__emotion_real===t,i=r&&t.__emotion_base||t;let o,s;n!==void 0&&(o=n.label,s=n.target);let a=[];const l=du((c,u,d)=>{var y;const{cva:h,isValidProperty:g}=af(),b=e.__cva__?e:h(e),p=s3(t.__emotion_cva,b),w=E=>(I,N)=>E.includes(I)?!0:!(N!=null&&N.includes(I))&&!g(I);!n.shouldForwardProp&&n.forwardProps&&(n.shouldForwardProp=w(n.forwardProps));const S=(E,I)=>{const N=typeof t=="string"&&t.charCodeAt(0)>96?t3:n3,D=!(I!=null&&I.includes(E))&&!g(E);return N(E)&&D},O=r3(t,n,r)||S,T=Ke.useMemo(()=>Object.assign({},n.defaultProps,hu(c)),[c]),{props:$,styles:R}=ZP(T,p,O);let j="",q=[R],G=$;if($.theme==null){G={};for(let E in $)G[E]=$[E];G.theme=Ke.useContext(qi)}typeof $.className=="string"?j=yg(u.registered,q,$.className):$.className!=null&&(j=Yn(j,$.className));const L=uu(a.concat(q),u.registered,G);L.styles&&(j=Yn(j,`${u.key}-${L.name}`)),s!==void 0&&(j=Yn(j,s));const V=!O("as");let W=V&&$.as||i,z={};for(let E in $)if(!(V&&E==="as")){if(JP(E)){const I=E.replace("html","").toLowerCase();z[I]=$[E];continue}O(E)&&(z[E]=$[E])}let C=j.trim();C?z.className=C:Reflect.deleteProperty(z,"className"),z.ref=d;const f=n.forwardAsChild||((y=n.forwardProps)==null?void 0:y.includes("asChild"));if($.asChild&&!f){const E=Ke.Children.only($.children);W=E.type,z.children=null,Reflect.deleteProperty(z,"asChild"),z=fu(z,E.props),z.ref=WP(d,jP(E))}return z.as&&f?(z.as=void 0,k.jsxs(Ke.Fragment,{children:[k.jsx(Av,{cache:u,serialized:L,isStringTag:typeof W=="string"}),k.jsx(W,{asChild:!0,...z,children:k.jsx($.as,{children:z.children})})]})):k.jsxs(Ke.Fragment,{children:[k.jsx(Av,{cache:u,serialized:L,isStringTag:typeof W=="string"}),k.jsx(W,{...z})]})});return l.displayName=o!==void 0?o:`chakra(${typeof i=="string"?i:i.displayName||i.name||"Component"})`,l.__emotion_real=l,l.__emotion_base=i,l.__emotion_forwardProp=n.shouldForwardProp,l.__emotion_cva=e,Object.defineProperty(l,"toString",{value(){return s===void 0&&process.env.NODE_ENV!=="production"?"NO_COMPONENT_SELECTOR":`.${s}`}}),l}).bind(),Cg=new Map,We=new Proxy(kg,{apply(t,e,n){return kg(...n)},get(t,e){return Cg.has(e)||Cg.set(e,kg(e)),Cg.get(e)}}),s3=(t,e)=>t&&!e?t:!t&&e?e:t.merge(e),ye=We("div");ye.displayName="Box";const a3=J.forwardRef(function(e,n){const{size:r,...i}=e;return k.jsx(ye,{...i,ref:n,boxSize:r,css:{display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0,flexGrow:0,...e.css}})}),l3=J.forwardRef(function(e,n){const{size:r,...i}=e;return k.jsx(a3,{size:r,ref:n,borderRadius:"9999px",...i})}),c3=Object.freeze({}),u3=Object.freeze({});function Cv(t){const{key:e,recipe:n}=t,r=af();return J.useMemo(()=>{const i=n||(e!=null?r.getRecipe(e):{});return r.cva(structuredClone(i))},[e,n,r])}const d3=t=>t.charAt(0).toUpperCase()+t.slice(1);function zo(t){const{key:e,recipe:n}=t,r=d3(e||n.className||"Component"),[i,o]=pu({strict:!1,name:`${r}PropsContext`,providerName:`${r}PropsContext`});function s(c){const{unstyled:u,...d}=c,h=Cv({key:e,recipe:d.recipe||n}),[g,b]=J.useMemo(()=>h.splitVariantProps(d),[h,d]);return{styles:u?c3:h(g),className:h.className,props:b}}const a=(c,u)=>{const d=We(c,{},u),h=J.forwardRef((g,b)=>{const p=o(),w=J.useMemo(()=>fu(p,g),[g,p]),{styles:S,className:O,props:T}=s(w);return k.jsx(d,{...T,ref:b,css:[S,w.css],className:Yn(O,w.className)})});return h.displayName=c.displayName||c.name,h};function l(){return i}return{withContext:a,PropsProvider:i,withPropsProvider:l,usePropsContext:o,useRecipeResult:s}}function lf(t){return t==null?[]:Array.isArray(t)?t:[t]}var gu=t=>t[0],Ig=t=>t[t.length-1],f3=(t,e)=>t.indexOf(e)!==-1,zs=(t,...e)=>t.concat(e),Us=(t,...e)=>t.filter(n=>!e.includes(n)),ll=t=>Array.from(new Set(t)),Og=(t,e)=>{const n=new Set(e);return t.filter(r=>!n.has(r))},cl=(t,e)=>f3(t,e)?Us(t,e):zs(t,e);function Iv(t,e,n={}){const{step:r=1,loop:i=!0}=n,o=e+r,s=t.length,a=s-1;return e===-1?r>0?0:a:o<0?i?a:0:o>=s?i?0:e>s?s:e:o}function h3(t,e,n={}){return t[Iv(t,e,n)]}function p3(t,e,n={}){const{step:r=1,loop:i=!0}=n;return Iv(t,e,{step:-r,loop:i})}function g3(t,e,n={}){return t[p3(t,e,n)]}function Ov(t,e){return t.reduce(([n,r],i)=>(e(i)?n.push(i):r.push(i),[n,r]),[[],[]])}var Tv=t=>(t==null?void 0:t.constructor.name)==="Array",m3=(t,e)=>{if(t.length!==e.length)return!1;for(let n=0;n<t.length;n++)if(!Wr(t[n],e[n]))return!1;return!0},Wr=(t,e)=>{if(Object.is(t,e))return!0;if(t==null&&e!=null||t!=null&&e==null)return!1;if(typeof(t==null?void 0:t.isEqual)=="function"&&typeof(e==null?void 0:e.isEqual)=="function")return t.isEqual(e);if(typeof t=="function"&&typeof e=="function")return t.toString()===e.toString();if(Tv(t)&&Tv(e))return m3(Array.from(t),Array.from(e));if(typeof t!="object"||typeof e!="object")return!1;const n=Object.keys(e!=null?e:Object.create(null)),r=n.length;for(let i=0;i<r;i++)if(!Reflect.has(t,n[i]))return!1;for(let i=0;i<r;i++){const o=n[i];if(!Wr(t[o],e[o]))return!1}return!0},mu=t=>Array.isArray(t),y3=t=>t===!0||t===!1,Pv=t=>t!=null&&typeof t=="object",$s=t=>Pv(t)&&!mu(t),cf=t=>typeof t=="string",Hs=t=>typeof t=="function",b3=t=>t==null,Uo=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),v3=t=>Object.prototype.toString.call(t),Nv=Function.prototype.toString,w3=Nv.call(Object),x3=t=>{if(!Pv(t)||v3(t)!="[object Object]"||A3(t))return!1;const e=Object.getPrototypeOf(t);if(e===null)return!0;const n=Uo(e,"constructor")&&e.constructor;return typeof n=="function"&&n instanceof n&&Nv.call(n)==w3},E3=t=>typeof t=="object"&&t!==null&&"$$typeof"in t&&"props"in t,S3=t=>typeof t=="object"&&t!==null&&"__v_isVNode"in t,A3=t=>E3(t)||S3(t),yu=(t,...e)=>{const n=typeof t=="function"?t(...e):t;return n!=null?n:void 0},k3=t=>t(),C3=()=>{},uf=(...t)=>(...e)=>{t.forEach(function(n){n==null||n(...e)})},I3=(()=>{let t=0;return()=>(t++,t.toString(36))})();function Yi(t,e,...n){var i;if(t in e){const o=e[t];return Hs(o)?o(...n):o}const r=new Error(`No matching key: ${JSON.stringify(t)} in ${JSON.stringify(Object.keys(e))}`);throw(i=Error.captureStackTrace)==null||i.call(Error,r,Yi),r}var Bv=(t,e)=>{var n;try{return t()}catch(r){return r instanceof Error&&((n=Error.captureStackTrace)==null||n.call(Error,r,Bv)),e==null?void 0:e()}},{floor:Rv,abs:Mv,round:df,min:O3,max:T3,pow:P3,sign:N3}=Math,Tg=t=>Number.isNaN(t),Qi=t=>Tg(t)?0:t,Lv=(t,e)=>(t%e+e)%e,B3=(t,e)=>(t%e+e)%e,R3=(t,e)=>Qi(t)>=e,M3=(t,e)=>Qi(t)<=e,L3=(t,e,n)=>Qi(t)>=e&&Qi(t)<=n,F3=(t,e,n)=>df((Qi(t)-e)/n)*n+e,Xn=(t,e,n)=>O3(T3(Qi(t),e),n),_3=(t,e,n)=>(Qi(t)-e)/(n-e),V3=(t,e,n,r)=>Xn(F3(t*(n-e)+e,e,r),e,n),Fv=(t,e)=>{let n=t,r=e.toString(),i=r.indexOf("."),o=i>=0?r.length-i:0;if(o>0){let s=P3(10,o);n=df(n*s)/s}return n},Pg=(t,e)=>typeof e=="number"?Rv(t*e+.5)/e:df(t),_v=(t,e,n,r)=>{const i=e!=null?Number(e):0,o=Number(n),s=(t-i)%r;let a=Mv(s)*2>=r?t+N3(s)*(r-Mv(s)):t-s;if(a=Fv(a,r),!Tg(i)&&a<i)a=i;else if(!Tg(o)&&a>o){const l=Rv((o-i)/r),c=i+l*r;a=l<=0||c<i?o:c}return Fv(a,r)},ht=(t,e=0,n=10)=>{const r=Math.pow(n,e);return df(t*r)/r},Vv=t=>{if(!Number.isFinite(t))return 0;let e=1,n=0;for(;Math.round(t*e)/e!==t;)e*=10,n+=1;return n},Dv=(t,e,n)=>{let r=e==="+"?t+n:t-n;if(t%1!==0||n%1!==0){const i=10**Math.max(Vv(t),Vv(n));t=Math.round(t*i),n=Math.round(n*i),r=e==="+"?t+n:t-n,r/=i}return r},D3=(t,e)=>Dv(Qi(t),"+",e),z3=(t,e)=>Dv(Qi(t),"-",e);function ff(t){if(!x3(t)||t===void 0)return t;const e=Reflect.ownKeys(t).filter(r=>typeof r=="string"),n={};for(const r of e){const i=t[r];i!==void 0&&(n[r]=ff(i))}return n}function bu(...t){const e=t.length===1?t[0]:t[1];(t.length===2?t[0]:!0)&&process.env.NODE_ENV!=="production"&&console.warn(e)}function zv(t,e){if(t==null)throw new Error(e())}function U3(t,e){return`${t} returned \`undefined\`. Seems you forgot to wrap component within ${e}`}function ul(t={}){const{name:e,strict:n=!0,hookName:r="useContext",providerName:i="Provider",errorMessage:o,defaultValue:s}=t,a=J.createContext(s);a.displayName=e;function l(){var u;const c=J.useContext(a);if(!c&&n){const d=new Error(o!=null?o:U3(r,i));throw d.name="ContextError",(u=Error.captureStackTrace)==null||u.call(Error,d,l),d}return c}return[a.Provider,l,a]}const[$3,Ng]=ul({name:"EnvironmentContext",hookName:"useEnvironmentContext",providerName:"<EnvironmentProvider />",strict:!1,defaultValue:{getRootNode:()=>document,getDocument:()=>document,getWindow:()=>window}});function H3(t){var r,i;if(!t)return;const e=(r=t.selectionStart)!=null?r:0,n=(i=t.selectionEnd)!=null?i:0;Math.abs(n-e)===0&&e===0&&t.setSelectionRange(t.value.length,t.value.length)}var Uv=t=>Math.max(0,Math.min(1,t)),W3=(t,e)=>t.map((n,r)=>t[(Math.max(e,0)+r)%t.length]),G3=()=>{},hf=t=>typeof t=="object"&&t!==null,j3=2147483647,pf=t=>t?"":void 0,K3=1,q3=9,Y3=11,Jn=t=>hf(t)&&t.nodeType===K3&&typeof t.nodeName=="string",$v=t=>hf(t)&&t.nodeType===q3,Q3=t=>hf(t)&&t===t.window,Hv=t=>Jn(t)?t.localName||"":"#document";function X3(t){return["html","body","#document"].includes(Hv(t))}var J3=t=>hf(t)&&t.nodeType!==void 0,dl=t=>J3(t)&&t.nodeType===Y3&&"host"in t,Z3=t=>Jn(t)&&t.localName==="input",eN=t=>Jn(t)?t.offsetWidth>0||t.offsetHeight>0||t.getClientRects().length>0:!1,tN=/(textarea|select)/;function nN(t){if(t==null||!Jn(t))return!1;try{return Z3(t)&&t.selectionStart!=null||tN.test(t.localName)||t.isContentEditable||t.getAttribute("contenteditable")==="true"||t.getAttribute("contenteditable")===""}catch(e){return!1}}function Ws(t,e){var r;if(!t||!e||!Jn(t)||!Jn(e))return!1;const n=(r=e.getRootNode)==null?void 0:r.call(e);if(t===e||t.contains(e))return!0;if(n&&dl(n)){let i=e;for(;i;){if(t===i)return!0;i=i.parentNode||i.host}}return!1}function Ir(t){var e;return $v(t)?t:Q3(t)?t.document:(e=t==null?void 0:t.ownerDocument)!=null?e:document}function rN(t){return Ir(t).documentElement}function on(t){var e,n,r;return dl(t)?on(t.host):$v(t)?(e=t.defaultView)!=null?e:window:Jn(t)&&(r=(n=t.ownerDocument)==null?void 0:n.defaultView)!=null?r:window}function iN(t){let e=t.activeElement;for(;e!=null&&e.shadowRoot;){const n=e.shadowRoot.activeElement;if(n===e)break;e=n}return e}function oN(t){if(Hv(t)==="html")return t;const e=t.assignedSlot||t.parentNode||dl(t)&&t.host||rN(t);return dl(e)?e.host:e}var Bg=new WeakMap;function gf(t){return Bg.has(t)||Bg.set(t,on(t).getComputedStyle(t)),Bg.get(t)}var mf=()=>typeof document!="undefined";function sN(){var e;const t=navigator.userAgentData;return(e=t==null?void 0:t.platform)!=null?e:navigator.platform}function aN(){const t=navigator.userAgentData;return t&&Array.isArray(t.brands)?t.brands.map(({brand:e,version:n})=>`${e}/${n}`).join(" "):navigator.userAgent}var Rg=t=>mf()&&t.test(sN()),Wv=t=>mf()&&t.test(aN()),lN=t=>mf()&&t.test(navigator.vendor),Gv=()=>mf()&&!!navigator.maxTouchPoints,cN=()=>Rg(/^iPhone/i),uN=()=>Rg(/^iPad/i)||yf()&&navigator.maxTouchPoints>1,Mg=()=>cN()||uN(),dN=()=>yf()||Mg(),yf=()=>Rg(/^Mac/i),jv=()=>dN()&&lN(/apple/i),fN=()=>Wv(/Firefox/i),hN=()=>Wv(/Android/i);function pN(t){var e,n,r,i;return(i=(e=t.composedPath)==null?void 0:e.call(t))!=null?i:(r=(n=t.nativeEvent)==null?void 0:n.composedPath)==null?void 0:r.call(n)}function Gr(t){var n;const e=pN(t);return(n=e==null?void 0:e[0])!=null?n:t.target}function gN(t){return wN(t).isComposing||t.keyCode===229}function mN(t){return t.mozInputSource===0&&t.isTrusted?!0:hN()&&t.pointerType?t.type==="click"&&t.buttons===1:t.detail===0&&!t.pointerType}var yN=t=>t.button===0,bN=t=>t.button===2||yf()&&t.ctrlKey&&t.button===0,vN=t=>"touches"in t&&t.touches.length>0;function wN(t){var e;return(e=t.nativeEvent)!=null?e:t}function xN(t,e="client"){const n=vN(t)?t.touches[0]||t.changedTouches[0]:t;return{x:n[`${e}X`],y:n[`${e}Y`]}}var gn=(t,e,n,r)=>{const i=typeof t=="function"?t():t;return i==null||i.addEventListener(e,n,r),()=>{i==null||i.removeEventListener(e,n,r)}};function EN(t,e){var o;const{type:n="HTMLInputElement",property:r="value"}=e,i=on(t)[n].prototype;return(o=Object.getOwnPropertyDescriptor(i,r))!=null?o:{}}function SN(t){if(t.localName==="input")return"HTMLInputElement";if(t.localName==="textarea")return"HTMLTextAreaElement";if(t.localName==="select")return"HTMLSelectElement"}function bf(t,e,n="value"){var i;if(!t)return;const r=SN(t);r&&((i=EN(t,{type:r,property:n}).set)==null||i.call(t,e)),t.setAttribute(n,e)}function AN(t,e){const{value:n,bubbles:r=!0}=e;if(!t)return;const i=on(t);t instanceof i.HTMLInputElement&&(bf(t,`${n}`),t.dispatchEvent(new i.Event("input",{bubbles:r})))}function kN(t){return CN(t)?t.form:t.closest("form")}function CN(t){return t.matches("textarea, input, select, button")}function IN(t,e){if(!t)return;const n=kN(t),r=i=>{i.defaultPrevented||e()};return n==null||n.addEventListener("reset",r,{passive:!0}),()=>n==null?void 0:n.removeEventListener("reset",r)}function ON(t,e){const n=t==null?void 0:t.closest("fieldset");if(!n)return;e(n.disabled);const r=on(n),i=new r.MutationObserver(()=>e(n.disabled));return i.observe(n,{attributes:!0,attributeFilter:["disabled"]}),()=>i.disconnect()}function Lg(t,e){if(!t)return;const{onFieldsetDisabledChange:n,onFormReset:r}=e,i=[IN(t,r),ON(t,n)];return()=>i.forEach(o=>o==null?void 0:o())}var TN=t=>Jn(t)&&t.tagName==="IFRAME",PN=t=>parseInt(t.getAttribute("tabindex")||"0",10)<0,Kv="input:not([type='hidden']):not([disabled]), select:not([disabled]), textarea:not([disabled]), a[href], button:not([disabled]), [tabindex], iframe, object, embed, area[href], audio[controls], video[controls], [contenteditable]:not([contenteditable='false']), details > summary:first-of-type";function Fg(t){return!t||t.closest("[inert]")?!1:t.matches(Kv)&&eN(t)}function qv(t,e){if(!t)return[];const r=Array.from(t.querySelectorAll(Kv)).filter(NN);return r.forEach((i,o)=>{if(TN(i)&&i.contentDocument){const s=i.contentDocument.body,a=qv(s);r.splice(o,1,...a)}}),r.length,r}function NN(t){return t!=null&&t.tabIndex>0?!0:Fg(t)&&!PN(t)}function _g(t){const{root:e,getInitialEl:n,filter:r,enabled:i=!0}=t;if(!i)return;let o=null;if(o||(o=typeof n=="function"?n():n),o||(o=e==null?void 0:e.querySelector("[data-autofocus],[autofocus]")),!o){const s=qv(e);o=r?s.filter(r)[0]:s[0]}return o||e||void 0}function vf(t){const e=new Set;function n(r){const i=globalThis.requestAnimationFrame(r);e.add(()=>globalThis.cancelAnimationFrame(i))}return n(()=>n(t)),function(){e.forEach(i=>i())}}function ze(t){let e;const n=globalThis.requestAnimationFrame(()=>{e=t()});return()=>{globalThis.cancelAnimationFrame(n),e==null||e()}}function BN(t,e,n){const r=ze(()=>{t.removeEventListener(e,i,!0),n()}),i=()=>{r(),n()};return t.addEventListener(e,i,{once:!0,capture:!0}),r}function RN(t,e){if(!t)return;const{attributes:n,callback:r}=e,i=t.ownerDocument.defaultView||window,o=new i.MutationObserver(s=>{for(const a of s)a.type==="attributes"&&a.attributeName&&n.includes(a.attributeName)&&r(a)});return o.observe(t,{attributes:!0,attributeFilter:n}),()=>o.disconnect()}function wf(t,e){const{defer:n}=e,r=n?ze:o=>o(),i=[];return i.push(r(()=>{const o=typeof t=="function"?t():t;i.push(RN(o,e))})),()=>{i.forEach(o=>o==null?void 0:o())}}function Yv(t){const e=()=>{const n=on(t);t.dispatchEvent(new n.MouseEvent("click"))};fN()?BN(t,"keyup",e):queueMicrotask(e)}function xf(t){const e=oN(t);return X3(e)?Ir(e).body:Jn(e)&&Vg(e)?e:xf(e)}function Qv(t,e=[]){const n=xf(t),r=n===t.ownerDocument.body,i=on(n);return r?e.concat(i,i.visualViewport||[],Vg(n)?n:[]):e.concat(n,Qv(n,[]))}var MN=/auto|scroll|overlay|hidden|clip/,LN=new Set(["inline","contents"]);function Vg(t){const e=on(t),{overflow:n,overflowX:r,overflowY:i,display:o}=e.getComputedStyle(t);return MN.test(n+i+r)&&!LN.has(o)}function FN(t){return t.scrollHeight>t.clientHeight||t.scrollWidth>t.clientWidth}function Ef(t,e){const{rootEl:n,...r}=e||{};!t||!n||!Vg(n)||!FN(n)||t.scrollIntoView(r)}function Xv(t,e){const{left:n,top:r,width:i,height:o}=e.getBoundingClientRect(),s={x:t.x-n,y:t.y-r},a={x:Uv(s.x/i),y:Uv(s.y/o)};function l(c={}){const{dir:u="ltr",orientation:d="horizontal",inverted:h}=c,g=typeof h=="object"?h.x:h,b=typeof h=="object"?h.y:h;return d==="horizontal"?u==="rtl"||g?1-a.x:a.x:b?1-a.y:a.y}return{offset:s,percent:a,getPercentValue:l}}function _N(t,e){const n=t.body,r="pointerLockElement"in t||"mozPointerLockElement"in t,i=()=>!!t.pointerLockElement;function o(){}function s(l){i(),console.error("PointerLock error occurred:",l),t.exitPointerLock()}if(!r)return;try{n.requestPointerLock()}catch(l){}const a=[gn(t,"pointerlockchange",o,!1),gn(t,"pointerlockerror",s,!1)];return()=>{a.forEach(l=>l()),t.exitPointerLock()}}var fl="default",Dg="",Sf=new WeakMap;function VN(t={}){const{target:e,doc:n}=t,r=n!=null?n:document,i=r.documentElement;return Mg()?(fl==="default"&&(Dg=i.style.webkitUserSelect,i.style.webkitUserSelect="none"),fl="disabled"):e&&(Sf.set(e,e.style.userSelect),e.style.userSelect="none"),()=>DN({target:e,doc:r})}function DN(t={}){const{target:e,doc:n}=t,i=(n!=null?n:document).documentElement;if(Mg()){if(fl!=="disabled")return;fl="restoring",setTimeout(()=>{vf(()=>{fl==="restoring"&&(i.style.webkitUserSelect==="none"&&(i.style.webkitUserSelect=Dg||""),Dg="",fl="default")})},300)}else if(e&&Sf.has(e)){const o=Sf.get(e);e.style.userSelect==="none"&&(e.style.userSelect=o!=null?o:""),e.getAttribute("style")===""&&e.removeAttribute("style"),Sf.delete(e)}}function Jv(t={}){const{defer:e,target:n,...r}=t,i=e?ze:s=>s(),o=[];return o.push(i(()=>{const s=typeof n=="function"?n():n;o.push(VN({...r,target:s}))})),()=>{o.forEach(s=>s==null?void 0:s())}}function zN(t,e){const{onPointerMove:n,onPointerUp:r}=e,o=[gn(t,"pointermove",s=>{const a=xN(s),l=Math.sqrt(a.x**2+a.y**2),c=s.pointerType==="touch"?10:5;if(!(l<c)){if(s.pointerType==="mouse"&&s.button===0){r();return}n({point:a,event:s})}},!1),gn(t,"pointerup",r,!1),gn(t,"pointercancel",r,!1),gn(t,"contextmenu",r,!1),Jv({doc:t})];return()=>{o.forEach(s=>s())}}function Af(t,e){var n;return Array.from((n=t==null?void 0:t.querySelectorAll(e))!=null?n:[])}function UN(t,e){var n;return(n=t==null?void 0:t.querySelector(e))!=null?n:null}var zg=t=>t.id;function $N(t,e,n=zg){return t.find(r=>n(r)===e)}function Ug(t,e,n=zg){const r=$N(t,e,n);return r?t.indexOf(r):-1}function HN(t,e,n=!0){let r=Ug(t,e);return r=n?(r+1)%t.length:Math.min(r+1,t.length-1),t[r]}function WN(t,e,n=!0){let r=Ug(t,e);return r===-1?n?t[t.length-1]:null:(r=n?(r-1+t.length)%t.length:Math.max(0,r-1),t[r])}var GN=t=>t.split("").map(e=>{const n=e.charCodeAt(0);return n>0&&n<128?e:n>=128&&n<=255?`/x${n.toString(16)}`.replace("/","\\"):""}).join("").trim(),jN=t=>{var e,n,r;return GN((r=(n=(e=t.dataset)==null?void 0:e.valuetext)!=null?n:t.textContent)!=null?r:"")},KN=(t,e)=>t.trim().toLowerCase().startsWith(e.toLowerCase());function qN(t,e,n,r=zg){const i=n?Ug(t,n,r):-1;let o=n?W3(t,i):t;return e.length===1&&(o=o.filter(a=>r(a)!==n)),o.find(a=>KN(jN(a),e))}function $g(t,e){if(!t)return G3;const n=Object.keys(e).reduce((r,i)=>(r[i]=t.style.getPropertyValue(i),r),{});return Object.assign(t.style,e),()=>{Object.assign(t.style,n),t.style.length===0&&t.removeAttribute("style")}}function YN(t,e){const{state:n,activeId:r,key:i,timeout:o=350,itemToId:s}=e,a=n.keysSoFar+i,c=a.length>1&&Array.from(a).every(b=>b===a[0])?a[0]:a;let u=t.slice();const d=qN(u,c,r,s);function h(){clearTimeout(n.timer),n.timer=-1}function g(b){n.keysSoFar=b,h(),b!==""&&(n.timer=+setTimeout(()=>{g(""),h()},o))}return g(a),d}var vu=Object.assign(YN,{defaultOptions:{keysSoFar:"",timer:-1},isValidEvent:QN});function QN(t){return t.key.length===1&&!t.ctrlKey&&!t.metaKey}function XN(t,e,n){const{signal:r}=e;return[new Promise((s,a)=>{const l=setTimeout(()=>{a(new Error(`Timeout of ${n}ms exceeded`))},n);r.addEventListener("abort",()=>{clearTimeout(l),a(new Error("Promise aborted"))}),t.then(c=>{r.aborted||(clearTimeout(l),s(c))}).catch(c=>{r.aborted||(clearTimeout(l),a(c))})}),()=>e.abort()]}function JN(t,e){const{timeout:n,rootNode:r}=e,i=on(r),o=Ir(r),s=new i.AbortController;return XN(new Promise(a=>{const l=t();if(l){a(l);return}const c=new i.MutationObserver(()=>{const u=t();u&&u.isConnected&&(c.disconnect(),a(u))});c.observe(o.body,{childList:!0,subtree:!0})}),s,n)}var ZN=(...t)=>t.map(e=>{var n;return(n=e==null?void 0:e.trim)==null?void 0:n.call(e)}).filter(Boolean).join(" "),eB=/((?:--)?(?:\w+-?)+)\s*:\s*([^;]*)/g,Zv=t=>{const e={};let n;for(;n=eB.exec(t);)e[n[1]]=n[2];return e},tB=(t,e)=>{if(cf(t)){if(cf(e))return`${t};${e}`;t=Zv(t)}else cf(e)&&(e=Zv(e));return Object.assign({},t!=null?t:{},e!=null?e:{})};function cr(...t){let e={};for(let n of t){for(let r in e){if(r.startsWith("on")&&typeof e[r]=="function"&&typeof n[r]=="function"){e[r]=uf(n[r],e[r]);continue}if(r==="className"||r==="class"){e[r]=ZN(e[r],n[r]);continue}if(r==="style"){e[r]=tB(e[r],n[r]);continue}e[r]=n[r]!==void 0?n[r]:e[r]}for(let r in n)e[r]===void 0&&(e[r]=n[r])}return e}function ew(t,e,n){let r=[],i;return o=>{const s=t(o);return(s.length!==r.length||s.some((l,c)=>!Wr(r[c],l)))&&(r=s,i=e(...s)),i}}function $o(){return{and:(...t)=>function(n){return t.every(r=>n.guard(r))},or:(...t)=>function(n){return t.some(r=>n.guard(r))},not:t=>function(n){return!n.guard(t)}}}function kK(t){return t}function tw(){return{guards:$o(),createMachine:t=>t,choose:t=>function({choose:n}){var r;return(r=n(t))==null?void 0:r.actions}}}var hl=(t=>(t.NotStarted="Not Started",t.Started="Started",t.Stopped="Stopped",t))(hl||{}),Hg="__init__";function nB(t){const e=()=>{var a,l;return(l=(a=t.getRootNode)==null?void 0:a.call(t))!=null?l:document},n=()=>Ir(e()),r=()=>{var a;return(a=n().defaultView)!=null?a:window},i=()=>iN(e());return{...t,getRootNode:e,getDoc:n,getWin:r,getActiveElement:i,isActiveElement:a=>a===i(),getById:a=>e().getElementById(a)}}function nw(...t){return e=>{const n=[];for(const r of t)if(typeof r=="function"){const i=r(e);typeof i=="function"&&n.push(i)}else r&&(r.current=e);if(n.length)return()=>{for(const r of n)r()}}}function rB(t){var r,i;let e=(r=Object.getOwnPropertyDescriptor(t.props,"ref"))==null?void 0:r.get,n=e&&"isReactWarning"in e&&e.isReactWarning;return n?t.ref:(e=(i=Object.getOwnPropertyDescriptor(t,"ref"))==null?void 0:i.get,n=e&&"isReactWarning"in e&&e.isReactWarning,n?t.props.ref:t.props.ref||t.ref)}const Wg=t=>{const e=J.memo(J.forwardRef((n,r)=>{const{asChild:i,children:o,...s}=n;if(!i)return J.createElement(t,{...s,ref:r},o);const a=J.Children.only(o);if(!J.isValidElement(a))return null;const l=rB(a);return J.cloneElement(a,{...cr(s,a.props),ref:r?nw(r,l):l})}));return e.displayName=t.displayName||t.name,e},bi=(()=>{const t=new Map;return new Proxy(Wg,{apply(e,n,r){return Wg(r[0])},get(e,n){const r=n;return t.has(r)||t.set(r,Wg(r)),t.get(r)}})})(),[IK,rw]=ul({name:"LocaleContext",hookName:"useLocaleContext",providerName:"<LocaleProvider />",strict:!1,defaultValue:{dir:"ltr",locale:"en-US"}}),Gg=()=>(t,e)=>e.reduce((n,r)=>{const[i,o]=n,s=r;return o[s]!==void 0&&(i[s]=o[s]),delete o[s],[i,o]},[{},{...t}]),iw=t=>Gg()(t,["immediate","lazyMount","onExitComplete","present","skipAnimationOnMount","unmountOnExit"]);function iB(t){return new Proxy({},{get(e,n){return n==="style"?r=>t({style:r}).style:t}})}var Be=()=>t=>Array.from(new Set(t));function oB(t,e){const{state:n,send:r,context:i}=t,o=n.matches("mounted","unmountSuspended");return{skip:!i.get("initial"),present:o,setNode(s){s&&r({type:"NODE.SET",node:s})},unmount(){r({type:"UNMOUNT"})}}}var sB={props({props:t}){return{...t,present:!!t.present}},initialState({prop:t}){return t("present")?"mounted":"unmounted"},refs(){return{node:null,styles:null}},context({bindable:t}){return{unmountAnimationName:t(()=>({defaultValue:null})),prevAnimationName:t(()=>({defaultValue:null})),present:t(()=>({defaultValue:!1})),initial:t(()=>({sync:!0,defaultValue:!1}))}},exit:["clearInitial","cleanupNode"],watch({track:t,action:e,prop:n}){t([()=>n("present")],()=>{e(["setInitial","syncPresence"])})},on:{"NODE.SET":{actions:["setNode","setStyles"]}},states:{mounted:{on:{UNMOUNT:{target:"unmounted",actions:["clearPrevAnimationName","invokeOnExitComplete"]},"UNMOUNT.SUSPEND":{target:"unmountSuspended"}}},unmountSuspended:{effects:["trackAnimationEvents"],on:{MOUNT:{target:"mounted",actions:["setPrevAnimationName"]},UNMOUNT:{target:"unmounted",actions:["clearPrevAnimationName","invokeOnExitComplete"]}}},unmounted:{on:{MOUNT:{target:"mounted",actions:["setPrevAnimationName"]}}}},implementations:{actions:{setInitial:({context:t})=>{t.get("initial")||queueMicrotask(()=>{t.set("initial",!0)})},clearInitial:({context:t})=>{t.set("initial",!1)},cleanupNode:({refs:t})=>{t.set("node",null),t.set("styles",null)},invokeOnExitComplete:({prop:t})=>{var e;(e=t("onExitComplete"))==null||e()},setNode:({refs:t,event:e})=>{t.set("node",e.node)},setStyles:({refs:t,event:e})=>{t.set("styles",gf(e.node))},syncPresence:({context:t,refs:e,send:n,prop:r})=>{const i=r("present");if(i)return n({type:"MOUNT",src:"presence.changed"});const o=e.get("node");if(!i&&(o==null?void 0:o.ownerDocument.visibilityState)==="hidden")return n({type:"UNMOUNT",src:"visibilitychange"});ze(()=>{var a,l;const s=kf(e.get("styles"));t.set("unmountAnimationName",s),s==="none"||s===t.get("prevAnimationName")||((a=e.get("styles"))==null?void 0:a.display)==="none"||((l=e.get("styles"))==null?void 0:l.animationDuration)==="0s"?n({type:"UNMOUNT",src:"presence.changed"}):n({type:"UNMOUNT.SUSPEND"})})},setPrevAnimationName:({context:t,refs:e})=>{ze(()=>{t.set("prevAnimationName",kf(e.get("styles")))})},clearPrevAnimationName:({context:t})=>{t.set("prevAnimationName",null)}},effects:{trackAnimationEvents:({context:t,refs:e,send:n})=>{const r=e.get("node");if(!r)return;const i=a=>{var c,u,d;((d=(u=(c=a.composedPath)==null?void 0:c.call(a))==null?void 0:u[0])!=null?d:a.target)===r&&t.set("prevAnimationName",kf(e.get("styles")))},o=a=>{const l=kf(e.get("styles"));Gr(a)===r&&l===t.get("unmountAnimationName")&&n({type:"UNMOUNT",src:"animationend"})};r.addEventListener("animationstart",i),r.addEventListener("animationcancel",o),r.addEventListener("animationend",o);const s=$g(r,{animationFillMode:"forwards"});return()=>{r.removeEventListener("animationstart",i),r.removeEventListener("animationcancel",o),r.removeEventListener("animationend",o),vf(()=>s())}}}}};function kf(t){return(t==null?void 0:t.animationName)||"none"}Be()(["onExitComplete","present","immediate"]);var ow=typeof globalThis.document!="undefined"?J.useLayoutEffect:J.useEffect;function Cf(t){var d,h;const e=(d=t().value)!=null?d:t().defaultValue,n=(h=t().isEqual)!=null?h:Object.is,[r]=J.useState(e),[i,o]=J.useState(r),s=t().value!==void 0,a=J.useRef(i);a.current=s?t().value:i;const l=J.useRef(a.current);ow(()=>{l.current=a.current},[i,t().value]);const c=g=>{var w,S;const b=l.current,p=Hs(g)?g(b):g;t().debug&&console.log(`[bindable > ${t().debug}] setValue`,{next:p,prev:b}),s||o(p),n(p,b)||(S=(w=t()).onChange)==null||S.call(w,p,b)};function u(){return s?t().value:i}return{initial:r,ref:a,get:u,set(g){(t().sync?Ds.flushSync:k3)(()=>c(g))},invoke(g,b){var p,w;(w=(p=t()).onChange)==null||w.call(p,g,b)},hash(g){var b,p,w;return(w=(p=(b=t()).hash)==null?void 0:p.call(b,g))!=null?w:String(g)}}}Cf.cleanup=t=>{J.useEffect(()=>t,[])},Cf.ref=t=>{const e=J.useRef(t);return{get:()=>e.current,set:n=>{e.current=n}}};function aB(t){const e=J.useRef(t);return{get(n){return e.current[n]},set(n,r){e.current[n]=r}}}var lB=(t,e)=>{const n=J.useRef(!1),r=J.useRef(!1);J.useEffect(()=>{if(n.current&&r.current)return e();r.current=!0},[...(t!=null?t:[]).map(i=>typeof i=="function"?i():i)]),J.useEffect(()=>(n.current=!0,()=>{n.current=!1}),[])};function jg(t,e={}){var W,z,C,f,y,E;const n=J.useMemo(()=>{const{id:I,ids:N,getRootNode:D}=e;return nB({id:I,ids:N,getRootNode:D})},[e]),r=(...I)=>{t.debug&&console.log(...I)},i=(z=(W=t.props)==null?void 0:W.call(t,{props:ff(e),scope:n}))!=null?z:e,o=cB(i),s=(C=t.context)==null?void 0:C.call(t,{prop:o,bindable:Cf,scope:n,flush:aw,getContext(){return l},getComputed(){return R},getRefs(){return p},getEvent(){return g()}}),a=sw(s),l={get(I){var N;return(N=a.current)==null?void 0:N[I].ref.current},set(I,N){var D;(D=a.current)==null||D[I].set(N)},initial(I){var N;return(N=a.current)==null?void 0:N[I].initial},hash(I){var D,M;const N=(D=a.current)==null?void 0:D[I].get();return(M=a.current)==null?void 0:M[I].hash(N)}},c=J.useRef(new Map),u=J.useRef(null),d=J.useRef(null),h=J.useRef({type:""}),g=()=>({...h.current,current(){return h.current},previous(){return d.current}}),b=()=>({...j,matches(...I){return I.includes(j.ref.current)},hasTag(I){var N,D;return!!((D=(N=t.states[j.ref.current])==null?void 0:N.tags)!=null&&D.includes(I))}}),p=aB((y=(f=t.refs)==null?void 0:f.call(t,{prop:o,context:l}))!=null?y:{}),w=()=>({state:b(),context:l,event:g(),prop:o,send:V,action:S,guard:O,track:lB,refs:p,computed:R,flush:aw,scope:n,choose:$}),S=I=>{const N=Hs(I)?I(w()):I;if(!N)return;const D=N.map(M=>{var m,v;const P=(v=(m=t.implementations)==null?void 0:m.actions)==null?void 0:v[M];return P||bu(`[zag-js] No implementation found for action "${JSON.stringify(M)}"`),P});for(const M of D)M==null||M(w())},O=I=>{var N,D;return Hs(I)?I(w()):(D=(N=t.implementations)==null?void 0:N.guards)==null?void 0:D[I](w())},T=I=>{const N=Hs(I)?I(w()):I;if(!N)return;const D=N.map(P=>{var v,B;const m=(B=(v=t.implementations)==null?void 0:v.effects)==null?void 0:B[P];return m||bu(`[zag-js] No implementation found for effect "${JSON.stringify(P)}"`),m}),M=[];for(const P of D){const m=P==null?void 0:P(w());m&&M.push(m)}return()=>M.forEach(P=>P==null?void 0:P())},$=I=>lf(I).find(N=>{let D=!N.guard;return cf(N.guard)?D=!!O(N.guard):Hs(N.guard)&&(D=N.guard(w())),D}),R=I=>{zv(t.computed,()=>"[zag-js] No computed object found on machine");const N=t.computed[I];return N({context:l,event:g(),prop:o,refs:p,scope:n,computed:R})},j=Cf(()=>({defaultValue:t.initialState({prop:o}),onChange(I,N){var M,P,m,v;if(N){const B=c.current.get(N);B==null||B(),c.current.delete(N)}N&&S((M=t.states[N])==null?void 0:M.exit),S((P=u.current)==null?void 0:P.actions);const D=T((m=t.states[I])==null?void 0:m.effects);if(D&&c.current.set(I,D),N===Hg){S(t.entry);const B=T(t.effects);B&&c.current.set(Hg,B)}S((v=t.states[I])==null?void 0:v.entry)}})),q=J.useRef(void 0),G=J.useRef(hl.NotStarted);ow(()=>{queueMicrotask(()=>{var P;const D=G.current===hl.Started;G.current=hl.Started,r(D?"rehydrating...":"initializing...");const M=(P=q.current)!=null?P:j.initial;j.invoke(M,D?j.get():Hg)});const I=c.current,N=j.ref.current;return()=>{r("unmounting..."),q.current=N,G.current=hl.Stopped,I.forEach(D=>D==null?void 0:D()),c.current=new Map,u.current=null,queueMicrotask(()=>{S(t.exit)})}},[]);const L=()=>"ref"in j?j.ref.current:j.get(),V=I=>{queueMicrotask(()=>{var v,B,U,Q,ee;if(G.current!==hl.Started)return;d.current=h.current,h.current=I,r("send",I);let N=L();const D=(U=(v=t.states[N].on)==null?void 0:v[I.type])!=null?U:(B=t.on)==null?void 0:B[I.type],M=$(D);if(!M)return;u.current=M;const P=(Q=M.target)!=null?Q:N;r("transition",M);const m=P!==N;m?Ds.flushSync(()=>j.set(P)):M.reenter&&!m?j.invoke(N,N):S((ee=M.actions)!=null?ee:[])})};return(E=t.watch)==null||E.call(t,w()),{state:b(),send:V,context:l,prop:o,scope:n,refs:p,computed:R,event:g(),getStatus:()=>G.current}}function sw(t){const e=J.useRef(t);return e.current=t,e}function cB(t){const e=sw(t);return function(r){return e.current[r]}}function aw(t){queueMicrotask(()=>{Ds.flushSync(()=>t())})}var lw=iB(t=>t);function uB(t,e={}){const{sync:n=!1}=e,r=dB(t);return J.useCallback((...i)=>{var o;return n?queueMicrotask(()=>{var s;return(s=r.current)==null?void 0:s.call(r,...i)}):(o=r.current)==null?void 0:o.call(r,...i)},[n,r])}function dB(t){const e=J.useRef(t);return e.current=t,e}const cw=(t={})=>{const{lazyMount:e,unmountOnExit:n,present:r,skipAnimationOnMount:i=!1,...o}=t,s=J.useRef(!1),a={...o,present:r,onExitComplete:uB(t.onExitComplete)},l=jg(sB,a),c=oB(l);c.present&&(s.current=!0);const u=!c.present&&!s.current&&e||n&&!c.present&&s.current,d=()=>({"data-state":c.skip&&i?void 0:r?"open":"closed",hidden:!c.present});return{ref:c.setNode,getPresenceProps:d,present:c.present,unmounted:u}},[uw,dw]=ul({name:"PresenceContext",hookName:"usePresenceContext",providerName:"<PresenceProvider />"}),Gs=We("span"),{withContext:fB}=zo({key:"text"}),Ge=fB("p"),hB=t=>Gg()(t,["defaultOpen","disabled","id","ids","lazyMount","onExitComplete","onOpenChange","open","unmountOnExit"]);var Ie=(t,e=[])=>({parts:(...n)=>{if(pB(e))return Ie(t,n);throw new Error("createAnatomy().parts(...) should only be called once. Did you mean to use .extendWith(...) ?")},extendWith:(...n)=>Ie(t,[...e,...n]),omit:(...n)=>Ie(t,e.filter(r=>!n.includes(r))),rename:n=>Ie(n,e),keys:()=>e,build:()=>[...new Set(e)].reduce((n,r)=>Object.assign(n,{[r]:{selector:[`&[data-scope="${pl(t)}"][data-part="${pl(r)}"]`,`& [data-scope="${pl(t)}"][data-part="${pl(r)}"]`].join(", "),attrs:{"data-scope":pl(t),"data-part":pl(r)}}}),{})}),pl=t=>t.replace(/([A-Z])([A-Z])/g,"$1-$2").replace(/([a-z])([A-Z])/g,"$1-$2").replace(/[\s_]+/g,"-").toLowerCase(),pB=t=>t.length===0,fw=Ie("collapsible").parts("root","trigger","content","indicator"),If=fw.build(),gB=t=>{var e,n;return(n=(e=t.ids)==null?void 0:e.root)!=null?n:`collapsible:${t.id}`},Kg=t=>{var e,n;return(n=(e=t.ids)==null?void 0:e.content)!=null?n:`collapsible:${t.id}:content`},mB=t=>{var e,n;return(n=(e=t.ids)==null?void 0:e.trigger)!=null?n:`collapsible:${t.id}:trigger`},Of=t=>t.getById(Kg(t));function yB(t,e){const{state:n,send:r,context:i,scope:o,prop:s}=t,a=n.matches("open")||n.matches("closing"),l=n.matches("open"),{width:c,height:u}=i.get("size"),d=!!s("disabled"),h=!i.get("initial")&&l,g="ltr";return{disabled:d,visible:a,open:l,measureSize(){r({type:"size.measure"})},setOpen(b){n.matches("open")!==b&&r({type:b?"open":"close"})},getRootProps(){return e.element({...If.root.attrs,"data-state":l?"open":"closed",dir:g,id:gB(o)})},getContentProps(){return e.element({...If.content.attrs,"data-collapsible":"","data-state":h?void 0:l?"open":"closed",id:Kg(o),"data-disabled":pf(d),hidden:!a,style:{"--height":u!=null?`${u}px`:void 0,"--width":c!=null?`${c}px`:void 0}})},getTriggerProps(){return e.element({...If.trigger.attrs,id:mB(o),dir:g,type:"button","data-state":l?"open":"closed","data-disabled":pf(d),"aria-controls":Kg(o),"aria-expanded":a||!1,onClick(b){b.defaultPrevented||d||r({type:l?"close":"open"})}})},getIndicatorProps(){return e.element({...If.indicator.attrs,dir:g,"data-state":l?"open":"closed","data-disabled":pf(d)})}}}var bB={initialState({prop:t}){return t("open")||t("defaultOpen")?"open":"closed"},context({bindable:t}){return{size:t(()=>({defaultValue:{height:0,width:0},sync:!0})),initial:t(()=>({defaultValue:!1}))}},refs(){return{cleanup:void 0,stylesRef:void 0}},watch({track:t,prop:e,action:n}){t([()=>e("open")],()=>{n(["setInitial","computeSize","toggleVisibility"])})},exit:["clearInitial","cleanupNode"],states:{closed:{on:{"controlled.open":{target:"open"},open:[{guard:"isOpenControlled",actions:["invokeOnOpen"]},{target:"open",actions:["setInitial","computeSize","invokeOnOpen"]}]}},closing:{effects:["trackExitAnimation"],on:{"controlled.close":{target:"closed"},"controlled.open":{target:"open"},open:[{guard:"isOpenControlled",actions:["invokeOnOpen"]},{target:"open",actions:["setInitial","invokeOnOpen"]}],close:[{guard:"isOpenControlled",actions:["invokeOnExitComplete"]},{target:"closed",actions:["setInitial","computeSize","invokeOnExitComplete"]}],"animation.end":{target:"closed",actions:["invokeOnExitComplete","clearInitial"]}}},open:{effects:["trackEnterAnimation"],on:{"controlled.close":{target:"closing"},close:[{guard:"isOpenControlled",actions:["invokeOnClose"]},{target:"closing",actions:["setInitial","computeSize","invokeOnClose"]}],"size.measure":{actions:["measureSize"]},"animation.end":{actions:["clearInitial"]}}}},implementations:{guards:{isOpenControlled:({prop:t})=>t("open")!=null},effects:{trackEnterAnimation:({send:t,scope:e})=>{let n;const r=ze(()=>{const i=Of(e);if(!i)return;const o=gf(i).animationName;if(!o||o==="none"){t({type:"animation.end"});return}const a=l=>{Gr(l)===i&&t({type:"animation.end"})};i.addEventListener("animationend",a),n=()=>{i.removeEventListener("animationend",a)}});return()=>{r(),n==null||n()}},trackExitAnimation:({send:t,scope:e})=>{let n;const r=ze(()=>{const i=Of(e);if(!i)return;const o=gf(i).animationName;if(!o||o==="none"){t({type:"animation.end"});return}const a=c=>{Gr(c)===i&&t({type:"animation.end"})};i.addEventListener("animationend",a);const l=$g(i,{animationFillMode:"forwards"});n=()=>{i.removeEventListener("animationend",a),vf(()=>l())}});return()=>{r(),n==null||n()}}},actions:{setInitial:({context:t,flush:e})=>{e(()=>{t.set("initial",!0)})},clearInitial:({context:t})=>{t.set("initial",!1)},cleanupNode:({refs:t})=>{t.set("stylesRef",null)},measureSize:({context:t,scope:e})=>{const n=Of(e);if(!n)return;const{height:r,width:i}=n.getBoundingClientRect();t.set("size",{height:r,width:i})},computeSize:({refs:t,scope:e,context:n})=>{var i;(i=t.get("cleanup"))==null||i();const r=ze(()=>{const o=Of(e);if(!o)return;const s=o.hidden;o.style.animationName="none",o.style.animationDuration="0s",o.hidden=!1;const a=o.getBoundingClientRect();n.set("size",{height:a.height,width:a.width}),n.get("initial")&&(o.style.animationName="",o.style.animationDuration=""),o.hidden=s});t.set("cleanup",r)},invokeOnOpen:({prop:t})=>{var e;(e=t("onOpenChange"))==null||e({open:!0})},invokeOnClose:({prop:t})=>{var e;(e=t("onOpenChange"))==null||e({open:!1})},invokeOnExitComplete:({prop:t})=>{var e;(e=t("onExitComplete"))==null||e()},toggleVisibility:({prop:t,send:e})=>{e({type:t("open")?"controlled.open":"controlled.close"})}}}};Be()(["dir","disabled","getRootNode","id","ids","onExitComplete","onOpenChange","defaultOpen","open"]);const vB=(t={})=>{const{lazyMount:e,unmountOnExit:n,...r}=t,i=J.useId(),o=J.useRef(!1),{dir:s}=rw(),{getRootNode:a}=Ng(),l={id:i,dir:s,getRootNode:a,...r},c=jg(bB,l),u=yB(c,lw);u.visible&&(o.current=!0);const d=!u.visible&&!o.current&&e||n&&!u.visible&&o.current;return{...u,isUnmounted:d}},[hw,pw]=ul({name:"CollapsibleContext",hookName:"useCollapsibleContext",providerName:"<CollapsibleProvider />"}),gw=J.forwardRef((t,e)=>{const[n,r]=hB(t),i=vB(n),o=cr(i.getRootProps(),r);return k.jsx(hw,{value:i,children:k.jsx(bi.div,{...o,ref:e})})});gw.displayName="CollapsibleRoot";var wB=Object.defineProperty,xB=(t,e,n)=>e in t?wB(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,qg=(t,e,n)=>xB(t,e+"",n),EB=(t,e)=>{if(Object.keys(t).length!==Object.keys(e).length)return!1;for(let n in t)if(t[n]!==e[n])return!1;return!0},Yg=class{toHexInt(){return this.toFormat("rgba").toHexInt()}getChannelValue(t){if(t in this)return this[t];throw new Error("Unsupported color channel: "+t)}getChannelValuePercent(t,e){const n=e!=null?e:this.getChannelValue(t),{minValue:r,maxValue:i}=this.getChannelRange(t);return _3(n,r,i)}getChannelPercentValue(t,e){const{minValue:n,maxValue:r,step:i}=this.getChannelRange(t),o=V3(e,n,r,i);return _v(o,n,r,i)}withChannelValue(t,e){const{minValue:n,maxValue:r}=this.getChannelRange(t);if(t in this){let i=this.clone();return i[t]=Xn(e,n,r),i}throw new Error("Unsupported color channel: "+t)}getColorAxes(t){let{xChannel:e,yChannel:n}=t,r=e||this.getChannels().find(s=>s!==n),i=n||this.getChannels().find(s=>s!==r),o=this.getChannels().find(s=>s!==r&&s!==i);return{xChannel:r,yChannel:i,zChannel:o}}incrementChannel(t,e){const{minValue:n,maxValue:r,step:i}=this.getChannelRange(t),o=_v(Xn(this.getChannelValue(t)+e,n,r),n,r,i);return this.withChannelValue(t,o)}decrementChannel(t,e){return this.incrementChannel(t,-e)}isEqual(t){return EB(this.toJSON(),t.toJSON())&&this.getChannelValue("alpha")===t.getChannelValue("alpha")}},SB=/^#[\da-f]+$/i,AB=/^rgba?\((.*)\)$/,kB=/[^#]/gi,mw=class Zp extends Yg{constructor(e,n,r,i){super(),this.red=e,this.green=n,this.blue=r,this.alpha=i}static parse(e){var i;let n=[];if(SB.test(e)&&[4,5,7,9].includes(e.length)){const o=(e.length<6?e.replace(kB,"$&$&"):e).slice(1).split("");for(;o.length>0;)n.push(parseInt(o.splice(0,2).join(""),16));n[3]=n[3]!==void 0?n[3]/255:void 0}const r=e.match(AB);return r!=null&&r[1]&&(n=r[1].split(",").map(o=>Number(o.trim())).map((o,s)=>Xn(o,0,s<3?255:1))),n.length<3?void 0:new Zp(n[0],n[1],n[2],(i=n[3])!=null?i:1)}toString(e){switch(e){case"hex":return"#"+(this.red.toString(16).padStart(2,"0")+this.green.toString(16).padStart(2,"0")+this.blue.toString(16).padStart(2,"0")).toUpperCase();case"hexa":return"#"+(this.red.toString(16).padStart(2,"0")+this.green.toString(16).padStart(2,"0")+this.blue.toString(16).padStart(2,"0")+Math.round(this.alpha*255).toString(16).padStart(2,"0")).toUpperCase();case"rgb":return`rgb(${this.red}, ${this.green}, ${this.blue})`;case"css":case"rgba":return`rgba(${this.red}, ${this.green}, ${this.blue}, ${this.alpha})`;case"hsl":return this.toHSL().toString("hsl");case"hsb":return this.toHSB().toString("hsb");default:return this.toFormat(e).toString(e)}}toFormat(e){switch(e){case"rgba":return this;case"hsba":return this.toHSB();case"hsla":return this.toHSL();default:throw new Error("Unsupported color conversion: rgb -> "+e)}}toHexInt(){return this.red<<16|this.green<<8|this.blue}toHSB(){const e=this.red/255,n=this.green/255,r=this.blue/255,i=Math.min(e,n,r),o=Math.max(e,n,r),s=o-i,a=o===0?0:s/o;let l=0;if(s!==0){switch(o){case e:l=(n-r)/s+(n<r?6:0);break;case n:l=(r-e)/s+2;break;case r:l=(e-n)/s+4;break}l/=6}return new Jg(ht(l*360,2),ht(a*100,2),ht(o*100,2),ht(this.alpha,2))}toHSL(){const e=this.red/255,n=this.green/255,r=this.blue/255,i=Math.min(e,n,r),o=Math.max(e,n,r),s=(o+i)/2,a=o-i;let l=-1,c=-1;if(a===0)l=c=0;else{switch(c=a/(s<.5?o+i:2-o-i),o){case e:l=(n-r)/a+(n<r?6:0);break;case n:l=(r-e)/a+2;break;case r:l=(e-n)/a+4;break}l/=6}return new Xg(ht(l*360,2),ht(c*100,2),ht(s*100,2),ht(this.alpha,2))}clone(){return new Zp(this.red,this.green,this.blue,this.alpha)}getChannelFormatOptions(e){switch(e){case"red":case"green":case"blue":return{style:"decimal"};case"alpha":return{style:"percent"};default:throw new Error("Unknown color channel: "+e)}}formatChannelValue(e,n){let r=this.getChannelFormatOptions(e),i=this.getChannelValue(e);return new Intl.NumberFormat(n,r).format(i)}getChannelRange(e){switch(e){case"red":case"green":case"blue":return{minValue:0,maxValue:255,step:1,pageSize:17};case"alpha":return{minValue:0,maxValue:1,step:.01,pageSize:.1};default:throw new Error("Unknown color channel: "+e)}}toJSON(){return{r:this.red,g:this.green,b:this.blue,a:this.alpha}}getFormat(){return"rgba"}getChannels(){return Zp.colorChannels}};qg(mw,"colorChannels",["red","green","blue"]);var Qg=mw,CB=/hsl\(([-+]?\d+(?:.\d+)?\s*,\s*[-+]?\d+(?:.\d+)?%\s*,\s*[-+]?\d+(?:.\d+)?%)\)|hsla\(([-+]?\d+(?:.\d+)?\s*,\s*[-+]?\d+(?:.\d+)?%\s*,\s*[-+]?\d+(?:.\d+)?%\s*,\s*[-+]?\d(.\d+)?)\)/,yw=class eg extends Yg{constructor(e,n,r,i){super(),this.hue=e,this.saturation=n,this.lightness=r,this.alpha=i}static parse(e){var r;let n;if(n=e.match(CB)){const[i,o,s,a]=((r=n[1])!=null?r:n[2]).split(",").map(l=>Number(l.trim().replace("%","")));return new eg(Lv(i,360),Xn(o,0,100),Xn(s,0,100),Xn(a!=null?a:1,0,1))}}toString(e){switch(e){case"hex":return this.toRGB().toString("hex");case"hexa":return this.toRGB().toString("hexa");case"hsl":return`hsl(${this.hue}, ${ht(this.saturation,2)}%, ${ht(this.lightness,2)}%)`;case"css":case"hsla":return`hsla(${this.hue}, ${ht(this.saturation,2)}%, ${ht(this.lightness,2)}%, ${this.alpha})`;case"hsb":return this.toHSB().toString("hsb");case"rgb":return this.toRGB().toString("rgb");default:return this.toFormat(e).toString(e)}}toFormat(e){switch(e){case"hsla":return this;case"hsba":return this.toHSB();case"rgba":return this.toRGB();default:throw new Error("Unsupported color conversion: hsl -> "+e)}}toHSB(){let e=this.saturation/100,n=this.lightness/100,r=n+e*Math.min(n,1-n);return e=r===0?0:2*(1-n/r),new Jg(ht(this.hue,2),ht(e*100,2),ht(r*100,2),ht(this.alpha,2))}toRGB(){let e=this.hue,n=this.saturation/100,r=this.lightness/100,i=n*Math.min(r,1-r),o=(s,a=(s+e/30)%12)=>r-i*Math.max(Math.min(a-3,9-a,1),-1);return new Qg(Math.round(o(0)*255),Math.round(o(8)*255),Math.round(o(4)*255),ht(this.alpha,2))}clone(){return new eg(this.hue,this.saturation,this.lightness,this.alpha)}getChannelFormatOptions(e){switch(e){case"hue":return{style:"unit",unit:"degree",unitDisplay:"narrow"};case"saturation":case"lightness":case"alpha":return{style:"percent"};default:throw new Error("Unknown color channel: "+e)}}formatChannelValue(e,n){let r=this.getChannelFormatOptions(e),i=this.getChannelValue(e);return(e==="saturation"||e==="lightness")&&(i/=100),new Intl.NumberFormat(n,r).format(i)}getChannelRange(e){switch(e){case"hue":return{minValue:0,maxValue:360,step:1,pageSize:15};case"saturation":case"lightness":return{minValue:0,maxValue:100,step:1,pageSize:10};case"alpha":return{minValue:0,maxValue:1,step:.01,pageSize:.1};default:throw new Error("Unknown color channel: "+e)}}toJSON(){return{h:this.hue,s:this.saturation,l:this.lightness,a:this.alpha}}getFormat(){return"hsla"}getChannels(){return eg.colorChannels}};qg(yw,"colorChannels",["hue","saturation","lightness"]);var Xg=yw,IB=/hsb\(([-+]?\d+(?:.\d+)?\s*,\s*[-+]?\d+(?:.\d+)?%\s*,\s*[-+]?\d+(?:.\d+)?%)\)|hsba\(([-+]?\d+(?:.\d+)?\s*,\s*[-+]?\d+(?:.\d+)?%\s*,\s*[-+]?\d+(?:.\d+)?%\s*,\s*[-+]?\d(.\d+)?)\)/,bw=class tg extends Yg{constructor(e,n,r,i){super(),this.hue=e,this.saturation=n,this.brightness=r,this.alpha=i}static parse(e){var r;let n;if(n=e.match(IB)){const[i,o,s,a]=((r=n[1])!=null?r:n[2]).split(",").map(l=>Number(l.trim().replace("%","")));return new tg(Lv(i,360),Xn(o,0,100),Xn(s,0,100),Xn(a!=null?a:1,0,1))}}toString(e){switch(e){case"css":return this.toHSL().toString("css");case"hex":return this.toRGB().toString("hex");case"hexa":return this.toRGB().toString("hexa");case"hsb":return`hsb(${this.hue}, ${ht(this.saturation,2)}%, ${ht(this.brightness,2)}%)`;case"hsba":return`hsba(${this.hue}, ${ht(this.saturation,2)}%, ${ht(this.brightness,2)}%, ${this.alpha})`;case"hsl":return this.toHSL().toString("hsl");case"rgb":return this.toRGB().toString("rgb");default:return this.toFormat(e).toString(e)}}toFormat(e){switch(e){case"hsba":return this;case"hsla":return this.toHSL();case"rgba":return this.toRGB();default:throw new Error("Unsupported color conversion: hsb -> "+e)}}toHSL(){let e=this.saturation/100,n=this.brightness/100,r=n*(1-e/2);return e=r===0||r===1?0:(n-r)/Math.min(r,1-r),new Xg(ht(this.hue,2),ht(e*100,2),ht(r*100,2),ht(this.alpha,2))}toRGB(){let e=this.hue,n=this.saturation/100,r=this.brightness/100,i=(o,s=(o+e/60)%6)=>r-n*r*Math.max(Math.min(s,4-s,1),0);return new Qg(Math.round(i(5)*255),Math.round(i(3)*255),Math.round(i(1)*255),ht(this.alpha,2))}clone(){return new tg(this.hue,this.saturation,this.brightness,this.alpha)}getChannelFormatOptions(e){switch(e){case"hue":return{style:"unit",unit:"degree",unitDisplay:"narrow"};case"saturation":case"brightness":case"alpha":return{style:"percent"};default:throw new Error("Unknown color channel: "+e)}}formatChannelValue(e,n){let r=this.getChannelFormatOptions(e),i=this.getChannelValue(e);return(e==="saturation"||e==="brightness")&&(i/=100),new Intl.NumberFormat(n,r).format(i)}getChannelRange(e){switch(e){case"hue":return{minValue:0,maxValue:360,step:1,pageSize:15};case"saturation":case"brightness":return{minValue:0,maxValue:100,step:1,pageSize:10};case"alpha":return{minValue:0,maxValue:1,step:.01,pageSize:.1};default:throw new Error("Unknown color channel: "+e)}}toJSON(){return{h:this.hue,s:this.saturation,b:this.brightness,a:this.alpha}}getFormat(){return"hsba"}getChannels(){return tg.colorChannels}};qg(bw,"colorChannels",["hue","saturation","brightness"]);var Jg=bw,OB="aliceblue:f0f8ff,antiquewhite:faebd7,aqua:00ffff,aquamarine:7fffd4,azure:f0ffff,beige:f5f5dc,bisque:ffe4c4,black:000000,blanchedalmond:ffebcd,blue:0000ff,blueviolet:8a2be2,brown:a52a2a,burlywood:deb887,cadetblue:5f9ea0,chartreuse:7fff00,chocolate:d2691e,coral:ff7f50,cornflowerblue:6495ed,cornsilk:fff8dc,crimson:dc143c,cyan:00ffff,darkblue:00008b,darkcyan:008b8b,darkgoldenrod:b8860b,darkgray:a9a9a9,darkgreen:006400,darkkhaki:bdb76b,darkmagenta:8b008b,darkolivegreen:556b2f,darkorange:ff8c00,darkorchid:9932cc,darkred:8b0000,darksalmon:e9967a,darkseagreen:8fbc8f,darkslateblue:483d8b,darkslategray:2f4f4f,darkturquoise:00ced1,darkviolet:9400d3,deeppink:ff1493,deepskyblue:00bfff,dimgray:696969,dodgerblue:1e90ff,firebrick:b22222,floralwhite:fffaf0,forestgreen:228b22,fuchsia:ff00ff,gainsboro:dcdcdc,ghostwhite:f8f8ff,gold:ffd700,goldenrod:daa520,gray:808080,green:008000,greenyellow:adff2f,honeydew:f0fff0,hotpink:ff69b4,indianred:cd5c5c,indigo:4b0082,ivory:fffff0,khaki:f0e68c,lavender:e6e6fa,lavenderblush:fff0f5,lawngreen:7cfc00,lemonchiffon:fffacd,lightblue:add8e6,lightcoral:f08080,lightcyan:e0ffff,lightgoldenrodyellow:fafad2,lightgrey:d3d3d3,lightgreen:90ee90,lightpink:ffb6c1,lightsalmon:ffa07a,lightseagreen:20b2aa,lightskyblue:87cefa,lightslategray:778899,lightsteelblue:b0c4de,lightyellow:ffffe0,lime:00ff00,limegreen:32cd32,linen:faf0e6,magenta:ff00ff,maroon:800000,mediumaquamarine:66cdaa,mediumblue:0000cd,mediumorchid:ba55d3,mediumpurple:9370d8,mediumseagreen:3cb371,mediumslateblue:7b68ee,mediumspringgreen:00fa9a,mediumturquoise:48d1cc,mediumvioletred:c71585,midnightblue:191970,mintcream:f5fffa,mistyrose:ffe4e1,moccasin:ffe4b5,navajowhite:ffdead,navy:000080,oldlace:fdf5e6,olive:808000,olivedrab:6b8e23,orange:ffa500,orangered:ff4500,orchid:da70d6,palegoldenrod:eee8aa,palegreen:98fb98,paleturquoise:afeeee,palevioletred:d87093,papayawhip:ffefd5,peachpuff:ffdab9,peru:cd853f,pink:ffc0cb,plum:dda0dd,powderblue:b0e0e6,purple:800080,rebeccapurple:663399,red:ff0000,rosybrown:bc8f8f,royalblue:4169e1,saddlebrown:8b4513,salmon:fa8072,sandybrown:f4a460,seagreen:2e8b57,seashell:fff5ee,sienna:a0522d,silver:c0c0c0,skyblue:87ceeb,slateblue:6a5acd,slategray:708090,snow:fffafa,springgreen:00ff7f,steelblue:4682b4,tan:d2b48c,teal:008080,thistle:d8bfd8,tomato:ff6347,turquoise:40e0d0,violet:ee82ee,wheat:f5deb3,white:ffffff,whitesmoke:f5f5f5,yellow:ffff00,yellowgreen:9acd32",TB=t=>{const e=new Map,n=t.split(",");for(let r=0;r<n.length;r++){const[i,o]=n[r].split(":");e.set(i,`#${o}`),i.includes("gray")&&e.set(i.replace("gray","grey"),`#${o}`)}return e},vw=TB(OB),Tf=t=>{var n;if(vw.has(t))return Tf(vw.get(t));const e=Qg.parse(t)||Jg.parse(t)||Xg.parse(t);if(!e){const r=new Error("Invalid color value: "+t);throw(n=Error.captureStackTrace)==null||n.call(Error,r,Tf),r}return e};const PB=["top","right","bottom","left"],Ho=Math.min,ur=Math.max,Pf=Math.round,Nf=Math.floor,vi=t=>({x:t,y:t}),NB={left:"right",right:"left",bottom:"top",top:"bottom"},BB={start:"end",end:"start"};function Zg(t,e,n){return ur(t,Ho(e,n))}function Xi(t,e){return typeof t=="function"?t(e):t}function Ji(t){return t.split("-")[0]}function gl(t){return t.split("-")[1]}function e0(t){return t==="x"?"y":"x"}function t0(t){return t==="y"?"height":"width"}const RB=new Set(["top","bottom"]);function wi(t){return RB.has(Ji(t))?"y":"x"}function n0(t){return e0(wi(t))}function MB(t,e,n){n===void 0&&(n=!1);const r=gl(t),i=n0(t),o=t0(i);let s=i==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return e.reference[o]>e.floating[o]&&(s=Bf(s)),[s,Bf(s)]}function LB(t){const e=Bf(t);return[r0(t),e,r0(e)]}function r0(t){return t.replace(/start|end/g,e=>BB[e])}const ww=["left","right"],xw=["right","left"],FB=["top","bottom"],_B=["bottom","top"];function VB(t,e,n){switch(t){case"top":case"bottom":return n?e?xw:ww:e?ww:xw;case"left":case"right":return e?FB:_B;default:return[]}}function DB(t,e,n,r){const i=gl(t);let o=VB(Ji(t),n==="start",r);return i&&(o=o.map(s=>s+"-"+i),e&&(o=o.concat(o.map(r0)))),o}function Bf(t){return t.replace(/left|right|bottom|top/g,e=>NB[e])}function zB(t){return{top:0,right:0,bottom:0,left:0,...t}}function Ew(t){return typeof t!="number"?zB(t):{top:t,right:t,bottom:t,left:t}}function Rf(t){const{x:e,y:n,width:r,height:i}=t;return{width:r,height:i,top:n,left:e,right:e+r,bottom:n+i,x:e,y:n}}function Sw(t,e,n){let{reference:r,floating:i}=t;const o=wi(e),s=n0(e),a=t0(s),l=Ji(e),c=o==="y",u=r.x+r.width/2-i.width/2,d=r.y+r.height/2-i.height/2,h=r[a]/2-i[a]/2;let g;switch(l){case"top":g={x:u,y:r.y-i.height};break;case"bottom":g={x:u,y:r.y+r.height};break;case"right":g={x:r.x+r.width,y:d};break;case"left":g={x:r.x-i.width,y:d};break;default:g={x:r.x,y:r.y}}switch(gl(e)){case"start":g[s]-=h*(n&&c?-1:1);break;case"end":g[s]+=h*(n&&c?-1:1);break}return g}const UB=async(t,e,n)=>{const{placement:r="bottom",strategy:i="absolute",middleware:o=[],platform:s}=n,a=o.filter(Boolean),l=await(s.isRTL==null?void 0:s.isRTL(e));let c=await s.getElementRects({reference:t,floating:e,strategy:i}),{x:u,y:d}=Sw(c,r,l),h=r,g={},b=0;for(let p=0;p<a.length;p++){const{name:w,fn:S}=a[p],{x:O,y:T,data:$,reset:R}=await S({x:u,y:d,initialPlacement:r,placement:h,strategy:i,middlewareData:g,rects:c,platform:s,elements:{reference:t,floating:e}});u=O!=null?O:u,d=T!=null?T:d,g={...g,[w]:{...g[w],...$}},R&&b<=50&&(b++,typeof R=="object"&&(R.placement&&(h=R.placement),R.rects&&(c=R.rects===!0?await s.getElementRects({reference:t,floating:e,strategy:i}):R.rects),{x:u,y:d}=Sw(c,h,l)),p=-1)}return{x:u,y:d,placement:h,strategy:i,middlewareData:g}};async function wu(t,e){var n;e===void 0&&(e={});const{x:r,y:i,platform:o,rects:s,elements:a,strategy:l}=t,{boundary:c="clippingAncestors",rootBoundary:u="viewport",elementContext:d="floating",altBoundary:h=!1,padding:g=0}=Xi(e,t),b=Ew(g),w=a[h?d==="floating"?"reference":"floating":d],S=Rf(await o.getClippingRect({element:(n=await(o.isElement==null?void 0:o.isElement(w)))==null||n?w:w.contextElement||await(o.getDocumentElement==null?void 0:o.getDocumentElement(a.floating)),boundary:c,rootBoundary:u,strategy:l})),O=d==="floating"?{x:r,y:i,width:s.floating.width,height:s.floating.height}:s.reference,T=await(o.getOffsetParent==null?void 0:o.getOffsetParent(a.floating)),$=await(o.isElement==null?void 0:o.isElement(T))?await(o.getScale==null?void 0:o.getScale(T))||{x:1,y:1}:{x:1,y:1},R=Rf(o.convertOffsetParentRelativeRectToViewportRelativeRect?await o.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:O,offsetParent:T,strategy:l}):O);return{top:(S.top-R.top+b.top)/$.y,bottom:(R.bottom-S.bottom+b.bottom)/$.y,left:(S.left-R.left+b.left)/$.x,right:(R.right-S.right+b.right)/$.x}}const $B=t=>({name:"arrow",options:t,async fn(e){const{x:n,y:r,placement:i,rects:o,platform:s,elements:a,middlewareData:l}=e,{element:c,padding:u=0}=Xi(t,e)||{};if(c==null)return{};const d=Ew(u),h={x:n,y:r},g=n0(i),b=t0(g),p=await s.getDimensions(c),w=g==="y",S=w?"top":"left",O=w?"bottom":"right",T=w?"clientHeight":"clientWidth",$=o.reference[b]+o.reference[g]-h[g]-o.floating[b],R=h[g]-o.reference[g],j=await(s.getOffsetParent==null?void 0:s.getOffsetParent(c));let q=j?j[T]:0;(!q||!await(s.isElement==null?void 0:s.isElement(j)))&&(q=a.floating[T]||o.floating[b]);const G=$/2-R/2,L=q/2-p[b]/2-1,V=Ho(d[S],L),W=Ho(d[O],L),z=V,C=q-p[b]-W,f=q/2-p[b]/2+G,y=Zg(z,f,C),E=!l.arrow&&gl(i)!=null&&f!==y&&o.reference[b]/2-(f<z?V:W)-p[b]/2<0,I=E?f<z?f-z:f-C:0;return{[g]:h[g]+I,data:{[g]:y,centerOffset:f-y-I,...E&&{alignmentOffset:I}},reset:E}}}),HB=function(t){return t===void 0&&(t={}),{name:"flip",options:t,async fn(e){var n,r;const{placement:i,middlewareData:o,rects:s,initialPlacement:a,platform:l,elements:c}=e,{mainAxis:u=!0,crossAxis:d=!0,fallbackPlacements:h,fallbackStrategy:g="bestFit",fallbackAxisSideDirection:b="none",flipAlignment:p=!0,...w}=Xi(t,e);if((n=o.arrow)!=null&&n.alignmentOffset)return{};const S=Ji(i),O=wi(a),T=Ji(a)===a,$=await(l.isRTL==null?void 0:l.isRTL(c.floating)),R=h||(T||!p?[Bf(a)]:LB(a)),j=b!=="none";!h&&j&&R.push(...DB(a,p,b,$));const q=[a,...R],G=await wu(e,w),L=[];let V=((r=o.flip)==null?void 0:r.overflows)||[];if(u&&L.push(G[S]),d){const f=MB(i,s,$);L.push(G[f[0]],G[f[1]])}if(V=[...V,{placement:i,overflows:L}],!L.every(f=>f<=0)){var W,z;const f=(((W=o.flip)==null?void 0:W.index)||0)+1,y=q[f];if(y&&(!(d==="alignment"?O!==wi(y):!1)||V.every(N=>wi(N.placement)===O?N.overflows[0]>0:!0)))return{data:{index:f,overflows:V},reset:{placement:y}};let E=(z=V.filter(I=>I.overflows[0]<=0).sort((I,N)=>I.overflows[1]-N.overflows[1])[0])==null?void 0:z.placement;if(!E)switch(g){case"bestFit":{var C;const I=(C=V.filter(N=>{if(j){const D=wi(N.placement);return D===O||D==="y"}return!0}).map(N=>[N.placement,N.overflows.filter(D=>D>0).reduce((D,M)=>D+M,0)]).sort((N,D)=>N[1]-D[1])[0])==null?void 0:C[0];I&&(E=I);break}case"initialPlacement":E=a;break}if(i!==E)return{reset:{placement:E}}}return{}}}};function Aw(t,e){return{top:t.top-e.height,right:t.right-e.width,bottom:t.bottom-e.height,left:t.left-e.width}}function kw(t){return PB.some(e=>t[e]>=0)}const WB=function(t){return t===void 0&&(t={}),{name:"hide",options:t,async fn(e){const{rects:n}=e,{strategy:r="referenceHidden",...i}=Xi(t,e);switch(r){case"referenceHidden":{const o=await wu(e,{...i,elementContext:"reference"}),s=Aw(o,n.reference);return{data:{referenceHiddenOffsets:s,referenceHidden:kw(s)}}}case"escaped":{const o=await wu(e,{...i,altBoundary:!0}),s=Aw(o,n.floating);return{data:{escapedOffsets:s,escaped:kw(s)}}}default:return{}}}}},Cw=new Set(["left","top"]);async function GB(t,e){const{placement:n,platform:r,elements:i}=t,o=await(r.isRTL==null?void 0:r.isRTL(i.floating)),s=Ji(n),a=gl(n),l=wi(n)==="y",c=Cw.has(s)?-1:1,u=o&&l?-1:1,d=Xi(e,t);let{mainAxis:h,crossAxis:g,alignmentAxis:b}=typeof d=="number"?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return a&&typeof b=="number"&&(g=a==="end"?b*-1:b),l?{x:g*u,y:h*c}:{x:h*c,y:g*u}}const jB=function(t){return t===void 0&&(t=0),{name:"offset",options:t,async fn(e){var n,r;const{x:i,y:o,placement:s,middlewareData:a}=e,l=await GB(e,t);return s===((n=a.offset)==null?void 0:n.placement)&&(r=a.arrow)!=null&&r.alignmentOffset?{}:{x:i+l.x,y:o+l.y,data:{...l,placement:s}}}}},KB=function(t){return t===void 0&&(t={}),{name:"shift",options:t,async fn(e){const{x:n,y:r,placement:i}=e,{mainAxis:o=!0,crossAxis:s=!1,limiter:a={fn:w=>{let{x:S,y:O}=w;return{x:S,y:O}}},...l}=Xi(t,e),c={x:n,y:r},u=await wu(e,l),d=wi(Ji(i)),h=e0(d);let g=c[h],b=c[d];if(o){const w=h==="y"?"top":"left",S=h==="y"?"bottom":"right",O=g+u[w],T=g-u[S];g=Zg(O,g,T)}if(s){const w=d==="y"?"top":"left",S=d==="y"?"bottom":"right",O=b+u[w],T=b-u[S];b=Zg(O,b,T)}const p=a.fn({...e,[h]:g,[d]:b});return{...p,data:{x:p.x-n,y:p.y-r,enabled:{[h]:o,[d]:s}}}}}},qB=function(t){return t===void 0&&(t={}),{options:t,fn(e){const{x:n,y:r,placement:i,rects:o,middlewareData:s}=e,{offset:a=0,mainAxis:l=!0,crossAxis:c=!0}=Xi(t,e),u={x:n,y:r},d=wi(i),h=e0(d);let g=u[h],b=u[d];const p=Xi(a,e),w=typeof p=="number"?{mainAxis:p,crossAxis:0}:{mainAxis:0,crossAxis:0,...p};if(l){const T=h==="y"?"height":"width",$=o.reference[h]-o.floating[T]+w.mainAxis,R=o.reference[h]+o.reference[T]-w.mainAxis;g<$?g=$:g>R&&(g=R)}if(c){var S,O;const T=h==="y"?"width":"height",$=Cw.has(Ji(i)),R=o.reference[d]-o.floating[T]+($&&((S=s.offset)==null?void 0:S[d])||0)+($?0:w.crossAxis),j=o.reference[d]+o.reference[T]+($?0:((O=s.offset)==null?void 0:O[d])||0)-($?w.crossAxis:0);b<R?b=R:b>j&&(b=j)}return{[h]:g,[d]:b}}}},YB=function(t){return t===void 0&&(t={}),{name:"size",options:t,async fn(e){var n,r;const{placement:i,rects:o,platform:s,elements:a}=e,{apply:l=()=>{},...c}=Xi(t,e),u=await wu(e,c),d=Ji(i),h=gl(i),g=wi(i)==="y",{width:b,height:p}=o.floating;let w,S;d==="top"||d==="bottom"?(w=d,S=h===(await(s.isRTL==null?void 0:s.isRTL(a.floating))?"start":"end")?"left":"right"):(S=d,w=h==="end"?"top":"bottom");const O=p-u.top-u.bottom,T=b-u.left-u.right,$=Ho(p-u[w],O),R=Ho(b-u[S],T),j=!e.middlewareData.shift;let q=$,G=R;if((n=e.middlewareData.shift)!=null&&n.enabled.x&&(G=T),(r=e.middlewareData.shift)!=null&&r.enabled.y&&(q=O),j&&!h){const V=ur(u.left,0),W=ur(u.right,0),z=ur(u.top,0),C=ur(u.bottom,0);g?G=b-2*(V!==0||W!==0?V+W:ur(u.left,u.right)):q=p-2*(z!==0||C!==0?z+C:ur(u.top,u.bottom))}await l({...e,availableWidth:G,availableHeight:q});const L=await s.getDimensions(a.floating);return b!==L.width||p!==L.height?{reset:{rects:!0}}:{}}}};function Mf(){return typeof window!="undefined"}function ml(t){return Iw(t)?(t.nodeName||"").toLowerCase():"#document"}function dr(t){var e;return(t==null||(e=t.ownerDocument)==null?void 0:e.defaultView)||window}function xi(t){var e;return(e=(Iw(t)?t.ownerDocument:t.document)||window.document)==null?void 0:e.documentElement}function Iw(t){return Mf()?t instanceof Node||t instanceof dr(t).Node:!1}function jr(t){return Mf()?t instanceof Element||t instanceof dr(t).Element:!1}function Ei(t){return Mf()?t instanceof HTMLElement||t instanceof dr(t).HTMLElement:!1}function Ow(t){return!Mf()||typeof ShadowRoot=="undefined"?!1:t instanceof ShadowRoot||t instanceof dr(t).ShadowRoot}const QB=new Set(["inline","contents"]);function xu(t){const{overflow:e,overflowX:n,overflowY:r,display:i}=Kr(t);return/auto|scroll|overlay|hidden|clip/.test(e+r+n)&&!QB.has(i)}const XB=new Set(["table","td","th"]);function JB(t){return XB.has(ml(t))}const ZB=[":popover-open",":modal"];function Lf(t){return ZB.some(e=>{try{return t.matches(e)}catch(n){return!1}})}const e4=["transform","translate","scale","rotate","perspective"],t4=["transform","translate","scale","rotate","perspective","filter"],n4=["paint","layout","strict","content"];function i0(t){const e=o0(),n=jr(t)?Kr(t):t;return e4.some(r=>n[r]?n[r]!=="none":!1)||(n.containerType?n.containerType!=="normal":!1)||!e&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!e&&(n.filter?n.filter!=="none":!1)||t4.some(r=>(n.willChange||"").includes(r))||n4.some(r=>(n.contain||"").includes(r))}function r4(t){let e=Wo(t);for(;Ei(e)&&!yl(e);){if(i0(e))return e;if(Lf(e))return null;e=Wo(e)}return null}function o0(){return typeof CSS=="undefined"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const i4=new Set(["html","body","#document"]);function yl(t){return i4.has(ml(t))}function Kr(t){return dr(t).getComputedStyle(t)}function Ff(t){return jr(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function Wo(t){if(ml(t)==="html")return t;const e=t.assignedSlot||t.parentNode||Ow(t)&&t.host||xi(t);return Ow(e)?e.host:e}function Tw(t){const e=Wo(t);return yl(e)?t.ownerDocument?t.ownerDocument.body:t.body:Ei(e)&&xu(e)?e:Tw(e)}function Eu(t,e,n){var r;e===void 0&&(e=[]),n===void 0&&(n=!0);const i=Tw(t),o=i===((r=t.ownerDocument)==null?void 0:r.body),s=dr(i);if(o){const a=s0(s);return e.concat(s,s.visualViewport||[],xu(i)?i:[],a&&n?Eu(a):[])}return e.concat(i,Eu(i,[],n))}function s0(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}function Pw(t){const e=Kr(t);let n=parseFloat(e.width)||0,r=parseFloat(e.height)||0;const i=Ei(t),o=i?t.offsetWidth:n,s=i?t.offsetHeight:r,a=Pf(n)!==o||Pf(r)!==s;return a&&(n=o,r=s),{width:n,height:r,$:a}}function a0(t){return jr(t)?t:t.contextElement}function bl(t){const e=a0(t);if(!Ei(e))return vi(1);const n=e.getBoundingClientRect(),{width:r,height:i,$:o}=Pw(e);let s=(o?Pf(n.width):n.width)/r,a=(o?Pf(n.height):n.height)/i;return(!s||!Number.isFinite(s))&&(s=1),(!a||!Number.isFinite(a))&&(a=1),{x:s,y:a}}const o4=vi(0);function Nw(t){const e=dr(t);return!o0()||!e.visualViewport?o4:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function s4(t,e,n){return e===void 0&&(e=!1),!n||e&&n!==dr(t)?!1:e}function js(t,e,n,r){e===void 0&&(e=!1),n===void 0&&(n=!1);const i=t.getBoundingClientRect(),o=a0(t);let s=vi(1);e&&(r?jr(r)&&(s=bl(r)):s=bl(t));const a=s4(o,n,r)?Nw(o):vi(0);let l=(i.left+a.x)/s.x,c=(i.top+a.y)/s.y,u=i.width/s.x,d=i.height/s.y;if(o){const h=dr(o),g=r&&jr(r)?dr(r):r;let b=h,p=s0(b);for(;p&&r&&g!==b;){const w=bl(p),S=p.getBoundingClientRect(),O=Kr(p),T=S.left+(p.clientLeft+parseFloat(O.paddingLeft))*w.x,$=S.top+(p.clientTop+parseFloat(O.paddingTop))*w.y;l*=w.x,c*=w.y,u*=w.x,d*=w.y,l+=T,c+=$,b=dr(p),p=s0(b)}}return Rf({width:u,height:d,x:l,y:c})}function l0(t,e){const n=Ff(t).scrollLeft;return e?e.left+n:js(xi(t)).left+n}function Bw(t,e,n){n===void 0&&(n=!1);const r=t.getBoundingClientRect(),i=r.left+e.scrollLeft-(n?0:l0(t,r)),o=r.top+e.scrollTop;return{x:i,y:o}}function a4(t){let{elements:e,rect:n,offsetParent:r,strategy:i}=t;const o=i==="fixed",s=xi(r),a=e?Lf(e.floating):!1;if(r===s||a&&o)return n;let l={scrollLeft:0,scrollTop:0},c=vi(1);const u=vi(0),d=Ei(r);if((d||!d&&!o)&&((ml(r)!=="body"||xu(s))&&(l=Ff(r)),Ei(r))){const g=js(r);c=bl(r),u.x=g.x+r.clientLeft,u.y=g.y+r.clientTop}const h=s&&!d&&!o?Bw(s,l,!0):vi(0);return{width:n.width*c.x,height:n.height*c.y,x:n.x*c.x-l.scrollLeft*c.x+u.x+h.x,y:n.y*c.y-l.scrollTop*c.y+u.y+h.y}}function l4(t){return Array.from(t.getClientRects())}function c4(t){const e=xi(t),n=Ff(t),r=t.ownerDocument.body,i=ur(e.scrollWidth,e.clientWidth,r.scrollWidth,r.clientWidth),o=ur(e.scrollHeight,e.clientHeight,r.scrollHeight,r.clientHeight);let s=-n.scrollLeft+l0(t);const a=-n.scrollTop;return Kr(r).direction==="rtl"&&(s+=ur(e.clientWidth,r.clientWidth)-i),{width:i,height:o,x:s,y:a}}function u4(t,e){const n=dr(t),r=xi(t),i=n.visualViewport;let o=r.clientWidth,s=r.clientHeight,a=0,l=0;if(i){o=i.width,s=i.height;const c=o0();(!c||c&&e==="fixed")&&(a=i.offsetLeft,l=i.offsetTop)}return{width:o,height:s,x:a,y:l}}const d4=new Set(["absolute","fixed"]);function f4(t,e){const n=js(t,!0,e==="fixed"),r=n.top+t.clientTop,i=n.left+t.clientLeft,o=Ei(t)?bl(t):vi(1),s=t.clientWidth*o.x,a=t.clientHeight*o.y,l=i*o.x,c=r*o.y;return{width:s,height:a,x:l,y:c}}function Rw(t,e,n){let r;if(e==="viewport")r=u4(t,n);else if(e==="document")r=c4(xi(t));else if(jr(e))r=f4(e,n);else{const i=Nw(t);r={x:e.x-i.x,y:e.y-i.y,width:e.width,height:e.height}}return Rf(r)}function Mw(t,e){const n=Wo(t);return n===e||!jr(n)||yl(n)?!1:Kr(n).position==="fixed"||Mw(n,e)}function h4(t,e){const n=e.get(t);if(n)return n;let r=Eu(t,[],!1).filter(a=>jr(a)&&ml(a)!=="body"),i=null;const o=Kr(t).position==="fixed";let s=o?Wo(t):t;for(;jr(s)&&!yl(s);){const a=Kr(s),l=i0(s);!l&&a.position==="fixed"&&(i=null),(o?!l&&!i:!l&&a.position==="static"&&!!i&&d4.has(i.position)||xu(s)&&!l&&Mw(t,s))?r=r.filter(u=>u!==s):i=a,s=Wo(s)}return e.set(t,r),r}function p4(t){let{element:e,boundary:n,rootBoundary:r,strategy:i}=t;const s=[...n==="clippingAncestors"?Lf(e)?[]:h4(e,this._c):[].concat(n),r],a=s[0],l=s.reduce((c,u)=>{const d=Rw(e,u,i);return c.top=ur(d.top,c.top),c.right=Ho(d.right,c.right),c.bottom=Ho(d.bottom,c.bottom),c.left=ur(d.left,c.left),c},Rw(e,a,i));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}function g4(t){const{width:e,height:n}=Pw(t);return{width:e,height:n}}function m4(t,e,n){const r=Ei(e),i=xi(e),o=n==="fixed",s=js(t,!0,o,e);let a={scrollLeft:0,scrollTop:0};const l=vi(0);function c(){l.x=l0(i)}if(r||!r&&!o)if((ml(e)!=="body"||xu(i))&&(a=Ff(e)),r){const g=js(e,!0,o,e);l.x=g.x+e.clientLeft,l.y=g.y+e.clientTop}else i&&c();o&&!r&&i&&c();const u=i&&!r&&!o?Bw(i,a):vi(0),d=s.left+a.scrollLeft-l.x-u.x,h=s.top+a.scrollTop-l.y-u.y;return{x:d,y:h,width:s.width,height:s.height}}function c0(t){return Kr(t).position==="static"}function Lw(t,e){if(!Ei(t)||Kr(t).position==="fixed")return null;if(e)return e(t);let n=t.offsetParent;return xi(t)===n&&(n=n.ownerDocument.body),n}function Fw(t,e){const n=dr(t);if(Lf(t))return n;if(!Ei(t)){let i=Wo(t);for(;i&&!yl(i);){if(jr(i)&&!c0(i))return i;i=Wo(i)}return n}let r=Lw(t,e);for(;r&&JB(r)&&c0(r);)r=Lw(r,e);return r&&yl(r)&&c0(r)&&!i0(r)?n:r||r4(t)||n}const y4=async function(t){const e=this.getOffsetParent||Fw,n=this.getDimensions,r=await n(t.floating);return{reference:m4(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function b4(t){return Kr(t).direction==="rtl"}const v4={convertOffsetParentRelativeRectToViewportRelativeRect:a4,getDocumentElement:xi,getClippingRect:p4,getOffsetParent:Fw,getElementRects:y4,getClientRects:l4,getDimensions:g4,getScale:bl,isElement:jr,isRTL:b4};function _w(t,e){return t.x===e.x&&t.y===e.y&&t.width===e.width&&t.height===e.height}function w4(t,e){let n=null,r;const i=xi(t);function o(){var a;clearTimeout(r),(a=n)==null||a.disconnect(),n=null}function s(a,l){a===void 0&&(a=!1),l===void 0&&(l=1),o();const c=t.getBoundingClientRect(),{left:u,top:d,width:h,height:g}=c;if(a||e(),!h||!g)return;const b=Nf(d),p=Nf(i.clientWidth-(u+h)),w=Nf(i.clientHeight-(d+g)),S=Nf(u),T={rootMargin:-b+"px "+-p+"px "+-w+"px "+-S+"px",threshold:ur(0,Ho(1,l))||1};let $=!0;function R(j){const q=j[0].intersectionRatio;if(q!==l){if(!$)return s();q?s(!1,q):r=setTimeout(()=>{s(!1,1e-7)},1e3)}q===1&&!_w(c,t.getBoundingClientRect())&&s(),$=!1}try{n=new IntersectionObserver(R,{...T,root:i.ownerDocument})}catch(j){n=new IntersectionObserver(R,T)}n.observe(t)}return s(!0),o}function x4(t,e,n,r){r===void 0&&(r={});const{ancestorScroll:i=!0,ancestorResize:o=!0,elementResize:s=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:l=!1}=r,c=a0(t),u=i||o?[...c?Eu(c):[],...Eu(e)]:[];u.forEach(S=>{i&&S.addEventListener("scroll",n,{passive:!0}),o&&S.addEventListener("resize",n)});const d=c&&a?w4(c,n):null;let h=-1,g=null;s&&(g=new ResizeObserver(S=>{let[O]=S;O&&O.target===c&&g&&(g.unobserve(e),cancelAnimationFrame(h),h=requestAnimationFrame(()=>{var T;(T=g)==null||T.observe(e)})),n()}),c&&!l&&g.observe(c),g.observe(e));let b,p=l?js(t):null;l&&w();function w(){const S=js(t);p&&!_w(p,S)&&n(),p=S,b=requestAnimationFrame(w)}return n(),()=>{var S;u.forEach(O=>{i&&O.removeEventListener("scroll",n),o&&O.removeEventListener("resize",n)}),d==null||d(),(S=g)==null||S.disconnect(),g=null,l&&cancelAnimationFrame(b)}}const E4=jB,S4=KB,A4=HB,k4=YB,C4=WB,I4=$B,O4=qB,T4=(t,e,n)=>{const r=new Map,i={platform:v4,...n},o={...i.platform,_c:r};return UB(t,e,{...i,platform:o})};function Vw(t=0,e=0,n=0,r=0){if(typeof DOMRect=="function")return new DOMRect(t,e,n,r);const i={x:t,y:e,width:n,height:r,top:e,right:t+n,bottom:e+r,left:t};return{...i,toJSON:()=>i}}function P4(t){if(!t)return Vw();const{x:e,y:n,width:r,height:i}=t;return Vw(e,n,r,i)}function N4(t,e){return{contextElement:Jn(t)?t:void 0,getBoundingClientRect:()=>{const n=t,r=e==null?void 0:e(n);return r||!n?P4(r):n.getBoundingClientRect()}}}var Su=t=>({variable:t,reference:`var(${t})`}),Zi={arrowSize:Su("--arrow-size"),arrowSizeHalf:Su("--arrow-size-half"),arrowBg:Su("--arrow-background"),transformOrigin:Su("--transform-origin"),arrowOffset:Su("--arrow-offset")},B4=t=>({top:"bottom center","top-start":t?`${t.x}px bottom`:"left bottom","top-end":t?`${t.x}px bottom`:"right bottom",bottom:"top center","bottom-start":t?`${t.x}px top`:"top left","bottom-end":t?`${t.x}px top`:"top right",left:"right center","left-start":t?`right ${t.y}px`:"right top","left-end":t?`right ${t.y}px`:"right bottom",right:"left center","right-start":t?`left ${t.y}px`:"left top","right-end":t?`left ${t.y}px`:"left bottom"}),R4={name:"transformOrigin",fn({placement:t,elements:e,middlewareData:n}){const{arrow:r}=n,i=B4(r)[t],{floating:o}=e;return o.style.setProperty(Zi.transformOrigin.variable,i),{data:{transformOrigin:i}}}},M4={name:"rects",fn({rects:t}){return{data:t}}},L4=t=>{if(t)return{name:"shiftArrow",fn({placement:e,middlewareData:n}){if(!n.arrow)return{};const{x:r,y:i}=n.arrow,o=e.split("-")[0];return Object.assign(t.style,{left:r!=null?`${r}px`:"",top:i!=null?`${i}px`:"",[o]:`calc(100% + ${Zi.arrowOffset.reference})`}),{}}}};function F4(t){const[e,n]=t.split("-");return{side:e,align:n,hasAlign:n!=null}}function _4(t){return t.split("-")[0]}var V4={strategy:"absolute",placement:"bottom",listeners:!0,gutter:8,flip:!0,slide:!0,overlap:!1,sameWidth:!1,fitViewport:!1,overflowPadding:8,arrowPadding:4};function Dw(t,e){const n=t.devicePixelRatio||1;return Math.round(e*n)/n}function zw(t){return yu(t.boundary)}function D4(t,e){if(t)return I4({element:t,padding:e.arrowPadding})}function z4(t,e){var n;if(!b3((n=e.offset)!=null?n:e.gutter))return E4(({placement:r})=>{var u,d,h,g;const i=((t==null?void 0:t.clientHeight)||0)/2,o=(d=(u=e.offset)==null?void 0:u.mainAxis)!=null?d:e.gutter,s=typeof o=="number"?o+i:o!=null?o:i,{hasAlign:a}=F4(r),l=a?void 0:e.shift,c=(g=(h=e.offset)==null?void 0:h.crossAxis)!=null?g:l;return ff({crossAxis:c,mainAxis:s,alignmentAxis:e.shift})})}function U4(t){if(t.flip)return A4({boundary:zw(t),padding:t.overflowPadding,fallbackPlacements:t.flip===!0?void 0:t.flip})}function $4(t){if(!(!t.slide&&!t.overlap))return S4({boundary:zw(t),mainAxis:t.slide,crossAxis:t.overlap,padding:t.overflowPadding,limiter:O4()})}function H4(t){return k4({padding:t.overflowPadding,apply({elements:e,rects:n,availableHeight:r,availableWidth:i}){const o=e.floating,s=Math.round(n.reference.width);i=Math.floor(i),r=Math.floor(r),o.style.setProperty("--reference-width",`${s}px`),o.style.setProperty("--available-width",`${i}px`),o.style.setProperty("--available-height",`${r}px`)}})}function W4(t){var e,n;if(t.hideWhenDetached)return C4({strategy:"referenceHidden",boundary:(n=(e=t.boundary)==null?void 0:e.call(t))!=null?n:"clippingAncestors"})}function G4(t){return t?t===!0?{ancestorResize:!0,ancestorScroll:!0,elementResize:!0,layoutShift:!0}:t:{}}function j4(t,e,n={}){const r=N4(t,n.getAnchorRect);if(!e||!r)return;const i=Object.assign({},V4,n),o=e.querySelector("[data-part=arrow]"),s=[z4(o,i),U4(i),$4(i),D4(o,i),L4(o),R4,H4(i),W4(i),M4],{placement:a,strategy:l,onComplete:c,onPositioned:u}=i,d=async()=>{var $;if(!r||!e)return;const p=await T4(r,e,{placement:a,middleware:s,strategy:l});c==null||c(p),u==null||u({placed:!0});const w=on(e),S=Dw(w,p.x),O=Dw(w,p.y);e.style.setProperty("--x",`${S}px`),e.style.setProperty("--y",`${O}px`),i.hideWhenDetached&&((($=p.middlewareData.hide)==null?void 0:$.referenceHidden)?(e.style.setProperty("visibility","hidden"),e.style.setProperty("pointer-events","none")):(e.style.removeProperty("visibility"),e.style.removeProperty("pointer-events")));const T=e.firstElementChild;if(T){const R=gf(T);e.style.setProperty("--z-index",R.zIndex)}},h=async()=>{n.updatePosition?(await n.updatePosition({updatePosition:d,floatingElement:e}),u==null||u({placed:!0})):await d()},g=G4(i.listeners),b=i.listeners?x4(r,e,h,g):C3;return h(),()=>{b==null||b(),u==null||u({placed:!1})}}function qr(t,e,n={}){const{defer:r,...i}=n,o=r?ze:a=>a(),s=[];return s.push(o(()=>{const a=typeof t=="function"?t():t,l=typeof e=="function"?e():e;s.push(j4(a,l,i))})),()=>{s.forEach(a=>a==null?void 0:a())}}var K4={bottom:"rotate(45deg)",left:"rotate(135deg)",top:"rotate(225deg)",right:"rotate(315deg)"};function q4(t={}){const{placement:e,sameWidth:n,fitViewport:r,strategy:i="absolute"}=t;return{arrow:{position:"absolute",width:Zi.arrowSize.reference,height:Zi.arrowSize.reference,[Zi.arrowSizeHalf.variable]:`calc(${Zi.arrowSize.reference} / 2)`,[Zi.arrowOffset.variable]:`calc(${Zi.arrowSizeHalf.reference} * -1)`},arrowTip:{transform:e?K4[e.split("-")[0]]:void 0,background:Zi.arrowBg.reference,top:"0",left:"0",width:"100%",height:"100%",position:"absolute",zIndex:"inherit"},floating:{position:i,isolation:"isolate",minWidth:n?void 0:"max-content",width:n?"var(--reference-width)":void 0,maxWidth:r?"var(--available-width)":void 0,maxHeight:r?"var(--available-height)":void 0,pointerEvents:e?void 0:"none",top:"0px",left:"0px",transform:e?"translate3d(var(--x), var(--y), 0)":"translate3d(0, -100vh, 0)",zIndex:"var(--z-index)"}}}function Y4(t){const e={each(n){var r;for(let i=0;i<((r=t.frames)==null?void 0:r.length);i+=1){const o=t.frames[i];o&&n(o)}},addEventListener(n,r,i){return e.each(o=>{try{o.document.addEventListener(n,r,i)}catch(s){}}),()=>{try{e.removeEventListener(n,r,i)}catch(o){}}},removeEventListener(n,r,i){e.each(o=>{try{o.document.removeEventListener(n,r,i)}catch(s){}})}};return e}function Q4(t){const e=t.frameElement!=null?t.parent:null;return{addEventListener:(n,r,i)=>{try{e==null||e.addEventListener(n,r,i)}catch(o){}return()=>{try{e==null||e.removeEventListener(n,r,i)}catch(o){}}},removeEventListener:(n,r,i)=>{try{e==null||e.removeEventListener(n,r,i)}catch(o){}}}}var Uw="pointerdown.outside",$w="focus.outside";function X4(t){for(const e of t)if(Jn(e)&&Fg(e))return!0;return!1}var Hw=t=>"clientY"in t;function J4(t,e){if(!Hw(e)||!t)return!1;const n=t.getBoundingClientRect();return n.width===0||n.height===0?!1:n.top<=e.clientY&&e.clientY<=n.top+n.height&&n.left<=e.clientX&&e.clientX<=n.left+n.width}function Z4(t,e){return t.y<=e.y&&e.y<=t.y+t.height&&t.x<=e.x&&e.x<=t.x+t.width}function Ww(t,e){if(!e||!Hw(t))return!1;const n=e.scrollHeight>e.clientHeight,r=n&&t.clientX>e.offsetLeft+e.clientWidth,i=e.scrollWidth>e.clientWidth,o=i&&t.clientY>e.offsetTop+e.clientHeight,s={x:e.offsetLeft,y:e.offsetTop,width:e.clientWidth+(n?16:0),height:e.clientHeight+(i?16:0)},a={x:t.clientX,y:t.clientY};return Z4(s,a)?r||o:!1}function e6(t,e){const{exclude:n,onFocusOutside:r,onPointerDownOutside:i,onInteractOutside:o,defer:s}=e;if(!t)return;const a=Ir(t),l=on(t),c=Y4(l),u=Q4(l);function d(O,T){if(!Jn(T)||!T.isConnected||Ws(t,T)||J4(t,O))return!1;const $=a.querySelector(`[aria-controls="${t.id}"]`);if($){const j=xf($);if(Ww(O,j))return!1}const R=xf(t);return Ww(O,R)?!1:!(n!=null&&n(T))}const h=new Set,g=dl(t==null?void 0:t.getRootNode());function b(O){function T($){var G,L;const R=s&&!Gv()?ze:V=>V(),j=$!=null?$:O,q=(L=(G=j==null?void 0:j.composedPath)==null?void 0:G.call(j))!=null?L:[j==null?void 0:j.target];R(()=>{const V=g?q[0]:Gr(O);if(!(!t||!d(O,V))){if(i||o){const W=uf(i,o);t.addEventListener(Uw,W,{once:!0})}Gw(t,Uw,{bubbles:!1,cancelable:!0,detail:{originalEvent:j,contextmenu:bN(j),focusable:X4(q),target:V}})}})}O.pointerType==="touch"?(h.forEach($=>$()),h.add(gn(a,"click",T,{once:!0})),h.add(u.addEventListener("click",T,{once:!0})),h.add(c.addEventListener("click",T,{once:!0}))):T()}const p=new Set,w=setTimeout(()=>{p.add(gn(a,"pointerdown",b,!0)),p.add(u.addEventListener("pointerdown",b,!0)),p.add(c.addEventListener("pointerdown",b,!0))},0);function S(O){(s?ze:$=>$())(()=>{const $=Gr(O);if(!(!t||!d(O,$))){if(r||o){const R=uf(r,o);t.addEventListener($w,R,{once:!0})}Gw(t,$w,{bubbles:!1,cancelable:!0,detail:{originalEvent:O,contextmenu:!1,focusable:Fg($),target:$}})}})}return Gv()||(p.add(gn(a,"focusin",S,!0)),p.add(u.addEventListener("focusin",S,!0)),p.add(c.addEventListener("focusin",S,!0))),()=>{clearTimeout(w),h.forEach(O=>O()),p.forEach(O=>O())}}function t6(t,e){const{defer:n}=e,r=n?ze:o=>o(),i=[];return i.push(r(()=>{const o=typeof t=="function"?t():t;i.push(e6(o,e))})),()=>{i.forEach(o=>o==null?void 0:o())}}function Gw(t,e,n){const r=t.ownerDocument.defaultView||window,i=new r.CustomEvent(e,n);return t.dispatchEvent(i)}function n6(t,e){const n=r=>{r.key==="Escape"&&(r.isComposing||e==null||e(r))};return gn(Ir(t),"keydown",n,{capture:!0})}var Yr={layers:[],branches:[],count(){return this.layers.length},pointerBlockingLayers(){return this.layers.filter(t=>t.pointerBlocking)},topMostPointerBlockingLayer(){return[...this.pointerBlockingLayers()].slice(-1)[0]},hasPointerBlockingLayer(){return this.pointerBlockingLayers().length>0},isBelowPointerBlockingLayer(t){var r;const e=this.indexOf(t),n=this.topMostPointerBlockingLayer()?this.indexOf((r=this.topMostPointerBlockingLayer())==null?void 0:r.node):-1;return e<n},isTopMost(t){const e=this.layers[this.count()-1];return(e==null?void 0:e.node)===t},getNestedLayers(t){return Array.from(this.layers).slice(this.indexOf(t)+1)},isInNestedLayer(t,e){return this.getNestedLayers(t).some(n=>Ws(n.node,e))},isInBranch(t){return Array.from(this.branches).some(e=>Ws(e,t))},add(t){const e=this.layers.push(t);t.node.style.setProperty("--layer-index",`${e}`)},addBranch(t){this.branches.push(t)},remove(t){const e=this.indexOf(t);e<0||(e<this.count()-1&&this.getNestedLayers(t).forEach(r=>r.dismiss()),this.layers.splice(e,1),t.style.removeProperty("--layer-index"))},removeBranch(t){const e=this.branches.indexOf(t);e>=0&&this.branches.splice(e,1)},indexOf(t){return this.layers.findIndex(e=>e.node===t)},dismiss(t){var e;(e=this.layers[this.indexOf(t)])==null||e.dismiss()},clear(){this.remove(this.layers[0].node)}},jw;function Kw(){Yr.layers.forEach(({node:t})=>{t.style.pointerEvents=Yr.isBelowPointerBlockingLayer(t)?"none":"auto"})}function r6(t){t.style.pointerEvents=""}function i6(t,e){const n=Ir(t),r=[];return Yr.hasPointerBlockingLayer()&&!n.body.hasAttribute("data-inert")&&(jw=document.body.style.pointerEvents,queueMicrotask(()=>{n.body.style.pointerEvents="none",n.body.setAttribute("data-inert","")})),e==null||e.forEach(i=>{const[o,s]=JN(()=>{const a=i();return Jn(a)?a:null},{timeout:1e3});o.then(a=>r.push($g(a,{pointerEvents:"auto"}))),r.push(s)}),()=>{Yr.hasPointerBlockingLayer()||(queueMicrotask(()=>{n.body.style.pointerEvents=jw,n.body.removeAttribute("data-inert"),n.body.style.length===0&&n.body.removeAttribute("style")}),r.forEach(i=>i()))}}function o6(t,e){const{warnOnMissingNode:n=!0}=e;if(n&&!t){bu("[@zag-js/dismissable] node is `null` or `undefined`");return}if(!t)return;const{onDismiss:r,pointerBlocking:i,exclude:o,debug:s}=e,a={dismiss:r,node:t,pointerBlocking:i};Yr.add(a),Kw();function l(g){var p,w;const b=Gr(g.detail.originalEvent);Yr.isBelowPointerBlockingLayer(t)||Yr.isInBranch(b)||((p=e.onPointerDownOutside)==null||p.call(e,g),(w=e.onInteractOutside)==null||w.call(e,g),!g.defaultPrevented&&(s&&console.log("onPointerDownOutside:",g.detail.originalEvent),r==null||r()))}function c(g){var p,w;const b=Gr(g.detail.originalEvent);Yr.isInBranch(b)||((p=e.onFocusOutside)==null||p.call(e,g),(w=e.onInteractOutside)==null||w.call(e,g),!g.defaultPrevented&&(s&&console.log("onFocusOutside:",g.detail.originalEvent),r==null||r()))}function u(g){var b;Yr.isTopMost(t)&&((b=e.onEscapeKeyDown)==null||b.call(e,g),!g.defaultPrevented&&r&&(g.preventDefault(),r()))}function d(g){var S;if(!t)return!1;const b=typeof o=="function"?o():o,p=Array.isArray(b)?b:[b],w=(S=e.persistentElements)==null?void 0:S.map(O=>O()).filter(Jn);return w&&p.push(...w),p.some(O=>Ws(O,g))||Yr.isInNestedLayer(t,g)}const h=[i?i6(t,e.persistentElements):void 0,n6(t,u),t6(t,{exclude:d,onFocusOutside:c,onPointerDownOutside:l,defer:e.defer})];return()=>{Yr.remove(t),Kw(),r6(t),h.forEach(g=>g==null?void 0:g())}}function Au(t,e){const{defer:n}=e,r=n?ze:o=>o(),i=[];return i.push(r(()=>{const o=Hs(t)?t():t;i.push(o6(o,e))})),()=>{i.forEach(o=>o==null?void 0:o())}}var qw=Ie("color-picker",["root","label","control","trigger","positioner","content","area","areaThumb","valueText","areaBackground","channelSlider","channelSliderLabel","channelSliderTrack","channelSliderThumb","channelSliderValueText","channelInput","transparencyGrid","swatchGroup","swatchTrigger","swatchIndicator","swatch","eyeDropperTrigger","formatTrigger","formatSelect"]);qw.build();var s6=t=>{var e,n;return(n=(e=t.ids)==null?void 0:e.hiddenInput)!=null?n:`color-picker:${t.id}:hidden-input`},a6=t=>{var e,n;return(n=(e=t.ids)==null?void 0:e.control)!=null?n:`color-picker:${t.id}:control`},l6=t=>{var e,n;return(n=(e=t.ids)==null?void 0:e.trigger)!=null?n:`color-picker:${t.id}:trigger`},c6=t=>{var e,n;return(n=(e=t.ids)==null?void 0:e.content)!=null?n:`color-picker:${t.id}:content`},u6=t=>{var e,n;return(n=(e=t.ids)==null?void 0:e.positioner)!=null?n:`color-picker:${t.id}:positioner`},d6=t=>{var e,n;return(n=(e=t.ids)==null?void 0:e.formatSelect)!=null?n:`color-picker:${t.id}:format-select`},f6=t=>{var e,n;return(n=(e=t.ids)==null?void 0:e.area)!=null?n:`color-picker:${t.id}:area`},h6=t=>{var e,n;return(n=(e=t.ids)==null?void 0:e.areaThumb)!=null?n:`color-picker:${t.id}:area-thumb`},p6=(t,e)=>{var n,r,i;return(i=(r=(n=t.ids)==null?void 0:n.channelSliderTrack)==null?void 0:r.call(n,e))!=null?i:`color-picker:${t.id}:slider-track:${e}`},g6=(t,e)=>{var n,r,i;return(i=(r=(n=t.ids)==null?void 0:n.channelSliderThumb)==null?void 0:r.call(n,e))!=null?i:`color-picker:${t.id}:slider-thumb:${e}`},_f=t=>t.getById(c6(t)),m6=t=>t.getById(h6(t)),y6=(t,e)=>t.getById(g6(t,e)),b6=t=>t.getById(d6(t)),Yw=t=>t.getById(s6(t)),v6=t=>t.getById(f6(t)),w6=(t,e)=>{const n=v6(t);if(!n)return;const{percent:r}=Xv(e,n);return r},x6=t=>t.getById(a6(t)),u0=t=>t.getById(l6(t)),E6=t=>t.getById(u6(t)),S6=(t,e)=>t.getById(p6(t,e)),A6=(t,e,n)=>{const r=S6(t,n);if(!r)return;const{percent:i}=Xv(e,r);return i},k6=t=>[...Af(_f(t),"input[data-channel]"),...Af(x6(t),"input[data-channel]")];function C6(t,e){if(e==null)return"";if(e==="hex")return t.toString("hex");if(e==="css")return t.toString("css");if(e in t)return t.getChannelValue(e).toString();const n=t.getFormat()==="hsla";switch(e){case"hue":return n?t.toFormat("hsla").getChannelValue("hue").toString():t.toFormat("hsba").getChannelValue("hue").toString();case"saturation":return n?t.toFormat("hsla").getChannelValue("saturation").toString():t.toFormat("hsba").getChannelValue("saturation").toString();case"lightness":return t.toFormat("hsla").getChannelValue("lightness").toString();case"brightness":return t.toFormat("hsba").getChannelValue("brightness").toString();case"red":case"green":case"blue":return t.toFormat("rgba").getChannelValue(e).toString();default:return t.getChannelValue(e).toString()}}var Qw=t=>Tf(t),I6=/^[0-9a-fA-F]{3,8}$/;function O6(t){return I6.test(t)}function T6(t){return t.startsWith("#")?t:O6(t)?`#${t}`:t}var{and:P6}=$o();P6("isOpenControlled","closeOnSelect");function Xw(t,e,n){const r=k6(t);ze(()=>{r.forEach(i=>{const o=i.dataset.channel;bf(i,C6(n||e,o))})})}function N6(t,e){const n=b6(t);n&&ze(()=>bf(n,e))}Be()(["closeOnSelect","dir","disabled","format","defaultFormat","getRootNode","id","ids","initialFocusEl","inline","name","positioning","onFocusOutside","onFormatChange","onInteractOutside","onOpenChange","onPointerDownOutside","onValueChange","onValueChangeEnd","defaultOpen","open","positioning","required","readOnly","value","defaultValue","invalid","openAutoFocus"]),Be()(["xChannel","yChannel"]),Be()(["channel","orientation"]),Be()(["value","disabled"]),Be()(["value","respectAlpha"]),Be()(["size"]);const Jw=J.forwardRef((t,e)=>{const n=pw();if(n.isUnmounted)return null;const r=cr(n.getContentProps(),t);return k.jsx(bi.div,{...r,ref:e})});Jw.displayName="CollapsibleContent";var Zw=Ie("accordion").parts("root","item","itemTrigger","itemContent","itemIndicator");Zw.build();var e1=t=>{var e,n;return(n=(e=t.ids)==null?void 0:e.root)!=null?n:`accordion:${t.id}`},t1=(t,e)=>{var n,r,i;return(i=(r=(n=t.ids)==null?void 0:n.itemTrigger)==null?void 0:r.call(n,e))!=null?i:`accordion:${t.id}:trigger:${e}`},B6=t=>t.getById(e1(t)),Vf=t=>{const n=`[aria-controls][data-ownedby='${CSS.escape(e1(t))}']:not([disabled])`;return Af(B6(t),n)},R6=t=>gu(Vf(t)),M6=t=>Ig(Vf(t)),L6=(t,e)=>HN(Vf(t),t1(t,e)),F6=(t,e)=>WN(Vf(t),t1(t,e)),{and:_6,not:V6}=$o();_6("isExpanded","canToggle"),V6("isExpanded"),Be()(["collapsible","dir","disabled","getRootNode","id","ids","multiple","onFocusChange","onValueChange","orientation","value","defaultValue"]),Be()(["value","disabled"]);var ku=(t,e)=>({x:t,y:e});function D6(t){const{x:e,y:n,width:r,height:i}=t,o=e+r/2,s=n+i/2;return{x:e,y:n,width:r,height:i,minX:e,minY:n,maxX:e+r,maxY:n+i,midX:o,midY:s,center:ku(o,s)}}function z6(t){const e=ku(t.minX,t.minY),n=ku(t.maxX,t.minY),r=ku(t.maxX,t.maxY),i=ku(t.minX,t.maxY);return{top:e,right:n,bottom:r,left:i}}function U6(t,e){const n=D6(t),{top:r,right:i,left:o,bottom:s}=z6(n),[a]=e.split("-");return{top:[o,r,i,s],right:[r,i,s,o],bottom:[r,o,s,i],left:[i,r,o,s]}[a]}function $6(t,e){const{x:n,y:r}=e;let i=!1;for(let o=0,s=t.length-1;o<t.length;s=o++){const a=t[o].x,l=t[o].y,c=t[s].x,u=t[s].y;l>r!=u>r&&n<(c-a)*(r-l)/(u-l)+a&&(i=!i)}return i}var n1=Ie("avatar").parts("root","image","fallback");n1.build(),Be()(["dir","id","ids","onStatusChange","getRootNode"]);function H6(t){return!(t.metaKey||!yf()&&t.altKey||t.ctrlKey||t.key==="Control"||t.key==="Shift"||t.key==="Meta")}var W6=new Set(["checkbox","radio","range","color","file","image","button","submit","reset"]);function G6(t,e,n){const r=n?Gr(n):null,i=on(r);return t=t||r instanceof i.HTMLInputElement&&!W6.has(r==null?void 0:r.type)||r instanceof i.HTMLTextAreaElement||r instanceof i.HTMLElement&&r.isContentEditable,!(t&&e==="keyboard"&&n instanceof i.KeyboardEvent&&!Reflect.has(j6,n.key))}var Ks=null,d0=new Set,Cu=new Map,qs=!1,f0=!1,j6={Tab:!0,Escape:!0};function Df(t,e){for(let n of d0)n(t,e)}function zf(t){qs=!0,H6(t)&&(Ks="keyboard",Df("keyboard",t))}function Or(t){Ks="pointer",(t.type==="mousedown"||t.type==="pointerdown")&&(qs=!0,Df("pointer",t))}function r1(t){mN(t)&&(qs=!0,Ks="virtual")}function i1(t){const e=Gr(t);e===on(e)||e===Ir(e)||(!qs&&!f0&&(Ks="virtual",Df("virtual",t)),qs=!1,f0=!1)}function o1(){qs=!1,f0=!0}function K6(t){if(typeof window=="undefined"||Cu.get(on(t)))return;const e=on(t),n=Ir(t);let r=e.HTMLElement.prototype.focus;function i(){Ks="virtual",Df("virtual",null),qs=!0,r.apply(this,arguments)}Object.defineProperty(e.HTMLElement.prototype,"focus",{configurable:!0,value:i}),n.addEventListener("keydown",zf,!0),n.addEventListener("keyup",zf,!0),n.addEventListener("click",r1,!0),e.addEventListener("focus",i1,!0),e.addEventListener("blur",o1,!1),typeof e.PointerEvent!="undefined"?(n.addEventListener("pointerdown",Or,!0),n.addEventListener("pointermove",Or,!0),n.addEventListener("pointerup",Or,!0)):(n.addEventListener("mousedown",Or,!0),n.addEventListener("mousemove",Or,!0),n.addEventListener("mouseup",Or,!0)),e.addEventListener("beforeunload",()=>{q6(t)},{once:!0}),Cu.set(e,{focus:r})}var q6=(t,e)=>{const n=on(t),r=Ir(t);Cu.has(n)&&(n.HTMLElement.prototype.focus=Cu.get(n).focus,r.removeEventListener("keydown",zf,!0),r.removeEventListener("keyup",zf,!0),r.removeEventListener("click",r1,!0),n.removeEventListener("focus",i1,!0),n.removeEventListener("blur",o1,!1),typeof n.PointerEvent!="undefined"?(r.removeEventListener("pointerdown",Or,!0),r.removeEventListener("pointermove",Or,!0),r.removeEventListener("pointerup",Or,!0)):(r.removeEventListener("mousedown",Or,!0),r.removeEventListener("mousemove",Or,!0),r.removeEventListener("mouseup",Or,!0)),Cu.delete(n))};function h0(){return Ks==="keyboard"}function Y6(t={}){const{isTextInput:e,autoFocus:n,onChange:r,root:i}=t;K6(i),r==null||r({isFocusVisible:n||h0(),modality:Ks});const o=(s,a)=>{G6(!!e,s,a)&&(r==null||r({isFocusVisible:h0(),modality:s}))};return d0.add(o),()=>{d0.delete(o)}}var s1=Ie("checkbox").parts("root","label","control","indicator");s1.build(),Be()(["defaultChecked","checked","dir","disabled","form","getRootNode","id","ids","invalid","name","onCheckedChange","readOnly","required","value"]);const Q6=s1.extendWith("group"),[OK,X6]=ul({name:"FieldContext",hookName:"useFieldContext",providerName:"<FieldProvider />",strict:!1});var a1=Ie("clipboard").parts("root","control","trigger","indicator","input","label");a1.build(),Be()(["getRootNode","id","ids","value","defaultValue","timeout","onStatusChange","onValueChange"]),Be()(["copied"]);const l1=J.forwardRef((t,e)=>{const[{value:n},r]=Gg()(t,["value"]),i=cr(n.getRootProps(),r);return k.jsx(hw,{value:n,children:k.jsx(bi.div,{...i,ref:e})})});l1.displayName="CollapsibleRootProvider";const c1=J.forwardRef((t,e)=>{const n=pw(),r=cr(n.getTriggerProps(),t);return k.jsx(bi.button,{...r,ref:e})});c1.displayName="CollapsibleTrigger";const J6=qw.extendWith("view");var Z6=Object.defineProperty,e5=(t,e,n)=>e in t?Z6(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,pe=(t,e,n)=>e5(t,typeof e!="symbol"?e+"":e,n),Uf={itemToValue(t){return typeof t=="string"?t:$s(t)&&Uo(t,"value")?t.value:""},itemToString(t){return typeof t=="string"?t:$s(t)&&Uo(t,"label")?t.label:Uf.itemToValue(t)},isItemDisabled(t){return $s(t)&&Uo(t,"disabled")?!!t.disabled:!1}},$f=class kT{constructor(e){this.options=e,pe(this,"items"),pe(this,"copy",n=>new kT({...this.options,items:n!=null?n:[...this.items]})),pe(this,"isEqual",n=>Wr(this.items,n.items)),pe(this,"setItems",n=>this.copy(n)),pe(this,"getValues",(n=this.items)=>Array.from(n).map(r=>this.getItemValue(r)).filter(Boolean)),pe(this,"find",n=>{if(n==null)return null;const r=this.indexOf(n);return r!=null?this.at(r):null}),pe(this,"findMany",n=>Array.from(n).map(r=>this.find(r)).filter(r=>r!=null)),pe(this,"at",n=>{var o;if(!this.options.groupBy&&!this.options.groupSort)return(o=this.items[n])!=null?o:null;let r=0;const i=this.group();for(const[,s]of i)for(const a of s){if(r===n)return a;r++}return null}),pe(this,"sortFn",(n,r)=>{const i=this.indexOf(n),o=this.indexOf(r);return(i!=null?i:0)-(o!=null?o:0)}),pe(this,"sort",n=>[...n].sort(this.sortFn.bind(this))),pe(this,"getItemValue",n=>{var r,i,o;return n==null?null:(o=(i=(r=this.options).itemToValue)==null?void 0:i.call(r,n))!=null?o:Uf.itemToValue(n)}),pe(this,"getItemDisabled",n=>{var r,i,o;return n==null?!1:(o=(i=(r=this.options).isItemDisabled)==null?void 0:i.call(r,n))!=null?o:Uf.isItemDisabled(n)}),pe(this,"stringifyItem",n=>{var r,i,o;return n==null?null:(o=(i=(r=this.options).itemToString)==null?void 0:i.call(r,n))!=null?o:Uf.itemToString(n)}),pe(this,"stringify",n=>n==null?null:this.stringifyItem(this.find(n))),pe(this,"stringifyItems",(n,r=", ")=>Array.from(n).map(i=>this.stringifyItem(i)).filter(Boolean).join(r)),pe(this,"stringifyMany",(n,r)=>this.stringifyItems(this.findMany(n),r)),pe(this,"has",n=>this.indexOf(n)!==-1),pe(this,"hasItem",n=>n==null?!1:this.has(this.getItemValue(n))),pe(this,"group",()=>{const{groupBy:n,groupSort:r}=this.options;if(!n)return[["",[...this.items]]];const i=new Map;this.items.forEach((s,a)=>{const l=n(s,a);i.has(l)||i.set(l,[]),i.get(l).push(s)});let o=Array.from(i.entries());return r&&o.sort(([s],[a])=>{if(typeof r=="function")return r(s,a);if(Array.isArray(r)){const l=r.indexOf(s),c=r.indexOf(a);return l===-1?1:c===-1?-1:l-c}return r==="asc"?s.localeCompare(a):r==="desc"?a.localeCompare(s):0}),o}),pe(this,"getNextValue",(n,r=1,i=!1)=>{let o=this.indexOf(n);if(o===-1)return null;for(o=i?Math.min(o+r,this.size-1):o+r;o<=this.size&&this.getItemDisabled(this.at(o));)o++;return this.getItemValue(this.at(o))}),pe(this,"getPreviousValue",(n,r=1,i=!1)=>{let o=this.indexOf(n);if(o===-1)return null;for(o=i?Math.max(o-r,0):o-r;o>=0&&this.getItemDisabled(this.at(o));)o--;return this.getItemValue(this.at(o))}),pe(this,"indexOf",n=>{if(n==null)return-1;if(!this.options.groupBy&&!this.options.groupSort)return this.items.findIndex(o=>this.getItemValue(o)===n);let r=0;const i=this.group();for(const[,o]of i)for(const s of o){if(this.getItemValue(s)===n)return r;r++}return-1}),pe(this,"getByText",(n,r)=>{let i=r!=null?n5(this.items,this.indexOf(r)):this.items;return n.length===1&&(i=i.filter(s=>this.getItemValue(s)!==r)),i.find(s=>t5(this.stringifyItem(s),n))}),pe(this,"search",(n,r)=>{const{state:i,currentValue:o,timeout:s=350}=r,a=i.keysSoFar+n,c=a.length>1&&Array.from(a).every(b=>b===a[0])?a[0]:a,u=this.getByText(c,o),d=this.getItemValue(u);function h(){clearTimeout(i.timer),i.timer=-1}function g(b){i.keysSoFar=b,h(),b!==""&&(i.timer=+setTimeout(()=>{g(""),h()},s))}return g(a),d}),pe(this,"update",(n,r)=>{let i=this.indexOf(n);return i===-1?this:this.copy([...this.items.slice(0,i),r,...this.items.slice(i+1)])}),pe(this,"upsert",(n,r,i="append")=>{let o=this.indexOf(n);return o===-1?(i==="append"?this.append:this.prepend)(r):this.copy([...this.items.slice(0,o),r,...this.items.slice(o+1)])}),pe(this,"insert",(n,...r)=>this.copy(Iu(this.items,n,...r))),pe(this,"insertBefore",(n,...r)=>{let i=this.indexOf(n);if(i===-1)if(this.items.length===0)i=0;else return this;return this.copy(Iu(this.items,i,...r))}),pe(this,"insertAfter",(n,...r)=>{let i=this.indexOf(n);if(i===-1)if(this.items.length===0)i=0;else return this;return this.copy(Iu(this.items,i+1,...r))}),pe(this,"prepend",(...n)=>this.copy(Iu(this.items,0,...n))),pe(this,"append",(...n)=>this.copy(Iu(this.items,this.items.length,...n))),pe(this,"filter",n=>{const r=this.items.filter((i,o)=>n(this.stringifyItem(i),o,i));return this.copy(r)}),pe(this,"remove",(...n)=>{const r=n.map(i=>typeof i=="string"?i:this.getItemValue(i));return this.copy(this.items.filter(i=>{const o=this.getItemValue(i);return o==null?!1:!r.includes(o)}))}),pe(this,"move",(n,r)=>{const i=this.indexOf(n);return i===-1?this:this.copy(Hf(this.items,[i],r))}),pe(this,"moveBefore",(n,...r)=>{let i=this.items.findIndex(s=>this.getItemValue(s)===n);if(i===-1)return this;let o=r.map(s=>this.items.findIndex(a=>this.getItemValue(a)===s)).sort((s,a)=>s-a);return this.copy(Hf(this.items,o,i))}),pe(this,"moveAfter",(n,...r)=>{let i=this.items.findIndex(s=>this.getItemValue(s)===n);if(i===-1)return this;let o=r.map(s=>this.items.findIndex(a=>this.getItemValue(a)===s)).sort((s,a)=>s-a);return this.copy(Hf(this.items,o,i+1))}),pe(this,"reorder",(n,r)=>this.copy(Hf(this.items,[n],r))),pe(this,"compareValue",(n,r)=>{const i=this.indexOf(n),o=this.indexOf(r);return i<o?-1:i>o?1:0}),pe(this,"range",(n,r)=>{let i=[],o=n;for(;o!=null;){if(this.find(o)&&i.push(o),o===r)return i;o=this.getNextValue(o)}return[]}),pe(this,"getValueRange",(n,r)=>n&&r?this.compareValue(n,r)<=0?this.range(n,r):this.range(r,n):[]),pe(this,"toString",()=>{let n="";for(const r of this.items){const i=this.getItemValue(r),o=this.stringifyItem(r),s=this.getItemDisabled(r),a=[i,o,s].filter(Boolean).join(":");n+=a+","}return n}),pe(this,"toJSON",()=>({size:this.size,first:this.firstValue,last:this.lastValue})),this.items=[...e.items]}get size(){return this.items.length}get firstValue(){let e=0;for(;this.getItemDisabled(this.at(e));)e++;return this.getItemValue(this.at(e))}get lastValue(){let e=this.size-1;for(;this.getItemDisabled(this.at(e));)e--;return this.getItemValue(this.at(e))}*[Symbol.iterator](){yield*this.items}},t5=(t,e)=>!!(t!=null&&t.toLowerCase().startsWith(e.toLowerCase())),n5=(t,e)=>t.map((n,r)=>t[(Math.max(e,0)+r)%t.length]);function Iu(t,e,...n){return[...t.slice(0,e),...n,...t.slice(e)]}function Hf(t,e,n){e=[...e].sort((i,o)=>i-o);const r=e.map(i=>t[i]);for(let i=e.length-1;i>=0;i--)t=[...t.slice(0,e[i]),...t.slice(e[i]+1)];return n=Math.max(0,n-e.filter(i=>i<n).length),[...t.slice(0,n),...r,...t.slice(n)]}function u1(t,e,n){for(let r=0;r<e.length;r++)t=n.getChildren(t,e.slice(r+1))[e[r]];return t}function r5(t){const e=i5(t),n=[],r=new Set;for(const i of e){const o=i.join();r.has(o)||(r.add(o),n.push(i))}return n}function d1(t,e){for(let n=0;n<Math.min(t.length,e.length);n++){if(t[n]<e[n])return-1;if(t[n]>e[n])return 1}return t.length-e.length}function i5(t){return t.sort(d1)}function o5(t,e){let n;return fr(t,{...e,onEnter:(r,i)=>{if(e.predicate(r,i))return n=r,"stop"}}),n}function s5(t,e){const n=[];return fr(t,{onEnter:(r,i)=>{e.predicate(r,i)&&n.push(r)},getChildren:e.getChildren}),n}function f1(t,e){let n;return fr(t,{onEnter:(r,i)=>{if(e.predicate(r,i))return n=[...i],"stop"},getChildren:e.getChildren}),n}function a5(t,e){let n=e.initialResult;return fr(t,{...e,onEnter:(r,i)=>{n=e.nextResult(n,r,i)}}),n}function l5(t,e){return a5(t,{...e,initialResult:[],nextResult:(n,r,i)=>(n.push(...e.transform(r,i)),n)})}function c5(t,e){const{predicate:n,create:r,getChildren:i}=e,o=(s,a)=>{const l=i(s,a),c=[];l.forEach((g,b)=>{const p=[...a,b],w=o(g,p);w&&c.push(w)});const u=a.length===0,d=n(s,a),h=c.length>0;return u||d||h?r(s,c,a):null};return o(t,[])||r(t,[],[])}function u5(t,e){const n=[];let r=0;const i=new Map,o=new Map;return fr(t,{getChildren:e.getChildren,onEnter:(s,a)=>{i.has(s)||i.set(s,r++);const l=e.getChildren(s,a);l.forEach(g=>{o.has(g)||o.set(g,s),i.has(g)||i.set(g,r++)});const c=l.length>0?l.map(g=>i.get(g)):void 0,u=o.get(s),d=u?i.get(u):void 0,h=i.get(s);n.push({...s,_children:c,_parent:d,_index:h})}}),n}function d5(t,e){return{type:"insert",index:t,nodes:e}}function f5(t){return{type:"remove",indexes:t}}function p0(){return{type:"replace"}}function h1(t){return[t.slice(0,-1),t[t.length-1]]}function p1(t,e,n=new Map){var s;const[r,i]=h1(t);for(let a=r.length-1;a>=0;a--){const l=r.slice(0,a).join();switch((s=n.get(l))==null?void 0:s.type){case"remove":continue}n.set(l,p0())}const o=n.get(r.join());switch(o==null?void 0:o.type){case"remove":n.set(r.join(),{type:"removeThenInsert",removeIndexes:o.indexes,insertIndex:i,insertNodes:e});break;default:n.set(r.join(),d5(i,e))}return n}function g1(t){var r;const e=new Map,n=new Map;for(const i of t){const o=i.slice(0,-1).join(),s=(r=n.get(o))!=null?r:[];s.push(i[i.length-1]),n.set(o,s.sort((a,l)=>a-l))}for(const i of t)for(let o=i.length-2;o>=0;o--){const s=i.slice(0,o).join();e.has(s)||e.set(s,p0())}for(const[i,o]of n)e.set(i,f5(o));return e}function h5(t,e){const n=new Map,[r,i]=h1(t);for(let o=r.length-1;o>=0;o--){const s=r.slice(0,o).join();n.set(s,p0())}return n.set(r.join(),{type:"removeThenInsert",removeIndexes:[i],insertIndex:i,insertNodes:[e]}),n}function Wf(t,e,n){return p5(t,{...n,getChildren:(r,i)=>{const o=i.join(),s=e.get(o);switch(s==null?void 0:s.type){case"replace":case"remove":case"removeThenInsert":case"insert":return n.getChildren(r,i);default:return[]}},transform:(r,i,o)=>{const s=o.join(),a=e.get(s);switch(a==null?void 0:a.type){case"remove":return n.create(r,i.filter((u,d)=>!a.indexes.includes(d)),o);case"removeThenInsert":const l=i.filter((u,d)=>!a.removeIndexes.includes(d)),c=a.removeIndexes.reduce((u,d)=>d<u?u-1:u,a.insertIndex);return n.create(r,m1(l,c,0,...a.insertNodes),o);case"insert":return n.create(r,m1(i,a.index,0,...a.nodes),o);case"replace":return n.create(r,i,o);default:return r}}})}function m1(t,e,n,...r){return[...t.slice(0,e),...r,...t.slice(e+n)]}function p5(t,e){const n={};return fr(t,{...e,onLeave:(r,i)=>{var u,d;const o=[0,...i],s=o.join(),a=e.transform(r,(u=n[s])!=null?u:[],i),l=o.slice(0,-1).join(),c=(d=n[l])!=null?d:[];c.push(a),n[l]=c}}),n[""][0]}function g5(t,e){const{nodes:n,at:r}=e;if(r.length===0)throw new Error("Can't insert nodes at the root");const i=p1(r,n);return Wf(t,i,e)}function m5(t,e){if(e.at.length===0)return e.node;const n=h5(e.at,e.node);return Wf(t,n,e)}function y5(t,e){if(e.indexPaths.length===0)return t;for(const r of e.indexPaths)if(r.length===0)throw new Error("Can't remove the root node");const n=g1(e.indexPaths);return Wf(t,n,e)}function b5(t,e){if(e.indexPaths.length===0)return t;for(const o of e.indexPaths)if(o.length===0)throw new Error("Can't move the root node");if(e.to.length===0)throw new Error("Can't move nodes to the root");const n=r5(e.indexPaths),r=n.map(o=>u1(t,o,e)),i=p1(e.to,r,g1(n));return Wf(t,i,e)}function fr(t,e){const{onEnter:n,onLeave:r,getChildren:i}=e;let o=[],s=[{node:t}];const a=e.reuseIndexPath?()=>o:()=>o.slice();for(;s.length>0;){let l=s[s.length-1];if(l.state===void 0){const u=n==null?void 0:n(l.node,a());if(u==="stop")return;l.state=u==="skip"?-1:0}const c=l.children||i(l.node,a());if(l.children||(l.children=c),l.state!==-1){if(l.state<c.length){let d=l.state;o.push(d),s.push({node:c[d]}),l.state=d+1;continue}if((r==null?void 0:r(l.node,a()))==="stop")return}o.pop(),s.pop()}}var y1=class CT{constructor(e){this.options=e,pe(this,"rootNode"),pe(this,"isEqual",n=>Wr(this.rootNode,n.rootNode)),pe(this,"getNodeChildren",n=>{var r,i,o,s;return(s=(o=(i=(r=this.options).nodeToChildren)==null?void 0:i.call(r,n))!=null?o:vl.nodeToChildren(n))!=null?s:[]}),pe(this,"resolveIndexPath",n=>typeof n=="string"?this.getIndexPath(n):n),pe(this,"resolveNode",n=>{const r=this.resolveIndexPath(n);return r?this.at(r):void 0}),pe(this,"getNodeChildrenCount",n=>{var r,i,o;return(o=(i=(r=this.options).nodeToChildrenCount)==null?void 0:i.call(r,n))!=null?o:vl.nodeToChildrenCount(n)}),pe(this,"getNodeValue",n=>{var r,i,o;return(o=(i=(r=this.options).nodeToValue)==null?void 0:i.call(r,n))!=null?o:vl.nodeToValue(n)}),pe(this,"getNodeDisabled",n=>{var r,i,o;return(o=(i=(r=this.options).isNodeDisabled)==null?void 0:i.call(r,n))!=null?o:vl.isNodeDisabled(n)}),pe(this,"stringify",n=>{const r=this.findNode(n);return r?this.stringifyNode(r):null}),pe(this,"stringifyNode",n=>{var r,i,o;return(o=(i=(r=this.options).nodeToString)==null?void 0:i.call(r,n))!=null?o:vl.nodeToString(n)}),pe(this,"getFirstNode",(n=this.rootNode)=>{let r;return fr(n,{getChildren:this.getNodeChildren,onEnter:(i,o)=>{if(!r&&o.length>0&&!this.getNodeDisabled(i))return r=i,"stop"}}),r}),pe(this,"getLastNode",(n=this.rootNode,r={})=>{let i;return fr(n,{getChildren:this.getNodeChildren,onEnter:(o,s)=>{var a;if(!this.isSameNode(o,n)){if((a=r.skip)!=null&&a.call(r,{value:this.getNodeValue(o),node:o,indexPath:s}))return"skip";s.length>0&&!this.getNodeDisabled(o)&&(i=o)}}}),i}),pe(this,"at",n=>u1(this.rootNode,n,{getChildren:this.getNodeChildren})),pe(this,"findNode",(n,r=this.rootNode)=>o5(r,{getChildren:this.getNodeChildren,predicate:i=>this.getNodeValue(i)===n})),pe(this,"findNodes",(n,r=this.rootNode)=>{const i=new Set(n.filter(o=>o!=null));return s5(r,{getChildren:this.getNodeChildren,predicate:o=>i.has(this.getNodeValue(o))})}),pe(this,"sort",n=>n.reduce((r,i)=>{const o=this.getIndexPath(i);return o&&r.push({value:i,indexPath:o}),r},[]).sort((r,i)=>d1(r.indexPath,i.indexPath)).map(({value:r})=>r)),pe(this,"getIndexPath",n=>f1(this.rootNode,{getChildren:this.getNodeChildren,predicate:r=>this.getNodeValue(r)===n})),pe(this,"getValue",n=>{const r=this.at(n);return r?this.getNodeValue(r):void 0}),pe(this,"getValuePath",n=>{if(!n)return[];const r=[];let i=[...n];for(;i.length>0;){const o=this.at(i);o&&r.unshift(this.getNodeValue(o)),i.pop()}return r}),pe(this,"getDepth",n=>{var i;const r=f1(this.rootNode,{getChildren:this.getNodeChildren,predicate:o=>this.getNodeValue(o)===n});return(i=r==null?void 0:r.length)!=null?i:0}),pe(this,"isSameNode",(n,r)=>this.getNodeValue(n)===this.getNodeValue(r)),pe(this,"isRootNode",n=>this.isSameNode(n,this.rootNode)),pe(this,"contains",(n,r)=>!n||!r?!1:r.slice(0,n.length).every((i,o)=>n[o]===r[o])),pe(this,"getNextNode",(n,r={})=>{let i=!1,o;return fr(this.rootNode,{getChildren:this.getNodeChildren,onEnter:(s,a)=>{var c;if(this.isRootNode(s))return;const l=this.getNodeValue(s);if((c=r.skip)!=null&&c.call(r,{value:l,node:s,indexPath:a}))return l===n&&(i=!0),"skip";if(i&&!this.getNodeDisabled(s))return o=s,"stop";l===n&&(i=!0)}}),o}),pe(this,"getPreviousNode",(n,r={})=>{let i,o=!1;return fr(this.rootNode,{getChildren:this.getNodeChildren,onEnter:(s,a)=>{var c;if(this.isRootNode(s))return;const l=this.getNodeValue(s);if((c=r.skip)!=null&&c.call(r,{value:l,node:s,indexPath:a}))return"skip";if(l===n)return o=!0,"stop";this.getNodeDisabled(s)||(i=s)}}),o?i:void 0}),pe(this,"getParentNodes",n=>{var o;const r=(o=this.resolveIndexPath(n))==null?void 0:o.slice();if(!r)return[];const i=[];for(;r.length>0;){r.pop();const s=this.at(r);s&&!this.isRootNode(s)&&i.unshift(s)}return i}),pe(this,"getDescendantNodes",(n,r)=>{const i=this.resolveNode(n);if(!i)return[];const o=[];return fr(i,{getChildren:this.getNodeChildren,onEnter:(s,a)=>{a.length!==0&&(!(r!=null&&r.withBranch)&&this.isBranchNode(s)||o.push(s))}}),o}),pe(this,"getDescendantValues",(n,r)=>this.getDescendantNodes(n,r).map(o=>this.getNodeValue(o))),pe(this,"getParentIndexPath",n=>n.slice(0,-1)),pe(this,"getParentNode",n=>{const r=this.resolveIndexPath(n);return r?this.at(this.getParentIndexPath(r)):void 0}),pe(this,"visit",n=>{const{skip:r,...i}=n;fr(this.rootNode,{...i,getChildren:this.getNodeChildren,onEnter:(o,s)=>{var a;if(!this.isRootNode(o))return r!=null&&r({value:this.getNodeValue(o),node:o,indexPath:s})?"skip":(a=i.onEnter)==null?void 0:a.call(i,o,s)}})}),pe(this,"getPreviousSibling",n=>{const r=this.getParentNode(n);if(!r)return;const i=this.getNodeChildren(r);let o=n[n.length-1];for(;--o>=0;){const s=i[o];if(!this.getNodeDisabled(s))return s}}),pe(this,"getNextSibling",n=>{const r=this.getParentNode(n);if(!r)return;const i=this.getNodeChildren(r);let o=n[n.length-1];for(;++o<i.length;){const s=i[o];if(!this.getNodeDisabled(s))return s}}),pe(this,"getSiblingNodes",n=>{const r=this.getParentNode(n);return r?this.getNodeChildren(r):[]}),pe(this,"getValues",(n=this.rootNode)=>l5(n,{getChildren:this.getNodeChildren,transform:i=>[this.getNodeValue(i)]}).slice(1)),pe(this,"isValidDepth",(n,r)=>r==null?!0:typeof r=="function"?r(n.length):n.length===r),pe(this,"isBranchNode",n=>this.getNodeChildren(n).length>0||this.getNodeChildrenCount(n)!=null),pe(this,"getBranchValues",(n=this.rootNode,r={})=>{let i=[];return fr(n,{getChildren:this.getNodeChildren,onEnter:(o,s)=>{var l;if(s.length===0)return;const a=this.getNodeValue(o);if((l=r.skip)!=null&&l.call(r,{value:a,node:o,indexPath:s}))return"skip";this.isBranchNode(o)&&this.isValidDepth(s,r.depth)&&i.push(this.getNodeValue(o))}}),i}),pe(this,"flatten",(n=this.rootNode)=>u5(n,{getChildren:this.getNodeChildren})),pe(this,"_create",(n,r)=>this.getNodeChildren(n).length>0||r.length>0?{...n,children:r}:{...n}),pe(this,"_insert",(n,r,i)=>this.copy(g5(n,{at:r,nodes:i,getChildren:this.getNodeChildren,create:this._create}))),pe(this,"copy",n=>new CT({...this.options,rootNode:n})),pe(this,"_replace",(n,r,i)=>this.copy(m5(n,{at:r,node:i,getChildren:this.getNodeChildren,create:this._create}))),pe(this,"_move",(n,r,i)=>this.copy(b5(n,{indexPaths:r,to:i,getChildren:this.getNodeChildren,create:this._create}))),pe(this,"_remove",(n,r)=>this.copy(y5(n,{indexPaths:r,getChildren:this.getNodeChildren,create:this._create}))),pe(this,"replace",(n,r)=>this._replace(this.rootNode,n,r)),pe(this,"remove",n=>this._remove(this.rootNode,n)),pe(this,"insertBefore",(n,r)=>this.getParentNode(n)?this._insert(this.rootNode,n,r):void 0),pe(this,"insertAfter",(n,r)=>{if(!this.getParentNode(n))return;const o=[...n.slice(0,-1),n[n.length-1]+1];return this._insert(this.rootNode,o,r)}),pe(this,"move",(n,r)=>this._move(this.rootNode,n,r)),pe(this,"filter",n=>{const r=c5(this.rootNode,{predicate:n,getChildren:this.getNodeChildren,create:this._create});return this.copy(r)}),pe(this,"toJSON",()=>this.getValues(this.rootNode)),this.rootNode=e.rootNode}},vl={nodeToValue(t){return typeof t=="string"?t:$s(t)&&Uo(t,"value")?t.value:""},nodeToString(t){return typeof t=="string"?t:$s(t)&&Uo(t,"label")?t.label:vl.nodeToValue(t)},isNodeDisabled(t){return $s(t)&&Uo(t,"disabled")?!!t.disabled:!1},nodeToChildren(t){return t.children},nodeToChildrenCount(t){if($s(t)&&Uo(t,"childrenCount"))return t.childrenCount}},wl=new WeakMap,Gf=new WeakMap,jf={},g0=0,b1=t=>t&&(t.host||b1(t.parentNode)),v5=(t,e)=>e.map(n=>{if(t.contains(n))return n;const r=b1(n);return r&&t.contains(r)?r:(console.error("[zag-js > ariaHidden] target",n,"in not contained inside",t,". Doing nothing"),null)}).filter(n=>!!n),w5=new Set(["script","output","status","next-route-announcer"]),x5=t=>w5.has(t.localName)||t.role==="status"||t.hasAttribute("aria-live")?!0:t.matches("[data-live-announcer]"),E5=(t,e)=>{const{parentNode:n,markerName:r,controlAttribute:i}=e,o=v5(n,Array.isArray(t)?t:[t]);jf[r]||(jf[r]=new WeakMap);const s=jf[r],a=[],l=new Set,c=new Set(o),u=h=>{!h||l.has(h)||(l.add(h),u(h.parentNode))};o.forEach(u);const d=h=>{!h||c.has(h)||Array.prototype.forEach.call(h.children,g=>{if(l.has(g))d(g);else try{if(x5(g))return;const p=g.getAttribute(i)==="true",w=(wl.get(g)||0)+1,S=(s.get(g)||0)+1;wl.set(g,w),s.set(g,S),a.push(g),w===1&&p&&Gf.set(g,!0),S===1&&g.setAttribute(r,""),p||g.setAttribute(i,"true")}catch(b){console.error("[zag-js > ariaHidden] cannot operate on ",g,b)}})};return d(n),l.clear(),g0++,()=>{a.forEach(h=>{const g=wl.get(h)-1,b=s.get(h)-1;wl.set(h,g),s.set(h,b),g||(Gf.has(h)||h.removeAttribute(i),Gf.delete(h)),b||h.removeAttribute(r)}),g0--,g0||(wl=new WeakMap,wl=new WeakMap,Gf=new WeakMap,jf={})}},S5=t=>(Array.isArray(t)?t[0]:t).ownerDocument.body,A5=(t,e=S5(t),n="data-aria-hidden")=>{if(e)return E5(t,{parentNode:e,markerName:n,controlAttribute:"aria-hidden"})},k5=t=>{const e=requestAnimationFrame(()=>t());return()=>cancelAnimationFrame(e)};function C5(t,e={}){const{defer:n=!0}=e,r=n?k5:o=>o(),i=[];return i.push(r(()=>{const s=(typeof t=="function"?t():t).filter(Boolean);s.length!==0&&i.push(A5(s))})),()=>{i.forEach(o=>o==null?void 0:o())}}var v1=Ie("combobox").parts("root","clearTrigger","content","control","input","item","itemGroup","itemGroupLabel","itemIndicator","itemText","label","list","positioner","trigger");v1.build();var w1=t=>new $f(t);w1.empty=()=>new $f({items:[]});var I5=t=>{var e,n;return(n=(e=t.ids)==null?void 0:e.control)!=null?n:`combobox:${t.id}:control`},O5=t=>{var e,n;return(n=(e=t.ids)==null?void 0:e.input)!=null?n:`combobox:${t.id}:input`},T5=t=>{var e,n;return(n=(e=t.ids)==null?void 0:e.content)!=null?n:`combobox:${t.id}:content`},P5=t=>{var e,n;return(n=(e=t.ids)==null?void 0:e.positioner)!=null?n:`combobox:${t.id}:popper`},N5=t=>{var e,n;return(n=(e=t.ids)==null?void 0:e.trigger)!=null?n:`combobox:${t.id}:toggle-btn`},B5=t=>{var e,n;return(n=(e=t.ids)==null?void 0:e.clearTrigger)!=null?n:`combobox:${t.id}:clear-btn`},Go=t=>t.getById(T5(t)),xl=t=>t.getById(O5(t)),x1=t=>t.getById(P5(t)),E1=t=>t.getById(I5(t)),Ou=t=>t.getById(N5(t)),S1=t=>t.getById(B5(t)),A1=(t,e)=>{if(e==null)return;const n=`[role=option][data-value="${CSS.escape(e)}"]`;return UN(Go(t),n)},k1=t=>{const e=xl(t);t.isActiveElement(e)||e==null||e.focus({preventScroll:!0})},R5=t=>{const e=Ou(t);t.isActiveElement(e)||e==null||e.focus({preventScroll:!0})},{guards:M5,createMachine:L5,choose:F5}=tw(),{and:sn,not:hr}=M5;L5({props({props:t}){return{loopFocus:!0,openOnClick:!1,defaultValue:[],closeOnSelect:!t.multiple,allowCustomValue:!1,inputBehavior:"none",selectionBehavior:t.multiple?"clear":"replace",openOnKeyPress:!0,openOnChange:!0,composite:!0,navigate({node:e}){Yv(e)},collection:w1.empty(),...t,positioning:{placement:"bottom",sameWidth:!0,...t.positioning},translations:{triggerLabel:"Toggle suggestions",clearTriggerLabel:"Clear value",...t.translations}}},initialState({prop:t}){return t("open")||t("defaultOpen")?"suggesting":"idle"},context({prop:t,bindable:e,getContext:n,getEvent:r}){return{currentPlacement:e(()=>({defaultValue:void 0})),value:e(()=>({defaultValue:t("defaultValue"),value:t("value"),isEqual:Wr,hash(i){return i.join(",")},onChange(i){var c;const o=n(),s=o.get("selectedItems"),a=t("collection"),l=i.map(u=>s.find(h=>a.getItemValue(h)===u)||a.find(u));o.set("selectedItems",l),(c=t("onValueChange"))==null||c({value:i,items:l})}})),highlightedValue:e(()=>({defaultValue:t("defaultHighlightedValue")||null,value:t("highlightedValue"),onChange(i){var s;const o=t("collection").find(i);(s=t("onHighlightChange"))==null||s({highlightedValue:i,highlightedItem:o})}})),inputValue:e(()=>{let i=t("inputValue")||t("defaultInputValue")||"";const o=t("defaultValue")||t("value")||[];if(!i.trim()&&!t("multiple")){const s=t("collection").stringifyMany(o);i=Yi(t("selectionBehavior"),{preserve:i||s,replace:s,clear:""})}return{defaultValue:i,value:t("inputValue"),onChange(s){var c;const a=r(),l=(a.previousEvent||a).src;(c=t("onInputValueChange"))==null||c({inputValue:s,reason:l})}}}),highlightedItem:e(()=>{const i=t("highlightedValue");return{defaultValue:t("collection").find(i)}}),selectedItems:e(()=>{const i=t("value")||t("defaultValue")||[];return{defaultValue:t("collection").findMany(i)}})}},computed:{isInputValueEmpty:({context:t})=>t.get("inputValue").length===0,isInteractive:({prop:t})=>!(t("readOnly")||t("disabled")),autoComplete:({prop:t})=>t("inputBehavior")==="autocomplete",autoHighlight:({prop:t})=>t("inputBehavior")==="autohighlight",hasSelectedItems:({context:t})=>t.get("value").length>0,valueAsString:({context:t,prop:e})=>e("collection").stringifyItems(t.get("selectedItems")),isCustomValue:({context:t,computed:e})=>t.get("inputValue")!==e("valueAsString")},watch({context:t,prop:e,track:n,action:r,send:i}){n([()=>t.hash("value")],()=>{r(["syncSelectedItems"])}),n([()=>t.get("inputValue")],()=>{r(["syncInputValue"])}),n([()=>t.get("highlightedValue")],()=>{r(["syncHighlightedItem","autofillInputValue"])}),n([()=>e("open")],()=>{r(["toggleVisibility"])}),n([()=>e("collection").toString()],()=>{i({type:"CHILDREN_CHANGE"})})},on:{"SELECTED_ITEMS.SYNC":{actions:["syncSelectedItems"]},"HIGHLIGHTED_VALUE.SET":{actions:["setHighlightedValue"]},"HIGHLIGHTED_VALUE.CLEAR":{actions:["clearHighlightedValue"]},"ITEM.SELECT":{actions:["selectItem"]},"ITEM.CLEAR":{actions:["clearItem"]},"VALUE.SET":{actions:["setValue"]},"INPUT_VALUE.SET":{actions:["setInputValue"]},"POSITIONING.SET":{actions:["reposition"]}},entry:F5([{guard:"autoFocus",actions:["setInitialFocus"]}]),states:{idle:{tags:["idle","closed"],entry:["scrollContentToTop","clearHighlightedValue"],on:{"CONTROLLED.OPEN":{target:"interacting"},"TRIGGER.CLICK":[{guard:"isOpenControlled",actions:["setInitialFocus","highlightFirstSelectedItem","invokeOnOpen"]},{target:"interacting",actions:["setInitialFocus","highlightFirstSelectedItem","invokeOnOpen"]}],"INPUT.CLICK":[{guard:"isOpenControlled",actions:["highlightFirstSelectedItem","invokeOnOpen"]},{target:"interacting",actions:["highlightFirstSelectedItem","invokeOnOpen"]}],"INPUT.FOCUS":{target:"focused"},OPEN:[{guard:"isOpenControlled",actions:["invokeOnOpen"]},{target:"interacting",actions:["invokeOnOpen"]}],"VALUE.CLEAR":{target:"focused",actions:["clearInputValue","clearSelectedItems","setInitialFocus"]}}},focused:{tags:["focused","closed"],entry:["scrollContentToTop","clearHighlightedValue"],on:{"CONTROLLED.OPEN":[{guard:"isChangeEvent",target:"suggesting"},{target:"interacting"}],"INPUT.CHANGE":[{guard:sn("isOpenControlled","openOnChange"),actions:["setInputValue","invokeOnOpen","highlightFirstItemIfNeeded"]},{guard:"openOnChange",target:"suggesting",actions:["setInputValue","invokeOnOpen","highlightFirstItemIfNeeded"]},{actions:["setInputValue"]}],"LAYER.INTERACT_OUTSIDE":{target:"idle"},"INPUT.ESCAPE":{guard:sn("isCustomValue",hr("allowCustomValue")),actions:["revertInputValue"]},"INPUT.BLUR":{target:"idle"},"INPUT.CLICK":[{guard:"isOpenControlled",actions:["highlightFirstSelectedItem","invokeOnOpen"]},{target:"interacting",actions:["highlightFirstSelectedItem","invokeOnOpen"]}],"TRIGGER.CLICK":[{guard:"isOpenControlled",actions:["setInitialFocus","highlightFirstSelectedItem","invokeOnOpen"]},{target:"interacting",actions:["setInitialFocus","highlightFirstSelectedItem","invokeOnOpen"]}],"INPUT.ARROW_DOWN":[{guard:sn("isOpenControlled","autoComplete"),actions:["invokeOnOpen"]},{guard:"autoComplete",target:"interacting",actions:["invokeOnOpen"]},{guard:"isOpenControlled",actions:["highlightFirstOrSelectedItem","invokeOnOpen"]},{target:"interacting",actions:["highlightFirstOrSelectedItem","invokeOnOpen"]}],"INPUT.ARROW_UP":[{guard:"autoComplete",target:"interacting",actions:["invokeOnOpen"]},{guard:"autoComplete",target:"interacting",actions:["invokeOnOpen"]},{target:"interacting",actions:["highlightLastOrSelectedItem","invokeOnOpen"]},{target:"interacting",actions:["highlightLastOrSelectedItem","invokeOnOpen"]}],OPEN:[{guard:"isOpenControlled",actions:["invokeOnOpen"]},{target:"interacting",actions:["invokeOnOpen"]}],"VALUE.CLEAR":{actions:["clearInputValue","clearSelectedItems"]}}},interacting:{tags:["open","focused"],entry:["setInitialFocus"],effects:["scrollToHighlightedItem","trackDismissableLayer","trackPlacement","hideOtherElements"],on:{"CONTROLLED.CLOSE":[{guard:"restoreFocus",target:"focused",actions:["setFinalFocus"]},{target:"idle"}],CHILDREN_CHANGE:[{guard:"isHighlightedItemRemoved",actions:["clearHighlightedValue"]},{actions:["scrollToHighlightedItem"]}],"INPUT.HOME":{actions:["highlightFirstItem"]},"INPUT.END":{actions:["highlightLastItem"]},"INPUT.ARROW_DOWN":[{guard:sn("autoComplete","isLastItemHighlighted"),actions:["clearHighlightedValue","scrollContentToTop"]},{actions:["highlightNextItem"]}],"INPUT.ARROW_UP":[{guard:sn("autoComplete","isFirstItemHighlighted"),actions:["clearHighlightedValue"]},{actions:["highlightPrevItem"]}],"INPUT.ENTER":[{guard:sn("isOpenControlled","isCustomValue",hr("hasHighlightedItem"),hr("allowCustomValue")),actions:["revertInputValue","invokeOnClose"]},{guard:sn("isCustomValue",hr("hasHighlightedItem"),hr("allowCustomValue")),target:"focused",actions:["revertInputValue","invokeOnClose"]},{guard:sn("isOpenControlled","closeOnSelect"),actions:["selectHighlightedItem","invokeOnClose"]},{guard:"closeOnSelect",target:"focused",actions:["selectHighlightedItem","invokeOnClose","setFinalFocus"]},{actions:["selectHighlightedItem"]}],"INPUT.CHANGE":[{guard:"autoComplete",target:"suggesting",actions:["setInputValue"]},{target:"suggesting",actions:["clearHighlightedValue","setInputValue"]}],"ITEM.POINTER_MOVE":{actions:["setHighlightedValue"]},"ITEM.POINTER_LEAVE":{actions:["clearHighlightedValue"]},"ITEM.CLICK":[{guard:sn("isOpenControlled","closeOnSelect"),actions:["selectItem","invokeOnClose"]},{guard:"closeOnSelect",target:"focused",actions:["selectItem","invokeOnClose","setFinalFocus"]},{actions:["selectItem"]}],"LAYER.ESCAPE":[{guard:sn("isOpenControlled","autoComplete"),actions:["syncInputValue","invokeOnClose"]},{guard:"autoComplete",target:"focused",actions:["syncInputValue","invokeOnClose"]},{guard:"isOpenControlled",actions:["invokeOnClose"]},{target:"focused",actions:["invokeOnClose","setFinalFocus"]}],"TRIGGER.CLICK":[{guard:"isOpenControlled",actions:["invokeOnClose"]},{target:"focused",actions:["invokeOnClose"]}],"LAYER.INTERACT_OUTSIDE":[{guard:sn("isOpenControlled","isCustomValue",hr("allowCustomValue")),actions:["revertInputValue","invokeOnClose"]},{guard:sn("isCustomValue",hr("allowCustomValue")),target:"idle",actions:["revertInputValue","invokeOnClose"]},{guard:"isOpenControlled",actions:["invokeOnClose"]},{target:"idle",actions:["invokeOnClose"]}],CLOSE:[{guard:"isOpenControlled",actions:["invokeOnClose"]},{target:"focused",actions:["invokeOnClose","setFinalFocus"]}],"VALUE.CLEAR":[{guard:"isOpenControlled",actions:["clearInputValue","clearSelectedItems","invokeOnClose"]},{target:"focused",actions:["clearInputValue","clearSelectedItems","invokeOnClose","setFinalFocus"]}]}},suggesting:{tags:["open","focused"],effects:["trackDismissableLayer","scrollToHighlightedItem","trackPlacement","hideOtherElements"],entry:["setInitialFocus"],on:{"CONTROLLED.CLOSE":[{guard:"restoreFocus",target:"focused",actions:["setFinalFocus"]},{target:"idle"}],CHILDREN_CHANGE:[{guard:"autoHighlight",actions:["highlightFirstItem"]},{guard:"isHighlightedItemRemoved",actions:["clearHighlightedValue"]}],"INPUT.ARROW_DOWN":{target:"interacting",actions:["highlightNextItem"]},"INPUT.ARROW_UP":{target:"interacting",actions:["highlightPrevItem"]},"INPUT.HOME":{target:"interacting",actions:["highlightFirstItem"]},"INPUT.END":{target:"interacting",actions:["highlightLastItem"]},"INPUT.ENTER":[{guard:sn("isOpenControlled","isCustomValue",hr("hasHighlightedItem"),hr("allowCustomValue")),actions:["revertInputValue","invokeOnClose"]},{guard:sn("isCustomValue",hr("hasHighlightedItem"),hr("allowCustomValue")),target:"focused",actions:["revertInputValue","invokeOnClose"]},{guard:sn("isOpenControlled","closeOnSelect"),actions:["selectHighlightedItem","invokeOnClose"]},{guard:"closeOnSelect",target:"focused",actions:["selectHighlightedItem","invokeOnClose","setFinalFocus"]},{actions:["selectHighlightedItem"]}],"INPUT.CHANGE":{actions:["setInputValue"]},"LAYER.ESCAPE":[{guard:"isOpenControlled",actions:["invokeOnClose"]},{target:"focused",actions:["invokeOnClose"]}],"ITEM.POINTER_MOVE":{target:"interacting",actions:["setHighlightedValue"]},"ITEM.POINTER_LEAVE":{actions:["clearHighlightedValue"]},"LAYER.INTERACT_OUTSIDE":[{guard:sn("isOpenControlled","isCustomValue",hr("allowCustomValue")),actions:["revertInputValue","invokeOnClose"]},{guard:sn("isCustomValue",hr("allowCustomValue")),target:"idle",actions:["revertInputValue","invokeOnClose"]},{guard:"isOpenControlled",actions:["invokeOnClose"]},{target:"idle",actions:["invokeOnClose"]}],"TRIGGER.CLICK":[{guard:"isOpenControlled",actions:["invokeOnClose"]},{target:"focused",actions:["invokeOnClose"]}],"ITEM.CLICK":[{guard:sn("isOpenControlled","closeOnSelect"),actions:["selectItem","invokeOnClose"]},{guard:"closeOnSelect",target:"focused",actions:["selectItem","invokeOnClose","setFinalFocus"]},{actions:["selectItem"]}],CLOSE:[{guard:"isOpenControlled",actions:["invokeOnClose"]},{target:"focused",actions:["invokeOnClose","setFinalFocus"]}],"VALUE.CLEAR":[{guard:"isOpenControlled",actions:["clearInputValue","clearSelectedItems","invokeOnClose"]},{target:"focused",actions:["clearInputValue","clearSelectedItems","invokeOnClose","setFinalFocus"]}]}}},implementations:{guards:{isInputValueEmpty:({computed:t})=>t("isInputValueEmpty"),autoComplete:({computed:t,prop:e})=>t("autoComplete")&&!e("multiple"),autoHighlight:({computed:t})=>t("autoHighlight"),isFirstItemHighlighted:({prop:t,context:e})=>t("collection").firstValue===e.get("highlightedValue"),isLastItemHighlighted:({prop:t,context:e})=>t("collection").lastValue===e.get("highlightedValue"),isCustomValue:({computed:t})=>t("isCustomValue"),allowCustomValue:({prop:t})=>!!t("allowCustomValue"),hasHighlightedItem:({context:t})=>t.get("highlightedValue")!=null,closeOnSelect:({prop:t})=>!!t("closeOnSelect"),isOpenControlled:({prop:t})=>t("open")!=null,openOnChange:({prop:t,context:e})=>{const n=t("openOnChange");return y3(n)?n:!!(n!=null&&n({inputValue:e.get("inputValue")}))},restoreFocus:({event:t})=>t.restoreFocus==null?!0:!!t.restoreFocus,isChangeEvent:({event:t})=>{var e;return((e=t.previousEvent)==null?void 0:e.type)==="INPUT.CHANGE"},autoFocus:({prop:t})=>!!t("autoFocus"),isHighlightedItemRemoved:({prop:t,context:e})=>!t("collection").has(e.get("highlightedValue"))},effects:{trackDismissableLayer({send:t,prop:e,scope:n}){return e("disableLayer")?void 0:Au(()=>Go(n),{defer:!0,exclude:()=>[xl(n),Ou(n),S1(n)],onFocusOutside:e("onFocusOutside"),onPointerDownOutside:e("onPointerDownOutside"),onInteractOutside:e("onInteractOutside"),onEscapeKeyDown(i){i.preventDefault(),i.stopPropagation(),t({type:"LAYER.ESCAPE",src:"escape-key"})},onDismiss(){t({type:"LAYER.INTERACT_OUTSIDE",src:"interact-outside",restoreFocus:!1})}})},hideOtherElements({scope:t}){return C5([xl(t),Go(t),Ou(t),S1(t)])},trackPlacement({context:t,prop:e,scope:n}){const r=()=>E1(n)||Ou(n),i=()=>x1(n);return t.set("currentPlacement",e("positioning").placement),qr(r,i,{...e("positioning"),defer:!0,onComplete(o){t.set("currentPlacement",o.placement)}})},scrollToHighlightedItem({context:t,prop:e,scope:n,event:r}){const i=xl(n);let o=[];const s=c=>{const u=r.current().type.includes("POINTER"),d=t.get("highlightedValue");if(u||!d)return;const h=A1(n,d),g=Go(n),b=e("scrollToIndexFn");if(b){const w=e("collection").indexOf(d);b({index:w,immediate:c});return}const p=ze(()=>{Ef(h,{rootEl:g,block:"nearest"})});o.push(p)},a=ze(()=>s(!0));o.push(a);const l=wf(i,{attributes:["aria-activedescendant"],callback:()=>s(!1)});return o.push(l),()=>{o.forEach(c=>c())}}},actions:{reposition({context:t,prop:e,scope:n,event:r}){qr(()=>E1(n),()=>x1(n),{...e("positioning"),...r.options,defer:!0,listeners:!1,onComplete(s){t.set("currentPlacement",s.placement)}})},setHighlightedValue({context:t,event:e}){e.value!=null&&t.set("highlightedValue",e.value)},clearHighlightedValue({context:t}){t.set("highlightedValue",null)},selectHighlightedItem(t){var a;const{context:e,prop:n}=t,r=n("collection"),i=e.get("highlightedValue");if(!i||!r.has(i))return;const o=n("multiple")?cl(e.get("value"),i):[i];(a=n("onSelect"))==null||a({value:o,itemValue:i}),e.set("value",o);const s=Yi(n("selectionBehavior"),{preserve:e.get("inputValue"),replace:r.stringifyMany(o),clear:""});e.set("inputValue",s)},scrollToHighlightedItem({context:t,prop:e,scope:n}){vf(()=>{const r=t.get("highlightedValue");if(r==null)return;const i=A1(n,r),o=Go(n),s=e("scrollToIndexFn");if(s){const a=e("collection").indexOf(r);s({index:a,immediate:!0});return}Ef(i,{rootEl:o,block:"nearest"})})},selectItem(t){const{context:e,event:n,flush:r,prop:i}=t;n.value!=null&&r(()=>{var a;const o=i("multiple")?cl(e.get("value"),n.value):[n.value];(a=i("onSelect"))==null||a({value:o,itemValue:n.value}),e.set("value",o);const s=Yi(i("selectionBehavior"),{preserve:e.get("inputValue"),replace:i("collection").stringifyMany(o),clear:""});e.set("inputValue",s)})},clearItem(t){const{context:e,event:n,flush:r,prop:i}=t;n.value!=null&&r(()=>{const o=Us(e.get("value"),n.value);e.set("value",o);const s=Yi(i("selectionBehavior"),{preserve:e.get("inputValue"),replace:i("collection").stringifyMany(o),clear:""});e.set("inputValue",s)})},setInitialFocus({scope:t}){ze(()=>{k1(t)})},setFinalFocus({scope:t}){ze(()=>{const e=Ou(t);(e==null?void 0:e.dataset.focusable)==null?k1(t):R5(t)})},syncInputValue({context:t,scope:e,event:n}){const r=xl(e);r&&(r.value=t.get("inputValue"),queueMicrotask(()=>{n.current().type!=="INPUT.CHANGE"&&H3(r)}))},setInputValue({context:t,event:e}){t.set("inputValue",e.value)},clearInputValue({context:t}){t.set("inputValue","")},revertInputValue({context:t,prop:e,computed:n}){const r=e("selectionBehavior"),i=Yi(r,{replace:n("hasSelectedItems")?n("valueAsString"):"",preserve:t.get("inputValue"),clear:""});t.set("inputValue",i)},setValue(t){const{context:e,flush:n,event:r,prop:i}=t;n(()=>{e.set("value",r.value);const o=Yi(i("selectionBehavior"),{preserve:e.get("inputValue"),replace:i("collection").stringifyMany(r.value),clear:""});e.set("inputValue",o)})},clearSelectedItems(t){const{context:e,flush:n,prop:r}=t;n(()=>{e.set("value",[]);const i=Yi(r("selectionBehavior"),{preserve:e.get("inputValue"),replace:r("collection").stringifyMany([]),clear:""});e.set("inputValue",i)})},scrollContentToTop({prop:t,scope:e}){const n=t("scrollToIndexFn");if(n)n({index:0,immediate:!0});else{const r=Go(e);if(!r)return;r.scrollTop=0}},invokeOnOpen({prop:t,event:e}){var r;const n=C1(e);(r=t("onOpenChange"))==null||r({open:!0,reason:n})},invokeOnClose({prop:t,event:e}){var r;const n=C1(e);(r=t("onOpenChange"))==null||r({open:!1,reason:n})},highlightFirstItem({context:t,prop:e,scope:n}){(Go(n)?queueMicrotask:ze)(()=>{const i=e("collection").firstValue;i&&t.set("highlightedValue",i)})},highlightFirstItemIfNeeded({computed:t,action:e}){t("autoHighlight")&&e(["highlightFirstItem"])},highlightLastItem({context:t,prop:e,scope:n}){(Go(n)?queueMicrotask:ze)(()=>{const i=e("collection").lastValue;i&&t.set("highlightedValue",i)})},highlightNextItem({context:t,prop:e}){let n=null;const r=t.get("highlightedValue"),i=e("collection");r?(n=i.getNextValue(r),!n&&e("loopFocus")&&(n=i.firstValue)):n=i.firstValue,n&&t.set("highlightedValue",n)},highlightPrevItem({context:t,prop:e}){let n=null;const r=t.get("highlightedValue"),i=e("collection");r?(n=i.getPreviousValue(r),!n&&e("loopFocus")&&(n=i.lastValue)):n=i.lastValue,n&&t.set("highlightedValue",n)},highlightFirstSelectedItem({context:t,prop:e}){ze(()=>{const[n]=e("collection").sort(t.get("value"));n&&t.set("highlightedValue",n)})},highlightFirstOrSelectedItem({context:t,prop:e,computed:n}){ze(()=>{let r=null;n("hasSelectedItems")?r=e("collection").sort(t.get("value"))[0]:r=e("collection").firstValue,r&&t.set("highlightedValue",r)})},highlightLastOrSelectedItem({context:t,prop:e,computed:n}){ze(()=>{const r=e("collection");let i=null;n("hasSelectedItems")?i=r.sort(t.get("value"))[0]:i=r.lastValue,i&&t.set("highlightedValue",i)})},autofillInputValue({context:t,computed:e,prop:n,event:r,scope:i}){const o=xl(i),s=n("collection");if(!e("autoComplete")||!o||!r.keypress)return;const a=s.stringify(t.get("highlightedValue"));ze(()=>{o.value=a||t.get("inputValue")})},syncSelectedItems(t){queueMicrotask(()=>{const{context:e,prop:n}=t,r=n("collection"),i=e.get("value"),o=i.map(a=>e.get("selectedItems").find(c=>r.getItemValue(c)===a)||r.find(a));e.set("selectedItems",o);const s=Yi(n("selectionBehavior"),{preserve:e.get("inputValue"),replace:r.stringifyMany(i),clear:""});e.set("inputValue",s)})},syncHighlightedItem({context:t,prop:e}){const n=e("collection").find(t.get("highlightedValue"));t.set("highlightedItem",n)},toggleVisibility({event:t,send:e,prop:n}){e({type:n("open")?"CONTROLLED.OPEN":"CONTROLLED.CLOSE",previousEvent:t})}}}});function C1(t){return(t.previousEvent||t).src}Be()(["allowCustomValue","autoFocus","closeOnSelect","collection","composite","defaultHighlightedValue","defaultInputValue","defaultOpen","defaultValue","dir","disabled","disableLayer","form","getRootNode","highlightedValue","id","ids","inputBehavior","inputValue","invalid","loopFocus","multiple","name","navigate","onFocusOutside","onHighlightChange","onInputValueChange","onInteractOutside","onOpenChange","onOpenChange","onPointerDownOutside","onSelect","onValueChange","open","openOnChange","openOnClick","openOnKeyPress","placeholder","positioning","readOnly","required","scrollToIndexFn","selectionBehavior","translations","value"]),Be()(["htmlFor"]),Be()(["id"]),Be()(["item","persistFocus"]);var m0=Ie("dialog").parts("trigger","backdrop","positioner","content","title","description","closeTrigger");m0.build(),Be()(["aria-label","closeOnEscape","closeOnInteractOutside","dir","finalFocusEl","getRootNode","getRootNode","id","id","ids","initialFocusEl","modal","onEscapeKeyDown","onFocusOutside","onInteractOutside","onOpenChange","onPointerDownOutside","defaultOpen","open","persistentElements","preventScroll","restoreFocus","role","trapFocus"]);var I1=Ie("editable").parts("root","area","label","preview","input","editTrigger","submitTrigger","cancelTrigger","control");I1.build(),Be()(["activationMode","autoResize","dir","disabled","finalFocusEl","form","getRootNode","id","ids","invalid","maxLength","name","onEditChange","onFocusOutside","onInteractOutside","onPointerDownOutside","onValueChange","onValueCommit","onValueRevert","placeholder","readOnly","required","selectOnFocus","edit","defaultEdit","submitMode","translations","defaultValue","value"]);const O1=J.forwardRef((t,e)=>{const n=X6(),r=cr(n==null?void 0:n.getInputProps(),t);return k.jsx(bi.input,{...r,ref:e})});O1.displayName="FieldInput";const T1=Ie("field").parts("root","errorText","helperText","input","label","select","textarea","requiredIndicator");T1.build();const P1=Ie("fieldset").parts("root","errorText","helperText","legend");P1.build();var N1=Ie("file-upload").parts("root","dropzone","item","itemDeleteTrigger","itemGroup","itemName","itemPreview","itemPreviewImage","itemSizeText","label","trigger","clearTrigger");N1.build(),Be()(["accept","acceptedFiles","allowDrop","capture","defaultAcceptedFiles","dir","directory","disabled","getRootNode","id","ids","invalid","locale","maxFiles","maxFileSize","minFileSize","name","onFileAccept","onFileChange","onFileReject","preventDocumentDrop","required","transformFiles","translations","validate"]),Be()(["file"]);const _5=Symbol(),B1=Object.getPrototypeOf,y0=new WeakMap,V5=t=>t&&(y0.has(t)?y0.get(t):B1(t)===Object.prototype||B1(t)===Array.prototype),D5=t=>V5(t)&&t[_5]||null,R1=(t,e=!0)=>{y0.set(t,e)};function z5(){if(typeof globalThis!="undefined")return globalThis;if(typeof self!="undefined")return self;if(typeof window!="undefined")return window;if(typeof global!="undefined")return global}function M1(t,e){const n=z5();return n?(n[t]||(n[t]=e()),n[t]):e()}var Kf=M1("__zag__refSet",()=>new WeakSet),U5=t=>typeof t=="object"&&t!==null&&"$$typeof"in t&&"props"in t,$5=t=>typeof t=="object"&&t!==null&&"__v_isVNode"in t,H5=t=>typeof t=="object"&&t!==null&&"nodeType"in t&&typeof t.nodeName=="string",W5=t=>U5(t)||$5(t)||H5(t),b0=t=>t!==null&&typeof t=="object",L1=t=>b0(t)&&!Kf.has(t)&&(Array.isArray(t)||!(Symbol.iterator in t))&&!W5(t)&&!(t instanceof WeakMap)&&!(t instanceof WeakSet)&&!(t instanceof Error)&&!(t instanceof Number)&&!(t instanceof Date)&&!(t instanceof String)&&!(t instanceof RegExp)&&!(t instanceof ArrayBuffer)&&!(t instanceof Promise),qf=()=>process.env.NODE_ENV!=="production",Ys=M1("__zag__proxyStateMap",()=>new WeakMap),G5=(t=Object.is,e=(a,l)=>new Proxy(a,l),n=new WeakMap,r=(a,l)=>{const c=n.get(a);if((c==null?void 0:c[0])===l)return c[1];const u=Array.isArray(a)?[]:Object.create(Object.getPrototypeOf(a));return R1(u,!0),n.set(a,[l,u]),Reflect.ownKeys(a).forEach(d=>{const h=Reflect.get(a,d);Kf.has(h)?(R1(h,!1),u[d]=h):Ys.has(h)?u[d]=q5(h):u[d]=h}),Object.freeze(u)},i=new WeakMap,o=[1,1],s=a=>{if(!b0(a))throw new Error("object required");const l=i.get(a);if(l)return l;let c=o[0];const u=new Set,d=(q,G=++o[0])=>{c!==G&&(c=G,u.forEach(L=>L(q,G)))};let h=o[1];const g=(q=++o[1])=>(h!==q&&!u.size&&(h=q,p.forEach(([G])=>{const L=G[1](q);L>c&&(c=L)})),c),b=q=>(G,L)=>{const V=[...G];V[1]=[q,...V[1]],d(V,L)},p=new Map,w=(q,G)=>{if(qf()&&p.has(q))throw new Error("prop listener already exists");if(u.size){const L=G[3](b(q));p.set(q,[G,L])}else p.set(q,[G])},S=q=>{var L;const G=p.get(q);G&&(p.delete(q),(L=G[1])==null||L.call(G))},O=q=>(u.add(q),u.size===1&&p.forEach(([L,V],W)=>{if(qf()&&V)throw new Error("remove already exists");const z=L[3](b(W));p.set(W,[L,z])}),()=>{u.delete(q),u.size===0&&p.forEach(([L,V],W)=>{V&&(V(),p.set(W,[L]))})}),T=Array.isArray(a)?[]:Object.create(Object.getPrototypeOf(a)),R=e(T,{deleteProperty(q,G){const L=Reflect.get(q,G);S(G);const V=Reflect.deleteProperty(q,G);return V&&d(["delete",[G],L]),V},set(q,G,L,V){var f;const W=Reflect.has(q,G),z=Reflect.get(q,G,V);if(W&&(t(z,L)||i.has(L)&&t(z,i.get(L))))return!0;S(G),b0(L)&&(L=D5(L)||L);let C=L;if(!((f=Object.getOwnPropertyDescriptor(q,G))!=null&&f.set)){!Ys.has(L)&&L1(L)&&(C=F1(L));const y=!Kf.has(C)&&Ys.get(C);y&&w(G,y)}return Reflect.set(q,G,C,V),d(["set",[G],L,z]),!0}});i.set(a,R);const j=[T,g,r,O];return Ys.set(R,j),Reflect.ownKeys(a).forEach(q=>{const G=Object.getOwnPropertyDescriptor(a,q);G.get||G.set?Object.defineProperty(T,q,G):R[q]=a[q]}),R})=>[s,Ys,Kf,t,e,L1,n,r,i,o],[j5]=G5();function F1(t={}){return j5(t)}function K5(t,e,n){const r=Ys.get(t);qf()&&!r&&console.warn("Please use proxy object");let i;const o=[],s=r[3];let a=!1;const c=s(u=>{o.push(u),i||(i=Promise.resolve().then(()=>{i=void 0,a&&e(o.splice(0))}))});return a=!0,()=>{a=!1,c()}}function q5(t){const e=Ys.get(t);qf()&&!e&&console.warn("Please use proxy object");const[n,r,i]=e;return i(n,r())}const Y5=t=>typeof t=="function",Q5=(t,...e)=>Y5(t)?t(...e):t,X5=t=>{const{value:e,children:n}=t,[r,i]=J.useState(),o=J.useMemo(()=>()=>{var a,l;return(l=(a=Q5(e))!=null?a:r==null?void 0:r.getRootNode())!=null?l:document},[e,r]),s=J.useMemo(()=>({getRootNode:o,getWindow:()=>on(o()),getDocument:()=>Ir(o())}),[o]);return k.jsxs($3,{value:s,children:[n,!e&&k.jsx("span",{hidden:!0,ref:i})]})};var _1=Ie("hoverCard").parts("arrow","arrowTip","trigger","positioner","content");_1.build();var J5=t=>{var e,n;return(n=(e=t.ids)==null?void 0:e.trigger)!=null?n:`hover-card:${t.id}:trigger`},Z5=t=>{var e,n;return(n=(e=t.ids)==null?void 0:e.content)!=null?n:`hover-card:${t.id}:content`},e8=t=>{var e,n;return(n=(e=t.ids)==null?void 0:e.positioner)!=null?n:`hover-card:${t.id}:popper`},v0=t=>t.getById(J5(t)),t8=t=>t.getById(Z5(t)),V1=t=>t.getById(e8(t)),{not:Yf,and:D1}=$o();D1("isOpenControlled",Yf("isPointer")),Yf("isPointer"),D1("isOpenControlled",Yf("isPointer")),Yf("isPointer"),Be()(["closeDelay","dir","getRootNode","id","ids","onOpenChange","defaultOpen","open","openDelay","positioning","onInteractOutside","onPointerDownOutside","onFocusOutside"]);var z1=Ie("menu").parts("arrow","arrowTip","content","contextTrigger","indicator","item","itemGroup","itemGroupLabel","itemIndicator","itemText","positioner","separator","trigger","triggerItem");z1.build();var U1=t=>{var e,n;return(n=(e=t.ids)==null?void 0:e.trigger)!=null?n:`menu:${t.id}:trigger`},n8=t=>{var e,n;return(n=(e=t.ids)==null?void 0:e.contextTrigger)!=null?n:`menu:${t.id}:ctx-trigger`},$1=t=>{var e,n;return(n=(e=t.ids)==null?void 0:e.content)!=null?n:`menu:${t.id}:content`},r8=t=>{var e,n;return(n=(e=t.ids)==null?void 0:e.positioner)!=null?n:`menu:${t.id}:popper`},w0=(t,e)=>`${t.id}/${e}`,Qs=t=>{var e;return(e=t==null?void 0:t.dataset.value)!=null?e:null},jo=t=>t.getById($1(t)),H1=t=>t.getById(r8(t)),Qf=t=>t.getById(U1(t)),i8=(t,e)=>e?t.getById(w0(t,e)):null,x0=t=>t.getById(n8(t)),Tu=t=>{const n=`[role^="menuitem"][data-ownedby=${CSS.escape($1(t))}]:not([data-disabled])`;return Af(jo(t),n)},o8=t=>gu(Tu(t)),s8=t=>Ig(Tu(t)),E0=(t,e)=>e?t.id===e||t.dataset.value===e:!1,a8=(t,e)=>{var i;const n=Tu(t),r=n.findIndex(o=>E0(o,e.value));return h3(n,r,{loop:(i=e.loop)!=null?i:e.loopFocus})},l8=(t,e)=>{var i;const n=Tu(t),r=n.findIndex(o=>E0(o,e.value));return g3(n,r,{loop:(i=e.loop)!=null?i:e.loopFocus})},c8=(t,e)=>{var i;const n=Tu(t),r=n.find(o=>E0(o,e.value));return vu(n,{state:e.typeaheadState,key:e.key,activeId:(i=r==null?void 0:r.id)!=null?i:null})},u8=t=>{var e;return!!((e=t==null?void 0:t.getAttribute("role"))!=null&&e.startsWith("menuitem"))&&!!(t!=null&&t.hasAttribute("aria-controls"))},d8="menu:select";function f8(t,e){if(!t)return;const n=on(t),r=new n.CustomEvent(d8,{detail:{value:e}});t.dispatchEvent(r)}var{not:Tr,and:El,or:h8}=$o();Tr("isSubmenu"),h8("isOpenAutoFocusEvent","isArrowDownEvent"),El(Tr("isTriggerItem"),"isOpenControlled"),Tr("isTriggerItem"),El("isSubmenu","isOpenControlled"),Tr("isPointerSuspended"),El(Tr("isPointerSuspended"),Tr("isTriggerItem")),El(Tr("isTriggerItemHighlighted"),Tr("isHighlightedItemEditable"),"closeOnSelect","isOpenControlled"),El(Tr("isTriggerItemHighlighted"),Tr("isHighlightedItemEditable"),"closeOnSelect"),El(Tr("isTriggerItemHighlighted"),Tr("isHighlightedItemEditable"));function W1(t){let e=t.parent;for(;e&&e.computed("isSubmenu");)e=e.refs.get("parent");e==null||e.send({type:"CLOSE"})}function p8(t,e){return t?$6(t,e):!1}function g8(t,e,n){const r=Object.keys(t).length>0;if(!e)return null;if(!r)return w0(n,e);for(const i in t){const o=t[i],s=U1(o.scope);if(s===e)return s}return w0(n,e)}Be()(["anchorPoint","aria-label","closeOnSelect","composite","defaultHighlightedValue","defaultOpen","dir","getRootNode","highlightedValue","id","ids","loopFocus","navigate","onEscapeKeyDown","onFocusOutside","onHighlightChange","onInteractOutside","onOpenChange","onPointerDownOutside","onSelect","open","positioning","typeahead"]),Be()(["closeOnSelect","disabled","value","valueText"]),Be()(["htmlFor"]),Be()(["id"]),Be()(["checked","closeOnSelect","disabled","onCheckedChange","type","value","valueText"]);var G1=Ie("tree-view").parts("branch","branchContent","branchControl","branchIndentGuide","branchIndicator","branchText","branchTrigger","item","itemIndicator","itemText","label","nodeCheckbox","root","tree");G1.build();var j1=t=>new y1(t);j1.empty=()=>new y1({rootNode:{children:[]}});var m8=(t,e)=>{var n,r,i;return(i=(r=(n=t.ids)==null?void 0:n.node)==null?void 0:r.call(n,e))!=null?i:`tree:${t.id}:node:${e}`},Xs=(t,e)=>{var n;e!=null&&((n=t.getById(m8(t,e)))==null||n.focus())};function y8(t,e,n){const r=t.getDescendantValues(e),i=r.every(o=>n.includes(o));return ll(i?Us(n,...r):zs(n,...r))}function Xf(t,e){const{context:n,prop:r,refs:i}=t;if(!r("loadChildren")){n.set("expandedValue",p=>ll(zs(p,...e)));return}const o=n.get("loadingStatus"),[s,a]=Ov(e,p=>o[p]==="loaded");if(s.length>0&&n.set("expandedValue",p=>ll(zs(p,...s))),a.length===0)return;const l=r("collection"),[c,u]=Ov(a,p=>{const w=l.findNode(p);return l.getNodeChildren(w).length>0});if(c.length>0&&n.set("expandedValue",p=>ll(zs(p,...c))),u.length===0)return;n.set("loadingStatus",p=>({...p,...u.reduce((w,S)=>({...w,[S]:"loading"}),{})}));const d=u.map(p=>{const w=l.getIndexPath(p),S=l.getValuePath(w),O=l.findNode(p);return{id:p,indexPath:w,valuePath:S,node:O}}),h=i.get("pendingAborts"),g=r("loadChildren");zv(g,()=>"[zag-js/tree-view] `loadChildren` is required for async expansion");const b=d.map(({id:p,indexPath:w,valuePath:S,node:O})=>{const T=h.get(p);T&&(T.abort(),h.delete(p));const $=new AbortController;return h.set(p,$),g({valuePath:S,indexPath:w,node:O,signal:$.signal})});Promise.allSettled(b).then(p=>{var $,R;const w=[],S=[],O=n.get("loadingStatus");let T=r("collection");p.forEach((j,q)=>{const{id:G,indexPath:L,node:V,valuePath:W}=d[q];j.status==="fulfilled"?(O[G]="loaded",w.push(G),T=T.replace(L,{...V,children:j.value})):(h.delete(G),Reflect.deleteProperty(O,G),S.push({node:V,error:j.reason,indexPath:L,valuePath:W}))}),n.set("loadingStatus",O),w.length&&(n.set("expandedValue",j=>ll(zs(j,...w))),($=r("onLoadChildrenComplete"))==null||$({collection:T})),S.length&&((R=r("onLoadChildrenError"))==null||R({nodes:S}))})}function Ko(t){const{prop:e,context:n}=t;return function({indexPath:i}){return e("collection").getValuePath(i).slice(0,-1).some(s=>!n.get("expandedValue").includes(s))}}var{and:Si}=$o();Si("isMultipleSelection","moveFocus"),Si("isShiftKey","isMultipleSelection"),Si("isShiftKey","isMultipleSelection"),Si("isBranchFocused","isBranchExpanded"),Si("isShiftKey","isMultipleSelection"),Si("isShiftKey","isMultipleSelection"),Si("isCtrlKey","isMultipleSelection"),Si("isShiftKey","isMultipleSelection"),Si("isCtrlKey","isMultipleSelection"),Si("isShiftKey","isMultipleSelection"),Be()(["ids","collection","dir","expandedValue","expandOnClick","defaultFocusedValue","focusedValue","getRootNode","id","onExpandedChange","onFocusChange","onSelectionChange","checkedValue","selectedValue","selectionMode","typeahead","defaultExpandedValue","defaultSelectedValue","defaultCheckedValue","onCheckedChange","onLoadChildrenComplete","onLoadChildrenError","loadChildren"]),Be()(["node","indexPath"]);let S0=new Map,A0=!1;try{A0=new Intl.NumberFormat("de-DE",{signDisplay:"exceptZero"}).resolvedOptions().signDisplay==="exceptZero"}catch(t){}let Jf=!1;try{Jf=new Intl.NumberFormat("de-DE",{style:"unit",unit:"degree"}).resolvedOptions().style==="unit"}catch(t){}const K1={degree:{narrow:{default:"°","ja-JP":" 度","zh-TW":"度","sl-SI":" °"}}};class b8{format(e){let n="";if(!A0&&this.options.signDisplay!=null?n=w8(this.numberFormatter,this.options.signDisplay,e):n=this.numberFormatter.format(e),this.options.style==="unit"&&!Jf){var r;let{unit:i,unitDisplay:o="short",locale:s}=this.resolvedOptions();if(!i)return n;let a=(r=K1[i])===null||r===void 0?void 0:r[o];n+=a[s]||a.default}return n}formatToParts(e){return this.numberFormatter.formatToParts(e)}formatRange(e,n){if(typeof this.numberFormatter.formatRange=="function")return this.numberFormatter.formatRange(e,n);if(n<e)throw new RangeError("End date must be >= start date");return`${this.format(e)} – ${this.format(n)}`}formatRangeToParts(e,n){if(typeof this.numberFormatter.formatRangeToParts=="function")return this.numberFormatter.formatRangeToParts(e,n);if(n<e)throw new RangeError("End date must be >= start date");let r=this.numberFormatter.formatToParts(e),i=this.numberFormatter.formatToParts(n);return[...r.map(o=>({...o,source:"startRange"})),{type:"literal",value:" – ",source:"shared"},...i.map(o=>({...o,source:"endRange"}))]}resolvedOptions(){let e=this.numberFormatter.resolvedOptions();return!A0&&this.options.signDisplay!=null&&(e={...e,signDisplay:this.options.signDisplay}),!Jf&&this.options.style==="unit"&&(e={...e,style:"unit",unit:this.options.unit,unitDisplay:this.options.unitDisplay}),e}constructor(e,n={}){this.numberFormatter=v8(e,n),this.options=n}}function v8(t,e={}){let{numberingSystem:n}=e;if(n&&t.includes("-nu-")&&(t.includes("-u-")||(t+="-u-"),t+=`-nu-${n}`),e.style==="unit"&&!Jf){var r;let{unit:s,unitDisplay:a="short"}=e;if(!s)throw new Error('unit option must be provided with style: "unit"');if(!(!((r=K1[s])===null||r===void 0)&&r[a]))throw new Error(`Unsupported unit ${s} with unitDisplay = ${a}`);e={...e,style:"decimal"}}let i=t+(e?Object.entries(e).sort((s,a)=>s[0]<a[0]?-1:1).join():"");if(S0.has(i))return S0.get(i);let o=new Intl.NumberFormat(t,e);return S0.set(i,o),o}function w8(t,e,n){if(e==="auto")return t.format(n);if(e==="never")return t.format(Math.abs(n));{let r=!1;if(e==="always"?r=n>0||Object.is(n,0):e==="exceptZero"&&(Object.is(n,-0)||Object.is(n,0)?n=Math.abs(n):r=n>0),r){let i=t.format(-n),o=t.format(n),s=i.replace(o,"").replace(/\u200e|\u061C/,"");return[...s].length!==1&&console.warn("@react-aria/i18n polyfill for NumberFormat signDisplay: Unsupported case"),i.replace(o,"!!!").replace(s,"+").replace("!!!",o)}else return t.format(n)}}const x8=new RegExp("^.*\\(.*\\).*$"),E8=["latn","arab","hanidec","deva","beng"];class q1{parse(e){return k0(this.locale,this.options,e).parse(e)}isValidPartialNumber(e,n,r){return k0(this.locale,this.options,e).isValidPartialNumber(e,n,r)}getNumberingSystem(e){return k0(this.locale,this.options,e).options.numberingSystem}constructor(e,n={}){this.locale=e,this.options=n}}const Y1=new Map;function k0(t,e,n){let r=Q1(t,e);if(!t.includes("-nu-")&&!r.isValidPartialNumber(n)){for(let i of E8)if(i!==r.options.numberingSystem){let o=Q1(t+(t.includes("-u-")?"-nu-":"-u-nu-")+i,e);if(o.isValidPartialNumber(n))return o}}return r}function Q1(t,e){let n=t+(e?Object.entries(e).sort((i,o)=>i[0]<o[0]?-1:1).join():""),r=Y1.get(n);return r||(r=new S8(t,e),Y1.set(n,r)),r}class S8{parse(e){let n=this.sanitize(e);if(this.symbols.group&&(n=Pu(n,this.symbols.group,"")),this.symbols.decimal&&(n=n.replace(this.symbols.decimal,".")),this.symbols.minusSign&&(n=n.replace(this.symbols.minusSign,"-")),n=n.replace(this.symbols.numeral,this.symbols.index),this.options.style==="percent"){let s=n.indexOf("-");n=n.replace("-",""),n=n.replace("+","");let a=n.indexOf(".");a===-1&&(a=n.length),n=n.replace(".",""),a-2===0?n=`0.${n}`:a-2===-1?n=`0.0${n}`:a-2===-2?n="0.00":n=`${n.slice(0,a-2)}.${n.slice(a-2)}`,s>-1&&(n=`-${n}`)}let r=n?+n:NaN;if(isNaN(r))return NaN;if(this.options.style==="percent"){var i,o;let s={...this.options,style:"decimal",minimumFractionDigits:Math.min(((i=this.options.minimumFractionDigits)!==null&&i!==void 0?i:0)+2,20),maximumFractionDigits:Math.min(((o=this.options.maximumFractionDigits)!==null&&o!==void 0?o:0)+2,20)};return new q1(this.locale,s).parse(new b8(this.locale,s).format(r))}return this.options.currencySign==="accounting"&&x8.test(e)&&(r=-1*r),r}sanitize(e){return e=e.replace(this.symbols.literals,""),this.symbols.minusSign&&(e=e.replace("-",this.symbols.minusSign)),this.options.numberingSystem==="arab"&&(this.symbols.decimal&&(e=e.replace(",",this.symbols.decimal),e=e.replace("،",this.symbols.decimal)),this.symbols.group&&(e=Pu(e,".",this.symbols.group))),this.options.locale==="fr-FR"&&this.symbols.group&&(e=Pu(e," ",this.symbols.group),e=Pu(e,/\u00A0/g,this.symbols.group)),e}isValidPartialNumber(e,n=-1/0,r=1/0){return e=this.sanitize(e),this.symbols.minusSign&&e.startsWith(this.symbols.minusSign)&&n<0?e=e.slice(this.symbols.minusSign.length):this.symbols.plusSign&&e.startsWith(this.symbols.plusSign)&&r>0&&(e=e.slice(this.symbols.plusSign.length)),this.symbols.group&&e.startsWith(this.symbols.group)||this.symbols.decimal&&e.indexOf(this.symbols.decimal)>-1&&this.options.maximumFractionDigits===0?!1:(this.symbols.group&&(e=Pu(e,this.symbols.group,"")),e=e.replace(this.symbols.numeral,""),this.symbols.decimal&&(e=e.replace(this.symbols.decimal,"")),e.length===0)}constructor(e,n={}){this.locale=e,n.roundingIncrement!==1&&n.roundingIncrement!=null&&(n.maximumFractionDigits==null&&n.minimumFractionDigits==null?(n.maximumFractionDigits=0,n.minimumFractionDigits=0):n.maximumFractionDigits==null?n.maximumFractionDigits=n.minimumFractionDigits:n.minimumFractionDigits==null&&(n.minimumFractionDigits=n.maximumFractionDigits)),this.formatter=new Intl.NumberFormat(e,n),this.options=this.formatter.resolvedOptions(),this.symbols=k8(e,this.formatter,this.options,n);var r,i;this.options.style==="percent"&&(((r=this.options.minimumFractionDigits)!==null&&r!==void 0?r:0)>18||((i=this.options.maximumFractionDigits)!==null&&i!==void 0?i:0)>18)&&console.warn("NumberParser cannot handle percentages with greater than 18 decimal places, please reduce the number in your options.")}}const X1=new Set(["decimal","fraction","integer","minusSign","plusSign","group"]),A8=[0,4,2,1,11,20,3,7,100,21,.1,1.1];function k8(t,e,n,r){var i,o,s,a;let l=new Intl.NumberFormat(t,{...n,minimumSignificantDigits:1,maximumSignificantDigits:21,roundingIncrement:1,roundingPriority:"auto",roundingMode:"halfExpand"}),c=l.formatToParts(-10000.111),u=l.formatToParts(10000.111),d=A8.map(V=>l.formatToParts(V));var h;let g=(h=(i=c.find(V=>V.type==="minusSign"))===null||i===void 0?void 0:i.value)!==null&&h!==void 0?h:"-",b=(o=u.find(V=>V.type==="plusSign"))===null||o===void 0?void 0:o.value;!b&&((r==null?void 0:r.signDisplay)==="exceptZero"||(r==null?void 0:r.signDisplay)==="always")&&(b="+");let w=(s=new Intl.NumberFormat(t,{...n,minimumFractionDigits:2,maximumFractionDigits:2}).formatToParts(.001).find(V=>V.type==="decimal"))===null||s===void 0?void 0:s.value,S=(a=c.find(V=>V.type==="group"))===null||a===void 0?void 0:a.value,O=c.filter(V=>!X1.has(V.type)).map(V=>J1(V.value)),T=d.flatMap(V=>V.filter(W=>!X1.has(W.type)).map(W=>J1(W.value))),$=[...new Set([...O,...T])].sort((V,W)=>W.length-V.length),R=$.length===0?new RegExp("[\\p{White_Space}]","gu"):new RegExp(`${$.join("|")}|[\\p{White_Space}]`,"gu"),j=[...new Intl.NumberFormat(n.locale,{useGrouping:!1}).format(9876543210)].reverse(),q=new Map(j.map((V,W)=>[V,W])),G=new RegExp(`[${j.join("")}]`,"g");return{minusSign:g,plusSign:b,decimal:w,group:S,literals:R,numeral:G,index:V=>String(q.get(V))}}function Pu(t,e,n){return t.replaceAll?t.replaceAll(e,n):t.split(e).join(n)}function J1(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}var Z1=Ie("numberInput").parts("root","label","input","control","valueText","incrementTrigger","decrementTrigger","scrubber");Z1.build();var C8=t=>{var e,n;return(n=(e=t.ids)==null?void 0:e.input)!=null?n:`number-input:${t.id}:input`},I8=t=>{var e,n;return(n=(e=t.ids)==null?void 0:e.incrementTrigger)!=null?n:`number-input:${t.id}:inc`},O8=t=>{var e,n;return(n=(e=t.ids)==null?void 0:e.decrementTrigger)!=null?n:`number-input:${t.id}:dec`},ex=t=>`number-input:${t.id}:cursor`,Zf=t=>t.getById(C8(t)),T8=t=>t.getById(I8(t)),P8=t=>t.getById(O8(t)),tx=t=>t.getDoc().getElementById(ex(t)),N8=(t,e)=>{let n=null;return e==="increment"&&(n=T8(t)),e==="decrement"&&(n=P8(t)),n},B8=(t,e)=>{if(!jv())return L8(t,e),()=>{var n;(n=tx(t))==null||n.remove()}},R8=t=>{const e=t.getDoc(),n=e.documentElement,r=e.body;return r.style.pointerEvents="none",n.style.userSelect="none",n.style.cursor="ew-resize",()=>{r.style.pointerEvents="",n.style.userSelect="",n.style.cursor="",n.style.length||n.removeAttribute("style"),r.style.length||r.removeAttribute("style")}},M8=(t,e)=>{const{point:n,isRtl:r,event:i}=e,o=t.getWin(),s=Pg(i.movementX,o.devicePixelRatio),a=Pg(i.movementY,o.devicePixelRatio);let l=s>0?"increment":s<0?"decrement":null;r&&l==="increment"&&(l="decrement"),r&&l==="decrement"&&(l="increment");const c={x:n.x+s,y:n.y+a},u=o.innerWidth,d=Pg(7.5,o.devicePixelRatio);return c.x=B3(c.x+d,u)-d,{hint:l,point:c}},L8=(t,e)=>{const n=t.getDoc(),r=n.createElement("div");r.className="scrubber--cursor",r.id=ex(t),Object.assign(r.style,{width:"15px",height:"15px",position:"fixed",pointerEvents:"none",left:"0px",top:"0px",zIndex:j3,transform:e?`translate3d(${e.x}px, ${e.y}px, 0px)`:void 0,willChange:"transform"}),r.innerHTML=`
17
+ <svg width="46" height="15" style="left: -15.5px; position: absolute; top: 0; filter: drop-shadow(rgba(0, 0, 0, 0.4) 0px 1px 1.1px);">
18
+ <g transform="translate(2 3)">
19
+ <path fill-rule="evenodd" d="M 15 4.5L 15 2L 11.5 5.5L 15 9L 15 6.5L 31 6.5L 31 9L 34.5 5.5L 31 2L 31 4.5Z" style="stroke-width: 2px; stroke: white;"></path>
20
+ <path fill-rule="evenodd" d="M 15 4.5L 15 2L 11.5 5.5L 15 9L 15 6.5L 31 6.5L 31 9L 34.5 5.5L 31 2L 31 4.5Z"></path>
21
+ </g>
22
+ </svg>`,n.body.appendChild(r)};function F8(t){if(!(!t||t.ownerDocument.activeElement!==t))try{const{selectionStart:e,selectionEnd:n,value:r}=t,i=r.substring(0,e),o=r.substring(n);return{start:e,end:n,value:r,beforeTxt:i,afterTxt:o}}catch(e){}}function _8(t,e){if(!(!t||t.ownerDocument.activeElement!==t)){if(!e){t.setSelectionRange(t.value.length,t.value.length);return}try{const{value:n}=t,{beforeTxt:r="",afterTxt:i="",start:o}=e;let s=n.length;if(n.endsWith(i))s=n.length-i.length;else if(n.startsWith(r))s=r.length;else if(o!=null){const a=r[o-1],l=n.indexOf(a,o-1);l!==-1&&(s=l+1)}t.setSelectionRange(s,s)}catch(n){}}}var V8=(t,e={})=>new Intl.NumberFormat(t,e),D8=(t,e={})=>new q1(t,e),C0=(t,e)=>{const{prop:n,computed:r}=e;return n("formatOptions")?r("parser").parse(String(t)):parseFloat(t)},Js=(t,e)=>{const{prop:n,computed:r}=e;return Number.isNaN(t)?"":n("formatOptions")?r("formatter").format(t):t.toString()},z8=(t,e)=>{let n=t!==void 0&&!Number.isNaN(t)?t:1;return(e==null?void 0:e.style)==="percent"&&(t===void 0||Number.isNaN(t))&&(n=.01),n},{choose:U8,guards:$8,createMachine:H8}=tw(),{not:nx,and:rx}=$8;H8({props({props:t}){const e=z8(t.step,t.formatOptions);return{dir:"ltr",locale:"en-US",focusInputOnChange:!0,clampValueOnBlur:!t.allowOverflow,allowOverflow:!1,inputMode:"decimal",pattern:"-?[0-9]*(.[0-9]+)?",defaultValue:"",step:e,min:Number.MIN_SAFE_INTEGER,max:Number.MAX_SAFE_INTEGER,spinOnPress:!0,...t,translations:{incrementLabel:"increment value",decrementLabel:"decrease value",...t.translations}}},initialState(){return"idle"},context({prop:t,bindable:e,getComputed:n}){return{value:e(()=>({defaultValue:t("defaultValue"),value:t("value"),onChange(r){var s;const i=n(),o=C0(r,{computed:i,prop:t});(s=t("onValueChange"))==null||s({value:r,valueAsNumber:o})}})),hint:e(()=>({defaultValue:null})),scrubberCursorPoint:e(()=>({defaultValue:null,hash(r){return r?`x:${r.x}, y:${r.y}`:""}})),fieldsetDisabled:e(()=>({defaultValue:!1}))}},computed:{isRtl:({prop:t})=>t("dir")==="rtl",valueAsNumber:({context:t,computed:e,prop:n})=>C0(t.get("value"),{computed:e,prop:n}),formattedValue:({computed:t,prop:e})=>Js(t("valueAsNumber"),{computed:t,prop:e}),isAtMin:({computed:t,prop:e})=>M3(t("valueAsNumber"),e("min")),isAtMax:({computed:t,prop:e})=>R3(t("valueAsNumber"),e("max")),isOutOfRange:({computed:t,prop:e})=>!L3(t("valueAsNumber"),e("min"),e("max")),isValueEmpty:({context:t})=>t.get("value")==="",isDisabled:({prop:t,context:e})=>!!t("disabled")||e.get("fieldsetDisabled"),canIncrement:({prop:t,computed:e})=>t("allowOverflow")||!e("isAtMax"),canDecrement:({prop:t,computed:e})=>t("allowOverflow")||!e("isAtMin"),valueText:({prop:t,context:e})=>{var n,r;return(r=(n=t("translations")).valueText)==null?void 0:r.call(n,e.get("value"))},formatter:ew(({prop:t})=>[t("locale"),t("formatOptions")],(t,e)=>V8(t,e)),parser:ew(({prop:t})=>[t("locale"),t("formatOptions")],(t,e)=>D8(t,e))},watch({track:t,action:e,context:n,computed:r,prop:i}){t([()=>n.get("value"),()=>i("locale")],()=>{e(["syncInputElement"])}),t([()=>r("isOutOfRange")],()=>{e(["invokeOnInvalid"])}),t([()=>n.hash("scrubberCursorPoint")],()=>{e(["setVirtualCursorPosition"])})},effects:["trackFormControl"],on:{"VALUE.SET":{actions:["setRawValue"]},"VALUE.CLEAR":{actions:["clearValue"]},"VALUE.INCREMENT":{actions:["increment"]},"VALUE.DECREMENT":{actions:["decrement"]}},states:{idle:{on:{"TRIGGER.PRESS_DOWN":[{guard:"isTouchPointer",target:"before:spin",actions:["setHint"]},{target:"before:spin",actions:["focusInput","invokeOnFocus","setHint"]}],"SCRUBBER.PRESS_DOWN":{target:"scrubbing",actions:["focusInput","invokeOnFocus","setHint","setCursorPoint"]},"INPUT.FOCUS":{target:"focused",actions:["focusInput","invokeOnFocus"]}}},focused:{tags:["focus"],effects:["attachWheelListener"],on:{"TRIGGER.PRESS_DOWN":[{guard:"isTouchPointer",target:"before:spin",actions:["setHint"]},{target:"before:spin",actions:["focusInput","setHint"]}],"SCRUBBER.PRESS_DOWN":{target:"scrubbing",actions:["focusInput","setHint","setCursorPoint"]},"INPUT.ARROW_UP":{actions:["increment"]},"INPUT.ARROW_DOWN":{actions:["decrement"]},"INPUT.HOME":{actions:["decrementToMin"]},"INPUT.END":{actions:["incrementToMax"]},"INPUT.CHANGE":{actions:["setValue","setHint"]},"INPUT.BLUR":[{guard:rx("clampValueOnBlur",nx("isInRange")),target:"idle",actions:["setClampedValue","clearHint","invokeOnBlur"]},{guard:nx("isInRange"),target:"idle",actions:["setFormattedValue","clearHint","invokeOnBlur","invokeOnInvalid"]},{target:"idle",actions:["setFormattedValue","clearHint","invokeOnBlur"]}],"INPUT.ENTER":{actions:["setFormattedValue","clearHint","invokeOnBlur"]}}},"before:spin":{tags:["focus"],effects:["trackButtonDisabled","waitForChangeDelay"],entry:U8([{guard:"isIncrementHint",actions:["increment"]},{guard:"isDecrementHint",actions:["decrement"]}]),on:{CHANGE_DELAY:{target:"spinning",guard:rx("isInRange","spinOnPress")},"TRIGGER.PRESS_UP":[{guard:"isTouchPointer",target:"focused",actions:["clearHint"]},{target:"focused",actions:["focusInput","clearHint"]}]}},spinning:{tags:["focus"],effects:["trackButtonDisabled","spinValue"],on:{SPIN:[{guard:"isIncrementHint",actions:["increment"]},{guard:"isDecrementHint",actions:["decrement"]}],"TRIGGER.PRESS_UP":{target:"focused",actions:["focusInput","clearHint"]}}},scrubbing:{tags:["focus"],effects:["activatePointerLock","trackMousemove","setupVirtualCursor","preventTextSelection"],on:{"SCRUBBER.POINTER_UP":{target:"focused",actions:["focusInput","clearCursorPoint"]},"SCRUBBER.POINTER_MOVE":[{guard:"isIncrementHint",actions:["increment","setCursorPoint"]},{guard:"isDecrementHint",actions:["decrement","setCursorPoint"]}]}}},implementations:{guards:{clampValueOnBlur:({prop:t})=>t("clampValueOnBlur"),spinOnPress:({prop:t})=>!!t("spinOnPress"),isInRange:({computed:t})=>!t("isOutOfRange"),isDecrementHint:({context:t,event:e})=>{var n;return((n=e.hint)!=null?n:t.get("hint"))==="decrement"},isIncrementHint:({context:t,event:e})=>{var n;return((n=e.hint)!=null?n:t.get("hint"))==="increment"},isTouchPointer:({event:t})=>t.pointerType==="touch"},effects:{waitForChangeDelay({send:t}){const e=setTimeout(()=>{t({type:"CHANGE_DELAY"})},300);return()=>clearTimeout(e)},spinValue({send:t}){const e=setInterval(()=>{t({type:"SPIN"})},50);return()=>clearInterval(e)},trackFormControl({context:t,scope:e}){const n=Zf(e);return Lg(n,{onFieldsetDisabledChange(r){t.set("fieldsetDisabled",r)},onFormReset(){t.set("value",t.initial("value"))}})},setupVirtualCursor({context:t,scope:e}){const n=t.get("scrubberCursorPoint");return B8(e,n)},preventTextSelection({scope:t}){return R8(t)},trackButtonDisabled({context:t,scope:e,send:n}){const r=t.get("hint"),i=N8(e,r);return wf(i,{attributes:["disabled"],callback(){n({type:"TRIGGER.PRESS_UP",src:"attr"})}})},attachWheelListener({scope:t,send:e,prop:n}){const r=Zf(t);if(!r||!t.isActiveElement(r)||!n("allowMouseWheel"))return;function i(o){o.preventDefault();const s=Math.sign(o.deltaY)*-1;s===1?e({type:"VALUE.INCREMENT"}):s===-1&&e({type:"VALUE.DECREMENT"})}return gn(r,"wheel",i,{passive:!1})},activatePointerLock({scope:t}){if(!jv())return _N(t.getDoc())},trackMousemove({scope:t,send:e,context:n,computed:r}){const i=t.getDoc();function o(a){const l=n.get("scrubberCursorPoint"),c=r("isRtl"),u=M8(t,{point:l,isRtl:c,event:a});u.hint&&e({type:"SCRUBBER.POINTER_MOVE",hint:u.hint,point:u.point})}function s(){e({type:"SCRUBBER.POINTER_UP"})}return uf(gn(i,"mousemove",o,!1),gn(i,"mouseup",s,!1))}},actions:{focusInput({scope:t,prop:e}){if(!e("focusInputOnChange"))return;const n=Zf(t);t.isActiveElement(n)||ze(()=>n==null?void 0:n.focus({preventScroll:!0}))},increment({context:t,event:e,prop:n,computed:r}){var o;let i=D3(r("valueAsNumber"),(o=e.step)!=null?o:n("step"));n("allowOverflow")||(i=Xn(i,n("min"),n("max"))),t.set("value",Js(i,{computed:r,prop:n}))},decrement({context:t,event:e,prop:n,computed:r}){var o;let i=z3(r("valueAsNumber"),(o=e.step)!=null?o:n("step"));n("allowOverflow")||(i=Xn(i,n("min"),n("max"))),t.set("value",Js(i,{computed:r,prop:n}))},setClampedValue({context:t,prop:e,computed:n}){const r=Xn(n("valueAsNumber"),e("min"),e("max"));t.set("value",Js(r,{computed:n,prop:e}))},setRawValue({context:t,event:e,prop:n,computed:r}){let i=C0(e.value,{computed:r,prop:n});n("allowOverflow")||(i=Xn(i,n("min"),n("max"))),t.set("value",Js(i,{computed:r,prop:n}))},setValue({context:t,event:e}){var r,i;const n=(i=(r=e.target)==null?void 0:r.value)!=null?i:e.value;t.set("value",n)},clearValue({context:t}){t.set("value","")},incrementToMax({context:t,prop:e,computed:n}){const r=Js(e("max"),{computed:n,prop:e});t.set("value",r)},decrementToMin({context:t,prop:e,computed:n}){const r=Js(e("min"),{computed:n,prop:e});t.set("value",r)},setHint({context:t,event:e}){t.set("hint",e.hint)},clearHint({context:t}){t.set("hint",null)},invokeOnFocus({computed:t,prop:e}){var n;(n=e("onFocusChange"))==null||n({focused:!0,value:t("formattedValue"),valueAsNumber:t("valueAsNumber")})},invokeOnBlur({computed:t,prop:e}){var n;(n=e("onFocusChange"))==null||n({focused:!1,value:t("formattedValue"),valueAsNumber:t("valueAsNumber")})},invokeOnInvalid({computed:t,prop:e,event:n}){var i;if(n.type==="INPUT.CHANGE")return;const r=t("valueAsNumber")>e("max")?"rangeOverflow":"rangeUnderflow";(i=e("onValueInvalid"))==null||i({reason:r,value:t("formattedValue"),valueAsNumber:t("valueAsNumber")})},syncInputElement({context:t,event:e,computed:n,scope:r}){const i=e.type.endsWith("CHANGE")?t.get("value"):n("formattedValue"),o=Zf(r),s=F8(o);ze(()=>{bf(o,i),_8(o,s)})},setFormattedValue({context:t,computed:e}){t.set("value",e("formattedValue"))},setCursorPoint({context:t,event:e}){t.set("scrubberCursorPoint",e.point)},clearCursorPoint({context:t}){t.set("scrubberCursorPoint",null)},setVirtualCursorPosition({context:t,scope:e}){const n=tx(e),r=t.get("scrubberCursorPoint");!n||!r||(n.style.transform=`translate3d(${r.x}px, ${r.y}px, 0px)`)}}}}),Be()(["allowMouseWheel","allowOverflow","clampValueOnBlur","dir","disabled","focusInputOnChange","form","formatOptions","getRootNode","id","ids","inputMode","invalid","locale","max","min","name","onFocusChange","onValueChange","onValueInvalid","pattern","required","readOnly","spinOnPress","step","translations","value","defaultValue"]);var ix=Ie("pinInput").parts("root","label","input","control");ix.build(),Be()(["autoFocus","blurOnComplete","count","defaultValue","dir","disabled","form","getRootNode","id","ids","invalid","mask","name","onValueChange","onValueComplete","onValueInvalid","otp","pattern","placeholder","readOnly","required","selectOnFocus","translations","type","value"]);var ox=Ie("popover").parts("arrow","arrowTip","anchor","trigger","indicator","positioner","content","title","description","closeTrigger");ox.build(),Be()(["autoFocus","closeOnEscape","closeOnInteractOutside","dir","getRootNode","id","ids","initialFocusEl","modal","onEscapeKeyDown","onFocusOutside","onInteractOutside","onOpenChange","onPointerDownOutside","defaultOpen","open","persistentElements","portalled","positioning"]);const W8=t=>{var l;const{children:e,disabled:n}=t,[r,i]=J.useState((l=t.container)==null?void 0:l.current),o=J.useSyncExternalStore(j8,()=>!1,()=>!0),{getRootNode:s}=Ng();if(J.useEffect(()=>{i(()=>{var c;return(c=t.container)==null?void 0:c.current})},[t.container]),o||n)return k.jsx(k.Fragment,{children:e});const a=r!=null?r:G8(s);return k.jsx(k.Fragment,{children:J.Children.map(e,c=>Ds.createPortal(c,a))})},G8=t=>{const e=t==null?void 0:t(),n=e.getRootNode();return dl(n)?n:Ir(e).body},j8=()=>()=>{};var I0=Ie("progress").parts("root","label","track","range","valueText","view","circle","circleTrack","circleRange");I0.build(),Be()(["dir","getRootNode","id","ids","max","min","orientation","translations","value","onValueChange","defaultValue","formatOptions","locale"]);var sx=Ie("qr-code").parts("root","frame","pattern","overlay","downloadTrigger");sx.build(),Be()(["ids","defaultValue","value","id","encoding","dir","getRootNode","onValueChange","pixelSize"]);var O0=Ie("radio-group").parts("root","label","item","itemText","itemControl","indicator");O0.build(),Be()(["dir","disabled","form","getRootNode","id","ids","name","onValueChange","orientation","readOnly","value","defaultValue"]),Be()(["value","disabled","invalid"]);var ax=Ie("rating-group").parts("root","label","item","control");ax.build(),Be()(["allowHalf","autoFocus","count","dir","disabled","form","getRootNode","id","ids","name","onHoverChange","onValueChange","required","readOnly","translations","value","defaultValue"]),Be()(["index"]);const lx=O0.rename("segment-group");lx.build();var cx=Ie("select").parts("label","positioner","trigger","indicator","clearTrigger","item","itemText","itemIndicator","itemGroup","itemGroupLabel","list","content","root","control","valueText");cx.build();var ux=t=>new $f(t);ux.empty=()=>new $f({items:[]});var K8=t=>{var e,n;return(n=(e=t.ids)==null?void 0:e.content)!=null?n:`select:${t.id}:content`},q8=t=>{var e,n;return(n=(e=t.ids)==null?void 0:e.trigger)!=null?n:`select:${t.id}:trigger`},Y8=t=>{var e,n;return(n=(e=t.ids)==null?void 0:e.clearTrigger)!=null?n:`select:${t.id}:clear-trigger`},Q8=(t,e)=>{var n,r,i;return(i=(r=(n=t.ids)==null?void 0:n.item)==null?void 0:r.call(n,e))!=null?i:`select:${t.id}:option:${e}`},X8=t=>{var e,n;return(n=(e=t.ids)==null?void 0:e.hiddenSelect)!=null?n:`select:${t.id}:select`},J8=t=>{var e,n;return(n=(e=t.ids)==null?void 0:e.positioner)!=null?n:`select:${t.id}:positioner`},T0=t=>t.getById(X8(t)),Nu=t=>t.getById(K8(t)),eh=t=>t.getById(q8(t)),Z8=t=>t.getById(Y8(t)),dx=t=>t.getById(J8(t)),eR=(t,e)=>t.getById(Q8(t,e)),{and:Bu,not:Zs,or:tR}=$o();tR("isTriggerArrowDownEvent","isTriggerEnterEvent"),Bu(Zs("multiple"),"hasSelectedItems"),Zs("multiple"),Bu(Zs("multiple"),"hasSelectedItems"),Zs("multiple"),Zs("multiple"),Zs("multiple"),Zs("multiple"),Bu("closeOnSelect","isOpenControlled"),Bu("hasHighlightedItem","loop","isLastItemHighlighted"),Bu("hasHighlightedItem","loop","isFirstItemHighlighted");function fx(t){var n,r;const e=(r=t.restoreFocus)!=null?r:(n=t.previousEvent)==null?void 0:n.restoreFocus;return e==null||!!e}Be()(["closeOnSelect","collection","composite","defaultHighlightedValue","defaultOpen","defaultValue","deselectable","dir","disabled","form","getRootNode","highlightedValue","id","ids","invalid","loopFocus","multiple","name","onFocusOutside","onHighlightChange","onInteractOutside","onOpenChange","onPointerDownOutside","onSelect","onValueChange","open","positioning","readOnly","required","scrollToIndexFn","value"]),Be()(["item","persistFocus"]),Be()(["id"]),Be()(["htmlFor"]);var hx=Ie("slider").parts("root","label","thumb","valueText","track","range","control","markerGroup","marker","draggingIndicator");hx.build(),Be()(["aria-label","aria-labelledby","dir","disabled","form","getAriaValueText","getRootNode","id","ids","invalid","max","min","minStepsBetweenThumbs","name","onFocusChange","onValueChange","onValueChangeEnd","orientation","origin","readOnly","step","thumbAlignment","thumbAlignment","thumbSize","value","defaultValue"]),Be()(["index","name"]);var px=Ie("switch").parts("root","label","control","thumb");px.build(),Be()(["checked","defaultChecked","dir","disabled","form","getRootNode","id","ids","invalid","label","name","onCheckedChange","readOnly","required","value"]);var nR=Ie("toast").parts("group","root","title","description","actionTrigger","closeTrigger");nR.build();var rR=(t,e)=>({...e,...ff(t)});function iR(t){const e=rR(t,{placement:"bottom",overlap:!1,max:24,gap:16,offsets:"1rem",hotkey:["altKey","KeyT"],removeDelay:200,pauseOnPageIdle:!0});let n=[],r=[],i=new Set,o=[];const s=z=>(n.push(z),()=>{const C=n.indexOf(z);n.splice(C,1)}),a=z=>(n.forEach(C=>C(z)),z),l=z=>{if(r.length>=e.max){o.push(z);return}a(z),r.unshift(z)},c=()=>{for(;o.length>0&&r.length<e.max;){const z=o.shift();z&&(a(z),r.unshift(z))}},u=z=>{var y;const C=(y=z.id)!=null?y:`toast:${I3()}`,f=r.find(E=>E.id===C);return i.has(C)&&i.delete(C),f?r=r.map(E=>E.id===C?a({...E,...z,id:C}):E):l({id:C,duration:e.duration,removeDelay:e.removeDelay,type:"info",...z,stacked:!e.overlap,gap:e.gap}),C},d=z=>(i.add(z),z?(n.forEach(C=>C({id:z,dismiss:!0})),r=r.filter(C=>C.id!==z),c()):(r.forEach(C=>{n.forEach(f=>f({id:C.id,dismiss:!0}))}),r=[],o=[]),z);return{attrs:e,subscribe:s,create:u,update:(z,C)=>u({id:z,...C}),remove:d,dismiss:z=>{z!=null?r=r.map(C=>C.id===z?a({...C,message:"DISMISS"}):C):r=r.map(C=>a({...C,message:"DISMISS"}))},error:z=>u({...z,type:"error"}),success:z=>u({...z,type:"success"}),info:z=>u({...z,type:"info"}),warning:z=>u({...z,type:"warning"}),loading:z=>u({...z,type:"loading"}),getVisibleToasts:()=>r.filter(z=>!i.has(z.id)),getCount:()=>r.length,promise:(z,C,f={})=>{if(!C||!C.loading){bu("[zag-js > toast] toaster.promise() requires at least a 'loading' option to be specified");return}const y=u({...f,...C.loading,promise:z,type:"loading"});let E=!0,I;const N=yu(z).then(async M=>{if(I=["resolve",M],oR(M)&&!M.ok){E=!1;const P=yu(C.error,`HTTP Error! status: ${M.status}`);u({...f,...P,id:y,type:"error"})}else if(C.success!==void 0){E=!1;const P=yu(C.success,M);u({...f,...P,id:y,type:"success"})}}).catch(async M=>{if(I=["reject",M],C.error!==void 0){E=!1;const P=yu(C.error,M);u({...f,...P,id:y,type:"error"})}}).finally(()=>{var M;E&&d(y),(M=C.finally)==null||M.call(C)});return{id:y,unwrap:()=>new Promise((M,P)=>N.then(()=>I[0]==="reject"?P(I[1]):M(I[1])).catch(P))}},pause:z=>{z!=null?r=r.map(C=>C.id===z?a({...C,message:"PAUSE"}):C):r=r.map(C=>a({...C,message:"PAUSE"}))},resume:z=>{z!=null?r=r.map(C=>C.id===z?a({...C,message:"RESUME"}):C):r=r.map(C=>a({...C,message:"RESUME"}))},isVisible:z=>!i.has(z)&&!!r.find(C=>C.id===z),isDismissed:z=>i.has(z),expand:()=>{r=r.map(z=>a({...z,stacked:!0}))},collapse:()=>{r=r.map(z=>a({...z,stacked:!1}))}}}var oR=t=>t&&typeof t=="object"&&"ok"in t&&typeof t.ok=="boolean"&&"status"in t&&typeof t.status=="number";const sR=t=>iR(t),[gx,Ru]=ul({name:"TooltipContext",hookName:"useTooltipContext",providerName:"<TooltipProvider />"}),mx=J.forwardRef((t,e)=>{const n=Ru(),r=cr(n.getArrowProps(),t);return k.jsx(bi.div,{...r,ref:e})});mx.displayName="TooltipArrow";const yx=J.forwardRef((t,e)=>{const n=Ru(),r=cr(n.getArrowTipProps(),t);return k.jsx(bi.div,{...r,ref:e})});yx.displayName="TooltipArrowTip";const bx=J.forwardRef((t,e)=>{const n=Ru(),r=dw(),i=cr(n.getContentProps(),r.getPresenceProps(),t);return r.unmounted?null:k.jsx(bi.div,{...i,ref:nw(r.ref,e)})});bx.displayName="TooltipContent";const vx=J.forwardRef((t,e)=>{const n=Ru(),r=cr(n.getPositionerProps(),t);return dw().unmounted?null:k.jsx(bi.div,{...r,ref:e})});vx.displayName="TooltipPositioner";var wx=Ie("tooltip").parts("trigger","arrow","arrowTip","positioner","content"),Mu=wx.build(),xx=t=>{var e,n;return(n=(e=t.ids)==null?void 0:e.trigger)!=null?n:`tooltip:${t.id}:trigger`},aR=t=>{var e,n;return(n=(e=t.ids)==null?void 0:e.content)!=null?n:`tooltip:${t.id}:content`},lR=t=>{var e,n;return(n=(e=t.ids)==null?void 0:e.arrow)!=null?n:`tooltip:${t.id}:arrow`},Ex=t=>{var e,n;return(n=(e=t.ids)==null?void 0:e.positioner)!=null?n:`tooltip:${t.id}:popper`},P0=t=>t.getById(xx(t)),Sx=t=>t.getById(Ex(t)),eo=F1({id:null});function cR(t,e){const{state:n,context:r,send:i,scope:o,prop:s,event:a}=t,l=s("id"),c=!!s("aria-label"),u=n.matches("open","closing"),d=xx(o),h=aR(o),g=s("disabled"),b=q4({...s("positioning"),placement:r.get("currentPlacement")});return{open:u,setOpen(p){n.matches("open","closing")!==p&&i({type:p?"open":"close"})},reposition(p={}){i({type:"positioning.set",options:p})},getTriggerProps(){return e.button({...Mu.trigger.attrs,id:d,dir:s("dir"),"data-expanded":pf(u),"data-state":u?"open":"closed","aria-describedby":u?h:void 0,onClick(p){p.defaultPrevented||g||s("closeOnClick")&&i({type:"close",src:"trigger.click"})},onFocus(p){queueMicrotask(()=>{p.defaultPrevented||g||a.src!=="trigger.pointerdown"&&h0()&&i({type:"open",src:"trigger.focus"})})},onBlur(p){p.defaultPrevented||g||l===eo.id&&i({type:"close",src:"trigger.blur"})},onPointerDown(p){p.defaultPrevented||g||yN(p)&&s("closeOnPointerDown")&&l===eo.id&&i({type:"close",src:"trigger.pointerdown"})},onPointerMove(p){p.defaultPrevented||g||p.pointerType!=="touch"&&i({type:"pointer.move"})},onPointerLeave(){g||i({type:"pointer.leave"})},onPointerCancel(){g||i({type:"pointer.leave"})}})},getArrowProps(){return e.element({id:lR(o),...Mu.arrow.attrs,dir:s("dir"),style:b.arrow})},getArrowTipProps(){return e.element({...Mu.arrowTip.attrs,dir:s("dir"),style:b.arrowTip})},getPositionerProps(){return e.element({id:Ex(o),...Mu.positioner.attrs,dir:s("dir"),style:b.floating})},getContentProps(){return e.element({...Mu.content.attrs,dir:s("dir"),hidden:!u,"data-state":u?"open":"closed",role:c?void 0:"tooltip",id:c?void 0:h,"data-placement":r.get("currentPlacement"),onPointerEnter(){i({type:"content.pointer.move"})},onPointerLeave(){i({type:"content.pointer.leave"})},style:{pointerEvents:s("interactive")?"auto":"none"}})}}}var{and:uR,not:Ax}=$o(),dR={initialState:({prop:t})=>t("open")||t("defaultOpen")?"open":"closed",props({props:t}){return{id:"x",openDelay:1e3,closeDelay:500,closeOnPointerDown:!0,closeOnEscape:!0,interactive:!1,closeOnScroll:!0,closeOnClick:!0,disabled:!1,...t,positioning:{placement:"bottom",...t.positioning}}},effects:["trackFocusVisible","trackStore"],context:({bindable:t})=>({currentPlacement:t(()=>({defaultValue:void 0})),hasPointerMoveOpened:t(()=>({defaultValue:!1}))}),watch({track:t,action:e,prop:n}){t([()=>n("disabled")],()=>{e(["closeIfDisabled"])}),t([()=>n("open")],()=>{e(["toggleVisibility"])})},states:{closed:{entry:["clearGlobalId"],on:{"controlled.open":{target:"open"},open:[{guard:"isOpenControlled",actions:["invokeOnOpen"]},{target:"open",actions:["invokeOnOpen"]}],"pointer.leave":{actions:["clearPointerMoveOpened"]},"pointer.move":[{guard:uR("noVisibleTooltip",Ax("hasPointerMoveOpened")),target:"opening"},{guard:Ax("hasPointerMoveOpened"),target:"open",actions:["setPointerMoveOpened","invokeOnOpen"]}]}},opening:{effects:["trackScroll","trackPointerlockChange","waitForOpenDelay"],on:{"after.openDelay":[{guard:"isOpenControlled",actions:["setPointerMoveOpened","invokeOnOpen"]},{target:"open",actions:["setPointerMoveOpened","invokeOnOpen"]}],"controlled.open":{target:"open"},"controlled.close":{target:"closed"},open:[{guard:"isOpenControlled",actions:["invokeOnOpen"]},{target:"open",actions:["invokeOnOpen"]}],"pointer.leave":[{guard:"isOpenControlled",actions:["clearPointerMoveOpened","invokeOnClose","toggleVisibility"]},{target:"closed",actions:["clearPointerMoveOpened","invokeOnClose"]}],close:[{guard:"isOpenControlled",actions:["invokeOnClose","toggleVisibility"]},{target:"closed",actions:["invokeOnClose"]}]}},open:{effects:["trackEscapeKey","trackScroll","trackPointerlockChange","trackPositioning"],entry:["setGlobalId"],on:{"controlled.close":{target:"closed"},close:[{guard:"isOpenControlled",actions:["invokeOnClose"]},{target:"closed",actions:["invokeOnClose"]}],"pointer.leave":[{guard:"isVisible",target:"closing",actions:["clearPointerMoveOpened"]},{guard:"isOpenControlled",actions:["clearPointerMoveOpened","invokeOnClose"]},{target:"closed",actions:["clearPointerMoveOpened","invokeOnClose"]}],"content.pointer.leave":{guard:"isInteractive",target:"closing"},"positioning.set":{actions:["reposition"]}}},closing:{effects:["trackPositioning","waitForCloseDelay"],on:{"after.closeDelay":[{guard:"isOpenControlled",actions:["invokeOnClose"]},{target:"closed",actions:["invokeOnClose"]}],"controlled.close":{target:"closed"},"controlled.open":{target:"open"},close:[{guard:"isOpenControlled",actions:["invokeOnClose"]},{target:"closed",actions:["invokeOnClose"]}],"pointer.move":[{guard:"isOpenControlled",actions:["setPointerMoveOpened","invokeOnOpen","toggleVisibility"]},{target:"open",actions:["setPointerMoveOpened","invokeOnOpen"]}],"content.pointer.move":{guard:"isInteractive",target:"open"},"positioning.set":{actions:["reposition"]}}}},implementations:{guards:{noVisibleTooltip:()=>eo.id===null,isVisible:({prop:t})=>t("id")===eo.id,isInteractive:({prop:t})=>!!t("interactive"),hasPointerMoveOpened:({context:t})=>t.get("hasPointerMoveOpened"),isOpenControlled:({prop:t})=>t("open")!==void 0},actions:{setGlobalId:({prop:t})=>{eo.id=t("id")},clearGlobalId:({prop:t})=>{t("id")===eo.id&&(eo.id=null)},invokeOnOpen:({prop:t})=>{var e;(e=t("onOpenChange"))==null||e({open:!0})},invokeOnClose:({prop:t})=>{var e;(e=t("onOpenChange"))==null||e({open:!1})},closeIfDisabled:({prop:t,send:e})=>{t("disabled")&&e({type:"close",src:"disabled.change"})},reposition:({context:t,event:e,prop:n,scope:r})=>{if(e.type!=="positioning.set")return;const i=()=>Sx(r);return qr(P0(r),i,{...n("positioning"),...e.options,defer:!0,listeners:!1,onComplete(o){t.set("currentPlacement",o.placement)}})},toggleVisibility:({prop:t,event:e,send:n})=>{queueMicrotask(()=>{n({type:t("open")?"controlled.open":"controlled.close",previousEvent:e})})},setPointerMoveOpened:({context:t})=>{t.set("hasPointerMoveOpened",!0)},clearPointerMoveOpened:({context:t})=>{t.set("hasPointerMoveOpened",!1)}},effects:{trackFocusVisible:({scope:t})=>{var e;return Y6({root:(e=t.getRootNode)==null?void 0:e.call(t)})},trackPositioning:({context:t,prop:e,scope:n})=>{t.get("currentPlacement")||t.set("currentPlacement",e("positioning").placement);const r=()=>Sx(n);return qr(P0(n),r,{...e("positioning"),defer:!0,onComplete(i){t.set("currentPlacement",i.placement)}})},trackPointerlockChange:({send:t,scope:e})=>{const n=e.getDoc();return gn(n,"pointerlockchange",()=>t({type:"close",src:"pointerlock:change"}),!1)},trackScroll:({send:t,prop:e,scope:n})=>{if(!e("closeOnScroll"))return;const r=P0(n);if(!r)return;const o=Qv(r).map(s=>gn(s,"scroll",()=>{t({type:"close",src:"scroll"})},{passive:!0,capture:!0}));return()=>{o.forEach(s=>s==null?void 0:s())}},trackStore:({prop:t,send:e})=>{let n;return queueMicrotask(()=>{n=K5(eo,()=>{eo.id!==t("id")&&e({type:"close",src:"id.change"})})}),()=>n==null?void 0:n()},trackEscapeKey:({send:t,prop:e})=>e("closeOnEscape")?gn(document,"keydown",r=>{gN(r)||r.key==="Escape"&&(r.stopPropagation(),t({type:"close",src:"keydown.escape"}))},!0):void 0,waitForOpenDelay:({send:t,prop:e})=>{const n=setTimeout(()=>{t({type:"after.openDelay"})},e("openDelay"));return()=>clearTimeout(n)},waitForCloseDelay:({send:t,prop:e})=>{const n=setTimeout(()=>{t({type:"after.closeDelay"})},e("closeDelay"));return()=>clearTimeout(n)}}}};Be()(["aria-label","closeDelay","closeOnEscape","closeOnPointerDown","closeOnScroll","closeOnClick","dir","disabled","getRootNode","id","ids","interactive","onOpenChange","defaultOpen","open","openDelay","positioning"]);const fR=t=>{const e=J.useId(),{getRootNode:n}=Ng(),{dir:r}=rw(),i={id:e,dir:r,getRootNode:n,...t},o=jg(dR,i);return cR(o,lw)},hR=t=>{const[e,{children:n,...r}]=iw(t),i=fR(r),o=cw(cr({present:i.open},e));return k.jsx(gx,{value:i,children:k.jsx(uw,{value:o,children:n})})},pR=t=>{const[e,{value:n,children:r}]=iw(t),i=cw(cr({present:n.open},e));return k.jsx(gx,{value:n,children:k.jsx(uw,{value:i,children:r})})},kx=J.forwardRef((t,e)=>{const n=Ru(),r=cr(n.getTriggerProps(),t);return k.jsx(bi.button,{...r,ref:e})});kx.displayName="TooltipTrigger";function Cx(t,e=[]){const n=Object.assign({},t);for(const r of e)r in n&&delete n[r];return n}const gR=(t,e)=>{var l;if(!t||typeof t!="string")return{invalid:!0,value:t};const[n,r]=t.split("/");if(!n||!r||n==="currentBg")return{invalid:!0,value:n};const i=e(`colors.${n}`),o=(l=e.raw(`opacity.${r}`))==null?void 0:l.value;if(!o&&isNaN(Number(r)))return{invalid:!0,value:n};const s=o?Number(o)*100+"%":`${r}%`,a=i!=null?i:n;return{invalid:!1,color:a,value:`color-mix(in srgb, ${a} ${s}, transparent)`}},ct=t=>(e,n)=>{const r=n.utils.colorMix(e);if(r.invalid)return{[t]:e};const i="--mix-"+t;return{[i]:r.value,[t]:`var(${i}, ${r.color})`}};function N0(t){if(t===null||typeof t!="object")return t;if(Array.isArray(t))return t.map(n=>N0(n));const e=Object.create(Object.getPrototypeOf(t));for(const n of Object.keys(t))e[n]=N0(t[n]);return e}function B0(t,e){if(e==null)return t;for(const n of Object.keys(e))if(!(e[n]===void 0||n==="__proto__"))if(!Qn(t[n])&&Qn(e[n]))Object.assign(t,{[n]:e[n]});else if(t[n]&&Qn(e[n]))B0(t[n],e[n]);else if(Array.isArray(e[n])&&Array.isArray(t[n])){let r=0;for(;r<e[n].length;r++)Qn(t[n][r])&&Qn(e[n][r])?B0(t[n][r],e[n][r]):t[n][r]=e[n][r]}else Object.assign(t,{[n]:e[n]});return t}function Sl(t,...e){for(const n of e)B0(t,n);return t}const mR=t=>t,Ot=t=>t,Oe=t=>t,yR=t=>t,bR=t=>t,Al=t=>t,vR=t=>t,wR=t=>t,xR=t=>t;function Ix(){const t=e=>e;return new Proxy(t,{get(){return t}})}const Rt=Ix(),R0=Ix(),M0=t=>t,Ox=(...t)=>Sl({},...t.map(N0)),ER=/[^a-zA-Z0-9_\u0081-\uffff-]/g;function SR(t){return`${t}`.replace(ER,e=>`\\${e}`)}const AR=/[A-Z]/g;function kR(t){return t.replace(AR,e=>`-${e.toLowerCase()}`)}function Tx(t,e={}){const{fallback:n="",prefix:r=""}=e,i=kR(["-",r,SR(t)].filter(Boolean).join("-"));return{var:i,ref:`var(${i}${n?`, ${n}`:""})`}}const CR=t=>/^var\(--.+\)$/.test(t),an=(t,e)=>e!=null?`${t}(${e})`:e,ea=t=>{if(CR(t)||t==null)return t;const e=typeof t=="string"&&!t.endsWith("deg");return typeof t=="number"||e?`${t}deg`:t},Px=t=>({values:["outside","inside","mixed","none"],transform(e,{token:n}){var o;const r=n("colors.colorPalette.focusRing");return(o={inside:{"--focus-ring-color":r,[t]:{outlineOffset:"0px",outlineWidth:"var(--focus-ring-width, 1px)",outlineColor:"var(--focus-ring-color)",outlineStyle:"var(--focus-ring-style, solid)",borderColor:"var(--focus-ring-color)"}},outside:{"--focus-ring-color":r,[t]:{outlineWidth:"var(--focus-ring-width, 2px)",outlineOffset:"var(--focus-ring-offset, 2px)",outlineStyle:"var(--focus-ring-style, solid)",outlineColor:"var(--focus-ring-color)"}},mixed:{"--focus-ring-color":r,[t]:{outlineWidth:"var(--focus-ring-width, 3px)",outlineStyle:"var(--focus-ring-style, solid)",outlineColor:"color-mix(in srgb, var(--focus-ring-color), transparent 60%)",borderColor:"var(--focus-ring-color)"}},none:{"--focus-ring-color":r,[t]:{outline:"none"}}}[e])!=null?o:{}}}),IR=ct("borderColor"),to=t=>({transition:t,transitionTimingFunction:"cubic-bezier(0.4, 0, 0.2, 1)",transitionDuration:"150ms"}),OR=mR({hover:["@media (hover: hover)","&:is(:hover, [data-hover]):not(:disabled, [data-disabled])"],active:"&:is(:active, [data-active]):not(:disabled, [data-disabled], [data-state=open])",focus:"&:is(:focus, [data-focus])",focusWithin:"&:is(:focus-within, [data-focus-within])",focusVisible:"&:is(:focus-visible, [data-focus-visible])",disabled:"&:is(:disabled, [disabled], [data-disabled], [aria-disabled=true])",visited:"&:visited",target:"&:target",readOnly:"&:is([data-readonly], [aria-readonly=true], [readonly])",readWrite:"&:read-write",empty:"&:is(:empty, [data-empty])",checked:"&:is(:checked, [data-checked], [aria-checked=true], [data-state=checked])",enabled:"&:enabled",expanded:"&:is([aria-expanded=true], [data-expanded], [data-state=expanded])",highlighted:"&[data-highlighted]",complete:"&[data-complete]",incomplete:"&[data-incomplete]",dragging:"&[data-dragging]",before:"&::before",after:"&::after",firstLetter:"&::first-letter",firstLine:"&::first-line",marker:"&::marker",selection:"&::selection",file:"&::file-selector-button",backdrop:"&::backdrop",first:"&:first-of-type",last:"&:last-of-type",notFirst:"&:not(:first-of-type)",notLast:"&:not(:last-of-type)",only:"&:only-child",even:"&:nth-of-type(even)",odd:"&:nth-of-type(odd)",peerFocus:".peer:is(:focus, [data-focus]) ~ &",peerHover:".peer:is(:hover, [data-hover]):not(:disabled, [data-disabled]) ~ &",peerActive:".peer:is(:active, [data-active]):not(:disabled, [data-disabled]) ~ &",peerFocusWithin:".peer:focus-within ~ &",peerFocusVisible:".peer:is(:focus-visible, [data-focus-visible]) ~ &",peerDisabled:".peer:is(:disabled, [disabled], [data-disabled]) ~ &",peerChecked:".peer:is(:checked, [data-checked], [aria-checked=true], [data-state=checked]) ~ &",peerInvalid:".peer:is(:invalid, [data-invalid], [aria-invalid=true]) ~ &",peerExpanded:".peer:is([aria-expanded=true], [data-expanded], [data-state=expanded]) ~ &",peerPlaceholderShown:".peer:placeholder-shown ~ &",groupFocus:".group:is(:focus, [data-focus]) &",groupHover:".group:is(:hover, [data-hover]):not(:disabled, [data-disabled]) &",groupActive:".group:is(:active, [data-active]):not(:disabled, [data-disabled]) &",groupFocusWithin:".group:focus-within &",groupFocusVisible:".group:is(:focus-visible, [data-focus-visible]) &",groupDisabled:".group:is(:disabled, [disabled], [data-disabled]) &",groupChecked:".group:is(:checked, [data-checked], [aria-checked=true], [data-state=checked]) &",groupExpanded:".group:is([aria-expanded=true], [data-expanded], [data-state=expanded]) &",groupInvalid:".group:invalid &",indeterminate:"&:is(:indeterminate, [data-indeterminate], [aria-checked=mixed], [data-state=indeterminate])",required:"&:is([data-required], [aria-required=true])",valid:"&:is([data-valid], [data-state=valid])",invalid:"&:is([data-invalid], [aria-invalid=true], [data-state=invalid])",autofill:"&:autofill",inRange:"&:is(:in-range, [data-in-range])",outOfRange:"&:is(:out-of-range, [data-outside-range])",placeholder:"&::placeholder, &[data-placeholder]",placeholderShown:"&:is(:placeholder-shown, [data-placeholder-shown])",pressed:"&:is([aria-pressed=true], [data-pressed])",selected:"&:is([aria-selected=true], [data-selected])",grabbed:"&:is([aria-grabbed=true], [data-grabbed])",underValue:"&[data-state=under-value]",overValue:"&[data-state=over-value]",atValue:"&[data-state=at-value]",default:"&:default",optional:"&:optional",open:"&:is([open], [data-open], [data-state=open])",closed:"&:is([closed], [data-closed], [data-state=closed])",fullscreen:"&is(:fullscreen, [data-fullscreen])",loading:"&:is([data-loading], [aria-busy=true])",hidden:"&:is([hidden], [data-hidden])",current:"&[data-current]",currentPage:"&[aria-current=page]",currentStep:"&[aria-current=step]",today:"&[data-today]",unavailable:"&[data-unavailable]",rangeStart:"&[data-range-start]",rangeEnd:"&[data-range-end]",now:"&[data-now]",topmost:"&[data-topmost]",motionReduce:"@media (prefers-reduced-motion: reduce)",motionSafe:"@media (prefers-reduced-motion: no-preference)",print:"@media print",landscape:"@media (orientation: landscape)",portrait:"@media (orientation: portrait)",dark:".dark &, .dark .chakra-theme:not(.light) &",light:":root &, .light &",osDark:"@media (prefers-color-scheme: dark)",osLight:"@media (prefers-color-scheme: light)",highContrast:"@media (forced-colors: active)",lessContrast:"@media (prefers-contrast: less)",moreContrast:"@media (prefers-contrast: more)",ltr:"[dir=ltr] &",rtl:"[dir=rtl] &",scrollbar:"&::-webkit-scrollbar",scrollbarThumb:"&::-webkit-scrollbar-thumb",scrollbarTrack:"&::-webkit-scrollbar-track",horizontal:"&[data-orientation=horizontal]",vertical:"&[data-orientation=vertical]",icon:"& :where(svg)",starting:"@starting-style"}),kl=Tx("bg-currentcolor"),Nx=t=>t===kl.ref||t==="currentBg",ut=t=>({...t("colors"),currentBg:kl}),TR=M0({conditions:OR,utilities:{background:{values:ut,shorthand:["bg"],transform(t,e){if(Nx(e.raw))return{background:kl.ref};const n=ct("background")(t,e);return{...n,[kl.var]:n==null?void 0:n.background}}},backgroundColor:{values:ut,shorthand:["bgColor"],transform(t,e){if(Nx(e.raw))return{backgroundColor:kl.ref};const n=ct("backgroundColor")(t,e);return{...n,[kl.var]:n==null?void 0:n.backgroundColor}}},backgroundSize:{shorthand:["bgSize"]},backgroundPosition:{shorthand:["bgPos"]},backgroundRepeat:{shorthand:["bgRepeat"]},backgroundAttachment:{shorthand:["bgAttachment"]},backgroundClip:{shorthand:["bgClip"],values:["text"],transform(t){return t==="text"?{color:"transparent",backgroundClip:"text"}:{backgroundClip:t}}},backgroundGradient:{shorthand:["bgGradient"],values(t){return{...t("gradients"),"to-t":"linear-gradient(to top, var(--gradient))","to-tr":"linear-gradient(to top right, var(--gradient))","to-r":"linear-gradient(to right, var(--gradient))","to-br":"linear-gradient(to bottom right, var(--gradient))","to-b":"linear-gradient(to bottom, var(--gradient))","to-bl":"linear-gradient(to bottom left, var(--gradient))","to-l":"linear-gradient(to left, var(--gradient))","to-tl":"linear-gradient(to top left, var(--gradient))"}},transform(t){return{"--gradient-stops":"var(--gradient-from), var(--gradient-to)","--gradient":"var(--gradient-via-stops, var(--gradient-stops))",backgroundImage:t}}},gradientFrom:{values:ut,transform:ct("--gradient-from")},gradientTo:{values:ut,transform:ct("--gradient-to")},gradientVia:{values:ut,transform(t,e){return{...ct("--gradient-via")(t,e),"--gradient-via-stops":"var(--gradient-from), var(--gradient-via), var(--gradient-to)"}}},backgroundImage:{values(t){return{...t("gradients"),...t("assets")}},shorthand:["bgImg","bgImage"]},border:{values:"borders"},borderTop:{values:"borders"},borderLeft:{values:"borders"},borderBlockStart:{values:"borders"},borderRight:{values:"borders"},borderBottom:{values:"borders"},borderBlockEnd:{values:"borders"},borderInlineStart:{values:"borders",shorthand:["borderStart"]},borderInlineEnd:{values:"borders",shorthand:["borderEnd"]},borderInline:{values:"borders",shorthand:["borderX"]},borderBlock:{values:"borders",shorthand:["borderY"]},borderColor:{values:ut,transform:ct("borderColor")},borderTopColor:{values:ut,transform:ct("borderTopColor")},borderBlockStartColor:{values:ut,transform:ct("borderBlockStartColor")},borderBottomColor:{values:ut,transform:ct("borderBottomColor")},borderBlockEndColor:{values:ut,transform:ct("borderBlockEndColor")},borderLeftColor:{values:ut,transform:ct("borderLeftColor")},borderInlineStartColor:{values:ut,shorthand:["borderStartColor"],transform:ct("borderInlineStartColor")},borderRightColor:{values:ut,transform:ct("borderRightColor")},borderInlineEndColor:{values:ut,shorthand:["borderEndColor"],transform:ct("borderInlineEndColor")},borderStyle:{values:"borderStyles"},borderTopStyle:{values:"borderStyles"},borderBlockStartStyle:{values:"borderStyles"},borderBottomStyle:{values:"borderStyles"},borderBlockEndStyle:{values:"borderStyles"},borderInlineStartStyle:{values:"borderStyles",shorthand:["borderStartStyle"]},borderInlineEndStyle:{values:"borderStyles",shorthand:["borderEndStyle"]},borderLeftStyle:{values:"borderStyles"},borderRightStyle:{values:"borderStyles"},borderRadius:{values:"radii",shorthand:["rounded"]},borderTopLeftRadius:{values:"radii",shorthand:["roundedTopLeft"]},borderStartStartRadius:{values:"radii",shorthand:["roundedStartStart","borderTopStartRadius"]},borderEndStartRadius:{values:"radii",shorthand:["roundedEndStart","borderBottomStartRadius"]},borderTopRightRadius:{values:"radii",shorthand:["roundedTopRight"]},borderStartEndRadius:{values:"radii",shorthand:["roundedStartEnd","borderTopEndRadius"]},borderEndEndRadius:{values:"radii",shorthand:["roundedEndEnd","borderBottomEndRadius"]},borderBottomLeftRadius:{values:"radii",shorthand:["roundedBottomLeft"]},borderBottomRightRadius:{values:"radii",shorthand:["roundedBottomRight"]},borderInlineStartRadius:{values:"radii",property:"borderRadius",shorthand:["roundedStart","borderStartRadius"],transform:t=>({borderStartStartRadius:t,borderEndStartRadius:t})},borderInlineEndRadius:{values:"radii",property:"borderRadius",shorthand:["roundedEnd","borderEndRadius"],transform:t=>({borderStartEndRadius:t,borderEndEndRadius:t})},borderTopRadius:{values:"radii",property:"borderRadius",shorthand:["roundedTop"],transform:t=>({borderTopLeftRadius:t,borderTopRightRadius:t})},borderBottomRadius:{values:"radii",property:"borderRadius",shorthand:["roundedBottom"],transform:t=>({borderBottomLeftRadius:t,borderBottomRightRadius:t})},borderLeftRadius:{values:"radii",property:"borderRadius",shorthand:["roundedLeft"],transform:t=>({borderTopLeftRadius:t,borderBottomLeftRadius:t})},borderRightRadius:{values:"radii",property:"borderRadius",shorthand:["roundedRight"],transform:t=>({borderTopRightRadius:t,borderBottomRightRadius:t})},borderWidth:{values:"borderWidths"},borderBlockStartWidth:{values:"borderWidths"},borderTopWidth:{values:"borderWidths"},borderBottomWidth:{values:"borderWidths"},borderBlockEndWidth:{values:"borderWidths"},borderRightWidth:{values:"borderWidths"},borderInlineWidth:{values:"borderWidths",shorthand:["borderXWidth"]},borderInlineStartWidth:{values:"borderWidths",shorthand:["borderStartWidth"]},borderInlineEndWidth:{values:"borderWidths",shorthand:["borderEndWidth"]},borderLeftWidth:{values:"borderWidths"},borderBlockWidth:{values:"borderWidths",shorthand:["borderYWidth"]},color:{values:ut,transform:ct("color")},fill:{values:ut,transform:ct("fill")},stroke:{values:ut,transform:ct("stroke")},accentColor:{values:ut,transform:ct("accentColor")},divideX:{values:{type:"string"},transform(t){return{"& > :not(style, [hidden]) ~ :not(style, [hidden])":{borderInlineStartWidth:t,borderInlineEndWidth:"0px"}}}},divideY:{values:{type:"string"},transform(t){return{"& > :not(style, [hidden]) ~ :not(style, [hidden])":{borderTopWidth:t,borderBottomWidth:"0px"}}}},divideColor:{values:ut,transform(t,e){return{"& > :not(style, [hidden]) ~ :not(style, [hidden])":IR(t,e)}}},divideStyle:{property:"borderStyle",transform(t){return{"& > :not(style, [hidden]) ~ :not(style, [hidden])":{borderStyle:t}}}},boxShadow:{values:"shadows",shorthand:["shadow"]},boxShadowColor:{values:ut,transform:ct("--shadow-color"),shorthand:["shadowColor"]},mixBlendMode:{shorthand:["blendMode"]},backgroundBlendMode:{shorthand:["bgBlendMode"]},opacity:{values:"opacity"},filter:{transform(t){return t!=="auto"?{filter:t}:{filter:"var(--blur) var(--brightness) var(--contrast) var(--grayscale) var(--hue-rotate) var(--invert) var(--saturate) var(--sepia) var(--drop-shadow)"}}},blur:{values:"blurs",transform:t=>({"--blur":an("blur",t)})},brightness:{transform:t=>({"--brightness":an("brightness",t)})},contrast:{transform:t=>({"--contrast":an("contrast",t)})},grayscale:{transform:t=>({"--grayscale":an("grayscale",t)})},hueRotate:{transform:t=>({"--hue-rotate":an("hue-rotate",ea(t))})},invert:{transform:t=>({"--invert":an("invert",t)})},saturate:{transform:t=>({"--saturate":an("saturate",t)})},sepia:{transform:t=>({"--sepia":an("sepia",t)})},dropShadow:{transform:t=>({"--drop-shadow":an("drop-shadow",t)})},backdropFilter:{transform(t){return t!=="auto"?{backdropFilter:t}:{backdropFilter:"var(--backdrop-blur) var(--backdrop-brightness) var(--backdrop-contrast) var(--backdrop-grayscale) var(--backdrop-hue-rotate) var(--backdrop-invert) var(--backdrop-opacity) var(--backdrop-saturate) var(--backdrop-sepia)"}}},backdropBlur:{values:"blurs",transform:t=>({"--backdrop-blur":an("blur",t)})},backdropBrightness:{transform:t=>({"--backdrop-brightness":an("brightness",t)})},backdropContrast:{transform:t=>({"--backdrop-contrast":an("contrast",t)})},backdropGrayscale:{transform:t=>({"--backdrop-grayscale":an("grayscale",t)})},backdropHueRotate:{transform:t=>({"--backdrop-hue-rotate":an("hue-rotate",ea(t))})},backdropInvert:{transform:t=>({"--backdrop-invert":an("invert",t)})},backdropOpacity:{transform:t=>({"--backdrop-opacity":an("opacity",t)})},backdropSaturate:{transform:t=>({"--backdrop-saturate":an("saturate",t)})},backdropSepia:{transform:t=>({"--backdrop-sepia":an("sepia",t)})},flexBasis:{values:"sizes"},gap:{values:"spacing"},rowGap:{values:"spacing",shorthand:["gapY"]},columnGap:{values:"spacing",shorthand:["gapX"]},flexDirection:{shorthand:["flexDir"]},gridGap:{values:"spacing"},gridColumnGap:{values:"spacing"},gridRowGap:{values:"spacing"},outlineColor:{values:ut,transform:ct("outlineColor")},focusRing:Px("&:is(:focus, [data-focus])"),focusVisibleRing:Px("&:is(:focus-visible, [data-focus-visible])"),focusRingColor:{values:ut,transform:ct("--focus-ring-color")},focusRingOffset:{values:"spacing",transform:t=>({"--focus-ring-offset":t})},focusRingWidth:{values:"borderWidths",property:"outlineWidth",transform:t=>({"--focus-ring-width":t})},focusRingStyle:{values:"borderStyles",property:"outlineStyle",transform:t=>({"--focus-ring-style":t})},aspectRatio:{values:"aspectRatios"},width:{values:"sizes",shorthand:["w"]},inlineSize:{values:"sizes"},height:{values:"sizes",shorthand:["h"]},blockSize:{values:"sizes"},boxSize:{values:"sizes",property:"width",transform:t=>({width:t,height:t})},minWidth:{values:"sizes",shorthand:["minW"]},minInlineSize:{values:"sizes"},minHeight:{values:"sizes",shorthand:["minH"]},minBlockSize:{values:"sizes"},maxWidth:{values:"sizes",shorthand:["maxW"]},maxInlineSize:{values:"sizes"},maxHeight:{values:"sizes",shorthand:["maxH"]},maxBlockSize:{values:"sizes"},hideFrom:{values:"breakpoints",transform:(t,{raw:e,token:n})=>({[n.raw(`breakpoints.${e}`)?`@breakpoint ${e}`:`@media screen and (min-width: ${t})`]:{display:"none"}})},hideBelow:{values:"breakpoints",transform(t,{raw:e,token:n}){return{[n.raw(`breakpoints.${e}`)?`@breakpoint ${e}Down`:`@media screen and (max-width: ${t})`]:{display:"none"}}}},overscrollBehavior:{shorthand:["overscroll"]},overscrollBehaviorX:{shorthand:["overscrollX"]},overscrollBehaviorY:{shorthand:["overscrollY"]},scrollbar:{values:["visible","hidden"],transform(t){switch(t){case"visible":return{msOverflowStyle:"auto",scrollbarWidth:"auto","&::-webkit-scrollbar":{display:"block"}};case"hidden":return{msOverflowStyle:"none",scrollbarWidth:"none","&::-webkit-scrollbar":{display:"none"}};default:return{}}}},scrollbarColor:{values:ut,transform:ct("scrollbarColor")},scrollbarGutter:{values:"spacing"},scrollbarWidth:{values:"sizes"},scrollMargin:{values:"spacing"},scrollMarginTop:{values:"spacing"},scrollMarginBottom:{values:"spacing"},scrollMarginLeft:{values:"spacing"},scrollMarginRight:{values:"spacing"},scrollMarginX:{values:"spacing",transform:t=>({scrollMarginLeft:t,scrollMarginRight:t})},scrollMarginY:{values:"spacing",transform:t=>({scrollMarginTop:t,scrollMarginBottom:t})},scrollPadding:{values:"spacing"},scrollPaddingTop:{values:"spacing"},scrollPaddingBottom:{values:"spacing"},scrollPaddingLeft:{values:"spacing"},scrollPaddingRight:{values:"spacing"},scrollPaddingInline:{values:"spacing",shorthand:["scrollPaddingX"]},scrollPaddingBlock:{values:"spacing",shorthand:["scrollPaddingY"]},scrollSnapType:{values:{none:"none",x:"x var(--scroll-snap-strictness)",y:"y var(--scroll-snap-strictness)",both:"both var(--scroll-snap-strictness)"}},scrollSnapStrictness:{values:["mandatory","proximity"],transform:t=>({"--scroll-snap-strictness":t})},scrollSnapMargin:{values:"spacing"},scrollSnapMarginTop:{values:"spacing"},scrollSnapMarginBottom:{values:"spacing"},scrollSnapMarginLeft:{values:"spacing"},scrollSnapMarginRight:{values:"spacing"},listStylePosition:{shorthand:["listStylePos"]},listStyleImage:{values:"assets",shorthand:["listStyleImg"]},position:{shorthand:["pos"]},zIndex:{values:"zIndex"},inset:{values:"spacing"},insetInline:{values:"spacing",shorthand:["insetX"]},insetBlock:{values:"spacing",shorthand:["insetY"]},top:{values:"spacing"},insetBlockStart:{values:"spacing"},bottom:{values:"spacing"},insetBlockEnd:{values:"spacing"},left:{values:"spacing"},right:{values:"spacing"},insetInlineStart:{values:"spacing",shorthand:["insetStart"]},insetInlineEnd:{values:"spacing",shorthand:["insetEnd"]},ring:{transform(t){return{"--ring-offset-shadow":"var(--ring-inset) 0 0 0 var(--ring-offset-width) var(--ring-offset-color)","--ring-shadow":"var(--ring-inset) 0 0 0 calc(var(--ring-width) + var(--ring-offset-width)) var(--ring-color)","--ring-width":t,boxShadow:"var(--ring-offset-shadow), var(--ring-shadow), var(--shadow, 0 0 #0000)"}}},ringColor:{values:ut,transform:ct("--ring-color")},ringOffset:{transform:t=>({"--ring-offset-width":t})},ringOffsetColor:{values:ut,transform:ct("--ring-offset-color")},ringInset:{transform:t=>({"--ring-inset":t})},margin:{values:"spacing",shorthand:["m"]},marginTop:{values:"spacing",shorthand:["mt"]},marginBlockStart:{values:"spacing"},marginRight:{values:"spacing",shorthand:["mr"]},marginBottom:{values:"spacing",shorthand:["mb"]},marginBlockEnd:{values:"spacing"},marginLeft:{values:"spacing",shorthand:["ml"]},marginInlineStart:{values:"spacing",shorthand:["ms","marginStart"]},marginInlineEnd:{values:"spacing",shorthand:["me","marginEnd"]},marginInline:{values:"spacing",shorthand:["mx","marginX"]},marginBlock:{values:"spacing",shorthand:["my","marginY"]},padding:{values:"spacing",shorthand:["p"]},paddingTop:{values:"spacing",shorthand:["pt"]},paddingRight:{values:"spacing",shorthand:["pr"]},paddingBottom:{values:"spacing",shorthand:["pb"]},paddingBlockStart:{values:"spacing"},paddingBlockEnd:{values:"spacing"},paddingLeft:{values:"spacing",shorthand:["pl"]},paddingInlineStart:{values:"spacing",shorthand:["ps","paddingStart"]},paddingInlineEnd:{values:"spacing",shorthand:["pe","paddingEnd"]},paddingInline:{values:"spacing",shorthand:["px","paddingX"]},paddingBlock:{values:"spacing",shorthand:["py","paddingY"]},textDecoration:{shorthand:["textDecor"]},textDecorationColor:{values:ut,transform:ct("textDecorationColor")},textShadow:{values:"shadows"},transform:{transform:t=>{let e=t;return t==="auto"&&(e="translateX(var(--translate-x, 0)) translateY(var(--translate-y, 0)) rotate(var(--rotate, 0)) scaleX(var(--scale-x, 1)) scaleY(var(--scale-y, 1)) skewX(var(--skew-x, 0)) skewY(var(--skew-y, 0))"),t==="auto-gpu"&&(e="translate3d(var(--translate-x, 0), var(--translate-y, 0), 0) rotate(var(--rotate, 0)) scaleX(var(--scale-x, 1)) scaleY(var(--scale-y, 1)) skewX(var(--skew-x, 0)) skewY(var(--skew-y, 0))"),{transform:e}}},skewX:{transform:t=>({"--skew-x":ea(t)})},skewY:{transform:t=>({"--skew-y":ea(t)})},scaleX:{transform:t=>({"--scale-x":t})},scaleY:{transform:t=>({"--scale-y":t})},scale:{transform(t){return t!=="auto"?{scale:t}:{scale:"var(--scale-x, 1) var(--scale-y, 1)"}}},spaceXReverse:{values:{type:"boolean"},transform(t){return{"& > :not(style, [hidden]) ~ :not(style, [hidden])":{"--space-x-reverse":t?"1":void 0}}}},spaceX:{property:"marginInlineStart",values:"spacing",transform:t=>({"& > :not(style, [hidden]) ~ :not(style, [hidden])":{"--space-x-reverse":"0",marginInlineStart:`calc(${t} * calc(1 - var(--space-x-reverse)))`,marginInlineEnd:`calc(${t} * var(--space-x-reverse))`}})},spaceYReverse:{values:{type:"boolean"},transform(t){return{"& > :not(style, [hidden]) ~ :not(style, [hidden])":{"--space-y-reverse":t?"1":void 0}}}},spaceY:{property:"marginTop",values:"spacing",transform:t=>({"& > :not(style, [hidden]) ~ :not(style, [hidden])":{"--space-y-reverse":"0",marginTop:`calc(${t} * calc(1 - var(--space-y-reverse)))`,marginBottom:`calc(${t} * var(--space-y-reverse))`}})},rotate:{transform(t){return t!=="auto"?{rotate:ea(t)}:{rotate:"var(--rotate-x, 0) var(--rotate-y, 0) var(--rotate-z, 0)"}}},rotateX:{transform(t){return{"--rotate-x":ea(t)}}},rotateY:{transform(t){return{"--rotate-y":ea(t)}}},translate:{transform(t){return t!=="auto"?{translate:t}:{translate:"var(--translate-x) var(--translate-y)"}}},translateX:{values:"spacing",transform:t=>({"--translate-x":t})},translateY:{values:"spacing",transform:t=>({"--translate-y":t})},transition:{values:["all","common","colors","opacity","position","backgrounds","size","shadow","transform"],transform(t){switch(t){case"all":return to("all");case"position":return to("left, right, top, bottom, inset-inline, inset-block");case"colors":return to("color, background-color, border-color, text-decoration-color, fill, stroke");case"opacity":return to("opacity");case"shadow":return to("box-shadow");case"transform":return to("transform");case"size":return to("width, height");case"backgrounds":return to("background, background-color, background-image, background-position");case"common":return to("color, background-color, border-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, backdrop-filter");default:return{transition:t}}}},transitionDuration:{values:"durations"},transitionProperty:{values:{common:"background-color, border-color, color, fill, stroke, opacity, box-shadow, translate, transform",colors:"background-color, border-color, color, fill, stroke",size:"width, height",position:"left, right, top, bottom, inset-inline, inset-block",background:"background, background-color, background-image, background-position"}},transitionTimingFunction:{values:"easings"},animation:{values:"animations"},animationDuration:{values:"durations"},animationDelay:{values:"durations"},animationTimingFunction:{values:"easings"},fontFamily:{values:"fonts"},fontSize:{values:"fontSizes"},fontWeight:{values:"fontWeights"},lineHeight:{values:"lineHeights"},letterSpacing:{values:"letterSpacings"},textIndent:{values:"spacing"},truncate:{values:{type:"boolean"},transform(t){return t===!0?{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}:{}}},lineClamp:{transform(t){return t==="none"?{WebkitLineClamp:"unset"}:{overflow:"hidden",display:"-webkit-box",WebkitLineClamp:t,WebkitBoxOrient:"vertical",textWrap:"wrap"}}},srOnly:{values:{type:"boolean"},transform(t){return PR[t]||{}}},debug:{values:{type:"boolean"},transform(t){return t?{outline:"1px solid blue !important","& > *":{outline:"1px solid red !important"}}:{}}},caretColor:{values:ut,transform:ct("caretColor")},cursor:{values:"cursor"}}}),PR={true:{position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"},false:{position:"static",width:"auto",height:"auto",padding:"0",margin:"0",overflow:"visible",clip:"auto",whiteSpace:"normal"}};var NR="",BR=NR.split(","),RR="WebkitAppearance,WebkitBorderBefore,WebkitBorderBeforeColor,WebkitBorderBeforeStyle,WebkitBorderBeforeWidth,WebkitBoxReflect,WebkitLineClamp,WebkitMask,WebkitMaskAttachment,WebkitMaskClip,WebkitMaskComposite,WebkitMaskImage,WebkitMaskOrigin,WebkitMaskPosition,WebkitMaskPositionX,WebkitMaskPositionY,WebkitMaskRepeat,WebkitMaskRepeatX,WebkitMaskRepeatY,WebkitMaskSize,WebkitOverflowScrolling,WebkitTapHighlightColor,WebkitTextFillColor,WebkitTextStroke,WebkitTextStrokeColor,WebkitTextStrokeWidth,WebkitTouchCallout,WebkitUserModify,WebkitUserSelect,accentColor,alignContent,alignItems,alignSelf,alignTracks,all,anchorName,anchorScope,animation,animationComposition,animationDelay,animationDirection,animationDuration,animationFillMode,animationIterationCount,animationName,animationPlayState,animationRange,animationRangeEnd,animationRangeStart,animationTimeline,animationTimingFunction,appearance,aspectRatio,backdropFilter,backfaceVisibility,background,backgroundAttachment,backgroundBlendMode,backgroundClip,backgroundColor,backgroundImage,backgroundOrigin,backgroundPosition,backgroundPositionX,backgroundPositionY,backgroundRepeat,backgroundSize,blockSize,border,borderBlock,borderBlockColor,borderBlockEnd,borderBlockEndColor,borderBlockEndStyle,borderBlockEndWidth,borderBlockStart,borderBlockStartColor,borderBlockStartStyle,borderBlockStartWidth,borderBlockStyle,borderBlockWidth,borderBottom,borderBottomColor,borderBottomLeftRadius,borderBottomRightRadius,borderBottomStyle,borderBottomWidth,borderCollapse,borderColor,borderEndEndRadius,borderEndStartRadius,borderImage,borderImageOutset,borderImageRepeat,borderImageSlice,borderImageSource,borderImageWidth,borderInline,borderInlineColor,borderInlineEnd,borderInlineEndColor,borderInlineEndStyle,borderInlineEndWidth,borderInlineStart,borderInlineStartColor,borderInlineStartStyle,borderInlineStartWidth,borderInlineStyle,borderInlineWidth,borderLeft,borderLeftColor,borderLeftStyle,borderLeftWidth,borderRadius,borderRight,borderRightColor,borderRightStyle,borderRightWidth,borderSpacing,borderStartEndRadius,borderStartStartRadius,borderStyle,borderTop,borderTopColor,borderTopLeftRadius,borderTopRightRadius,borderTopStyle,borderTopWidth,borderWidth,bottom,boxAlign,boxDecorationBreak,boxDirection,boxFlex,boxFlexGroup,boxLines,boxOrdinalGroup,boxOrient,boxPack,boxShadow,boxSizing,breakAfter,breakBefore,breakInside,captionSide,caret,caretColor,caretShape,clear,clip,clipPath,clipRule,color,colorInterpolationFilters,colorScheme,columnCount,columnFill,columnGap,columnRule,columnRuleColor,columnRuleStyle,columnRuleWidth,columnSpan,columnWidth,columns,contain,containIntrinsicBlockSize,containIntrinsicHeight,containIntrinsicInlineSize,containIntrinsicSize,containIntrinsicWidth,container,containerName,containerType,content,contentVisibility,counterIncrement,counterReset,counterSet,cursor,cx,cy,d,direction,display,dominantBaseline,emptyCells,fieldSizing,fill,fillOpacity,fillRule,filter,flex,flexBasis,flexDirection,flexFlow,flexGrow,flexShrink,flexWrap,float,floodColor,floodOpacity,font,fontFamily,fontFeatureSettings,fontKerning,fontLanguageOverride,fontOpticalSizing,fontPalette,fontSize,fontSizeAdjust,fontSmooth,fontStretch,fontStyle,fontSynthesis,fontSynthesisPosition,fontSynthesisSmallCaps,fontSynthesisStyle,fontSynthesisWeight,fontVariant,fontVariantAlternates,fontVariantCaps,fontVariantEastAsian,fontVariantEmoji,fontVariantLigatures,fontVariantNumeric,fontVariantPosition,fontVariationSettings,fontWeight,forcedColorAdjust,gap,grid,gridArea,gridAutoColumns,gridAutoFlow,gridAutoRows,gridColumn,gridColumnEnd,gridColumnGap,gridColumnStart,gridGap,gridRow,gridRowEnd,gridRowGap,gridRowStart,gridTemplate,gridTemplateAreas,gridTemplateColumns,gridTemplateRows,hangingPunctuation,height,hyphenateCharacter,hyphenateLimitChars,hyphens,imageOrientation,imageRendering,imageResolution,imeMode,initialLetter,initialLetterAlign,inlineSize,inset,insetBlock,insetBlockEnd,insetBlockStart,insetInline,insetInlineEnd,insetInlineStart,interpolateSize,isolation,justifyContent,justifyItems,justifySelf,justifyTracks,left,letterSpacing,lightingColor,lineBreak,lineClamp,lineHeight,lineHeightStep,listStyle,listStyleImage,listStylePosition,listStyleType,margin,marginBlock,marginBlockEnd,marginBlockStart,marginBottom,marginInline,marginInlineEnd,marginInlineStart,marginLeft,marginRight,marginTop,marginTrim,marker,markerEnd,markerMid,markerStart,mask,maskBorder,maskBorderMode,maskBorderOutset,maskBorderRepeat,maskBorderSlice,maskBorderSource,maskBorderWidth,maskClip,maskComposite,maskImage,maskMode,maskOrigin,maskPosition,maskRepeat,maskSize,maskType,masonryAutoFlow,mathDepth,mathShift,mathStyle,maxBlockSize,maxHeight,maxInlineSize,maxLines,maxWidth,minBlockSize,minHeight,minInlineSize,minWidth,mixBlendMode,objectFit,objectPosition,offset,offsetAnchor,offsetDistance,offsetPath,offsetPosition,offsetRotate,opacity,order,orphans,outline,outlineColor,outlineOffset,outlineStyle,outlineWidth,overflow,overflowAnchor,overflowBlock,overflowClipBox,overflowClipMargin,overflowInline,overflowWrap,overflowX,overflowY,overlay,overscrollBehavior,overscrollBehaviorBlock,overscrollBehaviorInline,overscrollBehaviorX,overscrollBehaviorY,padding,paddingBlock,paddingBlockEnd,paddingBlockStart,paddingBottom,paddingInline,paddingInlineEnd,paddingInlineStart,paddingLeft,paddingRight,paddingTop,page,pageBreakAfter,pageBreakBefore,pageBreakInside,paintOrder,perspective,perspectiveOrigin,placeContent,placeItems,placeSelf,pointerEvents,position,positionAnchor,positionArea,positionTry,positionTryFallbacks,positionTryOrder,positionVisibility,printColorAdjust,quotes,r,resize,right,rotate,rowGap,rubyAlign,rubyMerge,rubyPosition,rx,ry,scale,scrollBehavior,scrollMargin,scrollMarginBlock,scrollMarginBlockEnd,scrollMarginBlockStart,scrollMarginBottom,scrollMarginInline,scrollMarginInlineEnd,scrollMarginInlineStart,scrollMarginLeft,scrollMarginRight,scrollMarginTop,scrollPadding,scrollPaddingBlock,scrollPaddingBlockEnd,scrollPaddingBlockStart,scrollPaddingBottom,scrollPaddingInline,scrollPaddingInlineEnd,scrollPaddingInlineStart,scrollPaddingLeft,scrollPaddingRight,scrollPaddingTop,scrollSnapAlign,scrollSnapCoordinate,scrollSnapDestination,scrollSnapPointsX,scrollSnapPointsY,scrollSnapStop,scrollSnapType,scrollSnapTypeX,scrollSnapTypeY,scrollTimeline,scrollTimelineAxis,scrollTimelineName,scrollbarColor,scrollbarGutter,scrollbarWidth,shapeImageThreshold,shapeMargin,shapeOutside,shapeRendering,stopColor,stopOpacity,stroke,strokeDasharray,strokeDashoffset,strokeLinecap,strokeLinejoin,strokeMiterlimit,strokeOpacity,strokeWidth,tabSize,tableLayout,textAlign,textAlignLast,textAnchor,textBox,textBoxEdge,textBoxTrim,textCombineUpright,textDecoration,textDecorationColor,textDecorationLine,textDecorationSkip,textDecorationSkipInk,textDecorationStyle,textDecorationThickness,textEmphasis,textEmphasisColor,textEmphasisPosition,textEmphasisStyle,textIndent,textJustify,textOrientation,textOverflow,textRendering,textShadow,textSizeAdjust,textSpacingTrim,textTransform,textUnderlineOffset,textUnderlinePosition,textWrap,textWrapMode,textWrapStyle,timelineScope,top,touchAction,transform,transformBox,transformOrigin,transformStyle,transition,transitionBehavior,transitionDelay,transitionDuration,transitionProperty,transitionTimingFunction,translate,unicodeBidi,userSelect,vectorEffect,verticalAlign,viewTimeline,viewTimelineAxis,viewTimelineInset,viewTimelineName,viewTransitionName,visibility,whiteSpace,whiteSpaceCollapse,widows,width,willChange,wordBreak,wordSpacing,wordWrap,writingMode,x,y,zIndex,zoom,alignmentBaseline,baselineShift,colorInterpolation,colorRendering,glyphOrientationVertical",MR=RR.split(",").concat(BR),LR=new Map(MR.map(t=>[t,!0]));function FR(t){const e=Object.create(null);return n=>(e[n]===void 0&&(e[n]=t(n)),e[n])}var _R=/&|@/,VR=FR(t=>LR.has(t)||t.startsWith("--")||_R.test(t));const L0=t=>t!=null;function no(t,e,n={}){const{stop:r,getKey:i}=n;function o(s,a=[]){var l;if(Qn(s)||Array.isArray(s)){const c={};for(const[u,d]of Object.entries(s)){const h=(l=i==null?void 0:i(u,d))!=null?l:u,g=[...a,h];if(r!=null&&r(s,g))return e(s,a);const b=o(d,g);L0(b)&&(c[h]=b)}return c}return e(s,a)}return o(t)}function Bx(t,e){return Array.isArray(t)?t.map(n=>L0(n)?e(n):n):Qn(t)?no(t,n=>e(n)):L0(t)?e(t):t}function Rx(t,e){const n={};return no(t,(r,i)=>{r&&(n[i.join(".")]=r.value)},{stop:e}),n}var F0,Mx;function DR(){if(Mx)return F0;Mx=1,F0=o,o.default=o,o.stable=c,o.stableStringify=c;var t="[...]",e="[Circular]",n=[],r=[];function i(){return{depthLimit:Number.MAX_SAFE_INTEGER,edgesLimit:Number.MAX_SAFE_INTEGER}}function o(h,g,b,p){typeof p=="undefined"&&(p=i()),a(h,"",0,[],void 0,0,p);var w;try{r.length===0?w=JSON.stringify(h,g,b):w=JSON.stringify(h,d(g),b)}catch(O){return JSON.stringify("[unable to serialize, circular reference is too complex to analyze]")}finally{for(;n.length!==0;){var S=n.pop();S.length===4?Object.defineProperty(S[0],S[1],S[3]):S[0][S[1]]=S[2]}}return w}function s(h,g,b,p){var w=Object.getOwnPropertyDescriptor(p,b);w.get!==void 0?w.configurable?(Object.defineProperty(p,b,{value:h}),n.push([p,b,g,w])):r.push([g,b,h]):(p[b]=h,n.push([p,b,g]))}function a(h,g,b,p,w,S,O){S+=1;var T;if(typeof h=="object"&&h!==null){for(T=0;T<p.length;T++)if(p[T]===h){s(e,h,g,w);return}if(typeof O.depthLimit!="undefined"&&S>O.depthLimit){s(t,h,g,w);return}if(typeof O.edgesLimit!="undefined"&&b+1>O.edgesLimit){s(t,h,g,w);return}if(p.push(h),Array.isArray(h))for(T=0;T<h.length;T++)a(h[T],T,T,p,h,S,O);else{var $=Object.keys(h);for(T=0;T<$.length;T++){var R=$[T];a(h[R],R,T,p,h,S,O)}}p.pop()}}function l(h,g){return h<g?-1:h>g?1:0}function c(h,g,b,p){typeof p=="undefined"&&(p=i());var w=u(h,"",0,[],void 0,0,p)||h,S;try{r.length===0?S=JSON.stringify(w,g,b):S=JSON.stringify(w,d(g),b)}catch(T){return JSON.stringify("[unable to serialize, circular reference is too complex to analyze]")}finally{for(;n.length!==0;){var O=n.pop();O.length===4?Object.defineProperty(O[0],O[1],O[3]):O[0][O[1]]=O[2]}}return S}function u(h,g,b,p,w,S,O){S+=1;var T;if(typeof h=="object"&&h!==null){for(T=0;T<p.length;T++)if(p[T]===h){s(e,h,g,w);return}try{if(typeof h.toJSON=="function")return}catch(q){return}if(typeof O.depthLimit!="undefined"&&S>O.depthLimit){s(t,h,g,w);return}if(typeof O.edgesLimit!="undefined"&&b+1>O.edgesLimit){s(t,h,g,w);return}if(p.push(h),Array.isArray(h))for(T=0;T<h.length;T++)u(h[T],T,T,p,h,S,O);else{var $={},R=Object.keys(h).sort(l);for(T=0;T<R.length;T++){var j=R[T];u(h[j],j,T,p,h,S,O),$[j]=h[j]}if(typeof w!="undefined")n.push([w,g,h]),w[g]=$;else return $}p.pop()}}function d(h){return h=typeof h!="undefined"?h:function(g,b){return b},function(g,b){if(r.length>0)for(var p=0;p<r.length;p++){var w=r[p];if(w[1]===g&&w[0]===b){b=w[2],r.splice(p,1);break}}return h.call(this,g,b)}}return F0}var zR=DR();const UR=sl(zR),Qr=t=>{const e=Object.create(null);function n(...r){const i=r.map(o=>UR(o)).join("|");return e[i]===void 0&&(e[i]=t(...r)),e[i]}return n},Lx=16,th="px",_0="em",Lu="rem";function Fx(t=""){const e=new RegExp(String.raw`-?\d+(?:\.\d+|\d*)`),n=new RegExp(`${th}|${_0}|${Lu}`),r=t.match(new RegExp(`${e.source}(${n.source})`));return r==null?void 0:r[1]}function _x(t=""){if(typeof t=="number")return`${t}px`;const e=Fx(t);if(!e||e===th)return t;if(e===_0||e===Lu)return`${parseFloat(t)*Lx}${th}`}function Vx(t=""){const e=Fx(t);if(!e||e===Lu)return t;if(e===_0)return`${parseFloat(t)}${Lu}`;if(e===th)return`${parseFloat(t)/Lx}${Lu}`}const $R=t=>t.charAt(0).toUpperCase()+t.slice(1);function HR(t){const e=WR(t),n=Object.fromEntries(e);function r(h){return n[h]}function i(h){return Cl(r(h))}function o(){const h=Object.keys(n),g=GR(h),b=h.flatMap(p=>{const w=r(p),S=[`${p}Down`,Cl({max:nh(w.min)})],O=[p,Cl({min:w.min})],T=[`${p}Only`,i(p)];return[O,T,S]}).filter(([,p])=>p!=="").concat(g.map(([p,w])=>{const S=r(p),O=r(w);return[`${p}To${$R(w)}`,Cl({min:S.min,max:nh(O.min)})]}));return Object.fromEntries(b)}function s(){const h=o();return Object.fromEntries(Object.entries(h))}const a=s(),l=h=>a[h];function c(){return["base",...Object.keys(n)]}function u(h){return Cl({min:r(h).min})}function d(h){return Cl({max:nh(r(h).min)})}return{values:Object.values(n),only:i,keys:c,conditions:a,getCondition:l,up:u,down:d}}function nh(t){var n;const e=parseFloat((n=_x(t))!=null?n:"")-.04;return Vx(`${e}px`)}function WR(t){return Object.entries(t).sort(([,n],[,r])=>parseInt(n,10)<parseInt(r,10)?-1:1).map(([n,r],i,o)=>{var a;let s=null;return i<=o.length-1&&(s=(a=o[i+1])==null?void 0:a[1]),s!=null&&(s=nh(s)),[n,{name:n,min:Vx(r),max:s}]})}function GR(t){const e=[];return t.forEach((n,r)=>{let i=r;i++;let o=t[i];for(;o;)e.push([n,o]),i++,o=t[i]}),e}function Cl({min:t,max:e}){return t==null&&e==null?"":["@media screen",t&&`(min-width: ${t})`,e&&`(max-width: ${e})`].filter(Boolean).join(" and ")}const jR=(t,e)=>Object.fromEntries(Object.entries(t).map(([n,r])=>e(n,r))),KR=t=>{const{breakpoints:e,conditions:n={}}=t,r=jR(n,(u,d)=>[`_${u}`,d]),i=Object.assign({},r,e.conditions);function o(){return Object.keys(i)}function s(u){return o().includes(u)||/^@|&|&$/.test(u)||u.startsWith("_")}function a(u){return u.filter(d=>d!=="base").sort((d,h)=>{const g=s(d),b=s(h);return g&&!b?1:!g&&b?-1:0})}function l(u){return u.startsWith("@breakpoint")?e.getCondition(u.replace("@breakpoint ","")):u}function c(u){return Reflect.get(i,u)||u}return{keys:o,sort:a,has:s,resolve:c,breakpoints:e.keys(),expandAtRule:l}},Dx=t=>({minMax:new RegExp(`(!?\\(\\s*min(-device-)?-${t})(.|
23
+ )+\\(\\s*max(-device)?-${t}`,"i"),min:new RegExp(`\\(\\s*min(-device)?-${t}`,"i"),maxMin:new RegExp(`(!?\\(\\s*max(-device)?-${t})(.|
24
+ )+\\(\\s*min(-device)?-${t}`,"i"),max:new RegExp(`\\(\\s*max(-device)?-${t}`,"i")}),qR=Dx("width"),YR=Dx("height"),zx=t=>({isMin:jx(t.minMax,t.maxMin,t.min),isMax:jx(t.maxMin,t.minMax,t.max)}),{isMin:V0,isMax:Ux}=zx(qR),{isMin:D0,isMax:$x}=zx(YR),Hx=/print/i,Wx=/^print$/i,QR=/(-?\d*\.?\d+)(ch|em|ex|px|rem)/,XR=/(\d)/,Fu=Number.MAX_VALUE,JR={ch:8.8984375,em:16,rem:16,ex:8.296875,px:1};function Gx(t){const e=QR.exec(t)||(V0(t)||D0(t)?XR.exec(t):null);if(!e)return Fu;if(e[0]==="0")return 0;const n=parseFloat(e[1]),r=e[2];return n*(JR[r]||1)}function jx(t,e,n){return r=>t.test(r)||!e.test(r)&&n.test(r)}function ZR(t,e){const n=Hx.test(t),r=Wx.test(t),i=Hx.test(e),o=Wx.test(e);return n&&i?!r&&o?1:r&&!o?-1:t.localeCompare(e):n?1:i?-1:null}const eM=Qr((t,e)=>{const n=ZR(t,e);if(n!==null)return n;const r=V0(t)||D0(t),i=Ux(t)||$x(t),o=V0(e)||D0(e),s=Ux(e)||$x(e);if(r&&s)return-1;if(i&&o)return 1;const a=Gx(t),l=Gx(e);return a===Fu&&l===Fu?t.localeCompare(e):a===Fu?1:l===Fu?-1:a!==l?a>l?i?-1:1:i?1:-1:t.localeCompare(e)});function Kx(t){return t.sort(([e],[n])=>eM(e,n))}function qx(t){const e=[],n=[],r={};for(const[s,a]of Object.entries(t))s.startsWith("@media")?e.push([s,a]):s.startsWith("@container")?n.push([s,a]):Qn(a)?r[s]=qx(a):r[s]=a;const i=Kx(e),o=Kx(n);return{...r,...Object.fromEntries(i),...Object.fromEntries(o)}}const Yx=/\s*!(important)?/i,tM=t=>yi(t)?Yx.test(t):!1,nM=t=>yi(t)?t.replace(Yx,"").trim():t;function Qx(t){const{transform:e,conditions:n,normalize:r}=t,i=oM(t);return Qr(function(...s){const a=i(...s),l=r(a),c=Object.create(null);return no(l,(u,d)=>{var w;const h=tM(u);if(u==null)return;const[g,...b]=n.sort(d).map(n.resolve);h&&(u=nM(u));let p=(w=e(g,u))!=null?w:Object.create(null);p=no(p,S=>yi(S)&&h?`${S} !important`:S,{getKey:S=>n.expandAtRule(S)}),rM(c,b.flat(),p)}),qx(c)})}function rM(t,e,n){let r=t;for(const i of e)i&&(r[i]||(r[i]=Object.create(null)),r=r[i]);Sl(r,n)}function iM(...t){return t.filter(e=>Qn(e)&&Object.keys(hu(e)).length>0)}function oM(t){function e(n){const r=iM(...n);return r.length===1?r:r.map(i=>t.normalize(i))}return Qr(function(...r){return Sl({},...e(r))})}const Xx=t=>({base:{},variants:{},defaultVariants:{},compoundVariants:[],...t});function sM(t){const{css:e,conditions:n,normalize:r,layers:i}=t;function o(a={}){const{base:l,variants:c,defaultVariants:u,compoundVariants:d}=Xx(a),h=Qx({conditions:n,normalize:r,transform(O,T){var $;return($=c[O])==null?void 0:$[T]}}),g=(O={})=>{const T=r({...u,...hu(O)});let $={...l};Sl($,h(T));const R=s(d,T);return i.wrap("recipes",e($,R))},b=Object.keys(c),p=O=>{const T=Cx(O,["recipe"]),[$,R]=al(T,b);return b.includes("colorPalette")||($.colorPalette=O.colorPalette||u.colorPalette),b.includes("orientation")&&(R.orientation=O.orientation),[$,R]},w=Object.fromEntries(Object.entries(c).map(([O,T])=>[O,Object.keys(T)]));return Object.assign(O=>e(g(O)),{className:a.className,__cva__:!0,variantMap:w,variantKeys:b,raw:g,config:a,splitVariantProps:p,merge(O){return o(aM(t)(this,O))}})}function s(a,l){let c={};return a.forEach(u=>{Object.entries(u).every(([h,g])=>h==="css"?!0:(Array.isArray(g)?g:[g]).some(p=>l[h]===p))&&(c=e(c,u.css))}),c}return o}function aM(t){const{css:e}=t;return function(r,i){const o=Xx(i.config),s=Sv(r.variantKeys,Object.keys(i.variants)),a=e(r.base,o.base),l=Object.fromEntries(s.map(h=>[h,e(r.config.variants[h],o.variants[h])])),c=Sl(r.config.defaultVariants,o.defaultVariants),u=[...r.compoundVariants,...o.compoundVariants];return{className:Yn(r.className,i.className),base:a,variants:l,defaultVariants:c,compoundVariants:u}}}const lM={reset:"reset",base:"base",tokens:"tokens",recipes:"recipes"},Jx={reset:0,base:1,tokens:2,recipes:3};function cM(t){var i;const e=(i=t.layers)!=null?i:lM,r=Object.values(e).sort((o,s)=>Jx[o]-Jx[s]);return{names:r,atRule:`@layer ${r.join(", ")};`,wrap(o,s){return t.disableLayers?s:{[`@layer ${e[o]}`]:s}}}}function uM(t){const{utility:e,normalize:n}=t,{hasShorthand:r,resolveShorthand:i}=e;return function(o){return no(o,n,{stop:s=>Array.isArray(s),getKey:r?i:void 0})}}function dM(t){const{preflight:e}=t;if(!e)return{};const{scope:n="",level:r="parent"}=Qn(e)?e:{};let i="";n&&r==="parent"?i=`${n} `:n&&r==="element"&&(i=`&${n}`);const o={"*":{margin:"0px",padding:"0px",font:"inherit",wordWrap:"break-word",WebkitTapHighlightColor:"transparent"},"*, *::before, *::after, *::backdrop":{boxSizing:"border-box",borderWidth:"0px",borderStyle:"solid",borderColor:"var(--global-color-border, currentColor)"},hr:{height:"0px",color:"inherit",borderTopWidth:"1px"},body:{minHeight:"100dvh",position:"relative"},img:{borderStyle:"none"},"img, svg, video, canvas, audio, iframe, embed, object":{display:"block",verticalAlign:"middle"},iframe:{border:"none"},"img, video":{maxWidth:"100%",height:"auto"},"p, h1, h2, h3, h4, h5, h6":{overflowWrap:"break-word"},"ol, ul":{listStyle:"none"},"code, kbd, pre, samp":{fontSize:"1em"},"button, [type='button'], [type='reset'], [type='submit']":{WebkitAppearance:"button",backgroundColor:"transparent",backgroundImage:"none"},"button, input, optgroup, select, textarea":{color:"inherit"},"button, select":{textTransform:"none"},table:{textIndent:"0px",borderColor:"inherit",borderCollapse:"collapse"},"*::placeholder":{opacity:"unset",color:"#9ca3af",userSelect:"none"},textarea:{resize:"vertical"},summary:{display:"list-item"},small:{fontSize:"80%"},"sub, sup":{fontSize:"75%",lineHeight:0,position:"relative",verticalAlign:"baseline"},sub:{bottom:"-0.25em"},sup:{top:"-0.5em"},dialog:{padding:"0px"},a:{color:"inherit",textDecoration:"inherit"},"abbr:where([title])":{textDecoration:"underline dotted"},"b, strong":{fontWeight:"bolder"},"code, kbd, samp, pre":{fontSize:"1em","--font-mono-fallback":"ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New'",fontFamily:"var(--global-font-mono, var(--font-mono-fallback))"},'input[type="text"], input[type="email"], input[type="search"], input[type="password"]':{WebkitAppearance:"none",MozAppearance:"none"},"input[type='search']":{WebkitAppearance:"textfield",outlineOffset:"-2px"},"::-webkit-search-decoration, ::-webkit-search-cancel-button":{WebkitAppearance:"none"},"::-webkit-file-upload-button":{WebkitAppearance:"button",font:"inherit"},'input[type="number"]::-webkit-inner-spin-button, input[type="number"]::-webkit-outer-spin-button':{height:"auto"},"input[type='number']":{MozAppearance:"textfield"},":-moz-ui-invalid":{boxShadow:"none"},":-moz-focusring":{outline:"auto"},"[hidden]:where(:not([hidden='until-found']))":{display:"none !important"}},s={[n||"html"]:{lineHeight:1.5,"--font-fallback":"ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, 'Noto Sans', sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol', 'Noto Color Emoji'",WebkitTextSizeAdjust:"100%",WebkitFontSmoothing:"antialiased",MozOsxFontSmoothing:"grayscale",textRendering:"optimizeLegibility",touchAction:"manipulation",MozTabSize:"4",tabSize:"4",fontFamily:"var(--global-font-body, var(--font-fallback))"}};if(r==="element"){const a=Object.entries(o).reduce((l,[c,u])=>(l[c]={[i]:u},l),{});Object.assign(s,a)}else i?s[i]=o:Object.assign(s,o);return s}function fM(t){const{conditions:e,isValidProperty:n}=t;return function(i){return no(i,o=>o,{getKey:(o,s)=>Qn(s)&&!e.has(o)&&!n(o)?hM(o).map(a=>"&"+a).join(", "):o})}}function hM(t){const e=[];let n=0,r="",i=!1;for(let o=0;o<t.length;o++){const s=t[o];if(s==="\\"&&!i){i=!0,r+=s;continue}if(i){i=!1,r+=s;continue}s==="("?n++:s===")"&&n--,s===","&&n===0?(e.push(r.trim()),r=""):r+=s}return r&&e.push(r.trim()),e}const pM=(t={})=>{var i,o;const e=s=>{var a,l,c;return{base:(l=(a=t.base)==null?void 0:a[s])!=null?l:{},variants:{},defaultVariants:(c=t.defaultVariants)!=null?c:{},compoundVariants:t.compoundVariants?gM(t.compoundVariants,s):[]}},r=((i=t.slots)!=null?i:[]).map(s=>[s,e(s)]);for(const[s,a]of Object.entries((o=t.variants)!=null?o:{}))for(const[l,c]of Object.entries(a))r.forEach(([u,d])=>{var g,b;var h;(g=(h=d.variants)[s])!=null||(h[s]={}),d.variants[s][l]=(b=c[u])!=null?b:{}});return Object.fromEntries(r)},gM=(t,e)=>t.filter(n=>n.css[e]).map(n=>({...n,css:n.css[e]}));function mM(t){const{cva:e}=t;return function(r={}){var d;const i=Object.entries(pM(r)).map(([h,g])=>[h,e(g)]);function o(h){const g=i.map(([b,p])=>[b,p(h)]);return Object.fromEntries(g)}const s=(d=r.variants)!=null?d:{},a=Object.keys(s);function l(h){var w;const g=Cx(h,["recipe"]),[b,p]=al(g,a);return a.includes("colorPalette")||(b.colorPalette=h.colorPalette||((w=r.defaultVariants)==null?void 0:w.colorPalette)),a.includes("orientation")&&(p.orientation=h.orientation),[b,p]}const c=Object.fromEntries(Object.entries(s).map(([h,g])=>[h,Object.keys(g)]));let u={};return r.className&&(u=Object.fromEntries(r.slots.map(h=>[h,`${r.className}__${h}`]))),Object.assign(o,{variantMap:c,variantKeys:a,splitVariantProps:l,classNameMap:u})}}const yM=()=>t=>Array.from(new Set(t)),bM=/([\0-\x1f\x7f]|^-?\d)|^-$|^-|[^\x80-\uFFFF\w-]/g,vM=function(t,e){return e?t==="\0"?"�":t==="-"&&t.length===1?"\\-":t.slice(0,-1)+"\\"+t.charCodeAt(t.length-1).toString(16):"\\"+t},Zx=t=>(t+"").replace(bM,vM),e2=(t,e)=>{var l,c,u,d;let n="",r=0,i="char",o="",s="";const a=[];for(;r<t.length;){const h=t[r];if(h==="{"){const b=t.indexOf("}",r);if(b===-1)break;const p=t.slice(r+1,b),w=e(p);n+=w!=null?w:p,r=b+1;continue}if(i==="token"&&h===","){t[r]===""&&r++,i="fallback",a.push(i);const b=e(o);b!=null&&b.endsWith(")")&&(n+=b.slice(0,-1)),o="",s="";continue}if(i==="fallback"&&s+h===", var("){const w=wM(t.slice(r+1))+r+1,S=t.slice(r+1,w);if(w===-1)break;n+=", var("+S+")",r=w+1,i=(l=a.pop())!=null?l:i,s="";continue}if(i==="token"||i==="fallback"){if(r++,h===")"){i=(u=(c=a.pop())!=null?c:i)!=null?u:"char",s+=h;const b=o&&((d=e(o))!=null?d:Zx(o));if(s){if(s=s.slice(1).trim(),!s.startsWith("token(")&&s.endsWith(")")&&(s=s.slice(0,-1)),s.includes("token(")){const w=e2(s,e);w&&(s=w.slice(0,-1))}else if(s){const w=e(s);w&&(s=w)}}const p=n.at(-1);s?p!=null&&p.trim()?n+=b.slice(0,-1)+(", "+s+")"):n+=s:n+=b||")",o="",s="",i="char";continue}i==="token"&&(o+=h),i==="fallback"&&(s+=h);continue}const g=t.indexOf("token(",r);if(g!==-1){const b=g+6;n+=t.slice(r,g),r=b,i="token",a.push(i);continue}n+=h,r++}return n},wM=t=>{let e=0;const n=["("];for(;e<t.length;){const r=t[e];if(r==="(")n.push(r);else if(r===")"&&(n.pop(),n.length===0))return e;e++}return e};function t2(t){const e={};return t.forEach((n,r)=>{n instanceof Map?e[r]=Object.fromEntries(n):e[r]=n}),e}const n2=/({([^}]*)})/g,xM=/[{}]/g,EM=/\w+\.\w+/,r2=t=>{if(!yi(t))return[];const e=t.match(n2);return e?e.map(n=>n.replace(xM,"")).map(n=>n.trim()):[]},SM=t=>n2.test(t);function i2(t){var n,r,i,o,s;if(!((n=t.extensions)!=null&&n.references))return(o=(i=(r=t.extensions)==null?void 0:r.cssVar)==null?void 0:i.ref)!=null?o:t.value;const e=(s=t.extensions.references)!=null?s:{};return t.value=Object.keys(e).reduce((a,l)=>{const c=e[l];if(c.extensions.conditions)return a;const u=i2(c);return a.replace(`{${l}}`,u)},t.value),delete t.extensions.references,t.value}function o2(t){return Qn(t)&&t.reference?t.reference:String(t)}const rh=(t,...e)=>e.map(o2).join(` ${t} `).replace(/calc/g,""),s2=(...t)=>`calc(${rh("+",...t)})`,a2=(...t)=>`calc(${rh("-",...t)})`,z0=(...t)=>`calc(${rh("*",...t)})`,l2=(...t)=>`calc(${rh("/",...t)})`,c2=t=>{const e=o2(t);return e!=null&&!Number.isNaN(parseFloat(e))?String(e).startsWith("-")?String(e).slice(1):`-${e}`:z0(e,-1)},Il=Object.assign(t=>({add:(...e)=>Il(s2(t,...e)),subtract:(...e)=>Il(a2(t,...e)),multiply:(...e)=>Il(z0(t,...e)),divide:(...e)=>Il(l2(t,...e)),negate:()=>Il(c2(t)),toString:()=>t.toString()}),{add:s2,subtract:a2,multiply:z0,divide:l2,negate:c2}),AM={enforce:"pre",transform(t){const{prefix:e,allTokens:n,formatCssVar:r,formatTokenName:i,registerToken:o}=t;n.filter(({extensions:a})=>a.category==="spacing").forEach(a=>{const l=a.path.slice(),c=r(l,e);if(yi(a.value)&&a.value==="0rem")return;const u=structuredClone(a);Object.assign(u.extensions,{negative:!0,prop:`-${a.extensions.prop}`,originalPath:l}),u.value=Il.negate(c.ref);const d=u.path[u.path.length-1];d!=null&&(u.path[u.path.length-1]=`-${d}`),u.path&&(u.name=i(u.path)),o(u)})}},kM=new Set(["spacing","sizes","borderWidths","fontSizes","radii"]),CM=[AM,{enforce:"post",transform(t){const{allTokens:e,registerToken:n,formatTokenName:r}=t,i=e.filter(({extensions:a})=>a.category==="colors"),o=new Map,s=new Map;i.forEach(a=>{const{colorPalette:l}=a.extensions;l&&(l.keys.forEach(c=>{o.set(r(c),c)}),l.roots.forEach(c=>{var h;const u=r(c),d=s.get(u)||[];if(d.push(a),s.set(u,d),a.extensions.default&&c.length===1){const g=(h=l.keys[0])==null?void 0:h.filter(Boolean);if(!g.length)return;const b=c.concat(g);o.set(r(b),[])}}))}),o.forEach(a=>{const l=["colors","colorPalette",...a].filter(Boolean),c=r(l),u=r(l.slice(1));n({name:c,value:c,originalValue:c,path:l,extensions:{condition:"base",originalPath:l,category:"colors",prop:u,virtual:!0}},"pre")})}},{enforce:"post",transform(t){t.allTokens.filter(n=>kM.has(n.extensions.category)&&!n.extensions.negative).forEach(n=>{Object.assign(n.extensions,{pixelValue:_x(n.value)})})}},{enforce:"post",transform(t){t.allTokens=t.allTokens.filter(e=>e.value!=="")}}],IM=[{type:"extensions",enforce:"pre",name:"tokens/css-var",transform(t,e){const{prefix:n,formatCssVar:r}=e,{negative:i,originalPath:o}=t.extensions,s=i?o:t.path;return{cssVar:r(s.filter(Boolean),n)}}},{enforce:"post",type:"value",name:"tokens/conditionals",transform(t,e){const{prefix:n,formatCssVar:r}=e,i=r2(t.value);return i.length&&i.forEach(o=>{const s=r(o.split("."),n);t.value=t.value.replace(`{${s.ref}}`,s)}),t.value}},{type:"extensions",enforce:"pre",name:"tokens/colors/colorPalette",match(t){return t.extensions.category==="colors"&&!t.extensions.virtual},transform(t,e){let n=t.path.slice();if(n.pop(),n.shift(),n.length===0){const a=[...t.path];a.shift(),n=a}if(n.length===0)return{};const r=n.reduce((a,l,c,u)=>{const d=u.slice(0,c+1);return a.push(d),a},[]),i=n[0],o=e.formatTokenName(n),s=t.path.slice(t.path.indexOf(i)+1).reduce((a,l,c,u)=>(a.push(u.slice(c)),a),[]);return s.length===0&&s.push([""]),{colorPalette:{value:o,roots:r,keys:s}}}}],u2=t=>Qn(t)&&Object.prototype.hasOwnProperty.call(t,"value");function OM(t){return t?{breakpoints:Bx(t,e=>({value:e})),sizes:Object.fromEntries(Object.entries(t).map(([e,n])=>[`breakpoint-${e}`,{value:n}]))}:{breakpoints:{},sizes:{}}}function TM(t){const{prefix:e="",tokens:n={},semanticTokens:r={},breakpoints:i={}}=t,o=Z=>Z.join("."),s=(Z,Y)=>Tx(Z.join("-"),{prefix:Y}),a=[],l=new Map,c=new Map,u=new Map,d=new Map,h=new Map,g=new Map,b=new Map,p=new Map,w=[];function S(Z,Y){a.push(Z),l.set(Z.name,Z),Y&&p.forEach(re=>{re.enforce===Y&&M(re,Z)})}const O=OM(i),T=hu({...n,breakpoints:O.breakpoints,sizes:{...n.sizes,...O.sizes}});function $(){no(T,(Z,Y)=>{const re=Y.includes("DEFAULT");Y=d2(Y);const de=Y[0],se=o(Y),me=yi(Z)?{value:Z}:Z,Ae={value:me.value,originalValue:me.value,name:se,path:Y,extensions:{condition:"base",originalPath:Y,category:de,prop:o(Y.slice(1))}};re&&(Ae.extensions.default=!0),S(Ae)},{stop:u2}),no(r,(Z,Y)=>{const re=Y.includes("DEFAULT");Y=f2(d2(Y));const de=Y[0],se=o(Y),me=yi(Z.value)?{value:{base:Z.value}}:Z,Ae={value:me.value.base||"",originalValue:me.value.base||"",name:se,path:Y,extensions:{originalPath:Y,category:de,conditions:me.value,condition:"base",prop:o(Y.slice(1))}};re&&(Ae.extensions.default=!0),S(Ae)},{stop:u2})}function R(Z){return l.get(Z)}function j(Z){const{condition:Y}=Z.extensions;Y&&(c.has(Y)||c.set(Y,new Set),c.get(Y).add(Z))}function q(Z){const{category:Y,prop:re}=Z.extensions;Y&&(b.has(Y)||b.set(Y,new Map),b.get(Y).set(re,Z))}function G(Z){const{condition:Y,negative:re,virtual:de,cssVar:se}=Z.extensions;re||de||!Y||!se||(u.has(Y)||u.set(Y,new Map),u.get(Y).set(se.var,Z.value))}function L(Z){const{category:Y,prop:re,cssVar:de,negative:se}=Z.extensions;if(!Y)return;g.has(Y)||g.set(Y,new Map);const me=se?Z.extensions.conditions?Z.originalValue:Z.value:de.ref;g.get(Y).set(re,me),h.set([Y,re].join("."),me)}function V(Z){const{colorPalette:Y,virtual:re,default:de}=Z.extensions;!Y||re||Y.roots.forEach(se=>{var dt;const me=o(se);d.has(me)||d.set(me,new Map);const Ae=NM([...Z.path],[...se]),Re=o(Ae),Ct=R(Re);if(!Ct||!Ct.extensions.cssVar)return;const{var:st}=Ct.extensions.cssVar;if(d.get(me).set(st,Z.extensions.cssVar.ref),de&&se.length===1){const ji=o(["colors","colorPalette"]),at=R(ji);if(!at)return;const it=o(Z.path),hn=R(it);if(!hn)return;const ft=(dt=Y.keys[0])==null?void 0:dt.filter(Boolean);if(!ft.length)return;const mt=o(se.concat(ft));d.has(mt)||d.set(mt,new Map),d.get(mt).set(at.extensions.cssVar.var,hn.extensions.cssVar.ref)}})}let W={};function z(){a.forEach(Z=>{j(Z),q(Z),G(Z),L(Z),V(Z)}),W=t2(g)}const C=(Z,Y)=>{var Ct;if(!Z||typeof Z!="string")return{invalid:!0,value:Z};const[re,de]=Z.split("/");if(!re||!de)return{invalid:!0,value:re};const se=Y(re),me=(Ct=R(`opacity.${de}`))==null?void 0:Ct.value;if(!me&&isNaN(Number(de)))return{invalid:!0,value:re};const Ae=me?Number(me)*100+"%":`${de}%`,Re=se!=null?se:re;return{invalid:!1,color:Re,value:`color-mix(in srgb, ${Re} ${Ae}, transparent)`}},f=Qr((Z,Y)=>{var re;return(re=h.get(Z))!=null?re:Y}),y=Qr(Z=>W[Z]||null),E=Qr(Z=>e2(Z,Y=>{if(!Y)return;if(Y.includes("/")){const de=C(Y,se=>f(se));if(de.invalid)throw new Error("Invalid color mix at "+Y+": "+de.value);return de.value}const re=f(Y);return re||(EM.test(Y)?Zx(Y):Y)})),I={prefix:e,allTokens:a,tokenMap:l,registerToken:S,getByName:R,formatTokenName:o,formatCssVar:s,flatMap:h,cssVarMap:u,categoryMap:b,colorPaletteMap:d,getVar:f,getCategoryValues:y,expandReferenceInValue:E};function N(...Z){Z.forEach(Y=>{p.set(Y.name,Y)})}function D(...Z){w.push(...Z)}function M(Z,Y){if(Y.extensions.references||Ag(Z.match)&&!Z.match(Y))return;const de=(se=>Z.transform(se,I))(Y);switch(!0){case Z.type==="extensions":Object.assign(Y.extensions,de);break;case Z.type==="value":Y.value=de;break;default:Y[Z.type]=de;break}}function P(Z){w.forEach(Y=>{Y.enforce===Z&&Y.transform(I)})}function m(Z){p.forEach(Y=>{Y.enforce===Z&&a.forEach(re=>{M(Y,re)})})}function v(){a.forEach(Z=>{const Y=PM(Z);!Y||Y.length===0||Y.forEach(re=>{S(re)})})}function B(Z){return r2(Z).map(re=>R(re)).filter(Boolean)}function U(){a.forEach(Z=>{if(!SM(Z.value))return;const Y=B(Z.value);Z.extensions.references=Y.reduce((re,de)=>(re[de.name]=de,re),{})})}function Q(){a.forEach(Z=>{i2(Z)})}function ee(){P("pre"),m("pre"),v(),U(),Q(),P("post"),m("post"),z()}return $(),N(...IM),D(...CM),ee(),I}function d2(t){return t[0]==="DEFAULT"?t:t.filter(e=>e!=="DEFAULT")}function f2(t){return t.filter(e=>e!=="base")}function PM(t){if(!t.extensions.conditions)return;const{conditions:e}=t.extensions,n=[];return no(e,(r,i)=>{const o=f2(i);if(!o.length)return;const s=structuredClone(t);s.value=r,s.extensions.condition=o.join(":"),n.push(s)}),n}function NM(t,e){const n=t.findIndex((r,i)=>e.every((o,s)=>t[i+s]===o));return n===-1||(t.splice(n,e.length),t.splice(n,0,"colorPalette")),t}yM()(["aspectRatios","zIndex","opacity","colors","fonts","fontSizes","fontWeights","lineHeights","letterSpacings","sizes","shadows","spacing","radii","cursor","borders","borderWidths","borderStyles","durations","easings","animations","blurs","gradients","breakpoints","assets"]);function LK(t){return t}function BM(t){return Object.fromEntries(Object.entries(t).map(([e,n])=>[e,n]))}function RM(t){const e=BM(t.config),n=t.tokens,r=new Map,i=new Map;function o(G,L){e[G]=L,s(G,L)}const s=(G,L)=>{const V=p(L);V&&(i.set(G,V),d(G,L))},a=()=>{for(const[G,L]of Object.entries(e))L&&s(G,L)},l=()=>{for(const[G,L]of Object.entries(e)){const{shorthand:V}=L!=null?L:{};if(!V)continue;(Array.isArray(V)?V:[V]).forEach(z=>r.set(z,G))}},c=()=>{const G=t2(n.colorPaletteMap);o("colorPalette",{values:Object.keys(G),transform:Qr(L=>G[L])})},u=new Map,d=(G,L)=>{var z;if(!L)return;const V=p(L,C=>`type:Tokens["${C}"]`);if(typeof V=="object"&&V.type){u.set(G,new Set([`type:${V.type}`]));return}if(V){const C=new Set(Object.keys(V));u.set(G,C)}const W=(z=u.get(G))!=null?z:new Set;L.property&&u.set(G,W.add(`CssProperties["${L.property}"]`))},h=()=>{for(const[G,L]of Object.entries(e))L&&d(G,L)},g=(G,L)=>{var W;const V=(W=u.get(G))!=null?W:new Set;u.set(G,new Set([...V,...L]))},b=()=>{const G=new Map;for(const[L,V]of u.entries()){if(V.size===0){G.set(L,["string"]);continue}const W=Array.from(V).map(z=>z.startsWith("CssProperties")?z:z.startsWith("type:")?z.replace("type:",""):JSON.stringify(z));G.set(L,W)}return G},p=(G,L)=>{var z,C;const{values:V}=G,W=f=>{const y=L==null?void 0:L(f);return y?{[y]:y}:void 0};return yi(V)?(C=(z=W==null?void 0:W(V))!=null?z:n.getCategoryValues(V))!=null?C:{}:Array.isArray(V)?V.reduce((f,y)=>(f[y]=y,f),{}):Ag(V)?V(L?W:n.getCategoryValues):V},w=Qr((G,L)=>({[G]:G.startsWith("--")?n.getVar(L,L):L})),S=Object.assign(n.getVar,{raw:G=>n.getByName(G)}),O=Qr((G,L)=>{var f;const V=R(G);yi(L)&&!L.includes("_EMO_")&&(L=n.expandReferenceInValue(L));const W=e[V];if(!W)return w(V,L);const z=(f=i.get(V))==null?void 0:f[L];if(!W.transform)return w(G,z!=null?z:L);const C=y=>gR(y,S);return W.transform(z!=null?z:L,{raw:L,token:S,utils:{colorMix:C}})});function T(){l(),c(),a(),h()}T();const $=r.size>0,R=Qr(G=>{var L;return(L=r.get(G))!=null?L:G});return{keys:()=>[...Array.from(r.keys()),...Object.keys(e)],hasShorthand:$,transform:O,shorthands:r,resolveShorthand:R,register:o,getTypes:b,addPropertyType:g}}const Zn={};function h2(...t){var D,M,P,m,v,B,U,Q,ee,Z;const e=Ox(...t),{theme:n={},utilities:r={},globalCss:i={},cssVarsRoot:o=":where(:root, :host)",cssVarsPrefix:s="chakra",preflight:a}=e,l=cM(e),c=TM({breakpoints:n.breakpoints,tokens:n.tokens,semanticTokens:n.semanticTokens,prefix:s}),u=HR((D=n.breakpoints)!=null?D:Zn),d=KR({conditions:(M=e.conditions)!=null?M:Zn,breakpoints:u}),h=RM({config:r,tokens:c});function g(){const{textStyles:Y,layerStyles:re,animationStyles:de}=n,se=hu({textStyle:Y,layerStyle:re,animationStyle:de});for(const[me,Ae]of Object.entries(se)){const Re=Rx(Ae!=null?Ae:Zn,p2);h.register(me,{values:Object.keys(Re),transform(Ct){return T(Re[Ct])}})}}g(),h.addPropertyType("animationName",Object.keys((P=n.keyframes)!=null?P:Zn));const b=new Set(["css",...h.keys(),...d.keys()]),p=Qr(Y=>b.has(Y)||VR(Y)),w=Y=>Array.isArray(Y)?Y.reduce((re,de,se)=>{const me=d.breakpoints[se];return de!=null&&(re[me]=de),re},{}):Y,S=uM({utility:h,normalize:w}),O=fM({conditions:d,isValidProperty:p}),T=Qx({transform:h.transform,conditions:d,normalize:S}),$=sM({css:T,conditions:d,normalize:S,layers:l}),R=mM({cva:$});function j(){const Y={};for(const[re,de]of c.cssVarMap.entries()){const se=Object.fromEntries(de);if(Object.keys(se).length===0)continue;const me=re==="base"?o:d.resolve(re),Ae=me.startsWith("@"),Re=T(O({[me]:Ae?{[o]:se}:se}));Sl(Y,Re)}return l.wrap("tokens",Y)}function q(){var de;const Y=Object.fromEntries(Object.entries((de=n.keyframes)!=null?de:Zn).map(([se,me])=>[`@keyframes ${se}`,me])),re=Object.assign({},Y,T(O(i)));return l.wrap("base",re)}function G(Y){return al(Y,p)}function L(){const Y=dM({preflight:a});return l.wrap("reset",Y)}const V=MM(c),W=(Y,re)=>{var de;return((de=V.get(Y))==null?void 0:de.value)||re};W.var=(Y,re)=>{var de;return((de=V.get(Y))==null?void 0:de.variable)||re};function z(Y,re){var de,se;return(se=(de=n.recipes)==null?void 0:de[Y])!=null?se:re}function C(Y,re){var de,se;return(se=(de=n.slotRecipes)==null?void 0:de[Y])!=null?se:re}function f(Y){var re;return Object.hasOwnProperty.call((re=n.recipes)!=null?re:Zn,Y)}function y(Y){var re;return Object.hasOwnProperty.call((re=n.slotRecipes)!=null?re:Zn,Y)}function E(Y){return f(Y)||y(Y)}const I=[L(),q(),j()],N={layerStyles:U0((m=n.layerStyles)!=null?m:Zn),textStyles:U0((v=n.textStyles)!=null?v:Zn),animationStyles:U0((B=n.animationStyles)!=null?B:Zn),tokens:g2(c,Object.keys((U=n.tokens)!=null?U:Zn),(Y,re)=>!Y.extensions.conditions&&!re.includes("colorPalette")),semanticTokens:g2(c,Object.keys((Q=n.semanticTokens)!=null?Q:Zn),Y=>!!Y.extensions.conditions),keyframes:m2((ee=n.keyframes)!=null?ee:Zn),breakpoints:m2((Z=n.breakpoints)!=null?Z:Zn)};return{$$chakra:!0,_config:e,_global:I,breakpoints:u,tokens:c,conditions:d,utility:h,token:W,properties:b,layers:l,isValidProperty:p,splitCssProps:G,normalizeValue:w,getTokenCss:j,getGlobalCss:q,getPreflightCss:L,css:T,cva:$,sva:R,getRecipe:z,getSlotRecipe:C,hasRecipe:E,isRecipe:f,isSlotRecipe:y,query:N}}function MM(t){const e=new Map;return t.allTokens.forEach(n=>{const{cssVar:r,virtual:i,conditions:o}=n.extensions,s=o||i?r.ref:n.value;e.set(n.name,{value:s,variable:r.ref})}),e}const p2=t=>Qn(t)&&"value"in t,U0=t=>({list(){return Object.keys(Rx(t,p2))},search(e){return this.list().filter(n=>n.includes(e))}}),g2=(t,e,n)=>({categoryKeys:e,list(r){var i,o;return Array.from((o=(i=t.categoryMap.get(r))==null?void 0:i.entries())!=null?o:[]).reduce((s,[a,l])=>(n(l,a)&&s.push(a),s),[])},search(r,i){return this.list(r).filter(o=>o.includes(i))}}),m2=t=>({list(){return Object.keys(t)},search(e){return this.list().filter(n=>n.includes(e))}}),LM={sm:"480px",md:"768px",lg:"1024px",xl:"1280px","2xl":"1536px"},$0="var(--chakra-empty,/*!*/ /*!*/)",FM=bR({"*":{fontFeatureSettings:'"cv11"',"--ring-inset":$0,"--ring-offset-width":"0px","--ring-offset-color":"#fff","--ring-color":"rgba(66, 153, 225, 0.6)","--ring-offset-shadow":"0 0 #0000","--ring-shadow":"0 0 #0000",...Object.fromEntries(["brightness","contrast","grayscale","hue-rotate","invert","saturate","sepia","drop-shadow"].map(t=>[`--${t}`,$0])),...Object.fromEntries(["blur","brightness","contrast","grayscale","hue-rotate","invert","opacity","saturate","sepia"].map(t=>[`--backdrop-${t}`,$0])),"--global-font-mono":"fonts.mono","--global-font-body":"fonts.body","--global-color-border":"colors.border"},html:{color:"fg",bg:"bg",lineHeight:"1.5",colorPalette:"gray"},"*::placeholder, *[data-placeholder]":{color:"fg.muted/80"},"*::selection":{bg:"colorPalette.emphasized/80"}}),_M=xR({"fill.muted":{value:{background:"colorPalette.muted",color:"colorPalette.fg"}},"fill.subtle":{value:{background:"colorPalette.subtle",color:"colorPalette.fg"}},"fill.surface":{value:{background:"colorPalette.subtle",color:"colorPalette.fg",boxShadow:"0 0 0px 1px var(--shadow-color)",boxShadowColor:"colorPalette.muted"}},"fill.solid":{value:{background:"colorPalette.solid",color:"colorPalette.contrast"}},"outline.subtle":{value:{color:"colorPalette.fg",boxShadow:"inset 0 0 0px 1px var(--shadow-color)",boxShadowColor:"colorPalette.subtle"}},"outline.solid":{value:{borderWidth:"1px",borderColor:"colorPalette.solid",color:"colorPalette.fg"}},"indicator.bottom":{value:{position:"relative","--indicator-color-fallback":"colors.colorPalette.solid",_before:{content:'""',position:"absolute",bottom:"var(--indicator-offset-y, 0)",insetInline:"var(--indicator-offset-x, 0)",height:"var(--indicator-thickness, 2px)",background:"var(--indicator-color, var(--indicator-color-fallback))"}}},"indicator.top":{value:{position:"relative","--indicator-color-fallback":"colors.colorPalette.solid",_before:{content:'""',position:"absolute",top:"var(--indicator-offset-y, 0)",insetInline:"var(--indicator-offset-x, 0)",height:"var(--indicator-thickness, 2px)",background:"var(--indicator-color, var(--indicator-color-fallback))"}}},"indicator.start":{value:{position:"relative","--indicator-color-fallback":"colors.colorPalette.solid",_before:{content:'""',position:"absolute",insetInlineStart:"var(--indicator-offset-x, 0)",insetBlock:"var(--indicator-offset-y, 0)",width:"var(--indicator-thickness, 2px)",background:"var(--indicator-color, var(--indicator-color-fallback))"}}},"indicator.end":{value:{position:"relative","--indicator-color-fallback":"colors.colorPalette.solid",_before:{content:'""',position:"absolute",insetInlineEnd:"var(--indicator-offset-x, 0)",insetBlock:"var(--indicator-offset-y, 0)",width:"var(--indicator-thickness, 2px)",background:"var(--indicator-color, var(--indicator-color-fallback))"}}},disabled:{value:{opacity:"0.5",cursor:"not-allowed"}},none:{value:{}}}),VM=wR({"slide-fade-in":{value:{transformOrigin:"var(--transform-origin)","&[data-placement^=top]":{animationName:"slide-from-bottom, fade-in"},"&[data-placement^=bottom]":{animationName:"slide-from-top, fade-in"},"&[data-placement^=left]":{animationName:"slide-from-right, fade-in"},"&[data-placement^=right]":{animationName:"slide-from-left, fade-in"}}},"slide-fade-out":{value:{transformOrigin:"var(--transform-origin)","&[data-placement^=top]":{animationName:"slide-to-bottom, fade-out"},"&[data-placement^=bottom]":{animationName:"slide-to-top, fade-out"},"&[data-placement^=left]":{animationName:"slide-to-right, fade-out"},"&[data-placement^=right]":{animationName:"slide-to-left, fade-out"}}},"scale-fade-in":{value:{transformOrigin:"var(--transform-origin)",animationName:"scale-in, fade-in"}},"scale-fade-out":{value:{transformOrigin:"var(--transform-origin)",animationName:"scale-out, fade-out"}}}),H0=Ot({className:"chakra-badge",base:{display:"inline-flex",alignItems:"center",borderRadius:"l2",gap:"1",fontWeight:"medium",fontVariantNumeric:"tabular-nums",whiteSpace:"nowrap",userSelect:"none"},variants:{variant:{solid:{bg:"colorPalette.solid",color:"colorPalette.contrast"},subtle:{bg:"colorPalette.subtle",color:"colorPalette.fg"},outline:{color:"colorPalette.fg",shadow:"inset 0 0 0px 1px var(--shadow-color)",shadowColor:"colorPalette.muted"},surface:{bg:"colorPalette.subtle",color:"colorPalette.fg",shadow:"inset 0 0 0px 1px var(--shadow-color)",shadowColor:"colorPalette.muted"},plain:{color:"colorPalette.fg"}},size:{xs:{textStyle:"2xs",px:"1",minH:"4"},sm:{textStyle:"xs",px:"1.5",minH:"5"},md:{textStyle:"sm",px:"2",minH:"6"},lg:{textStyle:"sm",px:"2.5",minH:"7"}}},defaultVariants:{variant:"subtle",size:"sm"}}),DM=Ot({className:"chakra-button",base:{display:"inline-flex",appearance:"none",alignItems:"center",justifyContent:"center",userSelect:"none",position:"relative",borderRadius:"l2",whiteSpace:"nowrap",verticalAlign:"middle",borderWidth:"1px",borderColor:"transparent",cursor:"button",flexShrink:"0",outline:"0",lineHeight:"1.2",isolation:"isolate",fontWeight:"medium",transitionProperty:"common",transitionDuration:"moderate",focusVisibleRing:"outside",_disabled:{layerStyle:"disabled"},_icon:{flexShrink:"0"}},variants:{size:{"2xs":{h:"6",minW:"6",textStyle:"xs",px:"2",gap:"1",_icon:{width:"3.5",height:"3.5"}},xs:{h:"8",minW:"8",textStyle:"xs",px:"2.5",gap:"1",_icon:{width:"4",height:"4"}},sm:{h:"9",minW:"9",px:"3.5",textStyle:"sm",gap:"2",_icon:{width:"4",height:"4"}},md:{h:"10",minW:"10",textStyle:"sm",px:"4",gap:"2",_icon:{width:"5",height:"5"}},lg:{h:"11",minW:"11",textStyle:"md",px:"5",gap:"3",_icon:{width:"5",height:"5"}},xl:{h:"12",minW:"12",textStyle:"md",px:"5",gap:"2.5",_icon:{width:"5",height:"5"}},"2xl":{h:"16",minW:"16",textStyle:"lg",px:"7",gap:"3",_icon:{width:"6",height:"6"}}},variant:{solid:{bg:"colorPalette.solid",color:"colorPalette.contrast",borderColor:"transparent",_hover:{bg:"colorPalette.solid/90"},_expanded:{bg:"colorPalette.solid/90"}},subtle:{bg:"colorPalette.subtle",color:"colorPalette.fg",borderColor:"transparent",_hover:{bg:"colorPalette.muted"},_expanded:{bg:"colorPalette.muted"}},surface:{bg:"colorPalette.subtle",color:"colorPalette.fg",shadow:"0 0 0px 1px var(--shadow-color)",shadowColor:"colorPalette.muted",_hover:{bg:"colorPalette.muted"},_expanded:{bg:"colorPalette.muted"}},outline:{borderWidth:"1px",borderColor:"colorPalette.muted",color:"colorPalette.fg",_hover:{bg:"colorPalette.subtle"},_expanded:{bg:"colorPalette.subtle"}},ghost:{bg:"transparent",color:"colorPalette.fg",_hover:{bg:"colorPalette.subtle"},_expanded:{bg:"colorPalette.subtle"}},plain:{color:"colorPalette.fg"}}},defaultVariants:{size:"md",variant:"solid"}}),mn=Ot({className:"chakra-checkmark",base:{display:"inline-flex",alignItems:"center",justifyContent:"center",flexShrink:"0",color:"white",borderWidth:"1px",borderColor:"transparent",borderRadius:"l1",cursor:"checkbox",focusVisibleRing:"outside",_icon:{boxSize:"full"},_invalid:{colorPalette:"red",borderColor:"border.error"},_disabled:{opacity:"0.5",cursor:"disabled"}},variants:{size:{xs:{boxSize:"3"},sm:{boxSize:"4"},md:{boxSize:"5",p:"0.5"},lg:{boxSize:"6",p:"0.5"}},variant:{solid:{borderColor:"border.emphasized","&:is([data-state=checked], [data-state=indeterminate])":{bg:"colorPalette.solid",color:"colorPalette.contrast",borderColor:"colorPalette.solid"}},outline:{borderColor:"border","&:is([data-state=checked], [data-state=indeterminate])":{color:"colorPalette.fg",borderColor:"colorPalette.solid"}},subtle:{bg:"colorPalette.muted",borderColor:"colorPalette.muted","&:is([data-state=checked], [data-state=indeterminate])":{color:"colorPalette.fg"}},plain:{"&:is([data-state=checked], [data-state=indeterminate])":{color:"colorPalette.fg"}},inverted:{borderColor:"border",color:"colorPalette.fg","&:is([data-state=checked], [data-state=indeterminate])":{borderColor:"colorPalette.solid"}}}},defaultVariants:{variant:"solid",size:"md"}}),{variants:zM,defaultVariants:UM}=H0,$M=Ot({className:"chakra-code",base:{fontFamily:"mono",alignItems:"center",display:"inline-flex",borderRadius:"l2"},variants:zM,defaultVariants:UM}),y2=Ot({className:"color-swatch",base:{boxSize:"var(--swatch-size)",shadow:"inset 0 0 0 1px rgba(0, 0, 0, 0.1)","--checker-size":"8px","--checker-bg":"colors.bg","--checker-fg":"colors.bg.emphasized",background:"linear-gradient(var(--color), var(--color)), repeating-conic-gradient(var(--checker-fg) 0%, var(--checker-fg) 25%, var(--checker-bg) 0%, var(--checker-bg) 50%) 0% 50% / var(--checker-size) var(--checker-size) !important",display:"inline-flex",alignItems:"center",justifyContent:"center",flexShrink:"0"},variants:{size:{"2xs":{"--swatch-size":"sizes.3.5"},xs:{"--swatch-size":"sizes.4"},sm:{"--swatch-size":"sizes.4.5"},md:{"--swatch-size":"sizes.5"},lg:{"--swatch-size":"sizes.6"},xl:{"--swatch-size":"sizes.7"},"2xl":{"--swatch-size":"sizes.8"},inherit:{"--swatch-size":"inherit"},full:{"--swatch-size":"100%"}},shape:{square:{borderRadius:"none"},circle:{borderRadius:"full"},rounded:{borderRadius:"l1"}}},defaultVariants:{size:"md",shape:"rounded"}}),HM=Ot({className:"chakra-container",base:{position:"relative",maxWidth:"8xl",w:"100%",mx:"auto",px:{base:"4",md:"6",lg:"8"}},variants:{centerContent:{true:{display:"flex",flexDirection:"column",alignItems:"center"}},fluid:{true:{maxWidth:"full"}}}}),WM=Ot({className:"chakra-heading",base:{fontFamily:"heading",fontWeight:"semibold"},variants:{size:{xs:{textStyle:"xs"},sm:{textStyle:"sm"},md:{textStyle:"md"},lg:{textStyle:"lg"},xl:{textStyle:"xl"},"2xl":{textStyle:"2xl"},"3xl":{textStyle:"3xl"},"4xl":{textStyle:"4xl"},"5xl":{textStyle:"5xl"},"6xl":{textStyle:"6xl"},"7xl":{textStyle:"7xl"}}},defaultVariants:{size:"xl"}}),GM=Ot({className:"chakra-icon",base:{display:"inline-block",lineHeight:"1em",flexShrink:"0",color:"currentcolor",verticalAlign:"middle"},variants:{size:{inherit:{},xs:{boxSize:"3"},sm:{boxSize:"4"},md:{boxSize:"5"},lg:{boxSize:"6"},xl:{boxSize:"7"},"2xl":{boxSize:"8"}}},defaultVariants:{size:"inherit"}}),Mt=Ot({className:"chakra-input",base:{width:"100%",minWidth:"0",outline:"0",position:"relative",appearance:"none",textAlign:"start",borderRadius:"l2",_disabled:{layerStyle:"disabled"},height:"var(--input-height)",minW:"var(--input-height)","--focus-color":"colors.colorPalette.focusRing","--error-color":"colors.border.error",_invalid:{focusRingColor:"var(--error-color)",borderColor:"var(--error-color)"}},variants:{size:{"2xs":{textStyle:"xs",px:"2","--input-height":"sizes.7"},xs:{textStyle:"xs",px:"2","--input-height":"sizes.8"},sm:{textStyle:"sm",px:"2.5","--input-height":"sizes.9"},md:{textStyle:"sm",px:"3","--input-height":"sizes.10"},lg:{textStyle:"md",px:"4","--input-height":"sizes.11"},xl:{textStyle:"md",px:"4.5","--input-height":"sizes.12"},"2xl":{textStyle:"lg",px:"5","--input-height":"sizes.16"}},variant:{outline:{bg:"transparent",borderWidth:"1px",borderColor:"border",focusVisibleRing:"inside",focusRingColor:"var(--focus-color)"},subtle:{borderWidth:"1px",borderColor:"transparent",bg:"bg.muted",focusVisibleRing:"inside",focusRingColor:"var(--focus-color)"},flushed:{bg:"transparent",borderBottomWidth:"1px",borderBottomColor:"border",borderRadius:"0",px:"0",_focusVisible:{borderColor:"var(--focus-color)",boxShadow:"0px 1px 0px 0px var(--focus-color)",_invalid:{borderColor:"var(--error-color)",boxShadow:"0px 1px 0px 0px var(--error-color)"}}}}},defaultVariants:{size:"md",variant:"outline"}}),jM=Ot({className:"chakra-input-addon",base:{flex:"0 0 auto",width:"auto",display:"flex",alignItems:"center",whiteSpace:"nowrap",alignSelf:"stretch",borderRadius:"l2"},variants:{size:Mt.variants.size,variant:{outline:{borderWidth:"1px",borderColor:"border",bg:"bg.muted"},subtle:{borderWidth:"1px",borderColor:"transparent",bg:"bg.emphasized"},flushed:{borderBottom:"1px solid",borderColor:"inherit",borderRadius:"0",px:"0",bg:"transparent"}}},defaultVariants:{size:"md",variant:"outline"}}),KM=Ot({className:"chakra-kbd",base:{display:"inline-flex",alignItems:"center",fontWeight:"medium",fontFamily:"mono",flexShrink:"0",whiteSpace:"nowrap",wordSpacing:"-0.5em",userSelect:"none",px:"1",borderRadius:"l2"},variants:{variant:{raised:{bg:"colorPalette.subtle",color:"colorPalette.fg",borderWidth:"1px",borderBottomWidth:"2px",borderColor:"colorPalette.muted"},outline:{borderWidth:"1px",color:"colorPalette.fg"},subtle:{bg:"colorPalette.muted",color:"colorPalette.fg"},plain:{color:"colorPalette.fg"}},size:{sm:{textStyle:"xs",height:"4.5"},md:{textStyle:"sm",height:"5"},lg:{textStyle:"md",height:"6"}}},defaultVariants:{size:"md",variant:"raised"}}),qM=Ot({className:"chakra-link",base:{display:"inline-flex",alignItems:"center",outline:"none",gap:"1.5",cursor:"pointer",borderRadius:"l1",focusRing:"outside"},variants:{variant:{underline:{color:"colorPalette.fg",textDecoration:"underline",textUnderlineOffset:"3px",textDecorationColor:"currentColor/20"},plain:{color:"colorPalette.fg",_hover:{textDecoration:"underline",textUnderlineOffset:"3px",textDecorationColor:"currentColor/20"}}}},defaultVariants:{variant:"plain"}}),YM=Ot({className:"chakra-mark",base:{bg:"transparent",color:"inherit",whiteSpace:"nowrap"},variants:{variant:{subtle:{bg:"colorPalette.subtle",color:"inherit"},solid:{bg:"colorPalette.solid",color:"colorPalette.contrast"},text:{fontWeight:"medium"},plain:{}}}}),yn=Ot({className:"chakra-radiomark",base:{display:"inline-flex",alignItems:"center",justifyContent:"center",flexShrink:0,verticalAlign:"top",color:"white",borderWidth:"1px",borderColor:"transparent",borderRadius:"full",cursor:"radio",_focusVisible:{outline:"2px solid",outlineColor:"colorPalette.focusRing",outlineOffset:"2px"},_invalid:{colorPalette:"red",borderColor:"red.500"},_disabled:{opacity:"0.5",cursor:"disabled"},"& .dot":{height:"100%",width:"100%",borderRadius:"full",bg:"currentColor",scale:"0.4"}},variants:{variant:{solid:{borderWidth:"1px",borderColor:"border.emphasized",_checked:{bg:"colorPalette.solid",color:"colorPalette.contrast",borderColor:"colorPalette.solid"}},subtle:{borderWidth:"1px",bg:"colorPalette.muted",borderColor:"colorPalette.muted",color:"transparent",_checked:{color:"colorPalette.fg"}},outline:{borderWidth:"1px",borderColor:"inherit",_checked:{color:"colorPalette.fg",borderColor:"colorPalette.solid"},"& .dot":{scale:"0.6"}},inverted:{bg:"bg",borderWidth:"1px",borderColor:"inherit",_checked:{color:"colorPalette.solid",borderColor:"currentcolor"}}},size:{xs:{boxSize:"3"},sm:{boxSize:"4"},md:{boxSize:"5"},lg:{boxSize:"6"}}},defaultVariants:{variant:"solid",size:"md"}}),QM=Ot({className:"chakra-separator",base:{display:"block",borderColor:"border"},variants:{variant:{solid:{borderStyle:"solid"},dashed:{borderStyle:"dashed"},dotted:{borderStyle:"dotted"}},orientation:{vertical:{borderInlineStartWidth:"var(--separator-thickness)"},horizontal:{borderTopWidth:"var(--separator-thickness)"}},size:{xs:{"--separator-thickness":"0.5px"},sm:{"--separator-thickness":"1px"},md:{"--separator-thickness":"2px"},lg:{"--separator-thickness":"3px"}}},defaultVariants:{size:"sm",variant:"solid",orientation:"horizontal"}}),XM=Ot({className:"chakra-skeleton",base:{},variants:{loading:{true:{borderRadius:"l2",boxShadow:"none",backgroundClip:"padding-box",cursor:"default",color:"transparent",pointerEvents:"none",userSelect:"none",flexShrink:"0","&::before, &::after, *":{visibility:"hidden"}},false:{background:"unset",animation:"fade-in var(--fade-duration, 0.1s) ease-out !important"}},variant:{pulse:{background:"bg.emphasized",animation:"pulse",animationDuration:"var(--duration, 1.2s)"},shine:{"--animate-from":"200%","--animate-to":"-200%","--start-color":"colors.bg.muted","--end-color":"colors.bg.emphasized",backgroundImage:"linear-gradient(270deg,var(--start-color),var(--end-color),var(--end-color),var(--start-color))",backgroundSize:"400% 100%",animation:"bg-position var(--duration, 5s) ease-in-out infinite"},none:{animation:"none"}}},defaultVariants:{variant:"pulse",loading:!0}}),JM=Ot({className:"chakra-skip-nav",base:{display:"inline-flex",bg:"bg.panel",padding:"2.5",borderRadius:"l2",fontWeight:"semibold",focusVisibleRing:"outside",textStyle:"sm",userSelect:"none",border:"0",height:"1px",width:"1px",margin:"-1px",outline:"0",overflow:"hidden",position:"absolute",clip:"rect(0 0 0 0)",_focusVisible:{clip:"auto",width:"auto",height:"auto",position:"fixed",top:"6",insetStart:"6"}}}),ZM=Ot({className:"chakra-spinner",base:{display:"inline-block",borderColor:"currentColor",borderStyle:"solid",borderWidth:"2px",borderRadius:"full",width:"var(--spinner-size)",height:"var(--spinner-size)",animation:"spin",animationDuration:"slowest","--spinner-track-color":"transparent",borderBottomColor:"var(--spinner-track-color)",borderInlineStartColor:"var(--spinner-track-color)"},variants:{size:{inherit:{"--spinner-size":"1em"},xs:{"--spinner-size":"sizes.3"},sm:{"--spinner-size":"sizes.4"},md:{"--spinner-size":"sizes.5"},lg:{"--spinner-size":"sizes.8"},xl:{"--spinner-size":"sizes.10"}}},defaultVariants:{size:"md"}}),eL=Ot({className:"chakra-textarea",base:{width:"100%",minWidth:"0",outline:"0",position:"relative",appearance:"none",textAlign:"start",borderRadius:"l2",_disabled:{layerStyle:"disabled"},"--focus-color":"colors.colorPalette.focusRing","--error-color":"colors.border.error",_invalid:{focusRingColor:"var(--error-color)",borderColor:"var(--error-color)"}},variants:{size:{xs:{textStyle:"xs",px:"2",py:"1.5",scrollPaddingBottom:"1.5"},sm:{textStyle:"sm",px:"2.5",py:"2",scrollPaddingBottom:"2"},md:{textStyle:"sm",px:"3",py:"2",scrollPaddingBottom:"2"},lg:{textStyle:"md",px:"4",py:"3",scrollPaddingBottom:"3"},xl:{textStyle:"md",px:"4.5",py:"3.5",scrollPaddingBottom:"3.5"}},variant:{outline:{bg:"transparent",borderWidth:"1px",borderColor:"border",focusVisibleRing:"inside"},subtle:{borderWidth:"1px",borderColor:"transparent",bg:"bg.muted",focusVisibleRing:"inside"},flushed:{bg:"transparent",borderBottomWidth:"1px",borderBottomColor:"border",borderRadius:"0",px:"0",_focusVisible:{borderColor:"var(--focus-color)",boxShadow:"0px 1px 0px 0px var(--focus-color)"}}}},defaultVariants:{size:"md",variant:"outline"}}),tL={badge:H0,button:DM,code:$M,container:HM,heading:WM,input:Mt,inputAddon:jM,kbd:KM,link:qM,mark:YM,separator:QM,skeleton:XM,skipNavLink:JM,spinner:ZM,textarea:eL,icon:GM,checkmark:mn,radiomark:yn,colorSwatch:y2},nL=R0.colors({bg:{DEFAULT:{value:{_light:"{colors.white}",_dark:"{colors.black}"}},subtle:{value:{_light:"{colors.gray.50}",_dark:"{colors.gray.950}"}},muted:{value:{_light:"{colors.gray.100}",_dark:"{colors.gray.900}"}},emphasized:{value:{_light:"{colors.gray.200}",_dark:"{colors.gray.800}"}},inverted:{value:{_light:"{colors.black}",_dark:"{colors.white}"}},panel:{value:{_light:"{colors.white}",_dark:"{colors.gray.950}"}},error:{value:{_light:"{colors.red.50}",_dark:"{colors.red.950}"}},warning:{value:{_light:"{colors.orange.50}",_dark:"{colors.orange.950}"}},success:{value:{_light:"{colors.green.50}",_dark:"{colors.green.950}"}},info:{value:{_light:"{colors.blue.50}",_dark:"{colors.blue.950}"}}},fg:{DEFAULT:{value:{_light:"{colors.black}",_dark:"{colors.gray.50}"}},muted:{value:{_light:"{colors.gray.600}",_dark:"{colors.gray.400}"}},subtle:{value:{_light:"{colors.gray.400}",_dark:"{colors.gray.500}"}},inverted:{value:{_light:"{colors.gray.50}",_dark:"{colors.black}"}},error:{value:{_light:"{colors.red.500}",_dark:"{colors.red.400}"}},warning:{value:{_light:"{colors.orange.600}",_dark:"{colors.orange.300}"}},success:{value:{_light:"{colors.green.600}",_dark:"{colors.green.300}"}},info:{value:{_light:"{colors.blue.600}",_dark:"{colors.blue.300}"}}},border:{DEFAULT:{value:{_light:"{colors.gray.200}",_dark:"{colors.gray.800}"}},muted:{value:{_light:"{colors.gray.100}",_dark:"{colors.gray.900}"}},subtle:{value:{_light:"{colors.gray.50}",_dark:"{colors.gray.950}"}},emphasized:{value:{_light:"{colors.gray.300}",_dark:"{colors.gray.700}"}},inverted:{value:{_light:"{colors.gray.800}",_dark:"{colors.gray.200}"}},error:{value:{_light:"{colors.red.500}",_dark:"{colors.red.400}"}},warning:{value:{_light:"{colors.orange.500}",_dark:"{colors.orange.400}"}},success:{value:{_light:"{colors.green.500}",_dark:"{colors.green.400}"}},info:{value:{_light:"{colors.blue.500}",_dark:"{colors.blue.400}"}}},gray:{contrast:{value:{_light:"{colors.white}",_dark:"{colors.black}"}},fg:{value:{_light:"{colors.gray.800}",_dark:"{colors.gray.200}"}},subtle:{value:{_light:"{colors.gray.100}",_dark:"{colors.gray.900}"}},muted:{value:{_light:"{colors.gray.200}",_dark:"{colors.gray.800}"}},emphasized:{value:{_light:"{colors.gray.300}",_dark:"{colors.gray.700}"}},solid:{value:{_light:"{colors.gray.900}",_dark:"{colors.white}"}},focusRing:{value:{_light:"{colors.gray.400}",_dark:"{colors.gray.400}"}}},red:{contrast:{value:{_light:"white",_dark:"white"}},fg:{value:{_light:"{colors.red.700}",_dark:"{colors.red.300}"}},subtle:{value:{_light:"{colors.red.100}",_dark:"{colors.red.900}"}},muted:{value:{_light:"{colors.red.200}",_dark:"{colors.red.800}"}},emphasized:{value:{_light:"{colors.red.300}",_dark:"{colors.red.700}"}},solid:{value:{_light:"{colors.red.600}",_dark:"{colors.red.600}"}},focusRing:{value:{_light:"{colors.red.500}",_dark:"{colors.red.500}"}}},orange:{contrast:{value:{_light:"white",_dark:"black"}},fg:{value:{_light:"{colors.orange.700}",_dark:"{colors.orange.300}"}},subtle:{value:{_light:"{colors.orange.100}",_dark:"{colors.orange.900}"}},muted:{value:{_light:"{colors.orange.200}",_dark:"{colors.orange.800}"}},emphasized:{value:{_light:"{colors.orange.300}",_dark:"{colors.orange.700}"}},solid:{value:{_light:"{colors.orange.600}",_dark:"{colors.orange.500}"}},focusRing:{value:{_light:"{colors.orange.500}",_dark:"{colors.orange.500}"}}},green:{contrast:{value:{_light:"white",_dark:"white"}},fg:{value:{_light:"{colors.green.700}",_dark:"{colors.green.300}"}},subtle:{value:{_light:"{colors.green.100}",_dark:"{colors.green.900}"}},muted:{value:{_light:"{colors.green.200}",_dark:"{colors.green.800}"}},emphasized:{value:{_light:"{colors.green.300}",_dark:"{colors.green.700}"}},solid:{value:{_light:"{colors.green.600}",_dark:"{colors.green.600}"}},focusRing:{value:{_light:"{colors.green.500}",_dark:"{colors.green.500}"}}},blue:{contrast:{value:{_light:"white",_dark:"white"}},fg:{value:{_light:"{colors.blue.700}",_dark:"{colors.blue.300}"}},subtle:{value:{_light:"{colors.blue.100}",_dark:"{colors.blue.900}"}},muted:{value:{_light:"{colors.blue.200}",_dark:"{colors.blue.800}"}},emphasized:{value:{_light:"{colors.blue.300}",_dark:"{colors.blue.700}"}},solid:{value:{_light:"{colors.blue.600}",_dark:"{colors.blue.600}"}},focusRing:{value:{_light:"{colors.blue.500}",_dark:"{colors.blue.500}"}}},yellow:{contrast:{value:{_light:"black",_dark:"black"}},fg:{value:{_light:"{colors.yellow.800}",_dark:"{colors.yellow.300}"}},subtle:{value:{_light:"{colors.yellow.100}",_dark:"{colors.yellow.900}"}},muted:{value:{_light:"{colors.yellow.200}",_dark:"{colors.yellow.800}"}},emphasized:{value:{_light:"{colors.yellow.300}",_dark:"{colors.yellow.700}"}},solid:{value:{_light:"{colors.yellow.300}",_dark:"{colors.yellow.300}"}},focusRing:{value:{_light:"{colors.yellow.500}",_dark:"{colors.yellow.500}"}}},teal:{contrast:{value:{_light:"white",_dark:"white"}},fg:{value:{_light:"{colors.teal.700}",_dark:"{colors.teal.300}"}},subtle:{value:{_light:"{colors.teal.100}",_dark:"{colors.teal.900}"}},muted:{value:{_light:"{colors.teal.200}",_dark:"{colors.teal.800}"}},emphasized:{value:{_light:"{colors.teal.300}",_dark:"{colors.teal.700}"}},solid:{value:{_light:"{colors.teal.600}",_dark:"{colors.teal.600}"}},focusRing:{value:{_light:"{colors.teal.500}",_dark:"{colors.teal.500}"}}},purple:{contrast:{value:{_light:"white",_dark:"white"}},fg:{value:{_light:"{colors.purple.700}",_dark:"{colors.purple.300}"}},subtle:{value:{_light:"{colors.purple.100}",_dark:"{colors.purple.900}"}},muted:{value:{_light:"{colors.purple.200}",_dark:"{colors.purple.800}"}},emphasized:{value:{_light:"{colors.purple.300}",_dark:"{colors.purple.700}"}},solid:{value:{_light:"{colors.purple.600}",_dark:"{colors.purple.600}"}},focusRing:{value:{_light:"{colors.purple.500}",_dark:"{colors.purple.500}"}}},pink:{contrast:{value:{_light:"white",_dark:"white"}},fg:{value:{_light:"{colors.pink.700}",_dark:"{colors.pink.300}"}},subtle:{value:{_light:"{colors.pink.100}",_dark:"{colors.pink.900}"}},muted:{value:{_light:"{colors.pink.200}",_dark:"{colors.pink.800}"}},emphasized:{value:{_light:"{colors.pink.300}",_dark:"{colors.pink.700}"}},solid:{value:{_light:"{colors.pink.600}",_dark:"{colors.pink.600}"}},focusRing:{value:{_light:"{colors.pink.500}",_dark:"{colors.pink.500}"}}},cyan:{contrast:{value:{_light:"white",_dark:"white"}},fg:{value:{_light:"{colors.cyan.700}",_dark:"{colors.cyan.300}"}},subtle:{value:{_light:"{colors.cyan.100}",_dark:"{colors.cyan.900}"}},muted:{value:{_light:"{colors.cyan.200}",_dark:"{colors.cyan.800}"}},emphasized:{value:{_light:"{colors.cyan.300}",_dark:"{colors.cyan.700}"}},solid:{value:{_light:"{colors.cyan.600}",_dark:"{colors.cyan.600}"}},focusRing:{value:{_light:"{colors.cyan.500}",_dark:"{colors.cyan.500}"}}}}),rL=R0.radii({l1:{value:"{radii.xs}"},l2:{value:"{radii.sm}"},l3:{value:"{radii.md}"}}),iL=R0.shadows({xs:{value:{_light:"0px 1px 2px {colors.gray.900/10}, 0px 0px 1px {colors.gray.900/20}",_dark:"0px 1px 1px {black/64}, 0px 0px 1px inset {colors.gray.300/20}"}},sm:{value:{_light:"0px 2px 4px {colors.gray.900/10}, 0px 0px 1px {colors.gray.900/30}",_dark:"0px 2px 4px {black/64}, 0px 0px 1px inset {colors.gray.300/30}"}},md:{value:{_light:"0px 4px 8px {colors.gray.900/10}, 0px 0px 1px {colors.gray.900/30}",_dark:"0px 4px 8px {black/64}, 0px 0px 1px inset {colors.gray.300/30}"}},lg:{value:{_light:"0px 8px 16px {colors.gray.900/10}, 0px 0px 1px {colors.gray.900/30}",_dark:"0px 8px 16px {black/64}, 0px 0px 1px inset {colors.gray.300/30}"}},xl:{value:{_light:"0px 16px 24px {colors.gray.900/10}, 0px 0px 1px {colors.gray.900/30}",_dark:"0px 16px 24px {black/64}, 0px 0px 1px inset {colors.gray.300/30}"}},"2xl":{value:{_light:"0px 24px 40px {colors.gray.900/16}, 0px 0px 1px {colors.gray.900/30}",_dark:"0px 24px 40px {black/64}, 0px 0px 1px inset {colors.gray.300/30}"}},inner:{value:{_light:"inset 0 2px 4px 0 {black/5}",_dark:"inset 0 2px 4px 0 black"}},inset:{value:{_light:"inset 0 0 0 1px {black/5}",_dark:"inset 0 0 0 1px {colors.gray.300/5}"}}}),oL=Zw.extendWith("itemBody"),sL=Ie("action-bar").parts("positioner","content","separator","selectionTrigger","closeTrigger"),aL=Ie("alert").parts("title","description","root","indicator","content"),lL=Ie("breadcrumb").parts("link","currentLink","item","list","root","ellipsis","separator"),cL=Ie("blockquote").parts("root","icon","content","caption"),uL=Ie("card").parts("root","header","body","footer","title","description"),dL=Ie("checkbox-card",["root","control","label","description","addon","indicator","content"]),fL=Ie("data-list").parts("root","item","itemLabel","itemValue"),hL=m0.extendWith("header","body","footer","backdrop"),pL=m0.extendWith("header","body","footer","backdrop"),gL=I1.extendWith("textarea"),mL=Ie("empty-state",["root","content","indicator","title","description"]),yL=T1.extendWith("requiredIndicator"),bL=P1.extendWith("content"),vL=N1.extendWith("itemContent","dropzoneContent","fileText"),wL=Ie("list").parts("root","item","indicator"),xL=z1.extendWith("itemCommand"),EL=Ie("select").parts("root","field","indicator"),SL=ox.extendWith("header","body","footer"),b2=O0.extendWith("itemAddon","itemIndicator"),AL=b2.extendWith("itemContent","itemDescription"),kL=ax.extendWith("itemIndicator"),v2=cx.extendWith("indicatorGroup"),CL=v1.extendWith("indicatorGroup","empty"),IL=hx.extendWith("markerIndicator"),OL=Ie("stat").parts("root","label","helpText","valueText","valueUnit","indicator"),TL=Ie("status").parts("root","indicator"),PL=Ie("steps",["root","list","item","trigger","indicator","separator","content","title","description","nextTrigger","prevTrigger","progress"]),NL=px.extendWith("indicator"),w2=Ie("table").parts("root","header","body","row","columnHeader","cell","footer","caption"),BL=Ie("toast").parts("root","title","description","indicator","closeTrigger","actionTrigger"),RL=Ie("tabs").parts("root","trigger","list","content","contentGroup","indicator"),ML=Ie("tag").parts("root","label","closeTrigger","startElement","endElement"),LL=Ie("timeline").parts("root","item","content","separator","indicator","connector","title","description"),FL=J6.extendWith("channelText"),_L=Ie("code-block",["root","content","title","header","footer","control","overlay","code","codeText","copyTrigger","copyIndicator","collapseTrigger","collapseIndicator","collapseText"]);a1.extendWith("valueText");const VL=Oe({className:"chakra-accordion",slots:oL.keys(),base:{root:{width:"full","--accordion-radius":"radii.l2"},item:{overflowAnchor:"none"},itemTrigger:{display:"flex",alignItems:"center",textAlign:"start",width:"full",outline:"0",gap:"3",fontWeight:"medium",borderRadius:"var(--accordion-radius)",_focusVisible:{outline:"2px solid",outlineColor:"colorPalette.focusRing"},_disabled:{layerStyle:"disabled"}},itemBody:{pt:"var(--accordion-padding-y)",pb:"calc(var(--accordion-padding-y) * 2)"},itemContent:{overflow:"hidden",borderRadius:"var(--accordion-radius)",_open:{animationName:"expand-height, fade-in",animationDuration:"moderate"},_closed:{animationName:"collapse-height, fade-out",animationDuration:"moderate"}},itemIndicator:{transition:"rotate 0.2s",transformOrigin:"center",color:"fg.subtle",_open:{rotate:"180deg"},_icon:{width:"1.2em",height:"1.2em"}}},variants:{variant:{outline:{item:{borderBottomWidth:"1px"}},subtle:{itemTrigger:{px:"var(--accordion-padding-x)"},itemContent:{px:"var(--accordion-padding-x)"},item:{borderRadius:"var(--accordion-radius)",_open:{bg:"colorPalette.subtle"}}},enclosed:{root:{borderWidth:"1px",borderRadius:"var(--accordion-radius)",divideY:"1px",overflow:"hidden"},itemTrigger:{px:"var(--accordion-padding-x)"},itemContent:{px:"var(--accordion-padding-x)"},item:{_open:{bg:"bg.subtle"}}},plain:{}},size:{sm:{root:{"--accordion-padding-x":"spacing.3","--accordion-padding-y":"spacing.2"},itemTrigger:{textStyle:"sm",py:"var(--accordion-padding-y)"}},md:{root:{"--accordion-padding-x":"spacing.4","--accordion-padding-y":"spacing.2"},itemTrigger:{textStyle:"md",py:"var(--accordion-padding-y)"}},lg:{root:{"--accordion-padding-x":"spacing.4.5","--accordion-padding-y":"spacing.2.5"},itemTrigger:{textStyle:"lg",py:"var(--accordion-padding-y)"}}}},defaultVariants:{size:"md",variant:"outline"}}),DL=Oe({className:"chakra-action-bar",slots:sL.keys(),base:{positioner:{position:"fixed",display:"flex",justifyContent:"center",pointerEvents:"none",insetInline:"0",top:"unset",bottom:"calc(env(safe-area-inset-bottom) + 20px)"},content:{bg:"bg.panel",shadow:"md",display:"flex",alignItems:"center",gap:"3",borderRadius:"l3",py:"2.5",px:"3",pointerEvents:"auto",translate:"calc(-1 * var(--scrollbar-width) / 2) 0px",_open:{animationName:"slide-from-bottom, fade-in",animationDuration:"moderate"},_closed:{animationName:"slide-to-bottom, fade-out",animationDuration:"faster"}},separator:{width:"1px",height:"5",bg:"border"},selectionTrigger:{display:"inline-flex",alignItems:"center",gap:"2",alignSelf:"stretch",textStyle:"sm",px:"4",py:"1",borderRadius:"l2",borderWidth:"1px",borderStyle:"dashed"}}}),zL=Oe({slots:aL.keys(),className:"chakra-alert",base:{root:{width:"full",display:"flex",alignItems:"flex-start",position:"relative",borderRadius:"l3"},title:{fontWeight:"medium"},description:{display:"inline"},indicator:{display:"inline-flex",alignItems:"center",justifyContent:"center",flexShrink:"0",width:"1em",height:"1em",_icon:{boxSize:"full"}},content:{display:"flex",flex:"1",gap:"1"}},variants:{status:{info:{root:{colorPalette:"blue"}},warning:{root:{colorPalette:"orange"}},success:{root:{colorPalette:"green"}},error:{root:{colorPalette:"red"}},neutral:{root:{colorPalette:"gray"}}},inline:{true:{content:{display:"inline-flex",flexDirection:"row",alignItems:"center"}},false:{content:{display:"flex",flexDirection:"column"}}},variant:{subtle:{root:{bg:"colorPalette.subtle",color:"colorPalette.fg"}},surface:{root:{bg:"colorPalette.subtle",color:"colorPalette.fg",shadow:"inset 0 0 0px 1px var(--shadow-color)",shadowColor:"colorPalette.muted"},indicator:{color:"colorPalette.fg"}},outline:{root:{color:"colorPalette.fg",shadow:"inset 0 0 0px 1px var(--shadow-color)",shadowColor:"colorPalette.muted"},indicator:{color:"colorPalette.fg"}},solid:{root:{bg:"colorPalette.solid",color:"colorPalette.contrast"},indicator:{color:"colorPalette.contrast"}}},size:{sm:{root:{gap:"2",px:"3",py:"3",textStyle:"xs"},indicator:{textStyle:"lg"}},md:{root:{gap:"3",px:"4",py:"4",textStyle:"sm"},indicator:{textStyle:"xl"}},lg:{root:{gap:"3",px:"4",py:"4",textStyle:"md"},indicator:{textStyle:"2xl"}}}},defaultVariants:{status:"info",variant:"subtle",size:"md",inline:!1}}),UL=Oe({slots:n1.keys(),className:"chakra-avatar",base:{root:{display:"inline-flex",alignItems:"center",justifyContent:"center",fontWeight:"medium",position:"relative",verticalAlign:"top",flexShrink:"0",userSelect:"none",width:"var(--avatar-size)",height:"var(--avatar-size)",fontSize:"var(--avatar-font-size)",borderRadius:"var(--avatar-radius)","&[data-group-item]":{borderWidth:"2px",borderColor:"bg"}},image:{width:"100%",height:"100%",objectFit:"cover",borderRadius:"var(--avatar-radius)"},fallback:{lineHeight:"1",textTransform:"uppercase",fontWeight:"medium",fontSize:"var(--avatar-font-size)",borderRadius:"var(--avatar-radius)"}},variants:{size:{full:{root:{"--avatar-size":"100%","--avatar-font-size":"100%"}},"2xs":{root:{"--avatar-font-size":"fontSizes.2xs","--avatar-size":"sizes.6"}},xs:{root:{"--avatar-font-size":"fontSizes.xs","--avatar-size":"sizes.8"}},sm:{root:{"--avatar-font-size":"fontSizes.sm","--avatar-size":"sizes.9"}},md:{root:{"--avatar-font-size":"fontSizes.md","--avatar-size":"sizes.10"}},lg:{root:{"--avatar-font-size":"fontSizes.md","--avatar-size":"sizes.11"}},xl:{root:{"--avatar-font-size":"fontSizes.lg","--avatar-size":"sizes.12"}},"2xl":{root:{"--avatar-font-size":"fontSizes.xl","--avatar-size":"sizes.16"}}},variant:{solid:{root:{bg:"colorPalette.solid",color:"colorPalette.contrast"}},subtle:{root:{bg:"colorPalette.muted",color:"colorPalette.fg"}},outline:{root:{color:"colorPalette.fg",borderWidth:"1px",borderColor:"colorPalette.muted"}}},shape:{square:{},rounded:{root:{"--avatar-radius":"radii.l3"}},full:{root:{"--avatar-radius":"radii.full"}}},borderless:{true:{root:{"&[data-group-item]":{borderWidth:"0px"}}}}},defaultVariants:{size:"md",shape:"full",variant:"subtle"}}),$L=Oe({className:"chakra-blockquote",slots:cL.keys(),base:{root:{position:"relative",display:"flex",flexDirection:"column",gap:"2"},caption:{textStyle:"sm",color:"fg.muted"},icon:{boxSize:"5"}},variants:{justify:{start:{root:{alignItems:"flex-start",textAlign:"start"}},center:{root:{alignItems:"center",textAlign:"center"}},end:{root:{alignItems:"flex-end",textAlign:"end"}}},variant:{subtle:{root:{paddingX:"5",borderStartWidth:"4px",borderStartColor:"colorPalette.muted"},icon:{color:"colorPalette.fg"}},solid:{root:{paddingX:"5",borderStartWidth:"4px",borderStartColor:"colorPalette.solid"},icon:{color:"colorPalette.solid"}},plain:{root:{paddingX:"5"},icon:{color:"colorPalette.solid"}}}},defaultVariants:{variant:"subtle",justify:"start"}}),HL=Oe({className:"chakra-breadcrumb",slots:lL.keys(),base:{list:{display:"flex",alignItems:"center",wordBreak:"break-word",color:"fg.muted",listStyle:"none"},link:{outline:"0",textDecoration:"none",borderRadius:"l1",focusRing:"outside",display:"inline-flex",alignItems:"center",gap:"2"},item:{display:"inline-flex",alignItems:"center"},separator:{color:"fg.muted",opacity:"0.8",_icon:{boxSize:"1em"},_rtl:{rotate:"180deg"}},ellipsis:{display:"inline-flex",alignItems:"center",justifyContent:"center",_icon:{boxSize:"1em"}}},variants:{variant:{underline:{link:{color:"colorPalette.fg",textDecoration:"underline",textUnderlineOffset:"0.2em",textDecorationColor:"colorPalette.muted"},currentLink:{color:"colorPalette.fg"}},plain:{link:{color:"fg.muted",_hover:{color:"fg"}},currentLink:{color:"fg"}}},size:{sm:{list:{gap:"1",textStyle:"xs"}},md:{list:{gap:"1.5",textStyle:"sm"}},lg:{list:{gap:"2",textStyle:"md"}}}},defaultVariants:{variant:"plain",size:"md"}}),WL=Oe({className:"chakra-card",slots:uL.keys(),base:{root:{display:"flex",flexDirection:"column",position:"relative",minWidth:"0",wordWrap:"break-word",borderRadius:"l3",color:"fg",textAlign:"start"},title:{fontWeight:"semibold"},description:{color:"fg.muted",fontSize:"sm"},header:{paddingInline:"var(--card-padding)",paddingTop:"var(--card-padding)",display:"flex",flexDirection:"column",gap:"1.5"},body:{padding:"var(--card-padding)",flex:"1",display:"flex",flexDirection:"column"},footer:{display:"flex",alignItems:"center",gap:"2",paddingInline:"var(--card-padding)",paddingBottom:"var(--card-padding)"}},variants:{size:{sm:{root:{"--card-padding":"spacing.4"},title:{textStyle:"md"}},md:{root:{"--card-padding":"spacing.6"},title:{textStyle:"lg"}},lg:{root:{"--card-padding":"spacing.7"},title:{textStyle:"xl"}}},variant:{elevated:{root:{bg:"bg.panel",boxShadow:"md"}},outline:{root:{bg:"bg.panel",borderWidth:"1px",borderColor:"border"}},subtle:{root:{bg:"bg.muted"}}}},defaultVariants:{variant:"outline",size:"md"}}),GL=Oe({slots:Q6.keys(),className:"chakra-checkbox",base:{root:{display:"inline-flex",gap:"2",alignItems:"center",verticalAlign:"top",position:"relative"},control:mn.base,label:{fontWeight:"medium",userSelect:"none",_disabled:{opacity:"0.5"}}},variants:{size:{xs:{root:{gap:"1.5"},label:{textStyle:"xs"},control:(aO=(sO=mn.variants)==null?void 0:sO.size)==null?void 0:aO.xs},sm:{root:{gap:"2"},label:{textStyle:"sm"},control:(cO=(lO=mn.variants)==null?void 0:lO.size)==null?void 0:cO.sm},md:{root:{gap:"2.5"},label:{textStyle:"sm"},control:(dO=(uO=mn.variants)==null?void 0:uO.size)==null?void 0:dO.md},lg:{root:{gap:"3"},label:{textStyle:"md"},control:(hO=(fO=mn.variants)==null?void 0:fO.size)==null?void 0:hO.lg}},variant:{outline:{control:(gO=(pO=mn.variants)==null?void 0:pO.variant)==null?void 0:gO.outline},solid:{control:(yO=(mO=mn.variants)==null?void 0:mO.variant)==null?void 0:yO.solid},subtle:{control:(vO=(bO=mn.variants)==null?void 0:bO.variant)==null?void 0:vO.subtle}}},defaultVariants:{variant:"solid",size:"md"}}),jL=Oe({slots:dL.keys(),className:"chakra-checkbox-card",base:{root:{display:"flex",flexDirection:"column",userSelect:"none",position:"relative",borderRadius:"l2",flex:"1",focusVisibleRing:"outside",_disabled:{opacity:"0.8"},_invalid:{outline:"2px solid",outlineColor:"border.error"}},control:{display:"inline-flex",flex:"1",position:"relative",borderRadius:"inherit",justifyContent:"var(--checkbox-card-justify)",alignItems:"var(--checkbox-card-align)"},label:{fontWeight:"medium",display:"flex",alignItems:"center",gap:"2",flex:"1",_disabled:{opacity:"0.5"}},description:{opacity:"0.64",textStyle:"sm",_disabled:{opacity:"0.5"}},addon:{_disabled:{opacity:"0.5"}},indicator:mn.base,content:{display:"flex",flexDirection:"column",flex:"1",gap:"1",justifyContent:"var(--checkbox-card-justify)",alignItems:"var(--checkbox-card-align)"}},variants:{size:{sm:{root:{textStyle:"sm"},control:{padding:"3",gap:"1.5"},addon:{px:"3",py:"1.5",borderTopWidth:"1px"},indicator:(wO=mn.variants)==null?void 0:wO.size.sm},md:{root:{textStyle:"sm"},control:{padding:"4",gap:"2.5"},addon:{px:"4",py:"2",borderTopWidth:"1px"},indicator:(xO=mn.variants)==null?void 0:xO.size.md},lg:{root:{textStyle:"md"},control:{padding:"4",gap:"3.5"},addon:{px:"4",py:"2",borderTopWidth:"1px"},indicator:(EO=mn.variants)==null?void 0:EO.size.lg}},variant:{surface:{root:{borderWidth:"1px",borderColor:"border",_checked:{bg:"colorPalette.subtle",color:"colorPalette.fg",borderColor:"colorPalette.muted"},_disabled:{bg:"bg.muted"}},indicator:(SO=mn.variants)==null?void 0:SO.variant.solid},subtle:{root:{bg:"bg.muted"},control:{_checked:{bg:"colorPalette.muted",color:"colorPalette.fg"}},indicator:(AO=mn.variants)==null?void 0:AO.variant.plain},outline:{root:{borderWidth:"1px",borderColor:"border",_checked:{boxShadow:"0 0 0 1px var(--shadow-color)",boxShadowColor:"colorPalette.solid",borderColor:"colorPalette.solid"}},indicator:(kO=mn.variants)==null?void 0:kO.variant.solid},solid:{root:{borderWidth:"1px",_checked:{bg:"colorPalette.solid",color:"colorPalette.contrast",borderColor:"colorPalette.solid"}},indicator:(CO=mn.variants)==null?void 0:CO.variant.inverted}},justify:{start:{root:{"--checkbox-card-justify":"flex-start"}},end:{root:{"--checkbox-card-justify":"flex-end"}},center:{root:{"--checkbox-card-justify":"center"}}},align:{start:{root:{"--checkbox-card-align":"flex-start"},content:{textAlign:"start"}},end:{root:{"--checkbox-card-align":"flex-end"},content:{textAlign:"end"}},center:{root:{"--checkbox-card-align":"center"},content:{textAlign:"center"}}},orientation:{vertical:{control:{flexDirection:"column"}},horizontal:{control:{flexDirection:"row"}}}},defaultVariants:{size:"md",variant:"outline",align:"start",orientation:"horizontal"}}),KL=Oe({slots:_L.keys(),className:"code-block",base:{root:{colorPalette:"gray",rounded:"var(--code-block-radius)",overflow:"hidden",bg:"bg",color:"fg",borderWidth:"1px","--code-block-max-height":"320px","--code-block-bg":"colors.bg","--code-block-fg":"colors.fg","--code-block-obscured-opacity":"0.5","--code-block-obscured-blur":"1px","--code-block-line-number-width":"sizes.3","--code-block-line-number-margin":"spacing.4","--code-block-highlight-bg":"{colors.teal.focusRing/20}","--code-block-highlight-border":"colors.teal.focusRing","--code-block-highlight-added-bg":"{colors.green.focusRing/20}","--code-block-highlight-added-border":"colors.green.focusRing","--code-block-highlight-removed-bg":"{colors.red.focusRing/20}","--code-block-highlight-removed-border":"colors.red.focusRing"},header:{display:"flex",alignItems:"center",gap:"2",position:"relative",px:"var(--code-block-padding)",minH:"var(--code-block-header-height)",mb:"calc(var(--code-block-padding) / 2 * -1)"},title:{display:"inline-flex",alignItems:"center",gap:"1.5",flex:"1",color:"fg.muted"},control:{gap:"1.5",display:"inline-flex",alignItems:"center"},footer:{display:"flex",alignItems:"center",justifyContent:"center",gap:"2",px:"var(--code-block-padding)",minH:"var(--code-block-header-height)"},content:{position:"relative",colorScheme:"dark",overflow:"hidden",borderBottomRadius:"var(--code-block-radius)",maxHeight:"var(--code-block-max-height)","& ::selection":{bg:"blue.500/40"},_expanded:{maxHeight:"unset"}},overlay:{"--bg":"{colors.black/50}",display:"flex",alignItems:"flex-end",justifyContent:"center",padding:"4",bgImage:"linear-gradient(0deg,var(--bg) 25%,transparent 100%)",color:"white",minH:"5rem",pos:"absolute",bottom:"0",insetInline:"0",zIndex:"1",fontWeight:"medium",_expanded:{display:"none"}},code:{fontFamily:"mono",lineHeight:"tall",whiteSpace:"pre",counterReset:"line 0"},codeText:{px:"var(--code-block-padding)",py:"var(--code-block-padding)",position:"relative",display:"block",width:"100%","&[data-has-focused]":{"& [data-line]:not([data-focused])":{transitionProperty:"opacity, filter",transitionDuration:"moderate",transitionTimingFunction:"ease-in-out",opacity:"var(--code-block-obscured-opacity)",filter:"blur(var(--code-block-obscured-blur))"},"&:hover":{"--code-block-obscured-opacity":"1","--code-block-obscured-blur":"0px"}},"&[data-has-line-numbers][data-plaintext]":{paddingInlineStart:"calc(var(--code-block-line-number-width) + var(--code-block-line-number-margin) + var(--code-block-padding))"},"& [data-line]":{position:"relative","--highlight-bg":"var(--code-block-highlight-bg)","--highlight-border":"var(--code-block-highlight-border)","&[data-highlight], &[data-diff]":{display:"inline-block",width:"full","&:after":{content:"''",display:"block",position:"absolute",insetStart:"calc(var(--code-block-padding) * -1)",insetEnd:"0px",width:"calc(100% + var(--code-block-padding) * 2)",height:"100%",bg:"var(--highlight-bg)",borderStartWidth:"2px",borderStartColor:"var(--highlight-border)"}},"&[data-diff='added']":{"--highlight-bg":"var(--code-block-highlight-added-bg)","--highlight-border":"var(--code-block-highlight-added-border)"},"&[data-diff='removed']":{"--highlight-bg":"var(--code-block-highlight-removed-bg)","--highlight-border":"var(--code-block-highlight-removed-border)"}},"&[data-word-wrap]":{"&[data-plaintext], & [data-line]":{whiteSpace:"pre-wrap",wordBreak:"break-all"}},"&[data-has-line-numbers]":{"--content":"counter(line)","& [data-line]:before":{content:"var(--content)",counterIncrement:"line",width:"var(--code-block-line-number-width)",marginRight:"var(--code-block-line-number-margin)",display:"inline-block",textAlign:"end",userSelect:"none",opacity:.4},"& [data-diff='added']:before":{content:"'+'"},"& [data-diff='removed']:before":{content:"'-'"}}}},variants:{size:{sm:{root:{"--code-block-padding":"spacing.4","--code-block-radius":"radii.md","--code-block-header-height":"sizes.8"},title:{textStyle:"xs"},code:{fontSize:"xs"}},md:{root:{"--code-block-padding":"spacing.4","--code-block-radius":"radii.lg","--code-block-header-height":"sizes.10"},title:{textStyle:"xs"},code:{fontSize:"sm"}},lg:{root:{"--code-block-padding":"spacing.5","--code-block-radius":"radii.xl","--code-block-header-height":"sizes.12"},title:{textStyle:"sm"},code:{fontSize:"sm"}}}},defaultVariants:{size:"md"}}),qL=Oe({slots:fw.keys(),className:"chakra-collapsible",base:{content:{overflow:"hidden",_open:{animationName:"expand-height, fade-in",animationDuration:"moderate"},_closed:{animationName:"collapse-height, fade-out",animationDuration:"moderate"}}}}),YL=Oe({className:"colorPicker",slots:FL.keys(),base:{root:{display:"flex",flexDirection:"column",gap:"1.5"},label:{color:"fg",fontWeight:"medium",textStyle:"sm",_disabled:{opacity:"0.5"}},valueText:{textAlign:"start"},control:{display:"flex",alignItems:"center",flexDirection:"row",gap:"2",position:"relative"},swatchTrigger:{display:"flex",alignItems:"center",justifyContent:"center"},trigger:{display:"flex",alignItems:"center",justifyContent:"center",flexDirection:"row",flexShrink:"0",gap:"2",textStyle:"sm",minH:"var(--input-height)",minW:"var(--input-height)",px:"1",rounded:"l2",_disabled:{opacity:"0.5"},"--focus-color":"colors.colorPalette.focusRing","&:focus-visible":{borderColor:"var(--focus-color)",outline:"1px solid var(--focus-color)"},"&[data-fit-content]":{"--input-height":"unset",px:"0",border:"0"}},content:{display:"flex",flexDirection:"column",bg:"bg.panel",borderRadius:"l3",boxShadow:"lg",width:"64",p:"4",gap:"3",zIndex:"dropdown",_open:{animationStyle:"slide-fade-in",animationDuration:"fast"},_closed:{animationStyle:"slide-fade-out",animationDuration:"faster"}},area:{height:"180px",borderRadius:"l2",overflow:"hidden"},areaThumb:{borderRadius:"full",height:"var(--thumb-size)",width:"var(--thumb-size)",borderWidth:"2px",borderColor:"white",shadow:"sm",focusVisibleRing:"mixed",focusRingColor:"white"},areaBackground:{height:"full"},channelSlider:{borderRadius:"l2",flex:"1"},channelSliderTrack:{height:"var(--slider-height)",borderRadius:"inherit",boxShadow:"inset 0 0 0 1px rgba(0,0,0,0.1)"},channelText:{textStyle:"xs",color:"fg.muted",fontWeight:"medium",textTransform:"capitalize"},swatchGroup:{display:"flex",flexDirection:"row",flexWrap:"wrap",gap:"2"},swatch:{...y2.base,borderRadius:"l1"},swatchIndicator:{color:"white",rounded:"full"},channelSliderThumb:{borderRadius:"full",height:"var(--thumb-size)",width:"var(--thumb-size)",borderWidth:"2px",borderColor:"white",shadow:"sm",transform:"translate(-50%, -50%)",focusVisibleRing:"outside",focusRingOffset:"1px"},channelInput:{...Mt.base,"&::-webkit-inner-spin-button, &::-webkit-outer-spin-button":{WebkitAppearance:"none",margin:0}},formatSelect:{textStyle:"xs",textTransform:"uppercase",borderWidth:"1px",minH:"6",focusRing:"inside",rounded:"l2"},transparencyGrid:{borderRadius:"l2"},view:{display:"flex",flexDirection:"column",gap:"2"}},variants:{size:{"2xs":{channelInput:(OO=(IO=Mt.variants)==null?void 0:IO.size)==null?void 0:OO["2xs"],swatch:{"--swatch-size":"sizes.4.5"},trigger:{"--input-height":"sizes.7"},area:{"--thumb-size":"sizes.3"},channelSlider:{"--slider-height":"sizes.3","--thumb-size":"sizes.3"}},xs:{channelInput:(PO=(TO=Mt.variants)==null?void 0:TO.size)==null?void 0:PO.xs,swatch:{"--swatch-size":"sizes.5"},trigger:{"--input-height":"sizes.8"},area:{"--thumb-size":"sizes.3.5"},channelSlider:{"--slider-height":"sizes.3.5","--thumb-size":"sizes.3.5"}},sm:{channelInput:(BO=(NO=Mt.variants)==null?void 0:NO.size)==null?void 0:BO.sm,swatch:{"--swatch-size":"sizes.6"},trigger:{"--input-height":"sizes.9"},area:{"--thumb-size":"sizes.3.5"},channelSlider:{"--slider-height":"sizes.3.5","--thumb-size":"sizes.3.5"}},md:{channelInput:(MO=(RO=Mt.variants)==null?void 0:RO.size)==null?void 0:MO.md,swatch:{"--swatch-size":"sizes.7"},trigger:{"--input-height":"sizes.10"},area:{"--thumb-size":"sizes.3.5"},channelSlider:{"--slider-height":"sizes.3.5","--thumb-size":"sizes.3.5"}},lg:{channelInput:(FO=(LO=Mt.variants)==null?void 0:LO.size)==null?void 0:FO.lg,swatch:{"--swatch-size":"sizes.7"},trigger:{"--input-height":"sizes.11"},area:{"--thumb-size":"sizes.3.5"},channelSlider:{"--slider-height":"sizes.3.5","--thumb-size":"sizes.3.5"}},xl:{channelInput:(VO=(_O=Mt.variants)==null?void 0:_O.size)==null?void 0:VO.xl,swatch:{"--swatch-size":"sizes.8"},trigger:{"--input-height":"sizes.12"},area:{"--thumb-size":"sizes.3.5"},channelSlider:{"--slider-height":"sizes.3.5","--thumb-size":"sizes.3.5"}},"2xl":{channelInput:(zO=(DO=Mt.variants)==null?void 0:DO.size)==null?void 0:zO["2xl"],swatch:{"--swatch-size":"sizes.10"},trigger:{"--input-height":"sizes.16"},area:{"--thumb-size":"sizes.3.5"},channelSlider:{"--slider-height":"sizes.3.5","--thumb-size":"sizes.3.5"}}},variant:{outline:{channelInput:($O=(UO=Mt.variants)==null?void 0:UO.variant)==null?void 0:$O.outline,trigger:{borderWidth:"1px"}},subtle:{channelInput:(WO=(HO=Mt.variants)==null?void 0:HO.variant)==null?void 0:WO.subtle,trigger:{borderWidth:"1px",borderColor:"transparent",bg:"bg.muted"}}}},defaultVariants:{size:"md",variant:"outline"}}),QL=Oe({className:"chakra-combobox",slots:CL.keys(),base:{root:{display:"flex",flexDirection:"column",gap:"1.5",width:"full"},label:{fontWeight:"medium",userSelect:"none",textStyle:"sm",_disabled:{layerStyle:"disabled"}},input:{display:"flex",alignItems:"center",justifyContent:"space-between",background:"bg.panel",width:"full",minH:"var(--combobox-input-height)",px:"var(--combobox-input-padding-x)","--input-height":"var(--combobox-input-height)",borderRadius:"l2",outline:0,userSelect:"none",textAlign:"start",_placeholderShown:{color:"fg.muted"},_disabled:{layerStyle:"disabled"},"--focus-color":"colors.colorPalette.focusRing","--error-color":"colors.border.error",_invalid:{focusRingColor:"var(--error-color)",borderColor:"var(--error-color)"}},trigger:{display:"inline-flex",alignItems:"center",justifyContent:"center","--input-height":"var(--combobox-input-height)"},clearTrigger:{color:"fg.muted",pointerEvents:"auto",focusVisibleRing:"inside",focusRingWidth:"2px",rounded:"l1"},control:{pos:"relative"},indicatorGroup:{display:"flex",alignItems:"center",justifyContent:"center",gap:"1",pos:"absolute",insetEnd:"0",top:"0",bottom:"0",px:"var(--combobox-input-padding-x)",_icon:{boxSize:"var(--combobox-indicator-size)"},"[data-disabled] &":{opacity:.5}},content:{background:"bg.panel",display:"flex",flexDirection:"column",zIndex:"dropdown",borderRadius:"l2",outline:0,maxH:"96",overflowY:"auto",boxShadow:"md",_open:{animationStyle:"slide-fade-in",animationDuration:"fast"},_closed:{animationStyle:"slide-fade-out",animationDuration:"0s"},"&[data-empty]:not(:has([data-scope=combobox][data-part=empty]))":{opacity:0}},item:{position:"relative",userSelect:"none",display:"flex",alignItems:"center",gap:"2",py:"var(--combobox-item-padding-y)",px:"var(--combobox-item-padding-x)",cursor:"option",justifyContent:"space-between",flex:"1",textAlign:"start",borderRadius:"l1",_highlighted:{bg:"bg.emphasized/60"},_disabled:{pointerEvents:"none",opacity:"0.5"},_icon:{boxSize:"var(--combobox-indicator-size)"}},empty:{py:"var(--combobox-item-padding-y)",px:"var(--combobox-item-padding-x)"},itemText:{flex:"1"},itemGroup:{pb:"var(--combobox-item-padding-y)",_last:{pb:"0"}},itemGroupLabel:{fontWeight:"medium",py:"var(--combobox-item-padding-y)",px:"var(--combobox-item-padding-x)"}},variants:{variant:{outline:{input:{bg:"transparent",borderWidth:"1px",borderColor:"border",focusVisibleRing:"inside"}},subtle:{input:{borderWidth:"1px",borderColor:"transparent",bg:"bg.muted",focusVisibleRing:"inside"}},flushed:{input:{bg:"transparent",borderBottomWidth:"1px",borderBottomColor:"border",borderRadius:"0",px:"0",_focusVisible:{borderColor:"var(--focus-color)",boxShadow:"0px 1px 0px 0px var(--focus-color)"}},indicatorGroup:{px:"0"}}},size:{xs:{root:{"--combobox-input-height":"sizes.8","--combobox-input-padding-x":"spacing.2","--combobox-indicator-size":"sizes.3.5"},input:{textStyle:"xs"},content:{"--combobox-item-padding-x":"spacing.1.5","--combobox-item-padding-y":"spacing.1","--combobox-indicator-size":"sizes.3.5",p:"1",textStyle:"xs"},trigger:{textStyle:"xs",gap:"1"}},sm:{root:{"--combobox-input-height":"sizes.9","--combobox-input-padding-x":"spacing.2.5","--combobox-indicator-size":"sizes.4"},input:{textStyle:"sm"},content:{"--combobox-item-padding-x":"spacing.2","--combobox-item-padding-y":"spacing.1.5","--combobox-indicator-size":"sizes.4",p:"1",textStyle:"sm"},trigger:{textStyle:"sm",gap:"1"}},md:{root:{"--combobox-input-height":"sizes.10","--combobox-input-padding-x":"spacing.3","--combobox-indicator-size":"sizes.4"},input:{textStyle:"sm"},content:{"--combobox-item-padding-x":"spacing.2","--combobox-item-padding-y":"spacing.1.5","--combobox-indicator-size":"sizes.4",p:"1",textStyle:"sm"},itemIndicator:{display:"flex",alignItems:"center",justifyContent:"center"},trigger:{textStyle:"sm",gap:"2"}},lg:{root:{"--combobox-input-height":"sizes.12","--combobox-input-padding-x":"spacing.4","--combobox-indicator-size":"sizes.5"},input:{textStyle:"md"},content:{"--combobox-item-padding-y":"spacing.2","--combobox-item-padding-x":"spacing.3","--combobox-indicator-size":"sizes.5",p:"1.5",textStyle:"md"},trigger:{textStyle:"md",py:"3",gap:"2"}}}},defaultVariants:{size:"md",variant:"outline"}}),XL=Oe({slots:fL.keys(),className:"chakra-data-list",base:{itemLabel:{display:"flex",alignItems:"center",gap:"1"},itemValue:{display:"flex",minWidth:"0",flex:"1"}},variants:{orientation:{horizontal:{root:{display:"flex",flexDirection:"column"},item:{display:"inline-flex",alignItems:"center",gap:"4"},itemLabel:{minWidth:"120px"}},vertical:{root:{display:"flex",flexDirection:"column"},item:{display:"flex",flexDirection:"column",gap:"1"}}},size:{sm:{root:{gap:"3"},item:{textStyle:"xs"}},md:{root:{gap:"4"},item:{textStyle:"sm"}},lg:{root:{gap:"5"},item:{textStyle:"md"}}},variant:{subtle:{itemLabel:{color:"fg.muted"}},bold:{itemLabel:{fontWeight:"medium"},itemValue:{color:"fg.muted"}}}},defaultVariants:{size:"md",orientation:"vertical",variant:"subtle"}}),JL=Oe({slots:hL.keys(),className:"chakra-dialog",base:{backdrop:{bg:"blackAlpha.500",pos:"fixed",left:0,top:0,w:"100dvw",h:"100dvh",zIndex:"var(--z-index)",_open:{animationName:"fade-in",animationDuration:"slow"},_closed:{animationName:"fade-out",animationDuration:"moderate"}},positioner:{display:"flex",width:"100dvw",height:"100dvh",position:"fixed",left:0,top:0,"--dialog-z-index":"zIndex.modal",zIndex:"calc(var(--dialog-z-index) + var(--layer-index, 0))",justifyContent:"center",overscrollBehaviorY:"none"},content:{display:"flex",flexDirection:"column",position:"relative",width:"100%",outline:0,borderRadius:"l3",textStyle:"sm",my:"var(--dialog-margin, var(--dialog-base-margin))","--dialog-z-index":"zIndex.modal",zIndex:"calc(var(--dialog-z-index) + var(--layer-index, 0))",bg:"bg.panel",boxShadow:"lg",_open:{animationDuration:"moderate"},_closed:{animationDuration:"faster"}},header:{display:"flex",gap:"2",flex:0,px:"6",pt:"6",pb:"4"},body:{flex:"1",px:"6",pt:"2",pb:"6"},footer:{display:"flex",alignItems:"center",justifyContent:"flex-end",gap:"3",px:"6",pt:"2",pb:"4"},title:{textStyle:"lg",fontWeight:"semibold"},description:{color:"fg.muted"},closeTrigger:{pos:"absolute",top:"2",insetEnd:"2"}},variants:{placement:{center:{positioner:{alignItems:"center"},content:{"--dialog-base-margin":"auto",mx:"auto"}},top:{positioner:{alignItems:"flex-start"},content:{"--dialog-base-margin":"spacing.16",mx:"auto"}},bottom:{positioner:{alignItems:"flex-end"},content:{"--dialog-base-margin":"spacing.16",mx:"auto"}}},scrollBehavior:{inside:{positioner:{overflow:"hidden"},content:{maxH:"calc(100% - 7.5rem)"},body:{overflow:"auto"}},outside:{positioner:{overflow:"auto",pointerEvents:"auto"}}},size:{xs:{content:{maxW:"sm"}},sm:{content:{maxW:"md"}},md:{content:{maxW:"lg"}},lg:{content:{maxW:"2xl"}},xl:{content:{maxW:"4xl"}},cover:{positioner:{padding:"10"},content:{width:"100%",height:"100%","--dialog-margin":"0"}},full:{content:{maxW:"100dvw",minH:"100dvh","--dialog-margin":"0",borderRadius:"0"}}},motionPreset:{scale:{content:{_open:{animationName:"scale-in, fade-in"},_closed:{animationName:"scale-out, fade-out"}}},"slide-in-bottom":{content:{_open:{animationName:"slide-from-bottom, fade-in"},_closed:{animationName:"slide-to-bottom, fade-out"}}},"slide-in-top":{content:{_open:{animationName:"slide-from-top, fade-in"},_closed:{animationName:"slide-to-top, fade-out"}}},"slide-in-left":{content:{_open:{animationName:"slide-from-left, fade-in"},_closed:{animationName:"slide-to-left, fade-out"}}},"slide-in-right":{content:{_open:{animationName:"slide-from-right, fade-in"},_closed:{animationName:"slide-to-right, fade-out"}}},none:{}}},defaultVariants:{size:"md",scrollBehavior:"outside",placement:"top",motionPreset:"scale"}}),ZL=Oe({slots:pL.keys(),className:"chakra-drawer",base:{backdrop:{bg:"blackAlpha.500",pos:"fixed",insetInlineStart:0,top:0,w:"100vw",h:"100dvh",zIndex:"overlay",_open:{animationName:"fade-in",animationDuration:"slow"},_closed:{animationName:"fade-out",animationDuration:"moderate"}},positioner:{display:"flex",width:"100vw",height:"100dvh",position:"fixed",insetInlineStart:0,top:0,zIndex:"modal",overscrollBehaviorY:"none"},content:{display:"flex",flexDirection:"column",position:"relative",width:"100%",outline:0,zIndex:"modal",textStyle:"sm",maxH:"100dvh",color:"inherit",bg:"bg.panel",boxShadow:"lg",_open:{animationDuration:"slowest",animationTimingFunction:"ease-in-smooth"},_closed:{animationDuration:"slower",animationTimingFunction:"ease-in-smooth"}},header:{display:"flex",alignItems:"center",gap:"2",flex:0,px:"6",pt:"6",pb:"4"},body:{px:"6",py:"2",flex:"1",overflow:"auto"},footer:{display:"flex",alignItems:"center",justifyContent:"flex-end",gap:"3",px:"6",pt:"2",pb:"4"},title:{flex:"1",textStyle:"lg",fontWeight:"semibold"},description:{color:"fg.muted"},closeTrigger:{pos:"absolute",top:"3",insetEnd:"2"}},variants:{size:{xs:{content:{maxW:"xs"}},sm:{content:{maxW:"md"}},md:{content:{maxW:"lg"}},lg:{content:{maxW:"2xl"}},xl:{content:{maxW:"4xl"}},full:{content:{maxW:"100vw",h:"100dvh"}}},placement:{start:{positioner:{justifyContent:"flex-start",alignItems:"stretch"},content:{_open:{animationName:{base:"slide-from-left-full, fade-in",_rtl:"slide-from-right-full, fade-in"}},_closed:{animationName:{base:"slide-to-left-full, fade-out",_rtl:"slide-to-right-full, fade-out"}}}},end:{positioner:{justifyContent:"flex-end",alignItems:"stretch"},content:{_open:{animationName:{base:"slide-from-right-full, fade-in",_rtl:"slide-from-left-full, fade-in"}},_closed:{animationName:{base:"slide-to-right-full, fade-out",_rtl:"slide-to-left-full, fade-out"}}}},top:{positioner:{justifyContent:"stretch",alignItems:"flex-start"},content:{maxW:"100%",_open:{animationName:"slide-from-top-full, fade-in"},_closed:{animationName:"slide-to-top-full, fade-out"}}},bottom:{positioner:{justifyContent:"stretch",alignItems:"flex-end"},content:{maxW:"100%",_open:{animationName:"slide-from-bottom-full, fade-in"},_closed:{animationName:"slide-to-bottom-full, fade-out"}}}},contained:{true:{positioner:{padding:"4"},content:{borderRadius:"l3"}}}},defaultVariants:{size:"xs",placement:"end"}}),x2=Al({fontSize:"inherit",fontWeight:"inherit",textAlign:"inherit",bg:"transparent",borderRadius:"l2"}),eF=Oe({slots:gL.keys(),className:"chakra-editable",base:{root:{display:"inline-flex",alignItems:"center",position:"relative",gap:"1.5",width:"full"},preview:{...x2,py:"1",px:"1",display:"inline-flex",alignItems:"center",transitionProperty:"common",transitionDuration:"moderate",cursor:"text",_hover:{bg:"bg.muted"},_disabled:{userSelect:"none"}},input:{...x2,outline:"0",py:"1",px:"1",transitionProperty:"common",transitionDuration:"normal",width:"full",focusVisibleRing:"inside",focusRingWidth:"2px",_placeholder:{opacity:.6}},control:{display:"inline-flex",alignItems:"center",gap:"1.5"}},variants:{size:{sm:{root:{textStyle:"sm"},preview:{minH:"8"},input:{minH:"8"}},md:{root:{textStyle:"sm"},preview:{minH:"9"},input:{minH:"9"}},lg:{root:{textStyle:"md"},preview:{minH:"10"},input:{minH:"10"}}}},defaultVariants:{size:"md"}}),tF=Oe({slots:mL.keys(),className:"chakra-empty-state",base:{root:{width:"full"},content:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center"},indicator:{display:"flex",alignItems:"center",justifyContent:"center",color:"fg.subtle",_icon:{boxSize:"1em"}},title:{fontWeight:"semibold"},description:{textStyle:"sm",color:"fg.muted"}},variants:{size:{sm:{root:{px:"4",py:"6"},title:{textStyle:"md"},content:{gap:"4"},indicator:{textStyle:"2xl"}},md:{root:{px:"8",py:"12"},title:{textStyle:"lg"},content:{gap:"6"},indicator:{textStyle:"4xl"}},lg:{root:{px:"12",py:"16"},title:{textStyle:"xl"},content:{gap:"8"},indicator:{textStyle:"6xl"}}}},defaultVariants:{size:"md"}}),nF=Oe({className:"chakra-field",slots:yL.keys(),base:{requiredIndicator:{color:"fg.error",lineHeight:"1"},root:{display:"flex",width:"100%",position:"relative",gap:"1.5"},label:{display:"flex",alignItems:"center",textAlign:"start",textStyle:"sm",fontWeight:"medium",gap:"1",userSelect:"none",_disabled:{opacity:"0.5"}},errorText:{display:"inline-flex",alignItems:"center",fontWeight:"medium",gap:"1",color:"fg.error",textStyle:"xs"},helperText:{color:"fg.muted",textStyle:"xs"}},variants:{orientation:{vertical:{root:{flexDirection:"column",alignItems:"flex-start"}},horizontal:{root:{flexDirection:"row",alignItems:"center",justifyContent:"space-between"},label:{flex:"0 0 var(--field-label-width, 80px)"}}}},defaultVariants:{orientation:"vertical"}}),rF=Oe({className:"fieldset",slots:bL.keys(),base:{root:{display:"flex",flexDirection:"column",width:"full"},content:{display:"flex",flexDirection:"column",width:"full"},legend:{color:"fg",fontWeight:"medium",_disabled:{opacity:"0.5"}},helperText:{color:"fg.muted",textStyle:"sm"},errorText:{display:"inline-flex",alignItems:"center",color:"fg.error",gap:"2",fontWeight:"medium",textStyle:"sm"}},variants:{size:{sm:{root:{spaceY:"2"},content:{gap:"1.5"},legend:{textStyle:"sm"}},md:{root:{spaceY:"4"},content:{gap:"4"},legend:{textStyle:"sm"}},lg:{root:{spaceY:"6"},content:{gap:"4"},legend:{textStyle:"md"}}}},defaultVariants:{size:"md"}}),iF=Oe({className:"chakra-file-upload",slots:vL.keys(),base:{root:{display:"flex",flexDirection:"column",gap:"4",width:"100%",alignItems:"flex-start"},label:{fontWeight:"medium",textStyle:"sm"},dropzone:{background:"bg",borderRadius:"l3",borderWidth:"2px",borderStyle:"dashed",display:"flex",alignItems:"center",flexDirection:"column",gap:"4",justifyContent:"center",minHeight:"2xs",px:"3",py:"2",transition:"backgrounds",focusVisibleRing:"outside",_hover:{bg:"bg.subtle"},_dragging:{bg:"colorPalette.subtle",borderStyle:"solid",borderColor:"colorPalette.solid"}},dropzoneContent:{display:"flex",flexDirection:"column",alignItems:"center",textAlign:"center",gap:"1",textStyle:"sm"},item:{pos:"relative",textStyle:"sm",animationName:"fade-in",animationDuration:"moderate",background:"bg",borderRadius:"l2",borderWidth:"1px",width:"100%",display:"flex",alignItems:"center",gap:"3",p:"4"},itemGroup:{width:"100%",display:"flex",flexDirection:"column",gap:"3",_empty:{display:"none"}},itemName:{color:"fg",fontWeight:"medium",lineClamp:"1"},itemContent:{display:"flex",flexDirection:"column",gap:"0.5",flex:"1"},itemSizeText:{color:"fg.muted",textStyle:"xs"},itemDeleteTrigger:{display:"flex",alignItems:"center",justifyContent:"center",alignSelf:"flex-start",boxSize:"5",p:"2px",color:"fg.muted",cursor:"button"},itemPreview:{color:"fg.muted",_icon:{boxSize:"4.5"}}},defaultVariants:{}}),oF=Oe({className:"chakra-hover-card",slots:_1.keys(),base:{content:{position:"relative",display:"flex",flexDirection:"column",textStyle:"sm","--hovercard-bg":"colors.bg.panel",bg:"var(--hovercard-bg)",boxShadow:"lg",maxWidth:"80",borderRadius:"l3",zIndex:"popover",transformOrigin:"var(--transform-origin)",outline:"0",_open:{animationStyle:"slide-fade-in",animationDuration:"fast"},_closed:{animationStyle:"slide-fade-out",animationDuration:"faster"}},arrow:{"--arrow-size":"sizes.3","--arrow-background":"var(--hovercard-bg)"},arrowTip:{borderTopWidth:"0.5px",borderInlineStartWidth:"0.5px"}},variants:{size:{xs:{content:{padding:"3"}},sm:{content:{padding:"4"}},md:{content:{padding:"5"}},lg:{content:{padding:"6"}}}},defaultVariants:{size:"md"}}),sF=Oe({className:"chakra-list",slots:wL.keys(),base:{root:{display:"flex",flexDirection:"column",gap:"var(--list-gap)","& :where(ul, ol)":{marginTop:"var(--list-gap)"}},item:{whiteSpace:"normal",display:"list-item"},indicator:{marginEnd:"2",minHeight:"1lh",flexShrink:0,display:"inline-block",verticalAlign:"middle"}},variants:{variant:{marker:{root:{listStyle:"revert"},item:{_marker:{color:"fg.subtle"}}},plain:{item:{alignItems:"flex-start",display:"inline-flex"}}},align:{center:{item:{alignItems:"center"}},start:{item:{alignItems:"flex-start"}},end:{item:{alignItems:"flex-end"}}}},defaultVariants:{variant:"marker"}}),aF=Oe({className:"chakra-menu",slots:xL.keys(),base:{content:{outline:0,bg:"bg.panel",boxShadow:"lg",color:"fg",maxHeight:"var(--available-height)","--menu-z-index":"zIndex.dropdown",zIndex:"calc(var(--menu-z-index) + var(--layer-index, 0))",borderRadius:"l2",overflow:"hidden",overflowY:"auto",_open:{animationStyle:"slide-fade-in",animationDuration:"fast"},_closed:{animationStyle:"slide-fade-out",animationDuration:"faster"}},item:{textDecoration:"none",color:"fg",userSelect:"none",borderRadius:"l1",width:"100%",display:"flex",cursor:"menuitem",alignItems:"center",textAlign:"start",position:"relative",flex:"0 0 auto",outline:0,_disabled:{layerStyle:"disabled"},"&[data-type]":{ps:"8"}},itemText:{flex:"1"},itemIndicator:{position:"absolute",insetStart:"2",transform:"translateY(-50%)",top:"50%"},itemGroupLabel:{px:"2",py:"1.5",fontWeight:"semibold",textStyle:"sm"},indicator:{display:"inline-flex",alignItems:"center",justifyContent:"center",flexShrink:"0"},itemCommand:{opacity:"0.6",textStyle:"xs",ms:"auto",ps:"4",letterSpacing:"widest",fontFamily:"inherit"},separator:{height:"1px",bg:"bg.muted",my:"1",mx:"-1"}},variants:{variant:{subtle:{item:{_highlighted:{bg:"bg.emphasized/60"}}},solid:{item:{_highlighted:{bg:"colorPalette.solid",color:"colorPalette.contrast"}}}},size:{sm:{content:{minW:"8rem",padding:"1"},item:{gap:"1",textStyle:"xs",py:"1",px:"1.5"}},md:{content:{minW:"8rem",padding:"1.5"},item:{gap:"2",textStyle:"sm",py:"1.5",px:"2"}}}},defaultVariants:{size:"md",variant:"subtle"}}),ih=Oe({className:"chakra-select",slots:v2.keys(),base:{root:{display:"flex",flexDirection:"column",gap:"1.5",width:"full"},trigger:{display:"flex",alignItems:"center",justifyContent:"space-between",width:"full",minH:"var(--select-trigger-height)","--input-height":"var(--select-trigger-height)",px:"var(--select-trigger-padding-x)",borderRadius:"l2",userSelect:"none",textAlign:"start",focusVisibleRing:"inside",_placeholderShown:{color:"fg.muted/80"},_disabled:{layerStyle:"disabled"},_invalid:{borderColor:"border.error"}},indicatorGroup:{display:"flex",alignItems:"center",gap:"1",pos:"absolute",insetEnd:"0",top:"0",bottom:"0",px:"var(--select-trigger-padding-x)",pointerEvents:"none"},indicator:{display:"flex",alignItems:"center",justifyContent:"center",color:{base:"fg.muted",_disabled:"fg.subtle",_invalid:"fg.error"}},content:{background:"bg.panel",display:"flex",flexDirection:"column",zIndex:"dropdown",borderRadius:"l2",outline:0,maxH:"96",overflowY:"auto",boxShadow:"md",_open:{animationStyle:"slide-fade-in",animationDuration:"fast"},_closed:{animationStyle:"slide-fade-out",animationDuration:"fastest"}},item:{position:"relative",userSelect:"none",display:"flex",alignItems:"center",gap:"2",cursor:"option",justifyContent:"space-between",flex:"1",textAlign:"start",borderRadius:"l1",_highlighted:{bg:"bg.emphasized/60"},_disabled:{pointerEvents:"none",opacity:"0.5"},_icon:{width:"4",height:"4"}},control:{pos:"relative"},itemText:{flex:"1"},itemGroup:{_first:{mt:"0"}},itemGroupLabel:{py:"1",fontWeight:"medium"},label:{fontWeight:"medium",userSelect:"none",textStyle:"sm",_disabled:{layerStyle:"disabled"}},valueText:{lineClamp:"1",maxW:"80%"},clearTrigger:{color:"fg.muted",pointerEvents:"auto",focusVisibleRing:"inside",focusRingWidth:"2px",rounded:"l1"}},variants:{variant:{outline:{trigger:{bg:"transparent",borderWidth:"1px",borderColor:"border",_expanded:{borderColor:"border.emphasized"}}},subtle:{trigger:{borderWidth:"1px",borderColor:"transparent",bg:"bg.muted"}}},size:{xs:{root:{"--select-trigger-height":"sizes.8","--select-trigger-padding-x":"spacing.2"},content:{p:"1",gap:"1",textStyle:"xs"},trigger:{textStyle:"xs",gap:"1"},item:{py:"1",px:"2"},itemGroupLabel:{py:"1",px:"2"},indicator:{_icon:{width:"3.5",height:"3.5"}}},sm:{root:{"--select-trigger-height":"sizes.9","--select-trigger-padding-x":"spacing.2.5"},content:{p:"1",textStyle:"sm"},trigger:{textStyle:"sm",gap:"1"},indicator:{_icon:{width:"4",height:"4"}},item:{py:"1",px:"1.5"},itemGroup:{mt:"1"},itemGroupLabel:{py:"1",px:"1.5"}},md:{root:{"--select-trigger-height":"sizes.10","--select-trigger-padding-x":"spacing.3"},content:{p:"1",textStyle:"sm"},itemGroup:{mt:"1.5"},item:{py:"1.5",px:"2"},itemIndicator:{display:"flex",alignItems:"center",justifyContent:"center"},itemGroupLabel:{py:"1.5",px:"2"},trigger:{textStyle:"sm",gap:"2"},indicator:{_icon:{width:"4",height:"4"}}},lg:{root:{"--select-trigger-height":"sizes.12","--select-trigger-padding-x":"spacing.4"},content:{p:"1.5",textStyle:"md"},itemGroup:{mt:"2"},item:{py:"2",px:"3"},itemGroupLabel:{py:"2",px:"3"},trigger:{textStyle:"md",py:"3",gap:"2"},indicator:{_icon:{width:"5",height:"5"}}}}},defaultVariants:{size:"md",variant:"outline"}}),lF=Oe({className:"chakra-native-select",slots:EL.keys(),base:{root:{height:"fit-content",display:"flex",width:"100%",position:"relative"},field:{width:"100%",minWidth:"0",outline:"0",appearance:"none",borderRadius:"l2","--error-color":"colors.border.error","--input-height":"var(--select-field-height)",height:"var(--select-field-height)",_disabled:{layerStyle:"disabled"},_invalid:{focusRingColor:"var(--error-color)",borderColor:"var(--error-color)"},focusVisibleRing:"inside",lineHeight:"normal","& > option, & > optgroup":{bg:"bg"}},indicator:{position:"absolute",display:"inline-flex",alignItems:"center",justifyContent:"center",pointerEvents:"none",top:"50%",transform:"translateY(-50%)",height:"100%",color:"fg.muted",_disabled:{opacity:"0.5"},_invalid:{color:"fg.error"},_icon:{width:"1em",height:"1em"}}},variants:{variant:{outline:{field:(GO=ih.variants)==null?void 0:GO.variant.outline.trigger},subtle:{field:(jO=ih.variants)==null?void 0:jO.variant.subtle.trigger},plain:{field:{bg:"transparent",color:"fg",focusRingWidth:"2px"}}},size:{xs:{root:{"--select-field-height":"sizes.8"},field:{textStyle:"xs",ps:"2",pe:"6"},indicator:{textStyle:"sm",insetEnd:"1.5"}},sm:{root:{"--select-field-height":"sizes.9"},field:{textStyle:"sm",ps:"2.5",pe:"8"},indicator:{textStyle:"md",insetEnd:"2"}},md:{root:{"--select-field-height":"sizes.10"},field:{textStyle:"sm",ps:"3",pe:"8"},indicator:{textStyle:"lg",insetEnd:"2"}},lg:{root:{"--select-field-height":"sizes.11"},field:{textStyle:"md",ps:"4",pe:"8"},indicator:{textStyle:"xl",insetEnd:"3"}},xl:{root:{"--select-field-height":"sizes.12"},field:{textStyle:"md",ps:"4.5",pe:"10"},indicator:{textStyle:"xl",insetEnd:"3"}}}},defaultVariants:ih.defaultVariants});function W0(t,e){const n={};for(const r in t){const i=e(r,t[r]);n[i[0]]=i[1]}return n}const E2=Al({display:"flex",justifyContent:"center",alignItems:"center",flex:"1",userSelect:"none",cursor:"button",lineHeight:"1",color:"fg.muted","--stepper-base-radius":"radii.l1","--stepper-radius":"calc(var(--stepper-base-radius) + 1px)",_icon:{boxSize:"1em"},_disabled:{opacity:"0.5"},_hover:{bg:"bg.muted"},_active:{bg:"bg.emphasized"}}),cF=Oe({className:"chakra-number-input",slots:Z1.keys(),base:{root:{position:"relative",zIndex:"0",isolation:"isolate"},input:{...Mt.base,verticalAlign:"top",pe:"calc(var(--stepper-width) + 0.5rem)"},control:{display:"flex",flexDirection:"column",position:"absolute",top:"0",insetEnd:"0px",margin:"1px",width:"var(--stepper-width)",height:"calc(100% - 2px)",zIndex:"1",borderStartWidth:"1px",divideY:"1px"},incrementTrigger:{...E2,borderTopEndRadius:"var(--stepper-radius)"},decrementTrigger:{...E2,borderBottomEndRadius:"var(--stepper-radius)"},valueText:{fontWeight:"medium",fontFeatureSettings:"pnum",fontVariantNumeric:"proportional-nums"}},variants:{size:{xs:{input:Mt.variants.size.xs,control:{fontSize:"2xs","--stepper-width":"sizes.4"}},sm:{input:Mt.variants.size.sm,control:{fontSize:"xs","--stepper-width":"sizes.5"}},md:{input:Mt.variants.size.md,control:{fontSize:"sm","--stepper-width":"sizes.6"}},lg:{input:Mt.variants.size.lg,control:{fontSize:"sm","--stepper-width":"sizes.6"}}},variant:W0(Mt.variants.variant,(t,e)=>[t,{input:e}])},defaultVariants:{size:"md",variant:"outline"}}),{variants:S2,defaultVariants:uF}=Mt,dF=Oe({className:"chakra-pin-input",slots:ix.keys(),base:{input:{...Mt.base,textAlign:"center",width:"var(--input-height)"},control:{display:"inline-flex",gap:"2",isolation:"isolate"}},variants:{size:W0(S2.size,(t,e)=>[t,{input:{...e,px:"1"}}]),variant:W0(S2.variant,(t,e)=>[t,{input:e}]),attached:{true:{control:{gap:"0",spaceX:"-1px"},input:{_notFirst:{borderStartRadius:"0"},_notLast:{borderEndRadius:"0"},_focusVisible:{zIndex:"1"}}}}},defaultVariants:uF}),fF=Oe({className:"chakra-popover",slots:SL.keys(),base:{content:{position:"relative",display:"flex",flexDirection:"column",textStyle:"sm","--popover-bg":"colors.bg.panel",bg:"var(--popover-bg)",boxShadow:"lg","--popover-size":"sizes.xs","--popover-mobile-size":"calc(100dvw - 1rem)",width:{base:"min(var(--popover-mobile-size), var(--popover-size))",sm:"var(--popover-size)"},borderRadius:"l3","--popover-z-index":"zIndex.popover",zIndex:"calc(var(--popover-z-index) + var(--layer-index, 0))",outline:"0",transformOrigin:"var(--transform-origin)",maxHeight:"var(--available-height)",_open:{animationStyle:"scale-fade-in",animationDuration:"fast"},_closed:{animationStyle:"scale-fade-out",animationDuration:"faster"}},header:{paddingInline:"var(--popover-padding)",paddingTop:"var(--popover-padding)"},body:{padding:"var(--popover-padding)",flex:"1"},footer:{display:"flex",alignItems:"center",paddingInline:"var(--popover-padding)",paddingBottom:"var(--popover-padding)"},arrow:{"--arrow-size":"sizes.3","--arrow-background":"var(--popover-bg)"},arrowTip:{borderTopWidth:"1px",borderInlineStartWidth:"1px"}},variants:{size:{xs:{content:{"--popover-padding":"spacing.3"}},sm:{content:{"--popover-padding":"spacing.4"}},md:{content:{"--popover-padding":"spacing.5"}},lg:{content:{"--popover-padding":"spacing.6"}}}},defaultVariants:{size:"md"}}),hF=Oe({slots:I0.keys(),className:"chakra-progress",base:{root:{textStyle:"sm",position:"relative"},track:{overflow:"hidden",position:"relative"},range:{display:"flex",alignItems:"center",justifyContent:"center",transitionProperty:"width, height",transitionDuration:"slow",height:"100%",bgColor:"var(--track-color)",_indeterminate:{"--animate-from-x":"-40%","--animate-to-x":"100%",position:"absolute",willChange:"left",minWidth:"50%",animation:"position 1s ease infinite normal none running",backgroundImage:"linear-gradient(to right, transparent 0%, var(--track-color) 50%, transparent 100%)"}},label:{display:"inline-flex",fontWeight:"medium",alignItems:"center",gap:"1"},valueText:{textStyle:"xs",lineHeight:"1",fontWeight:"medium"}},variants:{variant:{outline:{track:{shadow:"inset",bgColor:"bg.muted"},range:{bgColor:"colorPalette.solid"}},subtle:{track:{bgColor:"colorPalette.muted"},range:{bgColor:"colorPalette.solid/72"}}},shape:{square:{},rounded:{track:{borderRadius:"l1"}},full:{track:{borderRadius:"full"}}},striped:{true:{range:{backgroundImage:"linear-gradient(45deg, var(--stripe-color) 25%, transparent 25%, transparent 50%, var(--stripe-color) 50%, var(--stripe-color) 75%, transparent 75%, transparent)",backgroundSize:"var(--stripe-size) var(--stripe-size)","--stripe-size":"1rem","--stripe-color":{_light:"rgba(255, 255, 255, 0.3)",_dark:"rgba(0, 0, 0, 0.3)"}}}},animated:{true:{range:{"--animate-from":"var(--stripe-size)",animation:"bg-position 1s linear infinite"}}},size:{xs:{track:{h:"1.5"}},sm:{track:{h:"2"}},md:{track:{h:"2.5"}},lg:{track:{h:"3"}},xl:{track:{h:"4"}}}},defaultVariants:{variant:"outline",size:"md",shape:"rounded"}}),pF=Oe({className:"chakra-progress-circle",slots:I0.keys(),base:{root:{display:"inline-flex",textStyle:"sm",position:"relative"},circle:{_indeterminate:{animation:"spin 2s linear infinite"}},circleTrack:{"--track-color":"colors.colorPalette.muted",stroke:"var(--track-color)"},circleRange:{stroke:"colorPalette.solid",transitionProperty:"stroke-dashoffset, stroke-dasharray",transitionDuration:"0.6s",_indeterminate:{animation:"circular-progress 1.5s linear infinite"}},label:{display:"inline-flex"},valueText:{lineHeight:"1",fontWeight:"medium",letterSpacing:"tight",fontVariantNumeric:"tabular-nums"}},variants:{size:{xs:{circle:{"--size":"24px","--thickness":"4px"},valueText:{textStyle:"2xs"}},sm:{circle:{"--size":"32px","--thickness":"5px"},valueText:{textStyle:"2xs"}},md:{circle:{"--size":"40px","--thickness":"6px"},valueText:{textStyle:"xs"}},lg:{circle:{"--size":"48px","--thickness":"7px"},valueText:{textStyle:"sm"}},xl:{circle:{"--size":"64px","--thickness":"8px"},valueText:{textStyle:"sm"}}}},defaultVariants:{size:"md"}}),gF=Oe({slots:sx.keys(),className:"chakra-qr-code",base:{root:{position:"relative",width:"fit-content","--qr-code-overlay-size":"calc(var(--qr-code-size) / 3)"},frame:{width:"var(--qr-code-size)",height:"var(--qr-code-size)",fill:"currentColor"},overlay:{display:"flex",alignItems:"center",justifyContent:"center",width:"var(--qr-code-overlay-size)",height:"var(--qr-code-overlay-size)",padding:"1",bg:"bg",rounded:"l1"}},variants:{size:{"2xs":{root:{"--qr-code-size":"40px"}},xs:{root:{"--qr-code-size":"64px"}},sm:{root:{"--qr-code-size":"80px"}},md:{root:{"--qr-code-size":"120px"}},lg:{root:{"--qr-code-size":"160px"}},xl:{root:{"--qr-code-size":"200px"}},"2xl":{root:{"--qr-code-size":"240px"}},full:{root:{"--qr-code-size":"100%"}}}},defaultVariants:{size:"md"}}),mF=Oe({className:"chakra-radio-card",slots:AL.keys(),base:{root:{display:"flex",flexDirection:"column",gap:"1.5",isolation:"isolate"},item:{flex:"1",display:"flex",flexDirection:"column",userSelect:"none",position:"relative",borderRadius:"l2",_focus:{bg:"colorPalette.muted/20"},_disabled:{opacity:"0.8",borderColor:"border.disabled"},_checked:{zIndex:"1"}},label:{display:"inline-flex",fontWeight:"medium",textStyle:"sm",_disabled:{opacity:"0.5"}},itemText:{fontWeight:"medium",flex:"1"},itemDescription:{opacity:"0.64",textStyle:"sm"},itemControl:{display:"inline-flex",flex:"1",pos:"relative",rounded:"inherit",justifyContent:"var(--radio-card-justify)",alignItems:"var(--radio-card-align)",_disabled:{bg:"bg.muted"}},itemIndicator:yn.base,itemAddon:{roundedBottom:"inherit",_disabled:{color:"fg.muted"}},itemContent:{display:"flex",flexDirection:"column",flex:"1",gap:"1",justifyContent:"var(--radio-card-justify)",alignItems:"var(--radio-card-align)"}},variants:{size:{sm:{item:{textStyle:"sm"},itemControl:{padding:"3",gap:"1.5"},itemAddon:{px:"3",py:"1.5",borderTopWidth:"1px"},itemIndicator:(KO=yn.variants)==null?void 0:KO.size.sm},md:{item:{textStyle:"sm"},itemControl:{padding:"4",gap:"2.5"},itemAddon:{px:"4",py:"2",borderTopWidth:"1px"},itemIndicator:(qO=yn.variants)==null?void 0:qO.size.md},lg:{item:{textStyle:"md"},itemControl:{padding:"4",gap:"3.5"},itemAddon:{px:"4",py:"2",borderTopWidth:"1px"},itemIndicator:(YO=yn.variants)==null?void 0:YO.size.lg}},variant:{surface:{item:{borderWidth:"1px",_checked:{bg:"colorPalette.subtle",color:"colorPalette.fg",borderColor:"colorPalette.muted"}},itemIndicator:(QO=yn.variants)==null?void 0:QO.variant.solid},subtle:{item:{bg:"bg.muted"},itemControl:{_checked:{bg:"colorPalette.muted",color:"colorPalette.fg"}},itemIndicator:(XO=yn.variants)==null?void 0:XO.variant.outline},outline:{item:{borderWidth:"1px",_checked:{boxShadow:"0 0 0 1px var(--shadow-color)",boxShadowColor:"colorPalette.solid",borderColor:"colorPalette.solid"}},itemIndicator:(JO=yn.variants)==null?void 0:JO.variant.solid},solid:{item:{borderWidth:"1px",_checked:{bg:"colorPalette.solid",color:"colorPalette.contrast",borderColor:"colorPalette.solid"}},itemIndicator:(ZO=yn.variants)==null?void 0:ZO.variant.inverted}},justify:{start:{item:{"--radio-card-justify":"flex-start"}},end:{item:{"--radio-card-justify":"flex-end"}},center:{item:{"--radio-card-justify":"center"}}},align:{start:{item:{"--radio-card-align":"flex-start"},itemControl:{textAlign:"start"}},end:{item:{"--radio-card-align":"flex-end"},itemControl:{textAlign:"end"}},center:{item:{"--radio-card-align":"center"},itemControl:{textAlign:"center"}}},orientation:{vertical:{itemControl:{flexDirection:"column"}},horizontal:{itemControl:{flexDirection:"row"}}}},defaultVariants:{size:"md",variant:"outline",align:"start",orientation:"horizontal"}}),yF=Oe({className:"chakra-radio-group",slots:b2.keys(),base:{item:{display:"inline-flex",alignItems:"center",position:"relative",fontWeight:"medium",_disabled:{cursor:"disabled"}},itemControl:yn.base,label:{userSelect:"none",textStyle:"sm",_disabled:{opacity:"0.5"}}},variants:{variant:{outline:{itemControl:(tT=(eT=yn.variants)==null?void 0:eT.variant)==null?void 0:tT.outline},subtle:{itemControl:(rT=(nT=yn.variants)==null?void 0:nT.variant)==null?void 0:rT.subtle},solid:{itemControl:(oT=(iT=yn.variants)==null?void 0:iT.variant)==null?void 0:oT.solid}},size:{xs:{item:{textStyle:"xs",gap:"1.5"},itemControl:(aT=(sT=yn.variants)==null?void 0:sT.size)==null?void 0:aT.xs},sm:{item:{textStyle:"sm",gap:"2"},itemControl:(cT=(lT=yn.variants)==null?void 0:lT.size)==null?void 0:cT.sm},md:{item:{textStyle:"sm",gap:"2.5"},itemControl:(dT=(uT=yn.variants)==null?void 0:uT.size)==null?void 0:dT.md},lg:{item:{textStyle:"md",gap:"3"},itemControl:(hT=(fT=yn.variants)==null?void 0:fT.size)==null?void 0:hT.lg}}},defaultVariants:{size:"md",variant:"solid"}}),bF=Oe({className:"chakra-rating-group",slots:kL.keys(),base:{root:{display:"inline-flex"},control:{display:"inline-flex",alignItems:"center"},item:{display:"inline-flex",alignItems:"center",justifyContent:"center",userSelect:"none"},itemIndicator:{display:"inline-flex",alignItems:"center",justifyContent:"center",width:"1em",height:"1em",position:"relative","--clip-path":{base:"inset(0 50% 0 0)",_rtl:"inset(0 0 0 50%)"},_icon:{stroke:"currentColor",width:"100%",height:"100%",display:"inline-block",flexShrink:0,position:"absolute",left:0,top:0},"& [data-bg]":{color:"bg.emphasized"},"& [data-fg]":{color:"transparent"},"&[data-highlighted]:not([data-half])":{"& [data-fg]":{color:"colorPalette.solid"}},"&[data-half]":{"& [data-fg]":{color:"colorPalette.solid",clipPath:"var(--clip-path)"}}}},variants:{size:{xs:{item:{textStyle:"sm"}},sm:{item:{textStyle:"md"}},md:{item:{textStyle:"xl"}},lg:{item:{textStyle:"2xl"}}}},defaultVariants:{size:"md"}}),vF=Oe({className:"chakra-segment-group",slots:lx.keys(),base:{root:{"--segment-radius":"radii.l2",borderRadius:"l2",display:"inline-flex",boxShadow:"inset",minW:"max-content",textAlign:"center",position:"relative",isolation:"isolate",bg:"bg.muted",_vertical:{flexDirection:"column"}},item:{display:"flex",alignItems:"center",justifyContent:"center",userSelect:"none",fontSize:"sm",position:"relative",color:"fg",borderRadius:"var(--segment-radius)",_disabled:{opacity:"0.5"},"&:has(input:focus-visible)":{focusRing:"outside"},_before:{content:'""',position:"absolute",bg:"border",transition:"opacity 0.2s"},_horizontal:{_before:{insetInlineStart:0,insetBlock:"1.5",width:"1px"}},_vertical:{_before:{insetBlockStart:0,insetInline:"1.5",height:"1px"}},"& + &[data-state=checked], &[data-state=checked] + &, &:first-of-type":{_before:{opacity:"0"}},"&[data-state=checked][data-ssr]":{shadow:"sm",bg:"bg",borderRadius:"var(--segment-radius)"}},indicator:{shadow:"sm",pos:"absolute",bg:{_light:"bg",_dark:"bg.emphasized"},width:"var(--width)",height:"var(--height)",top:"var(--top)",left:"var(--left)",zIndex:-1,borderRadius:"var(--segment-radius)"}},variants:{size:{xs:{item:{textStyle:"xs",px:"3",gap:"1",height:"6"}},sm:{item:{textStyle:"sm",px:"4",gap:"2",height:"8"}},md:{item:{textStyle:"sm",px:"4",gap:"2",height:"10"}},lg:{item:{textStyle:"md",px:"4.5",gap:"3",height:"11"}}}},defaultVariants:{size:"md"}}),wF=Oe({className:"chakra-slider",slots:IL.keys(),base:{root:{display:"flex",flexDirection:"column",gap:"1",textStyle:"sm",position:"relative",isolation:"isolate",touchAction:"none"},label:{fontWeight:"medium",textStyle:"sm"},control:{display:"inline-flex",alignItems:"center",position:"relative"},track:{overflow:"hidden",borderRadius:"full",flex:"1"},range:{width:"inherit",height:"inherit",_disabled:{bg:"border.emphasized!"}},markerGroup:{position:"absolute!",zIndex:"1"},marker:{"--marker-bg":{base:"white",_underValue:"colors.bg"},display:"flex",alignItems:"center",gap:"calc(var(--slider-thumb-size) / 2)",color:"fg.muted",textStyle:"xs"},markerIndicator:{width:"var(--slider-marker-size)",height:"var(--slider-marker-size)",borderRadius:"full",bg:"var(--marker-bg)"},thumb:{width:"var(--slider-thumb-size)",height:"var(--slider-thumb-size)",display:"flex",alignItems:"center",justifyContent:"center",outline:0,zIndex:"2",borderRadius:"full",_focusVisible:{ring:"2px",ringColor:"colorPalette.focusRing",ringOffset:"2px",ringOffsetColor:"bg"}}},variants:{size:{sm:{root:{"--slider-thumb-size":"sizes.4","--slider-track-size":"sizes.1.5","--slider-marker-center":"6px","--slider-marker-size":"sizes.1","--slider-marker-inset":"3px"}},md:{root:{"--slider-thumb-size":"sizes.5","--slider-track-size":"sizes.2","--slider-marker-center":"8px","--slider-marker-size":"sizes.1","--slider-marker-inset":"4px"}},lg:{root:{"--slider-thumb-size":"sizes.6","--slider-track-size":"sizes.2.5","--slider-marker-center":"9px","--slider-marker-size":"sizes.1.5","--slider-marker-inset":"5px"}}},variant:{outline:{track:{shadow:"inset",bg:"bg.emphasized/72"},range:{bg:"colorPalette.solid"},thumb:{borderWidth:"2px",borderColor:"colorPalette.solid",bg:"bg",_disabled:{bg:"border.emphasized",borderColor:"border.emphasized"}}},solid:{track:{bg:"colorPalette.subtle",_disabled:{bg:"bg.muted"}},range:{bg:"colorPalette.solid"},thumb:{bg:"colorPalette.solid",_disabled:{bg:"border.emphasized"}}}},orientation:{vertical:{root:{display:"inline-flex"},control:{flexDirection:"column",height:"100%",minWidth:"var(--slider-thumb-size)","&[data-has-mark-label], &:has(.chakra-slider__marker-label)":{marginEnd:"4"}},track:{width:"var(--slider-track-size)"},thumb:{left:"50%",translate:"-50% 0"},markerGroup:{insetStart:"var(--slider-marker-center)",insetBlock:"var(--slider-marker-inset)"},marker:{flexDirection:"row"}},horizontal:{control:{flexDirection:"row",width:"100%",minHeight:"var(--slider-thumb-size)","&[data-has-mark-label], &:has(.chakra-slider__marker-label)":{marginBottom:"4"}},track:{height:"var(--slider-track-size)"},thumb:{top:"50%",translate:"0 -50%"},markerGroup:{top:"var(--slider-marker-center)",insetInline:"var(--slider-marker-inset)"},marker:{flexDirection:"column"}}}},defaultVariants:{size:"md",variant:"outline",orientation:"horizontal"}}),xF=Oe({className:"chakra-stat",slots:OL.keys(),base:{root:{display:"flex",flexDirection:"column",gap:"1",position:"relative",flex:"1"},label:{display:"inline-flex",gap:"1.5",alignItems:"center",color:"fg.muted",textStyle:"sm"},helpText:{color:"fg.muted",textStyle:"xs"},valueUnit:{color:"fg.muted",textStyle:"xs",fontWeight:"initial",letterSpacing:"initial"},valueText:{verticalAlign:"baseline",fontWeight:"semibold",letterSpacing:"tight",fontFeatureSettings:"pnum",fontVariantNumeric:"proportional-nums",display:"inline-flex",gap:"1"},indicator:{display:"inline-flex",alignItems:"center",justifyContent:"center",marginEnd:1,"& :where(svg)":{w:"1em",h:"1em"},"&[data-type=up]":{color:"fg.success"},"&[data-type=down]":{color:"fg.error"}}},variants:{size:{sm:{valueText:{textStyle:"xl"}},md:{valueText:{textStyle:"2xl"}},lg:{valueText:{textStyle:"3xl"}}}},defaultVariants:{size:"md"}}),EF=Oe({className:"chakra-status",slots:TL.keys(),base:{root:{display:"inline-flex",alignItems:"center",gap:"2"},indicator:{width:"0.64em",height:"0.64em",flexShrink:0,borderRadius:"full",forcedColorAdjust:"none",bg:"colorPalette.solid"}},variants:{size:{sm:{root:{textStyle:"xs"}},md:{root:{textStyle:"sm"}},lg:{root:{textStyle:"md"}}}},defaultVariants:{size:"md"}}),SF=Oe({className:"chakra-steps",slots:PL.keys(),base:{root:{display:"flex",width:"full"},list:{display:"flex",justifyContent:"space-between","--steps-gutter":"spacing.3","--steps-thickness":"2px"},title:{fontWeight:"medium",color:"fg"},description:{color:"fg.muted"},separator:{bg:"border",flex:"1"},indicator:{display:"flex",justifyContent:"center",alignItems:"center",flexShrink:"0",borderRadius:"full",fontWeight:"medium",width:"var(--steps-size)",height:"var(--steps-size)",_icon:{flexShrink:"0",width:"var(--steps-icon-size)",height:"var(--steps-icon-size)"}},item:{position:"relative",display:"flex",gap:"3",flex:"1 0 0","&:last-of-type":{flex:"initial","& [data-part=separator]":{display:"none"}}},trigger:{display:"flex",alignItems:"center",gap:"3",textAlign:"start",focusVisibleRing:"outside",borderRadius:"l2"},content:{focusVisibleRing:"outside"}},variants:{orientation:{vertical:{root:{flexDirection:"row",height:"100%"},list:{flexDirection:"column",alignItems:"flex-start"},separator:{position:"absolute",width:"var(--steps-thickness)",height:"100%",maxHeight:"calc(100% - var(--steps-size) - var(--steps-gutter) * 2)",top:"calc(var(--steps-size) + var(--steps-gutter))",insetStart:"calc(var(--steps-size) / 2 - 1px)"},item:{alignItems:"flex-start"}},horizontal:{root:{flexDirection:"column",width:"100%"},list:{flexDirection:"row",alignItems:"center"},separator:{width:"100%",height:"var(--steps-thickness)",marginX:"var(--steps-gutter)"},item:{alignItems:"center"}}},variant:{solid:{indicator:{_incomplete:{borderWidth:"var(--steps-thickness)"},_current:{bg:"colorPalette.muted",borderWidth:"var(--steps-thickness)",borderColor:"colorPalette.solid",color:"colorPalette.fg"},_complete:{bg:"colorPalette.solid",borderColor:"colorPalette.solid",color:"colorPalette.contrast"}},separator:{_complete:{bg:"colorPalette.solid"}}},subtle:{indicator:{_incomplete:{bg:"bg.muted"},_current:{bg:"colorPalette.muted",color:"colorPalette.fg"},_complete:{bg:"colorPalette.emphasized",color:"colorPalette.fg"}},separator:{_complete:{bg:"colorPalette.emphasized"}}}},size:{xs:{root:{gap:"2.5"},list:{"--steps-size":"sizes.6","--steps-icon-size":"sizes.3.5",textStyle:"xs"},title:{textStyle:"sm"}},sm:{root:{gap:"3"},list:{"--steps-size":"sizes.8","--steps-icon-size":"sizes.4",textStyle:"xs"},title:{textStyle:"sm"}},md:{root:{gap:"4"},list:{"--steps-size":"sizes.10","--steps-icon-size":"sizes.4",textStyle:"sm"},title:{textStyle:"sm"}},lg:{root:{gap:"6"},list:{"--steps-size":"sizes.11","--steps-icon-size":"sizes.5",textStyle:"md"},title:{textStyle:"md"}}}},defaultVariants:{size:"md",variant:"solid",orientation:"horizontal"}}),AF=Oe({slots:NL.keys(),className:"chakra-switch",base:{root:{display:"inline-flex",gap:"2.5",alignItems:"center",position:"relative",verticalAlign:"middle","--switch-diff":"calc(var(--switch-width) - var(--switch-height))","--switch-x":{base:"var(--switch-diff)",_rtl:"calc(var(--switch-diff) * -1)"}},label:{lineHeight:"1",userSelect:"none",fontSize:"sm",fontWeight:"medium",_disabled:{opacity:"0.5"}},indicator:{position:"absolute",height:"var(--switch-height)",width:"var(--switch-height)",fontSize:"var(--switch-indicator-font-size)",fontWeight:"medium",flexShrink:0,userSelect:"none",display:"grid",placeContent:"center",transition:"inset-inline-start 0.12s ease",insetInlineStart:"calc(var(--switch-x) - 2px)",_checked:{insetInlineStart:"2px"}},control:{display:"inline-flex",gap:"0.5rem",flexShrink:0,justifyContent:"flex-start",cursor:"switch",borderRadius:"full",position:"relative",width:"var(--switch-width)",height:"var(--switch-height)",transition:"backgrounds",_disabled:{opacity:"0.5",cursor:"not-allowed"},_invalid:{outline:"2px solid",outlineColor:"border.error",outlineOffset:"2px"}},thumb:{display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0,transitionProperty:"translate",transitionDuration:"fast",borderRadius:"inherit",_checked:{translate:"var(--switch-x) 0"}}},variants:{variant:{solid:{control:{borderRadius:"full",bg:"bg.emphasized",focusVisibleRing:"outside",_checked:{bg:"colorPalette.solid"}},thumb:{bg:"white",width:"var(--switch-height)",height:"var(--switch-height)",scale:"0.8",boxShadow:"sm",_checked:{bg:"colorPalette.contrast"}}},raised:{control:{borderRadius:"full",height:"calc(var(--switch-height) / 2)",bg:"bg.muted",boxShadow:"inset",_checked:{bg:"colorPalette.solid/60"}},thumb:{width:"var(--switch-height)",height:"var(--switch-height)",position:"relative",top:"calc(var(--switch-height) * -0.25)",bg:"white",boxShadow:"xs",focusVisibleRing:"outside",_checked:{bg:"colorPalette.solid"}}}},size:{xs:{root:{"--switch-width":"sizes.6","--switch-height":"sizes.3","--switch-indicator-font-size":"fontSizes.xs"}},sm:{root:{"--switch-width":"sizes.8","--switch-height":"sizes.4","--switch-indicator-font-size":"fontSizes.xs"}},md:{root:{"--switch-width":"sizes.10","--switch-height":"sizes.5","--switch-indicator-font-size":"fontSizes.sm"}},lg:{root:{"--switch-width":"sizes.12","--switch-height":"sizes.6","--switch-indicator-font-size":"fontSizes.md"}}}},defaultVariants:{variant:"solid",size:"md"}}),kF=Oe({className:"chakra-table",slots:w2.keys(),base:{root:{fontVariantNumeric:"lining-nums tabular-nums",borderCollapse:"collapse",width:"full",textAlign:"start",verticalAlign:"top"},row:{_selected:{bg:"colorPalette.subtle"}},cell:{textAlign:"start",alignItems:"center"},columnHeader:{fontWeight:"medium",textAlign:"start",color:"fg"},caption:{fontWeight:"medium",textStyle:"xs"},footer:{fontWeight:"medium"}},variants:{interactive:{true:{body:{"& tr":{_hover:{bg:"colorPalette.subtle"}}}}},stickyHeader:{true:{header:{"& :where(tr)":{top:"var(--table-sticky-offset, 0)",position:"sticky",zIndex:1}}}},striped:{true:{row:{"&:nth-of-type(odd) td":{bg:"bg.muted"}}}},showColumnBorder:{true:{columnHeader:{"&:not(:last-of-type)":{borderInlineEndWidth:"1px"}},cell:{"&:not(:last-of-type)":{borderInlineEndWidth:"1px"}}}},variant:{line:{columnHeader:{borderBottomWidth:"1px"},cell:{borderBottomWidth:"1px"},row:{bg:"bg"}},outline:{root:{boxShadow:"0 0 0 1px {colors.border}",overflow:"hidden"},columnHeader:{borderBottomWidth:"1px"},header:{bg:"bg.muted"},row:{"&:not(:last-of-type)":{borderBottomWidth:"1px"}},footer:{borderTopWidth:"1px"}}},size:{sm:{root:{textStyle:"sm"},columnHeader:{px:"2",py:"2"},cell:{px:"2",py:"2"}},md:{root:{textStyle:"sm"},columnHeader:{px:"3",py:"3"},cell:{px:"3",py:"3"}},lg:{root:{textStyle:"md"},columnHeader:{px:"4",py:"3"},cell:{px:"4",py:"3"}}}},defaultVariants:{variant:"line",size:"md"}}),CF=Oe({slots:RL.keys(),className:"chakra-tabs",base:{root:{"--tabs-trigger-radius":"radii.l2",position:"relative",_horizontal:{display:"block"},_vertical:{display:"flex"}},list:{display:"inline-flex",position:"relative",isolation:"isolate","--tabs-indicator-shadow":"shadows.xs","--tabs-indicator-bg":"colors.bg",minH:"var(--tabs-height)",_horizontal:{flexDirection:"row"},_vertical:{flexDirection:"column"}},trigger:{outline:"0",minW:"var(--tabs-height)",height:"var(--tabs-height)",display:"flex",alignItems:"center",fontWeight:"medium",position:"relative",cursor:"button",gap:"2",_focusVisible:{zIndex:1,outline:"2px solid",outlineColor:"colorPalette.focusRing"},_disabled:{cursor:"not-allowed",opacity:.5}},content:{focusVisibleRing:"inside",_horizontal:{width:"100%",pt:"var(--tabs-content-padding)"},_vertical:{height:"100%",ps:"var(--tabs-content-padding)"}},indicator:{width:"var(--width)",height:"var(--height)",borderRadius:"var(--tabs-indicator-radius)",bg:"var(--tabs-indicator-bg)",shadow:"var(--tabs-indicator-shadow)",zIndex:-1}},variants:{fitted:{true:{list:{display:"flex"},trigger:{flex:1,textAlign:"center",justifyContent:"center"}}},justify:{start:{list:{justifyContent:"flex-start"}},center:{list:{justifyContent:"center"}},end:{list:{justifyContent:"flex-end"}}},size:{sm:{root:{"--tabs-height":"sizes.9","--tabs-content-padding":"spacing.3"},trigger:{py:"1",px:"3",textStyle:"sm"}},md:{root:{"--tabs-height":"sizes.10","--tabs-content-padding":"spacing.4"},trigger:{py:"2",px:"4",textStyle:"sm"}},lg:{root:{"--tabs-height":"sizes.11","--tabs-content-padding":"spacing.4.5"},trigger:{py:"2",px:"4.5",textStyle:"md"}}},variant:{line:{list:{display:"flex",borderColor:"border",_horizontal:{borderBottomWidth:"1px"},_vertical:{borderEndWidth:"1px"}},trigger:{color:"fg.muted",_disabled:{_active:{bg:"initial"}},_selected:{color:"fg",_horizontal:{layerStyle:"indicator.bottom","--indicator-offset-y":"-1px","--indicator-color":"colors.colorPalette.solid"},_vertical:{layerStyle:"indicator.end","--indicator-offset-x":"-1px"}}}},subtle:{trigger:{borderRadius:"var(--tabs-trigger-radius)",color:"fg.muted",_selected:{bg:"colorPalette.subtle",color:"colorPalette.fg"}}},enclosed:{list:{bg:"bg.muted",padding:"1",borderRadius:"l3",minH:"calc(var(--tabs-height) - 4px)"},trigger:{justifyContent:"center",color:"fg.muted",borderRadius:"var(--tabs-trigger-radius)",_selected:{bg:"bg",color:"colorPalette.fg",shadow:"xs"}}},outline:{list:{"--line-thickness":"1px","--line-offset":"calc(var(--line-thickness) * -1)",borderColor:"border",display:"flex",_horizontal:{_before:{content:'""',position:"absolute",bottom:"0px",width:"100%",borderBottomWidth:"var(--line-thickness)",borderBottomColor:"border"}},_vertical:{_before:{content:'""',position:"absolute",insetInline:"var(--line-offset)",height:"calc(100% - calc(var(--line-thickness) * 2))",borderEndWidth:"var(--line-thickness)",borderEndColor:"border"}}},trigger:{color:"fg.muted",borderWidth:"1px",borderColor:"transparent",_selected:{bg:"currentBg",color:"colorPalette.fg"},_horizontal:{borderTopRadius:"var(--tabs-trigger-radius)",marginBottom:"var(--line-offset)",marginEnd:{_notLast:"var(--line-offset)"},_selected:{borderColor:"border",borderBottomColor:"transparent"}},_vertical:{borderStartRadius:"var(--tabs-trigger-radius)",marginEnd:"var(--line-offset)",marginBottom:{_notLast:"var(--line-offset)"},_selected:{borderColor:"border",borderEndColor:"transparent"}}}},plain:{trigger:{color:"fg.muted",_selected:{color:"colorPalette.fg"},borderRadius:"var(--tabs-trigger-radius)","&[data-selected][data-ssr]":{bg:"var(--tabs-indicator-bg)",shadow:"var(--tabs-indicator-shadow)",borderRadius:"var(--tabs-indicator-radius)"}}}}},defaultVariants:{size:"md",variant:"line"}}),Pr=(pT=H0.variants)==null?void 0:pT.variant,IF=Oe({slots:ML.keys(),className:"chakra-tag",base:{root:{display:"inline-flex",alignItems:"center",verticalAlign:"top",maxWidth:"100%",userSelect:"none",borderRadius:"l2",focusVisibleRing:"outside"},label:{lineClamp:"1"},closeTrigger:{display:"flex",alignItems:"center",justifyContent:"center",outline:"0",borderRadius:"l1",color:"currentColor",focusVisibleRing:"inside",focusRingWidth:"2px"},startElement:{flexShrink:0,boxSize:"var(--tag-element-size)",ms:"var(--tag-element-offset)","&:has([data-scope=avatar])":{boxSize:"var(--tag-avatar-size)",ms:"calc(var(--tag-element-offset) * 1.5)"},_icon:{boxSize:"100%"}},endElement:{flexShrink:0,boxSize:"var(--tag-element-size)",me:"var(--tag-element-offset)",_icon:{boxSize:"100%"},"&:has(button)":{ms:"calc(var(--tag-element-offset) * -1)"}}},variants:{size:{sm:{root:{px:"1.5",minH:"4.5",gap:"1","--tag-avatar-size":"spacing.3","--tag-element-size":"spacing.3","--tag-element-offset":"-2px"},label:{textStyle:"xs"}},md:{root:{px:"1.5",minH:"5",gap:"1","--tag-avatar-size":"spacing.3.5","--tag-element-size":"spacing.3.5","--tag-element-offset":"-2px"},label:{textStyle:"xs"}},lg:{root:{px:"2",minH:"6",gap:"1.5","--tag-avatar-size":"spacing.4.5","--tag-element-size":"spacing.4","--tag-element-offset":"-3px"},label:{textStyle:"sm"}},xl:{root:{px:"2.5",minH:"8",gap:"1.5","--tag-avatar-size":"spacing.6","--tag-element-size":"spacing.4.5","--tag-element-offset":"-4px"},label:{textStyle:"sm"}}},variant:{subtle:{root:Pr==null?void 0:Pr.subtle},solid:{root:Pr==null?void 0:Pr.solid},outline:{root:Pr==null?void 0:Pr.outline},surface:{root:Pr==null?void 0:Pr.surface}}},defaultVariants:{size:"md",variant:"surface"}}),OF=Oe({slots:LL.keys(),className:"chakra-timeline",base:{root:{display:"flex",flexDirection:"column",width:"full","--timeline-thickness":"1px","--timeline-gutter":"4px"},item:{display:"flex",position:"relative",alignItems:"flex-start",flexShrink:0,gap:"4",_last:{"& :where(.chakra-timeline__separator)":{display:"none"}}},separator:{position:"absolute",borderStartWidth:"var(--timeline-thickness)",ms:"calc(-1 * var(--timeline-thickness) / 2)",insetInlineStart:"calc(var(--timeline-indicator-size) / 2)",insetBlock:"0",borderColor:"border"},indicator:{outline:"2px solid {colors.bg}",position:"relative",flexShrink:"0",boxSize:"var(--timeline-indicator-size)",fontSize:"var(--timeline-font-size)",display:"flex",alignItems:"center",justifyContent:"center",borderRadius:"full",fontWeight:"medium"},connector:{alignSelf:"stretch",position:"relative"},content:{pb:"6",display:"flex",flexDirection:"column",width:"full",gap:"2"},title:{display:"flex",fontWeight:"medium",flexWrap:"wrap",gap:"1.5",alignItems:"center",mt:"var(--timeline-margin)"},description:{color:"fg.muted",textStyle:"xs"}},variants:{variant:{subtle:{indicator:{bg:"colorPalette.muted"}},solid:{indicator:{bg:"colorPalette.solid",color:"colorPalette.contrast"}},outline:{indicator:{bg:"currentBg",borderWidth:"1px",borderColor:"colorPalette.muted"}},plain:{}},size:{sm:{root:{"--timeline-indicator-size":"sizes.4","--timeline-font-size":"fontSizes.2xs"},title:{textStyle:"xs"}},md:{root:{"--timeline-indicator-size":"sizes.5","--timeline-font-size":"fontSizes.xs"},title:{textStyle:"sm"}},lg:{root:{"--timeline-indicator-size":"sizes.6","--timeline-font-size":"fontSizes.xs"},title:{mt:"0.5",textStyle:"sm"}},xl:{root:{"--timeline-indicator-size":"sizes.8","--timeline-font-size":"fontSizes.sm"},title:{mt:"1.5",textStyle:"sm"}}}},defaultVariants:{size:"md",variant:"solid"}}),TF=Oe({slots:BL.keys(),className:"chakra-toast",base:{root:{width:"full",display:"flex",alignItems:"flex-start",position:"relative",gap:"3",py:"4",ps:"4",pe:"6",borderRadius:"l2",translate:"var(--x) var(--y)",scale:"var(--scale)",zIndex:"var(--z-index)",height:"var(--height)",opacity:"var(--opacity)",willChange:"translate, opacity, scale",transition:"translate 400ms, scale 400ms, opacity 400ms, height 400ms, box-shadow 200ms",transitionTimingFunction:"cubic-bezier(0.21, 1.02, 0.73, 1)",_closed:{transition:"translate 400ms, scale 400ms, opacity 200ms",transitionTimingFunction:"cubic-bezier(0.06, 0.71, 0.55, 1)"},bg:"bg.panel",color:"fg",boxShadow:"xl","--toast-trigger-bg":"colors.bg.muted","&[data-type=warning]":{bg:"orange.solid",color:"orange.contrast","--toast-trigger-bg":"{white/10}","--toast-border-color":"{white/40}"},"&[data-type=success]":{bg:"green.solid",color:"green.contrast","--toast-trigger-bg":"{white/10}","--toast-border-color":"{white/40}"},"&[data-type=error]":{bg:"red.solid",color:"red.contrast","--toast-trigger-bg":"{white/10}","--toast-border-color":"{white/40}"}},title:{fontWeight:"medium",textStyle:"sm",marginEnd:"2"},description:{display:"inline",textStyle:"sm",opacity:"0.8"},indicator:{flexShrink:"0",boxSize:"5"},actionTrigger:{textStyle:"sm",fontWeight:"medium",height:"8",px:"3",borderRadius:"l2",alignSelf:"center",borderWidth:"1px",borderColor:"var(--toast-border-color, inherit)",transition:"background 200ms",_hover:{bg:"var(--toast-trigger-bg)"}},closeTrigger:{position:"absolute",top:"1",insetEnd:"1",padding:"1",display:"inline-flex",alignItems:"center",justifyContent:"center",color:"{currentColor/60}",borderRadius:"l2",textStyle:"md",transition:"background 200ms",_icon:{boxSize:"1em"}}}}),PF=Oe({slots:wx.keys(),className:"chakra-tooltip",base:{content:{"--tooltip-bg":"colors.bg.inverted",bg:"var(--tooltip-bg)",color:"fg.inverted",px:"2.5",py:"1",borderRadius:"l2",fontWeight:"medium",textStyle:"xs",boxShadow:"md",maxW:"xs",zIndex:"tooltip",transformOrigin:"var(--transform-origin)",_open:{animationStyle:"scale-fade-in",animationDuration:"fast"},_closed:{animationStyle:"scale-fade-out",animationDuration:"fast"}},arrow:{"--arrow-size":"sizes.2","--arrow-background":"var(--tooltip-bg)"},arrowTip:{borderTopWidth:"1px",borderInlineStartWidth:"1px",borderColor:"var(--tooltip-bg)"}}}),A2=Al({display:"flex",alignItems:"center",gap:"var(--tree-item-gap)",rounded:"l2",userSelect:"none",position:"relative","--tree-depth":"calc(var(--depth) - 1)","--tree-indentation-offset":"calc(var(--tree-indentation) * var(--tree-depth))","--tree-icon-offset":"calc(var(--tree-icon-size) * var(--tree-depth) * 0.5)","--tree-offset":"calc(var(--tree-padding-inline) + var(--tree-indentation-offset) + var(--tree-icon-offset))",ps:"var(--tree-offset)",pe:"var(--tree-padding-inline)",py:"var(--tree-padding-block)",focusVisibleRing:"inside",focusRingColor:"border.emphasized",focusRingWidth:"2px","&:hover, &:focus-visible":{bg:"bg.muted"},_disabled:{layerStyle:"disabled"}}),k2=Al({flex:"1"}),C2=Al({_selected:{bg:"colorPalette.subtle",color:"colorPalette.fg"}}),I2=Al({_selected:{layerStyle:"fill.solid"}}),NF=Oe({slots:G1.keys(),className:"chakra-tree-view",base:{root:{width:"full",display:"flex",flexDirection:"column",gap:"2"},tree:{display:"flex",flexDirection:"column","--tree-item-gap":"spacing.2",_icon:{boxSize:"var(--tree-icon-size)"}},label:{fontWeight:"medium",textStyle:"sm"},branch:{position:"relative"},branchContent:{position:"relative"},branchIndentGuide:{height:"100%",width:"1px",bg:"border",position:"absolute","--tree-depth":"calc(var(--depth) - 1)","--tree-indentation-offset":"calc(var(--tree-indentation) * var(--tree-depth))","--tree-offset":"calc(var(--tree-padding-inline) + var(--tree-indentation-offset))","--tree-icon-offset":"calc(var(--tree-icon-size) * 0.5 * var(--depth))",insetInlineStart:"calc(var(--tree-offset) + var(--tree-icon-offset))",zIndex:"1"},branchIndicator:{color:"fg.muted",transformOrigin:"center",transitionDuration:"normal",transitionProperty:"transform",transitionTimingFunction:"default",_open:{transform:"rotate(90deg)"}},branchTrigger:{display:"inline-flex",alignItems:"center",justifyContent:"center"},branchControl:A2,item:A2,itemText:k2,branchText:k2,nodeCheckbox:{display:"inline-flex"}},variants:{size:{md:{tree:{textStyle:"sm","--tree-indentation":"spacing.4","--tree-padding-inline":"spacing.3","--tree-padding-block":"spacing.1.5","--tree-icon-size":"spacing.4"}},sm:{tree:{textStyle:"sm","--tree-indentation":"spacing.4","--tree-padding-inline":"spacing.3","--tree-padding-block":"spacing.1","--tree-icon-size":"spacing.3"}},xs:{tree:{textStyle:"xs","--tree-indentation":"spacing.4","--tree-padding-inline":"spacing.2","--tree-padding-block":"spacing.1","--tree-icon-size":"spacing.3"}}},variant:{subtle:{branchControl:C2,item:C2},solid:{branchControl:I2,item:I2}},animateContent:{true:{branchContent:{_open:{animationName:"expand-height, fade-in",animationDuration:"moderate"},_closed:{animationName:"collapse-height, fade-out",animationDuration:"moderate"}}}}},defaultVariants:{size:"md",variant:"subtle"}}),BF={accordion:VL,actionBar:DL,alert:zL,avatar:UL,blockquote:$L,breadcrumb:HL,card:WL,checkbox:GL,checkboxCard:jL,codeBlock:KL,collapsible:qL,dataList:XL,dialog:JL,drawer:ZL,editable:eF,emptyState:tF,field:nF,fieldset:rF,fileUpload:iF,hoverCard:oF,list:sF,menu:aF,nativeSelect:lF,numberInput:cF,pinInput:dF,popover:fF,progress:hF,progressCircle:pF,radioCard:mF,radioGroup:yF,ratingGroup:bF,segmentGroup:vF,select:ih,combobox:QL,slider:wF,stat:xF,steps:SF,switch:AF,table:kF,tabs:CF,tag:IF,toast:TF,tooltip:PF,status:EF,timeline:OF,colorPicker:YL,qrCode:gF,treeView:NF},RF=vR({"2xs":{value:{fontSize:"2xs",lineHeight:"0.75rem"}},xs:{value:{fontSize:"xs",lineHeight:"1rem"}},sm:{value:{fontSize:"sm",lineHeight:"1.25rem"}},md:{value:{fontSize:"md",lineHeight:"1.5rem"}},lg:{value:{fontSize:"lg",lineHeight:"1.75rem"}},xl:{value:{fontSize:"xl",lineHeight:"1.875rem"}},"2xl":{value:{fontSize:"2xl",lineHeight:"2rem"}},"3xl":{value:{fontSize:"3xl",lineHeight:"2.375rem"}},"4xl":{value:{fontSize:"4xl",lineHeight:"2.75rem",letterSpacing:"-0.025em"}},"5xl":{value:{fontSize:"5xl",lineHeight:"3.75rem",letterSpacing:"-0.025em"}},"6xl":{value:{fontSize:"6xl",lineHeight:"4.5rem",letterSpacing:"-0.025em"}},"7xl":{value:{fontSize:"7xl",lineHeight:"5.75rem",letterSpacing:"-0.025em"}},none:{value:{}},label:{value:{fontSize:"sm",lineHeight:"1.25rem",fontWeight:"medium"}}}),MF=Rt.animations({spin:{value:"spin 1s linear infinite"},ping:{value:"ping 1s cubic-bezier(0, 0, 0.2, 1) infinite"},pulse:{value:"pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite"},bounce:{value:"bounce 1s infinite"}}),LF=Rt.aspectRatios({square:{value:"1 / 1"},landscape:{value:"4 / 3"},portrait:{value:"3 / 4"},wide:{value:"16 / 9"},ultrawide:{value:"18 / 5"},golden:{value:"1.618 / 1"}}),FF=Rt.blurs({none:{value:" "},sm:{value:"4px"},md:{value:"8px"},lg:{value:"12px"},xl:{value:"16px"},"2xl":{value:"24px"},"3xl":{value:"40px"},"4xl":{value:"64px"}}),_F=Rt.borders({xs:{value:"0.5px solid"},sm:{value:"1px solid"},md:{value:"2px solid"},lg:{value:"4px solid"},xl:{value:"8px solid"}}),VF=Rt.colors({transparent:{value:"transparent"},current:{value:"currentColor"},black:{value:"#09090B"},white:{value:"#FFFFFF"},whiteAlpha:{50:{value:"rgba(255, 255, 255, 0.04)"},100:{value:"rgba(255, 255, 255, 0.06)"},200:{value:"rgba(255, 255, 255, 0.08)"},300:{value:"rgba(255, 255, 255, 0.16)"},400:{value:"rgba(255, 255, 255, 0.24)"},500:{value:"rgba(255, 255, 255, 0.36)"},600:{value:"rgba(255, 255, 255, 0.48)"},700:{value:"rgba(255, 255, 255, 0.64)"},800:{value:"rgba(255, 255, 255, 0.80)"},900:{value:"rgba(255, 255, 255, 0.92)"},950:{value:"rgba(255, 255, 255, 0.95)"}},blackAlpha:{50:{value:"rgba(0, 0, 0, 0.04)"},100:{value:"rgba(0, 0, 0, 0.06)"},200:{value:"rgba(0, 0, 0, 0.08)"},300:{value:"rgba(0, 0, 0, 0.16)"},400:{value:"rgba(0, 0, 0, 0.24)"},500:{value:"rgba(0, 0, 0, 0.36)"},600:{value:"rgba(0, 0, 0, 0.48)"},700:{value:"rgba(0, 0, 0, 0.64)"},800:{value:"rgba(0, 0, 0, 0.80)"},900:{value:"rgba(0, 0, 0, 0.92)"},950:{value:"rgba(0, 0, 0, 0.95)"}},gray:{50:{value:"#fafafa"},100:{value:"#f4f4f5"},200:{value:"#e4e4e7"},300:{value:"#d4d4d8"},400:{value:"#a1a1aa"},500:{value:"#71717a"},600:{value:"#52525b"},700:{value:"#3f3f46"},800:{value:"#27272a"},900:{value:"#18181b"},950:{value:"#111111"}},red:{50:{value:"#fef2f2"},100:{value:"#fee2e2"},200:{value:"#fecaca"},300:{value:"#fca5a5"},400:{value:"#f87171"},500:{value:"#ef4444"},600:{value:"#dc2626"},700:{value:"#991919"},800:{value:"#511111"},900:{value:"#300c0c"},950:{value:"#1f0808"}},orange:{50:{value:"#fff7ed"},100:{value:"#ffedd5"},200:{value:"#fed7aa"},300:{value:"#fdba74"},400:{value:"#fb923c"},500:{value:"#f97316"},600:{value:"#ea580c"},700:{value:"#92310a"},800:{value:"#6c2710"},900:{value:"#3b1106"},950:{value:"#220a04"}},yellow:{50:{value:"#fefce8"},100:{value:"#fef9c3"},200:{value:"#fef08a"},300:{value:"#fde047"},400:{value:"#facc15"},500:{value:"#eab308"},600:{value:"#ca8a04"},700:{value:"#845209"},800:{value:"#713f12"},900:{value:"#422006"},950:{value:"#281304"}},green:{50:{value:"#f0fdf4"},100:{value:"#dcfce7"},200:{value:"#bbf7d0"},300:{value:"#86efac"},400:{value:"#4ade80"},500:{value:"#22c55e"},600:{value:"#16a34a"},700:{value:"#116932"},800:{value:"#124a28"},900:{value:"#042713"},950:{value:"#03190c"}},teal:{50:{value:"#f0fdfa"},100:{value:"#ccfbf1"},200:{value:"#99f6e4"},300:{value:"#5eead4"},400:{value:"#2dd4bf"},500:{value:"#14b8a6"},600:{value:"#0d9488"},700:{value:"#0c5d56"},800:{value:"#114240"},900:{value:"#032726"},950:{value:"#021716"}},blue:{50:{value:"#eff6ff"},100:{value:"#dbeafe"},200:{value:"#bfdbfe"},300:{value:"#a3cfff"},400:{value:"#60a5fa"},500:{value:"#3b82f6"},600:{value:"#2563eb"},700:{value:"#173da6"},800:{value:"#1a3478"},900:{value:"#14204a"},950:{value:"#0c142e"}},cyan:{50:{value:"#ecfeff"},100:{value:"#cffafe"},200:{value:"#a5f3fc"},300:{value:"#67e8f9"},400:{value:"#22d3ee"},500:{value:"#06b6d4"},600:{value:"#0891b2"},700:{value:"#0c5c72"},800:{value:"#134152"},900:{value:"#072a38"},950:{value:"#051b24"}},purple:{50:{value:"#faf5ff"},100:{value:"#f3e8ff"},200:{value:"#e9d5ff"},300:{value:"#d8b4fe"},400:{value:"#c084fc"},500:{value:"#a855f7"},600:{value:"#9333ea"},700:{value:"#641ba3"},800:{value:"#4a1772"},900:{value:"#2f0553"},950:{value:"#1a032e"}},pink:{50:{value:"#fdf2f8"},100:{value:"#fce7f3"},200:{value:"#fbcfe8"},300:{value:"#f9a8d4"},400:{value:"#f472b6"},500:{value:"#ec4899"},600:{value:"#db2777"},700:{value:"#a41752"},800:{value:"#6d0e34"},900:{value:"#45061f"},950:{value:"#2c0514"}}}),DF=Rt.cursor({button:{value:"pointer"},checkbox:{value:"default"},disabled:{value:"not-allowed"},menuitem:{value:"default"},option:{value:"default"},radio:{value:"default"},slider:{value:"default"},switch:{value:"pointer"}}),zF=Rt.durations({fastest:{value:"50ms"},faster:{value:"100ms"},fast:{value:"150ms"},moderate:{value:"200ms"},slow:{value:"300ms"},slower:{value:"400ms"},slowest:{value:"500ms"}}),UF=Rt.easings({"ease-in":{value:"cubic-bezier(0.42, 0, 1, 1)"},"ease-out":{value:"cubic-bezier(0, 0, 0.58, 1)"},"ease-in-out":{value:"cubic-bezier(0.42, 0, 0.58, 1)"},"ease-in-smooth":{value:"cubic-bezier(0.32, 0.72, 0, 1)"}}),$F=Rt.fontSizes({"2xs":{value:"0.625rem"},xs:{value:"0.75rem"},sm:{value:"0.875rem"},md:{value:"1rem"},lg:{value:"1.125rem"},xl:{value:"1.25rem"},"2xl":{value:"1.5rem"},"3xl":{value:"1.875rem"},"4xl":{value:"2.25rem"},"5xl":{value:"3rem"},"6xl":{value:"3.75rem"},"7xl":{value:"4.5rem"},"8xl":{value:"6rem"},"9xl":{value:"8rem"}}),HF=Rt.fontWeights({thin:{value:"100"},extralight:{value:"200"},light:{value:"300"},normal:{value:"400"},medium:{value:"500"},semibold:{value:"600"},bold:{value:"700"},extrabold:{value:"800"},black:{value:"900"}}),O2='-apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"',WF=Rt.fonts({heading:{value:`Inter, ${O2}`},body:{value:`Inter, ${O2}`},mono:{value:'SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace'}}),GF=yR({spin:{"0%":{transform:"rotate(0deg)"},"100%":{transform:"rotate(360deg)"}},pulse:{"50%":{opacity:"0.5"}},ping:{"75%, 100%":{transform:"scale(2)",opacity:"0"}},bounce:{"0%, 100%":{transform:"translateY(-25%)",animationTimingFunction:"cubic-bezier(0.8,0,1,1)"},"50%":{transform:"none",animationTimingFunction:"cubic-bezier(0,0,0.2,1)"}},"bg-position":{from:{backgroundPosition:"var(--animate-from, 1rem) 0"},to:{backgroundPosition:"var(--animate-to, 0) 0"}},position:{from:{insetInlineStart:"var(--animate-from-x)",insetBlockStart:"var(--animate-from-y)"},to:{insetInlineStart:"var(--animate-to-x)",insetBlockStart:"var(--animate-to-y)"}},"circular-progress":{"0%":{strokeDasharray:"1, 400",strokeDashoffset:"0"},"50%":{strokeDasharray:"400, 400",strokeDashoffset:"-100%"},"100%":{strokeDasharray:"400, 400",strokeDashoffset:"-260%"}},"expand-height":{from:{height:"0"},to:{height:"var(--height)"}},"collapse-height":{from:{height:"var(--height)"},to:{height:"0"}},"expand-width":{from:{width:"0"},to:{width:"var(--width)"}},"collapse-width":{from:{height:"var(--width)"},to:{height:"0"}},"fade-in":{from:{opacity:0},to:{opacity:1}},"fade-out":{from:{opacity:1},to:{opacity:0}},"slide-from-left-full":{from:{translate:"-100% 0"},to:{translate:"0 0"}},"slide-from-right-full":{from:{translate:"100% 0"},to:{translate:"0 0"}},"slide-from-top-full":{from:{translate:"0 -100%"},to:{translate:"0 0"}},"slide-from-bottom-full":{from:{translate:"0 100%"},to:{translate:"0 0"}},"slide-to-left-full":{from:{translate:"0 0"},to:{translate:"-100% 0"}},"slide-to-right-full":{from:{translate:"0 0"},to:{translate:"100% 0"}},"slide-to-top-full":{from:{translate:"0 0"},to:{translate:"0 -100%"}},"slide-to-bottom-full":{from:{translate:"0 0"},to:{translate:"0 100%"}},"slide-from-top":{"0%":{translate:"0 -0.5rem"},to:{translate:"0"}},"slide-from-bottom":{"0%":{translate:"0 0.5rem"},to:{translate:"0"}},"slide-from-left":{"0%":{translate:"-0.5rem 0"},to:{translate:"0"}},"slide-from-right":{"0%":{translate:"0.5rem 0"},to:{translate:"0"}},"slide-to-top":{"0%":{translate:"0"},to:{translate:"0 -0.5rem"}},"slide-to-bottom":{"0%":{translate:"0"},to:{translate:"0 0.5rem"}},"slide-to-left":{"0%":{translate:"0"},to:{translate:"-0.5rem 0"}},"slide-to-right":{"0%":{translate:"0"},to:{translate:"0.5rem 0"}},"scale-in":{from:{scale:"0.95"},to:{scale:"1"}},"scale-out":{from:{scale:"1"},to:{scale:"0.95"}}}),jF=Rt.letterSpacings({tighter:{value:"-0.05em"},tight:{value:"-0.025em"},wide:{value:"0.025em"},wider:{value:"0.05em"},widest:{value:"0.1em"}}),KF=Rt.lineHeights({shorter:{value:1.25},short:{value:1.375},moderate:{value:1.5},tall:{value:1.625},taller:{value:2}}),qF=Rt.radii({none:{value:"0"},"2xs":{value:"0.0625rem"},xs:{value:"0.125rem"},sm:{value:"0.25rem"},md:{value:"0.375rem"},lg:{value:"0.5rem"},xl:{value:"0.75rem"},"2xl":{value:"1rem"},"3xl":{value:"1.5rem"},"4xl":{value:"2rem"},full:{value:"9999px"}}),T2=Rt.spacing({.5:{value:"0.125rem"},1:{value:"0.25rem"},1.5:{value:"0.375rem"},2:{value:"0.5rem"},2.5:{value:"0.625rem"},3:{value:"0.75rem"},3.5:{value:"0.875rem"},4:{value:"1rem"},4.5:{value:"1.125rem"},5:{value:"1.25rem"},6:{value:"1.5rem"},7:{value:"1.75rem"},8:{value:"2rem"},9:{value:"2.25rem"},10:{value:"2.5rem"},11:{value:"2.75rem"},12:{value:"3rem"},14:{value:"3.5rem"},16:{value:"4rem"},20:{value:"5rem"},24:{value:"6rem"},28:{value:"7rem"},32:{value:"8rem"},36:{value:"9rem"},40:{value:"10rem"},44:{value:"11rem"},48:{value:"12rem"},52:{value:"13rem"},56:{value:"14rem"},60:{value:"15rem"},64:{value:"16rem"},72:{value:"18rem"},80:{value:"20rem"},96:{value:"24rem"}}),YF=Rt.sizes({"3xs":{value:"14rem"},"2xs":{value:"16rem"},xs:{value:"20rem"},sm:{value:"24rem"},md:{value:"28rem"},lg:{value:"32rem"},xl:{value:"36rem"},"2xl":{value:"42rem"},"3xl":{value:"48rem"},"4xl":{value:"56rem"},"5xl":{value:"64rem"},"6xl":{value:"72rem"},"7xl":{value:"80rem"},"8xl":{value:"90rem"}}),QF=Rt.sizes({max:{value:"max-content"},min:{value:"min-content"},fit:{value:"fit-content"},prose:{value:"60ch"},full:{value:"100%"},dvh:{value:"100dvh"},svh:{value:"100svh"},lvh:{value:"100lvh"},dvw:{value:"100dvw"},svw:{value:"100svw"},lvw:{value:"100lvw"},vw:{value:"100vw"},vh:{value:"100vh"}}),XF=Rt.sizes({"1/2":{value:"50%"},"1/3":{value:"33.333333%"},"2/3":{value:"66.666667%"},"1/4":{value:"25%"},"3/4":{value:"75%"},"1/5":{value:"20%"},"2/5":{value:"40%"},"3/5":{value:"60%"},"4/5":{value:"80%"},"1/6":{value:"16.666667%"},"2/6":{value:"33.333333%"},"3/6":{value:"50%"},"4/6":{value:"66.666667%"},"5/6":{value:"83.333333%"},"1/12":{value:"8.333333%"},"2/12":{value:"16.666667%"},"3/12":{value:"25%"},"4/12":{value:"33.333333%"},"5/12":{value:"41.666667%"},"6/12":{value:"50%"},"7/12":{value:"58.333333%"},"8/12":{value:"66.666667%"},"9/12":{value:"75%"},"10/12":{value:"83.333333%"},"11/12":{value:"91.666667%"}}),JF=Rt.sizes({...YF,...T2,...XF,...QF}),ZF=Rt.zIndex({hide:{value:-1},base:{value:0},docked:{value:10},dropdown:{value:1e3},sticky:{value:1100},banner:{value:1200},overlay:{value:1300},modal:{value:1400},popover:{value:1500},skipNav:{value:1600},toast:{value:1700},tooltip:{value:1800},max:{value:2147483647}}),e_=M0({preflight:!0,cssVarsPrefix:"chakra",cssVarsRoot:":where(html, .chakra-theme)",globalCss:FM,theme:{breakpoints:LM,keyframes:GF,tokens:{aspectRatios:LF,animations:MF,blurs:FF,borders:_F,colors:VF,durations:zF,easings:UF,fonts:WF,fontSizes:$F,fontWeights:HF,letterSpacings:jF,lineHeights:KF,radii:qF,spacing:T2,sizes:JF,zIndex:ZF,cursor:DF},semanticTokens:{colors:nL,shadows:iL,radii:rL},recipes:tL,slotRecipes:BF,textStyles:RF,layerStyles:_M,animationStyles:VM}}),G0=Ox(TR,e_);h2(G0);function t_(t){const{key:e,recipe:n}=t,r=af();return J.useMemo(()=>{const i=n||(e!=null?r.getSlotRecipe(e):{});return r.sva(structuredClone(i))},[e,n,r])}const n_=t=>t.charAt(0).toUpperCase()+t.slice(1),j0=t=>{const{key:e,recipe:n}=t,r=n_(e||n.className||"Component"),[i,o]=pu({name:`${r}StylesContext`,errorMessage:`use${r}Styles returned is 'undefined'. Seems you forgot to wrap the components in "<${r}.Root />" `}),[s,a]=pu({name:`${r}ClassNameContext`,errorMessage:`use${r}ClassNames returned is 'undefined'. Seems you forgot to wrap the components in "<${r}.Root />" `,strict:!1}),[l,c]=pu({strict:!1,name:`${r}PropsContext`,providerName:`${r}PropsContext`,defaultValue:{}});function u(b){const{unstyled:p,...w}=b,S=t_({key:e,recipe:w.recipe||n}),[O,T]=J.useMemo(()=>S.splitVariantProps(w),[w,S]);return{styles:J.useMemo(()=>p?u3:S(O),[p,O,S]),classNames:S.classNameMap,props:T}}function d(b,p={}){const{defaultProps:w}=p,S=O=>{const T=c(),$=J.useMemo(()=>fu(w,T,O),[T,O]),{styles:R,classNames:j,props:q}=u($);return k.jsx(i,{value:R,children:k.jsx(s,{value:j,children:k.jsx(b,{...q})})})};return S.displayName=b.displayName||b.name,S}return{StylesProvider:i,ClassNamesProvider:s,PropsProvider:l,usePropsContext:c,useRecipeResult:u,withProvider:(b,p,w)=>{const{defaultProps:S,...O}=w!=null?w:{},T=We(b,{},O),$=J.forwardRef((R,j)=>{var f,y;const q=c(),G=J.useMemo(()=>fu(S!=null?S:{},q,R),[q,R]),{styles:L,props:V,classNames:W}=u(G),z=W[p],C=k.jsx(i,{value:L,children:k.jsx(s,{value:W,children:k.jsx(T,{ref:j,...V,css:[L[p],G.css],className:Yn(G.className,z)})})});return(y=(f=w==null?void 0:w.wrapElement)==null?void 0:f.call(w,C,G))!=null?y:C});return $.displayName=b.displayName||b.name,$},withContext:(b,p,w)=>{const S=We(b,{},w),O=J.forwardRef((T,$)=>{const{unstyled:R,...j}=T,q=o(),G=a(),L=G==null?void 0:G[p];return k.jsx(S,{...j,css:[!R&&p?q[p]:void 0,T.css],ref:$,className:Yn(T.className,L)})});return O.displayName=b.displayName||b.name,O},withRootProvider:d,useStyles:o,useClassNames:a}},P2=We("div",{base:{position:"absolute",display:"flex",alignItems:"center",justifyContent:"center"},variants:{axis:{horizontal:{insetStart:"50%",translate:"-50%",_rtl:{translate:"50%"}},vertical:{top:"50%",translate:"0 -50%"},both:{insetStart:"50%",top:"50%",translate:"-50% -50%",_rtl:{translate:"50% -50%"}}}},defaultVariants:{axis:"both"}});P2.displayName="AbsoluteCenter";const r_=t=>t?"":void 0,{withContext:i_}=zo({key:"badge"}),o_=i_("span"),{withContext:s_}=zo({key:"spinner"}),oh=s_("span"),a_=Ke.forwardRef(function(e,n){const{spinner:r=k.jsx(oh,{size:"inherit",borderWidth:"0.125em",color:"inherit"}),spinnerPlacement:i="start",children:o,text:s,visible:a=!0,...l}=e;return a?s?k.jsxs(Gs,{ref:n,display:"contents",...l,children:[i==="start"&&r,s,i==="end"&&r]}):r?k.jsxs(Gs,{ref:n,display:"contents",...l,children:[k.jsx(P2,{display:"inline-flex",children:r}),k.jsx(Gs,{visibility:"hidden",display:"contents",children:o})]}):k.jsx(Gs,{ref:n,display:"contents",...l,children:o}):o}),{useRecipeResult:l_,usePropsContext:c_}=zo({key:"button"}),N2=J.forwardRef(function(e,n){const r=c_(),i=J.useMemo(()=>fu(r,e),[r,e]),o=l_(i),{loading:s,loadingText:a,children:l,spinner:c,spinnerPlacement:u,...d}=o.props;return k.jsx(We.button,{type:"button",ref:n,...d,"data-loading":r_(s),disabled:s||d.disabled,className:Yn(o.className,i.className),css:[o.styles,i.css],children:!i.asChild&&s?k.jsx(a_,{spinner:c,text:a,spinnerPlacement:u,children:l}):l})}),u_=J.forwardRef(function(e,n){return k.jsx(N2,{px:"0",py:"0",_icon:{fontSize:"1.2em"},ref:n,...e})}),sh=We("div",{base:{display:"flex",alignItems:"center",justifyContent:"center"},variants:{inline:{true:{display:"inline-flex"}}}});sh.displayName="Center";const{withProvider:B2,withContext:R2}=j0({key:"collapsible"});B2(l1,"root",{forwardAsChild:!0});const d_=B2(gw,"root",{forwardAsChild:!0}),f_=R2(c1,"trigger",{forwardAsChild:!0}),h_=R2(Jw,"content",{forwardAsChild:!0});function p_(t){const{gap:e,direction:n}=t,r={column:{marginY:e,marginX:0,borderInlineStartWidth:0,borderTopWidth:"1px"},"column-reverse":{marginY:e,marginX:0,borderInlineStartWidth:0,borderTopWidth:"1px"},row:{marginX:e,marginY:0,borderInlineStartWidth:"1px",borderTopWidth:0},"row-reverse":{marginX:e,marginY:0,borderInlineStartWidth:"1px",borderTopWidth:0}};return{"&":Bx(n,i=>r[i])}}function g_(t){return J.Children.toArray(t).filter(e=>J.isValidElement(e))}const m_=J.forwardRef(function(e,n){const{direction:r="column",align:i,justify:o,gap:s="0.5rem",wrap:a,children:l,separator:c,className:u,...d}=e,h=J.useMemo(()=>p_({gap:s,direction:r}),[s,r]),g=J.useMemo(()=>J.isValidElement(c)?g_(l).map((b,p,w)=>{const S=typeof b.key!="undefined"?b.key:p,O=c,T=J.cloneElement(O,{css:[h,O.props.css]});return k.jsxs(J.Fragment,{children:[b,p===w.length-1?null:T]},S)}):l,[l,c,h]);return k.jsx(We.div,{ref:n,display:"flex",alignItems:i,justifyContent:o,flexDirection:r,flexWrap:a,gap:c?void 0:s,className:Yn("chakra-stack",u),...d,children:g})}),{useRecipeResult:y_}=zo({key:"icon"}),Lt=Ke.forwardRef(function(e,n){const{styles:r,className:i,props:o}=y_({asChild:!e.as,...e});return k.jsx(We.svg,{ref:n,focusable:!1,"aria-hidden":"true",...o,css:[r,e.css],className:Yn(i,e.className)})}),ro=J.forwardRef(function(e,n){const{direction:r,align:i,justify:o,wrap:s,basis:a,grow:l,shrink:c,inline:u,...d}=e;return k.jsx(We.div,{ref:n,...d,css:{display:u?"inline-flex":"flex",flexDirection:r,alignItems:i,justifyContent:o,flexWrap:s,flexBasis:a,flexGrow:l,flexShrink:c,...e.css}})}),pr=J.forwardRef(function(e,n){const{align:r,fit:i="cover",...o}=e;return k.jsx(We.img,{ref:n,objectFit:i,objectPosition:r,className:Yn("chakra-image",e.className),...o})}),{withContext:b_}=zo({key:"input"}),v_=b_(O1),{withContext:w_}=zo({key:"link"}),M2=w_("a"),{withContext:x_}=zo({key:"skeleton"}),io=x_("div"),L2=Ke.forwardRef(function(e,n){const{size:r,...i}=e;return k.jsx(l3,{size:r,asChild:!0,ref:n,children:k.jsx(io,{...i})})}),ah=Ke.forwardRef(function(e,n){const{noOfLines:r=3,gap:i,rootProps:o,...s}=e;return k.jsx(m_,{gap:i,width:"full",ref:n,...o,children:Array.from({length:r}).map((a,l)=>k.jsx(io,{height:"4",_last:{maxW:r===1?"100%":"80%"},...s},l))})}),{StylesProvider:E_,ClassNamesProvider:S_,useRecipeResult:A_,withContext:oo}=j0({key:"table"}),lh=J.forwardRef(function({native:e,...n},r){const{styles:i,props:o,classNames:s}=A_(n),a=J.useMemo(()=>e?{...i.root,"& thead":i.header,"& tbody":i.body,"& tfoot":i.footer,"& thead th":i.columnHeader,"& tr":i.row,"& td":i.cell,"& caption":i.caption}:i.root,[i,e]);return k.jsx(S_,{value:s,children:k.jsx(E_,{value:i,children:k.jsx(We.table,{ref:r,...o,css:[a,n.css],className:Yn(s==null?void 0:s.root,n.className)})})})}),so=oo("tr","row");We("div",{base:{display:"block",whiteSpace:"nowrap",WebkitOverflowScrolling:"touch",overflow:"auto",maxWidth:"100%"}}),oo("thead","header"),oo("tfoot","footer"),oo("th","columnHeader");const ln=oo("td","cell");oo("caption","caption",{defaultProps:{captionSide:"bottom"}});const ch=oo("tbody","body");oo("colgroup"),oo("col");const{withRootProvider:F2,withContext:_u}=j0({key:"tooltip"});F2(pR);const k_=F2(hR,{defaultProps:{lazyMount:!0,unmountOnExit:!0}}),C_=_u(kx,"trigger",{forwardAsChild:!0}),I_=_u(vx,"positioner",{forwardAsChild:!0}),O_=_u(bx,"content",{forwardAsChild:!0}),_2=_u(yx,"arrowTip",{forwardAsChild:!0}),T_=_u(mx,"arrow",{forwardAsChild:!0,defaultProps:{children:k.jsx(_2,{})}});/**
25
+ * @license lucide-react v0.469.0 - ISC
26
+ *
27
+ * This source code is licensed under the ISC license.
28
+ * See the LICENSE file in the root directory of this source tree.
29
+ */const P_=t=>t.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),V2=(...t)=>t.filter((e,n,r)=>!!e&&e.trim()!==""&&r.indexOf(e)===n).join(" ").trim();/**
30
+ * @license lucide-react v0.469.0 - ISC
31
+ *
32
+ * This source code is licensed under the ISC license.
33
+ * See the LICENSE file in the root directory of this source tree.
34
+ */var N_={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/**
35
+ * @license lucide-react v0.469.0 - ISC
36
+ *
37
+ * This source code is licensed under the ISC license.
38
+ * See the LICENSE file in the root directory of this source tree.
39
+ */const B_=J.forwardRef(({color:t="currentColor",size:e=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:i="",children:o,iconNode:s,...a},l)=>J.createElement("svg",{ref:l,...N_,width:e,height:e,stroke:t,strokeWidth:r?Number(n)*24/Number(e):n,className:V2("lucide",i),...a},[...s.map(([c,u])=>J.createElement(c,u)),...Array.isArray(o)?o:[o]]));/**
40
+ * @license lucide-react v0.469.0 - ISC
41
+ *
42
+ * This source code is licensed under the ISC license.
43
+ * See the LICENSE file in the root directory of this source tree.
44
+ */const Nr=(t,e)=>{const n=J.forwardRef(({className:r,...i},o)=>J.createElement(B_,{ref:o,iconNode:e,className:V2(`lucide-${P_(t)}`,r),...i}));return n.displayName=`${t}`,n};/**
45
+ * @license lucide-react v0.469.0 - ISC
46
+ *
47
+ * This source code is licensed under the ISC license.
48
+ * See the LICENSE file in the root directory of this source tree.
49
+ */const D2=Nr("ArrowDownUp",[["path",{d:"m3 16 4 4 4-4",key:"1co6wj"}],["path",{d:"M7 20V4",key:"1yoxec"}],["path",{d:"m21 8-4-4-4 4",key:"1c9v7m"}],["path",{d:"M17 4v16",key:"7dpous"}]]);/**
50
+ * @license lucide-react v0.469.0 - ISC
51
+ *
52
+ * This source code is licensed under the ISC license.
53
+ * See the LICENSE file in the root directory of this source tree.
54
+ */const R_=Nr("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);/**
55
+ * @license lucide-react v0.469.0 - ISC
56
+ *
57
+ * This source code is licensed under the ISC license.
58
+ * See the LICENSE file in the root directory of this source tree.
59
+ */const M_=Nr("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);/**
60
+ * @license lucide-react v0.469.0 - ISC
61
+ *
62
+ * This source code is licensed under the ISC license.
63
+ * See the LICENSE file in the root directory of this source tree.
64
+ */const Vu=Nr("ChevronLeft",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]]);/**
65
+ * @license lucide-react v0.469.0 - ISC
66
+ *
67
+ * This source code is licensed under the ISC license.
68
+ * See the LICENSE file in the root directory of this source tree.
69
+ */const z2=Nr("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);/**
70
+ * @license lucide-react v0.469.0 - ISC
71
+ *
72
+ * This source code is licensed under the ISC license.
73
+ * See the LICENSE file in the root directory of this source tree.
74
+ */const U2=Nr("ExternalLink",[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]]);/**
75
+ * @license lucide-react v0.469.0 - ISC
76
+ *
77
+ * This source code is licensed under the ISC license.
78
+ * See the LICENSE file in the root directory of this source tree.
79
+ */const L_=Nr("Fuel",[["line",{x1:"3",x2:"15",y1:"22",y2:"22",key:"xegly4"}],["line",{x1:"4",x2:"14",y1:"9",y2:"9",key:"xcnuvu"}],["path",{d:"M14 22V4a2 2 0 0 0-2-2H6a2 2 0 0 0-2 2v18",key:"16j0yd"}],["path",{d:"M14 13h2a2 2 0 0 1 2 2v2a2 2 0 0 0 2 2a2 2 0 0 0 2-2V9.83a2 2 0 0 0-.59-1.42L18 5",key:"7cu91f"}]]);/**
80
+ * @license lucide-react v0.469.0 - ISC
81
+ *
82
+ * This source code is licensed under the ISC license.
83
+ * See the LICENSE file in the root directory of this source tree.
84
+ */const F_=Nr("Handshake",[["path",{d:"m11 17 2 2a1 1 0 1 0 3-3",key:"efffak"}],["path",{d:"m14 14 2.5 2.5a1 1 0 1 0 3-3l-3.88-3.88a3 3 0 0 0-4.24 0l-.88.88a1 1 0 1 1-3-3l2.81-2.81a5.79 5.79 0 0 1 7.06-.87l.47.28a2 2 0 0 0 1.42.25L21 4",key:"9pr0kb"}],["path",{d:"m21 3 1 11h-2",key:"1tisrp"}],["path",{d:"M3 3 2 14l6.5 6.5a1 1 0 1 0 3-3",key:"1uvwmv"}],["path",{d:"M3 4h8",key:"1ep09j"}]]);/**
85
+ * @license lucide-react v0.469.0 - ISC
86
+ *
87
+ * This source code is licensed under the ISC license.
88
+ * See the LICENSE file in the root directory of this source tree.
89
+ */const __=Nr("Lock",[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 10 0v4",key:"fwvmzm"}]]);/**
90
+ * @license lucide-react v0.469.0 - ISC
91
+ *
92
+ * This source code is licensed under the ISC license.
93
+ * See the LICENSE file in the root directory of this source tree.
94
+ */const V_=Nr("ShieldCheck",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);/**
95
+ * @license lucide-react v0.469.0 - ISC
96
+ *
97
+ * This source code is licensed under the ISC license.
98
+ * See the LICENSE file in the root directory of this source tree.
99
+ */const D_=Nr("Wallet",[["path",{d:"M19 7V4a1 1 0 0 0-1-1H5a2 2 0 0 0 0 4h15a1 1 0 0 1 1 1v4h-3a2 2 0 0 0 0 4h3a1 1 0 0 0 1-1v-2a1 1 0 0 0-1-1",key:"18etb6"}],["path",{d:"M3 5v14a2 2 0 0 0 2 2h15a1 1 0 0 0 1-1v-4",key:"xoc0q4"}]]);/**
100
+ * @license lucide-react v0.469.0 - ISC
101
+ *
102
+ * This source code is licensed under the ISC license.
103
+ * See the LICENSE file in the root directory of this source tree.
104
+ */const ta=Nr("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);var uh={};const z_=lu(DP),U_=lu(uP);var dh={exports:{}};/*
105
+ object-assign
106
+ (c) Sindre Sorhus
107
+ @license MIT
108
+ */var K0,$2;function $_(){if($2)return K0;$2=1;var t=Object.getOwnPropertySymbols,e=Object.prototype.hasOwnProperty,n=Object.prototype.propertyIsEnumerable;function r(o){if(o==null)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(o)}function i(){try{if(!Object.assign)return!1;var o=new String("abc");if(o[5]="de",Object.getOwnPropertyNames(o)[0]==="5")return!1;for(var s={},a=0;a<10;a++)s["_"+String.fromCharCode(a)]=a;var l=Object.getOwnPropertyNames(s).map(function(u){return s[u]});if(l.join("")!=="0123456789")return!1;var c={};return"abcdefghijklmnopqrst".split("").forEach(function(u){c[u]=u}),Object.keys(Object.assign({},c)).join("")==="abcdefghijklmnopqrst"}catch(u){return!1}}return K0=i()?Object.assign:function(o,s){for(var a,l=r(o),c,u=1;u<arguments.length;u++){a=Object(arguments[u]);for(var d in a)e.call(a,d)&&(l[d]=a[d]);if(t){c=t(a);for(var h=0;h<c.length;h++)n.call(a,c[h])&&(l[c[h]]=a[c[h]])}}return l},K0}var q0,H2;function Y0(){if(H2)return q0;H2=1;var t="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";return q0=t,q0}var Q0,W2;function G2(){return W2||(W2=1,Q0=Function.call.bind(Object.prototype.hasOwnProperty)),Q0}var X0,j2;function H_(){if(j2)return X0;j2=1;var t=function(){};if(process.env.NODE_ENV!=="production"){var e=Y0(),n={},r=G2();t=function(o){var s="Warning: "+o;typeof console!="undefined"&&console.error(s);try{throw new Error(s)}catch(a){}}}function i(o,s,a,l,c){if(process.env.NODE_ENV!=="production"){for(var u in o)if(r(o,u)){var d;try{if(typeof o[u]!="function"){var h=Error((l||"React class")+": "+a+" type `"+u+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof o[u]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw h.name="Invariant Violation",h}d=o[u](s,u,l,a,null,e)}catch(b){d=b}if(d&&!(d instanceof Error)&&t((l||"React class")+": type specification of "+a+" `"+u+"` is invalid; the type checker function must return `null` or an `Error` but returned a "+typeof d+". You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument)."),d instanceof Error&&!(d.message in n)){n[d.message]=!0;var g=c?c():"";t("Failed "+a+" type: "+d.message+(g!=null?g:""))}}}}return i.resetWarningCache=function(){process.env.NODE_ENV!=="production"&&(n={})},X0=i,X0}var J0,K2;function W_(){if(K2)return J0;K2=1;var t=gg(),e=$_(),n=Y0(),r=G2(),i=H_(),o=function(){};process.env.NODE_ENV!=="production"&&(o=function(a){var l="Warning: "+a;typeof console!="undefined"&&console.error(l);try{throw new Error(l)}catch(c){}});function s(){return null}return J0=function(a,l){var c=typeof Symbol=="function"&&Symbol.iterator,u="@@iterator";function d(M){var P=M&&(c&&M[c]||M[u]);if(typeof P=="function")return P}var h="<<anonymous>>",g={array:S("array"),bigint:S("bigint"),bool:S("boolean"),func:S("function"),number:S("number"),object:S("object"),string:S("string"),symbol:S("symbol"),any:O(),arrayOf:T,element:$(),elementType:R(),instanceOf:j,node:V(),objectOf:G,oneOf:q,oneOfType:L,shape:z,exact:C};function b(M,P){return M===P?M!==0||1/M===1/P:M!==M&&P!==P}function p(M,P){this.message=M,this.data=P&&typeof P=="object"?P:{},this.stack=""}p.prototype=Error.prototype;function w(M){if(process.env.NODE_ENV!=="production")var P={},m=0;function v(U,Q,ee,Z,Y,re,de){if(Z=Z||h,re=re||ee,de!==n){if(l){var se=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use `PropTypes.checkPropTypes()` to call them. Read more at http://fb.me/use-check-prop-types");throw se.name="Invariant Violation",se}else if(process.env.NODE_ENV!=="production"&&typeof console!="undefined"){var me=Z+":"+ee;!P[me]&&m<3&&(o("You are manually calling a React.PropTypes validation function for the `"+re+"` prop on `"+Z+"`. This is deprecated and will throw in the standalone `prop-types` package. You may be seeing this warning due to a third-party PropTypes library. See https://fb.me/react-warning-dont-call-proptypes for details."),P[me]=!0,m++)}}return Q[ee]==null?U?Q[ee]===null?new p("The "+Y+" `"+re+"` is marked as required "+("in `"+Z+"`, but its value is `null`.")):new p("The "+Y+" `"+re+"` is marked as required in "+("`"+Z+"`, but its value is `undefined`.")):null:M(Q,ee,Z,Y,re)}var B=v.bind(null,!1);return B.isRequired=v.bind(null,!0),B}function S(M){function P(m,v,B,U,Q,ee){var Z=m[v],Y=E(Z);if(Y!==M){var re=I(Z);return new p("Invalid "+U+" `"+Q+"` of type "+("`"+re+"` supplied to `"+B+"`, expected ")+("`"+M+"`."),{expectedType:M})}return null}return w(P)}function O(){return w(s)}function T(M){function P(m,v,B,U,Q){if(typeof M!="function")return new p("Property `"+Q+"` of component `"+B+"` has invalid PropType notation inside arrayOf.");var ee=m[v];if(!Array.isArray(ee)){var Z=E(ee);return new p("Invalid "+U+" `"+Q+"` of type "+("`"+Z+"` supplied to `"+B+"`, expected an array."))}for(var Y=0;Y<ee.length;Y++){var re=M(ee,Y,B,U,Q+"["+Y+"]",n);if(re instanceof Error)return re}return null}return w(P)}function $(){function M(P,m,v,B,U){var Q=P[m];if(!a(Q)){var ee=E(Q);return new p("Invalid "+B+" `"+U+"` of type "+("`"+ee+"` supplied to `"+v+"`, expected a single ReactElement."))}return null}return w(M)}function R(){function M(P,m,v,B,U){var Q=P[m];if(!t.isValidElementType(Q)){var ee=E(Q);return new p("Invalid "+B+" `"+U+"` of type "+("`"+ee+"` supplied to `"+v+"`, expected a single ReactElement type."))}return null}return w(M)}function j(M){function P(m,v,B,U,Q){if(!(m[v]instanceof M)){var ee=M.name||h,Z=D(m[v]);return new p("Invalid "+U+" `"+Q+"` of type "+("`"+Z+"` supplied to `"+B+"`, expected ")+("instance of `"+ee+"`."))}return null}return w(P)}function q(M){if(!Array.isArray(M))return process.env.NODE_ENV!=="production"&&(arguments.length>1?o("Invalid arguments supplied to oneOf, expected an array, got "+arguments.length+" arguments. A common mistake is to write oneOf(x, y, z) instead of oneOf([x, y, z])."):o("Invalid argument supplied to oneOf, expected an array.")),s;function P(m,v,B,U,Q){for(var ee=m[v],Z=0;Z<M.length;Z++)if(b(ee,M[Z]))return null;var Y=JSON.stringify(M,function(de,se){var me=I(se);return me==="symbol"?String(se):se});return new p("Invalid "+U+" `"+Q+"` of value `"+String(ee)+"` "+("supplied to `"+B+"`, expected one of "+Y+"."))}return w(P)}function G(M){function P(m,v,B,U,Q){if(typeof M!="function")return new p("Property `"+Q+"` of component `"+B+"` has invalid PropType notation inside objectOf.");var ee=m[v],Z=E(ee);if(Z!=="object")return new p("Invalid "+U+" `"+Q+"` of type "+("`"+Z+"` supplied to `"+B+"`, expected an object."));for(var Y in ee)if(r(ee,Y)){var re=M(ee,Y,B,U,Q+"."+Y,n);if(re instanceof Error)return re}return null}return w(P)}function L(M){if(!Array.isArray(M))return process.env.NODE_ENV!=="production"&&o("Invalid argument supplied to oneOfType, expected an instance of array."),s;for(var P=0;P<M.length;P++){var m=M[P];if(typeof m!="function")return o("Invalid argument supplied to oneOfType. Expected an array of check functions, but received "+N(m)+" at index "+P+"."),s}function v(B,U,Q,ee,Z){for(var Y=[],re=0;re<M.length;re++){var de=M[re],se=de(B,U,Q,ee,Z,n);if(se==null)return null;se.data&&r(se.data,"expectedType")&&Y.push(se.data.expectedType)}var me=Y.length>0?", expected one of type ["+Y.join(", ")+"]":"";return new p("Invalid "+ee+" `"+Z+"` supplied to "+("`"+Q+"`"+me+"."))}return w(v)}function V(){function M(P,m,v,B,U){return f(P[m])?null:new p("Invalid "+B+" `"+U+"` supplied to "+("`"+v+"`, expected a ReactNode."))}return w(M)}function W(M,P,m,v,B){return new p((M||"React class")+": "+P+" type `"+m+"."+v+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+B+"`.")}function z(M){function P(m,v,B,U,Q){var ee=m[v],Z=E(ee);if(Z!=="object")return new p("Invalid "+U+" `"+Q+"` of type `"+Z+"` "+("supplied to `"+B+"`, expected `object`."));for(var Y in M){var re=M[Y];if(typeof re!="function")return W(B,U,Q,Y,I(re));var de=re(ee,Y,B,U,Q+"."+Y,n);if(de)return de}return null}return w(P)}function C(M){function P(m,v,B,U,Q){var ee=m[v],Z=E(ee);if(Z!=="object")return new p("Invalid "+U+" `"+Q+"` of type `"+Z+"` "+("supplied to `"+B+"`, expected `object`."));var Y=e({},m[v],M);for(var re in Y){var de=M[re];if(r(M,re)&&typeof de!="function")return W(B,U,Q,re,I(de));if(!de)return new p("Invalid "+U+" `"+Q+"` key `"+re+"` supplied to `"+B+"`.\nBad object: "+JSON.stringify(m[v],null," ")+`
109
+ Valid keys: `+JSON.stringify(Object.keys(M),null," "));var se=de(ee,re,B,U,Q+"."+re,n);if(se)return se}return null}return w(P)}function f(M){switch(typeof M){case"number":case"string":case"undefined":return!0;case"boolean":return!M;case"object":if(Array.isArray(M))return M.every(f);if(M===null||a(M))return!0;var P=d(M);if(P){var m=P.call(M),v;if(P!==M.entries){for(;!(v=m.next()).done;)if(!f(v.value))return!1}else for(;!(v=m.next()).done;){var B=v.value;if(B&&!f(B[1]))return!1}}else return!1;return!0;default:return!1}}function y(M,P){return M==="symbol"?!0:P?P["@@toStringTag"]==="Symbol"||typeof Symbol=="function"&&P instanceof Symbol:!1}function E(M){var P=typeof M;return Array.isArray(M)?"array":M instanceof RegExp?"object":y(P,M)?"symbol":P}function I(M){if(typeof M=="undefined"||M===null)return""+M;var P=E(M);if(P==="object"){if(M instanceof Date)return"date";if(M instanceof RegExp)return"regexp"}return P}function N(M){var P=I(M);switch(P){case"array":case"object":return"an "+P;case"boolean":case"date":case"regexp":return"a "+P;default:return P}}function D(M){return!M.constructor||!M.constructor.name?h:M.constructor.name}return g.checkPropTypes=i,g.resetWarningCache=i.resetWarningCache,g.PropTypes=g,g},J0}var Z0,q2;function G_(){if(q2)return Z0;q2=1;var t=Y0();function e(){}function n(){}return n.resetWarningCache=e,Z0=function(){function r(s,a,l,c,u,d){if(d!==t){var h=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw h.name="Invariant Violation",h}}r.isRequired=r;function i(){return r}var o={array:r,bigint:r,bool:r,func:r,number:r,object:r,string:r,symbol:r,any:r,arrayOf:i,element:r,elementType:r,instanceOf:i,node:r,objectOf:i,oneOf:i,oneOfType:i,shape:i,exact:i,checkPropTypes:n,resetWarningCache:e};return o.PropTypes=o,o},Z0}var Y2;function j_(){if(Y2)return dh.exports;if(Y2=1,process.env.NODE_ENV!=="production"){var t=gg(),e=!0;dh.exports=W_()(t.isElement,e)}else dh.exports=G_()();return dh.exports}var Q2;function K_(){if(Q2)return uh;Q2=1,Object.defineProperty(uh,"__esModule",{value:!0});var t=J,e=z_,n=U_,r=Ds,i=BT,o=j_();function s(f){return f&&typeof f=="object"&&"default"in f?f:{default:f}}var a=s(t),l=s(n),c=s(o),u=typeof globalThis!="undefined"?globalThis:typeof window!="undefined"?window:typeof uv!="undefined"?uv:typeof self!="undefined"?self:{};function d(f,y){return f(y={exports:{}},y.exports),y.exports}var h=d(function(f){(function(y){var E=function(re,de,se){if(!m(de)||B(de)||U(de)||Q(de)||P(de))return de;var me,Ae=0,Re=0;if(v(de))for(me=[],Re=de.length;Ae<Re;Ae++)me.push(E(re,de[Ae],se));else for(var Ct in me={},de)Object.prototype.hasOwnProperty.call(de,Ct)&&(me[re(Ct,se)]=E(re,de[Ct],se));return me},I=function(re){return ee(re)?re:(re=re.replace(/[\-_\s]+(.)?/g,function(de,se){return se?se.toUpperCase():""})).substr(0,1).toLowerCase()+re.substr(1)},N=function(re){var de=I(re);return de.substr(0,1).toUpperCase()+de.substr(1)},D=function(re,de){return function(se,me){var Ae=(me=me||{}).separator||"_",Re=me.split||/(?=[A-Z])/;return se.split(Re).join(Ae)}(re,de).toLowerCase()},M=Object.prototype.toString,P=function(re){return typeof re=="function"},m=function(re){return re===Object(re)},v=function(re){return M.call(re)=="[object Array]"},B=function(re){return M.call(re)=="[object Date]"},U=function(re){return M.call(re)=="[object RegExp]"},Q=function(re){return M.call(re)=="[object Boolean]"},ee=function(re){return(re-=0)==re},Z=function(re,de){var se=de&&"process"in de?de.process:de;return typeof se!="function"?re:function(me,Ae){return se(me,re,Ae)}},Y={camelize:I,decamelize:D,pascalize:N,depascalize:D,camelizeKeys:function(re,de){return E(Z(I,de),re)},decamelizeKeys:function(re,de){return E(Z(D,de),re,de)},pascalizeKeys:function(re,de){return E(Z(N,de),re)},depascalizeKeys:function(){return this.decamelizeKeys.apply(this,arguments)}};f.exports?f.exports=Y:y.humps=Y})(u)}).decamelize,g=function(f){if(Array.isArray(f))return f},b=function(f,y){if(typeof Symbol!="undefined"&&Symbol.iterator in Object(f)){var E=[],I=!0,N=!1,D=void 0;try{for(var M,P=f[Symbol.iterator]();!(I=(M=P.next()).done)&&(E.push(M.value),!y||E.length!==y);I=!0);}catch(m){N=!0,D=m}finally{try{I||P.return==null||P.return()}finally{if(N)throw D}}return E}},p=function(f,y){(y==null||y>f.length)&&(y=f.length);for(var E=0,I=new Array(y);E<y;E++)I[E]=f[E];return I},w=function(f,y){if(f){if(typeof f=="string")return p(f,y);var E=Object.prototype.toString.call(f).slice(8,-1);return E==="Object"&&f.constructor&&(E=f.constructor.name),E==="Map"||E==="Set"?Array.from(f):E==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(E)?p(f,y):void 0}},S=function(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
110
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)},O=function(f,y){return g(f)||b(f,y)||w(f,y)||S()},T=d(function(f){function y(){return f.exports=y=Object.assign||function(E){for(var I=1;I<arguments.length;I++){var N=arguments[I];for(var D in N)Object.prototype.hasOwnProperty.call(N,D)&&(E[D]=N[D])}return E},y.apply(this,arguments)}f.exports=y}),$=function(f,y){if(f==null)return{};var E,I,N={},D=Object.keys(f);for(I=0;I<D.length;I++)E=D[I],y.indexOf(E)>=0||(N[E]=f[E]);return N},R=function(f,y){if(f==null)return{};var E,I,N=$(f,y);if(Object.getOwnPropertySymbols){var D=Object.getOwnPropertySymbols(f);for(I=0;I<D.length;I++)E=D[I],y.indexOf(E)>=0||Object.prototype.propertyIsEnumerable.call(f,E)&&(N[E]=f[E])}return N},j=t.createContext(null);function q(f){var y=f.children,E=y===void 0?"":y,I=R(f,["children"]);return typeof E!="string"&&(E=i.renderToString(E)),a.default.createElement("template",T({},I,{dangerouslySetInnerHTML:{__html:E}}))}function G(f){var y=f.root,E=f.children,I=E===void 0?null:E;return r.createPortal(I,y)}function L(f){var y=t.forwardRef(function(E,I){var N,D,M=E.mode,P=M===void 0?"open":M,m=E.delegatesFocus,v=m!==void 0&&m,B=E.styleSheets,U=B===void 0?[]:B,Q=E.ssr,ee=Q!==void 0&&Q,Z=E.children,Y=R(E,["mode","delegatesFocus","styleSheets","ssr","children"]),re=(N=I,D=t.useRef(N&&N.current),t.useEffect(function(){N&&(N.current=D.current)},[N]),D),de=t.useState(null),se=O(de,2),me=se[0],Ae=se[1],Re="node_".concat(P).concat(v);return t.useLayoutEffect(function(){if(re.current)try{if(typeof I=="function"&&I(re.current),ee){var Ct=re.current.shadowRoot;return void Ae(Ct)}var st=re.current.attachShadow({mode:P,delegatesFocus:v});U.length>0&&(st.adoptedStyleSheets=U),Ae(st)}catch(dt){(function(ji){var at=ji.error,it=ji.styleSheets,hn=ji.root;switch(at.name){case"NotSupportedError":it.length>0&&(hn.adoptedStyleSheets=it);break;default:throw at}})({error:dt,styleSheets:U,root:me})}},[I,re,U]),a.default.createElement(a.default.Fragment,null,a.default.createElement(f.tag,T({key:Re,ref:re},Y),(me||ee)&&a.default.createElement(j.Provider,{value:me},ee?a.default.createElement(q,{shadowroot:P,shadowrootmode:P},f.render({root:me,ssr:ee,children:Z})):a.default.createElement(G,{root:me},f.render({root:me,ssr:ee,children:Z})))))});return y.propTypes={mode:c.default.oneOf(["open","closed"]),delegatesFocus:c.default.bool,styleSheets:c.default.arrayOf(c.default.instanceOf(globalThis.CSSStyleSheet)),ssr:c.default.bool,children:c.default.node},y}q.propTypes={children:c.default.oneOfType([c.default.string,c.default.node])},G.propTypes={root:c.default.object.isRequired,children:c.default.node};var V=new Map;function W(){var f=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},y=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"core",E=arguments.length>2&&arguments[2]!==void 0?arguments[2]:function(I){return I.children};return new Proxy(f,{get:function(I,N){var D=h(N,{separator:"-"}),M="".concat(y,"-").concat(D);return V.has(M)||V.set(M,L({tag:D,render:E})),V.get(M)}})}W();var z=new WeakMap,C=W({},"emotion",function(f){var y=f.root,E=f.children,I=z.get(y)||function(){var N=l.default({container:y,key:"react-shadow"});return z.set(y,N),N}();return a.default.createElement(e.CacheProvider,{value:I},a.default.createElement(a.default.Fragment,null,E))});return uh.default=C,uh}var q_=K_();const Y_=sl(q_),fh=":host",Q_=Ot({base:{display:"flex",width:"100%",justifyContent:"center",alignItems:"center",borderRadius:"md"},variants:{variant:{primary:{bg:"primary",color:"bg"},secondary:{bg:"bg.emphasized",color:"fg"},lightGray:{bg:"bg.subtle",color:"fg"}},size:{mdPlus:{padding:"8px 16px",fontSize:"14px",fontWeight:"medium"}}}}),X2=Ot({variants:{variant:{text:{border:"none",outline:"none",bg:"transparent",color:"fg",textAlign:"center",fontSize:"48px",fontWeight:600,lineHeight:"120%"}}}}),X_=Oe({slots:v2.keys(),base:{trigger:{borderRadius:"6px",boxShadow:"none"},content:{borderRadius:"6px",boxShadow:"none"}},variants:{variant:{filled:{trigger:{bg:"bg.subtle",color:"fg.muted",fontWeight:500},content:{bg:"bg.subtle",color:"fg.muted",fontWeight:400}},customOutline:{trigger:{bg:"bg",color:"fg.muted",fontWeight:400,border:"1px solid",borderColor:"border"},content:{bg:"bg",color:"fg.muted",fontWeight:400,border:"1px solid",borderColor:"border"}}}}}),J_=Oe({className:"chakra-table",slots:w2.keys(),base:{root:{fontVariantNumeric:"lining-nums tabular-nums",borderCollapse:"collapse",borderRadius:6,width:"full",textAlign:"start",verticalAlign:"top"},row:{_selected:{bg:"colorPalette.subtle"}},cell:{textAlign:"start",alignItems:"center"},columnHeader:{fontWeight:"medium",textAlign:"start",color:"fg"},caption:{fontWeight:"medium",textStyle:"xs"},footer:{fontWeight:"medium"}},variants:{interactive:{true:{body:{"& tr":{_hover:{bg:"colorPalette.subtle"}}}}},stickyHeader:{true:{header:{"& :where(tr)":{top:"var(--table-sticky-offset, 0)",position:"sticky",zIndex:1}}}},striped:{true:{row:{"&:nth-of-type(odd) td":{bg:"bg.muted"}}}},showColumnBorder:{true:{columnHeader:{"&:not(:last-of-type)":{borderInlineEndWidth:"1px"}},cell:{"&:not(:last-of-type)":{borderInlineEndWidth:"1px"}}}},variant:{line:{columnHeader:{borderBottomWidth:"1px"},cell:{borderBottomWidth:"1px"},row:{bg:"bg"}},outline:{root:{boxShadow:"0 0 0 1px {colors.border}",overflow:"hidden"},columnHeader:{borderBottomWidth:"1px"},header:{bg:"bg.muted"},row:{"&:not(:last-of-type)":{borderBottomWidth:"1px"}},footer:{borderTopWidth:"1px"}}},size:{sm:{root:{textStyle:"sm"},columnHeader:{px:"2",py:"2"},cell:{px:"2",py:"2"}},md:{root:{textStyle:"sm"},columnHeader:{px:"3",py:"3"},cell:{px:"3",py:"3"}},lg:{root:{textStyle:"md"},columnHeader:{px:"4",py:"3"},cell:{px:"4",py:"3"}}}},defaultVariants:{variant:"line",size:"md"}}),Z_=M0({theme:{semanticTokens:{colors:{border:{value:"#E4E4E7"},"border.emphasized":{value:"#1e171f4d"},primary:{value:"black"},customBlack:{value:"#1E171F"},customWhite:{value:"#FAFAFA"},gray:{50:{value:"#F4F4F5"},100:{value:"#707070"},200:{value:"#F4F4F5"},300:{value:"#E4E4E7"},400:{value:"#433E44"}},pink:{value:"#FF21FF"},green:{value:"#52C86E"}}},recipes:{input:X2,button:Q_},slotRecipes:{select:X_,table:J_}}}),eV=({children:t,themeConfig:e})=>{const[n,r]=J.useState(null),[i,o]=J.useState(null);J.useEffect(()=>{if(!(n!=null&&n.shadowRoot)||i)return;const a=pg({key:"root",container:n.shadowRoot});o(a)},[n,i]);const s=J.useMemo(()=>{var a;return h2(G0,Z_,e,{cssVarsRoot:fh,preflight:{scope:fh},conditions:{light:`${fh} &, .light &`},globalCss:{[fh]:{...(a=G0.globalCss)==null?void 0:a.html,borderRadius:"xl",shadow:"sm",border:"none"}}})},[e]);return k.jsx(Y_.div,{ref:r,children:n&&i&&k.jsx(X5,{value:()=>{var a;return(a=n.shadowRoot)!=null?a:document},children:k.jsx(xv,{value:i,children:k.jsx(YP,{value:s,children:t})})})})},hh=Ke.forwardRef(function(e,n){const{showArrow:r,children:i,disabled:o,portalled:s=!0,content:a,contentProps:l,portalRef:c,...u}=e;return o?i:k.jsxs(k_,{...u,children:[k.jsx(C_,{asChild:!0,children:i}),k.jsx(W8,{disabled:!s,container:c,children:k.jsx(I_,{children:k.jsxs(O_,{ref:n,...l,children:[r&&k.jsx(T_,{children:k.jsx(_2,{})}),a]})})})]})}),ph=J.forwardRef(({variant:t,...e},n)=>{const r=Cv({recipe:X2});if(t==="text"){const i=r({variant:"text"});return k.jsx(We.input,{ref:n,css:i,...e})}return k.jsx(v_,{ref:n,variant:t,...e})}),Fn=We(N2,{base:{display:"flex",width:"100%",justifyContent:"center",alignItems:"center",borderRadius:"md",flexShrink:"initial"},variants:{visual:{solid:{bg:"primary",_hover:{bg:"primary.emphasis"}},grayFilled:{bg:"bg.emphasized",color:"customWhite"},lightGray:{bg:"bg.subtle",color:"fg"}},size:{sm:{padding:"8px 16px",fontSize:"14px",fontWeight:"medium"},md:{padding:"4",fontSize:"16px"},lg:{padding:"8",fontSize:"24px"}}},defaultVariants:{visual:"solid",size:"sm"}});Fn.displayName="Button";const er=J.forwardRef(({variant:t="secondary",children:e,...n},r)=>k.jsx(u_,{ref:r,variant:"ghost",bg:"transparent",border:"none",_hover:{bg:"bg.subtle"},_active:{bg:"bg.emphasized"},color:"fg.muted",...n,children:e}));er.displayName="IconButton";const J2=We("div",{base:{p:"10px 12px",h:"32px",display:"flex",justifyContent:"center",alignItems:"center",gap:"8px",borderRadius:"6px",cursor:"pointer",color:"fg.muted",fontSize:"14px",fontWeight:"medium",transition:"all 0.2s ease-in-out",_hover:{bg:"bg.subtle",color:"fg"}}}),tV=({children:t})=>k.jsx(Ge,{fontSize:"md",fontWeight:"500",color:"fg",children:t}),nV=({children:t})=>k.jsx(Ge,{fontSize:"xs",color:"fg.muted",children:t}),Ai=({children:t,padding:e="8px 12px",onClick:n,selected:r=!1,disabled:i=!1})=>k.jsx(ye,{p:e,borderRadius:"md",border:"1px solid",borderColor:r?"primary":"border",bg:"bg",cursor:n&&!i?"pointer":"default",opacity:i?.5:1,_hover:r?void 0:{borderColor:"border.emphasized"},onClick:i?void 0:n,children:t});Ai.Title=tV,Ai.Description=nV;const Z2=We(o_,{base:{display:"flex",padding:"2px 10px",justifyContent:"center",alignItems:"center",lineHeight:"16px",borderRadius:"full",fontSize:"xs",color:"fg.muted",backgroundColor:"bg.subtle",width:"fit-content",fontWeight:600}}),rV=({children:t,type:e="info"})=>{const n=J.useMemo(()=>({info:{bg:"bg.subtle",color:"fg.muted",borderColor:"bg.subtle"},warning:{bg:"warning",color:"bg",borderColor:"warning"},error:{bg:"error",color:"bg",borderColor:"error"},success:{bg:"success",color:"bg",borderColor:"success"}})[e],[e]);return k.jsx(ro,{gap:1,p:3,borderRadius:"md",border:"1px solid",fontSize:"sm",...n,children:t})},Du=We("div",{base:{display:"flex",flexDirection:"row",width:"100%",alignItems:"center",gap:"12px",paddingBottom:"16px",borderBottom:"1px solid",borderColor:"border"}}),iV=We("div",{base:{display:"flex",flexDirection:"row",width:"100%",justifyContent:"space-between",alignItems:"center",gap:"12px",paddingBottom:"16px",borderBottom:"1px solid",borderColor:"border"}}),qo=We("h2",{base:{fontWeight:"600",fontSize:"14px",lineHeight:"120%",letterSpacing:"-0.4px",color:"fg"}}),em=We("p",{base:{fontWeight:"400",fontSize:"12px",lineHeight:"100%",letterSpacing:"-0.4px",color:"fg.muted"}}),gh=We("div",{base:{display:"flex",flexDirection:"column",width:"100%",justifyContent:"center",alignItems:"center",gap:4}}),gr=We("div",{base:{display:"flex",flexDirection:"column",width:"100%",justifyContent:"center",alignItems:"center",gap:"12px",paddingTop:"16px"}}),oV=We("hr",{base:{width:"100%",color:"border",backgroundColor:"border",borderColor:"border"}}),eE=t=>{let e;const n=new Set,r=(c,u)=>{const d=typeof c=="function"?c(e):c;if(!Object.is(d,e)){const h=e;e=(u!=null?u:typeof d!="object"||d===null)?d:Object.assign({},e,d),n.forEach(g=>g(e,h))}},i=()=>e,a={setState:r,getState:i,getInitialState:()=>l,subscribe:c=>(n.add(c),()=>n.delete(c))},l=e=t(r,i,a);return a},sV=t=>t?eE(t):eE,aV=t=>t;function lV(t,e=aV){const n=J.useSyncExternalStore(t.subscribe,J.useCallback(()=>e(t.getState()),[t,e]),J.useCallback(()=>e(t.getInitialState()),[t,e]));return J.useDebugValue(n),n}const tE=t=>{const e=sV(t),n=r=>lV(e,r);return Object.assign(n,e),n},nE=t=>t?tE(t):tE,tn="0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee",cV="0xd8da6bf26964af9d7eed9e03e53415d37aa96045",uV=200,dV={ETH:.02,USDC:20,USDT:20,WBTC:1e-8},ki={address:tn,name:"Ethereum",symbol:"ETH",decimals:18,logoURI:"https://assets.coingecko.com/coins/images/279/large/ethereum.png"},fV={address:tn,name:"Binance Coin",symbol:"BNB",decimals:18,logoURI:"https://assets.coingecko.com/coins/images/825/large/binance-coin-logo.png"},hV={address:tn,name:"Avalanche",symbol:"AVAX",decimals:18,logoURI:"https://assets.coingecko.com/coins/images/12559/large/coin-round-red.png"},pV={address:tn,name:"Polygon",symbol:"MATIC",decimals:18,logoURI:"https://assets.coingecko.com/coins/images/4713/large/matic___polygon.jpg"},gV={address:tn,name:"BeraChain",symbol:"BERA",decimals:18,logoURI:"https://assets.coingecko.com/coins/images/25235/large/BERA.png?1738822008"},mV={address:tn,name:"Gnosis XDAI",symbol:"XDAI",decimals:18,logoURI:"https://assets.coingecko.com/coins/images/11062/large/Identity-Primary-DarkBG.png"},yV={address:tn,name:"Sonic",symbol:"S",decimals:18,logoURI:"https://assets.coingecko.com/coins/images/38108/standard/200x200_Sonic_Logo.png"},bV={address:tn,name:"Plume",symbol:"PLUME",decimals:18,logoURI:"https://assets.coingecko.com/coins/images/53623/standard/plume-token.png?1736896935"},vV={address:tn,name:"Hyperliquid",symbol:"HYPE",decimals:18,logoURI:"https://assets.coingecko.com/asset_platforms/images/243/large/hyperliquid.png"},rE="https://assets.coingecko.com/coins/images/12504/small/uniswap-uni.png";var mh=(t=>(t[t.MAINNET=1]="MAINNET",t[t.ARBITRUM_ONE=42161]="ARBITRUM_ONE",t[t.OPTIMISM=10]="OPTIMISM",t[t.POLYGON=137]="POLYGON",t[t.BSC=56]="BSC",t[t.BASE=8453]="BASE",t[t.LINEA=59144]="LINEA",t[t.ZKSYNC=324]="ZKSYNC",t[t.GNOSIS=100]="GNOSIS",t[t.AVALANCHE=43114]="AVALANCHE",t[t.BERACHAIN=80094]="BERACHAIN",t[t.SONIC=146]="SONIC",t[t.UNICHAIN=130]="UNICHAIN",t[t.INK=57073]="INK",t[t.SONEIUM=1868]="SONEIUM",t[t.PLUME=98866]="PLUME",t[t.HYPERLIQUID=999]="HYPERLIQUID",t[t.KATANA=747474]="KATANA",t))(mh||{});const tm={1:"ethereum",8453:"base",137:"polygon",56:"bsc",59144:"linea",324:"zksync",100:"gnosis",43114:"avalanche",80094:"bera",146:"sonic",42161:"arbitrum",10:"optimism",130:"unichain",57073:"ink",1868:"soneium",98866:"plumephoenix",999:"hyperliquid",747474:"katana"},iE={1:"ethereum",42161:"arbitrum-one",10:"optimistic-ethereum",137:"polygon-pos",8453:"base",56:"binance-smart-chain",59144:"linea",324:"zksync",100:"xdai",43114:"avalanche",80094:"berachain",146:"sonic",130:"unichain",57073:"ink",1868:"soneium",98866:"plume",999:"hyperevm",747474:"katana"},oE={1:ki,42161:ki,10:ki,8453:ki,59144:ki,324:ki,1868:ki,130:ki,57073:ki,56:fV,43114:hV,137:pV,80094:gV,100:mV,146:yV,98866:bV,999:vV,747474:ki},wV={10:"https://optimistic.etherscan.io",1:"https://etherscan.io",42161:"https://arbiscan.io",137:"https://polygonscan.com",56:"https://bscscan.com",8453:"https://basescan.org",59144:"https://lineascan.build",324:"https://explorer.zksync.io/",100:"https://gnosisscan.io/",43114:"https://cchain.explorer.avax.network",80094:"https://berascan.com",146:"https://sonicscan.io",130:"https://uniscan.xyz",57073:"https://explorer.inkonchain.com",1868:"https://soneium.blockscout.com/",98866:"https://explorer.plume.org/",999:"https://www.hyperscan.com/",747474:"https://explorer-katana.t.conduit.xyz/"},Qe=nE(t=>({isCheckout:!1,setIsCheckout:e=>t({isCheckout:e}),ensoApiToken:"",setEnsoApiToken:e=>t({ensoApiToken:e}),tokenIn:"",setTokenIn:e=>t({tokenIn:e}),tokenOut:"",setTokenOut:e=>t({tokenOut:e}),chainIdIn:void 0,setChainIdIn:e=>t({chainIdIn:e}),chainIdOut:void 0,setChainIdOut:e=>t({chainIdOut:e}),amountIn:"0",setAmountIn:e=>t({amountIn:e}),slippage:uV,setSlippage:e=>t({slippage:e}),meshAccessToken:null,setMeshAccessToken:e=>t({meshAccessToken:e}),sessionId:"",setSessionId:e=>t({sessionId:e}),linkToken:"",setLinkToken:e=>t({linkToken:e})})),zu=()=>{const t=Qe(e=>e.ensoApiToken);return async({url:e,method:n,params:r,data:i})=>(await fetch(e+"?"+new URLSearchParams(r),{method:n,headers:{...i==null?void 0:i.headers,Authorization:`Bearer ${t}`},...i?{body:JSON.stringify(i)}:{}})).json()},xV=()=>{const t=zu();return J.useCallback((e,n,r)=>t({url:`https://api.enso.finance/api/v1/prices/${e}/${n}`,method:"GET",signal:r}),[t])},EV=(t,e)=>[`https://api.enso.finance/api/v1/prices/${t}/${e}`],SV=(t,e,n)=>{var a;const{query:r}={},i=(a=r==null?void 0:r.queryKey)!=null?a:EV(t,e),o=xV();return{queryKey:i,queryFn:({signal:l})=>o(t,e,l),enabled:!!(t&&e),refetchInterval:3e4,retry:2,...r}};function AV(t,e,n,r){const i=SV(t,e),o=Ki.useQuery(i,r);return o.queryKey=i.queryKey,o}const kV=()=>{const t=zu();return J.useCallback((e,n)=>t({url:"https://api.enso.finance/api/v1/tokens",method:"GET",params:e,signal:n}),[t])},CV=t=>["https://api.enso.finance/api/v1/tokens",...t?[t]:[]],IV=(t,e)=>{var s;const{query:n}=e!=null?e:{},r=(s=n==null?void 0:n.queryKey)!=null?s:CV(t),i=kV();return{queryKey:r,queryFn:({signal:a})=>i(t,a),refetchInterval:3e4,retry:2,...n}};function OV(t,e,n){const r=IV(t,e),i=Ki.useQuery(r,n);return i.queryKey=r.queryKey,i}const TV=()=>{const t=zu();return J.useCallback((e,n)=>t({url:"https://api.enso.finance/api/v1/shortcuts/route",method:"GET",params:e,signal:n}),[t])},PV=t=>["https://api.enso.finance/api/v1/shortcuts/route",...t?[t]:[]],NV=(t,e)=>{var s;const{query:n}=e!=null?e:{},r=(s=n==null?void 0:n.queryKey)!=null?s:PV(t),i=TV();return{queryKey:r,queryFn:({signal:a})=>i(t,a),refetchInterval:3e4,retry:2,...n}};function BV(t,e,n){const r=NV(t,e),i=Ki.useQuery(r,n);return i.queryKey=r.queryKey,i}const RV=()=>{const t=zu();return J.useCallback((e,n)=>t({url:"https://api.enso.finance/api/v1/wallet/approve",method:"GET",params:e,signal:n}),[t])},MV=t=>["https://api.enso.finance/api/v1/wallet/approve",...t?[t]:[]],LV=(t,e)=>{var s;const{query:n}={},r=(s=n==null?void 0:n.queryKey)!=null?s:MV(t),i=RV();return{queryKey:r,queryFn:({signal:a})=>i(t,a),refetchInterval:3e4,retry:2,...n}};function FV(t,e,n){const r=LV(t),i=Ki.useQuery(r,n);return i.queryKey=r.queryKey,i}const _V=()=>{const t=zu();return J.useCallback((e,n)=>t({url:"https://api.enso.finance/api/v1/wallet/balances",method:"GET",params:e,signal:n}),[t])},VV=t=>["https://api.enso.finance/api/v1/wallet/balances",...t?[t]:[]],DV=(t,e)=>{var s;const{query:n}=e!=null?e:{},r=(s=n==null?void 0:n.queryKey)!=null?s:VV(t),i=_V();return{queryKey:r,queryFn:({signal:a})=>i(t,a),refetchInterval:3e4,retry:2,...n}};function zV(t,e,n){const r=DV(t,e),i=Ki.useQuery(r,n);return i.queryKey=r.queryKey,i}function yh(t,{strict:e=!0}={}){return!t||typeof t!="string"?!1:e?/^0x[0-9a-fA-F]*$/.test(t):t.startsWith("0x")}function Br(t){return yh(t,{strict:!1})?Math.ceil((t.length-2)/2):t.length}const sE="2.33.2";let Uu={getDocsUrl:({docsBaseUrl:t,docsPath:e="",docsSlug:n})=>e?`${t!=null?t:"https://viem.sh"}${e}${n?`#${n}`:""}`:void 0,version:`viem@${sE}`};class kn extends Error{constructor(e,n={}){var a,l;const r=(()=>{var c;return n.cause instanceof kn?n.cause.details:(c=n.cause)!=null&&c.message?n.cause.message:n.details})(),i=n.cause instanceof kn&&n.cause.docsPath||n.docsPath,o=(a=Uu.getDocsUrl)==null?void 0:a.call(Uu,{...n,docsPath:i}),s=[e||"An error occurred.","",...n.metaMessages?[...n.metaMessages,""]:[],...o?[`Docs: ${o}`]:[],...r?[`Details: ${r}`]:[],...Uu.version?[`Version: ${Uu.version}`]:[]].join(`
111
+ `);super(s,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=r,this.docsPath=i,this.metaMessages=n.metaMessages,this.name=(l=n.name)!=null?l:this.name,this.shortMessage=e,this.version=sE}walk(e){return aE(this,e)}}function aE(t,e){return e!=null&&e(t)?t:t&&typeof t=="object"&&"cause"in t&&t.cause!==void 0?aE(t.cause,e):e?null:t}class UV extends kn{constructor({expectedLength:e,givenLength:n,type:r}){super([`ABI encoding array length mismatch for type ${r}.`,`Expected length: ${e}`,`Given length: ${n}`].join(`
112
+ `),{name:"AbiEncodingArrayLengthMismatchError"})}}class $V extends kn{constructor({expectedSize:e,value:n}){super(`Size of bytes "${n}" (bytes${Br(n)}) does not match expected size (bytes${e}).`,{name:"AbiEncodingBytesSizeMismatchError"})}}class HV extends kn{constructor({expectedLength:e,givenLength:n}){super(["ABI encoding params/values length mismatch.",`Expected length (params): ${e}`,`Given length (values): ${n}`].join(`
113
+ `),{name:"AbiEncodingLengthMismatchError"})}}class WV extends kn{constructor(e,{docsPath:n}){super([`Type "${e}" is not a valid encoding type.`,"Please provide a valid ABI type."].join(`
114
+ `),{docsPath:n,name:"InvalidAbiEncodingType"})}}class GV extends kn{constructor(e){super([`Value "${e}" is not a valid array.`].join(`
115
+ `),{name:"InvalidArrayError"})}}class lE extends kn{constructor({offset:e,position:n,size:r}){super(`Slice ${n==="start"?"starting":"ending"} at offset "${e}" is out-of-bounds (size: ${r}).`,{name:"SliceOffsetOutOfBoundsError"})}}class cE extends kn{constructor({size:e,targetSize:n,type:r}){super(`${r.charAt(0).toUpperCase()}${r.slice(1).toLowerCase()} size (${e}) exceeds padding size (${n}).`,{name:"SizeExceedsPaddingSizeError"})}}function Rr(t,{dir:e,size:n=32}={}){return typeof t=="string"?Yo(t,{dir:e,size:n}):jV(t,{dir:e,size:n})}function Yo(t,{dir:e,size:n=32}={}){if(n===null)return t;const r=t.replace("0x","");if(r.length>n*2)throw new cE({size:Math.ceil(r.length/2),targetSize:n,type:"hex"});return`0x${r[e==="right"?"padEnd":"padStart"](n*2,"0")}`}function jV(t,{dir:e,size:n=32}={}){if(n===null)return t;if(t.length>n)throw new cE({size:t.length,targetSize:n,type:"bytes"});const r=new Uint8Array(n);for(let i=0;i<n;i++){const o=e==="right";r[o?i:n-i-1]=t[o?i:t.length-i-1]}return r}class uE extends kn{constructor({max:e,min:n,signed:r,size:i,value:o}){super(`Number "${o}" is not in safe ${i?`${i*8}-bit ${r?"signed":"unsigned"} `:""}integer range ${e?`(${n} to ${e})`:`(above ${n})`}`,{name:"IntegerOutOfRangeError"})}}class KV extends kn{constructor({givenSize:e,maxSize:n}){super(`Size cannot exceed ${n} bytes. Given size: ${e} bytes.`,{name:"SizeOverflowError"})}}function $u(t,{size:e}){if(Br(t)>e)throw new KV({givenSize:Br(t),maxSize:e})}const qV=Array.from({length:256},(t,e)=>e.toString(16).padStart(2,"0"));function YV(t,e={}){return typeof t=="number"||typeof t=="bigint"?mr(t,e):typeof t=="string"?hE(t,e):typeof t=="boolean"?dE(t,e):fE(t,e)}function dE(t,e={}){const n=`0x${Number(t)}`;return typeof e.size=="number"?($u(n,{size:e.size}),Rr(n,{size:e.size})):n}function fE(t,e={}){let n="";for(let i=0;i<t.length;i++)n+=qV[t[i]];const r=`0x${n}`;return typeof e.size=="number"?($u(r,{size:e.size}),Rr(r,{dir:"right",size:e.size})):r}function mr(t,e={}){const{signed:n,size:r}=e,i=BigInt(t);let o;r?n?o=(BigInt(1)<<BigInt(r)*BigInt(8)-BigInt(1))-BigInt(1):o=BigInt(2)**(BigInt(r)*BigInt(8))-BigInt(1):typeof t=="number"&&(o=BigInt(Number.MAX_SAFE_INTEGER));const s=typeof o=="bigint"&&n?-o-BigInt(1):0;if(o&&i>o||i<s){const l=typeof t=="bigint"?"n":"";throw new uE({max:o?`${o}${l}`:void 0,min:`${s}${l}`,signed:n,size:r,value:`${t}${l}`})}const a=`0x${(n&&i<0?(BigInt(1)<<BigInt(r*8))+BigInt(i):i).toString(16)}`;return r?Rr(a,{size:r}):a}const QV=new TextEncoder;function hE(t,e={}){const n=QV.encode(t);return fE(n,e)}const XV=new TextEncoder;function JV(t,e={}){return typeof t=="number"||typeof t=="bigint"?eD(t,e):typeof t=="boolean"?ZV(t,e):yh(t)?gE(t,e):mE(t,e)}function ZV(t,e={}){const n=new Uint8Array(1);return n[0]=Number(t),typeof e.size=="number"?($u(n,{size:e.size}),Rr(n,{size:e.size})):n}const ao={zero:48,nine:57,A:65,F:70,a:97,f:102};function pE(t){if(t>=ao.zero&&t<=ao.nine)return t-ao.zero;if(t>=ao.A&&t<=ao.F)return t-(ao.A-10);if(t>=ao.a&&t<=ao.f)return t-(ao.a-10)}function gE(t,e={}){let n=t;e.size&&($u(n,{size:e.size}),n=Rr(n,{dir:"right",size:e.size}));let r=n.slice(2);r.length%2&&(r=`0${r}`);const i=r.length/2,o=new Uint8Array(i);for(let s=0,a=0;s<i;s++){const l=pE(r.charCodeAt(a++)),c=pE(r.charCodeAt(a++));if(l===void 0||c===void 0)throw new kn(`Invalid byte sequence ("${r[a-2]}${r[a-1]}" in "${r}").`);o[s]=l*16+c}return o}function eD(t,e){const n=mr(t,e);return gE(n)}function mE(t,e={}){const n=XV.encode(t);return typeof e.size=="number"?($u(n,{size:e.size}),Rr(n,{dir:"right",size:e.size})):n}const bh=BigInt(2**32-1),yE=BigInt(32);function tD(t,e=!1){return e?{h:Number(t&bh),l:Number(t>>yE&bh)}:{h:Number(t>>yE&bh)|0,l:Number(t&bh)|0}}function bE(t,e=!1){const n=t.length;let r=new Uint32Array(n),i=new Uint32Array(n);for(let o=0;o<n;o++){const{h:s,l:a}=tD(t[o],e);[r[o],i[o]]=[s,a]}return[r,i]}const vE=(t,e,n)=>t>>>n,wE=(t,e,n)=>t<<32-n|e>>>n,Ol=(t,e,n)=>t>>>n|e<<32-n,Tl=(t,e,n)=>t<<32-n|e>>>n,vh=(t,e,n)=>t<<64-n|e>>>n-32,wh=(t,e,n)=>t>>>n-32|e<<64-n,nD=(t,e,n)=>t<<n|e>>>32-n,rD=(t,e,n)=>e<<n|t>>>32-n,iD=(t,e,n)=>e<<n-32|t>>>64-n,oD=(t,e,n)=>t<<n-32|e>>>64-n;function lo(t,e,n,r){const i=(e>>>0)+(r>>>0);return{h:t+n+(i/2**32|0)|0,l:i|0}}const sD=(t,e,n)=>(t>>>0)+(e>>>0)+(n>>>0),aD=(t,e,n,r)=>e+n+r+(t/2**32|0)|0,lD=(t,e,n,r)=>(t>>>0)+(e>>>0)+(n>>>0)+(r>>>0),cD=(t,e,n,r,i)=>e+n+r+i+(t/2**32|0)|0,uD=(t,e,n,r,i)=>(t>>>0)+(e>>>0)+(n>>>0)+(r>>>0)+(i>>>0),dD=(t,e,n,r,i,o)=>e+n+r+i+o+(t/2**32|0)|0,Pl=typeof globalThis=="object"&&"crypto"in globalThis?globalThis.crypto:void 0;/*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */function Hu(t){return t instanceof Uint8Array||ArrayBuffer.isView(t)&&t.constructor.name==="Uint8Array"}function Wu(t){if(!Number.isSafeInteger(t)||t<0)throw new Error("positive integer expected, got "+t)}function co(t,...e){if(!Hu(t))throw new Error("Uint8Array expected");if(e.length>0&&!e.includes(t.length))throw new Error("Uint8Array expected of length "+e+", got length="+t.length)}function xE(t){if(typeof t!="function"||typeof t.create!="function")throw new Error("Hash should be wrapped by utils.createHasher");Wu(t.outputLen),Wu(t.blockLen)}function Nl(t,e=!0){if(t.destroyed)throw new Error("Hash instance has been destroyed");if(e&&t.finished)throw new Error("Hash#digest() has already been called")}function EE(t,e){co(t);const n=e.outputLen;if(t.length<n)throw new Error("digestInto() expects output buffer of length at least "+n)}function fD(t){return new Uint32Array(t.buffer,t.byteOffset,Math.floor(t.byteLength/4))}function Qo(...t){for(let e=0;e<t.length;e++)t[e].fill(0)}function nm(t){return new DataView(t.buffer,t.byteOffset,t.byteLength)}function Ci(t,e){return t<<32-e|t>>>e}const hD=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68;function pD(t){return t<<24&4278190080|t<<8&16711680|t>>>8&65280|t>>>24&255}function gD(t){for(let e=0;e<t.length;e++)t[e]=pD(t[e]);return t}const SE=hD?t=>t:gD,AE=typeof Uint8Array.from([]).toHex=="function"&&typeof Uint8Array.fromHex=="function",mD=Array.from({length:256},(t,e)=>e.toString(16).padStart(2,"0"));function na(t){if(co(t),AE)return t.toHex();let e="";for(let n=0;n<t.length;n++)e+=mD[t[n]];return e}const uo={_0:48,_9:57,A:65,F:70,a:97,f:102};function kE(t){if(t>=uo._0&&t<=uo._9)return t-uo._0;if(t>=uo.A&&t<=uo.F)return t-(uo.A-10);if(t>=uo.a&&t<=uo.f)return t-(uo.a-10)}function xh(t){if(typeof t!="string")throw new Error("hex string expected, got "+typeof t);if(AE)return Uint8Array.fromHex(t);const e=t.length,n=e/2;if(e%2)throw new Error("hex string expected, got unpadded hex of length "+e);const r=new Uint8Array(n);for(let i=0,o=0;i<n;i++,o+=2){const s=kE(t.charCodeAt(o)),a=kE(t.charCodeAt(o+1));if(s===void 0||a===void 0){const l=t[o]+t[o+1];throw new Error('hex string expected, got non-hex character "'+l+'" at index '+o)}r[i]=s*16+a}return r}function yD(t){if(typeof t!="string")throw new Error("string expected");return new Uint8Array(new TextEncoder().encode(t))}function Eh(t){return typeof t=="string"&&(t=yD(t)),co(t),t}function Ii(...t){let e=0;for(let r=0;r<t.length;r++){const i=t[r];co(i),e+=i.length}const n=new Uint8Array(e);for(let r=0,i=0;r<t.length;r++){const o=t[r];n.set(o,i),i+=o.length}return n}let rm=class{};function im(t){const e=r=>t().update(Eh(r)).digest(),n=t();return e.outputLen=n.outputLen,e.blockLen=n.blockLen,e.create=()=>t(),e}function om(t=32){if(Pl&&typeof Pl.getRandomValues=="function")return Pl.getRandomValues(new Uint8Array(t));if(Pl&&typeof Pl.randomBytes=="function")return Uint8Array.from(Pl.randomBytes(t));throw new Error("crypto.getRandomValues must be defined")}const bD=BigInt(0),Gu=BigInt(1),vD=BigInt(2),wD=BigInt(7),xD=BigInt(256),ED=BigInt(113),CE=[],IE=[],OE=[];for(let t=0,e=Gu,n=1,r=0;t<24;t++){[n,r]=[r,(2*n+3*r)%5],CE.push(2*(5*r+n)),IE.push((t+1)*(t+2)/2%64);let i=bD;for(let o=0;o<7;o++)e=(e<<Gu^(e>>wD)*ED)%xD,e&vD&&(i^=Gu<<(Gu<<BigInt(o))-Gu);OE.push(i)}const TE=bE(OE,!0),SD=TE[0],AD=TE[1],PE=(t,e,n)=>n>32?iD(t,e,n):nD(t,e,n),NE=(t,e,n)=>n>32?oD(t,e,n):rD(t,e,n);function kD(t,e=24){const n=new Uint32Array(10);for(let r=24-e;r<24;r++){for(let s=0;s<10;s++)n[s]=t[s]^t[s+10]^t[s+20]^t[s+30]^t[s+40];for(let s=0;s<10;s+=2){const a=(s+8)%10,l=(s+2)%10,c=n[l],u=n[l+1],d=PE(c,u,1)^n[a],h=NE(c,u,1)^n[a+1];for(let g=0;g<50;g+=10)t[s+g]^=d,t[s+g+1]^=h}let i=t[2],o=t[3];for(let s=0;s<24;s++){const a=IE[s],l=PE(i,o,a),c=NE(i,o,a),u=CE[s];i=t[u],o=t[u+1],t[u]=l,t[u+1]=c}for(let s=0;s<50;s+=10){for(let a=0;a<10;a++)n[a]=t[s+a];for(let a=0;a<10;a++)t[s+a]^=~n[(a+2)%10]&n[(a+4)%10]}t[0]^=SD[r],t[1]^=AD[r]}Qo(n)}let CD=class IT extends rm{constructor(e,n,r,i=!1,o=24){if(super(),this.pos=0,this.posOut=0,this.finished=!1,this.destroyed=!1,this.enableXOF=!1,this.blockLen=e,this.suffix=n,this.outputLen=r,this.enableXOF=i,this.rounds=o,Wu(r),!(0<e&&e<200))throw new Error("only keccak-f1600 function is supported");this.state=new Uint8Array(200),this.state32=fD(this.state)}clone(){return this._cloneInto()}keccak(){SE(this.state32),kD(this.state32,this.rounds),SE(this.state32),this.posOut=0,this.pos=0}update(e){Nl(this),e=Eh(e),co(e);const{blockLen:n,state:r}=this,i=e.length;for(let o=0;o<i;){const s=Math.min(n-this.pos,i-o);for(let a=0;a<s;a++)r[this.pos++]^=e[o++];this.pos===n&&this.keccak()}return this}finish(){if(this.finished)return;this.finished=!0;const{state:e,suffix:n,pos:r,blockLen:i}=this;e[r]^=n,(n&128)!==0&&r===i-1&&this.keccak(),e[i-1]^=128,this.keccak()}writeInto(e){Nl(this,!1),co(e),this.finish();const n=this.state,{blockLen:r}=this;for(let i=0,o=e.length;i<o;){this.posOut>=r&&this.keccak();const s=Math.min(r-this.posOut,o-i);e.set(n.subarray(this.posOut,this.posOut+s),i),this.posOut+=s,i+=s}return e}xofInto(e){if(!this.enableXOF)throw new Error("XOF is not possible for this instance");return this.writeInto(e)}xof(e){return Wu(e),this.xofInto(new Uint8Array(e))}digestInto(e){if(EE(e,this),this.finished)throw new Error("digest() was already called");return this.writeInto(e),this.destroy(),e}digest(){return this.digestInto(new Uint8Array(this.outputLen))}destroy(){this.destroyed=!0,Qo(this.state)}_cloneInto(e){const{blockLen:n,suffix:r,outputLen:i,rounds:o,enableXOF:s}=this;return e||(e=new IT(n,r,i,s,o)),e.state32.set(this.state32),e.pos=this.pos,e.posOut=this.posOut,e.finished=this.finished,e.rounds=o,e.suffix=r,e.outputLen=i,e.enableXOF=s,e.destroyed=this.destroyed,e}};const ID=(t,e,n)=>im(()=>new CD(e,t,n)),OD=ID(1,136,256/8);function Bl(t,e){const n=e||"hex",r=OD(yh(t,{strict:!1})?JV(t):t);return n==="bytes"?r:YV(r)}class TD extends kn{constructor({address:e}){super(`Address "${e}" is invalid.`,{metaMessages:["- Address must be a hex value of 20 bytes (40 hex characters).","- Address must match its checksum counterpart."],name:"InvalidAddressError"})}}class BE extends Map{constructor(e){super(),Object.defineProperty(this,"maxSize",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.maxSize=e}get(e){const n=super.get(e);return super.has(e)&&n!==void 0&&(this.delete(e),super.set(e,n)),n}set(e,n){if(super.set(e,n),this.maxSize&&this.size>this.maxSize){const r=this.keys().next().value;r&&this.delete(r)}return this}}const sm=new BE(8192);function PD(t,e){if(sm.has(`${t}.${e}`))return sm.get(`${t}.${e}`);const n=t.substring(2).toLowerCase(),r=Bl(mE(n),"bytes"),i=n.split("");for(let s=0;s<40;s+=2)r[s>>1]>>4>=8&&i[s]&&(i[s]=i[s].toUpperCase()),(r[s>>1]&15)>=8&&i[s+1]&&(i[s+1]=i[s+1].toUpperCase());const o=`0x${i.join("")}`;return sm.set(`${t}.${e}`,o),o}const ND=/^0x[a-fA-F0-9]{40}$/,am=new BE(8192);function ju(t,e){const{strict:n=!0}={},r=`${t}.${n}`;if(am.has(r))return am.get(r);const i=ND.test(t)?t.toLowerCase()===t?!0:n?PD(t)===t:!0:!1;return am.set(r,i),i}function Xr(t){return typeof t[0]=="string"?RD(t):BD(t)}function BD(t){let e=0;for(const i of t)e+=i.length;const n=new Uint8Array(e);let r=0;for(const i of t)n.set(i,r),r+=i.length;return n}function RD(t){return`0x${t.reduce((e,n)=>e+n.replace("0x",""),"")}`}function MD(t,e,n,{strict:r}={}){return yh(t,{strict:!1})?FD(t,e,n,{strict:r}):LD(t,e,n,{strict:r})}function RE(t,e){if(typeof e=="number"&&e>0&&e>Br(t)-1)throw new lE({offset:e,position:"start",size:Br(t)})}function ME(t,e,n){if(typeof e=="number"&&typeof n=="number"&&Br(t)!==n-e)throw new lE({offset:n,position:"end",size:Br(t)})}function LD(t,e,n,{strict:r}={}){RE(t,e);const i=t.slice(e,n);return r&&ME(i,e,n),i}function FD(t,e,n,{strict:r}={}){RE(t,e);const i=`0x${t.replace("0x","").slice((e!=null?e:0)*2,(n!=null?n:t.length)*2)}`;return r&&ME(i,e,n),i}const _D=/^(u?int)(8|16|24|32|40|48|56|64|72|80|88|96|104|112|120|128|136|144|152|160|168|176|184|192|200|208|216|224|232|240|248|256)?$/;function LE(t,e){if(t.length!==e.length)throw new HV({expectedLength:t.length,givenLength:e.length});const n=VD({params:t,values:e}),r=cm(n);return r.length===0?"0x":r}function VD({params:t,values:e}){const n=[];for(let r=0;r<t.length;r++)n.push(lm({param:t[r],value:e[r]}));return n}function lm({param:t,value:e}){var r;const n=jD(t.type);if(n){const[i,o]=n;return zD(e,{length:i,param:{...t,type:o}})}if(t.type==="tuple")return GD(e,{param:t});if(t.type==="address")return DD(e);if(t.type==="bool")return $D(e);if(t.type.startsWith("uint")||t.type.startsWith("int")){const i=t.type.startsWith("int"),[,,o="256"]=(r=_D.exec(t.type))!=null?r:[];return HD(e,{signed:i,size:Number(o)})}if(t.type.startsWith("bytes"))return UD(e,{param:t});if(t.type==="string")return WD(e);throw new WV(t.type,{docsPath:"/docs/contract/encodeAbiParameters"})}function cm(t){let e=0;for(let o=0;o<t.length;o++){const{dynamic:s,encoded:a}=t[o];s?e+=32:e+=Br(a)}const n=[],r=[];let i=0;for(let o=0;o<t.length;o++){const{dynamic:s,encoded:a}=t[o];s?(n.push(mr(e+i,{size:32})),r.push(a),i+=Br(a)):n.push(a)}return Xr([...n,...r])}function DD(t){if(!ju(t))throw new TD({address:t});return{dynamic:!1,encoded:Yo(t.toLowerCase())}}function zD(t,{length:e,param:n}){const r=e===null;if(!Array.isArray(t))throw new GV(t);if(!r&&t.length!==e)throw new UV({expectedLength:e,givenLength:t.length,type:`${n.type}[${e}]`});let i=!1;const o=[];for(let s=0;s<t.length;s++){const a=lm({param:n,value:t[s]});a.dynamic&&(i=!0),o.push(a)}if(r||i){const s=cm(o);if(r){const a=mr(o.length,{size:32});return{dynamic:!0,encoded:o.length>0?Xr([a,s]):a}}if(i)return{dynamic:!0,encoded:s}}return{dynamic:!1,encoded:Xr(o.map(({encoded:s})=>s))}}function UD(t,{param:e}){const[,n]=e.type.split("bytes"),r=Br(t);if(!n){let i=t;return r%32!==0&&(i=Yo(i,{dir:"right",size:Math.ceil((t.length-2)/2/32)*32})),{dynamic:!0,encoded:Xr([Yo(mr(r,{size:32})),i])}}if(r!==Number.parseInt(n))throw new $V({expectedSize:Number.parseInt(n),value:t});return{dynamic:!1,encoded:Yo(t,{dir:"right"})}}function $D(t){if(typeof t!="boolean")throw new kn(`Invalid boolean value: "${t}" (type: ${typeof t}). Expected: \`true\` or \`false\`.`);return{dynamic:!1,encoded:Yo(dE(t))}}function HD(t,{signed:e,size:n=256}){if(typeof n=="number"){const r=BigInt(2)**(BigInt(n)-(e?BigInt(1):BigInt(0)))-BigInt(1),i=e?-r-BigInt(1):BigInt(0);if(t>r||t<i)throw new uE({max:r.toString(),min:i.toString(),signed:e,size:n/8,value:t.toString()})}return{dynamic:!1,encoded:mr(t,{size:32,signed:e})}}function WD(t){const e=hE(t),n=Math.ceil(Br(e)/32),r=[];for(let i=0;i<n;i++)r.push(Yo(MD(e,i*32,(i+1)*32),{dir:"right"}));return{dynamic:!0,encoded:Xr([Yo(mr(Br(e),{size:32})),...r])}}function GD(t,{param:e}){let n=!1;const r=[];for(let i=0;i<e.components.length;i++){const o=e.components[i],s=Array.isArray(t)?i:o.name,a=lm({param:o,value:t[s]});r.push(a),a.dynamic&&(n=!0)}return{dynamic:n,encoded:n?cm(r):Xr(r.map(({encoded:i})=>i))}}function jD(t){const e=t.match(/^(.*)\[(\d+)?\]$/);return e?[e[2]?Number(e[2]):null,e[1]]:void 0}function KD(t,e){let n=t.toString();const r=n.startsWith("-");r&&(n=n.slice(1)),n=n.padStart(e,"0");let[i,o]=[n.slice(0,n.length-e),n.slice(n.length-e)];return o=o.replace(/(0+)$/,""),`${r?"-":""}${i||"0"}${o?`.${o}`:""}`}function qD(t,e,n,r){if(typeof t.setBigUint64=="function")return t.setBigUint64(e,n,r);const i=BigInt(32),o=BigInt(4294967295),s=Number(n>>i&o),a=Number(n&o),l=r?4:0,c=r?0:4;t.setUint32(e+l,s,r),t.setUint32(e+c,a,r)}function YD(t,e,n){return t&e^~t&n}function QD(t,e,n){return t&e^t&n^e&n}class FE extends rm{constructor(e,n,r,i){super(),this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.blockLen=e,this.outputLen=n,this.padOffset=r,this.isLE=i,this.buffer=new Uint8Array(e),this.view=nm(this.buffer)}update(e){Nl(this),e=Eh(e),co(e);const{view:n,buffer:r,blockLen:i}=this,o=e.length;for(let s=0;s<o;){const a=Math.min(i-this.pos,o-s);if(a===i){const l=nm(e);for(;i<=o-s;s+=i)this.process(l,s);continue}r.set(e.subarray(s,s+a),this.pos),this.pos+=a,s+=a,this.pos===i&&(this.process(n,0),this.pos=0)}return this.length+=e.length,this.roundClean(),this}digestInto(e){Nl(this),EE(e,this),this.finished=!0;const{buffer:n,view:r,blockLen:i,isLE:o}=this;let{pos:s}=this;n[s++]=128,Qo(this.buffer.subarray(s)),this.padOffset>i-s&&(this.process(r,0),s=0);for(let d=s;d<i;d++)n[d]=0;qD(r,i-8,BigInt(this.length*8),o),this.process(r,0);const a=nm(e),l=this.outputLen;if(l%4)throw new Error("_sha2: outputLen should be aligned to 32bit");const c=l/4,u=this.get();if(c>u.length)throw new Error("_sha2: outputLen bigger than state");for(let d=0;d<c;d++)a.setUint32(4*d,u[d],o)}digest(){const{buffer:e,outputLen:n}=this;this.digestInto(e);const r=e.slice(0,n);return this.destroy(),r}_cloneInto(e){e||(e=new this.constructor),e.set(...this.get());const{blockLen:n,buffer:r,length:i,finished:o,destroyed:s,pos:a}=this;return e.destroyed=s,e.finished=o,e.length=i,e.pos=a,i%n&&e.buffer.set(r),e}clone(){return this._cloneInto()}}const Xo=Uint32Array.from([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),Cn=Uint32Array.from([1779033703,4089235720,3144134277,2227873595,1013904242,4271175723,2773480762,1595750129,1359893119,2917565137,2600822924,725511199,528734635,4215389547,1541459225,327033209]),XD=Uint32Array.from([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),Jo=new Uint32Array(64);let JD=class extends FE{constructor(e=32){super(64,e,8,!1),this.A=Xo[0]|0,this.B=Xo[1]|0,this.C=Xo[2]|0,this.D=Xo[3]|0,this.E=Xo[4]|0,this.F=Xo[5]|0,this.G=Xo[6]|0,this.H=Xo[7]|0}get(){const{A:e,B:n,C:r,D:i,E:o,F:s,G:a,H:l}=this;return[e,n,r,i,o,s,a,l]}set(e,n,r,i,o,s,a,l){this.A=e|0,this.B=n|0,this.C=r|0,this.D=i|0,this.E=o|0,this.F=s|0,this.G=a|0,this.H=l|0}process(e,n){for(let d=0;d<16;d++,n+=4)Jo[d]=e.getUint32(n,!1);for(let d=16;d<64;d++){const h=Jo[d-15],g=Jo[d-2],b=Ci(h,7)^Ci(h,18)^h>>>3,p=Ci(g,17)^Ci(g,19)^g>>>10;Jo[d]=p+Jo[d-7]+b+Jo[d-16]|0}let{A:r,B:i,C:o,D:s,E:a,F:l,G:c,H:u}=this;for(let d=0;d<64;d++){const h=Ci(a,6)^Ci(a,11)^Ci(a,25),g=u+h+YD(a,l,c)+XD[d]+Jo[d]|0,p=(Ci(r,2)^Ci(r,13)^Ci(r,22))+QD(r,i,o)|0;u=c,c=l,l=a,a=s+g|0,s=o,o=i,i=r,r=g+p|0}r=r+this.A|0,i=i+this.B|0,o=o+this.C|0,s=s+this.D|0,a=a+this.E|0,l=l+this.F|0,c=c+this.G|0,u=u+this.H|0,this.set(r,i,o,s,a,l,c,u)}roundClean(){Qo(Jo)}destroy(){this.set(0,0,0,0,0,0,0,0),Qo(this.buffer)}};const _E=bE(["0x428a2f98d728ae22","0x7137449123ef65cd","0xb5c0fbcfec4d3b2f","0xe9b5dba58189dbbc","0x3956c25bf348b538","0x59f111f1b605d019","0x923f82a4af194f9b","0xab1c5ed5da6d8118","0xd807aa98a3030242","0x12835b0145706fbe","0x243185be4ee4b28c","0x550c7dc3d5ffb4e2","0x72be5d74f27b896f","0x80deb1fe3b1696b1","0x9bdc06a725c71235","0xc19bf174cf692694","0xe49b69c19ef14ad2","0xefbe4786384f25e3","0x0fc19dc68b8cd5b5","0x240ca1cc77ac9c65","0x2de92c6f592b0275","0x4a7484aa6ea6e483","0x5cb0a9dcbd41fbd4","0x76f988da831153b5","0x983e5152ee66dfab","0xa831c66d2db43210","0xb00327c898fb213f","0xbf597fc7beef0ee4","0xc6e00bf33da88fc2","0xd5a79147930aa725","0x06ca6351e003826f","0x142929670a0e6e70","0x27b70a8546d22ffc","0x2e1b21385c26c926","0x4d2c6dfc5ac42aed","0x53380d139d95b3df","0x650a73548baf63de","0x766a0abb3c77b2a8","0x81c2c92e47edaee6","0x92722c851482353b","0xa2bfe8a14cf10364","0xa81a664bbc423001","0xc24b8b70d0f89791","0xc76c51a30654be30","0xd192e819d6ef5218","0xd69906245565a910","0xf40e35855771202a","0x106aa07032bbd1b8","0x19a4c116b8d2d0c8","0x1e376c085141ab53","0x2748774cdf8eeb99","0x34b0bcb5e19b48a8","0x391c0cb3c5c95a63","0x4ed8aa4ae3418acb","0x5b9cca4f7763e373","0x682e6ff3d6b2b8a3","0x748f82ee5defb2fc","0x78a5636f43172f60","0x84c87814a1f0ab72","0x8cc702081a6439ec","0x90befffa23631e28","0xa4506cebde82bde9","0xbef9a3f7b2c67915","0xc67178f2e372532b","0xca273eceea26619c","0xd186b8c721c0c207","0xeada7dd6cde0eb1e","0xf57d4f7fee6ed178","0x06f067aa72176fba","0x0a637dc5a2c898a6","0x113f9804bef90dae","0x1b710b35131c471b","0x28db77f523047d84","0x32caab7b40c72493","0x3c9ebe0a15c9bebc","0x431d67c49c100d4c","0x4cc5d4becb3e42b6","0x597f299cfc657e2a","0x5fcb6fab3ad6faec","0x6c44198c4a475817"].map(t=>BigInt(t))),ZD=_E[0],ez=_E[1],Zo=new Uint32Array(80),es=new Uint32Array(80);let tz=class extends FE{constructor(e=64){super(128,e,16,!1),this.Ah=Cn[0]|0,this.Al=Cn[1]|0,this.Bh=Cn[2]|0,this.Bl=Cn[3]|0,this.Ch=Cn[4]|0,this.Cl=Cn[5]|0,this.Dh=Cn[6]|0,this.Dl=Cn[7]|0,this.Eh=Cn[8]|0,this.El=Cn[9]|0,this.Fh=Cn[10]|0,this.Fl=Cn[11]|0,this.Gh=Cn[12]|0,this.Gl=Cn[13]|0,this.Hh=Cn[14]|0,this.Hl=Cn[15]|0}get(){const{Ah:e,Al:n,Bh:r,Bl:i,Ch:o,Cl:s,Dh:a,Dl:l,Eh:c,El:u,Fh:d,Fl:h,Gh:g,Gl:b,Hh:p,Hl:w}=this;return[e,n,r,i,o,s,a,l,c,u,d,h,g,b,p,w]}set(e,n,r,i,o,s,a,l,c,u,d,h,g,b,p,w){this.Ah=e|0,this.Al=n|0,this.Bh=r|0,this.Bl=i|0,this.Ch=o|0,this.Cl=s|0,this.Dh=a|0,this.Dl=l|0,this.Eh=c|0,this.El=u|0,this.Fh=d|0,this.Fl=h|0,this.Gh=g|0,this.Gl=b|0,this.Hh=p|0,this.Hl=w|0}process(e,n){for(let T=0;T<16;T++,n+=4)Zo[T]=e.getUint32(n),es[T]=e.getUint32(n+=4);for(let T=16;T<80;T++){const $=Zo[T-15]|0,R=es[T-15]|0,j=Ol($,R,1)^Ol($,R,8)^vE($,R,7),q=Tl($,R,1)^Tl($,R,8)^wE($,R,7),G=Zo[T-2]|0,L=es[T-2]|0,V=Ol(G,L,19)^vh(G,L,61)^vE(G,L,6),W=Tl(G,L,19)^wh(G,L,61)^wE(G,L,6),z=lD(q,W,es[T-7],es[T-16]),C=cD(z,j,V,Zo[T-7],Zo[T-16]);Zo[T]=C|0,es[T]=z|0}let{Ah:r,Al:i,Bh:o,Bl:s,Ch:a,Cl:l,Dh:c,Dl:u,Eh:d,El:h,Fh:g,Fl:b,Gh:p,Gl:w,Hh:S,Hl:O}=this;for(let T=0;T<80;T++){const $=Ol(d,h,14)^Ol(d,h,18)^vh(d,h,41),R=Tl(d,h,14)^Tl(d,h,18)^wh(d,h,41),j=d&g^~d&p,q=h&b^~h&w,G=uD(O,R,q,ez[T],es[T]),L=dD(G,S,$,j,ZD[T],Zo[T]),V=G|0,W=Ol(r,i,28)^vh(r,i,34)^vh(r,i,39),z=Tl(r,i,28)^wh(r,i,34)^wh(r,i,39),C=r&o^r&a^o&a,f=i&s^i&l^s&l;S=p|0,O=w|0,p=g|0,w=b|0,g=d|0,b=h|0,{h:d,l:h}=lo(c|0,u|0,L|0,V|0),c=a|0,u=l|0,a=o|0,l=s|0,o=r|0,s=i|0;const y=sD(V,z,f);r=aD(y,L,W,C),i=y|0}({h:r,l:i}=lo(this.Ah|0,this.Al|0,r|0,i|0)),{h:o,l:s}=lo(this.Bh|0,this.Bl|0,o|0,s|0),{h:a,l}=lo(this.Ch|0,this.Cl|0,a|0,l|0),{h:c,l:u}=lo(this.Dh|0,this.Dl|0,c|0,u|0),{h:d,l:h}=lo(this.Eh|0,this.El|0,d|0,h|0),{h:g,l:b}=lo(this.Fh|0,this.Fl|0,g|0,b|0),{h:p,l:w}=lo(this.Gh|0,this.Gl|0,p|0,w|0),{h:S,l:O}=lo(this.Hh|0,this.Hl|0,S|0,O|0),this.set(r,i,o,s,a,l,c,u,d,h,g,b,p,w,S,O)}roundClean(){Qo(Zo,es)}destroy(){Qo(this.buffer),this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)}};const VE=im(()=>new JD),nz=im(()=>new tz),DE=VE,zE=[{type:"event",name:"Approval",inputs:[{indexed:!0,name:"owner",type:"address"},{indexed:!0,name:"spender",type:"address"},{indexed:!1,name:"value",type:"uint256"}]},{type:"event",name:"Transfer",inputs:[{indexed:!0,name:"from",type:"address"},{indexed:!0,name:"to",type:"address"},{indexed:!1,name:"value",type:"uint256"}]},{type:"function",name:"allowance",stateMutability:"view",inputs:[{name:"owner",type:"address"},{name:"spender",type:"address"}],outputs:[{type:"uint256"}]},{type:"function",name:"approve",stateMutability:"nonpayable",inputs:[{name:"spender",type:"address"},{name:"amount",type:"uint256"}],outputs:[{type:"bool"}]},{type:"function",name:"balanceOf",stateMutability:"view",inputs:[{name:"account",type:"address"}],outputs:[{type:"uint256"}]},{type:"function",name:"decimals",stateMutability:"view",inputs:[],outputs:[{type:"uint8"}]},{type:"function",name:"name",stateMutability:"view",inputs:[],outputs:[{type:"string"}]},{type:"function",name:"symbol",stateMutability:"view",inputs:[],outputs:[{type:"string"}]},{type:"function",name:"totalSupply",stateMutability:"view",inputs:[],outputs:[{type:"uint256"}]},{type:"function",name:"transfer",stateMutability:"nonpayable",inputs:[{name:"recipient",type:"address"},{name:"amount",type:"uint256"}],outputs:[{type:"bool"}]},{type:"function",name:"transferFrom",stateMutability:"nonpayable",inputs:[{name:"sender",type:"address"},{name:"recipient",type:"address"},{name:"amount",type:"uint256"}],outputs:[{type:"bool"}]}];class rz extends kn{constructor({value:e}){super(`Number \`${e}\` is not a valid decimal number.`,{name:"InvalidDecimalNumberError"})}}function iz(t,e){if(!/^(-?)([0-9]*)\.?([0-9]*)$/.test(t))throw new rz({value:t});let[n,r="0"]=t.split(".");const i=n.startsWith("-");if(i&&(n=n.slice(1)),r=r.replace(/(0+)$/,""),e===0)Math.round(+`.${r}`)===1&&(n=`${BigInt(n)+BigInt(1)}`),r="";else if(r.length>e){const[o,s,a]=[r.slice(0,e-1),r.slice(e-1,e),r.slice(e)],l=Math.round(+`${s}.${a}`);l>9?r=`${BigInt(o)+BigInt(1)}0`.padStart(o.length+1,"0"):r=`${o}${l}`,r.length>e&&(r=r.slice(1),n=`${BigInt(n)+BigInt(1)}`),r=r.slice(0,e)}else r=r.padEnd(e,"0");return BigInt(`${i?"-":""}${n}${r}`)}const oz="0x0000000000000000000000000000000000000000";let UE=class extends rm{constructor(e,n){super(),this.finished=!1,this.destroyed=!1,xE(e);const r=Eh(n);if(this.iHash=e.create(),typeof this.iHash.update!="function")throw new Error("Expected instance of class which extends utils.Hash");this.blockLen=this.iHash.blockLen,this.outputLen=this.iHash.outputLen;const i=this.blockLen,o=new Uint8Array(i);o.set(r.length>i?e.create().update(r).digest():r);for(let s=0;s<o.length;s++)o[s]^=54;this.iHash.update(o),this.oHash=e.create();for(let s=0;s<o.length;s++)o[s]^=106;this.oHash.update(o),Qo(o)}update(e){return Nl(this),this.iHash.update(e),this}digestInto(e){Nl(this),co(e,this.outputLen),this.finished=!0,this.iHash.digestInto(e),this.oHash.update(e),this.oHash.digestInto(e),this.destroy()}digest(){const e=new Uint8Array(this.oHash.outputLen);return this.digestInto(e),e}_cloneInto(e){e||(e=Object.create(Object.getPrototypeOf(this),{}));const{oHash:n,iHash:r,finished:i,destroyed:o,blockLen:s,outputLen:a}=this;return e=e,e.finished=i,e.destroyed=o,e.blockLen=s,e.outputLen=a,e.oHash=n._cloneInto(e.oHash),e.iHash=r._cloneInto(e.iHash),e}clone(){return this._cloneInto()}destroy(){this.destroyed=!0,this.oHash.destroy(),this.iHash.destroy()}};const $E=(t,e,n)=>new UE(t,e).update(n).digest();$E.create=(t,e)=>new UE(t,e);const HE=(t,e=0)=>iz(t,e).toString(),ts=(t="0",e=0)=>{try{return KD(BigInt(t),e)}catch(n){return console.error(n),"0"}},Rl=(t,e)=>!!(t&&e&&(t==null?void 0:t.toLowerCase())===(e==null?void 0:e.toLowerCase())),um=(t,e=!1)=>`${e?"":t.slice(0,4)}...${t.slice(-4)}`,sz=Intl.NumberFormat("en",{maximumFractionDigits:4}),az=Intl.NumberFormat("en",{maximumFractionDigits:6}),lz=Intl.NumberFormat("en",{style:"currency",currency:"USD"}),fo=(t,e)=>{const n=e?az:sz;return isNaN(+t)?"0.0":n.format(+t)},ra=t=>lz.format(+t),dm=t=>`https://icons-ckg.pages.dev/stargate-light/networks/${tm[t]}.svg`,WE=()=>{const{address:t}=Xe.useAccount(),e=Qe(s=>s.ensoApiToken),{data:n,isLoading:r}=zV({eoaAddress:t,chainId:"all"},{query:{enabled:!!t&&!!e}}),{holdingsList:i,total:o}=J.useMemo(()=>{if(!(n!=null&&n.length))return{holdingsList:[],total:0};const s=n==null?void 0:n.map(l=>({...l,total:+l.amount/10**l.decimals*+l.price})).filter(l=>l.total>1&&l.total<1e4).sort((l,c)=>c.total-l.total),a=s==null?void 0:s.reduce((l,{total:c})=>l+c,0);return{holdingsList:s,total:a}},[n]);return{holdingsList:i,total:o,isLoading:r}},GE=t=>{var e,n;return{...t,logoURI:(e=t==null?void 0:t.logosUri)==null?void 0:e[0],underlyingTokens:(n=t==null?void 0:t.underlyingTokens)==null?void 0:n.map(GE)}},cz=[],ia=(t,e)=>{var i,o;const{data:n,isLoading:r}=OV({address:[t],chainId:e,includeMetadata:!0},{query:{enabled:!!t&&!!e}});return{data:(i=n==null?void 0:n.data)!=null&&i.length?(o=n==null?void 0:n.data)==null?void 0:o.map(GE):cz,isLoading:r}},Sh=(t,e)=>{const{data:n,isLoading:r}=AV(t,e);return{data:n==null?void 0:n.price,isLoading:r}},uz=({chainId:t,outChainId:e,fromAddress:n,receiver:r,spender:i,amountIn:o,tokenIn:s,tokenOut:a,slippage:l,referralCode:c,routingStrategy:u="router"})=>{const d={referralCode:c,amountIn:[o],tokenIn:[s],tokenOut:[a],slippage:l.toString(),fromAddress:n,receiver:r,spender:i,routingStrategy:u,chainId:t};e!==t&&(d.destinationChainId=e);const{data:[g]}=ia(a,e),{data:[b]}=ia(s,t),p=`Purchase ${fo(ts(o,b==null?void 0:b.decimals))} ${b==null?void 0:b.symbol} of ${g==null?void 0:g.symbol}`;return{...BV(d,{query:{retry:2,enabled:!!d.amountIn&&!!b&&!!g}}),title:p}},dz=({address:t,token:e,chainId:n,amount:r})=>{const i=FV({fromAddress:t,tokenAddress:e,chainId:n,amount:r});return{approveData:i.data,approveFetched:i.isFetched}},fz=We("div",{base:{position:"sticky",top:"0px",display:"flex",flexDirection:"column",width:"100vw",height:"100vh",justifyContent:"center",alignItems:"center"}}),hz=We("div",{base:{zIndex:1,position:"absolute",top:"0px",left:"0px",width:"100vw",height:"100vh",backgroundColor:"rgba(0, 0, 0, 0.58)"}}),pz=We("div",{base:{zIndex:2,display:"flex",flexDirection:"column",width:"100%",maxWidth:"374px",justifyContent:"center",alignItems:"center",borderRadius:"lg",border:"1px solid",borderColor:"gray.300",padding:"16px",backgroundColor:"white"}}),gz=We("div",{base:{display:"flex",width:"100%",justifyContent:"center",alignItems:"center"}}),mz=We("div",{base:{display:"flex",width:"100%",justifyContent:"center",alignItems:"center"}}),_n=({children:t})=>k.jsxs(fz,{children:[k.jsx(pz,{children:t}),k.jsx(hz,{})]}),yz=({children:t})=>k.jsx(gz,{children:t});_n.Header=yz;const bz=({children:t})=>k.jsx(mz,{children:t});_n.Body=bz;const vz=We("p",{base:{fontWeight:"500",fontSize:"14px",lineHeight:"20px",letterSpacing:"0%",color:"fg.muted"}}),wz=({children:t,isLoading:e})=>e?k.jsxs(ye,{display:"flex",alignItems:"center",justifyContent:"space-between",gap:"1",minWidth:"320px",children:[k.jsxs(ye,{display:"flex",alignItems:"center",gap:"1",children:[k.jsx(L2,{size:"8"}),k.jsxs(ye,{display:"flex",flexDirection:"column",gap:"1",children:[k.jsx(ah,{noOfLines:1,width:"80px"}),k.jsx(ah,{noOfLines:1,width:"80px"})]})]}),k.jsx(ye,{display:"flex",alignItems:"center",gap:"1",children:k.jsx(ah,{noOfLines:1,width:"80px"})})]}):t,jE=({icon:t,title:e,balance:n,usdBalance:r,tag:i,loading:o,selected:s,onClick:a,chainId:l})=>k.jsx(Ai,{onClick:a,selected:s,children:k.jsx(wz,{isLoading:o,children:k.jsxs(ye,{display:"flex",alignItems:"center",justifyContent:"space-between",gap:"1",minWidth:"320px",children:[k.jsxs(ye,{display:"flex",alignItems:"center",gap:"1",children:[k.jsxs(ye,{position:"relative",borderRadius:"full",w:"32px",h:"32px",children:[t&&k.jsx(pr,{borderRadius:"full",w:"32px",src:t}),l&&k.jsx(ye,{position:"absolute",bottom:"0",right:"-2px",width:"16px",height:"16px",borderRadius:"50%",overflow:"hidden",border:"1px solid",borderColor:"bg",zIndex:"1",children:k.jsx("img",{src:dm(l),alt:`Chain ${l}`,width:"100%",height:"100%"})})]}),k.jsxs(ye,{children:[k.jsx(Ge,{fontWeight:"medium",color:"fg",whiteSpace:"nowrap",maxWidth:"80px",overflow:"hidden",textOverflow:"ellipsis",children:e}),k.jsx(Ge,{fontSize:"xs",color:"fg.muted",children:n})]})]}),k.jsxs(ye,{display:"flex",alignItems:"center",gap:"1",children:[i&&k.jsx(Z2,{children:i}),k.jsx(vz,{children:r})]})]})})});var KE=(t=>(t.LOADING="loading",t.CONNECTED="connected",t.NONE="none",t))(KE||{});const xz=({children:t,isLoading:e})=>e?k.jsxs(ye,{display:"flex",alignItems:"center",gap:"1",minWidth:"320px",children:[k.jsx(L2,{size:"8"}),k.jsxs(ye,{display:"flex",flexDirection:"column",gap:"1",children:[k.jsx(ah,{noOfLines:1,width:"80px"}),k.jsx(Ai.Description,{children:"Loading wallet..."})]})]}):t,Ez=({icon:t,walletHash:e,balance:n,delay:r,status:i,badge:o,onClick:s})=>k.jsx(Ai,{onClick:s,children:k.jsx(xz,{isLoading:i==="loading",children:k.jsxs(ye,{display:"flex",alignItems:"center",gap:"1",minWidth:"320px",children:[k.jsxs(ye,{display:"flex",alignItems:"center",gap:"1",marginRight:"auto",children:[t&&(typeof t=="string"?k.jsx(pr,{src:t}):t),k.jsxs(ye,{children:[k.jsx(Ai.Title,{children:e}),n&&r&&k.jsxs(Ai.Description,{children:[n," - ",r]})]})]}),o&&k.jsx(Z2,{children:o}),i==="connected"&&k.jsx(Lt,{as:R_,color:"green",width:"16px",height:"16px"})]})})}),Sz=({title:t,limit:e,delay:n,icons:r,onClick:i})=>k.jsx(Ai,{onClick:i,children:k.jsxs(ye,{display:"flex",alignItems:"center",gap:"1",minWidth:"320px",children:[k.jsx(ye,{display:"flex",alignItems:"center",gap:"1",marginRight:"auto",children:k.jsxs(ye,{children:[k.jsx(Ai.Title,{children:t}),e&&k.jsxs(Ai.Description,{children:[e,n?` - ${n}`:""]})]})}),k.jsx(ye,{display:"flex",position:"relative",children:r.map((o,s)=>k.jsx(pr,{w:"32px",position:"relative",zIndex:s,right:`${0-(r.length-1-s)*10}px`,src:o}))}),k.jsx(Lt,{as:z2,color:"gray",width:"16px",height:"16px"})]})}),qE=t=>fetch(`https://tokens.coingecko.com/${iE[t]}/all.json`).then(e=>e.json()).then(e=>e==null?void 0:e.tokens).then(e=>[oE[t],...e]),Az=()=>fetch("https://mainnet.internal.oogabooga.io/token-list/tokens?chainId=80094&client=SWAP").then(t=>t.json()).then(t=>t.map(e=>({...e,logoURI:e.tokenURI,address:e.address===oz?tn:e.address.toLowerCase()}))),kz=()=>fetch("https://api.rooster-protocol.xyz/api/tokens").then(t=>t.json()).then(({tokens:t})=>t),Cz=t=>({[oE[t].symbol]:5,USDC:4,DAI:4,USDT:4,WBTC:4,WETH:3,LINK:3,UNI:3,SUSHI:3,AAVE:3,USDCE:2}),Iz=new Promise(t=>t([{address:"0x6047828dc181963ba44974801ff68e538da5eaf9",name:"Tether USD",symbol:"USDT",decimals:6,logoURI:"https://assets.coingecko.com/coins/images/325/large/Tether.png"}])),Oz=new Promise(t=>t([{address:tn,name:"Plume",symbol:"PLUME",decimals:18,logoURI:"https://assets.coingecko.com/coins/images/53623/standard/plume-token.png?1736896935"},{address:"0x78adD880A697070c1e765Ac44D65323a0DcCE913",name:"USD Coin.e",symbol:"USDC.e",decimals:6,logoURI:"https://assets.coingecko.com/coins/images/6319/large/USD_Coin_icon.png"},{address:"0xEa237441c92CAe6FC17Caaf9a7acB3f953be4bd1",name:"Wrapped Plume",symbol:"wPlume",decimals:18,logoURI:"https://assets.coingecko.com/coins/images/53623/standard/plume-token.png?1736896935"},{address:"0xca59cA09E5602fAe8B629DeE83FfA819741f14be",name:"Wrapped Ether",symbol:"WETH",decimals:18,logoURI:"https://assets.coingecko.com/coins/images/2518/large/weth.png"}])),Tz=t=>{let e=[];switch(t){case mh.BERACHAIN:e=[Az()];break;case mh.SONIC:e=[qE(t),Iz];break;case mh.PLUME:e=[Oz,kz()];break;default:e=[qE(t)]}return Promise.allSettled(e).then(n=>{var a,l,c;const r=n.filter(u=>u.status==="fulfilled").map(u=>u.value),i=r[0];if(r.length>1){const u=new Set((l=(a=r[0])==null?void 0:a.map(h=>h.address))!=null?l:[]),d=r[0];for(let h=1;h<r.length;h++){const g=(c=r[h])==null?void 0:c.filter(b=>!u.has(b.address));g&&(d.push(...g),g.forEach(b=>u.add(b.address)))}}const o=Cz(t);return[...i].sort((u,d)=>{var h,g;return(g=(h=o[d.symbol])!=null?h:0-o[u.symbol])!=null?g:0}).map(u=>({...u,address:u.address.toLowerCase()}))})},Pz=t=>{const e=Ah(t);return Ki.useQuery({queryKey:["tokenList",e],queryFn:()=>Tz(e),enabled:!!e})},Nz={USDT:"USDT0"},Bz=(t,e)=>{const{data:n}=Pz(e);return(Array.isArray(t)?t:[t]).map(i=>n==null?void 0:n.find(o=>{var s;return o.symbol==((s=Nz[i])!=null?s:i)}))},Ah=t=>{var r;const e=Qe(i=>i.chainIdIn),{chainId:n=1}=Xe.useAccount();return(r=t!=null?t:e)!=null?r:n},Rz=t=>t.charAt(0).toUpperCase()+t.slice(1),kh=t=>{const e=iE[t];return Rz(e).split("-")[0]},Ch=({hash:t,chainId:e,type:n="/tx"})=>{const r=wV[e];if(t)return`${r}${n}/${t}`};sR({placement:"bottom-end",pauseOnPageIdle:!0});const YE="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABwAAAAcCAYAAAByDd+UAAACUUlEQVR4Ae2WA6weQRSFt7bdhrWNqLZtM6riFEFt27aCMqht27at2/3yMun8k52dmi/JyZvcOfd8O8r7vcrda/xS/YfAMXnj1x7RIEXsHxFOlhPYIZ13fU2FDCKdMrT9VpC0y9CKjE7pvTuhQFbmm6RRUk92lk8m0ibdufu1EuX6UhBev+cMvWSQRaYV6BtqYoqAtkwj0iLtHBfM98zCq8MQmWHAKZh06LGqyaOgqFWGdjK2fXZdbJ+ax2vA0BQrkPPDZIN+bJ9VZHQbkREtEWNqYTB0xw0MgF6rElekS2ETSI05G0zIDNvSfpiC5FvlSqcSH00gNeZsfWSGAbPaVrissHWFzFlXSKYViNqm8h60Se4JauGrS6aYcrNuKucZ4sFLj+ony/nwF9cuOGVZ3cKCeLyEKX1sltIEUovw0KP6yXICZXTrowSh9z0rEvhZDWMDihA13UOP6ifLCVRBCvi0dtQNRVfKevK6bz0FY0xNzeOlJ+KDwoDAqmDSAx+1L8Cl4JbyV18BY30Or/ogXVXCgBMNs6hwgs50rUioqjGmxpyqmTA0xQ4c1fouTUFScBOozwWJTCvwSjnvCmdiiquvQs0tVUA8Qb1kWoHXqsQbzOGb0m8g4WwjYqzf5KBeMq1A/p8FNXH1EYANvbtxSRBjVqjmA4FkWoHIbLhaypvxeMWcKbeevBd0+MBJGdC2tSDGqv541bzpeM1+5ztkC5D5ZTcfvc9y+/6r01duPpEtu44IYuzXzjBn7pTKcQDdunD5XstN2/aPRIyjf5f+duAnkHEA02/8X30AAAAASUVORK5CYII=",Mz="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAhCAYAAAC4JqlRAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAARKSURBVHgBtVhbbBRVGP7OdrbbC9KikQgxcXnBaCLWxCcftBo1Md6ILzyokb5o2gdbkAQFk91NLMWYavHFglHgxQSf0EQTEq4Jl0C4NRDCvcslhDu9UNi2u3P4/j07e2lnZmdb+iXTOXvOmfN9/3/+888/VagQXb/pKG9Rj+Hkd60qiQqggkyKb9SNkRTa2VyqvcnzIrjqVqWxLogYXwE5a2MkXYopgItv4i3hJ8RTwNpe3W7biHNGI6YDhQHYSKxqUz3uwy7oWq9jWsgfI0gUpycSLv2lWNOrf4FGB2YAIY2eb9vUspK+4h9i+UyRC2yFDsZVrLgv7wEONDPYdgVZSPGpgSFg9ixg5KGxor4O1B4MfPxNbsduaVtF/RsDPo+aaqDzG6Aq5z9N5r//B06eAerqyj+vDdcCaWeXoPVBzncedwaA4fvA2X7gxFnjjSXv87x+bfpVqOwS0U5y5gUQMVSAulqg+0/gYB8QCQMXrgA7D9CdlvHM/KfLbweJv5C76tygm1QGx1ABdG71EDfz4SjwZAPw8gvA4DDw4VtmbPt+4PBJ/0wnsWAhg8UISHp/BHh1EdBEstoIcJtbsX0fcOM2sPcIo9w28xa/A7z9GjCe5had9vYG5zdbtOINrX1V4u4g0PYZ8Nx8cwIczJsLvLTQtGO/Ap+8Cyx63vwO0cfvvW7iZHSs4LVicE6TYgD2+wWgkP+00lgXCvl7SNS6uXzFWuAp94SeDPmRpzPA8haS68nkjrsdy5QHuQx/ucRzG6KuNsliwyPm/sxcE2zFC6bT5rpH74yl4Qt5dCFP/NCw+7jl1inR3LVicr94wqZXMra5IkxIW7cxB3wAX4iXqqo8BFBhMkgSsu0CsYiQ7ZG+2prSeecuMUXXG3FCKgG45T/TZ0/eh6SlFY7Tr9Hi3oYngNXdDJw5wLKWIvKc9c5vcW//tYLAazeBv/4hsfhVG0JJ13K5xYDKBqFGH1xcNqvenAAhHc9Z7IiQ/c/wStG6zz+iiKvcY6bg7j9oeSRHSuvDlglezzwA7JHx3R7jqGfK/f5n4OJloDps3CrisrlAmXtq1BDK+2HlVwzKMQRGuIq1ozS6evUuLtzsNVEmPUgx7fL6YTlw6jzQxww3OFRws2THZ+cB12/RrEMIguSqVrXAnAKNzfzb7CmAChpns7psN20he+VF4PctTMf3zJx9R03AiUvDVnl26k44xmXhlxElKNs+Lfzeexj4dwdfQo3uKTYAstZLo1gr4929IrpFK3/cYIIuxW1oYCU0p2HK5GJ1i9POZ0IpkRy3TES1ZY6Z3KUMmyJvFqy2E045lhNTClYqPexsxwyAwtetblUlRe+kd4FM8PLEtMhp+URygWfBsma97mCxEpv2l5HmlxEq/DJyIN+G9EYcufqtUvDIbqKAqX0bThQiHxUsHj4u9+KS/M543Txeg554ixoot3YgARPF4DH+f+ARXqmiGXvOHE0AAAAASUVORK5CYII=",Lz=(t,e)=>{const n=J.useCallback(t,[]);J.useEffect(()=>{const r=setInterval(n,e);return()=>clearInterval(r)},[e,n])},QE=()=>{const[t,e]=J.useState(0);return Lz(()=>{e(t+1)},1e4),t},Fz=(t,e)=>{const{address:n}=Xe.useAccount(),r=Ah(e);return Xe.useReadContract({chainId:r,address:t,abi:zE,functionName:"balanceOf",args:[n],query:{enabled:ju(n)&&ju(t)&&!Rl(t,tn)}})},_z=(t,e)=>{var d;const{address:n}=Xe.useAccount(),r=Ah(e),i=QE(),o=Ki.useQueryClient(),{data:s,queryKey:a}=Fz(t,e),{data:l,queryKey:c}=Xe.useBalance({address:n,chainId:r,query:{enabled:Rl(t,tn)}});J.useEffect(()=>{o.invalidateQueries({queryKey:a}),o.invalidateQueries({queryKey:c})},[i,o,a,c]);const u=Rl(t,tn)?l==null?void 0:l.value:s;return(d=u==null?void 0:u.toString())!=null?d:"0"},Vz=(t,e)=>{var u;const{address:n}=Xe.useAccount(),r=Ah(),i=QE(),o=Ki.useQueryClient(),{data:s,queryKey:a,isLoading:l,isFetched:c}=Xe.useReadContract({chainId:r,address:t,abi:zE,functionName:"allowance",args:[n,e],query:{enabled:ju(n)&&ju(t)&&!Rl(t,tn)}});return J.useEffect(()=>{o.invalidateQueries({queryKey:a})},[i,o,a]),{allowance:(u=s==null?void 0:s.toString())!=null?u:"0",allowanceFetched:c,allowanceLoading:l}},Dz=(t,e="0xF75584eF6673aD213a685a1B58Cc0330B8eA22Cf",n)=>{const{allowance:r,allowanceFetched:i,allowanceLoading:o}=Vz(t,e);return{approveNeeded:!Rl(t,tn)&&+r<+n,allowanceFetched:i,allowanceLoading:o}},zz=t=>{if(!t)return YE;const e=t.toLowerCase();return e.includes("metamask")?YE:e.includes("rabby")?Mz:k.jsx(D_,{size:20})},Uz=t=>{if(!t)return"Wallet";const e=t.toLowerCase();return e.includes("metamask")?"MetaMask":e.includes("rabby")?"Rabby":e.includes("walletconnect")?"WalletConnect":e.includes("injected")?"Browser Wallet":t.charAt(0).toUpperCase()+t.slice(1)},Jr=()=>{const{address:t=cV}=Xe.useAccount(),e=Qe(h=>h.amountIn),n=Qe(h=>h.tokenIn),r=Qe(h=>h.tokenOut),i=Qe(h=>h.slippage),o=Qe(h=>h.chainIdIn),s=Qe(h=>h.chainIdOut),a=Qe(h=>h.isCheckout),{data:[l]}=ia(n,o),{data:[c]}=ia(r,s),{data:u}=Sh(o,n),{data:d}=Sh(s,r);return{chainIdIn:o,chainIdOut:s,tokenInData:l,tokenOutData:c,amountIn:e,slippage:i,address:t,tokenInPrice:u,tokenOutPrice:d,tokenIn:n,tokenOut:r,isCheckout:a}},$z=({address:t,chainId:e,calls:n})=>{const{sendCalls:r}=Xe.useSendCalls(),{data:i}=Xe.useCapabilities(),o=!1,s=Xe.useWalletClient();console.log(i,o);const a=J.useCallback(async(c,u)=>{var d;{console.log("Atomic not supported, sending transactions sequentially");try{for(const h of n){console.log("Sending individual transaction:",h);const g=await((d=s.data)==null?void 0:d.sendTransaction({...h,account:t,chainId:e}));if(console.log("Sequential transaction result:",g),!g)throw new Error(`Transaction failed for call: ${JSON.stringify(h)}`);h===n[n.length-1]&&c(g)}console.log("All sequential transactions completed")}catch(h){throw console.error("Error in sequential transaction:",h),u(h),h}return}},[r,n,o,e,s.data]);return{ready:n.length>0&&s.data,sendTxns:a}},Ml=()=>{const{tokenInData:t,amountIn:e,slippage:n,address:r,chainIdIn:i,chainIdOut:o,tokenInPrice:s,tokenIn:a,tokenOut:l,isCheckout:c}=Jr(),{data:u,isLoading:d,error:h,isFetched:g}=uz({routingStrategy:c?"checkout":"router",fromAddress:r,receiver:r,spender:r,amountIn:e,tokenIn:a,tokenOut:l,slippage:n,chainId:i,outChainId:o}),b=J.useMemo(()=>ra(ts((+e*s).toFixed(),t==null?void 0:t.decimals)),[e,s,t==null?void 0:t.decimals]);return{chainIdOut:o,routeData:u,routeFetched:g,routeLoading:d,usdAmountIn:b,routerError:h}},XE=()=>{const{connector:t}=Xe.useAccount();return{walletIcon:zz(t==null?void 0:t.name),walletDisplayName:Uz(t==null?void 0:t.name)}},JE="data:image/svg+xml,%3csvg%20width='32'%20height='33'%20viewBox='0%200%2032%2033'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3crect%20y='0.5'%20width='32'%20height='32'%20rx='16'%20fill='%232F2B32'/%3e%3cpath%20d='M22.5582%2020.6133L16.0006%2027.1709L9.4469%2020.6172L9.44397%2020.6133L11.858%2018.2061L16.0006%2022.3496L20.1481%2018.2021L22.5582%2020.6133ZM18.4469%2016.502L16.0006%2018.9521L13.5543%2016.5059V16.498L13.984%2016.0693L14.194%2015.8633L16.0006%2014.0557L18.4469%2016.502ZM26.6666%2016.5029L24.2565%2018.9131L21.8473%2016.5029L24.2565%2014.0928L26.6666%2016.5029ZM10.153%2016.501L7.7428%2018.9111L5.33264%2016.501L7.7428%2014.0908L10.153%2016.501ZM22.5582%2012.3906L20.1481%2014.8018L16.0006%2010.6543L11.858%2014.7979L9.4469%2012.3867L16.0006%205.83301L22.5582%2012.3906Z'%20fill='%23F3BA2F'/%3e%3c/svg%3e",Hz=()=>{const{handleClose:t,setStep:e,setFlow:n,enableExchanges:r}=J.useContext(Ba),{total:i,isLoading:o}=WE(),{address:s,isConnected:a}=Xe.useAccount(),{walletIcon:l,walletDisplayName:c}=XE(),u=J.useMemo(()=>o?k.jsx(io,{display:"inline-block",height:"10px",width:"60px"}):typeof i=="number"?ra(i):i||"$0.00",[i,o]),d=J.useMemo(()=>s?um(s):"",[s]),h=J.useMemo(()=>{var b;const g=[];return(b=r==null?void 0:r.includes)!=null&&b.call(r,"binance")&&g.unshift({id:"1",title:"Connect Exchange",limit:"No Limit",delay:"2 min",icons:[JE],flow:"exchangeFlow",firstStep:"connectExchange"}),g},[s,r]);return k.jsxs(k.Fragment,{children:[k.jsx(_n.Header,{children:k.jsxs(iV,{children:[k.jsx(ye,{display:"flex",flexDirection:"column",gap:"4px",children:k.jsx(qo,{children:"Deposit"})}),t&&k.jsx(er,{onClick:t,width:"40px",children:k.jsx(Lt,{as:ta,color:"fg.muted",width:"16px",height:"16px"})})]})}),k.jsx(_n.Body,{children:k.jsxs(gr,{children:[s&&k.jsx(gh,{children:k.jsx(Ez,{icon:l,walletHash:d,balance:u,delay:"Instant",status:KE.CONNECTED,badge:c,onClick:()=>{n("mainFlow"),e("selectToken")}},s)}),h.length>0&&k.jsxs(k.Fragment,{children:[k.jsx(oV,{}),k.jsx(gh,{children:h.map(g=>k.jsx(Sz,{title:g.title,limit:g.limit,delay:g.delay,icons:g.icons,onClick:()=>{g.disabled||(n(g.flow),e(g.firstStep))}},g.id))})]})]})})]})},Wz=()=>{const{handleClose:t,setFlow:e,setStep:n}=J.useContext(Ba),r=Qe(d=>d.setIsCheckout),i=Qe(d=>d.setTokenIn),o=Qe(d=>d.tokenIn),s=Qe(d=>d.setChainIdIn),a=Qe(d=>d.chainIdIn),{holdingsList:l,total:c,isLoading:u}=WE();return J.useEffect(()=>{r(!1)},[]),k.jsxs(k.Fragment,{children:[k.jsx(_n.Header,{children:k.jsxs(Du,{children:[k.jsx(er,{minWidth:"16px",minHeight:"16px",maxWidth:"16px",onClick:()=>{e(""),n("")},children:k.jsx(Lt,{as:Vu,color:"gray",width:"16px",height:"16px"})}),k.jsxs(ye,{display:"flex",flexDirection:"column",gap:"4px",children:[k.jsx(qo,{children:"Deposit"}),k.jsxs(em,{children:["Balance: ",ra(c)]})]}),t&&k.jsx(er,{onClick:t,width:"40px",marginLeft:"auto",children:k.jsx(Lt,{as:ta,color:"gray",width:"16px",height:"16px"})})]})}),k.jsx(_n.Body,{children:k.jsxs(gr,{children:[k.jsx(ye,{overflowY:"scroll",maxH:"400px",children:k.jsx(gh,{children:u?Array.from({length:10}).map((d,h)=>k.jsx(io,{height:"40px",width:"300px"},h)):l==null?void 0:l.map(d=>k.jsx(jE,{chainId:d.chainId,icon:d.logoUri,title:d.name,balance:`${fo(ts(d.amount,d.decimals))} ${d.symbol}`,usdBalance:ra(d.total),tag:"",loading:!1,selected:d.token===o&&d.chainId===a,onClick:()=>{i(d.token),s(d.chainId)}},`${d.token}-${d.chainId}`))})}),k.jsx(Fn,{onClick:()=>{n("selectAmount")},disabled:!o,children:"Continue"})]})})]})},Gz="coingecko",jz=We("div",{base:{display:"flex",gap:"8px",alignItems:"center",justifyContent:"center",p:"8px 12px",borderRadius:"114px",bg:"bg.subtle",w:"fit-content"}}),Kz=t=>t.includes(Gz)?t.replace("/thumb/","/large/"):t,qz=({token:t,chainId:e,size:n=32})=>k.jsxs(ye,{position:"relative",borderRadius:"50%",minW:`${n}px`,minH:`${n}px`,children:[k.jsx(ye,{borderRadius:"50%",overflow:"hidden",width:`${n}px`,height:`${n}px`,children:k.jsx("img",{src:t!=null&&t.logoURI?Kz(t==null?void 0:t.logoURI):rE,title:t==null?void 0:t.symbol,alt:t==null?void 0:t.symbol,width:`${n}px`,height:`${n}px`})}),e&&k.jsx(ye,{position:"absolute",bottom:"0",right:"-2px",width:`${n/2}px`,height:`${n/2}px`,borderRadius:"50%",overflow:"hidden",border:"1px solid white",zIndex:"1",children:k.jsx("img",{src:`https://icons-ckg.pages.dev/stargate-light/networks/${tm[e]}.svg`,alt:`Chain ${e}`,width:"100%",height:"100%"})})]}),ZE=({token:t,chainId:e,size:n=32,title:r,subTitle:i})=>k.jsxs(ro,{align:"center",gap:2,children:[k.jsx(qz,{token:t,chainId:e,size:n}),k.jsxs(ye,{children:[k.jsx(Ge,{fontWeight:"medium",fontSize:"xs",color:"fg.muted",children:r}),k.jsx(Ge,{fontSize:"xs",color:"fg",children:i})]})]}),Yz=({tokenIn:t,tokenOut:e,chainIdIn:n,chainIdOut:r,size:i=24})=>k.jsxs(jz,{children:[k.jsx(ZE,{token:t,chainId:n,title:"You send",subTitle:t==null?void 0:t.symbol,size:i}),k.jsx(z2,{color:"#707070",width:"16px",height:"16px"}),k.jsx(ZE,{token:e,chainId:r,title:"You receive",subTitle:e==null?void 0:e.symbol,size:i})]}),Qz=[{label:"25%",value:25},{label:"50%",value:50},{label:"75%",value:75},{label:"Max",value:100}],Xz=({nextStep:t})=>{const{handleClose:e,setStep:n}=J.useContext(Ba),[r,i]=J.useState("10.10"),[o,s]=J.useState("usd"),a=Qe(z=>z.tokenIn),l=Qe(z=>z.tokenOut),c=Qe(z=>z.chainIdOut),u=Qe(z=>z.chainIdIn),d=Qe(z=>z.setAmountIn),h=Qe(z=>z.amountIn),[g,b]=J.useState(!0),{data:[p]}=ia(a,u),{data:[w]}=ia(l,c),{data:S}=Sh(u,a),O=J.useMemo(()=>ts(h,p==null?void 0:p.decimals),[h,p==null?void 0:p.decimals]),T=_z(a,u),$=z=>{if(!T||!S||!(p!=null&&p.decimals)){i("0.00");return}const C=(BigInt(T)*BigInt(z)/BigInt(100)).toString();d(C),i((+ts(C,p==null?void 0:p.decimals)*S).toFixed(2))};J.useEffect(()=>{g&&S&&p&&+T>0&&(b(!1),$(100))},[T,g,S,p,T]);const R=z=>{if(o==="usd"){const C=z.replace("$","");i(C),d(HE((parseFloat(C)*S).toString(),p==null?void 0:p.decimals))}else d(HE(z,p==null?void 0:p.decimals)),i((parseFloat(z)*S).toFixed(2))},j=()=>{s(o==="usd"?"token":"usd")},q=()=>o==="usd"?{placeholder:"$10.00",displayValue:r?`$${r}`:"",equivalentValue:O?`${fo(O)} ${p==null?void 0:p.symbol}`:"—"}:{placeholder:"0.00",displayValue:O,equivalentValue:r?`$${r}`:"—"},{placeholder:G,displayValue:L,equivalentValue:V}=q(),W=+T<+h;return k.jsxs(k.Fragment,{children:[k.jsx(_n.Header,{children:k.jsxs(Du,{children:[k.jsx(er,{minWidth:"16px",minHeight:"16px",maxWidth:"16px",onClick:()=>n("selectToken"),children:k.jsx(Lt,{as:Vu,color:"gray",width:"16px",height:"16px"})}),k.jsx(ye,{display:"flex",flexDirection:"column",gap:"4px",children:k.jsx(qo,{children:"Deposit"})}),e&&k.jsx(er,{onClick:e,width:"40px",marginLeft:"auto",children:k.jsx(Lt,{as:ta,color:"gray",width:"16px",height:"16px"})})]})}),k.jsx(_n.Body,{children:k.jsxs(gr,{children:[k.jsxs(ye,{display:"flex",flexDirection:"column",gap:"8px",children:[k.jsxs(ye,{display:"flex",flexDirection:"column",gap:"8px",alignItems:"center",padding:"25.5px",children:[k.jsx(ph,{inputMode:"decimal",marginY:"8px",variant:"text",placeholder:G,value:L,onChange:z=>R(z.target.value)}),k.jsxs(ye,{display:"flex",gap:"3",alignItems:"center",onClick:j,_hover:{background:"bg.subtle"},cursor:"pointer",borderRadius:"lg",px:"3",children:[k.jsx(er,{minWidth:"24px",minHeight:"24px",maxWidth:"24px",background:"transparent",children:k.jsx(Lt,{as:D2,color:"gray",width:"16px",height:"16px"})}),k.jsx(Ge,{fontSize:"sm",color:"fg.muted",children:V})]})]}),k.jsx(ye,{display:"flex",gap:"4px",justifyContent:"center",paddingBottom:"35px",children:Qz.map(z=>k.jsx(J2,{onClick:()=>$(z.value),children:z.label},z.label))})]}),k.jsx(Yz,{tokenOut:w,tokenIn:p,chainIdIn:u,chainIdOut:c}),k.jsx(Fn,{onClick:()=>W?void 0:n(t!=null?t:"quote"),disabled:W,children:"Continue"})]})})]})},Jz=()=>{var l;const{routerData:t}=Ml(),{tokenIn:e,chainIdIn:n,amountIn:r}=Jr(),{data:i}=Sh(n,tn),{data:[o]}=ia(tn,n),s=J.useMemo(()=>{var u,d;let c=+((d=(u=t==null?void 0:t.tx)==null?void 0:u.value)!=null?d:0);return Rl(e,tn)&&(c-=+r),ts(Math.max(0,c).toString(),18)},[(l=t==null?void 0:t.tx)==null?void 0:l.value,e,r]),a=+s*+(i!=null?i:0);return k.jsxs(Ge,{title:"Bridging fee",cursor:"default",display:"flex",alignItems:"center",gap:1,color:"fg.subtle",fontSize:"xs",children:[k.jsx(L_,{size:12}),k.jsx(hh,{content:`${fo(s,!0)} ${o==null?void 0:o.symbol}`,children:k.jsx(Ge,{fontSize:"xs",color:"fg.subtle",children:ra(a)})})]})};We("div",{base:{display:"flex",justifyContent:"space-between",alignItems:"center",h:"36px",p:"8px 12px",borderRadius:"8px",bg:"bg",w:"100%"}});const Ih=()=>{const{routerData:t}=Ml(),{chainIdIn:e,chainIdOut:n,isCheckout:r}=Jr(),i=Qe(c=>c.slippage),[o,s]=J.useState(!1),l=[{detail:`${t!=null&&t.priceImpact?(-(t==null?void 0:t.priceImpact)/100).toFixed(2):"0.00"}%`,label:"Est. price impact"},{detail:`${i/100}%`,label:"Max. slippage"},{detail:r?"~2min":e!==n?"~1 min":"instant",label:"Est. processing time"}];return k.jsx(d_,{open:o,onOpenChange:c=>s(c.open),w:"full",children:k.jsxs(ye,{width:"100%",bg:"bg.subtle",borderRadius:"md",padding:"12px",transition:"all 0.2s",children:[k.jsx(f_,{asChild:!0,children:k.jsxs(ro,{align:"center",justify:"space-between",width:"100%",cursor:"pointer",children:[k.jsxs(ro,{align:"center",gap:2,children:[k.jsx(Gs,{color:"fg.muted",fontSize:"sm",children:"Transaction details"}),k.jsx(Lt,{as:M_,width:"14px",height:"14px",color:"fg.muted",transform:o?"rotate(180deg)":"rotate(0deg)",transition:"transform 0.2s ease-in-out"})]}),k.jsx(Jz,{})]})}),k.jsx(h_,{children:k.jsx(ye,{marginTop:"12px",paddingTop:"12px",borderTop:"1px solid",borderColor:"border",children:l.map((c,u)=>k.jsxs(ro,{justify:"space-between",align:"center",paddingY:"6px",children:[k.jsx(Gs,{fontSize:"sm",color:"fg.muted",children:c.label}),k.jsx(Gs,{fontSize:"sm",color:"fg",fontWeight:"medium",children:c.detail})]},u))})})]})})},Zz="Swap not found for a required underlying of defi route, please make sure your amount is within an acceptable range",eU="coingecko",tU=t=>t.includes(eU)?t.replace("/thumb/","/large/"):t,eS=({token:t,chainId:e,size:n=32})=>k.jsxs(ye,{position:"relative",borderRadius:"50%",minW:`${n}px`,minH:`${n}px`,children:[k.jsx(ye,{borderRadius:"50%",overflow:"hidden",width:`${n}px`,height:`${n}px`,children:k.jsx("img",{src:t!=null&&t.logoURI?tU(t==null?void 0:t.logoURI):rE,title:t==null?void 0:t.symbol,alt:t==null?void 0:t.symbol,width:`${n}px`,height:`${n}px`})}),e&&k.jsx(ye,{position:"absolute",bottom:"0",right:"-2px",width:`${n/2}px`,height:`${n/2}px`,borderRadius:"50%",overflow:"hidden",border:"1px solid",borderColor:"bg",zIndex:"1",children:k.jsx("img",{src:`https://icons-ckg.pages.dev/stargate-light/networks/${tm[e]}.svg`,alt:`Chain ${e}`,width:"100%",height:"100%"})})]}),Oh=()=>{const{address:t}=Xe.useAccount(),{walletIcon:e,walletDisplayName:n}=XE(),{chainIdOut:r,tokenOutData:i,tokenInData:o,amountIn:s,chainIdIn:a}=Jr(),{routeLoading:l,routeData:c,routeFetched:u,routerError:d}=Ml(),{isCheckout:h}=Qe(),g=l||!u&&!d,b=c!=null&&c.error||(c==null?void 0:c.statusCode)===500?Zz:null,p=Ch({hash:t,chainId:a,type:"/address"}),w=Ch({hash:t,chainId:r,type:"/address"});return k.jsxs(k.Fragment,{children:[k.jsx(lh,{size:"sm",variant:"outline",width:"100%",borderRadius:"sm",children:k.jsxs(ch,{children:[k.jsxs(so,{children:[k.jsx(ln,{children:"Source"}),k.jsx(ln,{display:"flex",textAlign:"end",justifyContent:"end",children:k.jsx(ye,{display:"flex",gap:"8px",alignItems:"center",children:h?k.jsxs(k.Fragment,{children:[k.jsx(pr,{src:JE,width:"16px",height:"16px"}),k.jsx(Ge,{children:"Binance"})]}):k.jsxs(k.Fragment,{children:[typeof e=="string"?k.jsx(pr,{src:e,width:"16px",height:"16px"}):e,k.jsx(hh,{content:n,children:k.jsx(Ge,{children:t&&n+" "+um(t,!0)})}),p&&k.jsx(M2,{href:p,target:"_blank",children:k.jsx(Lt,{as:U2,color:"fg.muted",width:"16px",height:"16px"})})]})})})]}),k.jsxs(so,{children:[k.jsx(ln,{children:"Destination"}),k.jsx(ln,{display:"flex",textAlign:"end",justifyContent:"end",children:k.jsx(io,{loading:g,width:g?"80px":"auto",children:k.jsxs(ro,{gap:"8px",alignItems:"center",children:[k.jsx(pr,{src:dm(r),width:"16px",height:"16px"}),k.jsx(Ge,{children:kh(r)})," - ",k.jsx(hh,{content:n,children:k.jsx(Ge,{children:t&&um(t)})}),w&&k.jsx(M2,{href:w,target:"_blank",children:k.jsx(Lt,{as:U2,color:"fg.muted",width:"16px",height:"16px"})})]})})})]}),k.jsxs(so,{children:[k.jsx(ln,{children:"Estimated time"}),k.jsx(ln,{display:"flex",textAlign:"end",justifyContent:"end",children:k.jsx(io,{loading:g,width:g?"80px":"auto",children:k.jsx(Ge,{children:h?"~2min":a!==r?"~1 min":"instant"})})})]})]})},"line"),b?k.jsx(Ge,{fontSize:"xs",color:"error",children:b}):k.jsx(lh,{size:"sm",variant:"outline",bg:"bg.subtle",children:k.jsxs(ch,{children:[k.jsxs(so,{children:[k.jsx(ln,{children:"You send"}),k.jsx(ln,{display:"flex",textAlign:"end",justifyContent:"end",children:k.jsxs(ye,{display:"flex",gap:"8px",alignItems:"center",children:[k.jsxs(Ge,{children:[fo(ts(s,o==null?void 0:o.decimals))," ",o==null?void 0:o.symbol]}),k.jsx(eS,{token:o,chainId:a,size:24})]})})]}),k.jsxs(so,{children:[k.jsx(ln,{children:"You receive"}),k.jsxs(ln,{display:"flex",textAlign:"end",justifyContent:"end",children:[" ",k.jsx(io,{loading:g,width:g?"156px":"auto",children:k.jsxs(ye,{display:"flex",gap:"8px",alignItems:"center",children:[k.jsxs(Ge,{children:[fo(ts(c==null?void 0:c.amountOut,i==null?void 0:i.decimals))," ",i==null?void 0:i.symbol]}),k.jsx(eS,{token:i,chainId:r,size:24})]})})]})]})]})},"line")]})},nU=()=>{const{handleClose:t,setStep:e}=J.useContext(Ba),{chainIdIn:n}=Jr(),{routeLoading:r,usdAmountIn:i,routeData:o}=Ml(),s=Xe.useChainId(),{switchChain:a}=Xe.useSwitchChain(),l=s!==n;return k.jsxs(k.Fragment,{children:[k.jsx(_n.Header,{children:k.jsxs(Du,{children:[k.jsx(er,{minWidth:"16px",minHeight:"16px",maxWidth:"16px",onClick:()=>{e("selectAmount")},children:k.jsx(Lt,{as:Vu,color:"gray",width:"16px",height:"16px"})}),k.jsx(ye,{display:"flex",flexDirection:"column",gap:"4px",children:k.jsx(qo,{children:"Deposit"})}),t&&k.jsx(er,{onClick:t,width:"40px",marginLeft:"auto",children:k.jsx(Lt,{as:ta,color:"gray",width:"16px",height:"16px"})})]})}),k.jsx(_n.Body,{children:k.jsxs(gr,{children:[k.jsxs(ro,{flexDirection:"column",gap:"16px",alignItems:"center",width:"100%",children:[k.jsx(io,{loading:r,width:r?"156px":"auto",children:k.jsx(ph,{readOnly:!0,marginY:"8px",variant:"text",placeholder:"$10.00",value:i})}),k.jsx(Oh,{})]}),k.jsx(Ih,{}),l?k.jsxs(Fn,{onClick:()=>{a({chainId:n})},children:["Switch to ",kh(n)]}):k.jsx(Fn,{disabled:!!(o!=null&&o.error),visual:r?"lightGray":"solid",onClick:r?()=>{}:()=>{e("confirmTransfer")},children:r?"Loading quote":"Continue"})]})})]})},rU=We("div",{base:{w:"58px",h:"58px",borderRadius:"full",border:"1px solid",borderColor:"border",display:"flex",alignItems:"center",justifyContent:"center"}}),tS=({onFinish:t,start:e,duration:n=60})=>{const[r,i]=J.useState(n);J.useEffect(()=>{i(n)},[n]),J.useEffect(()=>{if(!e)return;const s=setInterval(()=>{i(a=>a<=1?(clearInterval(s),t==null||t(),0):a-1)},1e3);return()=>clearInterval(s)},[e,t]);const o=s=>{const a=Math.floor(s/60).toString().padStart(2,"0"),l=(s%60).toString().padStart(2,"0");return`${a}:${l}`};return k.jsx(sh,{children:k.jsx(rU,{children:k.jsx(Ge,{fontSize:"xs",color:"fg.muted",fontWeight:"medium",children:o(r)})})})},iU="data:image/svg+xml,%3csvg%20width='20'%20height='20'%20viewBox='0%200%2020%2020'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3crect%20x='1'%20y='1'%20width='18'%20height='18'%20rx='9'%20stroke='white'%20stroke-width='2'/%3e%3cpath%20d='M17.7589%2011.9352C16.6904%2016.221%2012.3496%2018.8292%208.06336%2017.7605C3.77889%2016.692%201.17066%2012.351%202.23959%208.06558C3.30758%203.77935%207.64835%201.17093%2011.9333%202.23939C16.2192%203.30785%2018.8273%207.64936%2017.7587%2011.9353L17.7588%2011.9352H17.7589Z'%20fill='%2314AE5C'/%3e%3cpath%20d='M11.9997%204.66675C12.3679%204.66675%2012.6663%204.96522%2012.6663%205.33341C12.6663%205.7016%2012.3679%206.00008%2011.9997%206.00008H7.99967C7.63148%206.00008%207.33301%205.7016%207.33301%205.33341C7.33301%204.96522%207.63148%204.66675%207.99967%204.66675H11.9997Z'%20fill='white'/%3e%3cpath%20d='M12.0003%207.33325C12.3685%207.33325%2012.667%207.63173%2012.667%207.99992V9.33325H14.667C14.9366%209.33325%2015.1797%209.49564%2015.2829%209.74471C15.386%209.99383%2015.329%2010.2806%2015.1383%2010.4713L10.4717%2015.1379C10.2113%2015.3983%209.7893%2015.3983%209.52895%2015.1379L4.86229%2010.4713C4.67162%2010.2806%204.61457%209.99383%204.71775%209.74471C4.82096%209.49564%205.06403%209.33325%205.33364%209.33325H7.33364V7.99992C7.33364%207.63173%207.63212%207.33325%208.00031%207.33325H12.0003ZM8.66697%209.99992C8.66697%2010.3681%208.3685%2010.6666%208.00031%2010.6666H6.94301L10.0003%2013.7239L13.0576%2010.6666H12.0003C11.6321%2010.6666%2011.3336%2010.3681%2011.3336%209.99992V8.66659H8.66697V9.99992Z'%20fill='white'/%3e%3c/svg%3e",oU=We(pr,{base:{boxSize:"36px",borderRadius:"full",objectFit:"contain"}}),sU=We(pr,{base:{boxSize:"16px",position:"absolute",bottom:"-2px",right:"-2px",borderRadius:"full",border:"1px solid",borderColor:"bg",objectFit:"contain"}}),aU=({onClose:t,currencyIcon:e})=>{const n=()=>{const r=new Date,i=r.toLocaleString("en-US",{month:"short"}),o=r.toLocaleTimeString("en-US",{hour12:!1,hour:"2-digit",minute:"2-digit",second:"2-digit"});return`${i} - ${o}`};return k.jsxs(ye,{border:"1px solid",borderColor:"border.subtle",borderRadius:"12px",width:"100%",bg:"bg",children:[k.jsxs(ye,{display:"flex",alignItems:"center",gap:"12px",borderBottom:"1px solid",borderColor:"border.subtle",padding:"10px 16px",children:[k.jsxs(ye,{position:"relative",children:[k.jsx(oU,{src:e,alt:"Currency icon"}),k.jsx(sU,{src:iU,alt:"deposit icon"})]}),k.jsxs(ye,{flex:"1",children:[k.jsx(Ge,{fontSize:"lg",fontWeight:"semibold",color:"fg",marginBottom:"4px",children:"Deposit processing"}),k.jsx(Ge,{fontSize:"sm",color:"fg.muted",lineHeight:"1.4",children:"Your deposit will be added to your account soon."})]}),t&&k.jsx(Lt,{as:ta,width:"16px",height:"16px",color:"fg.subtle",cursor:"pointer",_hover:{color:"fg.muted"},onClick:t})]}),k.jsxs(ye,{display:"flex",justifyContent:"space-between",alignItems:"center",padding:"10px 16px",children:[k.jsx(Ge,{fontSize:"sm",color:"fg.muted",children:"Order started"}),k.jsx(Ge,{fontSize:"sm",color:"fg",fontWeight:"medium",children:n()})]})]})},Ll=nE(t=>({txs:[],addTx:e=>t(n=>({txs:[...n.txs,e]})),removeTx:e=>t(n=>({txs:n.txs.filter(r=>r.hash!==e)})),updateTx:(e,n)=>t(r=>({txs:r.txs.map(i=>i.hash===e?{...i,...n}:i)}))})),lU=t=>{const{txs:e}=Ll();return e.find(n=>n.hash===t)},cU=()=>{const{addTx:t}=Ll();return{track:J.useCallback(n=>{n.hash&&t(n)},[])}},uU=(t,e)=>{const n=Ll(i=>i.updateTx),{data:r}=Ki.useQuery({queryKey:["layerZeroUrl",t||"none",!!e],queryFn:async()=>t?fetch(`https://scan.layerzero-api.com/v1/messages/tx/${t}`).then(i=>i.json()).then(i=>i.data[0]):null,refetchInterval:2e3,enabled:!!(e&&t)});J.useEffect(()=>{var i,o,s,a;t&&((i=r==null?void 0:r.source)!=null&&i.status&&r.source.status!=="SUCCEEDED"?n(t,{status:"(1/4) Waiting for funds to be sent on destination"}):((o=r==null?void 0:r.status)==null?void 0:o.name)==="DELIVERED"?(e==null||e(),n(t,{status:"(4/4) Bridging is complete",isActive:!1})):((s=r==null?void 0:r.status)==null?void 0:s.name)==="CONFIRMING"?n(t,{status:"(3/4) Waiting for destination execution"}):((a=r==null?void 0:r.status)==null?void 0:a.name)==="INFLIGHT"&&n(t,{status:"(2/4) Waiting for funds to be delivered on destination"}))},[r,t])},dU=(t,e,n,r,i)=>{const o=Ch({hash:t,chainId:e}),s=Ll(a=>a.updateTx);J.useEffect(()=>{i&&(r.error?s(t,{status:"Transaction Failed",isActive:!1}):r.data&&(i==null||i(),s(t,{status:"Transaction Confirmed",isActive:!1})))},[r.data,r.error,r.isLoading,n,o,i])},fU=({hash:t,chainId:e,message:n="Transaction confirmed",onConfirmed:r})=>{const{removeTx:i}=Ll(),o=Xe.useWaitForTransactionReceipt({hash:t,chainId:e});return J.useEffect(()=>{o.data&&(r==null||r(o.data))},[o.data,r]),dU(t,e,n,o,()=>i(t)),null},hU=({hash:t,chainId:e,onConfirmed:n})=>{const r=Xe.useWaitForTransactionReceipt({hash:t,chainId:e});return uU(r.data?t:void 0,()=>n==null?void 0:n(r.data)),null},pU=t=>t.crosschain?k.jsx(hU,{...t}):k.jsx(fU,{...t}),gU=()=>{const{txs:t}=Ll();return k.jsx(k.Fragment,{children:t.filter(e=>e.isActive).map(e=>k.jsx(pU,{...e},e.hash))})},nS="data:image/svg+xml,%3csvg%20width='58'%20height='58'%20viewBox='0%200%2058%2058'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3ccircle%20cx='29'%20cy='29'%20r='29'%20fill='%2314AE5C'/%3e%3cpath%20d='M36.2929%2022.2929C36.6834%2021.9024%2037.3164%2021.9024%2037.707%2022.2929C38.0975%2022.6834%2038.0975%2023.3164%2037.707%2023.707L26.707%2034.707C26.3164%2035.0975%2025.6834%2035.0975%2025.2929%2034.707L20.2929%2029.707C19.9024%2029.3164%2019.9024%2028.6834%2020.2929%2028.2929C20.659%2027.9268%2021.238%2027.9042%2021.6308%2028.2245L21.707%2028.2929L25.9999%2032.5859L36.2929%2022.2929Z'%20fill='white'/%3e%3c/svg%3e",rS="data:image/svg+xml,%3csvg%20width='58'%20height='58'%20viewBox='0%200%2058%2058'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3ccircle%20cx='29'%20cy='29'%20r='29'%20fill='%23E84142'/%3e%3cpath%20d='M34.2929%2022.2929C34.6834%2021.9024%2035.3164%2021.9024%2035.707%2022.2929C36.0975%2022.6834%2036.0975%2023.3164%2035.707%2023.707L23.707%2035.707C23.3164%2036.0975%2022.6834%2036.0975%2022.2929%2035.707C21.9024%2035.3164%2021.9024%2034.6834%2022.2929%2034.2929L34.2929%2022.2929Z'%20fill='white'/%3e%3cpath%20d='M22.2929%2022.2929C22.6834%2021.9024%2023.3164%2021.9024%2023.707%2022.2929L35.707%2034.2929L35.7753%2034.3691C36.0957%2034.7618%2036.0731%2035.3408%2035.707%2035.707C35.3408%2036.0731%2034.7618%2036.0957%2034.3691%2035.7753L34.2929%2035.707L22.2929%2023.707C21.9024%2023.3164%2021.9024%2022.6834%2022.2929%2022.2929Z'%20fill='white'/%3e%3c/svg%3e",mU=()=>{var d;const{chainIdIn:t,tokenIn:e,amountIn:n}=Jr(),{address:r}=Xe.useAccount(),{approveData:i,approveFetched:o}=dz({address:r,token:e,chainId:t,amount:n}),{routeData:s,routeFetched:a}=Ml(),{approveNeeded:l,allowanceFetched:c}=Dz(e,(d=i==null?void 0:i.tx)==null?void 0:d.to,n);return{calls:J.useMemo(()=>!c||!a||!o?[]:l?[i==null?void 0:i.tx,s==null?void 0:s.tx]:[s==null?void 0:s.tx],[l,c,a,i,s,o]),approveNeeded:l}},yU=()=>{const{handleClose:t,setFlow:e,setStep:n}=J.useContext(Ba),[r,i]=J.useState("idle"),[o,s]=J.useState(!1),{address:a}=Xe.useAccount(),[l,c]=J.useState(""),[u,d]=J.useState(!1),{chainIdIn:h,chainIdOut:g}=Jr(),{calls:b}=mU(),{sendTxns:p,ready:w}=$z({calls:b,address:a,chainId:h}),{track:S}=cU(),O=h!==g,T=J.useCallback(f=>{i("processing"),c(f),S({hash:f,isActive:!0,chainId:h,crosschain:O,status:O?"(0/4) Waiting for source transaction completion":"Transaction in progess",message:"Transaction confirmed",onConfirmed:()=>{i("success")}})},[h,g]),$=J.useCallback(f=>{console.error(f),i("failed")},[]);J.useEffect(()=>{!u&&w&&(p(T,$),d(!0))},[u,w,p,T]);const R=()=>{s(!0)},j=()=>{e("mainFlow"),n("selectToken")},q=()=>{e("mainFlow"),n("quote")},G=lU(l),L=O?`https://layerzeroscan.com/tx/${l}`:Ch({hash:l,chainId:h}),V=()=>{switch(r){case"success":return"#14AE5C";case"failed":return"#E84142";default:return"#1E171F"}},W=()=>{switch(r){case"success":return"Success";case"failed":return"Failed";case"idle":return"Awaiting wallet approval";default:return G==null?void 0:G.status}},z=()=>{switch(r){case"processing":case"idle":return k.jsx(tS,{start:r==="processing",onFinish:R});case"success":return k.jsx(ye,{display:"flex",flexDirection:"column",alignItems:"center",children:k.jsx(pr,{src:nS,boxShadow:"0px 0px 20px #14AE5C",borderRadius:"90%",width:"58px",height:"58px"})});case"failed":return k.jsx(ye,{display:"flex",flexDirection:"column",alignItems:"center",children:k.jsx(pr,{src:rS,boxShadow:"0px 0px 20px #E84142",borderRadius:"90%",width:"58px",height:"58px"})})}},C=()=>r==="processing"&&o?k.jsxs(ye,{display:"flex",flexDirection:"column",alignItems:"center",marginTop:"16px",textAlign:"center",children:[k.jsx(Ge,{fontSize:"lg",fontWeight:"semibold",color:"fg",marginBottom:"8px",children:"Deposit pending"}),k.jsx(Ge,{fontSize:"sm",color:"fg.muted",maxWidth:"280px",children:"Your deposit is still in progress – no action is required from you."})]}):null;return k.jsxs(k.Fragment,{children:[k.jsx(_n.Header,{children:k.jsxs(Du,{children:[k.jsx(er,{minWidth:"16px",minHeight:"16px",maxWidth:"16px",onClick:()=>{e("mainFlow"),n("quote")},children:k.jsx(Lt,{as:Vu,color:"gray",width:"16px",height:"16px"})}),k.jsx(ye,{display:"flex",flexDirection:"column",gap:"4px",children:k.jsx(qo,{children:"Top up your wallet"})}),t&&k.jsx(er,{onClick:t,width:"40px",marginLeft:"auto",children:k.jsx(Lt,{as:ta,color:"gray",width:"16px",height:"16px"})})]})}),k.jsx(_n.Body,{children:k.jsxs(gr,{children:[k.jsxs(ye,{display:"flex",flexDirection:"column",paddingBottom:"16px",alignItems:"center",width:"100%",children:[z(),C()]}),k.jsx(lh,{size:"sm",variant:"outline",width:"100%",children:k.jsxs(ch,{children:[k.jsxs(so,{children:[k.jsx(ln,{children:"Status"}),k.jsx(ln,{display:"flex",textAlign:"end",justifyContent:"end",children:k.jsx(Ge,{color:V(),children:W()})})]}),["success","processing"].includes(r)&&k.jsxs(so,{children:[k.jsx(ln,{children:"Transaction"}),k.jsx(ln,{display:"flex",textAlign:"end",justifyContent:"end",children:L?k.jsx("a",{href:L,target:"_blank",rel:"noreferrer",children:k.jsxs(Ge,{color:"blue.500",children:["View on"," ",O?"LayerZero":"Etherscan"]})}):k.jsx(Ge,{children:"-"})})]})]})},"status"),k.jsx(Oh,{}),r==="processing"?k.jsx(aU,{currencyIcon:dm(g)}):k.jsx(Ih,{}),r==="success"&&k.jsxs(ye,{display:"flex",gap:"12px",width:"100%",children:[k.jsx(Fn,{visual:"lightGray",onClick:t,children:"Close"}),k.jsx(Fn,{visual:"solid",onClick:j,children:"New Deposit"})]}),r==="failed"&&k.jsxs(ye,{display:"flex",gap:"12px",width:"100%",children:[k.jsx(Fn,{visual:"lightGray",onClick:t,children:"Close"}),k.jsx(Fn,{visual:"solid",onClick:q,children:"Retry Deposit"})]})]})})]})};function bU(t){const{authorization:e,factory:n,factoryData:r}=t;if(n==="0x7702"||n==="0x7702000000000000000000000000000000000000"){if(!e)return"0x7702000000000000000000000000000000000000";const i=e.address;return Xr([i,r!=null?r:"0x"])}return n?Xr([n,r!=null?r:"0x"]):"0x"}function vU(t){var O,T;const{callGasLimit:e,callData:n,maxPriorityFeePerGas:r,maxFeePerGas:i,paymaster:o,paymasterData:s,paymasterPostOpGasLimit:a,paymasterVerificationGasLimit:l,sender:c,signature:u="0x",verificationGasLimit:d}=t,h=Xr([Rr(mr(d||BigInt(0)),{size:16}),Rr(mr(e||BigInt(0)),{size:16})]),g=bU(t),b=Xr([Rr(mr(r||BigInt(0)),{size:16}),Rr(mr(i||BigInt(0)),{size:16})]),p=(O=t.nonce)!=null?O:BigInt(0),w=o?Xr([o,Rr(mr(l||BigInt(0)),{size:16}),Rr(mr(a||BigInt(0)),{size:16}),s||"0x"]):"0x",S=(T=t.preVerificationGas)!=null?T:BigInt(0);return{accountGasLimits:h,callData:n,initCode:g,gasFees:b,nonce:p,paymasterAndData:w,preVerificationGas:S,sender:c,signature:u}}function wU(t){const{chainId:e,entryPointAddress:n}=t,r=t.userOperation,{authorization:i,callData:o="0x",callGasLimit:s,maxFeePerGas:a,maxPriorityFeePerGas:l,nonce:c,paymasterAndData:u="0x",preVerificationGas:d,sender:h,verificationGasLimit:g}=r,b=(()=>{{const p=vU(r);return LE([{type:"address"},{type:"uint256"},{type:"bytes32"},{type:"bytes32"},{type:"bytes32"},{type:"uint256"},{type:"bytes32"},{type:"bytes32"}],[p.sender,p.nonce,Bl(p.initCode),Bl(p.callData),p.accountGasLimits,p.preVerificationGas,p.gasFees,Bl(p.paymasterAndData)])}})();return Bl(LE([{type:"bytes32"},{type:"address"},{type:"uint256"}],[Bl(b),n,BigInt(e)]))}var xU=["integrationConnected","integrationConnectionError","integrationMfaRequired","integrationMfaEntered","integrationOAuthStarted","integrationAccountSelectionRequired","transferCompleted","integrationSelected","credentialsEntered","transferStarted","transferPreviewed","transferPreviewError","transferExecutionError","pageLoaded","transferAssetSelected","transferNetworkSelected","transferAmountEntered","transferMfaRequired","transferMfaEntered","transferKycRequired","transferExecuted","transferInitiated","transferNoEligibleAssets","walletMessageSigned","verifyDonePage","verifyWalletRejected","connectionDeclined","transferConfigureError","connectionUnavailable","transferDeclined","done","close","SDKinjectedWalletProviders","legalTermsViewed","seeWhatHappenedClicked","executeFundingStep","fundingOptionsUpdated","fundingOptionsViewed","gasIncreaseWarning"];function EU(t){return xU.includes(t)}function SU(t){try{var e=new URLSearchParams(new URL(t).search),n=e.get("link_style");return n&&JSON.parse(window.atob(n))}catch(r){return}}function fm(t,e){return e!==void 0?e:t}var hm="mesh-link-popup",iS="mesh-link-popup__backdrop",Fl="mesh-link-popup__popup-content",oS="mesh-link-popup__styles",pm="mesh-link-popup__iframe",AU=function(t){return`
116
+ body {
117
+ position: fixed;
118
+ left: 0;
119
+ top: 0;
120
+ bottom: 0;
121
+ right: 0;
122
+ overflow: hidden;
123
+ }
124
+
125
+ #`.concat(hm,` {
126
+ all: unset;
127
+ position: fixed;
128
+ left: 0;
129
+ top: 0;
130
+ bottom: 0;
131
+ right: 0;
132
+ display: flex;
133
+ flex-direction: column;
134
+ align-items: center;
135
+ justify-content: center;
136
+ z-index: 10000;
137
+ }
138
+
139
+ #`).concat(iS,` {
140
+ position: absolute;
141
+ left: 0;
142
+ top: 0;
143
+ bottom: 0;
144
+ right: 0;
145
+ z-index: 10000;
146
+ background: black;
147
+ opacity: `).concat(fm(.6,t==null?void 0:t.io),`;
148
+ }
149
+
150
+ #`).concat(Fl,` {
151
+ position: absolute;
152
+ height: 80%;
153
+ max-height: 710px;
154
+ min-height: 685px;
155
+ margin: auto;
156
+ z-index: 10001;
157
+ width: 30%;
158
+ max-width: 430px;
159
+ min-width: 380px;
160
+ display: flex;
161
+ flex-direction: column;
162
+ border-radius: `).concat(fm(24,t==null?void 0:t.ir),`px;
163
+ flex-grow: 1;
164
+ }
165
+
166
+ #`).concat(Fl,` iframe {
167
+ border: none;
168
+ width: 100%;
169
+ flex-grow: 1;
170
+ border-radius: `).concat(fm(24,t==null?void 0:t.ir),`px;
171
+ }
172
+
173
+ @media only screen and (max-width: 768px) {
174
+ #`).concat(Fl,` {
175
+ height: 100vh;
176
+ width: 100vw;
177
+ max-width: 100%;
178
+ min-width: 100%;
179
+ max-height: 100%;
180
+ min-height: 100%;
181
+ border-radius: 0px;
182
+ }
183
+
184
+ #`).concat(Fl,` iframe {
185
+ border-radius: 0px;
186
+ }
187
+ }
188
+
189
+ @media only screen and (max-height: 710px) {
190
+ #`).concat(Fl,` {
191
+ max-height: 100%;
192
+ min-height: 100%;
193
+ }
194
+ }
195
+ `)};function gm(){var t,e,n=window.document.getElementById(hm);(t=n==null?void 0:n.parentElement)===null||t===void 0||t.removeChild(n);var r=window.document.getElementById(oS);(e=r==null?void 0:r.parentElement)===null||e===void 0||e.removeChild(r)}function kU(t){gm();var e=document.createElement("style");e.id=oS;var n=SU(t);e.textContent=AU(n),window.document.head.appendChild(e);var r=document.createElement("div");r.id=hm;var i=document.createElement("div");i.id=iS,r.appendChild(i);var o=document.createElement("div");o.id=Fl;var s=document.createElement("iframe");s.id=pm,s.src=t,s.allow="clipboard-read *; clipboard-write *",o.appendChild(s),r.appendChild(o),window.document.body.appendChild(r)}var CU=["walletBrowserInjectedWalletSelected","walletBrowserSignRequest","walletBrowserChainSwitchRequest","walletBrowserTransferBalanceRequest","walletBrowserNativeTransferRequest","walletBrowserNonNativeTransferRequest","walletBrowserNativeSmartDeposit","walletBrowserNonNativeSmartDeposit","walletBrowserDisconnect","walletBrowserTransactionBatchRequest","walletBrowserWalletCapabilities","walletBrowserSolanaTransferWithInstructionsRequest"];function IU(t){return CU.includes(t)}var OU="3.2.14",TU={platform:"web",version:OU,origin:window.location.origin},sS=function(){function t(){}return t.prototype.handleError=function(e,n){return console.error("".concat(n," error:"),e),e instanceof Error?e:new Error("Failed to ".concat(n))},t.prototype.isUserRejection=function(e){var n;if(!e)return!1;var r=((n=e.message)===null||n===void 0?void 0:n.toLowerCase())||"",i=[4001,-32603];return r.includes("user rejected")||r.includes("declined")||r.includes("cancelled")||i.includes(e.code)},t}();const PU="6.15.0";function NU(t,e,n){const r=e.split("|").map(o=>o.trim());for(let o=0;o<r.length;o++)switch(e){case"any":return;case"bigint":case"boolean":case"number":case"string":if(typeof t===e)return}const i=new Error(`invalid value for type ${e}`);throw i.code="INVALID_ARGUMENT",i.argument=`value.${n}`,i.value=t,i}async function Vn(t){const e=Object.keys(t);return(await Promise.all(e.map(r=>Promise.resolve(t[r])))).reduce((r,i,o)=>(r[e[o]]=i,r),{})}function Te(t,e,n){for(let r in e){let i=e[r];const o=n?n[r]:null;o&&NU(i,o,r),Object.defineProperty(t,r,{enumerable:!0,value:i,writable:!1})}}function _l(t,e){if(t==null)return"null";if(e==null&&(e=new Set),typeof t=="object"){if(e.has(t))return"[Circular]";e.add(t)}if(Array.isArray(t))return"[ "+t.map(n=>_l(n,e)).join(", ")+" ]";if(t instanceof Uint8Array){const n="0123456789abcdef";let r="0x";for(let i=0;i<t.length;i++)r+=n[t[i]>>4],r+=n[t[i]&15];return r}if(typeof t=="object"&&typeof t.toJSON=="function")return _l(t.toJSON(),e);switch(typeof t){case"boolean":case"number":case"symbol":return t.toString();case"bigint":return BigInt(t).toString();case"string":return JSON.stringify(t);case"object":{const n=Object.keys(t);return n.sort(),"{ "+n.map(r=>`${_l(r,e)}: ${_l(t[r],e)}`).join(", ")+" }"}}return"[ COULD NOT SERIALIZE ]"}function bn(t,e){return t&&t.code===e}function mm(t){return bn(t,"CALL_EXCEPTION")}function bt(t,e,n){let r=t;{const o=[];if(n){if("message"in n||"code"in n||"name"in n)throw new Error(`value will overwrite populated values: ${_l(n)}`);for(const s in n){if(s==="shortMessage")continue;const a=n[s];o.push(s+"="+_l(a))}}o.push(`code=${e}`),o.push(`version=${PU}`),o.length&&(t+=" ("+o.join(", ")+")")}let i;switch(e){case"INVALID_ARGUMENT":i=new TypeError(t);break;case"NUMERIC_FAULT":case"BUFFER_OVERRUN":i=new RangeError(t);break;default:i=new Error(t)}return Te(i,{code:e}),n&&Object.assign(i,n),i.shortMessage==null&&Te(i,{shortMessage:r}),i}function fe(t,e,n,r){if(!t)throw bt(e,n,r)}function ne(t,e,n,r){fe(t,e,"INVALID_ARGUMENT",{argument:n,value:r})}function aS(t,e,n){n==null&&(n=""),n&&(n=": "+n),fe(t>=e,"missing argument"+n,"MISSING_ARGUMENT",{count:t,expectedCount:e}),fe(t<=e,"too many arguments"+n,"UNEXPECTED_ARGUMENT",{count:t,expectedCount:e})}["NFD","NFC","NFKD","NFKC"].reduce((t,e)=>{try{if("test".normalize(e)!=="test")throw new Error("bad");if(e==="NFD"&&"é".normalize("NFD")!=="é")throw new Error("broken");t.push(e)}catch(n){}return t},[]);function Th(t,e,n){if(n==null&&(n=""),t!==e){let r=n,i="new";n&&(r+=".",i+=" "+n),fe(!1,`private constructor; use ${r}from* methods`,"UNSUPPORTED_OPERATION",{operation:i})}}function lS(t,e,n){if(t instanceof Uint8Array)return n?new Uint8Array(t):t;if(typeof t=="string"&&t.match(/^0x(?:[0-9a-f][0-9a-f])*$/i)){const r=new Uint8Array((t.length-2)/2);let i=2;for(let o=0;o<r.length;o++)r[o]=parseInt(t.substring(i,i+2),16),i+=2;return r}ne(!1,"invalid BytesLike value",e||"value",t)}function Ue(t,e){return lS(t,e,!1)}function Dn(t,e){return lS(t,e,!0)}function pt(t,e){return!(typeof t!="string"||!t.match(/^0x[0-9A-Fa-f]*$/)||typeof e=="number"&&t.length!==2+2*e||e===!0&&t.length%2!==0)}function ym(t){return pt(t,!0)||t instanceof Uint8Array}const cS="0123456789abcdef";function ve(t){const e=Ue(t);let n="0x";for(let r=0;r<e.length;r++){const i=e[r];n+=cS[(i&240)>>4]+cS[i&15]}return n}function xt(t){return"0x"+t.map(e=>ve(e).substring(2)).join("")}function Vl(t){return pt(t,!0)?(t.length-2)/2:Ue(t).length}function Et(t,e,n){const r=Ue(t);return n!=null&&n>r.length&&fe(!1,"cannot slice beyond data bounds","BUFFER_OVERRUN",{buffer:r,length:r.length,offset:n}),ve(r.slice(e==null?0:e,n==null?r.length:n))}function uS(t,e,n){const r=Ue(t);fe(e>=r.length,"padding exceeds data length","BUFFER_OVERRUN",{buffer:new Uint8Array(r),length:e,offset:e+1});const i=new Uint8Array(e);return i.fill(0),n?i.set(r,e-r.length):i.set(r,0),ve(i)}function ho(t,e){return uS(t,e,!0)}function BU(t,e){return uS(t,e,!1)}const Ph=BigInt(0),Zr=BigInt(1),Dl=9007199254740991;function RU(t,e){const n=Nh(t,"value"),r=BigInt($e(e,"width"));if(fe(n>>r===Ph,"overflow","NUMERIC_FAULT",{operation:"fromTwos",fault:"overflow",value:t}),n>>r-Zr){const i=(Zr<<r)-Zr;return-((~n&i)+Zr)}return n}function dS(t,e){let n=Se(t,"value");const r=BigInt($e(e,"width")),i=Zr<<r-Zr;if(n<Ph){n=-n,fe(n<=i,"too low","NUMERIC_FAULT",{operation:"toTwos",fault:"overflow",value:t});const o=(Zr<<r)-Zr;return(~n&o)+Zr}else fe(n<i,"too high","NUMERIC_FAULT",{operation:"toTwos",fault:"overflow",value:t});return n}function Ku(t,e){const n=Nh(t,"value"),r=BigInt($e(e,"bits"));return n&(Zr<<r)-Zr}function Se(t,e){switch(typeof t){case"bigint":return t;case"number":return ne(Number.isInteger(t),"underflow",e||"value",t),ne(t>=-Dl&&t<=Dl,"overflow",e||"value",t),BigInt(t);case"string":try{if(t==="")throw new Error("empty string");return t[0]==="-"&&t[1]!=="-"?-BigInt(t.substring(1)):BigInt(t)}catch(n){ne(!1,`invalid BigNumberish string: ${n.message}`,e||"value",t)}}ne(!1,"invalid BigNumberish value",e||"value",t)}function Nh(t,e){const n=Se(t,e);return fe(n>=Ph,"unsigned value cannot be negative","NUMERIC_FAULT",{fault:"overflow",operation:"getUint",value:t}),n}const fS="0123456789abcdef";function bm(t){if(t instanceof Uint8Array){let e="0x0";for(const n of t)e+=fS[n>>4],e+=fS[n&15];return BigInt(e)}return Se(t)}function $e(t,e){switch(typeof t){case"bigint":return ne(t>=-Dl&&t<=Dl,"overflow",e||"value",t),Number(t);case"number":return ne(Number.isInteger(t),"underflow",e||"value",t),ne(t>=-Dl&&t<=Dl,"overflow",e||"value",t),t;case"string":try{if(t==="")throw new Error("empty string");return $e(BigInt(t),e)}catch(n){ne(!1,`invalid numeric string: ${n.message}`,e||"value",t)}}ne(!1,"invalid numeric value",e||"value",t)}function MU(t){return $e(bm(t))}function ns(t,e){let r=Nh(t,"value").toString(16);if(e==null)r.length%2&&(r="0"+r);else{const i=$e(e,"width");for(fe(i*2>=r.length,`value exceeds width (${i} bytes)`,"NUMERIC_FAULT",{operation:"toBeHex",fault:"overflow",value:t});r.length<i*2;)r="0"+r}return"0x"+r}function nn(t){const e=Nh(t,"value");if(e===Ph)return new Uint8Array([]);let n=e.toString(16);n.length%2&&(n="0"+n);const r=new Uint8Array(n.length/2);for(let i=0;i<r.length;i++){const o=i*2;r[i]=parseInt(n.substring(o,o+2),16)}return r}function ei(t){let e=ve(ym(t)?t:nn(t)).substring(2);for(;e.startsWith("0");)e=e.substring(1);return e===""&&(e="0"),"0x"+e}const hS="123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz";BigInt(0);const pS=BigInt(58);function LU(t){const e=Ue(t);let n=bm(e),r="";for(;n;)r=hS[Number(n%pS)]+r,n/=pS;for(let i=0;i<e.length&&!e[i];i++)r=hS[0]+r;return r}function FU(t){t=atob(t);const e=new Uint8Array(t.length);for(let n=0;n<t.length;n++)e[n]=t.charCodeAt(n);return Ue(e)}function _U(t){const e=Ue(t);let n="";for(let r=0;r<e.length;r++)n+=String.fromCharCode(e[r]);return btoa(n)}class gS{constructor(e,n,r){oe(this,"filter");oe(this,"emitter");ce(this,hc);K(this,hc,n),Te(this,{emitter:e,filter:r})}async removeListener(){F(this,hc)!=null&&await this.emitter.off(this.filter,F(this,hc))}}hc=new WeakMap;function VU(t,e,n,r,i){ne(!1,`invalid codepoint at offset ${e}; ${t}`,"bytes",n)}function mS(t,e,n,r,i){if(t==="BAD_PREFIX"||t==="UNEXPECTED_CONTINUE"){let o=0;for(let s=e+1;s<n.length&&n[s]>>6===2;s++)o++;return o}return t==="OVERRUN"?n.length-e-1:0}function DU(t,e,n,r,i){return t==="OVERLONG"?(ne(typeof i=="number","invalid bad code point for replacement","badCodepoint",i),r.push(i),0):(r.push(65533),mS(t,e,n))}const zU=Object.freeze({error:VU,ignore:mS,replace:DU});function UU(t,e){e==null&&(e=zU.error);const n=Ue(t,"bytes"),r=[];let i=0;for(;i<n.length;){const o=n[i++];if(o>>7===0){r.push(o);continue}let s=null,a=null;if((o&224)===192)s=1,a=127;else if((o&240)===224)s=2,a=2047;else if((o&248)===240)s=3,a=65535;else{(o&192)===128?i+=e("UNEXPECTED_CONTINUE",i-1,n,r):i+=e("BAD_PREFIX",i-1,n,r);continue}if(i-1+s>=n.length){i+=e("OVERRUN",i-1,n,r);continue}let l=o&(1<<8-s-1)-1;for(let c=0;c<s;c++){let u=n[i];if((u&192)!=128){i+=e("MISSING_CONTINUE",i,n,r),l=null;break}l=l<<6|u&63,i++}if(l!==null){if(l>1114111){i+=e("OUT_OF_RANGE",i-1-s,n,r,l);continue}if(l>=55296&&l<=57343){i+=e("UTF16_SURROGATE",i-1-s,n,r,l);continue}if(l<=a){i+=e("OVERLONG",i-1-s,n,r,l);continue}r.push(l)}}return r}function Oi(t,e){ne(typeof t=="string","invalid string value","str",t);let n=[];for(let r=0;r<t.length;r++){const i=t.charCodeAt(r);if(i<128)n.push(i);else if(i<2048)n.push(i>>6|192),n.push(i&63|128);else if((i&64512)==55296){r++;const o=t.charCodeAt(r);ne(r<t.length&&(o&64512)===56320,"invalid surrogate pair","str",t);const s=65536+((i&1023)<<10)+(o&1023);n.push(s>>18|240),n.push(s>>12&63|128),n.push(s>>6&63|128),n.push(s&63|128)}else n.push(i>>12|224),n.push(i>>6&63|128),n.push(i&63|128)}return new Uint8Array(n)}function $U(t){return t.map(e=>e<=65535?String.fromCharCode(e):(e-=65536,String.fromCharCode((e>>10&1023)+55296,(e&1023)+56320))).join("")}function Bh(t,e){return $U(UU(t,e))}function yS(t){async function e(n,r){fe(r==null||!r.cancelled,"request cancelled before sending","CANCELLED");const i=n.url.split(":")[0].toLowerCase();fe(i==="http"||i==="https",`unsupported protocol ${i}`,"UNSUPPORTED_OPERATION",{info:{protocol:i},operation:"request"}),fe(i==="https"||!n.credentials||n.allowInsecureAuthentication,"insecure authorized connections unsupported","UNSUPPORTED_OPERATION",{operation:"request"});let o=null;const s=new AbortController,a=setTimeout(()=>{o=bt("request timeout","TIMEOUT"),s.abort()},n.timeout);r&&r.addListener(()=>{o=bt("request cancelled","CANCELLED"),s.abort()});const l=Object.assign({},t,{method:n.method,headers:new Headers(Array.from(n)),body:n.body||void 0,signal:s.signal});let c;try{c=await fetch(n.url,l)}catch(g){throw clearTimeout(a),o||g}clearTimeout(a);const u={};c.headers.forEach((g,b)=>{u[b.toLowerCase()]=g});const d=await c.arrayBuffer(),h=d==null?null:new Uint8Array(d);return{statusCode:c.status,statusMessage:c.statusText,headers:u,body:h}}return e}const HU=12,WU=250;let bS=yS();const GU=new RegExp("^data:([^;:]*)?(;base64)?,(.*)$","i"),jU=new RegExp("^ipfs://(ipfs/)?(.*)$","i");let vm=!1;async function vS(t,e){try{const n=t.match(GU);if(!n)throw new Error("invalid data");return new is(200,"OK",{"content-type":n[1]||"text/plain"},n[2]?FU(n[3]):qU(n[3]))}catch(n){return new is(599,"BAD REQUEST (invalid data: URI)",{},null,new rs(t))}}function wS(t){async function e(n,r){try{const i=n.match(jU);if(!i)throw new Error("invalid link");return new rs(`${t}${i[2]}`)}catch(i){return new is(599,"BAD REQUEST (invalid IPFS URI)",{},null,new rs(n))}}return e}const Rh={data:vS,ipfs:wS("https://gateway.ipfs.io/ipfs/")},xS=new WeakMap;class KU{constructor(e){ce(this,Ra);ce(this,xs);K(this,Ra,[]),K(this,xs,!1),xS.set(e,()=>{if(!F(this,xs)){K(this,xs,!0);for(const n of F(this,Ra))setTimeout(()=>{n()},0);K(this,Ra,[])}})}addListener(e){fe(!F(this,xs),"singal already cancelled","UNSUPPORTED_OPERATION",{operation:"fetchCancelSignal.addCancelListener"}),F(this,Ra).push(e)}get cancelled(){return F(this,xs)}checkSignal(){fe(!this.cancelled,"cancelled","CANCELLED",{})}}Ra=new WeakMap,xs=new WeakMap;function Mh(t){if(t==null)throw new Error("missing signal; should not happen");return t.checkSignal(),t}const jp=class jp{constructor(e){ce(this,_a);ce(this,pc);ce(this,gc);ce(this,ai);ce(this,Oo);ce(this,mc);ce(this,yc);ce(this,fn);ce(this,xr);ce(this,To);ce(this,Ma);ce(this,La);ce(this,Fa);ce(this,Fi);ce(this,li);ce(this,Es);K(this,yc,String(e)),K(this,pc,!1),K(this,gc,!0),K(this,ai,{}),K(this,Oo,""),K(this,mc,3e5),K(this,li,{slotInterval:WU,maxAttempts:HU}),K(this,Es,null)}get url(){return F(this,yc)}set url(e){K(this,yc,String(e))}get body(){return F(this,fn)==null?null:new Uint8Array(F(this,fn))}set body(e){if(e==null)K(this,fn,void 0),K(this,xr,void 0);else if(typeof e=="string")K(this,fn,Oi(e)),K(this,xr,"text/plain");else if(e instanceof Uint8Array)K(this,fn,e),K(this,xr,"application/octet-stream");else if(typeof e=="object")K(this,fn,Oi(JSON.stringify(e))),K(this,xr,"application/json");else throw new Error("invalid body")}hasBody(){return F(this,fn)!=null}get method(){return F(this,Oo)?F(this,Oo):this.hasBody()?"POST":"GET"}set method(e){e==null&&(e=""),K(this,Oo,String(e).toUpperCase())}get headers(){const e=Object.assign({},F(this,ai));return F(this,To)&&(e.authorization=`Basic ${_U(Oi(F(this,To)))}`),this.allowGzip&&(e["accept-encoding"]="gzip"),e["content-type"]==null&&F(this,xr)&&(e["content-type"]=F(this,xr)),this.body&&(e["content-length"]=String(this.body.length)),e}getHeader(e){return this.headers[e.toLowerCase()]}setHeader(e,n){F(this,ai)[String(e).toLowerCase()]=String(n)}clearHeaders(){K(this,ai,{})}[Symbol.iterator](){const e=this.headers,n=Object.keys(e);let r=0;return{next:()=>{if(r<n.length){const i=n[r++];return{value:[i,e[i]],done:!1}}return{value:void 0,done:!0}}}}get credentials(){return F(this,To)||null}setCredentials(e,n){ne(!e.match(/:/),"invalid basic authentication username","username","[REDACTED]"),K(this,To,`${e}:${n}`)}get allowGzip(){return F(this,gc)}set allowGzip(e){K(this,gc,!!e)}get allowInsecureAuthentication(){return!!F(this,pc)}set allowInsecureAuthentication(e){K(this,pc,!!e)}get timeout(){return F(this,mc)}set timeout(e){ne(e>=0,"timeout must be non-zero","timeout",e),K(this,mc,e)}get preflightFunc(){return F(this,Ma)||null}set preflightFunc(e){K(this,Ma,e)}get processFunc(){return F(this,La)||null}set processFunc(e){K(this,La,e)}get retryFunc(){return F(this,Fa)||null}set retryFunc(e){K(this,Fa,e)}get getUrlFunc(){return F(this,Es)||bS}set getUrlFunc(e){K(this,Es,e)}toString(){return`<FetchRequest method=${JSON.stringify(this.method)} url=${JSON.stringify(this.url)} headers=${JSON.stringify(this.headers)} body=${F(this,fn)?ve(F(this,fn)):"null"}>`}setThrottleParams(e){e.slotInterval!=null&&(F(this,li).slotInterval=e.slotInterval),e.maxAttempts!=null&&(F(this,li).maxAttempts=e.maxAttempts)}send(){return fe(F(this,Fi)==null,"request already sent","UNSUPPORTED_OPERATION",{operation:"fetchRequest.send"}),K(this,Fi,new KU(this)),be(this,_a,Wd).call(this,0,ES()+this.timeout,0,this,new is(0,"",{},null,this))}cancel(){fe(F(this,Fi)!=null,"request has not been sent","UNSUPPORTED_OPERATION",{operation:"fetchRequest.cancel"});const e=xS.get(this);if(!e)throw new Error("missing signal; should not happen");e()}redirect(e){const n=this.url.split(":")[0].toLowerCase(),r=e.split(":")[0].toLowerCase();fe(this.method==="GET"&&(n!=="https"||r!=="http")&&e.match(/^https?:/),"unsupported redirect","UNSUPPORTED_OPERATION",{operation:`redirect(${this.method} ${JSON.stringify(this.url)} => ${JSON.stringify(e)})`});const i=new jp(e);return i.method="GET",i.allowGzip=this.allowGzip,i.timeout=this.timeout,K(i,ai,Object.assign({},F(this,ai))),F(this,fn)&&K(i,fn,new Uint8Array(F(this,fn))),K(i,xr,F(this,xr)),i}clone(){const e=new jp(this.url);return K(e,Oo,F(this,Oo)),F(this,fn)&&K(e,fn,F(this,fn)),K(e,xr,F(this,xr)),K(e,ai,Object.assign({},F(this,ai))),K(e,To,F(this,To)),this.allowGzip&&(e.allowGzip=!0),e.timeout=this.timeout,this.allowInsecureAuthentication&&(e.allowInsecureAuthentication=!0),K(e,Ma,F(this,Ma)),K(e,La,F(this,La)),K(e,Fa,F(this,Fa)),K(e,li,Object.assign({},F(this,li))),K(e,Es,F(this,Es)),e}static lockConfig(){vm=!0}static getGateway(e){return Rh[e.toLowerCase()]||null}static registerGateway(e,n){if(e=e.toLowerCase(),e==="http"||e==="https")throw new Error(`cannot intercept ${e}; use registerGetUrl`);if(vm)throw new Error("gateways locked");Rh[e]=n}static registerGetUrl(e){if(vm)throw new Error("gateways locked");bS=e}static createGetUrlFunc(e){return yS(e)}static createDataGateway(){return vS}static createIpfsGatewayFunc(e){return wS(e)}};pc=new WeakMap,gc=new WeakMap,ai=new WeakMap,Oo=new WeakMap,mc=new WeakMap,yc=new WeakMap,fn=new WeakMap,xr=new WeakMap,To=new WeakMap,Ma=new WeakMap,La=new WeakMap,Fa=new WeakMap,Fi=new WeakMap,li=new WeakMap,Es=new WeakMap,_a=new WeakSet,Wd=async function(e,n,r,i,o){var u,d,h;if(e>=F(this,li).maxAttempts)return o.makeServerError("exceeded maximum retry limit");fe(ES()<=n,"timeout","TIMEOUT",{operation:"request.send",reason:"timeout",request:i}),r>0&&await YU(r);let s=this.clone();const a=(s.url.split(":")[0]||"").toLowerCase();if(a in Rh){const g=await Rh[a](s.url,Mh(F(i,Fi)));if(g instanceof is){let b=g;if(this.processFunc){Mh(F(i,Fi));try{b=await this.processFunc(s,b)}catch(p){(p.throttle==null||typeof p.stall!="number")&&b.makeServerError("error in post-processing function",p).assertOk()}}return b}s=g}this.preflightFunc&&(s=await this.preflightFunc(s));const l=await this.getUrlFunc(s,Mh(F(i,Fi)));let c=new is(l.statusCode,l.statusMessage,l.headers,l.body,i);if(c.statusCode===301||c.statusCode===302){try{const g=c.headers.location||"";return be(u=s.redirect(g),_a,Wd).call(u,e+1,n,0,i,c)}catch(g){}return c}else if(c.statusCode===429&&(this.retryFunc==null||await this.retryFunc(s,c,e))){const g=c.headers["retry-after"];let b=F(this,li).slotInterval*Math.trunc(Math.random()*Math.pow(2,e));return typeof g=="string"&&g.match(/^[1-9][0-9]*$/)&&(b=parseInt(g)),be(d=s.clone(),_a,Wd).call(d,e+1,n,b,i,c)}if(this.processFunc){Mh(F(i,Fi));try{c=await this.processFunc(s,c)}catch(g){(g.throttle==null||typeof g.stall!="number")&&c.makeServerError("error in post-processing function",g).assertOk();let b=F(this,li).slotInterval*Math.trunc(Math.random()*Math.pow(2,e));return g.stall>=0&&(b=g.stall),be(h=s.clone(),_a,Wd).call(h,e+1,n,b,i,c)}}return c};let rs=jp;const xb=class xb{constructor(e,n,r,i,o){ce(this,Pd);ce(this,Nd);ce(this,Bd);ce(this,Er);ce(this,bc);ce(this,Va);K(this,Pd,e),K(this,Nd,n),K(this,Bd,Object.keys(r).reduce((s,a)=>(s[a.toLowerCase()]=String(r[a]),s),{})),K(this,Er,i==null?null:new Uint8Array(i)),K(this,bc,o||null),K(this,Va,{message:""})}toString(){return`<FetchResponse status=${this.statusCode} body=${F(this,Er)?ve(F(this,Er)):"null"}>`}get statusCode(){return F(this,Pd)}get statusMessage(){return F(this,Nd)}get headers(){return Object.assign({},F(this,Bd))}get body(){return F(this,Er)==null?null:new Uint8Array(F(this,Er))}get bodyText(){try{return F(this,Er)==null?"":Bh(F(this,Er))}catch(e){fe(!1,"response body is not valid UTF-8 data","UNSUPPORTED_OPERATION",{operation:"bodyText",info:{response:this}})}}get bodyJson(){try{return JSON.parse(this.bodyText)}catch(e){fe(!1,"response body is not valid JSON","UNSUPPORTED_OPERATION",{operation:"bodyJson",info:{response:this}})}}[Symbol.iterator](){const e=this.headers,n=Object.keys(e);let r=0;return{next:()=>{if(r<n.length){const i=n[r++];return{value:[i,e[i]],done:!1}}return{value:void 0,done:!0}}}}makeServerError(e,n){let r;e?r=`CLIENT ESCALATED SERVER ERROR (${this.statusCode} ${this.statusMessage}; ${e})`:(e=`${this.statusCode} ${this.statusMessage}`,r=`CLIENT ESCALATED SERVER ERROR (${e})`);const i=new xb(599,r,this.headers,this.body,F(this,bc)||void 0);return K(i,Va,{message:e,error:n}),i}throwThrottleError(e,n){n==null?n=-1:ne(Number.isInteger(n)&&n>=0,"invalid stall timeout","stall",n);const r=new Error(e||"throttling requests");throw Te(r,{stall:n,throttle:!0}),r}getHeader(e){return this.headers[e.toLowerCase()]}hasBody(){return F(this,Er)!=null}get request(){return F(this,bc)}ok(){return F(this,Va).message===""&&this.statusCode>=200&&this.statusCode<300}assertOk(){if(this.ok())return;let{message:e,error:n}=F(this,Va);e===""&&(e=`server response ${this.statusCode} ${this.statusMessage}`);let r=null;this.request&&(r=this.request.url);let i=null;try{F(this,Er)&&(i=Bh(F(this,Er)))}catch(o){}fe(!1,e,"SERVER_ERROR",{request:this.request||"unknown request",response:this,error:n,info:{requestUrl:r,responseBody:i,responseStatus:`${this.statusCode} ${this.statusMessage}`}})}};Pd=new WeakMap,Nd=new WeakMap,Bd=new WeakMap,Er=new WeakMap,bc=new WeakMap,Va=new WeakMap;let is=xb;function ES(){return new Date().getTime()}function qU(t){return Oi(t.replace(/%([0-9a-f][0-9a-f])/gi,(e,n)=>String.fromCharCode(parseInt(n,16))))}function YU(t){return new Promise(e=>setTimeout(e,t))}function QU(t){let e=t.toString(16);for(;e.length<2;)e="0"+e;return"0x"+e}function SS(t,e,n){let r=0;for(let i=0;i<n;i++)r=r*256+t[e+i];return r}function AS(t,e,n,r){const i=[];for(;n<e+1+r;){const o=kS(t,n);i.push(o.result),n+=o.consumed,fe(n<=e+1+r,"child data too short","BUFFER_OVERRUN",{buffer:t,length:r,offset:e})}return{consumed:1+r,result:i}}function kS(t,e){fe(t.length!==0,"data too short","BUFFER_OVERRUN",{buffer:t,length:0,offset:1});const n=r=>{fe(r<=t.length,"data short segment too short","BUFFER_OVERRUN",{buffer:t,length:t.length,offset:r})};if(t[e]>=248){const r=t[e]-247;n(e+1+r);const i=SS(t,e+1,r);return n(e+1+r+i),AS(t,e,e+1+r,r+i)}else if(t[e]>=192){const r=t[e]-192;return n(e+1+r),AS(t,e,e+1,r)}else if(t[e]>=184){const r=t[e]-183;n(e+1+r);const i=SS(t,e+1,r);n(e+1+r+i);const o=ve(t.slice(e+1+r,e+1+r+i));return{consumed:1+r+i,result:o}}else if(t[e]>=128){const r=t[e]-128;n(e+1+r);const i=ve(t.slice(e+1,e+1+r));return{consumed:1+r,result:i}}return{consumed:1,result:QU(t[e])}}function qu(t){const e=Ue(t,"data"),n=kS(e,0);return ne(n.consumed===e.length,"unexpected junk after rlp payload","data",t),n.result}function CS(t){const e=[];for(;t;)e.unshift(t&255),t>>=8;return e}function IS(t){if(Array.isArray(t)){let r=[];if(t.forEach(function(o){r=r.concat(IS(o))}),r.length<=55)return r.unshift(192+r.length),r;const i=CS(r.length);return i.unshift(247+i.length),i.concat(r)}const e=Array.prototype.slice.call(Ue(t,"object"));if(e.length===1&&e[0]<=127)return e;if(e.length<=55)return e.unshift(128+e.length),e;const n=CS(e.length);return n.unshift(183+n.length),n.concat(e)}const OS="0123456789abcdef";function os(t){let e="0x";for(const n of IS(t))e+=OS[n>>4],e+=OS[n&15];return e}const zn=32,wm=new Uint8Array(zn),XU=["then"],Lh={},TS=new WeakMap;function oa(t){return TS.get(t)}function PS(t,e){TS.set(t,e)}function Yu(t,e){const n=new Error(`deferred error during ABI decoding triggered accessing ${t}`);throw n.error=e,n}function xm(t,e,n){return t.indexOf(null)>=0?e.map((r,i)=>r instanceof zl?xm(oa(r),r,n):r):t.reduce((r,i,o)=>{let s=e.getValue(i);return i in r||(n&&s instanceof zl&&(s=xm(oa(s),s,n)),r[i]=s),r},{})}const wc=class wc extends Array{constructor(...n){const r=n[0];let i=n[1],o=(n[2]||[]).slice(),s=!0;r!==Lh&&(i=n,o=[],s=!1);super(i.length);ce(this,vc);i.forEach((c,u)=>{this[u]=c});const a=o.reduce((c,u)=>(typeof u=="string"&&c.set(u,(c.get(u)||0)+1),c),new Map);if(PS(this,Object.freeze(i.map((c,u)=>{const d=o[u];return d!=null&&a.get(d)===1?d:null}))),K(this,vc,[]),F(this,vc)==null&&F(this,vc),!s)return;Object.freeze(this);const l=new Proxy(this,{get:(c,u,d)=>{if(typeof u=="string"){if(u.match(/^[0-9]+$/)){const g=$e(u,"%index");if(g<0||g>=this.length)throw new RangeError("out of result range");const b=c[g];return b instanceof Error&&Yu(`index ${g}`,b),b}if(XU.indexOf(u)>=0)return Reflect.get(c,u,d);const h=c[u];if(h instanceof Function)return function(...g){return h.apply(this===d?c:this,g)};if(!(u in c))return c.getValue.apply(this===d?c:this,[u])}return Reflect.get(c,u,d)}});return PS(l,oa(this)),l}toArray(n){const r=[];return this.forEach((i,o)=>{i instanceof Error&&Yu(`index ${o}`,i),n&&i instanceof wc&&(i=i.toArray(n)),r.push(i)}),r}toObject(n){const r=oa(this);return r.reduce((i,o,s)=>(fe(o!=null,`value at index ${s} unnamed`,"UNSUPPORTED_OPERATION",{operation:"toObject()"}),xm(r,this,n)),{})}slice(n,r){n==null&&(n=0),n<0&&(n+=this.length,n<0&&(n=0)),r==null&&(r=this.length),r<0&&(r+=this.length,r<0&&(r=0)),r>this.length&&(r=this.length);const i=oa(this),o=[],s=[];for(let a=n;a<r;a++)o.push(this[a]),s.push(i[a]);return new wc(Lh,o,s)}filter(n,r){const i=oa(this),o=[],s=[];for(let a=0;a<this.length;a++){const l=this[a];l instanceof Error&&Yu(`index ${a}`,l),n.call(r,l,a,this)&&(o.push(l),s.push(i[a]))}return new wc(Lh,o,s)}map(n,r){const i=[];for(let o=0;o<this.length;o++){const s=this[o];s instanceof Error&&Yu(`index ${o}`,s),i.push(n.call(r,s,o,this))}return i}getValue(n){const r=oa(this).indexOf(n);if(r===-1)return;const i=this[r];return i instanceof Error&&Yu(`property ${JSON.stringify(n)}`,i.error),i}static fromItems(n,r){return new wc(Lh,n,r)}};vc=new WeakMap;let zl=wc;function NS(t){let e=nn(t);return fe(e.length<=zn,"value out-of-bounds","BUFFER_OVERRUN",{buffer:e,length:zn,offset:e.length}),e.length!==zn&&(e=Dn(xt([wm.slice(e.length%zn),e]))),e}class po{constructor(e,n,r,i){oe(this,"name");oe(this,"type");oe(this,"localName");oe(this,"dynamic");Te(this,{name:e,type:n,localName:r,dynamic:i},{name:"string",type:"string",localName:"string",dynamic:"boolean"})}_throwError(e,n){ne(!1,e,this.localName,n)}}class Em{constructor(){ce(this,xc);ce(this,Po);ce(this,Da);K(this,Po,[]),K(this,Da,0)}get data(){return xt(F(this,Po))}get length(){return F(this,Da)}appendWriter(e){return be(this,xc,ng).call(this,Dn(e.data))}writeBytes(e){let n=Dn(e);const r=n.length%zn;return r&&(n=Dn(xt([n,wm.slice(r)]))),be(this,xc,ng).call(this,n)}writeValue(e){return be(this,xc,ng).call(this,NS(e))}writeUpdatableValue(){const e=F(this,Po).length;return F(this,Po).push(wm),K(this,Da,F(this,Da)+zn),n=>{F(this,Po)[e]=NS(n)}}}Po=new WeakMap,Da=new WeakMap,xc=new WeakSet,ng=function(e){return F(this,Po).push(e),K(this,Da,F(this,Da)+e.length),e.length};const Eb=class Eb{constructor(e,n,r){ce(this,$a);oe(this,"allowLoose");ce(this,sr);ce(this,Sr);ce(this,za);ce(this,Ua);ce(this,Ss);Te(this,{allowLoose:!!n}),K(this,sr,Dn(e)),K(this,za,0),K(this,Ua,null),K(this,Ss,r!=null?r:1024),K(this,Sr,0)}get data(){return ve(F(this,sr))}get dataLength(){return F(this,sr).length}get consumed(){return F(this,Sr)}get bytes(){return new Uint8Array(F(this,sr))}subReader(e){const n=new Eb(F(this,sr).slice(F(this,Sr)+e),this.allowLoose,F(this,Ss));return K(n,Ua,this),n}readBytes(e,n){let r=be(this,$a,OT).call(this,0,e,!!n);return be(this,$a,Wb).call(this,e),K(this,Sr,F(this,Sr)+r.length),r.slice(0,e)}readValue(){return bm(this.readBytes(zn))}readIndex(){return MU(this.readBytes(zn))}};sr=new WeakMap,Sr=new WeakMap,za=new WeakMap,Ua=new WeakMap,Ss=new WeakMap,$a=new WeakSet,Wb=function(e){var n;if(F(this,Ua))return be(n=F(this,Ua),$a,Wb).call(n,e);K(this,za,F(this,za)+e),fe(F(this,Ss)<1||F(this,za)<=F(this,Ss)*this.dataLength,`compressed ABI data exceeds inflation ratio of ${F(this,Ss)} ( see: https://github.com/ethers-io/ethers.js/issues/4537 )`,"BUFFER_OVERRUN",{buffer:Dn(F(this,sr)),offset:F(this,Sr),length:e,info:{bytesRead:F(this,za),dataLength:this.dataLength}})},OT=function(e,n,r){let i=Math.ceil(n/zn)*zn;return F(this,Sr)+i>F(this,sr).length&&(this.allowLoose&&r&&F(this,Sr)+n<=F(this,sr).length?i=n:fe(!1,"data out-of-bounds","BUFFER_OVERRUN",{buffer:Dn(F(this,sr)),length:F(this,sr).length,offset:F(this,Sr)+i})),F(this,sr).slice(F(this,Sr),F(this,Sr)+i)};let Sm=Eb;function Fh(t){if(!Number.isSafeInteger(t)||t<0)throw new Error(`Wrong positive integer: ${t}`)}function Am(t,...e){if(!(t instanceof Uint8Array))throw new Error("Expected Uint8Array");if(e.length>0&&!e.includes(t.length))throw new Error(`Expected Uint8Array of length ${e}, not of length=${t.length}`)}function JU(t){if(typeof t!="function"||typeof t.create!="function")throw new Error("Hash should be wrapped by utils.wrapConstructor");Fh(t.outputLen),Fh(t.blockLen)}function Ul(t,e=!0){if(t.destroyed)throw new Error("Hash instance has been destroyed");if(e&&t.finished)throw new Error("Hash#digest() has already been called")}function BS(t,e){Am(t);const n=e.outputLen;if(t.length<n)throw new Error(`digestInto() expects output buffer of length at least ${n}`)}const km=typeof globalThis=="object"&&"crypto"in globalThis?globalThis.crypto:void 0;/*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */const RS=t=>t instanceof Uint8Array,ZU=t=>new Uint32Array(t.buffer,t.byteOffset,Math.floor(t.byteLength/4)),Cm=t=>new DataView(t.buffer,t.byteOffset,t.byteLength),Ti=(t,e)=>t<<32-e|t>>>e;if(!(new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68))throw new Error("Non little-endian hardware is not supported");function e7(t){if(typeof t!="string")throw new Error(`utf8ToBytes expected string, got ${typeof t}`);return new Uint8Array(new TextEncoder().encode(t))}function _h(t){if(typeof t=="string"&&(t=e7(t)),!RS(t))throw new Error(`expected Uint8Array, got ${typeof t}`);return t}function t7(...t){const e=new Uint8Array(t.reduce((r,i)=>r+i.length,0));let n=0;return t.forEach(r=>{if(!RS(r))throw new Error("Uint8Array expected");e.set(r,n),n+=r.length}),e}class Im{clone(){return this._cloneInto()}}function Om(t){const e=r=>t().update(_h(r)).digest(),n=t();return e.outputLen=n.outputLen,e.blockLen=n.blockLen,e.create=()=>t(),e}function n7(t=32){if(km&&typeof km.getRandomValues=="function")return km.getRandomValues(new Uint8Array(t));throw new Error("crypto.getRandomValues must be defined")}class MS extends Im{constructor(e,n){super(),this.finished=!1,this.destroyed=!1,JU(e);const r=_h(n);if(this.iHash=e.create(),typeof this.iHash.update!="function")throw new Error("Expected instance of class which extends utils.Hash");this.blockLen=this.iHash.blockLen,this.outputLen=this.iHash.outputLen;const i=this.blockLen,o=new Uint8Array(i);o.set(r.length>i?e.create().update(r).digest():r);for(let s=0;s<o.length;s++)o[s]^=54;this.iHash.update(o),this.oHash=e.create();for(let s=0;s<o.length;s++)o[s]^=106;this.oHash.update(o),o.fill(0)}update(e){return Ul(this),this.iHash.update(e),this}digestInto(e){Ul(this),Am(e,this.outputLen),this.finished=!0,this.iHash.digestInto(e),this.oHash.update(e),this.oHash.digestInto(e),this.destroy()}digest(){const e=new Uint8Array(this.oHash.outputLen);return this.digestInto(e),e}_cloneInto(e){e||(e=Object.create(Object.getPrototypeOf(this),{}));const{oHash:n,iHash:r,finished:i,destroyed:o,blockLen:s,outputLen:a}=this;return e=e,e.finished=i,e.destroyed=o,e.blockLen=s,e.outputLen=a,e.oHash=n._cloneInto(e.oHash),e.iHash=r._cloneInto(e.iHash),e}destroy(){this.destroyed=!0,this.oHash.destroy(),this.iHash.destroy()}}const LS=(t,e,n)=>new MS(t,e).update(n).digest();LS.create=(t,e)=>new MS(t,e);function r7(t,e,n,r){if(typeof t.setBigUint64=="function")return t.setBigUint64(e,n,r);const i=BigInt(32),o=BigInt(4294967295),s=Number(n>>i&o),a=Number(n&o),l=r?4:0,c=r?0:4;t.setUint32(e+l,s,r),t.setUint32(e+c,a,r)}class FS extends Im{constructor(e,n,r,i){super(),this.blockLen=e,this.outputLen=n,this.padOffset=r,this.isLE=i,this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.buffer=new Uint8Array(e),this.view=Cm(this.buffer)}update(e){Ul(this);const{view:n,buffer:r,blockLen:i}=this;e=_h(e);const o=e.length;for(let s=0;s<o;){const a=Math.min(i-this.pos,o-s);if(a===i){const l=Cm(e);for(;i<=o-s;s+=i)this.process(l,s);continue}r.set(e.subarray(s,s+a),this.pos),this.pos+=a,s+=a,this.pos===i&&(this.process(n,0),this.pos=0)}return this.length+=e.length,this.roundClean(),this}digestInto(e){Ul(this),BS(e,this),this.finished=!0;const{buffer:n,view:r,blockLen:i,isLE:o}=this;let{pos:s}=this;n[s++]=128,this.buffer.subarray(s).fill(0),this.padOffset>i-s&&(this.process(r,0),s=0);for(let d=s;d<i;d++)n[d]=0;r7(r,i-8,BigInt(this.length*8),o),this.process(r,0);const a=Cm(e),l=this.outputLen;if(l%4)throw new Error("_sha2: outputLen should be aligned to 32bit");const c=l/4,u=this.get();if(c>u.length)throw new Error("_sha2: outputLen bigger than state");for(let d=0;d<c;d++)a.setUint32(4*d,u[d],o)}digest(){const{buffer:e,outputLen:n}=this;this.digestInto(e);const r=e.slice(0,n);return this.destroy(),r}_cloneInto(e){e||(e=new this.constructor),e.set(...this.get());const{blockLen:n,buffer:r,length:i,finished:o,destroyed:s,pos:a}=this;return e.length=i,e.pos=a,e.finished=o,e.destroyed=s,i%n&&e.buffer.set(r),e}}const i7=(t,e,n)=>t&e^~t&n,o7=(t,e,n)=>t&e^t&n^e&n,s7=new Uint32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),ss=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),as=new Uint32Array(64);class a7 extends FS{constructor(){super(64,32,8,!1),this.A=ss[0]|0,this.B=ss[1]|0,this.C=ss[2]|0,this.D=ss[3]|0,this.E=ss[4]|0,this.F=ss[5]|0,this.G=ss[6]|0,this.H=ss[7]|0}get(){const{A:e,B:n,C:r,D:i,E:o,F:s,G:a,H:l}=this;return[e,n,r,i,o,s,a,l]}set(e,n,r,i,o,s,a,l){this.A=e|0,this.B=n|0,this.C=r|0,this.D=i|0,this.E=o|0,this.F=s|0,this.G=a|0,this.H=l|0}process(e,n){for(let d=0;d<16;d++,n+=4)as[d]=e.getUint32(n,!1);for(let d=16;d<64;d++){const h=as[d-15],g=as[d-2],b=Ti(h,7)^Ti(h,18)^h>>>3,p=Ti(g,17)^Ti(g,19)^g>>>10;as[d]=p+as[d-7]+b+as[d-16]|0}let{A:r,B:i,C:o,D:s,E:a,F:l,G:c,H:u}=this;for(let d=0;d<64;d++){const h=Ti(a,6)^Ti(a,11)^Ti(a,25),g=u+h+i7(a,l,c)+s7[d]+as[d]|0,p=(Ti(r,2)^Ti(r,13)^Ti(r,22))+o7(r,i,o)|0;u=c,c=l,l=a,a=s+g|0,s=o,o=i,i=r,r=g+p|0}r=r+this.A|0,i=i+this.B|0,o=o+this.C|0,s=s+this.D|0,a=a+this.E|0,l=l+this.F|0,c=c+this.G|0,u=u+this.H|0,this.set(r,i,o,s,a,l,c,u)}roundClean(){as.fill(0)}destroy(){this.set(0,0,0,0,0,0,0,0),this.buffer.fill(0)}}const _S=Om(()=>new a7),Vh=BigInt(2**32-1),Tm=BigInt(32);function VS(t,e=!1){return e?{h:Number(t&Vh),l:Number(t>>Tm&Vh)}:{h:Number(t>>Tm&Vh)|0,l:Number(t&Vh)|0}}function DS(t,e=!1){let n=new Uint32Array(t.length),r=new Uint32Array(t.length);for(let i=0;i<t.length;i++){const{h:o,l:s}=VS(t[i],e);[n[i],r[i]]=[o,s]}return[n,r]}const l7=(t,e)=>BigInt(t>>>0)<<Tm|BigInt(e>>>0),c7=(t,e,n)=>t>>>n,u7=(t,e,n)=>t<<32-n|e>>>n,d7=(t,e,n)=>t>>>n|e<<32-n,f7=(t,e,n)=>t<<32-n|e>>>n,h7=(t,e,n)=>t<<64-n|e>>>n-32,p7=(t,e,n)=>t>>>n-32|e<<64-n,g7=(t,e)=>e,m7=(t,e)=>t,zS=(t,e,n)=>t<<n|e>>>32-n,US=(t,e,n)=>e<<n|t>>>32-n,$S=(t,e,n)=>e<<n-32|t>>>64-n,HS=(t,e,n)=>t<<n-32|e>>>64-n;function y7(t,e,n,r){const i=(e>>>0)+(r>>>0);return{h:t+n+(i/2**32|0)|0,l:i|0}}const Ve={fromBig:VS,split:DS,toBig:l7,shrSH:c7,shrSL:u7,rotrSH:d7,rotrSL:f7,rotrBH:h7,rotrBL:p7,rotr32H:g7,rotr32L:m7,rotlSH:zS,rotlSL:US,rotlBH:$S,rotlBL:HS,add:y7,add3L:(t,e,n)=>(t>>>0)+(e>>>0)+(n>>>0),add3H:(t,e,n,r)=>e+n+r+(t/2**32|0)|0,add4L:(t,e,n,r)=>(t>>>0)+(e>>>0)+(n>>>0)+(r>>>0),add4H:(t,e,n,r,i)=>e+n+r+i+(t/2**32|0)|0,add5H:(t,e,n,r,i,o)=>e+n+r+i+o+(t/2**32|0)|0,add5L:(t,e,n,r,i)=>(t>>>0)+(e>>>0)+(n>>>0)+(r>>>0)+(i>>>0)},[b7,v7]=Ve.split(["0x428a2f98d728ae22","0x7137449123ef65cd","0xb5c0fbcfec4d3b2f","0xe9b5dba58189dbbc","0x3956c25bf348b538","0x59f111f1b605d019","0x923f82a4af194f9b","0xab1c5ed5da6d8118","0xd807aa98a3030242","0x12835b0145706fbe","0x243185be4ee4b28c","0x550c7dc3d5ffb4e2","0x72be5d74f27b896f","0x80deb1fe3b1696b1","0x9bdc06a725c71235","0xc19bf174cf692694","0xe49b69c19ef14ad2","0xefbe4786384f25e3","0x0fc19dc68b8cd5b5","0x240ca1cc77ac9c65","0x2de92c6f592b0275","0x4a7484aa6ea6e483","0x5cb0a9dcbd41fbd4","0x76f988da831153b5","0x983e5152ee66dfab","0xa831c66d2db43210","0xb00327c898fb213f","0xbf597fc7beef0ee4","0xc6e00bf33da88fc2","0xd5a79147930aa725","0x06ca6351e003826f","0x142929670a0e6e70","0x27b70a8546d22ffc","0x2e1b21385c26c926","0x4d2c6dfc5ac42aed","0x53380d139d95b3df","0x650a73548baf63de","0x766a0abb3c77b2a8","0x81c2c92e47edaee6","0x92722c851482353b","0xa2bfe8a14cf10364","0xa81a664bbc423001","0xc24b8b70d0f89791","0xc76c51a30654be30","0xd192e819d6ef5218","0xd69906245565a910","0xf40e35855771202a","0x106aa07032bbd1b8","0x19a4c116b8d2d0c8","0x1e376c085141ab53","0x2748774cdf8eeb99","0x34b0bcb5e19b48a8","0x391c0cb3c5c95a63","0x4ed8aa4ae3418acb","0x5b9cca4f7763e373","0x682e6ff3d6b2b8a3","0x748f82ee5defb2fc","0x78a5636f43172f60","0x84c87814a1f0ab72","0x8cc702081a6439ec","0x90befffa23631e28","0xa4506cebde82bde9","0xbef9a3f7b2c67915","0xc67178f2e372532b","0xca273eceea26619c","0xd186b8c721c0c207","0xeada7dd6cde0eb1e","0xf57d4f7fee6ed178","0x06f067aa72176fba","0x0a637dc5a2c898a6","0x113f9804bef90dae","0x1b710b35131c471b","0x28db77f523047d84","0x32caab7b40c72493","0x3c9ebe0a15c9bebc","0x431d67c49c100d4c","0x4cc5d4becb3e42b6","0x597f299cfc657e2a","0x5fcb6fab3ad6faec","0x6c44198c4a475817"].map(t=>BigInt(t))),ls=new Uint32Array(80),cs=new Uint32Array(80);class w7 extends FS{constructor(){super(128,64,16,!1),this.Ah=1779033703,this.Al=-205731576,this.Bh=-1150833019,this.Bl=-2067093701,this.Ch=1013904242,this.Cl=-23791573,this.Dh=-1521486534,this.Dl=1595750129,this.Eh=1359893119,this.El=-1377402159,this.Fh=-1694144372,this.Fl=725511199,this.Gh=528734635,this.Gl=-79577749,this.Hh=1541459225,this.Hl=327033209}get(){const{Ah:e,Al:n,Bh:r,Bl:i,Ch:o,Cl:s,Dh:a,Dl:l,Eh:c,El:u,Fh:d,Fl:h,Gh:g,Gl:b,Hh:p,Hl:w}=this;return[e,n,r,i,o,s,a,l,c,u,d,h,g,b,p,w]}set(e,n,r,i,o,s,a,l,c,u,d,h,g,b,p,w){this.Ah=e|0,this.Al=n|0,this.Bh=r|0,this.Bl=i|0,this.Ch=o|0,this.Cl=s|0,this.Dh=a|0,this.Dl=l|0,this.Eh=c|0,this.El=u|0,this.Fh=d|0,this.Fl=h|0,this.Gh=g|0,this.Gl=b|0,this.Hh=p|0,this.Hl=w|0}process(e,n){for(let T=0;T<16;T++,n+=4)ls[T]=e.getUint32(n),cs[T]=e.getUint32(n+=4);for(let T=16;T<80;T++){const $=ls[T-15]|0,R=cs[T-15]|0,j=Ve.rotrSH($,R,1)^Ve.rotrSH($,R,8)^Ve.shrSH($,R,7),q=Ve.rotrSL($,R,1)^Ve.rotrSL($,R,8)^Ve.shrSL($,R,7),G=ls[T-2]|0,L=cs[T-2]|0,V=Ve.rotrSH(G,L,19)^Ve.rotrBH(G,L,61)^Ve.shrSH(G,L,6),W=Ve.rotrSL(G,L,19)^Ve.rotrBL(G,L,61)^Ve.shrSL(G,L,6),z=Ve.add4L(q,W,cs[T-7],cs[T-16]),C=Ve.add4H(z,j,V,ls[T-7],ls[T-16]);ls[T]=C|0,cs[T]=z|0}let{Ah:r,Al:i,Bh:o,Bl:s,Ch:a,Cl:l,Dh:c,Dl:u,Eh:d,El:h,Fh:g,Fl:b,Gh:p,Gl:w,Hh:S,Hl:O}=this;for(let T=0;T<80;T++){const $=Ve.rotrSH(d,h,14)^Ve.rotrSH(d,h,18)^Ve.rotrBH(d,h,41),R=Ve.rotrSL(d,h,14)^Ve.rotrSL(d,h,18)^Ve.rotrBL(d,h,41),j=d&g^~d&p,q=h&b^~h&w,G=Ve.add5L(O,R,q,v7[T],cs[T]),L=Ve.add5H(G,S,$,j,b7[T],ls[T]),V=G|0,W=Ve.rotrSH(r,i,28)^Ve.rotrBH(r,i,34)^Ve.rotrBH(r,i,39),z=Ve.rotrSL(r,i,28)^Ve.rotrBL(r,i,34)^Ve.rotrBL(r,i,39),C=r&o^r&a^o&a,f=i&s^i&l^s&l;S=p|0,O=w|0,p=g|0,w=b|0,g=d|0,b=h|0,{h:d,l:h}=Ve.add(c|0,u|0,L|0,V|0),c=a|0,u=l|0,a=o|0,l=s|0,o=r|0,s=i|0;const y=Ve.add3L(V,z,f);r=Ve.add3H(y,L,W,C),i=y|0}({h:r,l:i}=Ve.add(this.Ah|0,this.Al|0,r|0,i|0)),{h:o,l:s}=Ve.add(this.Bh|0,this.Bl|0,o|0,s|0),{h:a,l}=Ve.add(this.Ch|0,this.Cl|0,a|0,l|0),{h:c,l:u}=Ve.add(this.Dh|0,this.Dl|0,c|0,u|0),{h:d,l:h}=Ve.add(this.Eh|0,this.El|0,d|0,h|0),{h:g,l:b}=Ve.add(this.Fh|0,this.Fl|0,g|0,b|0),{h:p,l:w}=Ve.add(this.Gh|0,this.Gl|0,p|0,w|0),{h:S,l:O}=Ve.add(this.Hh|0,this.Hl|0,S|0,O|0),this.set(r,i,o,s,a,l,c,u,d,h,g,b,p,w,S,O)}roundClean(){ls.fill(0),cs.fill(0)}destroy(){this.buffer.fill(0),this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)}}const x7=Om(()=>new w7);function E7(){if(typeof self!="undefined")return self;if(typeof window!="undefined")return window;if(typeof global!="undefined")return global;throw new Error("unable to locate global object")}const WS=E7();WS.crypto||WS.msCrypto;function S7(t){switch(t){case"sha256":return _S.create();case"sha512":return x7.create()}ne(!1,"invalid hashing algorithm name","algorithm",t)}const[GS,jS,KS]=[[],[],[]],A7=BigInt(0),Qu=BigInt(1),k7=BigInt(2),C7=BigInt(7),I7=BigInt(256),O7=BigInt(113);for(let t=0,e=Qu,n=1,r=0;t<24;t++){[n,r]=[r,(2*n+3*r)%5],GS.push(2*(5*r+n)),jS.push((t+1)*(t+2)/2%64);let i=A7;for(let o=0;o<7;o++)e=(e<<Qu^(e>>C7)*O7)%I7,e&k7&&(i^=Qu<<(Qu<<BigInt(o))-Qu);KS.push(i)}const[T7,P7]=DS(KS,!0),qS=(t,e,n)=>n>32?$S(t,e,n):zS(t,e,n),YS=(t,e,n)=>n>32?HS(t,e,n):US(t,e,n);function N7(t,e=24){const n=new Uint32Array(10);for(let r=24-e;r<24;r++){for(let s=0;s<10;s++)n[s]=t[s]^t[s+10]^t[s+20]^t[s+30]^t[s+40];for(let s=0;s<10;s+=2){const a=(s+8)%10,l=(s+2)%10,c=n[l],u=n[l+1],d=qS(c,u,1)^n[a],h=YS(c,u,1)^n[a+1];for(let g=0;g<50;g+=10)t[s+g]^=d,t[s+g+1]^=h}let i=t[2],o=t[3];for(let s=0;s<24;s++){const a=jS[s],l=qS(i,o,a),c=YS(i,o,a),u=GS[s];i=t[u],o=t[u+1],t[u]=l,t[u+1]=c}for(let s=0;s<50;s+=10){for(let a=0;a<10;a++)n[a]=t[s+a];for(let a=0;a<10;a++)t[s+a]^=~n[(a+2)%10]&n[(a+4)%10]}t[0]^=T7[r],t[1]^=P7[r]}n.fill(0)}class Pm extends Im{constructor(e,n,r,i=!1,o=24){if(super(),this.blockLen=e,this.suffix=n,this.outputLen=r,this.enableXOF=i,this.rounds=o,this.pos=0,this.posOut=0,this.finished=!1,this.destroyed=!1,Fh(r),0>=this.blockLen||this.blockLen>=200)throw new Error("Sha3 supports only keccak-f1600 function");this.state=new Uint8Array(200),this.state32=ZU(this.state)}keccak(){N7(this.state32,this.rounds),this.posOut=0,this.pos=0}update(e){Ul(this);const{blockLen:n,state:r}=this;e=_h(e);const i=e.length;for(let o=0;o<i;){const s=Math.min(n-this.pos,i-o);for(let a=0;a<s;a++)r[this.pos++]^=e[o++];this.pos===n&&this.keccak()}return this}finish(){if(this.finished)return;this.finished=!0;const{state:e,suffix:n,pos:r,blockLen:i}=this;e[r]^=n,(n&128)!==0&&r===i-1&&this.keccak(),e[i-1]^=128,this.keccak()}writeInto(e){Ul(this,!1),Am(e),this.finish();const n=this.state,{blockLen:r}=this;for(let i=0,o=e.length;i<o;){this.posOut>=r&&this.keccak();const s=Math.min(r-this.posOut,o-i);e.set(n.subarray(this.posOut,this.posOut+s),i),this.posOut+=s,i+=s}return e}xofInto(e){if(!this.enableXOF)throw new Error("XOF is not possible for this instance");return this.writeInto(e)}xof(e){return Fh(e),this.xofInto(new Uint8Array(e))}digestInto(e){if(BS(e,this),this.finished)throw new Error("digest() was already called");return this.writeInto(e),this.destroy(),e}digest(){return this.digestInto(new Uint8Array(this.outputLen))}destroy(){this.destroyed=!0,this.state.fill(0)}_cloneInto(e){const{blockLen:n,suffix:r,outputLen:i,rounds:o,enableXOF:s}=this;return e||(e=new Pm(n,r,i,s,o)),e.state32.set(this.state32),e.pos=this.pos,e.posOut=this.posOut,e.finished=this.finished,e.rounds=o,e.suffix=r,e.outputLen=i,e.enableXOF=s,e.destroyed=this.destroyed,e}}const B7=((t,e,n)=>Om(()=>new Pm(e,t,n)))(1,136,256/8);let QS=!1;const XS=function(t){return B7(t)};let JS=XS;function Ft(t){const e=Ue(t,"data");return ve(JS(e))}Ft._=XS,Ft.lock=function(){QS=!0},Ft.register=function(t){if(QS)throw new TypeError("keccak256 is locked");JS=t},Object.freeze(Ft);const ZS=function(t){return S7("sha256").update(t).digest()};let eA=ZS,tA=!1;function $l(t){const e=Ue(t,"data");return ve(eA(e))}$l._=ZS,$l.lock=function(){tA=!0},$l.register=function(t){if(tA)throw new Error("sha256 is locked");eA=t},Object.freeze($l),Object.freeze($l);/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const nA=BigInt(0),Dh=BigInt(1),R7=BigInt(2),zh=t=>t instanceof Uint8Array,M7=Array.from({length:256},(t,e)=>e.toString(16).padStart(2,"0"));function Hl(t){if(!zh(t))throw new Error("Uint8Array expected");let e="";for(let n=0;n<t.length;n++)e+=M7[t[n]];return e}function rA(t){const e=t.toString(16);return e.length&1?`0${e}`:e}function Nm(t){if(typeof t!="string")throw new Error("hex string expected, got "+typeof t);return BigInt(t===""?"0":`0x${t}`)}function Wl(t){if(typeof t!="string")throw new Error("hex string expected, got "+typeof t);const e=t.length;if(e%2)throw new Error("padded hex string expected, got unpadded hex of length "+e);const n=new Uint8Array(e/2);for(let r=0;r<n.length;r++){const i=r*2,o=t.slice(i,i+2),s=Number.parseInt(o,16);if(Number.isNaN(s)||s<0)throw new Error("Invalid byte sequence");n[r]=s}return n}function sa(t){return Nm(Hl(t))}function Bm(t){if(!zh(t))throw new Error("Uint8Array expected");return Nm(Hl(Uint8Array.from(t).reverse()))}function Gl(t,e){return Wl(t.toString(16).padStart(e*2,"0"))}function Rm(t,e){return Gl(t,e).reverse()}function L7(t){return Wl(rA(t))}function ti(t,e,n){let r;if(typeof e=="string")try{r=Wl(e)}catch(o){throw new Error(`${t} must be valid hex string, got "${e}". Cause: ${o}`)}else if(zh(e))r=Uint8Array.from(e);else throw new Error(`${t} must be hex string or Uint8Array`);const i=r.length;if(typeof n=="number"&&i!==n)throw new Error(`${t} expected ${n} bytes, got ${i}`);return r}function Xu(...t){const e=new Uint8Array(t.reduce((r,i)=>r+i.length,0));let n=0;return t.forEach(r=>{if(!zh(r))throw new Error("Uint8Array expected");e.set(r,n),n+=r.length}),e}function F7(t,e){if(t.length!==e.length)return!1;for(let n=0;n<t.length;n++)if(t[n]!==e[n])return!1;return!0}function _7(t){if(typeof t!="string")throw new Error(`utf8ToBytes expected string, got ${typeof t}`);return new Uint8Array(new TextEncoder().encode(t))}function V7(t){let e;for(e=0;t>nA;t>>=Dh,e+=1);return e}function D7(t,e){return t>>BigInt(e)&Dh}const z7=(t,e,n)=>t|(n?Dh:nA)<<BigInt(e),Mm=t=>(R7<<BigInt(t-1))-Dh,Lm=t=>new Uint8Array(t),iA=t=>Uint8Array.from(t);function oA(t,e,n){if(typeof t!="number"||t<2)throw new Error("hashLen must be a number");if(typeof e!="number"||e<2)throw new Error("qByteLen must be a number");if(typeof n!="function")throw new Error("hmacFn must be a function");let r=Lm(t),i=Lm(t),o=0;const s=()=>{r.fill(1),i.fill(0),o=0},a=(...d)=>n(i,r,...d),l=(d=Lm())=>{i=a(iA([0]),d),r=a(),d.length!==0&&(i=a(iA([1]),d),r=a())},c=()=>{if(o++>=1e3)throw new Error("drbg: tried 1000 values");let d=0;const h=[];for(;d<e;){r=a();const g=r.slice();h.push(g),d+=r.length}return Xu(...h)};return(d,h)=>{s(),l(d);let g;for(;!(g=h(c()));)l();return s(),g}}const U7={bigint:t=>typeof t=="bigint",function:t=>typeof t=="function",boolean:t=>typeof t=="boolean",string:t=>typeof t=="string",stringOrUint8Array:t=>typeof t=="string"||t instanceof Uint8Array,isSafeInteger:t=>Number.isSafeInteger(t),array:t=>Array.isArray(t),field:(t,e)=>e.Fp.isValid(t),hash:t=>typeof t=="function"&&Number.isSafeInteger(t.outputLen)};function Ju(t,e,n={}){const r=(i,o,s)=>{const a=U7[o];if(typeof a!="function")throw new Error(`Invalid validator "${o}", expected function`);const l=t[i];if(!(s&&l===void 0)&&!a(l,t))throw new Error(`Invalid param ${String(i)}=${l} (${typeof l}), expected ${o}`)};for(const[i,o]of Object.entries(e))r(i,o,!1);for(const[i,o]of Object.entries(n))r(i,o,!0);return t}const $7=Object.freeze(Object.defineProperty({__proto__:null,bitGet:D7,bitLen:V7,bitMask:Mm,bitSet:z7,bytesToHex:Hl,bytesToNumberBE:sa,bytesToNumberLE:Bm,concatBytes:Xu,createHmacDrbg:oA,ensureBytes:ti,equalBytes:F7,hexToBytes:Wl,hexToNumber:Nm,numberToBytesBE:Gl,numberToBytesLE:Rm,numberToHexUnpadded:rA,numberToVarBytesBE:L7,utf8ToBytes:_7,validateObject:Ju},Symbol.toStringTag,{value:"Module"}));/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const cn=BigInt(0),Tt=BigInt(1),aa=BigInt(2),H7=BigInt(3),Fm=BigInt(4),sA=BigInt(5),aA=BigInt(8);BigInt(9),BigInt(16);function tr(t,e){const n=t%e;return n>=cn?n:e+n}function W7(t,e,n){if(n<=cn||e<cn)throw new Error("Expected power/modulo > 0");if(n===Tt)return cn;let r=Tt;for(;e>cn;)e&Tt&&(r=r*t%n),t=t*t%n,e>>=Tt;return r}function Mr(t,e,n){let r=t;for(;e-- >cn;)r*=r,r%=n;return r}function _m(t,e){if(t===cn||e<=cn)throw new Error(`invert: expected positive integers, got n=${t} mod=${e}`);let n=tr(t,e),r=e,i=cn,o=Tt;for(;n!==cn;){const a=r/n,l=r%n,c=i-o*a;r=n,n=l,i=o,o=c}if(r!==Tt)throw new Error("invert: does not exist");return tr(i,e)}function G7(t){const e=(t-Tt)/aa;let n,r,i;for(n=t-Tt,r=0;n%aa===cn;n/=aa,r++);for(i=aa;i<t&&W7(i,e,t)!==t-Tt;i++);if(r===1){const s=(t+Tt)/Fm;return function(l,c){const u=l.pow(c,s);if(!l.eql(l.sqr(u),c))throw new Error("Cannot find square root");return u}}const o=(n+Tt)/aa;return function(a,l){if(a.pow(l,e)===a.neg(a.ONE))throw new Error("Cannot find square root");let c=r,u=a.pow(a.mul(a.ONE,i),n),d=a.pow(l,o),h=a.pow(l,n);for(;!a.eql(h,a.ONE);){if(a.eql(h,a.ZERO))return a.ZERO;let g=1;for(let p=a.sqr(h);g<c&&!a.eql(p,a.ONE);g++)p=a.sqr(p);const b=a.pow(u,Tt<<BigInt(c-g-1));u=a.sqr(b),d=a.mul(d,b),h=a.mul(h,u),c=g}return d}}function j7(t){if(t%Fm===H7){const e=(t+Tt)/Fm;return function(r,i){const o=r.pow(i,e);if(!r.eql(r.sqr(o),i))throw new Error("Cannot find square root");return o}}if(t%aA===sA){const e=(t-sA)/aA;return function(r,i){const o=r.mul(i,aa),s=r.pow(o,e),a=r.mul(i,s),l=r.mul(r.mul(a,aa),s),c=r.mul(a,r.sub(l,r.ONE));if(!r.eql(r.sqr(c),i))throw new Error("Cannot find square root");return c}}return G7(t)}const K7=["create","isValid","is0","neg","inv","sqrt","sqr","eql","add","sub","mul","pow","div","addN","subN","mulN","sqrN"];function q7(t){const e={ORDER:"bigint",MASK:"bigint",BYTES:"isSafeInteger",BITS:"isSafeInteger"},n=K7.reduce((r,i)=>(r[i]="function",r),e);return Ju(t,n)}function Y7(t,e,n){if(n<cn)throw new Error("Expected power > 0");if(n===cn)return t.ONE;if(n===Tt)return e;let r=t.ONE,i=e;for(;n>cn;)n&Tt&&(r=t.mul(r,i)),i=t.sqr(i),n>>=Tt;return r}function Q7(t,e){const n=new Array(e.length),r=e.reduce((o,s,a)=>t.is0(s)?o:(n[a]=o,t.mul(o,s)),t.ONE),i=t.inv(r);return e.reduceRight((o,s,a)=>t.is0(s)?o:(n[a]=t.mul(o,n[a]),t.mul(o,s)),i),n}function lA(t,e){const n=e!==void 0?e:t.toString(2).length,r=Math.ceil(n/8);return{nBitLength:n,nByteLength:r}}function X7(t,e,n=!1,r={}){if(t<=cn)throw new Error(`Expected Field ORDER > 0, got ${t}`);const{nBitLength:i,nByteLength:o}=lA(t,e);if(o>2048)throw new Error("Field lengths over 2048 bytes are not supported");const s=j7(t),a=Object.freeze({ORDER:t,BITS:i,BYTES:o,MASK:Mm(i),ZERO:cn,ONE:Tt,create:l=>tr(l,t),isValid:l=>{if(typeof l!="bigint")throw new Error(`Invalid field element: expected bigint, got ${typeof l}`);return cn<=l&&l<t},is0:l=>l===cn,isOdd:l=>(l&Tt)===Tt,neg:l=>tr(-l,t),eql:(l,c)=>l===c,sqr:l=>tr(l*l,t),add:(l,c)=>tr(l+c,t),sub:(l,c)=>tr(l-c,t),mul:(l,c)=>tr(l*c,t),pow:(l,c)=>Y7(a,l,c),div:(l,c)=>tr(l*_m(c,t),t),sqrN:l=>l*l,addN:(l,c)=>l+c,subN:(l,c)=>l-c,mulN:(l,c)=>l*c,inv:l=>_m(l,t),sqrt:r.sqrt||(l=>s(a,l)),invertBatch:l=>Q7(a,l),cmov:(l,c,u)=>u?c:l,toBytes:l=>n?Rm(l,o):Gl(l,o),fromBytes:l=>{if(l.length!==o)throw new Error(`Fp.fromBytes: expected ${o}, got ${l.length}`);return n?Bm(l):sa(l)}});return Object.freeze(a)}function cA(t){if(typeof t!="bigint")throw new Error("field order must be bigint");const e=t.toString(2).length;return Math.ceil(e/8)}function uA(t){const e=cA(t);return e+Math.ceil(e/2)}function J7(t,e,n=!1){const r=t.length,i=cA(e),o=uA(e);if(r<16||r<o||r>1024)throw new Error(`expected ${o}-1024 bytes of input, got ${r}`);const s=n?sa(t):Bm(t),a=tr(s,e-Tt)+Tt;return n?Rm(a,i):Gl(a,i)}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const Z7=BigInt(0),Vm=BigInt(1);function e9(t,e){const n=(i,o)=>{const s=o.negate();return i?s:o},r=i=>{const o=Math.ceil(e/i)+1,s=2**(i-1);return{windows:o,windowSize:s}};return{constTimeNegate:n,unsafeLadder(i,o){let s=t.ZERO,a=i;for(;o>Z7;)o&Vm&&(s=s.add(a)),a=a.double(),o>>=Vm;return s},precomputeWindow(i,o){const{windows:s,windowSize:a}=r(o),l=[];let c=i,u=c;for(let d=0;d<s;d++){u=c,l.push(u);for(let h=1;h<a;h++)u=u.add(c),l.push(u);c=u.double()}return l},wNAF(i,o,s){const{windows:a,windowSize:l}=r(i);let c=t.ZERO,u=t.BASE;const d=BigInt(2**i-1),h=2**i,g=BigInt(i);for(let b=0;b<a;b++){const p=b*l;let w=Number(s&d);s>>=g,w>l&&(w-=h,s+=Vm);const S=p,O=p+Math.abs(w)-1,T=b%2!==0,$=w<0;w===0?u=u.add(n(T,o[S])):c=c.add(n($,o[O]))}return{p:c,f:u}},wNAFCached(i,o,s,a){const l=i._WINDOW_SIZE||1;let c=o.get(i);return c||(c=this.precomputeWindow(i,l),l!==1&&o.set(i,a(c))),this.wNAF(l,c,s)}}}function dA(t){return q7(t.Fp),Ju(t,{n:"bigint",h:"bigint",Gx:"field",Gy:"field"},{nBitLength:"isSafeInteger",nByteLength:"isSafeInteger"}),Object.freeze({...lA(t.n,t.nBitLength),...t,p:t.Fp.ORDER})}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */function t9(t){const e=dA(t);Ju(e,{a:"field",b:"field"},{allowedPrivateKeyLengths:"array",wrapPrivateKey:"boolean",isTorsionFree:"function",clearCofactor:"function",allowInfinityPoint:"boolean",fromBytes:"function",toBytes:"function"});const{endo:n,Fp:r,a:i}=e;if(n){if(!r.eql(i,r.ZERO))throw new Error("Endomorphism can only be defined for Koblitz curves that have a=0");if(typeof n!="object"||typeof n.beta!="bigint"||typeof n.splitScalar!="function")throw new Error("Expected endomorphism with beta: bigint and splitScalar: function")}return Object.freeze({...e})}const{bytesToNumberBE:n9,hexToBytes:r9}=$7,la={Err:class extends Error{constructor(e=""){super(e)}},_parseInt(t){const{Err:e}=la;if(t.length<2||t[0]!==2)throw new e("Invalid signature integer tag");const n=t[1],r=t.subarray(2,n+2);if(!n||r.length!==n)throw new e("Invalid signature integer: wrong length");if(r[0]&128)throw new e("Invalid signature integer: negative");if(r[0]===0&&!(r[1]&128))throw new e("Invalid signature integer: unnecessary leading zero");return{d:n9(r),l:t.subarray(n+2)}},toSig(t){const{Err:e}=la,n=typeof t=="string"?r9(t):t;if(!(n instanceof Uint8Array))throw new Error("ui8a expected");let r=n.length;if(r<2||n[0]!=48)throw new e("Invalid signature tag");if(n[1]!==r-2)throw new e("Invalid signature: incorrect length");const{d:i,l:o}=la._parseInt(n.subarray(2)),{d:s,l:a}=la._parseInt(o);if(a.length)throw new e("Invalid signature: left bytes after parsing");return{r:i,s}},hexFromSig(t){const e=c=>Number.parseInt(c[0],16)&8?"00"+c:c,n=c=>{const u=c.toString(16);return u.length&1?`0${u}`:u},r=e(n(t.s)),i=e(n(t.r)),o=r.length/2,s=i.length/2,a=n(o),l=n(s);return`30${n(s+o+4)}02${l}${i}02${a}${r}`}},go=BigInt(0),Lr=BigInt(1);BigInt(2);const fA=BigInt(3);BigInt(4);function i9(t){const e=t9(t),{Fp:n}=e,r=e.toBytes||((b,p,w)=>{const S=p.toAffine();return Xu(Uint8Array.from([4]),n.toBytes(S.x),n.toBytes(S.y))}),i=e.fromBytes||(b=>{const p=b.subarray(1),w=n.fromBytes(p.subarray(0,n.BYTES)),S=n.fromBytes(p.subarray(n.BYTES,2*n.BYTES));return{x:w,y:S}});function o(b){const{a:p,b:w}=e,S=n.sqr(b),O=n.mul(S,b);return n.add(n.add(O,n.mul(b,p)),w)}if(!n.eql(n.sqr(e.Gy),o(e.Gx)))throw new Error("bad generator point: equation left != right");function s(b){return typeof b=="bigint"&&go<b&&b<e.n}function a(b){if(!s(b))throw new Error("Expected valid bigint: 0 < bigint < curve.n")}function l(b){const{allowedPrivateKeyLengths:p,nByteLength:w,wrapPrivateKey:S,n:O}=e;if(p&&typeof b!="bigint"){if(b instanceof Uint8Array&&(b=Hl(b)),typeof b!="string"||!p.includes(b.length))throw new Error("Invalid key");b=b.padStart(w*2,"0")}let T;try{T=typeof b=="bigint"?b:sa(ti("private key",b,w))}catch($){throw new Error(`private key must be ${w} bytes, hex or bigint, not ${typeof b}`)}return S&&(T=tr(T,O)),a(T),T}const c=new Map;function u(b){if(!(b instanceof d))throw new Error("ProjectivePoint expected")}class d{constructor(p,w,S){if(this.px=p,this.py=w,this.pz=S,p==null||!n.isValid(p))throw new Error("x required");if(w==null||!n.isValid(w))throw new Error("y required");if(S==null||!n.isValid(S))throw new Error("z required")}static fromAffine(p){const{x:w,y:S}=p||{};if(!p||!n.isValid(w)||!n.isValid(S))throw new Error("invalid affine point");if(p instanceof d)throw new Error("projective point not allowed");const O=T=>n.eql(T,n.ZERO);return O(w)&&O(S)?d.ZERO:new d(w,S,n.ONE)}get x(){return this.toAffine().x}get y(){return this.toAffine().y}static normalizeZ(p){const w=n.invertBatch(p.map(S=>S.pz));return p.map((S,O)=>S.toAffine(w[O])).map(d.fromAffine)}static fromHex(p){const w=d.fromAffine(i(ti("pointHex",p)));return w.assertValidity(),w}static fromPrivateKey(p){return d.BASE.multiply(l(p))}_setWindowSize(p){this._WINDOW_SIZE=p,c.delete(this)}assertValidity(){if(this.is0()){if(e.allowInfinityPoint&&!n.is0(this.py))return;throw new Error("bad point: ZERO")}const{x:p,y:w}=this.toAffine();if(!n.isValid(p)||!n.isValid(w))throw new Error("bad point: x or y not FE");const S=n.sqr(w),O=o(p);if(!n.eql(S,O))throw new Error("bad point: equation left != right");if(!this.isTorsionFree())throw new Error("bad point: not in prime-order subgroup")}hasEvenY(){const{y:p}=this.toAffine();if(n.isOdd)return!n.isOdd(p);throw new Error("Field doesn't support isOdd")}equals(p){u(p);const{px:w,py:S,pz:O}=this,{px:T,py:$,pz:R}=p,j=n.eql(n.mul(w,R),n.mul(T,O)),q=n.eql(n.mul(S,R),n.mul($,O));return j&&q}negate(){return new d(this.px,n.neg(this.py),this.pz)}double(){const{a:p,b:w}=e,S=n.mul(w,fA),{px:O,py:T,pz:$}=this;let R=n.ZERO,j=n.ZERO,q=n.ZERO,G=n.mul(O,O),L=n.mul(T,T),V=n.mul($,$),W=n.mul(O,T);return W=n.add(W,W),q=n.mul(O,$),q=n.add(q,q),R=n.mul(p,q),j=n.mul(S,V),j=n.add(R,j),R=n.sub(L,j),j=n.add(L,j),j=n.mul(R,j),R=n.mul(W,R),q=n.mul(S,q),V=n.mul(p,V),W=n.sub(G,V),W=n.mul(p,W),W=n.add(W,q),q=n.add(G,G),G=n.add(q,G),G=n.add(G,V),G=n.mul(G,W),j=n.add(j,G),V=n.mul(T,$),V=n.add(V,V),G=n.mul(V,W),R=n.sub(R,G),q=n.mul(V,L),q=n.add(q,q),q=n.add(q,q),new d(R,j,q)}add(p){u(p);const{px:w,py:S,pz:O}=this,{px:T,py:$,pz:R}=p;let j=n.ZERO,q=n.ZERO,G=n.ZERO;const L=e.a,V=n.mul(e.b,fA);let W=n.mul(w,T),z=n.mul(S,$),C=n.mul(O,R),f=n.add(w,S),y=n.add(T,$);f=n.mul(f,y),y=n.add(W,z),f=n.sub(f,y),y=n.add(w,O);let E=n.add(T,R);return y=n.mul(y,E),E=n.add(W,C),y=n.sub(y,E),E=n.add(S,O),j=n.add($,R),E=n.mul(E,j),j=n.add(z,C),E=n.sub(E,j),G=n.mul(L,y),j=n.mul(V,C),G=n.add(j,G),j=n.sub(z,G),G=n.add(z,G),q=n.mul(j,G),z=n.add(W,W),z=n.add(z,W),C=n.mul(L,C),y=n.mul(V,y),z=n.add(z,C),C=n.sub(W,C),C=n.mul(L,C),y=n.add(y,C),W=n.mul(z,y),q=n.add(q,W),W=n.mul(E,y),j=n.mul(f,j),j=n.sub(j,W),W=n.mul(f,z),G=n.mul(E,G),G=n.add(G,W),new d(j,q,G)}subtract(p){return this.add(p.negate())}is0(){return this.equals(d.ZERO)}wNAF(p){return g.wNAFCached(this,c,p,w=>{const S=n.invertBatch(w.map(O=>O.pz));return w.map((O,T)=>O.toAffine(S[T])).map(d.fromAffine)})}multiplyUnsafe(p){const w=d.ZERO;if(p===go)return w;if(a(p),p===Lr)return this;const{endo:S}=e;if(!S)return g.unsafeLadder(this,p);let{k1neg:O,k1:T,k2neg:$,k2:R}=S.splitScalar(p),j=w,q=w,G=this;for(;T>go||R>go;)T&Lr&&(j=j.add(G)),R&Lr&&(q=q.add(G)),G=G.double(),T>>=Lr,R>>=Lr;return O&&(j=j.negate()),$&&(q=q.negate()),q=new d(n.mul(q.px,S.beta),q.py,q.pz),j.add(q)}multiply(p){a(p);let w=p,S,O;const{endo:T}=e;if(T){const{k1neg:$,k1:R,k2neg:j,k2:q}=T.splitScalar(w);let{p:G,f:L}=this.wNAF(R),{p:V,f:W}=this.wNAF(q);G=g.constTimeNegate($,G),V=g.constTimeNegate(j,V),V=new d(n.mul(V.px,T.beta),V.py,V.pz),S=G.add(V),O=L.add(W)}else{const{p:$,f:R}=this.wNAF(w);S=$,O=R}return d.normalizeZ([S,O])[0]}multiplyAndAddUnsafe(p,w,S){const O=d.BASE,T=(R,j)=>j===go||j===Lr||!R.equals(O)?R.multiplyUnsafe(j):R.multiply(j),$=T(this,w).add(T(p,S));return $.is0()?void 0:$}toAffine(p){const{px:w,py:S,pz:O}=this,T=this.is0();p==null&&(p=T?n.ONE:n.inv(O));const $=n.mul(w,p),R=n.mul(S,p),j=n.mul(O,p);if(T)return{x:n.ZERO,y:n.ZERO};if(!n.eql(j,n.ONE))throw new Error("invZ was invalid");return{x:$,y:R}}isTorsionFree(){const{h:p,isTorsionFree:w}=e;if(p===Lr)return!0;if(w)return w(d,this);throw new Error("isTorsionFree() has not been declared for the elliptic curve")}clearCofactor(){const{h:p,clearCofactor:w}=e;return p===Lr?this:w?w(d,this):this.multiplyUnsafe(e.h)}toRawBytes(p=!0){return this.assertValidity(),r(d,this,p)}toHex(p=!0){return Hl(this.toRawBytes(p))}}d.BASE=new d(e.Gx,e.Gy,n.ONE),d.ZERO=new d(n.ZERO,n.ONE,n.ZERO);const h=e.nBitLength,g=e9(d,e.endo?Math.ceil(h/2):h);return{CURVE:e,ProjectivePoint:d,normPrivateKeyToScalar:l,weierstrassEquation:o,isWithinCurveOrder:s}}function o9(t){const e=dA(t);return Ju(e,{hash:"hash",hmac:"function",randomBytes:"function"},{bits2int:"function",bits2int_modN:"function",lowS:"boolean"}),Object.freeze({lowS:!0,...e})}function s9(t){const e=o9(t),{Fp:n,n:r}=e,i=n.BYTES+1,o=2*n.BYTES+1;function s(y){return go<y&&y<n.ORDER}function a(y){return tr(y,r)}function l(y){return _m(y,r)}const{ProjectivePoint:c,normPrivateKeyToScalar:u,weierstrassEquation:d,isWithinCurveOrder:h}=i9({...e,toBytes(y,E,I){const N=E.toAffine(),D=n.toBytes(N.x),M=Xu;return I?M(Uint8Array.from([E.hasEvenY()?2:3]),D):M(Uint8Array.from([4]),D,n.toBytes(N.y))},fromBytes(y){const E=y.length,I=y[0],N=y.subarray(1);if(E===i&&(I===2||I===3)){const D=sa(N);if(!s(D))throw new Error("Point is not on curve");const M=d(D);let P=n.sqrt(M);const m=(P&Lr)===Lr;return(I&1)===1!==m&&(P=n.neg(P)),{x:D,y:P}}else if(E===o&&I===4){const D=n.fromBytes(N.subarray(0,n.BYTES)),M=n.fromBytes(N.subarray(n.BYTES,2*n.BYTES));return{x:D,y:M}}else throw new Error(`Point of length ${E} was invalid. Expected ${i} compressed bytes or ${o} uncompressed bytes`)}}),g=y=>Hl(Gl(y,e.nByteLength));function b(y){const E=r>>Lr;return y>E}function p(y){return b(y)?a(-y):y}const w=(y,E,I)=>sa(y.slice(E,I));class S{constructor(E,I,N){this.r=E,this.s=I,this.recovery=N,this.assertValidity()}static fromCompact(E){const I=e.nByteLength;return E=ti("compactSignature",E,I*2),new S(w(E,0,I),w(E,I,2*I))}static fromDER(E){const{r:I,s:N}=la.toSig(ti("DER",E));return new S(I,N)}assertValidity(){if(!h(this.r))throw new Error("r must be 0 < r < CURVE.n");if(!h(this.s))throw new Error("s must be 0 < s < CURVE.n")}addRecoveryBit(E){return new S(this.r,this.s,E)}recoverPublicKey(E){const{r:I,s:N,recovery:D}=this,M=q(ti("msgHash",E));if(D==null||![0,1,2,3].includes(D))throw new Error("recovery id invalid");const P=D===2||D===3?I+e.n:I;if(P>=n.ORDER)throw new Error("recovery id 2 or 3 invalid");const m=(D&1)===0?"02":"03",v=c.fromHex(m+g(P)),B=l(P),U=a(-M*B),Q=a(N*B),ee=c.BASE.multiplyAndAddUnsafe(v,U,Q);if(!ee)throw new Error("point at infinify");return ee.assertValidity(),ee}hasHighS(){return b(this.s)}normalizeS(){return this.hasHighS()?new S(this.r,a(-this.s),this.recovery):this}toDERRawBytes(){return Wl(this.toDERHex())}toDERHex(){return la.hexFromSig({r:this.r,s:this.s})}toCompactRawBytes(){return Wl(this.toCompactHex())}toCompactHex(){return g(this.r)+g(this.s)}}const O={isValidPrivateKey(y){try{return u(y),!0}catch(E){return!1}},normPrivateKeyToScalar:u,randomPrivateKey:()=>{const y=uA(e.n);return J7(e.randomBytes(y),e.n)},precompute(y=8,E=c.BASE){return E._setWindowSize(y),E.multiply(BigInt(3)),E}};function T(y,E=!0){return c.fromPrivateKey(y).toRawBytes(E)}function $(y){const E=y instanceof Uint8Array,I=typeof y=="string",N=(E||I)&&y.length;return E?N===i||N===o:I?N===2*i||N===2*o:y instanceof c}function R(y,E,I=!0){if($(y))throw new Error("first arg must be private key");if(!$(E))throw new Error("second arg must be public key");return c.fromHex(E).multiply(u(y)).toRawBytes(I)}const j=e.bits2int||function(y){const E=sa(y),I=y.length*8-e.nBitLength;return I>0?E>>BigInt(I):E},q=e.bits2int_modN||function(y){return a(j(y))},G=Mm(e.nBitLength);function L(y){if(typeof y!="bigint")throw new Error("bigint expected");if(!(go<=y&&y<G))throw new Error(`bigint expected < 2^${e.nBitLength}`);return Gl(y,e.nByteLength)}function V(y,E,I=W){if(["recovered","canonical"].some(Y=>Y in I))throw new Error("sign() legacy options not supported");const{hash:N,randomBytes:D}=e;let{lowS:M,prehash:P,extraEntropy:m}=I;M==null&&(M=!0),y=ti("msgHash",y),P&&(y=ti("prehashed msgHash",N(y)));const v=q(y),B=u(E),U=[L(B),L(v)];if(m!=null){const Y=m===!0?D(n.BYTES):m;U.push(ti("extraEntropy",Y))}const Q=Xu(...U),ee=v;function Z(Y){const re=j(Y);if(!h(re))return;const de=l(re),se=c.BASE.multiply(re).toAffine(),me=a(se.x);if(me===go)return;const Ae=a(de*a(ee+me*B));if(Ae===go)return;let Re=(se.x===me?0:2)|Number(se.y&Lr),Ct=Ae;return M&&b(Ae)&&(Ct=p(Ae),Re^=1),new S(me,Ct,Re)}return{seed:Q,k2sig:Z}}const W={lowS:e.lowS,prehash:!1},z={lowS:e.lowS,prehash:!1};function C(y,E,I=W){const{seed:N,k2sig:D}=V(y,E,I),M=e;return oA(M.hash.outputLen,M.nByteLength,M.hmac)(N,D)}c.BASE._setWindowSize(8);function f(y,E,I,N=z){var se;const D=y;if(E=ti("msgHash",E),I=ti("publicKey",I),"strict"in N)throw new Error("options.strict was renamed to lowS");const{lowS:M,prehash:P}=N;let m,v;try{if(typeof D=="string"||D instanceof Uint8Array)try{m=S.fromDER(D)}catch(me){if(!(me instanceof la.Err))throw me;m=S.fromCompact(D)}else if(typeof D=="object"&&typeof D.r=="bigint"&&typeof D.s=="bigint"){const{r:me,s:Ae}=D;m=new S(me,Ae)}else throw new Error("PARSE");v=c.fromHex(I)}catch(me){if(me.message==="PARSE")throw new Error("signature must be Signature instance, Uint8Array or hex string");return!1}if(M&&m.hasHighS())return!1;P&&(E=e.hash(E));const{r:B,s:U}=m,Q=q(E),ee=l(U),Z=a(Q*ee),Y=a(B*ee),re=(se=c.BASE.multiplyAndAddUnsafe(v,Z,Y))==null?void 0:se.toAffine();return re?a(re.x)===B:!1}return{CURVE:e,getPublicKey:T,getSharedSecret:R,sign:C,verify:f,ProjectivePoint:c,Signature:S,utils:O}}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */function a9(t){return{hash:t,hmac:(e,...n)=>LS(t,e,t7(...n)),randomBytes:n7}}function l9(t,e){const n=r=>s9({...t,...a9(r)});return Object.freeze({...n(e),create:n})}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const hA=BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f"),pA=BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),c9=BigInt(1),Dm=BigInt(2),gA=(t,e)=>(t+e/Dm)/e;function u9(t){const e=hA,n=BigInt(3),r=BigInt(6),i=BigInt(11),o=BigInt(22),s=BigInt(23),a=BigInt(44),l=BigInt(88),c=t*t*t%e,u=c*c*t%e,d=Mr(u,n,e)*u%e,h=Mr(d,n,e)*u%e,g=Mr(h,Dm,e)*c%e,b=Mr(g,i,e)*g%e,p=Mr(b,o,e)*b%e,w=Mr(p,a,e)*p%e,S=Mr(w,l,e)*w%e,O=Mr(S,a,e)*p%e,T=Mr(O,n,e)*u%e,$=Mr(T,s,e)*b%e,R=Mr($,r,e)*c%e,j=Mr(R,Dm,e);if(!zm.eql(zm.sqr(j),t))throw new Error("Cannot find square root");return j}const zm=X7(hA,void 0,void 0,{sqrt:u9}),us=l9({a:BigInt(0),b:BigInt(7),Fp:zm,n:pA,Gx:BigInt("55066263022277343669578718895168534326250603453777594175500187360389116729240"),Gy:BigInt("32670510020758816978083085130507043184471273380659243275938904335757337482424"),h:BigInt(1),lowS:!0,endo:{beta:BigInt("0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee"),splitScalar:t=>{const e=pA,n=BigInt("0x3086d221a7d46bcde86c90e49284eb15"),r=-c9*BigInt("0xe4437ed6010e88286f547fa90abfe4c3"),i=BigInt("0x114ca50f7a8e2f3f657c1108d9d44cfd8"),o=n,s=BigInt("0x100000000000000000000000000000000"),a=gA(o*t,e),l=gA(-r*t,e);let c=tr(t-a*n-l*i,e),u=tr(-a*r-l*o,e);const d=c>s,h=u>s;if(d&&(c=e-c),h&&(u=e-u),c>s||u>s)throw new Error("splitScalar: Endomorphism failed, k="+t);return{k1neg:d,k1:c,k2neg:h,k2:u}}}},_S);BigInt(0),us.ProjectivePoint;const Zu="0x0000000000000000000000000000000000000000",mA="0x0000000000000000000000000000000000000000000000000000000000000000",yA=BigInt(0),bA=BigInt(1),vA=BigInt(2),wA=BigInt(27),xA=BigInt(28),Uh=BigInt(35),jl={};function EA(t){return ho(nn(t),32)}const ci=class ci{constructor(e,n,r,i){ce(this,Ec);ce(this,_i);ce(this,Sc);ce(this,Ha);Th(e,jl,"Signature"),K(this,Ec,n),K(this,_i,r),K(this,Sc,i),K(this,Ha,null)}get r(){return F(this,Ec)}set r(e){ne(Vl(e)===32,"invalid r","value",e),K(this,Ec,ve(e))}get s(){return ne(parseInt(F(this,_i).substring(0,3))<8,"non-canonical s; use ._s","s",F(this,_i)),F(this,_i)}set s(e){ne(Vl(e)===32,"invalid s","value",e),K(this,_i,ve(e))}get _s(){return F(this,_i)}isValid(){return parseInt(F(this,_i).substring(0,3))<8}get v(){return F(this,Sc)}set v(e){const n=$e(e,"value");ne(n===27||n===28,"invalid v","v",e),K(this,Sc,n)}get networkV(){return F(this,Ha)}get legacyChainId(){const e=this.networkV;return e==null?null:ci.getChainId(e)}get yParity(){return this.v===27?0:1}get yParityAndS(){const e=Ue(this.s);return this.yParity&&(e[0]|=128),ve(e)}get compactSerialized(){return xt([this.r,this.yParityAndS])}get serialized(){return xt([this.r,this.s,this.yParity?"0x1c":"0x1b"])}[Symbol.for("nodejs.util.inspect.custom")](){return`Signature { r: "${this.r}", s: "${this._s}"${this.isValid()?"":', valid: "false"'}, yParity: ${this.yParity}, networkV: ${this.networkV} }`}clone(){const e=new ci(jl,this.r,this._s,this.v);return this.networkV&&K(e,Ha,this.networkV),e}toJSON(){const e=this.networkV;return{_type:"signature",networkV:e!=null?e.toString():null,r:this.r,s:this._s,v:this.v}}static getChainId(e){const n=Se(e,"v");return n==wA||n==xA?yA:(ne(n>=Uh,"invalid EIP-155 v","v",e),(n-Uh)/vA)}static getChainIdV(e,n){return Se(e)*vA+BigInt(35+n-27)}static getNormalizedV(e){const n=Se(e);return n===yA||n===wA?27:n===bA||n===xA?28:(ne(n>=Uh,"invalid v","v",e),n&bA?27:28)}static from(e){function n(c,u){ne(c,u,"signature",e)}if(e==null)return new ci(jl,mA,mA,27);if(typeof e=="string"){const c=Ue(e,"signature");if(c.length===64){const u=ve(c.slice(0,32)),d=c.slice(32,64),h=d[0]&128?28:27;return d[0]&=127,new ci(jl,u,ve(d),h)}if(c.length===65){const u=ve(c.slice(0,32)),d=ve(c.slice(32,64)),h=ci.getNormalizedV(c[64]);return new ci(jl,u,d,h)}n(!1,"invalid raw signature length")}if(e instanceof ci)return e.clone();const r=e.r;n(r!=null,"missing r");const i=EA(r),o=function(c,u){if(c!=null)return EA(c);if(u!=null){n(pt(u,32),"invalid yParityAndS");const d=Ue(u);return d[0]&=127,ve(d)}n(!1,"missing s")}(e.s,e.yParityAndS),{networkV:s,v:a}=function(c,u,d){if(c!=null){const h=Se(c);return{networkV:h>=Uh?h:void 0,v:ci.getNormalizedV(h)}}if(u!=null)return n(pt(u,32),"invalid yParityAndS"),{v:Ue(u)[0]&128?28:27};if(d!=null){switch($e(d,"sig.yParity")){case 0:return{v:27};case 1:return{v:28}}n(!1,"invalid yParity")}n(!1,"missing v")}(e.v,e.yParityAndS,e.yParity),l=new ci(jl,i,o,a);return s&&K(l,Ha,s),n(e.yParity==null||$e(e.yParity,"sig.yParity")===l.yParity,"yParity mismatch"),n(e.yParityAndS==null||e.yParityAndS===l.yParityAndS,"yParityAndS mismatch"),l}};Ec=new WeakMap,_i=new WeakMap,Sc=new WeakMap,Ha=new WeakMap;let nr=ci;const Wa=class Wa{constructor(e){ce(this,No);ne(Vl(e)===32,"invalid private key","privateKey","[REDACTED]"),K(this,No,ve(e))}get privateKey(){return F(this,No)}get publicKey(){return Wa.computePublicKey(F(this,No))}get compressedPublicKey(){return Wa.computePublicKey(F(this,No),!0)}sign(e){ne(Vl(e)===32,"invalid digest length","digest",e);const n=us.sign(Dn(e),Dn(F(this,No)),{lowS:!0});return nr.from({r:ns(n.r,32),s:ns(n.s,32),v:n.recovery?28:27})}computeSharedSecret(e){const n=Wa.computePublicKey(e);return ve(us.getSharedSecret(Dn(F(this,No)),Ue(n),!1))}static computePublicKey(e,n){let r=Ue(e,"key");if(r.length===32){const o=us.getPublicKey(r,!!n);return ve(o)}if(r.length===64){const o=new Uint8Array(65);o[0]=4,o.set(r,1),r=o}const i=us.ProjectivePoint.fromHex(r);return ve(i.toRawBytes(n))}static recoverPublicKey(e,n){ne(Vl(e)===32,"invalid digest length","digest",e);const r=nr.from(n);let i=us.Signature.fromCompact(Dn(xt([r.r,r.s])));i=i.addRecoveryBit(r.yParity);const o=i.recoverPublicKey(Dn(e));return ne(o!=null,"invalid signature for digest","signature",n),"0x"+o.toHex(!1)}static addPoints(e,n,r){const i=us.ProjectivePoint.fromHex(Wa.computePublicKey(e).substring(2)),o=us.ProjectivePoint.fromHex(Wa.computePublicKey(n).substring(2));return"0x"+i.add(o).toHex(!!r)}};No=new WeakMap;let ed=Wa;const d9=BigInt(0),f9=BigInt(36);function SA(t){t=t.toLowerCase();const e=t.substring(2).split(""),n=new Uint8Array(40);for(let i=0;i<40;i++)n[i]=e[i].charCodeAt(0);const r=Ue(Ft(n));for(let i=0;i<40;i+=2)r[i>>1]>>4>=8&&(e[i]=e[i].toUpperCase()),(r[i>>1]&15)>=8&&(e[i+1]=e[i+1].toUpperCase());return"0x"+e.join("")}const Um={};for(let t=0;t<10;t++)Um[String(t)]=String(t);for(let t=0;t<26;t++)Um[String.fromCharCode(65+t)]=String(10+t);const AA=15;function h9(t){t=t.toUpperCase(),t=t.substring(4)+t.substring(0,2)+"00";let e=t.split("").map(r=>Um[r]).join("");for(;e.length>=AA;){let r=e.substring(0,AA);e=parseInt(r,10)%97+e.substring(r.length)}let n=String(98-parseInt(e,10)%97);for(;n.length<2;)n="0"+n;return n}const p9=function(){const t={};for(let e=0;e<36;e++){const n="0123456789abcdefghijklmnopqrstuvwxyz"[e];t[n]=BigInt(e)}return t}();function g9(t){t=t.toLowerCase();let e=d9;for(let n=0;n<t.length;n++)e=e*f9+p9[t[n]];return e}function rt(t){if(ne(typeof t=="string","invalid address","address",t),t.match(/^(0x)?[0-9a-fA-F]{40}$/)){t.startsWith("0x")||(t="0x"+t);const e=SA(t);return ne(!t.match(/([A-F].*[a-f])|([a-f].*[A-F])/)||e===t,"bad address checksum","address",t),e}if(t.match(/^XE[0-9]{2}[0-9A-Za-z]{30,31}$/)){ne(t.substring(2,4)===h9(t),"bad icap checksum","address",t);let e=g9(t.substring(4)).toString(16);for(;e.length<40;)e="0"+e;return SA("0x"+e)}ne(!1,"invalid address","address",t)}function m9(t){const e=rt(t.from);let r=Se(t.nonce,"tx.nonce").toString(16);return r==="0"?r="0x":r.length%2?r="0x0"+r:r="0x"+r,rt(Et(Ft(os([e,r])),12))}function kA(t){return t&&typeof t.getAddress=="function"}async function $m(t,e){const n=await e;return(n==null||n==="0x0000000000000000000000000000000000000000")&&(fe(typeof t!="string","unconfigured name","UNCONFIGURED_NAME",{value:t}),ne(!1,"invalid AddressLike value; did not resolve to a value address","target",t)),rt(n)}function Un(t,e){if(typeof t=="string")return t.match(/^0x[0-9a-f]{40}$/i)?rt(t):(fe(e!=null,"ENS resolution requires a provider","UNSUPPORTED_OPERATION",{operation:"resolveName"}),$m(t,e.resolveName(t)));if(kA(t))return $m(t,t.getAddress());if(t&&typeof t.then=="function")return $m(t,t);ne(!1,"unsupported addressable value","target",t)}const mo={};function Ee(t,e){let n=!1;return e<0&&(n=!0,e*=-1),new In(mo,`${n?"":"u"}int${e}`,t,{signed:n,width:e})}function Je(t,e){return new In(mo,`bytes${e||""}`,t,{size:e})}const CA=Symbol.for("_ethers_typed"),Bo=class Bo{constructor(e,n,r,i){oe(this,"type");oe(this,"value");ce(this,Ga);oe(this,"_typedSymbol");i==null&&(i=null),Th(mo,e,"Typed"),Te(this,{_typedSymbol:CA,type:n,value:r}),K(this,Ga,i),this.format()}format(){if(this.type==="array")throw new Error("");if(this.type==="dynamicArray")throw new Error("");return this.type==="tuple"?`tuple(${this.value.map(e=>e.format()).join(",")})`:this.type}defaultValue(){return 0}minValue(){return 0}maxValue(){return 0}isBigInt(){return!!this.type.match(/^u?int[0-9]+$/)}isData(){return this.type.startsWith("bytes")}isString(){return this.type==="string"}get tupleName(){if(this.type!=="tuple")throw TypeError("not a tuple");return F(this,Ga)}get arrayLength(){if(this.type!=="array")throw TypeError("not an array");return F(this,Ga)===!0?-1:F(this,Ga)===!1?this.value.length:null}static from(e,n){return new Bo(mo,e,n)}static uint8(e){return Ee(e,8)}static uint16(e){return Ee(e,16)}static uint24(e){return Ee(e,24)}static uint32(e){return Ee(e,32)}static uint40(e){return Ee(e,40)}static uint48(e){return Ee(e,48)}static uint56(e){return Ee(e,56)}static uint64(e){return Ee(e,64)}static uint72(e){return Ee(e,72)}static uint80(e){return Ee(e,80)}static uint88(e){return Ee(e,88)}static uint96(e){return Ee(e,96)}static uint104(e){return Ee(e,104)}static uint112(e){return Ee(e,112)}static uint120(e){return Ee(e,120)}static uint128(e){return Ee(e,128)}static uint136(e){return Ee(e,136)}static uint144(e){return Ee(e,144)}static uint152(e){return Ee(e,152)}static uint160(e){return Ee(e,160)}static uint168(e){return Ee(e,168)}static uint176(e){return Ee(e,176)}static uint184(e){return Ee(e,184)}static uint192(e){return Ee(e,192)}static uint200(e){return Ee(e,200)}static uint208(e){return Ee(e,208)}static uint216(e){return Ee(e,216)}static uint224(e){return Ee(e,224)}static uint232(e){return Ee(e,232)}static uint240(e){return Ee(e,240)}static uint248(e){return Ee(e,248)}static uint256(e){return Ee(e,256)}static uint(e){return Ee(e,256)}static int8(e){return Ee(e,-8)}static int16(e){return Ee(e,-16)}static int24(e){return Ee(e,-24)}static int32(e){return Ee(e,-32)}static int40(e){return Ee(e,-40)}static int48(e){return Ee(e,-48)}static int56(e){return Ee(e,-56)}static int64(e){return Ee(e,-64)}static int72(e){return Ee(e,-72)}static int80(e){return Ee(e,-80)}static int88(e){return Ee(e,-88)}static int96(e){return Ee(e,-96)}static int104(e){return Ee(e,-104)}static int112(e){return Ee(e,-112)}static int120(e){return Ee(e,-120)}static int128(e){return Ee(e,-128)}static int136(e){return Ee(e,-136)}static int144(e){return Ee(e,-144)}static int152(e){return Ee(e,-152)}static int160(e){return Ee(e,-160)}static int168(e){return Ee(e,-168)}static int176(e){return Ee(e,-176)}static int184(e){return Ee(e,-184)}static int192(e){return Ee(e,-192)}static int200(e){return Ee(e,-200)}static int208(e){return Ee(e,-208)}static int216(e){return Ee(e,-216)}static int224(e){return Ee(e,-224)}static int232(e){return Ee(e,-232)}static int240(e){return Ee(e,-240)}static int248(e){return Ee(e,-248)}static int256(e){return Ee(e,-256)}static int(e){return Ee(e,-256)}static bytes1(e){return Je(e,1)}static bytes2(e){return Je(e,2)}static bytes3(e){return Je(e,3)}static bytes4(e){return Je(e,4)}static bytes5(e){return Je(e,5)}static bytes6(e){return Je(e,6)}static bytes7(e){return Je(e,7)}static bytes8(e){return Je(e,8)}static bytes9(e){return Je(e,9)}static bytes10(e){return Je(e,10)}static bytes11(e){return Je(e,11)}static bytes12(e){return Je(e,12)}static bytes13(e){return Je(e,13)}static bytes14(e){return Je(e,14)}static bytes15(e){return Je(e,15)}static bytes16(e){return Je(e,16)}static bytes17(e){return Je(e,17)}static bytes18(e){return Je(e,18)}static bytes19(e){return Je(e,19)}static bytes20(e){return Je(e,20)}static bytes21(e){return Je(e,21)}static bytes22(e){return Je(e,22)}static bytes23(e){return Je(e,23)}static bytes24(e){return Je(e,24)}static bytes25(e){return Je(e,25)}static bytes26(e){return Je(e,26)}static bytes27(e){return Je(e,27)}static bytes28(e){return Je(e,28)}static bytes29(e){return Je(e,29)}static bytes30(e){return Je(e,30)}static bytes31(e){return Je(e,31)}static bytes32(e){return Je(e,32)}static address(e){return new Bo(mo,"address",e)}static bool(e){return new Bo(mo,"bool",!!e)}static bytes(e){return new Bo(mo,"bytes",e)}static string(e){return new Bo(mo,"string",e)}static array(e,n){throw new Error("not implemented yet")}static tuple(e,n){throw new Error("not implemented yet")}static overrides(e){return new Bo(mo,"overrides",Object.assign({},e))}static isTyped(e){return e&&typeof e=="object"&&"_typedSymbol"in e&&e._typedSymbol===CA}static dereference(e,n){if(Bo.isTyped(e)){if(e.type!==n)throw new Error(`invalid type: expecetd ${n}, got ${e.type}`);return e.value}return e}};Ga=new WeakMap;let In=Bo;class y9 extends po{constructor(e){super("address","address",e,!1)}defaultValue(){return"0x0000000000000000000000000000000000000000"}encode(e,n){let r=In.dereference(n,"string");try{r=rt(r)}catch(i){return this._throwError(i.message,n)}return e.writeValue(r)}decode(e){return rt(ns(e.readValue(),20))}}class b9 extends po{constructor(n){super(n.name,n.type,"_",n.dynamic);oe(this,"coder");this.coder=n}defaultValue(){return this.coder.defaultValue()}encode(n,r){return this.coder.encode(n,r)}decode(n){return this.coder.decode(n)}}function IA(t,e,n){let r=[];if(Array.isArray(n))r=n;else if(n&&typeof n=="object"){let l={};r=e.map(c=>{const u=c.localName;return fe(u,"cannot encode object for signature with missing names","INVALID_ARGUMENT",{argument:"values",info:{coder:c},value:n}),fe(!l[u],"cannot encode object for signature with duplicate names","INVALID_ARGUMENT",{argument:"values",info:{coder:c},value:n}),l[u]=!0,n[u]})}else ne(!1,"invalid tuple value","tuple",n);ne(e.length===r.length,"types/value length mismatch","tuple",n);let i=new Em,o=new Em,s=[];e.forEach((l,c)=>{let u=r[c];if(l.dynamic){let d=o.length;l.encode(o,u);let h=i.writeUpdatableValue();s.push(g=>{h(g+d)})}else l.encode(i,u)}),s.forEach(l=>{l(i.length)});let a=t.appendWriter(i);return a+=t.appendWriter(o),a}function OA(t,e){let n=[],r=[],i=t.subReader(0);return e.forEach(o=>{let s=null;if(o.dynamic){let a=t.readIndex(),l=i.subReader(a);try{s=o.decode(l)}catch(c){if(bn(c,"BUFFER_OVERRUN"))throw c;s=c,s.baseType=o.name,s.name=o.localName,s.type=o.type}}else try{s=o.decode(t)}catch(a){if(bn(a,"BUFFER_OVERRUN"))throw a;s=a,s.baseType=o.name,s.name=o.localName,s.type=o.type}if(s==null)throw new Error("investigate");n.push(s),r.push(o.localName||null)}),zl.fromItems(n,r)}class v9 extends po{constructor(n,r,i){const o=n.type+"["+(r>=0?r:"")+"]",s=r===-1||n.dynamic;super("array",o,i,s);oe(this,"coder");oe(this,"length");Te(this,{coder:n,length:r})}defaultValue(){const n=this.coder.defaultValue(),r=[];for(let i=0;i<this.length;i++)r.push(n);return r}encode(n,r){const i=In.dereference(r,"array");Array.isArray(i)||this._throwError("expected array value",i);let o=this.length;o===-1&&(o=i.length,n.writeValue(i.length)),aS(i.length,o,"coder array"+(this.localName?" "+this.localName:""));let s=[];for(let a=0;a<i.length;a++)s.push(this.coder);return IA(n,s,i)}decode(n){let r=this.length;r===-1&&(r=n.readIndex(),fe(r*zn<=n.dataLength,"insufficient data length","BUFFER_OVERRUN",{buffer:n.bytes,offset:r*zn,length:n.dataLength}));let i=[];for(let o=0;o<r;o++)i.push(new b9(this.coder));return OA(n,i)}}class w9 extends po{constructor(e){super("bool","bool",e,!1)}defaultValue(){return!1}encode(e,n){const r=In.dereference(n,"bool");return e.writeValue(r?1:0)}decode(e){return!!e.readValue()}}class TA extends po{constructor(e,n){super(e,e,n,!0)}defaultValue(){return"0x"}encode(e,n){n=Dn(n);let r=e.writeValue(n.length);return r+=e.writeBytes(n),r}decode(e){return e.readBytes(e.readIndex(),!0)}}class x9 extends TA{constructor(e){super("bytes",e)}decode(e){return ve(super.decode(e))}}class E9 extends po{constructor(n,r){let i="bytes"+String(n);super(i,i,r,!1);oe(this,"size");Te(this,{size:n},{size:"number"})}defaultValue(){return"0x0000000000000000000000000000000000000000000000000000000000000000".substring(0,2+this.size*2)}encode(n,r){let i=Dn(In.dereference(r,this.type));return i.length!==this.size&&this._throwError("incorrect data length",r),n.writeBytes(i)}decode(n){return ve(n.readBytes(this.size))}}const S9=new Uint8Array([]);class A9 extends po{constructor(e){super("null","",e,!1)}defaultValue(){return null}encode(e,n){return n!=null&&this._throwError("not null",n),e.writeBytes(S9)}decode(e){return e.readBytes(0),null}}const k9=BigInt(0),C9=BigInt(1),I9=BigInt("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");class O9 extends po{constructor(n,r,i){const o=(r?"int":"uint")+n*8;super(o,o,i,!1);oe(this,"size");oe(this,"signed");Te(this,{size:n,signed:r},{size:"number",signed:"boolean"})}defaultValue(){return 0}encode(n,r){let i=Se(In.dereference(r,this.type)),o=Ku(I9,zn*8);if(this.signed){let s=Ku(o,this.size*8-1);(i>s||i<-(s+C9))&&this._throwError("value out-of-bounds",r),i=dS(i,8*zn)}else(i<k9||i>Ku(o,this.size*8))&&this._throwError("value out-of-bounds",r);return n.writeValue(i)}decode(n){let r=Ku(n.readValue(),this.size*8);return this.signed&&(r=RU(r,this.size*8)),r}}class T9 extends TA{constructor(e){super("string",e)}defaultValue(){return""}encode(e,n){return super.encode(e,Oi(In.dereference(n,"string")))}decode(e){return Bh(super.decode(e))}}class $h extends po{constructor(n,r){let i=!1;const o=[];n.forEach(a=>{a.dynamic&&(i=!0),o.push(a.type)});const s="tuple("+o.join(",")+")";super("tuple",s,r,i);oe(this,"coders");Te(this,{coders:Object.freeze(n.slice())})}defaultValue(){const n=[];this.coders.forEach(i=>{n.push(i.defaultValue())});const r=this.coders.reduce((i,o)=>{const s=o.localName;return s&&(i[s]||(i[s]=0),i[s]++),i},{});return this.coders.forEach((i,o)=>{let s=i.localName;!s||r[s]!==1||(s==="length"&&(s="_length"),n[s]==null&&(n[s]=n[o]))}),Object.freeze(n)}encode(n,r){const i=In.dereference(r,"tuple");return IA(n,this.coders,i)}decode(n){return OA(n,this.coders)}}function Hm(t,e){return{address:rt(t),storageKeys:e.map((n,r)=>(ne(pt(n,32),"invalid slot",`storageKeys[${r}]`,n),n.toLowerCase()))}}function ca(t){if(Array.isArray(t))return t.map((n,r)=>Array.isArray(n)?(ne(n.length===2,"invalid slot set",`value[${r}]`,n),Hm(n[0],n[1])):(ne(n!=null&&typeof n=="object","invalid address-slot set","value",t),Hm(n.address,n.storageKeys)));ne(t!=null&&typeof t=="object","invalid access list","value",t);const e=Object.keys(t).map(n=>{const r=t[n].reduce((i,o)=>(i[o]=!0,i),{});return Hm(n,Object.keys(r).sort())});return e.sort((n,r)=>n.address.localeCompare(r.address)),e}function PA(t){return{address:rt(t.address),nonce:Se(t.nonce!=null?t.nonce:0),chainId:Se(t.chainId!=null?t.chainId:0),signature:nr.from(t.signature)}}function P9(t){let e;return typeof t=="string"?e=ed.computePublicKey(t,!1):e=t.publicKey,rt(Ft("0x"+e.substring(4)).substring(26))}function N9(t,e){return P9(ed.recoverPublicKey(t,e))}const un=BigInt(0),B9=BigInt(2),R9=BigInt(27),M9=BigInt(28),L9=BigInt(35),F9=BigInt("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"),Wm=4096*32;function _9(t){return{blobToKzgCommitment:r=>{if("computeBlobProof"in t){if("blobToKzgCommitment"in t&&typeof t.blobToKzgCommitment=="function")return Ue(t.blobToKzgCommitment(ve(r)))}else if("blobToKzgCommitment"in t&&typeof t.blobToKzgCommitment=="function")return Ue(t.blobToKzgCommitment(r));if("blobToKZGCommitment"in t&&typeof t.blobToKZGCommitment=="function")return Ue(t.blobToKZGCommitment(ve(r)));ne(!1,"unsupported KZG library","kzg",t)},computeBlobKzgProof:(r,i)=>{if("computeBlobProof"in t&&typeof t.computeBlobProof=="function")return Ue(t.computeBlobProof(ve(r),ve(i)));if("computeBlobKzgProof"in t&&typeof t.computeBlobKzgProof=="function")return t.computeBlobKzgProof(r,i);if("computeBlobKZGProof"in t&&typeof t.computeBlobKZGProof=="function")return Ue(t.computeBlobKZGProof(ve(r),ve(i)));ne(!1,"unsupported KZG library","kzg",t)}}}function NA(t,e){let n=t.toString(16);for(;n.length<2;)n="0"+n;return n+=$l(e).substring(4),"0x"+n}function Kl(t){return t==="0x"?null:rt(t)}function Hh(t,e){try{return ca(t)}catch(n){ne(!1,n.message,e,t)}}function V9(t,e){try{if(!Array.isArray(t))throw new Error("authorizationList: invalid array");const n=[];for(let r=0;r<t.length;r++){const i=t[r];if(!Array.isArray(i))throw new Error(`authorization[${r}]: invalid array`);if(i.length!==6)throw new Error(`authorization[${r}]: wrong length`);if(!i[1])throw new Error(`authorization[${r}]: null address`);n.push({address:Kl(i[1]),nonce:lt(i[2],"nonce"),chainId:lt(i[0],"chainId"),signature:nr.from({yParity:ua(i[3],"yParity"),r:ho(i[4],32),s:ho(i[5],32)})})}return n}catch(n){ne(!1,n.message,e,t)}}function ua(t,e){return t==="0x"?0:$e(t,e)}function lt(t,e){if(t==="0x")return un;const n=Se(t,e);return ne(n<=F9,"value exceeds uint size",e,n),n}function qe(t,e){const n=Se(t,"value"),r=nn(n);return ne(r.length<=32,"value too large",`tx.${e}`,n),r}function Wh(t){return ca(t).map(e=>[e.address,e.storageKeys])}function D9(t){return t.map(e=>[qe(e.chainId,"chainId"),e.address,qe(e.nonce,"nonce"),qe(e.signature.yParity,"yParity"),nn(e.signature.r),nn(e.signature.s)])}function z9(t,e){ne(Array.isArray(t),`invalid ${e}`,"value",t);for(let n=0;n<t.length;n++)ne(pt(t[n],32),"invalid ${ param } hash",`value[${n}]`,t[n]);return t}function U9(t){const e=qu(t);ne(Array.isArray(e)&&(e.length===9||e.length===6),"invalid field count for legacy transaction","data",t);const n={type:0,nonce:ua(e[0],"nonce"),gasPrice:lt(e[1],"gasPrice"),gasLimit:lt(e[2],"gasLimit"),to:Kl(e[3]),value:lt(e[4],"value"),data:ve(e[5]),chainId:un};if(e.length===6)return n;const r=lt(e[6],"v"),i=lt(e[7],"r"),o=lt(e[8],"s");if(i===un&&o===un)n.chainId=r;else{let s=(r-L9)/B9;s<un&&(s=un),n.chainId=s,ne(s!==un||r===R9||r===M9,"non-canonical legacy v","v",e[6]),n.signature=nr.from({r:ho(e[7],32),s:ho(e[8],32),v:r})}return n}function $9(t,e){const n=[qe(t.nonce,"nonce"),qe(t.gasPrice||0,"gasPrice"),qe(t.gasLimit,"gasLimit"),t.to||"0x",qe(t.value,"value"),t.data];let r=un;if(t.chainId!=un)r=Se(t.chainId,"tx.chainId"),ne(!e||e.networkV==null||e.legacyChainId===r,"tx.chainId/sig.v mismatch","sig",e);else if(t.signature){const o=t.signature.legacyChainId;o!=null&&(r=o)}if(!e)return r!==un&&(n.push(nn(r)),n.push("0x"),n.push("0x")),os(n);let i=BigInt(27+e.yParity);return r!==un?i=nr.getChainIdV(r,e.v):BigInt(e.v)!==i&&ne(!1,"tx.chainId/sig.v mismatch","sig",e),n.push(nn(i)),n.push(nn(e.r)),n.push(nn(e.s)),os(n)}function Gh(t,e){let n;try{if(n=ua(e[0],"yParity"),n!==0&&n!==1)throw new Error("bad yParity")}catch(s){ne(!1,"invalid yParity","yParity",e[0])}const r=ho(e[1],32),i=ho(e[2],32),o=nr.from({r,s:i,yParity:n});t.signature=o}function H9(t){const e=qu(Ue(t).slice(1));ne(Array.isArray(e)&&(e.length===9||e.length===12),"invalid field count for transaction type: 2","data",ve(t));const n={type:2,chainId:lt(e[0],"chainId"),nonce:ua(e[1],"nonce"),maxPriorityFeePerGas:lt(e[2],"maxPriorityFeePerGas"),maxFeePerGas:lt(e[3],"maxFeePerGas"),gasPrice:null,gasLimit:lt(e[4],"gasLimit"),to:Kl(e[5]),value:lt(e[6],"value"),data:ve(e[7]),accessList:Hh(e[8],"accessList")};return e.length===9||Gh(n,e.slice(9)),n}function W9(t,e){const n=[qe(t.chainId,"chainId"),qe(t.nonce,"nonce"),qe(t.maxPriorityFeePerGas||0,"maxPriorityFeePerGas"),qe(t.maxFeePerGas||0,"maxFeePerGas"),qe(t.gasLimit,"gasLimit"),t.to||"0x",qe(t.value,"value"),t.data,Wh(t.accessList||[])];return e&&(n.push(qe(e.yParity,"yParity")),n.push(nn(e.r)),n.push(nn(e.s))),xt(["0x02",os(n)])}function G9(t){const e=qu(Ue(t).slice(1));ne(Array.isArray(e)&&(e.length===8||e.length===11),"invalid field count for transaction type: 1","data",ve(t));const n={type:1,chainId:lt(e[0],"chainId"),nonce:ua(e[1],"nonce"),gasPrice:lt(e[2],"gasPrice"),gasLimit:lt(e[3],"gasLimit"),to:Kl(e[4]),value:lt(e[5],"value"),data:ve(e[6]),accessList:Hh(e[7],"accessList")};return e.length===8||Gh(n,e.slice(8)),n}function j9(t,e){const n=[qe(t.chainId,"chainId"),qe(t.nonce,"nonce"),qe(t.gasPrice||0,"gasPrice"),qe(t.gasLimit,"gasLimit"),t.to||"0x",qe(t.value,"value"),t.data,Wh(t.accessList||[])];return e&&(n.push(qe(e.yParity,"recoveryParam")),n.push(nn(e.r)),n.push(nn(e.s))),xt(["0x01",os(n)])}function K9(t){let e=qu(Ue(t).slice(1)),n="3",r=null;if(e.length===4&&Array.isArray(e[0])){n="3 (network format)";const o=e[1],s=e[2],a=e[3];ne(Array.isArray(o),"invalid network format: blobs not an array","fields[1]",o),ne(Array.isArray(s),"invalid network format: commitments not an array","fields[2]",s),ne(Array.isArray(a),"invalid network format: proofs not an array","fields[3]",a),ne(o.length===s.length,"invalid network format: blobs/commitments length mismatch","fields",e),ne(o.length===a.length,"invalid network format: blobs/proofs length mismatch","fields",e),r=[];for(let l=0;l<e[1].length;l++)r.push({data:o[l],commitment:s[l],proof:a[l]});e=e[0]}ne(Array.isArray(e)&&(e.length===11||e.length===14),`invalid field count for transaction type: ${n}`,"data",ve(t));const i={type:3,chainId:lt(e[0],"chainId"),nonce:ua(e[1],"nonce"),maxPriorityFeePerGas:lt(e[2],"maxPriorityFeePerGas"),maxFeePerGas:lt(e[3],"maxFeePerGas"),gasPrice:null,gasLimit:lt(e[4],"gasLimit"),to:Kl(e[5]),value:lt(e[6],"value"),data:ve(e[7]),accessList:Hh(e[8],"accessList"),maxFeePerBlobGas:lt(e[9],"maxFeePerBlobGas"),blobVersionedHashes:e[10]};r&&(i.blobs=r),ne(i.to!=null,`invalid address for transaction type: ${n}`,"data",t),ne(Array.isArray(i.blobVersionedHashes),"invalid blobVersionedHashes: must be an array","data",t);for(let o=0;o<i.blobVersionedHashes.length;o++)ne(pt(i.blobVersionedHashes[o],32),`invalid blobVersionedHash at index ${o}: must be length 32`,"data",t);return e.length===11||Gh(i,e.slice(11)),i}function q9(t,e,n){const r=[qe(t.chainId,"chainId"),qe(t.nonce,"nonce"),qe(t.maxPriorityFeePerGas||0,"maxPriorityFeePerGas"),qe(t.maxFeePerGas||0,"maxFeePerGas"),qe(t.gasLimit,"gasLimit"),t.to||Zu,qe(t.value,"value"),t.data,Wh(t.accessList||[]),qe(t.maxFeePerBlobGas||0,"maxFeePerBlobGas"),z9(t.blobVersionedHashes||[],"blobVersionedHashes")];return e&&(r.push(qe(e.yParity,"yParity")),r.push(nn(e.r)),r.push(nn(e.s)),n)?xt(["0x03",os([r,n.map(i=>i.data),n.map(i=>i.commitment),n.map(i=>i.proof)])]):xt(["0x03",os(r)])}function Y9(t){const e=qu(Ue(t).slice(1));ne(Array.isArray(e)&&(e.length===10||e.length===13),"invalid field count for transaction type: 4","data",ve(t));const n={type:4,chainId:lt(e[0],"chainId"),nonce:ua(e[1],"nonce"),maxPriorityFeePerGas:lt(e[2],"maxPriorityFeePerGas"),maxFeePerGas:lt(e[3],"maxFeePerGas"),gasPrice:null,gasLimit:lt(e[4],"gasLimit"),to:Kl(e[5]),value:lt(e[6],"value"),data:ve(e[7]),accessList:Hh(e[8],"accessList"),authorizationList:V9(e[9],"authorizationList")};return e.length===10||Gh(n,e.slice(10)),n}function Q9(t,e){const n=[qe(t.chainId,"chainId"),qe(t.nonce,"nonce"),qe(t.maxPriorityFeePerGas||0,"maxPriorityFeePerGas"),qe(t.maxFeePerGas||0,"maxFeePerGas"),qe(t.gasLimit,"gasLimit"),t.to||"0x",qe(t.value,"value"),t.data,Wh(t.accessList||[]),D9(t.authorizationList||[])];return e&&(n.push(qe(e.yParity,"yParity")),n.push(nn(e.r)),n.push(nn(e.s))),xt(["0x04",os(n)])}let BA=(Ar=class{constructor(){ce(this,Fc);ce(this,ui);ce(this,Ac);ce(this,kc);ce(this,Cc);ce(this,Ic);ce(this,Oc);ce(this,Tc);ce(this,Pc);ce(this,Nc);ce(this,Bc);ce(this,Rc);ce(this,Mc);ce(this,ja);ce(this,As);ce(this,Vi);ce(this,ks);ce(this,Lc);K(this,ui,null),K(this,Ac,null),K(this,Cc,0),K(this,Ic,un),K(this,Oc,null),K(this,Tc,null),K(this,Pc,null),K(this,kc,"0x"),K(this,Nc,un),K(this,Bc,un),K(this,Rc,null),K(this,Mc,null),K(this,ja,null),K(this,As,null),K(this,Vi,null),K(this,ks,null),K(this,Lc,null)}get type(){return F(this,ui)}set type(e){switch(e){case null:K(this,ui,null);break;case 0:case"legacy":K(this,ui,0);break;case 1:case"berlin":case"eip-2930":K(this,ui,1);break;case 2:case"london":case"eip-1559":K(this,ui,2);break;case 3:case"cancun":case"eip-4844":K(this,ui,3);break;case 4:case"pectra":case"eip-7702":K(this,ui,4);break;default:ne(!1,"unsupported transaction type","type",e)}}get typeName(){switch(this.type){case 0:return"legacy";case 1:return"eip-2930";case 2:return"eip-1559";case 3:return"eip-4844";case 4:return"eip-7702"}return null}get to(){const e=F(this,Ac);return e==null&&this.type===3?Zu:e}set to(e){K(this,Ac,e==null?null:rt(e))}get nonce(){return F(this,Cc)}set nonce(e){K(this,Cc,$e(e,"value"))}get gasLimit(){return F(this,Ic)}set gasLimit(e){K(this,Ic,Se(e))}get gasPrice(){const e=F(this,Oc);return e==null&&(this.type===0||this.type===1)?un:e}set gasPrice(e){K(this,Oc,e==null?null:Se(e,"gasPrice"))}get maxPriorityFeePerGas(){const e=F(this,Tc);return e==null?this.type===2||this.type===3?un:null:e}set maxPriorityFeePerGas(e){K(this,Tc,e==null?null:Se(e,"maxPriorityFeePerGas"))}get maxFeePerGas(){const e=F(this,Pc);return e==null?this.type===2||this.type===3?un:null:e}set maxFeePerGas(e){K(this,Pc,e==null?null:Se(e,"maxFeePerGas"))}get data(){return F(this,kc)}set data(e){K(this,kc,ve(e))}get value(){return F(this,Nc)}set value(e){K(this,Nc,Se(e,"value"))}get chainId(){return F(this,Bc)}set chainId(e){K(this,Bc,Se(e))}get signature(){return F(this,Rc)||null}set signature(e){K(this,Rc,e==null?null:nr.from(e))}get accessList(){const e=F(this,Mc)||null;return e==null?this.type===1||this.type===2||this.type===3?[]:null:e}set accessList(e){K(this,Mc,e==null?null:ca(e))}get authorizationList(){const e=F(this,Lc)||null;return e==null&&this.type===4?[]:e}set authorizationList(e){K(this,Lc,e==null?null:e.map(n=>PA(n)))}get maxFeePerBlobGas(){const e=F(this,ja);return e==null&&this.type===3?un:e}set maxFeePerBlobGas(e){K(this,ja,e==null?null:Se(e,"maxFeePerBlobGas"))}get blobVersionedHashes(){let e=F(this,As);return e==null&&this.type===3?[]:e}set blobVersionedHashes(e){if(e!=null){ne(Array.isArray(e),"blobVersionedHashes must be an Array","value",e),e=e.slice();for(let n=0;n<e.length;n++)ne(pt(e[n],32),"invalid blobVersionedHash",`value[${n}]`,e[n])}K(this,As,e)}get blobs(){return F(this,ks)==null?null:F(this,ks).map(e=>Object.assign({},e))}set blobs(e){if(e==null){K(this,ks,null);return}const n=[],r=[];for(let i=0;i<e.length;i++){const o=e[i];if(ym(o)){fe(F(this,Vi),"adding a raw blob requires a KZG library","UNSUPPORTED_OPERATION",{operation:"set blobs()"});let s=Ue(o);if(ne(s.length<=Wm,"blob is too large",`blobs[${i}]`,o),s.length!==Wm){const c=new Uint8Array(Wm);c.set(s),s=c}const a=F(this,Vi).blobToKzgCommitment(s),l=ve(F(this,Vi).computeBlobKzgProof(s,a));n.push({data:ve(s),commitment:ve(a),proof:l}),r.push(NA(1,a))}else{const s=ve(o.commitment);n.push({data:ve(o.data),commitment:s,proof:ve(o.proof)}),r.push(NA(1,s))}}K(this,ks,n),K(this,As,r)}get kzg(){return F(this,Vi)}set kzg(e){e==null?K(this,Vi,null):K(this,Vi,_9(e))}get hash(){return this.signature==null?null:Ft(be(this,Fc,rg).call(this,!0,!1))}get unsignedHash(){return Ft(this.unsignedSerialized)}get from(){return this.signature==null?null:N9(this.unsignedHash,this.signature)}get fromPublicKey(){return this.signature==null?null:ed.recoverPublicKey(this.unsignedHash,this.signature)}isSigned(){return this.signature!=null}get serialized(){return be(this,Fc,rg).call(this,!0,!0)}get unsignedSerialized(){return be(this,Fc,rg).call(this,!1,!1)}inferType(){const e=this.inferTypes();return e.indexOf(2)>=0?2:e.pop()}inferTypes(){const e=this.gasPrice!=null,n=this.maxFeePerGas!=null||this.maxPriorityFeePerGas!=null,r=this.accessList!=null,i=F(this,ja)!=null||F(this,As);this.maxFeePerGas!=null&&this.maxPriorityFeePerGas!=null&&fe(this.maxFeePerGas>=this.maxPriorityFeePerGas,"priorityFee cannot be more than maxFee","BAD_DATA",{value:this}),fe(!n||this.type!==0&&this.type!==1,"transaction type cannot have maxFeePerGas or maxPriorityFeePerGas","BAD_DATA",{value:this}),fe(this.type!==0||!r,"legacy transaction cannot have accessList","BAD_DATA",{value:this});const o=[];return this.type!=null?o.push(this.type):this.authorizationList&&this.authorizationList.length?o.push(4):n?o.push(2):e?(o.push(1),r||o.push(0)):r?(o.push(1),o.push(2)):(i&&this.to||(o.push(0),o.push(1),o.push(2)),o.push(3)),o.sort(),o}isLegacy(){return this.type===0}isBerlin(){return this.type===1}isLondon(){return this.type===2}isCancun(){return this.type===3}clone(){return Ar.from(this)}toJSON(){const e=n=>n==null?null:n.toString();return{type:this.type,to:this.to,data:this.data,nonce:this.nonce,gasLimit:e(this.gasLimit),gasPrice:e(this.gasPrice),maxPriorityFeePerGas:e(this.maxPriorityFeePerGas),maxFeePerGas:e(this.maxFeePerGas),value:e(this.value),chainId:e(this.chainId),sig:this.signature?this.signature.toJSON():null,accessList:this.accessList}}static from(e){if(e==null)return new Ar;if(typeof e=="string"){const r=Ue(e);if(r[0]>=127)return Ar.from(U9(r));switch(r[0]){case 1:return Ar.from(G9(r));case 2:return Ar.from(H9(r));case 3:return Ar.from(K9(r));case 4:return Ar.from(Y9(r))}fe(!1,"unsupported transaction type","UNSUPPORTED_OPERATION",{operation:"from"})}const n=new Ar;return e.type!=null&&(n.type=e.type),e.to!=null&&(n.to=e.to),e.nonce!=null&&(n.nonce=e.nonce),e.gasLimit!=null&&(n.gasLimit=e.gasLimit),e.gasPrice!=null&&(n.gasPrice=e.gasPrice),e.maxPriorityFeePerGas!=null&&(n.maxPriorityFeePerGas=e.maxPriorityFeePerGas),e.maxFeePerGas!=null&&(n.maxFeePerGas=e.maxFeePerGas),e.maxFeePerBlobGas!=null&&(n.maxFeePerBlobGas=e.maxFeePerBlobGas),e.data!=null&&(n.data=e.data),e.value!=null&&(n.value=e.value),e.chainId!=null&&(n.chainId=e.chainId),e.signature!=null&&(n.signature=nr.from(e.signature)),e.accessList!=null&&(n.accessList=e.accessList),e.authorizationList!=null&&(n.authorizationList=e.authorizationList),e.blobVersionedHashes!=null&&(n.blobVersionedHashes=e.blobVersionedHashes),e.kzg!=null&&(n.kzg=e.kzg),e.blobs!=null&&(n.blobs=e.blobs),e.hash!=null&&(ne(n.isSigned(),"unsigned transaction cannot define '.hash'","tx",e),ne(n.hash===e.hash,"hash mismatch","tx",e)),e.from!=null&&(ne(n.isSigned(),"unsigned transaction cannot define '.from'","tx",e),ne(n.from.toLowerCase()===(e.from||"").toLowerCase(),"from mismatch","tx",e)),n}},ui=new WeakMap,Ac=new WeakMap,kc=new WeakMap,Cc=new WeakMap,Ic=new WeakMap,Oc=new WeakMap,Tc=new WeakMap,Pc=new WeakMap,Nc=new WeakMap,Bc=new WeakMap,Rc=new WeakMap,Mc=new WeakMap,ja=new WeakMap,As=new WeakMap,Vi=new WeakMap,ks=new WeakMap,Lc=new WeakMap,Fc=new WeakSet,rg=function(e,n){fe(!e||this.signature!=null,"cannot serialize unsigned transaction; maybe you meant .unsignedSerialized","UNSUPPORTED_OPERATION",{operation:".serialized"});const r=e?this.signature:null;switch(this.inferType()){case 0:return $9(this,r);case 1:return j9(this,r);case 2:return W9(this,r);case 3:return q9(this,r,n?this.blobs:null);case 4:return Q9(this,r)}fe(!1,"unsupported transaction type","UNSUPPORTED_OPERATION",{operation:".serialized"})},Ar);function da(t){return Ft(Oi(t))}var X9="AEEUdwmgDS8BxQKKAP4BOgDjATAAngDUAIMAoABoAOAAagCOAEQAhABMAHIAOwA9ACsANgAmAGIAHgAuACgAJwAXAC0AGgAjAB8ALwAUACkAEgAeAAkAGwARABkAFgA5ACgALQArADcAFQApABAAHgAiABAAGgAeABMAGAUhBe8BFxREN8sF2wC5AK5HAW8ArQkDzQCuhzc3NzcBP68NEfMABQdHBuw5BV8FYAA9MzkI9r4ZBg7QyQAWA9CeOwLNCjcCjqkChuA/lm+RAsXTAoP6ASfnEQDytQFJAjWVCkeXAOsA6godAB/cwdAUE0WlBCN/AQUCQRjFD/MRBjHxDQSJbw0jBzUAswBxme+tnIcAYwabAysG8QAjAEMMmxcDqgPKQyDXCMMxA7kUQwD3NXOrAKmFIAAfBC0D3x4BJQDBGdUFAhEgVD8JnwmQJiNWYUzrg0oAGwAUAB0AFnNcACkAFgBP9h3gPfsDOWDKneY2ChglX1UDYD30ABsAFAAdABZzIGRAnwDD8wAjAEEMzRbDqgMB2sAFYwXqAtCnAsS4AwpUJKRtFHsadUz9AMMVbwLpABM1NJEX0ZkCgYMBEyMAxRVvAukAEzUBUFAtmUwSAy4DBTER33EftQHfSwB5MxJ/AjkWKQLzL8E/cwBB6QH9LQDPDtO9ASNriQC5DQANAwCK21EFI91zHwCoL9kBqQcHBwcHKzUDowBvAQohPvU3fAQgHwCyAc8CKQMA5zMSezr7ULgFmDp/LzVQBgEGAi8FYQVgt8AFcTtlQhpCWEmfe5tmZ6IAExsDzQ8t+X8rBKtTAltbAn0jsy8Bl6utPWMDTR8Ei2kRANkDBrNHNysDBzECQWUAcwFpJ3kAiyUhAJ0BUb8AL3EfAbfNAz81KUsFWwF3YQZtAm0A+VEfAzEJDQBRSQCzAQBlAHsAM70GD/v3IZWHBwARKQAxALsjTwHZAeMPEzmXgIHwABIAGQA8AEUAQDt3gdvIEGcQZAkGTRFMdEIVEwK0D64L7REdDNkq09PgADSxB/MDWwfzA1sDWwfzB/MDWwfzA1sDWwNbA1scEvAi28gQZw9QBHUFlgWTBN4IiyZREYkHMAjaVBV0JhxPA00BBCMtSSQ7mzMTJUpMFE0LCAQ2SmyvfUADTzGzVP2QqgPTMlc5dAkGHnkSqAAyD3skNb1OhnpPcagKU0+2tYdJak5vAsY6sEAACikJm2/Dd1YGRRAfJ6kQ+ww3AbkBPw3xS9wE9QY/BM0fgRkdD9GVoAipLeEM8SbnLqWAXiP5KocF8Uv4POELUVFsD10LaQnnOmeBUgMlAREijwrhDT0IcRD3Cs1vDekRSQc9A9lJngCpBwULFR05FbkmFGKwCw05ewb/GvoLkyazEy17AAXXGiUGUQEtGwMA0y7rhbRaNVwgT2MGBwspI8sUrFAkDSlAu3hMGh8HGSWtApVDdEqLUToelyH6PEENai4XUYAH+TwJGVMLhTyiRq9FEhHWPpE9TCJNTDAEOYMsMyePCdMPiQy9fHYBXQklCbUMdRM1ERs3yQg9Bx0xlygnGQglRplgngT7owP3E9UDDwVDCUUHFwO5HDETMhUtBRGBKNsC9zbZLrcCk1aEARsFzw8pH+MQVEfkDu0InwJpA4cl7wAxFSUAGyKfCEdnAGOP3FMJLs8Iy2pwI3gDaxTrZRF3B5UOWwerHDcVwxzlcMxeD4YMKKezCV8BeQmdAWME5wgNNV+MpCBFZ1eLXBifIGVBQ14AAjUMaRWjRMGHfAKPD28SHwE5AXcHPQ0FAnsR8RFvEJkI74YINbkz/DopBFMhhyAVCisDU2zSCysm/Qz8bQGnEmYDEDRBd/Jnr2C6KBgBBx0yyUFkIfULlk/RDKAaxRhGVDIZ6AfDA/ca9yfuQVsGAwOnBxc6UTPyBMELbQiPCUMATQ6nGwfbGG4KdYzUATWPAbudA1uVhwJzkwY7Bw8Aaw+LBX3pACECqwinAAkA0wNbAD0CsQehAB0AiUUBQQMrMwEl6QKTA5cINc8BmTMB9y0EH8cMGQD7O25OAsO1AoBuZqYF4VwCkgJNOQFRKQQJUktVA7N15QDfAE8GF+NLARmvTs8e50cB43MvAMsA/wAJOQcJRQHRAfdxALsBYws1Caa3uQFR7S0AhwAZbwHbAo0A4QA5AIP1AVcAUQVd/QXXAlNNARU1HC9bZQG/AyMBNwERAH0Gz5GpzQsjBHEH1wIQHxXlAu8yB7kFAyLjE9FCyQK94lkAMhoKPAqrCqpgX2Q3CjV2PVQAEh+sPss/UgVVO1c7XDtXO1w7VztcO1c7XDtXO1wDm8Pmw+YKcF9JYe8Mqg3YRMw6TRPfYFVgNhPMLbsUxRXSJVoZQRrAJwkl6FUNDwgt12Y0CDA0eRfAAEMpbINFY4oeNApPHOtTlVT8LR8AtUumM7MNsBsZREQFS3XxYi4WEgomAmSFAmJGX1GzAV83JAKh+wJonAJmDQKfiDgfDwJmPwJmKgRyBIMDfxcDfpY5Cjl7GzmGOicnAmwhAjI6OA4CbcsCbbLzjgM3a0kvAWsA4gDlAE4JB5wMkQECD8YAEbkCdzMCdqZDAnlPRwJ4viFg30WyRvcCfEMCeswCfQ0CfPRIBEiBZygALxlJXEpfGRtK0ALRBQLQ0EsrA4hTA4fqRMmRNgLypV0HAwOyS9JMMSkH001QTbMCi0MCitzFHwshR2sJuwKOOwKOYESbhQKO3QKOYHxRuFM5AQ5S2FSJApP/ApMQAO0AIFUiVbNV1AosHymZijLleGpFPz0Cl6MC77ZYJawAXSkClpMCloCgAK1ZsFoNhVEAPwKWuQKWUlxIXNUCmc8CmWhczl0LHQKcnznGOqECnBoCn58CnryOACETNS4TAp31Ap6WALlBYThh8wKe1wKgcgGtAp6jIwKeUqljzGQrKS8CJ7MCJoICoP8CoFDbAqYzAqXSAqgDAIECp/ZogGi1AAdNaiBq1QKs5wKssgKtawKtBgJXIQJV4AKx5dsDH1JsmwKywRECsuwbbORtZ21MYwMl0QK2YD9DbpQDKUkCuGICuUsZArkue3A6cOUCvR0DLbYDMhUCvoxyBgMzdQK+HnMmc1MCw88CwwhzhnRPOUl05AM8qwEDPJ4DPcMCxYACxksCxhSNAshtVQLISALJUwLJMgJkoQLd1nh9ZXiyeSlL1AMYp2cGAmH4GfeVKHsPXpZevxUCz28Cz3AzT1fW9xejAMqxAs93AS3uA04Wfk8JAtwrAtuOAtJTA1JgA1NjAQUDVZCAjUMEzxrxZEl5A4LSg5EC2ssC2eKEFIRNp0ADhqkAMwNkEoZ1Xf0AWQLfaQLevHd7AuIz7RgB8zQrAfSfAfLWiwLr9wLpdH0DAur9AuroAP1LAb0C7o0C66CWrpcHAu5DA4XkmH1w5HGlAvMHAG0DjhqZlwL3FwORcgOSiwL3nAL53QL4apogmq+/O5siA52HAv7+AR8APZ8gAZ+3AwWRA6ZuA6bdANXJAwZuoYyiCQ0DDE0BEwEjB3EGZb1rCQC/BG/DFY8etxEAG3k9ACcDNxJRA42DAWcrJQCM8wAlAOanC6OVCLsGI6fJBgCvBRnDBvElRUYFFoAFcD9GSDNCKUK8X3kZX8QAls0FOgCQVCGbwTsuYDoZutcONxjOGJHJ/gVfBWAFXwVgBWsFYAVfBWAFXwVgBV8FYAVfBWBOHQjfjW8KCgoKbF7xMwTRA7kGN8PDAMMEr8MA70gxFroFTj5xPnhCR0K+X30/X/AAWBkzswCNBsxzzASm70aCRS4rDDMeLz49fnXfcsH5GcoscQFz13Y4HwVnBXLJycnACNdRYwgICAqEXoWTxgA7P4kACxbZBu21Kw0AjMsTAwkVAOVtJUUsJ1JCuULESUArXy9gPi9AKwnJRQYKTD9LPoA+iT54PnkCkULEUUpDX9NWV3JVEjQAc1w3A3IBE3YnX+g7QiMJb6MKaiszRCUuQrNCxDPMCcwEX9EWJzYREBEEBwIHKn6l33JCNVIfybPJtAltydPUCmhBZw/tEKsZAJOVJU1CLRuxbUHOQAo7P0s+eEJHHA8SJVRPdGM0NVrpvBoKhfUlM0JHHGUQUhEWO1xLSj8MO0ucNAqJIzVCRxv9EFsqKyA4OQgNj2nwZgp5ZNFgE2A1K3YHS2AhQQojJmC7DgpzGG1WYFUZCQYHZO9gHWCdYIVgu2BTYJlwFh8GvRbcXbG8YgtDHrMBwzPVyQonHQgkCyYBgQJ0Ajc4nVqIAwGSCsBPIgDsK3SWEtIVBa5N8gGjAo+kVwVIZwD/AEUSCDweX4ITrRQsJ8K3TwBXFDwEAB0TvzVcAtoTS20RIwDgVgZ9BBImYgA5AL4Coi8LFnezOkCnIQFjAY4KBAPh9RcGsgZSBsEAJctdsWIRu2kTkQstRw7DAcMBKgpPBGIGMDAwKCYnKTQaLg4AKRSVAFwCdl+YUZ0JdicFD3lPAdt1F9ZZKCGxuE3yBxkFVGcA/wBFEgiCBwAOLHQSjxOtQDg1z7deFRMAZ8QTAGtKb1ApIiPHADkAvgKiLy1DFtYCmBiDAlDDWNB0eo7fpaMO/aEVRRv0ATEQZBIODyMEAc8JQhCbDRgzFD4TAEMAu9YBCgCsAOkAm5I3ABwAYxvONnR+MhXJAxgKQyxL2+kkJhMbhQKDBMkSsvF0AD9BNQ6uQC7WqSQHwxEAEEIu1hkhAH2z4iQPwyJPHNWpdyYBRSpnJALzoBAEVPPsH20MxA0CCEQKRgAFyAtFAlMNwwjEDUQJRArELtapMg7DDZgJIw+TGukEIwvDFkMAqAtDEMMMBhioe+QAO3MMRAACrgnEBSPY9Q0FDnbSBoMAB8MSYxkSxAEJAPIJAAB8FWMOFtMc/HcXwxhDAC7DAvOowwAewwJdKDKHAAHDAALrFUQVwwAbwyvzpWMWv8wA/ABpAy++bcYDUKPD0KhDCwKmJ1MAAmMA5+UZwxAagwipBRL/eADfw6fDGOMCGsOjk3l6BwOpo4sAEsMOGxMAA5sAbcMOAAvDp0MJGkMDwgipnNIPAwfIqUMGAOGDAAPzABXDAAcDAAnDAGmTABrDAA7DChjDjnEWAwABYwAOcwAuUyYABsMAF8MIKQANUgC6wy4AA8MADqMq8wCyYgAcIwAB8wqpAAXOCx0V4wAHowBCwwEKAGnDAAuDAB3DAAjDCakABdIAbqcZ3QCZCCkABdIAAAFDAAfjAB2jCCkABqIACYMAGzMAbSMA5sOIAAhjAAhDABTDBAkpAAbSAOOTAAlDC6kOzPtnAAdDAG6kQFAATwAKwwwAA0MACbUDPwAHIwAZgwACE6cDAAojAApDAAoDp/MGwwAJIwADEwAQQwgAFEMAEXMAD5MADfMADcMAGRMOFiMAFUMAbqMWuwHDAMIAE0MLAGkzEgDhUwACQwAEWgAXgwUjAAbYABjDBSYBgzBaAEFNALcQBxUMegAwMngBrA0IZgJ0KxQHBREPd1N0ZzKRJwaIHAZqNT4DqQq8BwngAB4DAwt2AX56T1ocKQNXAh1GATQGC3tOxYNagkgAMQA5CQADAQEAWxLjAIOYNAEzAH7tFRk6TglSAF8NAAlYAQ+S1ACAQwQorQBiAN4dAJ1wPyeTANVzuQDX3AIeEMp9eyMgXiUAEdkBkJizKltbVVAaRMqRAAEAhyQ/SDEz6BmfVwB6ATEsOClKIRcDOF0E/832AFNt5AByAnkCRxGCOs94NjXdAwINGBonDBwPALW2AwICAgAAAAAAAAYDBQMDARrUAwAtAAAAAgEGBgYGBgYFBQUFBQUEBQYHCAkEBQUFBQQAAAICAAAAIgCNAJAAlT0A6gC7ANwApEQAwgCyAK0AqADuAKYA2gCjAOcBCAEDAMcAgQBiANIA1AEDAN4A8gCQAKkBMQDqAN8A3AsBCQ8yO9ra2tq8xuLT1tRJOB0BUgFcNU0BWgFpAWgBWwFMUUlLbhMBUxsNEAs6PhMOACcUKy0vMj5AQENDQ0RFFEYGJFdXV1dZWVhZL1pbXVxcI2NnZ2ZoZypsbnZ1eHh4eHh4enp6enp6enp6enp8fH18e2IARPIASQCaAHgAMgBm+ACOAFcAVwA3AnbvAIsABfj4AGQAk/IAnwBPAGIAZP//sACFAIUAaQBWALEAJAC2AIMCQAJDAPwA5wD+AP4A6AD/AOkA6QDoAOYALwJ7AVEBQAE+AVQBPgE+AT4BOQE4ATgBOAEcAVgXADEQCAEAUx8SHgsdHhYAjgCWAKYAUQBqIAIxAHYAbwCXAxUDJzIDIUlGTzEAkQJPAMcCVwKkAMAClgKWApYClgKWApYCiwKWApYClgKWApYClgKVApUCmAKgApcClgKWApQClAKUApQCkgKVAnUB1AKXAp8ClgKWApUeAIETBQD+DQOfAmECOh8BVBg9AuIZEjMbAU4/G1WZAXusRAFpYQEFA0FPAQYAmTEeIJdyADFoAHEANgCRA5zMk/C2jGINwjMWygIZCaXdfDILBCs5dAE7YnQBugDlhoiHhoiGiYqKhouOjIaNkI6Ij4qQipGGkoaThpSSlYaWhpeKmIaZhpqGm4aci52QnoqfhuIC4XTpAt90AIp0LHSoAIsAdHQEQwRABEIERQRDBEkERgRBBEcESQRIBEQERgRJAJ5udACrA490ALxuAQ10ANFZdHQA13QCFHQA/mJ0AP4BIQD+APwA/AD9APwDhGZ03ASMK23HAP4A/AD8AP0A/CR0dACRYnQA/gCRASEA/gCRAvQA/gCRA4RmdNwEjCttxyR0AP9idAEhAP4A/gD8APwA/QD8AP8A/AD8AP0A/AOEZnTcBIwrbcckdHQAkWJ0ASEA/gCRAP4AkQL0AP4AkQOEZnTcBIwrbcckdAJLAT50AlIBQXQCU8l0dAJfdHQDpgL0A6YDpgOnA6cDpwOnA4RmdNwEjCttxyR0dACRYnQBIQOmAJEDpgCRAvQDpgCRA4RmdNwEjCttxyR0BDh0AJEEOQCRDpU5dSgCADR03gV2CwArdAEFAM5iCnR0AF1iAAYcOgp0dACRCnQAXAEIwWZ0CnRmdHQAkWZ0CnRmdEXgAFF03gp0dEY0tlT2u3SOAQTwscwhjZZKrhYcBSfFp9XNbKiVDOD2b+cpe4/Z17mQnbtzzhaeQtE2GGj0IDNTjRUSyTxxw/RPHW/+vS7d1NfRt9z9QPZg4X7QFfhCnkvgNPIItOsC2eV6hPannZNHlZ9xrwZXIMOlu3jSoQSq78WEjwLjw1ELSlF1aBvfzwk5ZX7AUvQzjPQKbDuQ+sm4wNOp4A6AdVuRS0t1y/DZpg4R6m7FNjM9HgvW7Bi88zaMjOo6lM8wtBBdj8LP4ylv3zCXPhebMKJc066o9sF71oFW/8JXu86HJbwDID5lzw5GWLR/LhT0Qqnp2JQxNZNfcbLIzPy+YypqRm/lBmGmex+82+PisxUumSeJkALIT6rJezxMH+CTJmQtt5uwTVbL3ptmjDUQzlSIvWi8Tl7ng1NpuRn1Ng4n14Qc+3Iil7OwkvNWogLSPkn3pihIFytyIGmMhOe3n1tWsuMy9BdKyqF4Z3v2SgggTL9KVvMXPnCbRe+oOuFFP3HejBG/w9gvmfNYvg6JuWia2lcSSN1uIjBktzoIazOHPJZ7kKHPz8mRWVdW3lA8WGF9dQF6Bm673boov3BUWDU2JNcahR23GtfHKLOz/viZ+rYnZFaIznXO67CYEJ1fXuTRpZhYZkKe54xeoagkNGLs+NTZHE0rX45/XvQ2RGADX6vcAvdxIUBV27wxGm2zjZo4X3ILgAlrOFheuZ6wtsvaIj4yLY7qqawlliaIcrz2G+c3vscAnCkCuMzMmZvMfu9lLwTvfX+3cVSyPdN9ZwgDZhfjRgNJcLiJ67b9xx8JHswprbiE3v9UphotAPIgnXVIN5KmMc0piXhc6cChPnN+MRhG9adtdttQTTwSIpl8I4/j//d3sz1326qTBTpPRM/Hgh3kzqEXs8ZAk4ErQhNO8hzrQ0DLkWMA/N+91tn2MdOJnWC2FCZehkQrwzwbKOjhvZsbM95QoeL9skYyMf4srVPVJSgg7pOLUtr/n9eT99oe9nLtFRpjA9okV2Kj8h9k5HaC0oivRD8VyXkJ81tcd4fHNXPCfloIQasxsuO18/46dR2jgul/UIet2G0kRvnyONMKhHs6J26FEoqSqd+rfYjeEGwHWVDpX1fh1jBBcKGMqRepju9Y00mDVHC+Xdij/j44rKfvfjGinNs1jO/0F3jB83XCDINN/HB84axlP+3E/klktRo+vl3U/aiyMJbIodE1XSsDn6UAzIoMtUObY2+k/4gY/l+AkZJ5Sj2vQrkyLm3FoxjhDX+31UXBFf9XrAH31fFqoBmDEZvhvvpnZ87N+oZEu7U9O/nnk+QWj3x8uyoRbEnf+O5UMr9i0nHP38IF5AvzrBW8YWBUR0mIAzIvndQq9N3v/Jto3aPjPXUPl8ASdPPyAp7jENf8bk7VMM9ol9XGmlBmeDMuGqt+WzuL6CXAxXjIhCPM5vACchgMJ/8XBGLO/D1isVvGhwwHHr1DLaI5mn2Jr/b1pUD90uciDaS8cXNDzCWvNmT/PhQe5e8nTnnnkt8Ds/SIjibcum/fqDhKopxAY8AkSrPn+IGDEKOO+U3XOP6djFs2H5N9+orhOahiQk5KnEUWa+CzkVzhp8bMHRbg81qhjjXuIKbHjSLSIBKWqockGtKinY+z4/RdBUF6pcc3JmnlxVcNgrI4SEzKUZSwcD2QCyxzKve+gAmg6ZuSRkpPFa6mfThu7LJNu3H5K42uCpNvPAsoedolKV/LHe/eJ+BbaG5MG0NaSGVPRUmNFMFFSSpXEcXwbVh7UETOZZtoVNRGOIbbkig3McEtR68cG0RZAoJevWYo7Dg/lZ1CQzblWeUvVHmr8fY4Nqd9JJiH/zEX24mJviH60fAyFr0A3c4bC1j3yZU60VgJxXn8JgJXLUIsiBnmKmMYz+7yBQFBvqb2eYnuW59joZBf56/wXvWIR4R8wTmV80i1mZy+S4+BUES+hzjk0uXpC///z/IlqHZ1monzlXp8aCfhGKMti73FI1KbL1q6IKO4fuBuZ59gagjn5xU79muMpHXg6S+e+gDM/U9BKLHbl9l6o8czQKl4RUkJJiqftQG2i3BMg/TQlUYFkJDYBOOvAugYuzYSDnZbDDd/aSd9x0Oe6F+bJcHfl9+gp6L5/TgA+BdFFovbfCrQ40s5vMPw8866pNX8zyFGeFWdxIpPVp9Rg1UPOVFbFZrvaFq/YAzHQgqMWpahMYfqHpmwXfHL1/kpYmGuHFwT55mQu0dylfNuq2Oq0hTMCPwqfxnuBIPLXfci4Y1ANy+1CUipQxld/izVh16WyG2Q0CQQ9NqtAnx1HCHwDj7sYxOSB0wopZSnOzxQOcExmxrVTF2BkOthVpGfuhaGECfCJpJKpjnihY+xOT2QJxN61+9K6QSqtv2Shr82I3jgJrqBg0wELFZPjvHpvzTtaJnLK6Vb97Yn933koO/saN7fsjwNKzp4l2lJVx2orjCGzC/4ZL4zCver6aQYtC5sdoychuFE6ufOiog+VWi5UDkbmvmtah/3aArEBIi39s5ILUnlFLgilcGuz9CQshEY7fw2ouoILAYPVT/gyAIq3TFAIwVsl+ktkRz/qGfnCDGrm5gsl/l9QdvCWGsjPz3dU7XuqKfdUrr/6XIgjp4rey6AJBmCmUJMjITHVdFb5m1p+dLMCL8t55zD42cmftmLEJC0Da04YiRCVUBLLa8D071/N5UBNBXDh0LFsmhV/5B5ExOB4j3WVG/S3lfK5o+V6ELHvy6RR9n4ac+VsK4VE4yphPvV+kG9FegTBH4ZRXL2HytUHCduJazB/KykjfetYxOXTLws267aGOd+I+JhKP//+VnXmS90OD/jvLcVu0asyqcuYN1mSb6XTlCkqv1vigZPIYwNF/zpWcT1GR/6aEIRjkh0yhg4LXJfaGobYJTY4JI58KiAKgmmgAKWdl5nYCeLqavRJGQNuYuZtZFGx+IkI4w4NS2xwbetNMunOjBu/hmKCI/w7tfiiyUd//4rbTeWt4izBY8YvGIN6vyKYmP/8X8wHKCeN+WRcKM70+tXKNGyevU9H2Dg5BsljnTf8YbsJ1TmMs74Ce2XlHisleguhyeg44rQOHZuw/6HTkhnnurK2d62q6yS7210SsAIaR+jXMQA+svkrLpsUY+F30Uw89uOdGAR6vo4FIME0EfVVeHTu6eKicfhSqOeXJhbftcd08sWEnNUL1C9fnprTgd83IMut8onVUF0hvqzZfHduPjbjwEXIcoYmy+P6tcJZHmeOv6VrvEdkHDJecjHuHeWANe79VG662qTjA/HCvumVv3qL+LrOcpqGps2ZGwQdFJ7PU4iuyRlBrwfO+xnPyr47s2cXVbWzAyznDiBGjCM3ksxjjqM62GE9C8f5U38kB3VjtabKp/nRdvMESPGDG90bWRLAt1Qk5DyLuazRR1YzdC1c+hZXvAWV8xA72S4A8B67vjVhbba3MMop293FeEXpe7zItMWrJG/LOH9ByOXmYnNJfjmfuX9KbrpgLOba4nZ+fl8Gbdv/ihv+6wFGKHCYrVwmhFC0J3V2bn2tIB1wCc1CST3d3X2OyxhguXcs4sm679UngzofuSeBewMFJboIQHbUh/m2JhW2hG9DIvG2t7yZIzKBTz9wBtnNC+2pCRYhSIuQ1j8xsz5VvqnyUIthvuoyyu7fNIrg/KQUVmGQaqkqZk/Vx5b33/gsEs8yX7SC1J+NV4icz6bvIE7C5G6McBaI8rVg56q5QBJWxn/87Q1sPK4+sQa8fLU5gXo4paaq4cOcQ4wR0VBHPGjKh+UlPCbA1nLXyEUX45qZ8J7/Ln4FPJE2TdzD0Z8MLSNQiykMMmSyOCiFfy84Rq60emYB2vD09KjYwsoIpeDcBDTElBbXxND72yhd9pC/1CMid/5HUMvAL27OtcIJDzNKpRPNqPOpyt2aPGz9QWIs9hQ9LiX5s8m9hjTUu/f7MyIatjjd+tSfQ3ufZxPpmJhTaBtZtKLUcfOCUqADuO+QoH8B9v6U+P0HV1GLQmtoNFTb3s74ivZgjES0qfK+8RdGgBbcCMSy8eBvh98+et1KIFqSe1KQPyXULBMTsIYnysIwiZBJYdI20vseV+wuJkcqGemehKjaAb9L57xZm3g2zX0bZ2xk/fU+bCo7TlnbW7JuF1YdURo/2Gw7VclDG1W7LOtas2LX4upifZ/23rzpsnY/ALfRgrcWP5hYmV9VxVOQA1fZvp9F2UNU+7d7xRyVm5wiLp3/0dlV7vdw1PMiZrbDAYzIVqEjRY2YU03sJhPnlwIPcZUG5ltL6S8XCxU1eYS5cjr34veBmXAvy7yN4ZjArIG0dfD/5UpBNlX1ZPoxJOwyqRi3wQWtOzd4oNKh0LkoTm8cwqgIfKhqqGOhwo71I+zXnMemTv2B2AUzABWyFztGgGULjDDzWYwJUVBTjKCn5K2QGMK1CQT7SzziOjo+BhAmqBjzuc3xYym2eedGeOIRJVyTwDw37iCMe4g5Vbnsb5ZBdxOAnMT7HU4DHpxWGuQ7GeiY30Cpbvzss55+5Km1YsbD5ea3NI9QNYIXol5apgSu9dZ8f8xS5dtHpido5BclDuLWY4lhik0tbJa07yJhH0BOyEut/GRbYTS6RfiTYWGMCkNpfSHi7HvdiTglEVHKZXaVhezH4kkXiIvKopYAlPusftpE4a5IZwvw1x/eLvoDIh/zpo9FiQInsTb2SAkKHV42XYBjpJDg4374XiVb3ws4qM0s9eSQ5HzsMU4OZJKuopFjBM+dAZEl8RUMx5uU2N486Kr141tVsGQfGjORYMCJAMsxELeNT4RmWjRcpdTGBwcx6XN9drWqPmJzcrGrH4+DRc7+n1w3kPZwu0BkNr6hQrqgo7JTB9A5kdJ/H7P4cWBMwsmuixAzJB3yrQpnGIq90lxAXLzDCdn1LPibsRt7rHNjgQBklRgPZ8vTbjXdgXrTWQsK5MdrXXQVPp0Rinq3frzZKJ0qD6Qhc40VzAraUXlob1gvkhK3vpmHgI6FRlQZNx6eRqkp0zy4AQlX813fAPtL3jMRaitGFFjo0zmErloC+h+YYdVQ6k4F/epxAoF0BmqEoKNTt6j4vQZNQ2BoqF9Vj53TOIoNmDiu9Xp15RkIgQIGcoLpfoIbenzpGUAtqFJp5W+LLnx38jHeECTJ/navKY1NWfN0sY1T8/pB8kIH3DU3DX+u6W3YwpypBMYOhbSxGjq84RZ84fWJow8pyHqn4S/9J15EcCMsXqrfwyd9mhiu3+rEo9pPpoJkdZqHjra4NvzFwuThNKy6hao/SlLw3ZADUcUp3w3SRVfW2rhl80zOgTYnKE0Hs2qp1J6H3xqPqIkvUDRMFDYyRbsFI3M9MEyovPk8rlw7/0a81cDVLmBsR2ze2pBuKb23fbeZC0uXoIvDppfTwIDxk1Oq2dGesGc+oJXWJLGkOha3CX+DUnzgAp9HGH9RsPZN63Hn4RMA5eSVhPHO+9RcRb/IOgtW31V1Q5IPGtoxPjC+MEJbVlIMYADd9aHYWUIQKopuPOHmoqSkubnAKnzgKHqgIOfW5RdAgotN6BN+O2ZYHkuemLnvQ8U9THVrS1RtLmKbcC7PeeDsYznvqzeg6VCNwmr0Yyx1wnLjyT84BZz3EJyCptD3yeueAyDWIs0L2qs/VQ3HUyqfrja0V1LdDzqAikeWuV4sc7RLIB69jEIBjCkyZedoUHqCrOvShVzyd73OdrJW0hPOuQv2qOoHDc9xVb6Yu6uq3Xqp2ZaH46A7lzevbxQEmfrzvAYSJuZ4WDk1Hz3QX1LVdiUK0EvlAGAYlG3Md30r7dcPN63yqBCIj25prpvZP0nI4+EgWoFG95V596CurXpKRBGRjQlHCvy5Ib/iW8nZJWwrET3mgd6mEhfP4KCuaLjopWs7h+MdXFdIv8dHQJgg1xi1eYqB0uDYjxwVmri0Sv5XKut/onqapC+FQiC2C1lvYJ9MVco6yDYsS3AANUfMtvtbYI2hfwZatiSsnoUeMZd34GVjkMMKA+XnjJpXgRW2SHTZplVowPmJsvXy6w3cfO1AK2dvtZEKTkC/TY9LFiKHCG0DnrMQdGm2lzlBHM9iEYynH2UcVMhUEjsc0oDBTgo2ZSQ1gzkAHeWeBXYFjYLuuf8yzTCy7/RFR81WDjXMbq2BOH5dURnxo6oivmxL3cKzKInlZkD31nvpHB9Kk7GfcfE1t+1V64b9LtgeJGlpRFxQCAqWJ5DoY77ski8gsOEOr2uywZaoO/NGa0X0y1pNQHBi3b2SUGNpcZxDT7rLbBf1FSnQ8guxGW3W+36BW0gBje4DOz6Ba6SVk0xiKgt+q2JOFyr4SYfnu+Ic1QZYIuwHBrgzr6UvOcSCzPTOo7D6IC4ISeS7zkl4h+2VoeHpnG/uWR3+ysNgPcOIXQbv0n4mr3BwQcdKJxgPSeyuP/z1Jjg4e9nUvoXegqQVIE30EHx5GHv+FAVUNTowYDJgyFhf5IvlYmEqRif6+WN1MkEJmDcQITx9FX23a4mxy1AQRsOHO/+eImX9l8EMJI3oPWzVXxSOeHU1dUWYr2uAA7AMb+vAEZSbU3qob9ibCyXeypEMpZ6863o6QPqlqGHZkuWABSTVNd4cOh9hv3qEpSx2Zy/DJMP6cItEmiBJ5PFqQnDEIt3NrA3COlOSgz43D7gpNFNJ5MBh4oFzhDPiglC2ypsNU4ISywY2erkyb1NC3Qh/IfWj0eDgZI4/ln8WPfBsT3meTjq1Uqt1E7Zl/qftqkx6aM9KueMCekSnMrcHj1CqTWWzEzPsZGcDe3Ue4Ws+XFYVxNbOFF8ezkvQGR6ZOtOLU2lQEnMBStx47vE6Pb7AYMBRj2OOfZXfisjJnpTfSNjo6sZ6qSvNxZNmDeS7Gk3yYyCk1HtKN2UnhMIjOXUzAqDv90lx9O/q/AT1ZMnit5XQe9wmQxnE/WSH0CqZ9/2Hy+Sfmpeg8RwsHI5Z8kC8H293m/LHVVM/BA7HaTJYg5Enk7M/xWpq0192ACfBai2LA/qrCjCr6Dh1BIMzMXINBmX96MJ5Hn2nxln/RXPFhwHxUmSV0EV2V0jm86/dxxuYSU1W7sVkEbN9EzkG0QFwPhyHKyb3t+Fj5WoUUTErcazE/N6EW6Lvp0d//SDPj7EV9UdJN+Amnf3Wwk3A0SlJ9Z00yvXZ7n3z70G47Hfsow8Wq1JXcfwnA+Yxa5mFsgV464KKP4T31wqIgzFPd3eCe3j5ory5fBF2hgCFyVFrLzI9eetNXvM7oQqyFgDo4CTp/hDV9NMX9JDHQ/nyHTLvZLNLF6ftn2OxjGm8+PqOwhxnPHWipkE/8wbtyri80Sr7pMNkQGMfo4ZYK9OcCC4ESVFFbLMIvlxSoRqWie0wxqnLfcLSXMSpMMQEJYDVObYsXIQNv4TGNwjq1kvT1UOkicTrG3IaBZ3XdScS3u8sgeZPVpOLkbiF940FjbCeNRINNvDbd01EPBrTCPpm12m43ze1bBB59Ia6Ovhnur/Nvx3IxwSWol+3H2qfCJR8df6aQf4v6WiONxkK+IqT4pKQrZK/LplgDI/PJZbOep8dtbV7oCr6CgfpWa8NczOkPx81iSHbsNhVSJBOtrLIMrL31LK9TqHqAbAHe0RLmmV806kRLDLNEhUEJfm9u0sxpkL93Zgd6rw+tqBfTMi59xqXHLXSHwSbSBl0EK0+loECOPtrl+/nsaFe197di4yUgoe4jKoAJDXc6DGDjrQOoFDWZJ9HXwt8xDrQP+7aRwWKWI1GF8s8O4KzxWBBcwnl3vnl1Oez3oh6Ea1vjR7/z7DDTrFtqU2W/KAEzAuXDNZ7MY73MF216dzdSbWmUp4lcm7keJfWaMHgut9x5C9mj66Z0lJ+yhsjVvyiWrfk1lzPOTdhG15Y7gQlXtacvI7qv/XNSscDwqkgwHT/gUsD5yB7LdRRvJxQGYINn9hTpodKFVSTPrtGvyQw+HlRFXIkodErAGu9Iy1YpfSPc3jkFh5CX3lPxv7aqjE/JAfTIpEjGb/H7MO0e2vsViSW1qa/Lmi4/n4DEI3g7lYrcanspDfEpKkdV1OjSLOy0BCUqVoECaB55vs06rXl4jqmLsPsFM/7vYJ0vrBhDCm/00A/H81l1uekJ/6Lml3Hb9+NKiLqATJmDpyzfYZFHumEjC662L0Bwkxi7E9U4cQA0XMVDuMYAIeLMPgQaMVOd8fmt5SflFIfuBoszeAw7ow5gXPE2Y/yBc/7jExARUf/BxIHQBF5Sn3i61w4z5xJdCyO1F1X3+3ax+JSvMeZ7S6QSKp1Fp/sjYz6Z+VgCZzibGeEoujryfMulH7Rai5kAft9ebcW50DyJr2uo2z97mTWIu45YsSnNSMrrNUuG1XsYBtD9TDYzQffKB87vWbkM4EbPAFgoBV4GQS+vtFDUqOFAoi1nTtmIOvg38N4hT2Sn8r8clmBCXspBlMBYTnrqFJGBT3wZOzAyJDre9dHH7+x7qaaKDOB4UQALD5ecS0DE4obubQEiuJZ0EpBVpLuYcce8Aa4PYd/V4DLDAJBYKQPCWTcrEaZ5HYbJi11Gd6hjGom1ii18VHYnG28NKpkz2UKVPxlhYSp8uZr367iOmoy7zsxehW9wzcy2zG0a80PBMCRQMb32hnaHeOR8fnNDzZhaNYhkOdDsBUZ3loDMa1YP0uS0cjUP3b/6DBlqmZOeNABDsLl5BI5QJups8uxAuWJdkUB/pO6Zax6tsg7fN5mjjDgMGngO+DPcKqiHIDbFIGudxtPTIyDi9SFMKBDcfdGQRv41q1AqmxgkVfJMnP8w/Bc7N9/TR6C7mGObFqFkIEom8sKi2xYqJLTCHK7cxzaZvqODo22c3wisBCP4HeAgcRbNPAsBkNRhSmD48dHupdBRw4mIvtS5oeF6zeT1KMCyhMnmhpkFAGWnGscoNkwvQ8ZM5lE/vgTHFYL99OuNxdFBxTEDd5v2qLR8y9WkXsWgG6kZNndFG+pO/UAkOCipqIhL3hq7cRSdrCq7YhUsTocEcnaFa6nVkhnSeRYUA1YO0z5itF9Sly3VlxYDw239TJJH6f3EUfYO5lb7bcFcz8Bp7Oo8QmnsUHOz/fagVUBtKEw1iT88j+aKkv8cscKNkMxjYr8344D1kFoZ7/td1W6LCNYN594301tUGRmFjAzeRg5vyoM1F6+bJZ/Q54jN/k8SFd3DxPTYaAUsivsBfgTn7Mx8H2SpPt4GOdYRnEJOH6jHM2p6SgB0gzIRq6fHxGMmSmqaPCmlfwxiuloaVIitLGN8wie2CDWhkzLoCJcODh7KIOAqbHEvXdUxaS4TTTs07Clzj/6GmVs9kiZDerMxEnhUB6QQPlcfqkG9882RqHoLiHGBoHfQuXIsAG8GTAtao2KVwRnvvam8jo1e312GQAKWEa4sUVEAMG4G6ckcONDwRcg1e2D3+ohXgY4UAWF8wHKQMrSnzCgfFpsxh+aHXMGtPQroQasRY4U6UdG0rz1Vjbka0MekOGRZQEvqQFlxseFor8zWFgHek3v29+WqN6gaK5gZOTOMZzpQIC1201LkMCXild3vWXSc5UX9xcFYfbRPzGFa1FDcPfPB/jUEq/FeGt419CI3YmBlVoHsa4KdcwQP5ZSwHHhFJ7/Ph/Rap/4vmG91eDwPP0lDfCDRCLszTqfzM71xpmiKi2HwS4WlqvGNwtvwF5Dqpn6KTq8ax00UMPkxDcZrEEEsIvHiUXXEphdb4GB4FymlPwBz4Gperqq5pW7TQ6/yNRhW8VT5NhuP0udlxo4gILq5ZxAZk8ZGh3g4CqxJlPKY7AQxupfUcVpWT5VItp1+30UqoyP4wWsRo3olRRgkWZZ2ZN6VC3OZFeXB8NbnUrSdikNptD1QiGuKkr8EmSR/AK9Rw+FF3s5uwuPbvHGiPeFOViltMK7AUaOsq9+x9cndk3iJEE5LKZRlWJbKOZweROzmPNVPkjE3K/TyA57Rs68TkZ3MR8akKpm7cFjnjPd/DdkWjgYoKHSr5Wu5ssoBYU4acRs5g2DHxUmdq8VXOXRbunD8QN0LhgkssgahcdoYsNvuXGUK/KXD/7oFb+VGdhqIn02veuM5bLudJOc2Ky0GMaG4W/xWBxIJcL7yliJOXOpx0AkBqUgzlDczmLT4iILXDxxtRR1oZa2JWFgiAb43obrJnG/TZC2KSK2wqOzRZTXavZZFMb1f3bXvVaNaK828w9TO610gk8JNf3gMfETzXXsbcvRGCG9JWQZ6+cDPqc4466Yo2RcKH+PILeKOqtnlbInR3MmBeGG3FH10yzkybuqEC2HSQwpA0An7d9+73BkDUTm30bZmoP/RGbgFN+GrCOfADgqr0WbI1a1okpFms8iHYw9hm0zUvlEMivBRxModrbJJ+9/p3jUdQQ9BCtQdxnOGrT5dzRUmw0593/mbRSdBg0nRvRZM5/E16m7ZHmDEtWhwvfdZCZ8J8M12W0yRMszXamWfQTwIZ4ayYktrnscQuWr8idp3PjT2eF/jmtdhIfcpMnb+IfZY2FebW6UY/AK3jP4u3Tu4zE4qlnQgLFbM19EBIsNf7KhjdbqQ/D6yiDb+NlEi2SKD+ivXVUK8ib0oBo366gXkR8ZxGjpJIDcEgZPa9TcYe0TIbiPl/rPUQDu3XBJ9X/GNq3FAUsKsll57DzaGMrjcT+gctp+9MLYXCq+sqP81eVQ0r9lt+gcQfZbACRbEjvlMskztZG8gbC8Qn9tt26Q7y7nDrbZq/LEz7kR6Jc6pg3N9rVX8Y5MJrGlML9p9lU4jbTkKqCveeZUJjHB03m2KRKR2TytoFkTXOLg7keU1s1lrPMQJpoOKLuAAC+y1HlJucU6ysB5hsXhvSPPLq5J7JtnqHKZ4vYjC4Vy8153QY+6780xDuGARsGbOs1WqzH0QS765rnSKEbbKlkO8oI/VDwUd0is13tKpqILu1mDJFNy/iJAWcvDgjxvusIT+PGz3ST/J9r9Mtfd0jpaGeiLYIqXc7DiHSS8TcjFVksi66PEkxW1z6ujbLLUGNNYnzOWpH8BZGK4bCK7iR+MbIv8ncDAz1u4StN3vTTzewr9IQjk9wxFxn+6N1ddKs0vffJiS08N3a4G1SVrlZ97Q/M+8G9fe5AP6d9/Qq4WRnORVhofPIKEdCr3llspUfE0oKIIYoByBRPh+bX1HLS3JWGJRhIvE1aW4NTd8ePi4Z+kXb+Z8snYfSNcqijhAgVsx4RCM54cXUiYkjeBmmC4ajOHrChoELscJJC7+9jjMjw5BagZKlgRMiSNYz7h7vvZIoQqbtQmspc0cUk1G/73iXtSpROl5wtLgQi0mW2Ex8i3WULhcggx6E1LMVHUsdc9GHI1PH3U2Ko0PyGdn9KdVOLm7FPBui0i9a0HpA60MsewVE4z8CAt5d401Gv6zXlIT5Ybit1VIA0FCs7wtvYreru1fUyW3oLAZ/+aTnZrOcYRNVA8spoRtlRoWflsRClFcgzkqiHOrf0/SVw+EpVaFlJ0g4Kxq1MMOmiQdpMNpte8lMMQqm6cIFXlnGbfJllysKDi+0JJMotkqgIxOSQgU9dn/lWkeVf8nUm3iwX2Nl3WDw9i6AUK3vBAbZZrcJpDQ/N64AVwjT07Jef30GSSmtNu2WlW7YoyW2FlWfZFQUwk867EdLYKk9VG6JgEnBiBxkY7LMo4YLQJJlAo9l/oTvJkSARDF/XtyAzM8O2t3eT/iXa6wDN3WewNmQHdPfsxChU/KtLG2Mn8i4ZqKdSlIaBZadxJmRzVS/o4yA65RTSViq60oa395Lqw0pzY4SipwE0SXXsKV+GZraGSkr/RW08wPRvqvSUkYBMA9lPx4m24az+IHmCbXA+0faxTRE9wuGeO06DIXa6QlKJ3puIyiuAVfPr736vzo2pBirS+Vxel3TMm3JKhz9o2ZoRvaFVpIkykb0Hcm4oHFBMcNSNj7/4GJt43ogonY2Vg4nsDQIWxAcorpXACzgBqQPjYsE/VUpXpwNManEru4NwMCFPkXvMoqvoeLN3qyu/N1eWEHttMD65v19l/0kH2mR35iv/FI+yjoHJ9gPMz67af3Mq/BoWXqu3rphiWMXVkmnPSEkpGpUI2h1MThideGFEOK6YZHPwYzMBvpNC7+ZHxPb7epfefGyIB4JzO9DTNEYnDLVVHdQyvOEVefrk6Uv5kTQYVYWWdqrdcIl7yljwwIWdfQ/y+2QB3eR/qxYObuYyB4gTbo2in4PzarU1sO9nETkmj9/AoxDA+JM3GMqQtJR4jtduHtnoCLxd1gQUscHRB/MoRYIEsP2pDZ9KvHgtlk1iTbWWbHhohwFEYX7y51fUV2nuUmnoUcqnWIQAAgl9LTVX+Bc0QGNEhChxHR4YjfE51PUdGfsSFE6ck7BL3/hTf9jLq4G1IafINxOLKeAtO7quulYvH5YOBc+zX7CrMgWnW47/jfRsWnJjYYoE7xMfWV2HN2iyIqLI";const RA=new Map([[8217,"apostrophe"],[8260,"fraction slash"],[12539,"middle dot"]]),MA=4;function J9(t){let e=0;function n(){return t[e++]<<8|t[e++]}let r=n(),i=1,o=[0,1];for(let R=1;R<r;R++)o.push(i+=n());let s=n(),a=e;e+=s;let l=0,c=0;function u(){return l==0&&(c=c<<8|t[e++],l=8),c>>--l&1}const d=31,h=2**d,g=h>>>1,b=g>>1,p=h-1;let w=0;for(let R=0;R<d;R++)w=w<<1|u();let S=[],O=0,T=h;for(;;){let R=Math.floor(((w-O+1)*i-1)/T),j=0,q=r;for(;q-j>1;){let V=j+q>>>1;R<o[V]?q=V:j=V}if(j==0)break;S.push(j);let G=O+Math.floor(T*o[j]/i),L=O+Math.floor(T*o[j+1]/i)-1;for(;((G^L)&g)==0;)w=w<<1&p|u(),G=G<<1&p,L=L<<1&p|1;for(;G&~L&b;)w=w&g|w<<1&p>>>1|u(),G=G<<1^g,L=(L^g)<<1|g|1;O=G,T=1+L-G}let $=r-4;return S.map(R=>{switch(R-$){case 3:return $+65792+(t[a++]<<16|t[a++]<<8|t[a++]);case 2:return $+256+(t[a++]<<8|t[a++]);case 1:return $+t[a++];default:return R-1}})}function Z9(t){let e=0;return()=>t[e++]}function LA(t){return Z9(J9(e$(t)))}function e$(t){let e=[];[..."ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"].forEach((i,o)=>e[i.charCodeAt(0)]=o);let n=t.length,r=new Uint8Array(6*n>>3);for(let i=0,o=0,s=0,a=0;i<n;i++)a=a<<6|e[t.charCodeAt(i)],s+=6,s>=8&&(r[o++]=a>>(s-=8));return r}function t$(t){return t&1?~t>>1:t>>1}function n$(t,e){let n=Array(t);for(let r=0,i=0;r<t;r++)n[r]=i+=t$(e());return n}function td(t,e=0){let n=[];for(;;){let r=t(),i=t();if(!i)break;e+=r;for(let o=0;o<i;o++)n.push(e+o);e+=i+1}return n}function FA(t){return nd(()=>{let e=td(t);if(e.length)return e})}function _A(t){let e=[];for(;;){let n=t();if(n==0)break;e.push(r$(n,t))}for(;;){let n=t()-1;if(n<0)break;e.push(i$(n,t))}return e.flat()}function nd(t){let e=[];for(;;){let n=t(e.length);if(!n)break;e.push(n)}return e}function VA(t,e,n){let r=Array(t).fill().map(()=>[]);for(let i=0;i<e;i++)n$(t,n).forEach((o,s)=>r[s].push(o));return r}function r$(t,e){let n=1+e(),r=e(),i=nd(e);return VA(i.length,1+t,e).flatMap((s,a)=>{let[l,...c]=s;return Array(i[a]).fill().map((u,d)=>{let h=d*r;return[l+d*n,c.map(g=>g+h)]})})}function i$(t,e){let n=1+e();return VA(n,1+t,e).map(i=>[i[0],i.slice(1)])}function o$(t){let e=[],n=td(t);return i(r([]),[]),e;function r(o){let s=t(),a=nd(()=>{let l=td(t).map(c=>n[c]);if(l.length)return r(l)});return{S:s,B:a,Q:o}}function i({S:o,B:s},a,l){if(!(o&4&&l===a[a.length-1])){o&2&&(l=a[a.length-1]),o&1&&e.push(a);for(let c of s)for(let u of c.Q)i(c,[...a,u],l)}}}function s$(t){return t.toString(16).toUpperCase().padStart(2,"0")}function DA(t){return`{${s$(t)}}`}function a$(t){let e=[];for(let n=0,r=t.length;n<r;){let i=t.codePointAt(n);n+=i<65536?1:2,e.push(i)}return e}function ql(t){let n=t.length;if(n<4096)return String.fromCodePoint(...t);let r=[];for(let i=0;i<n;)r.push(String.fromCodePoint(...t.slice(i,i+=4096)));return r.join("")}function l$(t,e){let n=t.length,r=n-e.length;for(let i=0;r==0&&i<n;i++)r=t[i]-e[i];return r}var c$="AEUDTAHBCFQATQDRADAAcgAgADQAFAAsABQAHwAOACQADQARAAoAFwAHABIACAAPAAUACwAFAAwABAAQAAMABwAEAAoABQAIAAIACgABAAQAFAALAAIACwABAAIAAQAHAAMAAwAEAAsADAAMAAwACgANAA0AAwAKAAkABAAdAAYAZwDSAdsDJgC0CkMB8xhZAqfoC190UGcThgBurwf7PT09Pb09AjgJum8OjDllxHYUKXAPxzq6tABAxgK8ysUvWAgMPT09PT09PSs6LT2HcgWXWwFLoSMEEEl5RFVMKvO0XQ8ExDdJMnIgsj26PTQyy8FfEQ8AY8IPAGcEbwRwBHEEcgRzBHQEdQR2BHcEeAR6BHsEfAR+BIAEgfndBQoBYgULAWIFDAFiBNcE2ATZBRAFEQUvBdALFAsVDPcNBw13DYcOMA4xDjMB4BllHI0B2grbAMDpHLkQ7QHVAPRNQQFnGRUEg0yEB2uaJF8AJpIBpob5AERSMAKNoAXqaQLUBMCzEiACnwRZEkkVsS7tANAsBG0RuAQLEPABv9HICTUBXigPZwRBApMDOwAamhtaABqEAY8KvKx3LQ4ArAB8UhwEBAVSagD8AEFZADkBIadVj2UMUgx5Il4ANQC9AxIB1BlbEPMAs30CGxlXAhwZKQIECBc6EbsCoxngzv7UzRQA8M0BawL6ZwkN7wABAD33OQRcsgLJCjMCjqUChtw/km+NAsXPAoP2BT84PwURAK0RAvptb6cApQS/OMMey5HJS84UdxpxTPkCogVFITaTOwERAK5pAvkNBOVyA7q3BKlOJSALAgUIBRcEdASpBXqzABXFSWZOawLCOqw//AolCZdvv3dSBkEQGyelEPcMMwG1ATsN7UvYBPEGOwTJH30ZGQ/NlZwIpS3dDO0m4y6hgFoj9SqDBe1L9DzdC01RaA9ZC2UJ4zpjgU4DIQENIosK3Q05CG0Q8wrJaw3lEUUHOQPVSZoApQcBCxEdNRW1JhBirAsJOXcG+xr2C48mrxMpevwF0xohBk0BKRr/AM8u54WwWjFcHE9fBgMLJSPHFKhQIA0lQLd4SBobBxUlqQKRQ3BKh1E2HpMh9jw9DWYuE1F8B/U8BRlPC4E8nkarRQ4R0j6NPUgiSUwsBDV/LC8niwnPD4UMuXxyAVkJIQmxDHETMREXN8UIOQcZLZckJxUIIUaVYJoE958D8xPRAwsFPwlBBxMDtRwtEy4VKQUNgSTXAvM21S6zAo9WgAEXBcsPJR/fEFBH4A7pCJsCZQODJesALRUhABcimwhDYwBfj9hTBS7LCMdqbCN0A2cU52ERcweRDlcHpxwzFb8c4XDIXguGCCijrwlbAXUJmQFfBOMICTVbjKAgQWdTi1gYmyBhQT9d/AIxDGUVn0S9h3gCiw9rEhsBNQFzBzkNAQJ3Ee0RaxCVCOuGBDW1M/g6JQRPIYMgEQonA09szgsnJvkM+GkBoxJiAww0PXfuZ6tgtiQX/QcZMsVBYCHxC5JPzQycGsEYQlQuGeQHvwPzGvMn6kFXBf8DowMTOk0z7gS9C2kIiwk/AEkOoxcH1xhqCnGM0AExiwG3mQNXkYMCb48GNwcLAGcLhwV55QAdAqcIowAFAM8DVwA5Aq0HnQAZAIVBAT0DJy8BIeUCjwOTCDHLAZUvAfMpBBvDDBUA9zduSgLDsQKAamaiBd1YAo4CSTUBTSUEBU5HUQOvceEA2wBLBhPfRwEVq0rLGuNDAd9vKwDHAPsABTUHBUEBzQHzbQC3AV8LMQmis7UBTekpAIMAFWsB1wKJAN0ANQB/8QFTAE0FWfkF0wJPSQERMRgrV2EBuwMfATMBDQB5BsuNpckHHwRtB9MCEBsV4QLvLge1AQMi3xPNQsUCvd5VoWACZIECYkJbTa9bNyACofcCaJgCZgkCn4Q4GwsCZjsCZiYEbgR/A38TA36SOQY5dxc5gjojIwJsHQIyNjgKAm3HAm2u74ozZ0UrAWcA3gDhAEoFB5gMjQD+C8IADbUCdy8CdqI/AnlLQwJ4uh1c20WuRtcCfD8CesgCfQkCfPAFWQUgSABIfWMkAoFtAoAAAoAFAn+uSVhKWxUXSswC0QEC0MxLJwOITwOH5kTFkTIC8qFdAwMDrkvOTC0lA89NTE2vAos/AorYwRsHHUNnBbcCjjcCjlxAl4ECjtkCjlx4UbRTNQpS1FSFApP7ApMMAOkAHFUeVa9V0AYsGymVhjLheGZFOzkCl58C77JYIagAWSUClo8ClnycAKlZrFoJgU0AOwKWtQKWTlxEXNECmcsCmWRcyl0HGQKcmznCOp0CnBYCn5sCnriKAB0PMSoPAp3xAp6SALU9YTRh7wKe0wKgbgGpAp6fHwKeTqVjyGQnJSsCJ68CJn4CoPsCoEwCot0CocQCpi8Cpc4Cp/8AfQKn8mh8aLEAA0lqHGrRAqzjAqyuAq1nAq0CAlcdAlXcArHh1wMfTmyXArK9DQKy6Bds4G1jbUhfAyXNArZcOz9ukAMpRQK4XgK5RxUCuSp3cDZw4QK9GQK72nCWAzIRAr6IcgIDM3ECvhpzInNPAsPLAsMEc4J0SzVFdOADPKcDPJoDPb8CxXwCxkcCxhCJAshpUQLIRALJTwLJLgJknQLd0nh5YXiueSVL0AMYo2cCAmH0GfOVJHsLXpJeuxECz2sCz2wvS1PS8xOfAMatAs9zASnqA04SfksFAtwnAtuKAtJPA1JcA1NfAQEDVYyAiT8AyxbtYEWCHILTgs6DjQLaxwLZ3oQQhEmnPAOGpQAvA2QOhnFZ+QBVAt9lAt64c3cC4i/tFAHzMCcB9JsB8tKHAuvzAulweQLq+QLq5AD5RwG5Au6JAuuclqqXAwLuPwOF4Jh5cOBxoQLzAwBpA44WmZMC9xMDkW4DkocC95gC+dkC+GaaHJqruzebHgOdgwL++gEbADmfHJ+zAwWNA6ZqA6bZANHFAwZqoYiiBQkDDEkCwAA/AwDhQRdTARHzA2sHl2cFAJMtK7evvdsBiZkUfxEEOQH7KQUhDp0JnwCS/SlXxQL3AZ0AtwW5AG8LbUEuFCaNLgFDAYD8AbUmAHUDDgRtACwCFgyhAAAKAj0CagPdA34EkQEgRQUhfAoABQBEABMANhICdwEABdUDa+8KxQIA9wqfJ7+xt+UBkSFBQgHpFH8RNMCJAAQAGwBaAkUChIsABjpTOpSNbQC4Oo860ACNOME63AClAOgAywE6gTo7Ofw5+Tt2iTpbO56JOm85GAFWATMBbAUvNV01njWtNWY1dTW2NcU1gjWRNdI14TWeNa017jX9NbI1wTYCNhE1xjXVNhY2JzXeNe02LjY9Ni41LSE2OjY9Njw2yTcIBJA8VzY4Nt03IDcPNsogN4k3MAoEsDxnNiQ3GTdsOo03IULUQwdC4EMLHA8PCZsobShRVQYA6X8A6bABFCnXAukBowC9BbcAbwNzBL8MDAMMAQgDAAkKCwsLCQoGBAVVBI/DvwDz9b29kaUCb0QtsRTNLt4eGBcSHAMZFhYZEhYEARAEBUEcQRxBHEEcQRxBHEEaQRxBHEFCSTxBPElISUhBNkM2QTYbNklISVmBVIgBFLWZAu0BhQCjBcEAbykBvwGJAaQcEZ0ePCklMAAhMvAIMAL54gC7Bm8EescjzQMpARQpKgDUABavAj626xQAJP0A3etzuf4NNRA7efy2Z9NQrCnC0OSyANz5BBIbJ5IFDR6miIavYS6tprjjmuKebxm5C74Q225X1pkaYYPb6f1DK4k3xMEBb9S2WMjEibTNWhsRJIA+vwNVEiXTE5iXs/wezV66oFLfp9NZGYW+Gk19J2+bCT6Ye2w6LDYdgzKMUabk595eLBCXANz9HUpWbATq9vqXVx9XDg+Pc9Xp4+bsS005SVM/BJBM4687WUuf+Uj9dEi8aDNaPxtpbDxcG1THTImUMZq4UCaaNYpsVqraNyKLJXDYsFZ/5jl7bLRtO88t7P3xZaAxhb5OdPMXqsSkp1WCieG8jXm1U99+blvLlXzPCS+M93VnJCiK+09LfaSaBAVBomyDgJua8dfUzR7ga34IvR2Nvj+A9heJ6lsl1KG4NkI1032Cnff1m1wof2B9oHJK4bi6JkEdSqeNeiuo6QoZZincoc73/TH9SXF8sCE7XyuYyW8WSgbGFCjPV0ihLKhdPs08Tx82fYAkLLc4I2wdl4apY7GU5lHRFzRWJep7Ww3wbeA3qmd59/86P4xuNaqDpygXt6M85glSBHOCGgJDnt+pN9bK7HApMguX6+06RZNjzVmcZJ+wcUrJ9//bpRNxNuKpNl9uFds+S9tdx7LaM5ZkIrPj6nIU9mnbFtVbs9s/uLgl8MVczAwet+iOEzzBlYW7RCMgE6gyNLeq6+1tIx4dpgZnd0DksJS5f+JNDpwwcPNXaaVspq1fbQajOrJgK0ofKtJ1Ne90L6VO4MOl5S886p7u6xo7OLjG8TGL+HU1JXGJgppg4nNbNJ5nlzSpuPYy21JUEcUA94PoFiZfjZue+QnyQ80ekOuZVkxx4g+cvhJfHgNl4hy1/a6+RKcKlar/J29y//EztlbVPHVUeQ1zX86eQVAjR/M3dA9w4W8LfaXp4EgM85wOWasli837PzVMOnsLzR+k3o75/lRPAJSE1xAKQzEi5v10ke+VBvRt1cwQRMd+U5mLCTGVd6XiZtgBG5cDi0w22GKcVNvHiu5LQbZEDVtz0onn7k5+heuKXVsZtSzilkLRAUmjMXEMB3J9YC50XBxPiz53SC+EhnPl9WsKCv92SM/OFFIMJZYfl0WW8tIO3UxYcwdMAj7FSmgrsZ2aAZO03BOhP1bNNZItyXYQFTpC3SG1VuPDqH9GkiCDmE+JwxyIVSO5siDErAOpEXFgjy6PQtOVDj+s6e1r8heWVvmZnTciuf4EiNZzCAd7SOMhXERIOlsHIMG399i9aLTy3m2hRLZjJVDNLS53iGIK11dPqQt0zBDyg6qc7YqkDm2M5Ve6dCWCaCbTXX2rToaIgz6+zh4lYUi/+6nqcFMAkQJKHYLK0wYk5N9szV6xihDbDDFr45lN1K4aCXBq/FitPSud9gLt5ZVn+ZqGX7cwm2z5EGMgfFpIFyhGGuDPmso6TItTMwny+7uPnLCf4W6goFQFV0oQSsc9VfMmVLcLr6ZetDZbaSFTLqnSO/bIPjA3/zAUoqgGFAEQS4IhuMzEp2I3jJzbzkk/IEmyax+rhZTwd6f+CGtwPixu8IvzACquPWPREu9ZvGkUzpRwvRRuaNN6cr0W1wWits9ICdYJ7ltbgMiSL3sTPeufgNcVqMVWFkCPDH4jG2jA0XcVgQj62Cb29v9f/z/+2KbYvIv/zzjpQAPkliaVDzNrW57TZ/ZOyZD0nlfMmAIBIAGAI0D3k/mdN4xr9v85ZbZbbqfH2jGd5hUqNZWwl5SPfoGmfElmazUIeNL1j/mkF7VNAzTq4jNt8JoQ11NQOcmhprXoxSxfRGJ9LDEOAQ+dmxAQH90iti9e2u/MoeuaGcDTHoC+xsmEeWmxEKefQuIzHbpw5Tc5cEocboAD09oipWQhtTO1wivf/O+DRe2rpl/E9wlrzBorjJsOeG1B/XPW4EaJEFdNlECEZga5ZoGRHXgYouGRuVkm8tDESiEyFNo+3s5M5puSdTyUL2llnINVHEt91XUNW4ewdMgJ4boJfEyt/iY5WXqbA+A2Fkt5Z0lutiWhe9nZIyIUjyXDC3UsaG1t+eNx6z4W/OYoTB7A6x+dNSTOi9AInctbESqm5gvOLww7OWXPrmHwVZasrl4eD113pm+JtT7JVOvnCXqdzzdTRHgJ0PiGTFYW5Gvt9R9LD6Lzfs0v/TZZHSmyVNq7viIHE6DBK7Qp07Iz55EM8SYtQvZf/obBniTWi5C2/ovHfw4VndkE5XYdjOhCMRjDeOEfXeN/CwfGduiUIfsoFeUxXeQXba7c7972XNv8w+dTjjUM0QeNAReW+J014dKAD/McQYXT7c0GQPIkn3Ll6R7gGjuiQoZD0TEeEqQpKoZ15g/0OPQI17QiSv9AUROa/V/TQN3dvLArec3RrsYlvBm1b8LWzltdugsC50lNKYLEp2a+ZZYqPejULRlOJh5zj/LVMyTDvwKhMxxwuDkxJ1QpoNI0OTWLom4Z71SNzI9TV1iXJrIu9Wcnd+MCaAw8o1jSXd94YU/1gnkrC9BUEOtQvEIQ7g0i6h+KL2JKk8Ydl7HruvgWMSAmNe+LshGhV4qnWHhO9/RIPQzY1tHRj2VqOyNsDpK0cww+56AdDC4gsWwY0XxoucIWIqs/GcwnWqlaT0KPr8mbK5U94/301i1WLt4YINTVvCFBrFZbIbY8eycOdeJ2teD5IfPLCRg7jjcFTwlMFNl9zdh/o3E/hHPwj7BWg0MU09pPrBLbrCgm54A6H+I6v27+jL5gkjWg/iYdks9jbfVP5y/n0dlgWEMlKasl7JvFZd56LfybW1eeaVO0gxTfXZwD8G4SI116yx7UKVRgui6Ya1YpixqXeNLc8IxtAwCU5IhwQgn+NqHnRaDv61CxKhOq4pOX7M6pkA+Pmpd4j1vn6ACUALoLLc4vpXci8VidLxzm7qFBe7s+quuJs6ETYmnpgS3LwSZxPIltgBDXz8M1k/W2ySNv2f9/NPhxLGK2D21dkHeSGmenRT3Yqcdl0m/h3OYr8V+lXNYGf8aCCpd4bWjE4QIPj7vUKN4Nrfs7ML6Y2OyS830JCnofg/k7lpFpt4SqZc5HGg1HCOrHvOdC8bP6FGDbE/VV0mX4IakzbdS/op+Kt3G24/8QbBV7y86sGSQ/vZzU8FXs7u6jIvwchsEP2BpIhW3G8uWNwa3HmjfH/ZjhhCWvluAcF+nMf14ClKg5hGgtPLJ98ueNAkc5Hs2WZlk2QHvfreCK1CCGO6nMZVSb99VM/ajr8WHTte9JSmkXq/i/U943HEbdzW6Re/S88dKgg8pGOLlAeNiqrcLkUR3/aClFpMXcOUP3rmETcWSfMXZE3TUOi8i+fqRnTYLflVx/Vb/6GJ7eIRZUA6k3RYR3iFSK9c4iDdNwJuZL2FKz/IK5VimcNWEqdXjSoxSgmF0UPlDoUlNrPcM7ftmA8Y9gKiqKEHuWN+AZRIwtVSxye2Kf8rM3lhJ5XcBXU9n4v0Oy1RU2M+4qM8AQPVwse8ErNSob5oFPWxuqZnVzo1qB/IBxkM3EVUKFUUlO3e51259GgNcJbCmlvrdjtoTW7rChm1wyCKzpCTwozUUEOIcWLneRLgMXh+SjGSFkAllzbGS5HK7LlfCMRNRDSvbQPjcXaenNYxCvu2Qyznz6StuxVj66SgI0T8B6/sfHAJYZaZ78thjOSIFumNWLQbeZixDCCC+v0YBtkxiBB3jefHqZ/dFHU+crbj6OvS1x/JDD7vlm7zOVPwpUC01nhxZuY/63E7g";const rd=44032,jh=4352,Kh=4449,qh=4519,zA=19,UA=21,Yl=28,Yh=UA*Yl,u$=zA*Yh,d$=rd+u$,f$=jh+zA,h$=Kh+UA,p$=qh+Yl;function id(t){return t>>24&255}function $A(t){return t&16777215}let Gm,HA,jm,Qh;function g$(){let t=LA(c$);Gm=new Map(FA(t).flatMap((e,n)=>e.map(r=>[r,n+1<<24]))),HA=new Set(td(t)),jm=new Map,Qh=new Map;for(let[e,n]of _A(t)){if(!HA.has(e)&&n.length==2){let[r,i]=n,o=Qh.get(r);o||(o=new Map,Qh.set(r,o)),o.set(i,e)}jm.set(e,n.reverse())}}function WA(t){return t>=rd&&t<d$}function m$(t,e){if(t>=jh&&t<f$&&e>=Kh&&e<h$)return rd+(t-jh)*Yh+(e-Kh)*Yl;if(WA(t)&&e>qh&&e<p$&&(t-rd)%Yl==0)return t+(e-qh);{let n=Qh.get(t);return n&&(n=n.get(e),n)?n:-1}}function GA(t){Gm||g$();let e=[],n=[],r=!1;function i(o){let s=Gm.get(o);s&&(r=!0,o|=s),e.push(o)}for(let o of t)for(;;){if(o<128)e.push(o);else if(WA(o)){let s=o-rd,a=s/Yh|0,l=s%Yh/Yl|0,c=s%Yl;i(jh+a),i(Kh+l),c>0&&i(qh+c)}else{let s=jm.get(o);s?n.push(...s):i(o)}if(!n.length)break;o=n.pop()}if(r&&e.length>1){let o=id(e[0]);for(let s=1;s<e.length;s++){let a=id(e[s]);if(a==0||o<=a){o=a;continue}let l=s-1;for(;;){let c=e[l+1];if(e[l+1]=e[l],e[l]=c,!l||(o=id(e[--l]),o<=a))break}o=id(e[s])}}return e}function y$(t){let e=[],n=[],r=-1,i=0;for(let o of t){let s=id(o),a=$A(o);if(r==-1)s==0?r=a:e.push(a);else if(i>0&&i>=s)s==0?(e.push(r,...n),n.length=0,r=a):n.push(a),i=s;else{let l=m$(r,a);l>=0?r=l:i==0&&s==0?(e.push(r),r=a):(n.push(a),i=s)}}return r>=0&&e.push(r,...n),e}function jA(t){return GA(t).map($A)}function b$(t){return y$(GA(t))}const KA=45,qA=".",YA=65039,QA=1,Xh=t=>Array.from(t);function od(t,e){return t.P.has(e)||t.Q.has(e)}class v$ extends Array{get is_emoji(){return!0}}let Km,XA,fa,qm,JA,Ql,Ym,Xl,ha,ZA,Qm;function Xm(){if(Km)return;let t=LA(X9);const e=()=>td(t),n=()=>new Set(e()),r=(u,d)=>d.forEach(h=>u.add(h));Km=new Map(_A(t)),XA=n(),fa=e(),qm=new Set(e().map(u=>fa[u])),fa=new Set(fa),JA=n(),n();let i=FA(t),o=t();const s=()=>{let u=new Set;return e().forEach(d=>r(u,i[d])),r(u,e()),u};Ql=nd(u=>{let d=nd(t).map(h=>h+96);if(d.length){let h=u>=o;d[0]-=32,d=ql(d),h&&(d=`Restricted[${d}]`);let g=s(),b=s(),p=!t();return{N:d,P:g,Q:b,M:p,R:h}}}),Ym=n(),Xl=new Map;let a=e().concat(Xh(Ym)).sort((u,d)=>u-d);a.forEach((u,d)=>{let h=t(),g=a[d]=h?a[d-h]:{V:[],M:new Map};g.V.push(u),Ym.has(u)||Xl.set(u,g)});for(let{V:u,M:d}of new Set(Xl.values())){let h=[];for(let b of u){let p=Ql.filter(S=>od(S,b)),w=h.find(({G:S})=>p.some(O=>S.has(O)));w||(w={G:new Set,V:[]},h.push(w)),w.V.push(b),r(w.G,p)}let g=h.flatMap(b=>Xh(b.G));for(let{G:b,V:p}of h){let w=new Set(g.filter(S=>!b.has(S)));for(let S of p)d.set(S,w)}}ha=new Set;let l=new Set;const c=u=>ha.has(u)?l.add(u):ha.add(u);for(let u of Ql){for(let d of u.P)c(d);for(let d of u.Q)c(d)}for(let u of ha)!Xl.has(u)&&!l.has(u)&&Xl.set(u,QA);r(ha,jA(ha)),ZA=o$(t).map(u=>v$.from(u)).sort(l$),Qm=new Map;for(let u of ZA){let d=[Qm];for(let h of u){let g=d.map(b=>{let p=b.get(h);return p||(p=new Map,b.set(h,p)),p});h===YA?d.push(...g):d=g}for(let h of d)h.V=u}}function Jm(t){return(ek(t)?"":`${Zm(Jh([t]))} `)+DA(t)}function Zm(t){return`"${t}"‎`}function w$(t){if(t.length>=4&&t[2]==KA&&t[3]==KA)throw new Error(`invalid label extension: "${ql(t.slice(0,4))}"`)}function x$(t){for(let n=t.lastIndexOf(95);n>0;)if(t[--n]!==95)throw new Error("underscore allowed only at start")}function E$(t){let e=t[0],n=RA.get(e);if(n)throw sd(`leading ${n}`);let r=t.length,i=-1;for(let o=1;o<r;o++){e=t[o];let s=RA.get(e);if(s){if(i==o)throw sd(`${n} + ${s}`);i=o+1,n=s}}if(i==r)throw sd(`trailing ${n}`)}function Jh(t,e=1/0,n=DA){let r=[];S$(t[0])&&r.push("◌"),t.length>e&&(e>>=1,t=[...t.slice(0,e),8230,...t.slice(-e)]);let i=0,o=t.length;for(let s=0;s<o;s++){let a=t[s];ek(a)&&(r.push(ql(t.slice(i,s))),r.push(n(a)),i=s+1)}return r.push(ql(t.slice(i,o))),r.join("")}function S$(t){return Xm(),fa.has(t)}function ek(t){return Xm(),JA.has(t)}function A$(t){return O$(k$(t,b$,N$))}function k$(t,e,n){if(!t)return[];Xm();let r=0;return t.split(qA).map(i=>{let o=a$(i),s={input:o,offset:r};r+=o.length+1;try{let a=s.tokens=P$(o,e,n),l=a.length,c;if(!l)throw new Error("empty label");let u=s.output=a.flat();if(x$(u),!(s.emoji=l>1||a[0].is_emoji)&&u.every(h=>h<128))w$(u),c="ASCII";else{let h=a.flatMap(g=>g.is_emoji?[]:g);if(!h.length)c="Emoji";else{if(fa.has(u[0]))throw sd("leading combining mark");for(let p=1;p<l;p++){let w=a[p];if(!w.is_emoji&&fa.has(w[0]))throw sd(`emoji + combining mark: "${ql(a[p-1])} + ${Jh([w[0]])}"`)}E$(u);let g=Xh(new Set(h)),[b]=I$(g);T$(b,h),C$(b,g),c=b.N}}s.type=c}catch(a){s.error=a}return s})}function C$(t,e){let n,r=[];for(let i of e){let o=Xl.get(i);if(o===QA)return;if(o){let s=o.M.get(i);if(n=n?n.filter(a=>s.has(a)):Xh(s),!n.length)return}else r.push(i)}if(n){for(let i of n)if(r.every(o=>od(i,o)))throw new Error(`whole-script confusable: ${t.N}/${i.N}`)}}function I$(t){let e=Ql;for(let n of t){let r=e.filter(i=>od(i,n));if(!r.length)throw Ql.some(i=>od(i,n))?nk(e[0],n):tk(n);if(e=r,r.length==1)break}return e}function O$(t){return t.map(({input:e,error:n,output:r})=>{if(n){let i=n.message;throw new Error(t.length==1?i:`Invalid label ${Zm(Jh(e,63))}: ${i}`)}return ql(r)}).join(qA)}function tk(t){return new Error(`disallowed character: ${Jm(t)}`)}function nk(t,e){let n=Jm(e),r=Ql.find(i=>i.P.has(e));return r&&(n=`${r.N} ${n}`),new Error(`illegal mixture: ${t.N} + ${n}`)}function sd(t){return new Error(`illegal placement: ${t}`)}function T$(t,e){for(let n of e)if(!od(t,n))throw nk(t,n);if(t.M){let n=jA(e);for(let r=1,i=n.length;r<i;r++)if(qm.has(n[r])){let o=r+1;for(let s;o<i&&qm.has(s=n[o]);o++)for(let a=r;a<o;a++)if(n[a]==s)throw new Error(`duplicate non-spacing marks: ${Jm(s)}`);if(o-r>MA)throw new Error(`excessive non-spacing marks: ${Zm(Jh(n.slice(r-1,o)))} (${o-r}/${MA})`);r=o}}}function P$(t,e,n){let r=[],i=[];for(t=t.slice().reverse();t.length;){let o=B$(t);if(o)i.length&&(r.push(e(i)),i=[]),r.push(n(o));else{let s=t.pop();if(ha.has(s))i.push(s);else{let a=Km.get(s);if(a)i.push(...a);else if(!XA.has(s))throw tk(s)}}}return i.length&&r.push(e(i)),r}function N$(t){return t.filter(e=>e!=YA)}function B$(t,e){let n=Qm,r,i=t.length;for(;i&&(n=n.get(t[--i]),!!n);){let{V:o}=n;o&&(r=o,t.length=i)}return r}const rk=new Uint8Array(32);rk.fill(0);function ik(t){return ne(t.length!==0,"invalid ENS name; empty component","comp",t),t}function ok(t){const e=Oi(R$(t)),n=[];if(t.length===0)return n;let r=0;for(let i=0;i<e.length;i++)e[i]===46&&(n.push(ik(e.slice(r,i))),r=i+1);return ne(r<e.length,"invalid ENS name; empty component","name",t),n.push(ik(e.slice(r))),n}function R$(t){try{if(t.length===0)throw new Error("empty label");return A$(t)}catch(e){ne(!1,`invalid ENS name (${e.message})`,"name",t)}}function ey(t){ne(typeof t=="string","invalid ENS name; not a string","name",t),ne(t.length,"invalid ENS name (empty label)","name",t);let e=rk;const n=ok(t);for(;n.length;)e=Ft(xt([e,Ft(n.pop())]));return ve(e)}function M$(t,e){const n=e;return ne(n<=255,"DNS encoded label cannot exceed 255","length",n),ve(xt(ok(t).map(r=>{ne(r.length<=n,`label ${JSON.stringify(t)} exceeds ${n} bytes`,"name",t);const i=new Uint8Array(r.length+1);return i.set(r,1),i[0]=i.length-1,i})))+"00"}const sk=new Uint8Array(32);sk.fill(0);const L$=BigInt(-1),ak=BigInt(0),lk=BigInt(1),F$=BigInt("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");function _$(t){const e=Ue(t),n=e.length%32;return n?xt([e,sk.slice(n)]):ve(e)}const V$=ns(lk,32),D$=ns(ak,32),ck={name:"string",version:"string",chainId:"uint256",verifyingContract:"address",salt:"bytes32"},ty=["name","version","chainId","verifyingContract","salt"];function uk(t){return function(e){return ne(typeof e=="string",`invalid domain value for ${JSON.stringify(t)}`,`domain.${t}`,e),e}}const z$={name:uk("name"),version:uk("version"),chainId:function(t){const e=Se(t,"domain.chainId");return ne(e>=0,"invalid chain ID","domain.chainId",t),Number.isSafeInteger(e)?Number(e):ei(e)},verifyingContract:function(t){try{return rt(t).toLowerCase()}catch(e){}ne(!1,'invalid domain value "verifyingContract"',"domain.verifyingContract",t)},salt:function(t){const e=Ue(t,"domain.salt");return ne(e.length===32,'invalid domain value "salt"',"domain.salt",t),ve(e)}};function ny(t){{const e=t.match(/^(u?)int(\d+)$/);if(e){const n=e[1]==="",r=parseInt(e[2]);ne(r%8===0&&r!==0&&r<=256&&e[2]===String(r),"invalid numeric width","type",t);const i=Ku(F$,n?r-1:r),o=n?(i+lk)*L$:ak;return function(s){const a=Se(s,"value");return ne(a>=o&&a<=i,`value out-of-bounds for ${t}`,"value",a),ns(n?dS(a,256):a,32)}}}{const e=t.match(/^bytes(\d+)$/);if(e){const n=parseInt(e[1]);return ne(n!==0&&n<=32&&e[1]===String(n),"invalid bytes width","type",t),function(r){const i=Ue(r);return ne(i.length===n,`invalid length for ${t}`,"value",r),_$(r)}}}switch(t){case"address":return function(e){return ho(rt(e),32)};case"bool":return function(e){return e?V$:D$};case"bytes":return function(e){return Ft(e)};case"string":return function(e){return da(e)}}return null}function dk(t,e){return`${t}(${e.map(({name:n,type:r})=>r+" "+n).join(",")})`}function Zh(t){const e=t.match(/^([^\x5b]*)((\x5b\d*\x5d)*)(\x5b(\d*)\x5d)$/);return e?{base:e[1],index:e[2]+e[4],array:{base:e[1],prefix:e[1]+e[2],count:e[5]?parseInt(e[5]):-1}}:{base:t}}const Vr=class Vr{constructor(e){ce(this,Kp);oe(this,"primaryType");ce(this,Rd);ce(this,Ro);ce(this,_c);K(this,Ro,new Map),K(this,_c,new Map);const n=new Map,r=new Map,i=new Map,o={};Object.keys(e).forEach(l=>{o[l]=e[l].map(({name:c,type:u})=>{let{base:d,index:h}=Zh(u);return d==="int"&&!e.int&&(d="int256"),d==="uint"&&!e.uint&&(d="uint256"),{name:c,type:d+(h||"")}}),n.set(l,new Set),r.set(l,[]),i.set(l,new Set)}),K(this,Rd,JSON.stringify(o));for(const l in o){const c=new Set;for(const u of o[l]){ne(!c.has(u.name),`duplicate variable name ${JSON.stringify(u.name)} in ${JSON.stringify(l)}`,"types",e),c.add(u.name);const d=Zh(u.type).base;ne(d!==l,`circular type reference to ${JSON.stringify(d)}`,"types",e),!ny(d)&&(ne(r.has(d),`unknown type ${JSON.stringify(d)}`,"types",e),r.get(d).push(l),n.get(l).add(d))}}const s=Array.from(r.keys()).filter(l=>r.get(l).length===0);ne(s.length!==0,"missing primary type","types",e),ne(s.length===1,`ambiguous primary types or unused types: ${s.map(l=>JSON.stringify(l)).join(", ")}`,"types",e),Te(this,{primaryType:s[0]});function a(l,c){ne(!c.has(l),`circular type reference to ${JSON.stringify(l)}`,"types",e),c.add(l);for(const u of n.get(l))if(r.has(u)){a(u,c);for(const d of c)i.get(d).add(u)}c.delete(l)}a(this.primaryType,new Set);for(const[l,c]of i){const u=Array.from(c);u.sort(),F(this,Ro).set(l,dk(l,o[l])+u.map(d=>dk(d,o[d])).join(""))}}get types(){return JSON.parse(F(this,Rd))}getEncoder(e){let n=F(this,_c).get(e);return n||(n=be(this,Kp,TT).call(this,e),F(this,_c).set(e,n)),n}encodeType(e){const n=F(this,Ro).get(e);return ne(n,`unknown type: ${JSON.stringify(e)}`,"name",e),n}encodeData(e,n){return this.getEncoder(e)(n)}hashStruct(e,n){return Ft(this.encodeData(e,n))}encode(e){return this.encodeData(this.primaryType,e)}hash(e){return this.hashStruct(this.primaryType,e)}_visit(e,n,r){if(ny(e))return r(e,n);const i=Zh(e).array;if(i)return ne(i.count===-1||i.count===n.length,`array length mismatch; expected length ${i.count}`,"value",n),n.map(s=>this._visit(i.prefix,s,r));const o=this.types[e];if(o)return o.reduce((s,{name:a,type:l})=>(s[a]=this._visit(l,n[a],r),s),{});ne(!1,`unknown type: ${e}`,"type",e)}visit(e,n){return this._visit(this.primaryType,e,n)}static from(e){return new Vr(e)}static getPrimaryType(e){return Vr.from(e).primaryType}static hashStruct(e,n,r){return Vr.from(n).hashStruct(e,r)}static hashDomain(e){const n=[];for(const r in e){if(e[r]==null)continue;const i=ck[r];ne(i,`invalid typed-data domain key: ${JSON.stringify(r)}`,"domain",e),n.push({name:r,type:i})}return n.sort((r,i)=>ty.indexOf(r.name)-ty.indexOf(i.name)),Vr.hashStruct("EIP712Domain",{EIP712Domain:n},e)}static encode(e,n,r){return xt(["0x1901",Vr.hashDomain(e),Vr.from(n).hash(r)])}static hash(e,n,r){return Ft(Vr.encode(e,n,r))}static async resolveNames(e,n,r,i){e=Object.assign({},e);for(const a in e)e[a]==null&&delete e[a];const o={};e.verifyingContract&&!pt(e.verifyingContract,20)&&(o[e.verifyingContract]="0x");const s=Vr.from(n);s.visit(r,(a,l)=>(a==="address"&&!pt(l,20)&&(o[l]="0x"),l));for(const a in o)o[a]=await i(a);return e.verifyingContract&&o[e.verifyingContract]&&(e.verifyingContract=o[e.verifyingContract]),r=s.visit(r,(a,l)=>a==="address"&&o[l]?o[l]:l),{domain:e,value:r}}static getPayload(e,n,r){Vr.hashDomain(e);const i={},o=[];ty.forEach(l=>{const c=e[l];c!=null&&(i[l]=z$[l](c),o.push({name:l,type:ck[l]}))});const s=Vr.from(n);n=s.types;const a=Object.assign({},n);return ne(a.EIP712Domain==null,"types must not contain EIP712Domain type","types.EIP712Domain",n),a.EIP712Domain=o,s.encode(r),{types:a,domain:i,primaryType:s.primaryType,message:s.visit(r,(l,c)=>{if(l.match(/^bytes(\d*)/))return ve(Ue(c));if(l.match(/^u?int/))return Se(c).toString();switch(l){case"address":return c.toLowerCase();case"bool":return!!c;case"string":return ne(typeof c=="string","invalid string","value",c),c}ne(!1,"unsupported type","type",l)})}}};Rd=new WeakMap,Ro=new WeakMap,_c=new WeakMap,Kp=new WeakSet,TT=function(e){{const i=ny(e);if(i)return i}const n=Zh(e).array;if(n){const i=n.prefix,o=this.getEncoder(i);return s=>{ne(n.count===-1||n.count===s.length,`array length mismatch; expected length ${n.count}`,"value",s);let a=s.map(o);return F(this,Ro).has(i)&&(a=a.map(Ft)),Ft(xt(a))}}const r=this.types[e];if(r){const i=da(F(this,Ro).get(e));return o=>{const s=r.map(({name:a,type:l})=>{const c=this.getEncoder(l)(o[a]);return F(this,Ro).has(l)?Ft(c):c});return s.unshift(i),xt(s)}}ne(!1,`unknown type: ${e}`,"type",e)};let ep=Vr;function $n(t){const e=new Set;return t.forEach(n=>e.add(n)),Object.freeze(e)}const U$=$n("external public payable override".split(" ")),fk="constant external internal payable private public pure view override",$$=$n(fk.split(" ")),hk="constructor error event fallback function receive struct",pk=$n(hk.split(" ")),gk="calldata memory storage payable indexed",H$=$n(gk.split(" ")),W$=[hk,gk,"tuple returns",fk].join(" "),G$=$n(W$.split(" ")),j$={"(":"OPEN_PAREN",")":"CLOSE_PAREN","[":"OPEN_BRACKET","]":"CLOSE_BRACKET",",":"COMMA","@":"AT"},K$=new RegExp("^(\\s*)"),q$=new RegExp("^([0-9]+)"),Y$=new RegExp("^([a-zA-Z$_][a-zA-Z0-9$_]*)"),mk=new RegExp("^([a-zA-Z$_][a-zA-Z0-9$_]*)$"),yk=new RegExp("^(address|bool|bytes([0-9]*)|string|u?int([0-9]*))$"),qp=class qp{constructor(e){ce(this,Md);ce(this,Sn);ce(this,di);K(this,Sn,0),K(this,di,e.slice())}get offset(){return F(this,Sn)}get length(){return F(this,di).length-F(this,Sn)}clone(){return new qp(F(this,di))}reset(){K(this,Sn,0)}popKeyword(e){const n=this.peek();if(n.type!=="KEYWORD"||!e.has(n.text))throw new Error(`expected keyword ${n.text}`);return this.pop().text}popType(e){if(this.peek().type!==e){const n=this.peek();throw new Error(`expected ${e}; got ${n.type} ${JSON.stringify(n.text)}`)}return this.pop().text}popParen(){const e=this.peek();if(e.type!=="OPEN_PAREN")throw new Error("bad start");const n=be(this,Md,Gb).call(this,F(this,Sn)+1,e.match+1);return K(this,Sn,e.match+1),n}popParams(){const e=this.peek();if(e.type!=="OPEN_PAREN")throw new Error("bad start");const n=[];for(;F(this,Sn)<e.match-1;){const r=this.peek().linkNext;n.push(be(this,Md,Gb).call(this,F(this,Sn)+1,r)),K(this,Sn,r)}return K(this,Sn,e.match+1),n}peek(){if(F(this,Sn)>=F(this,di).length)throw new Error("out-of-bounds");return F(this,di)[F(this,Sn)]}peekKeyword(e){const n=this.peekType("KEYWORD");return n!=null&&e.has(n)?n:null}peekType(e){if(this.length===0)return null;const n=this.peek();return n.type===e?n.text:null}pop(){const e=this.peek();return Hd(this,Sn)._++,e}toString(){const e=[];for(let n=F(this,Sn);n<F(this,di).length;n++){const r=F(this,di)[n];e.push(`${r.type}:${r.text}`)}return`<TokenString ${e.join(" ")}>`}};Sn=new WeakMap,di=new WeakMap,Md=new WeakSet,Gb=function(e=0,n=0){return new qp(F(this,di).slice(e,n).map(r=>Object.freeze(Object.assign({},r,{match:r.match-e,linkBack:r.linkBack-e,linkNext:r.linkNext-e}))))};let ni=qp;function ds(t){const e=[],n=s=>{const a=o<t.length?JSON.stringify(t[o]):"$EOI";throw new Error(`invalid token ${a} at ${o}: ${s}`)};let r=[],i=[],o=0;for(;o<t.length;){let s=t.substring(o),a=s.match(K$);a&&(o+=a[1].length,s=t.substring(o));const l={depth:r.length,linkBack:-1,linkNext:-1,match:-1,type:"",text:"",offset:o,value:-1};e.push(l);let c=j$[s[0]]||"";if(c){if(l.type=c,l.text=s[0],o++,c==="OPEN_PAREN")r.push(e.length-1),i.push(e.length-1);else if(c=="CLOSE_PAREN")r.length===0&&n("no matching open bracket"),l.match=r.pop(),e[l.match].match=e.length-1,l.depth--,l.linkBack=i.pop(),e[l.linkBack].linkNext=e.length-1;else if(c==="COMMA")l.linkBack=i.pop(),e[l.linkBack].linkNext=e.length-1,i.push(e.length-1);else if(c==="OPEN_BRACKET")l.type="BRACKET";else if(c==="CLOSE_BRACKET"){let u=e.pop().text;if(e.length>0&&e[e.length-1].type==="NUMBER"){const d=e.pop().text;u=d+u,e[e.length-1].value=$e(d)}if(e.length===0||e[e.length-1].type!=="BRACKET")throw new Error("missing opening bracket");e[e.length-1].text+=u}continue}if(a=s.match(Y$),a){if(l.text=a[1],o+=l.text.length,G$.has(l.text)){l.type="KEYWORD";continue}if(l.text.match(yk)){l.type="TYPE";continue}l.type="ID";continue}if(a=s.match(q$),a){l.text=a[1],l.type="NUMBER",o+=l.text.length;continue}throw new Error(`unexpected token ${JSON.stringify(s[0])} at position ${o}`)}return new ni(e.map(s=>Object.freeze(s)))}function bk(t,e){let n=[];for(const r in e.keys())t.has(r)&&n.push(r);if(n.length>1)throw new Error(`conflicting types: ${n.join(", ")}`)}function tp(t,e){if(e.peekKeyword(pk)){const n=e.pop().text;if(n!==t)throw new Error(`expected ${t}, got ${n}`)}return e.popType("ID")}function yo(t,e){const n=new Set;for(;;){const r=t.peekType("KEYWORD");if(r==null||e&&!e.has(r))break;if(t.pop(),n.has(r))throw new Error(`duplicate keywords: ${JSON.stringify(r)}`);n.add(r)}return Object.freeze(n)}function vk(t){let e=yo(t,$$);return bk(e,$n("constant payable nonpayable".split(" "))),bk(e,$n("pure view payable nonpayable".split(" "))),e.has("view")?"view":e.has("pure")?"pure":e.has("payable")?"payable":e.has("nonpayable")?"nonpayable":e.has("constant")?"view":"nonpayable"}function bo(t,e){return t.popParams().map(n=>vn.from(n,e))}function wk(t){if(t.peekType("AT")){if(t.pop(),t.peekType("NUMBER"))return Se(t.pop().text);throw new Error("invalid gas")}return null}function pa(t){if(t.length)throw new Error(`unexpected tokens at offset ${t.offset}: ${t.toString()}`)}const Q$=new RegExp(/^(.*)\[([0-9]*)\]$/);function xk(t){const e=t.match(yk);if(ne(e,"invalid type","type",t),t==="uint")return"uint256";if(t==="int")return"int256";if(e[2]){const n=parseInt(e[2]);ne(n!==0&&n<=32,"invalid bytes length","type",t)}else if(e[3]){const n=parseInt(e[3]);ne(n!==0&&n<=256&&n%8===0,"invalid numeric width","type",t)}return t}const vt={},rr=Symbol.for("_ethers_internal"),Ek="_ParamTypeInternal",Sk="_ErrorInternal",Ak="_EventInternal",kk="_ConstructorInternal",Ck="_FallbackInternal",Ik="_FunctionInternal",Ok="_StructInternal",Dr=class Dr{constructor(e,n,r,i,o,s,a,l){ce(this,Vc);oe(this,"name");oe(this,"type");oe(this,"baseType");oe(this,"indexed");oe(this,"components");oe(this,"arrayLength");oe(this,"arrayChildren");if(Th(e,vt,"ParamType"),Object.defineProperty(this,rr,{value:Ek}),s&&(s=Object.freeze(s.slice())),i==="array"){if(a==null||l==null)throw new Error("")}else if(a!=null||l!=null)throw new Error("");if(i==="tuple"){if(s==null)throw new Error("")}else if(s!=null)throw new Error("");Te(this,{name:n,type:r,baseType:i,indexed:o,components:s,arrayLength:a,arrayChildren:l})}format(e){if(e==null&&(e="sighash"),e==="json"){const r=this.name||"";if(this.isArray()){const o=JSON.parse(this.arrayChildren.format("json"));return o.name=r,o.type+=`[${this.arrayLength<0?"":String(this.arrayLength)}]`,JSON.stringify(o)}const i={type:this.baseType==="tuple"?"tuple":this.type,name:r};return typeof this.indexed=="boolean"&&(i.indexed=this.indexed),this.isTuple()&&(i.components=this.components.map(o=>JSON.parse(o.format(e)))),JSON.stringify(i)}let n="";return this.isArray()?(n+=this.arrayChildren.format(e),n+=`[${this.arrayLength<0?"":String(this.arrayLength)}]`):this.isTuple()?n+="("+this.components.map(r=>r.format(e)).join(e==="full"?", ":",")+")":n+=this.type,e!=="sighash"&&(this.indexed===!0&&(n+=" indexed"),e==="full"&&this.name&&(n+=" "+this.name)),n}isArray(){return this.baseType==="array"}isTuple(){return this.baseType==="tuple"}isIndexable(){return this.indexed!=null}walk(e,n){if(this.isArray()){if(!Array.isArray(e))throw new Error("invalid array value");if(this.arrayLength!==-1&&e.length!==this.arrayLength)throw new Error("array is wrong length");const r=this;return e.map(i=>r.arrayChildren.walk(i,n))}if(this.isTuple()){if(!Array.isArray(e))throw new Error("invalid tuple value");if(e.length!==this.components.length)throw new Error("array is wrong length");const r=this;return e.map((i,o)=>r.components[o].walk(i,n))}return n(this.type,e)}async walkAsync(e,n){const r=[],i=[e];return be(this,Vc,ig).call(this,r,e,n,o=>{i[0]=o}),r.length&&await Promise.all(r),i[0]}static from(e,n){if(Dr.isParamType(e))return e;if(typeof e=="string")try{return Dr.from(ds(e),n)}catch(a){ne(!1,"invalid param type","obj",e)}else if(e instanceof ni){let a="",l="",c=null;yo(e,$n(["tuple"])).has("tuple")||e.peekType("OPEN_PAREN")?(l="tuple",c=e.popParams().map(p=>Dr.from(p)),a=`tuple(${c.map(p=>p.format()).join(",")})`):(a=xk(e.popType("TYPE")),l=a);let u=null,d=null;for(;e.length&&e.peekType("BRACKET");){const p=e.pop();u=new Dr(vt,"",a,l,null,c,d,u),d=p.value,a+=p.text,l="array",c=null}let h=null;if(yo(e,H$).has("indexed")){if(!n)throw new Error("");h=!0}const b=e.peekType("ID")?e.pop().text:"";if(e.length)throw new Error("leftover tokens");return new Dr(vt,b,a,l,h,c,d,u)}const r=e.name;ne(!r||typeof r=="string"&&r.match(mk),"invalid name","obj.name",r);let i=e.indexed;i!=null&&(ne(n,"parameter cannot be indexed","obj.indexed",e.indexed),i=!!i);let o=e.type,s=o.match(Q$);if(s){const a=parseInt(s[2]||"-1"),l=Dr.from({type:s[1],components:e.components});return new Dr(vt,r||"",o,"array",i,null,a,l)}if(o==="tuple"||o.startsWith("tuple(")||o.startsWith("(")){const a=e.components!=null?e.components.map(c=>Dr.from(c)):null;return new Dr(vt,r||"",o,"tuple",i,a,null,null)}return o=xk(e.type),new Dr(vt,r||"",o,o,i,null,null,null)}static isParamType(e){return e&&e[rr]===Ek}};Vc=new WeakSet,ig=function(e,n,r,i){if(this.isArray()){if(!Array.isArray(n))throw new Error("invalid array value");if(this.arrayLength!==-1&&n.length!==this.arrayLength)throw new Error("array is wrong length");const s=this.arrayChildren,a=n.slice();a.forEach((l,c)=>{var u;be(u=s,Vc,ig).call(u,e,l,r,d=>{a[c]=d})}),i(a);return}if(this.isTuple()){const s=this.components;let a;if(Array.isArray(n))a=n.slice();else{if(n==null||typeof n!="object")throw new Error("invalid tuple value");a=s.map(l=>{if(!l.name)throw new Error("cannot use object value with unnamed components");if(!(l.name in n))throw new Error(`missing value for component ${l.name}`);return n[l.name]})}if(a.length!==this.components.length)throw new Error("array is wrong length");a.forEach((l,c)=>{var u;be(u=s[c],Vc,ig).call(u,e,l,r,d=>{a[c]=d})}),i(a);return}const o=r(this.type,n);o.then?e.push(async function(){i(await o)}()):i(o)};let vn=Dr;class ga{constructor(e,n,r){oe(this,"type");oe(this,"inputs");Th(e,vt,"Fragment"),r=Object.freeze(r.slice()),Te(this,{type:n,inputs:r})}static from(e){if(typeof e=="string"){try{ga.from(JSON.parse(e))}catch(n){}return ga.from(ds(e))}if(e instanceof ni)switch(e.peekKeyword(pk)){case"constructor":return vo.from(e);case"error":return ir.from(e);case"event":return Pi.from(e);case"fallback":case"receive":return wo.from(e);case"function":return Ni.from(e);case"struct":return ma.from(e)}else if(typeof e=="object"){switch(e.type){case"constructor":return vo.from(e);case"error":return ir.from(e);case"event":return Pi.from(e);case"fallback":case"receive":return wo.from(e);case"function":return Ni.from(e);case"struct":return ma.from(e)}fe(!1,`unsupported type: ${e.type}`,"UNSUPPORTED_OPERATION",{operation:"Fragment.from"})}ne(!1,"unsupported frgament object","obj",e)}static isConstructor(e){return vo.isFragment(e)}static isError(e){return ir.isFragment(e)}static isEvent(e){return Pi.isFragment(e)}static isFunction(e){return Ni.isFragment(e)}static isStruct(e){return ma.isFragment(e)}}class np extends ga{constructor(n,r,i,o){super(n,r,o);oe(this,"name");ne(typeof i=="string"&&i.match(mk),"invalid identifier","name",i),o=Object.freeze(o.slice()),Te(this,{name:i})}}function ad(t,e){return"("+e.map(n=>n.format(t)).join(t==="full"?", ":",")+")"}class ir extends np{constructor(e,n,r){super(e,"error",n,r),Object.defineProperty(this,rr,{value:Sk})}get selector(){return da(this.format("sighash")).substring(0,10)}format(e){if(e==null&&(e="sighash"),e==="json")return JSON.stringify({type:"error",name:this.name,inputs:this.inputs.map(r=>JSON.parse(r.format(e)))});const n=[];return e!=="sighash"&&n.push("error"),n.push(this.name+ad(e,this.inputs)),n.join(" ")}static from(e){if(ir.isFragment(e))return e;if(typeof e=="string")return ir.from(ds(e));if(e instanceof ni){const n=tp("error",e),r=bo(e);return pa(e),new ir(vt,n,r)}return new ir(vt,e.name,e.inputs?e.inputs.map(vn.from):[])}static isFragment(e){return e&&e[rr]===Sk}}class Pi extends np{constructor(n,r,i,o){super(n,"event",r,i);oe(this,"anonymous");Object.defineProperty(this,rr,{value:Ak}),Te(this,{anonymous:o})}get topicHash(){return da(this.format("sighash"))}format(n){if(n==null&&(n="sighash"),n==="json")return JSON.stringify({type:"event",anonymous:this.anonymous,name:this.name,inputs:this.inputs.map(i=>JSON.parse(i.format(n)))});const r=[];return n!=="sighash"&&r.push("event"),r.push(this.name+ad(n,this.inputs)),n!=="sighash"&&this.anonymous&&r.push("anonymous"),r.join(" ")}static getTopicHash(n,r){return r=(r||[]).map(o=>vn.from(o)),new Pi(vt,n,r,!1).topicHash}static from(n){if(Pi.isFragment(n))return n;if(typeof n=="string")try{return Pi.from(ds(n))}catch(r){ne(!1,"invalid event fragment","obj",n)}else if(n instanceof ni){const r=tp("event",n),i=bo(n,!0),o=!!yo(n,$n(["anonymous"])).has("anonymous");return pa(n),new Pi(vt,r,i,o)}return new Pi(vt,n.name,n.inputs?n.inputs.map(r=>vn.from(r,!0)):[],!!n.anonymous)}static isFragment(n){return n&&n[rr]===Ak}}class vo extends ga{constructor(n,r,i,o,s){super(n,r,i);oe(this,"payable");oe(this,"gas");Object.defineProperty(this,rr,{value:kk}),Te(this,{payable:o,gas:s})}format(n){if(fe(n!=null&&n!=="sighash","cannot format a constructor for sighash","UNSUPPORTED_OPERATION",{operation:"format(sighash)"}),n==="json")return JSON.stringify({type:"constructor",stateMutability:this.payable?"payable":"undefined",payable:this.payable,gas:this.gas!=null?this.gas:void 0,inputs:this.inputs.map(i=>JSON.parse(i.format(n)))});const r=[`constructor${ad(n,this.inputs)}`];return this.payable&&r.push("payable"),this.gas!=null&&r.push(`@${this.gas.toString()}`),r.join(" ")}static from(n){if(vo.isFragment(n))return n;if(typeof n=="string")try{return vo.from(ds(n))}catch(r){ne(!1,"invalid constuctor fragment","obj",n)}else if(n instanceof ni){yo(n,$n(["constructor"]));const r=bo(n),i=!!yo(n,U$).has("payable"),o=wk(n);return pa(n),new vo(vt,"constructor",r,i,o)}return new vo(vt,"constructor",n.inputs?n.inputs.map(vn.from):[],!!n.payable,n.gas!=null?n.gas:null)}static isFragment(n){return n&&n[rr]===kk}}class wo extends ga{constructor(n,r,i){super(n,"fallback",r);oe(this,"payable");Object.defineProperty(this,rr,{value:Ck}),Te(this,{payable:i})}format(n){const r=this.inputs.length===0?"receive":"fallback";if(n==="json"){const i=this.payable?"payable":"nonpayable";return JSON.stringify({type:r,stateMutability:i})}return`${r}()${this.payable?" payable":""}`}static from(n){if(wo.isFragment(n))return n;if(typeof n=="string")try{return wo.from(ds(n))}catch(r){ne(!1,"invalid fallback fragment","obj",n)}else if(n instanceof ni){const r=n.toString(),i=n.peekKeyword($n(["fallback","receive"]));if(ne(i,"type must be fallback or receive","obj",r),n.popKeyword($n(["fallback","receive"]))==="receive"){const l=bo(n);return ne(l.length===0,"receive cannot have arguments","obj.inputs",l),yo(n,$n(["payable"])),pa(n),new wo(vt,[],!0)}let s=bo(n);s.length?ne(s.length===1&&s[0].type==="bytes","invalid fallback inputs","obj.inputs",s.map(l=>l.format("minimal")).join(", ")):s=[vn.from("bytes")];const a=vk(n);if(ne(a==="nonpayable"||a==="payable","fallback cannot be constants","obj.stateMutability",a),yo(n,$n(["returns"])).has("returns")){const l=bo(n);ne(l.length===1&&l[0].type==="bytes","invalid fallback outputs","obj.outputs",l.map(c=>c.format("minimal")).join(", "))}return pa(n),new wo(vt,s,a==="payable")}if(n.type==="receive")return new wo(vt,[],!0);if(n.type==="fallback"){const r=[vn.from("bytes")],i=n.stateMutability==="payable";return new wo(vt,r,i)}ne(!1,"invalid fallback description","obj",n)}static isFragment(n){return n&&n[rr]===Ck}}class Ni extends np{constructor(n,r,i,o,s,a){super(n,"function",r,o);oe(this,"constant");oe(this,"outputs");oe(this,"stateMutability");oe(this,"payable");oe(this,"gas");Object.defineProperty(this,rr,{value:Ik}),s=Object.freeze(s.slice()),Te(this,{constant:i==="view"||i==="pure",gas:a,outputs:s,payable:i==="payable",stateMutability:i})}get selector(){return da(this.format("sighash")).substring(0,10)}format(n){if(n==null&&(n="sighash"),n==="json")return JSON.stringify({type:"function",name:this.name,constant:this.constant,stateMutability:this.stateMutability!=="nonpayable"?this.stateMutability:void 0,payable:this.payable,gas:this.gas!=null?this.gas:void 0,inputs:this.inputs.map(i=>JSON.parse(i.format(n))),outputs:this.outputs.map(i=>JSON.parse(i.format(n)))});const r=[];return n!=="sighash"&&r.push("function"),r.push(this.name+ad(n,this.inputs)),n!=="sighash"&&(this.stateMutability!=="nonpayable"&&r.push(this.stateMutability),this.outputs&&this.outputs.length&&(r.push("returns"),r.push(ad(n,this.outputs))),this.gas!=null&&r.push(`@${this.gas.toString()}`)),r.join(" ")}static getSelector(n,r){return r=(r||[]).map(o=>vn.from(o)),new Ni(vt,n,"view",r,[],null).selector}static from(n){if(Ni.isFragment(n))return n;if(typeof n=="string")try{return Ni.from(ds(n))}catch(i){ne(!1,"invalid function fragment","obj",n)}else if(n instanceof ni){const i=tp("function",n),o=bo(n),s=vk(n);let a=[];yo(n,$n(["returns"])).has("returns")&&(a=bo(n));const l=wk(n);return pa(n),new Ni(vt,i,s,o,a,l)}let r=n.stateMutability;return r==null&&(r="payable",typeof n.constant=="boolean"?(r="view",n.constant||(r="payable",typeof n.payable=="boolean"&&!n.payable&&(r="nonpayable"))):typeof n.payable=="boolean"&&!n.payable&&(r="nonpayable")),new Ni(vt,n.name,r,n.inputs?n.inputs.map(vn.from):[],n.outputs?n.outputs.map(vn.from):[],n.gas!=null?n.gas:null)}static isFragment(n){return n&&n[rr]===Ik}}class ma extends np{constructor(e,n,r){super(e,"struct",n,r),Object.defineProperty(this,rr,{value:Ok})}format(){throw new Error("@TODO")}static from(e){if(typeof e=="string")try{return ma.from(ds(e))}catch(n){ne(!1,"invalid struct fragment","obj",e)}else if(e instanceof ni){const n=tp("struct",e),r=bo(e);return pa(e),new ma(vt,n,r)}return new ma(vt,e.name,e.inputs?e.inputs.map(vn.from):[])}static isFragment(e){return e&&e[rr]===Ok}}const ri=new Map;ri.set(0,"GENERIC_PANIC"),ri.set(1,"ASSERT_FALSE"),ri.set(17,"OVERFLOW"),ri.set(18,"DIVIDE_BY_ZERO"),ri.set(33,"ENUM_RANGE_ERROR"),ri.set(34,"BAD_STORAGE_DATA"),ri.set(49,"STACK_UNDERFLOW"),ri.set(50,"ARRAY_RANGE_ERROR"),ri.set(65,"OUT_OF_MEMORY"),ri.set(81,"UNINITIALIZED_FUNCTION_CALL");const X$=new RegExp(/^bytes([0-9]*)$/),J$=new RegExp(/^(u?int)([0-9]*)$/);let ry=null,Tk=1024;function Z$(t,e,n,r){let i="missing revert data",o=null;const s=null;let a=null;if(n){i="execution reverted";const c=Ue(n);if(n=ve(n),c.length===0)i+=" (no data present; likely require(false) occurred",o="require(false)";else if(c.length%32!==4)i+=" (could not decode reason; invalid data length)";else if(ve(c.slice(0,4))==="0x08c379a0")try{o=r.decode(["string"],c.slice(4))[0],a={signature:"Error(string)",name:"Error",args:[o]},i+=`: ${JSON.stringify(o)}`}catch(u){i+=" (could not decode reason; invalid string data)"}else if(ve(c.slice(0,4))==="0x4e487b71")try{const u=Number(r.decode(["uint256"],c.slice(4))[0]);a={signature:"Panic(uint256)",name:"Panic",args:[u]},o=`Panic due to ${ri.get(u)||"UNKNOWN"}(${u})`,i+=`: ${o}`}catch(u){i+=" (could not decode panic code)"}else i+=" (unknown custom error)"}const l={to:e.to?rt(e.to):null,data:e.data||"0x"};return e.from&&(l.from=rt(e.from)),bt(i,"CALL_EXCEPTION",{action:t,data:n,reason:o,transaction:l,invocation:s,revert:a})}const Yp=class Yp{constructor(){ce(this,Cs)}getDefaultValue(e){const n=e.map(i=>be(this,Cs,nu).call(this,vn.from(i)));return new $h(n,"_").defaultValue()}encode(e,n){aS(n.length,e.length,"types/values length mismatch");const r=e.map(s=>be(this,Cs,nu).call(this,vn.from(s))),i=new $h(r,"_"),o=new Em;return i.encode(o,n),o.data}decode(e,n,r){const i=e.map(s=>be(this,Cs,nu).call(this,vn.from(s)));return new $h(i,"_").decode(new Sm(n,r,Tk))}static _setDefaultMaxInflation(e){ne(typeof e=="number"&&Number.isInteger(e),"invalid defaultMaxInflation factor","value",e),Tk=e}static defaultAbiCoder(){return ry==null&&(ry=new Yp),ry}static getBuiltinCallException(e,n,r){return Z$(e,n,r,Yp.defaultAbiCoder())}};Cs=new WeakSet,nu=function(e){if(e.isArray())return new v9(be(this,Cs,nu).call(this,e.arrayChildren),e.arrayLength,e.name);if(e.isTuple())return new $h(e.components.map(r=>be(this,Cs,nu).call(this,r)),e.name);switch(e.baseType){case"address":return new y9(e.name);case"bool":return new w9(e.name);case"string":return new T9(e.name);case"bytes":return new x9(e.name);case"":return new A9(e.name)}let n=e.type.match(J$);if(n){let r=parseInt(n[2]||"256");return ne(r!==0&&r<=256&&r%8===0,"invalid "+n[1]+" bit length","param",e),new O9(r/8,n[1]==="int",e.name)}if(n=e.type.match(X$),n){let r=parseInt(n[1]);return ne(r!==0&&r<=32,"invalid bytes length","param",e),new E9(r,e.name)}ne(!1,"invalid type","type",e.type)};let ld=Yp;class eH{constructor(e,n,r){oe(this,"fragment");oe(this,"name");oe(this,"signature");oe(this,"topic");oe(this,"args");const i=e.name,o=e.format();Te(this,{fragment:e,name:i,signature:o,topic:n,args:r})}}class tH{constructor(e,n,r,i){oe(this,"fragment");oe(this,"name");oe(this,"args");oe(this,"signature");oe(this,"selector");oe(this,"value");const o=e.name,s=e.format();Te(this,{fragment:e,name:o,args:r,signature:s,selector:n,value:i})}}class nH{constructor(e,n,r){oe(this,"fragment");oe(this,"name");oe(this,"args");oe(this,"signature");oe(this,"selector");const i=e.name,o=e.format();Te(this,{fragment:e,name:i,args:r,signature:o,selector:n})}}class Pk{constructor(e){oe(this,"hash");oe(this,"_isIndexed");Te(this,{hash:e,_isIndexed:!0})}static isIndexed(e){return!!(e&&e._isIndexed)}}const Nk={0:"generic panic",1:"assert(false)",17:"arithmetic overflow",18:"division or modulo by zero",33:"enum overflow",34:"invalid encoded storage byte array accessed",49:"out-of-bounds array access; popping on an empty array",50:"out-of-bounds access of an array or bytesN",65:"out of memory",81:"uninitialized function"},Bk={"0x08c379a0":{signature:"Error(string)",name:"Error",inputs:["string"],reason:t=>`reverted with reason string ${JSON.stringify(t)}`},"0x4e487b71":{signature:"Panic(uint256)",name:"Panic",inputs:["uint256"],reason:t=>{let e="unknown panic code";return t>=0&&t<=255&&Nk[t.toString()]&&(e=Nk[t.toString()]),`reverted with panic code 0x${t.toString(16)} (${e})`}}},Ka=class Ka{constructor(e){ce(this,$i);oe(this,"fragments");oe(this,"deploy");oe(this,"fallback");oe(this,"receive");ce(this,Di);ce(this,zi);ce(this,Ui);ce(this,Rn);let n=[];typeof e=="string"?n=JSON.parse(e):n=e,K(this,Ui,new Map),K(this,Di,new Map),K(this,zi,new Map);const r=[];for(const s of n)try{r.push(ga.from(s))}catch(a){console.log(`[Warning] Invalid Fragment ${JSON.stringify(s)}:`,a.message)}Te(this,{fragments:Object.freeze(r)});let i=null,o=!1;K(this,Rn,this.getAbiCoder()),this.fragments.forEach((s,a)=>{let l;switch(s.type){case"constructor":if(this.deploy){console.log("duplicate definition - constructor");return}Te(this,{deploy:s});return;case"fallback":s.inputs.length===0?o=!0:(ne(!i||s.payable!==i.payable,"conflicting fallback fragments",`fragments[${a}]`,s),i=s,o=i.payable);return;case"function":l=F(this,Ui);break;case"event":l=F(this,zi);break;case"error":l=F(this,Di);break;default:return}const c=s.format();l.has(c)||l.set(c,s)}),this.deploy||Te(this,{deploy:vo.from("constructor()")}),Te(this,{fallback:i,receive:o})}format(e){const n=e?"minimal":"full";return this.fragments.map(i=>i.format(n))}formatJson(){const e=this.fragments.map(n=>n.format("json"));return JSON.stringify(e.map(n=>JSON.parse(n)))}getAbiCoder(){return ld.defaultAbiCoder()}getFunctionName(e){const n=be(this,$i,og).call(this,e,null,!1);return ne(n,"no matching function","key",e),n.name}hasFunction(e){return!!be(this,$i,og).call(this,e,null,!1)}getFunction(e,n){return be(this,$i,og).call(this,e,n||null,!0)}forEachFunction(e){const n=Array.from(F(this,Ui).keys());n.sort((r,i)=>r.localeCompare(i));for(let r=0;r<n.length;r++){const i=n[r];e(F(this,Ui).get(i),r)}}getEventName(e){const n=be(this,$i,sg).call(this,e,null,!1);return ne(n,"no matching event","key",e),n.name}hasEvent(e){return!!be(this,$i,sg).call(this,e,null,!1)}getEvent(e,n){return be(this,$i,sg).call(this,e,n||null,!0)}forEachEvent(e){const n=Array.from(F(this,zi).keys());n.sort((r,i)=>r.localeCompare(i));for(let r=0;r<n.length;r++){const i=n[r];e(F(this,zi).get(i),r)}}getError(e,n){if(pt(e)){const i=e.toLowerCase();if(Bk[i])return ir.from(Bk[i].signature);for(const o of F(this,Di).values())if(i===o.selector)return o;return null}if(e.indexOf("(")===-1){const i=[];for(const[o,s]of F(this,Di))o.split("(")[0]===e&&i.push(s);if(i.length===0)return e==="Error"?ir.from("error Error(string)"):e==="Panic"?ir.from("error Panic(uint256)"):null;if(i.length>1){const o=i.map(s=>JSON.stringify(s.format())).join(", ");ne(!1,`ambiguous error description (i.e. ${o})`,"name",e)}return i[0]}if(e=ir.from(e).format(),e==="Error(string)")return ir.from("error Error(string)");if(e==="Panic(uint256)")return ir.from("error Panic(uint256)");const r=F(this,Di).get(e);return r||null}forEachError(e){const n=Array.from(F(this,Di).keys());n.sort((r,i)=>r.localeCompare(i));for(let r=0;r<n.length;r++){const i=n[r];e(F(this,Di).get(i),r)}}_decodeParams(e,n){return F(this,Rn).decode(e,n)}_encodeParams(e,n){return F(this,Rn).encode(e,n)}encodeDeploy(e){return this._encodeParams(this.deploy.inputs,e||[])}decodeErrorResult(e,n){if(typeof e=="string"){const r=this.getError(e);ne(r,"unknown error","fragment",e),e=r}return ne(Et(n,0,4)===e.selector,`data signature does not match error ${e.name}.`,"data",n),this._decodeParams(e.inputs,Et(n,4))}encodeErrorResult(e,n){if(typeof e=="string"){const r=this.getError(e);ne(r,"unknown error","fragment",e),e=r}return xt([e.selector,this._encodeParams(e.inputs,n||[])])}decodeFunctionData(e,n){if(typeof e=="string"){const r=this.getFunction(e);ne(r,"unknown function","fragment",e),e=r}return ne(Et(n,0,4)===e.selector,`data signature does not match function ${e.name}.`,"data",n),this._decodeParams(e.inputs,Et(n,4))}encodeFunctionData(e,n){if(typeof e=="string"){const r=this.getFunction(e);ne(r,"unknown function","fragment",e),e=r}return xt([e.selector,this._encodeParams(e.inputs,n||[])])}decodeFunctionResult(e,n){if(typeof e=="string"){const o=this.getFunction(e);ne(o,"unknown function","fragment",e),e=o}let r="invalid length for result data";const i=Dn(n);if(i.length%32===0)try{return F(this,Rn).decode(e.outputs,i)}catch(o){r="could not decode result data"}fe(!1,r,"BAD_DATA",{value:ve(i),info:{method:e.name,signature:e.format()}})}makeError(e,n){const r=Ue(e,"data"),i=ld.getBuiltinCallException("call",n,r);if(i.message.startsWith("execution reverted (unknown custom error)")){const a=ve(r.slice(0,4)),l=this.getError(a);if(l)try{const c=F(this,Rn).decode(l.inputs,r.slice(4));i.revert={name:l.name,signature:l.format(),args:c},i.reason=i.revert.signature,i.message=`execution reverted: ${i.reason}`}catch(c){i.message="execution reverted (coult not decode custom error)"}}const s=this.parseTransaction(n);return s&&(i.invocation={method:s.name,signature:s.signature,args:s.args}),i}encodeFunctionResult(e,n){if(typeof e=="string"){const r=this.getFunction(e);ne(r,"unknown function","fragment",e),e=r}return ve(F(this,Rn).encode(e.outputs,n||[]))}encodeFilterTopics(e,n){if(typeof e=="string"){const o=this.getEvent(e);ne(o,"unknown event","eventFragment",e),e=o}fe(n.length<=e.inputs.length,`too many arguments for ${e.format()}`,"UNEXPECTED_ARGUMENT",{count:n.length,expectedCount:e.inputs.length});const r=[];e.anonymous||r.push(e.topicHash);const i=(o,s)=>o.type==="string"?da(s):o.type==="bytes"?Ft(ve(s)):(o.type==="bool"&&typeof s=="boolean"?s=s?"0x01":"0x00":o.type.match(/^u?int/)?s=ns(s):o.type.match(/^bytes/)?s=BU(s,32):o.type==="address"&&F(this,Rn).encode(["address"],[s]),ho(ve(s),32));for(n.forEach((o,s)=>{const a=e.inputs[s];if(!a.indexed){ne(o==null,"cannot filter non-indexed parameters; must be null","contract."+a.name,o);return}o==null?r.push(null):a.baseType==="array"||a.baseType==="tuple"?ne(!1,"filtering with tuples or arrays not supported","contract."+a.name,o):Array.isArray(o)?r.push(o.map(l=>i(a,l))):r.push(i(a,o))});r.length&&r[r.length-1]===null;)r.pop();return r}encodeEventLog(e,n){if(typeof e=="string"){const s=this.getEvent(e);ne(s,"unknown event","eventFragment",e),e=s}const r=[],i=[],o=[];return e.anonymous||r.push(e.topicHash),ne(n.length===e.inputs.length,"event arguments/values mismatch","values",n),e.inputs.forEach((s,a)=>{const l=n[a];if(s.indexed)if(s.type==="string")r.push(da(l));else if(s.type==="bytes")r.push(Ft(l));else{if(s.baseType==="tuple"||s.baseType==="array")throw new Error("not implemented");r.push(F(this,Rn).encode([s.type],[l]))}else i.push(s),o.push(l)}),{data:F(this,Rn).encode(i,o),topics:r}}decodeEventLog(e,n,r){if(typeof e=="string"){const g=this.getEvent(e);ne(g,"unknown event","eventFragment",e),e=g}if(r!=null&&!e.anonymous){const g=e.topicHash;ne(pt(r[0],32)&&r[0].toLowerCase()===g,"fragment/topic mismatch","topics[0]",r[0]),r=r.slice(1)}const i=[],o=[],s=[];e.inputs.forEach((g,b)=>{g.indexed?g.type==="string"||g.type==="bytes"||g.baseType==="tuple"||g.baseType==="array"?(i.push(vn.from({type:"bytes32",name:g.name})),s.push(!0)):(i.push(g),s.push(!1)):(o.push(g),s.push(!1))});const a=r!=null?F(this,Rn).decode(i,xt(r)):null,l=F(this,Rn).decode(o,n,!0),c=[],u=[];let d=0,h=0;return e.inputs.forEach((g,b)=>{let p=null;if(g.indexed)if(a==null)p=new Pk(null);else if(s[b])p=new Pk(a[h++]);else try{p=a[h++]}catch(w){p=w}else try{p=l[d++]}catch(w){p=w}c.push(p),u.push(g.name||null)}),zl.fromItems(c,u)}parseTransaction(e){const n=Ue(e.data,"tx.data"),r=Se(e.value!=null?e.value:0,"tx.value"),i=this.getFunction(ve(n.slice(0,4)));if(!i)return null;const o=F(this,Rn).decode(i.inputs,n.slice(4));return new tH(i,i.selector,o,r)}parseCallResult(e){throw new Error("@TODO")}parseLog(e){const n=this.getEvent(e.topics[0]);return!n||n.anonymous?null:new eH(n,n.topicHash,this.decodeEventLog(n,e.data,e.topics))}parseError(e){const n=ve(e),r=this.getError(Et(n,0,4));if(!r)return null;const i=F(this,Rn).decode(r.inputs,Et(n,4));return new nH(r,r.selector,i)}static from(e){return e instanceof Ka?e:typeof e=="string"?new Ka(JSON.parse(e)):typeof e.formatJson=="function"?new Ka(e.formatJson()):typeof e.format=="function"?new Ka(e.format("json")):new Ka(e)}};Di=new WeakMap,zi=new WeakMap,Ui=new WeakMap,Rn=new WeakMap,$i=new WeakSet,og=function(e,n,r){if(pt(e)){const o=e.toLowerCase();for(const s of F(this,Ui).values())if(o===s.selector)return s;return null}if(e.indexOf("(")===-1){const o=[];for(const[s,a]of F(this,Ui))s.split("(")[0]===e&&o.push(a);if(n){const s=n.length>0?n[n.length-1]:null;let a=n.length,l=!0;In.isTyped(s)&&s.type==="overrides"&&(l=!1,a--);for(let c=o.length-1;c>=0;c--){const u=o[c].inputs.length;u!==a&&(!l||u!==a-1)&&o.splice(c,1)}for(let c=o.length-1;c>=0;c--){const u=o[c].inputs;for(let d=0;d<n.length;d++)if(In.isTyped(n[d])){if(d>=u.length){if(n[d].type==="overrides")continue;o.splice(c,1);break}if(n[d].type!==u[d].baseType){o.splice(c,1);break}}}}if(o.length===1&&n&&n.length!==o[0].inputs.length){const s=n[n.length-1];(s==null||Array.isArray(s)||typeof s!="object")&&o.splice(0,1)}if(o.length===0)return null;if(o.length>1&&r){const s=o.map(a=>JSON.stringify(a.format())).join(", ");ne(!1,`ambiguous function description (i.e. matches ${s})`,"key",e)}return o[0]}const i=F(this,Ui).get(Ni.from(e).format());return i||null},sg=function(e,n,r){if(pt(e)){const o=e.toLowerCase();for(const s of F(this,zi).values())if(o===s.topicHash)return s;return null}if(e.indexOf("(")===-1){const o=[];for(const[s,a]of F(this,zi))s.split("(")[0]===e&&o.push(a);if(n){for(let s=o.length-1;s>=0;s--)o[s].inputs.length<n.length&&o.splice(s,1);for(let s=o.length-1;s>=0;s--){const a=o[s].inputs;for(let l=0;l<n.length;l++)if(In.isTyped(n[l])&&n[l].type!==a[l].baseType){o.splice(s,1);break}}}if(o.length===0)return null;if(o.length>1&&r){const s=o.map(a=>JSON.stringify(a.format())).join(", ");ne(!1,`ambiguous event description (i.e. matches ${s})`,"key",e)}return o[0]}const i=F(this,zi).get(Pi.from(e).format());return i||null};let iy=Ka;const Rk=BigInt(0);function Jl(t){return t==null?null:t}function Pt(t){return t==null?null:t.toString()}class Mk{constructor(e,n,r){oe(this,"gasPrice");oe(this,"maxFeePerGas");oe(this,"maxPriorityFeePerGas");Te(this,{gasPrice:Jl(e),maxFeePerGas:Jl(n),maxPriorityFeePerGas:Jl(r)})}toJSON(){const{gasPrice:e,maxFeePerGas:n,maxPriorityFeePerGas:r}=this;return{_type:"FeeData",gasPrice:Pt(e),maxFeePerGas:Pt(n),maxPriorityFeePerGas:Pt(r)}}}function rp(t){const e={};t.to&&(e.to=t.to),t.from&&(e.from=t.from),t.data&&(e.data=ve(t.data));const n="chainId,gasLimit,gasPrice,maxFeePerBlobGas,maxFeePerGas,maxPriorityFeePerGas,value".split(/,/);for(const i of n)!(i in t)||t[i]==null||(e[i]=Se(t[i],`request.${i}`));const r="type,nonce".split(/,/);for(const i of r)!(i in t)||t[i]==null||(e[i]=$e(t[i],`request.${i}`));return t.accessList&&(e.accessList=ca(t.accessList)),t.authorizationList&&(e.authorizationList=t.authorizationList.slice()),"blockTag"in t&&(e.blockTag=t.blockTag),"enableCcipRead"in t&&(e.enableCcipRead=!!t.enableCcipRead),"customData"in t&&(e.customData=t.customData),"blobVersionedHashes"in t&&t.blobVersionedHashes&&(e.blobVersionedHashes=t.blobVersionedHashes.slice()),"kzg"in t&&(e.kzg=t.kzg),"blobs"in t&&t.blobs&&(e.blobs=t.blobs.map(i=>ym(i)?ve(i):Object.assign({},i))),e}class rH{constructor(e,n){oe(this,"provider");oe(this,"number");oe(this,"hash");oe(this,"timestamp");oe(this,"parentHash");oe(this,"parentBeaconBlockRoot");oe(this,"nonce");oe(this,"difficulty");oe(this,"gasLimit");oe(this,"gasUsed");oe(this,"stateRoot");oe(this,"receiptsRoot");oe(this,"blobGasUsed");oe(this,"excessBlobGas");oe(this,"miner");oe(this,"prevRandao");oe(this,"extraData");oe(this,"baseFeePerGas");ce(this,Mo);K(this,Mo,e.transactions.map(r=>typeof r!="string"?new ud(r,n):r)),Te(this,{provider:n,hash:Jl(e.hash),number:e.number,timestamp:e.timestamp,parentHash:e.parentHash,parentBeaconBlockRoot:e.parentBeaconBlockRoot,nonce:e.nonce,difficulty:e.difficulty,gasLimit:e.gasLimit,gasUsed:e.gasUsed,blobGasUsed:e.blobGasUsed,excessBlobGas:e.excessBlobGas,miner:e.miner,prevRandao:Jl(e.prevRandao),extraData:e.extraData,baseFeePerGas:Jl(e.baseFeePerGas),stateRoot:e.stateRoot,receiptsRoot:e.receiptsRoot})}get transactions(){return F(this,Mo).map(e=>typeof e=="string"?e:e.hash)}get prefetchedTransactions(){const e=F(this,Mo).slice();return e.length===0?[]:(fe(typeof e[0]=="object","transactions were not prefetched with block request","UNSUPPORTED_OPERATION",{operation:"transactionResponses()"}),e)}toJSON(){const{baseFeePerGas:e,difficulty:n,extraData:r,gasLimit:i,gasUsed:o,hash:s,miner:a,prevRandao:l,nonce:c,number:u,parentHash:d,parentBeaconBlockRoot:h,stateRoot:g,receiptsRoot:b,timestamp:p,transactions:w}=this;return{_type:"Block",baseFeePerGas:Pt(e),difficulty:Pt(n),extraData:r,gasLimit:Pt(i),gasUsed:Pt(o),blobGasUsed:Pt(this.blobGasUsed),excessBlobGas:Pt(this.excessBlobGas),hash:s,miner:a,prevRandao:l,nonce:c,number:u,parentHash:d,timestamp:p,parentBeaconBlockRoot:h,stateRoot:g,receiptsRoot:b,transactions:w}}[Symbol.iterator](){let e=0;const n=this.transactions;return{next:()=>e<this.length?{value:n[e++],done:!1}:{value:void 0,done:!0}}}get length(){return F(this,Mo).length}get date(){return this.timestamp==null?null:new Date(this.timestamp*1e3)}async getTransaction(e){let n;if(typeof e=="number")n=F(this,Mo)[e];else{const r=e.toLowerCase();for(const i of F(this,Mo))if(typeof i=="string"){if(i!==r)continue;n=i;break}else{if(i.hash!==r)continue;n=i;break}}if(n==null)throw new Error("no such tx");return typeof n=="string"?await this.provider.getTransaction(n):n}getPrefetchedTransaction(e){const n=this.prefetchedTransactions;if(typeof e=="number")return n[e];e=e.toLowerCase();for(const r of n)if(r.hash===e)return r;ne(!1,"no matching transaction","indexOrHash",e)}isMined(){return!!this.hash}isLondon(){return!!this.baseFeePerGas}orphanedEvent(){if(!this.isMined())throw new Error("");return iH(this)}}Mo=new WeakMap;class cd{constructor(e,n){oe(this,"provider");oe(this,"transactionHash");oe(this,"blockHash");oe(this,"blockNumber");oe(this,"removed");oe(this,"address");oe(this,"data");oe(this,"topics");oe(this,"index");oe(this,"transactionIndex");this.provider=n;const r=Object.freeze(e.topics.slice());Te(this,{transactionHash:e.transactionHash,blockHash:e.blockHash,blockNumber:e.blockNumber,removed:e.removed,address:e.address,data:e.data,topics:r,index:e.index,transactionIndex:e.transactionIndex})}toJSON(){const{address:e,blockHash:n,blockNumber:r,data:i,index:o,removed:s,topics:a,transactionHash:l,transactionIndex:c}=this;return{_type:"log",address:e,blockHash:n,blockNumber:r,data:i,index:o,removed:s,topics:a,transactionHash:l,transactionIndex:c}}async getBlock(){const e=await this.provider.getBlock(this.blockHash);return fe(!!e,"failed to find transaction","UNKNOWN_ERROR",{}),e}async getTransaction(){const e=await this.provider.getTransaction(this.transactionHash);return fe(!!e,"failed to find transaction","UNKNOWN_ERROR",{}),e}async getTransactionReceipt(){const e=await this.provider.getTransactionReceipt(this.transactionHash);return fe(!!e,"failed to find transaction receipt","UNKNOWN_ERROR",{}),e}removedEvent(){return oH(this)}}class Lk{constructor(e,n){oe(this,"provider");oe(this,"to");oe(this,"from");oe(this,"contractAddress");oe(this,"hash");oe(this,"index");oe(this,"blockHash");oe(this,"blockNumber");oe(this,"logsBloom");oe(this,"gasUsed");oe(this,"blobGasUsed");oe(this,"cumulativeGasUsed");oe(this,"gasPrice");oe(this,"blobGasPrice");oe(this,"type");oe(this,"status");oe(this,"root");ce(this,Ld);K(this,Ld,Object.freeze(e.logs.map(i=>new cd(i,n))));let r=Rk;e.effectiveGasPrice!=null?r=e.effectiveGasPrice:e.gasPrice!=null&&(r=e.gasPrice),Te(this,{provider:n,to:e.to,from:e.from,contractAddress:e.contractAddress,hash:e.hash,index:e.index,blockHash:e.blockHash,blockNumber:e.blockNumber,logsBloom:e.logsBloom,gasUsed:e.gasUsed,cumulativeGasUsed:e.cumulativeGasUsed,blobGasUsed:e.blobGasUsed,gasPrice:r,blobGasPrice:e.blobGasPrice,type:e.type,status:e.status,root:e.root})}get logs(){return F(this,Ld)}toJSON(){const{to:e,from:n,contractAddress:r,hash:i,index:o,blockHash:s,blockNumber:a,logsBloom:l,logs:c,status:u,root:d}=this;return{_type:"TransactionReceipt",blockHash:s,blockNumber:a,contractAddress:r,cumulativeGasUsed:Pt(this.cumulativeGasUsed),from:n,gasPrice:Pt(this.gasPrice),blobGasUsed:Pt(this.blobGasUsed),blobGasPrice:Pt(this.blobGasPrice),gasUsed:Pt(this.gasUsed),hash:i,index:o,logs:c,logsBloom:l,root:d,status:u,to:e}}get length(){return this.logs.length}[Symbol.iterator](){let e=0;return{next:()=>e<this.length?{value:this.logs[e++],done:!1}:{value:void 0,done:!0}}}get fee(){return this.gasUsed*this.gasPrice}async getBlock(){const e=await this.provider.getBlock(this.blockHash);if(e==null)throw new Error("TODO");return e}async getTransaction(){const e=await this.provider.getTransaction(this.hash);if(e==null)throw new Error("TODO");return e}async getResult(){return await this.provider.getTransactionResult(this.hash)}async confirmations(){return await this.provider.getBlockNumber()-this.blockNumber+1}removedEvent(){return _k(this)}reorderedEvent(e){return fe(!e||e.isMined(),"unmined 'other' transction cannot be orphaned","UNSUPPORTED_OPERATION",{operation:"reorderedEvent(other)"}),Fk(this,e)}}Ld=new WeakMap;const Sb=class Sb{constructor(e,n){oe(this,"provider");oe(this,"blockNumber");oe(this,"blockHash");oe(this,"index");oe(this,"hash");oe(this,"type");oe(this,"to");oe(this,"from");oe(this,"nonce");oe(this,"gasLimit");oe(this,"gasPrice");oe(this,"maxPriorityFeePerGas");oe(this,"maxFeePerGas");oe(this,"maxFeePerBlobGas");oe(this,"data");oe(this,"value");oe(this,"chainId");oe(this,"signature");oe(this,"accessList");oe(this,"blobVersionedHashes");oe(this,"authorizationList");ce(this,Is);this.provider=n,this.blockNumber=e.blockNumber!=null?e.blockNumber:null,this.blockHash=e.blockHash!=null?e.blockHash:null,this.hash=e.hash,this.index=e.index,this.type=e.type,this.from=e.from,this.to=e.to||null,this.gasLimit=e.gasLimit,this.nonce=e.nonce,this.data=e.data,this.value=e.value,this.gasPrice=e.gasPrice,this.maxPriorityFeePerGas=e.maxPriorityFeePerGas!=null?e.maxPriorityFeePerGas:null,this.maxFeePerGas=e.maxFeePerGas!=null?e.maxFeePerGas:null,this.maxFeePerBlobGas=e.maxFeePerBlobGas!=null?e.maxFeePerBlobGas:null,this.chainId=e.chainId,this.signature=e.signature,this.accessList=e.accessList!=null?e.accessList:null,this.blobVersionedHashes=e.blobVersionedHashes!=null?e.blobVersionedHashes:null,this.authorizationList=e.authorizationList!=null?e.authorizationList:null,K(this,Is,-1)}toJSON(){const{blockNumber:e,blockHash:n,index:r,hash:i,type:o,to:s,from:a,nonce:l,data:c,signature:u,accessList:d,blobVersionedHashes:h}=this;return{_type:"TransactionResponse",accessList:d,blockNumber:e,blockHash:n,blobVersionedHashes:h,chainId:Pt(this.chainId),data:c,from:a,gasLimit:Pt(this.gasLimit),gasPrice:Pt(this.gasPrice),hash:i,maxFeePerGas:Pt(this.maxFeePerGas),maxPriorityFeePerGas:Pt(this.maxPriorityFeePerGas),maxFeePerBlobGas:Pt(this.maxFeePerBlobGas),nonce:l,signature:u,to:s,index:r,type:o,value:Pt(this.value)}}async getBlock(){let e=this.blockNumber;if(e==null){const r=await this.getTransaction();r&&(e=r.blockNumber)}if(e==null)return null;const n=this.provider.getBlock(e);if(n==null)throw new Error("TODO");return n}async getTransaction(){return this.provider.getTransaction(this.hash)}async confirmations(){if(this.blockNumber==null){const{tx:n,blockNumber:r}=await Vn({tx:this.getTransaction(),blockNumber:this.provider.getBlockNumber()});return n==null||n.blockNumber==null?0:r-n.blockNumber+1}return await this.provider.getBlockNumber()-this.blockNumber+1}async wait(e,n){const r=e==null?1:e,i=n==null?0:n;let o=F(this,Is),s=-1,a=o===-1;const l=async()=>{if(a)return null;const{blockNumber:h,nonce:g}=await Vn({blockNumber:this.provider.getBlockNumber(),nonce:this.provider.getTransactionCount(this.from)});if(g<this.nonce){o=h;return}if(a)return null;const b=await this.getTransaction();if(!(b&&b.blockNumber!=null))for(s===-1&&(s=o-3,s<F(this,Is)&&(s=F(this,Is)));s<=h;){if(a)return null;const p=await this.provider.getBlock(s,!0);if(p==null)return;for(const w of p)if(w===this.hash)return;for(let w=0;w<p.length;w++){const S=await p.getTransaction(w);if(S.from===this.from&&S.nonce===this.nonce){if(a)return null;const O=await this.provider.getTransactionReceipt(S.hash);if(O==null||h-O.blockNumber+1<r)return;let T="replaced";S.data===this.data&&S.to===this.to&&S.value===this.value?T="repriced":S.data==="0x"&&S.from===S.to&&S.value===Rk&&(T="cancelled"),fe(!1,"transaction was replaced","TRANSACTION_REPLACED",{cancelled:T==="replaced"||T==="cancelled",reason:T,replacement:S.replaceableTransaction(o),hash:S.hash,receipt:O})}}s++}},c=h=>{if(h==null||h.status!==0)return h;fe(!1,"transaction execution reverted","CALL_EXCEPTION",{action:"sendTransaction",data:null,reason:null,invocation:null,revert:null,transaction:{to:h.to,from:h.from,data:""},receipt:h})},u=await this.provider.getTransactionReceipt(this.hash);if(r===0)return c(u);if(u){if(r===1||await u.confirmations()>=r)return c(u)}else if(await l(),r===0)return null;return await new Promise((h,g)=>{const b=[],p=()=>{b.forEach(S=>S())};if(b.push(()=>{a=!0}),i>0){const S=setTimeout(()=>{p(),g(bt("wait for transaction timeout","TIMEOUT"))},i);b.push(()=>{clearTimeout(S)})}const w=async S=>{if(await S.confirmations()>=r){p();try{h(c(S))}catch(O){g(O)}}};if(b.push(()=>{this.provider.off(this.hash,w)}),this.provider.on(this.hash,w),o>=0){const S=async()=>{try{await l()}catch(O){if(bn(O,"TRANSACTION_REPLACED")){p(),g(O);return}}a||this.provider.once("block",S)};b.push(()=>{this.provider.off("block",S)}),this.provider.once("block",S)}})}isMined(){return this.blockHash!=null}isLegacy(){return this.type===0}isBerlin(){return this.type===1}isLondon(){return this.type===2}isCancun(){return this.type===3}removedEvent(){return fe(this.isMined(),"unmined transaction canot be orphaned","UNSUPPORTED_OPERATION",{operation:"removeEvent()"}),_k(this)}reorderedEvent(e){return fe(this.isMined(),"unmined transaction canot be orphaned","UNSUPPORTED_OPERATION",{operation:"removeEvent()"}),fe(!e||e.isMined(),"unmined 'other' transaction canot be orphaned","UNSUPPORTED_OPERATION",{operation:"removeEvent()"}),Fk(this,e)}replaceableTransaction(e){ne(Number.isInteger(e)&&e>=0,"invalid startBlock","startBlock",e);const n=new Sb(this,this.provider);return K(n,Is,e),n}};Is=new WeakMap;let ud=Sb;function iH(t){return{orphan:"drop-block",hash:t.hash,number:t.number}}function Fk(t,e){return{orphan:"reorder-transaction",tx:t,other:e}}function _k(t){return{orphan:"drop-transaction",tx:t}}function oH(t){return{orphan:"drop-log",log:{transactionHash:t.transactionHash,blockHash:t.blockHash,blockNumber:t.blockNumber,address:t.address,data:t.data,topics:Object.freeze(t.topics.slice()),index:t.index}}}class oy extends cd{constructor(n,r,i){super(n,n.provider);oe(this,"interface");oe(this,"fragment");oe(this,"args");const o=r.decodeEventLog(i,n.data,n.topics);Te(this,{args:o,fragment:i,interface:r})}get eventName(){return this.fragment.name}get eventSignature(){return this.fragment.format()}}class Vk extends cd{constructor(n,r){super(n,n.provider);oe(this,"error");Te(this,{error:r})}}class sH extends Lk{constructor(n,r,i){super(i,r);ce(this,Dc);K(this,Dc,n)}get logs(){return super.logs.map(n=>{const r=n.topics.length?F(this,Dc).getEvent(n.topics[0]):null;if(r)try{return new oy(n,F(this,Dc),r)}catch(i){return new Vk(n,i)}return n})}}Dc=new WeakMap;class sy extends ud{constructor(n,r,i){super(i,r);ce(this,Fd);K(this,Fd,n)}async wait(n,r){const i=await super.wait(n,r);return i==null?null:new sH(F(this,Fd),this.provider,i)}}Fd=new WeakMap;class Dk extends gS{constructor(n,r,i,o){super(n,r,i);oe(this,"log");Te(this,{log:o})}async getBlock(){return await this.log.getBlock()}async getTransaction(){return await this.log.getTransaction()}async getTransactionReceipt(){return await this.log.getTransactionReceipt()}}class aH extends Dk{constructor(e,n,r,i,o){super(e,n,r,new oy(o,e.interface,i));const s=e.interface.decodeEventLog(i,this.log.data,this.log.topics);Te(this,{args:s,fragment:i})}get eventName(){return this.fragment.name}get eventSignature(){return this.fragment.format()}}const zk=BigInt(0);function Uk(t){return t&&typeof t.call=="function"}function $k(t){return t&&typeof t.estimateGas=="function"}function ip(t){return t&&typeof t.resolveName=="function"}function Hk(t){return t&&typeof t.sendTransaction=="function"}function Wk(t){if(t!=null){if(ip(t))return t;if(t.provider)return t.provider}}class lH{constructor(e,n,r){ce(this,_d);oe(this,"fragment");if(Te(this,{fragment:n}),n.inputs.length<r.length)throw new Error("too many arguments");const i=ya(e.runner,"resolveName"),o=ip(i)?i:null;K(this,_d,async function(){const s=await Promise.all(n.inputs.map((a,l)=>r[l]==null?null:a.walkAsync(r[l],(u,d)=>u==="address"?Array.isArray(d)?Promise.all(d.map(h=>Un(h,o))):Un(d,o):d)));return e.interface.encodeFilterTopics(n,s)}())}getTopicFilter(){return F(this,_d)}}_d=new WeakMap;function ya(t,e){return t==null?null:typeof t[e]=="function"?t:t.provider&&typeof t.provider[e]=="function"?t.provider:null}function ba(t){return t==null?null:t.provider||null}async function Gk(t,e){const n=In.dereference(t,"overrides");ne(typeof n=="object","invalid overrides parameter","overrides",t);const r=rp(n);return ne(r.to==null||(e||[]).indexOf("to")>=0,"cannot override to","overrides.to",r.to),ne(r.data==null||(e||[]).indexOf("data")>=0,"cannot override data","overrides.data",r.data),r.from&&(r.from=r.from),r}async function cH(t,e,n){const r=ya(t,"resolveName"),i=ip(r)?r:null;return await Promise.all(e.map((o,s)=>o.walkAsync(n[s],(a,l)=>(l=In.dereference(l,a),a==="address"?Un(l,i):l))))}function uH(t){const e=async function(s){const a=await Gk(s,["data"]);a.to=await t.getAddress(),a.from&&(a.from=await Un(a.from,Wk(t.runner)));const l=t.interface,c=Se(a.value||zk,"overrides.value")===zk,u=(a.data||"0x")==="0x";l.fallback&&!l.fallback.payable&&l.receive&&!u&&!c&&ne(!1,"cannot send data to receive or send value to non-payable fallback","overrides",s),ne(l.fallback||u,"cannot send data to receive-only contract","overrides.data",a.data);const d=l.receive||l.fallback&&l.fallback.payable;return ne(d||c,"cannot send value to non-payable fallback","overrides.value",a.value),ne(l.fallback||u,"cannot send data to receive-only contract","overrides.data",a.data),a},n=async function(s){const a=ya(t.runner,"call");fe(Uk(a),"contract runner does not support calling","UNSUPPORTED_OPERATION",{operation:"call"});const l=await e(s);try{return await a.call(l)}catch(c){throw mm(c)&&c.data?t.interface.makeError(c.data,l):c}},r=async function(s){const a=t.runner;fe(Hk(a),"contract runner does not support sending transactions","UNSUPPORTED_OPERATION",{operation:"sendTransaction"});const l=await a.sendTransaction(await e(s)),c=ba(t.runner);return new sy(t.interface,c,l)},i=async function(s){const a=ya(t.runner,"estimateGas");return fe($k(a),"contract runner does not support gas estimation","UNSUPPORTED_OPERATION",{operation:"estimateGas"}),await a.estimateGas(await e(s))},o=async s=>await r(s);return Te(o,{_contract:t,estimateGas:i,populateTransaction:e,send:r,staticCall:n}),o}function dH(t,e){const n=function(...c){const u=t.interface.getFunction(e,c);return fe(u,"no matching fragment","UNSUPPORTED_OPERATION",{operation:"fragment",info:{key:e,args:c}}),u},r=async function(...c){const u=n(...c);let d={};if(u.inputs.length+1===c.length&&(d=await Gk(c.pop()),d.from&&(d.from=await Un(d.from,Wk(t.runner)))),u.inputs.length!==c.length)throw new Error("internal error: fragment inputs doesn't match arguments; should not happen");const h=await cH(t.runner,u.inputs,c);return Object.assign({},d,await Vn({to:t.getAddress(),data:t.interface.encodeFunctionData(u,h)}))},i=async function(...c){const u=await a(...c);return u.length===1?u[0]:u},o=async function(...c){const u=t.runner;fe(Hk(u),"contract runner does not support sending transactions","UNSUPPORTED_OPERATION",{operation:"sendTransaction"});const d=await u.sendTransaction(await r(...c)),h=ba(t.runner);return new sy(t.interface,h,d)},s=async function(...c){const u=ya(t.runner,"estimateGas");return fe($k(u),"contract runner does not support gas estimation","UNSUPPORTED_OPERATION",{operation:"estimateGas"}),await u.estimateGas(await r(...c))},a=async function(...c){const u=ya(t.runner,"call");fe(Uk(u),"contract runner does not support calling","UNSUPPORTED_OPERATION",{operation:"call"});const d=await r(...c);let h="0x";try{h=await u.call(d)}catch(b){throw mm(b)&&b.data?t.interface.makeError(b.data,d):b}const g=n(...c);return t.interface.decodeFunctionResult(g,h)},l=async(...c)=>n(...c).constant?await i(...c):await o(...c);return Te(l,{name:t.interface.getFunctionName(e),_contract:t,_key:e,getFragment:n,estimateGas:s,populateTransaction:r,send:o,staticCall:i,staticCallResult:a}),Object.defineProperty(l,"fragment",{configurable:!1,enumerable:!0,get:()=>{const c=t.interface.getFunction(e);return fe(c,"no matching fragment","UNSUPPORTED_OPERATION",{operation:"fragment",info:{key:e}}),c}}),l}function fH(t,e){const n=function(...i){const o=t.interface.getEvent(e,i);return fe(o,"no matching fragment","UNSUPPORTED_OPERATION",{operation:"fragment",info:{key:e,args:i}}),o},r=function(...i){return new lH(t,n(...i),i)};return Te(r,{name:t.interface.getEventName(e),_contract:t,_key:e,getFragment:n}),Object.defineProperty(r,"fragment",{configurable:!1,enumerable:!0,get:()=>{const i=t.interface.getEvent(e);return fe(i,"no matching fragment","UNSUPPORTED_OPERATION",{operation:"fragment",info:{key:e}}),i}}),r}const op=Symbol.for("_ethersInternal_contract"),jk=new WeakMap;function hH(t,e){jk.set(t[op],e)}function yr(t){return jk.get(t[op])}function pH(t){return t&&typeof t=="object"&&"getTopicFilter"in t&&typeof t.getTopicFilter=="function"&&t.fragment}async function ay(t,e){let n,r=null;if(Array.isArray(e)){const o=function(s){if(pt(s,32))return s;const a=t.interface.getEvent(s);return ne(a,"unknown fragment","name",s),a.topicHash};n=e.map(s=>s==null?null:Array.isArray(s)?s.map(o):o(s))}else e==="*"?n=[null]:typeof e=="string"?pt(e,32)?n=[e]:(r=t.interface.getEvent(e),ne(r,"unknown fragment","event",e),n=[r.topicHash]):pH(e)?n=await e.getTopicFilter():"fragment"in e?(r=e.fragment,n=[r.topicHash]):ne(!1,"unknown event name","event",e);n=n.map(o=>{if(o==null)return null;if(Array.isArray(o)){const s=Array.from(new Set(o.map(a=>a.toLowerCase())).values());return s.length===1?s[0]:(s.sort(),s)}return o.toLowerCase()});const i=n.map(o=>o==null?"null":Array.isArray(o)?o.join("|"):o).join("&");return{fragment:r,tag:i,topics:n}}async function dd(t,e){const{subs:n}=yr(t);return n.get((await ay(t,e)).tag)||null}async function Kk(t,e,n){const r=ba(t.runner);fe(r,"contract runner does not support subscribing","UNSUPPORTED_OPERATION",{operation:e});const{fragment:i,tag:o,topics:s}=await ay(t,n),{addr:a,subs:l}=yr(t);let c=l.get(o);if(!c){const d={address:a||t,topics:s},h=w=>{let S=i;if(S==null)try{S=t.interface.getEvent(w.topics[0])}catch(O){}if(S){const O=S,T=i?t.interface.decodeEventLog(i,w.data,w.topics):[];cy(t,n,T,$=>new aH(t,$,n,O,w))}else cy(t,n,[],O=>new Dk(t,O,n,w))};let g=[];c={tag:o,listeners:[],start:()=>{g.length||g.push(r.on(d,h))},stop:async()=>{if(g.length==0)return;let w=g;g=[],await Promise.all(w),r.off(d,h)}},l.set(o,c)}return c}let ly=Promise.resolve();async function gH(t,e,n,r){await ly;const i=await dd(t,e);if(!i)return!1;const o=i.listeners.length;return i.listeners=i.listeners.filter(({listener:s,once:a})=>{const l=Array.from(n);r&&l.push(r(a?null:s));try{s.call(t,...l)}catch(c){}return!a}),i.listeners.length===0&&(i.stop(),yr(t).subs.delete(i.tag)),o>0}async function cy(t,e,n,r){try{await ly}catch(o){}const i=gH(t,e,n,r);return ly=i,await i}const sp=["then"];gT=op;const Vd=class Vd{constructor(e,n,r,i){oe(this,"target");oe(this,"interface");oe(this,"runner");oe(this,"filters");oe(this,gT);oe(this,"fallback");ne(typeof e=="string"||kA(e),"invalid value for Contract target","target",e),r==null&&(r=null);const o=iy.from(n);Te(this,{target:e,runner:r,interface:o}),Object.defineProperty(this,op,{value:{}});let s,a=null,l=null;if(i){const d=ba(r);l=new sy(this.interface,d,i)}let c=new Map;if(typeof e=="string")if(pt(e))a=e,s=Promise.resolve(e);else{const d=ya(r,"resolveName");if(!ip(d))throw bt("contract runner does not support name resolution","UNSUPPORTED_OPERATION",{operation:"resolveName"});s=d.resolveName(e).then(h=>{if(h==null)throw bt("an ENS name used for a contract target must be correctly configured","UNCONFIGURED_NAME",{value:e});return yr(this).addr=h,h})}else s=e.getAddress().then(d=>{if(d==null)throw new Error("TODO");return yr(this).addr=d,d});hH(this,{addrPromise:s,addr:a,deployTx:l,subs:c});const u=new Proxy({},{get:(d,h,g)=>{if(typeof h=="symbol"||sp.indexOf(h)>=0)return Reflect.get(d,h,g);try{return this.getEvent(h)}catch(b){if(!bn(b,"INVALID_ARGUMENT")||b.argument!=="key")throw b}},has:(d,h)=>sp.indexOf(h)>=0?Reflect.has(d,h):Reflect.has(d,h)||this.interface.hasEvent(String(h))});return Te(this,{filters:u}),Te(this,{fallback:o.receive||o.fallback?uH(this):null}),new Proxy(this,{get:(d,h,g)=>{if(typeof h=="symbol"||h in d||sp.indexOf(h)>=0)return Reflect.get(d,h,g);try{return d.getFunction(h)}catch(b){if(!bn(b,"INVALID_ARGUMENT")||b.argument!=="key")throw b}},has:(d,h)=>typeof h=="symbol"||h in d||sp.indexOf(h)>=0?Reflect.has(d,h):d.interface.hasFunction(h)})}connect(e){return new Vd(this.target,this.interface,e)}attach(e){return new Vd(e,this.interface,this.runner)}async getAddress(){return await yr(this).addrPromise}async getDeployedCode(){const e=ba(this.runner);fe(e,"runner does not support .provider","UNSUPPORTED_OPERATION",{operation:"getDeployedCode"});const n=await e.getCode(await this.getAddress());return n==="0x"?null:n}async waitForDeployment(){const e=this.deploymentTransaction();if(e)return await e.wait(),this;if(await this.getDeployedCode()!=null)return this;const r=ba(this.runner);return fe(r!=null,"contract runner does not support .provider","UNSUPPORTED_OPERATION",{operation:"waitForDeployment"}),new Promise((i,o)=>{const s=async()=>{try{if(await this.getDeployedCode()!=null)return i(this);r.once("block",s)}catch(a){o(a)}};s()})}deploymentTransaction(){return yr(this).deployTx}getFunction(e){return typeof e!="string"&&(e=e.format()),dH(this,e)}getEvent(e){return typeof e!="string"&&(e=e.format()),fH(this,e)}async queryTransaction(e){throw new Error("@TODO")}async queryFilter(e,n,r){n==null&&(n=0),r==null&&(r="latest");const{addr:i,addrPromise:o}=yr(this),s=i||await o,{fragment:a,topics:l}=await ay(this,e),c={address:s,topics:l,fromBlock:n,toBlock:r},u=ba(this.runner);return fe(u,"contract runner does not have a provider","UNSUPPORTED_OPERATION",{operation:"queryFilter"}),(await u.getLogs(c)).map(d=>{let h=a;if(h==null)try{h=this.interface.getEvent(d.topics[0])}catch(g){}if(h)try{return new oy(d,this.interface,h)}catch(g){return new Vk(d,g)}return new cd(d,u)})}async on(e,n){const r=await Kk(this,"on",e);return r.listeners.push({listener:n,once:!1}),r.start(),this}async once(e,n){const r=await Kk(this,"once",e);return r.listeners.push({listener:n,once:!0}),r.start(),this}async emit(e,...n){return await cy(this,e,n,null)}async listenerCount(e){if(e){const i=await dd(this,e);return i?i.listeners.length:0}const{subs:n}=yr(this);let r=0;for(const{listeners:i}of n.values())r+=i.length;return r}async listeners(e){if(e){const i=await dd(this,e);return i?i.listeners.map(({listener:o})=>o):[]}const{subs:n}=yr(this);let r=[];for(const{listeners:i}of n.values())r=r.concat(i.map(({listener:o})=>o));return r}async off(e,n){const r=await dd(this,e);if(!r)return this;if(n){const i=r.listeners.map(({listener:o})=>o).indexOf(n);i>=0&&r.listeners.splice(i,1)}return(n==null||r.listeners.length===0)&&(r.stop(),yr(this).subs.delete(r.tag)),this}async removeAllListeners(e){if(e){const n=await dd(this,e);if(!n)return this;n.stop(),yr(this).subs.delete(n.tag)}else{const{subs:n}=yr(this);for(const{tag:r,stop:i}of n.values())i(),n.delete(r)}return this}async addListener(e,n){return await this.on(e,n)}async removeListener(e,n){return await this.off(e,n)}static buildClass(e){class n extends Vd{constructor(i,o=null){super(i,e,o)}}return n}static from(e,n,r){return r==null&&(r=null),new this(e,n,r)}};let uy=Vd;function mH(){return uy}class va extends mH(){}function dy(t){return t.match(/^ipfs:\/\/ipfs\//i)?t=t.substring(12):t.match(/^ipfs:\/\//i)?t=t.substring(7):ne(!1,"unsupported IPFS format","link",t),`https://gateway.ipfs.io/ipfs/${t}`}class yH{constructor(e){oe(this,"name");Te(this,{name:e})}connect(e){return this}supportsCoinType(e){return!1}async encodeAddress(e,n){throw new Error("unsupported coin")}async decodeAddress(e,n){throw new Error("unsupported coin")}}const qk=new RegExp("^(ipfs)://(.*)$","i"),Yk=[new RegExp("^(https)://(.*)$","i"),new RegExp("^(data):(.*)$","i"),qk,new RegExp("^eip155:[0-9]+/(erc[0-9]+):(.*)$","i")],zc=class zc{constructor(e,n,r){ce(this,Ts);oe(this,"provider");oe(this,"address");oe(this,"name");ce(this,Os);ce(this,qa);Te(this,{provider:e,address:n,name:r}),K(this,Os,null),K(this,qa,new va(n,["function supportsInterface(bytes4) view returns (bool)","function resolve(bytes, bytes) view returns (bytes)","function addr(bytes32) view returns (address)","function addr(bytes32, uint) view returns (bytes)","function text(bytes32, string) view returns (string)","function contenthash(bytes32) view returns (bytes)"],e))}async supportsWildcard(){return F(this,Os)==null&&K(this,Os,(async()=>{try{return await F(this,qa).supportsInterface("0x9061b923")}catch(e){if(bn(e,"CALL_EXCEPTION"))return!1;throw K(this,Os,null),e}})()),await F(this,Os)}async getAddress(e){if(e==null&&(e=60),e===60)try{const o=await be(this,Ts,ru).call(this,"addr(bytes32)");return o==null||o===Zu?null:o}catch(o){if(bn(o,"CALL_EXCEPTION"))return null;throw o}if(e>=0&&e<2147483648){let o=e+2147483648;const s=await be(this,Ts,ru).call(this,"addr(bytes32,uint)",[o]);if(pt(s,20))return rt(s)}let n=null;for(const o of this.provider.plugins)if(o instanceof yH&&o.supportsCoinType(e)){n=o;break}if(n==null)return null;const r=await be(this,Ts,ru).call(this,"addr(bytes32,uint)",[e]);if(r==null||r==="0x")return null;const i=await n.decodeAddress(e,r);if(i!=null)return i;fe(!1,"invalid coin data","UNSUPPORTED_OPERATION",{operation:`getAddress(${e})`,info:{coinType:e,data:r}})}async getText(e){const n=await be(this,Ts,ru).call(this,"text(bytes32,string)",[e]);return n==null||n==="0x"?null:n}async getContentHash(){const e=await be(this,Ts,ru).call(this,"contenthash(bytes32)");if(e==null||e==="0x")return null;const n=e.match(/^0x(e3010170|e5010172)(([0-9a-f][0-9a-f])([0-9a-f][0-9a-f])([0-9a-f]*))$/);if(n){const i=n[1]==="e3010170"?"ipfs":"ipns",o=parseInt(n[4],16);if(n[5].length===o*2)return`${i}://${LU("0x"+n[2])}`}const r=e.match(/^0xe40101fa011b20([0-9a-f]*)$/);if(r&&r[1].length===64)return`bzz://${r[1]}`;fe(!1,"invalid or unsupported content hash data","UNSUPPORTED_OPERATION",{operation:"getContentHash()",info:{data:e}})}async getAvatar(){return(await this._getAvatar()).url}async _getAvatar(){const e=[{type:"name",value:this.name}];try{const n=await this.getText("avatar");if(n==null)return e.push({type:"!avatar",value:""}),{url:null,linkage:e};e.push({type:"avatar",value:n});for(let r=0;r<Yk.length;r++){const i=n.match(Yk[r]);if(i==null)continue;const o=i[1].toLowerCase();switch(o){case"https":case"data":return e.push({type:"url",value:n}),{linkage:e,url:n};case"ipfs":{const s=dy(n);return e.push({type:"ipfs",value:n}),e.push({type:"url",value:s}),{linkage:e,url:s}}case"erc721":case"erc1155":{const s=o==="erc721"?"tokenURI(uint256)":"uri(uint256)";e.push({type:o,value:n});const a=await this.getAddress();if(a==null)return e.push({type:"!owner",value:""}),{url:null,linkage:e};const l=(i[2]||"").split("/");if(l.length!==2)return e.push({type:`!${o}caip`,value:i[2]||""}),{url:null,linkage:e};const c=l[1],u=new va(l[0],["function tokenURI(uint) view returns (string)","function ownerOf(uint) view returns (address)","function uri(uint) view returns (string)","function balanceOf(address, uint256) view returns (uint)"],this.provider);if(o==="erc721"){const p=await u.ownerOf(c);if(a!==p)return e.push({type:"!owner",value:p}),{url:null,linkage:e};e.push({type:"owner",value:p})}else if(o==="erc1155"){const p=await u.balanceOf(a,c);if(!p)return e.push({type:"!balance",value:"0"}),{url:null,linkage:e};e.push({type:"balance",value:p.toString()})}let d=await u[s](c);if(d==null||d==="0x")return e.push({type:"!metadata-url",value:""}),{url:null,linkage:e};e.push({type:"metadata-url-base",value:d}),o==="erc1155"&&(d=d.replace("{id}",ns(c,32).substring(2)),e.push({type:"metadata-url-expanded",value:d})),d.match(/^ipfs:/i)&&(d=dy(d)),e.push({type:"metadata-url",value:d});let h={};const g=await new rs(d).send();g.assertOk();try{h=g.bodyJson}catch(p){try{e.push({type:"!metadata",value:g.bodyText})}catch(w){const S=g.body;return S&&e.push({type:"!metadata",value:ve(S)}),{url:null,linkage:e}}return{url:null,linkage:e}}if(!h)return e.push({type:"!metadata",value:""}),{url:null,linkage:e};e.push({type:"metadata",value:JSON.stringify(h)});let b=h.image;if(typeof b!="string")return e.push({type:"!imageUrl",value:""}),{url:null,linkage:e};if(!b.match(/^(https:\/\/|data:)/i)){if(b.match(qk)==null)return e.push({type:"!imageUrl-ipfs",value:b}),{url:null,linkage:e};e.push({type:"imageUrl-ipfs",value:b}),b=dy(b)}return e.push({type:"url",value:b}),{linkage:e,url:b}}}}}catch(n){}return{linkage:e,url:null}}static async getEnsAddress(e){const n=await e.getNetwork(),r=n.getPlugin("org.ethers.plugins.network.Ens");return fe(r,"network does not support ENS","UNSUPPORTED_OPERATION",{operation:"getEnsAddress",info:{network:n}}),r.address}static async fromName(e,n){var i;let r=n;for(;;){if(r===""||r==="."||n!=="eth"&&r==="eth")return null;const o=await be(i=zc,Qp,PT).call(i,e,r);if(o!=null){const s=new zc(e,o,n);return r!==n&&!await s.supportsWildcard()?null:s}r=r.split(".").slice(1).join(".")}}};Os=new WeakMap,qa=new WeakMap,Ts=new WeakSet,ru=async function(e,n){n=(n||[]).slice();const r=F(this,qa).interface;n.unshift(ey(this.name));let i=null;await this.supportsWildcard()&&(i=r.getFunction(e),fe(i,"missing fragment","UNKNOWN_ERROR",{info:{funcName:e}}),n=[M$(this.name,255),r.encodeFunctionData(i,n)],e="resolve(bytes,bytes)"),n.push({enableCcipRead:!0});try{const o=await F(this,qa)[e](...n);return i?r.decodeFunctionResult(i,o)[0]:o}catch(o){if(!bn(o,"CALL_EXCEPTION"))throw o}return null},Qp=new WeakSet,PT=async function(e,n){const r=await zc.getEnsAddress(e);try{const o=await new va(r,["function resolver(bytes32) view returns (address)"],e).resolver(ey(n),{enableCcipRead:!0});return o===Zu?null:o}catch(i){throw i}return null},ce(zc,Qp);let ap=zc;const Qk=BigInt(0);function Ye(t,e){return function(n){return n==null?e:t(n)}}function fd(t,e){return n=>{if(e&&n==null)return null;if(!Array.isArray(n))throw new Error("not an array");return n.map(r=>t(r))}}function hd(t,e){return n=>{const r={};for(const i in t){let o=i;if(e&&i in e&&!(o in n)){for(const s of e[i])if(s in n){o=s;break}}try{const s=t[i](n[o]);s!==void 0&&(r[i]=s)}catch(s){const a=s instanceof Error?s.message:"not-an-error";fe(!1,`invalid value for value.${i} (${a})`,"BAD_DATA",{value:n})}}return r}}function bH(t){switch(t){case!0:case"true":return!0;case!1:case"false":return!1}ne(!1,`invalid boolean; ${JSON.stringify(t)}`,"value",t)}function Zl(t){return ne(pt(t,!0),"invalid data","value",t),t}function wn(t){return ne(pt(t,32),"invalid hash","value",t),t}const vH=hd({address:rt,blockHash:wn,blockNumber:$e,data:Zl,index:$e,removed:Ye(bH,!1),topics:fd(wn),transactionHash:wn,transactionIndex:$e},{index:["logIndex"]});function wH(t){return vH(t)}const xH=hd({hash:Ye(wn),parentHash:wn,parentBeaconBlockRoot:Ye(wn,null),number:$e,timestamp:$e,nonce:Ye(Zl),difficulty:Se,gasLimit:Se,gasUsed:Se,stateRoot:Ye(wn,null),receiptsRoot:Ye(wn,null),blobGasUsed:Ye(Se,null),excessBlobGas:Ye(Se,null),miner:Ye(rt),prevRandao:Ye(wn,null),extraData:Zl,baseFeePerGas:Ye(Se)},{prevRandao:["mixHash"]});function EH(t){const e=xH(t);return e.transactions=t.transactions.map(n=>typeof n=="string"?n:Xk(n)),e}const SH=hd({transactionIndex:$e,blockNumber:$e,transactionHash:wn,address:rt,topics:fd(wn),data:Zl,index:$e,blockHash:wn},{index:["logIndex"]});function AH(t){return SH(t)}const kH=hd({to:Ye(rt,null),from:Ye(rt,null),contractAddress:Ye(rt,null),index:$e,root:Ye(ve),gasUsed:Se,blobGasUsed:Ye(Se,null),logsBloom:Ye(Zl),blockHash:wn,hash:wn,logs:fd(AH),blockNumber:$e,cumulativeGasUsed:Se,effectiveGasPrice:Ye(Se),blobGasPrice:Ye(Se,null),status:Ye($e),type:Ye($e,0)},{effectiveGasPrice:["gasPrice"],hash:["transactionHash"],index:["transactionIndex"]});function CH(t){return kH(t)}function Xk(t){t.to&&Se(t.to)===Qk&&(t.to="0x0000000000000000000000000000000000000000");const e=hd({hash:wn,index:Ye($e,void 0),type:n=>n==="0x"||n==null?0:$e(n),accessList:Ye(ca,null),blobVersionedHashes:Ye(fd(wn,!0),null),authorizationList:Ye(fd(n=>{let r;if(n.signature)r=n.signature;else{let i=n.yParity;i==="0x1b"?i=0:i==="0x1c"&&(i=1),r=Object.assign({},n,{yParity:i})}return{address:rt(n.address),chainId:Se(n.chainId),nonce:Se(n.nonce),signature:nr.from(r)}},!1),null),blockHash:Ye(wn,null),blockNumber:Ye($e,null),transactionIndex:Ye($e,null),from:rt,gasPrice:Ye(Se),maxPriorityFeePerGas:Ye(Se),maxFeePerGas:Ye(Se),maxFeePerBlobGas:Ye(Se,null),gasLimit:Se,to:Ye(rt,null),value:Se,nonce:$e,data:Zl,creates:Ye(rt,null),chainId:Ye(Se,null)},{data:["input"],gasLimit:["gas"],index:["transactionIndex"]})(t);if(e.to==null&&e.creates==null&&(e.creates=m9(e)),(t.type===1||t.type===2)&&t.accessList==null&&(e.accessList=[]),t.signature?e.signature=nr.from(t.signature):e.signature=nr.from(t),e.chainId==null){const n=e.signature.legacyChainId;n!=null&&(e.chainId=n)}return e.blockHash&&Se(e.blockHash)===Qk&&(e.blockHash=null),e}const IH="0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e";class pd{constructor(e){oe(this,"name");Te(this,{name:e})}clone(){return new pd(this.name)}}class lp extends pd{constructor(n,r){n==null&&(n=0);super(`org.ethers.network.plugins.GasCost#${n||0}`);oe(this,"effectiveBlock");oe(this,"txBase");oe(this,"txCreate");oe(this,"txDataZero");oe(this,"txDataNonzero");oe(this,"txAccessListStorageKey");oe(this,"txAccessListAddress");const i={effectiveBlock:n};function o(s,a){let l=(r||{})[s];l==null&&(l=a),ne(typeof l=="number",`invalud value for ${s}`,"costs",r),i[s]=l}o("txBase",21e3),o("txCreate",32e3),o("txDataZero",4),o("txDataNonzero",16),o("txAccessListStorageKey",1900),o("txAccessListAddress",2400),Te(this,i)}clone(){return new lp(this.effectiveBlock,this)}}class cp extends pd{constructor(n,r){super("org.ethers.plugins.network.Ens");oe(this,"address");oe(this,"targetNetwork");Te(this,{address:n||IH,targetNetwork:r==null?1:r})}clone(){return new cp(this.address,this.targetNetwork)}}class OH extends pd{constructor(n,r){super("org.ethers.plugins.network.FetchUrlFeeDataPlugin");ce(this,Dd);ce(this,zd);K(this,Dd,n),K(this,zd,r)}get url(){return F(this,Dd)}get processFunc(){return F(this,zd)}clone(){return this}}Dd=new WeakMap,zd=new WeakMap;const fy=new Map,Hc=class Hc{constructor(e,n){ce(this,Uc);ce(this,$c);ce(this,Ps);K(this,Uc,e),K(this,$c,Se(n)),K(this,Ps,new Map)}toJSON(){return{name:this.name,chainId:String(this.chainId)}}get name(){return F(this,Uc)}set name(e){K(this,Uc,e)}get chainId(){return F(this,$c)}set chainId(e){K(this,$c,Se(e,"chainId"))}matches(e){if(e==null)return!1;if(typeof e=="string"){try{return this.chainId===Se(e)}catch(n){}return this.name===e}if(typeof e=="number"||typeof e=="bigint"){try{return this.chainId===Se(e)}catch(n){}return!1}if(typeof e=="object"){if(e.chainId!=null){try{return this.chainId===Se(e.chainId)}catch(n){}return!1}return e.name!=null?this.name===e.name:!1}return!1}get plugins(){return Array.from(F(this,Ps).values())}attachPlugin(e){if(F(this,Ps).get(e.name))throw new Error(`cannot replace existing plugin: ${e.name} `);return F(this,Ps).set(e.name,e.clone()),this}getPlugin(e){return F(this,Ps).get(e)||null}getPlugins(e){return this.plugins.filter(n=>n.name.split("#")[0]===e)}clone(){const e=new Hc(this.name,this.chainId);return this.plugins.forEach(n=>{e.attachPlugin(n.clone())}),e}computeIntrinsicGas(e){const n=this.getPlugin("org.ethers.plugins.network.GasCost")||new lp;let r=n.txBase;if(e.to==null&&(r+=n.txCreate),e.data)for(let i=2;i<e.data.length;i+=2)e.data.substring(i,i+2)==="00"?r+=n.txDataZero:r+=n.txDataNonzero;if(e.accessList){const i=ca(e.accessList);for(const o in i)r+=n.txAccessListAddress+n.txAccessListStorageKey*i[o].storageKeys.length}return r}static from(e){if(TH(),e==null)return Hc.from("mainnet");if(typeof e=="number"&&(e=BigInt(e)),typeof e=="string"||typeof e=="bigint"){const n=fy.get(e);if(n)return n();if(typeof e=="bigint")return new Hc("unknown",e);ne(!1,"unknown network","network",e)}if(typeof e.clone=="function")return e.clone();if(typeof e=="object"){ne(typeof e.name=="string"&&typeof e.chainId=="number","invalid network object name or chainId","network",e);const n=new Hc(e.name,e.chainId);return(e.ensAddress||e.ensNetwork!=null)&&n.attachPlugin(new cp(e.ensAddress,e.ensNetwork)),n}ne(!1,"invalid network","network",e)}static register(e,n){typeof e=="number"&&(e=BigInt(e));const r=fy.get(e);r&&ne(!1,`conflicting network for ${JSON.stringify(r.name)}`,"nameOrChainId",e),fy.set(e,n)}};Uc=new WeakMap,$c=new WeakMap,Ps=new WeakMap;let Bi=Hc;function Jk(t,e){const n=String(t);if(!n.match(/^[0-9.]+$/))throw new Error(`invalid gwei value: ${t}`);const r=n.split(".");if(r.length===1&&r.push(""),r.length!==2)throw new Error(`invalid gwei value: ${t}`);for(;r[1].length<e;)r[1]+="0";if(r[1].length>9){let i=BigInt(r[1].substring(0,9));r[1].substring(9).match(/^0+$/)||i++,r[1]=i.toString()}return BigInt(r[0]+r[1])}function Zk(t){return new OH(t,async(e,n,r)=>{r.setHeader("User-Agent","ethers");let i;try{const[o,s]=await Promise.all([r.send(),e()]);i=o;const a=i.bodyJson.standard;return{gasPrice:s.gasPrice,maxFeePerGas:Jk(a.maxFee,9),maxPriorityFeePerGas:Jk(a.maxPriorityFee,9)}}catch(o){fe(!1,`error encountered with polygon gas station (${JSON.stringify(r.url)})`,"SERVER_ERROR",{request:r,response:i,error:o})}})}let eC=!1;function TH(){if(eC)return;eC=!0;function t(e,n,r){const i=function(){const o=new Bi(e,n);return r.ensNetwork!=null&&o.attachPlugin(new cp(null,r.ensNetwork)),o.attachPlugin(new lp),(r.plugins||[]).forEach(s=>{o.attachPlugin(s)}),o};Bi.register(e,i),Bi.register(n,i),r.altNames&&r.altNames.forEach(o=>{Bi.register(o,i)})}t("mainnet",1,{ensNetwork:1,altNames:["homestead"]}),t("ropsten",3,{ensNetwork:3}),t("rinkeby",4,{ensNetwork:4}),t("goerli",5,{ensNetwork:5}),t("kovan",42,{ensNetwork:42}),t("sepolia",11155111,{ensNetwork:11155111}),t("holesky",17e3,{ensNetwork:17e3}),t("classic",61,{}),t("classicKotti",6,{}),t("arbitrum",42161,{ensNetwork:1}),t("arbitrum-goerli",421613,{}),t("arbitrum-sepolia",421614,{}),t("base",8453,{ensNetwork:1}),t("base-goerli",84531,{}),t("base-sepolia",84532,{}),t("bnb",56,{ensNetwork:1}),t("bnbt",97,{}),t("linea",59144,{ensNetwork:1}),t("linea-goerli",59140,{}),t("linea-sepolia",59141,{}),t("matic",137,{ensNetwork:1,plugins:[Zk("https://gasstation.polygon.technology/v2")]}),t("matic-amoy",80002,{}),t("matic-mumbai",80001,{altNames:["maticMumbai","maticmum"],plugins:[Zk("https://gasstation-testnet.polygon.technology/v2")]}),t("optimism",10,{ensNetwork:1,plugins:[]}),t("optimism-goerli",420,{}),t("optimism-sepolia",11155420,{}),t("xdai",100,{ensNetwork:1})}function hy(t){return JSON.parse(JSON.stringify(t))}class PH{constructor(e){ce(this,Wc);ce(this,Lo);ce(this,zr);ce(this,Ns);ce(this,Hi);K(this,Lo,e),K(this,zr,null),K(this,Ns,4e3),K(this,Hi,-2)}get pollingInterval(){return F(this,Ns)}set pollingInterval(e){K(this,Ns,e)}start(){F(this,zr)||(K(this,zr,F(this,Lo)._setTimeout(be(this,Wc,ag).bind(this),F(this,Ns))),be(this,Wc,ag).call(this))}stop(){F(this,zr)&&(F(this,Lo)._clearTimeout(F(this,zr)),K(this,zr,null))}pause(e){this.stop(),e&&K(this,Hi,-2)}resume(){this.start()}}Lo=new WeakMap,zr=new WeakMap,Ns=new WeakMap,Hi=new WeakMap,Wc=new WeakSet,ag=async function(){try{const e=await F(this,Lo).getBlockNumber();if(F(this,Hi)===-2){K(this,Hi,e);return}if(e!==F(this,Hi)){for(let n=F(this,Hi)+1;n<=e;n++){if(F(this,zr)==null)return;await F(this,Lo).emit("block",n)}K(this,Hi,e)}}catch(e){}F(this,zr)!=null&&K(this,zr,F(this,Lo)._setTimeout(be(this,Wc,ag).bind(this),F(this,Ns)))};class py{constructor(e){ce(this,Ya);ce(this,Qa);ce(this,Bs);K(this,Ya,e),K(this,Bs,!1),K(this,Qa,n=>{this._poll(n,F(this,Ya))})}async _poll(e,n){throw new Error("sub-classes must override this")}start(){F(this,Bs)||(K(this,Bs,!0),F(this,Qa).call(this,-2),F(this,Ya).on("block",F(this,Qa)))}stop(){F(this,Bs)&&(K(this,Bs,!1),F(this,Ya).off("block",F(this,Qa)))}pause(e){this.stop()}resume(){this.start()}}Ya=new WeakMap,Qa=new WeakMap,Bs=new WeakMap;class NH extends py{constructor(n,r){super(n);ce(this,Gc);ce(this,Fo);K(this,Gc,r),K(this,Fo,-2)}pause(n){n&&K(this,Fo,-2),super.pause(n)}async _poll(n,r){const i=await r.getBlock(F(this,Gc));i!=null&&(F(this,Fo)===-2?K(this,Fo,i.number):i.number>F(this,Fo)&&(r.emit(F(this,Gc),i.number),K(this,Fo,i.number)))}}Gc=new WeakMap,Fo=new WeakMap;class BH extends py{constructor(n,r){super(n);ce(this,Xp);K(this,Xp,hy(r))}async _poll(n,r){throw new Error("@TODO")}}Xp=new WeakMap;class RH extends py{constructor(n,r){super(n);ce(this,jc);K(this,jc,r)}async _poll(n,r){const i=await r.getTransactionReceipt(F(this,jc));i&&r.emit(F(this,jc),i)}}jc=new WeakMap;class gy{constructor(e,n){ce(this,Jp);ce(this,_o);ce(this,Kc);ce(this,qc);ce(this,Rs);ce(this,Ur);K(this,_o,e),K(this,Kc,hy(n)),K(this,qc,be(this,Jp,NT).bind(this)),K(this,Rs,!1),K(this,Ur,-2)}start(){F(this,Rs)||(K(this,Rs,!0),F(this,Ur)===-2&&F(this,_o).getBlockNumber().then(e=>{K(this,Ur,e)}),F(this,_o).on("block",F(this,qc)))}stop(){F(this,Rs)&&(K(this,Rs,!1),F(this,_o).off("block",F(this,qc)))}pause(e){this.stop(),e&&K(this,Ur,-2)}resume(){this.start()}}_o=new WeakMap,Kc=new WeakMap,qc=new WeakMap,Rs=new WeakMap,Ur=new WeakMap,Jp=new WeakSet,NT=async function(e){if(F(this,Ur)===-2)return;const n=hy(F(this,Kc));n.fromBlock=F(this,Ur)+1,n.toBlock=e;const r=await F(this,_o).getLogs(n);if(r.length===0){F(this,Ur)<e-60&&K(this,Ur,e-60);return}for(const i of r)F(this,_o).emit(F(this,Kc),i),K(this,Ur,i.blockNumber)};const MH=BigInt(2),LH=10;function up(t){return t&&typeof t.then=="function"}function dp(t,e){return t+":"+JSON.stringify(e,(n,r)=>{if(r==null)return"null";if(typeof r=="bigint")return`bigint:${r.toString()}`;if(typeof r=="string")return r.toLowerCase();if(typeof r=="object"&&!Array.isArray(r)){const i=Object.keys(r);return i.sort(),i.reduce((o,s)=>(o[s]=r[s],o),{})}return r})}class tC{constructor(e){oe(this,"name");Te(this,{name:e})}start(){}stop(){}pause(e){}resume(){}}function FH(t){return JSON.parse(JSON.stringify(t))}function my(t){return t=Array.from(new Set(t).values()),t.sort(),t}async function yy(t,e){if(t==null)throw new Error("invalid event");if(Array.isArray(t)&&(t={topics:t}),typeof t=="string")switch(t){case"block":case"debug":case"error":case"finalized":case"network":case"pending":case"safe":return{type:t,tag:t}}if(pt(t,32)){const n=t.toLowerCase();return{type:"transaction",tag:dp("tx",{hash:n}),hash:n}}if(t.orphan){const n=t;return{type:"orphan",tag:dp("orphan",n),filter:FH(n)}}if(t.address||t.topics){const n=t,r={topics:(n.topics||[]).map(i=>i==null?null:Array.isArray(i)?my(i.map(o=>o.toLowerCase())):i.toLowerCase())};if(n.address){const i=[],o=[],s=a=>{pt(a)?i.push(a):o.push((async()=>{i.push(await Un(a,e))})())};Array.isArray(n.address)?n.address.forEach(s):s(n.address),o.length&&await Promise.all(o),r.address=my(i.map(a=>a.toLowerCase()))}return{filter:r,tag:dp("event",r),type:"event"}}ne(!1,"unknown ProviderEvent","event",t)}function by(){return new Date().getTime()}const _H={cacheTimeout:250,pollingInterval:4e3};class VH{constructor(e,n){ce(this,He);ce(this,Mn);ce(this,Ms);ce(this,Ln);ce(this,Yc);ce(this,kr);ce(this,Xa);ce(this,Ls);ce(this,Vo);ce(this,Ud);ce(this,$r);ce(this,Qc);ce(this,Xc);if(K(this,Xc,Object.assign({},_H,n||{})),e==="any")K(this,Xa,!0),K(this,kr,null);else if(e){const r=Bi.from(e);K(this,Xa,!1),K(this,kr,Promise.resolve(r)),setTimeout(()=>{this.emit("network",r,null)},0)}else K(this,Xa,!1),K(this,kr,null);K(this,Vo,-1),K(this,Ls,new Map),K(this,Mn,new Map),K(this,Ms,new Map),K(this,Ln,null),K(this,Yc,!1),K(this,Ud,1),K(this,$r,new Map),K(this,Qc,!1)}get pollingInterval(){return F(this,Xc).pollingInterval}get provider(){return this}get plugins(){return Array.from(F(this,Ms).values())}attachPlugin(e){if(F(this,Ms).get(e.name))throw new Error(`cannot replace existing plugin: ${e.name} `);return F(this,Ms).set(e.name,e.connect(this)),this}getPlugin(e){return F(this,Ms).get(e)||null}get disableCcipRead(){return F(this,Qc)}set disableCcipRead(e){K(this,Qc,!!e)}async ccipReadFetch(e,n,r){if(this.disableCcipRead||r.length===0||e.to==null)return null;const i=e.to.toLowerCase(),o=n.toLowerCase(),s=[];for(let a=0;a<r.length;a++){const l=r[a],c=l.replace("{sender}",i).replace("{data}",o),u=new rs(c);l.indexOf("{data}")===-1&&(u.body={data:o,sender:i}),this.emit("debug",{action:"sendCcipReadFetchRequest",request:u,index:a,urls:r});let d="unknown error",h;try{h=await u.send()}catch(g){s.push(g.message),this.emit("debug",{action:"receiveCcipReadFetchError",request:u,result:{error:g}});continue}try{const g=h.bodyJson;if(g.data)return this.emit("debug",{action:"receiveCcipReadFetchResult",request:u,result:g}),g.data;g.message&&(d=g.message),this.emit("debug",{action:"receiveCcipReadFetchError",request:u,result:g})}catch(g){}fe(h.statusCode<400||h.statusCode>=500,`response not found during CCIP fetch: ${d}`,"OFFCHAIN_FAULT",{reason:"404_MISSING_RESOURCE",transaction:e,info:{url:l,errorMessage:d}}),s.push(d)}fe(!1,`error encountered during CCIP fetch: ${s.map(a=>JSON.stringify(a)).join(", ")}`,"OFFCHAIN_FAULT",{reason:"500_SERVER_ERROR",transaction:e,info:{urls:r,errorMessages:s}})}_wrapBlock(e,n){return new rH(EH(e),this)}_wrapLog(e,n){return new cd(wH(e),this)}_wrapTransactionReceipt(e,n){return new Lk(CH(e),this)}_wrapTransactionResponse(e,n){return new ud(Xk(e),this)}_detectNetwork(){fe(!1,"sub-classes must implement this","UNSUPPORTED_OPERATION",{operation:"_detectNetwork"})}async _perform(e){fe(!1,`unsupported method: ${e.method}`,"UNSUPPORTED_OPERATION",{operation:e.method,info:e})}async getBlockNumber(){const e=$e(await be(this,He,Cr).call(this,{method:"getBlockNumber"}),"%response");return F(this,Vo)>=0&&K(this,Vo,e),e}_getAddress(e){return Un(e,this)}_getBlockTag(e){if(e==null)return"latest";switch(e){case"earliest":return"0x0";case"finalized":case"latest":case"pending":case"safe":return e}if(pt(e))return pt(e,32)?e:ei(e);if(typeof e=="bigint"&&(e=$e(e,"blockTag")),typeof e=="number")return e>=0?ei(e):F(this,Vo)>=0?ei(F(this,Vo)+e):this.getBlockNumber().then(n=>ei(n+e));ne(!1,"invalid blockTag","blockTag",e)}_getFilter(e){const n=(e.topics||[]).map(l=>l==null?null:Array.isArray(l)?my(l.map(c=>c.toLowerCase())):l.toLowerCase()),r="blockHash"in e?e.blockHash:void 0,i=(l,c,u)=>{let d;switch(l.length){case 0:break;case 1:d=l[0];break;default:l.sort(),d=l}if(r&&(c!=null||u!=null))throw new Error("invalid filter");const h={};return d&&(h.address=d),n.length&&(h.topics=n),c&&(h.fromBlock=c),u&&(h.toBlock=u),r&&(h.blockHash=r),h};let o=[];if(e.address)if(Array.isArray(e.address))for(const l of e.address)o.push(this._getAddress(l));else o.push(this._getAddress(e.address));let s;"fromBlock"in e&&(s=this._getBlockTag(e.fromBlock));let a;return"toBlock"in e&&(a=this._getBlockTag(e.toBlock)),o.filter(l=>typeof l!="string").length||s!=null&&typeof s!="string"||a!=null&&typeof a!="string"?Promise.all([Promise.all(o),s,a]).then(l=>i(l[0],l[1],l[2])):i(o,s,a)}_getTransactionRequest(e){const n=rp(e),r=[];if(["to","from"].forEach(i=>{if(n[i]==null)return;const o=Un(n[i],this);up(o)?r.push(async function(){n[i]=await o}()):n[i]=o}),n.blockTag!=null){const i=this._getBlockTag(n.blockTag);up(i)?r.push(async function(){n.blockTag=await i}()):n.blockTag=i}return r.length?async function(){return await Promise.all(r),n}():n}async getNetwork(){if(F(this,kr)==null){const i=(async()=>{try{const o=await this._detectNetwork();return this.emit("network",o,null),o}catch(o){throw F(this,kr)===i&&K(this,kr,null),o}})();return K(this,kr,i),(await i).clone()}const e=F(this,kr),[n,r]=await Promise.all([e,this._detectNetwork()]);return n.chainId!==r.chainId&&(F(this,Xa)?(this.emit("network",r,n),F(this,kr)===e&&K(this,kr,Promise.resolve(r))):fe(!1,`network changed: ${n.chainId} => ${r.chainId} `,"NETWORK_ERROR",{event:"changed"})),n.clone()}async getFeeData(){const e=await this.getNetwork(),n=async()=>{const{_block:i,gasPrice:o,priorityFee:s}=await Vn({_block:be(this,He,qb).call(this,"latest",!1),gasPrice:(async()=>{try{const u=await be(this,He,Cr).call(this,{method:"getGasPrice"});return Se(u,"%response")}catch(u){}return null})(),priorityFee:(async()=>{try{const u=await be(this,He,Cr).call(this,{method:"getPriorityFee"});return Se(u,"%response")}catch(u){}return null})()});let a=null,l=null;const c=this._wrapBlock(i,e);return c&&c.baseFeePerGas&&(l=s!=null?s:BigInt("1000000000"),a=c.baseFeePerGas*MH+l),new Mk(o,a,l)},r=e.getPlugin("org.ethers.plugins.network.FetchUrlFeeDataPlugin");if(r){const i=new rs(r.url),o=await r.processFunc(n,this,i);return new Mk(o.gasPrice,o.maxFeePerGas,o.maxPriorityFeePerGas)}return await n()}async estimateGas(e){let n=this._getTransactionRequest(e);return up(n)&&(n=await n),Se(await be(this,He,Cr).call(this,{method:"estimateGas",transaction:n}),"%response")}async call(e){const{tx:n,blockTag:r}=await Vn({tx:this._getTransactionRequest(e),blockTag:this._getBlockTag(e.blockTag)});return await be(this,He,Kb).call(this,be(this,He,jb).call(this,n,r,e.enableCcipRead?0:-1))}async getBalance(e,n){return Se(await be(this,He,Gd).call(this,{method:"getBalance"},e,n),"%response")}async getTransactionCount(e,n){return $e(await be(this,He,Gd).call(this,{method:"getTransactionCount"},e,n),"%response")}async getCode(e,n){return ve(await be(this,He,Gd).call(this,{method:"getCode"},e,n))}async getStorage(e,n,r){const i=Se(n,"position");return ve(await be(this,He,Gd).call(this,{method:"getStorage",position:i},e,r))}async broadcastTransaction(e){const{blockNumber:n,hash:r,network:i}=await Vn({blockNumber:this.getBlockNumber(),hash:this._perform({method:"broadcastTransaction",signedTransaction:e}),network:this.getNetwork()}),o=BA.from(e);if(o.hash!==r)throw new Error("@TODO: the returned hash did not match");return this._wrapTransactionResponse(o,i).replaceableTransaction(n)}async getBlock(e,n){const{network:r,params:i}=await Vn({network:this.getNetwork(),params:be(this,He,qb).call(this,e,!!n)});return i==null?null:this._wrapBlock(i,r)}async getTransaction(e){const{network:n,params:r}=await Vn({network:this.getNetwork(),params:be(this,He,Cr).call(this,{method:"getTransaction",hash:e})});return r==null?null:this._wrapTransactionResponse(r,n)}async getTransactionReceipt(e){const{network:n,params:r}=await Vn({network:this.getNetwork(),params:be(this,He,Cr).call(this,{method:"getTransactionReceipt",hash:e})});if(r==null)return null;if(r.gasPrice==null&&r.effectiveGasPrice==null){const i=await be(this,He,Cr).call(this,{method:"getTransaction",hash:e});if(i==null)throw new Error("report this; could not find tx or effectiveGasPrice");r.effectiveGasPrice=i.gasPrice}return this._wrapTransactionReceipt(r,n)}async getTransactionResult(e){const{result:n}=await Vn({network:this.getNetwork(),result:be(this,He,Cr).call(this,{method:"getTransactionResult",hash:e})});return n==null?null:ve(n)}async getLogs(e){let n=this._getFilter(e);up(n)&&(n=await n);const{network:r,params:i}=await Vn({network:this.getNetwork(),params:be(this,He,Cr).call(this,{method:"getLogs",filter:n})});return i.map(o=>this._wrapLog(o,r))}_getProvider(e){fe(!1,"provider cannot connect to target network","UNSUPPORTED_OPERATION",{operation:"_getProvider()"})}async getResolver(e){return await ap.fromName(this,e)}async getAvatar(e){const n=await this.getResolver(e);return n?await n.getAvatar():null}async resolveName(e){const n=await this.getResolver(e);return n?await n.getAddress():null}async lookupAddress(e){e=rt(e);const n=ey(e.substring(2).toLowerCase()+".addr.reverse");try{const r=await ap.getEnsAddress(this),o=await new va(r,["function resolver(bytes32) view returns (address)"],this).resolver(n);if(o==null||o===Zu)return null;const a=await new va(o,["function name(bytes32) view returns (string)"],this).name(n);return await this.resolveName(a)!==e?null:a}catch(r){if(bn(r,"BAD_DATA")&&r.value==="0x"||bn(r,"CALL_EXCEPTION"))return null;throw r}return null}async waitForTransaction(e,n,r){const i=n!=null?n:1;return i===0?this.getTransactionReceipt(e):new Promise(async(o,s)=>{let a=null;const l=async c=>{try{const u=await this.getTransactionReceipt(e);if(u!=null&&c-u.blockNumber+1>=i){o(u),a&&(clearTimeout(a),a=null);return}}catch(u){console.log("EEE",u)}this.once("block",l)};r!=null&&(a=setTimeout(()=>{a!=null&&(a=null,this.off("block",l),s(bt("timeout","TIMEOUT",{reason:"timeout"})))},r)),l(await this.getBlockNumber())})}async waitForBlock(e){fe(!1,"not implemented yet","NOT_IMPLEMENTED",{operation:"waitForBlock"})}_clearTimeout(e){const n=F(this,$r).get(e);n&&(n.timer&&clearTimeout(n.timer),F(this,$r).delete(e))}_setTimeout(e,n){n==null&&(n=0);const r=Hd(this,Ud)._++,i=()=>{F(this,$r).delete(r),e()};if(this.paused)F(this,$r).set(r,{timer:null,func:i,time:n});else{const o=setTimeout(i,n);F(this,$r).set(r,{timer:o,func:i,time:by()})}return r}_forEachSubscriber(e){for(const n of F(this,Mn).values())e(n.subscriber)}_getSubscriber(e){switch(e.type){case"debug":case"error":case"network":return new tC(e.type);case"block":{const n=new PH(this);return n.pollingInterval=this.pollingInterval,n}case"safe":case"finalized":return new NH(this,e.type);case"event":return new gy(this,e.filter);case"transaction":return new RH(this,e.hash);case"orphan":return new BH(this,e.filter)}throw new Error(`unsupported event: ${e.type}`)}_recoverSubscriber(e,n){for(const r of F(this,Mn).values())if(r.subscriber===e){r.started&&r.subscriber.stop(),r.subscriber=n,r.started&&n.start(),F(this,Ln)!=null&&n.pause(F(this,Ln));break}}async on(e,n){const r=await be(this,He,lg).call(this,e);return r.listeners.push({listener:n,once:!1}),r.started||(r.subscriber.start(),r.started=!0,F(this,Ln)!=null&&r.subscriber.pause(F(this,Ln))),this}async once(e,n){const r=await be(this,He,lg).call(this,e);return r.listeners.push({listener:n,once:!0}),r.started||(r.subscriber.start(),r.started=!0,F(this,Ln)!=null&&r.subscriber.pause(F(this,Ln))),this}async emit(e,...n){const r=await be(this,He,jd).call(this,e,n);if(!r||r.listeners.length===0)return!1;const i=r.listeners.length;return r.listeners=r.listeners.filter(({listener:o,once:s})=>{const a=new gS(this,s?null:o,e);try{o.call(this,...n,a)}catch(l){}return!s}),r.listeners.length===0&&(r.started&&r.subscriber.stop(),F(this,Mn).delete(r.tag)),i>0}async listenerCount(e){if(e){const r=await be(this,He,jd).call(this,e);return r?r.listeners.length:0}let n=0;for(const{listeners:r}of F(this,Mn).values())n+=r.length;return n}async listeners(e){if(e){const r=await be(this,He,jd).call(this,e);return r?r.listeners.map(({listener:i})=>i):[]}let n=[];for(const{listeners:r}of F(this,Mn).values())n=n.concat(r.map(({listener:i})=>i));return n}async off(e,n){const r=await be(this,He,jd).call(this,e);if(!r)return this;if(n){const i=r.listeners.map(({listener:o})=>o).indexOf(n);i>=0&&r.listeners.splice(i,1)}return(!n||r.listeners.length===0)&&(r.started&&r.subscriber.stop(),F(this,Mn).delete(r.tag)),this}async removeAllListeners(e){if(e){const{tag:n,started:r,subscriber:i}=await be(this,He,lg).call(this,e);r&&i.stop(),F(this,Mn).delete(n)}else for(const[n,{started:r,subscriber:i}]of F(this,Mn))r&&i.stop(),F(this,Mn).delete(n);return this}async addListener(e,n){return await this.on(e,n)}async removeListener(e,n){return this.off(e,n)}get destroyed(){return F(this,Yc)}destroy(){this.removeAllListeners();for(const e of F(this,$r).keys())this._clearTimeout(e);K(this,Yc,!0)}get paused(){return F(this,Ln)!=null}set paused(e){!!e!==this.paused&&(this.paused?this.resume():this.pause(!1))}pause(e){if(K(this,Vo,-1),F(this,Ln)!=null){if(F(this,Ln)==!!e)return;fe(!1,"cannot change pause type; resume first","UNSUPPORTED_OPERATION",{operation:"pause"})}this._forEachSubscriber(n=>n.pause(e)),K(this,Ln,!!e);for(const n of F(this,$r).values())n.timer&&clearTimeout(n.timer),n.time=by()-n.time}resume(){if(F(this,Ln)!=null){this._forEachSubscriber(e=>e.resume()),K(this,Ln,null);for(const e of F(this,$r).values()){let n=e.time;n<0&&(n=0),e.time=by(),setTimeout(e.func,n)}}}}Mn=new WeakMap,Ms=new WeakMap,Ln=new WeakMap,Yc=new WeakMap,kr=new WeakMap,Xa=new WeakMap,Ls=new WeakMap,Vo=new WeakMap,Ud=new WeakMap,$r=new WeakMap,Qc=new WeakMap,Xc=new WeakMap,He=new WeakSet,Cr=async function(e){const n=F(this,Xc).cacheTimeout;if(n<0)return await this._perform(e);const r=dp(e.method,e);let i=F(this,Ls).get(r);return i||(i=this._perform(e),F(this,Ls).set(r,i),setTimeout(()=>{F(this,Ls).get(r)===i&&F(this,Ls).delete(r)},n)),await i},jb=async function(e,n,r){fe(r<LH,"CCIP read exceeded maximum redirections","OFFCHAIN_FAULT",{reason:"TOO_MANY_REDIRECTS",transaction:Object.assign({},e,{blockTag:n,enableCcipRead:!0})});const i=rp(e);try{return ve(await this._perform({method:"call",transaction:i,blockTag:n}))}catch(o){if(!this.disableCcipRead&&mm(o)&&o.data&&r>=0&&n==="latest"&&i.to!=null&&Et(o.data,0,4)==="0x556f1830"){const s=o.data,a=await Un(i.to,this);let l;try{l=HH(Et(o.data,4))}catch(d){fe(!1,d.message,"OFFCHAIN_FAULT",{reason:"BAD_DATA",transaction:i,info:{data:s}})}fe(l.sender.toLowerCase()===a.toLowerCase(),"CCIP Read sender mismatch","CALL_EXCEPTION",{action:"call",data:s,reason:"OffchainLookup",transaction:i,invocation:null,revert:{signature:"OffchainLookup(address,string[],bytes,bytes4,bytes)",name:"OffchainLookup",args:l.errorArgs}});const c=await this.ccipReadFetch(i,l.calldata,l.urls);fe(c!=null,"CCIP Read failed to fetch data","OFFCHAIN_FAULT",{reason:"FETCH_FAILED",transaction:i,info:{data:o.data,errorArgs:l.errorArgs}});const u={to:a,data:xt([l.selector,$H([c,l.extraData])])};this.emit("debug",{action:"sendCcipReadCall",transaction:u});try{const d=await be(this,He,jb).call(this,u,n,r+1);return this.emit("debug",{action:"receiveCcipReadCallResult",transaction:Object.assign({},u),result:d}),d}catch(d){throw this.emit("debug",{action:"receiveCcipReadCallError",transaction:Object.assign({},u),error:d}),d}}throw o}},Kb=async function(e){const{value:n}=await Vn({network:this.getNetwork(),value:e});return n},Gd=async function(e,n,r){let i=this._getAddress(n),o=this._getBlockTag(r);return(typeof i!="string"||typeof o!="string")&&([i,o]=await Promise.all([i,o])),await be(this,He,Kb).call(this,be(this,He,Cr).call(this,Object.assign(e,{address:i,blockTag:o})))},qb=async function(e,n){if(pt(e,32))return await be(this,He,Cr).call(this,{method:"getBlock",blockHash:e,includeTransactions:n});let r=this._getBlockTag(e);return typeof r!="string"&&(r=await r),await be(this,He,Cr).call(this,{method:"getBlock",blockTag:r,includeTransactions:n})},jd=async function(e,n){let r=await yy(e,this);return r.type==="event"&&n&&n.length>0&&n[0].removed===!0&&(r=await yy({orphan:"drop-log",log:n[0]},this)),F(this,Mn).get(r.tag)||null},lg=async function(e){const n=await yy(e,this),r=n.tag;let i=F(this,Mn).get(r);return i||(i={subscriber:this._getSubscriber(n),tag:r,addressableMap:new WeakMap,nameMap:new Map,started:!1,listeners:[]},F(this,Mn).set(r,i)),i};function DH(t,e){try{const n=vy(t,e);if(n)return Bh(n)}catch(n){}return null}function vy(t,e){if(t==="0x")return null;try{const n=$e(Et(t,e,e+32)),r=$e(Et(t,n,n+32));return Et(t,n+32,n+32+r)}catch(n){}return null}function nC(t){const e=nn(t);if(e.length>32)throw new Error("internal; should not happen");const n=new Uint8Array(32);return n.set(e,32-e.length),n}function zH(t){if(t.length%32===0)return t;const e=new Uint8Array(Math.ceil(t.length/32)*32);return e.set(t),e}const UH=new Uint8Array([]);function $H(t){const e=[];let n=0;for(let r=0;r<t.length;r++)e.push(UH),n+=32;for(let r=0;r<t.length;r++){const i=Ue(t[r]);e[r]=nC(n),e.push(nC(i.length)),e.push(zH(i)),n+=32+Math.ceil(i.length/32)*32}return xt(e)}const rC="0x0000000000000000000000000000000000000000000000000000000000000000";function HH(t){const e={sender:"",urls:[],calldata:"",selector:"",extraData:"",errorArgs:[]};fe(Vl(t)>=160,"insufficient OffchainLookup data","OFFCHAIN_FAULT",{reason:"insufficient OffchainLookup data"});const n=Et(t,0,32);fe(Et(n,0,12)===Et(rC,0,12),"corrupt OffchainLookup sender","OFFCHAIN_FAULT",{reason:"corrupt OffchainLookup sender"}),e.sender=Et(n,12);try{const r=[],i=$e(Et(t,32,64)),o=$e(Et(t,i,i+32)),s=Et(t,i+32);for(let a=0;a<o;a++){const l=DH(s,a*32);if(l==null)throw new Error("abort");r.push(l)}e.urls=r}catch(r){fe(!1,"corrupt OffchainLookup urls","OFFCHAIN_FAULT",{reason:"corrupt OffchainLookup urls"})}try{const r=vy(t,64);if(r==null)throw new Error("abort");e.calldata=r}catch(r){fe(!1,"corrupt OffchainLookup calldata","OFFCHAIN_FAULT",{reason:"corrupt OffchainLookup calldata"})}fe(Et(t,100,128)===Et(rC,0,28),"corrupt OffchainLookup callbaackSelector","OFFCHAIN_FAULT",{reason:"corrupt OffchainLookup callbaackSelector"}),e.selector=Et(t,96,100);try{const r=vy(t,128);if(r==null)throw new Error("abort");e.extraData=r}catch(r){fe(!1,"corrupt OffchainLookup extraData","OFFCHAIN_FAULT",{reason:"corrupt OffchainLookup extraData"})}return e.errorArgs="sender,urls,calldata,selector,extraData".split(/,/).map(r=>e[r]),e}function wa(t,e){if(t.provider)return t.provider;fe(!1,"missing provider","UNSUPPORTED_OPERATION",{operation:e})}async function iC(t,e){let n=rp(e);if(n.to!=null&&(n.to=Un(n.to,t)),n.from!=null){const r=n.from;n.from=Promise.all([t.getAddress(),Un(r,t)]).then(([i,o])=>(ne(i.toLowerCase()===o.toLowerCase(),"transaction from mismatch","tx.from",o),i))}else n.from=t.getAddress();return await Vn(n)}class WH{constructor(e){oe(this,"provider");Te(this,{provider:e||null})}async getNonce(e){return wa(this,"getTransactionCount").getTransactionCount(await this.getAddress(),e)}async populateCall(e){return await iC(this,e)}async populateTransaction(e){const n=wa(this,"populateTransaction"),r=await iC(this,e);r.nonce==null&&(r.nonce=await this.getNonce("pending")),r.gasLimit==null&&(r.gasLimit=await this.estimateGas(r));const i=await this.provider.getNetwork();if(r.chainId!=null){const s=Se(r.chainId);ne(s===i.chainId,"transaction chainId mismatch","tx.chainId",e.chainId)}else r.chainId=i.chainId;const o=r.maxFeePerGas!=null||r.maxPriorityFeePerGas!=null;if(r.gasPrice!=null&&(r.type===2||o)?ne(!1,"eip-1559 transaction do not support gasPrice","tx",e):(r.type===0||r.type===1)&&o&&ne(!1,"pre-eip-1559 transaction do not support maxFeePerGas/maxPriorityFeePerGas","tx",e),(r.type===2||r.type==null)&&r.maxFeePerGas!=null&&r.maxPriorityFeePerGas!=null)r.type=2;else if(r.type===0||r.type===1){const s=await n.getFeeData();fe(s.gasPrice!=null,"network does not support gasPrice","UNSUPPORTED_OPERATION",{operation:"getGasPrice"}),r.gasPrice==null&&(r.gasPrice=s.gasPrice)}else{const s=await n.getFeeData();if(r.type==null)if(s.maxFeePerGas!=null&&s.maxPriorityFeePerGas!=null)if(r.authorizationList&&r.authorizationList.length?r.type=4:r.type=2,r.gasPrice!=null){const a=r.gasPrice;delete r.gasPrice,r.maxFeePerGas=a,r.maxPriorityFeePerGas=a}else r.maxFeePerGas==null&&(r.maxFeePerGas=s.maxFeePerGas),r.maxPriorityFeePerGas==null&&(r.maxPriorityFeePerGas=s.maxPriorityFeePerGas);else s.gasPrice!=null?(fe(!o,"network does not support EIP-1559","UNSUPPORTED_OPERATION",{operation:"populateTransaction"}),r.gasPrice==null&&(r.gasPrice=s.gasPrice),r.type=0):fe(!1,"failed to get consistent fee data","UNSUPPORTED_OPERATION",{operation:"signer.getFeeData"});else(r.type===2||r.type===3||r.type===4)&&(r.maxFeePerGas==null&&(r.maxFeePerGas=s.maxFeePerGas),r.maxPriorityFeePerGas==null&&(r.maxPriorityFeePerGas=s.maxPriorityFeePerGas))}return await Vn(r)}async populateAuthorization(e){const n=Object.assign({},e);return n.chainId==null&&(n.chainId=(await wa(this,"getNetwork").getNetwork()).chainId),n.nonce==null&&(n.nonce=await this.getNonce()),n}async estimateGas(e){return wa(this,"estimateGas").estimateGas(await this.populateCall(e))}async call(e){return wa(this,"call").call(await this.populateCall(e))}async resolveName(e){return await wa(this,"resolveName").resolveName(e)}async sendTransaction(e){const n=wa(this,"sendTransaction"),r=await this.populateTransaction(e);delete r.from;const i=BA.from(r);return await n.broadcastTransaction(await this.signTransaction(i))}authorize(e){fe(!1,"authorization not implemented for this signer","UNSUPPORTED_OPERATION",{operation:"authorize"})}}function GH(t){return JSON.parse(JSON.stringify(t))}class oC{constructor(e){ce(this,_s);ce(this,Kn);ce(this,Wi);ce(this,Ja);ce(this,Fs);ce(this,Za);ce(this,Jc);K(this,Kn,e),K(this,Wi,null),K(this,Ja,be(this,_s,Yb).bind(this)),K(this,Fs,!1),K(this,Za,null),K(this,Jc,!1)}_subscribe(e){throw new Error("subclasses must override this")}_emitResults(e,n){throw new Error("subclasses must override this")}_recover(e){throw new Error("subclasses must override this")}start(){F(this,Fs)||(K(this,Fs,!0),be(this,_s,Yb).call(this,-2))}stop(){F(this,Fs)&&(K(this,Fs,!1),K(this,Jc,!0),be(this,_s,Qb).call(this),F(this,Kn).off("block",F(this,Ja)))}pause(e){e&&be(this,_s,Qb).call(this),F(this,Kn).off("block",F(this,Ja))}resume(){this.start()}}Kn=new WeakMap,Wi=new WeakMap,Ja=new WeakMap,Fs=new WeakMap,Za=new WeakMap,Jc=new WeakMap,_s=new WeakSet,Yb=async function(e){try{F(this,Wi)==null&&K(this,Wi,this._subscribe(F(this,Kn)));let n=null;try{n=await F(this,Wi)}catch(o){if(!bn(o,"UNSUPPORTED_OPERATION")||o.operation!=="eth_newFilter")throw o}if(n==null){K(this,Wi,null),F(this,Kn)._recoverSubscriber(this,this._recover(F(this,Kn)));return}const r=await F(this,Kn).getNetwork();if(F(this,Za)||K(this,Za,r),F(this,Za).chainId!==r.chainId)throw new Error("chaid changed");if(F(this,Jc))return;const i=await F(this,Kn).send("eth_getFilterChanges",[n]);await this._emitResults(F(this,Kn),i)}catch(n){console.log("@TODO",n)}F(this,Kn).once("block",F(this,Ja))},Qb=function(){const e=F(this,Wi);e&&(K(this,Wi,null),e.then(n=>{F(this,Kn).destroyed||F(this,Kn).send("eth_uninstallFilter",[n])}))};class jH extends oC{constructor(n,r){super(n);ce(this,el);K(this,el,GH(r))}_recover(n){return new gy(n,F(this,el))}async _subscribe(n){return await n.send("eth_newFilter",[F(this,el)])}async _emitResults(n,r){for(const i of r)n.emit(F(this,el),n._wrapLog(i,n._network))}}el=new WeakMap;class KH extends oC{async _subscribe(e){return await e.send("eth_newPendingTransactionFilter",[])}async _emitResults(e,n){for(const r of n)e.emit("pending",r)}}const qH="bigint,boolean,function,number,string,symbol".split(/,/g);function fp(t){if(t==null||qH.indexOf(typeof t)>=0||typeof t.getAddress=="function")return t;if(Array.isArray(t))return t.map(fp);if(typeof t=="object")return Object.keys(t).reduce((e,n)=>(e[n]=t[n],e),{});throw new Error(`should not happen: ${t} (${typeof t})`)}function YH(t){return new Promise(e=>{setTimeout(e,t)})}function ec(t){return t&&t.toLowerCase()}function sC(t){return t&&typeof t.pollingInterval=="number"}const aC={polling:!1,staticNetwork:null,batchStallTime:10,batchMaxSize:1<<20,batchMaxCount:100,cacheTimeout:250,pollingInterval:4e3};class wy extends WH{constructor(n,r){super(n);oe(this,"address");r=rt(r),Te(this,{address:r})}connect(n){fe(!1,"cannot reconnect JsonRpcSigner","UNSUPPORTED_OPERATION",{operation:"signer.connect"})}async getAddress(){return this.address}async populateTransaction(n){return await this.populateCall(n)}async sendUncheckedTransaction(n){const r=fp(n),i=[];if(r.from){const s=r.from;i.push((async()=>{const a=await Un(s,this.provider);ne(a!=null&&a.toLowerCase()===this.address.toLowerCase(),"from address mismatch","transaction",n),r.from=a})())}else r.from=this.address;if(r.gasLimit==null&&i.push((async()=>{r.gasLimit=await this.provider.estimateGas({...r,from:this.address})})()),r.to!=null){const s=r.to;i.push((async()=>{r.to=await Un(s,this.provider)})())}i.length&&await Promise.all(i);const o=this.provider.getRpcTransaction(r);return this.provider.send("eth_sendTransaction",[o])}async sendTransaction(n){const r=await this.provider.getBlockNumber(),i=await this.sendUncheckedTransaction(n);return await new Promise((o,s)=>{const a=[1e3,100];let l=0;const c=async()=>{try{const u=await this.provider.getTransaction(i);if(u!=null){o(u.replaceableTransaction(r));return}}catch(u){if(bn(u,"CANCELLED")||bn(u,"BAD_DATA")||bn(u,"NETWORK_ERROR")||bn(u,"UNSUPPORTED_OPERATION")){u.info==null&&(u.info={}),u.info.sendTransactionHash=i,s(u);return}if(bn(u,"INVALID_ARGUMENT")&&(l++,u.info==null&&(u.info={}),u.info.sendTransactionHash=i,l>10)){s(u);return}this.provider.emit("error",bt("failed to fetch transation after sending (will try again)","UNKNOWN_ERROR",{error:u}))}this.provider._setTimeout(()=>{c()},a.pop()||4e3)};c()})}async signTransaction(n){const r=fp(n);if(r.from){const o=await Un(r.from,this.provider);ne(o!=null&&o.toLowerCase()===this.address.toLowerCase(),"from address mismatch","transaction",n),r.from=o}else r.from=this.address;const i=this.provider.getRpcTransaction(r);return await this.provider.send("eth_signTransaction",[i])}async signMessage(n){const r=typeof n=="string"?Oi(n):n;return await this.provider.send("personal_sign",[ve(r),this.address.toLowerCase()])}async signTypedData(n,r,i){const o=fp(i),s=await ep.resolveNames(n,r,o,async a=>{const l=await Un(a);return ne(l!=null,"TypedData does not support null address","value",a),l});return await this.provider.send("eth_signTypedData_v4",[this.address.toLowerCase(),JSON.stringify(ep.getPayload(s.domain,r,s.value))])}async unlock(n){return this.provider.send("personal_unlockAccount",[this.address.toLowerCase(),n,null])}async _legacySignMessage(n){const r=typeof n=="string"?Oi(n):n;return await this.provider.send("eth_sign",[this.address.toLowerCase(),ve(r)])}}class QH extends VH{constructor(n,r){super(n,r);ce(this,$d);ce(this,tl);ce(this,Zc);ce(this,Do);ce(this,Gi);ce(this,fi);ce(this,Hr);ce(this,ar);K(this,Zc,1),K(this,tl,Object.assign({},aC,r||{})),K(this,Do,[]),K(this,Gi,null),K(this,Hr,null),K(this,ar,null);{let o=null;const s=new Promise(a=>{o=a});K(this,fi,{promise:s,resolve:o})}const i=this._getOption("staticNetwork");typeof i=="boolean"?(ne(!i||n!=="any","staticNetwork cannot be used on special network 'any'","options",r),i&&n!=null&&K(this,Hr,Bi.from(n))):i&&(ne(n==null||i.matches(n),"staticNetwork MUST match network object","options",r),K(this,Hr,i))}_getOption(n){return F(this,tl)[n]}get _network(){return fe(F(this,Hr),"network is not available yet","NETWORK_ERROR"),F(this,Hr)}async _perform(n){if(n.method==="call"||n.method==="estimateGas"){let i=n.transaction;if(i&&i.type!=null&&Se(i.type)&&i.maxFeePerGas==null&&i.maxPriorityFeePerGas==null){const o=await this.getFeeData();o.maxFeePerGas==null&&o.maxPriorityFeePerGas==null&&(n=Object.assign({},n,{transaction:Object.assign({},i,{type:void 0})}))}}const r=this.getRpcRequest(n);return r!=null?await this.send(r.method,r.args):super._perform(n)}async _detectNetwork(){const n=this._getOption("staticNetwork");if(n)if(n===!0){if(F(this,Hr))return F(this,Hr)}else return n;return F(this,ar)?await F(this,ar):this.ready?(K(this,ar,(async()=>{try{const r=Bi.from(Se(await this.send("eth_chainId",[])));return K(this,ar,null),r}catch(r){throw K(this,ar,null),r}})()),await F(this,ar)):(K(this,ar,(async()=>{const r={id:Hd(this,Zc)._++,method:"eth_chainId",params:[],jsonrpc:"2.0"};this.emit("debug",{action:"sendRpcPayload",payload:r});let i;try{i=(await this._send(r))[0],K(this,ar,null)}catch(o){throw K(this,ar,null),this.emit("debug",{action:"receiveRpcError",error:o}),o}if(this.emit("debug",{action:"receiveRpcResult",result:i}),"result"in i)return Bi.from(Se(i.result));throw this.getRpcError(r,i)})()),await F(this,ar))}_start(){F(this,fi)==null||F(this,fi).resolve==null||(F(this,fi).resolve(),K(this,fi,null),(async()=>{for(;F(this,Hr)==null&&!this.destroyed;)try{K(this,Hr,await this._detectNetwork())}catch(n){if(this.destroyed)break;console.log("JsonRpcProvider failed to detect network and cannot start up; retry in 1s (perhaps the URL is wrong or the node is not started)"),this.emit("error",bt("failed to bootstrap network detection","NETWORK_ERROR",{event:"initial-network-discovery",info:{error:n}})),await YH(1e3)}be(this,$d,Xb).call(this)})())}async _waitUntilReady(){if(F(this,fi)!=null)return await F(this,fi).promise}_getSubscriber(n){return n.type==="pending"?new KH(this):n.type==="event"?this._getOption("polling")?new gy(this,n.filter):new jH(this,n.filter):n.type==="orphan"&&n.filter.orphan==="drop-log"?new tC("orphan"):super._getSubscriber(n)}get ready(){return F(this,fi)==null}getRpcTransaction(n){const r={};return["chainId","gasLimit","gasPrice","type","maxFeePerGas","maxPriorityFeePerGas","nonce","value"].forEach(i=>{if(n[i]==null)return;let o=i;i==="gasLimit"&&(o="gas"),r[o]=ei(Se(n[i],`tx.${i}`))}),["from","to","data"].forEach(i=>{n[i]!=null&&(r[i]=ve(n[i]))}),n.accessList&&(r.accessList=ca(n.accessList)),n.blobVersionedHashes&&(r.blobVersionedHashes=n.blobVersionedHashes.map(i=>i.toLowerCase())),n.authorizationList&&(r.authorizationList=n.authorizationList.map(i=>{const o=PA(i);return{address:o.address,nonce:ei(o.nonce),chainId:ei(o.chainId),yParity:ei(o.signature.yParity),r:ei(o.signature.r),s:ei(o.signature.s)}})),r}getRpcRequest(n){switch(n.method){case"chainId":return{method:"eth_chainId",args:[]};case"getBlockNumber":return{method:"eth_blockNumber",args:[]};case"getGasPrice":return{method:"eth_gasPrice",args:[]};case"getPriorityFee":return{method:"eth_maxPriorityFeePerGas",args:[]};case"getBalance":return{method:"eth_getBalance",args:[ec(n.address),n.blockTag]};case"getTransactionCount":return{method:"eth_getTransactionCount",args:[ec(n.address),n.blockTag]};case"getCode":return{method:"eth_getCode",args:[ec(n.address),n.blockTag]};case"getStorage":return{method:"eth_getStorageAt",args:[ec(n.address),"0x"+n.position.toString(16),n.blockTag]};case"broadcastTransaction":return{method:"eth_sendRawTransaction",args:[n.signedTransaction]};case"getBlock":if("blockTag"in n)return{method:"eth_getBlockByNumber",args:[n.blockTag,!!n.includeTransactions]};if("blockHash"in n)return{method:"eth_getBlockByHash",args:[n.blockHash,!!n.includeTransactions]};break;case"getTransaction":return{method:"eth_getTransactionByHash",args:[n.hash]};case"getTransactionReceipt":return{method:"eth_getTransactionReceipt",args:[n.hash]};case"call":return{method:"eth_call",args:[this.getRpcTransaction(n.transaction),n.blockTag]};case"estimateGas":return{method:"eth_estimateGas",args:[this.getRpcTransaction(n.transaction)]};case"getLogs":return n.filter&&n.filter.address!=null&&(Array.isArray(n.filter.address)?n.filter.address=n.filter.address.map(ec):n.filter.address=ec(n.filter.address)),{method:"eth_getLogs",args:[n.filter]}}return null}getRpcError(n,r){const{method:i}=n,{error:o}=r;if(i==="eth_estimateGas"&&o.message){const l=o.message;if(!l.match(/revert/i)&&l.match(/insufficient funds/i))return bt("insufficient funds","INSUFFICIENT_FUNDS",{transaction:n.params[0],info:{payload:n,error:o}});if(l.match(/nonce/i)&&l.match(/too low/i))return bt("nonce has already been used","NONCE_EXPIRED",{transaction:n.params[0],info:{payload:n,error:o}})}if(i==="eth_call"||i==="eth_estimateGas"){const l=xy(o),c=ld.getBuiltinCallException(i==="eth_call"?"call":"estimateGas",n.params[0],l?l.data:null);return c.info={error:o,payload:n},c}const s=JSON.stringify(JH(o));if(typeof o.message=="string"&&o.message.match(/user denied|ethers-user-denied/i))return bt("user rejected action","ACTION_REJECTED",{action:{eth_sign:"signMessage",personal_sign:"signMessage",eth_signTypedData_v4:"signTypedData",eth_signTransaction:"signTransaction",eth_sendTransaction:"sendTransaction",eth_requestAccounts:"requestAccess",wallet_requestAccounts:"requestAccess"}[i]||"unknown",reason:"rejected",info:{payload:n,error:o}});if(i==="eth_sendRawTransaction"||i==="eth_sendTransaction"){const l=n.params[0];if(s.match(/insufficient funds|base fee exceeds gas limit/i))return bt("insufficient funds for intrinsic transaction cost","INSUFFICIENT_FUNDS",{transaction:l,info:{error:o}});if(s.match(/nonce/i)&&s.match(/too low/i))return bt("nonce has already been used","NONCE_EXPIRED",{transaction:l,info:{error:o}});if(s.match(/replacement transaction/i)&&s.match(/underpriced/i))return bt("replacement fee too low","REPLACEMENT_UNDERPRICED",{transaction:l,info:{error:o}});if(s.match(/only replay-protected/i))return bt("legacy pre-eip-155 transactions not supported","UNSUPPORTED_OPERATION",{operation:i,info:{transaction:l,info:{error:o}}})}let a=!!s.match(/the method .* does not exist/i);return a||o&&o.details&&o.details.startsWith("Unauthorized method:")&&(a=!0),a?bt("unsupported operation","UNSUPPORTED_OPERATION",{operation:n.method,info:{error:o,payload:n}}):bt("could not coalesce error","UNKNOWN_ERROR",{error:o,payload:n})}send(n,r){if(this.destroyed)return Promise.reject(bt("provider destroyed; cancelled request","UNSUPPORTED_OPERATION",{operation:n}));const i=Hd(this,Zc)._++,o=new Promise((s,a)=>{F(this,Do).push({resolve:s,reject:a,payload:{method:n,params:r,id:i,jsonrpc:"2.0"}})});return be(this,$d,Xb).call(this),o}async getSigner(n){n==null&&(n=0);const r=this.send("eth_accounts",[]);if(typeof n=="number"){const o=await r;if(n>=o.length)throw new Error("no such account");return new wy(this,o[n])}const{accounts:i}=await Vn({network:this.getNetwork(),accounts:r});n=rt(n);for(const o of i)if(rt(o)===n)return new wy(this,n);throw new Error("invalid account")}async listAccounts(){return(await this.send("eth_accounts",[])).map(r=>new wy(this,r))}destroy(){F(this,Gi)&&(clearTimeout(F(this,Gi)),K(this,Gi,null));for(const{payload:n,reject:r}of F(this,Do))r(bt("provider destroyed; cancelled request","UNSUPPORTED_OPERATION",{operation:n.method}));K(this,Do,[]),super.destroy()}}tl=new WeakMap,Zc=new WeakMap,Do=new WeakMap,Gi=new WeakMap,fi=new WeakMap,Hr=new WeakMap,ar=new WeakMap,$d=new WeakSet,Xb=function(){if(F(this,Gi))return;const n=this._getOption("batchMaxCount")===1?0:this._getOption("batchStallTime");K(this,Gi,setTimeout(()=>{K(this,Gi,null);const r=F(this,Do);for(K(this,Do,[]);r.length;){const i=[r.shift()];for(;r.length&&i.length!==F(this,tl).batchMaxCount;)if(i.push(r.shift()),JSON.stringify(i.map(s=>s.payload)).length>F(this,tl).batchMaxSize){r.unshift(i.pop());break}(async()=>{const o=i.length===1?i[0].payload:i.map(s=>s.payload);this.emit("debug",{action:"sendRpcPayload",payload:o});try{const s=await this._send(o);this.emit("debug",{action:"receiveRpcResult",result:s});for(const{resolve:a,reject:l,payload:c}of i){if(this.destroyed){l(bt("provider destroyed; cancelled request","UNSUPPORTED_OPERATION",{operation:c.method}));continue}const u=s.filter(d=>d.id===c.id)[0];if(u==null){const d=bt("missing response for request","BAD_DATA",{value:s,info:{payload:c}});this.emit("error",d),l(d);continue}if("error"in u){l(this.getRpcError(c,u));continue}a(u.result)}}catch(s){this.emit("debug",{action:"receiveRpcError",error:s});for(const{reject:a}of i)a(s)}})()}},n))};class XH extends QH{constructor(n,r){super(n,r);ce(this,Vs);let i=this._getOption("pollingInterval");i==null&&(i=aC.pollingInterval),K(this,Vs,i)}_getSubscriber(n){const r=super._getSubscriber(n);return sC(r)&&(r.pollingInterval=F(this,Vs)),r}get pollingInterval(){return F(this,Vs)}set pollingInterval(n){if(!Number.isInteger(n)||n<0)throw new Error("invalid interval");K(this,Vs,n),this._forEachSubscriber(r=>{sC(r)&&(r.pollingInterval=F(this,Vs))})}}Vs=new WeakMap;function xy(t){if(t==null)return null;if(typeof t.message=="string"&&t.message.match(/revert/i)&&pt(t.data))return{message:t.message,data:t.data};if(typeof t=="object"){for(const e in t){const n=xy(t[e]);if(n)return n}return null}if(typeof t=="string")try{return xy(JSON.parse(t))}catch(e){}return null}function Ey(t,e){if(t!=null){if(typeof t.message=="string"&&e.push(t.message),typeof t=="object")for(const n in t)Ey(t[n],e);if(typeof t=="string")try{return Ey(JSON.parse(t),e)}catch(n){}}}function JH(t){const e=[];return Ey(t,e),e}const nl=class nl extends XH{constructor(n,r,i){const o=Object.assign({},i!=null?i:{},{batchMaxCount:1});ne(n&&n.request,"invalid EIP-1193 provider","ethereum",n);super(r,o);ce(this,eu);ce(this,tu);K(this,tu,null),i&&i.providerInfo&&K(this,tu,i.providerInfo),K(this,eu,async(s,a)=>{const l={method:s,params:a};this.emit("debug",{action:"sendEip1193Request",payload:l});try{const c=await n.request(l);return this.emit("debug",{action:"receiveEip1193Result",result:c}),c}catch(c){const u=new Error(c.message);throw u.code=c.code,u.data=c.data,u.payload=l,this.emit("debug",{action:"receiveEip1193Error",error:u}),u}})}get providerInfo(){return F(this,tu)}async send(n,r){return await this._start(),await super.send(n,r)}async _send(n){ne(!Array.isArray(n),"EIP-1193 does not support batch request","payload",n);try{const r=await F(this,eu).call(this,n.method,n.params||[]);return[{id:n.id,result:r}]}catch(r){return[{id:n.id,error:{code:r.code,data:r.data,message:r.message}}]}}getRpcError(n,r){switch(r=JSON.parse(JSON.stringify(r)),r.error.code||-1){case 4001:r.error.message=`ethers-user-denied: ${r.error.message}`;break;case 4200:r.error.message=`ethers-unsupported: ${r.error.message}`;break}return super.getRpcError(n,r)}async hasSigner(n){n==null&&(n=0);const r=await this.send("eth_accounts",[]);return typeof n=="number"?r.length>n:(n=n.toLowerCase(),r.filter(i=>i.toLowerCase()===n).length!==0)}async getSigner(n){if(n==null&&(n=0),!await this.hasSigner(n))try{await F(this,eu).call(this,"eth_requestAccounts",[])}catch(r){const i=r.payload;throw this.getRpcError(i,{id:i.id,error:r})}return await super.getSigner(n)}static async discover(n){if(n==null&&(n={}),n.provider)return new nl(n.provider);const r=n.window?n.window:typeof window!="undefined"?window:null;if(r==null)return null;const i=n.anyProvider;if(i&&r.ethereum)return new nl(r.ethereum);if(!("addEventListener"in r&&"dispatchEvent"in r&&"removeEventListener"in r))return null;const o=n.timeout?n.timeout:300;return o===0?null:await new Promise((s,a)=>{let l=[];const c=h=>{l.push(h.detail),i&&u()},u=()=>{if(clearTimeout(d),l.length)if(n&&n.filter){const h=n.filter(l.map(g=>Object.assign({},g.info)));if(h==null)s(null);else if(h instanceof nl)s(h);else{let g=null;if(h.uuid&&(g=l.filter(p=>h.uuid===p.info.uuid)[0]),g){const{provider:b,info:p}=g;s(new nl(b,void 0,{providerInfo:p}))}else a(bt("filter returned unknown info","UNSUPPORTED_OPERATION",{value:h}))}}else{const{provider:h,info:g}=l[0];s(new nl(h,void 0,{providerInfo:g}))}else s(null);r.removeEventListener("eip6963:announceProvider",c)},d=setTimeout(()=>{u()},o);r.addEventListener("eip6963:announceProvider",c),r.dispatchEvent(new Event("eip6963:requestProvider"))})}};eu=new WeakMap,tu=new WeakMap;let xo=nl;var Sy=null,Ay=null,ZH=function(t,e){Sy=t,Ay=e},eW=function(){return Sy},fs=function(){return Ay},tW=function(){Sy=null,Ay=null},nW={43114:{name:"Avalanche",nativeCurrency:{decimals:18,name:"Avalanche",symbol:"AVAX"},rpcUrls:{default:{http:["https://avalanche-mainnet.infura.io"]}},blockExplorers:{default:{name:"SnowTrace",url:"https://snowtrace.io"}}},42161:{name:"Arbitrum One",nativeCurrency:{decimals:18,name:"Ether",symbol:"ETH"},rpcUrls:{default:{http:["https://arb1.arbitrum.io/rpc"]}},blockExplorers:{default:{name:"Arbiscan",url:"https://arbiscan.io"}}},10:{name:"OP Mainnet",nativeCurrency:{decimals:18,name:"Ether",symbol:"ETH"},rpcUrls:{default:{http:["https://mainnet.optimism.io"]}},blockExplorers:{default:{name:"Optimism Explorer",url:"https://optimistic.etherscan.io"}}},8453:{name:"Base",nativeCurrency:{decimals:18,name:"Ether",symbol:"ETH"},rpcUrls:{default:{http:["https://mainnet.base.org"]}},blockExplorers:{default:{name:"Basescan",url:"https://basescan.org"}}},137:{name:"Polygon",nativeCurrency:{decimals:18,name:"MATIC",symbol:"MATIC"},rpcUrls:{default:{http:["https://polygon-rpc.com"]}},blockExplorers:{default:{name:"PolygonScan",url:"https://polygonscan.com"}}},56:{name:"BNB Smart Chain",nativeCurrency:{decimals:18,name:"BNB",symbol:"BNB"},rpcUrls:{default:{http:["https://rpc.ankr.com/bsc"]}},blockExplorers:{default:{name:"BscScan",url:"https://bscscan.com"}}}},rW=function(t){return nW[t]},gd=function(t,e,n,r){function i(o){return o instanceof n?o:new n(function(s){s(o)})}return new(n||(n=Promise))(function(o,s){function a(u){try{c(r.next(u))}catch(d){s(d)}}function l(u){try{c(r.throw(u))}catch(d){s(d)}}function c(u){u.done?o(u.value):i(u.value).then(a,l)}c((r=r.apply(t,e||[])).next())})},md=function(t,e){var n={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},r,i,o,s=Object.create((typeof Iterator=="function"?Iterator:Object).prototype);return s.next=a(0),s.throw=a(1),s.return=a(2),typeof Symbol=="function"&&(s[Symbol.iterator]=function(){return this}),s;function a(c){return function(u){return l([c,u])}}function l(c){if(r)throw new TypeError("Generator is already executing.");for(;s&&(s=0,c[0]&&(n=0)),n;)try{if(r=1,i&&(o=c[0]&2?i.return:c[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,c[1])).done)return o;switch(i=0,o&&(c=[c[0]&2,o.value]),c[0]){case 0:case 1:o=c;break;case 4:return n.label++,{value:c[1],done:!1};case 5:n.label++,i=c[1],c=[0];continue;case 7:c=n.ops.pop(),n.trys.pop();continue;default:if(o=n.trys,!(o=o.length>0&&o[o.length-1])&&(c[0]===6||c[0]===2)){n=0;continue}if(c[0]===3&&(!o||c[1]>o[0]&&c[1]<o[3])){n.label=c[1];break}if(c[0]===6&&n.label<o[1]){n.label=o[1],o=c;break}if(o&&n.label<o[2]){n.label=o[2],n.ops.push(c);break}o[2]&&n.ops.pop(),n.trys.pop();continue}c=e.call(t,n)}catch(u){c=[6,u],i=0}finally{r=o=0}if(c[0]&5)throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}},iW=function(t,e,n){if(n||arguments.length===2)for(var r=0,i=e.length,o;r<i;r++)(o||!(r in e))&&(o||(o=Array.prototype.slice.call(e,0,r)),o[r]=e[r]);return t.concat(o||Array.prototype.slice.call(e))},oW=3,lC=1e3,ky=function(t,e){for(var n=[],r=2;r<arguments.length;r++)n[r-2]=arguments[r];return gd(void 0,iW([t,e],n,!0),void 0,function(i,o,s){var a,l;return s===void 0&&(s=0),md(this,function(c){switch(c.label){case 0:return c.trys.push([0,3,,6]),[4,i.request({method:"eth_chainId"})];case 1:if(a=c.sent(),a===o)return[2];if(s>=oW)throw new Error("Chain switch timeout");return[4,new Promise(function(u){return setTimeout(u,lC)})];case 2:return c.sent(),[2,ky(i,o,s+1)];case 3:return l=c.sent(),l.code!==-32002?[3,5]:[4,new Promise(function(u){return setTimeout(u,lC)})];case 4:return c.sent(),[2,ky(i,o,s+1)];case 5:throw l;case 6:return[2]}})})},cC=function(t,e){return gd(void 0,void 0,void 0,function(){var n,r,i,o,s;return md(this,function(a){switch(a.label){case 0:if(a.trys.push([0,7,,9]),n=e||fs(),!n)throw new Error("No active EVM provider");r="0x".concat(t.toString(16)),a.label=1;case 1:return a.trys.push([1,3,,5]),[4,uC(n,r)];case 2:return a.sent(),[3,5];case 3:return i=a.sent(),[4,sW(i,n,t,r)];case 4:return a.sent(),[3,5];case 5:return[4,n.request({method:"eth_accounts"})];case 6:return o=a.sent(),[2,{chainId:t,accounts:o}];case 7:return s=a.sent(),lW(s)?[2,new Error("User rejected chain switch")]:[4,new Promise(function(l){return setTimeout(l,1e3)})];case 8:return a.sent(),console.error("Chain switch error:",s),[2,s instanceof Error?s:new Error("Failed to switch chain")];case 9:return[2]}})})},uC=function(t,e){return gd(void 0,void 0,void 0,function(){return md(this,function(n){switch(n.label){case 0:return[4,t.request({method:"wallet_switchEthereumChain",params:[{chainId:e}]})];case 1:return n.sent(),[2]}})})},sW=function(t,e,n,r){return gd(void 0,void 0,void 0,function(){return md(this,function(i){switch(i.label){case 0:if(t.code===4001)throw new Error("User rejected chain switch");return t.code!==-32002?[3,2]:[4,ky(e,r)];case 1:return i.sent(),[2];case 2:return t.code===4902||t.code===-32603?[4,aW(e,n,r)]:[3,5];case 3:return i.sent(),[4,uC(e,r)];case 4:return i.sent(),[3,6];case 5:throw t;case 6:return[2]}})})},aW=function(t,e,n){return gd(void 0,void 0,void 0,function(){var r,i;return md(this,function(o){switch(o.label){case 0:if(r=rW(e),!r)throw new Error("No configuration found for chain ".concat(e));o.label=1;case 1:return o.trys.push([1,3,,4]),[4,t.request({method:"wallet_addEthereumChain",params:[{chainId:n,chainName:r.name,nativeCurrency:r.nativeCurrency,rpcUrls:r.rpcUrls.default.http,blockExplorerUrls:[r.blockExplorers.default.url]}]})];case 2:return o.sent(),[3,4];case 3:throw i=o.sent(),i.code===4001?new Error("User rejected chain add"):i;case 4:return[2]}})})},lW=function(t){return t instanceof Error&&t.message.includes("rejected")},dC=function(t,e,n){if(n||arguments.length===2)for(var r=0,i=e.length,o;r<i;r++)(o||!(r in e))&&(o||(o=Array.prototype.slice.call(e,0,r)),o[r]=e[r]);return t.concat(o||Array.prototype.slice.call(e))},hp=[],fC=function(){var t=function(e){var n=e.detail;hp=dC(dC([],hp,!0),[n],!1)};return window.addEventListener("eip6963:announceProvider",t),window.dispatchEvent(new Event("eip6963:requestProvider")),function(){window.removeEventListener("eip6963:announceProvider",t)}},hC=function(){var t=[];return hp.length===0&&fC(),hp.forEach(function(e){var n={provider:e.provider};for(var r in e.provider){var i=e.provider;r.startsWith("is")&&typeof i[r]=="boolean"&&(n[r]=i[r])}t.push({name:e.info.name,id:e.info.uuid,icon:e.info.icon,injectedData:n})}),t},pC=function(t,e,n,r){function i(o){return o instanceof n?o:new n(function(s){s(o)})}return new(n||(n=Promise))(function(o,s){function a(u){try{c(r.next(u))}catch(d){s(d)}}function l(u){try{c(r.throw(u))}catch(d){s(d)}}function c(u){u.done?o(u.value):i(u.value).then(a,l)}c((r=r.apply(t,e||[])).next())})},gC=function(t,e){var n={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},r,i,o,s=Object.create((typeof Iterator=="function"?Iterator:Object).prototype);return s.next=a(0),s.throw=a(1),s.return=a(2),typeof Symbol=="function"&&(s[Symbol.iterator]=function(){return this}),s;function a(c){return function(u){return l([c,u])}}function l(c){if(r)throw new TypeError("Generator is already executing.");for(;s&&(s=0,c[0]&&(n=0)),n;)try{if(r=1,i&&(o=c[0]&2?i.return:c[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,c[1])).done)return o;switch(i=0,o&&(c=[c[0]&2,o.value]),c[0]){case 0:case 1:o=c;break;case 4:return n.label++,{value:c[1],done:!1};case 5:n.label++,i=c[1],c=[0];continue;case 7:c=n.ops.pop(),n.trys.pop();continue;default:if(o=n.trys,!(o=o.length>0&&o[o.length-1])&&(c[0]===6||c[0]===2)){n=0;continue}if(c[0]===3&&(!o||c[1]>o[0]&&c[1]<o[3])){n.label=c[1];break}if(c[0]===6&&n.label<o[1]){n.label=o[1],o=c;break}if(o&&n.label<o[2]){n.label=o[2],n.ops.push(c);break}o[2]&&n.ops.pop(),n.trys.pop();continue}c=e.call(t,n)}catch(u){c=[6,u],i=0}finally{r=o=0}if(c[0]&5)throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}};fC();var cW=function(t,e){if(!t)throw new Error("Wallet name is required");var n=hC(),r=n.find(function(i){return i.name.toLowerCase()===t.toLowerCase()||i.name.toLowerCase().includes(t.toLowerCase())});if(r)return r.injectedData.provider;if(window.ethereum)return window.ethereum;throw new Error("No provider found for wallet ".concat(t,". Please make sure the wallet is installed and enabled."))},uW=function(t,e,n){return pC(void 0,void 0,void 0,function(){var r,i,o,s,a,l,c,u;return gC(this,function(d){switch(d.label){case 0:d.trys.push([0,12,,13]),r=void 0;try{r=cW(t,n)}catch(h){throw new Error("No provider found for wallet ".concat(t))}i=new xo(r),ZH(i,r),o=void 0,d.label=1;case 1:return d.trys.push([1,3,,4]),[4,r.request({method:"eth_accounts"})];case 2:return o=d.sent(),[3,4];case 3:return d.sent(),o=[],[3,4];case 4:return!o||o.length===0?[4,i.send("eth_requestAccounts",[])]:[3,6];case 5:d.sent(),d.label=6;case 6:return[4,i.getSigner()];case 7:return s=d.sent(),[4,s.getAddress()];case 8:return a=d.sent(),[4,i.getNetwork().then(function(h){return Number(h.chainId)})];case 9:return l=d.sent(),e&&l!==e?[4,cC(e,r)]:[3,11];case 10:if(c=d.sent(),c instanceof Error)throw c;l=c.chainId,d.label=11;case 11:return[2,{accounts:[a],chainId:l,isConnected:!0}];case 12:return u=d.sent(),console.error("EVM wallet connection error:",u),[2,u instanceof Error?u:new Error("Failed to connect to ".concat(t," wallet"))];case 13:return[2]}})})},dW=function(t){return pC(void 0,void 0,void 0,function(){var e;return gC(this,function(n){try{if(e=fs(),!e)return[2];e.removeAllListeners&&e.removeAllListeners(),tW()}catch(r){return console.error("EVM wallet disconnection error:",r),[2,r instanceof Error?r:new Error("Failed to disconnect from ".concat(t," wallet"))]}return[2]})})},yd=function(t,e,n,r){function i(o){return o instanceof n?o:new n(function(s){s(o)})}return new(n||(n=Promise))(function(o,s){function a(u){try{c(r.next(u))}catch(d){s(d)}}function l(u){try{c(r.throw(u))}catch(d){s(d)}}function c(u){u.done?o(u.value):i(u.value).then(a,l)}c((r=r.apply(t,e||[])).next())})},bd=function(t,e){var n={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},r,i,o,s=Object.create((typeof Iterator=="function"?Iterator:Object).prototype);return s.next=a(0),s.throw=a(1),s.return=a(2),typeof Symbol=="function"&&(s[Symbol.iterator]=function(){return this}),s;function a(c){return function(u){return l([c,u])}}function l(c){if(r)throw new TypeError("Generator is already executing.");for(;s&&(s=0,c[0]&&(n=0)),n;)try{if(r=1,i&&(o=c[0]&2?i.return:c[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,c[1])).done)return o;switch(i=0,o&&(c=[c[0]&2,o.value]),c[0]){case 0:case 1:o=c;break;case 4:return n.label++,{value:c[1],done:!1};case 5:n.label++,i=c[1],c=[0];continue;case 7:c=n.ops.pop(),n.trys.pop();continue;default:if(o=n.trys,!(o=o.length>0&&o[o.length-1])&&(c[0]===6||c[0]===2)){n=0;continue}if(c[0]===3&&(!o||c[1]>o[0]&&c[1]<o[3])){n.label=c[1];break}if(c[0]===6&&n.label<o[1]){n.label=o[1],o=c;break}if(o&&n.label<o[2]){n.label=o[2],n.ops.push(c);break}o[2]&&n.ops.pop(),n.trys.pop();continue}c=e.call(t,n)}catch(u){c=[6,u],i=0}finally{r=o=0}if(c[0]&5)throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}},hs=function(t){var e;if(!t)return!1;var n=((e=t.message)===null||e===void 0?void 0:e.toLowerCase())||"";return t.code===4001||n.includes("user rejected")||n.includes("user denied")||n.includes("user cancelled")||n.includes("declined")},fW=function(t,e,n,r,i,o){return yd(void 0,void 0,void 0,function(){var s,a,l,c,u,d,h,g,b,p;return bd(this,function(w){switch(w.label){case 0:if(w.trys.push([0,9,,10]),s=fs(),!s)throw new Error("No active EVM provider");return[4,s.request({method:"eth_chainId"})];case 1:return a=w.sent(),l=parseInt(a,16),c=new xo(s),[4,c.getSigner(n)];case 2:return u=w.sent(),[4,c.getNetwork()];case 3:if(d=w.sent(),Number(d.chainId)!==l)throw new Error("Network changed during transaction setup");w.label=4;case 4:return w.trys.push([4,7,,8]),[4,u.sendTransaction({to:t,value:e,gasLimit:r?BigInt(Math.floor(r)):void 0,maxFeePerGas:i?BigInt(Math.floor(i)):void 0,maxPriorityFeePerGas:o?BigInt(Math.floor(o)):void 0})];case 5:return h=w.sent(),[4,h.wait()];case 6:return g=w.sent(),[2,g?g.hash:""];case 7:if(b=w.sent(),hs(b))return[2,new Error("Transaction was rejected by user")];throw b;case 8:return[3,10];case 9:return p=w.sent(),console.error("Transaction error:",p),hs(p)?[2,new Error("Transaction was rejected by user")]:p.code==="NETWORK_ERROR"?[2,new Error("Network changed during transaction. Please try again.")]:[2,p instanceof Error?p:new Error("Failed to send transaction")];case 10:return[2]}})})},hW=function(t,e,n,r,i){return yd(void 0,void 0,void 0,function(){var o,s,a,l,c,u,d,h,g,b,p,w,S,O,T;return bd(this,function($){switch($.label){case 0:if($.trys.push([0,9,,10]),o=fs(),!o)throw new Error("No active EVM provider");return[4,o.request({method:"eth_chainId"})];case 1:return s=$.sent(),a=parseInt(s,16),l=new xo(o),[4,l.getSigner(i)];case 2:return c=$.sent(),[4,l.getNetwork()];case 3:if(u=$.sent(),Number(u.chainId)!==a)throw new Error("Network changed during transaction setup");d=new va(t,e,c),h={},g=(r==null?void 0:r[2])!==void 0?tc(r[2],"gasLimit"):void 0,b=(r==null?void 0:r[3])!==void 0?tc(r[3],"maxFeePerGas"):void 0,p=(r==null?void 0:r[4])!==void 0?tc(r[4],"maxPriorityFeePerGas"):void 0,h.gasLimit=g?BigInt(Math.floor(g)):void 0,h.maxFeePerGas=b?BigInt(Math.floor(b)):void 0,h.maxPriorityFeePerGas=p?BigInt(Math.floor(p)):void 0,$.label=4;case 4:return $.trys.push([4,7,,8]),[4,d[n](r[0],r[1],h)];case 5:return w=$.sent(),[4,w.wait()];case 6:return S=$.sent(),[2,S?S.hash:""];case 7:if(O=$.sent(),hs(O))return[2,new Error("Transaction was rejected by user")];throw O;case 8:return[3,10];case 9:return T=$.sent(),console.error("Token transaction error:",T),hs(T)?[2,new Error("Transaction was rejected by user")]:T.code==="NETWORK_ERROR"?[2,new Error("Network changed during transaction. Please try again.")]:[2,T instanceof Error?T:new Error("Failed to send token transaction")];case 10:return[2]}})})},pW=function(t,e,n,r,i,o){return yd(void 0,void 0,void 0,function(){var s,a,l,c,u,d,h,g,b,p,w,S,O,T,$;return bd(this,function(R){switch(R.label){case 0:if(R.trys.push([0,9,,10]),s=fs(),!s)throw new Error("No active EVM provider");return[4,s.request({method:"eth_chainId"})];case 1:return a=R.sent(),l=parseInt(a,16),c=new xo(s),[4,c.getSigner(i)];case 2:return u=R.sent(),[4,c.getNetwork()];case 3:if(d=R.sent(),Number(d.chainId)!==l)throw new Error("Network changed during transaction setup");h=new va(t,e,u),g={},b=(r==null?void 0:r[1])!==void 0?tc(r[1],"gasLimit"):void 0,p=(r==null?void 0:r[2])!==void 0?tc(r[2],"maxFeePerGas"):void 0,w=(r==null?void 0:r[3])!==void 0?tc(r[3],"maxPriorityFeePerGas"):void 0,g.gasLimit=b?BigInt(Math.floor(b)):void 0,g.maxFeePerGas=p?BigInt(Math.floor(p)):void 0,g.maxPriorityFeePerGas=w?BigInt(Math.floor(w)):void 0,o&&(g.value=o),R.label=4;case 4:return R.trys.push([4,7,,8]),[4,h[n](r[0],g)];case 5:return S=R.sent(),[4,S.wait()];case 6:return O=R.sent(),[2,O?O.hash:""];case 7:if(T=R.sent(),hs(T))return[2,new Error("Transaction was rejected by user")];throw T;case 8:return[3,10];case 9:return $=R.sent(),console.error("Token transaction error:",$),hs($)?[2,new Error("Transaction was rejected by user")]:$.code==="NETWORK_ERROR"?[2,new Error("Network changed during transaction. Please try again.")]:[2,$ instanceof Error?$:new Error("Failed to send token transaction")];case 10:return[2]}})})};function tc(t,e){if(typeof t!="number"||Number.isNaN(t))throw new TypeError("Invalid ".concat(e,": expected a number, got ").concat(typeof t," (").concat(t,")"));return t}var gW=function(t){return yd(void 0,void 0,void 0,function(){var e,n,r,i,o,s,a,l;return bd(this,function(c){switch(c.label){case 0:if(c.trys.push([0,10,,11]),e=fs(),!e)throw new Error("No active EVM provider");n=new xo(e),c.label=1;case 1:return c.trys.push([1,8,,9]),[4,n.send("wallet_sendCalls",[t])];case 2:r=c.sent(),i=void 0,c.label=3;case 3:return[4,n.send("wallet_getCallsStatus",[r.id])];case 4:return i=c.sent(),i.status!=100?[3,6]:[4,new Promise(function(u){return setTimeout(u,1e3)})];case 5:c.sent(),c.label=6;case 6:if(i.status==100)return[3,3];c.label=7;case 7:return[2,(i==null?void 0:i.status)!=200?new Error("Failed to send batched transactions"):(l=(a=i.receipts.find(function(u){return u}))===null||a===void 0?void 0:a.transactionHash)!==null&&l!==void 0?l:new Error("Failed to get batched transactions receipt")];case 8:if(o=c.sent(),hs(o))return[2,new Error("Transaction was rejected by user")];throw o;case 9:return[3,11];case 10:return s=c.sent(),console.error("Token transaction error:",s),hs(s)?[2,new Error("Transaction was rejected by user")]:s.code==="NETWORK_ERROR"?[2,new Error("Network changed during transaction. Please try again.")]:[2,s instanceof Error?s:new Error("Failed to send token transaction")];case 11:return[2]}})})},mW=function(t,e){return yd(void 0,void 0,void 0,function(){var n,r,i;return bd(this,function(o){switch(o.label){case 0:if(n=fs(),!n)throw new Error("No active EVM provider");return r=new xo(n),[4,r.send("wallet_getCapabilities",[t,[e]])];case 1:return i=o.sent(),[2,i[e]]}})})},yW=function(t,e,n,r){function i(o){return o instanceof n?o:new n(function(s){s(o)})}return new(n||(n=Promise))(function(o,s){function a(u){try{c(r.next(u))}catch(d){s(d)}}function l(u){try{c(r.throw(u))}catch(d){s(d)}}function c(u){u.done?o(u.value):i(u.value).then(a,l)}c((r=r.apply(t,e||[])).next())})},bW=function(t,e){var n={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},r,i,o,s=Object.create((typeof Iterator=="function"?Iterator:Object).prototype);return s.next=a(0),s.throw=a(1),s.return=a(2),typeof Symbol=="function"&&(s[Symbol.iterator]=function(){return this}),s;function a(c){return function(u){return l([c,u])}}function l(c){if(r)throw new TypeError("Generator is already executing.");for(;s&&(s=0,c[0]&&(n=0)),n;)try{if(r=1,i&&(o=c[0]&2?i.return:c[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,c[1])).done)return o;switch(i=0,o&&(c=[c[0]&2,o.value]),c[0]){case 0:case 1:o=c;break;case 4:return n.label++,{value:c[1],done:!1};case 5:n.label++,i=c[1],c=[0];continue;case 7:c=n.ops.pop(),n.trys.pop();continue;default:if(o=n.trys,!(o=o.length>0&&o[o.length-1])&&(c[0]===6||c[0]===2)){n=0;continue}if(c[0]===3&&(!o||c[1]>o[0]&&c[1]<o[3])){n.label=c[1];break}if(c[0]===6&&n.label<o[1]){n.label=o[1],o=c;break}if(o&&n.label<o[2]){n.label=o[2],n.ops.push(c);break}o[2]&&n.ops.pop(),n.trys.pop();continue}c=e.call(t,n)}catch(u){c=[6,u],i=0}finally{r=o=0}if(c[0]&5)throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}},vW=function(t,e,n){return yW(void 0,void 0,void 0,function(){var r,i,o,s,a,l,c,u;return bW(this,function(d){switch(d.label){case 0:if(d.trys.push([0,5,,6]),r=eW(),i=fs(),!r||!i)throw new Error("No active EVM provider");return t.toLowerCase()!=="rainbow"?[3,2]:(o=ve(Oi(n)),[4,i.request({method:"personal_sign",params:[e.toLowerCase(),o]})]);case 1:return s=d.sent(),[2,s];case 2:return a=new xo(i),[4,a.getSigner(e)];case 3:return l=d.sent(),[4,l.signMessage(n)];case 4:return c=d.sent(),[2,c];case 5:return u=d.sent(),console.error("EVM message signing error:",u),[2,u instanceof Error?u:new Error("Failed to sign message with ".concat(t," wallet"))];case 6:return[2]}})})},wW=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),Eo=function(t,e,n,r){function i(o){return o instanceof n?o:new n(function(s){s(o)})}return new(n||(n=Promise))(function(o,s){function a(u){try{c(r.next(u))}catch(d){s(d)}}function l(u){try{c(r.throw(u))}catch(d){s(d)}}function c(u){u.done?o(u.value):i(u.value).then(a,l)}c((r=r.apply(t,e||[])).next())})},So=function(t,e){var n={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},r,i,o,s=Object.create((typeof Iterator=="function"?Iterator:Object).prototype);return s.next=a(0),s.throw=a(1),s.return=a(2),typeof Symbol=="function"&&(s[Symbol.iterator]=function(){return this}),s;function a(c){return function(u){return l([c,u])}}function l(c){if(r)throw new TypeError("Generator is already executing.");for(;s&&(s=0,c[0]&&(n=0)),n;)try{if(r=1,i&&(o=c[0]&2?i.return:c[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,c[1])).done)return o;switch(i=0,o&&(c=[c[0]&2,o.value]),c[0]){case 0:case 1:o=c;break;case 4:return n.label++,{value:c[1],done:!1};case 5:n.label++,i=c[1],c=[0];continue;case 7:c=n.ops.pop(),n.trys.pop();continue;default:if(o=n.trys,!(o=o.length>0&&o[o.length-1])&&(c[0]===6||c[0]===2)){n=0;continue}if(c[0]===3&&(!o||c[1]>o[0]&&c[1]<o[3])){n.label=c[1];break}if(c[0]===6&&n.label<o[1]){n.label=o[1],o=c;break}if(o&&n.label<o[2]){n.label=o[2],n.ops.push(c);break}o[2]&&n.ops.pop(),n.trys.pop();continue}c=e.call(t,n)}catch(u){c=[6,u],i=0}finally{r=o=0}if(c[0]&5)throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}},xW=function(t){wW(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.sendTransactionWithInstructions=function(){throw new Error("Method not implemented.")},e.prototype.connect=function(n){return Eo(this,void 0,void 0,function(){var r,i;return So(this,function(o){switch(o.label){case 0:return o.trys.push([0,2,,3]),[4,uW(n.integrationName,n.targetChainId?parseInt(n.targetChainId,10):void 0)];case 1:if(r=o.sent(),r instanceof Error)throw r;return[2,{accounts:r.accounts,chainId:r.chainId,isConnected:r.isConnected}];case 2:throw i=o.sent(),this.handleError(i,"connect to EVM wallet");case 3:return[2]}})})},e.prototype.disconnect=function(n){return Eo(this,void 0,void 0,function(){var r,i;return So(this,function(o){switch(o.label){case 0:return o.trys.push([0,2,,3]),[4,dW(n.walletName||"Unknown Wallet")];case 1:if(r=o.sent(),r instanceof Error)throw r;return[3,3];case 2:throw i=o.sent(),this.handleError(i,"disconnect from EVM wallet");case 3:return[2]}})})},e.prototype.signMessage=function(n){return Eo(this,void 0,void 0,function(){var r,i;return So(this,function(o){switch(o.label){case 0:return o.trys.push([0,2,,3]),[4,vW(n.walletName||"Unknown Wallet",n.address,n.message)];case 1:if(r=o.sent(),r instanceof Error)throw r;return[2,r];case 2:throw i=o.sent(),this.handleError(i,"sign EVM message");case 3:return[2]}})})},e.prototype.switchChain=function(n){return Eo(this,void 0,void 0,function(){var r,i;return So(this,function(o){switch(o.label){case 0:return o.trys.push([0,2,,3]),[4,cC(n.chainId)];case 1:if(r=o.sent(),r instanceof Error)throw r;return[2,r];case 2:throw i=o.sent(),this.handleError(i,"switch EVM chain");case 3:return[2]}})})},e.prototype.sendNativeTransfer=function(n){return Eo(this,void 0,void 0,function(){var r,i;return So(this,function(o){switch(o.label){case 0:return o.trys.push([0,2,,3]),[4,fW(n.toAddress,BigInt(n.amount*Math.pow(10,n.decimalPlaces)),n.account,n.gasLimit,n.maxFeePerGas,n.maxPriorityFeePerGas)];case 1:if(r=o.sent(),r instanceof Error)throw r;return[2,r];case 2:throw i=o.sent(),this.handleError(i,"send EVM native transfer");case 3:return[2]}})})},e.prototype.sendSmartContractInteraction=function(n){return Eo(this,void 0,void 0,function(){var r,i;return So(this,function(o){switch(o.label){case 0:return o.trys.push([0,2,,3]),[4,hW(n.address,JSON.parse(n.abi),n.functionName,n.args,n.account)];case 1:if(r=o.sent(),r instanceof Error)throw r;return[2,r];case 2:throw i=o.sent(),this.handleError(i,"send EVM smart contract interaction");case 3:return[2]}})})},e.prototype.sendNativeSmartContractInteraction=function(n){return Eo(this,void 0,void 0,function(){var r,i;return So(this,function(o){switch(o.label){case 0:return o.trys.push([0,2,,3]),[4,pW(n.address,JSON.parse(n.abi),n.functionName,n.args,n.account,n.value)];case 1:if(r=o.sent(),r instanceof Error)throw r;return[2,r];case 2:throw i=o.sent(),this.handleError(i,"send EVM smart contract interaction");case 3:return[2]}})})},e.prototype.sendTransactionBatch=function(n){return Eo(this,void 0,void 0,function(){var r,i;return So(this,function(o){switch(o.label){case 0:return o.trys.push([0,2,,3]),[4,gW(n)];case 1:if(r=o.sent(),r instanceof Error)throw r;return[2,r];case 2:throw i=o.sent(),this.handleError(i,"send EVM smart contract interaction");case 3:return[2]}})})},e.prototype.getWalletCapabilities=function(n){return Eo(this,void 0,void 0,function(){var r;return So(this,function(i){switch(i.label){case 0:return[4,mW(n.from,n.chainId)];case 1:return r=i.sent(),[2,r]}})})},e.prototype.getProviders=function(){return hC().map(function(n){return{icon:n.icon,id:n.id,name:n.name,type:"evm"}})},e}(sS),rn;(function(t){t.PHANTOM="phantom",t.SOLFLARE="solflare",t.TRUST="trustwallet",t.EXODUS="exodus",t.UNKNOWN="unknown"})(rn||(rn={}));var xa,mC=function(t){return t.isPhantom?rn.PHANTOM:t.isSolflare?rn.SOLFLARE:t.isTrust||t.isTrustWallet?rn.TRUST:t.isExodus?rn.EXODUS:rn.UNKNOWN},vd=(xa={},xa[rn.PHANTOM]=function(t){return t.isPhantom===!0&&t.isSolflare!==!0&&t.isTrust!==!0&&t.isTrustWallet!==!0&&t.isExodus!==!0},xa[rn.SOLFLARE]=function(t){return t.isSolflare===!0&&t.isPhantom!==!0&&t.isTrust!==!0&&t.isTrustWallet!==!0&&t.isExodus!==!0},xa[rn.TRUST]=function(t){return(t.isTrust===!0||t.isTrustWallet===!0)&&t.isPhantom!==!0&&t.isSolflare!==!0&&t.isExodus!==!0},xa[rn.EXODUS]=function(t){return t.isExodus===!0&&t.isSolflare!==!0&&t.isTrust!==!0&&t.isTrustWallet!==!0},xa[rn.UNKNOWN]=function(t){return t.isPhantom!==!0&&t.isSolflare!==!0&&t.isTrust!==!0&&t.isTrustWallet!==!0&&t.isExodus!==!0},xa),yC=function(t){var e,n,r;switch(t){case rn.PHANTOM:return!((e=window.phantom)===null||e===void 0)&&e.solana&&vd[t](window.phantom.solana)?window.phantom.solana:void 0;case rn.SOLFLARE:return window.solflare&&vd[t](window.solflare)?window.solflare:void 0;case rn.TRUST:return!((n=window.trustwallet)===null||n===void 0)&&n.solana&&vd[t](window.trustwallet.solana)?window.trustwallet.solana:void 0;case rn.EXODUS:return!((r=window.exodus)===null||r===void 0)&&r.solana&&vd[t](window.exodus.solana)?window.exodus.solana:void 0;case rn.UNKNOWN:return window.solana&&vd[t](window.solana)?window.solana:void 0;default:return}},bC=function(){var t={};if(Object.values(rn).forEach(function(n){yC(n)&&(t[n]=!0)}),window.solana&&!Object.keys(t).length){var e=mC(window.solana);t[e]=!0}return t},Ea=function(t){var e,n=t.toLowerCase().replace(/\s+/g,""),r=bC();if(r[n]){var i=yC(n);if(i)return i}var o=(e=window[n])===null||e===void 0?void 0:e.solana;if(o)return o;if(window.solana){var s=mC(window.solana);if(s===n||n===rn.UNKNOWN)return window.solana}throw new Error("Provider not found for wallet: ".concat(t))},Cy={},wd={},vC;function EW(){if(vC)return wd;vC=1,wd.byteLength=a,wd.toByteArray=c,wd.fromByteArray=h;for(var t=[],e=[],n=typeof Uint8Array!="undefined"?Uint8Array:Array,r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",i=0,o=r.length;i<o;++i)t[i]=r[i],e[r.charCodeAt(i)]=i;e[45]=62,e[95]=63;function s(g){var b=g.length;if(b%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var p=g.indexOf("=");p===-1&&(p=b);var w=p===b?0:4-p%4;return[p,w]}function a(g){var b=s(g),p=b[0],w=b[1];return(p+w)*3/4-w}function l(g,b,p){return(b+p)*3/4-p}function c(g){var b,p=s(g),w=p[0],S=p[1],O=new n(l(g,w,S)),T=0,$=S>0?w-4:w,R;for(R=0;R<$;R+=4)b=e[g.charCodeAt(R)]<<18|e[g.charCodeAt(R+1)]<<12|e[g.charCodeAt(R+2)]<<6|e[g.charCodeAt(R+3)],O[T++]=b>>16&255,O[T++]=b>>8&255,O[T++]=b&255;return S===2&&(b=e[g.charCodeAt(R)]<<2|e[g.charCodeAt(R+1)]>>4,O[T++]=b&255),S===1&&(b=e[g.charCodeAt(R)]<<10|e[g.charCodeAt(R+1)]<<4|e[g.charCodeAt(R+2)]>>2,O[T++]=b>>8&255,O[T++]=b&255),O}function u(g){return t[g>>18&63]+t[g>>12&63]+t[g>>6&63]+t[g&63]}function d(g,b,p){for(var w,S=[],O=b;O<p;O+=3)w=(g[O]<<16&16711680)+(g[O+1]<<8&65280)+(g[O+2]&255),S.push(u(w));return S.join("")}function h(g){for(var b,p=g.length,w=p%3,S=[],O=16383,T=0,$=p-w;T<$;T+=O)S.push(d(g,T,T+O>$?$:T+O));return w===1?(b=g[p-1],S.push(t[b>>2]+t[b<<4&63]+"==")):w===2&&(b=(g[p-2]<<8)+g[p-1],S.push(t[b>>10]+t[b>>4&63]+t[b<<2&63]+"=")),S.join("")}return wd}var pp={};/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */var wC;function SW(){return wC||(wC=1,pp.read=function(t,e,n,r,i){var o,s,a=i*8-r-1,l=(1<<a)-1,c=l>>1,u=-7,d=n?i-1:0,h=n?-1:1,g=t[e+d];for(d+=h,o=g&(1<<-u)-1,g>>=-u,u+=a;u>0;o=o*256+t[e+d],d+=h,u-=8);for(s=o&(1<<-u)-1,o>>=-u,u+=r;u>0;s=s*256+t[e+d],d+=h,u-=8);if(o===0)o=1-c;else{if(o===l)return s?NaN:(g?-1:1)*(1/0);s=s+Math.pow(2,r),o=o-c}return(g?-1:1)*s*Math.pow(2,o-r)},pp.write=function(t,e,n,r,i,o){var s,a,l,c=o*8-i-1,u=(1<<c)-1,d=u>>1,h=i===23?Math.pow(2,-24)-Math.pow(2,-77):0,g=r?0:o-1,b=r?1:-1,p=e<0||e===0&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(a=isNaN(e)?1:0,s=u):(s=Math.floor(Math.log(e)/Math.LN2),e*(l=Math.pow(2,-s))<1&&(s--,l*=2),s+d>=1?e+=h/l:e+=h*Math.pow(2,1-d),e*l>=2&&(s++,l/=2),s+d>=u?(a=0,s=u):s+d>=1?(a=(e*l-1)*Math.pow(2,i),s=s+d):(a=e*Math.pow(2,d-1)*Math.pow(2,i),s=0));i>=8;t[n+g]=a&255,g+=b,a/=256,i-=8);for(s=s<<i|a,c+=i;c>0;t[n+g]=s&255,g+=b,s/=256,c-=8);t[n+g-b]|=p*128}),pp}/*!
196
+ * The buffer module from node.js, for the browser.
197
+ *
198
+ * @author Feross Aboukhadijeh <https://feross.org>
199
+ * @license MIT
200
+ */var xC;function Iy(){return xC||(xC=1,function(t){const e=EW(),n=SW(),r=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;t.Buffer=a,t.SlowBuffer=O,t.INSPECT_MAX_BYTES=50;const i=2147483647;t.kMaxLength=i,a.TYPED_ARRAY_SUPPORT=o(),!a.TYPED_ARRAY_SUPPORT&&typeof console!="undefined"&&typeof console.error=="function"&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.");function o(){try{const _=new Uint8Array(1),x={foo:function(){return 42}};return Object.setPrototypeOf(x,Uint8Array.prototype),Object.setPrototypeOf(_,x),_.foo()===42}catch(_){return!1}}Object.defineProperty(a.prototype,"parent",{enumerable:!0,get:function(){if(a.isBuffer(this))return this.buffer}}),Object.defineProperty(a.prototype,"offset",{enumerable:!0,get:function(){if(a.isBuffer(this))return this.byteOffset}});function s(_){if(_>i)throw new RangeError('The value "'+_+'" is invalid for option "size"');const x=new Uint8Array(_);return Object.setPrototypeOf(x,a.prototype),x}function a(_,x,A){if(typeof _=="number"){if(typeof x=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return d(_)}return l(_,x,A)}a.poolSize=8192;function l(_,x,A){if(typeof _=="string")return h(_,x);if(ArrayBuffer.isView(_))return b(_);if(_==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof _);if(hn(_,ArrayBuffer)||_&&hn(_.buffer,ArrayBuffer)||typeof SharedArrayBuffer!="undefined"&&(hn(_,SharedArrayBuffer)||_&&hn(_.buffer,SharedArrayBuffer)))return p(_,x,A);if(typeof _=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');const H=_.valueOf&&_.valueOf();if(H!=null&&H!==_)return a.from(H,x,A);const te=w(_);if(te)return te;if(typeof Symbol!="undefined"&&Symbol.toPrimitive!=null&&typeof _[Symbol.toPrimitive]=="function")return a.from(_[Symbol.toPrimitive]("string"),x,A);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof _)}a.from=function(_,x,A){return l(_,x,A)},Object.setPrototypeOf(a.prototype,Uint8Array.prototype),Object.setPrototypeOf(a,Uint8Array);function c(_){if(typeof _!="number")throw new TypeError('"size" argument must be of type number');if(_<0)throw new RangeError('The value "'+_+'" is invalid for option "size"')}function u(_,x,A){return c(_),_<=0?s(_):x!==void 0?typeof A=="string"?s(_).fill(x,A):s(_).fill(x):s(_)}a.alloc=function(_,x,A){return u(_,x,A)};function d(_){return c(_),s(_<0?0:S(_)|0)}a.allocUnsafe=function(_){return d(_)},a.allocUnsafeSlow=function(_){return d(_)};function h(_,x){if((typeof x!="string"||x==="")&&(x="utf8"),!a.isEncoding(x))throw new TypeError("Unknown encoding: "+x);const A=T(_,x)|0;let H=s(A);const te=H.write(_,x);return te!==A&&(H=H.slice(0,te)),H}function g(_){const x=_.length<0?0:S(_.length)|0,A=s(x);for(let H=0;H<x;H+=1)A[H]=_[H]&255;return A}function b(_){if(hn(_,Uint8Array)){const x=new Uint8Array(_);return p(x.buffer,x.byteOffset,x.byteLength)}return g(_)}function p(_,x,A){if(x<0||_.byteLength<x)throw new RangeError('"offset" is outside of buffer bounds');if(_.byteLength<x+(A||0))throw new RangeError('"length" is outside of buffer bounds');let H;return x===void 0&&A===void 0?H=new Uint8Array(_):A===void 0?H=new Uint8Array(_,x):H=new Uint8Array(_,x,A),Object.setPrototypeOf(H,a.prototype),H}function w(_){if(a.isBuffer(_)){const x=S(_.length)|0,A=s(x);return A.length===0||_.copy(A,0,0,x),A}if(_.length!==void 0)return typeof _.length!="number"||ft(_.length)?s(0):g(_);if(_.type==="Buffer"&&Array.isArray(_.data))return g(_.data)}function S(_){if(_>=i)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+i.toString(16)+" bytes");return _|0}function O(_){return+_!=_&&(_=0),a.alloc(+_)}a.isBuffer=function(x){return x!=null&&x._isBuffer===!0&&x!==a.prototype},a.compare=function(x,A){if(hn(x,Uint8Array)&&(x=a.from(x,x.offset,x.byteLength)),hn(A,Uint8Array)&&(A=a.from(A,A.offset,A.byteLength)),!a.isBuffer(x)||!a.isBuffer(A))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(x===A)return 0;let H=x.length,te=A.length;for(let ie=0,ue=Math.min(H,te);ie<ue;++ie)if(x[ie]!==A[ie]){H=x[ie],te=A[ie];break}return H<te?-1:te<H?1:0},a.isEncoding=function(x){switch(String(x).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},a.concat=function(x,A){if(!Array.isArray(x))throw new TypeError('"list" argument must be an Array of Buffers');if(x.length===0)return a.alloc(0);let H;if(A===void 0)for(A=0,H=0;H<x.length;++H)A+=x[H].length;const te=a.allocUnsafe(A);let ie=0;for(H=0;H<x.length;++H){let ue=x[H];if(hn(ue,Uint8Array))ie+ue.length>te.length?(a.isBuffer(ue)||(ue=a.from(ue)),ue.copy(te,ie)):Uint8Array.prototype.set.call(te,ue,ie);else if(a.isBuffer(ue))ue.copy(te,ie);else throw new TypeError('"list" argument must be an Array of Buffers');ie+=ue.length}return te};function T(_,x){if(a.isBuffer(_))return _.length;if(ArrayBuffer.isView(_)||hn(_,ArrayBuffer))return _.byteLength;if(typeof _!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof _);const A=_.length,H=arguments.length>2&&arguments[2]===!0;if(!H&&A===0)return 0;let te=!1;for(;;)switch(x){case"ascii":case"latin1":case"binary":return A;case"utf8":case"utf-8":return st(_).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return A*2;case"hex":return A>>>1;case"base64":return at(_).length;default:if(te)return H?-1:st(_).length;x=(""+x).toLowerCase(),te=!0}}a.byteLength=T;function $(_,x,A){let H=!1;if((x===void 0||x<0)&&(x=0),x>this.length||((A===void 0||A>this.length)&&(A=this.length),A<=0)||(A>>>=0,x>>>=0,A<=x))return"";for(_||(_="utf8");;)switch(_){case"hex":return D(this,x,A);case"utf8":case"utf-8":return f(this,x,A);case"ascii":return I(this,x,A);case"latin1":case"binary":return N(this,x,A);case"base64":return C(this,x,A);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return M(this,x,A);default:if(H)throw new TypeError("Unknown encoding: "+_);_=(_+"").toLowerCase(),H=!0}}a.prototype._isBuffer=!0;function R(_,x,A){const H=_[x];_[x]=_[A],_[A]=H}a.prototype.swap16=function(){const x=this.length;if(x%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let A=0;A<x;A+=2)R(this,A,A+1);return this},a.prototype.swap32=function(){const x=this.length;if(x%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let A=0;A<x;A+=4)R(this,A,A+3),R(this,A+1,A+2);return this},a.prototype.swap64=function(){const x=this.length;if(x%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let A=0;A<x;A+=8)R(this,A,A+7),R(this,A+1,A+6),R(this,A+2,A+5),R(this,A+3,A+4);return this},a.prototype.toString=function(){const x=this.length;return x===0?"":arguments.length===0?f(this,0,x):$.apply(this,arguments)},a.prototype.toLocaleString=a.prototype.toString,a.prototype.equals=function(x){if(!a.isBuffer(x))throw new TypeError("Argument must be a Buffer");return this===x?!0:a.compare(this,x)===0},a.prototype.inspect=function(){let x="";const A=t.INSPECT_MAX_BYTES;return x=this.toString("hex",0,A).replace(/(.{2})/g,"$1 ").trim(),this.length>A&&(x+=" ... "),"<Buffer "+x+">"},r&&(a.prototype[r]=a.prototype.inspect),a.prototype.compare=function(x,A,H,te,ie){if(hn(x,Uint8Array)&&(x=a.from(x,x.offset,x.byteLength)),!a.isBuffer(x))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof x);if(A===void 0&&(A=0),H===void 0&&(H=x?x.length:0),te===void 0&&(te=0),ie===void 0&&(ie=this.length),A<0||H>x.length||te<0||ie>this.length)throw new RangeError("out of range index");if(te>=ie&&A>=H)return 0;if(te>=ie)return-1;if(A>=H)return 1;if(A>>>=0,H>>>=0,te>>>=0,ie>>>=0,this===x)return 0;let ue=ie-te,De=H-A;const Le=Math.min(ue,De),Me=this.slice(te,ie),yt=x.slice(A,H);for(let Ne=0;Ne<Le;++Ne)if(Me[Ne]!==yt[Ne]){ue=Me[Ne],De=yt[Ne];break}return ue<De?-1:De<ue?1:0};function j(_,x,A,H,te){if(_.length===0)return-1;if(typeof A=="string"?(H=A,A=0):A>2147483647?A=2147483647:A<-2147483648&&(A=-2147483648),A=+A,ft(A)&&(A=te?0:_.length-1),A<0&&(A=_.length+A),A>=_.length){if(te)return-1;A=_.length-1}else if(A<0)if(te)A=0;else return-1;if(typeof x=="string"&&(x=a.from(x,H)),a.isBuffer(x))return x.length===0?-1:q(_,x,A,H,te);if(typeof x=="number")return x=x&255,typeof Uint8Array.prototype.indexOf=="function"?te?Uint8Array.prototype.indexOf.call(_,x,A):Uint8Array.prototype.lastIndexOf.call(_,x,A):q(_,[x],A,H,te);throw new TypeError("val must be string, number or Buffer")}function q(_,x,A,H,te){let ie=1,ue=_.length,De=x.length;if(H!==void 0&&(H=String(H).toLowerCase(),H==="ucs2"||H==="ucs-2"||H==="utf16le"||H==="utf-16le")){if(_.length<2||x.length<2)return-1;ie=2,ue/=2,De/=2,A/=2}function Le(yt,Ne){return ie===1?yt[Ne]:yt.readUInt16BE(Ne*ie)}let Me;if(te){let yt=-1;for(Me=A;Me<ue;Me++)if(Le(_,Me)===Le(x,yt===-1?0:Me-yt)){if(yt===-1&&(yt=Me),Me-yt+1===De)return yt*ie}else yt!==-1&&(Me-=Me-yt),yt=-1}else for(A+De>ue&&(A=ue-De),Me=A;Me>=0;Me--){let yt=!0;for(let Ne=0;Ne<De;Ne++)if(Le(_,Me+Ne)!==Le(x,Ne)){yt=!1;break}if(yt)return Me}return-1}a.prototype.includes=function(x,A,H){return this.indexOf(x,A,H)!==-1},a.prototype.indexOf=function(x,A,H){return j(this,x,A,H,!0)},a.prototype.lastIndexOf=function(x,A,H){return j(this,x,A,H,!1)};function G(_,x,A,H){A=Number(A)||0;const te=_.length-A;H?(H=Number(H),H>te&&(H=te)):H=te;const ie=x.length;H>ie/2&&(H=ie/2);let ue;for(ue=0;ue<H;++ue){const De=parseInt(x.substr(ue*2,2),16);if(ft(De))return ue;_[A+ue]=De}return ue}function L(_,x,A,H){return it(st(x,_.length-A),_,A,H)}function V(_,x,A,H){return it(dt(x),_,A,H)}function W(_,x,A,H){return it(at(x),_,A,H)}function z(_,x,A,H){return it(ji(x,_.length-A),_,A,H)}a.prototype.write=function(x,A,H,te){if(A===void 0)te="utf8",H=this.length,A=0;else if(H===void 0&&typeof A=="string")te=A,H=this.length,A=0;else if(isFinite(A))A=A>>>0,isFinite(H)?(H=H>>>0,te===void 0&&(te="utf8")):(te=H,H=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");const ie=this.length-A;if((H===void 0||H>ie)&&(H=ie),x.length>0&&(H<0||A<0)||A>this.length)throw new RangeError("Attempt to write outside buffer bounds");te||(te="utf8");let ue=!1;for(;;)switch(te){case"hex":return G(this,x,A,H);case"utf8":case"utf-8":return L(this,x,A,H);case"ascii":case"latin1":case"binary":return V(this,x,A,H);case"base64":return W(this,x,A,H);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return z(this,x,A,H);default:if(ue)throw new TypeError("Unknown encoding: "+te);te=(""+te).toLowerCase(),ue=!0}},a.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function C(_,x,A){return x===0&&A===_.length?e.fromByteArray(_):e.fromByteArray(_.slice(x,A))}function f(_,x,A){A=Math.min(_.length,A);const H=[];let te=x;for(;te<A;){const ie=_[te];let ue=null,De=ie>239?4:ie>223?3:ie>191?2:1;if(te+De<=A){let Le,Me,yt,Ne;switch(De){case 1:ie<128&&(ue=ie);break;case 2:Le=_[te+1],(Le&192)===128&&(Ne=(ie&31)<<6|Le&63,Ne>127&&(ue=Ne));break;case 3:Le=_[te+1],Me=_[te+2],(Le&192)===128&&(Me&192)===128&&(Ne=(ie&15)<<12|(Le&63)<<6|Me&63,Ne>2047&&(Ne<55296||Ne>57343)&&(ue=Ne));break;case 4:Le=_[te+1],Me=_[te+2],yt=_[te+3],(Le&192)===128&&(Me&192)===128&&(yt&192)===128&&(Ne=(ie&15)<<18|(Le&63)<<12|(Me&63)<<6|yt&63,Ne>65535&&Ne<1114112&&(ue=Ne))}}ue===null?(ue=65533,De=1):ue>65535&&(ue-=65536,H.push(ue>>>10&1023|55296),ue=56320|ue&1023),H.push(ue),te+=De}return E(H)}const y=4096;function E(_){const x=_.length;if(x<=y)return String.fromCharCode.apply(String,_);let A="",H=0;for(;H<x;)A+=String.fromCharCode.apply(String,_.slice(H,H+=y));return A}function I(_,x,A){let H="";A=Math.min(_.length,A);for(let te=x;te<A;++te)H+=String.fromCharCode(_[te]&127);return H}function N(_,x,A){let H="";A=Math.min(_.length,A);for(let te=x;te<A;++te)H+=String.fromCharCode(_[te]);return H}function D(_,x,A){const H=_.length;(!x||x<0)&&(x=0),(!A||A<0||A>H)&&(A=H);let te="";for(let ie=x;ie<A;++ie)te+=mt[_[ie]];return te}function M(_,x,A){const H=_.slice(x,A);let te="";for(let ie=0;ie<H.length-1;ie+=2)te+=String.fromCharCode(H[ie]+H[ie+1]*256);return te}a.prototype.slice=function(x,A){const H=this.length;x=~~x,A=A===void 0?H:~~A,x<0?(x+=H,x<0&&(x=0)):x>H&&(x=H),A<0?(A+=H,A<0&&(A=0)):A>H&&(A=H),A<x&&(A=x);const te=this.subarray(x,A);return Object.setPrototypeOf(te,a.prototype),te};function P(_,x,A){if(_%1!==0||_<0)throw new RangeError("offset is not uint");if(_+x>A)throw new RangeError("Trying to access beyond buffer length")}a.prototype.readUintLE=a.prototype.readUIntLE=function(x,A,H){x=x>>>0,A=A>>>0,H||P(x,A,this.length);let te=this[x],ie=1,ue=0;for(;++ue<A&&(ie*=256);)te+=this[x+ue]*ie;return te},a.prototype.readUintBE=a.prototype.readUIntBE=function(x,A,H){x=x>>>0,A=A>>>0,H||P(x,A,this.length);let te=this[x+--A],ie=1;for(;A>0&&(ie*=256);)te+=this[x+--A]*ie;return te},a.prototype.readUint8=a.prototype.readUInt8=function(x,A){return x=x>>>0,A||P(x,1,this.length),this[x]},a.prototype.readUint16LE=a.prototype.readUInt16LE=function(x,A){return x=x>>>0,A||P(x,2,this.length),this[x]|this[x+1]<<8},a.prototype.readUint16BE=a.prototype.readUInt16BE=function(x,A){return x=x>>>0,A||P(x,2,this.length),this[x]<<8|this[x+1]},a.prototype.readUint32LE=a.prototype.readUInt32LE=function(x,A){return x=x>>>0,A||P(x,4,this.length),(this[x]|this[x+1]<<8|this[x+2]<<16)+this[x+3]*16777216},a.prototype.readUint32BE=a.prototype.readUInt32BE=function(x,A){return x=x>>>0,A||P(x,4,this.length),this[x]*16777216+(this[x+1]<<16|this[x+2]<<8|this[x+3])},a.prototype.readBigUInt64LE=hi(function(x){x=x>>>0,me(x,"offset");const A=this[x],H=this[x+7];(A===void 0||H===void 0)&&Ae(x,this.length-8);const te=A+this[++x]*2**8+this[++x]*2**16+this[++x]*2**24,ie=this[++x]+this[++x]*2**8+this[++x]*2**16+H*2**24;return BigInt(te)+(BigInt(ie)<<BigInt(32))}),a.prototype.readBigUInt64BE=hi(function(x){x=x>>>0,me(x,"offset");const A=this[x],H=this[x+7];(A===void 0||H===void 0)&&Ae(x,this.length-8);const te=A*2**24+this[++x]*2**16+this[++x]*2**8+this[++x],ie=this[++x]*2**24+this[++x]*2**16+this[++x]*2**8+H;return(BigInt(te)<<BigInt(32))+BigInt(ie)}),a.prototype.readIntLE=function(x,A,H){x=x>>>0,A=A>>>0,H||P(x,A,this.length);let te=this[x],ie=1,ue=0;for(;++ue<A&&(ie*=256);)te+=this[x+ue]*ie;return ie*=128,te>=ie&&(te-=Math.pow(2,8*A)),te},a.prototype.readIntBE=function(x,A,H){x=x>>>0,A=A>>>0,H||P(x,A,this.length);let te=A,ie=1,ue=this[x+--te];for(;te>0&&(ie*=256);)ue+=this[x+--te]*ie;return ie*=128,ue>=ie&&(ue-=Math.pow(2,8*A)),ue},a.prototype.readInt8=function(x,A){return x=x>>>0,A||P(x,1,this.length),this[x]&128?(255-this[x]+1)*-1:this[x]},a.prototype.readInt16LE=function(x,A){x=x>>>0,A||P(x,2,this.length);const H=this[x]|this[x+1]<<8;return H&32768?H|4294901760:H},a.prototype.readInt16BE=function(x,A){x=x>>>0,A||P(x,2,this.length);const H=this[x+1]|this[x]<<8;return H&32768?H|4294901760:H},a.prototype.readInt32LE=function(x,A){return x=x>>>0,A||P(x,4,this.length),this[x]|this[x+1]<<8|this[x+2]<<16|this[x+3]<<24},a.prototype.readInt32BE=function(x,A){return x=x>>>0,A||P(x,4,this.length),this[x]<<24|this[x+1]<<16|this[x+2]<<8|this[x+3]},a.prototype.readBigInt64LE=hi(function(x){x=x>>>0,me(x,"offset");const A=this[x],H=this[x+7];(A===void 0||H===void 0)&&Ae(x,this.length-8);const te=this[x+4]+this[x+5]*2**8+this[x+6]*2**16+(H<<24);return(BigInt(te)<<BigInt(32))+BigInt(A+this[++x]*2**8+this[++x]*2**16+this[++x]*2**24)}),a.prototype.readBigInt64BE=hi(function(x){x=x>>>0,me(x,"offset");const A=this[x],H=this[x+7];(A===void 0||H===void 0)&&Ae(x,this.length-8);const te=(A<<24)+this[++x]*2**16+this[++x]*2**8+this[++x];return(BigInt(te)<<BigInt(32))+BigInt(this[++x]*2**24+this[++x]*2**16+this[++x]*2**8+H)}),a.prototype.readFloatLE=function(x,A){return x=x>>>0,A||P(x,4,this.length),n.read(this,x,!0,23,4)},a.prototype.readFloatBE=function(x,A){return x=x>>>0,A||P(x,4,this.length),n.read(this,x,!1,23,4)},a.prototype.readDoubleLE=function(x,A){return x=x>>>0,A||P(x,8,this.length),n.read(this,x,!0,52,8)},a.prototype.readDoubleBE=function(x,A){return x=x>>>0,A||P(x,8,this.length),n.read(this,x,!1,52,8)};function m(_,x,A,H,te,ie){if(!a.isBuffer(_))throw new TypeError('"buffer" argument must be a Buffer instance');if(x>te||x<ie)throw new RangeError('"value" argument is out of bounds');if(A+H>_.length)throw new RangeError("Index out of range")}a.prototype.writeUintLE=a.prototype.writeUIntLE=function(x,A,H,te){if(x=+x,A=A>>>0,H=H>>>0,!te){const De=Math.pow(2,8*H)-1;m(this,x,A,H,De,0)}let ie=1,ue=0;for(this[A]=x&255;++ue<H&&(ie*=256);)this[A+ue]=x/ie&255;return A+H},a.prototype.writeUintBE=a.prototype.writeUIntBE=function(x,A,H,te){if(x=+x,A=A>>>0,H=H>>>0,!te){const De=Math.pow(2,8*H)-1;m(this,x,A,H,De,0)}let ie=H-1,ue=1;for(this[A+ie]=x&255;--ie>=0&&(ue*=256);)this[A+ie]=x/ue&255;return A+H},a.prototype.writeUint8=a.prototype.writeUInt8=function(x,A,H){return x=+x,A=A>>>0,H||m(this,x,A,1,255,0),this[A]=x&255,A+1},a.prototype.writeUint16LE=a.prototype.writeUInt16LE=function(x,A,H){return x=+x,A=A>>>0,H||m(this,x,A,2,65535,0),this[A]=x&255,this[A+1]=x>>>8,A+2},a.prototype.writeUint16BE=a.prototype.writeUInt16BE=function(x,A,H){return x=+x,A=A>>>0,H||m(this,x,A,2,65535,0),this[A]=x>>>8,this[A+1]=x&255,A+2},a.prototype.writeUint32LE=a.prototype.writeUInt32LE=function(x,A,H){return x=+x,A=A>>>0,H||m(this,x,A,4,4294967295,0),this[A+3]=x>>>24,this[A+2]=x>>>16,this[A+1]=x>>>8,this[A]=x&255,A+4},a.prototype.writeUint32BE=a.prototype.writeUInt32BE=function(x,A,H){return x=+x,A=A>>>0,H||m(this,x,A,4,4294967295,0),this[A]=x>>>24,this[A+1]=x>>>16,this[A+2]=x>>>8,this[A+3]=x&255,A+4};function v(_,x,A,H,te){se(x,H,te,_,A,7);let ie=Number(x&BigInt(4294967295));_[A++]=ie,ie=ie>>8,_[A++]=ie,ie=ie>>8,_[A++]=ie,ie=ie>>8,_[A++]=ie;let ue=Number(x>>BigInt(32)&BigInt(4294967295));return _[A++]=ue,ue=ue>>8,_[A++]=ue,ue=ue>>8,_[A++]=ue,ue=ue>>8,_[A++]=ue,A}function B(_,x,A,H,te){se(x,H,te,_,A,7);let ie=Number(x&BigInt(4294967295));_[A+7]=ie,ie=ie>>8,_[A+6]=ie,ie=ie>>8,_[A+5]=ie,ie=ie>>8,_[A+4]=ie;let ue=Number(x>>BigInt(32)&BigInt(4294967295));return _[A+3]=ue,ue=ue>>8,_[A+2]=ue,ue=ue>>8,_[A+1]=ue,ue=ue>>8,_[A]=ue,A+8}a.prototype.writeBigUInt64LE=hi(function(x,A=0){return v(this,x,A,BigInt(0),BigInt("0xffffffffffffffff"))}),a.prototype.writeBigUInt64BE=hi(function(x,A=0){return B(this,x,A,BigInt(0),BigInt("0xffffffffffffffff"))}),a.prototype.writeIntLE=function(x,A,H,te){if(x=+x,A=A>>>0,!te){const Le=Math.pow(2,8*H-1);m(this,x,A,H,Le-1,-Le)}let ie=0,ue=1,De=0;for(this[A]=x&255;++ie<H&&(ue*=256);)x<0&&De===0&&this[A+ie-1]!==0&&(De=1),this[A+ie]=(x/ue>>0)-De&255;return A+H},a.prototype.writeIntBE=function(x,A,H,te){if(x=+x,A=A>>>0,!te){const Le=Math.pow(2,8*H-1);m(this,x,A,H,Le-1,-Le)}let ie=H-1,ue=1,De=0;for(this[A+ie]=x&255;--ie>=0&&(ue*=256);)x<0&&De===0&&this[A+ie+1]!==0&&(De=1),this[A+ie]=(x/ue>>0)-De&255;return A+H},a.prototype.writeInt8=function(x,A,H){return x=+x,A=A>>>0,H||m(this,x,A,1,127,-128),x<0&&(x=255+x+1),this[A]=x&255,A+1},a.prototype.writeInt16LE=function(x,A,H){return x=+x,A=A>>>0,H||m(this,x,A,2,32767,-32768),this[A]=x&255,this[A+1]=x>>>8,A+2},a.prototype.writeInt16BE=function(x,A,H){return x=+x,A=A>>>0,H||m(this,x,A,2,32767,-32768),this[A]=x>>>8,this[A+1]=x&255,A+2},a.prototype.writeInt32LE=function(x,A,H){return x=+x,A=A>>>0,H||m(this,x,A,4,2147483647,-2147483648),this[A]=x&255,this[A+1]=x>>>8,this[A+2]=x>>>16,this[A+3]=x>>>24,A+4},a.prototype.writeInt32BE=function(x,A,H){return x=+x,A=A>>>0,H||m(this,x,A,4,2147483647,-2147483648),x<0&&(x=4294967295+x+1),this[A]=x>>>24,this[A+1]=x>>>16,this[A+2]=x>>>8,this[A+3]=x&255,A+4},a.prototype.writeBigInt64LE=hi(function(x,A=0){return v(this,x,A,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),a.prototype.writeBigInt64BE=hi(function(x,A=0){return B(this,x,A,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function U(_,x,A,H,te,ie){if(A+H>_.length)throw new RangeError("Index out of range");if(A<0)throw new RangeError("Index out of range")}function Q(_,x,A,H,te){return x=+x,A=A>>>0,te||U(_,x,A,4),n.write(_,x,A,H,23,4),A+4}a.prototype.writeFloatLE=function(x,A,H){return Q(this,x,A,!0,H)},a.prototype.writeFloatBE=function(x,A,H){return Q(this,x,A,!1,H)};function ee(_,x,A,H,te){return x=+x,A=A>>>0,te||U(_,x,A,8),n.write(_,x,A,H,52,8),A+8}a.prototype.writeDoubleLE=function(x,A,H){return ee(this,x,A,!0,H)},a.prototype.writeDoubleBE=function(x,A,H){return ee(this,x,A,!1,H)},a.prototype.copy=function(x,A,H,te){if(!a.isBuffer(x))throw new TypeError("argument should be a Buffer");if(H||(H=0),!te&&te!==0&&(te=this.length),A>=x.length&&(A=x.length),A||(A=0),te>0&&te<H&&(te=H),te===H||x.length===0||this.length===0)return 0;if(A<0)throw new RangeError("targetStart out of bounds");if(H<0||H>=this.length)throw new RangeError("Index out of range");if(te<0)throw new RangeError("sourceEnd out of bounds");te>this.length&&(te=this.length),x.length-A<te-H&&(te=x.length-A+H);const ie=te-H;return this===x&&typeof Uint8Array.prototype.copyWithin=="function"?this.copyWithin(A,H,te):Uint8Array.prototype.set.call(x,this.subarray(H,te),A),ie},a.prototype.fill=function(x,A,H,te){if(typeof x=="string"){if(typeof A=="string"?(te=A,A=0,H=this.length):typeof H=="string"&&(te=H,H=this.length),te!==void 0&&typeof te!="string")throw new TypeError("encoding must be a string");if(typeof te=="string"&&!a.isEncoding(te))throw new TypeError("Unknown encoding: "+te);if(x.length===1){const ue=x.charCodeAt(0);(te==="utf8"&&ue<128||te==="latin1")&&(x=ue)}}else typeof x=="number"?x=x&255:typeof x=="boolean"&&(x=Number(x));if(A<0||this.length<A||this.length<H)throw new RangeError("Out of range index");if(H<=A)return this;A=A>>>0,H=H===void 0?this.length:H>>>0,x||(x=0);let ie;if(typeof x=="number")for(ie=A;ie<H;++ie)this[ie]=x;else{const ue=a.isBuffer(x)?x:a.from(x,te),De=ue.length;if(De===0)throw new TypeError('The value "'+x+'" is invalid for argument "value"');for(ie=0;ie<H-A;++ie)this[ie+A]=ue[ie%De]}return this};const Z={};function Y(_,x,A){Z[_]=class extends A{constructor(){super(),Object.defineProperty(this,"message",{value:x.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${_}]`,this.stack,delete this.name}get code(){return _}set code(te){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:te,writable:!0})}toString(){return`${this.name} [${_}]: ${this.message}`}}}Y("ERR_BUFFER_OUT_OF_BOUNDS",function(_){return _?`${_} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError),Y("ERR_INVALID_ARG_TYPE",function(_,x){return`The "${_}" argument must be of type number. Received type ${typeof x}`},TypeError),Y("ERR_OUT_OF_RANGE",function(_,x,A){let H=`The value of "${_}" is out of range.`,te=A;return Number.isInteger(A)&&Math.abs(A)>2**32?te=re(String(A)):typeof A=="bigint"&&(te=String(A),(A>BigInt(2)**BigInt(32)||A<-(BigInt(2)**BigInt(32)))&&(te=re(te)),te+="n"),H+=` It must be ${x}. Received ${te}`,H},RangeError);function re(_){let x="",A=_.length;const H=_[0]==="-"?1:0;for(;A>=H+4;A-=3)x=`_${_.slice(A-3,A)}${x}`;return`${_.slice(0,A)}${x}`}function de(_,x,A){me(x,"offset"),(_[x]===void 0||_[x+A]===void 0)&&Ae(x,_.length-(A+1))}function se(_,x,A,H,te,ie){if(_>A||_<x){const ue=typeof x=="bigint"?"n":"";let De;throw x===0||x===BigInt(0)?De=`>= 0${ue} and < 2${ue} ** ${(ie+1)*8}${ue}`:De=`>= -(2${ue} ** ${(ie+1)*8-1}${ue}) and < 2 ** ${(ie+1)*8-1}${ue}`,new Z.ERR_OUT_OF_RANGE("value",De,_)}de(H,te,ie)}function me(_,x){if(typeof _!="number")throw new Z.ERR_INVALID_ARG_TYPE(x,"number",_)}function Ae(_,x,A){throw Math.floor(_)!==_?(me(_,A),new Z.ERR_OUT_OF_RANGE("offset","an integer",_)):x<0?new Z.ERR_BUFFER_OUT_OF_BOUNDS:new Z.ERR_OUT_OF_RANGE("offset",`>= 0 and <= ${x}`,_)}const Re=/[^+/0-9A-Za-z-_]/g;function Ct(_){if(_=_.split("=")[0],_=_.trim().replace(Re,""),_.length<2)return"";for(;_.length%4!==0;)_=_+"=";return _}function st(_,x){x=x||1/0;let A;const H=_.length;let te=null;const ie=[];for(let ue=0;ue<H;++ue){if(A=_.charCodeAt(ue),A>55295&&A<57344){if(!te){if(A>56319){(x-=3)>-1&&ie.push(239,191,189);continue}else if(ue+1===H){(x-=3)>-1&&ie.push(239,191,189);continue}te=A;continue}if(A<56320){(x-=3)>-1&&ie.push(239,191,189),te=A;continue}A=(te-55296<<10|A-56320)+65536}else te&&(x-=3)>-1&&ie.push(239,191,189);if(te=null,A<128){if((x-=1)<0)break;ie.push(A)}else if(A<2048){if((x-=2)<0)break;ie.push(A>>6|192,A&63|128)}else if(A<65536){if((x-=3)<0)break;ie.push(A>>12|224,A>>6&63|128,A&63|128)}else if(A<1114112){if((x-=4)<0)break;ie.push(A>>18|240,A>>12&63|128,A>>6&63|128,A&63|128)}else throw new Error("Invalid code point")}return ie}function dt(_){const x=[];for(let A=0;A<_.length;++A)x.push(_.charCodeAt(A)&255);return x}function ji(_,x){let A,H,te;const ie=[];for(let ue=0;ue<_.length&&!((x-=2)<0);++ue)A=_.charCodeAt(ue),H=A>>8,te=A%256,ie.push(te),ie.push(H);return ie}function at(_){return e.toByteArray(Ct(_))}function it(_,x,A,H){let te;for(te=0;te<H&&!(te+A>=x.length||te>=_.length);++te)x[te+A]=_[te];return te}function hn(_,x){return _ instanceof x||_!=null&&_.constructor!=null&&_.constructor.name!=null&&_.constructor.name===x.name}function ft(_){return _!==_}const mt=function(){const _="0123456789abcdef",x=new Array(256);for(let A=0;A<16;++A){const H=A*16;for(let te=0;te<16;++te)x[H+te]=_[A]+_[te]}return x}();function hi(_){return typeof BigInt=="undefined"?It:_}function It(){throw new Error("BigInt not supported")}}(Cy)),Cy}var Fe=Iy(),EC=function(t,e,n,r){function i(o){return o instanceof n?o:new n(function(s){s(o)})}return new(n||(n=Promise))(function(o,s){function a(u){try{c(r.next(u))}catch(d){s(d)}}function l(u){try{c(r.throw(u))}catch(d){s(d)}}function c(u){u.done?o(u.value):i(u.value).then(a,l)}c((r=r.apply(t,e||[])).next())})},SC=function(t,e){var n={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},r,i,o,s=Object.create((typeof Iterator=="function"?Iterator:Object).prototype);return s.next=a(0),s.throw=a(1),s.return=a(2),typeof Symbol=="function"&&(s[Symbol.iterator]=function(){return this}),s;function a(c){return function(u){return l([c,u])}}function l(c){if(r)throw new TypeError("Generator is already executing.");for(;s&&(s=0,c[0]&&(n=0)),n;)try{if(r=1,i&&(o=c[0]&2?i.return:c[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,c[1])).done)return o;switch(i=0,o&&(c=[c[0]&2,o.value]),c[0]){case 0:case 1:o=c;break;case 4:return n.label++,{value:c[1],done:!1};case 5:n.label++,i=c[1],c=[0];continue;case 7:c=n.ops.pop(),n.trys.pop();continue;default:if(o=n.trys,!(o=o.length>0&&o[o.length-1])&&(c[0]===6||c[0]===2)){n=0;continue}if(c[0]===3&&(!o||c[1]>o[0]&&c[1]<o[3])){n.label=c[1];break}if(c[0]===6&&n.label<o[1]){n.label=o[1],o=c;break}if(o&&n.label<o[2]){n.label=o[2],n.ops.push(c);break}o[2]&&n.ops.pop(),n.trys.pop();continue}c=e.call(t,n)}catch(u){c=[6,u],i=0}finally{r=o=0}if(c[0]&5)throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}};typeof window!="undefined"&&(window.Buffer=window.Buffer||Fe.Buffer);var AW=function(t){return EC(void 0,void 0,void 0,function(){var e,n,r;return SC(this,function(i){switch(i.label){case 0:return i.trys.push([0,2,,3]),e=Ea(t.integrationName),[4,e.connect({onlyIfTrusted:!0}).catch(function(){return e.connect()})];case 1:if(n=i.sent(),n!=null&&n.publicKey)return t.targetChainId=="103"?[2,{accounts:[n.publicKey.toString()],chainId:"103",isConnected:!0}]:[2,{accounts:[n.publicKey.toString()],chainId:"101",isConnected:!0}];if(e.publicKey)return[2,{accounts:[e.publicKey.toString()],chainId:"101",isConnected:!0}];throw new Error("".concat(t.integrationName," connection failed - no public key returned"));case 2:return r=i.sent(),[2,r instanceof Error?r:new Error("Failed to connect to ".concat(t.integrationName," wallet"))];case 3:return[2]}})})},kW=function(t){return EC(void 0,void 0,void 0,function(){var e,n;return SC(this,function(r){switch(r.label){case 0:return r.trys.push([0,2,,3]),e=Ea(t),[4,e.disconnect()];case 1:return r.sent(),[3,3];case 2:return n=r.sent(),[2,n instanceof Error?n:new Error("Failed to disconnect from ".concat(t," wallet"))];case 3:return[2]}})})};/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const Oy=BigInt(0),Ty=BigInt(1);function Sa(t,e=""){if(typeof t!="boolean"){const n=e&&`"${e}"`;throw new Error(n+"expected boolean, got type="+typeof t)}return t}function ii(t,e,n=""){const r=Hu(t),i=t==null?void 0:t.length,o=e!==void 0;if(!r||o&&i!==e){const s=n&&`"${n}" `,a=o?` of length ${e}`:"",l=r?`length=${i}`:`type=${typeof t}`;throw new Error(s+"expected Uint8Array"+a+", got "+l)}return t}function gp(t){const e=t.toString(16);return e.length&1?"0"+e:e}function AC(t){if(typeof t!="string")throw new Error("hex string expected, got "+typeof t);return t===""?Oy:BigInt("0x"+t)}function mp(t){return AC(na(t))}function xd(t){return co(t),AC(na(Uint8Array.from(t).reverse()))}function Py(t,e){return xh(t.toString(16).padStart(e*2,"0"))}function kC(t,e){return Py(t,e).reverse()}function St(t,e,n){let r;if(typeof e=="string")try{r=xh(e)}catch(o){throw new Error(t+" must be hex string or Uint8Array, cause: "+o)}else if(Hu(e))r=Uint8Array.from(e);else throw new Error(t+" must be hex string or Uint8Array");const i=r.length;if(typeof n=="number"&&i!==n)throw new Error(t+" of length "+n+" expected, got "+i);return r}function CC(t){return Uint8Array.from(t)}const Ny=t=>typeof t=="bigint"&&Oy<=t;function CW(t,e,n){return Ny(t)&&Ny(e)&&Ny(n)&&e<=t&&t<n}function By(t,e,n,r){if(!CW(e,n,r))throw new Error("expected valid "+t+": "+n+" <= n < "+r+", got "+e)}function IC(t){let e;for(e=0;t>Oy;t>>=Ty,e+=1);return e}const Ed=t=>(Ty<<BigInt(t))-Ty;function IW(t,e,n){if(typeof t!="number"||t<2)throw new Error("hashLen must be a number");if(typeof e!="number"||e<2)throw new Error("qByteLen must be a number");if(typeof n!="function")throw new Error("hmacFn must be a function");const r=g=>new Uint8Array(g),i=g=>Uint8Array.of(g);let o=r(t),s=r(t),a=0;const l=()=>{o.fill(1),s.fill(0),a=0},c=(...g)=>n(s,o,...g),u=(g=r(0))=>{s=c(i(0),g),o=c(),g.length!==0&&(s=c(i(1),g),o=c())},d=()=>{if(a++>=1e3)throw new Error("drbg: tried 1000 values");let g=0;const b=[];for(;g<e;){o=c();const p=o.slice();b.push(p),g+=o.length}return Ii(...b)};return(g,b)=>{l(),u(g);let p;for(;!(p=b(d()));)u();return l(),p}}function Sd(t,e,n={}){if(!t||typeof t!="object")throw new Error("expected valid options object");function r(i,o,s){const a=t[i];if(s&&a===void 0)return;const l=typeof a;if(l!==o||a===null)throw new Error(`param "${i}" is invalid: expected ${o}, got ${l}`)}Object.entries(e).forEach(([i,o])=>r(i,o,!1)),Object.entries(n).forEach(([i,o])=>r(i,o,!0))}function yp(t){const e=new WeakMap;return(n,...r)=>{const i=e.get(n);if(i!==void 0)return i;const o=t(n,...r);return e.set(n,o),o}}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const or=BigInt(0),xn=BigInt(1),Aa=BigInt(2),OC=BigInt(3),TC=BigInt(4),PC=BigInt(5),OW=BigInt(7),NC=BigInt(8),TW=BigInt(9),BC=BigInt(16);function _t(t,e){const n=t%e;return n>=or?n:e+n}function At(t,e,n){let r=t;for(;e-- >or;)r*=r,r%=n;return r}function RC(t,e){if(t===or)throw new Error("invert: expected non-zero number");if(e<=or)throw new Error("invert: expected positive modulus, got "+e);let n=_t(t,e),r=e,i=or,o=xn;for(;n!==or;){const a=r/n,l=r%n,c=i-o*a;r=n,n=l,i=o,o=c}if(r!==xn)throw new Error("invert: does not exist");return _t(i,e)}function Ry(t,e,n){if(!t.eql(t.sqr(e),n))throw new Error("Cannot find square root")}function MC(t,e){const n=(t.ORDER+xn)/TC,r=t.pow(e,n);return Ry(t,r,e),r}function PW(t,e){const n=(t.ORDER-PC)/NC,r=t.mul(e,Aa),i=t.pow(r,n),o=t.mul(e,i),s=t.mul(t.mul(o,Aa),i),a=t.mul(o,t.sub(s,t.ONE));return Ry(t,a,e),a}function NW(t){const e=ka(t),n=LC(t),r=n(e,e.neg(e.ONE)),i=n(e,r),o=n(e,e.neg(r)),s=(t+OW)/BC;return(a,l)=>{let c=a.pow(l,s),u=a.mul(c,r);const d=a.mul(c,i),h=a.mul(c,o),g=a.eql(a.sqr(u),l),b=a.eql(a.sqr(d),l);c=a.cmov(c,u,g),u=a.cmov(h,d,b);const p=a.eql(a.sqr(u),l),w=a.cmov(c,u,p);return Ry(a,w,l),w}}function LC(t){if(t<OC)throw new Error("sqrt is not defined for small field");let e=t-xn,n=0;for(;e%Aa===or;)e/=Aa,n++;let r=Aa;const i=ka(t);for(;_C(i,r)===1;)if(r++>1e3)throw new Error("Cannot find square root: probably non-prime P");if(n===1)return MC;let o=i.pow(r,e);const s=(e+xn)/Aa;return function(l,c){if(l.is0(c))return c;if(_C(l,c)!==1)throw new Error("Cannot find square root");let u=n,d=l.mul(l.ONE,o),h=l.pow(c,e),g=l.pow(c,s);for(;!l.eql(h,l.ONE);){if(l.is0(h))return l.ZERO;let b=1,p=l.sqr(h);for(;!l.eql(p,l.ONE);)if(b++,p=l.sqr(p),b===u)throw new Error("Cannot find square root");const w=xn<<BigInt(u-b-1),S=l.pow(d,w);u=b,d=l.sqr(S),h=l.mul(h,d),g=l.mul(g,S)}return g}}function BW(t){return t%TC===OC?MC:t%NC===PC?PW:t%BC===TW?NW(t):LC(t)}const RW=(t,e)=>(_t(t,e)&xn)===xn,MW=["create","isValid","is0","neg","inv","sqrt","sqr","eql","add","sub","mul","pow","div","addN","subN","mulN","sqrN"];function LW(t){const e={ORDER:"bigint",MASK:"bigint",BYTES:"number",BITS:"number"},n=MW.reduce((r,i)=>(r[i]="function",r),e);return Sd(t,n),t}function FW(t,e,n){if(n<or)throw new Error("invalid exponent, negatives unsupported");if(n===or)return t.ONE;if(n===xn)return e;let r=t.ONE,i=e;for(;n>or;)n&xn&&(r=t.mul(r,i)),i=t.sqr(i),n>>=xn;return r}function FC(t,e,n=!1){const r=new Array(e.length).fill(n?t.ZERO:void 0),i=e.reduce((s,a,l)=>t.is0(a)?s:(r[l]=s,t.mul(s,a)),t.ONE),o=t.inv(i);return e.reduceRight((s,a,l)=>t.is0(a)?s:(r[l]=t.mul(s,r[l]),t.mul(s,a)),o),r}function _C(t,e){const n=(t.ORDER-xn)/Aa,r=t.pow(e,n),i=t.eql(r,t.ONE),o=t.eql(r,t.ZERO),s=t.eql(r,t.neg(t.ONE));if(!i&&!o&&!s)throw new Error("invalid Legendre symbol result");return i?1:o?0:-1}function VC(t,e){e!==void 0&&Wu(e);const n=e!==void 0?e:t.toString(2).length,r=Math.ceil(n/8);return{nBitLength:n,nByteLength:r}}function ka(t,e,n=!1,r={}){if(t<=or)throw new Error("invalid field: expected ORDER > 0, got "+t);let i,o,s=!1,a;if(typeof e=="object"&&e!=null){if(r.sqrt||n)throw new Error("cannot specify opts in two arguments");const h=e;h.BITS&&(i=h.BITS),h.sqrt&&(o=h.sqrt),typeof h.isLE=="boolean"&&(n=h.isLE),typeof h.modFromBytes=="boolean"&&(s=h.modFromBytes),a=h.allowedLengths}else typeof e=="number"&&(i=e),r.sqrt&&(o=r.sqrt);const{nBitLength:l,nByteLength:c}=VC(t,i);if(c>2048)throw new Error("invalid field: expected ORDER of <= 2048 bytes");let u;const d=Object.freeze({ORDER:t,isLE:n,BITS:l,BYTES:c,MASK:Ed(l),ZERO:or,ONE:xn,allowedLengths:a,create:h=>_t(h,t),isValid:h=>{if(typeof h!="bigint")throw new Error("invalid field element: expected bigint, got "+typeof h);return or<=h&&h<t},is0:h=>h===or,isValidNot0:h=>!d.is0(h)&&d.isValid(h),isOdd:h=>(h&xn)===xn,neg:h=>_t(-h,t),eql:(h,g)=>h===g,sqr:h=>_t(h*h,t),add:(h,g)=>_t(h+g,t),sub:(h,g)=>_t(h-g,t),mul:(h,g)=>_t(h*g,t),pow:(h,g)=>FW(d,h,g),div:(h,g)=>_t(h*RC(g,t),t),sqrN:h=>h*h,addN:(h,g)=>h+g,subN:(h,g)=>h-g,mulN:(h,g)=>h*g,inv:h=>RC(h,t),sqrt:o||(h=>(u||(u=BW(t)),u(d,h))),toBytes:h=>n?kC(h,c):Py(h,c),fromBytes:(h,g=!0)=>{if(a){if(!a.includes(h.length)||h.length>c)throw new Error("Field.fromBytes: expected "+a+" bytes, got "+h.length);const p=new Uint8Array(c);p.set(h,n?0:p.length-h.length),h=p}if(h.length!==c)throw new Error("Field.fromBytes: expected "+c+" bytes, got "+h.length);let b=n?xd(h):mp(h);if(s&&(b=_t(b,t)),!g&&!d.isValid(b))throw new Error("invalid field element: outside of range 0..ORDER");return b},invertBatch:h=>FC(d,h),cmov:(h,g,b)=>b?g:h});return Object.freeze(d)}function DC(t){if(typeof t!="bigint")throw new Error("field order must be bigint");const e=t.toString(2).length;return Math.ceil(e/8)}function zC(t){const e=DC(t);return e+Math.ceil(e/2)}function _W(t,e,n=!1){const r=t.length,i=DC(e),o=zC(e);if(r<16||r<o||r>1024)throw new Error("expected "+o+"-1024 bytes of input, got "+r);const s=n?xd(t):mp(t),a=_t(s,e-xn)+xn;return n?kC(a,i):Py(a,i)}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const nc=BigInt(0),Ca=BigInt(1);function bp(t,e){const n=e.negate();return t?n:e}function Ia(t,e){const n=FC(t.Fp,e.map(r=>r.Z));return e.map((r,i)=>t.fromAffine(r.toAffine(n[i])))}function UC(t,e){if(!Number.isSafeInteger(t)||t<=0||t>e)throw new Error("invalid window size, expected [1.."+e+"], got W="+t)}function My(t,e){UC(t,e);const n=Math.ceil(e/t)+1,r=2**(t-1),i=2**t,o=Ed(t),s=BigInt(t);return{windows:n,windowSize:r,mask:o,maxNumber:i,shiftBy:s}}function $C(t,e,n){const{windowSize:r,mask:i,maxNumber:o,shiftBy:s}=n;let a=Number(t&i),l=t>>s;a>r&&(a-=o,l+=Ca);const c=e*r,u=c+Math.abs(a)-1,d=a===0,h=a<0,g=e%2!==0;return{nextN:l,offset:u,isZero:d,isNeg:h,isNegF:g,offsetF:c}}function VW(t,e){if(!Array.isArray(t))throw new Error("array expected");t.forEach((n,r)=>{if(!(n instanceof e))throw new Error("invalid point at index "+r)})}function DW(t,e){if(!Array.isArray(t))throw new Error("array of scalars expected");t.forEach((n,r)=>{if(!e.isValid(n))throw new Error("invalid scalar at index "+r)})}const Ly=new WeakMap,HC=new WeakMap;function Fy(t){return HC.get(t)||1}function WC(t){if(t!==nc)throw new Error("invalid wNAF")}class GC{constructor(e,n){this.BASE=e.BASE,this.ZERO=e.ZERO,this.Fn=e.Fn,this.bits=n}_unsafeLadder(e,n,r=this.ZERO){let i=e;for(;n>nc;)n&Ca&&(r=r.add(i)),i=i.double(),n>>=Ca;return r}precomputeWindow(e,n){const{windows:r,windowSize:i}=My(n,this.bits),o=[];let s=e,a=s;for(let l=0;l<r;l++){a=s,o.push(a);for(let c=1;c<i;c++)a=a.add(s),o.push(a);s=a.double()}return o}wNAF(e,n,r){if(!this.Fn.isValid(r))throw new Error("invalid scalar");let i=this.ZERO,o=this.BASE;const s=My(e,this.bits);for(let a=0;a<s.windows;a++){const{nextN:l,offset:c,isZero:u,isNeg:d,isNegF:h,offsetF:g}=$C(r,a,s);r=l,u?o=o.add(bp(h,n[g])):i=i.add(bp(d,n[c]))}return WC(r),{p:i,f:o}}wNAFUnsafe(e,n,r,i=this.ZERO){const o=My(e,this.bits);for(let s=0;s<o.windows&&r!==nc;s++){const{nextN:a,offset:l,isZero:c,isNeg:u}=$C(r,s,o);if(r=a,!c){const d=n[l];i=i.add(u?d.negate():d)}}return WC(r),i}getPrecomputes(e,n,r){let i=Ly.get(n);return i||(i=this.precomputeWindow(n,e),e!==1&&(typeof r=="function"&&(i=r(i)),Ly.set(n,i))),i}cached(e,n,r){const i=Fy(e);return this.wNAF(i,this.getPrecomputes(i,e,r),n)}unsafe(e,n,r,i){const o=Fy(e);return o===1?this._unsafeLadder(e,n,i):this.wNAFUnsafe(o,this.getPrecomputes(o,e,r),n,i)}createCache(e,n){UC(n,this.bits),HC.set(e,n),Ly.delete(e)}hasCache(e){return Fy(e)!==1}}function zW(t,e,n,r){let i=e,o=t.ZERO,s=t.ZERO;for(;n>nc||r>nc;)n&Ca&&(o=o.add(i)),r&Ca&&(s=s.add(i)),i=i.double(),n>>=Ca,r>>=Ca;return{p1:o,p2:s}}function jC(t,e,n,r){VW(n,t),DW(r,e);const i=n.length,o=r.length;if(i!==o)throw new Error("arrays of points and scalars must have equal length");const s=t.ZERO,a=IC(BigInt(i));let l=1;a>12?l=a-3:a>4?l=a-2:a>0&&(l=2);const c=Ed(l),u=new Array(Number(c)+1).fill(s),d=Math.floor((e.BITS-1)/l)*l;let h=s;for(let g=d;g>=0;g-=l){u.fill(s);for(let p=0;p<o;p++){const w=r[p],S=Number(w>>BigInt(g)&c);u[S]=u[S].add(n[p])}let b=s;for(let p=u.length-1,w=s;p>0;p--)w=w.add(u[p]),b=b.add(w);if(h=h.add(b),g!==0)for(let p=0;p<l;p++)h=h.double()}return h}function KC(t,e,n){if(e){if(e.ORDER!==t)throw new Error("Field.ORDER must match order: Fp == p, Fn == n");return LW(e),e}else return ka(t,{isLE:n})}function qC(t,e,n={},r){if(r===void 0&&(r=t==="edwards"),!e||typeof e!="object")throw new Error(`expected valid ${t} CURVE object`);for(const l of["p","n","h"]){const c=e[l];if(!(typeof c=="bigint"&&c>nc))throw new Error(`CURVE.${l} must be positive bigint`)}const i=KC(e.p,n.Fp,r),o=KC(e.n,n.Fn,r),a=["Gx","Gy","a",t==="weierstrass"?"b":"d"];for(const l of a)if(!i.isValid(e[l]))throw new Error(`CURVE.${l} must be valid field element of CURVE.Fp`);return e=Object.freeze(Object.assign({},e)),{CURVE:e,Fp:i,Fn:o}}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const ps=BigInt(0),dn=BigInt(1),_y=BigInt(2),UW=BigInt(8);function $W(t,e,n,r){const i=t.sqr(n),o=t.sqr(r),s=t.add(t.mul(e.a,i),o),a=t.add(t.ONE,t.mul(e.d,t.mul(i,o)));return t.eql(s,a)}function HW(t,e={}){const n=qC("edwards",t,e,e.FpFnLE),{Fp:r,Fn:i}=n;let o=n.CURVE;const{h:s}=o;Sd(e,{},{uvRatio:"function"});const a=_y<<BigInt(i.BYTES*8)-dn,l=w=>r.create(w),c=e.uvRatio||((w,S)=>{try{return{isValid:!0,value:r.sqrt(r.div(w,S))}}catch(O){return{isValid:!1,value:ps}}});if(!$W(r,o,o.Gx,o.Gy))throw new Error("bad curve params: generator point");function u(w,S,O=!1){const T=O?dn:ps;return By("coordinate "+w,S,T,a),S}function d(w){if(!(w instanceof b))throw new Error("ExtendedPoint expected")}const h=yp((w,S)=>{const{X:O,Y:T,Z:$}=w,R=w.is0();S==null&&(S=R?UW:r.inv($));const j=l(O*S),q=l(T*S),G=r.mul($,S);if(R)return{x:ps,y:dn};if(G!==dn)throw new Error("invZ was invalid");return{x:j,y:q}}),g=yp(w=>{const{a:S,d:O}=o;if(w.is0())throw new Error("bad point: ZERO");const{X:T,Y:$,Z:R,T:j}=w,q=l(T*T),G=l($*$),L=l(R*R),V=l(L*L),W=l(q*S),z=l(L*l(W+G)),C=l(V+l(O*l(q*G)));if(z!==C)throw new Error("bad point: equation left != right (1)");const f=l(T*$),y=l(R*j);if(f!==y)throw new Error("bad point: equation left != right (2)");return!0});class b{constructor(S,O,T,$){this.X=u("x",S),this.Y=u("y",O),this.Z=u("z",T,!0),this.T=u("t",$),Object.freeze(this)}static CURVE(){return o}static fromAffine(S){if(S instanceof b)throw new Error("extended point not allowed");const{x:O,y:T}=S||{};return u("x",O),u("y",T),new b(O,T,dn,l(O*T))}static fromBytes(S,O=!1){const T=r.BYTES,{a:$,d:R}=o;S=CC(ii(S,T,"point")),Sa(O,"zip215");const j=CC(S),q=S[T-1];j[T-1]=q&-129;const G=xd(j),L=O?a:r.ORDER;By("point.y",G,ps,L);const V=l(G*G),W=l(V-dn),z=l(R*V-$);let{isValid:C,value:f}=c(W,z);if(!C)throw new Error("bad point: invalid y coordinate");const y=(f&dn)===dn,E=(q&128)!==0;if(!O&&f===ps&&E)throw new Error("bad point: x=0 and x_0=1");return E!==y&&(f=l(-f)),b.fromAffine({x:f,y:G})}static fromHex(S,O=!1){return b.fromBytes(St("point",S),O)}get x(){return this.toAffine().x}get y(){return this.toAffine().y}precompute(S=8,O=!0){return p.createCache(this,S),O||this.multiply(_y),this}assertValidity(){g(this)}equals(S){d(S);const{X:O,Y:T,Z:$}=this,{X:R,Y:j,Z:q}=S,G=l(O*q),L=l(R*$),V=l(T*q),W=l(j*$);return G===L&&V===W}is0(){return this.equals(b.ZERO)}negate(){return new b(l(-this.X),this.Y,this.Z,l(-this.T))}double(){const{a:S}=o,{X:O,Y:T,Z:$}=this,R=l(O*O),j=l(T*T),q=l(_y*l($*$)),G=l(S*R),L=O+T,V=l(l(L*L)-R-j),W=G+j,z=W-q,C=G-j,f=l(V*z),y=l(W*C),E=l(V*C),I=l(z*W);return new b(f,y,I,E)}add(S){d(S);const{a:O,d:T}=o,{X:$,Y:R,Z:j,T:q}=this,{X:G,Y:L,Z:V,T:W}=S,z=l($*G),C=l(R*L),f=l(q*T*W),y=l(j*V),E=l(($+R)*(G+L)-z-C),I=y-f,N=y+f,D=l(C-O*z),M=l(E*I),P=l(N*D),m=l(E*D),v=l(I*N);return new b(M,P,v,m)}subtract(S){return this.add(S.negate())}multiply(S){if(!i.isValidNot0(S))throw new Error("invalid scalar: expected 1 <= sc < curve.n");const{p:O,f:T}=p.cached(this,S,$=>Ia(b,$));return Ia(b,[O,T])[0]}multiplyUnsafe(S,O=b.ZERO){if(!i.isValid(S))throw new Error("invalid scalar: expected 0 <= sc < curve.n");return S===ps?b.ZERO:this.is0()||S===dn?this:p.unsafe(this,S,T=>Ia(b,T),O)}isSmallOrder(){return this.multiplyUnsafe(s).is0()}isTorsionFree(){return p.unsafe(this,o.n).is0()}toAffine(S){return h(this,S)}clearCofactor(){return s===dn?this:this.multiplyUnsafe(s)}toBytes(){const{x:S,y:O}=this.toAffine(),T=r.toBytes(O);return T[T.length-1]|=S&dn?128:0,T}toHex(){return na(this.toBytes())}toString(){return`<Point ${this.is0()?"ZERO":this.toHex()}>`}get ex(){return this.X}get ey(){return this.Y}get ez(){return this.Z}get et(){return this.T}static normalizeZ(S){return Ia(b,S)}static msm(S,O){return jC(b,i,S,O)}_setWindowSize(S){this.precompute(S)}toRawBytes(){return this.toBytes()}}b.BASE=new b(o.Gx,o.Gy,dn,l(o.Gx*o.Gy)),b.ZERO=new b(ps,dn,dn,ps),b.Fp=r,b.Fn=i;const p=new GC(b,i.BITS);return b.BASE.precompute(8),b}function WW(t,e,n={}){if(typeof e!="function")throw new Error('"hash" function param is required');Sd(n,{},{adjustScalarBytes:"function",randomBytes:"function",domain:"function",prehash:"function",mapToCurve:"function"});const{prehash:r}=n,{BASE:i,Fp:o,Fn:s}=t,a=n.randomBytes||om,l=n.adjustScalarBytes||(L=>L),c=n.domain||((L,V,W)=>{if(Sa(W,"phflag"),V.length||W)throw new Error("Contexts/pre-hash are not supported");return L});function u(L){return s.create(xd(L))}function d(L){const V=T.secretKey;L=St("private key",L,V);const W=St("hashed private key",e(L),2*V),z=l(W.slice(0,V)),C=W.slice(V,2*V),f=u(z);return{head:z,prefix:C,scalar:f}}function h(L){const{head:V,prefix:W,scalar:z}=d(L),C=i.multiply(z),f=C.toBytes();return{head:V,prefix:W,scalar:z,point:C,pointBytes:f}}function g(L){return h(L).pointBytes}function b(L=Uint8Array.of(),...V){const W=Ii(...V);return u(e(c(W,St("context",L),!!r)))}function p(L,V,W={}){L=St("message",L),r&&(L=r(L));const{prefix:z,scalar:C,pointBytes:f}=h(V),y=b(W.context,z,L),E=i.multiply(y).toBytes(),I=b(W.context,E,f,L),N=s.create(y+I*C);if(!s.isValid(N))throw new Error("sign failed: invalid s");const D=Ii(E,s.toBytes(N));return ii(D,T.signature,"result")}const w={zip215:!0};function S(L,V,W,z=w){const{context:C,zip215:f}=z,y=T.signature;L=St("signature",L,y),V=St("message",V),W=St("publicKey",W,T.publicKey),f!==void 0&&Sa(f,"zip215"),r&&(V=r(V));const E=y/2,I=L.subarray(0,E),N=xd(L.subarray(E,y));let D,M,P;try{D=t.fromBytes(W,f),M=t.fromBytes(I,f),P=i.multiplyUnsafe(N)}catch(B){return!1}if(!f&&D.isSmallOrder())return!1;const m=b(C,M.toBytes(),D.toBytes(),V);return M.add(D.multiplyUnsafe(m)).subtract(P).clearCofactor().is0()}const O=o.BYTES,T={secretKey:O,publicKey:O,signature:2*O,seed:O};function $(L=a(T.seed)){return ii(L,T.seed,"seed")}function R(L){const V=G.randomSecretKey(L);return{secretKey:V,publicKey:g(V)}}function j(L){return Hu(L)&&L.length===s.BYTES}function q(L,V){try{return!!t.fromBytes(L,V)}catch(W){return!1}}const G={getExtendedPublicKey:h,randomSecretKey:$,isValidSecretKey:j,isValidPublicKey:q,toMontgomery(L){const{y:V}=t.fromBytes(L),W=T.publicKey,z=W===32;if(!z&&W!==57)throw new Error("only defined for 25519 and 448");const C=z?o.div(dn+V,dn-V):o.div(V-dn,V+dn);return o.toBytes(C)},toMontgomeryPriv(L){const V=T.secretKey;ii(L,V);const W=e(L.subarray(0,V));return l(W).subarray(0,V)},randomPrivateKey:$,precompute(L=8,V=t.BASE){return V.precompute(L,!1)}};return Object.freeze({keygen:R,getPublicKey:g,sign:p,verify:S,utils:G,Point:t,lengths:T})}function GW(t){const e={a:t.a,d:t.d,p:t.Fp.ORDER,n:t.n,h:t.h,Gx:t.Gx,Gy:t.Gy},n=t.Fp,r=ka(e.n,t.nBitLength,!0),i={Fp:n,Fn:r,uvRatio:t.uvRatio},o={randomBytes:t.randomBytes,adjustScalarBytes:t.adjustScalarBytes,domain:t.domain,prehash:t.prehash,mapToCurve:t.mapToCurve};return{CURVE:e,curveOpts:i,hash:t.hash,eddsaOpts:o}}function jW(t,e){const n=e.Point;return Object.assign({},e,{ExtendedPoint:n,CURVE:t,nBitLength:n.Fn.BITS,nByteLength:n.Fn.BYTES})}function KW(t){const{CURVE:e,curveOpts:n,hash:r,eddsaOpts:i}=GW(t),o=HW(e,n),s=WW(o,r,i);return jW(t,s)}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const qW=BigInt(1),YC=BigInt(2);BigInt(3);const YW=BigInt(5),QW=BigInt(8),Vy=BigInt("0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffed"),QC={p:Vy,n:BigInt("0x1000000000000000000000000000000014def9dea2f79cd65812631a5cf5d3ed"),h:QW,a:BigInt("0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffec"),d:BigInt("0x52036cee2b6ffe738cc740797779e89800700a4d4141d8ab75eb4dca135978a3"),Gx:BigInt("0x216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a"),Gy:BigInt("0x6666666666666666666666666666666666666666666666666666666666666658")};function XW(t){const e=BigInt(10),n=BigInt(20),r=BigInt(40),i=BigInt(80),o=Vy,a=t*t%o*t%o,l=At(a,YC,o)*a%o,c=At(l,qW,o)*t%o,u=At(c,YW,o)*c%o,d=At(u,e,o)*u%o,h=At(d,n,o)*d%o,g=At(h,r,o)*h%o,b=At(g,i,o)*g%o,p=At(b,i,o)*g%o,w=At(p,e,o)*u%o;return{pow_p_5_8:At(w,YC,o)*t%o,b2:a}}function JW(t){return t[0]&=248,t[31]&=127,t[31]|=64,t}const XC=BigInt("19681161376707505956807079304988542015446066515923890162744021073123829784752");function ZW(t,e){const n=Vy,r=_t(e*e*e,n),i=_t(r*r*e,n),o=XW(t*i).pow_p_5_8;let s=_t(t*r*o,n);const a=_t(e*s*s,n),l=s,c=_t(s*XC,n),u=a===t,d=a===_t(-t,n),h=a===_t(-t*XC,n);return u&&(s=l),(d||h)&&(s=c),RW(s,n)&&(s=_t(-s,n)),{isValid:u||d,value:s}}const eG=ka(QC.p,{isLE:!0}),tG={...QC,Fp:eG,hash:nz,adjustScalarBytes:JW,uvRatio:ZW},Ad=KW(tG);var vp={exports:{}};const nG=lu(Object.freeze(Object.defineProperty({__proto__:null,default:{}},Symbol.toStringTag,{value:"Module"})));var rG=vp.exports,JC;function ZC(){return JC||(JC=1,function(t){(function(e,n){function r(C,f){if(!C)throw new Error(f||"Assertion failed")}function i(C,f){C.super_=f;var y=function(){};y.prototype=f.prototype,C.prototype=new y,C.prototype.constructor=C}function o(C,f,y){if(o.isBN(C))return C;this.negative=0,this.words=null,this.length=0,this.red=null,C!==null&&((f==="le"||f==="be")&&(y=f,f=10),this._init(C||0,f||10,y||"be"))}typeof e=="object"?e.exports=o:n.BN=o,o.BN=o,o.wordSize=26;var s;try{typeof window!="undefined"&&typeof window.Buffer!="undefined"?s=window.Buffer:s=nG.Buffer}catch(C){}o.isBN=function(f){return f instanceof o?!0:f!==null&&typeof f=="object"&&f.constructor.wordSize===o.wordSize&&Array.isArray(f.words)},o.max=function(f,y){return f.cmp(y)>0?f:y},o.min=function(f,y){return f.cmp(y)<0?f:y},o.prototype._init=function(f,y,E){if(typeof f=="number")return this._initNumber(f,y,E);if(typeof f=="object")return this._initArray(f,y,E);y==="hex"&&(y=16),r(y===(y|0)&&y>=2&&y<=36),f=f.toString().replace(/\s+/g,"");var I=0;f[0]==="-"&&(I++,this.negative=1),I<f.length&&(y===16?this._parseHex(f,I,E):(this._parseBase(f,y,I),E==="le"&&this._initArray(this.toArray(),y,E)))},o.prototype._initNumber=function(f,y,E){f<0&&(this.negative=1,f=-f),f<67108864?(this.words=[f&67108863],this.length=1):f<4503599627370496?(this.words=[f&67108863,f/67108864&67108863],this.length=2):(r(f<9007199254740992),this.words=[f&67108863,f/67108864&67108863,1],this.length=3),E==="le"&&this._initArray(this.toArray(),y,E)},o.prototype._initArray=function(f,y,E){if(r(typeof f.length=="number"),f.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(f.length/3),this.words=new Array(this.length);for(var I=0;I<this.length;I++)this.words[I]=0;var N,D,M=0;if(E==="be")for(I=f.length-1,N=0;I>=0;I-=3)D=f[I]|f[I-1]<<8|f[I-2]<<16,this.words[N]|=D<<M&67108863,this.words[N+1]=D>>>26-M&67108863,M+=24,M>=26&&(M-=26,N++);else if(E==="le")for(I=0,N=0;I<f.length;I+=3)D=f[I]|f[I+1]<<8|f[I+2]<<16,this.words[N]|=D<<M&67108863,this.words[N+1]=D>>>26-M&67108863,M+=24,M>=26&&(M-=26,N++);return this._strip()};function a(C,f){var y=C.charCodeAt(f);if(y>=48&&y<=57)return y-48;if(y>=65&&y<=70)return y-55;if(y>=97&&y<=102)return y-87;r(!1,"Invalid character in "+C)}function l(C,f,y){var E=a(C,y);return y-1>=f&&(E|=a(C,y-1)<<4),E}o.prototype._parseHex=function(f,y,E){this.length=Math.ceil((f.length-y)/6),this.words=new Array(this.length);for(var I=0;I<this.length;I++)this.words[I]=0;var N=0,D=0,M;if(E==="be")for(I=f.length-1;I>=y;I-=2)M=l(f,y,I)<<N,this.words[D]|=M&67108863,N>=18?(N-=18,D+=1,this.words[D]|=M>>>26):N+=8;else{var P=f.length-y;for(I=P%2===0?y+1:y;I<f.length;I+=2)M=l(f,y,I)<<N,this.words[D]|=M&67108863,N>=18?(N-=18,D+=1,this.words[D]|=M>>>26):N+=8}this._strip()};function c(C,f,y,E){for(var I=0,N=0,D=Math.min(C.length,y),M=f;M<D;M++){var P=C.charCodeAt(M)-48;I*=E,P>=49?N=P-49+10:P>=17?N=P-17+10:N=P,r(P>=0&&N<E,"Invalid character"),I+=N}return I}o.prototype._parseBase=function(f,y,E){this.words=[0],this.length=1;for(var I=0,N=1;N<=67108863;N*=y)I++;I--,N=N/y|0;for(var D=f.length-E,M=D%I,P=Math.min(D,D-M)+E,m=0,v=E;v<P;v+=I)m=c(f,v,v+I,y),this.imuln(N),this.words[0]+m<67108864?this.words[0]+=m:this._iaddn(m);if(M!==0){var B=1;for(m=c(f,v,f.length,y),v=0;v<M;v++)B*=y;this.imuln(B),this.words[0]+m<67108864?this.words[0]+=m:this._iaddn(m)}this._strip()},o.prototype.copy=function(f){f.words=new Array(this.length);for(var y=0;y<this.length;y++)f.words[y]=this.words[y];f.length=this.length,f.negative=this.negative,f.red=this.red};function u(C,f){C.words=f.words,C.length=f.length,C.negative=f.negative,C.red=f.red}if(o.prototype._move=function(f){u(f,this)},o.prototype.clone=function(){var f=new o(null);return this.copy(f),f},o.prototype._expand=function(f){for(;this.length<f;)this.words[this.length++]=0;return this},o.prototype._strip=function(){for(;this.length>1&&this.words[this.length-1]===0;)this.length--;return this._normSign()},o.prototype._normSign=function(){return this.length===1&&this.words[0]===0&&(this.negative=0),this},typeof Symbol!="undefined"&&typeof Symbol.for=="function")try{o.prototype[Symbol.for("nodejs.util.inspect.custom")]=d}catch(C){o.prototype.inspect=d}else o.prototype.inspect=d;function d(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"}var h=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],g=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],b=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];o.prototype.toString=function(f,y){f=f||10,y=y|0||1;var E;if(f===16||f==="hex"){E="";for(var I=0,N=0,D=0;D<this.length;D++){var M=this.words[D],P=((M<<I|N)&16777215).toString(16);N=M>>>24-I&16777215,I+=2,I>=26&&(I-=26,D--),N!==0||D!==this.length-1?E=h[6-P.length]+P+E:E=P+E}for(N!==0&&(E=N.toString(16)+E);E.length%y!==0;)E="0"+E;return this.negative!==0&&(E="-"+E),E}if(f===(f|0)&&f>=2&&f<=36){var m=g[f],v=b[f];E="";var B=this.clone();for(B.negative=0;!B.isZero();){var U=B.modrn(v).toString(f);B=B.idivn(v),B.isZero()?E=U+E:E=h[m-U.length]+U+E}for(this.isZero()&&(E="0"+E);E.length%y!==0;)E="0"+E;return this.negative!==0&&(E="-"+E),E}r(!1,"Base should be between 2 and 36")},o.prototype.toNumber=function(){var f=this.words[0];return this.length===2?f+=this.words[1]*67108864:this.length===3&&this.words[2]===1?f+=4503599627370496+this.words[1]*67108864:this.length>2&&r(!1,"Number can only safely store up to 53 bits"),this.negative!==0?-f:f},o.prototype.toJSON=function(){return this.toString(16,2)},s&&(o.prototype.toBuffer=function(f,y){return this.toArrayLike(s,f,y)}),o.prototype.toArray=function(f,y){return this.toArrayLike(Array,f,y)};var p=function(f,y){return f.allocUnsafe?f.allocUnsafe(y):new f(y)};o.prototype.toArrayLike=function(f,y,E){this._strip();var I=this.byteLength(),N=E||Math.max(1,I);r(I<=N,"byte array longer than desired length"),r(N>0,"Requested array length <= 0");var D=p(f,N),M=y==="le"?"LE":"BE";return this["_toArrayLike"+M](D,I),D},o.prototype._toArrayLikeLE=function(f,y){for(var E=0,I=0,N=0,D=0;N<this.length;N++){var M=this.words[N]<<D|I;f[E++]=M&255,E<f.length&&(f[E++]=M>>8&255),E<f.length&&(f[E++]=M>>16&255),D===6?(E<f.length&&(f[E++]=M>>24&255),I=0,D=0):(I=M>>>24,D+=2)}if(E<f.length)for(f[E++]=I;E<f.length;)f[E++]=0},o.prototype._toArrayLikeBE=function(f,y){for(var E=f.length-1,I=0,N=0,D=0;N<this.length;N++){var M=this.words[N]<<D|I;f[E--]=M&255,E>=0&&(f[E--]=M>>8&255),E>=0&&(f[E--]=M>>16&255),D===6?(E>=0&&(f[E--]=M>>24&255),I=0,D=0):(I=M>>>24,D+=2)}if(E>=0)for(f[E--]=I;E>=0;)f[E--]=0},Math.clz32?o.prototype._countBits=function(f){return 32-Math.clz32(f)}:o.prototype._countBits=function(f){var y=f,E=0;return y>=4096&&(E+=13,y>>>=13),y>=64&&(E+=7,y>>>=7),y>=8&&(E+=4,y>>>=4),y>=2&&(E+=2,y>>>=2),E+y},o.prototype._zeroBits=function(f){if(f===0)return 26;var y=f,E=0;return(y&8191)===0&&(E+=13,y>>>=13),(y&127)===0&&(E+=7,y>>>=7),(y&15)===0&&(E+=4,y>>>=4),(y&3)===0&&(E+=2,y>>>=2),(y&1)===0&&E++,E},o.prototype.bitLength=function(){var f=this.words[this.length-1],y=this._countBits(f);return(this.length-1)*26+y};function w(C){for(var f=new Array(C.bitLength()),y=0;y<f.length;y++){var E=y/26|0,I=y%26;f[y]=C.words[E]>>>I&1}return f}o.prototype.zeroBits=function(){if(this.isZero())return 0;for(var f=0,y=0;y<this.length;y++){var E=this._zeroBits(this.words[y]);if(f+=E,E!==26)break}return f},o.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},o.prototype.toTwos=function(f){return this.negative!==0?this.abs().inotn(f).iaddn(1):this.clone()},o.prototype.fromTwos=function(f){return this.testn(f-1)?this.notn(f).iaddn(1).ineg():this.clone()},o.prototype.isNeg=function(){return this.negative!==0},o.prototype.neg=function(){return this.clone().ineg()},o.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},o.prototype.iuor=function(f){for(;this.length<f.length;)this.words[this.length++]=0;for(var y=0;y<f.length;y++)this.words[y]=this.words[y]|f.words[y];return this._strip()},o.prototype.ior=function(f){return r((this.negative|f.negative)===0),this.iuor(f)},o.prototype.or=function(f){return this.length>f.length?this.clone().ior(f):f.clone().ior(this)},o.prototype.uor=function(f){return this.length>f.length?this.clone().iuor(f):f.clone().iuor(this)},o.prototype.iuand=function(f){var y;this.length>f.length?y=f:y=this;for(var E=0;E<y.length;E++)this.words[E]=this.words[E]&f.words[E];return this.length=y.length,this._strip()},o.prototype.iand=function(f){return r((this.negative|f.negative)===0),this.iuand(f)},o.prototype.and=function(f){return this.length>f.length?this.clone().iand(f):f.clone().iand(this)},o.prototype.uand=function(f){return this.length>f.length?this.clone().iuand(f):f.clone().iuand(this)},o.prototype.iuxor=function(f){var y,E;this.length>f.length?(y=this,E=f):(y=f,E=this);for(var I=0;I<E.length;I++)this.words[I]=y.words[I]^E.words[I];if(this!==y)for(;I<y.length;I++)this.words[I]=y.words[I];return this.length=y.length,this._strip()},o.prototype.ixor=function(f){return r((this.negative|f.negative)===0),this.iuxor(f)},o.prototype.xor=function(f){return this.length>f.length?this.clone().ixor(f):f.clone().ixor(this)},o.prototype.uxor=function(f){return this.length>f.length?this.clone().iuxor(f):f.clone().iuxor(this)},o.prototype.inotn=function(f){r(typeof f=="number"&&f>=0);var y=Math.ceil(f/26)|0,E=f%26;this._expand(y),E>0&&y--;for(var I=0;I<y;I++)this.words[I]=~this.words[I]&67108863;return E>0&&(this.words[I]=~this.words[I]&67108863>>26-E),this._strip()},o.prototype.notn=function(f){return this.clone().inotn(f)},o.prototype.setn=function(f,y){r(typeof f=="number"&&f>=0);var E=f/26|0,I=f%26;return this._expand(E+1),y?this.words[E]=this.words[E]|1<<I:this.words[E]=this.words[E]&~(1<<I),this._strip()},o.prototype.iadd=function(f){var y;if(this.negative!==0&&f.negative===0)return this.negative=0,y=this.isub(f),this.negative^=1,this._normSign();if(this.negative===0&&f.negative!==0)return f.negative=0,y=this.isub(f),f.negative=1,y._normSign();var E,I;this.length>f.length?(E=this,I=f):(E=f,I=this);for(var N=0,D=0;D<I.length;D++)y=(E.words[D]|0)+(I.words[D]|0)+N,this.words[D]=y&67108863,N=y>>>26;for(;N!==0&&D<E.length;D++)y=(E.words[D]|0)+N,this.words[D]=y&67108863,N=y>>>26;if(this.length=E.length,N!==0)this.words[this.length]=N,this.length++;else if(E!==this)for(;D<E.length;D++)this.words[D]=E.words[D];return this},o.prototype.add=function(f){var y;return f.negative!==0&&this.negative===0?(f.negative=0,y=this.sub(f),f.negative^=1,y):f.negative===0&&this.negative!==0?(this.negative=0,y=f.sub(this),this.negative=1,y):this.length>f.length?this.clone().iadd(f):f.clone().iadd(this)},o.prototype.isub=function(f){if(f.negative!==0){f.negative=0;var y=this.iadd(f);return f.negative=1,y._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(f),this.negative=1,this._normSign();var E=this.cmp(f);if(E===0)return this.negative=0,this.length=1,this.words[0]=0,this;var I,N;E>0?(I=this,N=f):(I=f,N=this);for(var D=0,M=0;M<N.length;M++)y=(I.words[M]|0)-(N.words[M]|0)+D,D=y>>26,this.words[M]=y&67108863;for(;D!==0&&M<I.length;M++)y=(I.words[M]|0)+D,D=y>>26,this.words[M]=y&67108863;if(D===0&&M<I.length&&I!==this)for(;M<I.length;M++)this.words[M]=I.words[M];return this.length=Math.max(this.length,M),I!==this&&(this.negative=1),this._strip()},o.prototype.sub=function(f){return this.clone().isub(f)};function S(C,f,y){y.negative=f.negative^C.negative;var E=C.length+f.length|0;y.length=E,E=E-1|0;var I=C.words[0]|0,N=f.words[0]|0,D=I*N,M=D&67108863,P=D/67108864|0;y.words[0]=M;for(var m=1;m<E;m++){for(var v=P>>>26,B=P&67108863,U=Math.min(m,f.length-1),Q=Math.max(0,m-C.length+1);Q<=U;Q++){var ee=m-Q|0;I=C.words[ee]|0,N=f.words[Q]|0,D=I*N+B,v+=D/67108864|0,B=D&67108863}y.words[m]=B|0,P=v|0}return P!==0?y.words[m]=P|0:y.length--,y._strip()}var O=function(f,y,E){var I=f.words,N=y.words,D=E.words,M=0,P,m,v,B=I[0]|0,U=B&8191,Q=B>>>13,ee=I[1]|0,Z=ee&8191,Y=ee>>>13,re=I[2]|0,de=re&8191,se=re>>>13,me=I[3]|0,Ae=me&8191,Re=me>>>13,Ct=I[4]|0,st=Ct&8191,dt=Ct>>>13,ji=I[5]|0,at=ji&8191,it=ji>>>13,hn=I[6]|0,ft=hn&8191,mt=hn>>>13,hi=I[7]|0,It=hi&8191,_=hi>>>13,x=I[8]|0,A=x&8191,H=x>>>13,te=I[9]|0,ie=te&8191,ue=te>>>13,De=N[0]|0,Le=De&8191,Me=De>>>13,yt=N[1]|0,Ne=yt&8191,Vt=yt>>>13,mT=N[2]|0,Dt=mT&8191,zt=mT>>>13,yT=N[3]|0,Ut=yT&8191,$t=yT>>>13,bT=N[4]|0,Ht=bT&8191,Wt=bT>>>13,vT=N[5]|0,Gt=vT&8191,jt=vT>>>13,wT=N[6]|0,Kt=wT&8191,qt=wT>>>13,xT=N[7]|0,Yt=xT&8191,Qt=xT>>>13,ET=N[8]|0,Xt=ET&8191,Jt=ET>>>13,ST=N[9]|0,Zt=ST&8191,en=ST>>>13;E.negative=f.negative^y.negative,E.length=19,P=Math.imul(U,Le),m=Math.imul(U,Me),m=m+Math.imul(Q,Le)|0,v=Math.imul(Q,Me);var Ab=(M+P|0)+((m&8191)<<13)|0;M=(v+(m>>>13)|0)+(Ab>>>26)|0,Ab&=67108863,P=Math.imul(Z,Le),m=Math.imul(Z,Me),m=m+Math.imul(Y,Le)|0,v=Math.imul(Y,Me),P=P+Math.imul(U,Ne)|0,m=m+Math.imul(U,Vt)|0,m=m+Math.imul(Q,Ne)|0,v=v+Math.imul(Q,Vt)|0;var kb=(M+P|0)+((m&8191)<<13)|0;M=(v+(m>>>13)|0)+(kb>>>26)|0,kb&=67108863,P=Math.imul(de,Le),m=Math.imul(de,Me),m=m+Math.imul(se,Le)|0,v=Math.imul(se,Me),P=P+Math.imul(Z,Ne)|0,m=m+Math.imul(Z,Vt)|0,m=m+Math.imul(Y,Ne)|0,v=v+Math.imul(Y,Vt)|0,P=P+Math.imul(U,Dt)|0,m=m+Math.imul(U,zt)|0,m=m+Math.imul(Q,Dt)|0,v=v+Math.imul(Q,zt)|0;var Cb=(M+P|0)+((m&8191)<<13)|0;M=(v+(m>>>13)|0)+(Cb>>>26)|0,Cb&=67108863,P=Math.imul(Ae,Le),m=Math.imul(Ae,Me),m=m+Math.imul(Re,Le)|0,v=Math.imul(Re,Me),P=P+Math.imul(de,Ne)|0,m=m+Math.imul(de,Vt)|0,m=m+Math.imul(se,Ne)|0,v=v+Math.imul(se,Vt)|0,P=P+Math.imul(Z,Dt)|0,m=m+Math.imul(Z,zt)|0,m=m+Math.imul(Y,Dt)|0,v=v+Math.imul(Y,zt)|0,P=P+Math.imul(U,Ut)|0,m=m+Math.imul(U,$t)|0,m=m+Math.imul(Q,Ut)|0,v=v+Math.imul(Q,$t)|0;var Ib=(M+P|0)+((m&8191)<<13)|0;M=(v+(m>>>13)|0)+(Ib>>>26)|0,Ib&=67108863,P=Math.imul(st,Le),m=Math.imul(st,Me),m=m+Math.imul(dt,Le)|0,v=Math.imul(dt,Me),P=P+Math.imul(Ae,Ne)|0,m=m+Math.imul(Ae,Vt)|0,m=m+Math.imul(Re,Ne)|0,v=v+Math.imul(Re,Vt)|0,P=P+Math.imul(de,Dt)|0,m=m+Math.imul(de,zt)|0,m=m+Math.imul(se,Dt)|0,v=v+Math.imul(se,zt)|0,P=P+Math.imul(Z,Ut)|0,m=m+Math.imul(Z,$t)|0,m=m+Math.imul(Y,Ut)|0,v=v+Math.imul(Y,$t)|0,P=P+Math.imul(U,Ht)|0,m=m+Math.imul(U,Wt)|0,m=m+Math.imul(Q,Ht)|0,v=v+Math.imul(Q,Wt)|0;var Ob=(M+P|0)+((m&8191)<<13)|0;M=(v+(m>>>13)|0)+(Ob>>>26)|0,Ob&=67108863,P=Math.imul(at,Le),m=Math.imul(at,Me),m=m+Math.imul(it,Le)|0,v=Math.imul(it,Me),P=P+Math.imul(st,Ne)|0,m=m+Math.imul(st,Vt)|0,m=m+Math.imul(dt,Ne)|0,v=v+Math.imul(dt,Vt)|0,P=P+Math.imul(Ae,Dt)|0,m=m+Math.imul(Ae,zt)|0,m=m+Math.imul(Re,Dt)|0,v=v+Math.imul(Re,zt)|0,P=P+Math.imul(de,Ut)|0,m=m+Math.imul(de,$t)|0,m=m+Math.imul(se,Ut)|0,v=v+Math.imul(se,$t)|0,P=P+Math.imul(Z,Ht)|0,m=m+Math.imul(Z,Wt)|0,m=m+Math.imul(Y,Ht)|0,v=v+Math.imul(Y,Wt)|0,P=P+Math.imul(U,Gt)|0,m=m+Math.imul(U,jt)|0,m=m+Math.imul(Q,Gt)|0,v=v+Math.imul(Q,jt)|0;var Tb=(M+P|0)+((m&8191)<<13)|0;M=(v+(m>>>13)|0)+(Tb>>>26)|0,Tb&=67108863,P=Math.imul(ft,Le),m=Math.imul(ft,Me),m=m+Math.imul(mt,Le)|0,v=Math.imul(mt,Me),P=P+Math.imul(at,Ne)|0,m=m+Math.imul(at,Vt)|0,m=m+Math.imul(it,Ne)|0,v=v+Math.imul(it,Vt)|0,P=P+Math.imul(st,Dt)|0,m=m+Math.imul(st,zt)|0,m=m+Math.imul(dt,Dt)|0,v=v+Math.imul(dt,zt)|0,P=P+Math.imul(Ae,Ut)|0,m=m+Math.imul(Ae,$t)|0,m=m+Math.imul(Re,Ut)|0,v=v+Math.imul(Re,$t)|0,P=P+Math.imul(de,Ht)|0,m=m+Math.imul(de,Wt)|0,m=m+Math.imul(se,Ht)|0,v=v+Math.imul(se,Wt)|0,P=P+Math.imul(Z,Gt)|0,m=m+Math.imul(Z,jt)|0,m=m+Math.imul(Y,Gt)|0,v=v+Math.imul(Y,jt)|0,P=P+Math.imul(U,Kt)|0,m=m+Math.imul(U,qt)|0,m=m+Math.imul(Q,Kt)|0,v=v+Math.imul(Q,qt)|0;var Pb=(M+P|0)+((m&8191)<<13)|0;M=(v+(m>>>13)|0)+(Pb>>>26)|0,Pb&=67108863,P=Math.imul(It,Le),m=Math.imul(It,Me),m=m+Math.imul(_,Le)|0,v=Math.imul(_,Me),P=P+Math.imul(ft,Ne)|0,m=m+Math.imul(ft,Vt)|0,m=m+Math.imul(mt,Ne)|0,v=v+Math.imul(mt,Vt)|0,P=P+Math.imul(at,Dt)|0,m=m+Math.imul(at,zt)|0,m=m+Math.imul(it,Dt)|0,v=v+Math.imul(it,zt)|0,P=P+Math.imul(st,Ut)|0,m=m+Math.imul(st,$t)|0,m=m+Math.imul(dt,Ut)|0,v=v+Math.imul(dt,$t)|0,P=P+Math.imul(Ae,Ht)|0,m=m+Math.imul(Ae,Wt)|0,m=m+Math.imul(Re,Ht)|0,v=v+Math.imul(Re,Wt)|0,P=P+Math.imul(de,Gt)|0,m=m+Math.imul(de,jt)|0,m=m+Math.imul(se,Gt)|0,v=v+Math.imul(se,jt)|0,P=P+Math.imul(Z,Kt)|0,m=m+Math.imul(Z,qt)|0,m=m+Math.imul(Y,Kt)|0,v=v+Math.imul(Y,qt)|0,P=P+Math.imul(U,Yt)|0,m=m+Math.imul(U,Qt)|0,m=m+Math.imul(Q,Yt)|0,v=v+Math.imul(Q,Qt)|0;var Nb=(M+P|0)+((m&8191)<<13)|0;M=(v+(m>>>13)|0)+(Nb>>>26)|0,Nb&=67108863,P=Math.imul(A,Le),m=Math.imul(A,Me),m=m+Math.imul(H,Le)|0,v=Math.imul(H,Me),P=P+Math.imul(It,Ne)|0,m=m+Math.imul(It,Vt)|0,m=m+Math.imul(_,Ne)|0,v=v+Math.imul(_,Vt)|0,P=P+Math.imul(ft,Dt)|0,m=m+Math.imul(ft,zt)|0,m=m+Math.imul(mt,Dt)|0,v=v+Math.imul(mt,zt)|0,P=P+Math.imul(at,Ut)|0,m=m+Math.imul(at,$t)|0,m=m+Math.imul(it,Ut)|0,v=v+Math.imul(it,$t)|0,P=P+Math.imul(st,Ht)|0,m=m+Math.imul(st,Wt)|0,m=m+Math.imul(dt,Ht)|0,v=v+Math.imul(dt,Wt)|0,P=P+Math.imul(Ae,Gt)|0,m=m+Math.imul(Ae,jt)|0,m=m+Math.imul(Re,Gt)|0,v=v+Math.imul(Re,jt)|0,P=P+Math.imul(de,Kt)|0,m=m+Math.imul(de,qt)|0,m=m+Math.imul(se,Kt)|0,v=v+Math.imul(se,qt)|0,P=P+Math.imul(Z,Yt)|0,m=m+Math.imul(Z,Qt)|0,m=m+Math.imul(Y,Yt)|0,v=v+Math.imul(Y,Qt)|0,P=P+Math.imul(U,Xt)|0,m=m+Math.imul(U,Jt)|0,m=m+Math.imul(Q,Xt)|0,v=v+Math.imul(Q,Jt)|0;var Bb=(M+P|0)+((m&8191)<<13)|0;M=(v+(m>>>13)|0)+(Bb>>>26)|0,Bb&=67108863,P=Math.imul(ie,Le),m=Math.imul(ie,Me),m=m+Math.imul(ue,Le)|0,v=Math.imul(ue,Me),P=P+Math.imul(A,Ne)|0,m=m+Math.imul(A,Vt)|0,m=m+Math.imul(H,Ne)|0,v=v+Math.imul(H,Vt)|0,P=P+Math.imul(It,Dt)|0,m=m+Math.imul(It,zt)|0,m=m+Math.imul(_,Dt)|0,v=v+Math.imul(_,zt)|0,P=P+Math.imul(ft,Ut)|0,m=m+Math.imul(ft,$t)|0,m=m+Math.imul(mt,Ut)|0,v=v+Math.imul(mt,$t)|0,P=P+Math.imul(at,Ht)|0,m=m+Math.imul(at,Wt)|0,m=m+Math.imul(it,Ht)|0,v=v+Math.imul(it,Wt)|0,P=P+Math.imul(st,Gt)|0,m=m+Math.imul(st,jt)|0,m=m+Math.imul(dt,Gt)|0,v=v+Math.imul(dt,jt)|0,P=P+Math.imul(Ae,Kt)|0,m=m+Math.imul(Ae,qt)|0,m=m+Math.imul(Re,Kt)|0,v=v+Math.imul(Re,qt)|0,P=P+Math.imul(de,Yt)|0,m=m+Math.imul(de,Qt)|0,m=m+Math.imul(se,Yt)|0,v=v+Math.imul(se,Qt)|0,P=P+Math.imul(Z,Xt)|0,m=m+Math.imul(Z,Jt)|0,m=m+Math.imul(Y,Xt)|0,v=v+Math.imul(Y,Jt)|0,P=P+Math.imul(U,Zt)|0,m=m+Math.imul(U,en)|0,m=m+Math.imul(Q,Zt)|0,v=v+Math.imul(Q,en)|0;var Rb=(M+P|0)+((m&8191)<<13)|0;M=(v+(m>>>13)|0)+(Rb>>>26)|0,Rb&=67108863,P=Math.imul(ie,Ne),m=Math.imul(ie,Vt),m=m+Math.imul(ue,Ne)|0,v=Math.imul(ue,Vt),P=P+Math.imul(A,Dt)|0,m=m+Math.imul(A,zt)|0,m=m+Math.imul(H,Dt)|0,v=v+Math.imul(H,zt)|0,P=P+Math.imul(It,Ut)|0,m=m+Math.imul(It,$t)|0,m=m+Math.imul(_,Ut)|0,v=v+Math.imul(_,$t)|0,P=P+Math.imul(ft,Ht)|0,m=m+Math.imul(ft,Wt)|0,m=m+Math.imul(mt,Ht)|0,v=v+Math.imul(mt,Wt)|0,P=P+Math.imul(at,Gt)|0,m=m+Math.imul(at,jt)|0,m=m+Math.imul(it,Gt)|0,v=v+Math.imul(it,jt)|0,P=P+Math.imul(st,Kt)|0,m=m+Math.imul(st,qt)|0,m=m+Math.imul(dt,Kt)|0,v=v+Math.imul(dt,qt)|0,P=P+Math.imul(Ae,Yt)|0,m=m+Math.imul(Ae,Qt)|0,m=m+Math.imul(Re,Yt)|0,v=v+Math.imul(Re,Qt)|0,P=P+Math.imul(de,Xt)|0,m=m+Math.imul(de,Jt)|0,m=m+Math.imul(se,Xt)|0,v=v+Math.imul(se,Jt)|0,P=P+Math.imul(Z,Zt)|0,m=m+Math.imul(Z,en)|0,m=m+Math.imul(Y,Zt)|0,v=v+Math.imul(Y,en)|0;var Mb=(M+P|0)+((m&8191)<<13)|0;M=(v+(m>>>13)|0)+(Mb>>>26)|0,Mb&=67108863,P=Math.imul(ie,Dt),m=Math.imul(ie,zt),m=m+Math.imul(ue,Dt)|0,v=Math.imul(ue,zt),P=P+Math.imul(A,Ut)|0,m=m+Math.imul(A,$t)|0,m=m+Math.imul(H,Ut)|0,v=v+Math.imul(H,$t)|0,P=P+Math.imul(It,Ht)|0,m=m+Math.imul(It,Wt)|0,m=m+Math.imul(_,Ht)|0,v=v+Math.imul(_,Wt)|0,P=P+Math.imul(ft,Gt)|0,m=m+Math.imul(ft,jt)|0,m=m+Math.imul(mt,Gt)|0,v=v+Math.imul(mt,jt)|0,P=P+Math.imul(at,Kt)|0,m=m+Math.imul(at,qt)|0,m=m+Math.imul(it,Kt)|0,v=v+Math.imul(it,qt)|0,P=P+Math.imul(st,Yt)|0,m=m+Math.imul(st,Qt)|0,m=m+Math.imul(dt,Yt)|0,v=v+Math.imul(dt,Qt)|0,P=P+Math.imul(Ae,Xt)|0,m=m+Math.imul(Ae,Jt)|0,m=m+Math.imul(Re,Xt)|0,v=v+Math.imul(Re,Jt)|0,P=P+Math.imul(de,Zt)|0,m=m+Math.imul(de,en)|0,m=m+Math.imul(se,Zt)|0,v=v+Math.imul(se,en)|0;var Lb=(M+P|0)+((m&8191)<<13)|0;M=(v+(m>>>13)|0)+(Lb>>>26)|0,Lb&=67108863,P=Math.imul(ie,Ut),m=Math.imul(ie,$t),m=m+Math.imul(ue,Ut)|0,v=Math.imul(ue,$t),P=P+Math.imul(A,Ht)|0,m=m+Math.imul(A,Wt)|0,m=m+Math.imul(H,Ht)|0,v=v+Math.imul(H,Wt)|0,P=P+Math.imul(It,Gt)|0,m=m+Math.imul(It,jt)|0,m=m+Math.imul(_,Gt)|0,v=v+Math.imul(_,jt)|0,P=P+Math.imul(ft,Kt)|0,m=m+Math.imul(ft,qt)|0,m=m+Math.imul(mt,Kt)|0,v=v+Math.imul(mt,qt)|0,P=P+Math.imul(at,Yt)|0,m=m+Math.imul(at,Qt)|0,m=m+Math.imul(it,Yt)|0,v=v+Math.imul(it,Qt)|0,P=P+Math.imul(st,Xt)|0,m=m+Math.imul(st,Jt)|0,m=m+Math.imul(dt,Xt)|0,v=v+Math.imul(dt,Jt)|0,P=P+Math.imul(Ae,Zt)|0,m=m+Math.imul(Ae,en)|0,m=m+Math.imul(Re,Zt)|0,v=v+Math.imul(Re,en)|0;var Fb=(M+P|0)+((m&8191)<<13)|0;M=(v+(m>>>13)|0)+(Fb>>>26)|0,Fb&=67108863,P=Math.imul(ie,Ht),m=Math.imul(ie,Wt),m=m+Math.imul(ue,Ht)|0,v=Math.imul(ue,Wt),P=P+Math.imul(A,Gt)|0,m=m+Math.imul(A,jt)|0,m=m+Math.imul(H,Gt)|0,v=v+Math.imul(H,jt)|0,P=P+Math.imul(It,Kt)|0,m=m+Math.imul(It,qt)|0,m=m+Math.imul(_,Kt)|0,v=v+Math.imul(_,qt)|0,P=P+Math.imul(ft,Yt)|0,m=m+Math.imul(ft,Qt)|0,m=m+Math.imul(mt,Yt)|0,v=v+Math.imul(mt,Qt)|0,P=P+Math.imul(at,Xt)|0,m=m+Math.imul(at,Jt)|0,m=m+Math.imul(it,Xt)|0,v=v+Math.imul(it,Jt)|0,P=P+Math.imul(st,Zt)|0,m=m+Math.imul(st,en)|0,m=m+Math.imul(dt,Zt)|0,v=v+Math.imul(dt,en)|0;var _b=(M+P|0)+((m&8191)<<13)|0;M=(v+(m>>>13)|0)+(_b>>>26)|0,_b&=67108863,P=Math.imul(ie,Gt),m=Math.imul(ie,jt),m=m+Math.imul(ue,Gt)|0,v=Math.imul(ue,jt),P=P+Math.imul(A,Kt)|0,m=m+Math.imul(A,qt)|0,m=m+Math.imul(H,Kt)|0,v=v+Math.imul(H,qt)|0,P=P+Math.imul(It,Yt)|0,m=m+Math.imul(It,Qt)|0,m=m+Math.imul(_,Yt)|0,v=v+Math.imul(_,Qt)|0,P=P+Math.imul(ft,Xt)|0,m=m+Math.imul(ft,Jt)|0,m=m+Math.imul(mt,Xt)|0,v=v+Math.imul(mt,Jt)|0,P=P+Math.imul(at,Zt)|0,m=m+Math.imul(at,en)|0,m=m+Math.imul(it,Zt)|0,v=v+Math.imul(it,en)|0;var Vb=(M+P|0)+((m&8191)<<13)|0;M=(v+(m>>>13)|0)+(Vb>>>26)|0,Vb&=67108863,P=Math.imul(ie,Kt),m=Math.imul(ie,qt),m=m+Math.imul(ue,Kt)|0,v=Math.imul(ue,qt),P=P+Math.imul(A,Yt)|0,m=m+Math.imul(A,Qt)|0,m=m+Math.imul(H,Yt)|0,v=v+Math.imul(H,Qt)|0,P=P+Math.imul(It,Xt)|0,m=m+Math.imul(It,Jt)|0,m=m+Math.imul(_,Xt)|0,v=v+Math.imul(_,Jt)|0,P=P+Math.imul(ft,Zt)|0,m=m+Math.imul(ft,en)|0,m=m+Math.imul(mt,Zt)|0,v=v+Math.imul(mt,en)|0;var Db=(M+P|0)+((m&8191)<<13)|0;M=(v+(m>>>13)|0)+(Db>>>26)|0,Db&=67108863,P=Math.imul(ie,Yt),m=Math.imul(ie,Qt),m=m+Math.imul(ue,Yt)|0,v=Math.imul(ue,Qt),P=P+Math.imul(A,Xt)|0,m=m+Math.imul(A,Jt)|0,m=m+Math.imul(H,Xt)|0,v=v+Math.imul(H,Jt)|0,P=P+Math.imul(It,Zt)|0,m=m+Math.imul(It,en)|0,m=m+Math.imul(_,Zt)|0,v=v+Math.imul(_,en)|0;var zb=(M+P|0)+((m&8191)<<13)|0;M=(v+(m>>>13)|0)+(zb>>>26)|0,zb&=67108863,P=Math.imul(ie,Xt),m=Math.imul(ie,Jt),m=m+Math.imul(ue,Xt)|0,v=Math.imul(ue,Jt),P=P+Math.imul(A,Zt)|0,m=m+Math.imul(A,en)|0,m=m+Math.imul(H,Zt)|0,v=v+Math.imul(H,en)|0;var Ub=(M+P|0)+((m&8191)<<13)|0;M=(v+(m>>>13)|0)+(Ub>>>26)|0,Ub&=67108863,P=Math.imul(ie,Zt),m=Math.imul(ie,en),m=m+Math.imul(ue,Zt)|0,v=Math.imul(ue,en);var $b=(M+P|0)+((m&8191)<<13)|0;return M=(v+(m>>>13)|0)+($b>>>26)|0,$b&=67108863,D[0]=Ab,D[1]=kb,D[2]=Cb,D[3]=Ib,D[4]=Ob,D[5]=Tb,D[6]=Pb,D[7]=Nb,D[8]=Bb,D[9]=Rb,D[10]=Mb,D[11]=Lb,D[12]=Fb,D[13]=_b,D[14]=Vb,D[15]=Db,D[16]=zb,D[17]=Ub,D[18]=$b,M!==0&&(D[19]=M,E.length++),E};Math.imul||(O=S);function T(C,f,y){y.negative=f.negative^C.negative,y.length=C.length+f.length;for(var E=0,I=0,N=0;N<y.length-1;N++){var D=I;I=0;for(var M=E&67108863,P=Math.min(N,f.length-1),m=Math.max(0,N-C.length+1);m<=P;m++){var v=N-m,B=C.words[v]|0,U=f.words[m]|0,Q=B*U,ee=Q&67108863;D=D+(Q/67108864|0)|0,ee=ee+M|0,M=ee&67108863,D=D+(ee>>>26)|0,I+=D>>>26,D&=67108863}y.words[N]=M,E=D,D=I}return E!==0?y.words[N]=E:y.length--,y._strip()}function $(C,f,y){return T(C,f,y)}o.prototype.mulTo=function(f,y){var E,I=this.length+f.length;return this.length===10&&f.length===10?E=O(this,f,y):I<63?E=S(this,f,y):I<1024?E=T(this,f,y):E=$(this,f,y),E},o.prototype.mul=function(f){var y=new o(null);return y.words=new Array(this.length+f.length),this.mulTo(f,y)},o.prototype.mulf=function(f){var y=new o(null);return y.words=new Array(this.length+f.length),$(this,f,y)},o.prototype.imul=function(f){return this.clone().mulTo(f,this)},o.prototype.imuln=function(f){var y=f<0;y&&(f=-f),r(typeof f=="number"),r(f<67108864);for(var E=0,I=0;I<this.length;I++){var N=(this.words[I]|0)*f,D=(N&67108863)+(E&67108863);E>>=26,E+=N/67108864|0,E+=D>>>26,this.words[I]=D&67108863}return E!==0&&(this.words[I]=E,this.length++),this.length=f===0?1:this.length,y?this.ineg():this},o.prototype.muln=function(f){return this.clone().imuln(f)},o.prototype.sqr=function(){return this.mul(this)},o.prototype.isqr=function(){return this.imul(this.clone())},o.prototype.pow=function(f){var y=w(f);if(y.length===0)return new o(1);for(var E=this,I=0;I<y.length&&y[I]===0;I++,E=E.sqr());if(++I<y.length)for(var N=E.sqr();I<y.length;I++,N=N.sqr())y[I]!==0&&(E=E.mul(N));return E},o.prototype.iushln=function(f){r(typeof f=="number"&&f>=0);var y=f%26,E=(f-y)/26,I=67108863>>>26-y<<26-y,N;if(y!==0){var D=0;for(N=0;N<this.length;N++){var M=this.words[N]&I,P=(this.words[N]|0)-M<<y;this.words[N]=P|D,D=M>>>26-y}D&&(this.words[N]=D,this.length++)}if(E!==0){for(N=this.length-1;N>=0;N--)this.words[N+E]=this.words[N];for(N=0;N<E;N++)this.words[N]=0;this.length+=E}return this._strip()},o.prototype.ishln=function(f){return r(this.negative===0),this.iushln(f)},o.prototype.iushrn=function(f,y,E){r(typeof f=="number"&&f>=0);var I;y?I=(y-y%26)/26:I=0;var N=f%26,D=Math.min((f-N)/26,this.length),M=67108863^67108863>>>N<<N,P=E;if(I-=D,I=Math.max(0,I),P){for(var m=0;m<D;m++)P.words[m]=this.words[m];P.length=D}if(D!==0)if(this.length>D)for(this.length-=D,m=0;m<this.length;m++)this.words[m]=this.words[m+D];else this.words[0]=0,this.length=1;var v=0;for(m=this.length-1;m>=0&&(v!==0||m>=I);m--){var B=this.words[m]|0;this.words[m]=v<<26-N|B>>>N,v=B&M}return P&&v!==0&&(P.words[P.length++]=v),this.length===0&&(this.words[0]=0,this.length=1),this._strip()},o.prototype.ishrn=function(f,y,E){return r(this.negative===0),this.iushrn(f,y,E)},o.prototype.shln=function(f){return this.clone().ishln(f)},o.prototype.ushln=function(f){return this.clone().iushln(f)},o.prototype.shrn=function(f){return this.clone().ishrn(f)},o.prototype.ushrn=function(f){return this.clone().iushrn(f)},o.prototype.testn=function(f){r(typeof f=="number"&&f>=0);var y=f%26,E=(f-y)/26,I=1<<y;if(this.length<=E)return!1;var N=this.words[E];return!!(N&I)},o.prototype.imaskn=function(f){r(typeof f=="number"&&f>=0);var y=f%26,E=(f-y)/26;if(r(this.negative===0,"imaskn works only with positive numbers"),this.length<=E)return this;if(y!==0&&E++,this.length=Math.min(E,this.length),y!==0){var I=67108863^67108863>>>y<<y;this.words[this.length-1]&=I}return this._strip()},o.prototype.maskn=function(f){return this.clone().imaskn(f)},o.prototype.iaddn=function(f){return r(typeof f=="number"),r(f<67108864),f<0?this.isubn(-f):this.negative!==0?this.length===1&&(this.words[0]|0)<=f?(this.words[0]=f-(this.words[0]|0),this.negative=0,this):(this.negative=0,this.isubn(f),this.negative=1,this):this._iaddn(f)},o.prototype._iaddn=function(f){this.words[0]+=f;for(var y=0;y<this.length&&this.words[y]>=67108864;y++)this.words[y]-=67108864,y===this.length-1?this.words[y+1]=1:this.words[y+1]++;return this.length=Math.max(this.length,y+1),this},o.prototype.isubn=function(f){if(r(typeof f=="number"),r(f<67108864),f<0)return this.iaddn(-f);if(this.negative!==0)return this.negative=0,this.iaddn(f),this.negative=1,this;if(this.words[0]-=f,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var y=0;y<this.length&&this.words[y]<0;y++)this.words[y]+=67108864,this.words[y+1]-=1;return this._strip()},o.prototype.addn=function(f){return this.clone().iaddn(f)},o.prototype.subn=function(f){return this.clone().isubn(f)},o.prototype.iabs=function(){return this.negative=0,this},o.prototype.abs=function(){return this.clone().iabs()},o.prototype._ishlnsubmul=function(f,y,E){var I=f.length+E,N;this._expand(I);var D,M=0;for(N=0;N<f.length;N++){D=(this.words[N+E]|0)+M;var P=(f.words[N]|0)*y;D-=P&67108863,M=(D>>26)-(P/67108864|0),this.words[N+E]=D&67108863}for(;N<this.length-E;N++)D=(this.words[N+E]|0)+M,M=D>>26,this.words[N+E]=D&67108863;if(M===0)return this._strip();for(r(M===-1),M=0,N=0;N<this.length;N++)D=-(this.words[N]|0)+M,M=D>>26,this.words[N]=D&67108863;return this.negative=1,this._strip()},o.prototype._wordDiv=function(f,y){var E=this.length-f.length,I=this.clone(),N=f,D=N.words[N.length-1]|0,M=this._countBits(D);E=26-M,E!==0&&(N=N.ushln(E),I.iushln(E),D=N.words[N.length-1]|0);var P=I.length-N.length,m;if(y!=="mod"){m=new o(null),m.length=P+1,m.words=new Array(m.length);for(var v=0;v<m.length;v++)m.words[v]=0}var B=I.clone()._ishlnsubmul(N,1,P);B.negative===0&&(I=B,m&&(m.words[P]=1));for(var U=P-1;U>=0;U--){var Q=(I.words[N.length+U]|0)*67108864+(I.words[N.length+U-1]|0);for(Q=Math.min(Q/D|0,67108863),I._ishlnsubmul(N,Q,U);I.negative!==0;)Q--,I.negative=0,I._ishlnsubmul(N,1,U),I.isZero()||(I.negative^=1);m&&(m.words[U]=Q)}return m&&m._strip(),I._strip(),y!=="div"&&E!==0&&I.iushrn(E),{div:m||null,mod:I}},o.prototype.divmod=function(f,y,E){if(r(!f.isZero()),this.isZero())return{div:new o(0),mod:new o(0)};var I,N,D;return this.negative!==0&&f.negative===0?(D=this.neg().divmod(f,y),y!=="mod"&&(I=D.div.neg()),y!=="div"&&(N=D.mod.neg(),E&&N.negative!==0&&N.iadd(f)),{div:I,mod:N}):this.negative===0&&f.negative!==0?(D=this.divmod(f.neg(),y),y!=="mod"&&(I=D.div.neg()),{div:I,mod:D.mod}):(this.negative&f.negative)!==0?(D=this.neg().divmod(f.neg(),y),y!=="div"&&(N=D.mod.neg(),E&&N.negative!==0&&N.isub(f)),{div:D.div,mod:N}):f.length>this.length||this.cmp(f)<0?{div:new o(0),mod:this}:f.length===1?y==="div"?{div:this.divn(f.words[0]),mod:null}:y==="mod"?{div:null,mod:new o(this.modrn(f.words[0]))}:{div:this.divn(f.words[0]),mod:new o(this.modrn(f.words[0]))}:this._wordDiv(f,y)},o.prototype.div=function(f){return this.divmod(f,"div",!1).div},o.prototype.mod=function(f){return this.divmod(f,"mod",!1).mod},o.prototype.umod=function(f){return this.divmod(f,"mod",!0).mod},o.prototype.divRound=function(f){var y=this.divmod(f);if(y.mod.isZero())return y.div;var E=y.div.negative!==0?y.mod.isub(f):y.mod,I=f.ushrn(1),N=f.andln(1),D=E.cmp(I);return D<0||N===1&&D===0?y.div:y.div.negative!==0?y.div.isubn(1):y.div.iaddn(1)},o.prototype.modrn=function(f){var y=f<0;y&&(f=-f),r(f<=67108863);for(var E=(1<<26)%f,I=0,N=this.length-1;N>=0;N--)I=(E*I+(this.words[N]|0))%f;return y?-I:I},o.prototype.modn=function(f){return this.modrn(f)},o.prototype.idivn=function(f){var y=f<0;y&&(f=-f),r(f<=67108863);for(var E=0,I=this.length-1;I>=0;I--){var N=(this.words[I]|0)+E*67108864;this.words[I]=N/f|0,E=N%f}return this._strip(),y?this.ineg():this},o.prototype.divn=function(f){return this.clone().idivn(f)},o.prototype.egcd=function(f){r(f.negative===0),r(!f.isZero());var y=this,E=f.clone();y.negative!==0?y=y.umod(f):y=y.clone();for(var I=new o(1),N=new o(0),D=new o(0),M=new o(1),P=0;y.isEven()&&E.isEven();)y.iushrn(1),E.iushrn(1),++P;for(var m=E.clone(),v=y.clone();!y.isZero();){for(var B=0,U=1;(y.words[0]&U)===0&&B<26;++B,U<<=1);if(B>0)for(y.iushrn(B);B-- >0;)(I.isOdd()||N.isOdd())&&(I.iadd(m),N.isub(v)),I.iushrn(1),N.iushrn(1);for(var Q=0,ee=1;(E.words[0]&ee)===0&&Q<26;++Q,ee<<=1);if(Q>0)for(E.iushrn(Q);Q-- >0;)(D.isOdd()||M.isOdd())&&(D.iadd(m),M.isub(v)),D.iushrn(1),M.iushrn(1);y.cmp(E)>=0?(y.isub(E),I.isub(D),N.isub(M)):(E.isub(y),D.isub(I),M.isub(N))}return{a:D,b:M,gcd:E.iushln(P)}},o.prototype._invmp=function(f){r(f.negative===0),r(!f.isZero());var y=this,E=f.clone();y.negative!==0?y=y.umod(f):y=y.clone();for(var I=new o(1),N=new o(0),D=E.clone();y.cmpn(1)>0&&E.cmpn(1)>0;){for(var M=0,P=1;(y.words[0]&P)===0&&M<26;++M,P<<=1);if(M>0)for(y.iushrn(M);M-- >0;)I.isOdd()&&I.iadd(D),I.iushrn(1);for(var m=0,v=1;(E.words[0]&v)===0&&m<26;++m,v<<=1);if(m>0)for(E.iushrn(m);m-- >0;)N.isOdd()&&N.iadd(D),N.iushrn(1);y.cmp(E)>=0?(y.isub(E),I.isub(N)):(E.isub(y),N.isub(I))}var B;return y.cmpn(1)===0?B=I:B=N,B.cmpn(0)<0&&B.iadd(f),B},o.prototype.gcd=function(f){if(this.isZero())return f.abs();if(f.isZero())return this.abs();var y=this.clone(),E=f.clone();y.negative=0,E.negative=0;for(var I=0;y.isEven()&&E.isEven();I++)y.iushrn(1),E.iushrn(1);do{for(;y.isEven();)y.iushrn(1);for(;E.isEven();)E.iushrn(1);var N=y.cmp(E);if(N<0){var D=y;y=E,E=D}else if(N===0||E.cmpn(1)===0)break;y.isub(E)}while(!0);return E.iushln(I)},o.prototype.invm=function(f){return this.egcd(f).a.umod(f)},o.prototype.isEven=function(){return(this.words[0]&1)===0},o.prototype.isOdd=function(){return(this.words[0]&1)===1},o.prototype.andln=function(f){return this.words[0]&f},o.prototype.bincn=function(f){r(typeof f=="number");var y=f%26,E=(f-y)/26,I=1<<y;if(this.length<=E)return this._expand(E+1),this.words[E]|=I,this;for(var N=I,D=E;N!==0&&D<this.length;D++){var M=this.words[D]|0;M+=N,N=M>>>26,M&=67108863,this.words[D]=M}return N!==0&&(this.words[D]=N,this.length++),this},o.prototype.isZero=function(){return this.length===1&&this.words[0]===0},o.prototype.cmpn=function(f){var y=f<0;if(this.negative!==0&&!y)return-1;if(this.negative===0&&y)return 1;this._strip();var E;if(this.length>1)E=1;else{y&&(f=-f),r(f<=67108863,"Number is too big");var I=this.words[0]|0;E=I===f?0:I<f?-1:1}return this.negative!==0?-E|0:E},o.prototype.cmp=function(f){if(this.negative!==0&&f.negative===0)return-1;if(this.negative===0&&f.negative!==0)return 1;var y=this.ucmp(f);return this.negative!==0?-y|0:y},o.prototype.ucmp=function(f){if(this.length>f.length)return 1;if(this.length<f.length)return-1;for(var y=0,E=this.length-1;E>=0;E--){var I=this.words[E]|0,N=f.words[E]|0;if(I!==N){I<N?y=-1:I>N&&(y=1);break}}return y},o.prototype.gtn=function(f){return this.cmpn(f)===1},o.prototype.gt=function(f){return this.cmp(f)===1},o.prototype.gten=function(f){return this.cmpn(f)>=0},o.prototype.gte=function(f){return this.cmp(f)>=0},o.prototype.ltn=function(f){return this.cmpn(f)===-1},o.prototype.lt=function(f){return this.cmp(f)===-1},o.prototype.lten=function(f){return this.cmpn(f)<=0},o.prototype.lte=function(f){return this.cmp(f)<=0},o.prototype.eqn=function(f){return this.cmpn(f)===0},o.prototype.eq=function(f){return this.cmp(f)===0},o.red=function(f){return new W(f)},o.prototype.toRed=function(f){return r(!this.red,"Already a number in reduction context"),r(this.negative===0,"red works only with positives"),f.convertTo(this)._forceRed(f)},o.prototype.fromRed=function(){return r(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},o.prototype._forceRed=function(f){return this.red=f,this},o.prototype.forceRed=function(f){return r(!this.red,"Already a number in reduction context"),this._forceRed(f)},o.prototype.redAdd=function(f){return r(this.red,"redAdd works only with red numbers"),this.red.add(this,f)},o.prototype.redIAdd=function(f){return r(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,f)},o.prototype.redSub=function(f){return r(this.red,"redSub works only with red numbers"),this.red.sub(this,f)},o.prototype.redISub=function(f){return r(this.red,"redISub works only with red numbers"),this.red.isub(this,f)},o.prototype.redShl=function(f){return r(this.red,"redShl works only with red numbers"),this.red.shl(this,f)},o.prototype.redMul=function(f){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,f),this.red.mul(this,f)},o.prototype.redIMul=function(f){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,f),this.red.imul(this,f)},o.prototype.redSqr=function(){return r(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},o.prototype.redISqr=function(){return r(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},o.prototype.redSqrt=function(){return r(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},o.prototype.redInvm=function(){return r(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},o.prototype.redNeg=function(){return r(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},o.prototype.redPow=function(f){return r(this.red&&!f.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,f)};var R={k256:null,p224:null,p192:null,p25519:null};function j(C,f){this.name=C,this.p=new o(f,16),this.n=this.p.bitLength(),this.k=new o(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}j.prototype._tmp=function(){var f=new o(null);return f.words=new Array(Math.ceil(this.n/13)),f},j.prototype.ireduce=function(f){var y=f,E;do this.split(y,this.tmp),y=this.imulK(y),y=y.iadd(this.tmp),E=y.bitLength();while(E>this.n);var I=E<this.n?-1:y.ucmp(this.p);return I===0?(y.words[0]=0,y.length=1):I>0?y.isub(this.p):y.strip!==void 0?y.strip():y._strip(),y},j.prototype.split=function(f,y){f.iushrn(this.n,0,y)},j.prototype.imulK=function(f){return f.imul(this.k)};function q(){j.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}i(q,j),q.prototype.split=function(f,y){for(var E=4194303,I=Math.min(f.length,9),N=0;N<I;N++)y.words[N]=f.words[N];if(y.length=I,f.length<=9){f.words[0]=0,f.length=1;return}var D=f.words[9];for(y.words[y.length++]=D&E,N=10;N<f.length;N++){var M=f.words[N]|0;f.words[N-10]=(M&E)<<4|D>>>22,D=M}D>>>=22,f.words[N-10]=D,D===0&&f.length>10?f.length-=10:f.length-=9},q.prototype.imulK=function(f){f.words[f.length]=0,f.words[f.length+1]=0,f.length+=2;for(var y=0,E=0;E<f.length;E++){var I=f.words[E]|0;y+=I*977,f.words[E]=y&67108863,y=I*64+(y/67108864|0)}return f.words[f.length-1]===0&&(f.length--,f.words[f.length-1]===0&&f.length--),f};function G(){j.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}i(G,j);function L(){j.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}i(L,j);function V(){j.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}i(V,j),V.prototype.imulK=function(f){for(var y=0,E=0;E<f.length;E++){var I=(f.words[E]|0)*19+y,N=I&67108863;I>>>=26,f.words[E]=N,y=I}return y!==0&&(f.words[f.length++]=y),f},o._prime=function(f){if(R[f])return R[f];var y;if(f==="k256")y=new q;else if(f==="p224")y=new G;else if(f==="p192")y=new L;else if(f==="p25519")y=new V;else throw new Error("Unknown prime "+f);return R[f]=y,y};function W(C){if(typeof C=="string"){var f=o._prime(C);this.m=f.p,this.prime=f}else r(C.gtn(1),"modulus must be greater than 1"),this.m=C,this.prime=null}W.prototype._verify1=function(f){r(f.negative===0,"red works only with positives"),r(f.red,"red works only with red numbers")},W.prototype._verify2=function(f,y){r((f.negative|y.negative)===0,"red works only with positives"),r(f.red&&f.red===y.red,"red works only with red numbers")},W.prototype.imod=function(f){return this.prime?this.prime.ireduce(f)._forceRed(this):(u(f,f.umod(this.m)._forceRed(this)),f)},W.prototype.neg=function(f){return f.isZero()?f.clone():this.m.sub(f)._forceRed(this)},W.prototype.add=function(f,y){this._verify2(f,y);var E=f.add(y);return E.cmp(this.m)>=0&&E.isub(this.m),E._forceRed(this)},W.prototype.iadd=function(f,y){this._verify2(f,y);var E=f.iadd(y);return E.cmp(this.m)>=0&&E.isub(this.m),E},W.prototype.sub=function(f,y){this._verify2(f,y);var E=f.sub(y);return E.cmpn(0)<0&&E.iadd(this.m),E._forceRed(this)},W.prototype.isub=function(f,y){this._verify2(f,y);var E=f.isub(y);return E.cmpn(0)<0&&E.iadd(this.m),E},W.prototype.shl=function(f,y){return this._verify1(f),this.imod(f.ushln(y))},W.prototype.imul=function(f,y){return this._verify2(f,y),this.imod(f.imul(y))},W.prototype.mul=function(f,y){return this._verify2(f,y),this.imod(f.mul(y))},W.prototype.isqr=function(f){return this.imul(f,f.clone())},W.prototype.sqr=function(f){return this.mul(f,f)},W.prototype.sqrt=function(f){if(f.isZero())return f.clone();var y=this.m.andln(3);if(r(y%2===1),y===3){var E=this.m.add(new o(1)).iushrn(2);return this.pow(f,E)}for(var I=this.m.subn(1),N=0;!I.isZero()&&I.andln(1)===0;)N++,I.iushrn(1);r(!I.isZero());var D=new o(1).toRed(this),M=D.redNeg(),P=this.m.subn(1).iushrn(1),m=this.m.bitLength();for(m=new o(2*m*m).toRed(this);this.pow(m,P).cmp(M)!==0;)m.redIAdd(M);for(var v=this.pow(m,I),B=this.pow(f,I.addn(1).iushrn(1)),U=this.pow(f,I),Q=N;U.cmp(D)!==0;){for(var ee=U,Z=0;ee.cmp(D)!==0;Z++)ee=ee.redSqr();r(Z<Q);var Y=this.pow(v,new o(1).iushln(Q-Z-1));B=B.redMul(Y),v=Y.redSqr(),U=U.redMul(v),Q=Z}return B},W.prototype.invm=function(f){var y=f._invmp(this.m);return y.negative!==0?(y.negative=0,this.imod(y).redNeg()):this.imod(y)},W.prototype.pow=function(f,y){if(y.isZero())return new o(1).toRed(this);if(y.cmpn(1)===0)return f.clone();var E=4,I=new Array(1<<E);I[0]=new o(1).toRed(this),I[1]=f;for(var N=2;N<I.length;N++)I[N]=this.mul(I[N-1],f);var D=I[0],M=0,P=0,m=y.bitLength()%26;for(m===0&&(m=26),N=y.length-1;N>=0;N--){for(var v=y.words[N],B=m-1;B>=0;B--){var U=v>>B&1;if(D!==I[0]&&(D=this.sqr(D)),U===0&&M===0){P=0;continue}M<<=1,M|=U,P++,!(P!==E&&(N!==0||B!==0))&&(D=this.mul(D,I[M]),P=0,M=0)}m=26}return D},W.prototype.convertTo=function(f){var y=f.umod(this.m);return y===f?y.clone():y},W.prototype.convertFrom=function(f){var y=f.clone();return y.red=null,y},o.mont=function(f){return new z(f)};function z(C){W.call(this,C),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new o(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}i(z,W),z.prototype.convertTo=function(f){return this.imod(f.ushln(this.shift))},z.prototype.convertFrom=function(f){var y=this.imod(f.mul(this.rinv));return y.red=null,y},z.prototype.imul=function(f,y){if(f.isZero()||y.isZero())return f.words[0]=0,f.length=1,f;var E=f.imul(y),I=E.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),N=E.isub(I).iushrn(this.shift),D=N;return N.cmp(this.m)>=0?D=N.isub(this.m):N.cmpn(0)<0&&(D=N.iadd(this.m)),D._forceRed(this)},z.prototype.mul=function(f,y){if(f.isZero()||y.isZero())return new o(0)._forceRed(this);var E=f.mul(y),I=E.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),N=E.isub(I).iushrn(this.shift),D=N;return N.cmp(this.m)>=0?D=N.isub(this.m):N.cmpn(0)<0&&(D=N.iadd(this.m)),D._forceRed(this)},z.prototype.invm=function(f){var y=this.imod(f._invmp(this.m).mul(this.r2));return y._forceRed(this)}})(t,rG)}(vp)),vp.exports}var iG=ZC();const eI=sl(iG);var wp={exports:{}};/*! safe-buffer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */var tI;function oG(){return tI||(tI=1,function(t,e){var n=Iy(),r=n.Buffer;function i(s,a){for(var l in s)a[l]=s[l]}r.from&&r.alloc&&r.allocUnsafe&&r.allocUnsafeSlow?t.exports=n:(i(n,e),e.Buffer=o);function o(s,a,l){return r(s,a,l)}o.prototype=Object.create(r.prototype),i(r,o),o.from=function(s,a,l){if(typeof s=="number")throw new TypeError("Argument must not be a number");return r(s,a,l)},o.alloc=function(s,a,l){if(typeof s!="number")throw new TypeError("Argument must be a number");var c=r(s);return a!==void 0?typeof l=="string"?c.fill(a,l):c.fill(a):c.fill(0),c},o.allocUnsafe=function(s){if(typeof s!="number")throw new TypeError("Argument must be a number");return r(s)},o.allocUnsafeSlow=function(s){if(typeof s!="number")throw new TypeError("Argument must be a number");return n.SlowBuffer(s)}}(wp,wp.exports)),wp.exports}var Dy,nI;function sG(){if(nI)return Dy;nI=1;var t=oG().Buffer;function e(n){if(n.length>=255)throw new TypeError("Alphabet too long");for(var r=new Uint8Array(256),i=0;i<r.length;i++)r[i]=255;for(var o=0;o<n.length;o++){var s=n.charAt(o),a=s.charCodeAt(0);if(r[a]!==255)throw new TypeError(s+" is ambiguous");r[a]=o}var l=n.length,c=n.charAt(0),u=Math.log(l)/Math.log(256),d=Math.log(256)/Math.log(l);function h(p){if((Array.isArray(p)||p instanceof Uint8Array)&&(p=t.from(p)),!t.isBuffer(p))throw new TypeError("Expected Buffer");if(p.length===0)return"";for(var w=0,S=0,O=0,T=p.length;O!==T&&p[O]===0;)O++,w++;for(var $=(T-O)*d+1>>>0,R=new Uint8Array($);O!==T;){for(var j=p[O],q=0,G=$-1;(j!==0||q<S)&&G!==-1;G--,q++)j+=256*R[G]>>>0,R[G]=j%l>>>0,j=j/l>>>0;if(j!==0)throw new Error("Non-zero carry");S=q,O++}for(var L=$-S;L!==$&&R[L]===0;)L++;for(var V=c.repeat(w);L<$;++L)V+=n.charAt(R[L]);return V}function g(p){if(typeof p!="string")throw new TypeError("Expected String");if(p.length===0)return t.alloc(0);for(var w=0,S=0,O=0;p[w]===c;)S++,w++;for(var T=(p.length-w)*u+1>>>0,$=new Uint8Array(T);w<p.length;){var R=p.charCodeAt(w);if(R>255)return;var j=r[R];if(j===255)return;for(var q=0,G=T-1;(j!==0||q<O)&&G!==-1;G--,q++)j+=l*$[G]>>>0,$[G]=j%256>>>0,j=j/256>>>0;if(j!==0)throw new Error("Non-zero carry");O=q,w++}for(var L=T-O;L!==T&&$[L]===0;)L++;var V=t.allocUnsafe(S+(T-L));V.fill(0,0,S);for(var W=S;L!==T;)V[W++]=$[L++];return V}function b(p){var w=g(p);if(w)return w;throw new Error("Non-base"+l+" character")}return{encode:h,decodeUnsafe:g,decode:b}}return Dy=e,Dy}var zy,rI;function iI(){if(rI)return zy;rI=1;var t=sG(),e="123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz";return zy=t(e),zy}var aG=iI();const Hn=sl(aG);var ot={};function Ao(t,e,n){return e<=t&&t<=n}function xp(t){if(t===void 0)return{};if(t===Object(t))return t;throw TypeError("Could not convert argument to dictionary")}function lG(t){for(var e=String(t),n=e.length,r=0,i=[];r<n;){var o=e.charCodeAt(r);if(o<55296||o>57343)i.push(o);else if(56320<=o&&o<=57343)i.push(65533);else if(55296<=o&&o<=56319)if(r===n-1)i.push(65533);else{var s=t.charCodeAt(r+1);if(56320<=s&&s<=57343){var a=o&1023,l=s&1023;i.push(65536+(a<<10)+l),r+=1}else i.push(65533)}r+=1}return i}function cG(t){for(var e="",n=0;n<t.length;++n){var r=t[n];r<=65535?e+=String.fromCharCode(r):(r-=65536,e+=String.fromCharCode((r>>10)+55296,(r&1023)+56320))}return e}var Ep=-1;function Uy(t){this.tokens=[].slice.call(t)}Uy.prototype={endOfStream:function(){return!this.tokens.length},read:function(){return this.tokens.length?this.tokens.shift():Ep},prepend:function(t){if(Array.isArray(t))for(var e=t;e.length;)this.tokens.unshift(e.pop());else this.tokens.unshift(t)},push:function(t){if(Array.isArray(t))for(var e=t;e.length;)this.tokens.push(e.shift());else this.tokens.push(t)}};var rc=-1;function $y(t,e){if(t)throw TypeError("Decoder error");return e||65533}var Sp="utf-8";function Ap(t,e){if(!(this instanceof Ap))return new Ap(t,e);if(t=t!==void 0?String(t).toLowerCase():Sp,t!==Sp)throw new Error("Encoding not supported. Only utf-8 is supported");e=xp(e),this._streaming=!1,this._BOMseen=!1,this._decoder=null,this._fatal=!!e.fatal,this._ignoreBOM=!!e.ignoreBOM,Object.defineProperty(this,"encoding",{value:"utf-8"}),Object.defineProperty(this,"fatal",{value:this._fatal}),Object.defineProperty(this,"ignoreBOM",{value:this._ignoreBOM})}Ap.prototype={decode:function(e,n){var r;typeof e=="object"&&e instanceof ArrayBuffer?r=new Uint8Array(e):typeof e=="object"&&"buffer"in e&&e.buffer instanceof ArrayBuffer?r=new Uint8Array(e.buffer,e.byteOffset,e.byteLength):r=new Uint8Array(0),n=xp(n),this._streaming||(this._decoder=new uG({fatal:this._fatal}),this._BOMseen=!1),this._streaming=!!n.stream;for(var i=new Uy(r),o=[],s;!i.endOfStream()&&(s=this._decoder.handler(i,i.read()),s!==rc);)s!==null&&(Array.isArray(s)?o.push.apply(o,s):o.push(s));if(!this._streaming){do{if(s=this._decoder.handler(i,i.read()),s===rc)break;s!==null&&(Array.isArray(s)?o.push.apply(o,s):o.push(s))}while(!i.endOfStream());this._decoder=null}return o.length&&["utf-8"].indexOf(this.encoding)!==-1&&!this._ignoreBOM&&!this._BOMseen&&(o[0]===65279?(this._BOMseen=!0,o.shift()):this._BOMseen=!0),cG(o)}};function kp(t,e){if(!(this instanceof kp))return new kp(t,e);if(t=t!==void 0?String(t).toLowerCase():Sp,t!==Sp)throw new Error("Encoding not supported. Only utf-8 is supported");e=xp(e),this._streaming=!1,this._encoder=null,this._options={fatal:!!e.fatal},Object.defineProperty(this,"encoding",{value:"utf-8"})}kp.prototype={encode:function(e,n){e=e?String(e):"",n=xp(n),this._streaming||(this._encoder=new dG(this._options)),this._streaming=!!n.stream;for(var r=[],i=new Uy(lG(e)),o;!i.endOfStream()&&(o=this._encoder.handler(i,i.read()),o!==rc);)Array.isArray(o)?r.push.apply(r,o):r.push(o);if(!this._streaming){for(;o=this._encoder.handler(i,i.read()),o!==rc;)Array.isArray(o)?r.push.apply(r,o):r.push(o);this._encoder=null}return new Uint8Array(r)}};function uG(t){var e=t.fatal,n=0,r=0,i=0,o=128,s=191;this.handler=function(a,l){if(l===Ep&&i!==0)return i=0,$y(e);if(l===Ep)return rc;if(i===0){if(Ao(l,0,127))return l;if(Ao(l,194,223))i=1,n=l-192;else if(Ao(l,224,239))l===224&&(o=160),l===237&&(s=159),i=2,n=l-224;else if(Ao(l,240,244))l===240&&(o=144),l===244&&(s=143),i=3,n=l-240;else return $y(e);return n=n<<6*i,null}if(!Ao(l,o,s))return n=i=r=0,o=128,s=191,a.prepend(l),$y(e);if(o=128,s=191,r+=1,n+=l-128<<6*(i-r),r!==i)return null;var c=n;return n=i=r=0,c}}function dG(t){t.fatal,this.handler=function(e,n){if(n===Ep)return rc;if(Ao(n,0,127))return n;var r,i;Ao(n,128,2047)?(r=1,i=192):Ao(n,2048,65535)?(r=2,i=224):Ao(n,65536,1114111)&&(r=3,i=240);for(var o=[(n>>6*r)+i];r>0;){var s=n>>6*(r-1);o.push(128|s&63),r-=1}return o}}const fG=lu(Object.freeze(Object.defineProperty({__proto__:null,TextDecoder:Ap,TextEncoder:kp},Symbol.toStringTag,{value:"Module"})));var oI;function hG(){if(oI)return ot;oI=1;var t=ot&&ot.__createBinding||(Object.create?function(L,V,W,z){z===void 0&&(z=W),Object.defineProperty(L,z,{enumerable:!0,get:function(){return V[W]}})}:function(L,V,W,z){z===void 0&&(z=W),L[z]=V[W]}),e=ot&&ot.__setModuleDefault||(Object.create?function(L,V){Object.defineProperty(L,"default",{enumerable:!0,value:V})}:function(L,V){L.default=V}),n=ot&&ot.__decorate||function(L,V,W,z){var C=arguments.length,f=C<3?V:z===null?z=Object.getOwnPropertyDescriptor(V,W):z,y;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")f=Reflect.decorate(L,V,W,z);else for(var E=L.length-1;E>=0;E--)(y=L[E])&&(f=(C<3?y(f):C>3?y(V,W,f):y(V,W))||f);return C>3&&f&&Object.defineProperty(V,W,f),f},r=ot&&ot.__importStar||function(L){if(L&&L.__esModule)return L;var V={};if(L!=null)for(var W in L)W!=="default"&&Object.hasOwnProperty.call(L,W)&&t(V,L,W);return e(V,L),V},i=ot&&ot.__importDefault||function(L){return L&&L.__esModule?L:{default:L}};Object.defineProperty(ot,"__esModule",{value:!0}),ot.deserializeUnchecked=ot.deserialize=ot.serialize=ot.BinaryReader=ot.BinaryWriter=ot.BorshError=ot.baseDecode=ot.baseEncode=void 0;const o=i(ZC()),s=i(iI()),a=r(fG),l=typeof TextDecoder!="function"?a.TextDecoder:TextDecoder,c=new l("utf-8",{fatal:!0});function u(L){return typeof L=="string"&&(L=Buffer.from(L,"utf8")),s.default.encode(Buffer.from(L))}ot.baseEncode=u;function d(L){return Buffer.from(s.default.decode(L))}ot.baseDecode=d;const h=1024;class g extends Error{constructor(V){super(V),this.fieldPath=[],this.originalMessage=V}addToFieldPath(V){this.fieldPath.splice(0,0,V),this.message=this.originalMessage+": "+this.fieldPath.join(".")}}ot.BorshError=g;class b{constructor(){this.buf=Buffer.alloc(h),this.length=0}maybeResize(){this.buf.length<16+this.length&&(this.buf=Buffer.concat([this.buf,Buffer.alloc(h)]))}writeU8(V){this.maybeResize(),this.buf.writeUInt8(V,this.length),this.length+=1}writeU16(V){this.maybeResize(),this.buf.writeUInt16LE(V,this.length),this.length+=2}writeU32(V){this.maybeResize(),this.buf.writeUInt32LE(V,this.length),this.length+=4}writeU64(V){this.maybeResize(),this.writeBuffer(Buffer.from(new o.default(V).toArray("le",8)))}writeU128(V){this.maybeResize(),this.writeBuffer(Buffer.from(new o.default(V).toArray("le",16)))}writeU256(V){this.maybeResize(),this.writeBuffer(Buffer.from(new o.default(V).toArray("le",32)))}writeU512(V){this.maybeResize(),this.writeBuffer(Buffer.from(new o.default(V).toArray("le",64)))}writeBuffer(V){this.buf=Buffer.concat([Buffer.from(this.buf.subarray(0,this.length)),V,Buffer.alloc(h)]),this.length+=V.length}writeString(V){this.maybeResize();const W=Buffer.from(V,"utf8");this.writeU32(W.length),this.writeBuffer(W)}writeFixedArray(V){this.writeBuffer(Buffer.from(V))}writeArray(V,W){this.maybeResize(),this.writeU32(V.length);for(const z of V)this.maybeResize(),W(z)}toArray(){return this.buf.subarray(0,this.length)}}ot.BinaryWriter=b;function p(L,V,W){const z=W.value;W.value=function(...C){try{return z.apply(this,C)}catch(f){if(f instanceof RangeError){const y=f.code;if(["ERR_BUFFER_OUT_OF_BOUNDS","ERR_OUT_OF_RANGE"].indexOf(y)>=0)throw new g("Reached the end of buffer when deserializing")}throw f}}}class w{constructor(V){this.buf=V,this.offset=0}readU8(){const V=this.buf.readUInt8(this.offset);return this.offset+=1,V}readU16(){const V=this.buf.readUInt16LE(this.offset);return this.offset+=2,V}readU32(){const V=this.buf.readUInt32LE(this.offset);return this.offset+=4,V}readU64(){const V=this.readBuffer(8);return new o.default(V,"le")}readU128(){const V=this.readBuffer(16);return new o.default(V,"le")}readU256(){const V=this.readBuffer(32);return new o.default(V,"le")}readU512(){const V=this.readBuffer(64);return new o.default(V,"le")}readBuffer(V){if(this.offset+V>this.buf.length)throw new g(`Expected buffer length ${V} isn't within bounds`);const W=this.buf.slice(this.offset,this.offset+V);return this.offset+=V,W}readString(){const V=this.readU32(),W=this.readBuffer(V);try{return c.decode(W)}catch(z){throw new g(`Error decoding UTF-8 string: ${z}`)}}readFixedArray(V){return new Uint8Array(this.readBuffer(V))}readArray(V){const W=this.readU32(),z=Array();for(let C=0;C<W;++C)z.push(V());return z}}n([p],w.prototype,"readU8",null),n([p],w.prototype,"readU16",null),n([p],w.prototype,"readU32",null),n([p],w.prototype,"readU64",null),n([p],w.prototype,"readU128",null),n([p],w.prototype,"readU256",null),n([p],w.prototype,"readU512",null),n([p],w.prototype,"readString",null),n([p],w.prototype,"readFixedArray",null),n([p],w.prototype,"readArray",null),ot.BinaryReader=w;function S(L){return L.charAt(0).toUpperCase()+L.slice(1)}function O(L,V,W,z,C){try{if(typeof z=="string")C[`write${S(z)}`](W);else if(z instanceof Array)if(typeof z[0]=="number"){if(W.length!==z[0])throw new g(`Expecting byte array of length ${z[0]}, but got ${W.length} bytes`);C.writeFixedArray(W)}else if(z.length===2&&typeof z[1]=="number"){if(W.length!==z[1])throw new g(`Expecting byte array of length ${z[1]}, but got ${W.length} bytes`);for(let f=0;f<z[1];f++)O(L,null,W[f],z[0],C)}else C.writeArray(W,f=>{O(L,V,f,z[0],C)});else if(z.kind!==void 0)switch(z.kind){case"option":{W==null?C.writeU8(0):(C.writeU8(1),O(L,V,W,z.type,C));break}case"map":{C.writeU32(W.size),W.forEach((f,y)=>{O(L,V,y,z.key,C),O(L,V,f,z.value,C)});break}default:throw new g(`FieldType ${z} unrecognized`)}else T(L,W,C)}catch(f){throw f instanceof g&&f.addToFieldPath(V),f}}function T(L,V,W){if(typeof V.borshSerialize=="function"){V.borshSerialize(W);return}const z=L.get(V.constructor);if(!z)throw new g(`Class ${V.constructor.name} is missing in schema`);if(z.kind==="struct")z.fields.map(([C,f])=>{O(L,C,V[C],f,W)});else if(z.kind==="enum"){const C=V[z.field];for(let f=0;f<z.values.length;++f){const[y,E]=z.values[f];if(y===C){W.writeU8(f),O(L,y,V[y],E,W);break}}}else throw new g(`Unexpected schema kind: ${z.kind} for ${V.constructor.name}`)}function $(L,V,W=b){const z=new W;return T(L,V,z),z.toArray()}ot.serialize=$;function R(L,V,W,z){try{if(typeof W=="string")return z[`read${S(W)}`]();if(W instanceof Array){if(typeof W[0]=="number")return z.readFixedArray(W[0]);if(typeof W[1]=="number"){const C=[];for(let f=0;f<W[1];f++)C.push(R(L,null,W[0],z));return C}else return z.readArray(()=>R(L,V,W[0],z))}if(W.kind==="option")return z.readU8()?R(L,V,W.type,z):void 0;if(W.kind==="map"){let C=new Map;const f=z.readU32();for(let y=0;y<f;y++){const E=R(L,V,W.key,z),I=R(L,V,W.value,z);C.set(E,I)}return C}return j(L,W,z)}catch(C){throw C instanceof g&&C.addToFieldPath(V),C}}function j(L,V,W){if(typeof V.borshDeserialize=="function")return V.borshDeserialize(W);const z=L.get(V);if(!z)throw new g(`Class ${V.name} is missing in schema`);if(z.kind==="struct"){const C={};for(const[f,y]of L.get(V).fields)C[f]=R(L,f,y,W);return new V(C)}if(z.kind==="enum"){const C=W.readU8();if(C>=z.values.length)throw new g(`Enum index: ${C} is out of range`);const[f,y]=z.values[C],E=R(L,f,y,W);return new V({[f]:E})}throw new g(`Unexpected schema kind: ${z.kind} for ${V.constructor.name}`)}function q(L,V,W,z=w){const C=new z(W),f=j(L,V,C);if(C.offset<W.length)throw new g(`Unexpected ${W.length-C.offset} bytes after deserialized data`);return f}ot.deserialize=q;function G(L,V,W,z=w){const C=new z(W);return j(L,V,C)}return ot.deserializeUnchecked=G,ot}var Hy=hG(),ae={},sI;function pG(){if(sI)return ae;sI=1,Object.defineProperty(ae,"__esModule",{value:!0}),ae.s16=ae.s8=ae.nu64be=ae.u48be=ae.u40be=ae.u32be=ae.u24be=ae.u16be=ae.nu64=ae.u48=ae.u40=ae.u32=ae.u24=ae.u16=ae.u8=ae.offset=ae.greedy=ae.Constant=ae.UTF8=ae.CString=ae.Blob=ae.Boolean=ae.BitField=ae.BitStructure=ae.VariantLayout=ae.Union=ae.UnionLayoutDiscriminator=ae.UnionDiscriminator=ae.Structure=ae.Sequence=ae.DoubleBE=ae.Double=ae.FloatBE=ae.Float=ae.NearInt64BE=ae.NearInt64=ae.NearUInt64BE=ae.NearUInt64=ae.IntBE=ae.Int=ae.UIntBE=ae.UInt=ae.OffsetLayout=ae.GreedyCount=ae.ExternalLayout=ae.bindConstructorLayout=ae.nameWithProperty=ae.Layout=ae.uint8ArrayToBuffer=ae.checkUint8Array=void 0,ae.constant=ae.utf8=ae.cstr=ae.blob=ae.unionLayoutDiscriminator=ae.union=ae.seq=ae.bits=ae.struct=ae.f64be=ae.f64=ae.f32be=ae.f32=ae.ns64be=ae.s48be=ae.s40be=ae.s32be=ae.s24be=ae.s16be=ae.ns64=ae.s48=ae.s40=ae.s32=ae.s24=void 0;const t=Iy();function e(m){if(!(m instanceof Uint8Array))throw new TypeError("b must be a Uint8Array")}ae.checkUint8Array=e;function n(m){return e(m),t.Buffer.from(m.buffer,m.byteOffset,m.length)}ae.uint8ArrayToBuffer=n;let r=class{constructor(v,B){if(!Number.isInteger(v))throw new TypeError("span must be an integer");this.span=v,this.property=B}makeDestinationObject(){return{}}getSpan(v,B){if(0>this.span)throw new RangeError("indeterminate span");return this.span}replicate(v){const B=Object.create(this.constructor.prototype);return Object.assign(B,this),B.property=v,B}fromArray(v){}};ae.Layout=r;function i(m,v){return v.property?m+"["+v.property+"]":m}ae.nameWithProperty=i;function o(m,v){if(typeof m!="function")throw new TypeError("Class must be constructor");if(Object.prototype.hasOwnProperty.call(m,"layout_"))throw new Error("Class is already bound to a layout");if(!(v&&v instanceof r))throw new TypeError("layout must be a Layout");if(Object.prototype.hasOwnProperty.call(v,"boundConstructor_"))throw new Error("layout is already bound to a constructor");m.layout_=v,v.boundConstructor_=m,v.makeDestinationObject=()=>new m,Object.defineProperty(m.prototype,"encode",{value(B,U){return v.encode(this,B,U)},writable:!0}),Object.defineProperty(m,"decode",{value(B,U){return v.decode(B,U)},writable:!0})}ae.bindConstructorLayout=o;class s extends r{isCount(){throw new Error("ExternalLayout is abstract")}}ae.ExternalLayout=s;class a extends s{constructor(v=1,B){if(!Number.isInteger(v)||0>=v)throw new TypeError("elementSpan must be a (positive) integer");super(-1,B),this.elementSpan=v}isCount(){return!0}decode(v,B=0){e(v);const U=v.length-B;return Math.floor(U/this.elementSpan)}encode(v,B,U){return 0}}ae.GreedyCount=a;class l extends s{constructor(v,B=0,U){if(!(v instanceof r))throw new TypeError("layout must be a Layout");if(!Number.isInteger(B))throw new TypeError("offset must be integer or undefined");super(v.span,U||v.property),this.layout=v,this.offset=B}isCount(){return this.layout instanceof c||this.layout instanceof u}decode(v,B=0){return this.layout.decode(v,B+this.offset)}encode(v,B,U=0){return this.layout.encode(v,B,U+this.offset)}}ae.OffsetLayout=l;class c extends r{constructor(v,B){if(super(v,B),6<this.span)throw new RangeError("span must not exceed 6 bytes")}decode(v,B=0){return n(v).readUIntLE(B,this.span)}encode(v,B,U=0){return n(B).writeUIntLE(v,U,this.span),this.span}}ae.UInt=c;class u extends r{constructor(v,B){if(super(v,B),6<this.span)throw new RangeError("span must not exceed 6 bytes")}decode(v,B=0){return n(v).readUIntBE(B,this.span)}encode(v,B,U=0){return n(B).writeUIntBE(v,U,this.span),this.span}}ae.UIntBE=u;class d extends r{constructor(v,B){if(super(v,B),6<this.span)throw new RangeError("span must not exceed 6 bytes")}decode(v,B=0){return n(v).readIntLE(B,this.span)}encode(v,B,U=0){return n(B).writeIntLE(v,U,this.span),this.span}}ae.Int=d;class h extends r{constructor(v,B){if(super(v,B),6<this.span)throw new RangeError("span must not exceed 6 bytes")}decode(v,B=0){return n(v).readIntBE(B,this.span)}encode(v,B,U=0){return n(B).writeIntBE(v,U,this.span),this.span}}ae.IntBE=h;const g=Math.pow(2,32);function b(m){const v=Math.floor(m/g),B=m-v*g;return{hi32:v,lo32:B}}function p(m,v){return m*g+v}class w extends r{constructor(v){super(8,v)}decode(v,B=0){const U=n(v),Q=U.readUInt32LE(B),ee=U.readUInt32LE(B+4);return p(ee,Q)}encode(v,B,U=0){const Q=b(v),ee=n(B);return ee.writeUInt32LE(Q.lo32,U),ee.writeUInt32LE(Q.hi32,U+4),8}}ae.NearUInt64=w;class S extends r{constructor(v){super(8,v)}decode(v,B=0){const U=n(v),Q=U.readUInt32BE(B),ee=U.readUInt32BE(B+4);return p(Q,ee)}encode(v,B,U=0){const Q=b(v),ee=n(B);return ee.writeUInt32BE(Q.hi32,U),ee.writeUInt32BE(Q.lo32,U+4),8}}ae.NearUInt64BE=S;class O extends r{constructor(v){super(8,v)}decode(v,B=0){const U=n(v),Q=U.readUInt32LE(B),ee=U.readInt32LE(B+4);return p(ee,Q)}encode(v,B,U=0){const Q=b(v),ee=n(B);return ee.writeUInt32LE(Q.lo32,U),ee.writeInt32LE(Q.hi32,U+4),8}}ae.NearInt64=O;class T extends r{constructor(v){super(8,v)}decode(v,B=0){const U=n(v),Q=U.readInt32BE(B),ee=U.readUInt32BE(B+4);return p(Q,ee)}encode(v,B,U=0){const Q=b(v),ee=n(B);return ee.writeInt32BE(Q.hi32,U),ee.writeUInt32BE(Q.lo32,U+4),8}}ae.NearInt64BE=T;class $ extends r{constructor(v){super(4,v)}decode(v,B=0){return n(v).readFloatLE(B)}encode(v,B,U=0){return n(B).writeFloatLE(v,U),4}}ae.Float=$;class R extends r{constructor(v){super(4,v)}decode(v,B=0){return n(v).readFloatBE(B)}encode(v,B,U=0){return n(B).writeFloatBE(v,U),4}}ae.FloatBE=R;class j extends r{constructor(v){super(8,v)}decode(v,B=0){return n(v).readDoubleLE(B)}encode(v,B,U=0){return n(B).writeDoubleLE(v,U),8}}ae.Double=j;class q extends r{constructor(v){super(8,v)}decode(v,B=0){return n(v).readDoubleBE(B)}encode(v,B,U=0){return n(B).writeDoubleBE(v,U),8}}ae.DoubleBE=q;class G extends r{constructor(v,B,U){if(!(v instanceof r))throw new TypeError("elementLayout must be a Layout");if(!(B instanceof s&&B.isCount()||Number.isInteger(B)&&0<=B))throw new TypeError("count must be non-negative integer or an unsigned integer ExternalLayout");let Q=-1;!(B instanceof s)&&0<v.span&&(Q=B*v.span),super(Q,U),this.elementLayout=v,this.count=B}getSpan(v,B=0){if(0<=this.span)return this.span;let U=0,Q=this.count;if(Q instanceof s&&(Q=Q.decode(v,B)),0<this.elementLayout.span)U=Q*this.elementLayout.span;else{let ee=0;for(;ee<Q;)U+=this.elementLayout.getSpan(v,B+U),++ee}return U}decode(v,B=0){const U=[];let Q=0,ee=this.count;for(ee instanceof s&&(ee=ee.decode(v,B));Q<ee;)U.push(this.elementLayout.decode(v,B)),B+=this.elementLayout.getSpan(v,B),Q+=1;return U}encode(v,B,U=0){const Q=this.elementLayout,ee=v.reduce((Z,Y)=>Z+Q.encode(Y,B,U+Z),0);return this.count instanceof s&&this.count.encode(v.length,B,U),ee}}ae.Sequence=G;class L extends r{constructor(v,B,U){if(!(Array.isArray(v)&&v.reduce((ee,Z)=>ee&&Z instanceof r,!0)))throw new TypeError("fields must be array of Layout instances");typeof B=="boolean"&&U===void 0&&(U=B,B=void 0);for(const ee of v)if(0>ee.span&&ee.property===void 0)throw new Error("fields cannot contain unnamed variable-length layout");let Q=-1;try{Q=v.reduce((ee,Z)=>ee+Z.getSpan(),0)}catch(ee){}super(Q,B),this.fields=v,this.decodePrefixes=!!U}getSpan(v,B=0){if(0<=this.span)return this.span;let U=0;try{U=this.fields.reduce((Q,ee)=>{const Z=ee.getSpan(v,B);return B+=Z,Q+Z},0)}catch(Q){throw new RangeError("indeterminate span")}return U}decode(v,B=0){e(v);const U=this.makeDestinationObject();for(const Q of this.fields)if(Q.property!==void 0&&(U[Q.property]=Q.decode(v,B)),B+=Q.getSpan(v,B),this.decodePrefixes&&v.length===B)break;return U}encode(v,B,U=0){const Q=U;let ee=0,Z=0;for(const Y of this.fields){let re=Y.span;if(Z=0<re?re:0,Y.property!==void 0){const de=v[Y.property];de!==void 0&&(Z=Y.encode(de,B,U),0>re&&(re=Y.getSpan(B,U)))}ee=U,U+=re}return ee+Z-Q}fromArray(v){const B=this.makeDestinationObject();for(const U of this.fields)U.property!==void 0&&0<v.length&&(B[U.property]=v.shift());return B}layoutFor(v){if(typeof v!="string")throw new TypeError("property must be string");for(const B of this.fields)if(B.property===v)return B}offsetOf(v){if(typeof v!="string")throw new TypeError("property must be string");let B=0;for(const U of this.fields){if(U.property===v)return B;0>U.span?B=-1:0<=B&&(B+=U.span)}}}ae.Structure=L;class V{constructor(v){this.property=v}decode(v,B){throw new Error("UnionDiscriminator is abstract")}encode(v,B,U){throw new Error("UnionDiscriminator is abstract")}}ae.UnionDiscriminator=V;class W extends V{constructor(v,B){if(!(v instanceof s&&v.isCount()))throw new TypeError("layout must be an unsigned integer ExternalLayout");super(B||v.property||"variant"),this.layout=v}decode(v,B){return this.layout.decode(v,B)}encode(v,B,U){return this.layout.encode(v,B,U)}}ae.UnionLayoutDiscriminator=W;class z extends r{constructor(v,B,U){let Q;if(v instanceof c||v instanceof u)Q=new W(new l(v));else if(v instanceof s&&v.isCount())Q=new W(v);else if(v instanceof V)Q=v;else throw new TypeError("discr must be a UnionDiscriminator or an unsigned integer layout");if(B===void 0&&(B=null),!(B===null||B instanceof r))throw new TypeError("defaultLayout must be null or a Layout");if(B!==null){if(0>B.span)throw new Error("defaultLayout must have constant span");B.property===void 0&&(B=B.replicate("content"))}let ee=-1;B&&(ee=B.span,0<=ee&&(v instanceof c||v instanceof u)&&(ee+=Q.layout.span)),super(ee,U),this.discriminator=Q,this.usesPrefixDiscriminator=v instanceof c||v instanceof u,this.defaultLayout=B,this.registry={};let Z=this.defaultGetSourceVariant.bind(this);this.getSourceVariant=function(Y){return Z(Y)},this.configGetSourceVariant=function(Y){Z=Y.bind(this)}}getSpan(v,B=0){if(0<=this.span)return this.span;const U=this.getVariant(v,B);if(!U)throw new Error("unable to determine span for unrecognized variant");return U.getSpan(v,B)}defaultGetSourceVariant(v){if(Object.prototype.hasOwnProperty.call(v,this.discriminator.property)){if(this.defaultLayout&&this.defaultLayout.property&&Object.prototype.hasOwnProperty.call(v,this.defaultLayout.property))return;const B=this.registry[v[this.discriminator.property]];if(B&&(!B.layout||B.property&&Object.prototype.hasOwnProperty.call(v,B.property)))return B}else for(const B in this.registry){const U=this.registry[B];if(U.property&&Object.prototype.hasOwnProperty.call(v,U.property))return U}throw new Error("unable to infer src variant")}decode(v,B=0){let U;const Q=this.discriminator,ee=Q.decode(v,B),Z=this.registry[ee];if(Z===void 0){const Y=this.defaultLayout;let re=0;this.usesPrefixDiscriminator&&(re=Q.layout.span),U=this.makeDestinationObject(),U[Q.property]=ee,U[Y.property]=Y.decode(v,B+re)}else U=Z.decode(v,B);return U}encode(v,B,U=0){const Q=this.getSourceVariant(v);if(Q===void 0){const ee=this.discriminator,Z=this.defaultLayout;let Y=0;return this.usesPrefixDiscriminator&&(Y=ee.layout.span),ee.encode(v[ee.property],B,U),Y+Z.encode(v[Z.property],B,U+Y)}return Q.encode(v,B,U)}addVariant(v,B,U){const Q=new C(this,v,B,U);return this.registry[v]=Q,Q}getVariant(v,B=0){let U;return v instanceof Uint8Array?U=this.discriminator.decode(v,B):U=v,this.registry[U]}}ae.Union=z;class C extends r{constructor(v,B,U,Q){if(!(v instanceof z))throw new TypeError("union must be a Union");if(!Number.isInteger(B)||0>B)throw new TypeError("variant must be a (non-negative) integer");if(typeof U=="string"&&Q===void 0&&(Q=U,U=null),U){if(!(U instanceof r))throw new TypeError("layout must be a Layout");if(v.defaultLayout!==null&&0<=U.span&&U.span>v.defaultLayout.span)throw new Error("variant span exceeds span of containing union");if(typeof Q!="string")throw new TypeError("variant must have a String property")}let ee=v.span;0>v.span&&(ee=U?U.span:0,0<=ee&&v.usesPrefixDiscriminator&&(ee+=v.discriminator.layout.span)),super(ee,Q),this.union=v,this.variant=B,this.layout=U||null}getSpan(v,B=0){if(0<=this.span)return this.span;let U=0;this.union.usesPrefixDiscriminator&&(U=this.union.discriminator.layout.span);let Q=0;return this.layout&&(Q=this.layout.getSpan(v,B+U)),U+Q}decode(v,B=0){const U=this.makeDestinationObject();if(this!==this.union.getVariant(v,B))throw new Error("variant mismatch");let Q=0;return this.union.usesPrefixDiscriminator&&(Q=this.union.discriminator.layout.span),this.layout?U[this.property]=this.layout.decode(v,B+Q):this.property?U[this.property]=!0:this.union.usesPrefixDiscriminator&&(U[this.union.discriminator.property]=this.variant),U}encode(v,B,U=0){let Q=0;if(this.union.usesPrefixDiscriminator&&(Q=this.union.discriminator.layout.span),this.layout&&!Object.prototype.hasOwnProperty.call(v,this.property))throw new TypeError("variant lacks property "+this.property);this.union.discriminator.encode(this.variant,B,U);let ee=Q;if(this.layout&&(this.layout.encode(v[this.property],B,U+Q),ee+=this.layout.getSpan(B,U+Q),0<=this.union.span&&ee>this.union.span))throw new Error("encoded variant overruns containing union");return ee}fromArray(v){if(this.layout)return this.layout.fromArray(v)}}ae.VariantLayout=C;function f(m){return 0>m&&(m+=4294967296),m}class y extends r{constructor(v,B,U){if(!(v instanceof c||v instanceof u))throw new TypeError("word must be a UInt or UIntBE layout");if(typeof B=="string"&&U===void 0&&(U=B,B=!1),4<v.span)throw new RangeError("word cannot exceed 32 bits");super(v.span,U),this.word=v,this.msb=!!B,this.fields=[];let Q=0;this._packedSetValue=function(ee){return Q=f(ee),this},this._packedGetValue=function(){return Q}}decode(v,B=0){const U=this.makeDestinationObject(),Q=this.word.decode(v,B);this._packedSetValue(Q);for(const ee of this.fields)ee.property!==void 0&&(U[ee.property]=ee.decode(v));return U}encode(v,B,U=0){const Q=this.word.decode(B,U);this._packedSetValue(Q);for(const ee of this.fields)if(ee.property!==void 0){const Z=v[ee.property];Z!==void 0&&ee.encode(Z)}return this.word.encode(this._packedGetValue(),B,U)}addField(v,B){const U=new E(this,v,B);return this.fields.push(U),U}addBoolean(v){const B=new I(this,v);return this.fields.push(B),B}fieldFor(v){if(typeof v!="string")throw new TypeError("property must be string");for(const B of this.fields)if(B.property===v)return B}}ae.BitStructure=y;class E{constructor(v,B,U){if(!(v instanceof y))throw new TypeError("container must be a BitStructure");if(!Number.isInteger(B)||0>=B)throw new TypeError("bits must be positive integer");const Q=8*v.span,ee=v.fields.reduce((Z,Y)=>Z+Y.bits,0);if(B+ee>Q)throw new Error("bits too long for span remainder ("+(Q-ee)+" of "+Q+" remain)");this.container=v,this.bits=B,this.valueMask=(1<<B)-1,B===32&&(this.valueMask=4294967295),this.start=ee,this.container.msb&&(this.start=Q-ee-B),this.wordMask=f(this.valueMask<<this.start),this.property=U}decode(v,B){const U=this.container._packedGetValue();return f(U&this.wordMask)>>>this.start}encode(v){if(typeof v!="number"||!Number.isInteger(v)||v!==f(v&this.valueMask))throw new TypeError(i("BitField.encode",this)+" value must be integer not exceeding "+this.valueMask);const B=this.container._packedGetValue(),U=f(v<<this.start);this.container._packedSetValue(f(B&~this.wordMask)|U)}}ae.BitField=E;class I extends E{constructor(v,B){super(v,1,B)}decode(v,B){return!!super.decode(v,B)}encode(v){typeof v=="boolean"&&(v=+v),super.encode(v)}}ae.Boolean=I;class N extends r{constructor(v,B){if(!(v instanceof s&&v.isCount()||Number.isInteger(v)&&0<=v))throw new TypeError("length must be positive integer or an unsigned integer ExternalLayout");let U=-1;v instanceof s||(U=v),super(U,B),this.length=v}getSpan(v,B){let U=this.span;return 0>U&&(U=this.length.decode(v,B)),U}decode(v,B=0){let U=this.span;return 0>U&&(U=this.length.decode(v,B)),n(v).slice(B,B+U)}encode(v,B,U){let Q=this.length;if(this.length instanceof s&&(Q=v.length),!(v instanceof Uint8Array&&Q===v.length))throw new TypeError(i("Blob.encode",this)+" requires (length "+Q+") Uint8Array as src");if(U+Q>B.length)throw new RangeError("encoding overruns Uint8Array");const ee=n(v);return n(B).write(ee.toString("hex"),U,Q,"hex"),this.length instanceof s&&this.length.encode(Q,B,U),Q}}ae.Blob=N;class D extends r{constructor(v){super(-1,v)}getSpan(v,B=0){e(v);let U=B;for(;U<v.length&&v[U]!==0;)U+=1;return 1+U-B}decode(v,B=0){const U=this.getSpan(v,B);return n(v).slice(B,B+U-1).toString("utf-8")}encode(v,B,U=0){typeof v!="string"&&(v=String(v));const Q=t.Buffer.from(v,"utf8"),ee=Q.length;if(U+ee>B.length)throw new RangeError("encoding overruns Buffer");const Z=n(B);return Q.copy(Z,U),Z[U+ee]=0,ee+1}}ae.CString=D;class M extends r{constructor(v,B){if(typeof v=="string"&&B===void 0&&(B=v,v=void 0),v===void 0)v=-1;else if(!Number.isInteger(v))throw new TypeError("maxSpan must be an integer");super(-1,B),this.maxSpan=v}getSpan(v,B=0){return e(v),v.length-B}decode(v,B=0){const U=this.getSpan(v,B);if(0<=this.maxSpan&&this.maxSpan<U)throw new RangeError("text length exceeds maxSpan");return n(v).slice(B,B+U).toString("utf-8")}encode(v,B,U=0){typeof v!="string"&&(v=String(v));const Q=t.Buffer.from(v,"utf8"),ee=Q.length;if(0<=this.maxSpan&&this.maxSpan<ee)throw new RangeError("text length exceeds maxSpan");if(U+ee>B.length)throw new RangeError("encoding overruns Buffer");return Q.copy(n(B),U),ee}}ae.UTF8=M;class P extends r{constructor(v,B){super(0,B),this.value=v}decode(v,B){return this.value}encode(v,B,U){return 0}}return ae.Constant=P,ae.greedy=(m,v)=>new a(m,v),ae.offset=(m,v,B)=>new l(m,v,B),ae.u8=m=>new c(1,m),ae.u16=m=>new c(2,m),ae.u24=m=>new c(3,m),ae.u32=m=>new c(4,m),ae.u40=m=>new c(5,m),ae.u48=m=>new c(6,m),ae.nu64=m=>new w(m),ae.u16be=m=>new u(2,m),ae.u24be=m=>new u(3,m),ae.u32be=m=>new u(4,m),ae.u40be=m=>new u(5,m),ae.u48be=m=>new u(6,m),ae.nu64be=m=>new S(m),ae.s8=m=>new d(1,m),ae.s16=m=>new d(2,m),ae.s24=m=>new d(3,m),ae.s32=m=>new d(4,m),ae.s40=m=>new d(5,m),ae.s48=m=>new d(6,m),ae.ns64=m=>new O(m),ae.s16be=m=>new h(2,m),ae.s24be=m=>new h(3,m),ae.s32be=m=>new h(4,m),ae.s40be=m=>new h(5,m),ae.s48be=m=>new h(6,m),ae.ns64be=m=>new T(m),ae.f32=m=>new $(m),ae.f32be=m=>new R(m),ae.f64=m=>new j(m),ae.f64be=m=>new q(m),ae.struct=(m,v,B)=>new L(m,v,B),ae.bits=(m,v,B)=>new y(m,v,B),ae.seq=(m,v,B)=>new G(m,v,B),ae.union=(m,v,B)=>new z(m,v,B),ae.unionLayoutDiscriminator=(m,v)=>new W(m,v),ae.blob=(m,v)=>new N(m,v),ae.cstr=m=>new D(m),ae.utf8=(m,v)=>new M(m,v),ae.constant=(m,v)=>new P(m,v),ae}var X=pG();class gG extends TypeError{constructor(e,n){let r;const{message:i,explanation:o,...s}=e,{path:a}=e,l=a.length===0?i:`At path: ${a.join(".")} -- ${i}`;super(o!=null?o:l),o!=null&&(this.cause=l),Object.assign(this,s),this.name=this.constructor.name,this.failures=()=>r!=null?r:r=[e,...n()]}}function mG(t){return kd(t)&&typeof t[Symbol.iterator]=="function"}function kd(t){return typeof t=="object"&&t!=null}function Cp(t){return kd(t)&&!Array.isArray(t)}function oi(t){return typeof t=="symbol"?t.toString():typeof t=="string"?JSON.stringify(t):`${t}`}function yG(t){const{done:e,value:n}=t.next();return e?void 0:n}function bG(t,e,n,r){if(t===!0)return;t===!1?t={}:typeof t=="string"&&(t={message:t});const{path:i,branch:o}=e,{type:s}=n,{refinement:a,message:l=`Expected a value of type \`${s}\`${a?` with refinement \`${a}\``:""}, but received: \`${oi(r)}\``}=t;return{value:r,type:s,refinement:a,key:i[i.length-1],path:i,branch:o,...t,message:l}}function*aI(t,e,n,r){mG(t)||(t=[t]);for(const i of t){const o=bG(i,e,n,r);o&&(yield o)}}function*Wy(t,e,n={}){const{path:r=[],branch:i=[t],coerce:o=!1,mask:s=!1}=n,a={path:r,branch:i,mask:s};o&&(t=e.coercer(t,a));let l="valid";for(const c of e.validator(t,a))c.explanation=n.message,l="not_valid",yield[c,void 0];for(let[c,u,d]of e.entries(t,a)){const h=Wy(u,d,{path:c===void 0?r:[...r,c],branch:c===void 0?i:[...i,u],coerce:o,mask:s,message:n.message});for(const g of h)g[0]?(l=g[0].refinement!=null?"not_refined":"not_valid",yield[g[0],void 0]):o&&(u=g[1],c===void 0?t=u:t instanceof Map?t.set(c,u):t instanceof Set?t.add(u):kd(t)&&(u!==void 0||c in t)&&(t[c]=u))}if(l!=="not_valid")for(const c of e.refiner(t,a))c.explanation=n.message,l="not_refined",yield[c,void 0];l==="valid"&&(yield[void 0,t])}let Ri=class{constructor(e){const{type:n,schema:r,validator:i,refiner:o,coercer:s=l=>l,entries:a=function*(){}}=e;this.type=n,this.schema=r,this.entries=a,this.coercer=s,i?this.validator=(l,c)=>{const u=i(l,c);return aI(u,c,this,l)}:this.validator=()=>[],o?this.refiner=(l,c)=>{const u=o(l,c);return aI(u,c,this,l)}:this.refiner=()=>[]}assert(e,n){return vG(e,this,n)}create(e,n){return Cd(e,this,n)}is(e){return lI(e,this)}mask(e,n){return wG(e,this,n)}validate(e,n={}){return Id(e,this,n)}};function vG(t,e,n){const r=Id(t,e,{message:n});if(r[0])throw r[0]}function Cd(t,e,n){const r=Id(t,e,{coerce:!0,message:n});if(r[0])throw r[0];return r[1]}function wG(t,e,n){const r=Id(t,e,{coerce:!0,mask:!0,message:n});if(r[0])throw r[0];return r[1]}function lI(t,e){return!Id(t,e)[0]}function Id(t,e,n={}){const r=Wy(t,e,n),i=yG(r);return i[0]?[new gG(i[0],function*(){for(const s of r)s[0]&&(yield s[0])}),void 0]:[void 0,i[1]]}function Oa(t,e){return new Ri({type:t,schema:null,validator:e})}function xG(){return Oa("any",()=>!0)}function we(t){return new Ri({type:"array",schema:t,*entries(e){if(t&&Array.isArray(e))for(const[n,r]of e.entries())yield[n,r,t]},coercer(e){return Array.isArray(e)?e.slice():e},validator(e){return Array.isArray(e)||`Expected an array value, but received: ${oi(e)}`}})}function Mi(){return Oa("boolean",t=>typeof t=="boolean")}function Gy(t){return Oa("instance",e=>e instanceof t||`Expected a \`${t.name}\` instance, but received: ${oi(e)}`)}function wt(t){const e=oi(t),n=typeof t;return new Ri({type:"literal",schema:n==="string"||n==="number"||n==="boolean"?t:null,validator(r){return r===t||`Expected the literal \`${e}\`, but received: ${oi(r)}`}})}function EG(){return Oa("never",()=>!1)}function xe(t){return new Ri({...t,validator:(e,n)=>e===null||t.validator(e,n),refiner:(e,n)=>e===null||t.refiner(e,n)})}function le(){return Oa("number",t=>typeof t=="number"&&!isNaN(t)||`Expected a number, but received: ${oi(t)}`)}function Ce(t){return new Ri({...t,validator:(e,n)=>e===void 0||t.validator(e,n),refiner:(e,n)=>e===void 0||t.refiner(e,n)})}function cI(t,e){return new Ri({type:"record",schema:null,*entries(n){if(kd(n))for(const r in n){const i=n[r];yield[r,r,t],yield[r,i,e]}},validator(n){return Cp(n)||`Expected an object, but received: ${oi(n)}`},coercer(n){return Cp(n)?{...n}:n}})}function ge(){return Oa("string",t=>typeof t=="string"||`Expected a string, but received: ${oi(t)}`)}function jy(t){const e=EG();return new Ri({type:"tuple",schema:null,*entries(n){if(Array.isArray(n)){const r=Math.max(t.length,n.length);for(let i=0;i<r;i++)yield[i,n[i],t[i]||e]}},validator(n){return Array.isArray(n)||`Expected an array, but received: ${oi(n)}`},coercer(n){return Array.isArray(n)?n.slice():n}})}function he(t){const e=Object.keys(t);return new Ri({type:"type",schema:t,*entries(n){if(kd(n))for(const r of e)yield[r,n[r],t[r]]},validator(n){return Cp(n)||`Expected an object, but received: ${oi(n)}`},coercer(n){return Cp(n)?{...n}:n}})}function Wn(t){const e=t.map(n=>n.type).join(" | ");return new Ri({type:"union",schema:null,coercer(n,r){for(const i of t){const[o,s]=i.validate(n,{coerce:!0,mask:r.mask});if(!o)return s}return n},validator(n,r){const i=[];for(const o of t){const[...s]=Wy(n,o,r),[a]=s;if(a[0])for(const[l]of s)l&&i.push(l);else return[]}return[`Expected the value to satisfy a union of \`${e}\`, but received: ${oi(n)}`,...i]}})}function ic(){return Oa("unknown",()=>!0)}function Od(t,e,n){return new Ri({...t,coercer:(r,i)=>lI(r,e)?t.coercer(n(r,i),i):t.coercer(r,i)})}var Ip,SG=new Uint8Array(16);function uI(){if(!Ip&&(Ip=typeof crypto!="undefined"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||typeof msCrypto!="undefined"&&typeof msCrypto.getRandomValues=="function"&&msCrypto.getRandomValues.bind(msCrypto),!Ip))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return Ip(SG)}const AG=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;function Op(t){return typeof t=="string"&&AG.test(t)}for(var En=[],Ky=0;Ky<256;++Ky)En.push((Ky+256).toString(16).substr(1));function Tp(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,n=(En[t[e+0]]+En[t[e+1]]+En[t[e+2]]+En[t[e+3]]+"-"+En[t[e+4]]+En[t[e+5]]+"-"+En[t[e+6]]+En[t[e+7]]+"-"+En[t[e+8]]+En[t[e+9]]+"-"+En[t[e+10]]+En[t[e+11]]+En[t[e+12]]+En[t[e+13]]+En[t[e+14]]+En[t[e+15]]).toLowerCase();if(!Op(n))throw TypeError("Stringified UUID is invalid");return n}var dI,qy,Yy=0,Qy=0;function kG(t,e,n){var r=e&&n||0,i=e||new Array(16);t=t||{};var o=t.node||dI,s=t.clockseq!==void 0?t.clockseq:qy;if(o==null||s==null){var a=t.random||(t.rng||uI)();o==null&&(o=dI=[a[0]|1,a[1],a[2],a[3],a[4],a[5]]),s==null&&(s=qy=(a[6]<<8|a[7])&16383)}var l=t.msecs!==void 0?t.msecs:Date.now(),c=t.nsecs!==void 0?t.nsecs:Qy+1,u=l-Yy+(c-Qy)/1e4;if(u<0&&t.clockseq===void 0&&(s=s+1&16383),(u<0||l>Yy)&&t.nsecs===void 0&&(c=0),c>=1e4)throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");Yy=l,Qy=c,qy=s,l+=122192928e5;var d=((l&268435455)*1e4+c)%4294967296;i[r++]=d>>>24&255,i[r++]=d>>>16&255,i[r++]=d>>>8&255,i[r++]=d&255;var h=l/4294967296*1e4&268435455;i[r++]=h>>>8&255,i[r++]=h&255,i[r++]=h>>>24&15|16,i[r++]=h>>>16&255,i[r++]=s>>>8|128,i[r++]=s&255;for(var g=0;g<6;++g)i[r+g]=o[g];return e||Tp(i)}function fI(t){if(!Op(t))throw TypeError("Invalid UUID");var e,n=new Uint8Array(16);return n[0]=(e=parseInt(t.slice(0,8),16))>>>24,n[1]=e>>>16&255,n[2]=e>>>8&255,n[3]=e&255,n[4]=(e=parseInt(t.slice(9,13),16))>>>8,n[5]=e&255,n[6]=(e=parseInt(t.slice(14,18),16))>>>8,n[7]=e&255,n[8]=(e=parseInt(t.slice(19,23),16))>>>8,n[9]=e&255,n[10]=(e=parseInt(t.slice(24,36),16))/1099511627776&255,n[11]=e/4294967296&255,n[12]=e>>>24&255,n[13]=e>>>16&255,n[14]=e>>>8&255,n[15]=e&255,n}function CG(t){t=unescape(encodeURIComponent(t));for(var e=[],n=0;n<t.length;++n)e.push(t.charCodeAt(n));return e}var IG="6ba7b810-9dad-11d1-80b4-00c04fd430c8",OG="6ba7b811-9dad-11d1-80b4-00c04fd430c8";function hI(t,e,n){function r(i,o,s,a){if(typeof i=="string"&&(i=CG(i)),typeof o=="string"&&(o=fI(o)),o.length!==16)throw TypeError("Namespace must be array-like (16 iterable integer values, 0-255)");var l=new Uint8Array(16+i.length);if(l.set(o),l.set(i,o.length),l=n(l),l[6]=l[6]&15|e,l[8]=l[8]&63|128,s){a=a||0;for(var c=0;c<16;++c)s[a+c]=l[c];return s}return Tp(l)}try{r.name=t}catch(i){}return r.DNS=IG,r.URL=OG,r}function TG(t){if(typeof t=="string"){var e=unescape(encodeURIComponent(t));t=new Uint8Array(e.length);for(var n=0;n<e.length;++n)t[n]=e.charCodeAt(n)}return PG(NG(BG(t),t.length*8))}function PG(t){for(var e=[],n=t.length*32,r="0123456789abcdef",i=0;i<n;i+=8){var o=t[i>>5]>>>i%32&255,s=parseInt(r.charAt(o>>>4&15)+r.charAt(o&15),16);e.push(s)}return e}function pI(t){return(t+64>>>9<<4)+14+1}function NG(t,e){t[e>>5]|=128<<e%32,t[pI(e)-1]=e;for(var n=1732584193,r=-271733879,i=-1732584194,o=271733878,s=0;s<t.length;s+=16){var a=n,l=r,c=i,u=o;n=On(n,r,i,o,t[s],7,-680876936),o=On(o,n,r,i,t[s+1],12,-389564586),i=On(i,o,n,r,t[s+2],17,606105819),r=On(r,i,o,n,t[s+3],22,-1044525330),n=On(n,r,i,o,t[s+4],7,-176418897),o=On(o,n,r,i,t[s+5],12,1200080426),i=On(i,o,n,r,t[s+6],17,-1473231341),r=On(r,i,o,n,t[s+7],22,-45705983),n=On(n,r,i,o,t[s+8],7,1770035416),o=On(o,n,r,i,t[s+9],12,-1958414417),i=On(i,o,n,r,t[s+10],17,-42063),r=On(r,i,o,n,t[s+11],22,-1990404162),n=On(n,r,i,o,t[s+12],7,1804603682),o=On(o,n,r,i,t[s+13],12,-40341101),i=On(i,o,n,r,t[s+14],17,-1502002290),r=On(r,i,o,n,t[s+15],22,1236535329),n=Tn(n,r,i,o,t[s+1],5,-165796510),o=Tn(o,n,r,i,t[s+6],9,-1069501632),i=Tn(i,o,n,r,t[s+11],14,643717713),r=Tn(r,i,o,n,t[s],20,-373897302),n=Tn(n,r,i,o,t[s+5],5,-701558691),o=Tn(o,n,r,i,t[s+10],9,38016083),i=Tn(i,o,n,r,t[s+15],14,-660478335),r=Tn(r,i,o,n,t[s+4],20,-405537848),n=Tn(n,r,i,o,t[s+9],5,568446438),o=Tn(o,n,r,i,t[s+14],9,-1019803690),i=Tn(i,o,n,r,t[s+3],14,-187363961),r=Tn(r,i,o,n,t[s+8],20,1163531501),n=Tn(n,r,i,o,t[s+13],5,-1444681467),o=Tn(o,n,r,i,t[s+2],9,-51403784),i=Tn(i,o,n,r,t[s+7],14,1735328473),r=Tn(r,i,o,n,t[s+12],20,-1926607734),n=Pn(n,r,i,o,t[s+5],4,-378558),o=Pn(o,n,r,i,t[s+8],11,-2022574463),i=Pn(i,o,n,r,t[s+11],16,1839030562),r=Pn(r,i,o,n,t[s+14],23,-35309556),n=Pn(n,r,i,o,t[s+1],4,-1530992060),o=Pn(o,n,r,i,t[s+4],11,1272893353),i=Pn(i,o,n,r,t[s+7],16,-155497632),r=Pn(r,i,o,n,t[s+10],23,-1094730640),n=Pn(n,r,i,o,t[s+13],4,681279174),o=Pn(o,n,r,i,t[s],11,-358537222),i=Pn(i,o,n,r,t[s+3],16,-722521979),r=Pn(r,i,o,n,t[s+6],23,76029189),n=Pn(n,r,i,o,t[s+9],4,-640364487),o=Pn(o,n,r,i,t[s+12],11,-421815835),i=Pn(i,o,n,r,t[s+15],16,530742520),r=Pn(r,i,o,n,t[s+2],23,-995338651),n=Nn(n,r,i,o,t[s],6,-198630844),o=Nn(o,n,r,i,t[s+7],10,1126891415),i=Nn(i,o,n,r,t[s+14],15,-1416354905),r=Nn(r,i,o,n,t[s+5],21,-57434055),n=Nn(n,r,i,o,t[s+12],6,1700485571),o=Nn(o,n,r,i,t[s+3],10,-1894986606),i=Nn(i,o,n,r,t[s+10],15,-1051523),r=Nn(r,i,o,n,t[s+1],21,-2054922799),n=Nn(n,r,i,o,t[s+8],6,1873313359),o=Nn(o,n,r,i,t[s+15],10,-30611744),i=Nn(i,o,n,r,t[s+6],15,-1560198380),r=Nn(r,i,o,n,t[s+13],21,1309151649),n=Nn(n,r,i,o,t[s+4],6,-145523070),o=Nn(o,n,r,i,t[s+11],10,-1120210379),i=Nn(i,o,n,r,t[s+2],15,718787259),r=Nn(r,i,o,n,t[s+9],21,-343485551),n=gs(n,a),r=gs(r,l),i=gs(i,c),o=gs(o,u)}return[n,r,i,o]}function BG(t){if(t.length===0)return[];for(var e=t.length*8,n=new Uint32Array(pI(e)),r=0;r<e;r+=8)n[r>>5]|=(t[r/8]&255)<<r%32;return n}function gs(t,e){var n=(t&65535)+(e&65535),r=(t>>16)+(e>>16)+(n>>16);return r<<16|n&65535}function RG(t,e){return t<<e|t>>>32-e}function Pp(t,e,n,r,i,o){return gs(RG(gs(gs(e,t),gs(r,o)),i),n)}function On(t,e,n,r,i,o,s){return Pp(e&n|~e&r,t,e,i,o,s)}function Tn(t,e,n,r,i,o,s){return Pp(e&r|n&~r,t,e,i,o,s)}function Pn(t,e,n,r,i,o,s){return Pp(e^n^r,t,e,i,o,s)}function Nn(t,e,n,r,i,o,s){return Pp(n^(e|~r),t,e,i,o,s)}var MG=hI("v3",48,TG);function LG(t,e,n){t=t||{};var r=t.random||(t.rng||uI)();if(r[6]=r[6]&15|64,r[8]=r[8]&63|128,e){n=n||0;for(var i=0;i<16;++i)e[n+i]=r[i];return e}return Tp(r)}function FG(t,e,n,r){switch(t){case 0:return e&n^~e&r;case 1:return e^n^r;case 2:return e&n^e&r^n&r;case 3:return e^n^r}}function Xy(t,e){return t<<e|t>>>32-e}function _G(t){var e=[1518500249,1859775393,2400959708,3395469782],n=[1732584193,4023233417,2562383102,271733878,3285377520];if(typeof t=="string"){var r=unescape(encodeURIComponent(t));t=[];for(var i=0;i<r.length;++i)t.push(r.charCodeAt(i))}else Array.isArray(t)||(t=Array.prototype.slice.call(t));t.push(128);for(var o=t.length/4+2,s=Math.ceil(o/16),a=new Array(s),l=0;l<s;++l){for(var c=new Uint32Array(16),u=0;u<16;++u)c[u]=t[l*64+u*4]<<24|t[l*64+u*4+1]<<16|t[l*64+u*4+2]<<8|t[l*64+u*4+3];a[l]=c}a[s-1][14]=(t.length-1)*8/Math.pow(2,32),a[s-1][14]=Math.floor(a[s-1][14]),a[s-1][15]=(t.length-1)*8&4294967295;for(var d=0;d<s;++d){for(var h=new Uint32Array(80),g=0;g<16;++g)h[g]=a[d][g];for(var b=16;b<80;++b)h[b]=Xy(h[b-3]^h[b-8]^h[b-14]^h[b-16],1);for(var p=n[0],w=n[1],S=n[2],O=n[3],T=n[4],$=0;$<80;++$){var R=Math.floor($/20),j=Xy(p,5)+FG(R,w,S,O)+T+e[R]+h[$]>>>0;T=O,O=S,S=Xy(w,30)>>>0,w=p,p=j}n[0]=n[0]+p>>>0,n[1]=n[1]+w>>>0,n[2]=n[2]+S>>>0,n[3]=n[3]+O>>>0,n[4]=n[4]+T>>>0}return[n[0]>>24&255,n[0]>>16&255,n[0]>>8&255,n[0]&255,n[1]>>24&255,n[1]>>16&255,n[1]>>8&255,n[1]&255,n[2]>>24&255,n[2]>>16&255,n[2]>>8&255,n[2]&255,n[3]>>24&255,n[3]>>16&255,n[3]>>8&255,n[3]&255,n[4]>>24&255,n[4]>>16&255,n[4]>>8&255,n[4]&255]}var VG=hI("v5",80,_G);const DG="00000000-0000-0000-0000-000000000000";function zG(t){if(!Op(t))throw TypeError("Invalid UUID");return parseInt(t.substr(14,1),16)}const gI=lu(Object.freeze(Object.defineProperty({__proto__:null,NIL:DG,parse:fI,stringify:Tp,v1:kG,v3:MG,v4:LG,v5:VG,validate:Op,version:zG},Symbol.toStringTag,{value:"Module"})));var Jy,mI;function UG(){if(mI)return Jy;mI=1;const t=gI.v4;return Jy=function(n,r,i,o){if(typeof n!="string")throw new TypeError(n+" must be a string");o=o||{};const s=typeof o.version=="number"?o.version:2;if(s!==1&&s!==2)throw new TypeError(s+" must be 1 or 2");const a={method:n};if(s===2&&(a.jsonrpc="2.0"),r){if(typeof r!="object"&&!Array.isArray(r))throw new TypeError(r+" must be an object, array or omitted");a.params=r}if(typeof i=="undefined"){const l=typeof o.generator=="function"?o.generator:function(){return t()};a.id=l(a,o)}else s===2&&i===null?o.notificationIdNull&&(a.id=null):a.id=i;return a},Jy}var Zy,yI;function $G(){if(yI)return Zy;yI=1;const t=gI.v4,e=UG(),n=function(r,i){if(!(this instanceof n))return new n(r,i);i||(i={}),this.options={reviver:typeof i.reviver!="undefined"?i.reviver:null,replacer:typeof i.replacer!="undefined"?i.replacer:null,generator:typeof i.generator!="undefined"?i.generator:function(){return t()},version:typeof i.version!="undefined"?i.version:2,notificationIdNull:typeof i.notificationIdNull=="boolean"?i.notificationIdNull:!1},this.callServer=r};return Zy=n,n.prototype.request=function(r,i,o,s){const a=this;let l=null;const c=Array.isArray(r)&&typeof i=="function";if(this.options.version===1&&c)throw new TypeError("JSON-RPC 1.0 does not support batching");if(c||!c&&r&&typeof r=="object"&&typeof i=="function")s=i,l=r;else{typeof o=="function"&&(s=o,o=void 0);const h=typeof s=="function";try{l=e(r,i,o,{generator:this.options.generator,version:this.options.version,notificationIdNull:this.options.notificationIdNull})}catch(g){if(h)return s(g);throw g}if(!h)return l}let d;try{d=JSON.stringify(l,this.options.replacer)}catch(h){return s(h)}return this.callServer(d,function(h,g){a._parseResponse(h,g,s)}),l},n.prototype._parseResponse=function(r,i,o){if(r){o(r);return}if(!i)return o();let s;try{s=JSON.parse(i,this.options.reviver)}catch(a){return o(a)}if(o.length===3)if(Array.isArray(s)){const a=function(c){return typeof c.error!="undefined"},l=function(c){return!a(c)};return o(null,s.filter(a),s.filter(l))}else return o(null,s.error,s.result);o(null,s)},Zy}$G();var eb={exports:{}},bI;function HG(){return bI||(bI=1,function(t){var e=Object.prototype.hasOwnProperty,n="~";function r(){}Object.create&&(r.prototype=Object.create(null),new r().__proto__||(n=!1));function i(l,c,u){this.fn=l,this.context=c,this.once=u||!1}function o(l,c,u,d,h){if(typeof u!="function")throw new TypeError("The listener must be a function");var g=new i(u,d||l,h),b=n?n+c:c;return l._events[b]?l._events[b].fn?l._events[b]=[l._events[b],g]:l._events[b].push(g):(l._events[b]=g,l._eventsCount++),l}function s(l,c){--l._eventsCount===0?l._events=new r:delete l._events[c]}function a(){this._events=new r,this._eventsCount=0}a.prototype.eventNames=function(){var c=[],u,d;if(this._eventsCount===0)return c;for(d in u=this._events)e.call(u,d)&&c.push(n?d.slice(1):d);return Object.getOwnPropertySymbols?c.concat(Object.getOwnPropertySymbols(u)):c},a.prototype.listeners=function(c){var u=n?n+c:c,d=this._events[u];if(!d)return[];if(d.fn)return[d.fn];for(var h=0,g=d.length,b=new Array(g);h<g;h++)b[h]=d[h].fn;return b},a.prototype.listenerCount=function(c){var u=n?n+c:c,d=this._events[u];return d?d.fn?1:d.length:0},a.prototype.emit=function(c,u,d,h,g,b){var p=n?n+c:c;if(!this._events[p])return!1;var w=this._events[p],S=arguments.length,O,T;if(w.fn){switch(w.once&&this.removeListener(c,w.fn,void 0,!0),S){case 1:return w.fn.call(w.context),!0;case 2:return w.fn.call(w.context,u),!0;case 3:return w.fn.call(w.context,u,d),!0;case 4:return w.fn.call(w.context,u,d,h),!0;case 5:return w.fn.call(w.context,u,d,h,g),!0;case 6:return w.fn.call(w.context,u,d,h,g,b),!0}for(T=1,O=new Array(S-1);T<S;T++)O[T-1]=arguments[T];w.fn.apply(w.context,O)}else{var $=w.length,R;for(T=0;T<$;T++)switch(w[T].once&&this.removeListener(c,w[T].fn,void 0,!0),S){case 1:w[T].fn.call(w[T].context);break;case 2:w[T].fn.call(w[T].context,u);break;case 3:w[T].fn.call(w[T].context,u,d);break;case 4:w[T].fn.call(w[T].context,u,d,h);break;default:if(!O)for(R=1,O=new Array(S-1);R<S;R++)O[R-1]=arguments[R];w[T].fn.apply(w[T].context,O)}}return!0},a.prototype.on=function(c,u,d){return o(this,c,u,d,!1)},a.prototype.once=function(c,u,d){return o(this,c,u,d,!0)},a.prototype.removeListener=function(c,u,d,h){var g=n?n+c:c;if(!this._events[g])return this;if(!u)return s(this,g),this;var b=this._events[g];if(b.fn)b.fn===u&&(!h||b.once)&&(!d||b.context===d)&&s(this,g);else{for(var p=0,w=[],S=b.length;p<S;p++)(b[p].fn!==u||h&&!b[p].once||d&&b[p].context!==d)&&w.push(b[p]);w.length?this._events[g]=w.length===1?w[0]:w:s(this,g)}return this},a.prototype.removeAllListeners=function(c){var u;return c?(u=n?n+c:c,this._events[u]&&s(this,u)):(this._events=new r,this._eventsCount=0),this},a.prototype.off=a.prototype.removeListener,a.prototype.addListener=a.prototype.on,a.prefixed=n,a.EventEmitter=a,t.exports=a}(eb)),eb.exports}HG();/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const vI=(t,e)=>(t+(t>=0?e:-e)/wI)/e;function WG(t,e,n){const[[r,i],[o,s]]=e,a=vI(s*t,n),l=vI(-i*t,n);let c=t-a*r-l*o,u=-a*i-l*s;const d=c<Co,h=u<Co;d&&(c=-c),h&&(u=-u);const g=Ed(Math.ceil(IC(n)/2))+oc;if(c<Co||c>=g||u<Co||u>=g)throw new Error("splitScalar (endomorphism): failed, k="+t);return{k1neg:d,k1:c,k2neg:h,k2:u}}function tb(t){if(!["compact","recovered","der"].includes(t))throw new Error('Signature format must be "compact", "recovered", or "der"');return t}function nb(t,e){const n={};for(let r of Object.keys(e))n[r]=t[r]===void 0?e[r]:t[r];return Sa(n.lowS,"lowS"),Sa(n.prehash,"prehash"),n.format!==void 0&&tb(n.format),n}class GG extends Error{constructor(e=""){super(e)}}const ko={Err:GG,_tlv:{encode:(t,e)=>{const{Err:n}=ko;if(t<0||t>256)throw new n("tlv.encode: wrong tag");if(e.length&1)throw new n("tlv.encode: unpadded data");const r=e.length/2,i=gp(r);if(i.length/2&128)throw new n("tlv.encode: long form length too big");const o=r>127?gp(i.length/2|128):"";return gp(t)+o+i+e},decode(t,e){const{Err:n}=ko;let r=0;if(t<0||t>256)throw new n("tlv.encode: wrong tag");if(e.length<2||e[r++]!==t)throw new n("tlv.decode: wrong tlv");const i=e[r++],o=!!(i&128);let s=0;if(!o)s=i;else{const l=i&127;if(!l)throw new n("tlv.decode(long): indefinite length not supported");if(l>4)throw new n("tlv.decode(long): byte length is too big");const c=e.subarray(r,r+l);if(c.length!==l)throw new n("tlv.decode: length bytes not complete");if(c[0]===0)throw new n("tlv.decode(long): zero leftmost byte");for(const u of c)s=s<<8|u;if(r+=l,s<128)throw new n("tlv.decode(long): not minimal encoding")}const a=e.subarray(r,r+s);if(a.length!==s)throw new n("tlv.decode: wrong value length");return{v:a,l:e.subarray(r+s)}}},_int:{encode(t){const{Err:e}=ko;if(t<Co)throw new e("integer: negative integers are not allowed");let n=gp(t);if(Number.parseInt(n[0],16)&8&&(n="00"+n),n.length&1)throw new e("unexpected DER parsing assertion: unpadded hex");return n},decode(t){const{Err:e}=ko;if(t[0]&128)throw new e("invalid signature integer: negative");if(t[0]===0&&!(t[1]&128))throw new e("invalid signature integer: unnecessary leading zero");return mp(t)}},toSig(t){const{Err:e,_int:n,_tlv:r}=ko,i=St("signature",t),{v:o,l:s}=r.decode(48,i);if(s.length)throw new e("invalid signature: left bytes after parsing");const{v:a,l}=r.decode(2,o),{v:c,l:u}=r.decode(2,l);if(u.length)throw new e("invalid signature: left bytes after parsing");return{r:n.decode(a),s:n.decode(c)}},hexFromSig(t){const{_tlv:e,_int:n}=ko,r=e.encode(2,n.encode(t.r)),i=e.encode(2,n.encode(t.s)),o=r+i;return e.encode(48,o)}},Co=BigInt(0),oc=BigInt(1),wI=BigInt(2),Np=BigInt(3),jG=BigInt(4);function sc(t,e){const{BYTES:n}=t;let r;if(typeof e=="bigint")r=e;else{let i=St("private key",e);try{r=t.fromBytes(i)}catch(o){throw new Error(`invalid private key: expected ui8a of size ${n}, got ${typeof e}`)}}if(!t.isValidNot0(r))throw new Error("invalid private key: out of range [1..N-1]");return r}function KG(t,e={}){const n=qC("weierstrass",t,e),{Fp:r,Fn:i}=n;let o=n.CURVE;const{h:s,n:a}=o;Sd(e,{},{allowInfinityPoint:"boolean",clearCofactor:"function",isTorsionFree:"function",fromBytes:"function",toBytes:"function",endo:"object",wrapPrivateKey:"boolean"});const{endo:l}=e;if(l&&(!r.is0(o.a)||typeof l.beta!="bigint"||!Array.isArray(l.basises)))throw new Error('invalid endo: expected "beta": bigint and "basises": array');const c=EI(r,i);function u(){if(!r.isOdd)throw new Error("compression is not supported: Field does not have .isOdd()")}function d(z,C,f){const{x:y,y:E}=C.toAffine(),I=r.toBytes(y);if(Sa(f,"isCompressed"),f){u();const N=!r.isOdd(E);return Ii(xI(N),I)}else return Ii(Uint8Array.of(4),I,r.toBytes(E))}function h(z){ii(z,void 0,"Point");const{publicKey:C,publicKeyUncompressed:f}=c,y=z.length,E=z[0],I=z.subarray(1);if(y===C&&(E===2||E===3)){const N=r.fromBytes(I);if(!r.isValid(N))throw new Error("bad point: is not on curve, wrong x");const D=p(N);let M;try{M=r.sqrt(D)}catch(v){const B=v instanceof Error?": "+v.message:"";throw new Error("bad point: is not on curve, sqrt error"+B)}u();const P=r.isOdd(M);return(E&1)===1!==P&&(M=r.neg(M)),{x:N,y:M}}else if(y===f&&E===4){const N=r.BYTES,D=r.fromBytes(I.subarray(0,N)),M=r.fromBytes(I.subarray(N,N*2));if(!w(D,M))throw new Error("bad point: is not on curve");return{x:D,y:M}}else throw new Error(`bad point: got length ${y}, expected compressed=${C} or uncompressed=${f}`)}const g=e.toBytes||d,b=e.fromBytes||h;function p(z){const C=r.sqr(z),f=r.mul(C,z);return r.add(r.add(f,r.mul(z,o.a)),o.b)}function w(z,C){const f=r.sqr(C),y=p(z);return r.eql(f,y)}if(!w(o.Gx,o.Gy))throw new Error("bad curve params: generator point");const S=r.mul(r.pow(o.a,Np),jG),O=r.mul(r.sqr(o.b),BigInt(27));if(r.is0(r.add(S,O)))throw new Error("bad curve params: a or b");function T(z,C,f=!1){if(!r.isValid(C)||f&&r.is0(C))throw new Error(`bad point coordinate ${z}`);return C}function $(z){if(!(z instanceof L))throw new Error("ProjectivePoint expected")}function R(z){if(!l||!l.basises)throw new Error("no endo");return WG(z,l.basises,i.ORDER)}const j=yp((z,C)=>{const{X:f,Y:y,Z:E}=z;if(r.eql(E,r.ONE))return{x:f,y};const I=z.is0();C==null&&(C=I?r.ONE:r.inv(E));const N=r.mul(f,C),D=r.mul(y,C),M=r.mul(E,C);if(I)return{x:r.ZERO,y:r.ZERO};if(!r.eql(M,r.ONE))throw new Error("invZ was invalid");return{x:N,y:D}}),q=yp(z=>{if(z.is0()){if(e.allowInfinityPoint&&!r.is0(z.Y))return;throw new Error("bad point: ZERO")}const{x:C,y:f}=z.toAffine();if(!r.isValid(C)||!r.isValid(f))throw new Error("bad point: x or y not field elements");if(!w(C,f))throw new Error("bad point: equation left != right");if(!z.isTorsionFree())throw new Error("bad point: not in prime-order subgroup");return!0});function G(z,C,f,y,E){return f=new L(r.mul(f.X,z),f.Y,f.Z),C=bp(y,C),f=bp(E,f),C.add(f)}class L{constructor(C,f,y){this.X=T("x",C),this.Y=T("y",f,!0),this.Z=T("z",y),Object.freeze(this)}static CURVE(){return o}static fromAffine(C){const{x:f,y}=C||{};if(!C||!r.isValid(f)||!r.isValid(y))throw new Error("invalid affine point");if(C instanceof L)throw new Error("projective point not allowed");return r.is0(f)&&r.is0(y)?L.ZERO:new L(f,y,r.ONE)}static fromBytes(C){const f=L.fromAffine(b(ii(C,void 0,"point")));return f.assertValidity(),f}static fromHex(C){return L.fromBytes(St("pointHex",C))}get x(){return this.toAffine().x}get y(){return this.toAffine().y}precompute(C=8,f=!0){return W.createCache(this,C),f||this.multiply(Np),this}assertValidity(){q(this)}hasEvenY(){const{y:C}=this.toAffine();if(!r.isOdd)throw new Error("Field doesn't support isOdd");return!r.isOdd(C)}equals(C){$(C);const{X:f,Y:y,Z:E}=this,{X:I,Y:N,Z:D}=C,M=r.eql(r.mul(f,D),r.mul(I,E)),P=r.eql(r.mul(y,D),r.mul(N,E));return M&&P}negate(){return new L(this.X,r.neg(this.Y),this.Z)}double(){const{a:C,b:f}=o,y=r.mul(f,Np),{X:E,Y:I,Z:N}=this;let D=r.ZERO,M=r.ZERO,P=r.ZERO,m=r.mul(E,E),v=r.mul(I,I),B=r.mul(N,N),U=r.mul(E,I);return U=r.add(U,U),P=r.mul(E,N),P=r.add(P,P),D=r.mul(C,P),M=r.mul(y,B),M=r.add(D,M),D=r.sub(v,M),M=r.add(v,M),M=r.mul(D,M),D=r.mul(U,D),P=r.mul(y,P),B=r.mul(C,B),U=r.sub(m,B),U=r.mul(C,U),U=r.add(U,P),P=r.add(m,m),m=r.add(P,m),m=r.add(m,B),m=r.mul(m,U),M=r.add(M,m),B=r.mul(I,N),B=r.add(B,B),m=r.mul(B,U),D=r.sub(D,m),P=r.mul(B,v),P=r.add(P,P),P=r.add(P,P),new L(D,M,P)}add(C){$(C);const{X:f,Y:y,Z:E}=this,{X:I,Y:N,Z:D}=C;let M=r.ZERO,P=r.ZERO,m=r.ZERO;const v=o.a,B=r.mul(o.b,Np);let U=r.mul(f,I),Q=r.mul(y,N),ee=r.mul(E,D),Z=r.add(f,y),Y=r.add(I,N);Z=r.mul(Z,Y),Y=r.add(U,Q),Z=r.sub(Z,Y),Y=r.add(f,E);let re=r.add(I,D);return Y=r.mul(Y,re),re=r.add(U,ee),Y=r.sub(Y,re),re=r.add(y,E),M=r.add(N,D),re=r.mul(re,M),M=r.add(Q,ee),re=r.sub(re,M),m=r.mul(v,Y),M=r.mul(B,ee),m=r.add(M,m),M=r.sub(Q,m),m=r.add(Q,m),P=r.mul(M,m),Q=r.add(U,U),Q=r.add(Q,U),ee=r.mul(v,ee),Y=r.mul(B,Y),Q=r.add(Q,ee),ee=r.sub(U,ee),ee=r.mul(v,ee),Y=r.add(Y,ee),U=r.mul(Q,Y),P=r.add(P,U),U=r.mul(re,Y),M=r.mul(Z,M),M=r.sub(M,U),U=r.mul(Z,Q),m=r.mul(re,m),m=r.add(m,U),new L(M,P,m)}subtract(C){return this.add(C.negate())}is0(){return this.equals(L.ZERO)}multiply(C){const{endo:f}=e;if(!i.isValidNot0(C))throw new Error("invalid scalar: out of range");let y,E;const I=N=>W.cached(this,N,D=>Ia(L,D));if(f){const{k1neg:N,k1:D,k2neg:M,k2:P}=R(C),{p:m,f:v}=I(D),{p:B,f:U}=I(P);E=v.add(U),y=G(f.beta,m,B,N,M)}else{const{p:N,f:D}=I(C);y=N,E=D}return Ia(L,[y,E])[0]}multiplyUnsafe(C){const{endo:f}=e,y=this;if(!i.isValid(C))throw new Error("invalid scalar: out of range");if(C===Co||y.is0())return L.ZERO;if(C===oc)return y;if(W.hasCache(this))return this.multiply(C);if(f){const{k1neg:E,k1:I,k2neg:N,k2:D}=R(C),{p1:M,p2:P}=zW(L,y,I,D);return G(f.beta,M,P,E,N)}else return W.unsafe(y,C)}multiplyAndAddUnsafe(C,f,y){const E=this.multiplyUnsafe(f).add(C.multiplyUnsafe(y));return E.is0()?void 0:E}toAffine(C){return j(this,C)}isTorsionFree(){const{isTorsionFree:C}=e;return s===oc?!0:C?C(L,this):W.unsafe(this,a).is0()}clearCofactor(){const{clearCofactor:C}=e;return s===oc?this:C?C(L,this):this.multiplyUnsafe(s)}isSmallOrder(){return this.multiplyUnsafe(s).is0()}toBytes(C=!0){return Sa(C,"isCompressed"),this.assertValidity(),g(L,this,C)}toHex(C=!0){return na(this.toBytes(C))}toString(){return`<Point ${this.is0()?"ZERO":this.toHex()}>`}get px(){return this.X}get py(){return this.X}get pz(){return this.Z}toRawBytes(C=!0){return this.toBytes(C)}_setWindowSize(C){this.precompute(C)}static normalizeZ(C){return Ia(L,C)}static msm(C,f){return jC(L,i,C,f)}static fromPrivateKey(C){return L.BASE.multiply(sc(i,C))}}L.BASE=new L(o.Gx,o.Gy,r.ONE),L.ZERO=new L(r.ZERO,r.ONE,r.ZERO),L.Fp=r,L.Fn=i;const V=i.BITS,W=new GC(L,e.endo?Math.ceil(V/2):V);return L.BASE.precompute(8),L}function xI(t){return Uint8Array.of(t?2:3)}function EI(t,e){return{secretKey:e.BYTES,publicKey:1+t.BYTES,publicKeyUncompressed:1+2*t.BYTES,publicKeyHasPrefix:!0,signature:2*e.BYTES}}function qG(t,e={}){const{Fn:n}=t,r=e.randomBytes||om,i=Object.assign(EI(t.Fp,n),{seed:zC(n.ORDER)});function o(g){try{return!!sc(n,g)}catch(b){return!1}}function s(g,b){const{publicKey:p,publicKeyUncompressed:w}=i;try{const S=g.length;return b===!0&&S!==p||b===!1&&S!==w?!1:!!t.fromBytes(g)}catch(S){return!1}}function a(g=r(i.seed)){return _W(ii(g,i.seed,"seed"),n.ORDER)}function l(g,b=!0){return t.BASE.multiply(sc(n,g)).toBytes(b)}function c(g){const b=a(g);return{secretKey:b,publicKey:l(b)}}function u(g){if(typeof g=="bigint")return!1;if(g instanceof t)return!0;const{secretKey:b,publicKey:p,publicKeyUncompressed:w}=i;if(n.allowedLengths||b===p)return;const S=St("key",g).length;return S===p||S===w}function d(g,b,p=!0){if(u(g)===!0)throw new Error("first arg must be private key");if(u(b)===!1)throw new Error("second arg must be public key");const w=sc(n,g);return t.fromHex(b).multiply(w).toBytes(p)}return Object.freeze({getPublicKey:l,getSharedSecret:d,keygen:c,Point:t,utils:{isValidSecretKey:o,isValidPublicKey:s,randomSecretKey:a,isValidPrivateKey:o,randomPrivateKey:a,normPrivateKeyToScalar:g=>sc(n,g),precompute(g=8,b=t.BASE){return b.precompute(g,!1)}},lengths:i})}function YG(t,e,n={}){xE(e),Sd(n,{},{hmac:"function",lowS:"boolean",randomBytes:"function",bits2int:"function",bits2int_modN:"function"});const r=n.randomBytes||om,i=n.hmac||((f,...y)=>$E(e,f,Ii(...y))),{Fp:o,Fn:s}=t,{ORDER:a,BITS:l}=s,{keygen:c,getPublicKey:u,getSharedSecret:d,utils:h,lengths:g}=qG(t,n),b={prehash:!1,lowS:typeof n.lowS=="boolean"?n.lowS:!1,format:void 0,extraEntropy:!1},p="compact";function w(f){const y=a>>oc;return f>y}function S(f,y){if(!s.isValidNot0(y))throw new Error(`invalid signature ${f}: out of range 1..Point.Fn.ORDER`);return y}function O(f,y){tb(y);const E=g.signature,I=y==="compact"?E:y==="recovered"?E+1:void 0;return ii(f,I,`${y} signature`)}class T{constructor(y,E,I){this.r=S("r",y),this.s=S("s",E),I!=null&&(this.recovery=I),Object.freeze(this)}static fromBytes(y,E=p){O(y,E);let I;if(E==="der"){const{r:P,s:m}=ko.toSig(ii(y));return new T(P,m)}E==="recovered"&&(I=y[0],E="compact",y=y.subarray(1));const N=s.BYTES,D=y.subarray(0,N),M=y.subarray(N,N*2);return new T(s.fromBytes(D),s.fromBytes(M),I)}static fromHex(y,E){return this.fromBytes(xh(y),E)}addRecoveryBit(y){return new T(this.r,this.s,y)}recoverPublicKey(y){const E=o.ORDER,{r:I,s:N,recovery:D}=this;if(D==null||![0,1,2,3].includes(D))throw new Error("recovery id invalid");if(a*wI<E&&D>1)throw new Error("recovery id is ambiguous for h>1 curve");const P=D===2||D===3?I+a:I;if(!o.isValid(P))throw new Error("recovery id 2 or 3 invalid");const m=o.toBytes(P),v=t.fromBytes(Ii(xI((D&1)===0),m)),B=s.inv(P),U=R(St("msgHash",y)),Q=s.create(-U*B),ee=s.create(N*B),Z=t.BASE.multiplyUnsafe(Q).add(v.multiplyUnsafe(ee));if(Z.is0())throw new Error("point at infinify");return Z.assertValidity(),Z}hasHighS(){return w(this.s)}toBytes(y=p){if(tb(y),y==="der")return xh(ko.hexFromSig(this));const E=s.toBytes(this.r),I=s.toBytes(this.s);if(y==="recovered"){if(this.recovery==null)throw new Error("recovery bit must be present");return Ii(Uint8Array.of(this.recovery),E,I)}return Ii(E,I)}toHex(y){return na(this.toBytes(y))}assertValidity(){}static fromCompact(y){return T.fromBytes(St("sig",y),"compact")}static fromDER(y){return T.fromBytes(St("sig",y),"der")}normalizeS(){return this.hasHighS()?new T(this.r,s.neg(this.s),this.recovery):this}toDERRawBytes(){return this.toBytes("der")}toDERHex(){return na(this.toBytes("der"))}toCompactRawBytes(){return this.toBytes("compact")}toCompactHex(){return na(this.toBytes("compact"))}}const $=n.bits2int||function(y){if(y.length>8192)throw new Error("input is too large");const E=mp(y),I=y.length*8-l;return I>0?E>>BigInt(I):E},R=n.bits2int_modN||function(y){return s.create($(y))},j=Ed(l);function q(f){return By("num < 2^"+l,f,Co,j),s.toBytes(f)}function G(f,y){return ii(f,void 0,"message"),y?ii(e(f),void 0,"prehashed message"):f}function L(f,y,E){if(["recovered","canonical"].some(Q=>Q in E))throw new Error("sign() legacy options not supported");const{lowS:I,prehash:N,extraEntropy:D}=nb(E,b);f=G(f,N);const M=R(f),P=sc(s,y),m=[q(P),q(M)];if(D!=null&&D!==!1){const Q=D===!0?r(g.secretKey):D;m.push(St("extraEntropy",Q))}const v=Ii(...m),B=M;function U(Q){const ee=$(Q);if(!s.isValidNot0(ee))return;const Z=s.inv(ee),Y=t.BASE.multiply(ee).toAffine(),re=s.create(Y.x);if(re===Co)return;const de=s.create(Z*s.create(B+re*P));if(de===Co)return;let se=(Y.x===re?0:2)|Number(Y.y&oc),me=de;return I&&w(de)&&(me=s.neg(de),se^=1),new T(re,me,se)}return{seed:v,k2sig:U}}function V(f,y,E={}){f=St("message",f);const{seed:I,k2sig:N}=L(f,y,E);return IW(e.outputLen,s.BYTES,i)(I,N)}function W(f){let y;const E=typeof f=="string"||Hu(f),I=!E&&f!==null&&typeof f=="object"&&typeof f.r=="bigint"&&typeof f.s=="bigint";if(!E&&!I)throw new Error("invalid signature, expected Uint8Array, hex string or Signature instance");if(I)y=new T(f.r,f.s);else if(E){try{y=T.fromBytes(St("sig",f),"der")}catch(N){if(!(N instanceof ko.Err))throw N}if(!y)try{y=T.fromBytes(St("sig",f),"compact")}catch(N){return!1}}return y||!1}function z(f,y,E,I={}){const{lowS:N,prehash:D,format:M}=nb(I,b);if(E=St("publicKey",E),y=G(St("message",y),D),"strict"in I)throw new Error("options.strict was renamed to lowS");const P=M===void 0?W(f):T.fromBytes(St("sig",f),M);if(P===!1)return!1;try{const m=t.fromBytes(E);if(N&&P.hasHighS())return!1;const{r:v,s:B}=P,U=R(y),Q=s.inv(B),ee=s.create(U*Q),Z=s.create(v*Q),Y=t.BASE.multiplyUnsafe(ee).add(m.multiplyUnsafe(Z));return Y.is0()?!1:s.create(Y.x)===v}catch(m){return!1}}function C(f,y,E={}){const{prehash:I}=nb(E,b);return y=G(y,I),T.fromBytes(f,"recovered").recoverPublicKey(y).toBytes()}return Object.freeze({keygen:c,getPublicKey:u,getSharedSecret:d,utils:h,lengths:g,Point:t,sign:V,verify:z,recoverPublicKey:C,Signature:T,hash:e})}function QG(t){const e={a:t.a,b:t.b,p:t.Fp.ORDER,n:t.n,h:t.h,Gx:t.Gx,Gy:t.Gy},n=t.Fp;let r=t.allowedPrivateKeyLengths?Array.from(new Set(t.allowedPrivateKeyLengths.map(s=>Math.ceil(s/2)))):void 0;const i=ka(e.n,{BITS:t.nBitLength,allowedLengths:r,modFromBytes:t.wrapPrivateKey}),o={Fp:n,Fn:i,allowInfinityPoint:t.allowInfinityPoint,endo:t.endo,isTorsionFree:t.isTorsionFree,clearCofactor:t.clearCofactor,fromBytes:t.fromBytes,toBytes:t.toBytes};return{CURVE:e,curveOpts:o}}function XG(t){const{CURVE:e,curveOpts:n}=QG(t),r={hmac:t.hmac,randomBytes:t.randomBytes,lowS:t.lowS,bits2int:t.bits2int,bits2int_modN:t.bits2int_modN};return{CURVE:e,curveOpts:n,hash:t.hash,ecdsaOpts:r}}function JG(t,e){const n=e.Point;return Object.assign({},e,{ProjectivePoint:n,CURVE:Object.assign({},t,VC(n.Fn.ORDER,n.Fn.BITS))})}function ZG(t){const{CURVE:e,curveOpts:n,hash:r,ecdsaOpts:i}=XG(t),o=KG(e,n),s=YG(o,r,i);return JG(t,s)}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */function ej(t,e){const n=r=>ZG({...t,hash:r});return{...n(e),create:n}}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const rb={p:BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f"),n:BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),h:BigInt(1),a:BigInt(0),b:BigInt(7),Gx:BigInt("0x79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798"),Gy:BigInt("0x483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8")},tj={beta:BigInt("0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee"),basises:[[BigInt("0x3086d221a7d46bcde86c90e49284eb15"),-BigInt("0xe4437ed6010e88286f547fa90abfe4c3")],[BigInt("0x114ca50f7a8e2f3f657c1108d9d44cfd8"),BigInt("0x3086d221a7d46bcde86c90e49284eb15")]]},SI=BigInt(2);function nj(t){const e=rb.p,n=BigInt(3),r=BigInt(6),i=BigInt(11),o=BigInt(22),s=BigInt(23),a=BigInt(44),l=BigInt(88),c=t*t*t%e,u=c*c*t%e,d=At(u,n,e)*u%e,h=At(d,n,e)*u%e,g=At(h,SI,e)*c%e,b=At(g,i,e)*g%e,p=At(b,o,e)*b%e,w=At(p,a,e)*p%e,S=At(w,l,e)*w%e,O=At(S,a,e)*p%e,T=At(O,n,e)*u%e,$=At(T,s,e)*b%e,R=At($,r,e)*c%e,j=At(R,SI,e);if(!ib.eql(ib.sqr(j),t))throw new Error("Cannot find square root");return j}const ib=ka(rb.p,{sqrt:nj}),rj=ej({...rb,Fp:ib,lowS:!0,endo:tj},VE);Ad.utils.randomPrivateKey,Ad.getPublicKey;function AI(t){try{return Ad.ExtendedPoint.fromHex(t),!0}catch(e){return!1}}const kI=(t,e)=>Ad.sign(t,e.slice(0,32)),ij=Ad.verify,Gn=t=>Fe.Buffer.isBuffer(t)?t:t instanceof Uint8Array?Fe.Buffer.from(t.buffer,t.byteOffset,t.byteLength):Fe.Buffer.from(t);class oj{constructor(e){Object.assign(this,e)}encode(){return Fe.Buffer.from(Hy.serialize(Bp,this))}static decode(e){return Hy.deserialize(Bp,this,e)}static decodeUnchecked(e){return Hy.deserializeUnchecked(Bp,this,e)}}const Bp=new Map;var CI;const sj=32,ms=32;function aj(t){return t._bn!==void 0}let II=1;class ke extends oj{constructor(e){if(super({}),this._bn=void 0,aj(e))this._bn=e._bn;else{if(typeof e=="string"){const n=Hn.decode(e);if(n.length!=ms)throw new Error("Invalid public key input");this._bn=new eI(n)}else this._bn=new eI(e);if(this._bn.byteLength()>ms)throw new Error("Invalid public key input")}}static unique(){const e=new ke(II);return II+=1,new ke(e.toBuffer())}equals(e){return this._bn.eq(e._bn)}toBase58(){return Hn.encode(this.toBytes())}toJSON(){return this.toBase58()}toBytes(){const e=this.toBuffer();return new Uint8Array(e.buffer,e.byteOffset,e.byteLength)}toBuffer(){const e=this._bn.toArrayLike(Fe.Buffer);if(e.length===ms)return e;const n=Fe.Buffer.alloc(32);return e.copy(n,32-e.length),n}get[Symbol.toStringTag](){return`PublicKey(${this.toString()})`}toString(){return this.toBase58()}static async createWithSeed(e,n,r){const i=Fe.Buffer.concat([e.toBuffer(),Fe.Buffer.from(n),r.toBuffer()]),o=DE(i);return new ke(o)}static createProgramAddressSync(e,n){let r=Fe.Buffer.alloc(0);e.forEach(function(o){if(o.length>sj)throw new TypeError("Max seed length exceeded");r=Fe.Buffer.concat([r,Gn(o)])}),r=Fe.Buffer.concat([r,n.toBuffer(),Fe.Buffer.from("ProgramDerivedAddress")]);const i=DE(r);if(AI(i))throw new Error("Invalid seeds, address must fall off the curve");return new ke(i)}static async createProgramAddress(e,n){return this.createProgramAddressSync(e,n)}static findProgramAddressSync(e,n){let r=255,i;for(;r!=0;){try{const o=e.concat(Fe.Buffer.from([r]));i=this.createProgramAddressSync(o,n)}catch(o){if(o instanceof TypeError)throw o;r--;continue}return[i,r]}throw new Error("Unable to find a viable program address nonce")}static async findProgramAddress(e,n){return this.findProgramAddressSync(e,n)}static isOnCurve(e){const n=new ke(e);return AI(n.toBytes())}}CI=ke,ke.default=new CI("11111111111111111111111111111111"),Bp.set(ke,{kind:"struct",fields:[["_bn","u256"]]}),new ke("BPFLoader1111111111111111111111111111111111");const ac=1232,ob=127,Rp=64;class Mp{constructor(e,n){this.staticAccountKeys=void 0,this.accountKeysFromLookups=void 0,this.staticAccountKeys=e,this.accountKeysFromLookups=n}keySegments(){const e=[this.staticAccountKeys];return this.accountKeysFromLookups&&(e.push(this.accountKeysFromLookups.writable),e.push(this.accountKeysFromLookups.readonly)),e}get(e){for(const n of this.keySegments()){if(e<n.length)return n[e];e-=n.length}}get length(){return this.keySegments().flat().length}compileInstructions(e){if(this.length>256)throw new Error("Account index overflow encountered during compilation");const r=new Map;this.keySegments().flat().forEach((o,s)=>{r.set(o.toBase58(),s)});const i=o=>{const s=r.get(o.toBase58());if(s===void 0)throw new Error("Encountered an unknown instruction account key during compilation");return s};return e.map(o=>({programIdIndex:i(o.programId),accountKeyIndexes:o.keys.map(s=>i(s.pubkey)),data:o.data}))}}const je=(t="publicKey")=>X.blob(32,t),lj=(t="signature")=>X.blob(64,t),lc=(t="string")=>{const e=X.struct([X.u32("length"),X.u32("lengthPadding"),X.blob(X.offset(X.u32(),-8),"chars")],t),n=e.decode.bind(e),r=e.encode.bind(e),i=e;return i.decode=(o,s)=>n(o,s).chars.toString(),i.encode=(o,s,a)=>{const l={chars:Fe.Buffer.from(o,"utf8")};return r(l,s,a)},i.alloc=o=>X.u32().span+X.u32().span+Fe.Buffer.from(o,"utf8").length,i},cj=(t="authorized")=>X.struct([je("staker"),je("withdrawer")],t),uj=(t="lockup")=>X.struct([X.ns64("unixTimestamp"),X.ns64("epoch"),je("custodian")],t),dj=(t="voteInit")=>X.struct([je("nodePubkey"),je("authorizedVoter"),je("authorizedWithdrawer"),X.u8("commission")],t),fj=(t="voteAuthorizeWithSeedArgs")=>X.struct([X.u32("voteAuthorizationType"),je("currentAuthorityDerivedKeyOwnerPubkey"),lc("currentAuthorityDerivedKeySeed"),je("newAuthorized")],t);function OI(t,e){const n=i=>{if(i.span>=0)return i.span;if(typeof i.alloc=="function")return i.alloc(e[i.property]);if("count"in i&&"elementLayout"in i){const o=e[i.property];if(Array.isArray(o))return o.length*n(i.elementLayout)}else if("fields"in i)return OI({layout:i},e[i.property]);return 0};let r=0;return t.layout.fields.forEach(i=>{r+=n(i)}),r}function br(t){let e=0,n=0;for(;;){let r=t.shift();if(e|=(r&127)<<n*7,n+=1,(r&128)===0)break}return e}function vr(t,e){let n=e;for(;;){let r=n&127;if(n>>=7,n==0){t.push(r);break}else r|=128,t.push(r)}}function Nt(t,e){if(!t)throw new Error(e||"Assertion failed")}class Lp{constructor(e,n){this.payer=void 0,this.keyMetaMap=void 0,this.payer=e,this.keyMetaMap=n}static compile(e,n){const r=new Map,i=s=>{const a=s.toBase58();let l=r.get(a);return l===void 0&&(l={isSigner:!1,isWritable:!1,isInvoked:!1},r.set(a,l)),l},o=i(n);o.isSigner=!0,o.isWritable=!0;for(const s of e){i(s.programId).isInvoked=!0;for(const a of s.keys){const l=i(a.pubkey);l.isSigner||(l.isSigner=a.isSigner),l.isWritable||(l.isWritable=a.isWritable)}}return new Lp(n,r)}getMessageComponents(){const e=[...this.keyMetaMap.entries()];Nt(e.length<=256,"Max static account keys length exceeded");const n=e.filter(([,l])=>l.isSigner&&l.isWritable),r=e.filter(([,l])=>l.isSigner&&!l.isWritable),i=e.filter(([,l])=>!l.isSigner&&l.isWritable),o=e.filter(([,l])=>!l.isSigner&&!l.isWritable),s={numRequiredSignatures:n.length+r.length,numReadonlySignedAccounts:r.length,numReadonlyUnsignedAccounts:o.length};{Nt(n.length>0,"Expected at least one writable signer key");const[l]=n[0];Nt(l===this.payer.toBase58(),"Expected first writable signer key to be the fee payer")}const a=[...n.map(([l])=>new ke(l)),...r.map(([l])=>new ke(l)),...i.map(([l])=>new ke(l)),...o.map(([l])=>new ke(l))];return[s,a]}extractTableLookup(e){const[n,r]=this.drainKeysFoundInLookupTable(e.state.addresses,s=>!s.isSigner&&!s.isInvoked&&s.isWritable),[i,o]=this.drainKeysFoundInLookupTable(e.state.addresses,s=>!s.isSigner&&!s.isInvoked&&!s.isWritable);if(!(n.length===0&&i.length===0))return[{accountKey:e.key,writableIndexes:n,readonlyIndexes:i},{writable:r,readonly:o}]}drainKeysFoundInLookupTable(e,n){const r=new Array,i=new Array;for(const[o,s]of this.keyMetaMap.entries())if(n(s)){const a=new ke(o),l=e.findIndex(c=>c.equals(a));l>=0&&(Nt(l<256,"Max lookup table index exceeded"),r.push(l),i.push(a),this.keyMetaMap.delete(o))}return[r,i]}}const TI="Reached end of buffer unexpectedly";function Io(t){if(t.length===0)throw new Error(TI);return t.shift()}function wr(t,...e){var r;const[n]=e;if(e.length===2?n+((r=e[1])!=null?r:0)>t.length:n>=t.length)throw new Error(TI);return t.splice(...e)}class Ta{constructor(e){this.header=void 0,this.accountKeys=void 0,this.recentBlockhash=void 0,this.instructions=void 0,this.indexToProgramIds=new Map,this.header=e.header,this.accountKeys=e.accountKeys.map(n=>new ke(n)),this.recentBlockhash=e.recentBlockhash,this.instructions=e.instructions,this.instructions.forEach(n=>this.indexToProgramIds.set(n.programIdIndex,this.accountKeys[n.programIdIndex]))}get version(){return"legacy"}get staticAccountKeys(){return this.accountKeys}get compiledInstructions(){return this.instructions.map(e=>({programIdIndex:e.programIdIndex,accountKeyIndexes:e.accounts,data:Hn.decode(e.data)}))}get addressTableLookups(){return[]}getAccountKeys(){return new Mp(this.staticAccountKeys)}static compile(e){const n=Lp.compile(e.instructions,e.payerKey),[r,i]=n.getMessageComponents(),s=new Mp(i).compileInstructions(e.instructions).map(a=>({programIdIndex:a.programIdIndex,accounts:a.accountKeyIndexes,data:Hn.encode(a.data)}));return new Ta({header:r,accountKeys:i,recentBlockhash:e.recentBlockhash,instructions:s})}isAccountSigner(e){return e<this.header.numRequiredSignatures}isAccountWritable(e){const n=this.header.numRequiredSignatures;if(e>=this.header.numRequiredSignatures){const r=e-n,o=this.accountKeys.length-n-this.header.numReadonlyUnsignedAccounts;return r<o}else{const r=n-this.header.numReadonlySignedAccounts;return e<r}}isProgramId(e){return this.indexToProgramIds.has(e)}programIds(){return[...this.indexToProgramIds.values()]}nonProgramIds(){return this.accountKeys.filter((e,n)=>!this.isProgramId(n))}serialize(){const e=this.accountKeys.length;let n=[];vr(n,e);const r=this.instructions.map(d=>{const{accounts:h,programIdIndex:g}=d,b=Array.from(Hn.decode(d.data));let p=[];vr(p,h.length);let w=[];return vr(w,b.length),{programIdIndex:g,keyIndicesCount:Fe.Buffer.from(p),keyIndices:h,dataLength:Fe.Buffer.from(w),data:b}});let i=[];vr(i,r.length);let o=Fe.Buffer.alloc(ac);Fe.Buffer.from(i).copy(o);let s=i.length;r.forEach(d=>{const g=X.struct([X.u8("programIdIndex"),X.blob(d.keyIndicesCount.length,"keyIndicesCount"),X.seq(X.u8("keyIndex"),d.keyIndices.length,"keyIndices"),X.blob(d.dataLength.length,"dataLength"),X.seq(X.u8("userdatum"),d.data.length,"data")]).encode(d,o,s);s+=g}),o=o.slice(0,s);const a=X.struct([X.blob(1,"numRequiredSignatures"),X.blob(1,"numReadonlySignedAccounts"),X.blob(1,"numReadonlyUnsignedAccounts"),X.blob(n.length,"keyCount"),X.seq(je("key"),e,"keys"),je("recentBlockhash")]),l={numRequiredSignatures:Fe.Buffer.from([this.header.numRequiredSignatures]),numReadonlySignedAccounts:Fe.Buffer.from([this.header.numReadonlySignedAccounts]),numReadonlyUnsignedAccounts:Fe.Buffer.from([this.header.numReadonlyUnsignedAccounts]),keyCount:Fe.Buffer.from(n),keys:this.accountKeys.map(d=>Gn(d.toBytes())),recentBlockhash:Hn.decode(this.recentBlockhash)};let c=Fe.Buffer.alloc(2048);const u=a.encode(l,c);return o.copy(c,u),c.slice(0,u+o.length)}static from(e){let n=[...e];const r=Io(n);if(r!==(r&ob))throw new Error("Versioned messages must be deserialized with VersionedMessage.deserialize()");const i=Io(n),o=Io(n),s=br(n);let a=[];for(let h=0;h<s;h++){const g=wr(n,0,ms);a.push(new ke(Fe.Buffer.from(g)))}const l=wr(n,0,ms),c=br(n);let u=[];for(let h=0;h<c;h++){const g=Io(n),b=br(n),p=wr(n,0,b),w=br(n),S=wr(n,0,w),O=Hn.encode(Fe.Buffer.from(S));u.push({programIdIndex:g,accounts:p,data:O})}const d={header:{numRequiredSignatures:r,numReadonlySignedAccounts:i,numReadonlyUnsignedAccounts:o},recentBlockhash:Hn.encode(Fe.Buffer.from(l)),accountKeys:a,instructions:u};return new Ta(d)}}class Td{constructor(e){this.header=void 0,this.staticAccountKeys=void 0,this.recentBlockhash=void 0,this.compiledInstructions=void 0,this.addressTableLookups=void 0,this.header=e.header,this.staticAccountKeys=e.staticAccountKeys,this.recentBlockhash=e.recentBlockhash,this.compiledInstructions=e.compiledInstructions,this.addressTableLookups=e.addressTableLookups}get version(){return 0}get numAccountKeysFromLookups(){let e=0;for(const n of this.addressTableLookups)e+=n.readonlyIndexes.length+n.writableIndexes.length;return e}getAccountKeys(e){let n;if(e&&"accountKeysFromLookups"in e&&e.accountKeysFromLookups){if(this.numAccountKeysFromLookups!=e.accountKeysFromLookups.writable.length+e.accountKeysFromLookups.readonly.length)throw new Error("Failed to get account keys because of a mismatch in the number of account keys from lookups");n=e.accountKeysFromLookups}else if(e&&"addressLookupTableAccounts"in e&&e.addressLookupTableAccounts)n=this.resolveAddressTableLookups(e.addressLookupTableAccounts);else if(this.addressTableLookups.length>0)throw new Error("Failed to get account keys because address table lookups were not resolved");return new Mp(this.staticAccountKeys,n)}isAccountSigner(e){return e<this.header.numRequiredSignatures}isAccountWritable(e){const n=this.header.numRequiredSignatures,r=this.staticAccountKeys.length;if(e>=r){const i=e-r,o=this.addressTableLookups.reduce((s,a)=>s+a.writableIndexes.length,0);return i<o}else if(e>=this.header.numRequiredSignatures){const i=e-n,s=r-n-this.header.numReadonlyUnsignedAccounts;return i<s}else{const i=n-this.header.numReadonlySignedAccounts;return e<i}}resolveAddressTableLookups(e){const n={writable:[],readonly:[]};for(const r of this.addressTableLookups){const i=e.find(o=>o.key.equals(r.accountKey));if(!i)throw new Error(`Failed to find address lookup table account for table key ${r.accountKey.toBase58()}`);for(const o of r.writableIndexes)if(o<i.state.addresses.length)n.writable.push(i.state.addresses[o]);else throw new Error(`Failed to find address for index ${o} in address lookup table ${r.accountKey.toBase58()}`);for(const o of r.readonlyIndexes)if(o<i.state.addresses.length)n.readonly.push(i.state.addresses[o]);else throw new Error(`Failed to find address for index ${o} in address lookup table ${r.accountKey.toBase58()}`)}return n}static compile(e){const n=Lp.compile(e.instructions,e.payerKey),r=new Array,i={writable:new Array,readonly:new Array},o=e.addressLookupTableAccounts||[];for(const u of o){const d=n.extractTableLookup(u);if(d!==void 0){const[h,{writable:g,readonly:b}]=d;r.push(h),i.writable.push(...g),i.readonly.push(...b)}}const[s,a]=n.getMessageComponents(),c=new Mp(a,i).compileInstructions(e.instructions);return new Td({header:s,staticAccountKeys:a,recentBlockhash:e.recentBlockhash,compiledInstructions:c,addressTableLookups:r})}serialize(){const e=Array();vr(e,this.staticAccountKeys.length);const n=this.serializeInstructions(),r=Array();vr(r,this.compiledInstructions.length);const i=this.serializeAddressTableLookups(),o=Array();vr(o,this.addressTableLookups.length);const s=X.struct([X.u8("prefix"),X.struct([X.u8("numRequiredSignatures"),X.u8("numReadonlySignedAccounts"),X.u8("numReadonlyUnsignedAccounts")],"header"),X.blob(e.length,"staticAccountKeysLength"),X.seq(je(),this.staticAccountKeys.length,"staticAccountKeys"),je("recentBlockhash"),X.blob(r.length,"instructionsLength"),X.blob(n.length,"serializedInstructions"),X.blob(o.length,"addressTableLookupsLength"),X.blob(i.length,"serializedAddressTableLookups")]),a=new Uint8Array(ac),c=s.encode({prefix:128,header:this.header,staticAccountKeysLength:new Uint8Array(e),staticAccountKeys:this.staticAccountKeys.map(u=>u.toBytes()),recentBlockhash:Hn.decode(this.recentBlockhash),instructionsLength:new Uint8Array(r),serializedInstructions:n,addressTableLookupsLength:new Uint8Array(o),serializedAddressTableLookups:i},a);return a.slice(0,c)}serializeInstructions(){let e=0;const n=new Uint8Array(ac);for(const r of this.compiledInstructions){const i=Array();vr(i,r.accountKeyIndexes.length);const o=Array();vr(o,r.data.length);const s=X.struct([X.u8("programIdIndex"),X.blob(i.length,"encodedAccountKeyIndexesLength"),X.seq(X.u8(),r.accountKeyIndexes.length,"accountKeyIndexes"),X.blob(o.length,"encodedDataLength"),X.blob(r.data.length,"data")]);e+=s.encode({programIdIndex:r.programIdIndex,encodedAccountKeyIndexesLength:new Uint8Array(i),accountKeyIndexes:r.accountKeyIndexes,encodedDataLength:new Uint8Array(o),data:r.data},n,e)}return n.slice(0,e)}serializeAddressTableLookups(){let e=0;const n=new Uint8Array(ac);for(const r of this.addressTableLookups){const i=Array();vr(i,r.writableIndexes.length);const o=Array();vr(o,r.readonlyIndexes.length);const s=X.struct([je("accountKey"),X.blob(i.length,"encodedWritableIndexesLength"),X.seq(X.u8(),r.writableIndexes.length,"writableIndexes"),X.blob(o.length,"encodedReadonlyIndexesLength"),X.seq(X.u8(),r.readonlyIndexes.length,"readonlyIndexes")]);e+=s.encode({accountKey:r.accountKey.toBytes(),encodedWritableIndexesLength:new Uint8Array(i),writableIndexes:r.writableIndexes,encodedReadonlyIndexesLength:new Uint8Array(o),readonlyIndexes:r.readonlyIndexes},n,e)}return n.slice(0,e)}static deserialize(e){let n=[...e];const r=Io(n),i=r&ob;Nt(r!==i,"Expected versioned message but received legacy message");const o=i;Nt(o===0,`Expected versioned message with version 0 but found version ${o}`);const s={numRequiredSignatures:Io(n),numReadonlySignedAccounts:Io(n),numReadonlyUnsignedAccounts:Io(n)},a=[],l=br(n);for(let b=0;b<l;b++)a.push(new ke(wr(n,0,ms)));const c=Hn.encode(wr(n,0,ms)),u=br(n),d=[];for(let b=0;b<u;b++){const p=Io(n),w=br(n),S=wr(n,0,w),O=br(n),T=new Uint8Array(wr(n,0,O));d.push({programIdIndex:p,accountKeyIndexes:S,data:T})}const h=br(n),g=[];for(let b=0;b<h;b++){const p=new ke(wr(n,0,ms)),w=br(n),S=wr(n,0,w),O=br(n),T=wr(n,0,O);g.push({accountKey:p,writableIndexes:S,readonlyIndexes:T})}return new Td({header:s,staticAccountKeys:a,recentBlockhash:c,compiledInstructions:d,addressTableLookups:g})}}const PI={deserializeMessageVersion(t){const e=t[0],n=e&ob;return n===e?"legacy":n},deserialize:t=>{const e=PI.deserializeMessageVersion(t);if(e==="legacy")return Ta.from(t);if(e===0)return Td.deserialize(t);throw new Error(`Transaction message version ${e} deserialization is not supported`)}},hj=Fe.Buffer.alloc(Rp).fill(0);class Bn{constructor(e){this.keys=void 0,this.programId=void 0,this.data=Fe.Buffer.alloc(0),this.programId=e.programId,this.keys=e.keys,e.data&&(this.data=e.data)}toJSON(){return{keys:this.keys.map(({pubkey:e,isSigner:n,isWritable:r})=>({pubkey:e.toJSON(),isSigner:n,isWritable:r})),programId:this.programId.toJSON(),data:[...this.data]}}}class Fp{get signature(){return this.signatures.length>0?this.signatures[0].signature:null}constructor(e){if(this.signatures=[],this.feePayer=void 0,this.instructions=[],this.recentBlockhash=void 0,this.lastValidBlockHeight=void 0,this.nonceInfo=void 0,this.minNonceContextSlot=void 0,this._message=void 0,this._json=void 0,!!e)if(e.feePayer&&(this.feePayer=e.feePayer),e.signatures&&(this.signatures=e.signatures),Object.prototype.hasOwnProperty.call(e,"nonceInfo")){const{minContextSlot:n,nonceInfo:r}=e;this.minNonceContextSlot=n,this.nonceInfo=r}else if(Object.prototype.hasOwnProperty.call(e,"lastValidBlockHeight")){const{blockhash:n,lastValidBlockHeight:r}=e;this.recentBlockhash=n,this.lastValidBlockHeight=r}else{const{recentBlockhash:n,nonceInfo:r}=e;r&&(this.nonceInfo=r),this.recentBlockhash=n}}toJSON(){return{recentBlockhash:this.recentBlockhash||null,feePayer:this.feePayer?this.feePayer.toJSON():null,nonceInfo:this.nonceInfo?{nonce:this.nonceInfo.nonce,nonceInstruction:this.nonceInfo.nonceInstruction.toJSON()}:null,instructions:this.instructions.map(e=>e.toJSON()),signers:this.signatures.map(({publicKey:e})=>e.toJSON())}}add(...e){if(e.length===0)throw new Error("No instructions");return e.forEach(n=>{"instructions"in n?this.instructions=this.instructions.concat(n.instructions):"data"in n&&"programId"in n&&"keys"in n?this.instructions.push(n):this.instructions.push(new Bn(n))}),this}compileMessage(){if(this._message&&JSON.stringify(this.toJSON())===JSON.stringify(this._json))return this._message;let e,n;if(this.nonceInfo?(e=this.nonceInfo.nonce,this.instructions[0]!=this.nonceInfo.nonceInstruction?n=[this.nonceInfo.nonceInstruction,...this.instructions]:n=this.instructions):(e=this.recentBlockhash,n=this.instructions),!e)throw new Error("Transaction recentBlockhash required");n.length<1&&console.warn("No instructions provided");let r;if(this.feePayer)r=this.feePayer;else if(this.signatures.length>0&&this.signatures[0].publicKey)r=this.signatures[0].publicKey;else throw new Error("Transaction fee payer required");for(let p=0;p<n.length;p++)if(n[p].programId===void 0)throw new Error(`Transaction instruction index ${p} has undefined program id`);const i=[],o=[];n.forEach(p=>{p.keys.forEach(S=>{o.push({...S})});const w=p.programId.toString();i.includes(w)||i.push(w)}),i.forEach(p=>{o.push({pubkey:new ke(p),isSigner:!1,isWritable:!1})});const s=[];o.forEach(p=>{const w=p.pubkey.toString(),S=s.findIndex(O=>O.pubkey.toString()===w);S>-1?(s[S].isWritable=s[S].isWritable||p.isWritable,s[S].isSigner=s[S].isSigner||p.isSigner):s.push(p)}),s.sort(function(p,w){if(p.isSigner!==w.isSigner)return p.isSigner?-1:1;if(p.isWritable!==w.isWritable)return p.isWritable?-1:1;const S={localeMatcher:"best fit",usage:"sort",sensitivity:"variant",ignorePunctuation:!1,numeric:!1,caseFirst:"lower"};return p.pubkey.toBase58().localeCompare(w.pubkey.toBase58(),"en",S)});const a=s.findIndex(p=>p.pubkey.equals(r));if(a>-1){const[p]=s.splice(a,1);p.isSigner=!0,p.isWritable=!0,s.unshift(p)}else s.unshift({pubkey:r,isSigner:!0,isWritable:!0});for(const p of this.signatures){const w=s.findIndex(S=>S.pubkey.equals(p.publicKey));if(w>-1)s[w].isSigner||(s[w].isSigner=!0,console.warn("Transaction references a signature that is unnecessary, only the fee payer and instruction signer accounts should sign a transaction. This behavior is deprecated and will throw an error in the next major version release."));else throw new Error(`unknown signer: ${p.publicKey.toString()}`)}let l=0,c=0,u=0;const d=[],h=[];s.forEach(({pubkey:p,isSigner:w,isWritable:S})=>{w?(d.push(p.toString()),l+=1,S||(c+=1)):(h.push(p.toString()),S||(u+=1))});const g=d.concat(h),b=n.map(p=>{const{data:w,programId:S}=p;return{programIdIndex:g.indexOf(S.toString()),accounts:p.keys.map(O=>g.indexOf(O.pubkey.toString())),data:Hn.encode(w)}});return b.forEach(p=>{Nt(p.programIdIndex>=0),p.accounts.forEach(w=>Nt(w>=0))}),new Ta({header:{numRequiredSignatures:l,numReadonlySignedAccounts:c,numReadonlyUnsignedAccounts:u},accountKeys:g,recentBlockhash:e,instructions:b})}_compile(){const e=this.compileMessage(),n=e.accountKeys.slice(0,e.header.numRequiredSignatures);return this.signatures.length===n.length&&this.signatures.every((i,o)=>n[o].equals(i.publicKey))||(this.signatures=n.map(r=>({signature:null,publicKey:r}))),e}serializeMessage(){return this._compile().serialize()}async getEstimatedFee(e){return(await e.getFeeForMessage(this.compileMessage())).value}setSigners(...e){if(e.length===0)throw new Error("No signers");const n=new Set;this.signatures=e.filter(r=>{const i=r.toString();return n.has(i)?!1:(n.add(i),!0)}).map(r=>({signature:null,publicKey:r}))}sign(...e){if(e.length===0)throw new Error("No signers");const n=new Set,r=[];for(const o of e){const s=o.publicKey.toString();n.has(s)||(n.add(s),r.push(o))}this.signatures=r.map(o=>({signature:null,publicKey:o.publicKey}));const i=this._compile();this._partialSign(i,...r)}partialSign(...e){if(e.length===0)throw new Error("No signers");const n=new Set,r=[];for(const o of e){const s=o.publicKey.toString();n.has(s)||(n.add(s),r.push(o))}const i=this._compile();this._partialSign(i,...r)}_partialSign(e,...n){const r=e.serialize();n.forEach(i=>{const o=kI(r,i.secretKey);this._addSignature(i.publicKey,Gn(o))})}addSignature(e,n){this._compile(),this._addSignature(e,n)}_addSignature(e,n){Nt(n.length===64);const r=this.signatures.findIndex(i=>e.equals(i.publicKey));if(r<0)throw new Error(`unknown signer: ${e.toString()}`);this.signatures[r].signature=Fe.Buffer.from(n)}verifySignatures(e=!0){return!this._getMessageSignednessErrors(this.serializeMessage(),e)}_getMessageSignednessErrors(e,n){const r={};for(const{signature:i,publicKey:o}of this.signatures)i===null?n&&(r.missing||(r.missing=[])).push(o):ij(i,e,o.toBytes())||(r.invalid||(r.invalid=[])).push(o);return r.invalid||r.missing?r:void 0}serialize(e){const{requireAllSignatures:n,verifySignatures:r}=Object.assign({requireAllSignatures:!0,verifySignatures:!0},e),i=this.serializeMessage();if(r){const o=this._getMessageSignednessErrors(i,n);if(o){let s="Signature verification failed.";throw o.invalid&&(s+=`
201
+ Invalid signature for public key${o.invalid.length===1?"":"(s)"} [\`${o.invalid.map(a=>a.toBase58()).join("`, `")}\`].`),o.missing&&(s+=`
202
+ Missing signature for public key${o.missing.length===1?"":"(s)"} [\`${o.missing.map(a=>a.toBase58()).join("`, `")}\`].`),new Error(s)}}return this._serialize(i)}_serialize(e){const{signatures:n}=this,r=[];vr(r,n.length);const i=r.length+n.length*64+e.length,o=Fe.Buffer.alloc(i);return Nt(n.length<256),Fe.Buffer.from(r).copy(o,0),n.forEach(({signature:s},a)=>{s!==null&&(Nt(s.length===64,"signature has invalid length"),Fe.Buffer.from(s).copy(o,r.length+a*64))}),e.copy(o,r.length+n.length*64),Nt(o.length<=ac,`Transaction too large: ${o.length} > ${ac}`),o}get keys(){return Nt(this.instructions.length===1),this.instructions[0].keys.map(e=>e.pubkey)}get programId(){return Nt(this.instructions.length===1),this.instructions[0].programId}get data(){return Nt(this.instructions.length===1),this.instructions[0].data}static from(e){let n=[...e];const r=br(n);let i=[];for(let o=0;o<r;o++){const s=wr(n,0,Rp);i.push(Hn.encode(Fe.Buffer.from(s)))}return Fp.populate(Ta.from(n),i)}static populate(e,n=[]){const r=new Fp;return r.recentBlockhash=e.recentBlockhash,e.header.numRequiredSignatures>0&&(r.feePayer=e.accountKeys[0]),n.forEach((i,o)=>{const s={signature:i==Hn.encode(hj)?null:Hn.decode(i),publicKey:e.accountKeys[o]};r.signatures.push(s)}),e.instructions.forEach(i=>{const o=i.accounts.map(s=>{const a=e.accountKeys[s];return{pubkey:a,isSigner:r.signatures.some(l=>l.publicKey.toString()===a.toString())||e.isAccountSigner(s),isWritable:e.isAccountWritable(s)}});r.instructions.push(new Bn({keys:o,programId:e.accountKeys[i.programIdIndex],data:Hn.decode(i.data)}))}),r._message=e,r._json=r.toJSON(),r}}class _p{constructor(e){this.payerKey=void 0,this.instructions=void 0,this.recentBlockhash=void 0,this.payerKey=e.payerKey,this.instructions=e.instructions,this.recentBlockhash=e.recentBlockhash}static decompile(e,n){const{header:r,compiledInstructions:i,recentBlockhash:o}=e,{numRequiredSignatures:s,numReadonlySignedAccounts:a,numReadonlyUnsignedAccounts:l}=r,c=s-a;Nt(c>0,"Message header is invalid");const u=e.staticAccountKeys.length-s-l;Nt(u>=0,"Message header is invalid");const d=e.getAccountKeys(n),h=d.get(0);if(h===void 0)throw new Error("Failed to decompile message because no account keys were found");const g=[];for(const b of i){const p=[];for(const S of b.accountKeyIndexes){const O=d.get(S);if(O===void 0)throw new Error(`Failed to find key for account key index ${S}`);const T=S<s;let $;T?$=S<c:S<d.staticAccountKeys.length?$=S-s<u:$=S-d.staticAccountKeys.length<d.accountKeysFromLookups.writable.length,p.push({pubkey:O,isSigner:S<r.numRequiredSignatures,isWritable:$})}const w=d.get(b.programIdIndex);if(w===void 0)throw new Error(`Failed to find program id for program id index ${b.programIdIndex}`);g.push(new Bn({programId:w,data:Gn(b.data),keys:p}))}return new _p({payerKey:h,instructions:g,recentBlockhash:o})}compileToLegacyMessage(){return Ta.compile({payerKey:this.payerKey,recentBlockhash:this.recentBlockhash,instructions:this.instructions})}compileToV0Message(e){return Td.compile({payerKey:this.payerKey,recentBlockhash:this.recentBlockhash,instructions:this.instructions,addressLookupTableAccounts:e})}}class Vp{get version(){return this.message.version}constructor(e,n){if(this.signatures=void 0,this.message=void 0,n!==void 0)Nt(n.length===e.header.numRequiredSignatures,"Expected signatures length to be equal to the number of required signatures"),this.signatures=n;else{const r=[];for(let i=0;i<e.header.numRequiredSignatures;i++)r.push(new Uint8Array(Rp));this.signatures=r}this.message=e}serialize(){const e=this.message.serialize(),n=Array();vr(n,this.signatures.length);const r=X.struct([X.blob(n.length,"encodedSignaturesLength"),X.seq(lj(),this.signatures.length,"signatures"),X.blob(e.length,"serializedMessage")]),i=new Uint8Array(2048),o=r.encode({encodedSignaturesLength:new Uint8Array(n),signatures:this.signatures,serializedMessage:e},i);return i.slice(0,o)}static deserialize(e){let n=[...e];const r=[],i=br(n);for(let s=0;s<i;s++)r.push(new Uint8Array(wr(n,0,Rp)));const o=PI.deserialize(new Uint8Array(n));return new Vp(o,r)}sign(e){const n=this.message.serialize(),r=this.message.staticAccountKeys.slice(0,this.message.header.numRequiredSignatures);for(const i of e){const o=r.findIndex(s=>s.equals(i.publicKey));Nt(o>=0,`Cannot sign with non signer key ${i.publicKey.toBase58()}`),this.signatures[o]=kI(n,i.secretKey)}}addSignature(e,n){Nt(n.byteLength===64,"Signature must be 64 bytes long");const i=this.message.staticAccountKeys.slice(0,this.message.header.numRequiredSignatures).findIndex(o=>o.equals(e));Nt(i>=0,`Can not add signature; \`${e.toBase58()}\` is not required to sign this transaction`),this.signatures[i]=n}}new ke("SysvarC1ock11111111111111111111111111111111"),new ke("SysvarEpochSchedu1e111111111111111111111111"),new ke("Sysvar1nstructions1111111111111111111111111");const sb=new ke("SysvarRecentB1ockHashes11111111111111111111"),NI=new ke("SysvarRent111111111111111111111111111111111");new ke("SysvarRewards111111111111111111111111111111"),new ke("SysvarS1otHashes111111111111111111111111111"),new ke("SysvarS1otHistory11111111111111111111111111"),new ke("SysvarStakeHistory1111111111111111111111111");function Fr(t,e){const n=t.layout.span>=0?t.layout.span:OI(t,e),r=Fe.Buffer.alloc(n),i=Object.assign({instruction:t.index},e);return t.layout.encode(i,r),r}const pj=X.nu64("lamportsPerSignature"),BI=X.struct([X.u32("version"),X.u32("state"),je("authorizedPubkey"),je("nonce"),X.struct([pj],"feeCalculator")]).span;function gj(t,e){const n=Fe.Buffer.alloc(e);let r=t;for(let i=0;i<e;i++)n[i]=Number(r&BigInt(255)),r>>=BigInt(8);return n}function mj(t){return t.reduceRight((e,n)=>(e<<BigInt(8))+BigInt(n),BigInt(0))}const yj=t=>{const e=t.decode.bind(t),n=t.encode.bind(t);return{decode:e,encode:n}},cc=(t=>e=>{const n=X.blob(t,e),{encode:r,decode:i}=yj(n),o=n;return o.decode=(s,a)=>{const l=i(s,a);return mj(Fe.Buffer.from(l))},o.encode=(s,a,l)=>{const c=gj(s,t);return r(c,a,l)},o})(8),_r=Object.freeze({Create:{index:0,layout:X.struct([X.u32("instruction"),X.ns64("lamports"),X.ns64("space"),je("programId")])},Assign:{index:1,layout:X.struct([X.u32("instruction"),je("programId")])},Transfer:{index:2,layout:X.struct([X.u32("instruction"),cc("lamports")])},CreateWithSeed:{index:3,layout:X.struct([X.u32("instruction"),je("base"),lc("seed"),X.ns64("lamports"),X.ns64("space"),je("programId")])},AdvanceNonceAccount:{index:4,layout:X.struct([X.u32("instruction")])},WithdrawNonceAccount:{index:5,layout:X.struct([X.u32("instruction"),X.ns64("lamports")])},InitializeNonceAccount:{index:6,layout:X.struct([X.u32("instruction"),je("authorized")])},AuthorizeNonceAccount:{index:7,layout:X.struct([X.u32("instruction"),je("authorized")])},Allocate:{index:8,layout:X.struct([X.u32("instruction"),X.ns64("space")])},AllocateWithSeed:{index:9,layout:X.struct([X.u32("instruction"),je("base"),lc("seed"),X.ns64("space"),je("programId")])},AssignWithSeed:{index:10,layout:X.struct([X.u32("instruction"),je("base"),lc("seed"),je("programId")])},TransferWithSeed:{index:11,layout:X.struct([X.u32("instruction"),cc("lamports"),lc("seed"),je("programId")])},UpgradeNonceAccount:{index:12,layout:X.struct([X.u32("instruction")])}});class uc{constructor(){}static createAccount(e){const n=_r.Create,r=Fr(n,{lamports:e.lamports,space:e.space,programId:Gn(e.programId.toBuffer())});return new Bn({keys:[{pubkey:e.fromPubkey,isSigner:!0,isWritable:!0},{pubkey:e.newAccountPubkey,isSigner:!0,isWritable:!0}],programId:this.programId,data:r})}static transfer(e){let n,r;if("basePubkey"in e){const i=_r.TransferWithSeed;n=Fr(i,{lamports:BigInt(e.lamports),seed:e.seed,programId:Gn(e.programId.toBuffer())}),r=[{pubkey:e.fromPubkey,isSigner:!1,isWritable:!0},{pubkey:e.basePubkey,isSigner:!0,isWritable:!1},{pubkey:e.toPubkey,isSigner:!1,isWritable:!0}]}else{const i=_r.Transfer;n=Fr(i,{lamports:BigInt(e.lamports)}),r=[{pubkey:e.fromPubkey,isSigner:!0,isWritable:!0},{pubkey:e.toPubkey,isSigner:!1,isWritable:!0}]}return new Bn({keys:r,programId:this.programId,data:n})}static assign(e){let n,r;if("basePubkey"in e){const i=_r.AssignWithSeed;n=Fr(i,{base:Gn(e.basePubkey.toBuffer()),seed:e.seed,programId:Gn(e.programId.toBuffer())}),r=[{pubkey:e.accountPubkey,isSigner:!1,isWritable:!0},{pubkey:e.basePubkey,isSigner:!0,isWritable:!1}]}else{const i=_r.Assign;n=Fr(i,{programId:Gn(e.programId.toBuffer())}),r=[{pubkey:e.accountPubkey,isSigner:!0,isWritable:!0}]}return new Bn({keys:r,programId:this.programId,data:n})}static createAccountWithSeed(e){const n=_r.CreateWithSeed,r=Fr(n,{base:Gn(e.basePubkey.toBuffer()),seed:e.seed,lamports:e.lamports,space:e.space,programId:Gn(e.programId.toBuffer())});let i=[{pubkey:e.fromPubkey,isSigner:!0,isWritable:!0},{pubkey:e.newAccountPubkey,isSigner:!1,isWritable:!0}];return e.basePubkey.equals(e.fromPubkey)||i.push({pubkey:e.basePubkey,isSigner:!0,isWritable:!1}),new Bn({keys:i,programId:this.programId,data:r})}static createNonceAccount(e){const n=new Fp;"basePubkey"in e&&"seed"in e?n.add(uc.createAccountWithSeed({fromPubkey:e.fromPubkey,newAccountPubkey:e.noncePubkey,basePubkey:e.basePubkey,seed:e.seed,lamports:e.lamports,space:BI,programId:this.programId})):n.add(uc.createAccount({fromPubkey:e.fromPubkey,newAccountPubkey:e.noncePubkey,lamports:e.lamports,space:BI,programId:this.programId}));const r={noncePubkey:e.noncePubkey,authorizedPubkey:e.authorizedPubkey};return n.add(this.nonceInitialize(r)),n}static nonceInitialize(e){const n=_r.InitializeNonceAccount,r=Fr(n,{authorized:Gn(e.authorizedPubkey.toBuffer())}),i={keys:[{pubkey:e.noncePubkey,isSigner:!1,isWritable:!0},{pubkey:sb,isSigner:!1,isWritable:!1},{pubkey:NI,isSigner:!1,isWritable:!1}],programId:this.programId,data:r};return new Bn(i)}static nonceAdvance(e){const n=_r.AdvanceNonceAccount,r=Fr(n),i={keys:[{pubkey:e.noncePubkey,isSigner:!1,isWritable:!0},{pubkey:sb,isSigner:!1,isWritable:!1},{pubkey:e.authorizedPubkey,isSigner:!0,isWritable:!1}],programId:this.programId,data:r};return new Bn(i)}static nonceWithdraw(e){const n=_r.WithdrawNonceAccount,r=Fr(n,{lamports:e.lamports});return new Bn({keys:[{pubkey:e.noncePubkey,isSigner:!1,isWritable:!0},{pubkey:e.toPubkey,isSigner:!1,isWritable:!0},{pubkey:sb,isSigner:!1,isWritable:!1},{pubkey:NI,isSigner:!1,isWritable:!1},{pubkey:e.authorizedPubkey,isSigner:!0,isWritable:!1}],programId:this.programId,data:r})}static nonceAuthorize(e){const n=_r.AuthorizeNonceAccount,r=Fr(n,{authorized:Gn(e.newAuthorizedPubkey.toBuffer())});return new Bn({keys:[{pubkey:e.noncePubkey,isSigner:!1,isWritable:!0},{pubkey:e.authorizedPubkey,isSigner:!0,isWritable:!1}],programId:this.programId,data:r})}static allocate(e){let n,r;if("basePubkey"in e){const i=_r.AllocateWithSeed;n=Fr(i,{base:Gn(e.basePubkey.toBuffer()),seed:e.seed,space:e.space,programId:Gn(e.programId.toBuffer())}),r=[{pubkey:e.accountPubkey,isSigner:!1,isWritable:!0},{pubkey:e.basePubkey,isSigner:!0,isWritable:!1}]}else{const i=_r.Allocate;n=Fr(i,{space:e.space}),r=[{pubkey:e.accountPubkey,isSigner:!0,isWritable:!0}]}return new Bn({keys:r,programId:this.programId,data:n})}}uc.programId=new ke("11111111111111111111111111111111"),new ke("BPFLoader2111111111111111111111111111111111"),X.struct([X.u32("typeIndex"),cc("deactivationSlot"),X.nu64("lastExtendedSlot"),X.u8("lastExtendedStartIndex"),X.u8(),X.seq(je(),X.offset(X.u8(),-1),"authority")]);const kt=Od(Gy(ke),ge(),t=>new ke(t)),RI=jy([ge(),wt("base64")]),ab=Od(Gy(Fe.Buffer),RI,t=>Fe.Buffer.from(t[0],"base64"));function MI(t){return Wn([he({jsonrpc:wt("2.0"),id:ge(),result:t}),he({jsonrpc:wt("2.0"),id:ge(),error:he({code:ic(),message:ge(),data:Ce(xG())})})])}const bj=MI(ic());function gt(t){return Od(MI(t),bj,e=>"error"in e?e:{...e,result:Cd(e.result,t)})}function si(t){return gt(he({context:he({slot:le()}),value:t}))}function Dp(t){return he({context:he({slot:le()}),value:t})}const vj=he({foundation:le(),foundationTerm:le(),initial:le(),taper:le(),terminal:le()});gt(we(xe(he({epoch:le(),effectiveSlot:le(),amount:le(),postBalance:le(),commission:Ce(xe(le()))}))));const wj=we(he({slot:le(),prioritizationFee:le()})),xj=he({total:le(),validator:le(),foundation:le(),epoch:le()}),Ej=he({epoch:le(),slotIndex:le(),slotsInEpoch:le(),absoluteSlot:le(),blockHeight:Ce(le()),transactionCount:Ce(le())}),Sj=he({slotsPerEpoch:le(),leaderScheduleSlotOffset:le(),warmup:Mi(),firstNormalEpoch:le(),firstNormalSlot:le()}),Aj=cI(ge(),we(le())),Pa=xe(Wn([he({}),ge()])),kj=he({err:Pa}),Cj=wt("receivedSignature");he({"solana-core":ge(),"feature-set":Ce(le())});const Ij=he({program:ge(),programId:kt,parsed:ic()}),Oj=he({programId:kt,accounts:we(kt),data:ge()});si(he({err:xe(Wn([he({}),ge()])),logs:xe(we(ge())),accounts:Ce(xe(we(xe(he({executable:Mi(),owner:ge(),lamports:le(),data:we(ge()),rentEpoch:Ce(le())}))))),unitsConsumed:Ce(le()),returnData:Ce(xe(he({programId:ge(),data:jy([ge(),wt("base64")])}))),innerInstructions:Ce(xe(we(he({index:le(),instructions:we(Wn([Ij,Oj]))}))))})),si(he({byIdentity:cI(ge(),we(le())),range:he({firstSlot:le(),lastSlot:le()})})),gt(vj),gt(xj),gt(wj),gt(Ej),gt(Sj),gt(Aj),gt(le()),si(he({total:le(),circulating:le(),nonCirculating:le(),nonCirculatingAccounts:we(kt)}));const Tj=he({amount:ge(),uiAmount:xe(le()),decimals:le(),uiAmountString:Ce(ge())});si(we(he({address:kt,amount:ge(),uiAmount:xe(le()),decimals:le(),uiAmountString:Ce(ge())}))),si(we(he({pubkey:kt,account:he({executable:Mi(),owner:kt,lamports:le(),data:ab,rentEpoch:le()})})));const lb=he({program:ge(),parsed:ic(),space:le()});si(we(he({pubkey:kt,account:he({executable:Mi(),owner:kt,lamports:le(),data:lb,rentEpoch:le()})}))),si(we(he({lamports:le(),address:kt})));const cb=he({executable:Mi(),owner:kt,lamports:le(),data:ab,rentEpoch:le()});he({pubkey:kt,account:cb});const Pj=Od(Wn([Gy(Fe.Buffer),lb]),Wn([RI,lb]),t=>Array.isArray(t)?Cd(t,ab):t),Nj=he({executable:Mi(),owner:kt,lamports:le(),data:Pj,rentEpoch:le()});he({pubkey:kt,account:Nj}),he({state:Wn([wt("active"),wt("inactive"),wt("activating"),wt("deactivating")]),active:le(),inactive:le()}),gt(we(he({signature:ge(),slot:le(),err:Pa,memo:xe(ge()),blockTime:Ce(xe(le()))}))),gt(we(he({signature:ge(),slot:le(),err:Pa,memo:xe(ge()),blockTime:Ce(xe(le()))}))),he({subscription:le(),result:Dp(cb)});const Bj=he({pubkey:kt,account:cb});he({subscription:le(),result:Dp(Bj)});const Rj=he({parent:le(),slot:le(),root:le()});he({subscription:le(),result:Rj});const Mj=Wn([he({type:Wn([wt("firstShredReceived"),wt("completed"),wt("optimisticConfirmation"),wt("root")]),slot:le(),timestamp:le()}),he({type:wt("createdBank"),parent:le(),slot:le(),timestamp:le()}),he({type:wt("frozen"),slot:le(),timestamp:le(),stats:he({numTransactionEntries:le(),numSuccessfulTransactions:le(),numFailedTransactions:le(),maxTransactionsPerEntry:le()})}),he({type:wt("dead"),slot:le(),timestamp:le(),err:ge()})]);he({subscription:le(),result:Mj}),he({subscription:le(),result:Dp(Wn([kj,Cj]))}),he({subscription:le(),result:le()}),he({pubkey:ge(),gossip:xe(ge()),tpu:xe(ge()),rpc:xe(ge()),version:xe(ge())});const LI=he({votePubkey:ge(),nodePubkey:ge(),activatedStake:le(),epochVoteAccount:Mi(),epochCredits:we(jy([le(),le(),le()])),commission:le(),lastVote:le(),rootSlot:xe(le())});gt(he({current:we(LI),delinquent:we(LI)}));const Lj=Wn([wt("processed"),wt("confirmed"),wt("finalized")]),Fj=he({slot:le(),confirmations:xe(le()),err:Pa,confirmationStatus:Ce(Lj)});si(we(xe(Fj))),gt(le());const FI=he({accountKey:kt,writableIndexes:we(le()),readonlyIndexes:we(le())}),ub=he({signatures:we(ge()),message:he({accountKeys:we(ge()),header:he({numRequiredSignatures:le(),numReadonlySignedAccounts:le(),numReadonlyUnsignedAccounts:le()}),instructions:we(he({accounts:we(le()),data:ge(),programIdIndex:le()})),recentBlockhash:ge(),addressTableLookups:Ce(we(FI))})}),_I=he({pubkey:kt,signer:Mi(),writable:Mi(),source:Ce(Wn([wt("transaction"),wt("lookupTable")]))}),VI=he({accountKeys:we(_I),signatures:we(ge())}),DI=he({parsed:ic(),program:ge(),programId:kt}),zI=he({accounts:we(kt),data:ge(),programId:kt}),_j=Wn([zI,DI]),Vj=Wn([he({parsed:ic(),program:ge(),programId:ge()}),he({accounts:we(ge()),data:ge(),programId:ge()})]),UI=Od(_j,Vj,t=>"accounts"in t?Cd(t,zI):Cd(t,DI)),$I=he({signatures:we(ge()),message:he({accountKeys:we(_I),instructions:we(UI),recentBlockhash:ge(),addressTableLookups:Ce(xe(we(FI)))})}),zp=he({accountIndex:le(),mint:ge(),owner:Ce(ge()),programId:Ce(ge()),uiTokenAmount:Tj}),HI=he({writable:we(kt),readonly:we(kt)}),Up=he({err:Pa,fee:le(),innerInstructions:Ce(xe(we(he({index:le(),instructions:we(he({accounts:we(le()),data:ge(),programIdIndex:le()}))})))),preBalances:we(le()),postBalances:we(le()),logMessages:Ce(xe(we(ge()))),preTokenBalances:Ce(xe(we(zp))),postTokenBalances:Ce(xe(we(zp))),loadedAddresses:Ce(HI),computeUnitsConsumed:Ce(le())}),db=he({err:Pa,fee:le(),innerInstructions:Ce(xe(we(he({index:le(),instructions:we(UI)})))),preBalances:we(le()),postBalances:we(le()),logMessages:Ce(xe(we(ge()))),preTokenBalances:Ce(xe(we(zp))),postTokenBalances:Ce(xe(we(zp))),loadedAddresses:Ce(HI),computeUnitsConsumed:Ce(le())}),dc=Wn([wt(0),wt("legacy")]),Na=he({pubkey:ge(),lamports:le(),postBalance:xe(le()),rewardType:xe(ge()),commission:Ce(xe(le()))});gt(xe(he({blockhash:ge(),previousBlockhash:ge(),parentSlot:le(),transactions:we(he({transaction:ub,meta:xe(Up),version:Ce(dc)})),rewards:Ce(we(Na)),blockTime:xe(le()),blockHeight:xe(le())}))),gt(xe(he({blockhash:ge(),previousBlockhash:ge(),parentSlot:le(),rewards:Ce(we(Na)),blockTime:xe(le()),blockHeight:xe(le())}))),gt(xe(he({blockhash:ge(),previousBlockhash:ge(),parentSlot:le(),transactions:we(he({transaction:VI,meta:xe(Up),version:Ce(dc)})),rewards:Ce(we(Na)),blockTime:xe(le()),blockHeight:xe(le())}))),gt(xe(he({blockhash:ge(),previousBlockhash:ge(),parentSlot:le(),transactions:we(he({transaction:$I,meta:xe(db),version:Ce(dc)})),rewards:Ce(we(Na)),blockTime:xe(le()),blockHeight:xe(le())}))),gt(xe(he({blockhash:ge(),previousBlockhash:ge(),parentSlot:le(),transactions:we(he({transaction:VI,meta:xe(db),version:Ce(dc)})),rewards:Ce(we(Na)),blockTime:xe(le()),blockHeight:xe(le())}))),gt(xe(he({blockhash:ge(),previousBlockhash:ge(),parentSlot:le(),rewards:Ce(we(Na)),blockTime:xe(le()),blockHeight:xe(le())}))),gt(xe(he({blockhash:ge(),previousBlockhash:ge(),parentSlot:le(),transactions:we(he({transaction:ub,meta:xe(Up)})),rewards:Ce(we(Na)),blockTime:xe(le())}))),gt(xe(he({blockhash:ge(),previousBlockhash:ge(),parentSlot:le(),signatures:we(ge()),blockTime:xe(le())}))),gt(xe(he({slot:le(),meta:xe(Up),blockTime:Ce(xe(le())),transaction:ub,version:Ce(dc)}))),gt(xe(he({slot:le(),transaction:$I,meta:xe(db),blockTime:Ce(xe(le())),version:Ce(dc)}))),si(he({blockhash:ge(),lastValidBlockHeight:le()})),si(Mi());const Dj=he({slot:le(),numTransactions:le(),numSlots:le(),samplePeriodSecs:le()});gt(we(Dj)),si(xe(he({feeCalculator:he({lamportsPerSignature:le()})}))),gt(ge()),gt(ge());const zj=he({err:Pa,logs:we(ge()),signature:ge()});he({result:Dp(zj),subscription:le()}),Object.freeze({CreateLookupTable:{index:0,layout:X.struct([X.u32("instruction"),cc("recentSlot"),X.u8("bumpSeed")])},FreezeLookupTable:{index:1,layout:X.struct([X.u32("instruction")])},ExtendLookupTable:{index:2,layout:X.struct([X.u32("instruction"),cc(),X.seq(je(),X.offset(X.u32(),-8),"addresses")])},DeactivateLookupTable:{index:3,layout:X.struct([X.u32("instruction")])},CloseLookupTable:{index:4,layout:X.struct([X.u32("instruction")])}}),new ke("AddressLookupTab1e1111111111111111111111111"),Object.freeze({RequestUnits:{index:0,layout:X.struct([X.u8("instruction"),X.u32("units"),X.u32("additionalFee")])},RequestHeapFrame:{index:1,layout:X.struct([X.u8("instruction"),X.u32("bytes")])},SetComputeUnitLimit:{index:2,layout:X.struct([X.u8("instruction"),X.u32("units")])},SetComputeUnitPrice:{index:3,layout:X.struct([X.u8("instruction"),cc("microLamports")])}}),new ke("ComputeBudget111111111111111111111111111111"),X.struct([X.u8("numSignatures"),X.u8("padding"),X.u16("signatureOffset"),X.u16("signatureInstructionIndex"),X.u16("publicKeyOffset"),X.u16("publicKeyInstructionIndex"),X.u16("messageDataOffset"),X.u16("messageDataSize"),X.u16("messageInstructionIndex")]),new ke("Ed25519SigVerify111111111111111111111111111"),rj.utils.isValidPrivateKey,X.struct([X.u8("numSignatures"),X.u16("signatureOffset"),X.u8("signatureInstructionIndex"),X.u16("ethAddressOffset"),X.u8("ethAddressInstructionIndex"),X.u16("messageDataOffset"),X.u16("messageDataSize"),X.u8("messageInstructionIndex"),X.blob(20,"ethAddress"),X.blob(64,"signature"),X.u8("recoveryId")]),new ke("KeccakSecp256k11111111111111111111111111111");var WI;new ke("StakeConfig11111111111111111111111111111111");class GI{constructor(e,n,r){this.unixTimestamp=void 0,this.epoch=void 0,this.custodian=void 0,this.unixTimestamp=e,this.epoch=n,this.custodian=r}}WI=GI,GI.default=new WI(0,0,ke.default),Object.freeze({Initialize:{index:0,layout:X.struct([X.u32("instruction"),cj(),uj()])},Authorize:{index:1,layout:X.struct([X.u32("instruction"),je("newAuthorized"),X.u32("stakeAuthorizationType")])},Delegate:{index:2,layout:X.struct([X.u32("instruction")])},Split:{index:3,layout:X.struct([X.u32("instruction"),X.ns64("lamports")])},Withdraw:{index:4,layout:X.struct([X.u32("instruction"),X.ns64("lamports")])},Deactivate:{index:5,layout:X.struct([X.u32("instruction")])},Merge:{index:7,layout:X.struct([X.u32("instruction")])},AuthorizeWithSeed:{index:8,layout:X.struct([X.u32("instruction"),je("newAuthorized"),X.u32("stakeAuthorizationType"),lc("authoritySeed"),je("authorityOwner")])}}),new ke("Stake11111111111111111111111111111111111111"),Object.freeze({InitializeAccount:{index:0,layout:X.struct([X.u32("instruction"),dj()])},Authorize:{index:1,layout:X.struct([X.u32("instruction"),je("newAuthorized"),X.u32("voteAuthorizationType")])},Withdraw:{index:3,layout:X.struct([X.u32("instruction"),X.ns64("lamports")])},UpdateValidatorIdentity:{index:4,layout:X.struct([X.u32("instruction")])},AuthorizeWithSeed:{index:10,layout:X.struct([X.u32("instruction"),fj()])}}),new ke("Vote111111111111111111111111111111111111111"),new ke("Va1idator1nfo111111111111111111111111111111"),he({name:ge(),website:Ce(ge()),details:Ce(ge()),iconUrl:Ce(ge()),keybaseUsername:Ce(ge())}),new ke("Vote111111111111111111111111111111111111111"),X.struct([je("nodePubkey"),je("authorizedWithdrawer"),X.u8("commission"),X.nu64(),X.seq(X.struct([X.nu64("slot"),X.u32("confirmationCount")]),X.offset(X.u32(),-8),"votes"),X.u8("rootSlotValid"),X.nu64("rootSlot"),X.nu64(),X.seq(X.struct([X.nu64("epoch"),je("authorizedVoter")]),X.offset(X.u32(),-8),"authorizedVoters"),X.struct([X.seq(X.struct([je("authorizedPubkey"),X.nu64("epochOfLastAuthorizedSwitch"),X.nu64("targetEpoch")]),32,"buf"),X.nu64("idx"),X.u8("isEmpty")],"priorVoters"),X.nu64(),X.seq(X.struct([X.nu64("epoch"),X.nu64("credits"),X.nu64("prevCredits")]),X.offset(X.u32(),-8),"epochCredits"),X.struct([X.nu64("slot"),X.nu64("timestamp")],"lastTimestamp")]);var ys=function(t,e,n,r){function i(o){return o instanceof n?o:new n(function(s){s(o)})}return new(n||(n=Promise))(function(o,s){function a(u){try{c(r.next(u))}catch(d){s(d)}}function l(u){try{c(r.throw(u))}catch(d){s(d)}}function c(u){u.done?o(u.value):i(u.value).then(a,l)}c((r=r.apply(t,e||[])).next())})},bs=function(t,e){var n={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},r,i,o,s=Object.create((typeof Iterator=="function"?Iterator:Object).prototype);return s.next=a(0),s.throw=a(1),s.return=a(2),typeof Symbol=="function"&&(s[Symbol.iterator]=function(){return this}),s;function a(c){return function(u){return l([c,u])}}function l(c){if(r)throw new TypeError("Generator is already executing.");for(;s&&(s=0,c[0]&&(n=0)),n;)try{if(r=1,i&&(o=c[0]&2?i.return:c[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,c[1])).done)return o;switch(i=0,o&&(c=[c[0]&2,o.value]),c[0]){case 0:case 1:o=c;break;case 4:return n.label++,{value:c[1],done:!1};case 5:n.label++,i=c[1],c=[0];continue;case 7:c=n.ops.pop(),n.trys.pop();continue;default:if(o=n.trys,!(o=o.length>0&&o[o.length-1])&&(c[0]===6||c[0]===2)){n=0;continue}if(c[0]===3&&(!o||c[1]>o[0]&&c[1]<o[3])){n.label=c[1];break}if(c[0]===6&&n.label<o[1]){n.label=o[1],o=c;break}if(o&&n.label<o[2]){n.label=o[2],n.ops.push(c);break}o[2]&&n.ops.pop(),n.trys.pop();continue}c=e.call(t,n)}catch(u){c=[6,u],i=0}finally{r=o=0}if(c[0]&5)throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}},$p=new ke("TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA"),jI=new ke("TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb"),KI=new ke("ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL"),Hp=function(t){if(!t||typeof t!="object")return!1;var e=t,n=(e.message||"").toLowerCase();return n.includes("user rejected")||n.includes("declined")||n.includes("cancelled")||n.includes("denied")||e.code===4001};function qI(t,e){return ys(this,arguments,void 0,function(n,r,i){var o;return i===void 0&&(i=$p.toBase58()),bs(this,function(s){switch(s.label){case 0:return[4,ke.findProgramAddress([r.toBuffer(),new ke(i).toBuffer(),n.toBuffer()],KI)];case 1:return o=s.sent()[0],[2,o]}})})}function Uj(t,e,n,r,i){i===void 0&&(i=$p);var o=[{pubkey:t,isSigner:!0,isWritable:!0},{pubkey:e,isSigner:!1,isWritable:!0},{pubkey:n,isSigner:!1,isWritable:!1},{pubkey:r,isSigner:!1,isWritable:!1},{pubkey:uc.programId,isSigner:!1,isWritable:!1},{pubkey:i,isSigner:!1,isWritable:!1}];return new Bn({keys:o,programId:KI,data:Buffer.alloc(0)})}function $j(t,e,n,r,i,o){i===void 0&&(i=9);var s=Buffer.alloc(10);s[0]=12,s.writeBigUInt64LE(r,1),s[9]=i;var a=jI;return new Bn({keys:[{pubkey:t,isSigner:!1,isWritable:!0},{pubkey:o,isSigner:!1,isWritable:!1},{pubkey:e,isSigner:!1,isWritable:!0},{pubkey:n,isSigner:!0,isWritable:!1}],programId:a,data:s})}function Hj(t){var e=t.fromTokenAccount,n=t.toTokenAccount,r=t.owner,i=t.amount,o=Buffer.alloc(9);return o[0]=3,o.writeBigUInt64LE(i,1),new Bn({keys:[{pubkey:e,isSigner:!1,isWritable:!0},{pubkey:n,isSigner:!1,isWritable:!0},{pubkey:r,isSigner:!0,isWritable:!1}],programId:$p,data:o})}function Wj(t){return ys(this,void 0,void 0,function(){var e,n,r;return bs(this,function(i){switch(i.label){case 0:return[4,YI(t)];case 1:return e=i.sent(),n=new ke(t.fromAddress),r=new _p({payerKey:n,recentBlockhash:t.blockhash,instructions:e}).compileToV0Message(),[2,new Vp(r)]}})})}function YI(t){return ys(this,void 0,void 0,function(){var e,n,r,i,o,s;return bs(this,function(a){switch(a.label){case 0:return e=new ke(t.fromAddress),n=new ke(t.toAddress),r=[],t.tokenMint?[3,1]:(r.push(uc.transfer({fromPubkey:e,toPubkey:n,lamports:Number(t.amount)})),[3,4]);case 1:return i=new ke(t.tokenMint),[4,qI(i,e,t.tokenProgram)];case 2:return o=a.sent(),[4,qI(i,n,t.tokenProgram)];case 3:s=a.sent(),t.createATA&&r.push(Uj(e,s,n,i,t.tokenProgram?new ke(t.tokenProgram):$p)),t.tokenProgram===jI.toBase58()?r.push($j(o,s,e,BigInt(t.amount),t.tokenDecimals,i)):r.push(Hj({fromTokenAccount:o,toTokenAccount:s,owner:e,amount:BigInt(t.amount)})),a.label=4;case 4:return[2,r]}})})}function fc(t,e){return ys(this,void 0,void 0,function(){var r,n,r,i,o;return bs(this,function(s){switch(s.label){case 0:return s.trys.push([0,6,,7]),e.signAndSendTransaction?[4,e.signAndSendTransaction(t)]:[3,2];case 1:return r=s.sent().signature,[2,r];case 2:return[4,e.signTransaction(t)];case 3:if(n=s.sent(),!e.sendTransaction)throw new Error("Provider does not support sendTransaction");return[4,e.sendTransaction(n)];case 4:return r=s.sent(),[2,r];case 5:return[3,7];case 6:throw i=s.sent(),console.error("Error in handleManualSignAndSend:",i),i instanceof Error&&(!((o=i.message)===null||o===void 0)&&o.includes("User rejected"))?new Error("Transaction was rejected by user"):i;case 7:return[2]}})})}function Gj(t){return ys(this,void 0,void 0,function(){var e,n,r;return bs(this,function(i){for(e=[],n=function(o){var s=t[o],a=new ke(s.programId),l=s.accounts.map(function(c,u){if(!c.pubKey)throw new Error("Account at instruction ".concat(o,", index ").concat(u," has no pubKey and is not fillable"));var d=new ke(c.pubKey);return{pubkey:d,isSigner:c.isSigner,isWritable:c.isWritable}});e.push(new Bn({keys:l,programId:a,data:Buffer.from(s.data,"base64")}))},r=0;r<t.length;r++)n(r);return[2,e]})})}var QI=function(t){return ys(void 0,void 0,void 0,function(){var e,n,r,i,o,s;return bs(this,function(a){switch(a.label){case 0:return a.trys.push([0,8,,9]),e=Ea(t.walletName),[4,Wj(t)];case 1:return n=a.sent(),r=e.isTrust||e.isTrustWallet||t.walletName.toLowerCase().includes("trust"),r?[4,fc(n,e)]:[3,3];case 2:return[2,a.sent()];case 3:if(!e.signAndSendTransaction)return[3,7];a.label=4;case 4:return a.trys.push([4,6,,7]),[4,e.signAndSendTransaction(n)];case 5:return i=a.sent().signature,[2,i];case 6:if(o=a.sent(),Hp(o))throw new Error("Transaction was rejected by user");return[2,fc(n,e)];case 7:return[2,fc(n,e)];case 8:throw s=a.sent(),Hp(s)?new Error("Transaction was rejected by user"):s instanceof Error?s:new Error("Failed to send SOL transaction with ".concat(t.walletName," wallet"));case 9:return[2]}})})},jj=function(t,e){return ys(void 0,void 0,void 0,function(){var n,r,i,o,s,a;return bs(this,function(l){switch(l.label){case 0:n=t.transactionInstructions.walletName||"Phantom",l.label=1;case 1:return l.trys.push([1,5,,6]),[4,Gj(t.transactionInstructions.instructions)];case 2:return r=l.sent(),i=new ke(e.fromAddress),[4,YI(e)];case 3:return o=l.sent(),r.push.apply(r,o),s=new Vp(new _p({payerKey:i,recentBlockhash:t.transactionInstructions.blockhash,instructions:r}).compileToV0Message()),[4,Kj(n,s)];case 4:return[2,l.sent()];case 5:throw a=l.sent(),Hp(a)?new Error("Transaction was rejected by user"):a instanceof Error?a:new Error("Failed to send SOL transaction with ".concat(n," wallet"));case 6:return[2]}})})},Kj=function(t,e){return ys(void 0,void 0,void 0,function(){var n,r,i,o;return bs(this,function(s){switch(s.label){case 0:return n=Ea(t),r=n.isTrust||n.isTrustWallet||t.includes("trust"),r?[4,fc(e,n)]:[3,2];case 1:return[2,s.sent()];case 2:if(!n.signAndSendTransaction)return[3,6];s.label=3;case 3:return s.trys.push([3,5,,6]),[4,n.signAndSendTransaction(e)];case 4:return i=s.sent().signature,[2,i];case 5:if(o=s.sent(),Hp(o))throw new Error("Transaction was rejected by user");return[2,fc(e,n)];case 6:return[2,fc(e,n)]}})})},fb,XI;function qj(){if(XI)return fb;XI=1;function t(e){if(e.length>=255)throw new TypeError("Alphabet too long");for(var n=new Uint8Array(256),r=0;r<n.length;r++)n[r]=255;for(var i=0;i<e.length;i++){var o=e.charAt(i),s=o.charCodeAt(0);if(n[s]!==255)throw new TypeError(o+" is ambiguous");n[s]=i}var a=e.length,l=e.charAt(0),c=Math.log(a)/Math.log(256),u=Math.log(256)/Math.log(a);function d(b){if(b instanceof Uint8Array||(ArrayBuffer.isView(b)?b=new Uint8Array(b.buffer,b.byteOffset,b.byteLength):Array.isArray(b)&&(b=Uint8Array.from(b))),!(b instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if(b.length===0)return"";for(var p=0,w=0,S=0,O=b.length;S!==O&&b[S]===0;)S++,p++;for(var T=(O-S)*u+1>>>0,$=new Uint8Array(T);S!==O;){for(var R=b[S],j=0,q=T-1;(R!==0||j<w)&&q!==-1;q--,j++)R+=256*$[q]>>>0,$[q]=R%a>>>0,R=R/a>>>0;if(R!==0)throw new Error("Non-zero carry");w=j,S++}for(var G=T-w;G!==T&&$[G]===0;)G++;for(var L=l.repeat(p);G<T;++G)L+=e.charAt($[G]);return L}function h(b){if(typeof b!="string")throw new TypeError("Expected String");if(b.length===0)return new Uint8Array;for(var p=0,w=0,S=0;b[p]===l;)w++,p++;for(var O=(b.length-p)*c+1>>>0,T=new Uint8Array(O);b[p];){var $=b.charCodeAt(p);if($>255)return;var R=n[$];if(R===255)return;for(var j=0,q=O-1;(R!==0||j<S)&&q!==-1;q--,j++)R+=a*T[q]>>>0,T[q]=R%256>>>0,R=R/256>>>0;if(R!==0)throw new Error("Non-zero carry");S=j,p++}for(var G=O-S;G!==O&&T[G]===0;)G++;for(var L=new Uint8Array(w+(O-G)),V=w;G!==O;)L[V++]=T[G++];return L}function g(b){var p=h(b);if(p)return p;throw new Error("Non-base"+a+" character")}return{encode:d,decodeUnsafe:h,decode:g}}return fb=t,fb}var hb,JI;function Yj(){return JI||(JI=1,hb=qj()("123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz")),hb}var Qj=Yj();const Xj=sl(Qj);var Jj=function(t,e,n,r){function i(o){return o instanceof n?o:new n(function(s){s(o)})}return new(n||(n=Promise))(function(o,s){function a(u){try{c(r.next(u))}catch(d){s(d)}}function l(u){try{c(r.throw(u))}catch(d){s(d)}}function c(u){u.done?o(u.value):i(u.value).then(a,l)}c((r=r.apply(t,e||[])).next())})},Zj=function(t,e){var n={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},r,i,o,s=Object.create((typeof Iterator=="function"?Iterator:Object).prototype);return s.next=a(0),s.throw=a(1),s.return=a(2),typeof Symbol=="function"&&(s[Symbol.iterator]=function(){return this}),s;function a(c){return function(u){return l([c,u])}}function l(c){if(r)throw new TypeError("Generator is already executing.");for(;s&&(s=0,c[0]&&(n=0)),n;)try{if(r=1,i&&(o=c[0]&2?i.return:c[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,c[1])).done)return o;switch(i=0,o&&(c=[c[0]&2,o.value]),c[0]){case 0:case 1:o=c;break;case 4:return n.label++,{value:c[1],done:!1};case 5:n.label++,i=c[1],c=[0];continue;case 7:c=n.ops.pop(),n.trys.pop();continue;default:if(o=n.trys,!(o=o.length>0&&o[o.length-1])&&(c[0]===6||c[0]===2)){n=0;continue}if(c[0]===3&&(!o||c[1]>o[0]&&c[1]<o[3])){n.label=c[1];break}if(c[0]===6&&n.label<o[1]){n.label=o[1],o=c;break}if(o&&n.label<o[2]){n.label=o[2],n.ops.push(c);break}o[2]&&n.ops.pop(),n.trys.pop();continue}c=e.call(t,n)}catch(u){c=[6,u],i=0}finally{r=o=0}if(c[0]&5)throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}},eK=function(t,e){return Jj(void 0,void 0,void 0,function(){var n,r,i,o;return Zj(this,function(s){switch(s.label){case 0:return s.trys.push([0,2,,3]),n=Ea(t),r=new TextEncoder().encode(e),[4,n.signMessage(r)];case 1:return i=s.sent(),[2,Xj.encode(i.signature)];case 2:return o=s.sent(),[2,o instanceof Error?o:new Error("Failed to sign message with ".concat(t," wallet"))];case 3:return[2]}})})},tK=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(r[o]=i[o])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),vs=function(t,e,n,r){function i(o){return o instanceof n?o:new n(function(s){s(o)})}return new(n||(n=Promise))(function(o,s){function a(u){try{c(r.next(u))}catch(d){s(d)}}function l(u){try{c(r.throw(u))}catch(d){s(d)}}function c(u){u.done?o(u.value):i(u.value).then(a,l)}c((r=r.apply(t,e||[])).next())})},ws=function(t,e){var n={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},r,i,o,s=Object.create((typeof Iterator=="function"?Iterator:Object).prototype);return s.next=a(0),s.throw=a(1),s.return=a(2),typeof Symbol=="function"&&(s[Symbol.iterator]=function(){return this}),s;function a(c){return function(u){return l([c,u])}}function l(c){if(r)throw new TypeError("Generator is already executing.");for(;s&&(s=0,c[0]&&(n=0)),n;)try{if(r=1,i&&(o=c[0]&2?i.return:c[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,c[1])).done)return o;switch(i=0,o&&(c=[c[0]&2,o.value]),c[0]){case 0:case 1:o=c;break;case 4:return n.label++,{value:c[1],done:!1};case 5:n.label++,i=c[1],c=[0];continue;case 7:c=n.ops.pop(),n.trys.pop();continue;default:if(o=n.trys,!(o=o.length>0&&o[o.length-1])&&(c[0]===6||c[0]===2)){n=0;continue}if(c[0]===3&&(!o||c[1]>o[0]&&c[1]<o[3])){n.label=c[1];break}if(c[0]===6&&n.label<o[1]){n.label=o[1],o=c;break}if(o&&n.label<o[2]){n.label=o[2],n.ops.push(c);break}o[2]&&n.ops.pop(),n.trys.pop();continue}c=e.call(t,n)}catch(u){c=[6,u],i=0}finally{r=o=0}if(c[0]&5)throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}},nK=function(t){tK(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.connect=function(n){return vs(this,void 0,void 0,function(){var r,i;return ws(this,function(o){switch(o.label){case 0:return o.trys.push([0,2,,3]),[4,AW(n)];case 1:if(r=o.sent(),r instanceof Error)throw r;return[2,{accounts:r.accounts,chainId:r.chainId,isConnected:r.isConnected}];case 2:throw i=o.sent(),this.handleError(i,"connect to Solana wallet");case 3:return[2]}})})},e.prototype.disconnect=function(n){return vs(this,void 0,void 0,function(){var r,i;return ws(this,function(o){switch(o.label){case 0:return o.trys.push([0,2,,3]),[4,kW(n.walletName||"Unknown Wallet")];case 1:if(r=o.sent(),r instanceof Error)throw r;return[3,3];case 2:throw i=o.sent(),this.handleError(i,"disconnect from Solana wallet");case 3:return[2]}})})},e.prototype.signMessage=function(n){return vs(this,void 0,void 0,function(){var r,i;return ws(this,function(o){switch(o.label){case 0:return o.trys.push([0,2,,3]),[4,eK(n.walletName||"Unknown Wallet",n.message)];case 1:if(r=o.sent(),r instanceof Error)throw r;return[2,r];case 2:throw i=o.sent(),this.handleError(i,"sign Solana message");case 3:return[2]}})})},e.prototype.switchChain=function(n){return vs(this,void 0,void 0,function(){return ws(this,function(r){return[2,{chainId:"101",accounts:[]}]})})},e.prototype.sendNativeTransfer=function(n){return vs(this,void 0,void 0,function(){var r,i;return ws(this,function(o){switch(o.label){case 0:return o.trys.push([0,2,,3]),[4,QI({toAddress:n.toAddress,amount:BigInt(n.amount*Math.pow(10,n.decimalPlaces)),fromAddress:n.account,blockhash:n.blockhash||"",walletName:n.walletName||""})];case 1:if(r=o.sent(),typeof r=="string")return[2,r];throw r;case 2:throw i=o.sent(),this.handleError(i,"send Solana native transfer");case 3:return[2]}})})},e.prototype.sendSmartContractInteraction=function(n){return vs(this,void 0,void 0,function(){var r,i,o,s,a,l,c;return ws(this,function(u){switch(u.label){case 0:return r=Ea(n.walletName||""),o=n.account,o?[3,2]:[4,(c=r.publicKey)===null||c===void 0?void 0:c.toString()];case 1:o=u.sent(),u.label=2;case 2:if(i=o,!i)throw new Error("Sender account address is required");if(s=n.args[2]||9,a=n.args[1],l=a,!n.blockhash)throw new Error("Blockhash is required for Solana transactions");return[4,QI({toAddress:n.args[0],amount:l,fromAddress:i,blockhash:n.blockhash,walletName:n.walletName||"",tokenMint:n.address,createATA:n.createATA||!1,tokenProgram:n.tokenProgram,tokenDecimals:s})];case 3:return[2,u.sent()]}})})},e.prototype.sendTransactionWithInstructions=function(n){return vs(this,void 0,void 0,function(){var r,i,o,s,a,l,c,u,d;return ws(this,function(h){switch(h.label){case 0:return r=Ea(n.transactionInstructions.walletName||""),o=n.transferConfig.account,o?[3,2]:[4,(d=r.publicKey)===null||d===void 0?void 0:d.toString()];case 1:o=h.sent(),h.label=2;case 2:if(i=o,!i)throw new Error("Sender account address is required");if(s=n.transferConfig.args[2]||6,a=n.transferConfig.args[1],l=a,!n.transactionInstructions.blockhash)throw new Error("Blockhash is required for Solana transactions");h.label=3;case 3:return h.trys.push([3,5,,6]),[4,jj(n,{toAddress:n.transferConfig.args[0],amount:l,fromAddress:i,blockhash:n.transactionInstructions.blockhash,walletName:n.transactionInstructions.walletName||"",tokenMint:n.transferConfig.address,createATA:n.transferConfig.createATA||!1,tokenProgram:n.transferConfig.tokenProgram,tokenDecimals:s})];case 4:if(c=h.sent(),typeof c=="string")return[2,c];throw c;case 5:throw u=h.sent(),this.handleError(u,"send Solana native transfer");case 6:return[2]}})})},e.prototype.sendNativeSmartContractInteraction=function(){throw new Error("Method not implemented.")},e.prototype.sendTransactionBatch=function(){throw new Error("Method not implemented.")},e.prototype.getWalletCapabilities=function(){return vs(this,void 0,void 0,function(){return ws(this,function(n){return[2,{atomic:{status:"ready"}}]})})},e.prototype.getProviders=function(){var n=bC();return Object.keys(n).map(function(r){return{id:r,type:"solana"}})},e}(sS),ZI=function(){function t(){this.strategies=new Map,this.strategies.set("evm",new xW),this.strategies.set("solana",new nK)}return t.getInstance=function(){return t.instance||(t.instance=new t),t.instance},t.prototype.getStrategy=function(e){var n=this.strategies.get(e);if(!n)throw new Error("No strategy found for network type: ".concat(e));return n},t.prototype.getAllProviders=function(){var e=[];return this.strategies.forEach(function(n){e.push.apply(e,n.getProviders())}),e},t}(),pb=function(){return pb=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++){e=arguments[n];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},pb.apply(this,arguments)},gb=function(t,e,n,r){function i(o){return o instanceof n?o:new n(function(s){s(o)})}return new(n||(n=Promise))(function(o,s){function a(u){try{c(r.next(u))}catch(d){s(d)}}function l(u){try{c(r.throw(u))}catch(d){s(d)}}function c(u){u.done?o(u.value):i(u.value).then(a,l)}c((r=r.apply(t,e||[])).next())})},mb=function(t,e){var n={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},r,i,o,s=Object.create((typeof Iterator=="function"?Iterator:Object).prototype);return s.next=a(0),s.throw=a(1),s.return=a(2),typeof Symbol=="function"&&(s[Symbol.iterator]=function(){return this}),s;function a(c){return function(u){return l([c,u])}}function l(c){if(r)throw new TypeError("Generator is already executing.");for(;s&&(s=0,c[0]&&(n=0)),n;)try{if(r=1,i&&(o=c[0]&2?i.return:c[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,c[1])).done)return o;switch(i=0,o&&(c=[c[0]&2,o.value]),c[0]){case 0:case 1:o=c;break;case 4:return n.label++,{value:c[1],done:!1};case 5:n.label++,i=c[1],c=[0];continue;case 7:c=n.ops.pop(),n.trys.pop();continue;default:if(o=n.trys,!(o=o.length>0&&o[o.length-1])&&(c[0]===6||c[0]===2)){n=0;continue}if(c[0]===3&&(!o||c[1]>o[0]&&c[1]<o[3])){n.label=c[1];break}if(c[0]===6&&n.label<o[1]){n.label=o[1],o=c;break}if(o&&n.label<o[2]){n.label=o[2],n.ops.push(c);break}o[2]&&n.ops.pop(),n.trys.pop();continue}c=e.call(t,n)}catch(u){c=[6,u],i=0}finally{r=o=0}if(c[0]&5)throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}},Pe,eO,Wp,yb=pm,rK=function(){return document.getElementById(yb)};function jn(t){var e,n=rK();if(!n){console.warn("Mesh SDK: Failed to deliver ".concat(t.type," message to the iframe - no iframe element found"));return}if(!Wp){console.warn("Mesh SDK: Failed to deliver ".concat(t.type," message to the iframe - no link token origin found"));return}try{(e=n.contentWindow)===null||e===void 0||e.postMessage(t,Wp)}catch(r){console.error("Mesh SDK: Failed to deliver ".concat(t.type," message to the iframe")),console.error(r)}}function iK(t){return gb(this,void 0,void 0,function(){var e,e,e,e,n,r,i,o,s,a,l,c,u,d,h,g;return mb(this,function(b){switch(t.data.type){case"brokerageAccountAccessToken":{e={accessToken:t.data.payload},(i=Pe==null?void 0:Pe.onEvent)===null||i===void 0||i.call(Pe,{type:"integrationConnected",payload:e}),(o=Pe==null?void 0:Pe.onIntegrationConnected)===null||o===void 0||o.call(Pe,e);break}case"delayedAuthentication":{e={delayedAuth:t.data.payload},(s=Pe==null?void 0:Pe.onEvent)===null||s===void 0||s.call(Pe,{type:"integrationConnected",payload:e}),(a=Pe==null?void 0:Pe.onIntegrationConnected)===null||a===void 0||a.call(Pe,e);break}case"transferFinished":{e=t.data.payload,(l=Pe==null?void 0:Pe.onEvent)===null||l===void 0||l.call(Pe,{type:"transferCompleted",payload:e}),(c=Pe==null?void 0:Pe.onTransferFinished)===null||c===void 0||c.call(Pe,e);break}case"close":case"done":{e=(u=t.data)===null||u===void 0?void 0:u.payload,(d=Pe==null?void 0:Pe.onExit)===null||d===void 0||d.call(Pe,e==null?void 0:e.errorMessage,e),gm();break}case"loaded":{jn({type:"meshSDKSpecs",payload:pb({},TU)}),n=ZI.getInstance(),r=n.getAllProviders(),jn({type:"SDKinjectedWalletProviders",payload:r}),Pe!=null&&Pe.accessTokens&&jn({type:"frontAccessTokens",payload:Pe.accessTokens}),Pe!=null&&Pe.transferDestinationTokens&&jn({type:"frontTransferDestinationTokens",payload:Pe.transferDestinationTokens}),(h=Pe==null?void 0:Pe.onEvent)===null||h===void 0||h.call(Pe,{type:"pageLoaded"});break}default:{EU(t.data.type)&&((g=Pe==null?void 0:Pe.onEvent)===null||g===void 0||g.call(Pe,t.data));break}}return[2]})})}function oK(t){return gb(this,void 0,void 0,function(){var e,n,p,w,S,O,r,p,w,S,O,i,p,w,S,O,o,p,w,S,O,s,p,l,w,S,O,h,a,u,p,l,w,S,O,h,c,u,p,h,w,S,O,d,p,h,w,S,O,g,p,w,S,b,p,w,S,O,T,$;return mb(this,function(R){switch(R.label){case 0:switch(e=ZI.getInstance(),n=t.data.type,n){case"walletBrowserInjectedWalletSelected":return[3,1];case"walletBrowserSignRequest":return[3,6];case"walletBrowserChainSwitchRequest":return[3,11];case"walletBrowserNativeTransferRequest":return[3,16];case"walletBrowserNonNativeTransferRequest":return[3,21];case"walletBrowserNonNativeSmartDeposit":return[3,21];case"walletBrowserNativeSmartDeposit":return[3,26];case"walletBrowserTransactionBatchRequest":return[3,31];case"walletBrowserWalletCapabilities":return[3,36];case"walletBrowserDisconnect":return[3,41];case"walletBrowserSolanaTransferWithInstructionsRequest":return[3,49]}return[3,54];case 1:p=t.data.payload,R.label=2;case 2:return R.trys.push([2,4,,5]),w=!(($=p.networkType)===null||$===void 0)&&$.includes("solana")?"solana":"evm",S=e.getStrategy(w),[4,S.connect(p)];case 3:return O=R.sent(),jn({type:"SDKinjectedConnectionCompleted",payload:{accounts:O.accounts,chainId:O.chainId,networkType:w}}),[3,5];case 4:return r=R.sent(),console.error("Connection error:",r),Li(r,"SDKinjectedConnectionCompleted"),[3,5];case 5:return[3,54];case 6:p=t.data.payload,R.label=7;case 7:return R.trys.push([7,9,,10]),w=p.address.startsWith("0x")?"evm":"solana",S=e.getStrategy(w),[4,S.signMessage(p)];case 8:return O=R.sent(),jn({type:"SDKsignRequestCompleted",payload:O}),[3,10];case 9:return i=R.sent(),Li(i,"SDKsignRequestCompleted"),[3,10];case 10:return[3,54];case 11:p=t.data.payload,R.label=12;case 12:return R.trys.push([12,14,,15]),w=p.networkType==="solana"?"solana":"evm",S=e.getStrategy(w),[4,S.switchChain(p)];case 13:return O=R.sent(),jn({type:"SDKswitchChainCompleted",payload:{chainId:O.chainId,accounts:O.accounts,networkType:w}}),[3,15];case 14:return o=R.sent(),console.error("Chain switch failed:",o),Li(o,"SDKswitchChainCompleted"),[3,15];case 15:return[3,54];case 16:p=t.data.payload,R.label=17;case 17:return R.trys.push([17,19,,20]),w=p.network==="solana"?"solana":"evm",S=e.getStrategy(w),[4,S.sendNativeTransfer(p)];case 18:return O=R.sent(),jn({type:"SDKnativeTransferCompleted",payload:O}),[3,20];case 19:return s=R.sent(),Li(s,"SDKnativeTransferCompleted"),[3,20];case 20:return[3,54];case 21:p=t.data.payload,l=function(j){switch(j){case"walletBrowserNonNativeTransferRequest":return"SDKnonNativeTransferCompleted";case"walletBrowserNativeSmartDeposit":return"SDKnativeSmartDepositCompleted";case"walletBrowserNonNativeSmartDeposit":return"SDKnonNativeSmartDepositCompleted";default:return"SDKnonNativeTransferCompleted"}},R.label=22;case 22:return R.trys.push([22,24,,25]),w=p.address.startsWith("0x")?"evm":"solana",S=e.getStrategy(w),[4,S.sendSmartContractInteraction(p)];case 23:return O=R.sent(),h=l(t.data.type),jn({type:h,payload:{txHash:O}}),[3,25];case 24:return a=R.sent(),u=l(t.data.type),Li(a,u),[3,25];case 25:return[3,54];case 26:p=t.data.payload,l=function(j){switch(j){case"walletBrowserNonNativeTransferRequest":return"SDKnonNativeTransferCompleted";case"walletBrowserNativeSmartDeposit":return"SDKnativeSmartDepositCompleted";case"walletBrowserNonNativeSmartDeposit":return"SDKnonNativeSmartDepositCompleted";default:return"SDKnonNativeTransferCompleted"}},R.label=27;case 27:return R.trys.push([27,29,,30]),w=p.address.startsWith("0x")?"evm":"solana",S=e.getStrategy(w),[4,S.sendNativeSmartContractInteraction(p)];case 28:return O=R.sent(),h=l(t.data.type),jn({type:h,payload:{txHash:O}}),[3,30];case 29:return c=R.sent(),u=l(t.data.type),Li(c,u),[3,30];case 30:return[3,54];case 31:p=t.data.payload,h="SDKtransactionBatchCompleted",R.label=32;case 32:return R.trys.push([32,34,,35]),w=p.from.startsWith("0x")?"evm":"solana",S=e.getStrategy(w),[4,S.sendTransactionBatch(p)];case 33:return O=R.sent(),jn({type:h,payload:{txHash:O}}),[3,35];case 34:return d=R.sent(),Li(d,h),[3,35];case 35:return[3,54];case 36:p=t.data.payload,h="SDKwalletCapabilitiesCompleted",R.label=37;case 37:return R.trys.push([37,39,,40]),w=p.from.startsWith("0x")?"evm":"solana",S=e.getStrategy(w),[4,S.getWalletCapabilities(p)];case 38:return O=R.sent(),jn({type:h,payload:O}),[3,40];case 39:return g=R.sent(),Li(g,h),[3,40];case 40:return[3,54];case 41:p=t.data.payload,R.label=42;case 42:return R.trys.push([42,47,,48]),p!=null&&p.networkType?(w=p.networkType==="solana"?"solana":"evm",S=e.getStrategy(w),[4,S.disconnect(p)]):[3,44];case 43:return R.sent(),[3,46];case 44:return[4,Promise.all([e.getStrategy("solana").disconnect(p),e.getStrategy("evm").disconnect(p)])];case 45:R.sent(),R.label=46;case 46:return jn({type:"SDKdisconnectSuccess"}),[3,48];case 47:return b=R.sent(),console.error("Error during disconnect:",b),Li(b,"SDKdisconnectSuccess"),[3,48];case 48:return[3,54];case 49:p=t.data.payload,R.label=50;case 50:return R.trys.push([50,52,,53]),w="solana",S=e.getStrategy(w),[4,S.sendTransactionWithInstructions(p)];case 51:return O=R.sent(),jn({type:"SDKnonNativeTransferCompleted",payload:{txHash:O}}),[3,53];case 52:return T=R.sent(),Li(T,"SDKdisconnectSuccess"),[3,53];case 53:return[3,54];case 54:return[2]}})})}function bb(t){return gb(this,void 0,void 0,function(){return mb(this,function(e){switch(e.label){case 0:return t.origin!==eO&&t.origin!==Wp?(console.warn("Received message from untrusted origin:",t.origin),[3,5]):[3,1];case 1:return IU(t.data.type)?[4,oK(t)]:[3,3];case 2:return e.sent(),[3,5];case 3:return[4,iK(t)];case 4:e.sent(),e.label=5;case 5:return[2]}})})}function Li(t,e){jn({type:e,payload:{error:t}})}var tO=function(t){var e=function(r,i){var o;if(!r){(o=t==null?void 0:t.onExit)===null||o===void 0||o.call(t,"Invalid link token!");return}Pe=t;var s=window.atob(r);if(s=sK(s,Pe==null?void 0:Pe.language),Wp=new URL(s).origin,window.removeEventListener("message",bb),i){var a=document.getElementById(i);a?(a.allow="clipboard-read *; clipboard-write *",a.src=s,yb=i):console.warn("Mesh SDK: No iframe found with id ".concat(i))}else yb=pm,kU(s);window.addEventListener("message",bb),eO=window.location.origin},n=function(){var r;gm(),window.removeEventListener("message",bb),(r=t.onExit)===null||r===void 0||r.call(t)};return{openLink:e,closeLink:n}};function sK(t,e){return e==="system"&&(e=typeof navigator!="undefined"&&navigator.language?encodeURIComponent(navigator.language):void 0),"".concat(t).concat(t.includes("?")?"&":"?","lng=").concat(e||"en")}const aK="data:image/svg+xml,%3csvg%20width='17'%20height='16'%20viewBox='0%200%2017%2016'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20clip-path='url(%23clip0_126_8587)'%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M16.3686%2010.6232C16.3715%2010.6146%2016.359%2010.6097%2016.355%2010.6179C14.975%2013.5085%2012.2144%2015.5112%208.66017%2015.5112C4.88611%2015.5112%201.35008%2012.688%201.35008%208.37011C1.35008%204.65011%204.30812%201.56104%207.74213%201.56104C10.6321%201.56104%2012.6382%203.28819%2012.6382%204.51714C12.6382%205.08189%2012.2642%205.48041%2011.6862%205.48041C10.3602%205.48041%209.85022%203.15536%207.33413%203.15536C4.78406%203.15536%202.6081%205.54683%202.6081%208.37011C2.6081%2012.0238%205.56614%2014.4153%208.52417%2014.4153C9.68043%2014.4153%2010.322%2014.1182%2010.5073%2014.0169C10.515%2014.0126%2010.51%2014.0012%2010.5017%2014.0037C10.3174%2014.0604%209.73839%2014.2159%208.93211%2014.2159C5.29405%2014.2159%203.83206%2011.4591%203.83206%209.66544C3.83206%208.30367%204.71606%207.73906%205.43016%207.73906C7.33413%207.73906%207.06219%2011.7248%2011.7542%2011.7248C14.2023%2011.7248%2016.4803%2010.0972%2016.4803%206.87544C16.4803%203.22178%2012.9442%200%208.66017%200C4.17214%200%200.5%203.554%200.5%207.97156C0.5%2012.4223%204.30812%2015.9763%208.66017%2015.9763C12.4804%2015.9763%2015.3429%2013.5242%2016.3686%2010.6232Z'%20fill='%231E171F'/%3e%3c/g%3e%3cdefs%3e%3cclipPath%20id='clip0_126_8587'%3e%3crect%20width='16'%20height='16'%20fill='white'%20transform='translate(0.5)'/%3e%3c/clipPath%3e%3c/defs%3e%3c/svg%3e";We("h2",{base:{fontWeight:"600",fontSize:"16px",lineHeight:"100%",letterSpacing:"-0.4px",color:"fg"}});const vb=({icon:t,title:e,description:n})=>k.jsxs(ye,{display:"flex",flexDirection:"row",gap:"16px",width:"100%",alignItems:"flex-start",children:[k.jsx(Lt,{as:t,color:"fg.muted",width:"20px",height:"20px",marginTop:"2px"}),k.jsxs(ye,{display:"flex",flexDirection:"column",gap:"4px",flex:"1",children:[k.jsx(ye,{fontWeight:"600",fontSize:"14px",lineHeight:"120%",color:"fg",children:e}),k.jsx(ye,{fontWeight:"400",fontSize:"12px",lineHeight:"140%",color:"fg.subtle",children:n})]})]}),lK=({onConfirm:t})=>k.jsxs(gr,{children:[k.jsx(ye,{display:"flex",justifyContent:"center",width:"100%",children:k.jsx(ye,{height:"48px",width:"48px",backgroundColor:"gray.200",borderRadius:"90%"})}),k.jsx(ye,{fontWeight:"600",fontSize:"16px",lineHeight:"140%",color:"fg",textAlign:"center",children:"Enso Checkout uses a 3rd party to connect your Binance account."}),k.jsxs(ye,{display:"flex",flexDirection:"column",gap:"12px",width:"100%",children:[k.jsx(vb,{icon:F_,title:"Your sign-in credentials are never stored",description:"All data is encrypted between enso and Binance"}),k.jsx(vb,{icon:V_,title:"2fa always required",description:"Transfers cannot be made without your approval."}),k.jsx(vb,{icon:__,title:"Assets never touch 3rd parties",description:"Your funds are transferred directly to your wallet."}),k.jsxs(rV,{children:[k.jsx(pr,{src:aK,color:"gray",w:"24px"}),"Enso securely encrypts all user data."]})]}),k.jsx(Fn,{onClick:t,children:"Continue to 3rd Party"})]}),cK="0x0000000071727de22e5e9d8baf0edac6f37da032",Gp="https://mesh-bff.enso-checkout.workers.dev",nO=[0,1,2,3,4],wb="9226e5c2-ebc3-4fdd-94f6-ed52cdce1420",rO={1:"e3c7fdd8-b1fc-4e51-85ae-bb276e075611",8453:"aa883b03-120d-477c-a588-37c2afd3ca71",42161:"a34f2431-0ddd-4de4-bc22-4a8143287aeb",137:"7436e9d0-ba42-4d2b-b4c0-8e4e606b2c12",10:"18fa36b0-88a8-43ca-83db-9a874e0a2288",43114:"bad16371-c22a-4bf4-a311-274d046cd760",56:"ed0ebeec-b166-4c8b-8574-cb078f7af8cf",146:"385f0b3a-8471-4b8f-884f-c4f4496f1603"},uK=t=>rO[t]||rO[8453],dK=({setStep:t})=>{const{chainIdOut:e,setMeshAccessToken:n,setSessionId:r}=Qe(),{address:i}=Xe.useAccount(),o=iO(),[s,a]=J.useState(!1);J.useEffect(()=>{const c=localStorage.getItem(o);if(c)try{const u=JSON.parse(c);if(u!=null&&u.accessToken&&(u!=null&&u.sessionId)){n(u.accessToken),r(u.sessionId),t(1);return}}catch(u){console.error("Failed to parse saved Mesh connection",u)}a(!0)},[e,i,o]);const l=()=>{fetch(`${Gp}/linktoken`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({userId:i,integrationId:wb,address:i})}).then(c=>c.json()).then(c=>{r(c.content.sessionId);const u=tO({clientId:i,onIntegrationConnected:d=>{console.log("onIntegrationConnected",d),n(d.accessToken),t(1);try{localStorage.setItem(o,JSON.stringify({accessToken:d.accessToken,sessionId:c.content.sessionId,timestamp:Date.now()})),u.closeLink()}catch(h){console.error("Failed to persist Mesh connection",h)}},onExit:d=>{debugger},onTransferFinished:d=>{debugger},onEvent:d=>{console.log(d)}});u.openLink(c.content.linkToken)}).catch(c=>console.error(c))};return s?k.jsx(lK,{onConfirm:l}):k.jsx(oh,{m:5})},iO=()=>J.useMemo(()=>{const t="meshDeviceId";let e=localStorage.getItem(t);return e||(e=`device_${Date.now()}_${Math.random().toString(36).substring(2,15)}`,localStorage.setItem(t,e)),e},[]),fK=({setStep:t,onTokenSelect:e})=>{const[n,r]=J.useState([]),[i,o]=J.useState([]),[s,a]=J.useState([]),[l,c]=J.useState(null),[u,d]=J.useState(!0),[h,g]=J.useState(null),{address:b}=Xe.useAccount(),{chainIdOut:p,meshAccessToken:w,sessionId:S,setMeshAccessToken:O,setSessionId:T,setTokenIn:$,chainIdIn:R}=Qe(),j=iO();J.useEffect(()=>{w&&S&&p&&(async()=>{var L,V;try{const z=await(await fetch(`${Gp}/holdings`,{method:"POST",headers:{"Content-Type":"application/json","x-session-id":S},body:JSON.stringify({authToken:w.accountTokens[0].accessToken,brokerType:"binanceInternationalDirect"})})).json();if(console.log("Holdings data:",z),z.status==="ok"&&((L=z.content)!=null&&L.cryptocurrencyPositions))r(z.content.cryptocurrencyPositions);else throw z.errorType==="invalidIntegrationToken"&&(console.log("Invalid integration token"),t(0),O(null),T(null),localStorage.removeItem(j)),new Error(z.message||"Failed to fetch holdings");const f=await(await fetch(`${Gp}/tokens?chainId=${R}`)).json();if(console.log("Tokens data:",f),f.status==="success"&&((V=f.content)!=null&&V.tokens)){o(f.content.tokens);const y=f.content.tokens.map(E=>{const I=z.content.cryptocurrencyPositions.find(N=>N.symbol===E.symbol);return I?{...E,balance:I.amount,marketValue:I.marketValue,holding:I}:null}).filter(E=>E!==null&&E.marketValue>5).sort((E,I)=>I.marketValue-E.marketValue);console.log("Matched tokens with balances:",y),a(y)}else throw new Error(f.message||"Failed to fetch supported tokens")}catch(W){debugger;console.error("Error fetching data:",W),g(W instanceof Error?W.message:"Failed to fetch data")}finally{d(!1)}})()},[b,p,w,S]);const q=Bz(s.map(G=>G.symbol),R);return console.log("geckoTokens",q),u?k.jsx(sh,{children:k.jsx(oh,{m:5})}):h?k.jsxs(ye,{p:5,color:"red.500",children:["Error: ",h]}):k.jsxs(gr,{children:[k.jsxs(ye,{mb:4,width:"100%",textAlign:"left",children:[k.jsx(qo,{children:"Your Holdings"}),k.jsxs(em,{children:["Found ",s.length," tokens with balances"]})]}),k.jsx(ye,{overflowY:"scroll",maxH:"400px",children:k.jsx(gh,{children:s.map((G,L)=>{var V,W;return k.jsx(jE,{chainId:p||1,icon:(W=(V=q==null?void 0:q[L])==null?void 0:V.logoURI)==null?void 0:W.replace("/thumb/","/large/"),title:G.name,balance:`${fo(G.balance)} ${G.symbol}`,usdBalance:ra(G.marketValue||0),tag:"",loading:!1,selected:l===G.symbol,onClick:()=>{var z;c(G.symbol),e(G),$((z=q==null?void 0:q[L])==null?void 0:z.address)}},`${G.symbol}-${L}`)})})}),s.length===0&&k.jsx(ye,{textAlign:"center",color:"fg.subtle",py:8,children:"No tokens with balances found for this chain"}),k.jsx(Fn,{disabled:!l,onClick:()=>{t(2)},children:"Continue"})]})},hK=({setStep:t,selectedToken:e})=>{const[n,r]=J.useState(""),[i,o]=J.useState("usd"),[s,a]=J.useState(""),{setAmountIn:l}=Qe(),{tokenInData:c,tokenIn:u}=Jr();J.useEffect(()=>{e&&(r(e.balance.toString()),a(e.marketValue.toFixed(2)))},[e]),J.useEffect(()=>{console.log("tokenIn",u),c!=null&&c.decimals&&l((Number(n)*10**(c==null?void 0:c.decimals)).toFixed())},[n,c==null?void 0:c.decimals]);const d=L=>{if(!e)return;const V=e.balance*L/100,W=e.marketValue*L/100;r(V.toString()),a(W.toFixed(2))},h=L=>{if(e)if(i==="usd"){const V=L.replace("$","");a(V);const W=e.marketValue/e.balance,z=parseFloat(V)/W;r(z.toString())}else{r(L);const V=e.marketValue/e.balance,W=parseFloat(L)*V;a(W.toFixed(2))}},g=()=>{o(i==="usd"?"token":"usd")},b=()=>i==="usd"?{placeholder:"$10.00",displayValue:s?`$${s}`:"",equivalentValue:n?`${fo(parseFloat(n))} ${e==null?void 0:e.symbol}`:"—"}:{placeholder:"0.00",displayValue:n,equivalentValue:s?`$${s}`:"—"},{placeholder:p,displayValue:w,equivalentValue:S}=b(),O=e?parseFloat(n)>e.balance:!0,T=parseFloat(s),$=e?dV[e.symbol]:0,R=e?e.marketValue-5:0,j=e&&T>0&&$&&T<$,q=e&&T>0&&T>R,G=j||q||O;return e?k.jsxs(gr,{children:[k.jsxs(ye,{mb:4,width:"100%",textAlign:"left",children:[k.jsx(qo,{children:"Enter Amount"}),k.jsxs(em,{children:["Available: ",fo(e.balance)," ",e.symbol," ($",ra(e.marketValue),")"]})]}),k.jsxs(ye,{display:"flex",flexDirection:"column",gap:"8px",width:"100%",children:[k.jsxs(ye,{display:"flex",flexDirection:"column",gap:"8px",alignItems:"center",padding:"25.5px",children:[k.jsx(ph,{inputMode:"decimal",marginY:"8px",variant:"text",placeholder:p,value:w,onChange:L=>h(L.target.value)}),k.jsxs(ye,{display:"flex",gap:"3",alignItems:"center",onClick:g,_hover:{background:"bg.subtle"},cursor:"pointer",borderRadius:"lg",px:"3",children:[k.jsx(er,{minWidth:"24px",minHeight:"24px",maxWidth:"24px",background:"transparent",children:k.jsx(Lt,{as:D2,color:"gray",width:"16px",height:"16px"})}),k.jsx(Ge,{fontSize:"sm",color:"fg.muted",children:S})]})]}),k.jsx(ye,{display:"flex",gap:"4px",justifyContent:"center",paddingBottom:"35px",children:[25,50,75,100].map(L=>k.jsx(J2,{onClick:()=>d(L),children:L===100?"Max":`${L}%`},L))})]}),k.jsx(hh,{disabled:!G&&!!n,content:n?j?`Minimum amount is $${$} USD`:q?`Maximum amount is $${R.toFixed(2)} USD (balance - $10)`:O?"Amount exceeds available balance":"":"Please enter an amount",showArrow:!0,children:k.jsx(Fn,{onClick:()=>G||!n?void 0:t(3),disabled:G||!n,children:"Continue"})})]}):k.jsx(gr,{children:k.jsx(ye,{textAlign:"center",color:"fg.subtle",py:8,children:"No token selected"})})},pK=({setStep:t,setUserOp:e})=>{const{chainIdIn:n}=Jr(),{isLoading:r,usdAmountIn:i,routerData:o}=Ml(),{signMessageAsync:s}=Xe.useSignMessage(),{address:a}=Xe.useAccount(),[l,c]=J.useState(!1),u=async()=>{if(!o||o!=null&&o.error){console.error("No valid router data available");return}try{c(!0);const d=o==null?void 0:o.userOp;if(!d){console.error("No userOperation found in routerData");return}console.log("Signing userOperation:",d);const h=wU({userOperation:d,entryPointAddress:cK,entryPointVersion:"0.7",chainId:n});console.log("Signing userOpHash:",h);const g=await s({account:a,message:{raw:h}}),b={...d,signature:g};console.log("signedUserOp",JSON.stringify(b)),e(b),t(4)}catch(d){console.error("Failed to sign userOperation:",d)}finally{c(!1)}};return k.jsxs(gr,{children:[k.jsxs(ro,{flexDirection:"column",gap:"16px",alignItems:"center",width:"100%",children:[k.jsx(io,{loading:r,width:r?"156px":"auto",children:k.jsx(ph,{readOnly:!0,marginY:"8px",variant:"text",placeholder:"$10.00",value:i})}),k.jsx(Oh,{})]}),k.jsx(Ih,{}),k.jsx(Fn,{disabled:!!(o!=null&&o.message)||r||l,loading:r||l,onClick:u,children:r?"Loading quote":l?"Signing...":"Sign Transaction"})]})},gK=({selectedToken:t,userOp:e,setStep:n})=>{const{meshAccessToken:r,amountIn:i,chainIdOut:o}=Qe(),{address:s}=Xe.useAccount(),{tokenInData:a}=Jr(),[l,c]=J.useState(!0);return J.useEffect(()=>{if(!t||!e||!r){console.error("Missing required data for withdrawal initiation");return}const u=a!=null&&a.decimals?Number(i)/10**a.decimals:0;(async()=>{try{const h=[{networkId:uK(o),symbol:t.symbol,address:e.sender,amount:u}];console.log("link request body",{restrictMultipleAccounts:!0,userId:s,integrationId:wb,transferOptions:{toAddresses:h}});const p=await(await fetch(`${Gp}/linktoken`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({restrictMultipleAccounts:!0,userId:s,integrationId:wb,transferOptions:{toAddresses:h}})})).json();console.log("Link token response:",p);const w=r.accountTokens.map(O=>({...O,accountId:O.account.accountId,accountName:O.account.accountName,brokerName:"Binance",brokerType:"binanceInternationalDirect"}));console.log("accessTokens",w);const S=tO({clientId:s,accessTokens:w,onIntegrationConnected:O=>{console.log("Integration connected",O)},onTransferFinished:O=>{console.log("Transfer finished:",O),c(!1)},onExit:O=>{console.log("Mesh link exited:",O),c(!1),n(1)},onEvent:O=>{console.log("Mesh event:",O),O.type==="transferExecuted"&&(console.log("Transfer executed, closing mesh link and moving to TrackUserOp step"),S.closeLink(),n(5))}});S.openLink(p.content.linkToken)}catch(h){console.error("Failed to fetch link token:",h),c(!1)}})()},[t,e]),k.jsx(gr,{children:k.jsx(sh,{children:k.jsx(Ge,{mt:4,children:l?k.jsxs(ro,{alignItems:"center",gap:2,children:[k.jsx(oh,{m:5}),k.jsx(Ge,{children:"Intiating Mesh"})]}):"Transfer completed"})})})},mK=({selectedToken:t,userOp:e,setStep:n})=>{const{chainIdIn:r,tokenInData:i}=Jr(),{amountIn:o}=Qe(),[s,a]=J.useState(null),[l,c]=J.useState("sending"),[u,d]=J.useState("Sending operation to tracker..."),[h,g]=J.useState(!1),[b,p]=J.useState(null);J.useEffect(()=>{(async()=>{if(!t||!e||!i){console.error("Missing required data for tracking"),c("failed"),d("Missing required data");return}try{const q=await(await fetch("https://alpha-scanners-dev-054573dc8549.herokuapp.com/operations",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({userOperationData:{sender:e.sender,nonce:e.nonce,factory:e.factory,factoryData:e.factoryData,callData:e.callData,callGasLimit:e.callGasLimit,verificationGasLimit:e.verificationGasLimit,preVerificationGas:e.preVerificationGas,maxFeePerGas:e.maxFeePerGas,maxPriorityFeePerGas:e.maxPriorityFeePerGas,paymaster:e.paymaster,paymasterData:e.paymasterData,paymasterVerificationGasLimit:e.paymasterVerificationGasLimit,paymasterPostOpGasLimit:e.paymasterPostOpGasLimit,signature:e.signature},chainId:r,expectedBalance:o,tokenAddress:i.address})})).json();if(console.log("Operation tracking response:",q),q.success&&q.operationId)a(q.operationId),c("tracking"),d("Tracking operation progress...");else throw new Error(q.message||"Failed to send operation to tracker")}catch(j){console.error("Failed to send operation to tracker:",j),c("failed"),d("Failed to send operation to tracker")}})()},[]),J.useEffect(()=>{if(!s||l!=="tracking")return;const j=setInterval(async()=>{var q,G;try{const V=await(await fetch(`https://alpha-scanners-dev-054573dc8549.herokuapp.com/operations/${s}/status`)).json();console.log("Operation status:",V),((q=V.operation)==null?void 0:q.status)==="completed"?(c("completed"),d("Operation completed successfully!"),b&&(clearInterval(b),p(null))):((G=V.operation)==null?void 0:G.status)==="failed"&&(c("failed"),d("Operation failed"),b&&(clearInterval(b),p(null)))}catch(L){console.error("Failed to fetch operation status:",L)}},3e3);return p(j),()=>{j&&clearInterval(j)}},[s]);const w=()=>{g(!0)},S=()=>{switch(l){case"completed":return"#14AE5C";case"failed":return"#E84142";default:return"#1E171F"}},O=()=>{switch(l){case"sending":case"tracking":return k.jsx(tS,{start:l==="tracking",onFinish:w,duration:120});case"completed":return k.jsx(ye,{display:"flex",flexDirection:"column",alignItems:"center",children:k.jsx(pr,{src:nS,boxShadow:"0px 0px 20px #14AE5C",borderRadius:"90%",width:"58px",height:"58px"})});case"failed":return k.jsx(ye,{display:"flex",flexDirection:"column",alignItems:"center",children:k.jsx(pr,{src:rS,boxShadow:"0px 0px 20px #E84142",borderRadius:"90%",width:"58px",height:"58px"})})}},T=()=>l==="tracking"&&h?k.jsxs(ye,{display:"flex",flexDirection:"column",alignItems:"center",marginTop:"16px",textAlign:"center",children:[k.jsx(Ge,{fontSize:"lg",fontWeight:"semibold",color:"fg",marginBottom:"8px",children:u}),k.jsx(Ge,{fontSize:"sm",color:"fg.muted",maxWidth:"280px",children:"Your operation is being processed – no action is required from you."})]}):null,$=()=>{switch(l){case"completed":return"Success";case"failed":return"Failed";case"tracking":return"Processing";case"sending":return"Sending";default:return"Unknown"}};return k.jsxs(gr,{children:[k.jsxs(ye,{display:"flex",flexDirection:"column",paddingBottom:"16px",alignItems:"center",width:"100%",children:[O(),T()]}),k.jsx(lh,{size:"sm",variant:"outline",width:"100%",children:k.jsxs(ch,{children:[k.jsxs(so,{children:[k.jsx(ln,{children:"Status"}),k.jsx(ln,{display:"flex",textAlign:"end",justifyContent:"end",children:k.jsx(Ge,{color:S(),children:$()})})]}),s&&k.jsxs(so,{children:[k.jsx(ln,{children:"Operation ID"}),k.jsx(ln,{display:"flex",textAlign:"end",justifyContent:"end",children:k.jsx(Ge,{fontSize:"sm",color:"fg.muted",children:s})})]})]})},"status"),k.jsx(Oh,{}),k.jsx(Ih,{}),(l==="completed"||l==="failed")&&k.jsx(Fn,{onClick:()=>n(0),visual:"solid",children:l==="completed"?"New Deposit":"Retry Deposit"})]})},yK=()=>{const{handleClose:t,setFlow:e,setStep:n}=J.useContext(Ba),[r,i]=J.useState(0),[o,s]=J.useState(null),[a,l]=J.useState(null),{chainIdOut:c}=Qe(),u=Qe(S=>S.setIsCheckout),d=Qe(S=>S.setChainIdIn),h=Xe.useChainId(),{switchChain:g}=Xe.useSwitchChain(),b=h!==c,p=S=>{s(S),console.log("Selected token:",S)};J.useEffect(()=>{d(c),u(!0)},[c]);const w=(()=>{switch(r){case 0:return k.jsx(dK,{setStep:i});case 1:return k.jsx(fK,{setStep:i,onTokenSelect:p});case 2:return k.jsx(hK,{setStep:i,selectedToken:o});case 3:return k.jsx(pK,{setStep:i,setUserOp:l});case 4:return k.jsx(gK,{selectedToken:o,userOp:a,setStep:i});case 5:return k.jsx(mK,{selectedToken:o,userOp:a,setStep:i});default:return null}})();return k.jsxs(k.Fragment,{children:[k.jsx(_n.Header,{children:k.jsxs(Du,{children:[k.jsx(er,{minWidth:"16px",minHeight:"16px",maxWidth:"16px",onClick:()=>{const S=nO.findIndex(O=>O===r)-1;S>0?i(nO[S]):(e(""),n(""))},children:k.jsx(Lt,{as:Vu,color:"gray",width:"16px",height:"16px"})}),k.jsx(ye,{display:"flex",flexDirection:"column",gap:"4px",alignItems:"center",width:"100%",children:k.jsx(qo,{children:"Deposit from Binance"})}),t&&k.jsx(er,{onClick:t,minWidth:"16px",minHeight:"16px",maxWidth:"16px",marginLeft:"auto",children:k.jsx(Lt,{as:ta,color:"gray",width:"16px",height:"16px"})})]})}),k.jsx(_n.Body,{children:b?k.jsx(gr,{children:k.jsxs(ye,{display:"flex",flexDirection:"column",alignItems:"center",gap:"16px",textAlign:"center",children:[k.jsx(Ge,{fontSize:"16px",fontWeight:"600",children:"Wrong Network"}),k.jsxs(Ge,{fontSize:"14px",color:"fg.muted",children:["Please switch to ",kh(c)," to continue with your Binance withdrawal."]}),k.jsxs(Fn,{onClick:()=>{g({chainId:c})},children:["Switch to ",kh(c)]})]})}):w})]})},bK={mainFlow:{steps:{selectToken:k.jsx(Wz,{}),selectAmount:k.jsx(Xz,{}),quote:k.jsx(nU,{}),confirmTransfer:k.jsx(yU,{})}},exchangeFlow:{steps:{connectExchange:k.jsx(yK,{})}}},Ba=J.createContext({}),oO=({config:{apiKey:t,tokenOut:e,chainIdOut:n,theme:r,enableExchange:i},onClose:o,wrapper:s})=>{const[a,l]=J.useState(""),[c,u]=J.useState(""),d=Qe(w=>w.setEnsoApiToken),h=Qe(w=>w.setTokenOut),g=Qe(w=>w.setChainIdOut),b=J.useMemo(()=>o?()=>{o&&o(),l(""),u("")}:void 0,[o]);J.useEffect(()=>{h(e),g(n)},[e,n]),J.useEffect(()=>{d(t)},[t]);const p=J.useMemo(()=>s!=null?s:({children:w,...S})=>k.jsx(ye,{p:4,w:"374px",...S,children:w}),[s]);return k.jsx(Ba.Provider,{value:{step:a,setStep:l,flow:c,setFlow:u,handleClose:b,enableExchanges:i},children:k.jsx(eV,{themeConfig:r,children:k.jsxs(p,{children:[k.jsx(gU,{}),!c&&!a?k.jsx(Hz,{}):bK[c].steps[a]]})})})},vK=({config:t,setIsActive:e,isActive:n,onClose:r})=>{const i=J.useCallback(()=>{e(!1),r==null||r()},[e,r]);return n?k.jsx(oO,{wrapper:_n,config:t,onClose:i}):null};_e.Checkout=oO,_e.CheckoutModal=vK,Object.defineProperty(_e,Symbol.toStringTag,{value:"Module"})});
203
+ //# sourceMappingURL=checkout-widget.umd.js.map