@dcl/auth-site 0.1.3-7359390835.commit-b3d936d → 0.1.3-7378840092.commit-24eec55

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.
@@ -0,0 +1,28 @@
1
+ import{e as au,r as uu,c as te,s as Q0,B as ye,b as Te,g as si,_ as G,a as Us,d as Y0}from"./index-ae5690b8.js";function K0(t,e){for(var r=0;r<e.length;r++){const n=e[r];if(typeof n!="string"&&!Array.isArray(n)){for(const i in n)if(i!=="default"&&!(i in t)){const s=Object.getOwnPropertyDescriptor(n,i);s&&Object.defineProperty(t,i,s.get?s:{enumerable:!0,get:()=>n[i]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}var cu={},Ti={},Hs={};Object.defineProperty(Hs,"__esModule",{value:!0});Hs.walletLogo=void 0;const X0=(t,e)=>{let r;switch(t){case"standard":return r=e,`data:image/svg+xml,%3Csvg width='${e}' height='${r}' viewBox='0 0 1024 1024' fill='none' xmlns='http://www.w3.org/2000/svg'%3E %3Crect width='1024' height='1024' fill='%230052FF'/%3E %3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M152 512C152 710.823 313.177 872 512 872C710.823 872 872 710.823 872 512C872 313.177 710.823 152 512 152C313.177 152 152 313.177 152 512ZM420 396C406.745 396 396 406.745 396 420V604C396 617.255 406.745 628 420 628H604C617.255 628 628 617.255 628 604V420C628 406.745 617.255 396 604 396H420Z' fill='white'/%3E %3C/svg%3E `;case"circle":return r=e,`data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='${e}' height='${r}' viewBox='0 0 999.81 999.81'%3E%3Cdefs%3E%3Cstyle%3E.cls-1%7Bfill:%230052fe;%7D.cls-2%7Bfill:%23fefefe;%7D.cls-3%7Bfill:%230152fe;%7D%3C/style%3E%3C/defs%3E%3Cpath class='cls-1' d='M655-115.9h56c.83,1.59,2.36.88,3.56,1a478,478,0,0,1,75.06,10.42C891.4-81.76,978.33-32.58,1049.19,44q116.7,126,131.94,297.61c.38,4.14-.34,8.53,1.78,12.45v59c-1.58.84-.91,2.35-1,3.56a482.05,482.05,0,0,1-10.38,74.05c-24,106.72-76.64,196.76-158.83,268.93s-178.18,112.82-287.2,122.6c-4.83.43-9.86-.25-14.51,1.77H654c-1-1.68-2.69-.91-4.06-1a496.89,496.89,0,0,1-105.9-18.59c-93.54-27.42-172.78-77.59-236.91-150.94Q199.34,590.1,184.87,426.58c-.47-5.19.25-10.56-1.77-15.59V355c1.68-1,.91-2.7,1-4.06a498.12,498.12,0,0,1,18.58-105.9c26-88.75,72.64-164.9,140.6-227.57q126-116.27,297.21-131.61C645.32-114.57,650.35-113.88,655-115.9Zm377.92,500c0-192.44-156.31-349.49-347.56-350.15-194.13-.68-350.94,155.13-352.29,347.42-1.37,194.55,155.51,352.1,348.56,352.47C876.15,734.23,1032.93,577.84,1032.93,384.11Z' transform='translate(-183.1 115.9)'/%3E%3Cpath class='cls-2' d='M1032.93,384.11c0,193.73-156.78,350.12-351.29,349.74-193-.37-349.93-157.92-348.56-352.47C334.43,189.09,491.24,33.28,685.37,34,876.62,34.62,1032.94,191.67,1032.93,384.11ZM683,496.81q43.74,0,87.48,0c15.55,0,25.32-9.72,25.33-25.21q0-87.48,0-175c0-15.83-9.68-25.46-25.59-25.46H595.77c-15.88,0-25.57,9.64-25.58,25.46q0,87.23,0,174.45c0,16.18,9.59,25.7,25.84,25.71Z' transform='translate(-183.1 115.9)'/%3E%3Cpath class='cls-3' d='M683,496.81H596c-16.25,0-25.84-9.53-25.84-25.71q0-87.23,0-174.45c0-15.82,9.7-25.46,25.58-25.46H770.22c15.91,0,25.59,9.63,25.59,25.46q0,87.47,0,175c0,15.49-9.78,25.2-25.33,25.21Q726.74,496.84,683,496.81Z' transform='translate(-183.1 115.9)'/%3E%3C/svg%3E`;case"text":return r=(.1*e).toFixed(2),`data:image/svg+xml,%3Csvg width='${e}' height='${r}' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 528.15 53.64'%3E%3Cdefs%3E%3Cstyle%3E.cls-1%7Bfill:%230052ff;%7D%3C/style%3E%3C/defs%3E%3Ctitle%3ECoinbase_Wordmark_SubBrands_ALL%3C/title%3E%3Cpath class='cls-1' d='M164.45,15a15,15,0,0,0-11.74,5.4V0h-8.64V52.92h8.5V48a15,15,0,0,0,11.88,5.62c10.37,0,18.21-8.21,18.21-19.3S174.67,15,164.45,15Zm-1.3,30.67c-6.19,0-10.73-4.83-10.73-11.31S157,23,163.22,23s10.66,4.82,10.66,11.37S169.34,45.65,163.15,45.65Zm83.31-14.91-6.34-.93c-3-.43-5.18-1.44-5.18-3.82,0-2.59,2.8-3.89,6.62-3.89,4.18,0,6.84,1.8,7.42,4.76h8.35c-.94-7.49-6.7-11.88-15.55-11.88-9.15,0-15.2,4.68-15.2,11.3,0,6.34,4,10,12,11.16l6.33.94c3.1.43,4.83,1.65,4.83,4,0,2.95-3,4.17-7.2,4.17-5.12,0-8-2.09-8.43-5.25h-8.49c.79,7.27,6.48,12.38,16.84,12.38,9.44,0,15.7-4.32,15.7-11.74C258.12,35.28,253.58,31.82,246.46,30.74Zm-27.65-2.3c0-8.06-4.9-13.46-15.27-13.46-9.79,0-15.26,5-16.34,12.6h8.57c.43-3,2.73-5.4,7.63-5.4,4.39,0,6.55,1.94,6.55,4.32,0,3.09-4,3.88-8.85,4.39-6.63.72-14.84,3-14.84,11.66,0,6.7,5,11,12.89,11,6.19,0,10.08-2.59,12-6.7.28,3.67,3,6.05,6.84,6.05h5v-7.7h-4.25Zm-8.5,9.36c0,5-4.32,8.64-9.57,8.64-3.24,0-6-1.37-6-4.25,0-3.67,4.39-4.68,8.42-5.11s6-1.22,7.13-2.88ZM281.09,15c-11.09,0-19.23,8.35-19.23,19.36,0,11.6,8.72,19.3,19.37,19.3,9,0,16.06-5.33,17.86-12.89h-9c-1.3,3.31-4.47,5.19-8.71,5.19-5.55,0-9.72-3.46-10.66-9.51H299.3V33.12C299.3,22.46,291.53,15,281.09,15Zm-9.87,15.26c1.37-5.18,5.26-7.7,9.72-7.7,4.9,0,8.64,2.8,9.51,7.7ZM19.3,23a9.84,9.84,0,0,1,9.5,7h9.14c-1.65-8.93-9-15-18.57-15A19,19,0,0,0,0,34.34c0,11.09,8.28,19.3,19.37,19.3,9.36,0,16.85-6,18.5-15H28.8a9.75,9.75,0,0,1-9.43,7.06c-6.27,0-10.66-4.83-10.66-11.31S13,23,19.3,23Zm41.11-8A19,19,0,0,0,41,34.34c0,11.09,8.28,19.3,19.37,19.3A19,19,0,0,0,79.92,34.27C79.92,23.33,71.64,15,60.41,15Zm.07,30.67c-6.19,0-10.73-4.83-10.73-11.31S54.22,23,60.41,23s10.8,4.89,10.8,11.37S66.67,45.65,60.48,45.65ZM123.41,15c-5.62,0-9.29,2.3-11.45,5.54V15.7h-8.57V52.92H112V32.69C112,27,115.63,23,121,23c5,0,8.06,3.53,8.06,8.64V52.92h8.64V31C137.66,21.6,132.84,15,123.41,15ZM92,.36a5.36,5.36,0,0,0-5.55,5.47,5.55,5.55,0,0,0,11.09,0A5.35,5.35,0,0,0,92,.36Zm-9.72,23h5.4V52.92h8.64V15.7h-14Zm298.17-7.7L366.2,52.92H372L375.29,44H392l3.33,8.88h6L386.87,15.7ZM377,39.23l6.45-17.56h.1l6.56,17.56ZM362.66,15.7l-7.88,29h-.11l-8.14-29H341l-8,28.93h-.1l-8-28.87H319L329.82,53h5.45l8.19-29.24h.11L352,53h5.66L368.1,15.7Zm135.25,0v4.86h12.32V52.92h5.6V20.56h12.32V15.7ZM467.82,52.92h25.54V48.06H473.43v-12h18.35V31.35H473.43V20.56h19.93V15.7H467.82ZM443,15.7h-5.6V52.92h24.32V48.06H443Zm-30.45,0h-5.61V52.92h24.32V48.06H412.52Z'/%3E%3C/svg%3E`;case"textWithLogo":return r=(.25*e).toFixed(2),`data:image/svg+xml,%3Csvg width='${e}' height='${r}' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 308.44 77.61'%3E%3Cdefs%3E%3Cstyle%3E.cls-1%7Bfill:%230052ff;%7D%3C/style%3E%3C/defs%3E%3Cpath class='cls-1' d='M142.94,20.2l-7.88,29H135l-8.15-29h-5.55l-8,28.93h-.11l-8-28.87H99.27l10.84,37.27h5.44l8.2-29.24h.1l8.41,29.24h5.66L148.39,20.2Zm17.82,0L146.48,57.42h5.82l3.28-8.88h16.65l3.34,8.88h6L167.16,20.2Zm-3.44,23.52,6.45-17.55h.11l6.56,17.55ZM278.2,20.2v4.86h12.32V57.42h5.6V25.06h12.32V20.2ZM248.11,57.42h25.54V52.55H253.71V40.61h18.35V35.85H253.71V25.06h19.94V20.2H248.11ZM223.26,20.2h-5.61V57.42H242V52.55H223.26Zm-30.46,0h-5.6V57.42h24.32V52.55H192.8Zm-154,38A19.41,19.41,0,1,1,57.92,35.57H77.47a38.81,38.81,0,1,0,0,6.47H57.92A19.39,19.39,0,0,1,38.81,58.21Z'/%3E%3C/svg%3E`;case"textLight":return r=(.1*e).toFixed(2),`data:image/svg+xml,%3Csvg width='${e}' height='${r}' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 528.15 53.64'%3E%3Cdefs%3E%3Cstyle%3E.cls-1%7Bfill:%23fefefe;%7D%3C/style%3E%3C/defs%3E%3Ctitle%3ECoinbase_Wordmark_SubBrands_ALL%3C/title%3E%3Cpath class='cls-1' d='M164.45,15a15,15,0,0,0-11.74,5.4V0h-8.64V52.92h8.5V48a15,15,0,0,0,11.88,5.62c10.37,0,18.21-8.21,18.21-19.3S174.67,15,164.45,15Zm-1.3,30.67c-6.19,0-10.73-4.83-10.73-11.31S157,23,163.22,23s10.66,4.82,10.66,11.37S169.34,45.65,163.15,45.65Zm83.31-14.91-6.34-.93c-3-.43-5.18-1.44-5.18-3.82,0-2.59,2.8-3.89,6.62-3.89,4.18,0,6.84,1.8,7.42,4.76h8.35c-.94-7.49-6.7-11.88-15.55-11.88-9.15,0-15.2,4.68-15.2,11.3,0,6.34,4,10,12,11.16l6.33.94c3.1.43,4.83,1.65,4.83,4,0,2.95-3,4.17-7.2,4.17-5.12,0-8-2.09-8.43-5.25h-8.49c.79,7.27,6.48,12.38,16.84,12.38,9.44,0,15.7-4.32,15.7-11.74C258.12,35.28,253.58,31.82,246.46,30.74Zm-27.65-2.3c0-8.06-4.9-13.46-15.27-13.46-9.79,0-15.26,5-16.34,12.6h8.57c.43-3,2.73-5.4,7.63-5.4,4.39,0,6.55,1.94,6.55,4.32,0,3.09-4,3.88-8.85,4.39-6.63.72-14.84,3-14.84,11.66,0,6.7,5,11,12.89,11,6.19,0,10.08-2.59,12-6.7.28,3.67,3,6.05,6.84,6.05h5v-7.7h-4.25Zm-8.5,9.36c0,5-4.32,8.64-9.57,8.64-3.24,0-6-1.37-6-4.25,0-3.67,4.39-4.68,8.42-5.11s6-1.22,7.13-2.88ZM281.09,15c-11.09,0-19.23,8.35-19.23,19.36,0,11.6,8.72,19.3,19.37,19.3,9,0,16.06-5.33,17.86-12.89h-9c-1.3,3.31-4.47,5.19-8.71,5.19-5.55,0-9.72-3.46-10.66-9.51H299.3V33.12C299.3,22.46,291.53,15,281.09,15Zm-9.87,15.26c1.37-5.18,5.26-7.7,9.72-7.7,4.9,0,8.64,2.8,9.51,7.7ZM19.3,23a9.84,9.84,0,0,1,9.5,7h9.14c-1.65-8.93-9-15-18.57-15A19,19,0,0,0,0,34.34c0,11.09,8.28,19.3,19.37,19.3,9.36,0,16.85-6,18.5-15H28.8a9.75,9.75,0,0,1-9.43,7.06c-6.27,0-10.66-4.83-10.66-11.31S13,23,19.3,23Zm41.11-8A19,19,0,0,0,41,34.34c0,11.09,8.28,19.3,19.37,19.3A19,19,0,0,0,79.92,34.27C79.92,23.33,71.64,15,60.41,15Zm.07,30.67c-6.19,0-10.73-4.83-10.73-11.31S54.22,23,60.41,23s10.8,4.89,10.8,11.37S66.67,45.65,60.48,45.65ZM123.41,15c-5.62,0-9.29,2.3-11.45,5.54V15.7h-8.57V52.92H112V32.69C112,27,115.63,23,121,23c5,0,8.06,3.53,8.06,8.64V52.92h8.64V31C137.66,21.6,132.84,15,123.41,15ZM92,.36a5.36,5.36,0,0,0-5.55,5.47,5.55,5.55,0,0,0,11.09,0A5.35,5.35,0,0,0,92,.36Zm-9.72,23h5.4V52.92h8.64V15.7h-14Zm298.17-7.7L366.2,52.92H372L375.29,44H392l3.33,8.88h6L386.87,15.7ZM377,39.23l6.45-17.56h.1l6.56,17.56ZM362.66,15.7l-7.88,29h-.11l-8.14-29H341l-8,28.93h-.1l-8-28.87H319L329.82,53h5.45l8.19-29.24h.11L352,53h5.66L368.1,15.7Zm135.25,0v4.86h12.32V52.92h5.6V20.56h12.32V15.7ZM467.82,52.92h25.54V48.06H473.43v-12h18.35V31.35H473.43V20.56h19.93V15.7H467.82ZM443,15.7h-5.6V52.92h24.32V48.06H443Zm-30.45,0h-5.61V52.92h24.32V48.06H412.52Z'/%3E%3C/svg%3E`;case"textWithLogoLight":return r=(.25*e).toFixed(2),`data:image/svg+xml,%3Csvg width='${e}' height='${r}' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 308.44 77.61'%3E%3Cdefs%3E%3Cstyle%3E.cls-1%7Bfill:%23fefefe;%7D%3C/style%3E%3C/defs%3E%3Cpath class='cls-1' d='M142.94,20.2l-7.88,29H135l-8.15-29h-5.55l-8,28.93h-.11l-8-28.87H99.27l10.84,37.27h5.44l8.2-29.24h.1l8.41,29.24h5.66L148.39,20.2Zm17.82,0L146.48,57.42h5.82l3.28-8.88h16.65l3.34,8.88h6L167.16,20.2Zm-3.44,23.52,6.45-17.55h.11l6.56,17.55ZM278.2,20.2v4.86h12.32V57.42h5.6V25.06h12.32V20.2ZM248.11,57.42h25.54V52.55H253.71V40.61h18.35V35.85H253.71V25.06h19.94V20.2H248.11ZM223.26,20.2h-5.61V57.42H242V52.55H223.26Zm-30.46,0h-5.6V57.42h24.32V52.55H192.8Zm-154,38A19.41,19.41,0,1,1,57.92,35.57H77.47a38.81,38.81,0,1,0,0,6.47H57.92A19.39,19.39,0,0,1,38.81,58.21Z'/%3E%3C/svg%3E`;default:return r=e,`data:image/svg+xml,%3Csvg width='${e}' height='${r}' viewBox='0 0 1024 1024' fill='none' xmlns='http://www.w3.org/2000/svg'%3E %3Crect width='1024' height='1024' fill='%230052FF'/%3E %3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M152 512C152 710.823 313.177 872 512 872C710.823 872 872 710.823 872 512C872 313.177 710.823 152 512 152C313.177 152 152 313.177 152 512ZM420 396C406.745 396 396 406.745 396 420V604C396 617.255 406.745 628 420 628H604C617.255 628 628 617.255 628 604V420C628 406.745 617.255 396 604 396H420Z' fill='white'/%3E %3C/svg%3E `}};Hs.walletLogo=X0;var Ws={};Object.defineProperty(Ws,"__esModule",{value:!0});Ws.LINK_API_URL=void 0;Ws.LINK_API_URL="https://www.walletlink.org";var Vs={};Object.defineProperty(Vs,"__esModule",{value:!0});Vs.ScopedLocalStorage=void 0;class ep{constructor(e){this.scope=e}setItem(e,r){localStorage.setItem(this.scopedKey(e),r)}getItem(e){return localStorage.getItem(this.scopedKey(e))}removeItem(e){localStorage.removeItem(this.scopedKey(e))}clear(){const e=this.scopedKey(""),r=[];for(let n=0;n<localStorage.length;n++){const i=localStorage.key(n);typeof i=="string"&&i.startsWith(e)&&r.push(i)}r.forEach(n=>localStorage.removeItem(n))}scopedKey(e){return`${this.scope}:${e}`}}Vs.ScopedLocalStorage=ep;var zn={},pn={};Object.defineProperty(pn,"__esModule",{value:!0});const tp=au;function vc(t,e,r){try{Reflect.apply(t,e,r)}catch(n){setTimeout(()=>{throw n})}}function rp(t){const e=t.length,r=new Array(e);for(let n=0;n<e;n+=1)r[n]=t[n];return r}let np=class extends tp.EventEmitter{emit(e,...r){let n=e==="error";const i=this._events;if(i!==void 0)n=n&&i.error===void 0;else if(!n)return!1;if(n){let o;if(r.length>0&&([o]=r),o instanceof Error)throw o;const a=new Error(`Unhandled error.${o?` (${o.message})`:""}`);throw a.context=o,a}const s=i[e];if(s===void 0)return!1;if(typeof s=="function")vc(s,this,r);else{const o=s.length,a=rp(s);for(let c=0;c<o;c+=1)vc(a[c],this,r)}return!0}};pn.default=np;var lu={exports:{}};lu.exports;(function(t){(function(e,r){function n(w,u){if(!w)throw new Error(u||"Assertion failed")}function i(w,u){w.super_=u;var b=function(){};b.prototype=u.prototype,w.prototype=new b,w.prototype.constructor=w}function s(w,u,b){if(s.isBN(w))return w;this.negative=0,this.words=null,this.length=0,this.red=null,w!==null&&((u==="le"||u==="be")&&(b=u,u=10),this._init(w||0,u||10,b||"be"))}typeof e=="object"?e.exports=s:r.BN=s,s.BN=s,s.wordSize=26;var o;try{typeof window<"u"&&typeof window.Buffer<"u"?o=window.Buffer:o=uu.Buffer}catch{}s.isBN=function(u){return u instanceof s?!0:u!==null&&typeof u=="object"&&u.constructor.wordSize===s.wordSize&&Array.isArray(u.words)},s.max=function(u,b){return u.cmp(b)>0?u:b},s.min=function(u,b){return u.cmp(b)<0?u:b},s.prototype._init=function(u,b,m){if(typeof u=="number")return this._initNumber(u,b,m);if(typeof u=="object")return this._initArray(u,b,m);b==="hex"&&(b=16),n(b===(b|0)&&b>=2&&b<=36),u=u.toString().replace(/\s+/g,"");var E=0;u[0]==="-"&&(E++,this.negative=1),E<u.length&&(b===16?this._parseHex(u,E,m):(this._parseBase(u,b,E),m==="le"&&this._initArray(this.toArray(),b,m)))},s.prototype._initNumber=function(u,b,m){u<0&&(this.negative=1,u=-u),u<67108864?(this.words=[u&67108863],this.length=1):u<4503599627370496?(this.words=[u&67108863,u/67108864&67108863],this.length=2):(n(u<9007199254740992),this.words=[u&67108863,u/67108864&67108863,1],this.length=3),m==="le"&&this._initArray(this.toArray(),b,m)},s.prototype._initArray=function(u,b,m){if(n(typeof u.length=="number"),u.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(u.length/3),this.words=new Array(this.length);for(var E=0;E<this.length;E++)this.words[E]=0;var S,k,L=0;if(m==="be")for(E=u.length-1,S=0;E>=0;E-=3)k=u[E]|u[E-1]<<8|u[E-2]<<16,this.words[S]|=k<<L&67108863,this.words[S+1]=k>>>26-L&67108863,L+=24,L>=26&&(L-=26,S++);else if(m==="le")for(E=0,S=0;E<u.length;E+=3)k=u[E]|u[E+1]<<8|u[E+2]<<16,this.words[S]|=k<<L&67108863,this.words[S+1]=k>>>26-L&67108863,L+=24,L>=26&&(L-=26,S++);return this._strip()};function a(w,u){var b=w.charCodeAt(u);if(b>=48&&b<=57)return b-48;if(b>=65&&b<=70)return b-55;if(b>=97&&b<=102)return b-87;n(!1,"Invalid character in "+w)}function c(w,u,b){var m=a(w,b);return b-1>=u&&(m|=a(w,b-1)<<4),m}s.prototype._parseHex=function(u,b,m){this.length=Math.ceil((u.length-b)/6),this.words=new Array(this.length);for(var E=0;E<this.length;E++)this.words[E]=0;var S=0,k=0,L;if(m==="be")for(E=u.length-1;E>=b;E-=2)L=c(u,b,E)<<S,this.words[k]|=L&67108863,S>=18?(S-=18,k+=1,this.words[k]|=L>>>26):S+=8;else{var _=u.length-b;for(E=_%2===0?b+1:b;E<u.length;E+=2)L=c(u,b,E)<<S,this.words[k]|=L&67108863,S>=18?(S-=18,k+=1,this.words[k]|=L>>>26):S+=8}this._strip()};function l(w,u,b,m){for(var E=0,S=0,k=Math.min(w.length,b),L=u;L<k;L++){var _=w.charCodeAt(L)-48;E*=m,_>=49?S=_-49+10:_>=17?S=_-17+10:S=_,n(_>=0&&S<m,"Invalid character"),E+=S}return E}s.prototype._parseBase=function(u,b,m){this.words=[0],this.length=1;for(var E=0,S=1;S<=67108863;S*=b)E++;E--,S=S/b|0;for(var k=u.length-m,L=k%E,_=Math.min(k,k-L)+m,d=0,A=m;A<_;A+=E)d=l(u,A,A+E,b),this.imuln(S),this.words[0]+d<67108864?this.words[0]+=d:this._iaddn(d);if(L!==0){var Y=1;for(d=l(u,A,u.length,b),A=0;A<L;A++)Y*=b;this.imuln(Y),this.words[0]+d<67108864?this.words[0]+=d:this._iaddn(d)}this._strip()},s.prototype.copy=function(u){u.words=new Array(this.length);for(var b=0;b<this.length;b++)u.words[b]=this.words[b];u.length=this.length,u.negative=this.negative,u.red=this.red};function p(w,u){w.words=u.words,w.length=u.length,w.negative=u.negative,w.red=u.red}if(s.prototype._move=function(u){p(u,this)},s.prototype.clone=function(){var u=new s(null);return this.copy(u),u},s.prototype._expand=function(u){for(;this.length<u;)this.words[this.length++]=0;return this},s.prototype._strip=function(){for(;this.length>1&&this.words[this.length-1]===0;)this.length--;return this._normSign()},s.prototype._normSign=function(){return this.length===1&&this.words[0]===0&&(this.negative=0),this},typeof Symbol<"u"&&typeof Symbol.for=="function")try{s.prototype[Symbol.for("nodejs.util.inspect.custom")]=g}catch{s.prototype.inspect=g}else s.prototype.inspect=g;function g(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"}var y=["","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"],I=[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],T=[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];s.prototype.toString=function(u,b){u=u||10,b=b|0||1;var m;if(u===16||u==="hex"){m="";for(var E=0,S=0,k=0;k<this.length;k++){var L=this.words[k],_=((L<<E|S)&16777215).toString(16);S=L>>>24-E&16777215,E+=2,E>=26&&(E-=26,k--),S!==0||k!==this.length-1?m=y[6-_.length]+_+m:m=_+m}for(S!==0&&(m=S.toString(16)+m);m.length%b!==0;)m="0"+m;return this.negative!==0&&(m="-"+m),m}if(u===(u|0)&&u>=2&&u<=36){var d=I[u],A=T[u];m="";var Y=this.clone();for(Y.negative=0;!Y.isZero();){var ee=Y.modrn(A).toString(u);Y=Y.idivn(A),Y.isZero()?m=ee+m:m=y[d-ee.length]+ee+m}for(this.isZero()&&(m="0"+m);m.length%b!==0;)m="0"+m;return this.negative!==0&&(m="-"+m),m}n(!1,"Base should be between 2 and 36")},s.prototype.toNumber=function(){var u=this.words[0];return this.length===2?u+=this.words[1]*67108864:this.length===3&&this.words[2]===1?u+=4503599627370496+this.words[1]*67108864:this.length>2&&n(!1,"Number can only safely store up to 53 bits"),this.negative!==0?-u:u},s.prototype.toJSON=function(){return this.toString(16,2)},o&&(s.prototype.toBuffer=function(u,b){return this.toArrayLike(o,u,b)}),s.prototype.toArray=function(u,b){return this.toArrayLike(Array,u,b)};var D=function(u,b){return u.allocUnsafe?u.allocUnsafe(b):new u(b)};s.prototype.toArrayLike=function(u,b,m){this._strip();var E=this.byteLength(),S=m||Math.max(1,E);n(E<=S,"byte array longer than desired length"),n(S>0,"Requested array length <= 0");var k=D(u,S),L=b==="le"?"LE":"BE";return this["_toArrayLike"+L](k,E),k},s.prototype._toArrayLikeLE=function(u,b){for(var m=0,E=0,S=0,k=0;S<this.length;S++){var L=this.words[S]<<k|E;u[m++]=L&255,m<u.length&&(u[m++]=L>>8&255),m<u.length&&(u[m++]=L>>16&255),k===6?(m<u.length&&(u[m++]=L>>24&255),E=0,k=0):(E=L>>>24,k+=2)}if(m<u.length)for(u[m++]=E;m<u.length;)u[m++]=0},s.prototype._toArrayLikeBE=function(u,b){for(var m=u.length-1,E=0,S=0,k=0;S<this.length;S++){var L=this.words[S]<<k|E;u[m--]=L&255,m>=0&&(u[m--]=L>>8&255),m>=0&&(u[m--]=L>>16&255),k===6?(m>=0&&(u[m--]=L>>24&255),E=0,k=0):(E=L>>>24,k+=2)}if(m>=0)for(u[m--]=E;m>=0;)u[m--]=0},Math.clz32?s.prototype._countBits=function(u){return 32-Math.clz32(u)}:s.prototype._countBits=function(u){var b=u,m=0;return b>=4096&&(m+=13,b>>>=13),b>=64&&(m+=7,b>>>=7),b>=8&&(m+=4,b>>>=4),b>=2&&(m+=2,b>>>=2),m+b},s.prototype._zeroBits=function(u){if(u===0)return 26;var b=u,m=0;return b&8191||(m+=13,b>>>=13),b&127||(m+=7,b>>>=7),b&15||(m+=4,b>>>=4),b&3||(m+=2,b>>>=2),b&1||m++,m},s.prototype.bitLength=function(){var u=this.words[this.length-1],b=this._countBits(u);return(this.length-1)*26+b};function U(w){for(var u=new Array(w.bitLength()),b=0;b<u.length;b++){var m=b/26|0,E=b%26;u[b]=w.words[m]>>>E&1}return u}s.prototype.zeroBits=function(){if(this.isZero())return 0;for(var u=0,b=0;b<this.length;b++){var m=this._zeroBits(this.words[b]);if(u+=m,m!==26)break}return u},s.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},s.prototype.toTwos=function(u){return this.negative!==0?this.abs().inotn(u).iaddn(1):this.clone()},s.prototype.fromTwos=function(u){return this.testn(u-1)?this.notn(u).iaddn(1).ineg():this.clone()},s.prototype.isNeg=function(){return this.negative!==0},s.prototype.neg=function(){return this.clone().ineg()},s.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},s.prototype.iuor=function(u){for(;this.length<u.length;)this.words[this.length++]=0;for(var b=0;b<u.length;b++)this.words[b]=this.words[b]|u.words[b];return this._strip()},s.prototype.ior=function(u){return n((this.negative|u.negative)===0),this.iuor(u)},s.prototype.or=function(u){return this.length>u.length?this.clone().ior(u):u.clone().ior(this)},s.prototype.uor=function(u){return this.length>u.length?this.clone().iuor(u):u.clone().iuor(this)},s.prototype.iuand=function(u){var b;this.length>u.length?b=u:b=this;for(var m=0;m<b.length;m++)this.words[m]=this.words[m]&u.words[m];return this.length=b.length,this._strip()},s.prototype.iand=function(u){return n((this.negative|u.negative)===0),this.iuand(u)},s.prototype.and=function(u){return this.length>u.length?this.clone().iand(u):u.clone().iand(this)},s.prototype.uand=function(u){return this.length>u.length?this.clone().iuand(u):u.clone().iuand(this)},s.prototype.iuxor=function(u){var b,m;this.length>u.length?(b=this,m=u):(b=u,m=this);for(var E=0;E<m.length;E++)this.words[E]=b.words[E]^m.words[E];if(this!==b)for(;E<b.length;E++)this.words[E]=b.words[E];return this.length=b.length,this._strip()},s.prototype.ixor=function(u){return n((this.negative|u.negative)===0),this.iuxor(u)},s.prototype.xor=function(u){return this.length>u.length?this.clone().ixor(u):u.clone().ixor(this)},s.prototype.uxor=function(u){return this.length>u.length?this.clone().iuxor(u):u.clone().iuxor(this)},s.prototype.inotn=function(u){n(typeof u=="number"&&u>=0);var b=Math.ceil(u/26)|0,m=u%26;this._expand(b),m>0&&b--;for(var E=0;E<b;E++)this.words[E]=~this.words[E]&67108863;return m>0&&(this.words[E]=~this.words[E]&67108863>>26-m),this._strip()},s.prototype.notn=function(u){return this.clone().inotn(u)},s.prototype.setn=function(u,b){n(typeof u=="number"&&u>=0);var m=u/26|0,E=u%26;return this._expand(m+1),b?this.words[m]=this.words[m]|1<<E:this.words[m]=this.words[m]&~(1<<E),this._strip()},s.prototype.iadd=function(u){var b;if(this.negative!==0&&u.negative===0)return this.negative=0,b=this.isub(u),this.negative^=1,this._normSign();if(this.negative===0&&u.negative!==0)return u.negative=0,b=this.isub(u),u.negative=1,b._normSign();var m,E;this.length>u.length?(m=this,E=u):(m=u,E=this);for(var S=0,k=0;k<E.length;k++)b=(m.words[k]|0)+(E.words[k]|0)+S,this.words[k]=b&67108863,S=b>>>26;for(;S!==0&&k<m.length;k++)b=(m.words[k]|0)+S,this.words[k]=b&67108863,S=b>>>26;if(this.length=m.length,S!==0)this.words[this.length]=S,this.length++;else if(m!==this)for(;k<m.length;k++)this.words[k]=m.words[k];return this},s.prototype.add=function(u){var b;return u.negative!==0&&this.negative===0?(u.negative=0,b=this.sub(u),u.negative^=1,b):u.negative===0&&this.negative!==0?(this.negative=0,b=u.sub(this),this.negative=1,b):this.length>u.length?this.clone().iadd(u):u.clone().iadd(this)},s.prototype.isub=function(u){if(u.negative!==0){u.negative=0;var b=this.iadd(u);return u.negative=1,b._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(u),this.negative=1,this._normSign();var m=this.cmp(u);if(m===0)return this.negative=0,this.length=1,this.words[0]=0,this;var E,S;m>0?(E=this,S=u):(E=u,S=this);for(var k=0,L=0;L<S.length;L++)b=(E.words[L]|0)-(S.words[L]|0)+k,k=b>>26,this.words[L]=b&67108863;for(;k!==0&&L<E.length;L++)b=(E.words[L]|0)+k,k=b>>26,this.words[L]=b&67108863;if(k===0&&L<E.length&&E!==this)for(;L<E.length;L++)this.words[L]=E.words[L];return this.length=Math.max(this.length,L),E!==this&&(this.negative=1),this._strip()},s.prototype.sub=function(u){return this.clone().isub(u)};function M(w,u,b){b.negative=u.negative^w.negative;var m=w.length+u.length|0;b.length=m,m=m-1|0;var E=w.words[0]|0,S=u.words[0]|0,k=E*S,L=k&67108863,_=k/67108864|0;b.words[0]=L;for(var d=1;d<m;d++){for(var A=_>>>26,Y=_&67108863,ee=Math.min(d,u.length-1),O=Math.max(0,d-w.length+1);O<=ee;O++){var P=d-O|0;E=w.words[P]|0,S=u.words[O]|0,k=E*S+Y,A+=k/67108864|0,Y=k&67108863}b.words[d]=Y|0,_=A|0}return _!==0?b.words[d]=_|0:b.length--,b._strip()}var N=function(u,b,m){var E=u.words,S=b.words,k=m.words,L=0,_,d,A,Y=E[0]|0,ee=Y&8191,O=Y>>>13,P=E[1]|0,V=P&8191,Q=P>>>13,ge=E[2]|0,C=ge&8191,R=ge>>>13,q=E[3]|0,Z=q&8191,he=q>>>13,be=E[4]|0,se=be&8191,xe=be>>>13,Bt=E[5]|0,ke=Bt&8191,Re=Bt>>>13,ct=E[6]|0,Ce=ct&8191,Ne=ct>>>13,ft=E[7]|0,Ie=ft&8191,v=ft>>>13,h=E[8]|0,f=h&8191,x=h>>>13,B=E[9]|0,$=B&8191,W=B>>>13,de=S[0]|0,fe=de&8191,ce=de>>>13,Oe=S[1]|0,ae=Oe&8191,De=Oe>>>13,En=S[2]|0,je=En&8191,$e=En>>>13,Sn=S[3]|0,Fe=Sn&8191,Ue=Sn>>>13,xn=S[4]|0,He=xn&8191,We=xn>>>13,Mn=S[5]|0,Ve=Mn&8191,ze=Mn>>>13,Cn=S[6]|0,qe=Cn&8191,Ge=Cn>>>13,In=S[7]|0,Je=In&8191,Ze=In>>>13,Rn=S[8]|0,Qe=Rn&8191,Ye=Rn>>>13,An=S[9]|0,Ke=An&8191,Xe=An>>>13;m.negative=u.negative^b.negative,m.length=19,_=Math.imul(ee,fe),d=Math.imul(ee,ce),d=d+Math.imul(O,fe)|0,A=Math.imul(O,ce);var Dr=(L+_|0)+((d&8191)<<13)|0;L=(A+(d>>>13)|0)+(Dr>>>26)|0,Dr&=67108863,_=Math.imul(V,fe),d=Math.imul(V,ce),d=d+Math.imul(Q,fe)|0,A=Math.imul(Q,ce),_=_+Math.imul(ee,ae)|0,d=d+Math.imul(ee,De)|0,d=d+Math.imul(O,ae)|0,A=A+Math.imul(O,De)|0;var jr=(L+_|0)+((d&8191)<<13)|0;L=(A+(d>>>13)|0)+(jr>>>26)|0,jr&=67108863,_=Math.imul(C,fe),d=Math.imul(C,ce),d=d+Math.imul(R,fe)|0,A=Math.imul(R,ce),_=_+Math.imul(V,ae)|0,d=d+Math.imul(V,De)|0,d=d+Math.imul(Q,ae)|0,A=A+Math.imul(Q,De)|0,_=_+Math.imul(ee,je)|0,d=d+Math.imul(ee,$e)|0,d=d+Math.imul(O,je)|0,A=A+Math.imul(O,$e)|0;var $r=(L+_|0)+((d&8191)<<13)|0;L=(A+(d>>>13)|0)+($r>>>26)|0,$r&=67108863,_=Math.imul(Z,fe),d=Math.imul(Z,ce),d=d+Math.imul(he,fe)|0,A=Math.imul(he,ce),_=_+Math.imul(C,ae)|0,d=d+Math.imul(C,De)|0,d=d+Math.imul(R,ae)|0,A=A+Math.imul(R,De)|0,_=_+Math.imul(V,je)|0,d=d+Math.imul(V,$e)|0,d=d+Math.imul(Q,je)|0,A=A+Math.imul(Q,$e)|0,_=_+Math.imul(ee,Fe)|0,d=d+Math.imul(ee,Ue)|0,d=d+Math.imul(O,Fe)|0,A=A+Math.imul(O,Ue)|0;var Fr=(L+_|0)+((d&8191)<<13)|0;L=(A+(d>>>13)|0)+(Fr>>>26)|0,Fr&=67108863,_=Math.imul(se,fe),d=Math.imul(se,ce),d=d+Math.imul(xe,fe)|0,A=Math.imul(xe,ce),_=_+Math.imul(Z,ae)|0,d=d+Math.imul(Z,De)|0,d=d+Math.imul(he,ae)|0,A=A+Math.imul(he,De)|0,_=_+Math.imul(C,je)|0,d=d+Math.imul(C,$e)|0,d=d+Math.imul(R,je)|0,A=A+Math.imul(R,$e)|0,_=_+Math.imul(V,Fe)|0,d=d+Math.imul(V,Ue)|0,d=d+Math.imul(Q,Fe)|0,A=A+Math.imul(Q,Ue)|0,_=_+Math.imul(ee,He)|0,d=d+Math.imul(ee,We)|0,d=d+Math.imul(O,He)|0,A=A+Math.imul(O,We)|0;var Ur=(L+_|0)+((d&8191)<<13)|0;L=(A+(d>>>13)|0)+(Ur>>>26)|0,Ur&=67108863,_=Math.imul(ke,fe),d=Math.imul(ke,ce),d=d+Math.imul(Re,fe)|0,A=Math.imul(Re,ce),_=_+Math.imul(se,ae)|0,d=d+Math.imul(se,De)|0,d=d+Math.imul(xe,ae)|0,A=A+Math.imul(xe,De)|0,_=_+Math.imul(Z,je)|0,d=d+Math.imul(Z,$e)|0,d=d+Math.imul(he,je)|0,A=A+Math.imul(he,$e)|0,_=_+Math.imul(C,Fe)|0,d=d+Math.imul(C,Ue)|0,d=d+Math.imul(R,Fe)|0,A=A+Math.imul(R,Ue)|0,_=_+Math.imul(V,He)|0,d=d+Math.imul(V,We)|0,d=d+Math.imul(Q,He)|0,A=A+Math.imul(Q,We)|0,_=_+Math.imul(ee,Ve)|0,d=d+Math.imul(ee,ze)|0,d=d+Math.imul(O,Ve)|0,A=A+Math.imul(O,ze)|0;var Hr=(L+_|0)+((d&8191)<<13)|0;L=(A+(d>>>13)|0)+(Hr>>>26)|0,Hr&=67108863,_=Math.imul(Ce,fe),d=Math.imul(Ce,ce),d=d+Math.imul(Ne,fe)|0,A=Math.imul(Ne,ce),_=_+Math.imul(ke,ae)|0,d=d+Math.imul(ke,De)|0,d=d+Math.imul(Re,ae)|0,A=A+Math.imul(Re,De)|0,_=_+Math.imul(se,je)|0,d=d+Math.imul(se,$e)|0,d=d+Math.imul(xe,je)|0,A=A+Math.imul(xe,$e)|0,_=_+Math.imul(Z,Fe)|0,d=d+Math.imul(Z,Ue)|0,d=d+Math.imul(he,Fe)|0,A=A+Math.imul(he,Ue)|0,_=_+Math.imul(C,He)|0,d=d+Math.imul(C,We)|0,d=d+Math.imul(R,He)|0,A=A+Math.imul(R,We)|0,_=_+Math.imul(V,Ve)|0,d=d+Math.imul(V,ze)|0,d=d+Math.imul(Q,Ve)|0,A=A+Math.imul(Q,ze)|0,_=_+Math.imul(ee,qe)|0,d=d+Math.imul(ee,Ge)|0,d=d+Math.imul(O,qe)|0,A=A+Math.imul(O,Ge)|0;var Wr=(L+_|0)+((d&8191)<<13)|0;L=(A+(d>>>13)|0)+(Wr>>>26)|0,Wr&=67108863,_=Math.imul(Ie,fe),d=Math.imul(Ie,ce),d=d+Math.imul(v,fe)|0,A=Math.imul(v,ce),_=_+Math.imul(Ce,ae)|0,d=d+Math.imul(Ce,De)|0,d=d+Math.imul(Ne,ae)|0,A=A+Math.imul(Ne,De)|0,_=_+Math.imul(ke,je)|0,d=d+Math.imul(ke,$e)|0,d=d+Math.imul(Re,je)|0,A=A+Math.imul(Re,$e)|0,_=_+Math.imul(se,Fe)|0,d=d+Math.imul(se,Ue)|0,d=d+Math.imul(xe,Fe)|0,A=A+Math.imul(xe,Ue)|0,_=_+Math.imul(Z,He)|0,d=d+Math.imul(Z,We)|0,d=d+Math.imul(he,He)|0,A=A+Math.imul(he,We)|0,_=_+Math.imul(C,Ve)|0,d=d+Math.imul(C,ze)|0,d=d+Math.imul(R,Ve)|0,A=A+Math.imul(R,ze)|0,_=_+Math.imul(V,qe)|0,d=d+Math.imul(V,Ge)|0,d=d+Math.imul(Q,qe)|0,A=A+Math.imul(Q,Ge)|0,_=_+Math.imul(ee,Je)|0,d=d+Math.imul(ee,Ze)|0,d=d+Math.imul(O,Je)|0,A=A+Math.imul(O,Ze)|0;var Vr=(L+_|0)+((d&8191)<<13)|0;L=(A+(d>>>13)|0)+(Vr>>>26)|0,Vr&=67108863,_=Math.imul(f,fe),d=Math.imul(f,ce),d=d+Math.imul(x,fe)|0,A=Math.imul(x,ce),_=_+Math.imul(Ie,ae)|0,d=d+Math.imul(Ie,De)|0,d=d+Math.imul(v,ae)|0,A=A+Math.imul(v,De)|0,_=_+Math.imul(Ce,je)|0,d=d+Math.imul(Ce,$e)|0,d=d+Math.imul(Ne,je)|0,A=A+Math.imul(Ne,$e)|0,_=_+Math.imul(ke,Fe)|0,d=d+Math.imul(ke,Ue)|0,d=d+Math.imul(Re,Fe)|0,A=A+Math.imul(Re,Ue)|0,_=_+Math.imul(se,He)|0,d=d+Math.imul(se,We)|0,d=d+Math.imul(xe,He)|0,A=A+Math.imul(xe,We)|0,_=_+Math.imul(Z,Ve)|0,d=d+Math.imul(Z,ze)|0,d=d+Math.imul(he,Ve)|0,A=A+Math.imul(he,ze)|0,_=_+Math.imul(C,qe)|0,d=d+Math.imul(C,Ge)|0,d=d+Math.imul(R,qe)|0,A=A+Math.imul(R,Ge)|0,_=_+Math.imul(V,Je)|0,d=d+Math.imul(V,Ze)|0,d=d+Math.imul(Q,Je)|0,A=A+Math.imul(Q,Ze)|0,_=_+Math.imul(ee,Qe)|0,d=d+Math.imul(ee,Ye)|0,d=d+Math.imul(O,Qe)|0,A=A+Math.imul(O,Ye)|0;var zr=(L+_|0)+((d&8191)<<13)|0;L=(A+(d>>>13)|0)+(zr>>>26)|0,zr&=67108863,_=Math.imul($,fe),d=Math.imul($,ce),d=d+Math.imul(W,fe)|0,A=Math.imul(W,ce),_=_+Math.imul(f,ae)|0,d=d+Math.imul(f,De)|0,d=d+Math.imul(x,ae)|0,A=A+Math.imul(x,De)|0,_=_+Math.imul(Ie,je)|0,d=d+Math.imul(Ie,$e)|0,d=d+Math.imul(v,je)|0,A=A+Math.imul(v,$e)|0,_=_+Math.imul(Ce,Fe)|0,d=d+Math.imul(Ce,Ue)|0,d=d+Math.imul(Ne,Fe)|0,A=A+Math.imul(Ne,Ue)|0,_=_+Math.imul(ke,He)|0,d=d+Math.imul(ke,We)|0,d=d+Math.imul(Re,He)|0,A=A+Math.imul(Re,We)|0,_=_+Math.imul(se,Ve)|0,d=d+Math.imul(se,ze)|0,d=d+Math.imul(xe,Ve)|0,A=A+Math.imul(xe,ze)|0,_=_+Math.imul(Z,qe)|0,d=d+Math.imul(Z,Ge)|0,d=d+Math.imul(he,qe)|0,A=A+Math.imul(he,Ge)|0,_=_+Math.imul(C,Je)|0,d=d+Math.imul(C,Ze)|0,d=d+Math.imul(R,Je)|0,A=A+Math.imul(R,Ze)|0,_=_+Math.imul(V,Qe)|0,d=d+Math.imul(V,Ye)|0,d=d+Math.imul(Q,Qe)|0,A=A+Math.imul(Q,Ye)|0,_=_+Math.imul(ee,Ke)|0,d=d+Math.imul(ee,Xe)|0,d=d+Math.imul(O,Ke)|0,A=A+Math.imul(O,Xe)|0;var qr=(L+_|0)+((d&8191)<<13)|0;L=(A+(d>>>13)|0)+(qr>>>26)|0,qr&=67108863,_=Math.imul($,ae),d=Math.imul($,De),d=d+Math.imul(W,ae)|0,A=Math.imul(W,De),_=_+Math.imul(f,je)|0,d=d+Math.imul(f,$e)|0,d=d+Math.imul(x,je)|0,A=A+Math.imul(x,$e)|0,_=_+Math.imul(Ie,Fe)|0,d=d+Math.imul(Ie,Ue)|0,d=d+Math.imul(v,Fe)|0,A=A+Math.imul(v,Ue)|0,_=_+Math.imul(Ce,He)|0,d=d+Math.imul(Ce,We)|0,d=d+Math.imul(Ne,He)|0,A=A+Math.imul(Ne,We)|0,_=_+Math.imul(ke,Ve)|0,d=d+Math.imul(ke,ze)|0,d=d+Math.imul(Re,Ve)|0,A=A+Math.imul(Re,ze)|0,_=_+Math.imul(se,qe)|0,d=d+Math.imul(se,Ge)|0,d=d+Math.imul(xe,qe)|0,A=A+Math.imul(xe,Ge)|0,_=_+Math.imul(Z,Je)|0,d=d+Math.imul(Z,Ze)|0,d=d+Math.imul(he,Je)|0,A=A+Math.imul(he,Ze)|0,_=_+Math.imul(C,Qe)|0,d=d+Math.imul(C,Ye)|0,d=d+Math.imul(R,Qe)|0,A=A+Math.imul(R,Ye)|0,_=_+Math.imul(V,Ke)|0,d=d+Math.imul(V,Xe)|0,d=d+Math.imul(Q,Ke)|0,A=A+Math.imul(Q,Xe)|0;var Gr=(L+_|0)+((d&8191)<<13)|0;L=(A+(d>>>13)|0)+(Gr>>>26)|0,Gr&=67108863,_=Math.imul($,je),d=Math.imul($,$e),d=d+Math.imul(W,je)|0,A=Math.imul(W,$e),_=_+Math.imul(f,Fe)|0,d=d+Math.imul(f,Ue)|0,d=d+Math.imul(x,Fe)|0,A=A+Math.imul(x,Ue)|0,_=_+Math.imul(Ie,He)|0,d=d+Math.imul(Ie,We)|0,d=d+Math.imul(v,He)|0,A=A+Math.imul(v,We)|0,_=_+Math.imul(Ce,Ve)|0,d=d+Math.imul(Ce,ze)|0,d=d+Math.imul(Ne,Ve)|0,A=A+Math.imul(Ne,ze)|0,_=_+Math.imul(ke,qe)|0,d=d+Math.imul(ke,Ge)|0,d=d+Math.imul(Re,qe)|0,A=A+Math.imul(Re,Ge)|0,_=_+Math.imul(se,Je)|0,d=d+Math.imul(se,Ze)|0,d=d+Math.imul(xe,Je)|0,A=A+Math.imul(xe,Ze)|0,_=_+Math.imul(Z,Qe)|0,d=d+Math.imul(Z,Ye)|0,d=d+Math.imul(he,Qe)|0,A=A+Math.imul(he,Ye)|0,_=_+Math.imul(C,Ke)|0,d=d+Math.imul(C,Xe)|0,d=d+Math.imul(R,Ke)|0,A=A+Math.imul(R,Xe)|0;var Jr=(L+_|0)+((d&8191)<<13)|0;L=(A+(d>>>13)|0)+(Jr>>>26)|0,Jr&=67108863,_=Math.imul($,Fe),d=Math.imul($,Ue),d=d+Math.imul(W,Fe)|0,A=Math.imul(W,Ue),_=_+Math.imul(f,He)|0,d=d+Math.imul(f,We)|0,d=d+Math.imul(x,He)|0,A=A+Math.imul(x,We)|0,_=_+Math.imul(Ie,Ve)|0,d=d+Math.imul(Ie,ze)|0,d=d+Math.imul(v,Ve)|0,A=A+Math.imul(v,ze)|0,_=_+Math.imul(Ce,qe)|0,d=d+Math.imul(Ce,Ge)|0,d=d+Math.imul(Ne,qe)|0,A=A+Math.imul(Ne,Ge)|0,_=_+Math.imul(ke,Je)|0,d=d+Math.imul(ke,Ze)|0,d=d+Math.imul(Re,Je)|0,A=A+Math.imul(Re,Ze)|0,_=_+Math.imul(se,Qe)|0,d=d+Math.imul(se,Ye)|0,d=d+Math.imul(xe,Qe)|0,A=A+Math.imul(xe,Ye)|0,_=_+Math.imul(Z,Ke)|0,d=d+Math.imul(Z,Xe)|0,d=d+Math.imul(he,Ke)|0,A=A+Math.imul(he,Xe)|0;var Zr=(L+_|0)+((d&8191)<<13)|0;L=(A+(d>>>13)|0)+(Zr>>>26)|0,Zr&=67108863,_=Math.imul($,He),d=Math.imul($,We),d=d+Math.imul(W,He)|0,A=Math.imul(W,We),_=_+Math.imul(f,Ve)|0,d=d+Math.imul(f,ze)|0,d=d+Math.imul(x,Ve)|0,A=A+Math.imul(x,ze)|0,_=_+Math.imul(Ie,qe)|0,d=d+Math.imul(Ie,Ge)|0,d=d+Math.imul(v,qe)|0,A=A+Math.imul(v,Ge)|0,_=_+Math.imul(Ce,Je)|0,d=d+Math.imul(Ce,Ze)|0,d=d+Math.imul(Ne,Je)|0,A=A+Math.imul(Ne,Ze)|0,_=_+Math.imul(ke,Qe)|0,d=d+Math.imul(ke,Ye)|0,d=d+Math.imul(Re,Qe)|0,A=A+Math.imul(Re,Ye)|0,_=_+Math.imul(se,Ke)|0,d=d+Math.imul(se,Xe)|0,d=d+Math.imul(xe,Ke)|0,A=A+Math.imul(xe,Xe)|0;var Qr=(L+_|0)+((d&8191)<<13)|0;L=(A+(d>>>13)|0)+(Qr>>>26)|0,Qr&=67108863,_=Math.imul($,Ve),d=Math.imul($,ze),d=d+Math.imul(W,Ve)|0,A=Math.imul(W,ze),_=_+Math.imul(f,qe)|0,d=d+Math.imul(f,Ge)|0,d=d+Math.imul(x,qe)|0,A=A+Math.imul(x,Ge)|0,_=_+Math.imul(Ie,Je)|0,d=d+Math.imul(Ie,Ze)|0,d=d+Math.imul(v,Je)|0,A=A+Math.imul(v,Ze)|0,_=_+Math.imul(Ce,Qe)|0,d=d+Math.imul(Ce,Ye)|0,d=d+Math.imul(Ne,Qe)|0,A=A+Math.imul(Ne,Ye)|0,_=_+Math.imul(ke,Ke)|0,d=d+Math.imul(ke,Xe)|0,d=d+Math.imul(Re,Ke)|0,A=A+Math.imul(Re,Xe)|0;var Jo=(L+_|0)+((d&8191)<<13)|0;L=(A+(d>>>13)|0)+(Jo>>>26)|0,Jo&=67108863,_=Math.imul($,qe),d=Math.imul($,Ge),d=d+Math.imul(W,qe)|0,A=Math.imul(W,Ge),_=_+Math.imul(f,Je)|0,d=d+Math.imul(f,Ze)|0,d=d+Math.imul(x,Je)|0,A=A+Math.imul(x,Ze)|0,_=_+Math.imul(Ie,Qe)|0,d=d+Math.imul(Ie,Ye)|0,d=d+Math.imul(v,Qe)|0,A=A+Math.imul(v,Ye)|0,_=_+Math.imul(Ce,Ke)|0,d=d+Math.imul(Ce,Xe)|0,d=d+Math.imul(Ne,Ke)|0,A=A+Math.imul(Ne,Xe)|0;var Zo=(L+_|0)+((d&8191)<<13)|0;L=(A+(d>>>13)|0)+(Zo>>>26)|0,Zo&=67108863,_=Math.imul($,Je),d=Math.imul($,Ze),d=d+Math.imul(W,Je)|0,A=Math.imul(W,Ze),_=_+Math.imul(f,Qe)|0,d=d+Math.imul(f,Ye)|0,d=d+Math.imul(x,Qe)|0,A=A+Math.imul(x,Ye)|0,_=_+Math.imul(Ie,Ke)|0,d=d+Math.imul(Ie,Xe)|0,d=d+Math.imul(v,Ke)|0,A=A+Math.imul(v,Xe)|0;var Qo=(L+_|0)+((d&8191)<<13)|0;L=(A+(d>>>13)|0)+(Qo>>>26)|0,Qo&=67108863,_=Math.imul($,Qe),d=Math.imul($,Ye),d=d+Math.imul(W,Qe)|0,A=Math.imul(W,Ye),_=_+Math.imul(f,Ke)|0,d=d+Math.imul(f,Xe)|0,d=d+Math.imul(x,Ke)|0,A=A+Math.imul(x,Xe)|0;var Yo=(L+_|0)+((d&8191)<<13)|0;L=(A+(d>>>13)|0)+(Yo>>>26)|0,Yo&=67108863,_=Math.imul($,Ke),d=Math.imul($,Xe),d=d+Math.imul(W,Ke)|0,A=Math.imul(W,Xe);var Ko=(L+_|0)+((d&8191)<<13)|0;return L=(A+(d>>>13)|0)+(Ko>>>26)|0,Ko&=67108863,k[0]=Dr,k[1]=jr,k[2]=$r,k[3]=Fr,k[4]=Ur,k[5]=Hr,k[6]=Wr,k[7]=Vr,k[8]=zr,k[9]=qr,k[10]=Gr,k[11]=Jr,k[12]=Zr,k[13]=Qr,k[14]=Jo,k[15]=Zo,k[16]=Qo,k[17]=Yo,k[18]=Ko,L!==0&&(k[19]=L,m.length++),m};Math.imul||(N=M);function j(w,u,b){b.negative=u.negative^w.negative,b.length=w.length+u.length;for(var m=0,E=0,S=0;S<b.length-1;S++){var k=E;E=0;for(var L=m&67108863,_=Math.min(S,u.length-1),d=Math.max(0,S-w.length+1);d<=_;d++){var A=S-d,Y=w.words[A]|0,ee=u.words[d]|0,O=Y*ee,P=O&67108863;k=k+(O/67108864|0)|0,P=P+L|0,L=P&67108863,k=k+(P>>>26)|0,E+=k>>>26,k&=67108863}b.words[S]=L,m=k,k=E}return m!==0?b.words[S]=m:b.length--,b._strip()}function H(w,u,b){return j(w,u,b)}s.prototype.mulTo=function(u,b){var m,E=this.length+u.length;return this.length===10&&u.length===10?m=N(this,u,b):E<63?m=M(this,u,b):E<1024?m=j(this,u,b):m=H(this,u,b),m},s.prototype.mul=function(u){var b=new s(null);return b.words=new Array(this.length+u.length),this.mulTo(u,b)},s.prototype.mulf=function(u){var b=new s(null);return b.words=new Array(this.length+u.length),H(this,u,b)},s.prototype.imul=function(u){return this.clone().mulTo(u,this)},s.prototype.imuln=function(u){var b=u<0;b&&(u=-u),n(typeof u=="number"),n(u<67108864);for(var m=0,E=0;E<this.length;E++){var S=(this.words[E]|0)*u,k=(S&67108863)+(m&67108863);m>>=26,m+=S/67108864|0,m+=k>>>26,this.words[E]=k&67108863}return m!==0&&(this.words[E]=m,this.length++),b?this.ineg():this},s.prototype.muln=function(u){return this.clone().imuln(u)},s.prototype.sqr=function(){return this.mul(this)},s.prototype.isqr=function(){return this.imul(this.clone())},s.prototype.pow=function(u){var b=U(u);if(b.length===0)return new s(1);for(var m=this,E=0;E<b.length&&b[E]===0;E++,m=m.sqr());if(++E<b.length)for(var S=m.sqr();E<b.length;E++,S=S.sqr())b[E]!==0&&(m=m.mul(S));return m},s.prototype.iushln=function(u){n(typeof u=="number"&&u>=0);var b=u%26,m=(u-b)/26,E=67108863>>>26-b<<26-b,S;if(b!==0){var k=0;for(S=0;S<this.length;S++){var L=this.words[S]&E,_=(this.words[S]|0)-L<<b;this.words[S]=_|k,k=L>>>26-b}k&&(this.words[S]=k,this.length++)}if(m!==0){for(S=this.length-1;S>=0;S--)this.words[S+m]=this.words[S];for(S=0;S<m;S++)this.words[S]=0;this.length+=m}return this._strip()},s.prototype.ishln=function(u){return n(this.negative===0),this.iushln(u)},s.prototype.iushrn=function(u,b,m){n(typeof u=="number"&&u>=0);var E;b?E=(b-b%26)/26:E=0;var S=u%26,k=Math.min((u-S)/26,this.length),L=67108863^67108863>>>S<<S,_=m;if(E-=k,E=Math.max(0,E),_){for(var d=0;d<k;d++)_.words[d]=this.words[d];_.length=k}if(k!==0)if(this.length>k)for(this.length-=k,d=0;d<this.length;d++)this.words[d]=this.words[d+k];else this.words[0]=0,this.length=1;var A=0;for(d=this.length-1;d>=0&&(A!==0||d>=E);d--){var Y=this.words[d]|0;this.words[d]=A<<26-S|Y>>>S,A=Y&L}return _&&A!==0&&(_.words[_.length++]=A),this.length===0&&(this.words[0]=0,this.length=1),this._strip()},s.prototype.ishrn=function(u,b,m){return n(this.negative===0),this.iushrn(u,b,m)},s.prototype.shln=function(u){return this.clone().ishln(u)},s.prototype.ushln=function(u){return this.clone().iushln(u)},s.prototype.shrn=function(u){return this.clone().ishrn(u)},s.prototype.ushrn=function(u){return this.clone().iushrn(u)},s.prototype.testn=function(u){n(typeof u=="number"&&u>=0);var b=u%26,m=(u-b)/26,E=1<<b;if(this.length<=m)return!1;var S=this.words[m];return!!(S&E)},s.prototype.imaskn=function(u){n(typeof u=="number"&&u>=0);var b=u%26,m=(u-b)/26;if(n(this.negative===0,"imaskn works only with positive numbers"),this.length<=m)return this;if(b!==0&&m++,this.length=Math.min(m,this.length),b!==0){var E=67108863^67108863>>>b<<b;this.words[this.length-1]&=E}return this._strip()},s.prototype.maskn=function(u){return this.clone().imaskn(u)},s.prototype.iaddn=function(u){return n(typeof u=="number"),n(u<67108864),u<0?this.isubn(-u):this.negative!==0?this.length===1&&(this.words[0]|0)<=u?(this.words[0]=u-(this.words[0]|0),this.negative=0,this):(this.negative=0,this.isubn(u),this.negative=1,this):this._iaddn(u)},s.prototype._iaddn=function(u){this.words[0]+=u;for(var b=0;b<this.length&&this.words[b]>=67108864;b++)this.words[b]-=67108864,b===this.length-1?this.words[b+1]=1:this.words[b+1]++;return this.length=Math.max(this.length,b+1),this},s.prototype.isubn=function(u){if(n(typeof u=="number"),n(u<67108864),u<0)return this.iaddn(-u);if(this.negative!==0)return this.negative=0,this.iaddn(u),this.negative=1,this;if(this.words[0]-=u,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var b=0;b<this.length&&this.words[b]<0;b++)this.words[b]+=67108864,this.words[b+1]-=1;return this._strip()},s.prototype.addn=function(u){return this.clone().iaddn(u)},s.prototype.subn=function(u){return this.clone().isubn(u)},s.prototype.iabs=function(){return this.negative=0,this},s.prototype.abs=function(){return this.clone().iabs()},s.prototype._ishlnsubmul=function(u,b,m){var E=u.length+m,S;this._expand(E);var k,L=0;for(S=0;S<u.length;S++){k=(this.words[S+m]|0)+L;var _=(u.words[S]|0)*b;k-=_&67108863,L=(k>>26)-(_/67108864|0),this.words[S+m]=k&67108863}for(;S<this.length-m;S++)k=(this.words[S+m]|0)+L,L=k>>26,this.words[S+m]=k&67108863;if(L===0)return this._strip();for(n(L===-1),L=0,S=0;S<this.length;S++)k=-(this.words[S]|0)+L,L=k>>26,this.words[S]=k&67108863;return this.negative=1,this._strip()},s.prototype._wordDiv=function(u,b){var m=this.length-u.length,E=this.clone(),S=u,k=S.words[S.length-1]|0,L=this._countBits(k);m=26-L,m!==0&&(S=S.ushln(m),E.iushln(m),k=S.words[S.length-1]|0);var _=E.length-S.length,d;if(b!=="mod"){d=new s(null),d.length=_+1,d.words=new Array(d.length);for(var A=0;A<d.length;A++)d.words[A]=0}var Y=E.clone()._ishlnsubmul(S,1,_);Y.negative===0&&(E=Y,d&&(d.words[_]=1));for(var ee=_-1;ee>=0;ee--){var O=(E.words[S.length+ee]|0)*67108864+(E.words[S.length+ee-1]|0);for(O=Math.min(O/k|0,67108863),E._ishlnsubmul(S,O,ee);E.negative!==0;)O--,E.negative=0,E._ishlnsubmul(S,1,ee),E.isZero()||(E.negative^=1);d&&(d.words[ee]=O)}return d&&d._strip(),E._strip(),b!=="div"&&m!==0&&E.iushrn(m),{div:d||null,mod:E}},s.prototype.divmod=function(u,b,m){if(n(!u.isZero()),this.isZero())return{div:new s(0),mod:new s(0)};var E,S,k;return this.negative!==0&&u.negative===0?(k=this.neg().divmod(u,b),b!=="mod"&&(E=k.div.neg()),b!=="div"&&(S=k.mod.neg(),m&&S.negative!==0&&S.iadd(u)),{div:E,mod:S}):this.negative===0&&u.negative!==0?(k=this.divmod(u.neg(),b),b!=="mod"&&(E=k.div.neg()),{div:E,mod:k.mod}):this.negative&u.negative?(k=this.neg().divmod(u.neg(),b),b!=="div"&&(S=k.mod.neg(),m&&S.negative!==0&&S.isub(u)),{div:k.div,mod:S}):u.length>this.length||this.cmp(u)<0?{div:new s(0),mod:this}:u.length===1?b==="div"?{div:this.divn(u.words[0]),mod:null}:b==="mod"?{div:null,mod:new s(this.modrn(u.words[0]))}:{div:this.divn(u.words[0]),mod:new s(this.modrn(u.words[0]))}:this._wordDiv(u,b)},s.prototype.div=function(u){return this.divmod(u,"div",!1).div},s.prototype.mod=function(u){return this.divmod(u,"mod",!1).mod},s.prototype.umod=function(u){return this.divmod(u,"mod",!0).mod},s.prototype.divRound=function(u){var b=this.divmod(u);if(b.mod.isZero())return b.div;var m=b.div.negative!==0?b.mod.isub(u):b.mod,E=u.ushrn(1),S=u.andln(1),k=m.cmp(E);return k<0||S===1&&k===0?b.div:b.div.negative!==0?b.div.isubn(1):b.div.iaddn(1)},s.prototype.modrn=function(u){var b=u<0;b&&(u=-u),n(u<=67108863);for(var m=(1<<26)%u,E=0,S=this.length-1;S>=0;S--)E=(m*E+(this.words[S]|0))%u;return b?-E:E},s.prototype.modn=function(u){return this.modrn(u)},s.prototype.idivn=function(u){var b=u<0;b&&(u=-u),n(u<=67108863);for(var m=0,E=this.length-1;E>=0;E--){var S=(this.words[E]|0)+m*67108864;this.words[E]=S/u|0,m=S%u}return this._strip(),b?this.ineg():this},s.prototype.divn=function(u){return this.clone().idivn(u)},s.prototype.egcd=function(u){n(u.negative===0),n(!u.isZero());var b=this,m=u.clone();b.negative!==0?b=b.umod(u):b=b.clone();for(var E=new s(1),S=new s(0),k=new s(0),L=new s(1),_=0;b.isEven()&&m.isEven();)b.iushrn(1),m.iushrn(1),++_;for(var d=m.clone(),A=b.clone();!b.isZero();){for(var Y=0,ee=1;!(b.words[0]&ee)&&Y<26;++Y,ee<<=1);if(Y>0)for(b.iushrn(Y);Y-- >0;)(E.isOdd()||S.isOdd())&&(E.iadd(d),S.isub(A)),E.iushrn(1),S.iushrn(1);for(var O=0,P=1;!(m.words[0]&P)&&O<26;++O,P<<=1);if(O>0)for(m.iushrn(O);O-- >0;)(k.isOdd()||L.isOdd())&&(k.iadd(d),L.isub(A)),k.iushrn(1),L.iushrn(1);b.cmp(m)>=0?(b.isub(m),E.isub(k),S.isub(L)):(m.isub(b),k.isub(E),L.isub(S))}return{a:k,b:L,gcd:m.iushln(_)}},s.prototype._invmp=function(u){n(u.negative===0),n(!u.isZero());var b=this,m=u.clone();b.negative!==0?b=b.umod(u):b=b.clone();for(var E=new s(1),S=new s(0),k=m.clone();b.cmpn(1)>0&&m.cmpn(1)>0;){for(var L=0,_=1;!(b.words[0]&_)&&L<26;++L,_<<=1);if(L>0)for(b.iushrn(L);L-- >0;)E.isOdd()&&E.iadd(k),E.iushrn(1);for(var d=0,A=1;!(m.words[0]&A)&&d<26;++d,A<<=1);if(d>0)for(m.iushrn(d);d-- >0;)S.isOdd()&&S.iadd(k),S.iushrn(1);b.cmp(m)>=0?(b.isub(m),E.isub(S)):(m.isub(b),S.isub(E))}var Y;return b.cmpn(1)===0?Y=E:Y=S,Y.cmpn(0)<0&&Y.iadd(u),Y},s.prototype.gcd=function(u){if(this.isZero())return u.abs();if(u.isZero())return this.abs();var b=this.clone(),m=u.clone();b.negative=0,m.negative=0;for(var E=0;b.isEven()&&m.isEven();E++)b.iushrn(1),m.iushrn(1);do{for(;b.isEven();)b.iushrn(1);for(;m.isEven();)m.iushrn(1);var S=b.cmp(m);if(S<0){var k=b;b=m,m=k}else if(S===0||m.cmpn(1)===0)break;b.isub(m)}while(!0);return m.iushln(E)},s.prototype.invm=function(u){return this.egcd(u).a.umod(u)},s.prototype.isEven=function(){return(this.words[0]&1)===0},s.prototype.isOdd=function(){return(this.words[0]&1)===1},s.prototype.andln=function(u){return this.words[0]&u},s.prototype.bincn=function(u){n(typeof u=="number");var b=u%26,m=(u-b)/26,E=1<<b;if(this.length<=m)return this._expand(m+1),this.words[m]|=E,this;for(var S=E,k=m;S!==0&&k<this.length;k++){var L=this.words[k]|0;L+=S,S=L>>>26,L&=67108863,this.words[k]=L}return S!==0&&(this.words[k]=S,this.length++),this},s.prototype.isZero=function(){return this.length===1&&this.words[0]===0},s.prototype.cmpn=function(u){var b=u<0;if(this.negative!==0&&!b)return-1;if(this.negative===0&&b)return 1;this._strip();var m;if(this.length>1)m=1;else{b&&(u=-u),n(u<=67108863,"Number is too big");var E=this.words[0]|0;m=E===u?0:E<u?-1:1}return this.negative!==0?-m|0:m},s.prototype.cmp=function(u){if(this.negative!==0&&u.negative===0)return-1;if(this.negative===0&&u.negative!==0)return 1;var b=this.ucmp(u);return this.negative!==0?-b|0:b},s.prototype.ucmp=function(u){if(this.length>u.length)return 1;if(this.length<u.length)return-1;for(var b=0,m=this.length-1;m>=0;m--){var E=this.words[m]|0,S=u.words[m]|0;if(E!==S){E<S?b=-1:E>S&&(b=1);break}}return b},s.prototype.gtn=function(u){return this.cmpn(u)===1},s.prototype.gt=function(u){return this.cmp(u)===1},s.prototype.gten=function(u){return this.cmpn(u)>=0},s.prototype.gte=function(u){return this.cmp(u)>=0},s.prototype.ltn=function(u){return this.cmpn(u)===-1},s.prototype.lt=function(u){return this.cmp(u)===-1},s.prototype.lten=function(u){return this.cmpn(u)<=0},s.prototype.lte=function(u){return this.cmp(u)<=0},s.prototype.eqn=function(u){return this.cmpn(u)===0},s.prototype.eq=function(u){return this.cmp(u)===0},s.red=function(u){return new oe(u)},s.prototype.toRed=function(u){return n(!this.red,"Already a number in reduction context"),n(this.negative===0,"red works only with positives"),u.convertTo(this)._forceRed(u)},s.prototype.fromRed=function(){return n(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},s.prototype._forceRed=function(u){return this.red=u,this},s.prototype.forceRed=function(u){return n(!this.red,"Already a number in reduction context"),this._forceRed(u)},s.prototype.redAdd=function(u){return n(this.red,"redAdd works only with red numbers"),this.red.add(this,u)},s.prototype.redIAdd=function(u){return n(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,u)},s.prototype.redSub=function(u){return n(this.red,"redSub works only with red numbers"),this.red.sub(this,u)},s.prototype.redISub=function(u){return n(this.red,"redISub works only with red numbers"),this.red.isub(this,u)},s.prototype.redShl=function(u){return n(this.red,"redShl works only with red numbers"),this.red.shl(this,u)},s.prototype.redMul=function(u){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,u),this.red.mul(this,u)},s.prototype.redIMul=function(u){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,u),this.red.imul(this,u)},s.prototype.redSqr=function(){return n(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},s.prototype.redISqr=function(){return n(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},s.prototype.redSqrt=function(){return n(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},s.prototype.redInvm=function(){return n(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},s.prototype.redNeg=function(){return n(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},s.prototype.redPow=function(u){return n(this.red&&!u.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,u)};var F={k256:null,p224:null,p192:null,p25519:null};function z(w,u){this.name=w,this.p=new s(u,16),this.n=this.p.bitLength(),this.k=new s(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}z.prototype._tmp=function(){var u=new s(null);return u.words=new Array(Math.ceil(this.n/13)),u},z.prototype.ireduce=function(u){var b=u,m;do this.split(b,this.tmp),b=this.imulK(b),b=b.iadd(this.tmp),m=b.bitLength();while(m>this.n);var E=m<this.n?-1:b.ucmp(this.p);return E===0?(b.words[0]=0,b.length=1):E>0?b.isub(this.p):b.strip!==void 0?b.strip():b._strip(),b},z.prototype.split=function(u,b){u.iushrn(this.n,0,b)},z.prototype.imulK=function(u){return u.imul(this.k)};function X(){z.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}i(X,z),X.prototype.split=function(u,b){for(var m=4194303,E=Math.min(u.length,9),S=0;S<E;S++)b.words[S]=u.words[S];if(b.length=E,u.length<=9){u.words[0]=0,u.length=1;return}var k=u.words[9];for(b.words[b.length++]=k&m,S=10;S<u.length;S++){var L=u.words[S]|0;u.words[S-10]=(L&m)<<4|k>>>22,k=L}k>>>=22,u.words[S-10]=k,k===0&&u.length>10?u.length-=10:u.length-=9},X.prototype.imulK=function(u){u.words[u.length]=0,u.words[u.length+1]=0,u.length+=2;for(var b=0,m=0;m<u.length;m++){var E=u.words[m]|0;b+=E*977,u.words[m]=b&67108863,b=E*64+(b/67108864|0)}return u.words[u.length-1]===0&&(u.length--,u.words[u.length-1]===0&&u.length--),u};function K(){z.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}i(K,z);function J(){z.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}i(J,z);function ne(){z.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}i(ne,z),ne.prototype.imulK=function(u){for(var b=0,m=0;m<u.length;m++){var E=(u.words[m]|0)*19+b,S=E&67108863;E>>>=26,u.words[m]=S,b=E}return b!==0&&(u.words[u.length++]=b),u},s._prime=function(u){if(F[u])return F[u];var b;if(u==="k256")b=new X;else if(u==="p224")b=new K;else if(u==="p192")b=new J;else if(u==="p25519")b=new ne;else throw new Error("Unknown prime "+u);return F[u]=b,b};function oe(w){if(typeof w=="string"){var u=s._prime(w);this.m=u.p,this.prime=u}else n(w.gtn(1),"modulus must be greater than 1"),this.m=w,this.prime=null}oe.prototype._verify1=function(u){n(u.negative===0,"red works only with positives"),n(u.red,"red works only with red numbers")},oe.prototype._verify2=function(u,b){n((u.negative|b.negative)===0,"red works only with positives"),n(u.red&&u.red===b.red,"red works only with red numbers")},oe.prototype.imod=function(u){return this.prime?this.prime.ireduce(u)._forceRed(this):(p(u,u.umod(this.m)._forceRed(this)),u)},oe.prototype.neg=function(u){return u.isZero()?u.clone():this.m.sub(u)._forceRed(this)},oe.prototype.add=function(u,b){this._verify2(u,b);var m=u.add(b);return m.cmp(this.m)>=0&&m.isub(this.m),m._forceRed(this)},oe.prototype.iadd=function(u,b){this._verify2(u,b);var m=u.iadd(b);return m.cmp(this.m)>=0&&m.isub(this.m),m},oe.prototype.sub=function(u,b){this._verify2(u,b);var m=u.sub(b);return m.cmpn(0)<0&&m.iadd(this.m),m._forceRed(this)},oe.prototype.isub=function(u,b){this._verify2(u,b);var m=u.isub(b);return m.cmpn(0)<0&&m.iadd(this.m),m},oe.prototype.shl=function(u,b){return this._verify1(u),this.imod(u.ushln(b))},oe.prototype.imul=function(u,b){return this._verify2(u,b),this.imod(u.imul(b))},oe.prototype.mul=function(u,b){return this._verify2(u,b),this.imod(u.mul(b))},oe.prototype.isqr=function(u){return this.imul(u,u.clone())},oe.prototype.sqr=function(u){return this.mul(u,u)},oe.prototype.sqrt=function(u){if(u.isZero())return u.clone();var b=this.m.andln(3);if(n(b%2===1),b===3){var m=this.m.add(new s(1)).iushrn(2);return this.pow(u,m)}for(var E=this.m.subn(1),S=0;!E.isZero()&&E.andln(1)===0;)S++,E.iushrn(1);n(!E.isZero());var k=new s(1).toRed(this),L=k.redNeg(),_=this.m.subn(1).iushrn(1),d=this.m.bitLength();for(d=new s(2*d*d).toRed(this);this.pow(d,_).cmp(L)!==0;)d.redIAdd(L);for(var A=this.pow(d,E),Y=this.pow(u,E.addn(1).iushrn(1)),ee=this.pow(u,E),O=S;ee.cmp(k)!==0;){for(var P=ee,V=0;P.cmp(k)!==0;V++)P=P.redSqr();n(V<O);var Q=this.pow(A,new s(1).iushln(O-V-1));Y=Y.redMul(Q),A=Q.redSqr(),ee=ee.redMul(A),O=V}return Y},oe.prototype.invm=function(u){var b=u._invmp(this.m);return b.negative!==0?(b.negative=0,this.imod(b).redNeg()):this.imod(b)},oe.prototype.pow=function(u,b){if(b.isZero())return new s(1).toRed(this);if(b.cmpn(1)===0)return u.clone();var m=4,E=new Array(1<<m);E[0]=new s(1).toRed(this),E[1]=u;for(var S=2;S<E.length;S++)E[S]=this.mul(E[S-1],u);var k=E[0],L=0,_=0,d=b.bitLength()%26;for(d===0&&(d=26),S=b.length-1;S>=0;S--){for(var A=b.words[S],Y=d-1;Y>=0;Y--){var ee=A>>Y&1;if(k!==E[0]&&(k=this.sqr(k)),ee===0&&L===0){_=0;continue}L<<=1,L|=ee,_++,!(_!==m&&(S!==0||Y!==0))&&(k=this.mul(k,E[L]),_=0,L=0)}d=26}return k},oe.prototype.convertTo=function(u){var b=u.umod(this.m);return b===u?b.clone():b},oe.prototype.convertFrom=function(u){var b=u.clone();return b.red=null,b},s.mont=function(u){return new ue(u)};function ue(w){oe.call(this,w),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new s(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(ue,oe),ue.prototype.convertTo=function(u){return this.imod(u.ushln(this.shift))},ue.prototype.convertFrom=function(u){var b=this.imod(u.mul(this.rinv));return b.red=null,b},ue.prototype.imul=function(u,b){if(u.isZero()||b.isZero())return u.words[0]=0,u.length=1,u;var m=u.imul(b),E=m.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),S=m.isub(E).iushrn(this.shift),k=S;return S.cmp(this.m)>=0?k=S.isub(this.m):S.cmpn(0)<0&&(k=S.iadd(this.m)),k._forceRed(this)},ue.prototype.mul=function(u,b){if(u.isZero()||b.isZero())return new s(0)._forceRed(this);var m=u.mul(b),E=m.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),S=m.isub(E).iushrn(this.shift),k=S;return S.cmp(this.m)>=0?k=S.isub(this.m):S.cmpn(0)<0&&(k=S.iadd(this.m)),k._forceRed(this)},ue.prototype.invm=function(u){var b=this.imod(u._invmp(this.m).mul(this.r2));return b._forceRed(this)}})(t,te)})(lu);var zs=lu.exports,oi={};Object.defineProperty(oi,"__esModule",{value:!0});oi.EVENTS=void 0;oi.EVENTS={STARTED_CONNECTING:"walletlink_sdk.started.connecting",CONNECTED_STATE_CHANGE:"walletlink_sdk.connected",DISCONNECTED:"walletlink_sdk.disconnected",METADATA_DESTROYED:"walletlink_sdk_metadata_destroyed",LINKED:"walletlink_sdk.linked",FAILURE:"walletlink_sdk.generic_failure",SESSION_CONFIG_RECEIVED:"walletlink_sdk.session_config_event_received",ETH_ACCOUNTS_STATE:"walletlink_sdk.eth_accounts_state",SESSION_STATE_CHANGE:"walletlink_sdk.session_state_change",UNLINKED_ERROR_STATE:"walletlink_sdk.unlinked_error_state",SKIPPED_CLEARING_SESSION:"walletlink_sdk.skipped_clearing_session",GENERAL_ERROR:"walletlink_sdk.general_error",WEB3_REQUEST:"walletlink_sdk.web3.request",WEB3_REQUEST_PUBLISHED:"walletlink_sdk.web3.request_published",WEB3_RESPONSE:"walletlink_sdk.web3.response",UNKNOWN_ADDRESS_ENCOUNTERED:"walletlink_sdk.unknown_address_encountered"};var ji={},hu={},kr={},ip=ki;ki.default=ki;ki.stable=xh;ki.stableStringify=xh;var Rs="[...]",Eh="[Circular]",cn=[],on=[];function Sh(){return{depthLimit:Number.MAX_SAFE_INTEGER,edgesLimit:Number.MAX_SAFE_INTEGER}}function ki(t,e,r,n){typeof n>"u"&&(n=Sh()),Da(t,"",0,[],void 0,0,n);var i;try{on.length===0?i=JSON.stringify(t,e,r):i=JSON.stringify(t,Mh(e),r)}catch{return JSON.stringify("[unable to serialize, circular reference is too complex to analyze]")}finally{for(;cn.length!==0;){var s=cn.pop();s.length===4?Object.defineProperty(s[0],s[1],s[3]):s[0][s[1]]=s[2]}}return i}function $n(t,e,r,n){var i=Object.getOwnPropertyDescriptor(n,r);i.get!==void 0?i.configurable?(Object.defineProperty(n,r,{value:t}),cn.push([n,r,e,i])):on.push([e,r,t]):(n[r]=t,cn.push([n,r,e]))}function Da(t,e,r,n,i,s,o){s+=1;var a;if(typeof t=="object"&&t!==null){for(a=0;a<n.length;a++)if(n[a]===t){$n(Eh,t,e,i);return}if(typeof o.depthLimit<"u"&&s>o.depthLimit){$n(Rs,t,e,i);return}if(typeof o.edgesLimit<"u"&&r+1>o.edgesLimit){$n(Rs,t,e,i);return}if(n.push(t),Array.isArray(t))for(a=0;a<t.length;a++)Da(t[a],a,a,n,t,s,o);else{var c=Object.keys(t);for(a=0;a<c.length;a++){var l=c[a];Da(t[l],l,a,n,t,s,o)}}n.pop()}}function sp(t,e){return t<e?-1:t>e?1:0}function xh(t,e,r,n){typeof n>"u"&&(n=Sh());var i=ja(t,"",0,[],void 0,0,n)||t,s;try{on.length===0?s=JSON.stringify(i,e,r):s=JSON.stringify(i,Mh(e),r)}catch{return JSON.stringify("[unable to serialize, circular reference is too complex to analyze]")}finally{for(;cn.length!==0;){var o=cn.pop();o.length===4?Object.defineProperty(o[0],o[1],o[3]):o[0][o[1]]=o[2]}}return s}function ja(t,e,r,n,i,s,o){s+=1;var a;if(typeof t=="object"&&t!==null){for(a=0;a<n.length;a++)if(n[a]===t){$n(Eh,t,e,i);return}try{if(typeof t.toJSON=="function")return}catch{return}if(typeof o.depthLimit<"u"&&s>o.depthLimit){$n(Rs,t,e,i);return}if(typeof o.edgesLimit<"u"&&r+1>o.edgesLimit){$n(Rs,t,e,i);return}if(n.push(t),Array.isArray(t))for(a=0;a<t.length;a++)ja(t[a],a,a,n,t,s,o);else{var c={},l=Object.keys(t).sort(sp);for(a=0;a<l.length;a++){var p=l[a];ja(t[p],p,a,n,t,s,o),c[p]=t[p]}if(typeof i<"u")cn.push([i,e,t]),i[e]=c;else return c}n.pop()}}function Mh(t){return t=typeof t<"u"?t:function(e,r){return r},function(e,r){if(on.length>0)for(var n=0;n<on.length;n++){var i=on[n];if(i[1]===e&&i[0]===r){r=i[2],on.splice(n,1);break}}return t.call(this,e,r)}}Object.defineProperty(kr,"__esModule",{value:!0});kr.EthereumProviderError=kr.EthereumRpcError=void 0;const op=ip;class Ch extends Error{constructor(e,r,n){if(!Number.isInteger(e))throw new Error('"code" must be an integer.');if(!r||typeof r!="string")throw new Error('"message" must be a nonempty string.');super(r),this.code=e,n!==void 0&&(this.data=n)}serialize(){const e={code:this.code,message:this.message};return this.data!==void 0&&(e.data=this.data),this.stack&&(e.stack=this.stack),e}toString(){return op.default(this.serialize(),cp,2)}}kr.EthereumRpcError=Ch;class ap extends Ch{constructor(e,r,n){if(!up(e))throw new Error('"code" must be an integer such that: 1000 <= code <= 4999');super(e,r,n)}}kr.EthereumProviderError=ap;function up(t){return Number.isInteger(t)&&t>=1e3&&t<=4999}function cp(t,e){if(e!=="[Circular]")return e}var fu={},Nr={};Object.defineProperty(Nr,"__esModule",{value:!0});Nr.errorValues=Nr.errorCodes=void 0;Nr.errorCodes={rpc:{invalidInput:-32e3,resourceNotFound:-32001,resourceUnavailable:-32002,transactionRejected:-32003,methodNotSupported:-32004,limitExceeded:-32005,parse:-32700,invalidRequest:-32600,methodNotFound:-32601,invalidParams:-32602,internal:-32603},provider:{userRejectedRequest:4001,unauthorized:4100,unsupportedMethod:4200,disconnected:4900,chainDisconnected:4901}};Nr.errorValues={"-32700":{standard:"JSON RPC 2.0",message:"Invalid JSON was received by the server. An error occurred on the server while parsing the JSON text."},"-32600":{standard:"JSON RPC 2.0",message:"The JSON sent is not a valid Request object."},"-32601":{standard:"JSON RPC 2.0",message:"The method does not exist / is not available."},"-32602":{standard:"JSON RPC 2.0",message:"Invalid method parameter(s)."},"-32603":{standard:"JSON RPC 2.0",message:"Internal JSON-RPC error."},"-32000":{standard:"EIP-1474",message:"Invalid input."},"-32001":{standard:"EIP-1474",message:"Resource not found."},"-32002":{standard:"EIP-1474",message:"Resource unavailable."},"-32003":{standard:"EIP-1474",message:"Transaction rejected."},"-32004":{standard:"EIP-1474",message:"Method not supported."},"-32005":{standard:"EIP-1474",message:"Request limit exceeded."},4001:{standard:"EIP-1193",message:"User rejected the request."},4100:{standard:"EIP-1193",message:"The requested account and/or method has not been authorized by the user."},4200:{standard:"EIP-1193",message:"The requested method is not supported by this Ethereum provider."},4900:{standard:"EIP-1193",message:"The provider is disconnected from all chains."},4901:{standard:"EIP-1193",message:"The provider is disconnected from the specified chain."}};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.serializeError=t.isValidCode=t.getMessageFromCode=t.JSON_RPC_SERVER_ERROR_MESSAGE=void 0;const e=Nr,r=kr,n=e.errorCodes.rpc.internal,i="Unspecified error message. This is a bug, please report it.",s={code:n,message:o(n)};t.JSON_RPC_SERVER_ERROR_MESSAGE="Unspecified server error.";function o(y,I=i){if(Number.isInteger(y)){const T=y.toString();if(g(e.errorValues,T))return e.errorValues[T].message;if(l(y))return t.JSON_RPC_SERVER_ERROR_MESSAGE}return I}t.getMessageFromCode=o;function a(y){if(!Number.isInteger(y))return!1;const I=y.toString();return!!(e.errorValues[I]||l(y))}t.isValidCode=a;function c(y,{fallbackError:I=s,shouldIncludeStack:T=!1}={}){var D,U;if(!I||!Number.isInteger(I.code)||typeof I.message!="string")throw new Error("Must provide fallback error with integer number code and string message.");if(y instanceof r.EthereumRpcError)return y.serialize();const M={};if(y&&typeof y=="object"&&!Array.isArray(y)&&g(y,"code")&&a(y.code)){const j=y;M.code=j.code,j.message&&typeof j.message=="string"?(M.message=j.message,g(j,"data")&&(M.data=j.data)):(M.message=o(M.code),M.data={originalError:p(y)})}else{M.code=I.code;const j=(D=y)===null||D===void 0?void 0:D.message;M.message=j&&typeof j=="string"?j:I.message,M.data={originalError:p(y)}}const N=(U=y)===null||U===void 0?void 0:U.stack;return T&&y&&N&&typeof N=="string"&&(M.stack=N),M}t.serializeError=c;function l(y){return y>=-32099&&y<=-32e3}function p(y){return y&&typeof y=="object"&&!Array.isArray(y)?Object.assign({},y):y}function g(y,I){return Object.prototype.hasOwnProperty.call(y,I)}})(fu);var qs={};Object.defineProperty(qs,"__esModule",{value:!0});qs.ethErrors=void 0;const du=kr,Ih=fu,wt=Nr;qs.ethErrors={rpc:{parse:t=>Pt(wt.errorCodes.rpc.parse,t),invalidRequest:t=>Pt(wt.errorCodes.rpc.invalidRequest,t),invalidParams:t=>Pt(wt.errorCodes.rpc.invalidParams,t),methodNotFound:t=>Pt(wt.errorCodes.rpc.methodNotFound,t),internal:t=>Pt(wt.errorCodes.rpc.internal,t),server:t=>{if(!t||typeof t!="object"||Array.isArray(t))throw new Error("Ethereum RPC Server errors must provide single object argument.");const{code:e}=t;if(!Number.isInteger(e)||e>-32005||e<-32099)throw new Error('"code" must be an integer such that: -32099 <= code <= -32005');return Pt(e,t)},invalidInput:t=>Pt(wt.errorCodes.rpc.invalidInput,t),resourceNotFound:t=>Pt(wt.errorCodes.rpc.resourceNotFound,t),resourceUnavailable:t=>Pt(wt.errorCodes.rpc.resourceUnavailable,t),transactionRejected:t=>Pt(wt.errorCodes.rpc.transactionRejected,t),methodNotSupported:t=>Pt(wt.errorCodes.rpc.methodNotSupported,t),limitExceeded:t=>Pt(wt.errorCodes.rpc.limitExceeded,t)},provider:{userRejectedRequest:t=>mi(wt.errorCodes.provider.userRejectedRequest,t),unauthorized:t=>mi(wt.errorCodes.provider.unauthorized,t),unsupportedMethod:t=>mi(wt.errorCodes.provider.unsupportedMethod,t),disconnected:t=>mi(wt.errorCodes.provider.disconnected,t),chainDisconnected:t=>mi(wt.errorCodes.provider.chainDisconnected,t),custom:t=>{if(!t||typeof t!="object"||Array.isArray(t))throw new Error("Ethereum Provider custom errors must provide single object argument.");const{code:e,message:r,data:n}=t;if(!r||typeof r!="string")throw new Error('"message" must be a nonempty string');return new du.EthereumProviderError(e,r,n)}}};function Pt(t,e){const[r,n]=Rh(e);return new du.EthereumRpcError(t,r||Ih.getMessageFromCode(t),n)}function mi(t,e){const[r,n]=Rh(e);return new du.EthereumProviderError(t,r||Ih.getMessageFromCode(t),n)}function Rh(t){if(t){if(typeof t=="string")return[t];if(typeof t=="object"&&!Array.isArray(t)){const{message:e,data:r}=t;if(e&&typeof e!="string")throw new Error("Must specify string message.");return[e||void 0,r]}}return[]}(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.getMessageFromCode=t.serializeError=t.EthereumProviderError=t.EthereumRpcError=t.ethErrors=t.errorCodes=void 0;const e=kr;Object.defineProperty(t,"EthereumRpcError",{enumerable:!0,get:function(){return e.EthereumRpcError}}),Object.defineProperty(t,"EthereumProviderError",{enumerable:!0,get:function(){return e.EthereumProviderError}});const r=fu;Object.defineProperty(t,"serializeError",{enumerable:!0,get:function(){return r.serializeError}}),Object.defineProperty(t,"getMessageFromCode",{enumerable:!0,get:function(){return r.getMessageFromCode}});const n=qs;Object.defineProperty(t,"ethErrors",{enumerable:!0,get:function(){return n.ethErrors}});const i=Nr;Object.defineProperty(t,"errorCodes",{enumerable:!0,get:function(){return i.errorCodes}})})(hu);var Pe={},Gs={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.Web3Method=void 0,function(e){e.requestEthereumAccounts="requestEthereumAccounts",e.signEthereumMessage="signEthereumMessage",e.signEthereumTransaction="signEthereumTransaction",e.submitEthereumTransaction="submitEthereumTransaction",e.ethereumAddressFromSignedMessage="ethereumAddressFromSignedMessage",e.scanQRCode="scanQRCode",e.generic="generic",e.childRequestEthereumAccounts="childRequestEthereumAccounts",e.addEthereumChain="addEthereumChain",e.switchEthereumChain="switchEthereumChain",e.makeEthereumJSONRPCRequest="makeEthereumJSONRPCRequest",e.watchAsset="watchAsset",e.selectProvider="selectProvider"}(t.Web3Method||(t.Web3Method={}))})(Gs);Object.defineProperty(Pe,"__esModule",{value:!0});Pe.EthereumAddressFromSignedMessageResponse=Pe.SubmitEthereumTransactionResponse=Pe.SignEthereumTransactionResponse=Pe.SignEthereumMessageResponse=Pe.isRequestEthereumAccountsResponse=Pe.SelectProviderResponse=Pe.WatchAssetReponse=Pe.RequestEthereumAccountsResponse=Pe.SwitchEthereumChainResponse=Pe.AddEthereumChainResponse=Pe.isErrorResponse=void 0;const pr=Gs;function lp(t){var e,r;return((e=t)===null||e===void 0?void 0:e.method)!==void 0&&((r=t)===null||r===void 0?void 0:r.errorMessage)!==void 0}Pe.isErrorResponse=lp;function hp(t){return{method:pr.Web3Method.addEthereumChain,result:t}}Pe.AddEthereumChainResponse=hp;function fp(t){return{method:pr.Web3Method.switchEthereumChain,result:t}}Pe.SwitchEthereumChainResponse=fp;function dp(t){return{method:pr.Web3Method.requestEthereumAccounts,result:t}}Pe.RequestEthereumAccountsResponse=dp;function pp(t){return{method:pr.Web3Method.watchAsset,result:t}}Pe.WatchAssetReponse=pp;function gp(t){return{method:pr.Web3Method.selectProvider,result:t}}Pe.SelectProviderResponse=gp;function bp(t){return t&&t.method===pr.Web3Method.requestEthereumAccounts}Pe.isRequestEthereumAccountsResponse=bp;function vp(t){return{method:pr.Web3Method.signEthereumMessage,result:t}}Pe.SignEthereumMessageResponse=vp;function mp(t){return{method:pr.Web3Method.signEthereumTransaction,result:t}}Pe.SignEthereumTransactionResponse=mp;function yp(t){return{method:pr.Web3Method.submitEthereumTransaction,result:t}}Pe.SubmitEthereumTransactionResponse=yp;function _p(t){return{method:pr.Web3Method.ethereumAddressFromSignedMessage,result:t}}Pe.EthereumAddressFromSignedMessageResponse=_p;var ai={};Object.defineProperty(ai,"__esModule",{value:!0});ai.LIB_VERSION=void 0;ai.LIB_VERSION="3.7.2";(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.getErrorCode=t.serializeError=t.standardErrors=t.standardErrorMessage=t.standardErrorCodes=void 0;const e=hu,r=Pe,n=ai;t.standardErrorCodes=Object.freeze(Object.assign(Object.assign({},e.errorCodes),{provider:Object.freeze(Object.assign(Object.assign({},e.errorCodes.provider),{unsupportedChain:4902}))}));function i(p){return p!==void 0?(0,e.getMessageFromCode)(p):"Unknown error"}t.standardErrorMessage=i,t.standardErrors=Object.freeze(Object.assign(Object.assign({},e.ethErrors),{provider:Object.freeze(Object.assign(Object.assign({},e.ethErrors.provider),{unsupportedChain:(p="")=>e.ethErrors.provider.custom({code:t.standardErrorCodes.provider.unsupportedChain,message:`Unrecognized chain ID ${p}. Try adding the chain using wallet_addEthereumChain first.`})}))}));function s(p,g){const y=(0,e.serializeError)(o(p),{shouldIncludeStack:!0}),I=new URL("https://docs.cloud.coinbase.com/wallet-sdk/docs/errors");I.searchParams.set("version",n.LIB_VERSION),I.searchParams.set("code",y.code.toString());const T=a(y.data,g);return T&&I.searchParams.set("method",T),I.searchParams.set("message",y.message),Object.assign(Object.assign({},y),{docUrl:I.href})}t.serializeError=s;function o(p){return typeof p=="string"?{message:p,code:t.standardErrorCodes.rpc.internal}:(0,r.isErrorResponse)(p)?Object.assign(Object.assign({},p),{message:p.errorMessage,code:p.errorCode,data:{method:p.method,result:p.result}}):p}function a(p,g){var y;const I=(y=p)===null||y===void 0?void 0:y.method;if(I)return I;if(g!==void 0)return typeof g=="string"?g:Array.isArray(g)?g.length>0?g[0].method:void 0:g.method}function c(p){var g;if(typeof p=="number")return p;if(l(p))return(g=p.code)!==null&&g!==void 0?g:p.errorCode}t.getErrorCode=c;function l(p){return typeof p=="object"&&p!==null&&(typeof p.code=="number"||typeof p.errorCode=="number")}})(ji);var ui={},Ah={exports:{}},$a={exports:{}};typeof Object.create=="function"?$a.exports=function(e,r){r&&(e.super_=r,e.prototype=Object.create(r.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:$a.exports=function(e,r){if(r){e.super_=r;var n=function(){};n.prototype=r.prototype,e.prototype=new n,e.prototype.constructor=e}};var Xt=$a.exports,Fa={exports:{}},$i={},Js={};Js.byteLength=Sp;Js.toByteArray=Mp;Js.fromByteArray=Rp;var ur=[],$t=[],wp=typeof Uint8Array<"u"?Uint8Array:Array,Xo="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(var Tn=0,Ep=Xo.length;Tn<Ep;++Tn)ur[Tn]=Xo[Tn],$t[Xo.charCodeAt(Tn)]=Tn;$t["-".charCodeAt(0)]=62;$t["_".charCodeAt(0)]=63;function Th(t){var e=t.length;if(e%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=t.indexOf("=");r===-1&&(r=e);var n=r===e?0:4-r%4;return[r,n]}function Sp(t){var e=Th(t),r=e[0],n=e[1];return(r+n)*3/4-n}function xp(t,e,r){return(e+r)*3/4-r}function Mp(t){var e,r=Th(t),n=r[0],i=r[1],s=new wp(xp(t,n,i)),o=0,a=i>0?n-4:n,c;for(c=0;c<a;c+=4)e=$t[t.charCodeAt(c)]<<18|$t[t.charCodeAt(c+1)]<<12|$t[t.charCodeAt(c+2)]<<6|$t[t.charCodeAt(c+3)],s[o++]=e>>16&255,s[o++]=e>>8&255,s[o++]=e&255;return i===2&&(e=$t[t.charCodeAt(c)]<<2|$t[t.charCodeAt(c+1)]>>4,s[o++]=e&255),i===1&&(e=$t[t.charCodeAt(c)]<<10|$t[t.charCodeAt(c+1)]<<4|$t[t.charCodeAt(c+2)]>>2,s[o++]=e>>8&255,s[o++]=e&255),s}function Cp(t){return ur[t>>18&63]+ur[t>>12&63]+ur[t>>6&63]+ur[t&63]}function Ip(t,e,r){for(var n,i=[],s=e;s<r;s+=3)n=(t[s]<<16&16711680)+(t[s+1]<<8&65280)+(t[s+2]&255),i.push(Cp(n));return i.join("")}function Rp(t){for(var e,r=t.length,n=r%3,i=[],s=16383,o=0,a=r-n;o<a;o+=s)i.push(Ip(t,o,o+s>a?a:o+s));return n===1?(e=t[r-1],i.push(ur[e>>2]+ur[e<<4&63]+"==")):n===2&&(e=(t[r-2]<<8)+t[r-1],i.push(ur[e>>10]+ur[e>>4&63]+ur[e<<2&63]+"=")),i.join("")}var pu={};/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */pu.read=function(t,e,r,n,i){var s,o,a=i*8-n-1,c=(1<<a)-1,l=c>>1,p=-7,g=r?i-1:0,y=r?-1:1,I=t[e+g];for(g+=y,s=I&(1<<-p)-1,I>>=-p,p+=a;p>0;s=s*256+t[e+g],g+=y,p-=8);for(o=s&(1<<-p)-1,s>>=-p,p+=n;p>0;o=o*256+t[e+g],g+=y,p-=8);if(s===0)s=1-l;else{if(s===c)return o?NaN:(I?-1:1)*(1/0);o=o+Math.pow(2,n),s=s-l}return(I?-1:1)*o*Math.pow(2,s-n)};pu.write=function(t,e,r,n,i,s){var o,a,c,l=s*8-i-1,p=(1<<l)-1,g=p>>1,y=i===23?Math.pow(2,-24)-Math.pow(2,-77):0,I=n?0:s-1,T=n?1:-1,D=e<0||e===0&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(a=isNaN(e)?1:0,o=p):(o=Math.floor(Math.log(e)/Math.LN2),e*(c=Math.pow(2,-o))<1&&(o--,c*=2),o+g>=1?e+=y/c:e+=y*Math.pow(2,1-g),e*c>=2&&(o++,c/=2),o+g>=p?(a=0,o=p):o+g>=1?(a=(e*c-1)*Math.pow(2,i),o=o+g):(a=e*Math.pow(2,g-1)*Math.pow(2,i),o=0));i>=8;t[r+I]=a&255,I+=T,a/=256,i-=8);for(o=o<<i|a,l+=i;l>0;t[r+I]=o&255,I+=T,o/=256,l-=8);t[r+I-T]|=D*128};/*!
2
+ * The buffer module from node.js, for the browser.
3
+ *
4
+ * @author Feross Aboukhadijeh <https://feross.org>
5
+ * @license MIT
6
+ */(function(t){const e=Js,r=pu,n=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;t.Buffer=a,t.SlowBuffer=N,t.INSPECT_MAX_BYTES=50;const i=2147483647;t.kMaxLength=i,a.TYPED_ARRAY_SUPPORT=s(),!a.TYPED_ARRAY_SUPPORT&&typeof console<"u"&&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 s(){try{const v=new Uint8Array(1),h={foo:function(){return 42}};return Object.setPrototypeOf(h,Uint8Array.prototype),Object.setPrototypeOf(v,h),v.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 o(v){if(v>i)throw new RangeError('The value "'+v+'" is invalid for option "size"');const h=new Uint8Array(v);return Object.setPrototypeOf(h,a.prototype),h}function a(v,h,f){if(typeof v=="number"){if(typeof h=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return g(v)}return c(v,h,f)}a.poolSize=8192;function c(v,h,f){if(typeof v=="string")return y(v,h);if(ArrayBuffer.isView(v))return T(v);if(v==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof v);if(ct(v,ArrayBuffer)||v&&ct(v.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(ct(v,SharedArrayBuffer)||v&&ct(v.buffer,SharedArrayBuffer)))return D(v,h,f);if(typeof v=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');const x=v.valueOf&&v.valueOf();if(x!=null&&x!==v)return a.from(x,h,f);const B=U(v);if(B)return B;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof v[Symbol.toPrimitive]=="function")return a.from(v[Symbol.toPrimitive]("string"),h,f);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof v)}a.from=function(v,h,f){return c(v,h,f)},Object.setPrototypeOf(a.prototype,Uint8Array.prototype),Object.setPrototypeOf(a,Uint8Array);function l(v){if(typeof v!="number")throw new TypeError('"size" argument must be of type number');if(v<0)throw new RangeError('The value "'+v+'" is invalid for option "size"')}function p(v,h,f){return l(v),v<=0?o(v):h!==void 0?typeof f=="string"?o(v).fill(h,f):o(v).fill(h):o(v)}a.alloc=function(v,h,f){return p(v,h,f)};function g(v){return l(v),o(v<0?0:M(v)|0)}a.allocUnsafe=function(v){return g(v)},a.allocUnsafeSlow=function(v){return g(v)};function y(v,h){if((typeof h!="string"||h==="")&&(h="utf8"),!a.isEncoding(h))throw new TypeError("Unknown encoding: "+h);const f=j(v,h)|0;let x=o(f);const B=x.write(v,h);return B!==f&&(x=x.slice(0,B)),x}function I(v){const h=v.length<0?0:M(v.length)|0,f=o(h);for(let x=0;x<h;x+=1)f[x]=v[x]&255;return f}function T(v){if(ct(v,Uint8Array)){const h=new Uint8Array(v);return D(h.buffer,h.byteOffset,h.byteLength)}return I(v)}function D(v,h,f){if(h<0||v.byteLength<h)throw new RangeError('"offset" is outside of buffer bounds');if(v.byteLength<h+(f||0))throw new RangeError('"length" is outside of buffer bounds');let x;return h===void 0&&f===void 0?x=new Uint8Array(v):f===void 0?x=new Uint8Array(v,h):x=new Uint8Array(v,h,f),Object.setPrototypeOf(x,a.prototype),x}function U(v){if(a.isBuffer(v)){const h=M(v.length)|0,f=o(h);return f.length===0||v.copy(f,0,0,h),f}if(v.length!==void 0)return typeof v.length!="number"||Ce(v.length)?o(0):I(v);if(v.type==="Buffer"&&Array.isArray(v.data))return I(v.data)}function M(v){if(v>=i)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+i.toString(16)+" bytes");return v|0}function N(v){return+v!=v&&(v=0),a.alloc(+v)}a.isBuffer=function(h){return h!=null&&h._isBuffer===!0&&h!==a.prototype},a.compare=function(h,f){if(ct(h,Uint8Array)&&(h=a.from(h,h.offset,h.byteLength)),ct(f,Uint8Array)&&(f=a.from(f,f.offset,f.byteLength)),!a.isBuffer(h)||!a.isBuffer(f))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(h===f)return 0;let x=h.length,B=f.length;for(let $=0,W=Math.min(x,B);$<W;++$)if(h[$]!==f[$]){x=h[$],B=f[$];break}return x<B?-1:B<x?1:0},a.isEncoding=function(h){switch(String(h).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(h,f){if(!Array.isArray(h))throw new TypeError('"list" argument must be an Array of Buffers');if(h.length===0)return a.alloc(0);let x;if(f===void 0)for(f=0,x=0;x<h.length;++x)f+=h[x].length;const B=a.allocUnsafe(f);let $=0;for(x=0;x<h.length;++x){let W=h[x];if(ct(W,Uint8Array))$+W.length>B.length?(a.isBuffer(W)||(W=a.from(W)),W.copy(B,$)):Uint8Array.prototype.set.call(B,W,$);else if(a.isBuffer(W))W.copy(B,$);else throw new TypeError('"list" argument must be an Array of Buffers');$+=W.length}return B};function j(v,h){if(a.isBuffer(v))return v.length;if(ArrayBuffer.isView(v)||ct(v,ArrayBuffer))return v.byteLength;if(typeof v!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof v);const f=v.length,x=arguments.length>2&&arguments[2]===!0;if(!x&&f===0)return 0;let B=!1;for(;;)switch(h){case"ascii":case"latin1":case"binary":return f;case"utf8":case"utf-8":return se(v).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return f*2;case"hex":return f>>>1;case"base64":return ke(v).length;default:if(B)return x?-1:se(v).length;h=(""+h).toLowerCase(),B=!0}}a.byteLength=j;function H(v,h,f){let x=!1;if((h===void 0||h<0)&&(h=0),h>this.length||((f===void 0||f>this.length)&&(f=this.length),f<=0)||(f>>>=0,h>>>=0,f<=h))return"";for(v||(v="utf8");;)switch(v){case"hex":return k(this,h,f);case"utf8":case"utf-8":return u(this,h,f);case"ascii":return E(this,h,f);case"latin1":case"binary":return S(this,h,f);case"base64":return w(this,h,f);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return L(this,h,f);default:if(x)throw new TypeError("Unknown encoding: "+v);v=(v+"").toLowerCase(),x=!0}}a.prototype._isBuffer=!0;function F(v,h,f){const x=v[h];v[h]=v[f],v[f]=x}a.prototype.swap16=function(){const h=this.length;if(h%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let f=0;f<h;f+=2)F(this,f,f+1);return this},a.prototype.swap32=function(){const h=this.length;if(h%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let f=0;f<h;f+=4)F(this,f,f+3),F(this,f+1,f+2);return this},a.prototype.swap64=function(){const h=this.length;if(h%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let f=0;f<h;f+=8)F(this,f,f+7),F(this,f+1,f+6),F(this,f+2,f+5),F(this,f+3,f+4);return this},a.prototype.toString=function(){const h=this.length;return h===0?"":arguments.length===0?u(this,0,h):H.apply(this,arguments)},a.prototype.toLocaleString=a.prototype.toString,a.prototype.equals=function(h){if(!a.isBuffer(h))throw new TypeError("Argument must be a Buffer");return this===h?!0:a.compare(this,h)===0},a.prototype.inspect=function(){let h="";const f=t.INSPECT_MAX_BYTES;return h=this.toString("hex",0,f).replace(/(.{2})/g,"$1 ").trim(),this.length>f&&(h+=" ... "),"<Buffer "+h+">"},n&&(a.prototype[n]=a.prototype.inspect),a.prototype.compare=function(h,f,x,B,$){if(ct(h,Uint8Array)&&(h=a.from(h,h.offset,h.byteLength)),!a.isBuffer(h))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof h);if(f===void 0&&(f=0),x===void 0&&(x=h?h.length:0),B===void 0&&(B=0),$===void 0&&($=this.length),f<0||x>h.length||B<0||$>this.length)throw new RangeError("out of range index");if(B>=$&&f>=x)return 0;if(B>=$)return-1;if(f>=x)return 1;if(f>>>=0,x>>>=0,B>>>=0,$>>>=0,this===h)return 0;let W=$-B,de=x-f;const fe=Math.min(W,de),ce=this.slice(B,$),Oe=h.slice(f,x);for(let ae=0;ae<fe;++ae)if(ce[ae]!==Oe[ae]){W=ce[ae],de=Oe[ae];break}return W<de?-1:de<W?1:0};function z(v,h,f,x,B){if(v.length===0)return-1;if(typeof f=="string"?(x=f,f=0):f>2147483647?f=2147483647:f<-2147483648&&(f=-2147483648),f=+f,Ce(f)&&(f=B?0:v.length-1),f<0&&(f=v.length+f),f>=v.length){if(B)return-1;f=v.length-1}else if(f<0)if(B)f=0;else return-1;if(typeof h=="string"&&(h=a.from(h,x)),a.isBuffer(h))return h.length===0?-1:X(v,h,f,x,B);if(typeof h=="number")return h=h&255,typeof Uint8Array.prototype.indexOf=="function"?B?Uint8Array.prototype.indexOf.call(v,h,f):Uint8Array.prototype.lastIndexOf.call(v,h,f):X(v,[h],f,x,B);throw new TypeError("val must be string, number or Buffer")}function X(v,h,f,x,B){let $=1,W=v.length,de=h.length;if(x!==void 0&&(x=String(x).toLowerCase(),x==="ucs2"||x==="ucs-2"||x==="utf16le"||x==="utf-16le")){if(v.length<2||h.length<2)return-1;$=2,W/=2,de/=2,f/=2}function fe(Oe,ae){return $===1?Oe[ae]:Oe.readUInt16BE(ae*$)}let ce;if(B){let Oe=-1;for(ce=f;ce<W;ce++)if(fe(v,ce)===fe(h,Oe===-1?0:ce-Oe)){if(Oe===-1&&(Oe=ce),ce-Oe+1===de)return Oe*$}else Oe!==-1&&(ce-=ce-Oe),Oe=-1}else for(f+de>W&&(f=W-de),ce=f;ce>=0;ce--){let Oe=!0;for(let ae=0;ae<de;ae++)if(fe(v,ce+ae)!==fe(h,ae)){Oe=!1;break}if(Oe)return ce}return-1}a.prototype.includes=function(h,f,x){return this.indexOf(h,f,x)!==-1},a.prototype.indexOf=function(h,f,x){return z(this,h,f,x,!0)},a.prototype.lastIndexOf=function(h,f,x){return z(this,h,f,x,!1)};function K(v,h,f,x){f=Number(f)||0;const B=v.length-f;x?(x=Number(x),x>B&&(x=B)):x=B;const $=h.length;x>$/2&&(x=$/2);let W;for(W=0;W<x;++W){const de=parseInt(h.substr(W*2,2),16);if(Ce(de))return W;v[f+W]=de}return W}function J(v,h,f,x){return Re(se(h,v.length-f),v,f,x)}function ne(v,h,f,x){return Re(xe(h),v,f,x)}function oe(v,h,f,x){return Re(ke(h),v,f,x)}function ue(v,h,f,x){return Re(Bt(h,v.length-f),v,f,x)}a.prototype.write=function(h,f,x,B){if(f===void 0)B="utf8",x=this.length,f=0;else if(x===void 0&&typeof f=="string")B=f,x=this.length,f=0;else if(isFinite(f))f=f>>>0,isFinite(x)?(x=x>>>0,B===void 0&&(B="utf8")):(B=x,x=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");const $=this.length-f;if((x===void 0||x>$)&&(x=$),h.length>0&&(x<0||f<0)||f>this.length)throw new RangeError("Attempt to write outside buffer bounds");B||(B="utf8");let W=!1;for(;;)switch(B){case"hex":return K(this,h,f,x);case"utf8":case"utf-8":return J(this,h,f,x);case"ascii":case"latin1":case"binary":return ne(this,h,f,x);case"base64":return oe(this,h,f,x);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return ue(this,h,f,x);default:if(W)throw new TypeError("Unknown encoding: "+B);B=(""+B).toLowerCase(),W=!0}},a.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function w(v,h,f){return h===0&&f===v.length?e.fromByteArray(v):e.fromByteArray(v.slice(h,f))}function u(v,h,f){f=Math.min(v.length,f);const x=[];let B=h;for(;B<f;){const $=v[B];let W=null,de=$>239?4:$>223?3:$>191?2:1;if(B+de<=f){let fe,ce,Oe,ae;switch(de){case 1:$<128&&(W=$);break;case 2:fe=v[B+1],(fe&192)===128&&(ae=($&31)<<6|fe&63,ae>127&&(W=ae));break;case 3:fe=v[B+1],ce=v[B+2],(fe&192)===128&&(ce&192)===128&&(ae=($&15)<<12|(fe&63)<<6|ce&63,ae>2047&&(ae<55296||ae>57343)&&(W=ae));break;case 4:fe=v[B+1],ce=v[B+2],Oe=v[B+3],(fe&192)===128&&(ce&192)===128&&(Oe&192)===128&&(ae=($&15)<<18|(fe&63)<<12|(ce&63)<<6|Oe&63,ae>65535&&ae<1114112&&(W=ae))}}W===null?(W=65533,de=1):W>65535&&(W-=65536,x.push(W>>>10&1023|55296),W=56320|W&1023),x.push(W),B+=de}return m(x)}const b=4096;function m(v){const h=v.length;if(h<=b)return String.fromCharCode.apply(String,v);let f="",x=0;for(;x<h;)f+=String.fromCharCode.apply(String,v.slice(x,x+=b));return f}function E(v,h,f){let x="";f=Math.min(v.length,f);for(let B=h;B<f;++B)x+=String.fromCharCode(v[B]&127);return x}function S(v,h,f){let x="";f=Math.min(v.length,f);for(let B=h;B<f;++B)x+=String.fromCharCode(v[B]);return x}function k(v,h,f){const x=v.length;(!h||h<0)&&(h=0),(!f||f<0||f>x)&&(f=x);let B="";for(let $=h;$<f;++$)B+=Ne[v[$]];return B}function L(v,h,f){const x=v.slice(h,f);let B="";for(let $=0;$<x.length-1;$+=2)B+=String.fromCharCode(x[$]+x[$+1]*256);return B}a.prototype.slice=function(h,f){const x=this.length;h=~~h,f=f===void 0?x:~~f,h<0?(h+=x,h<0&&(h=0)):h>x&&(h=x),f<0?(f+=x,f<0&&(f=0)):f>x&&(f=x),f<h&&(f=h);const B=this.subarray(h,f);return Object.setPrototypeOf(B,a.prototype),B};function _(v,h,f){if(v%1!==0||v<0)throw new RangeError("offset is not uint");if(v+h>f)throw new RangeError("Trying to access beyond buffer length")}a.prototype.readUintLE=a.prototype.readUIntLE=function(h,f,x){h=h>>>0,f=f>>>0,x||_(h,f,this.length);let B=this[h],$=1,W=0;for(;++W<f&&($*=256);)B+=this[h+W]*$;return B},a.prototype.readUintBE=a.prototype.readUIntBE=function(h,f,x){h=h>>>0,f=f>>>0,x||_(h,f,this.length);let B=this[h+--f],$=1;for(;f>0&&($*=256);)B+=this[h+--f]*$;return B},a.prototype.readUint8=a.prototype.readUInt8=function(h,f){return h=h>>>0,f||_(h,1,this.length),this[h]},a.prototype.readUint16LE=a.prototype.readUInt16LE=function(h,f){return h=h>>>0,f||_(h,2,this.length),this[h]|this[h+1]<<8},a.prototype.readUint16BE=a.prototype.readUInt16BE=function(h,f){return h=h>>>0,f||_(h,2,this.length),this[h]<<8|this[h+1]},a.prototype.readUint32LE=a.prototype.readUInt32LE=function(h,f){return h=h>>>0,f||_(h,4,this.length),(this[h]|this[h+1]<<8|this[h+2]<<16)+this[h+3]*16777216},a.prototype.readUint32BE=a.prototype.readUInt32BE=function(h,f){return h=h>>>0,f||_(h,4,this.length),this[h]*16777216+(this[h+1]<<16|this[h+2]<<8|this[h+3])},a.prototype.readBigUInt64LE=ft(function(h){h=h>>>0,q(h,"offset");const f=this[h],x=this[h+7];(f===void 0||x===void 0)&&Z(h,this.length-8);const B=f+this[++h]*2**8+this[++h]*2**16+this[++h]*2**24,$=this[++h]+this[++h]*2**8+this[++h]*2**16+x*2**24;return BigInt(B)+(BigInt($)<<BigInt(32))}),a.prototype.readBigUInt64BE=ft(function(h){h=h>>>0,q(h,"offset");const f=this[h],x=this[h+7];(f===void 0||x===void 0)&&Z(h,this.length-8);const B=f*2**24+this[++h]*2**16+this[++h]*2**8+this[++h],$=this[++h]*2**24+this[++h]*2**16+this[++h]*2**8+x;return(BigInt(B)<<BigInt(32))+BigInt($)}),a.prototype.readIntLE=function(h,f,x){h=h>>>0,f=f>>>0,x||_(h,f,this.length);let B=this[h],$=1,W=0;for(;++W<f&&($*=256);)B+=this[h+W]*$;return $*=128,B>=$&&(B-=Math.pow(2,8*f)),B},a.prototype.readIntBE=function(h,f,x){h=h>>>0,f=f>>>0,x||_(h,f,this.length);let B=f,$=1,W=this[h+--B];for(;B>0&&($*=256);)W+=this[h+--B]*$;return $*=128,W>=$&&(W-=Math.pow(2,8*f)),W},a.prototype.readInt8=function(h,f){return h=h>>>0,f||_(h,1,this.length),this[h]&128?(255-this[h]+1)*-1:this[h]},a.prototype.readInt16LE=function(h,f){h=h>>>0,f||_(h,2,this.length);const x=this[h]|this[h+1]<<8;return x&32768?x|4294901760:x},a.prototype.readInt16BE=function(h,f){h=h>>>0,f||_(h,2,this.length);const x=this[h+1]|this[h]<<8;return x&32768?x|4294901760:x},a.prototype.readInt32LE=function(h,f){return h=h>>>0,f||_(h,4,this.length),this[h]|this[h+1]<<8|this[h+2]<<16|this[h+3]<<24},a.prototype.readInt32BE=function(h,f){return h=h>>>0,f||_(h,4,this.length),this[h]<<24|this[h+1]<<16|this[h+2]<<8|this[h+3]},a.prototype.readBigInt64LE=ft(function(h){h=h>>>0,q(h,"offset");const f=this[h],x=this[h+7];(f===void 0||x===void 0)&&Z(h,this.length-8);const B=this[h+4]+this[h+5]*2**8+this[h+6]*2**16+(x<<24);return(BigInt(B)<<BigInt(32))+BigInt(f+this[++h]*2**8+this[++h]*2**16+this[++h]*2**24)}),a.prototype.readBigInt64BE=ft(function(h){h=h>>>0,q(h,"offset");const f=this[h],x=this[h+7];(f===void 0||x===void 0)&&Z(h,this.length-8);const B=(f<<24)+this[++h]*2**16+this[++h]*2**8+this[++h];return(BigInt(B)<<BigInt(32))+BigInt(this[++h]*2**24+this[++h]*2**16+this[++h]*2**8+x)}),a.prototype.readFloatLE=function(h,f){return h=h>>>0,f||_(h,4,this.length),r.read(this,h,!0,23,4)},a.prototype.readFloatBE=function(h,f){return h=h>>>0,f||_(h,4,this.length),r.read(this,h,!1,23,4)},a.prototype.readDoubleLE=function(h,f){return h=h>>>0,f||_(h,8,this.length),r.read(this,h,!0,52,8)},a.prototype.readDoubleBE=function(h,f){return h=h>>>0,f||_(h,8,this.length),r.read(this,h,!1,52,8)};function d(v,h,f,x,B,$){if(!a.isBuffer(v))throw new TypeError('"buffer" argument must be a Buffer instance');if(h>B||h<$)throw new RangeError('"value" argument is out of bounds');if(f+x>v.length)throw new RangeError("Index out of range")}a.prototype.writeUintLE=a.prototype.writeUIntLE=function(h,f,x,B){if(h=+h,f=f>>>0,x=x>>>0,!B){const de=Math.pow(2,8*x)-1;d(this,h,f,x,de,0)}let $=1,W=0;for(this[f]=h&255;++W<x&&($*=256);)this[f+W]=h/$&255;return f+x},a.prototype.writeUintBE=a.prototype.writeUIntBE=function(h,f,x,B){if(h=+h,f=f>>>0,x=x>>>0,!B){const de=Math.pow(2,8*x)-1;d(this,h,f,x,de,0)}let $=x-1,W=1;for(this[f+$]=h&255;--$>=0&&(W*=256);)this[f+$]=h/W&255;return f+x},a.prototype.writeUint8=a.prototype.writeUInt8=function(h,f,x){return h=+h,f=f>>>0,x||d(this,h,f,1,255,0),this[f]=h&255,f+1},a.prototype.writeUint16LE=a.prototype.writeUInt16LE=function(h,f,x){return h=+h,f=f>>>0,x||d(this,h,f,2,65535,0),this[f]=h&255,this[f+1]=h>>>8,f+2},a.prototype.writeUint16BE=a.prototype.writeUInt16BE=function(h,f,x){return h=+h,f=f>>>0,x||d(this,h,f,2,65535,0),this[f]=h>>>8,this[f+1]=h&255,f+2},a.prototype.writeUint32LE=a.prototype.writeUInt32LE=function(h,f,x){return h=+h,f=f>>>0,x||d(this,h,f,4,4294967295,0),this[f+3]=h>>>24,this[f+2]=h>>>16,this[f+1]=h>>>8,this[f]=h&255,f+4},a.prototype.writeUint32BE=a.prototype.writeUInt32BE=function(h,f,x){return h=+h,f=f>>>0,x||d(this,h,f,4,4294967295,0),this[f]=h>>>24,this[f+1]=h>>>16,this[f+2]=h>>>8,this[f+3]=h&255,f+4};function A(v,h,f,x,B){R(h,x,B,v,f,7);let $=Number(h&BigInt(4294967295));v[f++]=$,$=$>>8,v[f++]=$,$=$>>8,v[f++]=$,$=$>>8,v[f++]=$;let W=Number(h>>BigInt(32)&BigInt(4294967295));return v[f++]=W,W=W>>8,v[f++]=W,W=W>>8,v[f++]=W,W=W>>8,v[f++]=W,f}function Y(v,h,f,x,B){R(h,x,B,v,f,7);let $=Number(h&BigInt(4294967295));v[f+7]=$,$=$>>8,v[f+6]=$,$=$>>8,v[f+5]=$,$=$>>8,v[f+4]=$;let W=Number(h>>BigInt(32)&BigInt(4294967295));return v[f+3]=W,W=W>>8,v[f+2]=W,W=W>>8,v[f+1]=W,W=W>>8,v[f]=W,f+8}a.prototype.writeBigUInt64LE=ft(function(h,f=0){return A(this,h,f,BigInt(0),BigInt("0xffffffffffffffff"))}),a.prototype.writeBigUInt64BE=ft(function(h,f=0){return Y(this,h,f,BigInt(0),BigInt("0xffffffffffffffff"))}),a.prototype.writeIntLE=function(h,f,x,B){if(h=+h,f=f>>>0,!B){const fe=Math.pow(2,8*x-1);d(this,h,f,x,fe-1,-fe)}let $=0,W=1,de=0;for(this[f]=h&255;++$<x&&(W*=256);)h<0&&de===0&&this[f+$-1]!==0&&(de=1),this[f+$]=(h/W>>0)-de&255;return f+x},a.prototype.writeIntBE=function(h,f,x,B){if(h=+h,f=f>>>0,!B){const fe=Math.pow(2,8*x-1);d(this,h,f,x,fe-1,-fe)}let $=x-1,W=1,de=0;for(this[f+$]=h&255;--$>=0&&(W*=256);)h<0&&de===0&&this[f+$+1]!==0&&(de=1),this[f+$]=(h/W>>0)-de&255;return f+x},a.prototype.writeInt8=function(h,f,x){return h=+h,f=f>>>0,x||d(this,h,f,1,127,-128),h<0&&(h=255+h+1),this[f]=h&255,f+1},a.prototype.writeInt16LE=function(h,f,x){return h=+h,f=f>>>0,x||d(this,h,f,2,32767,-32768),this[f]=h&255,this[f+1]=h>>>8,f+2},a.prototype.writeInt16BE=function(h,f,x){return h=+h,f=f>>>0,x||d(this,h,f,2,32767,-32768),this[f]=h>>>8,this[f+1]=h&255,f+2},a.prototype.writeInt32LE=function(h,f,x){return h=+h,f=f>>>0,x||d(this,h,f,4,2147483647,-2147483648),this[f]=h&255,this[f+1]=h>>>8,this[f+2]=h>>>16,this[f+3]=h>>>24,f+4},a.prototype.writeInt32BE=function(h,f,x){return h=+h,f=f>>>0,x||d(this,h,f,4,2147483647,-2147483648),h<0&&(h=4294967295+h+1),this[f]=h>>>24,this[f+1]=h>>>16,this[f+2]=h>>>8,this[f+3]=h&255,f+4},a.prototype.writeBigInt64LE=ft(function(h,f=0){return A(this,h,f,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),a.prototype.writeBigInt64BE=ft(function(h,f=0){return Y(this,h,f,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function ee(v,h,f,x,B,$){if(f+x>v.length)throw new RangeError("Index out of range");if(f<0)throw new RangeError("Index out of range")}function O(v,h,f,x,B){return h=+h,f=f>>>0,B||ee(v,h,f,4),r.write(v,h,f,x,23,4),f+4}a.prototype.writeFloatLE=function(h,f,x){return O(this,h,f,!0,x)},a.prototype.writeFloatBE=function(h,f,x){return O(this,h,f,!1,x)};function P(v,h,f,x,B){return h=+h,f=f>>>0,B||ee(v,h,f,8),r.write(v,h,f,x,52,8),f+8}a.prototype.writeDoubleLE=function(h,f,x){return P(this,h,f,!0,x)},a.prototype.writeDoubleBE=function(h,f,x){return P(this,h,f,!1,x)},a.prototype.copy=function(h,f,x,B){if(!a.isBuffer(h))throw new TypeError("argument should be a Buffer");if(x||(x=0),!B&&B!==0&&(B=this.length),f>=h.length&&(f=h.length),f||(f=0),B>0&&B<x&&(B=x),B===x||h.length===0||this.length===0)return 0;if(f<0)throw new RangeError("targetStart out of bounds");if(x<0||x>=this.length)throw new RangeError("Index out of range");if(B<0)throw new RangeError("sourceEnd out of bounds");B>this.length&&(B=this.length),h.length-f<B-x&&(B=h.length-f+x);const $=B-x;return this===h&&typeof Uint8Array.prototype.copyWithin=="function"?this.copyWithin(f,x,B):Uint8Array.prototype.set.call(h,this.subarray(x,B),f),$},a.prototype.fill=function(h,f,x,B){if(typeof h=="string"){if(typeof f=="string"?(B=f,f=0,x=this.length):typeof x=="string"&&(B=x,x=this.length),B!==void 0&&typeof B!="string")throw new TypeError("encoding must be a string");if(typeof B=="string"&&!a.isEncoding(B))throw new TypeError("Unknown encoding: "+B);if(h.length===1){const W=h.charCodeAt(0);(B==="utf8"&&W<128||B==="latin1")&&(h=W)}}else typeof h=="number"?h=h&255:typeof h=="boolean"&&(h=Number(h));if(f<0||this.length<f||this.length<x)throw new RangeError("Out of range index");if(x<=f)return this;f=f>>>0,x=x===void 0?this.length:x>>>0,h||(h=0);let $;if(typeof h=="number")for($=f;$<x;++$)this[$]=h;else{const W=a.isBuffer(h)?h:a.from(h,B),de=W.length;if(de===0)throw new TypeError('The value "'+h+'" is invalid for argument "value"');for($=0;$<x-f;++$)this[$+f]=W[$%de]}return this};const V={};function Q(v,h,f){V[v]=class extends f{constructor(){super(),Object.defineProperty(this,"message",{value:h.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${v}]`,this.stack,delete this.name}get code(){return v}set code(B){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:B,writable:!0})}toString(){return`${this.name} [${v}]: ${this.message}`}}}Q("ERR_BUFFER_OUT_OF_BOUNDS",function(v){return v?`${v} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError),Q("ERR_INVALID_ARG_TYPE",function(v,h){return`The "${v}" argument must be of type number. Received type ${typeof h}`},TypeError),Q("ERR_OUT_OF_RANGE",function(v,h,f){let x=`The value of "${v}" is out of range.`,B=f;return Number.isInteger(f)&&Math.abs(f)>2**32?B=ge(String(f)):typeof f=="bigint"&&(B=String(f),(f>BigInt(2)**BigInt(32)||f<-(BigInt(2)**BigInt(32)))&&(B=ge(B)),B+="n"),x+=` It must be ${h}. Received ${B}`,x},RangeError);function ge(v){let h="",f=v.length;const x=v[0]==="-"?1:0;for(;f>=x+4;f-=3)h=`_${v.slice(f-3,f)}${h}`;return`${v.slice(0,f)}${h}`}function C(v,h,f){q(h,"offset"),(v[h]===void 0||v[h+f]===void 0)&&Z(h,v.length-(f+1))}function R(v,h,f,x,B,$){if(v>f||v<h){const W=typeof h=="bigint"?"n":"";let de;throw $>3?h===0||h===BigInt(0)?de=`>= 0${W} and < 2${W} ** ${($+1)*8}${W}`:de=`>= -(2${W} ** ${($+1)*8-1}${W}) and < 2 ** ${($+1)*8-1}${W}`:de=`>= ${h}${W} and <= ${f}${W}`,new V.ERR_OUT_OF_RANGE("value",de,v)}C(x,B,$)}function q(v,h){if(typeof v!="number")throw new V.ERR_INVALID_ARG_TYPE(h,"number",v)}function Z(v,h,f){throw Math.floor(v)!==v?(q(v,f),new V.ERR_OUT_OF_RANGE(f||"offset","an integer",v)):h<0?new V.ERR_BUFFER_OUT_OF_BOUNDS:new V.ERR_OUT_OF_RANGE(f||"offset",`>= ${f?1:0} and <= ${h}`,v)}const he=/[^+/0-9A-Za-z-_]/g;function be(v){if(v=v.split("=")[0],v=v.trim().replace(he,""),v.length<2)return"";for(;v.length%4!==0;)v=v+"=";return v}function se(v,h){h=h||1/0;let f;const x=v.length;let B=null;const $=[];for(let W=0;W<x;++W){if(f=v.charCodeAt(W),f>55295&&f<57344){if(!B){if(f>56319){(h-=3)>-1&&$.push(239,191,189);continue}else if(W+1===x){(h-=3)>-1&&$.push(239,191,189);continue}B=f;continue}if(f<56320){(h-=3)>-1&&$.push(239,191,189),B=f;continue}f=(B-55296<<10|f-56320)+65536}else B&&(h-=3)>-1&&$.push(239,191,189);if(B=null,f<128){if((h-=1)<0)break;$.push(f)}else if(f<2048){if((h-=2)<0)break;$.push(f>>6|192,f&63|128)}else if(f<65536){if((h-=3)<0)break;$.push(f>>12|224,f>>6&63|128,f&63|128)}else if(f<1114112){if((h-=4)<0)break;$.push(f>>18|240,f>>12&63|128,f>>6&63|128,f&63|128)}else throw new Error("Invalid code point")}return $}function xe(v){const h=[];for(let f=0;f<v.length;++f)h.push(v.charCodeAt(f)&255);return h}function Bt(v,h){let f,x,B;const $=[];for(let W=0;W<v.length&&!((h-=2)<0);++W)f=v.charCodeAt(W),x=f>>8,B=f%256,$.push(B),$.push(x);return $}function ke(v){return e.toByteArray(be(v))}function Re(v,h,f,x){let B;for(B=0;B<x&&!(B+f>=h.length||B>=v.length);++B)h[B+f]=v[B];return B}function ct(v,h){return v instanceof h||v!=null&&v.constructor!=null&&v.constructor.name!=null&&v.constructor.name===h.name}function Ce(v){return v!==v}const Ne=function(){const v="0123456789abcdef",h=new Array(256);for(let f=0;f<16;++f){const x=f*16;for(let B=0;B<16;++B)h[x+B]=v[f]+v[B]}return h}();function ft(v){return typeof BigInt>"u"?Ie:v}function Ie(){throw new Error("BigInt not supported")}})($i);/*! safe-buffer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */(function(t,e){var r=$i,n=r.Buffer;function i(o,a){for(var c in o)a[c]=o[c]}n.from&&n.alloc&&n.allocUnsafe&&n.allocUnsafeSlow?t.exports=r:(i(r,e),e.Buffer=s);function s(o,a,c){return n(o,a,c)}s.prototype=Object.create(n.prototype),i(n,s),s.from=function(o,a,c){if(typeof o=="number")throw new TypeError("Argument must not be a number");return n(o,a,c)},s.alloc=function(o,a,c){if(typeof o!="number")throw new TypeError("Argument must be a number");var l=n(o);return a!==void 0?typeof c=="string"?l.fill(a,c):l.fill(a):l.fill(0),l},s.allocUnsafe=function(o){if(typeof o!="number")throw new TypeError("Argument must be a number");return n(o)},s.allocUnsafeSlow=function(o){if(typeof o!="number")throw new TypeError("Argument must be a number");return r.SlowBuffer(o)}})(Fa,Fa.exports);var Pr=Fa.exports,kh=Pr.Buffer;function Zs(t,e){this._block=kh.alloc(t),this._finalSize=e,this._blockSize=t,this._len=0}Zs.prototype.update=function(t,e){typeof t=="string"&&(e=e||"utf8",t=kh.from(t,e));for(var r=this._block,n=this._blockSize,i=t.length,s=this._len,o=0;o<i;){for(var a=s%n,c=Math.min(i-o,n-a),l=0;l<c;l++)r[a+l]=t[o+l];s+=c,o+=c,s%n===0&&this._update(r)}return this._len+=i,this};Zs.prototype.digest=function(t){var e=this._len%this._blockSize;this._block[e]=128,this._block.fill(0,e+1),e>=this._finalSize&&(this._update(this._block),this._block.fill(0));var r=this._len*8;if(r<=4294967295)this._block.writeUInt32BE(r,this._blockSize-4);else{var n=(r&4294967295)>>>0,i=(r-n)/4294967296;this._block.writeUInt32BE(i,this._blockSize-8),this._block.writeUInt32BE(n,this._blockSize-4)}this._update(this._block);var s=this._hash();return t?s.toString(t):s};Zs.prototype._update=function(){throw new Error("_update must be implemented by subclass")};var ci=Zs,Ap=Xt,Nh=ci,Tp=Pr.Buffer,kp=[1518500249,1859775393,-1894007588,-899497514],Np=new Array(80);function Fi(){this.init(),this._w=Np,Nh.call(this,64,56)}Ap(Fi,Nh);Fi.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this};function Op(t){return t<<5|t>>>27}function Lp(t){return t<<30|t>>>2}function Bp(t,e,r,n){return t===0?e&r|~e&n:t===2?e&r|e&n|r&n:e^r^n}Fi.prototype._update=function(t){for(var e=this._w,r=this._a|0,n=this._b|0,i=this._c|0,s=this._d|0,o=this._e|0,a=0;a<16;++a)e[a]=t.readInt32BE(a*4);for(;a<80;++a)e[a]=e[a-3]^e[a-8]^e[a-14]^e[a-16];for(var c=0;c<80;++c){var l=~~(c/20),p=Op(r)+Bp(l,n,i,s)+o+e[c]+kp[l]|0;o=s,s=i,i=Lp(n),n=r,r=p}this._a=r+this._a|0,this._b=n+this._b|0,this._c=i+this._c|0,this._d=s+this._d|0,this._e=o+this._e|0};Fi.prototype._hash=function(){var t=Tp.allocUnsafe(20);return t.writeInt32BE(this._a|0,0),t.writeInt32BE(this._b|0,4),t.writeInt32BE(this._c|0,8),t.writeInt32BE(this._d|0,12),t.writeInt32BE(this._e|0,16),t};var Pp=Fi,Dp=Xt,Oh=ci,jp=Pr.Buffer,$p=[1518500249,1859775393,-1894007588,-899497514],Fp=new Array(80);function Ui(){this.init(),this._w=Fp,Oh.call(this,64,56)}Dp(Ui,Oh);Ui.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this};function Up(t){return t<<1|t>>>31}function Hp(t){return t<<5|t>>>27}function Wp(t){return t<<30|t>>>2}function Vp(t,e,r,n){return t===0?e&r|~e&n:t===2?e&r|e&n|r&n:e^r^n}Ui.prototype._update=function(t){for(var e=this._w,r=this._a|0,n=this._b|0,i=this._c|0,s=this._d|0,o=this._e|0,a=0;a<16;++a)e[a]=t.readInt32BE(a*4);for(;a<80;++a)e[a]=Up(e[a-3]^e[a-8]^e[a-14]^e[a-16]);for(var c=0;c<80;++c){var l=~~(c/20),p=Hp(r)+Vp(l,n,i,s)+o+e[c]+$p[l]|0;o=s,s=i,i=Wp(n),n=r,r=p}this._a=r+this._a|0,this._b=n+this._b|0,this._c=i+this._c|0,this._d=s+this._d|0,this._e=o+this._e|0};Ui.prototype._hash=function(){var t=jp.allocUnsafe(20);return t.writeInt32BE(this._a|0,0),t.writeInt32BE(this._b|0,4),t.writeInt32BE(this._c|0,8),t.writeInt32BE(this._d|0,12),t.writeInt32BE(this._e|0,16),t};var zp=Ui,qp=Xt,Lh=ci,Gp=Pr.Buffer,Jp=[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],Zp=new Array(64);function Hi(){this.init(),this._w=Zp,Lh.call(this,64,56)}qp(Hi,Lh);Hi.prototype.init=function(){return this._a=1779033703,this._b=3144134277,this._c=1013904242,this._d=2773480762,this._e=1359893119,this._f=2600822924,this._g=528734635,this._h=1541459225,this};function Qp(t,e,r){return r^t&(e^r)}function Yp(t,e,r){return t&e|r&(t|e)}function Kp(t){return(t>>>2|t<<30)^(t>>>13|t<<19)^(t>>>22|t<<10)}function Xp(t){return(t>>>6|t<<26)^(t>>>11|t<<21)^(t>>>25|t<<7)}function eg(t){return(t>>>7|t<<25)^(t>>>18|t<<14)^t>>>3}function tg(t){return(t>>>17|t<<15)^(t>>>19|t<<13)^t>>>10}Hi.prototype._update=function(t){for(var e=this._w,r=this._a|0,n=this._b|0,i=this._c|0,s=this._d|0,o=this._e|0,a=this._f|0,c=this._g|0,l=this._h|0,p=0;p<16;++p)e[p]=t.readInt32BE(p*4);for(;p<64;++p)e[p]=tg(e[p-2])+e[p-7]+eg(e[p-15])+e[p-16]|0;for(var g=0;g<64;++g){var y=l+Xp(o)+Qp(o,a,c)+Jp[g]+e[g]|0,I=Kp(r)+Yp(r,n,i)|0;l=c,c=a,a=o,o=s+y|0,s=i,i=n,n=r,r=y+I|0}this._a=r+this._a|0,this._b=n+this._b|0,this._c=i+this._c|0,this._d=s+this._d|0,this._e=o+this._e|0,this._f=a+this._f|0,this._g=c+this._g|0,this._h=l+this._h|0};Hi.prototype._hash=function(){var t=Gp.allocUnsafe(32);return t.writeInt32BE(this._a,0),t.writeInt32BE(this._b,4),t.writeInt32BE(this._c,8),t.writeInt32BE(this._d,12),t.writeInt32BE(this._e,16),t.writeInt32BE(this._f,20),t.writeInt32BE(this._g,24),t.writeInt32BE(this._h,28),t};var Bh=Hi,rg=Xt,ng=Bh,ig=ci,sg=Pr.Buffer,og=new Array(64);function Qs(){this.init(),this._w=og,ig.call(this,64,56)}rg(Qs,ng);Qs.prototype.init=function(){return this._a=3238371032,this._b=914150663,this._c=812702999,this._d=4144912697,this._e=4290775857,this._f=1750603025,this._g=1694076839,this._h=3204075428,this};Qs.prototype._hash=function(){var t=sg.allocUnsafe(28);return t.writeInt32BE(this._a,0),t.writeInt32BE(this._b,4),t.writeInt32BE(this._c,8),t.writeInt32BE(this._d,12),t.writeInt32BE(this._e,16),t.writeInt32BE(this._f,20),t.writeInt32BE(this._g,24),t};var ag=Qs,ug=Xt,Ph=ci,cg=Pr.Buffer,mc=[1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591],lg=new Array(160);function Wi(){this.init(),this._w=lg,Ph.call(this,128,112)}ug(Wi,Ph);Wi.prototype.init=function(){return this._ah=1779033703,this._bh=3144134277,this._ch=1013904242,this._dh=2773480762,this._eh=1359893119,this._fh=2600822924,this._gh=528734635,this._hh=1541459225,this._al=4089235720,this._bl=2227873595,this._cl=4271175723,this._dl=1595750129,this._el=2917565137,this._fl=725511199,this._gl=4215389547,this._hl=327033209,this};function yc(t,e,r){return r^t&(e^r)}function _c(t,e,r){return t&e|r&(t|e)}function wc(t,e){return(t>>>28|e<<4)^(e>>>2|t<<30)^(e>>>7|t<<25)}function Ec(t,e){return(t>>>14|e<<18)^(t>>>18|e<<14)^(e>>>9|t<<23)}function hg(t,e){return(t>>>1|e<<31)^(t>>>8|e<<24)^t>>>7}function fg(t,e){return(t>>>1|e<<31)^(t>>>8|e<<24)^(t>>>7|e<<25)}function dg(t,e){return(t>>>19|e<<13)^(e>>>29|t<<3)^t>>>6}function pg(t,e){return(t>>>19|e<<13)^(e>>>29|t<<3)^(t>>>6|e<<26)}function dt(t,e){return t>>>0<e>>>0?1:0}Wi.prototype._update=function(t){for(var e=this._w,r=this._ah|0,n=this._bh|0,i=this._ch|0,s=this._dh|0,o=this._eh|0,a=this._fh|0,c=this._gh|0,l=this._hh|0,p=this._al|0,g=this._bl|0,y=this._cl|0,I=this._dl|0,T=this._el|0,D=this._fl|0,U=this._gl|0,M=this._hl|0,N=0;N<32;N+=2)e[N]=t.readInt32BE(N*4),e[N+1]=t.readInt32BE(N*4+4);for(;N<160;N+=2){var j=e[N-30],H=e[N-15*2+1],F=hg(j,H),z=fg(H,j);j=e[N-2*2],H=e[N-2*2+1];var X=dg(j,H),K=pg(H,j),J=e[N-7*2],ne=e[N-7*2+1],oe=e[N-16*2],ue=e[N-16*2+1],w=z+ne|0,u=F+J+dt(w,z)|0;w=w+K|0,u=u+X+dt(w,K)|0,w=w+ue|0,u=u+oe+dt(w,ue)|0,e[N]=u,e[N+1]=w}for(var b=0;b<160;b+=2){u=e[b],w=e[b+1];var m=_c(r,n,i),E=_c(p,g,y),S=wc(r,p),k=wc(p,r),L=Ec(o,T),_=Ec(T,o),d=mc[b],A=mc[b+1],Y=yc(o,a,c),ee=yc(T,D,U),O=M+_|0,P=l+L+dt(O,M)|0;O=O+ee|0,P=P+Y+dt(O,ee)|0,O=O+A|0,P=P+d+dt(O,A)|0,O=O+w|0,P=P+u+dt(O,w)|0;var V=k+E|0,Q=S+m+dt(V,k)|0;l=c,M=U,c=a,U=D,a=o,D=T,T=I+O|0,o=s+P+dt(T,I)|0,s=i,I=y,i=n,y=g,n=r,g=p,p=O+V|0,r=P+Q+dt(p,O)|0}this._al=this._al+p|0,this._bl=this._bl+g|0,this._cl=this._cl+y|0,this._dl=this._dl+I|0,this._el=this._el+T|0,this._fl=this._fl+D|0,this._gl=this._gl+U|0,this._hl=this._hl+M|0,this._ah=this._ah+r+dt(this._al,p)|0,this._bh=this._bh+n+dt(this._bl,g)|0,this._ch=this._ch+i+dt(this._cl,y)|0,this._dh=this._dh+s+dt(this._dl,I)|0,this._eh=this._eh+o+dt(this._el,T)|0,this._fh=this._fh+a+dt(this._fl,D)|0,this._gh=this._gh+c+dt(this._gl,U)|0,this._hh=this._hh+l+dt(this._hl,M)|0};Wi.prototype._hash=function(){var t=cg.allocUnsafe(64);function e(r,n,i){t.writeInt32BE(r,i),t.writeInt32BE(n,i+4)}return e(this._ah,this._al,0),e(this._bh,this._bl,8),e(this._ch,this._cl,16),e(this._dh,this._dl,24),e(this._eh,this._el,32),e(this._fh,this._fl,40),e(this._gh,this._gl,48),e(this._hh,this._hl,56),t};var Dh=Wi,gg=Xt,bg=Dh,vg=ci,mg=Pr.Buffer,yg=new Array(160);function Ys(){this.init(),this._w=yg,vg.call(this,128,112)}gg(Ys,bg);Ys.prototype.init=function(){return this._ah=3418070365,this._bh=1654270250,this._ch=2438529370,this._dh=355462360,this._eh=1731405415,this._fh=2394180231,this._gh=3675008525,this._hh=1203062813,this._al=3238371032,this._bl=914150663,this._cl=812702999,this._dl=4144912697,this._el=4290775857,this._fl=1750603025,this._gl=1694076839,this._hl=3204075428,this};Ys.prototype._hash=function(){var t=mg.allocUnsafe(48);function e(r,n,i){t.writeInt32BE(r,i),t.writeInt32BE(n,i+4)}return e(this._ah,this._al,0),e(this._bh,this._bl,8),e(this._ch,this._cl,16),e(this._dh,this._dl,24),e(this._eh,this._el,32),e(this._fh,this._fl,40),t};var _g=Ys,gn=Ah.exports=function(e){e=e.toLowerCase();var r=gn[e];if(!r)throw new Error(e+" is not supported (we accept pull requests)");return new r};gn.sha=Pp;gn.sha1=zp;gn.sha224=ag;gn.sha256=Bh;gn.sha384=_g;gn.sha512=Dh;var wg=Ah.exports,re={},Eg=String.prototype.replace,Sg=/%20/g,ea={RFC1738:"RFC1738",RFC3986:"RFC3986"},gu={default:ea.RFC3986,formatters:{RFC1738:function(t){return Eg.call(t,Sg,"+")},RFC3986:function(t){return String(t)}},RFC1738:ea.RFC1738,RFC3986:ea.RFC3986},xg=gu,ta=Object.prototype.hasOwnProperty,en=Array.isArray,rr=function(){for(var t=[],e=0;e<256;++e)t.push("%"+((e<16?"0":"")+e.toString(16)).toUpperCase());return t}(),Mg=function(e){for(;e.length>1;){var r=e.pop(),n=r.obj[r.prop];if(en(n)){for(var i=[],s=0;s<n.length;++s)typeof n[s]<"u"&&i.push(n[s]);r.obj[r.prop]=i}}},jh=function(e,r){for(var n=r&&r.plainObjects?Object.create(null):{},i=0;i<e.length;++i)typeof e[i]<"u"&&(n[i]=e[i]);return n},Cg=function t(e,r,n){if(!r)return e;if(typeof r!="object"){if(en(e))e.push(r);else if(e&&typeof e=="object")(n&&(n.plainObjects||n.allowPrototypes)||!ta.call(Object.prototype,r))&&(e[r]=!0);else return[e,r];return e}if(!e||typeof e!="object")return[e].concat(r);var i=e;return en(e)&&!en(r)&&(i=jh(e,n)),en(e)&&en(r)?(r.forEach(function(s,o){if(ta.call(e,o)){var a=e[o];a&&typeof a=="object"&&s&&typeof s=="object"?e[o]=t(a,s,n):e.push(s)}else e[o]=s}),e):Object.keys(r).reduce(function(s,o){var a=r[o];return ta.call(s,o)?s[o]=t(s[o],a,n):s[o]=a,s},i)},Ig=function(e,r){return Object.keys(r).reduce(function(n,i){return n[i]=r[i],n},e)},Rg=function(t,e,r){var n=t.replace(/\+/g," ");if(r==="iso-8859-1")return n.replace(/%[0-9a-f]{2}/gi,unescape);try{return decodeURIComponent(n)}catch{return n}},Ag=function(e,r,n,i,s){if(e.length===0)return e;var o=e;if(typeof e=="symbol"?o=Symbol.prototype.toString.call(e):typeof e!="string"&&(o=String(e)),n==="iso-8859-1")return escape(o).replace(/%u[0-9a-f]{4}/gi,function(p){return"%26%23"+parseInt(p.slice(2),16)+"%3B"});for(var a="",c=0;c<o.length;++c){var l=o.charCodeAt(c);if(l===45||l===46||l===95||l===126||l>=48&&l<=57||l>=65&&l<=90||l>=97&&l<=122||s===xg.RFC1738&&(l===40||l===41)){a+=o.charAt(c);continue}if(l<128){a=a+rr[l];continue}if(l<2048){a=a+(rr[192|l>>6]+rr[128|l&63]);continue}if(l<55296||l>=57344){a=a+(rr[224|l>>12]+rr[128|l>>6&63]+rr[128|l&63]);continue}c+=1,l=65536+((l&1023)<<10|o.charCodeAt(c)&1023),a+=rr[240|l>>18]+rr[128|l>>12&63]+rr[128|l>>6&63]+rr[128|l&63]}return a},Tg=function(e){for(var r=[{obj:{o:e},prop:"o"}],n=[],i=0;i<r.length;++i)for(var s=r[i],o=s.obj[s.prop],a=Object.keys(o),c=0;c<a.length;++c){var l=a[c],p=o[l];typeof p=="object"&&p!==null&&n.indexOf(p)===-1&&(r.push({obj:o,prop:l}),n.push(p))}return Mg(r),e},kg=function(e){return Object.prototype.toString.call(e)==="[object RegExp]"},Ng=function(e){return!e||typeof e!="object"?!1:!!(e.constructor&&e.constructor.isBuffer&&e.constructor.isBuffer(e))},Og=function(e,r){return[].concat(e,r)},Lg=function(e,r){if(en(e)){for(var n=[],i=0;i<e.length;i+=1)n.push(r(e[i]));return n}return r(e)},$h={arrayToObject:jh,assign:Ig,combine:Og,compact:Tg,decode:Rg,encode:Ag,isBuffer:Ng,isRegExp:kg,maybeMap:Lg,merge:Cg},Fh=Q0,Es=$h,xi=gu,Bg=Object.prototype.hasOwnProperty,Sc={brackets:function(e){return e+"[]"},comma:"comma",indices:function(e,r){return e+"["+r+"]"},repeat:function(e){return e}},vr=Array.isArray,Pg=Array.prototype.push,Uh=function(t,e){Pg.apply(t,vr(e)?e:[e])},Dg=Date.prototype.toISOString,xc=xi.default,St={addQueryPrefix:!1,allowDots:!1,charset:"utf-8",charsetSentinel:!1,delimiter:"&",encode:!0,encoder:Es.encode,encodeValuesOnly:!1,format:xc,formatter:xi.formatters[xc],indices:!1,serializeDate:function(e){return Dg.call(e)},skipNulls:!1,strictNullHandling:!1},jg=function(e){return typeof e=="string"||typeof e=="number"||typeof e=="boolean"||typeof e=="symbol"||typeof e=="bigint"},ra={},$g=function t(e,r,n,i,s,o,a,c,l,p,g,y,I,T,D,U){for(var M=e,N=U,j=0,H=!1;(N=N.get(ra))!==void 0&&!H;){var F=N.get(e);if(j+=1,typeof F<"u"){if(F===j)throw new RangeError("Cyclic object value");H=!0}typeof N.get(ra)>"u"&&(j=0)}if(typeof c=="function"?M=c(r,M):M instanceof Date?M=g(M):n==="comma"&&vr(M)&&(M=Es.maybeMap(M,function(m){return m instanceof Date?g(m):m})),M===null){if(s)return a&&!T?a(r,St.encoder,D,"key",y):r;M=""}if(jg(M)||Es.isBuffer(M)){if(a){var z=T?r:a(r,St.encoder,D,"key",y);return[I(z)+"="+I(a(M,St.encoder,D,"value",y))]}return[I(r)+"="+I(String(M))]}var X=[];if(typeof M>"u")return X;var K;if(n==="comma"&&vr(M))T&&a&&(M=Es.maybeMap(M,a)),K=[{value:M.length>0?M.join(",")||null:void 0}];else if(vr(c))K=c;else{var J=Object.keys(M);K=l?J.sort(l):J}for(var ne=i&&vr(M)&&M.length===1?r+"[]":r,oe=0;oe<K.length;++oe){var ue=K[oe],w=typeof ue=="object"&&typeof ue.value<"u"?ue.value:M[ue];if(!(o&&w===null)){var u=vr(M)?typeof n=="function"?n(ne,ue):ne:ne+(p?"."+ue:"["+ue+"]");U.set(e,j);var b=Fh();b.set(ra,U),Uh(X,t(w,u,n,i,s,o,n==="comma"&&T&&vr(M)?null:a,c,l,p,g,y,I,T,D,b))}}return X},Fg=function(e){if(!e)return St;if(e.encoder!==null&&typeof e.encoder<"u"&&typeof e.encoder!="function")throw new TypeError("Encoder has to be a function.");var r=e.charset||St.charset;if(typeof e.charset<"u"&&e.charset!=="utf-8"&&e.charset!=="iso-8859-1")throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var n=xi.default;if(typeof e.format<"u"){if(!Bg.call(xi.formatters,e.format))throw new TypeError("Unknown format option provided.");n=e.format}var i=xi.formatters[n],s=St.filter;return(typeof e.filter=="function"||vr(e.filter))&&(s=e.filter),{addQueryPrefix:typeof e.addQueryPrefix=="boolean"?e.addQueryPrefix:St.addQueryPrefix,allowDots:typeof e.allowDots>"u"?St.allowDots:!!e.allowDots,charset:r,charsetSentinel:typeof e.charsetSentinel=="boolean"?e.charsetSentinel:St.charsetSentinel,delimiter:typeof e.delimiter>"u"?St.delimiter:e.delimiter,encode:typeof e.encode=="boolean"?e.encode:St.encode,encoder:typeof e.encoder=="function"?e.encoder:St.encoder,encodeValuesOnly:typeof e.encodeValuesOnly=="boolean"?e.encodeValuesOnly:St.encodeValuesOnly,filter:s,format:n,formatter:i,serializeDate:typeof e.serializeDate=="function"?e.serializeDate:St.serializeDate,skipNulls:typeof e.skipNulls=="boolean"?e.skipNulls:St.skipNulls,sort:typeof e.sort=="function"?e.sort:null,strictNullHandling:typeof e.strictNullHandling=="boolean"?e.strictNullHandling:St.strictNullHandling}},Ug=function(t,e){var r=t,n=Fg(e),i,s;typeof n.filter=="function"?(s=n.filter,r=s("",r)):vr(n.filter)&&(s=n.filter,i=s);var o=[];if(typeof r!="object"||r===null)return"";var a;e&&e.arrayFormat in Sc?a=e.arrayFormat:e&&"indices"in e?a=e.indices?"indices":"repeat":a="indices";var c=Sc[a];if(e&&"commaRoundTrip"in e&&typeof e.commaRoundTrip!="boolean")throw new TypeError("`commaRoundTrip` must be a boolean, or absent");var l=c==="comma"&&e&&e.commaRoundTrip;i||(i=Object.keys(r)),n.sort&&i.sort(n.sort);for(var p=Fh(),g=0;g<i.length;++g){var y=i[g];n.skipNulls&&r[y]===null||Uh(o,$g(r[y],y,c,l,n.strictNullHandling,n.skipNulls,n.encode?n.encoder:null,n.filter,n.sort,n.allowDots,n.serializeDate,n.format,n.formatter,n.encodeValuesOnly,n.charset,p))}var I=o.join(n.delimiter),T=n.addQueryPrefix===!0?"?":"";return n.charsetSentinel&&(n.charset==="iso-8859-1"?T+="utf8=%26%2310003%3B&":T+="utf8=%E2%9C%93&"),I.length>0?T+I:""},qn=$h,Ua=Object.prototype.hasOwnProperty,Hg=Array.isArray,pt={allowDots:!1,allowPrototypes:!1,allowSparse:!1,arrayLimit:20,charset:"utf-8",charsetSentinel:!1,comma:!1,decoder:qn.decode,delimiter:"&",depth:5,ignoreQueryPrefix:!1,interpretNumericEntities:!1,parameterLimit:1e3,parseArrays:!0,plainObjects:!1,strictNullHandling:!1},Wg=function(t){return t.replace(/&#(\d+);/g,function(e,r){return String.fromCharCode(parseInt(r,10))})},Hh=function(t,e){return t&&typeof t=="string"&&e.comma&&t.indexOf(",")>-1?t.split(","):t},Vg="utf8=%26%2310003%3B",zg="utf8=%E2%9C%93",qg=function(e,r){var n={__proto__:null},i=r.ignoreQueryPrefix?e.replace(/^\?/,""):e,s=r.parameterLimit===1/0?void 0:r.parameterLimit,o=i.split(r.delimiter,s),a=-1,c,l=r.charset;if(r.charsetSentinel)for(c=0;c<o.length;++c)o[c].indexOf("utf8=")===0&&(o[c]===zg?l="utf-8":o[c]===Vg&&(l="iso-8859-1"),a=c,c=o.length);for(c=0;c<o.length;++c)if(c!==a){var p=o[c],g=p.indexOf("]="),y=g===-1?p.indexOf("="):g+1,I,T;y===-1?(I=r.decoder(p,pt.decoder,l,"key"),T=r.strictNullHandling?null:""):(I=r.decoder(p.slice(0,y),pt.decoder,l,"key"),T=qn.maybeMap(Hh(p.slice(y+1),r),function(D){return r.decoder(D,pt.decoder,l,"value")})),T&&r.interpretNumericEntities&&l==="iso-8859-1"&&(T=Wg(T)),p.indexOf("[]=")>-1&&(T=Hg(T)?[T]:T),Ua.call(n,I)?n[I]=qn.combine(n[I],T):n[I]=T}return n},Gg=function(t,e,r,n){for(var i=n?e:Hh(e,r),s=t.length-1;s>=0;--s){var o,a=t[s];if(a==="[]"&&r.parseArrays)o=[].concat(i);else{o=r.plainObjects?Object.create(null):{};var c=a.charAt(0)==="["&&a.charAt(a.length-1)==="]"?a.slice(1,-1):a,l=parseInt(c,10);!r.parseArrays&&c===""?o={0:i}:!isNaN(l)&&a!==c&&String(l)===c&&l>=0&&r.parseArrays&&l<=r.arrayLimit?(o=[],o[l]=i):c!=="__proto__"&&(o[c]=i)}i=o}return i},Jg=function(e,r,n,i){if(e){var s=n.allowDots?e.replace(/\.([^.[]+)/g,"[$1]"):e,o=/(\[[^[\]]*])/,a=/(\[[^[\]]*])/g,c=n.depth>0&&o.exec(s),l=c?s.slice(0,c.index):s,p=[];if(l){if(!n.plainObjects&&Ua.call(Object.prototype,l)&&!n.allowPrototypes)return;p.push(l)}for(var g=0;n.depth>0&&(c=a.exec(s))!==null&&g<n.depth;){if(g+=1,!n.plainObjects&&Ua.call(Object.prototype,c[1].slice(1,-1))&&!n.allowPrototypes)return;p.push(c[1])}return c&&p.push("["+s.slice(c.index)+"]"),Gg(p,r,n,i)}},Zg=function(e){if(!e)return pt;if(e.decoder!==null&&e.decoder!==void 0&&typeof e.decoder!="function")throw new TypeError("Decoder has to be a function.");if(typeof e.charset<"u"&&e.charset!=="utf-8"&&e.charset!=="iso-8859-1")throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var r=typeof e.charset>"u"?pt.charset:e.charset;return{allowDots:typeof e.allowDots>"u"?pt.allowDots:!!e.allowDots,allowPrototypes:typeof e.allowPrototypes=="boolean"?e.allowPrototypes:pt.allowPrototypes,allowSparse:typeof e.allowSparse=="boolean"?e.allowSparse:pt.allowSparse,arrayLimit:typeof e.arrayLimit=="number"?e.arrayLimit:pt.arrayLimit,charset:r,charsetSentinel:typeof e.charsetSentinel=="boolean"?e.charsetSentinel:pt.charsetSentinel,comma:typeof e.comma=="boolean"?e.comma:pt.comma,decoder:typeof e.decoder=="function"?e.decoder:pt.decoder,delimiter:typeof e.delimiter=="string"||qn.isRegExp(e.delimiter)?e.delimiter:pt.delimiter,depth:typeof e.depth=="number"||e.depth===!1?+e.depth:pt.depth,ignoreQueryPrefix:e.ignoreQueryPrefix===!0,interpretNumericEntities:typeof e.interpretNumericEntities=="boolean"?e.interpretNumericEntities:pt.interpretNumericEntities,parameterLimit:typeof e.parameterLimit=="number"?e.parameterLimit:pt.parameterLimit,parseArrays:e.parseArrays!==!1,plainObjects:typeof e.plainObjects=="boolean"?e.plainObjects:pt.plainObjects,strictNullHandling:typeof e.strictNullHandling=="boolean"?e.strictNullHandling:pt.strictNullHandling}},Qg=function(t,e){var r=Zg(e);if(t===""||t===null||typeof t>"u")return r.plainObjects?Object.create(null):{};for(var n=typeof t=="string"?qg(t,r):t,i=r.plainObjects?Object.create(null):{},s=Object.keys(n),o=0;o<s.length;++o){var a=s[o],c=Jg(a,n[a],r,typeof t=="string");i=qn.merge(i,c,r)}return r.allowSparse===!0?i:qn.compact(i)},Yg=Ug,Kg=Qg,Xg=gu,eb={formats:Xg,parse:Kg,stringify:Yg},Vi={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.ProviderType=t.RegExpString=t.IntNumber=t.BigIntString=t.AddressString=t.HexString=t.OpaqueType=void 0;function e(){return n=>n}t.OpaqueType=e,t.HexString=e(),t.AddressString=e(),t.BigIntString=e();function r(n){return Math.floor(n)}t.IntNumber=r,t.RegExpString=e(),function(n){n.CoinbaseWallet="CoinbaseWallet",n.MetaMask="MetaMask",n.Unselected=""}(t.ProviderType||(t.ProviderType={}))})(Vi);var tb=te&&te.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(re,"__esModule",{value:!0});re.isInIFrame=re.createQrUrl=re.getFavicon=re.range=re.isBigNumber=re.ensureParsedJSONObject=re.ensureBN=re.ensureRegExpString=re.ensureIntNumber=re.ensureBuffer=re.ensureAddressString=re.ensureEvenLengthHexString=re.ensureHexString=re.isHexString=re.prepend0x=re.strip0x=re.has0xPrefix=re.hexStringFromIntNumber=re.intNumberFromHexString=re.bigIntStringFromBN=re.hexStringFromBuffer=re.hexStringToUint8Array=re.uint8ArrayToHex=re.randomBytesHex=void 0;const Rr=tb(zs),rb=eb,bn=ji,Wt=Vi,Wh=/^[0-9]*$/,Vh=/^[a-f0-9]*$/;function nb(t){return zh(crypto.getRandomValues(new Uint8Array(t)))}re.randomBytesHex=nb;function zh(t){return[...t].map(e=>e.toString(16).padStart(2,"0")).join("")}re.uint8ArrayToHex=zh;function ib(t){return new Uint8Array(t.match(/.{1,2}/g).map(e=>parseInt(e,16)))}re.hexStringToUint8Array=ib;function sb(t,e=!1){const r=t.toString("hex");return(0,Wt.HexString)(e?"0x"+r:r)}re.hexStringFromBuffer=sb;function ob(t){return(0,Wt.BigIntString)(t.toString(10))}re.bigIntStringFromBN=ob;function ab(t){return(0,Wt.IntNumber)(new Rr.default(qi(t,!1),16).toNumber())}re.intNumberFromHexString=ab;function ub(t){return(0,Wt.HexString)("0x"+new Rr.default(t).toString(16))}re.hexStringFromIntNumber=ub;function bu(t){return t.startsWith("0x")||t.startsWith("0X")}re.has0xPrefix=bu;function Ks(t){return bu(t)?t.slice(2):t}re.strip0x=Ks;function qh(t){return bu(t)?"0x"+t.slice(2):"0x"+t}re.prepend0x=qh;function zi(t){if(typeof t!="string")return!1;const e=Ks(t).toLowerCase();return Vh.test(e)}re.isHexString=zi;function Gh(t,e=!1){if(typeof t=="string"){const r=Ks(t).toLowerCase();if(Vh.test(r))return(0,Wt.HexString)(e?"0x"+r:r)}throw bn.standardErrors.rpc.invalidParams(`"${String(t)}" is not a hexadecimal string`)}re.ensureHexString=Gh;function qi(t,e=!1){let r=Gh(t,!1);return r.length%2===1&&(r=(0,Wt.HexString)("0"+r)),e?(0,Wt.HexString)("0x"+r):r}re.ensureEvenLengthHexString=qi;function cb(t){if(typeof t=="string"){const e=Ks(t).toLowerCase();if(zi(e)&&e.length===40)return(0,Wt.AddressString)(qh(e))}throw bn.standardErrors.rpc.invalidParams(`Invalid Ethereum address: ${String(t)}`)}re.ensureAddressString=cb;function lb(t){if(ye.isBuffer(t))return t;if(typeof t=="string")if(zi(t)){const e=qi(t,!1);return ye.from(e,"hex")}else return ye.from(t,"utf8");throw bn.standardErrors.rpc.invalidParams(`Not binary data: ${String(t)}`)}re.ensureBuffer=lb;function Jh(t){if(typeof t=="number"&&Number.isInteger(t))return(0,Wt.IntNumber)(t);if(typeof t=="string"){if(Wh.test(t))return(0,Wt.IntNumber)(Number(t));if(zi(t))return(0,Wt.IntNumber)(new Rr.default(qi(t,!1),16).toNumber())}throw bn.standardErrors.rpc.invalidParams(`Not an integer: ${String(t)}`)}re.ensureIntNumber=Jh;function hb(t){if(t instanceof RegExp)return(0,Wt.RegExpString)(t.toString());throw bn.standardErrors.rpc.invalidParams(`Not a RegExp: ${String(t)}`)}re.ensureRegExpString=hb;function fb(t){if(t!==null&&(Rr.default.isBN(t)||Zh(t)))return new Rr.default(t.toString(10),10);if(typeof t=="number")return new Rr.default(Jh(t));if(typeof t=="string"){if(Wh.test(t))return new Rr.default(t,10);if(zi(t))return new Rr.default(qi(t,!1),16)}throw bn.standardErrors.rpc.invalidParams(`Not an integer: ${String(t)}`)}re.ensureBN=fb;function db(t){if(typeof t=="string")return JSON.parse(t);if(typeof t=="object")return t;throw bn.standardErrors.rpc.invalidParams(`Not a JSON string or an object: ${String(t)}`)}re.ensureParsedJSONObject=db;function Zh(t){if(t==null||typeof t.constructor!="function")return!1;const{constructor:e}=t;return typeof e.config=="function"&&typeof e.EUCLID=="number"}re.isBigNumber=Zh;function pb(t,e){return Array.from({length:e-t},(r,n)=>t+n)}re.range=pb;function gb(){const t=document.querySelector('link[sizes="192x192"]')||document.querySelector('link[sizes="180x180"]')||document.querySelector('link[rel="icon"]')||document.querySelector('link[rel="shortcut icon"]'),{protocol:e,host:r}=document.location,n=t?t.getAttribute("href"):null;return!n||n.startsWith("javascript:")?null:n.startsWith("http://")||n.startsWith("https://")||n.startsWith("data:")?n:n.startsWith("//")?e+n:`${e}//${r}${n}`}re.getFavicon=gb;function bb(t,e,r,n,i,s){const o=n?"parent-id":"id",a=(0,rb.stringify)({[o]:t,secret:e,server:r,v:i,chainId:s});return`${r}/#/link?${a}`}re.createQrUrl=bb;function vb(){try{return window.frameElement!==null}catch{return!1}}re.isInIFrame=vb;Object.defineProperty(ui,"__esModule",{value:!0});ui.Session=void 0;const Mc=wg,Cc=re,Ic="session:id",Rc="session:secret",Ac="session:linked";class vu{constructor(e,r,n,i){this._storage=e,this._id=r||(0,Cc.randomBytesHex)(16),this._secret=n||(0,Cc.randomBytesHex)(32),this._key=new Mc.sha256().update(`${this._id}, ${this._secret} WalletLink`).digest("hex"),this._linked=!!i}static load(e){const r=e.getItem(Ic),n=e.getItem(Ac),i=e.getItem(Rc);return r&&i?new vu(e,r,i,n==="1"):null}static hash(e){return new Mc.sha256().update(e).digest("hex")}get id(){return this._id}get secret(){return this._secret}get key(){return this._key}get linked(){return this._linked}set linked(e){this._linked=e,this.persistLinked()}save(){return this._storage.setItem(Ic,this._id),this._storage.setItem(Rc,this._secret),this.persistLinked(),this}persistLinked(){this._storage.setItem(Ac,this._linked?"1":"0")}}ui.Session=vu;var Kt={};Object.defineProperty(Kt,"__esModule",{value:!0});Kt.WalletSDKRelayAbstract=Kt.APP_VERSION_KEY=Kt.LOCAL_STORAGE_ADDRESSES_KEY=Kt.WALLET_USER_NAME_KEY=void 0;const Tc=ji;Kt.WALLET_USER_NAME_KEY="walletUsername";Kt.LOCAL_STORAGE_ADDRESSES_KEY="Addresses";Kt.APP_VERSION_KEY="AppVersion";class mb{async makeEthereumJSONRPCRequest(e,r){if(!r)throw new Error("Error: No jsonRpcUrl provided");return window.fetch(r,{method:"POST",body:JSON.stringify(e),mode:"cors",headers:{"Content-Type":"application/json"}}).then(n=>n.json()).then(n=>{if(!n)throw Tc.standardErrors.rpc.parse({});const i=n,{error:s}=i;if(s)throw(0,Tc.serializeError)(s,e.method);return i})}}Kt.WalletSDKRelayAbstract=mb;var Ha={exports:{}},Qh=au.EventEmitter,na,kc;function yb(){if(kc)return na;kc=1;function t(T,D){var U=Object.keys(T);if(Object.getOwnPropertySymbols){var M=Object.getOwnPropertySymbols(T);D&&(M=M.filter(function(N){return Object.getOwnPropertyDescriptor(T,N).enumerable})),U.push.apply(U,M)}return U}function e(T){for(var D=1;D<arguments.length;D++){var U=arguments[D]!=null?arguments[D]:{};D%2?t(Object(U),!0).forEach(function(M){r(T,M,U[M])}):Object.getOwnPropertyDescriptors?Object.defineProperties(T,Object.getOwnPropertyDescriptors(U)):t(Object(U)).forEach(function(M){Object.defineProperty(T,M,Object.getOwnPropertyDescriptor(U,M))})}return T}function r(T,D,U){return D=o(D),D in T?Object.defineProperty(T,D,{value:U,enumerable:!0,configurable:!0,writable:!0}):T[D]=U,T}function n(T,D){if(!(T instanceof D))throw new TypeError("Cannot call a class as a function")}function i(T,D){for(var U=0;U<D.length;U++){var M=D[U];M.enumerable=M.enumerable||!1,M.configurable=!0,"value"in M&&(M.writable=!0),Object.defineProperty(T,o(M.key),M)}}function s(T,D,U){return D&&i(T.prototype,D),U&&i(T,U),Object.defineProperty(T,"prototype",{writable:!1}),T}function o(T){var D=a(T,"string");return typeof D=="symbol"?D:String(D)}function a(T,D){if(typeof T!="object"||T===null)return T;var U=T[Symbol.toPrimitive];if(U!==void 0){var M=U.call(T,D||"default");if(typeof M!="object")return M;throw new TypeError("@@toPrimitive must return a primitive value.")}return(D==="string"?String:Number)(T)}var c=$i,l=c.Buffer,p=uu,g=p.inspect,y=g&&g.custom||"inspect";function I(T,D,U){l.prototype.copy.call(T,D,U)}return na=function(){function T(){n(this,T),this.head=null,this.tail=null,this.length=0}return s(T,[{key:"push",value:function(U){var M={data:U,next:null};this.length>0?this.tail.next=M:this.head=M,this.tail=M,++this.length}},{key:"unshift",value:function(U){var M={data:U,next:this.head};this.length===0&&(this.tail=M),this.head=M,++this.length}},{key:"shift",value:function(){if(this.length!==0){var U=this.head.data;return this.length===1?this.head=this.tail=null:this.head=this.head.next,--this.length,U}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(U){if(this.length===0)return"";for(var M=this.head,N=""+M.data;M=M.next;)N+=U+M.data;return N}},{key:"concat",value:function(U){if(this.length===0)return l.alloc(0);for(var M=l.allocUnsafe(U>>>0),N=this.head,j=0;N;)I(N.data,M,j),j+=N.data.length,N=N.next;return M}},{key:"consume",value:function(U,M){var N;return U<this.head.data.length?(N=this.head.data.slice(0,U),this.head.data=this.head.data.slice(U)):U===this.head.data.length?N=this.shift():N=M?this._getString(U):this._getBuffer(U),N}},{key:"first",value:function(){return this.head.data}},{key:"_getString",value:function(U){var M=this.head,N=1,j=M.data;for(U-=j.length;M=M.next;){var H=M.data,F=U>H.length?H.length:U;if(F===H.length?j+=H:j+=H.slice(0,U),U-=F,U===0){F===H.length?(++N,M.next?this.head=M.next:this.head=this.tail=null):(this.head=M,M.data=H.slice(F));break}++N}return this.length-=N,j}},{key:"_getBuffer",value:function(U){var M=l.allocUnsafe(U),N=this.head,j=1;for(N.data.copy(M),U-=N.data.length;N=N.next;){var H=N.data,F=U>H.length?H.length:U;if(H.copy(M,M.length-U,0,F),U-=F,U===0){F===H.length?(++j,N.next?this.head=N.next:this.head=this.tail=null):(this.head=N,N.data=H.slice(F));break}++j}return this.length-=j,M}},{key:y,value:function(U,M){return g(this,e(e({},M),{},{depth:0,customInspect:!1}))}}]),T}(),na}function _b(t,e){var r=this,n=this._readableState&&this._readableState.destroyed,i=this._writableState&&this._writableState.destroyed;return n||i?(e?e(t):t&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,Te.nextTick(Wa,this,t)):Te.nextTick(Wa,this,t)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(t||null,function(s){!e&&s?r._writableState?r._writableState.errorEmitted?Te.nextTick(Ss,r):(r._writableState.errorEmitted=!0,Te.nextTick(Nc,r,s)):Te.nextTick(Nc,r,s):e?(Te.nextTick(Ss,r),e(s)):Te.nextTick(Ss,r)}),this)}function Nc(t,e){Wa(t,e),Ss(t)}function Ss(t){t._writableState&&!t._writableState.emitClose||t._readableState&&!t._readableState.emitClose||t.emit("close")}function wb(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finalCalled=!1,this._writableState.prefinished=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)}function Wa(t,e){t.emit("error",e)}function Eb(t,e){var r=t._readableState,n=t._writableState;r&&r.autoDestroy||n&&n.autoDestroy?t.destroy(e):t.emit("error",e)}var Yh={destroy:_b,undestroy:wb,errorOrDestroy:Eb},vn={};function Sb(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,t.__proto__=e}var Kh={};function zt(t,e,r){r||(r=Error);function n(s,o,a){return typeof e=="string"?e:e(s,o,a)}var i=function(s){Sb(o,s);function o(a,c,l){return s.call(this,n(a,c,l))||this}return o}(r);i.prototype.name=r.name,i.prototype.code=t,Kh[t]=i}function Oc(t,e){if(Array.isArray(t)){var r=t.length;return t=t.map(function(n){return String(n)}),r>2?"one of ".concat(e," ").concat(t.slice(0,r-1).join(", "),", or ")+t[r-1]:r===2?"one of ".concat(e," ").concat(t[0]," or ").concat(t[1]):"of ".concat(e," ").concat(t[0])}else return"of ".concat(e," ").concat(String(t))}function xb(t,e,r){return t.substr(!r||r<0?0:+r,e.length)===e}function Mb(t,e,r){return(r===void 0||r>t.length)&&(r=t.length),t.substring(r-e.length,r)===e}function Cb(t,e,r){return typeof r!="number"&&(r=0),r+e.length>t.length?!1:t.indexOf(e,r)!==-1}zt("ERR_INVALID_OPT_VALUE",function(t,e){return'The value "'+e+'" is invalid for option "'+t+'"'},TypeError);zt("ERR_INVALID_ARG_TYPE",function(t,e,r){var n;typeof e=="string"&&xb(e,"not ")?(n="must not be",e=e.replace(/^not /,"")):n="must be";var i;if(Mb(t," argument"))i="The ".concat(t," ").concat(n," ").concat(Oc(e,"type"));else{var s=Cb(t,".")?"property":"argument";i='The "'.concat(t,'" ').concat(s," ").concat(n," ").concat(Oc(e,"type"))}return i+=". Received type ".concat(typeof r),i},TypeError);zt("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF");zt("ERR_METHOD_NOT_IMPLEMENTED",function(t){return"The "+t+" method is not implemented"});zt("ERR_STREAM_PREMATURE_CLOSE","Premature close");zt("ERR_STREAM_DESTROYED",function(t){return"Cannot call "+t+" after a stream was destroyed"});zt("ERR_MULTIPLE_CALLBACK","Callback called multiple times");zt("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable");zt("ERR_STREAM_WRITE_AFTER_END","write after end");zt("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError);zt("ERR_UNKNOWN_ENCODING",function(t){return"Unknown encoding: "+t},TypeError);zt("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event");vn.codes=Kh;var Ib=vn.codes.ERR_INVALID_OPT_VALUE;function Rb(t,e,r){return t.highWaterMark!=null?t.highWaterMark:e?t[r]:null}function Ab(t,e,r,n){var i=Rb(e,n,r);if(i!=null){if(!(isFinite(i)&&Math.floor(i)===i)||i<0){var s=n?r:"highWaterMark";throw new Ib(s,i)}return Math.floor(i)}return t.objectMode?16:16*1024}var Xh={getHighWaterMark:Ab},Tb=kb;function kb(t,e){if(ia("noDeprecation"))return t;var r=!1;function n(){if(!r){if(ia("throwDeprecation"))throw new Error(e);ia("traceDeprecation")?console.trace(e):console.warn(e),r=!0}return t.apply(this,arguments)}return n}function ia(t){try{if(!te.localStorage)return!1}catch{return!1}var e=te.localStorage[t];return e==null?!1:String(e).toLowerCase()==="true"}var sa,Lc;function ef(){if(Lc)return sa;Lc=1,sa=K;function t(O){var P=this;this.next=null,this.entry=null,this.finish=function(){ee(P,O)}}var e;K.WritableState=z;var r={deprecate:Tb},n=Qh,i=$i.Buffer,s=(typeof te<"u"?te:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function o(O){return i.from(O)}function a(O){return i.isBuffer(O)||O instanceof s}var c=Yh,l=Xh,p=l.getHighWaterMark,g=vn.codes,y=g.ERR_INVALID_ARG_TYPE,I=g.ERR_METHOD_NOT_IMPLEMENTED,T=g.ERR_MULTIPLE_CALLBACK,D=g.ERR_STREAM_CANNOT_PIPE,U=g.ERR_STREAM_DESTROYED,M=g.ERR_STREAM_NULL_VALUES,N=g.ERR_STREAM_WRITE_AFTER_END,j=g.ERR_UNKNOWN_ENCODING,H=c.errorOrDestroy;Xt(K,n);function F(){}function z(O,P,V){e=e||Gn(),O=O||{},typeof V!="boolean"&&(V=P instanceof e),this.objectMode=!!O.objectMode,V&&(this.objectMode=this.objectMode||!!O.writableObjectMode),this.highWaterMark=p(this,O,"writableHighWaterMark",V),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var Q=O.decodeStrings===!1;this.decodeStrings=!Q,this.defaultEncoding=O.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(ge){m(P,ge)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=O.emitClose!==!1,this.autoDestroy=!!O.autoDestroy,this.bufferedRequestCount=0,this.corkedRequestsFree=new t(this)}z.prototype.getBuffer=function(){for(var P=this.bufferedRequest,V=[];P;)V.push(P),P=P.next;return V},function(){try{Object.defineProperty(z.prototype,"buffer",{get:r.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch{}}();var X;typeof Symbol=="function"&&Symbol.hasInstance&&typeof Function.prototype[Symbol.hasInstance]=="function"?(X=Function.prototype[Symbol.hasInstance],Object.defineProperty(K,Symbol.hasInstance,{value:function(P){return X.call(this,P)?!0:this!==K?!1:P&&P._writableState instanceof z}})):X=function(P){return P instanceof this};function K(O){e=e||Gn();var P=this instanceof e;if(!P&&!X.call(K,this))return new K(O);this._writableState=new z(O,this,P),this.writable=!0,O&&(typeof O.write=="function"&&(this._write=O.write),typeof O.writev=="function"&&(this._writev=O.writev),typeof O.destroy=="function"&&(this._destroy=O.destroy),typeof O.final=="function"&&(this._final=O.final)),n.call(this)}K.prototype.pipe=function(){H(this,new D)};function J(O,P){var V=new N;H(O,V),Te.nextTick(P,V)}function ne(O,P,V,Q){var ge;return V===null?ge=new M:typeof V!="string"&&!P.objectMode&&(ge=new y("chunk",["string","Buffer"],V)),ge?(H(O,ge),Te.nextTick(Q,ge),!1):!0}K.prototype.write=function(O,P,V){var Q=this._writableState,ge=!1,C=!Q.objectMode&&a(O);return C&&!i.isBuffer(O)&&(O=o(O)),typeof P=="function"&&(V=P,P=null),C?P="buffer":P||(P=Q.defaultEncoding),typeof V!="function"&&(V=F),Q.ending?J(this,V):(C||ne(this,Q,O,V))&&(Q.pendingcb++,ge=ue(this,Q,C,O,P,V)),ge},K.prototype.cork=function(){this._writableState.corked++},K.prototype.uncork=function(){var O=this._writableState;O.corked&&(O.corked--,!O.writing&&!O.corked&&!O.bufferProcessing&&O.bufferedRequest&&k(this,O))},K.prototype.setDefaultEncoding=function(P){if(typeof P=="string"&&(P=P.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((P+"").toLowerCase())>-1))throw new j(P);return this._writableState.defaultEncoding=P,this},Object.defineProperty(K.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}});function oe(O,P,V){return!O.objectMode&&O.decodeStrings!==!1&&typeof P=="string"&&(P=i.from(P,V)),P}Object.defineProperty(K.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}});function ue(O,P,V,Q,ge,C){if(!V){var R=oe(P,Q,ge);Q!==R&&(V=!0,ge="buffer",Q=R)}var q=P.objectMode?1:Q.length;P.length+=q;var Z=P.length<P.highWaterMark;if(Z||(P.needDrain=!0),P.writing||P.corked){var he=P.lastBufferedRequest;P.lastBufferedRequest={chunk:Q,encoding:ge,isBuf:V,callback:C,next:null},he?he.next=P.lastBufferedRequest:P.bufferedRequest=P.lastBufferedRequest,P.bufferedRequestCount+=1}else w(O,P,!1,q,Q,ge,C);return Z}function w(O,P,V,Q,ge,C,R){P.writelen=Q,P.writecb=R,P.writing=!0,P.sync=!0,P.destroyed?P.onwrite(new U("write")):V?O._writev(ge,P.onwrite):O._write(ge,C,P.onwrite),P.sync=!1}function u(O,P,V,Q,ge){--P.pendingcb,V?(Te.nextTick(ge,Q),Te.nextTick(A,O,P),O._writableState.errorEmitted=!0,H(O,Q)):(ge(Q),O._writableState.errorEmitted=!0,H(O,Q),A(O,P))}function b(O){O.writing=!1,O.writecb=null,O.length-=O.writelen,O.writelen=0}function m(O,P){var V=O._writableState,Q=V.sync,ge=V.writecb;if(typeof ge!="function")throw new T;if(b(V),P)u(O,V,Q,P,ge);else{var C=L(V)||O.destroyed;!C&&!V.corked&&!V.bufferProcessing&&V.bufferedRequest&&k(O,V),Q?Te.nextTick(E,O,V,C,ge):E(O,V,C,ge)}}function E(O,P,V,Q){V||S(O,P),P.pendingcb--,Q(),A(O,P)}function S(O,P){P.length===0&&P.needDrain&&(P.needDrain=!1,O.emit("drain"))}function k(O,P){P.bufferProcessing=!0;var V=P.bufferedRequest;if(O._writev&&V&&V.next){var Q=P.bufferedRequestCount,ge=new Array(Q),C=P.corkedRequestsFree;C.entry=V;for(var R=0,q=!0;V;)ge[R]=V,V.isBuf||(q=!1),V=V.next,R+=1;ge.allBuffers=q,w(O,P,!0,P.length,ge,"",C.finish),P.pendingcb++,P.lastBufferedRequest=null,C.next?(P.corkedRequestsFree=C.next,C.next=null):P.corkedRequestsFree=new t(P),P.bufferedRequestCount=0}else{for(;V;){var Z=V.chunk,he=V.encoding,be=V.callback,se=P.objectMode?1:Z.length;if(w(O,P,!1,se,Z,he,be),V=V.next,P.bufferedRequestCount--,P.writing)break}V===null&&(P.lastBufferedRequest=null)}P.bufferedRequest=V,P.bufferProcessing=!1}K.prototype._write=function(O,P,V){V(new I("_write()"))},K.prototype._writev=null,K.prototype.end=function(O,P,V){var Q=this._writableState;return typeof O=="function"?(V=O,O=null,P=null):typeof P=="function"&&(V=P,P=null),O!=null&&this.write(O,P),Q.corked&&(Q.corked=1,this.uncork()),Q.ending||Y(this,Q,V),this},Object.defineProperty(K.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}});function L(O){return O.ending&&O.length===0&&O.bufferedRequest===null&&!O.finished&&!O.writing}function _(O,P){O._final(function(V){P.pendingcb--,V&&H(O,V),P.prefinished=!0,O.emit("prefinish"),A(O,P)})}function d(O,P){!P.prefinished&&!P.finalCalled&&(typeof O._final=="function"&&!P.destroyed?(P.pendingcb++,P.finalCalled=!0,Te.nextTick(_,O,P)):(P.prefinished=!0,O.emit("prefinish")))}function A(O,P){var V=L(P);if(V&&(d(O,P),P.pendingcb===0&&(P.finished=!0,O.emit("finish"),P.autoDestroy))){var Q=O._readableState;(!Q||Q.autoDestroy&&Q.endEmitted)&&O.destroy()}return V}function Y(O,P,V){P.ending=!0,A(O,P),V&&(P.finished?Te.nextTick(V):O.once("finish",V)),P.ended=!0,O.writable=!1}function ee(O,P,V){var Q=O.entry;for(O.entry=null;Q;){var ge=Q.callback;P.pendingcb--,ge(V),Q=Q.next}P.corkedRequestsFree.next=O}return Object.defineProperty(K.prototype,"destroyed",{enumerable:!1,get:function(){return this._writableState===void 0?!1:this._writableState.destroyed},set:function(P){this._writableState&&(this._writableState.destroyed=P)}}),K.prototype.destroy=c.destroy,K.prototype._undestroy=c.undestroy,K.prototype._destroy=function(O,P){P(O)},sa}var oa,Bc;function Gn(){if(Bc)return oa;Bc=1;var t=Object.keys||function(l){var p=[];for(var g in l)p.push(g);return p};oa=o;var e=rf(),r=ef();Xt(o,e);for(var n=t(r.prototype),i=0;i<n.length;i++){var s=n[i];o.prototype[s]||(o.prototype[s]=r.prototype[s])}function o(l){if(!(this instanceof o))return new o(l);e.call(this,l),r.call(this,l),this.allowHalfOpen=!0,l&&(l.readable===!1&&(this.readable=!1),l.writable===!1&&(this.writable=!1),l.allowHalfOpen===!1&&(this.allowHalfOpen=!1,this.once("end",a)))}Object.defineProperty(o.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),Object.defineProperty(o.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(o.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}});function a(){this._writableState.ended||Te.nextTick(c,this)}function c(l){l.end()}return Object.defineProperty(o.prototype,"destroyed",{enumerable:!1,get:function(){return this._readableState===void 0||this._writableState===void 0?!1:this._readableState.destroyed&&this._writableState.destroyed},set:function(p){this._readableState===void 0||this._writableState===void 0||(this._readableState.destroyed=p,this._writableState.destroyed=p)}}),oa}var aa={},Pc;function Dc(){if(Pc)return aa;Pc=1;var t=Pr.Buffer,e=t.isEncoding||function(M){switch(M=""+M,M&&M.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function r(M){if(!M)return"utf8";for(var N;;)switch(M){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return M;default:if(N)return;M=(""+M).toLowerCase(),N=!0}}function n(M){var N=r(M);if(typeof N!="string"&&(t.isEncoding===e||!e(M)))throw new Error("Unknown encoding: "+M);return N||M}aa.StringDecoder=i;function i(M){this.encoding=n(M);var N;switch(this.encoding){case"utf16le":this.text=g,this.end=y,N=4;break;case"utf8":this.fillLast=c,N=4;break;case"base64":this.text=I,this.end=T,N=3;break;default:this.write=D,this.end=U;return}this.lastNeed=0,this.lastTotal=0,this.lastChar=t.allocUnsafe(N)}i.prototype.write=function(M){if(M.length===0)return"";var N,j;if(this.lastNeed){if(N=this.fillLast(M),N===void 0)return"";j=this.lastNeed,this.lastNeed=0}else j=0;return j<M.length?N?N+this.text(M,j):this.text(M,j):N||""},i.prototype.end=p,i.prototype.text=l,i.prototype.fillLast=function(M){if(this.lastNeed<=M.length)return M.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);M.copy(this.lastChar,this.lastTotal-this.lastNeed,0,M.length),this.lastNeed-=M.length};function s(M){return M<=127?0:M>>5===6?2:M>>4===14?3:M>>3===30?4:M>>6===2?-1:-2}function o(M,N,j){var H=N.length-1;if(H<j)return 0;var F=s(N[H]);return F>=0?(F>0&&(M.lastNeed=F-1),F):--H<j||F===-2?0:(F=s(N[H]),F>=0?(F>0&&(M.lastNeed=F-2),F):--H<j||F===-2?0:(F=s(N[H]),F>=0?(F>0&&(F===2?F=0:M.lastNeed=F-3),F):0))}function a(M,N,j){if((N[0]&192)!==128)return M.lastNeed=0,"�";if(M.lastNeed>1&&N.length>1){if((N[1]&192)!==128)return M.lastNeed=1,"�";if(M.lastNeed>2&&N.length>2&&(N[2]&192)!==128)return M.lastNeed=2,"�"}}function c(M){var N=this.lastTotal-this.lastNeed,j=a(this,M);if(j!==void 0)return j;if(this.lastNeed<=M.length)return M.copy(this.lastChar,N,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);M.copy(this.lastChar,N,0,M.length),this.lastNeed-=M.length}function l(M,N){var j=o(this,M,N);if(!this.lastNeed)return M.toString("utf8",N);this.lastTotal=j;var H=M.length-(j-this.lastNeed);return M.copy(this.lastChar,0,H),M.toString("utf8",N,H)}function p(M){var N=M&&M.length?this.write(M):"";return this.lastNeed?N+"�":N}function g(M,N){if((M.length-N)%2===0){var j=M.toString("utf16le",N);if(j){var H=j.charCodeAt(j.length-1);if(H>=55296&&H<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=M[M.length-2],this.lastChar[1]=M[M.length-1],j.slice(0,-1)}return j}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=M[M.length-1],M.toString("utf16le",N,M.length-1)}function y(M){var N=M&&M.length?this.write(M):"";if(this.lastNeed){var j=this.lastTotal-this.lastNeed;return N+this.lastChar.toString("utf16le",0,j)}return N}function I(M,N){var j=(M.length-N)%3;return j===0?M.toString("base64",N):(this.lastNeed=3-j,this.lastTotal=3,j===1?this.lastChar[0]=M[M.length-1]:(this.lastChar[0]=M[M.length-2],this.lastChar[1]=M[M.length-1]),M.toString("base64",N,M.length-j))}function T(M){var N=M&&M.length?this.write(M):"";return this.lastNeed?N+this.lastChar.toString("base64",0,3-this.lastNeed):N}function D(M){return M.toString(this.encoding)}function U(M){return M&&M.length?this.write(M):""}return aa}var jc=vn.codes.ERR_STREAM_PREMATURE_CLOSE;function Nb(t){var e=!1;return function(){if(!e){e=!0;for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];t.apply(this,n)}}}function Ob(){}function Lb(t){return t.setHeader&&typeof t.abort=="function"}function tf(t,e,r){if(typeof e=="function")return tf(t,null,e);e||(e={}),r=Nb(r||Ob);var n=e.readable||e.readable!==!1&&t.readable,i=e.writable||e.writable!==!1&&t.writable,s=function(){t.writable||a()},o=t._writableState&&t._writableState.finished,a=function(){i=!1,o=!0,n||r.call(t)},c=t._readableState&&t._readableState.endEmitted,l=function(){n=!1,c=!0,i||r.call(t)},p=function(T){r.call(t,T)},g=function(){var T;if(n&&!c)return(!t._readableState||!t._readableState.ended)&&(T=new jc),r.call(t,T);if(i&&!o)return(!t._writableState||!t._writableState.ended)&&(T=new jc),r.call(t,T)},y=function(){t.req.on("finish",a)};return Lb(t)?(t.on("complete",a),t.on("abort",g),t.req?y():t.on("request",y)):i&&!t._writableState&&(t.on("end",s),t.on("close",s)),t.on("end",l),t.on("finish",a),e.error!==!1&&t.on("error",p),t.on("close",g),function(){t.removeListener("complete",a),t.removeListener("abort",g),t.removeListener("request",y),t.req&&t.req.removeListener("finish",a),t.removeListener("end",s),t.removeListener("close",s),t.removeListener("finish",a),t.removeListener("end",l),t.removeListener("error",p),t.removeListener("close",g)}}var mu=tf,ua,$c;function Bb(){if($c)return ua;$c=1;var t;function e(j,H,F){return H=r(H),H in j?Object.defineProperty(j,H,{value:F,enumerable:!0,configurable:!0,writable:!0}):j[H]=F,j}function r(j){var H=n(j,"string");return typeof H=="symbol"?H:String(H)}function n(j,H){if(typeof j!="object"||j===null)return j;var F=j[Symbol.toPrimitive];if(F!==void 0){var z=F.call(j,H||"default");if(typeof z!="object")return z;throw new TypeError("@@toPrimitive must return a primitive value.")}return(H==="string"?String:Number)(j)}var i=mu,s=Symbol("lastResolve"),o=Symbol("lastReject"),a=Symbol("error"),c=Symbol("ended"),l=Symbol("lastPromise"),p=Symbol("handlePromise"),g=Symbol("stream");function y(j,H){return{value:j,done:H}}function I(j){var H=j[s];if(H!==null){var F=j[g].read();F!==null&&(j[l]=null,j[s]=null,j[o]=null,H(y(F,!1)))}}function T(j){Te.nextTick(I,j)}function D(j,H){return function(F,z){j.then(function(){if(H[c]){F(y(void 0,!0));return}H[p](F,z)},z)}}var U=Object.getPrototypeOf(function(){}),M=Object.setPrototypeOf((t={get stream(){return this[g]},next:function(){var H=this,F=this[a];if(F!==null)return Promise.reject(F);if(this[c])return Promise.resolve(y(void 0,!0));if(this[g].destroyed)return new Promise(function(J,ne){Te.nextTick(function(){H[a]?ne(H[a]):J(y(void 0,!0))})});var z=this[l],X;if(z)X=new Promise(D(z,this));else{var K=this[g].read();if(K!==null)return Promise.resolve(y(K,!1));X=new Promise(this[p])}return this[l]=X,X}},e(t,Symbol.asyncIterator,function(){return this}),e(t,"return",function(){var H=this;return new Promise(function(F,z){H[g].destroy(null,function(X){if(X){z(X);return}F(y(void 0,!0))})})}),t),U),N=function(H){var F,z=Object.create(M,(F={},e(F,g,{value:H,writable:!0}),e(F,s,{value:null,writable:!0}),e(F,o,{value:null,writable:!0}),e(F,a,{value:null,writable:!0}),e(F,c,{value:H._readableState.endEmitted,writable:!0}),e(F,p,{value:function(K,J){var ne=z[g].read();ne?(z[l]=null,z[s]=null,z[o]=null,K(y(ne,!1))):(z[s]=K,z[o]=J)},writable:!0}),F));return z[l]=null,i(H,function(X){if(X&&X.code!=="ERR_STREAM_PREMATURE_CLOSE"){var K=z[o];K!==null&&(z[l]=null,z[s]=null,z[o]=null,K(X)),z[a]=X;return}var J=z[s];J!==null&&(z[l]=null,z[s]=null,z[o]=null,J(y(void 0,!0))),z[c]=!0}),H.on("readable",T.bind(null,z)),z};return ua=N,ua}var ca,Fc;function Pb(){return Fc||(Fc=1,ca=function(){throw new Error("Readable.from is not available in the browser")}),ca}var la,Uc;function rf(){if(Uc)return la;Uc=1,la=J;var t;J.ReadableState=K,au.EventEmitter;var e=function(R,q){return R.listeners(q).length},r=Qh,n=$i.Buffer,i=(typeof te<"u"?te:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function s(C){return n.from(C)}function o(C){return n.isBuffer(C)||C instanceof i}var a=uu,c;a&&a.debuglog?c=a.debuglog("stream"):c=function(){};var l=yb(),p=Yh,g=Xh,y=g.getHighWaterMark,I=vn.codes,T=I.ERR_INVALID_ARG_TYPE,D=I.ERR_STREAM_PUSH_AFTER_EOF,U=I.ERR_METHOD_NOT_IMPLEMENTED,M=I.ERR_STREAM_UNSHIFT_AFTER_END_EVENT,N,j,H;Xt(J,r);var F=p.errorOrDestroy,z=["error","close","destroy","pause","resume"];function X(C,R,q){if(typeof C.prependListener=="function")return C.prependListener(R,q);!C._events||!C._events[R]?C.on(R,q):Array.isArray(C._events[R])?C._events[R].unshift(q):C._events[R]=[q,C._events[R]]}function K(C,R,q){t=t||Gn(),C=C||{},typeof q!="boolean"&&(q=R instanceof t),this.objectMode=!!C.objectMode,q&&(this.objectMode=this.objectMode||!!C.readableObjectMode),this.highWaterMark=y(this,C,"readableHighWaterMark",q),this.buffer=new l,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.paused=!0,this.emitClose=C.emitClose!==!1,this.autoDestroy=!!C.autoDestroy,this.destroyed=!1,this.defaultEncoding=C.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,C.encoding&&(N||(N=Dc().StringDecoder),this.decoder=new N(C.encoding),this.encoding=C.encoding)}function J(C){if(t=t||Gn(),!(this instanceof J))return new J(C);var R=this instanceof t;this._readableState=new K(C,this,R),this.readable=!0,C&&(typeof C.read=="function"&&(this._read=C.read),typeof C.destroy=="function"&&(this._destroy=C.destroy)),r.call(this)}Object.defineProperty(J.prototype,"destroyed",{enumerable:!1,get:function(){return this._readableState===void 0?!1:this._readableState.destroyed},set:function(R){this._readableState&&(this._readableState.destroyed=R)}}),J.prototype.destroy=p.destroy,J.prototype._undestroy=p.undestroy,J.prototype._destroy=function(C,R){R(C)},J.prototype.push=function(C,R){var q=this._readableState,Z;return q.objectMode?Z=!0:typeof C=="string"&&(R=R||q.defaultEncoding,R!==q.encoding&&(C=n.from(C,R),R=""),Z=!0),ne(this,C,R,!1,Z)},J.prototype.unshift=function(C){return ne(this,C,null,!0,!1)};function ne(C,R,q,Z,he){c("readableAddChunk",R);var be=C._readableState;if(R===null)be.reading=!1,m(C,be);else{var se;if(he||(se=ue(be,R)),se)F(C,se);else if(be.objectMode||R&&R.length>0)if(typeof R!="string"&&!be.objectMode&&Object.getPrototypeOf(R)!==n.prototype&&(R=s(R)),Z)be.endEmitted?F(C,new M):oe(C,be,R,!0);else if(be.ended)F(C,new D);else{if(be.destroyed)return!1;be.reading=!1,be.decoder&&!q?(R=be.decoder.write(R),be.objectMode||R.length!==0?oe(C,be,R,!1):k(C,be)):oe(C,be,R,!1)}else Z||(be.reading=!1,k(C,be))}return!be.ended&&(be.length<be.highWaterMark||be.length===0)}function oe(C,R,q,Z){R.flowing&&R.length===0&&!R.sync?(R.awaitDrain=0,C.emit("data",q)):(R.length+=R.objectMode?1:q.length,Z?R.buffer.unshift(q):R.buffer.push(q),R.needReadable&&E(C)),k(C,R)}function ue(C,R){var q;return!o(R)&&typeof R!="string"&&R!==void 0&&!C.objectMode&&(q=new T("chunk",["string","Buffer","Uint8Array"],R)),q}J.prototype.isPaused=function(){return this._readableState.flowing===!1},J.prototype.setEncoding=function(C){N||(N=Dc().StringDecoder);var R=new N(C);this._readableState.decoder=R,this._readableState.encoding=this._readableState.decoder.encoding;for(var q=this._readableState.buffer.head,Z="";q!==null;)Z+=R.write(q.data),q=q.next;return this._readableState.buffer.clear(),Z!==""&&this._readableState.buffer.push(Z),this._readableState.length=Z.length,this};var w=1073741824;function u(C){return C>=w?C=w:(C--,C|=C>>>1,C|=C>>>2,C|=C>>>4,C|=C>>>8,C|=C>>>16,C++),C}function b(C,R){return C<=0||R.length===0&&R.ended?0:R.objectMode?1:C!==C?R.flowing&&R.length?R.buffer.head.data.length:R.length:(C>R.highWaterMark&&(R.highWaterMark=u(C)),C<=R.length?C:R.ended?R.length:(R.needReadable=!0,0))}J.prototype.read=function(C){c("read",C),C=parseInt(C,10);var R=this._readableState,q=C;if(C!==0&&(R.emittedReadable=!1),C===0&&R.needReadable&&((R.highWaterMark!==0?R.length>=R.highWaterMark:R.length>0)||R.ended))return c("read: emitReadable",R.length,R.ended),R.length===0&&R.ended?V(this):E(this),null;if(C=b(C,R),C===0&&R.ended)return R.length===0&&V(this),null;var Z=R.needReadable;c("need readable",Z),(R.length===0||R.length-C<R.highWaterMark)&&(Z=!0,c("length less than watermark",Z)),R.ended||R.reading?(Z=!1,c("reading or ended",Z)):Z&&(c("do read"),R.reading=!0,R.sync=!0,R.length===0&&(R.needReadable=!0),this._read(R.highWaterMark),R.sync=!1,R.reading||(C=b(q,R)));var he;return C>0?he=P(C,R):he=null,he===null?(R.needReadable=R.length<=R.highWaterMark,C=0):(R.length-=C,R.awaitDrain=0),R.length===0&&(R.ended||(R.needReadable=!0),q!==C&&R.ended&&V(this)),he!==null&&this.emit("data",he),he};function m(C,R){if(c("onEofChunk"),!R.ended){if(R.decoder){var q=R.decoder.end();q&&q.length&&(R.buffer.push(q),R.length+=R.objectMode?1:q.length)}R.ended=!0,R.sync?E(C):(R.needReadable=!1,R.emittedReadable||(R.emittedReadable=!0,S(C)))}}function E(C){var R=C._readableState;c("emitReadable",R.needReadable,R.emittedReadable),R.needReadable=!1,R.emittedReadable||(c("emitReadable",R.flowing),R.emittedReadable=!0,Te.nextTick(S,C))}function S(C){var R=C._readableState;c("emitReadable_",R.destroyed,R.length,R.ended),!R.destroyed&&(R.length||R.ended)&&(C.emit("readable"),R.emittedReadable=!1),R.needReadable=!R.flowing&&!R.ended&&R.length<=R.highWaterMark,O(C)}function k(C,R){R.readingMore||(R.readingMore=!0,Te.nextTick(L,C,R))}function L(C,R){for(;!R.reading&&!R.ended&&(R.length<R.highWaterMark||R.flowing&&R.length===0);){var q=R.length;if(c("maybeReadMore read 0"),C.read(0),q===R.length)break}R.readingMore=!1}J.prototype._read=function(C){F(this,new U("_read()"))},J.prototype.pipe=function(C,R){var q=this,Z=this._readableState;switch(Z.pipesCount){case 0:Z.pipes=C;break;case 1:Z.pipes=[Z.pipes,C];break;default:Z.pipes.push(C);break}Z.pipesCount+=1,c("pipe count=%d opts=%j",Z.pipesCount,R);var he=(!R||R.end!==!1)&&C!==Te.stdout&&C!==Te.stderr,be=he?xe:Ie;Z.endEmitted?Te.nextTick(be):q.once("end",be),C.on("unpipe",se);function se(v,h){c("onunpipe"),v===q&&h&&h.hasUnpiped===!1&&(h.hasUnpiped=!0,Re())}function xe(){c("onend"),C.end()}var Bt=_(q);C.on("drain",Bt);var ke=!1;function Re(){c("cleanup"),C.removeListener("close",Ne),C.removeListener("finish",ft),C.removeListener("drain",Bt),C.removeListener("error",Ce),C.removeListener("unpipe",se),q.removeListener("end",xe),q.removeListener("end",Ie),q.removeListener("data",ct),ke=!0,Z.awaitDrain&&(!C._writableState||C._writableState.needDrain)&&Bt()}q.on("data",ct);function ct(v){c("ondata");var h=C.write(v);c("dest.write",h),h===!1&&((Z.pipesCount===1&&Z.pipes===C||Z.pipesCount>1&&ge(Z.pipes,C)!==-1)&&!ke&&(c("false write response, pause",Z.awaitDrain),Z.awaitDrain++),q.pause())}function Ce(v){c("onerror",v),Ie(),C.removeListener("error",Ce),e(C,"error")===0&&F(C,v)}X(C,"error",Ce);function Ne(){C.removeListener("finish",ft),Ie()}C.once("close",Ne);function ft(){c("onfinish"),C.removeListener("close",Ne),Ie()}C.once("finish",ft);function Ie(){c("unpipe"),q.unpipe(C)}return C.emit("pipe",q),Z.flowing||(c("pipe resume"),q.resume()),C};function _(C){return function(){var q=C._readableState;c("pipeOnDrain",q.awaitDrain),q.awaitDrain&&q.awaitDrain--,q.awaitDrain===0&&e(C,"data")&&(q.flowing=!0,O(C))}}J.prototype.unpipe=function(C){var R=this._readableState,q={hasUnpiped:!1};if(R.pipesCount===0)return this;if(R.pipesCount===1)return C&&C!==R.pipes?this:(C||(C=R.pipes),R.pipes=null,R.pipesCount=0,R.flowing=!1,C&&C.emit("unpipe",this,q),this);if(!C){var Z=R.pipes,he=R.pipesCount;R.pipes=null,R.pipesCount=0,R.flowing=!1;for(var be=0;be<he;be++)Z[be].emit("unpipe",this,{hasUnpiped:!1});return this}var se=ge(R.pipes,C);return se===-1?this:(R.pipes.splice(se,1),R.pipesCount-=1,R.pipesCount===1&&(R.pipes=R.pipes[0]),C.emit("unpipe",this,q),this)},J.prototype.on=function(C,R){var q=r.prototype.on.call(this,C,R),Z=this._readableState;return C==="data"?(Z.readableListening=this.listenerCount("readable")>0,Z.flowing!==!1&&this.resume()):C==="readable"&&!Z.endEmitted&&!Z.readableListening&&(Z.readableListening=Z.needReadable=!0,Z.flowing=!1,Z.emittedReadable=!1,c("on readable",Z.length,Z.reading),Z.length?E(this):Z.reading||Te.nextTick(A,this)),q},J.prototype.addListener=J.prototype.on,J.prototype.removeListener=function(C,R){var q=r.prototype.removeListener.call(this,C,R);return C==="readable"&&Te.nextTick(d,this),q},J.prototype.removeAllListeners=function(C){var R=r.prototype.removeAllListeners.apply(this,arguments);return(C==="readable"||C===void 0)&&Te.nextTick(d,this),R};function d(C){var R=C._readableState;R.readableListening=C.listenerCount("readable")>0,R.resumeScheduled&&!R.paused?R.flowing=!0:C.listenerCount("data")>0&&C.resume()}function A(C){c("readable nexttick read 0"),C.read(0)}J.prototype.resume=function(){var C=this._readableState;return C.flowing||(c("resume"),C.flowing=!C.readableListening,Y(this,C)),C.paused=!1,this};function Y(C,R){R.resumeScheduled||(R.resumeScheduled=!0,Te.nextTick(ee,C,R))}function ee(C,R){c("resume",R.reading),R.reading||C.read(0),R.resumeScheduled=!1,C.emit("resume"),O(C),R.flowing&&!R.reading&&C.read(0)}J.prototype.pause=function(){return c("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1&&(c("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this};function O(C){var R=C._readableState;for(c("flow",R.flowing);R.flowing&&C.read()!==null;);}J.prototype.wrap=function(C){var R=this,q=this._readableState,Z=!1;C.on("end",function(){if(c("wrapped end"),q.decoder&&!q.ended){var se=q.decoder.end();se&&se.length&&R.push(se)}R.push(null)}),C.on("data",function(se){if(c("wrapped data"),q.decoder&&(se=q.decoder.write(se)),!(q.objectMode&&se==null)&&!(!q.objectMode&&(!se||!se.length))){var xe=R.push(se);xe||(Z=!0,C.pause())}});for(var he in C)this[he]===void 0&&typeof C[he]=="function"&&(this[he]=function(xe){return function(){return C[xe].apply(C,arguments)}}(he));for(var be=0;be<z.length;be++)C.on(z[be],this.emit.bind(this,z[be]));return this._read=function(se){c("wrapped _read",se),Z&&(Z=!1,C.resume())},this},typeof Symbol=="function"&&(J.prototype[Symbol.asyncIterator]=function(){return j===void 0&&(j=Bb()),j(this)}),Object.defineProperty(J.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}}),Object.defineProperty(J.prototype,"readableBuffer",{enumerable:!1,get:function(){return this._readableState&&this._readableState.buffer}}),Object.defineProperty(J.prototype,"readableFlowing",{enumerable:!1,get:function(){return this._readableState.flowing},set:function(R){this._readableState&&(this._readableState.flowing=R)}}),J._fromList=P,Object.defineProperty(J.prototype,"readableLength",{enumerable:!1,get:function(){return this._readableState.length}});function P(C,R){if(R.length===0)return null;var q;return R.objectMode?q=R.buffer.shift():!C||C>=R.length?(R.decoder?q=R.buffer.join(""):R.buffer.length===1?q=R.buffer.first():q=R.buffer.concat(R.length),R.buffer.clear()):q=R.buffer.consume(C,R.decoder),q}function V(C){var R=C._readableState;c("endReadable",R.endEmitted),R.endEmitted||(R.ended=!0,Te.nextTick(Q,R,C))}function Q(C,R){if(c("endReadableNT",C.endEmitted,C.length),!C.endEmitted&&C.length===0&&(C.endEmitted=!0,R.readable=!1,R.emit("end"),C.autoDestroy)){var q=R._writableState;(!q||q.autoDestroy&&q.finished)&&R.destroy()}}typeof Symbol=="function"&&(J.from=function(C,R){return H===void 0&&(H=Pb()),H(J,C,R)});function ge(C,R){for(var q=0,Z=C.length;q<Z;q++)if(C[q]===R)return q;return-1}return la}var nf=wr,Xs=vn.codes,Db=Xs.ERR_METHOD_NOT_IMPLEMENTED,jb=Xs.ERR_MULTIPLE_CALLBACK,$b=Xs.ERR_TRANSFORM_ALREADY_TRANSFORMING,Fb=Xs.ERR_TRANSFORM_WITH_LENGTH_0,eo=Gn();Xt(wr,eo);function Ub(t,e){var r=this._transformState;r.transforming=!1;var n=r.writecb;if(n===null)return this.emit("error",new jb);r.writechunk=null,r.writecb=null,e!=null&&this.push(e),n(t);var i=this._readableState;i.reading=!1,(i.needReadable||i.length<i.highWaterMark)&&this._read(i.highWaterMark)}function wr(t){if(!(this instanceof wr))return new wr(t);eo.call(this,t),this._transformState={afterTransform:Ub.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null},this._readableState.needReadable=!0,this._readableState.sync=!1,t&&(typeof t.transform=="function"&&(this._transform=t.transform),typeof t.flush=="function"&&(this._flush=t.flush)),this.on("prefinish",Hb)}function Hb(){var t=this;typeof this._flush=="function"&&!this._readableState.destroyed?this._flush(function(e,r){Hc(t,e,r)}):Hc(this,null,null)}wr.prototype.push=function(t,e){return this._transformState.needTransform=!1,eo.prototype.push.call(this,t,e)};wr.prototype._transform=function(t,e,r){r(new Db("_transform()"))};wr.prototype._write=function(t,e,r){var n=this._transformState;if(n.writecb=r,n.writechunk=t,n.writeencoding=e,!n.transforming){var i=this._readableState;(n.needTransform||i.needReadable||i.length<i.highWaterMark)&&this._read(i.highWaterMark)}};wr.prototype._read=function(t){var e=this._transformState;e.writechunk!==null&&!e.transforming?(e.transforming=!0,this._transform(e.writechunk,e.writeencoding,e.afterTransform)):e.needTransform=!0};wr.prototype._destroy=function(t,e){eo.prototype._destroy.call(this,t,function(r){e(r)})};function Hc(t,e,r){if(e)return t.emit("error",e);if(r!=null&&t.push(r),t._writableState.length)throw new Fb;if(t._transformState.transforming)throw new $b;return t.push(null)}var Wb=Ni,sf=nf;Xt(Ni,sf);function Ni(t){if(!(this instanceof Ni))return new Ni(t);sf.call(this,t)}Ni.prototype._transform=function(t,e,r){r(null,t)};var ha;function Vb(t){var e=!1;return function(){e||(e=!0,t.apply(void 0,arguments))}}var of=vn.codes,zb=of.ERR_MISSING_ARGS,qb=of.ERR_STREAM_DESTROYED;function Wc(t){if(t)throw t}function Gb(t){return t.setHeader&&typeof t.abort=="function"}function Jb(t,e,r,n){n=Vb(n);var i=!1;t.on("close",function(){i=!0}),ha===void 0&&(ha=mu),ha(t,{readable:e,writable:r},function(o){if(o)return n(o);i=!0,n()});var s=!1;return function(o){if(!i&&!s){if(s=!0,Gb(t))return t.abort();if(typeof t.destroy=="function")return t.destroy();n(o||new qb("pipe"))}}}function Vc(t){t()}function Zb(t,e){return t.pipe(e)}function Qb(t){return!t.length||typeof t[t.length-1]!="function"?Wc:t.pop()}function Yb(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];var n=Qb(e);if(Array.isArray(e[0])&&(e=e[0]),e.length<2)throw new zb("streams");var i,s=e.map(function(o,a){var c=a<e.length-1,l=a>0;return Jb(o,c,l,function(p){i||(i=p),p&&s.forEach(Vc),!c&&(s.forEach(Vc),n(i))})});return e.reduce(Zb)}var Kb=Yb;(function(t,e){e=t.exports=rf(),e.Stream=e,e.Readable=e,e.Writable=ef(),e.Duplex=Gn(),e.Transform=nf,e.PassThrough=Wb,e.finished=mu,e.pipeline=Kb})(Ha,Ha.exports);var af=Ha.exports;const{Transform:Xb}=af;var ev=t=>class uf extends Xb{constructor(r,n,i,s,o){super(o),this._rate=r,this._capacity=n,this._delimitedSuffix=i,this._hashBitLength=s,this._options=o,this._state=new t,this._state.initialize(r,n),this._finalized=!1}_transform(r,n,i){let s=null;try{this.update(r,n)}catch(o){s=o}i(s)}_flush(r){let n=null;try{this.push(this.digest())}catch(i){n=i}r(n)}update(r,n){if(!ye.isBuffer(r)&&typeof r!="string")throw new TypeError("Data must be a string or a buffer");if(this._finalized)throw new Error("Digest already called");return ye.isBuffer(r)||(r=ye.from(r,n)),this._state.absorb(r),this}digest(r){if(this._finalized)throw new Error("Digest already called");this._finalized=!0,this._delimitedSuffix&&this._state.absorbLastFewBits(this._delimitedSuffix);let n=this._state.squeeze(this._hashBitLength/8);return r!==void 0&&(n=n.toString(r)),this._resetState(),n}_resetState(){return this._state.initialize(this._rate,this._capacity),this}_clone(){const r=new uf(this._rate,this._capacity,this._delimitedSuffix,this._hashBitLength,this._options);return this._state.copy(r._state),r._finalized=this._finalized,r}};const{Transform:tv}=af;var rv=t=>class cf extends tv{constructor(r,n,i,s){super(s),this._rate=r,this._capacity=n,this._delimitedSuffix=i,this._options=s,this._state=new t,this._state.initialize(r,n),this._finalized=!1}_transform(r,n,i){let s=null;try{this.update(r,n)}catch(o){s=o}i(s)}_flush(){}_read(r){this.push(this.squeeze(r))}update(r,n){if(!ye.isBuffer(r)&&typeof r!="string")throw new TypeError("Data must be a string or a buffer");if(this._finalized)throw new Error("Squeeze already called");return ye.isBuffer(r)||(r=ye.from(r,n)),this._state.absorb(r),this}squeeze(r,n){this._finalized||(this._finalized=!0,this._state.absorbLastFewBits(this._delimitedSuffix));let i=this._state.squeeze(r);return n!==void 0&&(i=i.toString(n)),i}_resetState(){return this._state.initialize(this._rate,this._capacity),this}_clone(){const r=new cf(this._rate,this._capacity,this._delimitedSuffix,this._options);return this._state.copy(r._state),r._finalized=this._finalized,r}};const nv=ev,iv=rv;var sv=function(t){const e=nv(t),r=iv(t);return function(n,i){switch(typeof n=="string"?n.toLowerCase():n){case"keccak224":return new e(1152,448,null,224,i);case"keccak256":return new e(1088,512,null,256,i);case"keccak384":return new e(832,768,null,384,i);case"keccak512":return new e(576,1024,null,512,i);case"sha3-224":return new e(1152,448,6,224,i);case"sha3-256":return new e(1088,512,6,256,i);case"sha3-384":return new e(832,768,6,384,i);case"sha3-512":return new e(576,1024,6,512,i);case"shake128":return new r(1344,256,31,i);case"shake256":return new r(1088,512,31,i);default:throw new Error("Invald algorithm: "+n)}}},lf={};const zc=[1,0,32898,0,32906,2147483648,2147516416,2147483648,32907,0,2147483649,0,2147516545,2147483648,32777,2147483648,138,0,136,0,2147516425,0,2147483658,0,2147516555,0,139,2147483648,32905,2147483648,32771,2147483648,32770,2147483648,128,2147483648,32778,0,2147483658,2147483648,2147516545,2147483648,32896,2147483648,2147483649,0,2147516424,2147483648];lf.p1600=function(t){for(let e=0;e<24;++e){const r=t[0]^t[10]^t[20]^t[30]^t[40],n=t[1]^t[11]^t[21]^t[31]^t[41],i=t[2]^t[12]^t[22]^t[32]^t[42],s=t[3]^t[13]^t[23]^t[33]^t[43],o=t[4]^t[14]^t[24]^t[34]^t[44],a=t[5]^t[15]^t[25]^t[35]^t[45],c=t[6]^t[16]^t[26]^t[36]^t[46],l=t[7]^t[17]^t[27]^t[37]^t[47],p=t[8]^t[18]^t[28]^t[38]^t[48],g=t[9]^t[19]^t[29]^t[39]^t[49];let y=p^(i<<1|s>>>31),I=g^(s<<1|i>>>31);const T=t[0]^y,D=t[1]^I,U=t[10]^y,M=t[11]^I,N=t[20]^y,j=t[21]^I,H=t[30]^y,F=t[31]^I,z=t[40]^y,X=t[41]^I;y=r^(o<<1|a>>>31),I=n^(a<<1|o>>>31);const K=t[2]^y,J=t[3]^I,ne=t[12]^y,oe=t[13]^I,ue=t[22]^y,w=t[23]^I,u=t[32]^y,b=t[33]^I,m=t[42]^y,E=t[43]^I;y=i^(c<<1|l>>>31),I=s^(l<<1|c>>>31);const S=t[4]^y,k=t[5]^I,L=t[14]^y,_=t[15]^I,d=t[24]^y,A=t[25]^I,Y=t[34]^y,ee=t[35]^I,O=t[44]^y,P=t[45]^I;y=o^(p<<1|g>>>31),I=a^(g<<1|p>>>31);const V=t[6]^y,Q=t[7]^I,ge=t[16]^y,C=t[17]^I,R=t[26]^y,q=t[27]^I,Z=t[36]^y,he=t[37]^I,be=t[46]^y,se=t[47]^I;y=c^(r<<1|n>>>31),I=l^(n<<1|r>>>31);const xe=t[8]^y,Bt=t[9]^I,ke=t[18]^y,Re=t[19]^I,ct=t[28]^y,Ce=t[29]^I,Ne=t[38]^y,ft=t[39]^I,Ie=t[48]^y,v=t[49]^I,h=T,f=D,x=M<<4|U>>>28,B=U<<4|M>>>28,$=N<<3|j>>>29,W=j<<3|N>>>29,de=F<<9|H>>>23,fe=H<<9|F>>>23,ce=z<<18|X>>>14,Oe=X<<18|z>>>14,ae=K<<1|J>>>31,De=J<<1|K>>>31,En=oe<<12|ne>>>20,je=ne<<12|oe>>>20,$e=ue<<10|w>>>22,Sn=w<<10|ue>>>22,Fe=b<<13|u>>>19,Ue=u<<13|b>>>19,xn=m<<2|E>>>30,He=E<<2|m>>>30,We=k<<30|S>>>2,Mn=S<<30|k>>>2,Ve=L<<6|_>>>26,ze=_<<6|L>>>26,Cn=A<<11|d>>>21,qe=d<<11|A>>>21,Ge=Y<<15|ee>>>17,In=ee<<15|Y>>>17,Je=P<<29|O>>>3,Ze=O<<29|P>>>3,Rn=V<<28|Q>>>4,Qe=Q<<28|V>>>4,Ye=C<<23|ge>>>9,An=ge<<23|C>>>9,Ke=R<<25|q>>>7,Xe=q<<25|R>>>7,Dr=Z<<21|he>>>11,jr=he<<21|Z>>>11,$r=se<<24|be>>>8,Fr=be<<24|se>>>8,Ur=xe<<27|Bt>>>5,Hr=Bt<<27|xe>>>5,Wr=ke<<20|Re>>>12,Vr=Re<<20|ke>>>12,zr=Ce<<7|ct>>>25,qr=ct<<7|Ce>>>25,Gr=Ne<<8|ft>>>24,Jr=ft<<8|Ne>>>24,Zr=Ie<<14|v>>>18,Qr=v<<14|Ie>>>18;t[0]=h^~En&Cn,t[1]=f^~je&qe,t[10]=Rn^~Wr&$,t[11]=Qe^~Vr&W,t[20]=ae^~Ve&Ke,t[21]=De^~ze&Xe,t[30]=Ur^~x&$e,t[31]=Hr^~B&Sn,t[40]=We^~Ye&zr,t[41]=Mn^~An&qr,t[2]=En^~Cn&Dr,t[3]=je^~qe&jr,t[12]=Wr^~$&Fe,t[13]=Vr^~W&Ue,t[22]=Ve^~Ke&Gr,t[23]=ze^~Xe&Jr,t[32]=x^~$e&Ge,t[33]=B^~Sn&In,t[42]=Ye^~zr&de,t[43]=An^~qr&fe,t[4]=Cn^~Dr&Zr,t[5]=qe^~jr&Qr,t[14]=$^~Fe&Je,t[15]=W^~Ue&Ze,t[24]=Ke^~Gr&ce,t[25]=Xe^~Jr&Oe,t[34]=$e^~Ge&$r,t[35]=Sn^~In&Fr,t[44]=zr^~de&xn,t[45]=qr^~fe&He,t[6]=Dr^~Zr&h,t[7]=jr^~Qr&f,t[16]=Fe^~Je&Rn,t[17]=Ue^~Ze&Qe,t[26]=Gr^~ce&ae,t[27]=Jr^~Oe&De,t[36]=Ge^~$r&Ur,t[37]=In^~Fr&Hr,t[46]=de^~xn&We,t[47]=fe^~He&Mn,t[8]=Zr^~h&En,t[9]=Qr^~f&je,t[18]=Je^~Rn&Wr,t[19]=Ze^~Qe&Vr,t[28]=ce^~ae&Ve,t[29]=Oe^~De&ze,t[38]=$r^~Ur&x,t[39]=Fr^~Hr&B,t[48]=xn^~We&Ye,t[49]=He^~Mn&An,t[0]^=zc[e*2],t[1]^=zc[e*2+1]}};const As=lf;function li(){this.state=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],this.blockSize=null,this.count=0,this.squeezing=!1}li.prototype.initialize=function(t,e){for(let r=0;r<50;++r)this.state[r]=0;this.blockSize=t/8,this.count=0,this.squeezing=!1};li.prototype.absorb=function(t){for(let e=0;e<t.length;++e)this.state[~~(this.count/4)]^=t[e]<<8*(this.count%4),this.count+=1,this.count===this.blockSize&&(As.p1600(this.state),this.count=0)};li.prototype.absorbLastFewBits=function(t){this.state[~~(this.count/4)]^=t<<8*(this.count%4),t&128&&this.count===this.blockSize-1&&As.p1600(this.state),this.state[~~((this.blockSize-1)/4)]^=128<<8*((this.blockSize-1)%4),As.p1600(this.state),this.count=0,this.squeezing=!0};li.prototype.squeeze=function(t){this.squeezing||this.absorbLastFewBits(1);const e=ye.alloc(t);for(let r=0;r<t;++r)e[r]=this.state[~~(this.count/4)]>>>8*(this.count%4)&255,this.count+=1,this.count===this.blockSize&&(As.p1600(this.state),this.count=0);return e};li.prototype.copy=function(t){for(let e=0;e<50;++e)t.state[e]=this.state[e];t.blockSize=this.blockSize,t.count=this.count,t.squeezing=this.squeezing};var ov=li,av=sv(ov);const uv=av,cv=zs;function hf(t){return ye.allocUnsafe(t).fill(0)}function ff(t,e,r){const n=hf(e);return t=to(t),r?t.length<e?(t.copy(n),n):t.slice(0,e):t.length<e?(t.copy(n,e-t.length),n):t.slice(-e)}function lv(t,e){return ff(t,e,!0)}function to(t){if(!ye.isBuffer(t))if(Array.isArray(t))t=ye.from(t);else if(typeof t=="string")df(t)?t=ye.from(dv(pf(t)),"hex"):t=ye.from(t);else if(typeof t=="number")t=intToBuffer(t);else if(t==null)t=ye.allocUnsafe(0);else if(cv.isBN(t))t=t.toArrayLike(ye);else if(t.toArray)t=ye.from(t.toArray());else throw new Error("invalid type");return t}function hv(t){return t=to(t),"0x"+t.toString("hex")}function fv(t,e){return t=to(t),e||(e=256),uv("keccak"+e).update(t).digest()}function dv(t){return t.length%2?"0"+t:t}function df(t){return typeof t=="string"&&t.match(/^0x[0-9A-Fa-f]*$/)}function pf(t){return typeof t=="string"&&t.startsWith("0x")?t.slice(2):t}var gf={zeros:hf,setLength:ff,setLengthRight:lv,isHexString:df,stripHexPrefix:pf,toBuffer:to,bufferToHex:hv,keccak:fv};const ln=gf,an=zs;function bf(t){return t.startsWith("int[")?"int256"+t.slice(3):t==="int"?"int256":t.startsWith("uint[")?"uint256"+t.slice(4):t==="uint"?"uint256":t.startsWith("fixed[")?"fixed128x128"+t.slice(5):t==="fixed"?"fixed128x128":t.startsWith("ufixed[")?"ufixed128x128"+t.slice(6):t==="ufixed"?"ufixed128x128":t}function Fn(t){return parseInt(/^\D+(\d+)$/.exec(t)[1],10)}function qc(t){var e=/^\D+(\d+)x(\d+)$/.exec(t);return[parseInt(e[1],10),parseInt(e[2],10)]}function vf(t){var e=t.match(/(.*)\[(.*?)\]$/);return e?e[2]===""?"dynamic":parseInt(e[2],10):null}function tn(t){var e=typeof t;if(e==="string")return ln.isHexString(t)?new an(ln.stripHexPrefix(t),16):new an(t,10);if(e==="number")return new an(t);if(t.toArray)return t;throw new Error("Argument is not a number")}function or(t,e){var r,n,i,s;if(t==="address")return or("uint160",tn(e));if(t==="bool")return or("uint8",e?1:0);if(t==="string")return or("bytes",new ye(e,"utf8"));if(gv(t)){if(typeof e.length>"u")throw new Error("Not an array?");if(r=vf(t),r!=="dynamic"&&r!==0&&e.length>r)throw new Error("Elements exceed array size: "+r);i=[],t=t.slice(0,t.lastIndexOf("[")),typeof e=="string"&&(e=JSON.parse(e));for(s in e)i.push(or(t,e[s]));if(r==="dynamic"){var o=or("uint256",e.length);i.unshift(o)}return ye.concat(i)}else{if(t==="bytes")return e=new ye(e),i=ye.concat([or("uint256",e.length),e]),e.length%32!==0&&(i=ye.concat([i,ln.zeros(32-e.length%32)])),i;if(t.startsWith("bytes")){if(r=Fn(t),r<1||r>32)throw new Error("Invalid bytes<N> width: "+r);return ln.setLengthRight(e,32)}else if(t.startsWith("uint")){if(r=Fn(t),r%8||r<8||r>256)throw new Error("Invalid uint<N> width: "+r);if(n=tn(e),n.bitLength()>r)throw new Error("Supplied uint exceeds width: "+r+" vs "+n.bitLength());if(n<0)throw new Error("Supplied uint is negative");return n.toArrayLike(ye,"be",32)}else if(t.startsWith("int")){if(r=Fn(t),r%8||r<8||r>256)throw new Error("Invalid int<N> width: "+r);if(n=tn(e),n.bitLength()>r)throw new Error("Supplied int exceeds width: "+r+" vs "+n.bitLength());return n.toTwos(256).toArrayLike(ye,"be",32)}else if(t.startsWith("ufixed")){if(r=qc(t),n=tn(e),n<0)throw new Error("Supplied ufixed is negative");return or("uint256",n.mul(new an(2).pow(new an(r[1]))))}else if(t.startsWith("fixed"))return r=qc(t),or("int256",tn(e).mul(new an(2).pow(new an(r[1]))))}throw new Error("Unsupported or invalid type: "+t)}function pv(t){return t==="string"||t==="bytes"||vf(t)==="dynamic"}function gv(t){return t.lastIndexOf("]")===t.length-1}function bv(t,e){var r=[],n=[],i=32*t.length;for(var s in t){var o=bf(t[s]),a=e[s],c=or(o,a);pv(o)?(r.push(or("uint256",i)),n.push(c),i+=c.length):r.push(c)}return ye.concat(r.concat(n))}function mf(t,e){if(t.length!==e.length)throw new Error("Number of types are not matching the values");for(var r,n,i=[],s=0;s<t.length;s++){var o=bf(t[s]),a=e[s];if(o==="bytes")i.push(a);else if(o==="string")i.push(new ye(a,"utf8"));else if(o==="bool")i.push(new ye(a?"01":"00","hex"));else if(o==="address")i.push(ln.setLength(a,20));else if(o.startsWith("bytes")){if(r=Fn(o),r<1||r>32)throw new Error("Invalid bytes<N> width: "+r);i.push(ln.setLengthRight(a,r))}else if(o.startsWith("uint")){if(r=Fn(o),r%8||r<8||r>256)throw new Error("Invalid uint<N> width: "+r);if(n=tn(a),n.bitLength()>r)throw new Error("Supplied uint exceeds width: "+r+" vs "+n.bitLength());i.push(n.toArrayLike(ye,"be",r/8))}else if(o.startsWith("int")){if(r=Fn(o),r%8||r<8||r>256)throw new Error("Invalid int<N> width: "+r);if(n=tn(a),n.bitLength()>r)throw new Error("Supplied int exceeds width: "+r+" vs "+n.bitLength());i.push(n.toTwos(r).toArrayLike(ye,"be",r/8))}else throw new Error("Unsupported or invalid type: "+o)}return ye.concat(i)}function vv(t,e){return ln.keccak(mf(t,e))}var mv={rawEncode:bv,solidityPack:mf,soliditySHA3:vv};const Zt=gf,Mi=mv,yf={type:"object",properties:{types:{type:"object",additionalProperties:{type:"array",items:{type:"object",properties:{name:{type:"string"},type:{type:"string"}},required:["name","type"]}}},primaryType:{type:"string"},domain:{type:"object"},message:{type:"object"}},required:["types","primaryType","domain","message"]},fa={encodeData(t,e,r,n=!0){const i=["bytes32"],s=[this.hashType(t,r)];if(n){const o=(a,c,l)=>{if(r[c]!==void 0)return["bytes32",l==null?"0x0000000000000000000000000000000000000000000000000000000000000000":Zt.keccak(this.encodeData(c,l,r,n))];if(l===void 0)throw new Error(`missing value for field ${a} of type ${c}`);if(c==="bytes")return["bytes32",Zt.keccak(l)];if(c==="string")return typeof l=="string"&&(l=ye.from(l,"utf8")),["bytes32",Zt.keccak(l)];if(c.lastIndexOf("]")===c.length-1){const p=c.slice(0,c.lastIndexOf("[")),g=l.map(y=>o(a,p,y));return["bytes32",Zt.keccak(Mi.rawEncode(g.map(([y])=>y),g.map(([,y])=>y)))]}return[c,l]};for(const a of r[t]){const[c,l]=o(a.name,a.type,e[a.name]);i.push(c),s.push(l)}}else for(const o of r[t]){let a=e[o.name];if(a!==void 0)if(o.type==="bytes")i.push("bytes32"),a=Zt.keccak(a),s.push(a);else if(o.type==="string")i.push("bytes32"),typeof a=="string"&&(a=ye.from(a,"utf8")),a=Zt.keccak(a),s.push(a);else if(r[o.type]!==void 0)i.push("bytes32"),a=Zt.keccak(this.encodeData(o.type,a,r,n)),s.push(a);else{if(o.type.lastIndexOf("]")===o.type.length-1)throw new Error("Arrays currently unimplemented in encodeData");i.push(o.type),s.push(a)}}return Mi.rawEncode(i,s)},encodeType(t,e){let r="",n=this.findTypeDependencies(t,e).filter(i=>i!==t);n=[t].concat(n.sort());for(const i of n){if(!e[i])throw new Error("No type definition specified: "+i);r+=i+"("+e[i].map(({name:o,type:a})=>a+" "+o).join(",")+")"}return r},findTypeDependencies(t,e,r=[]){if(t=t.match(/^\w*/)[0],r.includes(t)||e[t]===void 0)return r;r.push(t);for(const n of e[t])for(const i of this.findTypeDependencies(n.type,e,r))!r.includes(i)&&r.push(i);return r},hashStruct(t,e,r,n=!0){return Zt.keccak(this.encodeData(t,e,r,n))},hashType(t,e){return Zt.keccak(this.encodeType(t,e))},sanitizeData(t){const e={};for(const r in yf.properties)t[r]&&(e[r]=t[r]);return e.types&&(e.types=Object.assign({EIP712Domain:[]},e.types)),e},hash(t,e=!0){const r=this.sanitizeData(t),n=[ye.from("1901","hex")];return n.push(this.hashStruct("EIP712Domain",r.domain,r.types,e)),r.primaryType!=="EIP712Domain"&&n.push(this.hashStruct(r.primaryType,r.message,r.types,e)),Zt.keccak(ye.concat(n))}};var yv={TYPED_MESSAGE_SCHEMA:yf,TypedDataUtils:fa,hashForSignTypedDataLegacy:function(t){return _v(t.data)},hashForSignTypedData_v3:function(t){return fa.hash(t.data,!1)},hashForSignTypedData_v4:function(t){return fa.hash(t.data)}};function _v(t){const e=new Error("Expect argument to be non-empty array");if(typeof t!="object"||!t.length)throw e;const r=t.map(function(s){return s.type==="bytes"?Zt.toBuffer(s.value):s.value}),n=t.map(function(s){return s.type}),i=t.map(function(s){if(!s.name)throw e;return s.type+" "+s.name});return Mi.soliditySHA3(["bytes32","bytes32"],[Mi.soliditySHA3(new Array(t.length).fill("string"),i),Mi.soliditySHA3(n,r)])}var Jn={};Object.defineProperty(Jn,"__esModule",{value:!0});Jn.filterFromParam=Jn.FilterPolyfill=void 0;const Pn=Vi,xt=re,wv=5*60*1e3,rn={jsonrpc:"2.0",id:0};class Ev{constructor(e){this.logFilters=new Map,this.blockFilters=new Set,this.pendingTransactionFilters=new Set,this.cursors=new Map,this.timeouts=new Map,this.nextFilterId=(0,Pn.IntNumber)(1),this.provider=e}async newFilter(e){const r=_f(e),n=this.makeFilterId(),i=await this.setInitialCursorPosition(n,r.fromBlock);return console.log(`Installing new log filter(${n}):`,r,"initial cursor position:",i),this.logFilters.set(n,r),this.setFilterTimeout(n),(0,xt.hexStringFromIntNumber)(n)}async newBlockFilter(){const e=this.makeFilterId(),r=await this.setInitialCursorPosition(e,"latest");return console.log(`Installing new block filter (${e}) with initial cursor position:`,r),this.blockFilters.add(e),this.setFilterTimeout(e),(0,xt.hexStringFromIntNumber)(e)}async newPendingTransactionFilter(){const e=this.makeFilterId(),r=await this.setInitialCursorPosition(e,"latest");return console.log(`Installing new block filter (${e}) with initial cursor position:`,r),this.pendingTransactionFilters.add(e),this.setFilterTimeout(e),(0,xt.hexStringFromIntNumber)(e)}uninstallFilter(e){const r=(0,xt.intNumberFromHexString)(e);return console.log(`Uninstalling filter (${r})`),this.deleteFilter(r),!0}getFilterChanges(e){const r=(0,xt.intNumberFromHexString)(e);return this.timeouts.has(r)&&this.setFilterTimeout(r),this.logFilters.has(r)?this.getLogFilterChanges(r):this.blockFilters.has(r)?this.getBlockFilterChanges(r):this.pendingTransactionFilters.has(r)?this.getPendingTransactionFilterChanges(r):Promise.resolve(ls())}async getFilterLogs(e){const r=(0,xt.intNumberFromHexString)(e),n=this.logFilters.get(r);return n?this.sendAsyncPromise(Object.assign(Object.assign({},rn),{method:"eth_getLogs",params:[Gc(n)]})):ls()}makeFilterId(){return(0,Pn.IntNumber)(++this.nextFilterId)}sendAsyncPromise(e){return new Promise((r,n)=>{this.provider.sendAsync(e,(i,s)=>{if(i)return n(i);if(Array.isArray(s)||s==null)return n(new Error(`unexpected response received: ${JSON.stringify(s)}`));r(s)})})}deleteFilter(e){console.log(`Deleting filter (${e})`),this.logFilters.delete(e),this.blockFilters.delete(e),this.pendingTransactionFilters.delete(e),this.cursors.delete(e),this.timeouts.delete(e)}async getLogFilterChanges(e){const r=this.logFilters.get(e),n=this.cursors.get(e);if(!n||!r)return ls();const i=await this.getCurrentBlockHeight(),s=r.toBlock==="latest"?i:r.toBlock;if(n>i||n>r.toBlock)return hs();console.log(`Fetching logs from ${n} to ${s} for filter ${e}`);const o=await this.sendAsyncPromise(Object.assign(Object.assign({},rn),{method:"eth_getLogs",params:[Gc(Object.assign(Object.assign({},r),{fromBlock:n,toBlock:s}))]}));if(Array.isArray(o.result)){const a=o.result.map(l=>(0,xt.intNumberFromHexString)(l.blockNumber||"0x0")),c=Math.max(...a);if(c&&c>n){const l=(0,Pn.IntNumber)(c+1);console.log(`Moving cursor position for filter (${e}) from ${n} to ${l}`),this.cursors.set(e,l)}}return o}async getBlockFilterChanges(e){const r=this.cursors.get(e);if(!r)return ls();const n=await this.getCurrentBlockHeight();if(r>n)return hs();console.log(`Fetching blocks from ${r} to ${n} for filter (${e})`);const i=(await Promise.all((0,xt.range)(r,n+1).map(o=>this.getBlockHashByNumber((0,Pn.IntNumber)(o))))).filter(o=>!!o),s=(0,Pn.IntNumber)(r+i.length);return console.log(`Moving cursor position for filter (${e}) from ${r} to ${s}`),this.cursors.set(e,s),Object.assign(Object.assign({},rn),{result:i})}async getPendingTransactionFilterChanges(e){return Promise.resolve(hs())}async setInitialCursorPosition(e,r){const n=await this.getCurrentBlockHeight(),i=typeof r=="number"&&r>n?r:n;return this.cursors.set(e,i),i}setFilterTimeout(e){const r=this.timeouts.get(e);r&&window.clearTimeout(r);const n=window.setTimeout(()=>{console.log(`Filter (${e}) timed out`),this.deleteFilter(e)},wv);this.timeouts.set(e,n)}async getCurrentBlockHeight(){const{result:e}=await this.sendAsyncPromise(Object.assign(Object.assign({},rn),{method:"eth_blockNumber",params:[]}));return(0,xt.intNumberFromHexString)((0,xt.ensureHexString)(e))}async getBlockHashByNumber(e){const r=await this.sendAsyncPromise(Object.assign(Object.assign({},rn),{method:"eth_getBlockByNumber",params:[(0,xt.hexStringFromIntNumber)(e),!1]}));return r.result&&typeof r.result.hash=="string"?(0,xt.ensureHexString)(r.result.hash):null}}Jn.FilterPolyfill=Ev;function _f(t){return{fromBlock:Jc(t.fromBlock),toBlock:Jc(t.toBlock),addresses:t.address===void 0?null:Array.isArray(t.address)?t.address:[t.address],topics:t.topics||[]}}Jn.filterFromParam=_f;function Gc(t){const e={fromBlock:Zc(t.fromBlock),toBlock:Zc(t.toBlock),topics:t.topics};return t.addresses!==null&&(e.address=t.addresses),e}function Jc(t){if(t===void 0||t==="latest"||t==="pending")return"latest";if(t==="earliest")return(0,Pn.IntNumber)(0);if((0,xt.isHexString)(t))return(0,xt.intNumberFromHexString)(t);throw new Error(`Invalid block option: ${String(t)}`)}function Zc(t){return t==="latest"?t:(0,xt.hexStringFromIntNumber)(t)}function ls(){return Object.assign(Object.assign({},rn),{error:{code:-32e3,message:"filter not found"}})}function hs(){return Object.assign(Object.assign({},rn),{result:[]})}var wf={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.JSONRPCMethod=void 0,function(e){e.eth_accounts="eth_accounts",e.eth_coinbase="eth_coinbase",e.net_version="net_version",e.eth_chainId="eth_chainId",e.eth_uninstallFilter="eth_uninstallFilter",e.eth_requestAccounts="eth_requestAccounts",e.eth_sign="eth_sign",e.eth_ecRecover="eth_ecRecover",e.personal_sign="personal_sign",e.personal_ecRecover="personal_ecRecover",e.eth_signTransaction="eth_signTransaction",e.eth_sendRawTransaction="eth_sendRawTransaction",e.eth_sendTransaction="eth_sendTransaction",e.eth_signTypedData_v1="eth_signTypedData_v1",e.eth_signTypedData_v2="eth_signTypedData_v2",e.eth_signTypedData_v3="eth_signTypedData_v3",e.eth_signTypedData_v4="eth_signTypedData_v4",e.eth_signTypedData="eth_signTypedData",e.cbWallet_arbitrary="walletlink_arbitrary",e.wallet_addEthereumChain="wallet_addEthereumChain",e.wallet_switchEthereumChain="wallet_switchEthereumChain",e.wallet_watchAsset="wallet_watchAsset",e.eth_subscribe="eth_subscribe",e.eth_unsubscribe="eth_unsubscribe",e.eth_newFilter="eth_newFilter",e.eth_newBlockFilter="eth_newBlockFilter",e.eth_newPendingTransactionFilter="eth_newPendingTransactionFilter",e.eth_getFilterChanges="eth_getFilterChanges",e.eth_getFilterLogs="eth_getFilterLogs"}(t.JSONRPCMethod||(t.JSONRPCMethod={}))})(wf);var ro={},Ef={},no={},yu=Sv;function Sv(t){t=t||{};var e=t.max||Number.MAX_SAFE_INTEGER,r=typeof t.start<"u"?t.start:Math.floor(Math.random()*e);return function(){return r=r%e,r++}}const Qc=(t,e)=>function(){const r=e.promiseModule,n=new Array(arguments.length);for(let i=0;i<arguments.length;i++)n[i]=arguments[i];return new r((i,s)=>{e.errorFirst?n.push(function(o,a){if(e.multiArgs){const c=new Array(arguments.length-1);for(let l=1;l<arguments.length;l++)c[l-1]=arguments[l];o?(c.unshift(o),s(c)):i(c)}else o?s(o):i(a)}):n.push(function(o){if(e.multiArgs){const a=new Array(arguments.length-1);for(let c=0;c<arguments.length;c++)a[c]=arguments[c];i(a)}else i(o)}),t.apply(this,n)})};var xv=(t,e)=>{e=Object.assign({exclude:[/.+(Sync|Stream)$/],errorFirst:!0,promiseModule:Promise},e);const r=i=>{const s=o=>typeof o=="string"?i===o:o.test(i);return e.include?e.include.some(s):!e.exclude.some(s)};let n;typeof t=="function"?n=function(){return e.excludeMain?t.apply(this,arguments):Qc(t,e).apply(this,arguments)}:n=Object.create(Object.getPrototypeOf(t));for(const i in t){const s=t[i];n[i]=typeof s=="function"&&r(i)?Qc(s,e):s}return n},Gi={},Mv=te&&te.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Gi,"__esModule",{value:!0});Gi.BaseBlockTracker=void 0;const Cv=Mv(pn),Iv=1e3,Rv=(t,e)=>t+e,Yc=["sync","latest"];class Av extends Cv.default{constructor(e){super(),this._blockResetDuration=e.blockResetDuration||20*Iv,this._currentBlock=null,this._isRunning=!1,this._onNewListener=this._onNewListener.bind(this),this._onRemoveListener=this._onRemoveListener.bind(this),this._resetCurrentBlock=this._resetCurrentBlock.bind(this),this._setupInternalEvents()}async destroy(){this._cancelBlockResetTimeout(),await this._maybeEnd(),super.removeAllListeners()}isRunning(){return this._isRunning}getCurrentBlock(){return this._currentBlock}async getLatestBlock(){return this._currentBlock?this._currentBlock:await new Promise(r=>this.once("latest",r))}removeAllListeners(e){return e?super.removeAllListeners(e):super.removeAllListeners(),this._setupInternalEvents(),this._onRemoveListener(),this}_setupInternalEvents(){this.removeListener("newListener",this._onNewListener),this.removeListener("removeListener",this._onRemoveListener),this.on("newListener",this._onNewListener),this.on("removeListener",this._onRemoveListener)}_onNewListener(e){Yc.includes(e)&&this._maybeStart()}_onRemoveListener(){this._getBlockTrackerEventCount()>0||this._maybeEnd()}async _maybeStart(){this._isRunning||(this._isRunning=!0,this._cancelBlockResetTimeout(),await this._start(),this.emit("_started"))}async _maybeEnd(){this._isRunning&&(this._isRunning=!1,this._setupBlockResetTimeout(),await this._end(),this.emit("_ended"))}_getBlockTrackerEventCount(){return Yc.map(e=>this.listenerCount(e)).reduce(Rv)}_newPotentialLatest(e){const r=this._currentBlock;r&&Kc(e)<=Kc(r)||this._setCurrentBlock(e)}_setCurrentBlock(e){const r=this._currentBlock;this._currentBlock=e,this.emit("latest",e),this.emit("sync",{oldBlock:r,newBlock:e})}_setupBlockResetTimeout(){this._cancelBlockResetTimeout(),this._blockResetTimeout=setTimeout(this._resetCurrentBlock,this._blockResetDuration),this._blockResetTimeout.unref&&this._blockResetTimeout.unref()}_cancelBlockResetTimeout(){this._blockResetTimeout&&clearTimeout(this._blockResetTimeout)}_resetCurrentBlock(){this._currentBlock=null}}Gi.BaseBlockTracker=Av;function Kc(t){return Number.parseInt(t,16)}var Sf={},xf={},_t={};class Mf extends TypeError{constructor(e,r){let n;const{message:i,explanation:s,...o}=e,{path:a}=e,c=a.length===0?i:`At path: ${a.join(".")} -- ${i}`;super(s??c),s!=null&&(this.cause=c),Object.assign(this,o),this.name=this.constructor.name,this.failures=()=>n??(n=[e,...r()])}}function Tv(t){return Vt(t)&&typeof t[Symbol.iterator]=="function"}function Vt(t){return typeof t=="object"&&t!=null}function Xc(t){if(Object.prototype.toString.call(t)!=="[object Object]")return!1;const e=Object.getPrototypeOf(t);return e===null||e===Object.prototype}function ht(t){return typeof t=="symbol"?t.toString():typeof t=="string"?JSON.stringify(t):`${t}`}function kv(t){const{done:e,value:r}=t.next();return e?void 0:r}function Nv(t,e,r,n){if(t===!0)return;t===!1?t={}:typeof t=="string"&&(t={message:t});const{path:i,branch:s}=e,{type:o}=r,{refinement:a,message:c=`Expected a value of type \`${o}\`${a?` with refinement \`${a}\``:""}, but received: \`${ht(n)}\``}=t;return{value:n,type:o,refinement:a,key:i[i.length-1],path:i,branch:s,...t,message:c}}function*Va(t,e,r,n){Tv(t)||(t=[t]);for(const i of t){const s=Nv(i,e,r,n);s&&(yield s)}}function*_u(t,e,r={}){const{path:n=[],branch:i=[t],coerce:s=!1,mask:o=!1}=r,a={path:n,branch:i};if(s&&(t=e.coercer(t,a),o&&e.type!=="type"&&Vt(e.schema)&&Vt(t)&&!Array.isArray(t)))for(const l in t)e.schema[l]===void 0&&delete t[l];let c="valid";for(const l of e.validator(t,a))l.explanation=r.message,c="not_valid",yield[l,void 0];for(let[l,p,g]of e.entries(t,a)){const y=_u(p,g,{path:l===void 0?n:[...n,l],branch:l===void 0?i:[...i,p],coerce:s,mask:o,message:r.message});for(const I of y)I[0]?(c=I[0].refinement!=null?"not_refined":"not_valid",yield[I[0],void 0]):s&&(p=I[1],l===void 0?t=p:t instanceof Map?t.set(l,p):t instanceof Set?t.add(p):Vt(t)&&(p!==void 0||l in t)&&(t[l]=p))}if(c!=="not_valid")for(const l of e.refiner(t,a))l.explanation=r.message,c="not_refined",yield[l,void 0];c==="valid"&&(yield[void 0,t])}class at{constructor(e){const{type:r,schema:n,validator:i,refiner:s,coercer:o=c=>c,entries:a=function*(){}}=e;this.type=r,this.schema=n,this.entries=a,this.coercer=o,i?this.validator=(c,l)=>{const p=i(c,l);return Va(p,l,this,c)}:this.validator=()=>[],s?this.refiner=(c,l)=>{const p=s(c,l);return Va(p,l,this,c)}:this.refiner=()=>[]}assert(e,r){return Cf(e,this,r)}create(e,r){return If(e,this,r)}is(e){return wu(e,this)}mask(e,r){return Rf(e,this,r)}validate(e,r={}){return hi(e,this,r)}}function Cf(t,e,r){const n=hi(t,e,{message:r});if(n[0])throw n[0]}function If(t,e,r){const n=hi(t,e,{coerce:!0,message:r});if(n[0])throw n[0];return n[1]}function Rf(t,e,r){const n=hi(t,e,{coerce:!0,mask:!0,message:r});if(n[0])throw n[0];return n[1]}function wu(t,e){return!hi(t,e)[0]}function hi(t,e,r={}){const n=_u(t,e,r),i=kv(n);return i[0]?[new Mf(i[0],function*(){for(const o of n)o[0]&&(yield o[0])}),void 0]:[void 0,i[1]]}function Ov(...t){const e=t[0].type==="type",r=t.map(i=>i.schema),n=Object.assign({},...r);return e?Su(n):Ji(n)}function Tt(t,e){return new at({type:t,schema:null,validator:e})}function Lv(t,e){return new at({...t,refiner:(r,n)=>r===void 0||t.refiner(r,n),validator(r,n){return r===void 0?!0:(e(r,n),t.validator(r,n))}})}function Bv(t){return new at({type:"dynamic",schema:null,*entries(e,r){yield*t(e,r).entries(e,r)},validator(e,r){return t(e,r).validator(e,r)},coercer(e,r){return t(e,r).coercer(e,r)},refiner(e,r){return t(e,r).refiner(e,r)}})}function Pv(t){let e;return new at({type:"lazy",schema:null,*entries(r,n){e??(e=t()),yield*e.entries(r,n)},validator(r,n){return e??(e=t()),e.validator(r,n)},coercer(r,n){return e??(e=t()),e.coercer(r,n)},refiner(r,n){return e??(e=t()),e.refiner(r,n)}})}function Dv(t,e){const{schema:r}=t,n={...r};for(const i of e)delete n[i];switch(t.type){case"type":return Su(n);default:return Ji(n)}}function jv(t){const e=t instanceof at?{...t.schema}:{...t};for(const r in e)e[r]=Af(e[r]);return Ji(e)}function $v(t,e){const{schema:r}=t,n={};for(const i of e)n[i]=r[i];return Ji(n)}function Fv(t,e){return console.warn("superstruct@0.11 - The `struct` helper has been renamed to `define`."),Tt(t,e)}function Uv(){return Tt("any",()=>!0)}function Hv(t){return new at({type:"array",schema:t,*entries(e){if(t&&Array.isArray(e))for(const[r,n]of e.entries())yield[r,n,t]},coercer(e){return Array.isArray(e)?e.slice():e},validator(e){return Array.isArray(e)||`Expected an array value, but received: ${ht(e)}`}})}function Wv(){return Tt("bigint",t=>typeof t=="bigint")}function Vv(){return Tt("boolean",t=>typeof t=="boolean")}function zv(){return Tt("date",t=>t instanceof Date&&!isNaN(t.getTime())||`Expected a valid \`Date\` object, but received: ${ht(t)}`)}function qv(t){const e={},r=t.map(n=>ht(n)).join();for(const n of t)e[n]=n;return new at({type:"enums",schema:e,validator(n){return t.includes(n)||`Expected one of \`${r}\`, but received: ${ht(n)}`}})}function Gv(){return Tt("func",t=>typeof t=="function"||`Expected a function, but received: ${ht(t)}`)}function Jv(t){return Tt("instance",e=>e instanceof t||`Expected a \`${t.name}\` instance, but received: ${ht(e)}`)}function Zv(){return Tt("integer",t=>typeof t=="number"&&!isNaN(t)&&Number.isInteger(t)||`Expected an integer, but received: ${ht(t)}`)}function Qv(t){return new at({type:"intersection",schema:null,*entries(e,r){for(const n of t)yield*n.entries(e,r)},*validator(e,r){for(const n of t)yield*n.validator(e,r)},*refiner(e,r){for(const n of t)yield*n.refiner(e,r)}})}function Yv(t){const e=ht(t),r=typeof t;return new at({type:"literal",schema:r==="string"||r==="number"||r==="boolean"?t:null,validator(n){return n===t||`Expected the literal \`${e}\`, but received: ${ht(n)}`}})}function Kv(t,e){return new at({type:"map",schema:null,*entries(r){if(t&&e&&r instanceof Map)for(const[n,i]of r.entries())yield[n,n,t],yield[n,i,e]},coercer(r){return r instanceof Map?new Map(r):r},validator(r){return r instanceof Map||`Expected a \`Map\` object, but received: ${ht(r)}`}})}function Eu(){return Tt("never",()=>!1)}function Xv(t){return new at({...t,validator:(e,r)=>e===null||t.validator(e,r),refiner:(e,r)=>e===null||t.refiner(e,r)})}function e1(){return Tt("number",t=>typeof t=="number"&&!isNaN(t)||`Expected a number, but received: ${ht(t)}`)}function Ji(t){const e=t?Object.keys(t):[],r=Eu();return new at({type:"object",schema:t||null,*entries(n){if(t&&Vt(n)){const i=new Set(Object.keys(n));for(const s of e)i.delete(s),yield[s,n[s],t[s]];for(const s of i)yield[s,n[s],r]}},validator(n){return Vt(n)||`Expected an object, but received: ${ht(n)}`},coercer(n){return Vt(n)?{...n}:n}})}function Af(t){return new at({...t,validator:(e,r)=>e===void 0||t.validator(e,r),refiner:(e,r)=>e===void 0||t.refiner(e,r)})}function t1(t,e){return new at({type:"record",schema:null,*entries(r){if(Vt(r))for(const n in r){const i=r[n];yield[n,n,t],yield[n,i,e]}},validator(r){return Vt(r)||`Expected an object, but received: ${ht(r)}`}})}function r1(){return Tt("regexp",t=>t instanceof RegExp)}function n1(t){return new at({type:"set",schema:null,*entries(e){if(t&&e instanceof Set)for(const r of e)yield[r,r,t]},coercer(e){return e instanceof Set?new Set(e):e},validator(e){return e instanceof Set||`Expected a \`Set\` object, but received: ${ht(e)}`}})}function Tf(){return Tt("string",t=>typeof t=="string"||`Expected a string, but received: ${ht(t)}`)}function i1(t){const e=Eu();return new at({type:"tuple",schema:null,*entries(r){if(Array.isArray(r)){const n=Math.max(t.length,r.length);for(let i=0;i<n;i++)yield[i,r[i],t[i]||e]}},validator(r){return Array.isArray(r)||`Expected an array, but received: ${ht(r)}`}})}function Su(t){const e=Object.keys(t);return new at({type:"type",schema:t,*entries(r){if(Vt(r))for(const n of e)yield[n,r[n],t[n]]},validator(r){return Vt(r)||`Expected an object, but received: ${ht(r)}`},coercer(r){return Vt(r)?{...r}:r}})}function s1(t){const e=t.map(r=>r.type).join(" | ");return new at({type:"union",schema:null,coercer(r){for(const n of t){const[i,s]=n.validate(r,{coerce:!0});if(!i)return s}return r},validator(r,n){const i=[];for(const s of t){const[...o]=_u(r,s,n),[a]=o;if(a[0])for(const[c]of o)c&&i.push(c);else return[]}return[`Expected the value to satisfy a union of \`${e}\`, but received: ${ht(r)}`,...i]}})}function kf(){return Tt("unknown",()=>!0)}function xu(t,e,r){return new at({...t,coercer:(n,i)=>wu(n,e)?t.coercer(r(n,i),i):t.coercer(n,i)})}function o1(t,e,r={}){return xu(t,kf(),n=>{const i=typeof e=="function"?e():e;if(n===void 0)return i;if(!r.strict&&Xc(n)&&Xc(i)){const s={...n};let o=!1;for(const a in i)s[a]===void 0&&(s[a]=i[a],o=!0);if(o)return s}return n})}function a1(t){return xu(t,Tf(),e=>e.trim())}function u1(t){return mn(t,"empty",e=>{const r=Nf(e);return r===0||`Expected an empty ${t.type} but received one with a size of \`${r}\``})}function Nf(t){return t instanceof Map||t instanceof Set?t.size:t.length}function c1(t,e,r={}){const{exclusive:n}=r;return mn(t,"max",i=>n?i<e:i<=e||`Expected a ${t.type} less than ${n?"":"or equal to "}${e} but received \`${i}\``)}function l1(t,e,r={}){const{exclusive:n}=r;return mn(t,"min",i=>n?i>e:i>=e||`Expected a ${t.type} greater than ${n?"":"or equal to "}${e} but received \`${i}\``)}function h1(t){return mn(t,"nonempty",e=>Nf(e)>0||`Expected a nonempty ${t.type} but received an empty one`)}function f1(t,e){return mn(t,"pattern",r=>e.test(r)||`Expected a ${t.type} matching \`/${e.source}/\` but received "${r}"`)}function d1(t,e,r=e){const n=`Expected a ${t.type}`,i=e===r?`of \`${e}\``:`between \`${e}\` and \`${r}\``;return mn(t,"size",s=>{if(typeof s=="number"||s instanceof Date)return e<=s&&s<=r||`${n} ${i} but received \`${s}\``;if(s instanceof Map||s instanceof Set){const{size:o}=s;return e<=o&&o<=r||`${n} with a size ${i} but received one with a size of \`${o}\``}else{const{length:o}=s;return e<=o&&o<=r||`${n} with a length ${i} but received one with a length of \`${o}\``}})}function mn(t,e,r){return new at({...t,*refiner(n,i){yield*t.refiner(n,i);const s=r(n,i),o=Va(s,i,t,n);for(const a of o)yield{...a,refinement:e}}})}const p1=Object.freeze(Object.defineProperty({__proto__:null,Struct:at,StructError:Mf,any:Uv,array:Hv,assert:Cf,assign:Ov,bigint:Wv,boolean:Vv,coerce:xu,create:If,date:zv,defaulted:o1,define:Tt,deprecated:Lv,dynamic:Bv,empty:u1,enums:qv,func:Gv,instance:Jv,integer:Zv,intersection:Qv,is:wu,lazy:Pv,literal:Yv,map:Kv,mask:Rf,max:c1,min:l1,never:Eu,nonempty:h1,nullable:Xv,number:e1,object:Ji,omit:Dv,optional:Af,partial:jv,pattern:f1,pick:$v,record:t1,refine:mn,regexp:r1,set:n1,size:d1,string:Tf,struct:Fv,trimmed:a1,tuple:i1,type:Su,union:s1,unknown:kf,validate:hi},Symbol.toStringTag,{value:"Module"})),yn=si(p1);Object.defineProperty(_t,"__esModule",{value:!0});_t.assertExhaustive=_t.assertStruct=_t.assert=_t.AssertionError=void 0;const g1=yn;function b1(t){return typeof t=="object"&&t!==null&&"message"in t}function v1(t){var e,r;return typeof((r=(e=t==null?void 0:t.prototype)===null||e===void 0?void 0:e.constructor)===null||r===void 0?void 0:r.name)=="string"}function m1(t){const e=b1(t)?t.message:String(t);return e.endsWith(".")?e.slice(0,-1):e}function Of(t,e){return v1(t)?new t({message:e}):t({message:e})}class Mu extends Error{constructor(e){super(e.message),this.code="ERR_ASSERTION"}}_t.AssertionError=Mu;function y1(t,e="Assertion failed.",r=Mu){if(!t)throw e instanceof Error?e:Of(r,e)}_t.assert=y1;function _1(t,e,r="Assertion failed",n=Mu){try{(0,g1.assert)(t,e)}catch(i){throw Of(n,`${r}: ${m1(i)}.`)}}_t.assertStruct=_1;function w1(t){throw new Error("Invalid branch reached. Should be detected during compilation.")}_t.assertExhaustive=w1;var Zi={};Object.defineProperty(Zi,"__esModule",{value:!0});Zi.base64=void 0;const E1=yn,S1=_t,x1=(t,e={})=>{var r,n;const i=(r=e.paddingRequired)!==null&&r!==void 0?r:!1,s=(n=e.characterSet)!==null&&n!==void 0?n:"base64";let o;s==="base64"?o=String.raw`[A-Za-z0-9+\/]`:((0,S1.assert)(s==="base64url"),o=String.raw`[-_A-Za-z0-9]`);let a;return i?a=new RegExp(`^(?:${o}{4})*(?:${o}{3}=|${o}{2}==)?$`,"u"):a=new RegExp(`^(?:${o}{4})*(?:${o}{2,3}|${o}{3}=|${o}{2}==)?$`,"u"),(0,E1.pattern)(t,a)};Zi.base64=x1;var Se={},Qi={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.remove0x=t.add0x=t.assertIsStrictHexString=t.assertIsHexString=t.isStrictHexString=t.isHexString=t.StrictHexStruct=t.HexStruct=void 0;const e=yn,r=_t;t.HexStruct=(0,e.pattern)((0,e.string)(),/^(?:0x)?[0-9a-f]+$/iu),t.StrictHexStruct=(0,e.pattern)((0,e.string)(),/^0x[0-9a-f]+$/iu);function n(l){return(0,e.is)(l,t.HexStruct)}t.isHexString=n;function i(l){return(0,e.is)(l,t.StrictHexStruct)}t.isStrictHexString=i;function s(l){(0,r.assert)(n(l),"Value must be a hexadecimal string.")}t.assertIsHexString=s;function o(l){(0,r.assert)(i(l),'Value must be a hexadecimal string, starting with "0x".')}t.assertIsStrictHexString=o;function a(l){return l.startsWith("0x")?l:l.startsWith("0X")?`0x${l.substring(2)}`:`0x${l}`}t.add0x=a;function c(l){return l.startsWith("0x")||l.startsWith("0X")?l.substring(2):l}t.remove0x=c})(Qi);Object.defineProperty(Se,"__esModule",{value:!0});Se.createDataView=Se.concatBytes=Se.valueToBytes=Se.stringToBytes=Se.numberToBytes=Se.signedBigIntToBytes=Se.bigIntToBytes=Se.hexToBytes=Se.bytesToString=Se.bytesToNumber=Se.bytesToSignedBigInt=Se.bytesToBigInt=Se.bytesToHex=Se.assertIsBytes=Se.isBytes=void 0;const Nt=_t,za=Qi,el=48,tl=58,rl=87;function M1(){const t=[];return()=>{if(t.length===0)for(let e=0;e<256;e++)t.push(e.toString(16).padStart(2,"0"));return t}}const C1=M1();function Cu(t){return t instanceof Uint8Array}Se.isBytes=Cu;function fi(t){(0,Nt.assert)(Cu(t),"Value must be a Uint8Array.")}Se.assertIsBytes=fi;function Lf(t){if(fi(t),t.length===0)return"0x";const e=C1(),r=new Array(t.length);for(let n=0;n<t.length;n++)r[n]=e[t[n]];return(0,za.add0x)(r.join(""))}Se.bytesToHex=Lf;function Bf(t){fi(t);const e=Lf(t);return BigInt(e)}Se.bytesToBigInt=Bf;function I1(t){fi(t);let e=BigInt(0);for(const r of t)e=(e<<BigInt(8))+BigInt(r);return BigInt.asIntN(t.length*8,e)}Se.bytesToSignedBigInt=I1;function R1(t){fi(t);const e=Bf(t);return(0,Nt.assert)(e<=BigInt(Number.MAX_SAFE_INTEGER),"Number is not a safe integer. Use `bytesToBigInt` instead."),Number(e)}Se.bytesToNumber=R1;function A1(t){return fi(t),new TextDecoder().decode(t)}Se.bytesToString=A1;function io(t){var e;if(((e=t==null?void 0:t.toLowerCase)===null||e===void 0?void 0:e.call(t))==="0x")return new Uint8Array;(0,za.assertIsHexString)(t);const r=(0,za.remove0x)(t).toLowerCase(),n=r.length%2===0?r:`0${r}`,i=new Uint8Array(n.length/2);for(let s=0;s<i.length;s++){const o=n.charCodeAt(s*2),a=n.charCodeAt(s*2+1),c=o-(o<tl?el:rl),l=a-(a<tl?el:rl);i[s]=c*16+l}return i}Se.hexToBytes=io;function Pf(t){(0,Nt.assert)(typeof t=="bigint","Value must be a bigint."),(0,Nt.assert)(t>=BigInt(0),"Value must be a non-negative bigint.");const e=t.toString(16);return io(e)}Se.bigIntToBytes=Pf;function T1(t,e){(0,Nt.assert)(e>0);const r=t>>BigInt(31);return!((~t&r)+(t&~r)>>BigInt(e*8+-1))}function k1(t,e){(0,Nt.assert)(typeof t=="bigint","Value must be a bigint."),(0,Nt.assert)(typeof e=="number","Byte length must be a number."),(0,Nt.assert)(e>0,"Byte length must be greater than 0."),(0,Nt.assert)(T1(t,e),"Byte length is too small to represent the given value.");let r=t;const n=new Uint8Array(e);for(let i=0;i<n.length;i++)n[i]=Number(BigInt.asUintN(8,r)),r>>=BigInt(8);return n.reverse()}Se.signedBigIntToBytes=k1;function Df(t){(0,Nt.assert)(typeof t=="number","Value must be a number."),(0,Nt.assert)(t>=0,"Value must be a non-negative number."),(0,Nt.assert)(Number.isSafeInteger(t),"Value is not a safe integer. Use `bigIntToBytes` instead.");const e=t.toString(16);return io(e)}Se.numberToBytes=Df;function jf(t){return(0,Nt.assert)(typeof t=="string","Value must be a string."),new TextEncoder().encode(t)}Se.stringToBytes=jf;function $f(t){if(typeof t=="bigint")return Pf(t);if(typeof t=="number")return Df(t);if(typeof t=="string")return t.startsWith("0x")?io(t):jf(t);if(Cu(t))return t;throw new TypeError(`Unsupported value type: "${typeof t}".`)}Se.valueToBytes=$f;function N1(t){const e=new Array(t.length);let r=0;for(let i=0;i<t.length;i++){const s=$f(t[i]);e[i]=s,r+=s.length}const n=new Uint8Array(r);for(let i=0,s=0;i<e.length;i++)n.set(e[i],s),s+=e[i].length;return n}Se.concatBytes=N1;function O1(t){if(typeof ye<"u"&&t instanceof ye){const e=t.buffer.slice(t.byteOffset,t.byteOffset+t.byteLength);return new DataView(e)}return new DataView(t.buffer,t.byteOffset,t.byteLength)}Se.createDataView=O1;var so={};Object.defineProperty(so,"__esModule",{value:!0});so.ChecksumStruct=void 0;const nl=yn,L1=Zi;so.ChecksumStruct=(0,nl.size)((0,L1.base64)((0,nl.string)(),{paddingRequired:!0}),44,44);var lr={};Object.defineProperty(lr,"__esModule",{value:!0});lr.createHex=lr.createBytes=lr.createBigInt=lr.createNumber=void 0;const rt=yn,B1=_t,Ff=Se,oo=Qi,Uf=(0,rt.union)([(0,rt.number)(),(0,rt.bigint)(),(0,rt.string)(),oo.StrictHexStruct]),P1=(0,rt.coerce)((0,rt.number)(),Uf,Number),D1=(0,rt.coerce)((0,rt.bigint)(),Uf,BigInt);(0,rt.union)([oo.StrictHexStruct,(0,rt.instance)(Uint8Array)]);const j1=(0,rt.coerce)((0,rt.instance)(Uint8Array),(0,rt.union)([oo.StrictHexStruct]),Ff.hexToBytes),$1=(0,rt.coerce)(oo.StrictHexStruct,(0,rt.instance)(Uint8Array),Ff.bytesToHex);function F1(t){try{const e=(0,rt.create)(t,P1);return(0,B1.assert)(Number.isFinite(e),`Expected a number-like value, got "${t}".`),e}catch(e){throw e instanceof rt.StructError?new Error(`Expected a number-like value, got "${t}".`):e}}lr.createNumber=F1;function U1(t){try{return(0,rt.create)(t,D1)}catch(e){throw e instanceof rt.StructError?new Error(`Expected a number-like value, got "${String(e.value)}".`):e}}lr.createBigInt=U1;function H1(t){if(typeof t=="string"&&t.toLowerCase()==="0x")return new Uint8Array;try{return(0,rt.create)(t,j1)}catch(e){throw e instanceof rt.StructError?new Error(`Expected a bytes-like value, got "${String(e.value)}".`):e}}lr.createBytes=H1;function W1(t){if(t instanceof Uint8Array&&t.length===0||typeof t=="string"&&t.toLowerCase()==="0x")return"0x";try{return(0,rt.create)(t,$1)}catch(e){throw e instanceof rt.StructError?new Error(`Expected a bytes-like value, got "${String(e.value)}".`):e}}lr.createHex=W1;var Zn={},Hf=te&&te.__classPrivateFieldSet||function(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r},Mt=te&&te.__classPrivateFieldGet||function(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)},Gt,nr;Object.defineProperty(Zn,"__esModule",{value:!0});Zn.FrozenSet=Zn.FrozenMap=void 0;class Iu{constructor(e){Gt.set(this,void 0),Hf(this,Gt,new Map(e),"f"),Object.freeze(this)}get size(){return Mt(this,Gt,"f").size}[(Gt=new WeakMap,Symbol.iterator)](){return Mt(this,Gt,"f")[Symbol.iterator]()}entries(){return Mt(this,Gt,"f").entries()}forEach(e,r){return Mt(this,Gt,"f").forEach((n,i,s)=>e.call(r,n,i,this))}get(e){return Mt(this,Gt,"f").get(e)}has(e){return Mt(this,Gt,"f").has(e)}keys(){return Mt(this,Gt,"f").keys()}values(){return Mt(this,Gt,"f").values()}toString(){return`FrozenMap(${this.size}) {${this.size>0?` ${[...this.entries()].map(([e,r])=>`${String(e)} => ${String(r)}`).join(", ")} `:""}}`}}Zn.FrozenMap=Iu;class Ru{constructor(e){nr.set(this,void 0),Hf(this,nr,new Set(e),"f"),Object.freeze(this)}get size(){return Mt(this,nr,"f").size}[(nr=new WeakMap,Symbol.iterator)](){return Mt(this,nr,"f")[Symbol.iterator]()}entries(){return Mt(this,nr,"f").entries()}forEach(e,r){return Mt(this,nr,"f").forEach((n,i,s)=>e.call(r,n,i,this))}has(e){return Mt(this,nr,"f").has(e)}keys(){return Mt(this,nr,"f").keys()}values(){return Mt(this,nr,"f").values()}toString(){return`FrozenSet(${this.size}) {${this.size>0?` ${[...this.values()].map(e=>String(e)).join(", ")} `:""}}`}}Zn.FrozenSet=Ru;Object.freeze(Iu);Object.freeze(Iu.prototype);Object.freeze(Ru);Object.freeze(Ru.prototype);var Wf={},Au={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.calculateNumberSize=t.calculateStringSize=t.isASCII=t.isPlainObject=t.ESCAPE_CHARACTERS_REGEXP=t.JsonSize=t.hasProperty=t.isObject=t.isNullOrUndefined=t.isNonEmptyArray=void 0;function e(l){return Array.isArray(l)&&l.length>0}t.isNonEmptyArray=e;function r(l){return l==null}t.isNullOrUndefined=r;function n(l){return!!l&&typeof l=="object"&&!Array.isArray(l)}t.isObject=n;const i=(l,p)=>Object.hasOwnProperty.call(l,p);t.hasProperty=i,function(l){l[l.Null=4]="Null",l[l.Comma=1]="Comma",l[l.Wrapper=1]="Wrapper",l[l.True=4]="True",l[l.False=5]="False",l[l.Quote=1]="Quote",l[l.Colon=1]="Colon",l[l.Date=24]="Date"}(t.JsonSize||(t.JsonSize={})),t.ESCAPE_CHARACTERS_REGEXP=/"|\\|\n|\r|\t/gu;function s(l){if(typeof l!="object"||l===null)return!1;try{let p=l;for(;Object.getPrototypeOf(p)!==null;)p=Object.getPrototypeOf(p);return Object.getPrototypeOf(l)===p}catch{return!1}}t.isPlainObject=s;function o(l){return l.charCodeAt(0)<=127}t.isASCII=o;function a(l){var p;return l.split("").reduce((y,I)=>o(I)?y+1:y+2,0)+((p=l.match(t.ESCAPE_CHARACTERS_REGEXP))!==null&&p!==void 0?p:[]).length}t.calculateStringSize=a;function c(l){return l.toString().length}t.calculateNumberSize=c})(Au);(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.validateJsonAndGetSize=t.getJsonRpcIdValidator=t.assertIsJsonRpcError=t.isJsonRpcError=t.assertIsJsonRpcFailure=t.isJsonRpcFailure=t.assertIsJsonRpcSuccess=t.isJsonRpcSuccess=t.assertIsJsonRpcResponse=t.isJsonRpcResponse=t.assertIsPendingJsonRpcResponse=t.isPendingJsonRpcResponse=t.JsonRpcResponseStruct=t.JsonRpcFailureStruct=t.JsonRpcSuccessStruct=t.PendingJsonRpcResponseStruct=t.assertIsJsonRpcRequest=t.isJsonRpcRequest=t.assertIsJsonRpcNotification=t.isJsonRpcNotification=t.JsonRpcNotificationStruct=t.JsonRpcRequestStruct=t.JsonRpcParamsStruct=t.JsonRpcErrorStruct=t.JsonRpcIdStruct=t.JsonRpcVersionStruct=t.jsonrpc2=t.isValidJson=t.JsonStruct=void 0;const e=yn,r=_t,n=Au;t.JsonStruct=(0,e.define)("Json",F=>{const[z]=H(F,!0);return z?!0:"Expected a valid JSON-serializable value"});function i(F){return(0,e.is)(F,t.JsonStruct)}t.isValidJson=i,t.jsonrpc2="2.0",t.JsonRpcVersionStruct=(0,e.literal)(t.jsonrpc2),t.JsonRpcIdStruct=(0,e.nullable)((0,e.union)([(0,e.number)(),(0,e.string)()])),t.JsonRpcErrorStruct=(0,e.object)({code:(0,e.integer)(),message:(0,e.string)(),data:(0,e.optional)(t.JsonStruct),stack:(0,e.optional)((0,e.string)())}),t.JsonRpcParamsStruct=(0,e.optional)((0,e.union)([(0,e.record)((0,e.string)(),t.JsonStruct),(0,e.array)(t.JsonStruct)])),t.JsonRpcRequestStruct=(0,e.object)({id:t.JsonRpcIdStruct,jsonrpc:t.JsonRpcVersionStruct,method:(0,e.string)(),params:t.JsonRpcParamsStruct}),t.JsonRpcNotificationStruct=(0,e.omit)(t.JsonRpcRequestStruct,["id"]);function s(F){return(0,e.is)(F,t.JsonRpcNotificationStruct)}t.isJsonRpcNotification=s;function o(F,z){(0,r.assertStruct)(F,t.JsonRpcNotificationStruct,"Invalid JSON-RPC notification",z)}t.assertIsJsonRpcNotification=o;function a(F){return(0,e.is)(F,t.JsonRpcRequestStruct)}t.isJsonRpcRequest=a;function c(F,z){(0,r.assertStruct)(F,t.JsonRpcRequestStruct,"Invalid JSON-RPC request",z)}t.assertIsJsonRpcRequest=c,t.PendingJsonRpcResponseStruct=(0,e.object)({id:t.JsonRpcIdStruct,jsonrpc:t.JsonRpcVersionStruct,result:(0,e.optional)((0,e.unknown)()),error:(0,e.optional)(t.JsonRpcErrorStruct)}),t.JsonRpcSuccessStruct=(0,e.object)({id:t.JsonRpcIdStruct,jsonrpc:t.JsonRpcVersionStruct,result:t.JsonStruct}),t.JsonRpcFailureStruct=(0,e.object)({id:t.JsonRpcIdStruct,jsonrpc:t.JsonRpcVersionStruct,error:t.JsonRpcErrorStruct}),t.JsonRpcResponseStruct=(0,e.union)([t.JsonRpcSuccessStruct,t.JsonRpcFailureStruct]);function l(F){return(0,e.is)(F,t.PendingJsonRpcResponseStruct)}t.isPendingJsonRpcResponse=l;function p(F,z){(0,r.assertStruct)(F,t.PendingJsonRpcResponseStruct,"Invalid pending JSON-RPC response",z)}t.assertIsPendingJsonRpcResponse=p;function g(F){return(0,e.is)(F,t.JsonRpcResponseStruct)}t.isJsonRpcResponse=g;function y(F,z){(0,r.assertStruct)(F,t.JsonRpcResponseStruct,"Invalid JSON-RPC response",z)}t.assertIsJsonRpcResponse=y;function I(F){return(0,e.is)(F,t.JsonRpcSuccessStruct)}t.isJsonRpcSuccess=I;function T(F,z){(0,r.assertStruct)(F,t.JsonRpcSuccessStruct,"Invalid JSON-RPC success response",z)}t.assertIsJsonRpcSuccess=T;function D(F){return(0,e.is)(F,t.JsonRpcFailureStruct)}t.isJsonRpcFailure=D;function U(F,z){(0,r.assertStruct)(F,t.JsonRpcFailureStruct,"Invalid JSON-RPC failure response",z)}t.assertIsJsonRpcFailure=U;function M(F){return(0,e.is)(F,t.JsonRpcErrorStruct)}t.isJsonRpcError=M;function N(F,z){(0,r.assertStruct)(F,t.JsonRpcErrorStruct,"Invalid JSON-RPC error",z)}t.assertIsJsonRpcError=N;function j(F){const{permitEmptyString:z,permitFractions:X,permitNull:K}=Object.assign({permitEmptyString:!0,permitFractions:!1,permitNull:!0},F);return ne=>!!(typeof ne=="number"&&(X||Number.isInteger(ne))||typeof ne=="string"&&(z||ne.length>0)||K&&ne===null)}t.getJsonRpcIdValidator=j;function H(F,z=!1){const X=new Set;function K(J,ne){if(J===void 0)return[!1,0];if(J===null)return[!0,ne?0:n.JsonSize.Null];const oe=typeof J;try{if(oe==="function")return[!1,0];if(oe==="string"||J instanceof String)return[!0,ne?0:(0,n.calculateStringSize)(J)+n.JsonSize.Quote*2];if(oe==="boolean"||J instanceof Boolean)return ne?[!0,0]:[!0,J==!0?n.JsonSize.True:n.JsonSize.False];if(oe==="number"||J instanceof Number)return ne?[!0,0]:[!0,(0,n.calculateNumberSize)(J)];if(J instanceof Date)return ne?[!0,0]:[!0,isNaN(J.getDate())?n.JsonSize.Null:n.JsonSize.Date+n.JsonSize.Quote*2]}catch{return[!1,0]}if(!(0,n.isPlainObject)(J)&&!Array.isArray(J))return[!1,0];if(X.has(J))return[!1,0];X.add(J);try{return[!0,Object.entries(J).reduce((ue,[w,u],b,m)=>{let[E,S]=K(u,ne);if(!E)throw new Error("JSON validation did not pass. Validation process stopped.");if(X.delete(J),ne)return 0;const k=Array.isArray(J)?0:w.length+n.JsonSize.Comma+n.JsonSize.Colon*2,L=b<m.length-1?n.JsonSize.Comma:0;return ue+k+S+L},ne?0:n.JsonSize.Wrapper*2)]}catch{return[!1,0]}}return K(F,z)}t.validateJsonAndGetSize=H})(Wf);var Qn={},qa={exports:{}},da,il;function V1(){if(il)return da;il=1;var t=1e3,e=t*60,r=e*60,n=r*24,i=n*7,s=n*365.25;da=function(p,g){g=g||{};var y=typeof p;if(y==="string"&&p.length>0)return o(p);if(y==="number"&&isFinite(p))return g.long?c(p):a(p);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(p))};function o(p){if(p=String(p),!(p.length>100)){var g=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(p);if(g){var y=parseFloat(g[1]),I=(g[2]||"ms").toLowerCase();switch(I){case"years":case"year":case"yrs":case"yr":case"y":return y*s;case"weeks":case"week":case"w":return y*i;case"days":case"day":case"d":return y*n;case"hours":case"hour":case"hrs":case"hr":case"h":return y*r;case"minutes":case"minute":case"mins":case"min":case"m":return y*e;case"seconds":case"second":case"secs":case"sec":case"s":return y*t;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return y;default:return}}}}function a(p){var g=Math.abs(p);return g>=n?Math.round(p/n)+"d":g>=r?Math.round(p/r)+"h":g>=e?Math.round(p/e)+"m":g>=t?Math.round(p/t)+"s":p+"ms"}function c(p){var g=Math.abs(p);return g>=n?l(p,g,n,"day"):g>=r?l(p,g,r,"hour"):g>=e?l(p,g,e,"minute"):g>=t?l(p,g,t,"second"):p+" ms"}function l(p,g,y,I){var T=g>=y*1.5;return Math.round(p/y)+" "+I+(T?"s":"")}return da}function z1(t){r.debug=r,r.default=r,r.coerce=c,r.disable=s,r.enable=i,r.enabled=o,r.humanize=V1(),r.destroy=l,Object.keys(t).forEach(p=>{r[p]=t[p]}),r.names=[],r.skips=[],r.formatters={};function e(p){let g=0;for(let y=0;y<p.length;y++)g=(g<<5)-g+p.charCodeAt(y),g|=0;return r.colors[Math.abs(g)%r.colors.length]}r.selectColor=e;function r(p){let g,y=null,I,T;function D(...U){if(!D.enabled)return;const M=D,N=Number(new Date),j=N-(g||N);M.diff=j,M.prev=g,M.curr=N,g=N,U[0]=r.coerce(U[0]),typeof U[0]!="string"&&U.unshift("%O");let H=0;U[0]=U[0].replace(/%([a-zA-Z%])/g,(z,X)=>{if(z==="%%")return"%";H++;const K=r.formatters[X];if(typeof K=="function"){const J=U[H];z=K.call(M,J),U.splice(H,1),H--}return z}),r.formatArgs.call(M,U),(M.log||r.log).apply(M,U)}return D.namespace=p,D.useColors=r.useColors(),D.color=r.selectColor(p),D.extend=n,D.destroy=r.destroy,Object.defineProperty(D,"enabled",{enumerable:!0,configurable:!1,get:()=>y!==null?y:(I!==r.namespaces&&(I=r.namespaces,T=r.enabled(p)),T),set:U=>{y=U}}),typeof r.init=="function"&&r.init(D),D}function n(p,g){const y=r(this.namespace+(typeof g>"u"?":":g)+p);return y.log=this.log,y}function i(p){r.save(p),r.namespaces=p,r.names=[],r.skips=[];let g;const y=(typeof p=="string"?p:"").split(/[\s,]+/),I=y.length;for(g=0;g<I;g++)y[g]&&(p=y[g].replace(/\*/g,".*?"),p[0]==="-"?r.skips.push(new RegExp("^"+p.slice(1)+"$")):r.names.push(new RegExp("^"+p+"$")))}function s(){const p=[...r.names.map(a),...r.skips.map(a).map(g=>"-"+g)].join(",");return r.enable(""),p}function o(p){if(p[p.length-1]==="*")return!0;let g,y;for(g=0,y=r.skips.length;g<y;g++)if(r.skips[g].test(p))return!1;for(g=0,y=r.names.length;g<y;g++)if(r.names[g].test(p))return!0;return!1}function a(p){return p.toString().substring(2,p.toString().length-2).replace(/\.\*\?$/,"*")}function c(p){return p instanceof Error?p.stack||p.message:p}function l(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")}return r.enable(r.load()),r}var q1=z1;(function(t,e){e.formatArgs=n,e.save=i,e.load=s,e.useColors=r,e.storage=o(),e.destroy=(()=>{let c=!1;return()=>{c||(c=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})(),e.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"];function r(){return typeof window<"u"&&window.process&&(window.process.type==="renderer"||window.process.__nwjs)?!0:typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)?!1:typeof document<"u"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window<"u"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}function n(c){if(c[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+c[0]+(this.useColors?"%c ":" ")+"+"+t.exports.humanize(this.diff),!this.useColors)return;const l="color: "+this.color;c.splice(1,0,l,"color: inherit");let p=0,g=0;c[0].replace(/%[a-zA-Z%]/g,y=>{y!=="%%"&&(p++,y==="%c"&&(g=p))}),c.splice(g,0,l)}e.log=console.debug||console.log||(()=>{});function i(c){try{c?e.storage.setItem("debug",c):e.storage.removeItem("debug")}catch{}}function s(){let c;try{c=e.storage.getItem("debug")}catch{}return!c&&typeof Te<"u"&&"env"in Te&&(c={}.DEBUG),c}function o(){try{return localStorage}catch{}}t.exports=q1(e);const{formatters:a}=t.exports;a.j=function(c){try{return JSON.stringify(c)}catch(l){return"[UnexpectedJSONParseError]: "+l.message}}})(qa,qa.exports);var G1=qa.exports,J1=te&&te.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Qn,"__esModule",{value:!0});Qn.createModuleLogger=Qn.createProjectLogger=void 0;const Z1=J1(G1),Q1=(0,Z1.default)("metamask");function Y1(t){return Q1.extend(t)}Qn.createProjectLogger=Y1;function K1(t,e){return t.extend(e)}Qn.createModuleLogger=K1;var hr={};Object.defineProperty(hr,"__esModule",{value:!0});hr.hexToBigInt=hr.hexToNumber=hr.bigIntToHex=hr.numberToHex=void 0;const Un=_t,Oi=Qi,X1=t=>((0,Un.assert)(typeof t=="number","Value must be a number."),(0,Un.assert)(t>=0,"Value must be a non-negative number."),(0,Un.assert)(Number.isSafeInteger(t),"Value is not a safe integer. Use `bigIntToHex` instead."),(0,Oi.add0x)(t.toString(16)));hr.numberToHex=X1;const em=t=>((0,Un.assert)(typeof t=="bigint","Value must be a bigint."),(0,Un.assert)(t>=0,"Value must be a non-negative bigint."),(0,Oi.add0x)(t.toString(16)));hr.bigIntToHex=em;const tm=t=>{(0,Oi.assertIsHexString)(t);const e=parseInt(t,16);return(0,Un.assert)(Number.isSafeInteger(e),"Value is not a safe integer. Use `hexToBigInt` instead."),e};hr.hexToNumber=tm;const rm=t=>((0,Oi.assertIsHexString)(t),BigInt((0,Oi.add0x)(t)));hr.hexToBigInt=rm;var Vf={};Object.defineProperty(Vf,"__esModule",{value:!0});var zf={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.timeSince=t.inMilliseconds=t.Duration=void 0,function(s){s[s.Millisecond=1]="Millisecond",s[s.Second=1e3]="Second",s[s.Minute=6e4]="Minute",s[s.Hour=36e5]="Hour",s[s.Day=864e5]="Day",s[s.Week=6048e5]="Week",s[s.Year=31536e6]="Year"}(t.Duration||(t.Duration={}));const e=s=>Number.isInteger(s)&&s>=0,r=(s,o)=>{if(!e(s))throw new Error(`"${o}" must be a non-negative integer. Received: "${s}".`)};function n(s,o){return r(s,"count"),s*o}t.inMilliseconds=n;function i(s){return r(s,"timestamp"),Date.now()-s}t.timeSince=i})(zf);var qf={},Ga={exports:{}};const nm="2.0.0",Gf=256,im=Number.MAX_SAFE_INTEGER||9007199254740991,sm=16,om=Gf-6,am=["major","premajor","minor","preminor","patch","prepatch","prerelease"];var ao={MAX_LENGTH:Gf,MAX_SAFE_COMPONENT_LENGTH:sm,MAX_SAFE_BUILD_LENGTH:om,MAX_SAFE_INTEGER:im,RELEASE_TYPES:am,SEMVER_SPEC_VERSION:nm,FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2};const um=typeof Te=="object"&&{}&&{}.NODE_DEBUG&&/\bsemver\b/i.test({}.NODE_DEBUG)?(...t)=>console.error("SEMVER",...t):()=>{};var uo=um;(function(t,e){const{MAX_SAFE_COMPONENT_LENGTH:r,MAX_SAFE_BUILD_LENGTH:n,MAX_LENGTH:i}=ao,s=uo;e=t.exports={};const o=e.re=[],a=e.safeRe=[],c=e.src=[],l=e.t={};let p=0;const g="[a-zA-Z0-9-]",y=[["\\s",1],["\\d",i],[g,n]],I=D=>{for(const[U,M]of y)D=D.split(`${U}*`).join(`${U}{0,${M}}`).split(`${U}+`).join(`${U}{1,${M}}`);return D},T=(D,U,M)=>{const N=I(U),j=p++;s(D,j,U),l[D]=j,c[j]=U,o[j]=new RegExp(U,M?"g":void 0),a[j]=new RegExp(N,M?"g":void 0)};T("NUMERICIDENTIFIER","0|[1-9]\\d*"),T("NUMERICIDENTIFIERLOOSE","\\d+"),T("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${g}*`),T("MAINVERSION",`(${c[l.NUMERICIDENTIFIER]})\\.(${c[l.NUMERICIDENTIFIER]})\\.(${c[l.NUMERICIDENTIFIER]})`),T("MAINVERSIONLOOSE",`(${c[l.NUMERICIDENTIFIERLOOSE]})\\.(${c[l.NUMERICIDENTIFIERLOOSE]})\\.(${c[l.NUMERICIDENTIFIERLOOSE]})`),T("PRERELEASEIDENTIFIER",`(?:${c[l.NUMERICIDENTIFIER]}|${c[l.NONNUMERICIDENTIFIER]})`),T("PRERELEASEIDENTIFIERLOOSE",`(?:${c[l.NUMERICIDENTIFIERLOOSE]}|${c[l.NONNUMERICIDENTIFIER]})`),T("PRERELEASE",`(?:-(${c[l.PRERELEASEIDENTIFIER]}(?:\\.${c[l.PRERELEASEIDENTIFIER]})*))`),T("PRERELEASELOOSE",`(?:-?(${c[l.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${c[l.PRERELEASEIDENTIFIERLOOSE]})*))`),T("BUILDIDENTIFIER",`${g}+`),T("BUILD",`(?:\\+(${c[l.BUILDIDENTIFIER]}(?:\\.${c[l.BUILDIDENTIFIER]})*))`),T("FULLPLAIN",`v?${c[l.MAINVERSION]}${c[l.PRERELEASE]}?${c[l.BUILD]}?`),T("FULL",`^${c[l.FULLPLAIN]}$`),T("LOOSEPLAIN",`[v=\\s]*${c[l.MAINVERSIONLOOSE]}${c[l.PRERELEASELOOSE]}?${c[l.BUILD]}?`),T("LOOSE",`^${c[l.LOOSEPLAIN]}$`),T("GTLT","((?:<|>)?=?)"),T("XRANGEIDENTIFIERLOOSE",`${c[l.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`),T("XRANGEIDENTIFIER",`${c[l.NUMERICIDENTIFIER]}|x|X|\\*`),T("XRANGEPLAIN",`[v=\\s]*(${c[l.XRANGEIDENTIFIER]})(?:\\.(${c[l.XRANGEIDENTIFIER]})(?:\\.(${c[l.XRANGEIDENTIFIER]})(?:${c[l.PRERELEASE]})?${c[l.BUILD]}?)?)?`),T("XRANGEPLAINLOOSE",`[v=\\s]*(${c[l.XRANGEIDENTIFIERLOOSE]})(?:\\.(${c[l.XRANGEIDENTIFIERLOOSE]})(?:\\.(${c[l.XRANGEIDENTIFIERLOOSE]})(?:${c[l.PRERELEASELOOSE]})?${c[l.BUILD]}?)?)?`),T("XRANGE",`^${c[l.GTLT]}\\s*${c[l.XRANGEPLAIN]}$`),T("XRANGELOOSE",`^${c[l.GTLT]}\\s*${c[l.XRANGEPLAINLOOSE]}$`),T("COERCE",`(^|[^\\d])(\\d{1,${r}})(?:\\.(\\d{1,${r}}))?(?:\\.(\\d{1,${r}}))?(?:$|[^\\d])`),T("COERCERTL",c[l.COERCE],!0),T("LONETILDE","(?:~>?)"),T("TILDETRIM",`(\\s*)${c[l.LONETILDE]}\\s+`,!0),e.tildeTrimReplace="$1~",T("TILDE",`^${c[l.LONETILDE]}${c[l.XRANGEPLAIN]}$`),T("TILDELOOSE",`^${c[l.LONETILDE]}${c[l.XRANGEPLAINLOOSE]}$`),T("LONECARET","(?:\\^)"),T("CARETTRIM",`(\\s*)${c[l.LONECARET]}\\s+`,!0),e.caretTrimReplace="$1^",T("CARET",`^${c[l.LONECARET]}${c[l.XRANGEPLAIN]}$`),T("CARETLOOSE",`^${c[l.LONECARET]}${c[l.XRANGEPLAINLOOSE]}$`),T("COMPARATORLOOSE",`^${c[l.GTLT]}\\s*(${c[l.LOOSEPLAIN]})$|^$`),T("COMPARATOR",`^${c[l.GTLT]}\\s*(${c[l.FULLPLAIN]})$|^$`),T("COMPARATORTRIM",`(\\s*)${c[l.GTLT]}\\s*(${c[l.LOOSEPLAIN]}|${c[l.XRANGEPLAIN]})`,!0),e.comparatorTrimReplace="$1$2$3",T("HYPHENRANGE",`^\\s*(${c[l.XRANGEPLAIN]})\\s+-\\s+(${c[l.XRANGEPLAIN]})\\s*$`),T("HYPHENRANGELOOSE",`^\\s*(${c[l.XRANGEPLAINLOOSE]})\\s+-\\s+(${c[l.XRANGEPLAINLOOSE]})\\s*$`),T("STAR","(<|>)?=?\\s*\\*"),T("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$"),T("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")})(Ga,Ga.exports);var Yi=Ga.exports;const cm=Object.freeze({loose:!0}),lm=Object.freeze({}),hm=t=>t?typeof t!="object"?cm:t:lm;var Tu=hm;const sl=/^[0-9]+$/,Jf=(t,e)=>{const r=sl.test(t),n=sl.test(e);return r&&n&&(t=+t,e=+e),t===e?0:r&&!n?-1:n&&!r?1:t<e?-1:1},fm=(t,e)=>Jf(e,t);var Zf={compareIdentifiers:Jf,rcompareIdentifiers:fm};const fs=uo,{MAX_LENGTH:ol,MAX_SAFE_INTEGER:ds}=ao,{safeRe:al,t:ul}=Yi,dm=Tu,{compareIdentifiers:kn}=Zf;let pm=class sr{constructor(e,r){if(r=dm(r),e instanceof sr){if(e.loose===!!r.loose&&e.includePrerelease===!!r.includePrerelease)return e;e=e.version}else if(typeof e!="string")throw new TypeError(`Invalid version. Must be a string. Got type "${typeof e}".`);if(e.length>ol)throw new TypeError(`version is longer than ${ol} characters`);fs("SemVer",e,r),this.options=r,this.loose=!!r.loose,this.includePrerelease=!!r.includePrerelease;const n=e.trim().match(r.loose?al[ul.LOOSE]:al[ul.FULL]);if(!n)throw new TypeError(`Invalid Version: ${e}`);if(this.raw=e,this.major=+n[1],this.minor=+n[2],this.patch=+n[3],this.major>ds||this.major<0)throw new TypeError("Invalid major version");if(this.minor>ds||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>ds||this.patch<0)throw new TypeError("Invalid patch version");n[4]?this.prerelease=n[4].split(".").map(i=>{if(/^[0-9]+$/.test(i)){const s=+i;if(s>=0&&s<ds)return s}return i}):this.prerelease=[],this.build=n[5]?n[5].split("."):[],this.format()}format(){return this.version=`${this.major}.${this.minor}.${this.patch}`,this.prerelease.length&&(this.version+=`-${this.prerelease.join(".")}`),this.version}toString(){return this.version}compare(e){if(fs("SemVer.compare",this.version,this.options,e),!(e instanceof sr)){if(typeof e=="string"&&e===this.version)return 0;e=new sr(e,this.options)}return e.version===this.version?0:this.compareMain(e)||this.comparePre(e)}compareMain(e){return e instanceof sr||(e=new sr(e,this.options)),kn(this.major,e.major)||kn(this.minor,e.minor)||kn(this.patch,e.patch)}comparePre(e){if(e instanceof sr||(e=new sr(e,this.options)),this.prerelease.length&&!e.prerelease.length)return-1;if(!this.prerelease.length&&e.prerelease.length)return 1;if(!this.prerelease.length&&!e.prerelease.length)return 0;let r=0;do{const n=this.prerelease[r],i=e.prerelease[r];if(fs("prerelease compare",r,n,i),n===void 0&&i===void 0)return 0;if(i===void 0)return 1;if(n===void 0)return-1;if(n===i)continue;return kn(n,i)}while(++r)}compareBuild(e){e instanceof sr||(e=new sr(e,this.options));let r=0;do{const n=this.build[r],i=e.build[r];if(fs("prerelease compare",r,n,i),n===void 0&&i===void 0)return 0;if(i===void 0)return 1;if(n===void 0)return-1;if(n===i)continue;return kn(n,i)}while(++r)}inc(e,r,n){switch(e){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",r,n);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",r,n);break;case"prepatch":this.prerelease.length=0,this.inc("patch",r,n),this.inc("pre",r,n);break;case"prerelease":this.prerelease.length===0&&this.inc("patch",r,n),this.inc("pre",r,n);break;case"major":(this.minor!==0||this.patch!==0||this.prerelease.length===0)&&this.major++,this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":(this.patch!==0||this.prerelease.length===0)&&this.minor++,this.patch=0,this.prerelease=[];break;case"patch":this.prerelease.length===0&&this.patch++,this.prerelease=[];break;case"pre":{const i=Number(n)?1:0;if(!r&&n===!1)throw new Error("invalid increment argument: identifier is empty");if(this.prerelease.length===0)this.prerelease=[i];else{let s=this.prerelease.length;for(;--s>=0;)typeof this.prerelease[s]=="number"&&(this.prerelease[s]++,s=-2);if(s===-1){if(r===this.prerelease.join(".")&&n===!1)throw new Error("invalid increment argument: identifier already exists");this.prerelease.push(i)}}if(r){let s=[r,i];n===!1&&(s=[r]),kn(this.prerelease[0],r)===0?isNaN(this.prerelease[1])&&(this.prerelease=s):this.prerelease=s}break}default:throw new Error(`invalid increment argument: ${e}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(".")}`),this}};var Rt=pm;const cl=Rt,gm=(t,e,r=!1)=>{if(t instanceof cl)return t;try{return new cl(t,e)}catch(n){if(!r)return null;throw n}};var di=gm;const bm=di,vm=(t,e)=>{const r=bm(t,e);return r?r.version:null};var mm=vm;const ym=di,_m=(t,e)=>{const r=ym(t.trim().replace(/^[=v]+/,""),e);return r?r.version:null};var wm=_m;const ll=Rt,Em=(t,e,r,n,i)=>{typeof r=="string"&&(i=n,n=r,r=void 0);try{return new ll(t instanceof ll?t.version:t,r).inc(e,n,i).version}catch{return null}};var Sm=Em;const hl=di,xm=(t,e)=>{const r=hl(t,null,!0),n=hl(e,null,!0),i=r.compare(n);if(i===0)return null;const s=i>0,o=s?r:n,a=s?n:r,c=!!o.prerelease.length;if(!!a.prerelease.length&&!c)return!a.patch&&!a.minor?"major":o.patch?"patch":o.minor?"minor":"major";const p=c?"pre":"";return r.major!==n.major?p+"major":r.minor!==n.minor?p+"minor":r.patch!==n.patch?p+"patch":"prerelease"};var Mm=xm;const Cm=Rt,Im=(t,e)=>new Cm(t,e).major;var Rm=Im;const Am=Rt,Tm=(t,e)=>new Am(t,e).minor;var km=Tm;const Nm=Rt,Om=(t,e)=>new Nm(t,e).patch;var Lm=Om;const Bm=di,Pm=(t,e)=>{const r=Bm(t,e);return r&&r.prerelease.length?r.prerelease:null};var Dm=Pm;const fl=Rt,jm=(t,e,r)=>new fl(t,r).compare(new fl(e,r));var er=jm;const $m=er,Fm=(t,e,r)=>$m(e,t,r);var Um=Fm;const Hm=er,Wm=(t,e)=>Hm(t,e,!0);var Vm=Wm;const dl=Rt,zm=(t,e,r)=>{const n=new dl(t,r),i=new dl(e,r);return n.compare(i)||n.compareBuild(i)};var ku=zm;const qm=ku,Gm=(t,e)=>t.sort((r,n)=>qm(r,n,e));var Jm=Gm;const Zm=ku,Qm=(t,e)=>t.sort((r,n)=>Zm(n,r,e));var Ym=Qm;const Km=er,Xm=(t,e,r)=>Km(t,e,r)>0;var co=Xm;const ey=er,ty=(t,e,r)=>ey(t,e,r)<0;var Nu=ty;const ry=er,ny=(t,e,r)=>ry(t,e,r)===0;var Qf=ny;const iy=er,sy=(t,e,r)=>iy(t,e,r)!==0;var Yf=sy;const oy=er,ay=(t,e,r)=>oy(t,e,r)>=0;var Ou=ay;const uy=er,cy=(t,e,r)=>uy(t,e,r)<=0;var Lu=cy;const ly=Qf,hy=Yf,fy=co,dy=Ou,py=Nu,gy=Lu,by=(t,e,r,n)=>{switch(e){case"===":return typeof t=="object"&&(t=t.version),typeof r=="object"&&(r=r.version),t===r;case"!==":return typeof t=="object"&&(t=t.version),typeof r=="object"&&(r=r.version),t!==r;case"":case"=":case"==":return ly(t,r,n);case"!=":return hy(t,r,n);case">":return fy(t,r,n);case">=":return dy(t,r,n);case"<":return py(t,r,n);case"<=":return gy(t,r,n);default:throw new TypeError(`Invalid operator: ${e}`)}};var Kf=by;const vy=Rt,my=di,{safeRe:ps,t:gs}=Yi,yy=(t,e)=>{if(t instanceof vy)return t;if(typeof t=="number"&&(t=String(t)),typeof t!="string")return null;e=e||{};let r=null;if(!e.rtl)r=t.match(ps[gs.COERCE]);else{let n;for(;(n=ps[gs.COERCERTL].exec(t))&&(!r||r.index+r[0].length!==t.length);)(!r||n.index+n[0].length!==r.index+r[0].length)&&(r=n),ps[gs.COERCERTL].lastIndex=n.index+n[1].length+n[2].length;ps[gs.COERCERTL].lastIndex=-1}return r===null?null:my(`${r[2]}.${r[3]||"0"}.${r[4]||"0"}`,e)};var _y=yy,pa,pl;function wy(){return pl||(pl=1,pa=function(t){t.prototype[Symbol.iterator]=function*(){for(let e=this.head;e;e=e.next)yield e.value}}),pa}var Ey=Me;Me.Node=hn;Me.create=Me;function Me(t){var e=this;if(e instanceof Me||(e=new Me),e.tail=null,e.head=null,e.length=0,t&&typeof t.forEach=="function")t.forEach(function(i){e.push(i)});else if(arguments.length>0)for(var r=0,n=arguments.length;r<n;r++)e.push(arguments[r]);return e}Me.prototype.removeNode=function(t){if(t.list!==this)throw new Error("removing node which does not belong to this list");var e=t.next,r=t.prev;return e&&(e.prev=r),r&&(r.next=e),t===this.head&&(this.head=e),t===this.tail&&(this.tail=r),t.list.length--,t.next=null,t.prev=null,t.list=null,e};Me.prototype.unshiftNode=function(t){if(t!==this.head){t.list&&t.list.removeNode(t);var e=this.head;t.list=this,t.next=e,e&&(e.prev=t),this.head=t,this.tail||(this.tail=t),this.length++}};Me.prototype.pushNode=function(t){if(t!==this.tail){t.list&&t.list.removeNode(t);var e=this.tail;t.list=this,t.prev=e,e&&(e.next=t),this.tail=t,this.head||(this.head=t),this.length++}};Me.prototype.push=function(){for(var t=0,e=arguments.length;t<e;t++)xy(this,arguments[t]);return this.length};Me.prototype.unshift=function(){for(var t=0,e=arguments.length;t<e;t++)My(this,arguments[t]);return this.length};Me.prototype.pop=function(){if(this.tail){var t=this.tail.value;return this.tail=this.tail.prev,this.tail?this.tail.next=null:this.head=null,this.length--,t}};Me.prototype.shift=function(){if(this.head){var t=this.head.value;return this.head=this.head.next,this.head?this.head.prev=null:this.tail=null,this.length--,t}};Me.prototype.forEach=function(t,e){e=e||this;for(var r=this.head,n=0;r!==null;n++)t.call(e,r.value,n,this),r=r.next};Me.prototype.forEachReverse=function(t,e){e=e||this;for(var r=this.tail,n=this.length-1;r!==null;n--)t.call(e,r.value,n,this),r=r.prev};Me.prototype.get=function(t){for(var e=0,r=this.head;r!==null&&e<t;e++)r=r.next;if(e===t&&r!==null)return r.value};Me.prototype.getReverse=function(t){for(var e=0,r=this.tail;r!==null&&e<t;e++)r=r.prev;if(e===t&&r!==null)return r.value};Me.prototype.map=function(t,e){e=e||this;for(var r=new Me,n=this.head;n!==null;)r.push(t.call(e,n.value,this)),n=n.next;return r};Me.prototype.mapReverse=function(t,e){e=e||this;for(var r=new Me,n=this.tail;n!==null;)r.push(t.call(e,n.value,this)),n=n.prev;return r};Me.prototype.reduce=function(t,e){var r,n=this.head;if(arguments.length>1)r=e;else if(this.head)n=this.head.next,r=this.head.value;else throw new TypeError("Reduce of empty list with no initial value");for(var i=0;n!==null;i++)r=t(r,n.value,i),n=n.next;return r};Me.prototype.reduceReverse=function(t,e){var r,n=this.tail;if(arguments.length>1)r=e;else if(this.tail)n=this.tail.prev,r=this.tail.value;else throw new TypeError("Reduce of empty list with no initial value");for(var i=this.length-1;n!==null;i--)r=t(r,n.value,i),n=n.prev;return r};Me.prototype.toArray=function(){for(var t=new Array(this.length),e=0,r=this.head;r!==null;e++)t[e]=r.value,r=r.next;return t};Me.prototype.toArrayReverse=function(){for(var t=new Array(this.length),e=0,r=this.tail;r!==null;e++)t[e]=r.value,r=r.prev;return t};Me.prototype.slice=function(t,e){e=e||this.length,e<0&&(e+=this.length),t=t||0,t<0&&(t+=this.length);var r=new Me;if(e<t||e<0)return r;t<0&&(t=0),e>this.length&&(e=this.length);for(var n=0,i=this.head;i!==null&&n<t;n++)i=i.next;for(;i!==null&&n<e;n++,i=i.next)r.push(i.value);return r};Me.prototype.sliceReverse=function(t,e){e=e||this.length,e<0&&(e+=this.length),t=t||0,t<0&&(t+=this.length);var r=new Me;if(e<t||e<0)return r;t<0&&(t=0),e>this.length&&(e=this.length);for(var n=this.length,i=this.tail;i!==null&&n>e;n--)i=i.prev;for(;i!==null&&n>t;n--,i=i.prev)r.push(i.value);return r};Me.prototype.splice=function(t,e,...r){t>this.length&&(t=this.length-1),t<0&&(t=this.length+t);for(var n=0,i=this.head;i!==null&&n<t;n++)i=i.next;for(var s=[],n=0;i&&n<e;n++)s.push(i.value),i=this.removeNode(i);i===null&&(i=this.tail),i!==this.head&&i!==this.tail&&(i=i.prev);for(var n=0;n<r.length;n++)i=Sy(this,i,r[n]);return s};Me.prototype.reverse=function(){for(var t=this.head,e=this.tail,r=t;r!==null;r=r.prev){var n=r.prev;r.prev=r.next,r.next=n}return this.head=e,this.tail=t,this};function Sy(t,e,r){var n=e===t.head?new hn(r,null,e,t):new hn(r,e,e.next,t);return n.next===null&&(t.tail=n),n.prev===null&&(t.head=n),t.length++,n}function xy(t,e){t.tail=new hn(e,t.tail,null,t),t.head||(t.head=t.tail),t.length++}function My(t,e){t.head=new hn(e,null,t.head,t),t.tail||(t.tail=t.head),t.length++}function hn(t,e,r,n){if(!(this instanceof hn))return new hn(t,e,r,n);this.list=n,this.value=t,e?(e.next=this,this.prev=e):this.prev=null,r?(r.prev=this,this.next=r):this.next=null}try{wy()(Me)}catch{}const Cy=Ey,nn=Symbol("max"),mr=Symbol("length"),Nn=Symbol("lengthCalculator"),Ci=Symbol("allowStale"),un=Symbol("maxAge"),gr=Symbol("dispose"),gl=Symbol("noDisposeOnSet"),gt=Symbol("lruList"),Qt=Symbol("cache"),Xf=Symbol("updateAgeOnGet"),ga=()=>1;class Iy{constructor(e){if(typeof e=="number"&&(e={max:e}),e||(e={}),e.max&&(typeof e.max!="number"||e.max<0))throw new TypeError("max must be a non-negative number");this[nn]=e.max||1/0;const r=e.length||ga;if(this[Nn]=typeof r!="function"?ga:r,this[Ci]=e.stale||!1,e.maxAge&&typeof e.maxAge!="number")throw new TypeError("maxAge must be a number");this[un]=e.maxAge||0,this[gr]=e.dispose,this[gl]=e.noDisposeOnSet||!1,this[Xf]=e.updateAgeOnGet||!1,this.reset()}set max(e){if(typeof e!="number"||e<0)throw new TypeError("max must be a non-negative number");this[nn]=e||1/0,yi(this)}get max(){return this[nn]}set allowStale(e){this[Ci]=!!e}get allowStale(){return this[Ci]}set maxAge(e){if(typeof e!="number")throw new TypeError("maxAge must be a non-negative number");this[un]=e,yi(this)}get maxAge(){return this[un]}set lengthCalculator(e){typeof e!="function"&&(e=ga),e!==this[Nn]&&(this[Nn]=e,this[mr]=0,this[gt].forEach(r=>{r.length=this[Nn](r.value,r.key),this[mr]+=r.length})),yi(this)}get lengthCalculator(){return this[Nn]}get length(){return this[mr]}get itemCount(){return this[gt].length}rforEach(e,r){r=r||this;for(let n=this[gt].tail;n!==null;){const i=n.prev;bl(this,e,n,r),n=i}}forEach(e,r){r=r||this;for(let n=this[gt].head;n!==null;){const i=n.next;bl(this,e,n,r),n=i}}keys(){return this[gt].toArray().map(e=>e.key)}values(){return this[gt].toArray().map(e=>e.value)}reset(){this[gr]&&this[gt]&&this[gt].length&&this[gt].forEach(e=>this[gr](e.key,e.value)),this[Qt]=new Map,this[gt]=new Cy,this[mr]=0}dump(){return this[gt].map(e=>Ts(this,e)?!1:{k:e.key,v:e.value,e:e.now+(e.maxAge||0)}).toArray().filter(e=>e)}dumpLru(){return this[gt]}set(e,r,n){if(n=n||this[un],n&&typeof n!="number")throw new TypeError("maxAge must be a number");const i=n?Date.now():0,s=this[Nn](r,e);if(this[Qt].has(e)){if(s>this[nn])return Hn(this,this[Qt].get(e)),!1;const c=this[Qt].get(e).value;return this[gr]&&(this[gl]||this[gr](e,c.value)),c.now=i,c.maxAge=n,c.value=r,this[mr]+=s-c.length,c.length=s,this.get(e),yi(this),!0}const o=new Ry(e,r,s,i,n);return o.length>this[nn]?(this[gr]&&this[gr](e,r),!1):(this[mr]+=o.length,this[gt].unshift(o),this[Qt].set(e,this[gt].head),yi(this),!0)}has(e){if(!this[Qt].has(e))return!1;const r=this[Qt].get(e).value;return!Ts(this,r)}get(e){return ba(this,e,!0)}peek(e){return ba(this,e,!1)}pop(){const e=this[gt].tail;return e?(Hn(this,e),e.value):null}del(e){Hn(this,this[Qt].get(e))}load(e){this.reset();const r=Date.now();for(let n=e.length-1;n>=0;n--){const i=e[n],s=i.e||0;if(s===0)this.set(i.k,i.v);else{const o=s-r;o>0&&this.set(i.k,i.v,o)}}}prune(){this[Qt].forEach((e,r)=>ba(this,r,!1))}}const ba=(t,e,r)=>{const n=t[Qt].get(e);if(n){const i=n.value;if(Ts(t,i)){if(Hn(t,n),!t[Ci])return}else r&&(t[Xf]&&(n.value.now=Date.now()),t[gt].unshiftNode(n));return i.value}},Ts=(t,e)=>{if(!e||!e.maxAge&&!t[un])return!1;const r=Date.now()-e.now;return e.maxAge?r>e.maxAge:t[un]&&r>t[un]},yi=t=>{if(t[mr]>t[nn])for(let e=t[gt].tail;t[mr]>t[nn]&&e!==null;){const r=e.prev;Hn(t,e),e=r}},Hn=(t,e)=>{if(e){const r=e.value;t[gr]&&t[gr](r.key,r.value),t[mr]-=r.length,t[Qt].delete(r.key),t[gt].removeNode(e)}};class Ry{constructor(e,r,n,i,s){this.key=e,this.value=r,this.length=n,this.now=i,this.maxAge=s||0}}const bl=(t,e,r,n)=>{let i=r.value;Ts(t,i)&&(Hn(t,r),t[Ci]||(i=void 0)),i&&e.call(n,i.value,i.key,t)};var Ay=Iy,va,vl;function tr(){if(vl)return va;vl=1;class t{constructor(u,b){if(b=n(b),u instanceof t)return u.loose===!!b.loose&&u.includePrerelease===!!b.includePrerelease?u:new t(u.raw,b);if(u instanceof i)return this.raw=u.value,this.set=[[u]],this.format(),this;if(this.options=b,this.loose=!!b.loose,this.includePrerelease=!!b.includePrerelease,this.raw=u.trim().split(/\s+/).join(" "),this.set=this.raw.split("||").map(m=>this.parseRange(m.trim())).filter(m=>m.length),!this.set.length)throw new TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){const m=this.set[0];if(this.set=this.set.filter(E=>!T(E[0])),this.set.length===0)this.set=[m];else if(this.set.length>1){for(const E of this.set)if(E.length===1&&D(E[0])){this.set=[E];break}}}this.format()}format(){return this.range=this.set.map(u=>u.join(" ").trim()).join("||").trim(),this.range}toString(){return this.range}parseRange(u){const m=((this.options.includePrerelease&&y)|(this.options.loose&&I))+":"+u,E=r.get(m);if(E)return E;const S=this.options.loose,k=S?a[c.HYPHENRANGELOOSE]:a[c.HYPHENRANGE];u=u.replace(k,oe(this.options.includePrerelease)),s("hyphen replace",u),u=u.replace(a[c.COMPARATORTRIM],l),s("comparator trim",u),u=u.replace(a[c.TILDETRIM],p),s("tilde trim",u),u=u.replace(a[c.CARETTRIM],g),s("caret trim",u);let L=u.split(" ").map(Y=>M(Y,this.options)).join(" ").split(/\s+/).map(Y=>ne(Y,this.options));S&&(L=L.filter(Y=>(s("loose invalid filter",Y,this.options),!!Y.match(a[c.COMPARATORLOOSE])))),s("range list",L);const _=new Map,d=L.map(Y=>new i(Y,this.options));for(const Y of d){if(T(Y))return[Y];_.set(Y.value,Y)}_.size>1&&_.has("")&&_.delete("");const A=[..._.values()];return r.set(m,A),A}intersects(u,b){if(!(u instanceof t))throw new TypeError("a Range is required");return this.set.some(m=>U(m,b)&&u.set.some(E=>U(E,b)&&m.every(S=>E.every(k=>S.intersects(k,b)))))}test(u){if(!u)return!1;if(typeof u=="string")try{u=new o(u,this.options)}catch{return!1}for(let b=0;b<this.set.length;b++)if(ue(this.set[b],u,this.options))return!0;return!1}}va=t;const e=Ay,r=new e({max:1e3}),n=Tu,i=lo(),s=uo,o=Rt,{safeRe:a,t:c,comparatorTrimReplace:l,tildeTrimReplace:p,caretTrimReplace:g}=Yi,{FLAG_INCLUDE_PRERELEASE:y,FLAG_LOOSE:I}=ao,T=w=>w.value==="<0.0.0-0",D=w=>w.value==="",U=(w,u)=>{let b=!0;const m=w.slice();let E=m.pop();for(;b&&m.length;)b=m.every(S=>E.intersects(S,u)),E=m.pop();return b},M=(w,u)=>(s("comp",w,u),w=F(w,u),s("caret",w),w=j(w,u),s("tildes",w),w=X(w,u),s("xrange",w),w=J(w,u),s("stars",w),w),N=w=>!w||w.toLowerCase()==="x"||w==="*",j=(w,u)=>w.trim().split(/\s+/).map(b=>H(b,u)).join(" "),H=(w,u)=>{const b=u.loose?a[c.TILDELOOSE]:a[c.TILDE];return w.replace(b,(m,E,S,k,L)=>{s("tilde",w,m,E,S,k,L);let _;return N(E)?_="":N(S)?_=`>=${E}.0.0 <${+E+1}.0.0-0`:N(k)?_=`>=${E}.${S}.0 <${E}.${+S+1}.0-0`:L?(s("replaceTilde pr",L),_=`>=${E}.${S}.${k}-${L} <${E}.${+S+1}.0-0`):_=`>=${E}.${S}.${k} <${E}.${+S+1}.0-0`,s("tilde return",_),_})},F=(w,u)=>w.trim().split(/\s+/).map(b=>z(b,u)).join(" "),z=(w,u)=>{s("caret",w,u);const b=u.loose?a[c.CARETLOOSE]:a[c.CARET],m=u.includePrerelease?"-0":"";return w.replace(b,(E,S,k,L,_)=>{s("caret",w,E,S,k,L,_);let d;return N(S)?d="":N(k)?d=`>=${S}.0.0${m} <${+S+1}.0.0-0`:N(L)?S==="0"?d=`>=${S}.${k}.0${m} <${S}.${+k+1}.0-0`:d=`>=${S}.${k}.0${m} <${+S+1}.0.0-0`:_?(s("replaceCaret pr",_),S==="0"?k==="0"?d=`>=${S}.${k}.${L}-${_} <${S}.${k}.${+L+1}-0`:d=`>=${S}.${k}.${L}-${_} <${S}.${+k+1}.0-0`:d=`>=${S}.${k}.${L}-${_} <${+S+1}.0.0-0`):(s("no pr"),S==="0"?k==="0"?d=`>=${S}.${k}.${L}${m} <${S}.${k}.${+L+1}-0`:d=`>=${S}.${k}.${L}${m} <${S}.${+k+1}.0-0`:d=`>=${S}.${k}.${L} <${+S+1}.0.0-0`),s("caret return",d),d})},X=(w,u)=>(s("replaceXRanges",w,u),w.split(/\s+/).map(b=>K(b,u)).join(" ")),K=(w,u)=>{w=w.trim();const b=u.loose?a[c.XRANGELOOSE]:a[c.XRANGE];return w.replace(b,(m,E,S,k,L,_)=>{s("xRange",w,m,E,S,k,L,_);const d=N(S),A=d||N(k),Y=A||N(L),ee=Y;return E==="="&&ee&&(E=""),_=u.includePrerelease?"-0":"",d?E===">"||E==="<"?m="<0.0.0-0":m="*":E&&ee?(A&&(k=0),L=0,E===">"?(E=">=",A?(S=+S+1,k=0,L=0):(k=+k+1,L=0)):E==="<="&&(E="<",A?S=+S+1:k=+k+1),E==="<"&&(_="-0"),m=`${E+S}.${k}.${L}${_}`):A?m=`>=${S}.0.0${_} <${+S+1}.0.0-0`:Y&&(m=`>=${S}.${k}.0${_} <${S}.${+k+1}.0-0`),s("xRange return",m),m})},J=(w,u)=>(s("replaceStars",w,u),w.trim().replace(a[c.STAR],"")),ne=(w,u)=>(s("replaceGTE0",w,u),w.trim().replace(a[u.includePrerelease?c.GTE0PRE:c.GTE0],"")),oe=w=>(u,b,m,E,S,k,L,_,d,A,Y,ee,O)=>(N(m)?b="":N(E)?b=`>=${m}.0.0${w?"-0":""}`:N(S)?b=`>=${m}.${E}.0${w?"-0":""}`:k?b=`>=${b}`:b=`>=${b}${w?"-0":""}`,N(d)?_="":N(A)?_=`<${+d+1}.0.0-0`:N(Y)?_=`<${d}.${+A+1}.0-0`:ee?_=`<=${d}.${A}.${Y}-${ee}`:w?_=`<${d}.${A}.${+Y+1}-0`:_=`<=${_}`,`${b} ${_}`.trim()),ue=(w,u,b)=>{for(let m=0;m<w.length;m++)if(!w[m].test(u))return!1;if(u.prerelease.length&&!b.includePrerelease){for(let m=0;m<w.length;m++)if(s(w[m].semver),w[m].semver!==i.ANY&&w[m].semver.prerelease.length>0){const E=w[m].semver;if(E.major===u.major&&E.minor===u.minor&&E.patch===u.patch)return!0}return!1}return!0};return va}var ma,ml;function lo(){if(ml)return ma;ml=1;const t=Symbol("SemVer ANY");class e{static get ANY(){return t}constructor(p,g){if(g=r(g),p instanceof e){if(p.loose===!!g.loose)return p;p=p.value}p=p.trim().split(/\s+/).join(" "),o("comparator",p,g),this.options=g,this.loose=!!g.loose,this.parse(p),this.semver===t?this.value="":this.value=this.operator+this.semver.version,o("comp",this)}parse(p){const g=this.options.loose?n[i.COMPARATORLOOSE]:n[i.COMPARATOR],y=p.match(g);if(!y)throw new TypeError(`Invalid comparator: ${p}`);this.operator=y[1]!==void 0?y[1]:"",this.operator==="="&&(this.operator=""),y[2]?this.semver=new a(y[2],this.options.loose):this.semver=t}toString(){return this.value}test(p){if(o("Comparator.test",p,this.options.loose),this.semver===t||p===t)return!0;if(typeof p=="string")try{p=new a(p,this.options)}catch{return!1}return s(p,this.operator,this.semver,this.options)}intersects(p,g){if(!(p instanceof e))throw new TypeError("a Comparator is required");return this.operator===""?this.value===""?!0:new c(p.value,g).test(this.value):p.operator===""?p.value===""?!0:new c(this.value,g).test(p.semver):(g=r(g),g.includePrerelease&&(this.value==="<0.0.0-0"||p.value==="<0.0.0-0")||!g.includePrerelease&&(this.value.startsWith("<0.0.0")||p.value.startsWith("<0.0.0"))?!1:!!(this.operator.startsWith(">")&&p.operator.startsWith(">")||this.operator.startsWith("<")&&p.operator.startsWith("<")||this.semver.version===p.semver.version&&this.operator.includes("=")&&p.operator.includes("=")||s(this.semver,"<",p.semver,g)&&this.operator.startsWith(">")&&p.operator.startsWith("<")||s(this.semver,">",p.semver,g)&&this.operator.startsWith("<")&&p.operator.startsWith(">")))}}ma=e;const r=Tu,{safeRe:n,t:i}=Yi,s=Kf,o=uo,a=Rt,c=tr();return ma}const Ty=tr(),ky=(t,e,r)=>{try{e=new Ty(e,r)}catch{return!1}return e.test(t)};var ho=ky;const Ny=tr(),Oy=(t,e)=>new Ny(t,e).set.map(r=>r.map(n=>n.value).join(" ").trim().split(" "));var Ly=Oy;const By=Rt,Py=tr(),Dy=(t,e,r)=>{let n=null,i=null,s=null;try{s=new Py(e,r)}catch{return null}return t.forEach(o=>{s.test(o)&&(!n||i.compare(o)===-1)&&(n=o,i=new By(n,r))}),n};var jy=Dy;const $y=Rt,Fy=tr(),Uy=(t,e,r)=>{let n=null,i=null,s=null;try{s=new Fy(e,r)}catch{return null}return t.forEach(o=>{s.test(o)&&(!n||i.compare(o)===1)&&(n=o,i=new $y(n,r))}),n};var Hy=Uy;const ya=Rt,Wy=tr(),yl=co,Vy=(t,e)=>{t=new Wy(t,e);let r=new ya("0.0.0");if(t.test(r)||(r=new ya("0.0.0-0"),t.test(r)))return r;r=null;for(let n=0;n<t.set.length;++n){const i=t.set[n];let s=null;i.forEach(o=>{const a=new ya(o.semver.version);switch(o.operator){case">":a.prerelease.length===0?a.patch++:a.prerelease.push(0),a.raw=a.format();case"":case">=":(!s||yl(a,s))&&(s=a);break;case"<":case"<=":break;default:throw new Error(`Unexpected operation: ${o.operator}`)}}),s&&(!r||yl(r,s))&&(r=s)}return r&&t.test(r)?r:null};var zy=Vy;const qy=tr(),Gy=(t,e)=>{try{return new qy(t,e).range||"*"}catch{return null}};var Jy=Gy;const Zy=Rt,ed=lo(),{ANY:Qy}=ed,Yy=tr(),Ky=ho,_l=co,wl=Nu,Xy=Lu,e_=Ou,t_=(t,e,r,n)=>{t=new Zy(t,n),e=new Yy(e,n);let i,s,o,a,c;switch(r){case">":i=_l,s=Xy,o=wl,a=">",c=">=";break;case"<":i=wl,s=e_,o=_l,a="<",c="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(Ky(t,e,n))return!1;for(let l=0;l<e.set.length;++l){const p=e.set[l];let g=null,y=null;if(p.forEach(I=>{I.semver===Qy&&(I=new ed(">=0.0.0")),g=g||I,y=y||I,i(I.semver,g.semver,n)?g=I:o(I.semver,y.semver,n)&&(y=I)}),g.operator===a||g.operator===c||(!y.operator||y.operator===a)&&s(t,y.semver))return!1;if(y.operator===c&&o(t,y.semver))return!1}return!0};var Bu=t_;const r_=Bu,n_=(t,e,r)=>r_(t,e,">",r);var i_=n_;const s_=Bu,o_=(t,e,r)=>s_(t,e,"<",r);var a_=o_;const El=tr(),u_=(t,e,r)=>(t=new El(t,r),e=new El(e,r),t.intersects(e,r));var c_=u_;const l_=ho,h_=er;var f_=(t,e,r)=>{const n=[];let i=null,s=null;const o=t.sort((p,g)=>h_(p,g,r));for(const p of o)l_(p,e,r)?(s=p,i||(i=p)):(s&&n.push([i,s]),s=null,i=null);i&&n.push([i,null]);const a=[];for(const[p,g]of n)p===g?a.push(p):!g&&p===o[0]?a.push("*"):g?p===o[0]?a.push(`<=${g}`):a.push(`${p} - ${g}`):a.push(`>=${p}`);const c=a.join(" || "),l=typeof e.raw=="string"?e.raw:String(e);return c.length<l.length?c:e};const Sl=tr(),Pu=lo(),{ANY:_a}=Pu,_i=ho,Du=er,d_=(t,e,r={})=>{if(t===e)return!0;t=new Sl(t,r),e=new Sl(e,r);let n=!1;e:for(const i of t.set){for(const s of e.set){const o=g_(i,s,r);if(n=n||o!==null,o)continue e}if(n)return!1}return!0},p_=[new Pu(">=0.0.0-0")],xl=[new Pu(">=0.0.0")],g_=(t,e,r)=>{if(t===e)return!0;if(t.length===1&&t[0].semver===_a){if(e.length===1&&e[0].semver===_a)return!0;r.includePrerelease?t=p_:t=xl}if(e.length===1&&e[0].semver===_a){if(r.includePrerelease)return!0;e=xl}const n=new Set;let i,s;for(const I of t)I.operator===">"||I.operator===">="?i=Ml(i,I,r):I.operator==="<"||I.operator==="<="?s=Cl(s,I,r):n.add(I.semver);if(n.size>1)return null;let o;if(i&&s){if(o=Du(i.semver,s.semver,r),o>0)return null;if(o===0&&(i.operator!==">="||s.operator!=="<="))return null}for(const I of n){if(i&&!_i(I,String(i),r)||s&&!_i(I,String(s),r))return null;for(const T of e)if(!_i(I,String(T),r))return!1;return!0}let a,c,l,p,g=s&&!r.includePrerelease&&s.semver.prerelease.length?s.semver:!1,y=i&&!r.includePrerelease&&i.semver.prerelease.length?i.semver:!1;g&&g.prerelease.length===1&&s.operator==="<"&&g.prerelease[0]===0&&(g=!1);for(const I of e){if(p=p||I.operator===">"||I.operator===">=",l=l||I.operator==="<"||I.operator==="<=",i){if(y&&I.semver.prerelease&&I.semver.prerelease.length&&I.semver.major===y.major&&I.semver.minor===y.minor&&I.semver.patch===y.patch&&(y=!1),I.operator===">"||I.operator===">="){if(a=Ml(i,I,r),a===I&&a!==i)return!1}else if(i.operator===">="&&!_i(i.semver,String(I),r))return!1}if(s){if(g&&I.semver.prerelease&&I.semver.prerelease.length&&I.semver.major===g.major&&I.semver.minor===g.minor&&I.semver.patch===g.patch&&(g=!1),I.operator==="<"||I.operator==="<="){if(c=Cl(s,I,r),c===I&&c!==s)return!1}else if(s.operator==="<="&&!_i(s.semver,String(I),r))return!1}if(!I.operator&&(s||i)&&o!==0)return!1}return!(i&&l&&!s&&o!==0||s&&p&&!i&&o!==0||y||g)},Ml=(t,e,r)=>{if(!t)return e;const n=Du(t.semver,e.semver,r);return n>0?t:n<0||e.operator===">"&&t.operator===">="?e:t},Cl=(t,e,r)=>{if(!t)return e;const n=Du(t.semver,e.semver,r);return n<0?t:n>0||e.operator==="<"&&t.operator==="<="?e:t};var b_=d_;const wa=Yi,Il=ao,v_=Rt,Rl=Zf,m_=di,y_=mm,__=wm,w_=Sm,E_=Mm,S_=Rm,x_=km,M_=Lm,C_=Dm,I_=er,R_=Um,A_=Vm,T_=ku,k_=Jm,N_=Ym,O_=co,L_=Nu,B_=Qf,P_=Yf,D_=Ou,j_=Lu,$_=Kf,F_=_y,U_=lo(),H_=tr(),W_=ho,V_=Ly,z_=jy,q_=Hy,G_=zy,J_=Jy,Z_=Bu,Q_=i_,Y_=a_,K_=c_,X_=f_,ew=b_;var tw={parse:m_,valid:y_,clean:__,inc:w_,diff:E_,major:S_,minor:x_,patch:M_,prerelease:C_,compare:I_,rcompare:R_,compareLoose:A_,compareBuild:T_,sort:k_,rsort:N_,gt:O_,lt:L_,eq:B_,neq:P_,gte:D_,lte:j_,cmp:$_,coerce:F_,Comparator:U_,Range:H_,satisfies:W_,toComparators:V_,maxSatisfying:z_,minSatisfying:q_,minVersion:G_,validRange:J_,outside:Z_,gtr:Q_,ltr:Y_,intersects:K_,simplifyRange:X_,subset:ew,SemVer:v_,re:wa.re,src:wa.src,tokens:wa.t,SEMVER_SPEC_VERSION:Il.SEMVER_SPEC_VERSION,RELEASE_TYPES:Il.RELEASE_TYPES,compareIdentifiers:Rl.compareIdentifiers,rcompareIdentifiers:Rl.rcompareIdentifiers};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.satisfiesVersionRange=t.gtRange=t.gtVersion=t.assertIsSemVerRange=t.assertIsSemVerVersion=t.isValidSemVerRange=t.isValidSemVerVersion=t.VersionRangeStruct=t.VersionStruct=void 0;const e=tw,r=yn,n=_t;t.VersionStruct=(0,r.refine)((0,r.string)(),"Version",g=>(0,e.valid)(g)===null?`Expected SemVer version, got "${g}"`:!0),t.VersionRangeStruct=(0,r.refine)((0,r.string)(),"Version range",g=>(0,e.validRange)(g)===null?`Expected SemVer range, got "${g}"`:!0);function i(g){return(0,r.is)(g,t.VersionStruct)}t.isValidSemVerVersion=i;function s(g){return(0,r.is)(g,t.VersionRangeStruct)}t.isValidSemVerRange=s;function o(g){(0,n.assertStruct)(g,t.VersionStruct)}t.assertIsSemVerVersion=o;function a(g){(0,n.assertStruct)(g,t.VersionRangeStruct)}t.assertIsSemVerRange=a;function c(g,y){return(0,e.gt)(g,y)}t.gtVersion=c;function l(g,y){return(0,e.gtr)(g,y)}t.gtRange=l;function p(g,y){return(0,e.satisfies)(g,y,{includePrerelease:!0})}t.satisfiesVersionRange=p})(qf);(function(t){var e=te&&te.__createBinding||(Object.create?function(n,i,s,o){o===void 0&&(o=s);var a=Object.getOwnPropertyDescriptor(i,s);(!a||("get"in a?!i.__esModule:a.writable||a.configurable))&&(a={enumerable:!0,get:function(){return i[s]}}),Object.defineProperty(n,o,a)}:function(n,i,s,o){o===void 0&&(o=s),n[o]=i[s]}),r=te&&te.__exportStar||function(n,i){for(var s in n)s!=="default"&&!Object.prototype.hasOwnProperty.call(i,s)&&e(i,n,s)};Object.defineProperty(t,"__esModule",{value:!0}),r(_t,t),r(Zi,t),r(Se,t),r(so,t),r(lr,t),r(Zn,t),r(Qi,t),r(Wf,t),r(Qn,t),r(Au,t),r(hr,t),r(Vf,t),r(zf,t),r(qf,t)})(xf);(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.createModuleLogger=t.projectLogger=void 0;const e=xf;Object.defineProperty(t,"createModuleLogger",{enumerable:!0,get:function(){return e.createModuleLogger}}),t.projectLogger=(0,e.createProjectLogger)("eth-block-tracker")})(Sf);var td=te&&te.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(no,"__esModule",{value:!0});no.PollingBlockTracker=void 0;const rw=td(yu),nw=td(xv),iw=Gi,Al=Sf,Tl=(0,Al.createModuleLogger)(Al.projectLogger,"polling-block-tracker"),sw=(0,rw.default)(),ow=1e3;class aw extends iw.BaseBlockTracker{constructor(e={}){var r;if(!e.provider)throw new Error("PollingBlockTracker - no provider specified.");super({blockResetDuration:(r=e.blockResetDuration)!==null&&r!==void 0?r:e.pollingInterval}),this._provider=e.provider,this._pollingInterval=e.pollingInterval||20*ow,this._retryTimeout=e.retryTimeout||this._pollingInterval/10,this._keepEventLoopActive=e.keepEventLoopActive===void 0?!0:e.keepEventLoopActive,this._setSkipCacheFlag=e.setSkipCacheFlag||!1}async checkForLatestBlock(){return await this._updateLatestBlock(),await this.getLatestBlock()}async _start(){this._synchronize()}async _end(){}async _synchronize(){for(var e;this._isRunning;)try{await this._updateLatestBlock();const r=kl(this._pollingInterval,!this._keepEventLoopActive);this.emit("_waitingForNextIteration"),await r}catch(r){const n=new Error(`PollingBlockTracker - encountered an error while attempting to update latest block:
7
+ ${(e=r.stack)!==null&&e!==void 0?e:r}`);try{this.emit("error",n)}catch{console.error(n)}const i=kl(this._retryTimeout,!this._keepEventLoopActive);this.emit("_waitingForNextIteration"),await i}}async _updateLatestBlock(){const e=await this._fetchLatestBlock();this._newPotentialLatest(e)}async _fetchLatestBlock(){const e={jsonrpc:"2.0",id:sw(),method:"eth_blockNumber",params:[]};this._setSkipCacheFlag&&(e.skipCache=!0),Tl("Making request",e);const r=await(0,nw.default)(n=>this._provider.sendAsync(e,n))();if(Tl("Got response",r),r.error)throw new Error(`PollingBlockTracker - encountered error fetching block:
8
+ ${r.error.message}`);return r.result}}no.PollingBlockTracker=aw;function kl(t,e){return new Promise(r=>{const n=setTimeout(r,t);n.unref&&e&&n.unref()})}var fo={},uw=te&&te.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(fo,"__esModule",{value:!0});fo.SubscribeBlockTracker=void 0;const cw=uw(yu),lw=Gi,hw=(0,cw.default)();class fw extends lw.BaseBlockTracker{constructor(e={}){if(!e.provider)throw new Error("SubscribeBlockTracker - no provider specified.");super(e),this._provider=e.provider,this._subscriptionId=null}async checkForLatestBlock(){return await this.getLatestBlock()}async _start(){if(this._subscriptionId===void 0||this._subscriptionId===null)try{const e=await this._call("eth_blockNumber");this._subscriptionId=await this._call("eth_subscribe","newHeads"),this._provider.on("data",this._handleSubData.bind(this)),this._newPotentialLatest(e)}catch(e){this.emit("error",e)}}async _end(){if(this._subscriptionId!==null&&this._subscriptionId!==void 0)try{await this._call("eth_unsubscribe",this._subscriptionId),this._subscriptionId=null}catch(e){this.emit("error",e)}}_call(e,...r){return new Promise((n,i)=>{this._provider.sendAsync({id:hw(),method:e,params:r,jsonrpc:"2.0"},(s,o)=>{s?i(s):n(o.result)})})}_handleSubData(e,r){var n;r.method==="eth_subscription"&&((n=r.params)===null||n===void 0?void 0:n.subscription)===this._subscriptionId&&this._newPotentialLatest(r.params.result.number)}}fo.SubscribeBlockTracker=fw;var rd={};Object.defineProperty(rd,"__esModule",{value:!0});(function(t){var e=te&&te.__createBinding||(Object.create?function(n,i,s,o){o===void 0&&(o=s),Object.defineProperty(n,o,{enumerable:!0,get:function(){return i[s]}})}:function(n,i,s,o){o===void 0&&(o=s),n[o]=i[s]}),r=te&&te.__exportStar||function(n,i){for(var s in n)s!=="default"&&!Object.prototype.hasOwnProperty.call(i,s)&&e(i,n,s)};Object.defineProperty(t,"__esModule",{value:!0}),r(no,t),r(fo,t),r(rd,t)})(Ef);var ju={},po={},Ki={};Object.defineProperty(Ki,"__esModule",{value:!0});Ki.getUniqueId=void 0;const nd=4294967295;let Ea=Math.floor(Math.random()*nd);function dw(){return Ea=(Ea+1)%nd,Ea}Ki.getUniqueId=dw;Object.defineProperty(po,"__esModule",{value:!0});po.createIdRemapMiddleware=void 0;const pw=Ki;function gw(){return(t,e,r,n)=>{const i=t.id,s=pw.getUniqueId();t.id=s,e.id=s,r(o=>{t.id=i,e.id=i,o()})}}po.createIdRemapMiddleware=gw;var go={};Object.defineProperty(go,"__esModule",{value:!0});go.createAsyncMiddleware=void 0;function bw(t){return async(e,r,n,i)=>{let s;const o=new Promise(p=>{s=p});let a=null,c=!1;const l=async()=>{c=!0,n(p=>{a=p,s()}),await o};try{await t(e,r,l),c?(await o,a(null)):i(null)}catch(p){a?a(p):i(p)}}}go.createAsyncMiddleware=bw;var bo={};Object.defineProperty(bo,"__esModule",{value:!0});bo.createScaffoldMiddleware=void 0;function vw(t){return(e,r,n,i)=>{const s=t[e.method];return s===void 0?n():typeof s=="function"?s(e,r,n,i):(r.result=s,i())}}bo.createScaffoldMiddleware=vw;var Xi={},mw=te&&te.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Xi,"__esModule",{value:!0});Xi.JsonRpcEngine=void 0;const yw=mw(pn),Dt=hu;class br extends yw.default{constructor(){super(),this._middleware=[]}push(e){this._middleware.push(e)}handle(e,r){if(r&&typeof r!="function")throw new Error('"callback" must be a function if provided.');return Array.isArray(e)?r?this._handleBatch(e,r):this._handleBatch(e):r?this._handle(e,r):this._promiseHandle(e)}asMiddleware(){return async(e,r,n,i)=>{try{const[s,o,a]=await br._runAllMiddleware(e,r,this._middleware);return o?(await br._runReturnHandlers(a),i(s)):n(async c=>{try{await br._runReturnHandlers(a)}catch(l){return c(l)}return c()})}catch(s){return i(s)}}}async _handleBatch(e,r){try{const n=await Promise.all(e.map(this._promiseHandle.bind(this)));return r?r(null,n):n}catch(n){if(r)return r(n);throw n}}_promiseHandle(e){return new Promise(r=>{this._handle(e,(n,i)=>{r(i)})})}async _handle(e,r){if(!e||Array.isArray(e)||typeof e!="object"){const o=new Dt.EthereumRpcError(Dt.errorCodes.rpc.invalidRequest,`Requests must be plain objects. Received: ${typeof e}`,{request:e});return r(o,{id:void 0,jsonrpc:"2.0",error:o})}if(typeof e.method!="string"){const o=new Dt.EthereumRpcError(Dt.errorCodes.rpc.invalidRequest,`Must specify a string method. Received: ${typeof e.method}`,{request:e});return r(o,{id:e.id,jsonrpc:"2.0",error:o})}const n=Object.assign({},e),i={id:n.id,jsonrpc:n.jsonrpc};let s=null;try{await this._processRequest(n,i)}catch(o){s=o}return s&&(delete i.result,i.error||(i.error=Dt.serializeError(s))),r(s,i)}async _processRequest(e,r){const[n,i,s]=await br._runAllMiddleware(e,r,this._middleware);if(br._checkForCompletion(e,r,i),await br._runReturnHandlers(s),n)throw n}static async _runAllMiddleware(e,r,n){const i=[];let s=null,o=!1;for(const a of n)if([s,o]=await br._runMiddleware(e,r,a,i),o)break;return[s,o,i.reverse()]}static _runMiddleware(e,r,n,i){return new Promise(s=>{const o=c=>{const l=c||r.error;l&&(r.error=Dt.serializeError(l)),s([l,!0])},a=c=>{r.error?o(r.error):(c&&(typeof c!="function"&&o(new Dt.EthereumRpcError(Dt.errorCodes.rpc.internal,`JsonRpcEngine: "next" return handlers must be functions. Received "${typeof c}" for request:
9
+ ${Sa(e)}`,{request:e})),i.push(c)),s([null,!1]))};try{n(e,r,a,o)}catch(c){o(c)}})}static async _runReturnHandlers(e){for(const r of e)await new Promise((n,i)=>{r(s=>s?i(s):n())})}static _checkForCompletion(e,r,n){if(!("result"in r)&&!("error"in r))throw new Dt.EthereumRpcError(Dt.errorCodes.rpc.internal,`JsonRpcEngine: Response has no error or result for request:
10
+ ${Sa(e)}`,{request:e});if(!n)throw new Dt.EthereumRpcError(Dt.errorCodes.rpc.internal,`JsonRpcEngine: Nothing ended request:
11
+ ${Sa(e)}`,{request:e})}}Xi.JsonRpcEngine=br;function Sa(t){return JSON.stringify(t,null,2)}var vo={};Object.defineProperty(vo,"__esModule",{value:!0});vo.mergeMiddleware=void 0;const _w=Xi;function ww(t){const e=new _w.JsonRpcEngine;return t.forEach(r=>e.push(r)),e.asMiddleware()}vo.mergeMiddleware=ww;(function(t){var e=te&&te.__createBinding||(Object.create?function(n,i,s,o){o===void 0&&(o=s),Object.defineProperty(n,o,{enumerable:!0,get:function(){return i[s]}})}:function(n,i,s,o){o===void 0&&(o=s),n[o]=i[s]}),r=te&&te.__exportStar||function(n,i){for(var s in n)s!=="default"&&!Object.prototype.hasOwnProperty.call(i,s)&&e(i,n,s)};Object.defineProperty(t,"__esModule",{value:!0}),r(po,t),r(go,t),r(bo,t),r(Ki,t),r(Xi,t),r(vo,t)})(ju);var id={},$u={},Ja=function(t,e){return Ja=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,n){r.__proto__=n}||function(r,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(r[i]=n[i])},Ja(t,e)};function sd(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");Ja(t,e);function r(){this.constructor=t}t.prototype=e===null?Object.create(e):(r.prototype=e.prototype,new r)}var ks=function(){return ks=Object.assign||function(e){for(var r,n=1,i=arguments.length;n<i;n++){r=arguments[n];for(var s in r)Object.prototype.hasOwnProperty.call(r,s)&&(e[s]=r[s])}return e},ks.apply(this,arguments)};function od(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(t);i<n.length;i++)e.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(t,n[i])&&(r[n[i]]=t[n[i]]);return r}function ad(t,e,r,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=0;a--)(o=t[a])&&(s=(i<3?o(s):i>3?o(e,r,s):o(e,r))||s);return i>3&&s&&Object.defineProperty(e,r,s),s}function ud(t,e){return function(r,n){e(r,n,t)}}function Ew(t,e,r,n,i,s){function o(M){if(M!==void 0&&typeof M!="function")throw new TypeError("Function expected");return M}for(var a=n.kind,c=a==="getter"?"get":a==="setter"?"set":"value",l=!e&&t?n.static?t:t.prototype:null,p=e||(l?Object.getOwnPropertyDescriptor(l,n.name):{}),g,y=!1,I=r.length-1;I>=0;I--){var T={};for(var D in n)T[D]=D==="access"?{}:n[D];for(var D in n.access)T.access[D]=n.access[D];T.addInitializer=function(M){if(y)throw new TypeError("Cannot add initializers after decoration has completed");s.push(o(M||null))};var U=(0,r[I])(a==="accessor"?{get:p.get,set:p.set}:p[c],T);if(a==="accessor"){if(U===void 0)continue;if(U===null||typeof U!="object")throw new TypeError("Object expected");(g=o(U.get))&&(p.get=g),(g=o(U.set))&&(p.set=g),(g=o(U.init))&&i.unshift(g)}else(g=o(U))&&(a==="field"?i.unshift(g):p[c]=g)}l&&Object.defineProperty(l,n.name,p),y=!0}function Sw(t,e,r){for(var n=arguments.length>2,i=0;i<e.length;i++)r=n?e[i].call(t,r):e[i].call(t);return n?r:void 0}function xw(t){return typeof t=="symbol"?t:"".concat(t)}function Mw(t,e,r){return typeof e=="symbol"&&(e=e.description?"[".concat(e.description,"]"):""),Object.defineProperty(t,"name",{configurable:!0,value:r?"".concat(r," ",e):e})}function cd(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)}function ld(t,e,r,n){function i(s){return s instanceof r?s:new r(function(o){o(s)})}return new(r||(r=Promise))(function(s,o){function a(p){try{l(n.next(p))}catch(g){o(g)}}function c(p){try{l(n.throw(p))}catch(g){o(g)}}function l(p){p.done?s(p.value):i(p.value).then(a,c)}l((n=n.apply(t,e||[])).next())})}function hd(t,e){var r={label:0,sent:function(){if(s[0]&1)throw s[1];return s[1]},trys:[],ops:[]},n,i,s,o;return o={next:a(0),throw:a(1),return:a(2)},typeof Symbol=="function"&&(o[Symbol.iterator]=function(){return this}),o;function a(l){return function(p){return c([l,p])}}function c(l){if(n)throw new TypeError("Generator is already executing.");for(;o&&(o=0,l[0]&&(r=0)),r;)try{if(n=1,i&&(s=l[0]&2?i.return:l[0]?i.throw||((s=i.return)&&s.call(i),0):i.next)&&!(s=s.call(i,l[1])).done)return s;switch(i=0,s&&(l=[l[0]&2,s.value]),l[0]){case 0:case 1:s=l;break;case 4:return r.label++,{value:l[1],done:!1};case 5:r.label++,i=l[1],l=[0];continue;case 7:l=r.ops.pop(),r.trys.pop();continue;default:if(s=r.trys,!(s=s.length>0&&s[s.length-1])&&(l[0]===6||l[0]===2)){r=0;continue}if(l[0]===3&&(!s||l[1]>s[0]&&l[1]<s[3])){r.label=l[1];break}if(l[0]===6&&r.label<s[1]){r.label=s[1],s=l;break}if(s&&r.label<s[2]){r.label=s[2],r.ops.push(l);break}s[2]&&r.ops.pop(),r.trys.pop();continue}l=e.call(t,r)}catch(p){l=[6,p],i=0}finally{n=s=0}if(l[0]&5)throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}}var mo=Object.create?function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]};function fd(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&mo(e,t,r)}function Ns(t){var e=typeof Symbol=="function"&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function Fu(t,e){var r=typeof Symbol=="function"&&t[Symbol.iterator];if(!r)return t;var n=r.call(t),i,s=[],o;try{for(;(e===void 0||e-- >0)&&!(i=n.next()).done;)s.push(i.value)}catch(a){o={error:a}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(o)throw o.error}}return s}function dd(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(Fu(arguments[e]));return t}function pd(){for(var t=0,e=0,r=arguments.length;e<r;e++)t+=arguments[e].length;for(var n=Array(t),i=0,e=0;e<r;e++)for(var s=arguments[e],o=0,a=s.length;o<a;o++,i++)n[i]=s[o];return n}function gd(t,e,r){if(r||arguments.length===2)for(var n=0,i=e.length,s;n<i;n++)(s||!(n in e))&&(s||(s=Array.prototype.slice.call(e,0,n)),s[n]=e[n]);return t.concat(s||Array.prototype.slice.call(e))}function Yn(t){return this instanceof Yn?(this.v=t,this):new Yn(t)}function bd(t,e,r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var n=r.apply(t,e||[]),i,s=[];return i={},o("next"),o("throw"),o("return"),i[Symbol.asyncIterator]=function(){return this},i;function o(y){n[y]&&(i[y]=function(I){return new Promise(function(T,D){s.push([y,I,T,D])>1||a(y,I)})})}function a(y,I){try{c(n[y](I))}catch(T){g(s[0][3],T)}}function c(y){y.value instanceof Yn?Promise.resolve(y.value.v).then(l,p):g(s[0][2],y)}function l(y){a("next",y)}function p(y){a("throw",y)}function g(y,I){y(I),s.shift(),s.length&&a(s[0][0],s[0][1])}}function vd(t){var e,r;return e={},n("next"),n("throw",function(i){throw i}),n("return"),e[Symbol.iterator]=function(){return this},e;function n(i,s){e[i]=t[i]?function(o){return(r=!r)?{value:Yn(t[i](o)),done:!1}:s?s(o):o}:s}}function md(t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e=t[Symbol.asyncIterator],r;return e?e.call(t):(t=typeof Ns=="function"?Ns(t):t[Symbol.iterator](),r={},n("next"),n("throw"),n("return"),r[Symbol.asyncIterator]=function(){return this},r);function n(s){r[s]=t[s]&&function(o){return new Promise(function(a,c){o=t[s](o),i(a,c,o.done,o.value)})}}function i(s,o,a,c){Promise.resolve(c).then(function(l){s({value:l,done:a})},o)}}function yd(t,e){return Object.defineProperty?Object.defineProperty(t,"raw",{value:e}):t.raw=e,t}var Cw=Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e};function _d(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)r!=="default"&&Object.prototype.hasOwnProperty.call(t,r)&&mo(e,t,r);return Cw(e,t),e}function wd(t){return t&&t.__esModule?t:{default:t}}function Ed(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)}function Sd(t,e,r,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r}function xd(t,e){if(e===null||typeof e!="object"&&typeof e!="function")throw new TypeError("Cannot use 'in' operator on non-object");return typeof t=="function"?e===t:t.has(e)}function Md(t,e,r){if(e!=null){if(typeof e!="object"&&typeof e!="function")throw new TypeError("Object expected.");var n;if(r){if(!Symbol.asyncDispose)throw new TypeError("Symbol.asyncDispose is not defined.");n=e[Symbol.asyncDispose]}if(n===void 0){if(!Symbol.dispose)throw new TypeError("Symbol.dispose is not defined.");n=e[Symbol.dispose]}if(typeof n!="function")throw new TypeError("Object not disposable.");t.stack.push({value:e,dispose:n,async:r})}else r&&t.stack.push({async:!0});return e}var Iw=typeof SuppressedError=="function"?SuppressedError:function(t,e,r){var n=new Error(r);return n.name="SuppressedError",n.error=t,n.suppressed=e,n};function Cd(t){function e(n){t.error=t.hasError?new Iw(n,t.error,"An error was suppressed during disposal."):n,t.hasError=!0}function r(){for(;t.stack.length;){var n=t.stack.pop();try{var i=n.dispose&&n.dispose.call(n.value);if(n.async)return Promise.resolve(i).then(r,function(s){return e(s),r()})}catch(s){e(s)}}if(t.hasError)throw t.error}return r()}const Rw={__extends:sd,__assign:ks,__rest:od,__decorate:ad,__param:ud,__metadata:cd,__awaiter:ld,__generator:hd,__createBinding:mo,__exportStar:fd,__values:Ns,__read:Fu,__spread:dd,__spreadArrays:pd,__spreadArray:gd,__await:Yn,__asyncGenerator:bd,__asyncDelegator:vd,__asyncValues:md,__makeTemplateObject:yd,__importStar:_d,__importDefault:wd,__classPrivateFieldGet:Ed,__classPrivateFieldSet:Sd,__classPrivateFieldIn:xd,__addDisposableResource:Md,__disposeResources:Cd},Aw=Object.freeze(Object.defineProperty({__proto__:null,__addDisposableResource:Md,get __assign(){return ks},__asyncDelegator:vd,__asyncGenerator:bd,__asyncValues:md,__await:Yn,__awaiter:ld,__classPrivateFieldGet:Ed,__classPrivateFieldIn:xd,__classPrivateFieldSet:Sd,__createBinding:mo,__decorate:ad,__disposeResources:Cd,__esDecorate:Ew,__exportStar:fd,__extends:sd,__generator:hd,__importDefault:wd,__importStar:_d,__makeTemplateObject:yd,__metadata:cd,__param:ud,__propKey:xw,__read:Fu,__rest:od,__runInitializers:Sw,__setFunctionName:Mw,__spread:dd,__spreadArray:gd,__spreadArrays:pd,__values:Ns,default:Rw},Symbol.toStringTag,{value:"Module"})),Uu=si(Aw);var yo={};Object.defineProperty(yo,"__esModule",{value:!0});var Nl=Uu,Tw=function(){function t(e){if(this._maxConcurrency=e,this._queue=[],e<=0)throw new Error("semaphore must be initialized to a positive value");this._value=e}return t.prototype.acquire=function(){var e=this,r=this.isLocked(),n=new Promise(function(i){return e._queue.push(i)});return r||this._dispatch(),n},t.prototype.runExclusive=function(e){return Nl.__awaiter(this,void 0,void 0,function(){var r,n,i;return Nl.__generator(this,function(s){switch(s.label){case 0:return[4,this.acquire()];case 1:r=s.sent(),n=r[0],i=r[1],s.label=2;case 2:return s.trys.push([2,,4,5]),[4,e(n)];case 3:return[2,s.sent()];case 4:return i(),[7];case 5:return[2]}})})},t.prototype.isLocked=function(){return this._value<=0},t.prototype.release=function(){if(this._maxConcurrency>1)throw new Error("this method is unavailabel on semaphores with concurrency > 1; use the scoped release returned by acquire instead");if(this._currentReleaser){var e=this._currentReleaser;this._currentReleaser=void 0,e()}},t.prototype._dispatch=function(){var e=this,r=this._queue.shift();if(r){var n=!1;this._currentReleaser=function(){n||(n=!0,e._value++,e._dispatch())},r([this._value--,this._currentReleaser])}},t}();yo.default=Tw;Object.defineProperty($u,"__esModule",{value:!0});var Ol=Uu,kw=yo,Nw=function(){function t(){this._semaphore=new kw.default(1)}return t.prototype.acquire=function(){return Ol.__awaiter(this,void 0,void 0,function(){var e,r;return Ol.__generator(this,function(n){switch(n.label){case 0:return[4,this._semaphore.acquire()];case 1:return e=n.sent(),r=e[1],[2,r]}})})},t.prototype.runExclusive=function(e){return this._semaphore.runExclusive(function(){return e()})},t.prototype.isLocked=function(){return this._semaphore.isLocked()},t.prototype.release=function(){this._semaphore.release()},t}();$u.default=Nw;var _o={};Object.defineProperty(_o,"__esModule",{value:!0});_o.withTimeout=void 0;var bs=Uu;function Ow(t,e,r){var n=this;return r===void 0&&(r=new Error("timeout")),{acquire:function(){return new Promise(function(i,s){return bs.__awaiter(n,void 0,void 0,function(){var o,a,c;return bs.__generator(this,function(l){switch(l.label){case 0:return o=!1,setTimeout(function(){o=!0,s(r)},e),[4,t.acquire()];case 1:return a=l.sent(),o?(c=Array.isArray(a)?a[1]:a,c()):i(a),[2]}})})})},runExclusive:function(i){return bs.__awaiter(this,void 0,void 0,function(){var s,o;return bs.__generator(this,function(a){switch(a.label){case 0:s=function(){},a.label=1;case 1:return a.trys.push([1,,7,8]),[4,this.acquire()];case 2:return o=a.sent(),Array.isArray(o)?(s=o[1],[4,i(o[0])]):[3,4];case 3:return[2,a.sent()];case 4:return s=o,[4,i()];case 5:return[2,a.sent()];case 6:return[3,8];case 7:return s(),[7];case 8:return[2]}})})},release:function(){t.release()},isLocked:function(){return t.isLocked()}}}_o.withTimeout=Ow;(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.withTimeout=t.Semaphore=t.Mutex=void 0;var e=$u;Object.defineProperty(t,"Mutex",{enumerable:!0,get:function(){return e.default}});var r=yo;Object.defineProperty(t,"Semaphore",{enumerable:!0,get:function(){return r.default}});var n=_o;Object.defineProperty(t,"withTimeout",{enumerable:!0,get:function(){return n.withTimeout}})})(id);var Lw=Pw,Bw=Object.prototype.hasOwnProperty;function Pw(){for(var t={},e=0;e<arguments.length;e++){var r=arguments[e];for(var n in r)Bw.call(r,n)&&(t[n]=r[n])}return t}const Dw=Lw,jw=yu();var $w=pe;function pe(t){const e=this;e.currentProvider=t}pe.prototype.getBalance=es(2,"eth_getBalance");pe.prototype.getCode=es(2,"eth_getCode");pe.prototype.getTransactionCount=es(2,"eth_getTransactionCount");pe.prototype.getStorageAt=es(3,"eth_getStorageAt");pe.prototype.call=es(2,"eth_call");pe.prototype.protocolVersion=we("eth_protocolVersion");pe.prototype.syncing=we("eth_syncing");pe.prototype.coinbase=we("eth_coinbase");pe.prototype.mining=we("eth_mining");pe.prototype.hashrate=we("eth_hashrate");pe.prototype.gasPrice=we("eth_gasPrice");pe.prototype.accounts=we("eth_accounts");pe.prototype.blockNumber=we("eth_blockNumber");pe.prototype.getBlockTransactionCountByHash=we("eth_getBlockTransactionCountByHash");pe.prototype.getBlockTransactionCountByNumber=we("eth_getBlockTransactionCountByNumber");pe.prototype.getUncleCountByBlockHash=we("eth_getUncleCountByBlockHash");pe.prototype.getUncleCountByBlockNumber=we("eth_getUncleCountByBlockNumber");pe.prototype.sign=we("eth_sign");pe.prototype.sendTransaction=we("eth_sendTransaction");pe.prototype.sendRawTransaction=we("eth_sendRawTransaction");pe.prototype.estimateGas=we("eth_estimateGas");pe.prototype.getBlockByHash=we("eth_getBlockByHash");pe.prototype.getBlockByNumber=we("eth_getBlockByNumber");pe.prototype.getTransactionByHash=we("eth_getTransactionByHash");pe.prototype.getTransactionByBlockHashAndIndex=we("eth_getTransactionByBlockHashAndIndex");pe.prototype.getTransactionByBlockNumberAndIndex=we("eth_getTransactionByBlockNumberAndIndex");pe.prototype.getTransactionReceipt=we("eth_getTransactionReceipt");pe.prototype.getUncleByBlockHashAndIndex=we("eth_getUncleByBlockHashAndIndex");pe.prototype.getUncleByBlockNumberAndIndex=we("eth_getUncleByBlockNumberAndIndex");pe.prototype.getCompilers=we("eth_getCompilers");pe.prototype.compileLLL=we("eth_compileLLL");pe.prototype.compileSolidity=we("eth_compileSolidity");pe.prototype.compileSerpent=we("eth_compileSerpent");pe.prototype.newFilter=we("eth_newFilter");pe.prototype.newBlockFilter=we("eth_newBlockFilter");pe.prototype.newPendingTransactionFilter=we("eth_newPendingTransactionFilter");pe.prototype.uninstallFilter=we("eth_uninstallFilter");pe.prototype.getFilterChanges=we("eth_getFilterChanges");pe.prototype.getFilterLogs=we("eth_getFilterLogs");pe.prototype.getLogs=we("eth_getLogs");pe.prototype.getWork=we("eth_getWork");pe.prototype.submitWork=we("eth_submitWork");pe.prototype.submitHashrate=we("eth_submitHashrate");pe.prototype.sendAsync=function(t,e){this.currentProvider.sendAsync(Fw(t),function(n,i){if(!n&&i.error&&(n=new Error("EthQuery - RPC Error - "+i.error.message)),n)return e(n);e(null,i.result)})};function we(t){return function(){const e=this;var r=[].slice.call(arguments),n=r.pop();e.sendAsync({method:t,params:r},n)}}function es(t,e){return function(){const r=this;var n=[].slice.call(arguments),i=n.pop();n.length<t&&n.push("latest"),r.sendAsync({method:e,params:n},i)}}function Fw(t){return Dw({id:jw(),jsonrpc:"2.0",params:[]},t)}const Ll=(t,e,r,n)=>function(...i){const s=e.promiseModule;return new s((o,a)=>{e.multiArgs?i.push((...l)=>{e.errorFirst?l[0]?a(l):(l.shift(),o(l)):o(l)}):e.errorFirst?i.push((l,p)=>{l?a(l):o(p)}):i.push(o),Reflect.apply(t,this===r?n:this,i)})},Bl=new WeakMap;var Uw=(t,e)=>{e={exclude:[/.+(?:Sync|Stream)$/],errorFirst:!0,promiseModule:Promise,...e};const r=typeof t;if(!(t!==null&&(r==="object"||r==="function")))throw new TypeError(`Expected \`input\` to be a \`Function\` or \`Object\`, got \`${t===null?"null":r}\``);const n=(o,a)=>{let c=Bl.get(o);if(c||(c={},Bl.set(o,c)),a in c)return c[a];const l=T=>typeof T=="string"||typeof a=="symbol"?a===T:T.test(a),p=Reflect.getOwnPropertyDescriptor(o,a),g=p===void 0||p.writable||p.configurable,I=(e.include?e.include.some(l):!e.exclude.some(l))&&g;return c[a]=I,I},i=new WeakMap,s=new Proxy(t,{apply(o,a,c){const l=i.get(o);if(l)return Reflect.apply(l,a,c);const p=e.excludeMain?o:Ll(o,e,s,o);return i.set(o,p),Reflect.apply(p,a,c)},get(o,a){const c=o[a];if(!n(o,a)||c===Function.prototype[a])return c;const l=i.get(c);if(l)return l;if(typeof c=="function"){const p=Ll(c,e,s,o);return i.set(c,p),p}return c}});return s};const Hw=pn.default;let Ww=class extends Hw{constructor(){super(),this.updates=[]}async initialize(){}async update(){throw new Error("BaseFilter - no update method specified")}addResults(e){this.updates=this.updates.concat(e),e.forEach(r=>this.emit("update",r))}addInitialResults(e){}getChangesAndClear(){const e=this.updates;return this.updates=[],e}};var Hu=Ww;const Vw=Hu;let zw=class extends Vw{constructor(){super(),this.allResults=[]}async update(){throw new Error("BaseFilterWithHistory - no update method specified")}addResults(e){this.allResults=this.allResults.concat(e),super.addResults(e)}addInitialResults(e){this.allResults=this.allResults.concat(e),super.addInitialResults(e)}getAllResults(){return this.allResults}};var qw=zw,ts={minBlockRef:Gw,maxBlockRef:Jw,sortBlockRefs:Wu,bnToHex:Zw,blockRefIsNumber:Qw,hexToInt:Os,incrementHexInt:Yw,intToHex:Id,unsafeRandomBytes:Kw};function Gw(...t){return Wu(t)[0]}function Jw(...t){const e=Wu(t);return e[e.length-1]}function Wu(t){return t.sort((e,r)=>e==="latest"||r==="earliest"?1:r==="latest"||e==="earliest"?-1:Os(e)-Os(r))}function Zw(t){return"0x"+t.toString(16)}function Qw(t){return t&&!["earliest","latest","pending"].includes(t)}function Os(t){return t==null?t:Number.parseInt(t,16)}function Yw(t){if(t==null)return t;const e=Os(t);return Id(e+1)}function Id(t){if(t==null)return t;let e=t.toString(16);return e.length%2&&(e="0"+e),"0x"+e}function Kw(t){let e="0x";for(let r=0;r<t;r++)e+=Pl(),e+=Pl();return e}function Pl(){return Math.floor(Math.random()*16).toString(16)}const Xw=$w,e2=Uw,t2=qw,{bnToHex:wC,hexToInt:vs,incrementHexInt:r2,minBlockRef:n2,blockRefIsNumber:i2}=ts;let s2=class extends t2{constructor({provider:e,params:r}){super(),this.type="log",this.ethQuery=new Xw(e),this.params=Object.assign({fromBlock:"latest",toBlock:"latest",address:void 0,topics:[]},r),this.params.address&&(Array.isArray(this.params.address)||(this.params.address=[this.params.address]),this.params.address=this.params.address.map(n=>n.toLowerCase()))}async initialize({currentBlock:e}){let r=this.params.fromBlock;["latest","pending"].includes(r)&&(r=e),r==="earliest"&&(r="0x0"),this.params.fromBlock=r;const n=n2(this.params.toBlock,e),i=Object.assign({},this.params,{toBlock:n}),s=await this._fetchLogs(i);this.addInitialResults(s)}async update({oldBlock:e,newBlock:r}){const n=r;let i;e?i=r2(e):i=r;const s=Object.assign({},this.params,{fromBlock:i,toBlock:n}),a=(await this._fetchLogs(s)).filter(c=>this.matchLog(c));this.addResults(a)}async _fetchLogs(e){return await e2(n=>this.ethQuery.getLogs(e,n))()}matchLog(e){if(vs(this.params.fromBlock)>=vs(e.blockNumber)||i2(this.params.toBlock)&&vs(this.params.toBlock)<=vs(e.blockNumber))return!1;const r=e.address&&e.address.toLowerCase();return this.params.address&&r&&!this.params.address.includes(r)?!1:this.params.topics.every((i,s)=>{let o=e.topics[s];if(!o)return!1;o=o.toLowerCase();let a=Array.isArray(i)?i:[i];return a.includes(null)?!0:(a=a.map(p=>p.toLowerCase()),a.includes(o))})}};var o2=s2,Vu=a2;async function a2({provider:t,fromBlock:e,toBlock:r}){e||(e=r);const n=Dl(e),s=Dl(r)-n+1,o=Array(s).fill().map((c,l)=>n+l).map(u2);return await Promise.all(o.map(c=>l2(t,"eth_getBlockByNumber",[c,!1])))}function Dl(t){return t==null?t:Number.parseInt(t,16)}function u2(t){return t==null?t:"0x"+t.toString(16)}function c2(t,e){return new Promise((r,n)=>{t.sendAsync(e,(i,s)=>{i?n(i):s.error?n(s.error):s.result?r(s.result):n(new Error("Result was empty"))})})}async function l2(t,e,r){for(let n=0;n<3;n++)try{return await c2(t,{id:1,jsonrpc:"2.0",method:e,params:r})}catch(i){console.error(`provider.sendAsync failed: ${i.stack||i.message||i}`)}throw new Error(`Block not found for params: ${JSON.stringify(r)}`)}const h2=Hu,f2=Vu,{incrementHexInt:d2}=ts;let p2=class extends h2{constructor({provider:e,params:r}){super(),this.type="block",this.provider=e}async update({oldBlock:e,newBlock:r}){const n=r,i=d2(e),o=(await f2({provider:this.provider,fromBlock:i,toBlock:n})).map(a=>a.hash);this.addResults(o)}};var g2=p2;const b2=Hu,v2=Vu,{incrementHexInt:m2}=ts;let y2=class extends b2{constructor({provider:e}){super(),this.type="tx",this.provider=e}async update({oldBlock:e}){const r=e,n=m2(e),i=await v2({provider:this.provider,fromBlock:n,toBlock:r}),s=[];for(const o of i)s.push(...o.transactions);this.addResults(s)}};var _2=y2;const w2=id.Mutex,{createAsyncMiddleware:E2,createScaffoldMiddleware:S2}=ju,x2=o2,M2=g2,C2=_2,{intToHex:Rd,hexToInt:xa}=ts;var I2=R2;function R2({blockTracker:t,provider:e}){let r=0,n={};const i=new w2,s=A2({mutex:i}),o=S2({eth_newFilter:s(Ma(c)),eth_newBlockFilter:s(Ma(l)),eth_newPendingTransactionFilter:s(Ma(p)),eth_uninstallFilter:s(xs(I)),eth_getFilterChanges:s(xs(g)),eth_getFilterLogs:s(xs(y))}),a=async({oldBlock:N,newBlock:j})=>{if(n.length===0)return;const H=await i.acquire();try{await Promise.all(On(n).map(async F=>{try{await F.update({oldBlock:N,newBlock:j})}catch(z){console.error(z)}}))}catch(F){console.error(F)}H()};return o.newLogFilter=c,o.newBlockFilter=l,o.newPendingTransactionFilter=p,o.uninstallFilter=I,o.getFilterChanges=g,o.getFilterLogs=y,o.destroy=()=>{U()},o;async function c(N){const j=new x2({provider:e,params:N});return await T(j),j}async function l(){const N=new M2({provider:e});return await T(N),N}async function p(){const N=new C2({provider:e});return await T(N),N}async function g(N){const j=xa(N),H=n[j];if(!H)throw new Error(`No filter for index "${j}"`);return H.getChangesAndClear()}async function y(N){const j=xa(N),H=n[j];if(!H)throw new Error(`No filter for index "${j}"`);let F=[];return H.type==="log"&&(F=H.getAllResults()),F}async function I(N){const j=xa(N),F=!!n[j];return F&&await D(j),F}async function T(N){const j=On(n).length,H=await t.getLatestBlock();await N.initialize({currentBlock:H}),r++,n[r]=N,N.id=r,N.idHex=Rd(r);const F=On(n).length;return M({prevFilterCount:j,newFilterCount:F}),r}async function D(N){const j=On(n).length;delete n[N];const H=On(n).length;M({prevFilterCount:j,newFilterCount:H})}async function U(){const N=On(n).length;n={},M({prevFilterCount:N,newFilterCount:0})}function M({prevFilterCount:N,newFilterCount:j}){if(N===0&&j>0){t.on("sync",a);return}if(N>0&&j===0){t.removeListener("sync",a);return}}}function Ma(t){return xs(async(...e)=>{const r=await t(...e);return Rd(r.id)})}function xs(t){return E2(async(e,r)=>{const n=await t.apply(null,e.params);r.result=n})}function A2({mutex:t}){return e=>async(r,n,i,s)=>{(await t.acquire())(),e(r,n,i,s)}}function On(t,e){const r=[];for(let n in t)r.push(t[n]);return r}const T2=pn.default,{createAsyncMiddleware:jl,createScaffoldMiddleware:k2}=ju,N2=I2,{unsafeRandomBytes:O2,incrementHexInt:L2}=ts,B2=Vu;var P2=D2;function D2({blockTracker:t,provider:e}){const r={},n=N2({blockTracker:t,provider:e});let i=!1;const s=new T2,o=k2({eth_subscribe:jl(a),eth_unsubscribe:jl(c)});return o.destroy=p,{events:s,middleware:o};async function a(g,y){if(i)throw new Error("SubscriptionManager - attempting to use after destroying");const I=g.params[0],T=O2(16);let D;switch(I){case"newHeads":D=U({subId:T});break;case"logs":const N=g.params[1],j=await n.newLogFilter(N);D=M({subId:T,filter:j});break;default:throw new Error(`SubscriptionManager - unsupported subscription type "${I}"`)}r[T]=D,y.result=T;return;function U({subId:N}){const j={type:I,destroy:async()=>{t.removeListener("sync",j.update)},update:async({oldBlock:H,newBlock:F})=>{const z=F,X=L2(H);(await B2({provider:e,fromBlock:X,toBlock:z})).map(j2).filter(ne=>ne!==null).forEach(ne=>{l(N,ne)})}};return t.on("sync",j.update),j}function M({subId:N,filter:j}){return j.on("update",F=>l(N,F)),{type:I,destroy:async()=>await n.uninstallFilter(j.idHex)}}}async function c(g,y){if(i)throw new Error("SubscriptionManager - attempting to use after destroying");const I=g.params[0],T=r[I];if(!T){y.result=!1;return}delete r[I],await T.destroy(),y.result=!0}function l(g,y){s.emit("notification",{jsonrpc:"2.0",method:"eth_subscription",params:{subscription:g,result:y}})}function p(){s.removeAllListeners();for(const g in r)r[g].destroy(),delete r[g];i=!0}}function j2(t){return t==null?null:{hash:t.hash,parentHash:t.parentHash,sha3Uncles:t.sha3Uncles,miner:t.miner,stateRoot:t.stateRoot,transactionsRoot:t.transactionsRoot,receiptsRoot:t.receiptsRoot,logsBloom:t.logsBloom,difficulty:t.difficulty,number:t.number,gasLimit:t.gasLimit,gasUsed:t.gasUsed,nonce:t.nonce,mixHash:t.mixHash,timestamp:t.timestamp,extraData:t.extraData}}Object.defineProperty(ro,"__esModule",{value:!0});ro.SubscriptionManager=void 0;const $2=Ef,F2=P2,$l=()=>{};class U2{constructor(e){const r=new $2.PollingBlockTracker({provider:e,pollingInterval:15e3,setSkipCacheFlag:!0}),{events:n,middleware:i}=F2({blockTracker:r,provider:e});this.events=n,this.subscriptionMiddleware=i}async handleRequest(e){const r={};return await this.subscriptionMiddleware(e,r,$l,$l),r}destroy(){this.subscriptionMiddleware.destroy()}}ro.SubscriptionManager=U2;var zu=te&&te.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(zn,"__esModule",{value:!0});zn.CoinbaseWalletProvider=void 0;const H2=zu(pn),W2=zu(zs),Ca=oi,Le=ji,Fl=ui,Ul=Kt,Ia=Gs,V2=Pe,me=re,Ra=zu(yv),z2=Jn,Ae=wf,q2=ro,Hl="DefaultChainId",Wl="DefaultJsonRpcUrl";class G2 extends H2.default{constructor(e){var r,n;super(),this._filterPolyfill=new z2.FilterPolyfill(this),this._subscriptionManager=new q2.SubscriptionManager(this),this._relay=null,this._addresses=[],this.hasMadeFirstChainChangedEmission=!1,this.setProviderInfo=this.setProviderInfo.bind(this),this.updateProviderInfo=this.updateProviderInfo.bind(this),this.getChainId=this.getChainId.bind(this),this.setAppInfo=this.setAppInfo.bind(this),this.enable=this.enable.bind(this),this.close=this.close.bind(this),this.send=this.send.bind(this),this.sendAsync=this.sendAsync.bind(this),this.request=this.request.bind(this),this._setAddresses=this._setAddresses.bind(this),this.scanQRCode=this.scanQRCode.bind(this),this.genericRequest=this.genericRequest.bind(this),this._chainIdFromOpts=e.chainId,this._jsonRpcUrlFromOpts=e.jsonRpcUrl,this._overrideIsMetaMask=e.overrideIsMetaMask,this._relayProvider=e.relayProvider,this._storage=e.storage,this._relayEventManager=e.relayEventManager,this.diagnostic=e.diagnosticLogger,this.reloadOnDisconnect=!0,this.isCoinbaseWallet=(r=e.overrideIsCoinbaseWallet)!==null&&r!==void 0?r:!0,this.isCoinbaseBrowser=(n=e.overrideIsCoinbaseBrowser)!==null&&n!==void 0?n:!1,this.qrUrl=e.qrUrl;const i=this.getChainId(),s=(0,me.prepend0x)(i.toString(16));this.emit("connect",{chainIdStr:s});const o=this._storage.getItem(Ul.LOCAL_STORAGE_ADDRESSES_KEY);if(o){const a=o.split(" ");a[0]!==""&&(this._addresses=a.map(c=>(0,me.ensureAddressString)(c)),this.emit("accountsChanged",a))}this._subscriptionManager.events.on("notification",a=>{this.emit("message",{type:a.method,data:a.params})}),this._isAuthorized()&&this.initializeRelay(),window.addEventListener("message",a=>{var c;if(!(a.origin!==location.origin||a.source!==window)&&a.data.type==="walletLinkMessage"){if(a.data.data.action==="dappChainSwitched"){const l=a.data.data.chainId,p=(c=a.data.data.jsonRpcUrl)!==null&&c!==void 0?c:this.jsonRpcUrl;this.updateProviderInfo(p,Number(l))}a.data.data.action==="addressChanged"&&this._setAddresses([a.data.data.address])}})}get selectedAddress(){return this._addresses[0]||void 0}get networkVersion(){return this.getChainId().toString(10)}get chainId(){return(0,me.prepend0x)(this.getChainId().toString(16))}get isWalletLink(){return!0}get isMetaMask(){return this._overrideIsMetaMask}get host(){return this.jsonRpcUrl}get connected(){return!0}isConnected(){return!0}get jsonRpcUrl(){var e;return(e=this._storage.getItem(Wl))!==null&&e!==void 0?e:this._jsonRpcUrlFromOpts}set jsonRpcUrl(e){this._storage.setItem(Wl,e)}disableReloadOnDisconnect(){this.reloadOnDisconnect=!1}setProviderInfo(e,r){this.isCoinbaseBrowser||(this._chainIdFromOpts=r,this._jsonRpcUrlFromOpts=e),this.updateProviderInfo(this.jsonRpcUrl,this.getChainId())}updateProviderInfo(e,r){this.jsonRpcUrl=e;const n=this.getChainId();this._storage.setItem(Hl,r.toString(10)),((0,me.ensureIntNumber)(r)!==n||!this.hasMadeFirstChainChangedEmission)&&(this.emit("chainChanged",this.getChainId()),this.hasMadeFirstChainChangedEmission=!0)}async watchAsset(e,r,n,i,s,o){return!!(await(await this.initializeRelay()).watchAsset(e,r,n,i,s,o==null?void 0:o.toString()).promise).result}async addEthereumChain(e,r,n,i,s,o){var a,c;if((0,me.ensureIntNumber)(e)===this.getChainId())return!1;const l=await this.initializeRelay(),p=l.inlineAddEthereumChain(e.toString());!this._isAuthorized()&&!p&&await l.requestEthereumAccounts().promise;const g=await l.addEthereumChain(e.toString(),r,s,n,i,o).promise;return((a=g.result)===null||a===void 0?void 0:a.isApproved)===!0&&this.updateProviderInfo(r[0],e),((c=g.result)===null||c===void 0?void 0:c.isApproved)===!0}async switchEthereumChain(e){const n=await(await this.initializeRelay()).switchEthereumChain(e.toString(10),this.selectedAddress||void 0).promise;if((0,V2.isErrorResponse)(n)&&n.errorCode)throw n.errorCode===Le.standardErrorCodes.provider.unsupportedChain?Le.standardErrors.provider.unsupportedChain(e):Le.standardErrors.provider.custom({message:n.errorMessage,code:n.errorCode});const i=n.result;i.isApproved&&i.rpcUrl.length>0&&this.updateProviderInfo(i.rpcUrl,e)}setAppInfo(e,r){this.initializeRelay().then(n=>n.setAppInfo(e,r))}async enable(){var e;return(e=this.diagnostic)===null||e===void 0||e.log(Ca.EVENTS.ETH_ACCOUNTS_STATE,{method:"provider::enable",addresses_length:this._addresses.length,sessionIdHash:this._relay?Fl.Session.hash(this._relay.session.id):void 0}),this._isAuthorized()?[...this._addresses]:await this.send(Ae.JSONRPCMethod.eth_requestAccounts)}async close(){(await this.initializeRelay()).resetAndReload()}send(e,r){try{const n=this._send(e,r);if(n instanceof Promise)return n.catch(i=>{throw(0,Le.serializeError)(i,e)})}catch(n){throw(0,Le.serializeError)(n,e)}}_send(e,r){if(typeof e=="string"){const i=e,s=Array.isArray(r)?r:r!==void 0?[r]:[],o={jsonrpc:"2.0",id:0,method:i,params:s};return this._sendRequestAsync(o).then(a=>a.result)}if(typeof r=="function"){const i=e,s=r;return this._sendAsync(i,s)}if(Array.isArray(e))return e.map(s=>this._sendRequest(s));const n=e;return this._sendRequest(n)}async sendAsync(e,r){try{return this._sendAsync(e,r).catch(n=>{throw(0,Le.serializeError)(n,e)})}catch(n){return Promise.reject((0,Le.serializeError)(n,e))}}async _sendAsync(e,r){if(typeof r!="function")throw new Error("callback is required");if(Array.isArray(e)){const i=r;this._sendMultipleRequestsAsync(e).then(s=>i(null,s)).catch(s=>i(s,null));return}const n=r;return this._sendRequestAsync(e).then(i=>n(null,i)).catch(i=>n(i,null))}async request(e){try{return this._request(e).catch(r=>{throw(0,Le.serializeError)(r,e.method)})}catch(r){return Promise.reject((0,Le.serializeError)(r,e.method))}}async _request(e){if(!e||typeof e!="object"||Array.isArray(e))throw Le.standardErrors.rpc.invalidRequest({message:"Expected a single, non-array, object argument.",data:e});const{method:r,params:n}=e;if(typeof r!="string"||r.length===0)throw Le.standardErrors.rpc.invalidRequest({message:"'args.method' must be a non-empty string.",data:e});if(n!==void 0&&!Array.isArray(n)&&(typeof n!="object"||n===null))throw Le.standardErrors.rpc.invalidRequest({message:"'args.params' must be an object or array if provided.",data:e});const i=n===void 0?[]:n,s=this._relayEventManager.makeRequestId();return(await this._sendRequestAsync({method:r,params:i,jsonrpc:"2.0",id:s})).result}async scanQRCode(e){var r;const i=await(await this.initializeRelay()).scanQRCode((0,me.ensureRegExpString)(e)).promise;if(typeof i.result!="string")throw(0,Le.serializeError)((r=i.errorMessage)!==null&&r!==void 0?r:"result was not a string",Ia.Web3Method.scanQRCode);return i.result}async genericRequest(e,r){var n;const s=await(await this.initializeRelay()).genericRequest(e,r).promise;if(typeof s.result!="string")throw(0,Le.serializeError)((n=s.errorMessage)!==null&&n!==void 0?n:"result was not a string",Ia.Web3Method.generic);return s.result}async selectProvider(e){var r;const i=await(await this.initializeRelay()).selectProvider(e).promise;if(typeof i.result!="string")throw(0,Le.serializeError)((r=i.errorMessage)!==null&&r!==void 0?r:"result was not a string",Ia.Web3Method.selectProvider);return i.result}supportsSubscriptions(){return!1}subscribe(){throw new Error("Subscriptions are not supported")}unsubscribe(){throw new Error("Subscriptions are not supported")}disconnect(){return!0}_sendRequest(e){const r={jsonrpc:"2.0",id:e.id},{method:n}=e;if(r.result=this._handleSynchronousMethods(e),r.result===void 0)throw new Error(`Coinbase Wallet does not support calling ${n} synchronously without a callback. Please provide a callback parameter to call ${n} asynchronously.`);return r}_setAddresses(e,r){if(!Array.isArray(e))throw new Error("addresses is not an array");const n=e.map(i=>(0,me.ensureAddressString)(i));JSON.stringify(n)!==JSON.stringify(this._addresses)&&(this._addresses=n,this.emit("accountsChanged",this._addresses),this._storage.setItem(Ul.LOCAL_STORAGE_ADDRESSES_KEY,n.join(" ")))}_sendRequestAsync(e){return new Promise((r,n)=>{try{const i=this._handleSynchronousMethods(e);if(i!==void 0)return r({jsonrpc:"2.0",id:e.id,result:i});const s=this._handleAsynchronousFilterMethods(e);if(s!==void 0){s.then(a=>r(Object.assign(Object.assign({},a),{id:e.id}))).catch(a=>n(a));return}const o=this._handleSubscriptionMethods(e);if(o!==void 0){o.then(a=>r({jsonrpc:"2.0",id:e.id,result:a.result})).catch(a=>n(a));return}}catch(i){return n(i)}this._handleAsynchronousMethods(e).then(i=>i&&r(Object.assign(Object.assign({},i),{id:e.id}))).catch(i=>n(i))})}_sendMultipleRequestsAsync(e){return Promise.all(e.map(r=>this._sendRequestAsync(r)))}_handleSynchronousMethods(e){const{method:r}=e,n=e.params||[];switch(r){case Ae.JSONRPCMethod.eth_accounts:return this._eth_accounts();case Ae.JSONRPCMethod.eth_coinbase:return this._eth_coinbase();case Ae.JSONRPCMethod.eth_uninstallFilter:return this._eth_uninstallFilter(n);case Ae.JSONRPCMethod.net_version:return this._net_version();case Ae.JSONRPCMethod.eth_chainId:return this._eth_chainId();default:return}}async _handleAsynchronousMethods(e){const{method:r}=e,n=e.params||[];switch(r){case Ae.JSONRPCMethod.eth_requestAccounts:return this._eth_requestAccounts();case Ae.JSONRPCMethod.eth_sign:return this._eth_sign(n);case Ae.JSONRPCMethod.eth_ecRecover:return this._eth_ecRecover(n);case Ae.JSONRPCMethod.personal_sign:return this._personal_sign(n);case Ae.JSONRPCMethod.personal_ecRecover:return this._personal_ecRecover(n);case Ae.JSONRPCMethod.eth_signTransaction:return this._eth_signTransaction(n);case Ae.JSONRPCMethod.eth_sendRawTransaction:return this._eth_sendRawTransaction(n);case Ae.JSONRPCMethod.eth_sendTransaction:return this._eth_sendTransaction(n);case Ae.JSONRPCMethod.eth_signTypedData_v1:return this._eth_signTypedData_v1(n);case Ae.JSONRPCMethod.eth_signTypedData_v2:return this._throwUnsupportedMethodError();case Ae.JSONRPCMethod.eth_signTypedData_v3:return this._eth_signTypedData_v3(n);case Ae.JSONRPCMethod.eth_signTypedData_v4:case Ae.JSONRPCMethod.eth_signTypedData:return this._eth_signTypedData_v4(n);case Ae.JSONRPCMethod.cbWallet_arbitrary:return this._cbwallet_arbitrary(n);case Ae.JSONRPCMethod.wallet_addEthereumChain:return this._wallet_addEthereumChain(n);case Ae.JSONRPCMethod.wallet_switchEthereumChain:return this._wallet_switchEthereumChain(n);case Ae.JSONRPCMethod.wallet_watchAsset:return this._wallet_watchAsset(n)}return(await this.initializeRelay()).makeEthereumJSONRPCRequest(e,this.jsonRpcUrl)}_handleAsynchronousFilterMethods(e){const{method:r}=e,n=e.params||[];switch(r){case Ae.JSONRPCMethod.eth_newFilter:return this._eth_newFilter(n);case Ae.JSONRPCMethod.eth_newBlockFilter:return this._eth_newBlockFilter();case Ae.JSONRPCMethod.eth_newPendingTransactionFilter:return this._eth_newPendingTransactionFilter();case Ae.JSONRPCMethod.eth_getFilterChanges:return this._eth_getFilterChanges(n);case Ae.JSONRPCMethod.eth_getFilterLogs:return this._eth_getFilterLogs(n)}}_handleSubscriptionMethods(e){switch(e.method){case Ae.JSONRPCMethod.eth_subscribe:case Ae.JSONRPCMethod.eth_unsubscribe:return this._subscriptionManager.handleRequest(e)}}_isKnownAddress(e){try{const r=(0,me.ensureAddressString)(e);return this._addresses.map(i=>(0,me.ensureAddressString)(i)).includes(r)}catch{}return!1}_ensureKnownAddress(e){var r;if(!this._isKnownAddress(e))throw(r=this.diagnostic)===null||r===void 0||r.log(Ca.EVENTS.UNKNOWN_ADDRESS_ENCOUNTERED),new Error("Unknown Ethereum address")}_prepareTransactionParams(e){const r=e.from?(0,me.ensureAddressString)(e.from):this.selectedAddress;if(!r)throw new Error("Ethereum address is unavailable");this._ensureKnownAddress(r);const n=e.to?(0,me.ensureAddressString)(e.to):null,i=e.value!=null?(0,me.ensureBN)(e.value):new W2.default(0),s=e.data?(0,me.ensureBuffer)(e.data):ye.alloc(0),o=e.nonce!=null?(0,me.ensureIntNumber)(e.nonce):null,a=e.gasPrice!=null?(0,me.ensureBN)(e.gasPrice):null,c=e.maxFeePerGas!=null?(0,me.ensureBN)(e.maxFeePerGas):null,l=e.maxPriorityFeePerGas!=null?(0,me.ensureBN)(e.maxPriorityFeePerGas):null,p=e.gas!=null?(0,me.ensureBN)(e.gas):null,g=this.getChainId();return{fromAddress:r,toAddress:n,weiValue:i,data:s,nonce:o,gasPriceInWei:a,maxFeePerGas:c,maxPriorityFeePerGas:l,gasLimit:p,chainId:g}}_isAuthorized(){return this._addresses.length>0}_requireAuthorization(){if(!this._isAuthorized())throw Le.standardErrors.provider.unauthorized({})}_throwUnsupportedMethodError(){throw Le.standardErrors.provider.unsupportedMethod({})}async _signEthereumMessage(e,r,n,i){this._ensureKnownAddress(r);try{return{jsonrpc:"2.0",id:0,result:(await(await this.initializeRelay()).signEthereumMessage(e,r,n,i).promise).result}}catch(s){throw typeof s.message=="string"&&s.message.match(/(denied|rejected)/i)?Le.standardErrors.provider.userRejectedRequest("User denied message signature"):s}}async _ethereumAddressFromSignedMessage(e,r,n){return{jsonrpc:"2.0",id:0,result:(await(await this.initializeRelay()).ethereumAddressFromSignedMessage(e,r,n).promise).result}}_eth_accounts(){return[...this._addresses]}_eth_coinbase(){return this.selectedAddress||null}_net_version(){return this.getChainId().toString(10)}_eth_chainId(){return(0,me.hexStringFromIntNumber)(this.getChainId())}getChainId(){const e=this._storage.getItem(Hl);if(!e)return(0,me.ensureIntNumber)(this._chainIdFromOpts);const r=parseInt(e,10);return(0,me.ensureIntNumber)(r)}async _eth_requestAccounts(){var e;if((e=this.diagnostic)===null||e===void 0||e.log(Ca.EVENTS.ETH_ACCOUNTS_STATE,{method:"provider::_eth_requestAccounts",addresses_length:this._addresses.length,sessionIdHash:this._relay?Fl.Session.hash(this._relay.session.id):void 0}),this._isAuthorized())return Promise.resolve({jsonrpc:"2.0",id:0,result:this._addresses});let r;try{r=await(await this.initializeRelay()).requestEthereumAccounts().promise}catch(n){throw typeof n.message=="string"&&n.message.match(/(denied|rejected)/i)?Le.standardErrors.provider.userRejectedRequest("User denied account authorization"):n}if(!r.result)throw new Error("accounts received is empty");return this._setAddresses(r.result),this.isCoinbaseBrowser||await this.switchEthereumChain(this.getChainId()),{jsonrpc:"2.0",id:0,result:this._addresses}}_eth_sign(e){this._requireAuthorization();const r=(0,me.ensureAddressString)(e[0]),n=(0,me.ensureBuffer)(e[1]);return this._signEthereumMessage(n,r,!1)}_eth_ecRecover(e){const r=(0,me.ensureBuffer)(e[0]),n=(0,me.ensureBuffer)(e[1]);return this._ethereumAddressFromSignedMessage(r,n,!1)}_personal_sign(e){this._requireAuthorization();const r=(0,me.ensureBuffer)(e[0]),n=(0,me.ensureAddressString)(e[1]);return this._signEthereumMessage(r,n,!0)}_personal_ecRecover(e){const r=(0,me.ensureBuffer)(e[0]),n=(0,me.ensureBuffer)(e[1]);return this._ethereumAddressFromSignedMessage(r,n,!0)}async _eth_signTransaction(e){this._requireAuthorization();const r=this._prepareTransactionParams(e[0]||{});try{return{jsonrpc:"2.0",id:0,result:(await(await this.initializeRelay()).signEthereumTransaction(r).promise).result}}catch(n){throw typeof n.message=="string"&&n.message.match(/(denied|rejected)/i)?Le.standardErrors.provider.userRejectedRequest("User denied transaction signature"):n}}async _eth_sendRawTransaction(e){const r=(0,me.ensureBuffer)(e[0]);return{jsonrpc:"2.0",id:0,result:(await(await this.initializeRelay()).submitEthereumTransaction(r,this.getChainId()).promise).result}}async _eth_sendTransaction(e){this._requireAuthorization();const r=this._prepareTransactionParams(e[0]||{});try{return{jsonrpc:"2.0",id:0,result:(await(await this.initializeRelay()).signAndSubmitEthereumTransaction(r).promise).result}}catch(n){throw typeof n.message=="string"&&n.message.match(/(denied|rejected)/i)?Le.standardErrors.provider.userRejectedRequest("User denied transaction signature"):n}}async _eth_signTypedData_v1(e){this._requireAuthorization();const r=(0,me.ensureParsedJSONObject)(e[0]),n=(0,me.ensureAddressString)(e[1]);this._ensureKnownAddress(n);const i=Ra.default.hashForSignTypedDataLegacy({data:r}),s=JSON.stringify(r,null,2);return this._signEthereumMessage(i,n,!1,s)}async _eth_signTypedData_v3(e){this._requireAuthorization();const r=(0,me.ensureAddressString)(e[0]),n=(0,me.ensureParsedJSONObject)(e[1]);this._ensureKnownAddress(r);const i=Ra.default.hashForSignTypedData_v3({data:n}),s=JSON.stringify(n,null,2);return this._signEthereumMessage(i,r,!1,s)}async _eth_signTypedData_v4(e){this._requireAuthorization();const r=(0,me.ensureAddressString)(e[0]),n=(0,me.ensureParsedJSONObject)(e[1]);this._ensureKnownAddress(r);const i=Ra.default.hashForSignTypedData_v4({data:n}),s=JSON.stringify(n,null,2);return this._signEthereumMessage(i,r,!1,s)}async _cbwallet_arbitrary(e){const r=e[0],n=e[1];if(typeof n!="string")throw new Error("parameter must be a string");if(typeof r!="object"||r===null)throw new Error("parameter must be an object");return{jsonrpc:"2.0",id:0,result:await this.genericRequest(r,n)}}async _wallet_addEthereumChain(e){var r,n,i,s;const o=e[0];if(((r=o.rpcUrls)===null||r===void 0?void 0:r.length)===0)return{jsonrpc:"2.0",id:0,error:{code:2,message:"please pass in at least 1 rpcUrl"}};if(!o.chainName||o.chainName.trim()==="")throw Le.standardErrors.rpc.invalidParams("chainName is a required field");if(!o.nativeCurrency)throw Le.standardErrors.rpc.invalidParams("nativeCurrency is a required field");const a=parseInt(o.chainId,16);return await this.addEthereumChain(a,(n=o.rpcUrls)!==null&&n!==void 0?n:[],(i=o.blockExplorerUrls)!==null&&i!==void 0?i:[],o.chainName,(s=o.iconUrls)!==null&&s!==void 0?s:[],o.nativeCurrency)?{jsonrpc:"2.0",id:0,result:null}:{jsonrpc:"2.0",id:0,error:{code:2,message:"unable to add ethereum chain"}}}async _wallet_switchEthereumChain(e){const r=e[0];return await this.switchEthereumChain(parseInt(r.chainId,16)),{jsonrpc:"2.0",id:0,result:null}}async _wallet_watchAsset(e){const r=Array.isArray(e)?e[0]:e;if(!r.type)throw Le.standardErrors.rpc.invalidParams("Type is required");if((r==null?void 0:r.type)!=="ERC20")throw Le.standardErrors.rpc.invalidParams(`Asset of type '${r.type}' is not supported`);if(!(r!=null&&r.options))throw Le.standardErrors.rpc.invalidParams("Options are required");if(!(r!=null&&r.options.address))throw Le.standardErrors.rpc.invalidParams("Address is required");const n=this.getChainId(),{address:i,symbol:s,image:o,decimals:a}=r.options;return{jsonrpc:"2.0",id:0,result:await this.watchAsset(r.type,i,s,a,o,n)}}_eth_uninstallFilter(e){const r=(0,me.ensureHexString)(e[0]);return this._filterPolyfill.uninstallFilter(r)}async _eth_newFilter(e){const r=e[0];return{jsonrpc:"2.0",id:0,result:await this._filterPolyfill.newFilter(r)}}async _eth_newBlockFilter(){return{jsonrpc:"2.0",id:0,result:await this._filterPolyfill.newBlockFilter()}}async _eth_newPendingTransactionFilter(){return{jsonrpc:"2.0",id:0,result:await this._filterPolyfill.newPendingTransactionFilter()}}_eth_getFilterChanges(e){const r=(0,me.ensureHexString)(e[0]);return this._filterPolyfill.getFilterChanges(r)}_eth_getFilterLogs(e){const r=(0,me.ensureHexString)(e[0]);return this._filterPolyfill.getFilterLogs(r)}initializeRelay(){return this._relay?Promise.resolve(this._relay):this._relayProvider().then(e=>(e.setAccountsCallback((r,n)=>this._setAddresses(r,n)),e.setChainCallback((r,n)=>{this.updateProviderInfo(n,parseInt(r,10))}),e.setDappDefaultChainCallback(this._chainIdFromOpts),this._relay=e,e))}}zn.CoinbaseWalletProvider=G2;var wo={},Eo={},rs,ve,Ad,Td,sn,Vl,kd,Za,Nd,Wn={},Od=[],J2=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,So=Array.isArray;function yr(t,e){for(var r in e)t[r]=e[r];return t}function Ld(t){var e=t.parentNode;e&&e.removeChild(t)}function Qa(t,e,r){var n,i,s,o={};for(s in e)s=="key"?n=e[s]:s=="ref"?i=e[s]:o[s]=e[s];if(arguments.length>2&&(o.children=arguments.length>3?rs.call(arguments,2):r),typeof t=="function"&&t.defaultProps!=null)for(s in t.defaultProps)o[s]===void 0&&(o[s]=t.defaultProps[s]);return Ii(t,o,n,i,null)}function Ii(t,e,r,n,i){var s={type:t,props:e,key:r,ref:n,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,__h:null,constructor:void 0,__v:i??++Ad};return i==null&&ve.vnode!=null&&ve.vnode(s),s}function Z2(){return{current:null}}function ns(t){return t.children}function Ri(t,e){this.props=t,this.context=e}function Li(t,e){if(e==null)return t.__?Li(t.__,t.__.__k.indexOf(t)+1):null;for(var r;e<t.__k.length;e++)if((r=t.__k[e])!=null&&r.__e!=null)return r.__d||r.__e;return typeof t.type=="function"?Li(t):null}function Bd(t){var e,r;if((t=t.__)!=null&&t.__c!=null){for(t.__e=t.__c.base=null,e=0;e<t.__k.length;e++)if((r=t.__k[e])!=null&&r.__e!=null){t.__e=t.__c.base=r.__e;break}return Bd(t)}}function Ya(t){(!t.__d&&(t.__d=!0)&&sn.push(t)&&!Ls.__r++||Vl!==ve.debounceRendering)&&((Vl=ve.debounceRendering)||kd)(Ls)}function Ls(){var t,e,r,n,i,s,o,a,c;for(sn.sort(Za);t=sn.shift();)t.__d&&(e=sn.length,n=void 0,i=void 0,s=void 0,a=(o=(r=t).__v).__e,(c=r.__P)&&(n=[],i=[],(s=yr({},o)).__v=o.__v+1,qu(c,o,s,r.__n,c.ownerSVGElement!==void 0,o.__h!=null?[a]:null,n,a??Li(o),o.__h,i),Fd(n,o,i),o.__e!=a&&Bd(o)),sn.length>e&&sn.sort(Za));Ls.__r=0}function Pd(t,e,r,n,i,s,o,a,c,l,p){var g,y,I,T,D,U,M,N,j,H=0,F=n&&n.__k||Od,z=F.length,X=z,K=e.length;for(r.__k=[],g=0;g<K;g++)(T=r.__k[g]=(T=e[g])==null||typeof T=="boolean"||typeof T=="function"?null:typeof T=="string"||typeof T=="number"||typeof T=="bigint"?Ii(null,T,null,null,T):So(T)?Ii(ns,{children:T},null,null,null):T.__b>0?Ii(T.type,T.props,T.key,T.ref?T.ref:null,T.__v):T)!=null?(T.__=r,T.__b=r.__b+1,(N=Q2(T,F,M=g+H,X))===-1?I=Wn:(I=F[N]||Wn,F[N]=void 0,X--),qu(t,T,I,i,s,o,a,c,l,p),D=T.__e,(y=T.ref)&&I.ref!=y&&(I.ref&&Gu(I.ref,null,T),p.push(y,T.__c||D,T)),D!=null&&(U==null&&(U=D),(j=I===Wn||I.__v===null)?N==-1&&H--:N!==M&&(N===M+1?H++:N>M?X>K-M?H+=N-M:H--:H=N<M&&N==M-1?N-M:0),M=g+H,typeof T.type!="function"||N===M&&I.__k!==T.__k?typeof T.type=="function"||N===M&&!j?T.__d!==void 0?(c=T.__d,T.__d=void 0):c=D.nextSibling:c=$d(t,D,c):c=Dd(T,c,t),typeof r.type=="function"&&(r.__d=c))):(I=F[g])&&I.key==null&&I.__e&&(I.__e==c&&(I.__=n,c=Li(I)),Ka(I,I,!1),F[g]=null);for(r.__e=U,g=z;g--;)F[g]!=null&&(typeof r.type=="function"&&F[g].__e!=null&&F[g].__e==r.__d&&(r.__d=F[g].__e.nextSibling),Ka(F[g],F[g]))}function Dd(t,e,r){for(var n,i=t.__k,s=0;i&&s<i.length;s++)(n=i[s])&&(n.__=t,e=typeof n.type=="function"?Dd(n,e,r):$d(r,n.__e,e));return e}function jd(t,e){return e=e||[],t==null||typeof t=="boolean"||(So(t)?t.some(function(r){jd(r,e)}):e.push(t)),e}function $d(t,e,r){return r==null||r.parentNode!==t?t.insertBefore(e,null):e==r&&e.parentNode!=null||t.insertBefore(e,r),e.nextSibling}function Q2(t,e,r,n){var i=t.key,s=t.type,o=r-1,a=r+1,c=e[r];if(c===null||c&&i==c.key&&s===c.type)return r;if(n>(c!=null?1:0))for(;o>=0||a<e.length;){if(o>=0){if((c=e[o])&&i==c.key&&s===c.type)return o;o--}if(a<e.length){if((c=e[a])&&i==c.key&&s===c.type)return a;a++}}return-1}function Y2(t,e,r,n,i){var s;for(s in r)s==="children"||s==="key"||s in e||Bs(t,s,null,r[s],n);for(s in e)i&&typeof e[s]!="function"||s==="children"||s==="key"||s==="value"||s==="checked"||r[s]===e[s]||Bs(t,s,e[s],r[s],n)}function zl(t,e,r){e[0]==="-"?t.setProperty(e,r??""):t[e]=r==null?"":typeof r!="number"||J2.test(e)?r:r+"px"}function Bs(t,e,r,n,i){var s;e:if(e==="style")if(typeof r=="string")t.style.cssText=r;else{if(typeof n=="string"&&(t.style.cssText=n=""),n)for(e in n)r&&e in r||zl(t.style,e,"");if(r)for(e in r)n&&r[e]===n[e]||zl(t.style,e,r[e])}else if(e[0]==="o"&&e[1]==="n")s=e!==(e=e.replace(/(PointerCapture)$|Capture$/,"$1")),e=e.toLowerCase()in t?e.toLowerCase().slice(2):e.slice(2),t.l||(t.l={}),t.l[e+s]=r,r?n?r.u=n.u:(r.u=Date.now(),t.addEventListener(e,s?Gl:ql,s)):t.removeEventListener(e,s?Gl:ql,s);else if(e!=="dangerouslySetInnerHTML"){if(i)e=e.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if(e!=="width"&&e!=="height"&&e!=="href"&&e!=="list"&&e!=="form"&&e!=="tabIndex"&&e!=="download"&&e!=="rowSpan"&&e!=="colSpan"&&e!=="role"&&e in t)try{t[e]=r??"";break e}catch{}typeof r=="function"||(r==null||r===!1&&e[4]!=="-"?t.removeAttribute(e):t.setAttribute(e,r))}}function ql(t){var e=this.l[t.type+!1];if(t.t){if(t.t<=e.u)return}else t.t=Date.now();return e(ve.event?ve.event(t):t)}function Gl(t){return this.l[t.type+!0](ve.event?ve.event(t):t)}function qu(t,e,r,n,i,s,o,a,c,l){var p,g,y,I,T,D,U,M,N,j,H,F,z,X,K,J=e.type;if(e.constructor!==void 0)return null;r.__h!=null&&(c=r.__h,a=e.__e=r.__e,e.__h=null,s=[a]),(p=ve.__b)&&p(e);e:if(typeof J=="function")try{if(M=e.props,N=(p=J.contextType)&&n[p.__c],j=p?N?N.props.value:p.__:n,r.__c?U=(g=e.__c=r.__c).__=g.__E:("prototype"in J&&J.prototype.render?e.__c=g=new J(M,j):(e.__c=g=new Ri(M,j),g.constructor=J,g.render=X2),N&&N.sub(g),g.props=M,g.state||(g.state={}),g.context=j,g.__n=n,y=g.__d=!0,g.__h=[],g._sb=[]),g.__s==null&&(g.__s=g.state),J.getDerivedStateFromProps!=null&&(g.__s==g.state&&(g.__s=yr({},g.__s)),yr(g.__s,J.getDerivedStateFromProps(M,g.__s))),I=g.props,T=g.state,g.__v=e,y)J.getDerivedStateFromProps==null&&g.componentWillMount!=null&&g.componentWillMount(),g.componentDidMount!=null&&g.__h.push(g.componentDidMount);else{if(J.getDerivedStateFromProps==null&&M!==I&&g.componentWillReceiveProps!=null&&g.componentWillReceiveProps(M,j),!g.__e&&(g.shouldComponentUpdate!=null&&g.shouldComponentUpdate(M,g.__s,j)===!1||e.__v===r.__v)){for(e.__v!==r.__v&&(g.props=M,g.state=g.__s,g.__d=!1),e.__e=r.__e,e.__k=r.__k,e.__k.forEach(function(ne){ne&&(ne.__=e)}),H=0;H<g._sb.length;H++)g.__h.push(g._sb[H]);g._sb=[],g.__h.length&&o.push(g);break e}g.componentWillUpdate!=null&&g.componentWillUpdate(M,g.__s,j),g.componentDidUpdate!=null&&g.__h.push(function(){g.componentDidUpdate(I,T,D)})}if(g.context=j,g.props=M,g.__P=t,g.__e=!1,F=ve.__r,z=0,"prototype"in J&&J.prototype.render){for(g.state=g.__s,g.__d=!1,F&&F(e),p=g.render(g.props,g.state,g.context),X=0;X<g._sb.length;X++)g.__h.push(g._sb[X]);g._sb=[]}else do g.__d=!1,F&&F(e),p=g.render(g.props,g.state,g.context),g.state=g.__s;while(g.__d&&++z<25);g.state=g.__s,g.getChildContext!=null&&(n=yr(yr({},n),g.getChildContext())),y||g.getSnapshotBeforeUpdate==null||(D=g.getSnapshotBeforeUpdate(I,T)),Pd(t,So(K=p!=null&&p.type===ns&&p.key==null?p.props.children:p)?K:[K],e,r,n,i,s,o,a,c,l),g.base=e.__e,e.__h=null,g.__h.length&&o.push(g),U&&(g.__E=g.__=null)}catch(ne){e.__v=null,(c||s!=null)&&(e.__e=a,e.__h=!!c,s[s.indexOf(a)]=null),ve.__e(ne,e,r)}else s==null&&e.__v===r.__v?(e.__k=r.__k,e.__e=r.__e):e.__e=K2(r.__e,e,r,n,i,s,o,c,l);(p=ve.diffed)&&p(e)}function Fd(t,e,r){for(var n=0;n<r.length;n++)Gu(r[n],r[++n],r[++n]);ve.__c&&ve.__c(e,t),t.some(function(i){try{t=i.__h,i.__h=[],t.some(function(s){s.call(i)})}catch(s){ve.__e(s,i.__v)}})}function K2(t,e,r,n,i,s,o,a,c){var l,p,g,y=r.props,I=e.props,T=e.type,D=0;if(T==="svg"&&(i=!0),s!=null){for(;D<s.length;D++)if((l=s[D])&&"setAttribute"in l==!!T&&(T?l.localName===T:l.nodeType===3)){t=l,s[D]=null;break}}if(t==null){if(T===null)return document.createTextNode(I);t=i?document.createElementNS("http://www.w3.org/2000/svg",T):document.createElement(T,I.is&&I),s=null,a=!1}if(T===null)y===I||a&&t.data===I||(t.data=I);else{if(s=s&&rs.call(t.childNodes),p=(y=r.props||Wn).dangerouslySetInnerHTML,g=I.dangerouslySetInnerHTML,!a){if(s!=null)for(y={},D=0;D<t.attributes.length;D++)y[t.attributes[D].name]=t.attributes[D].value;(g||p)&&(g&&(p&&g.__html==p.__html||g.__html===t.innerHTML)||(t.innerHTML=g&&g.__html||""))}if(Y2(t,I,y,i,a),g)e.__k=[];else if(Pd(t,So(D=e.props.children)?D:[D],e,r,n,i&&T!=="foreignObject",s,o,s?s[0]:r.__k&&Li(r,0),a,c),s!=null)for(D=s.length;D--;)s[D]!=null&&Ld(s[D]);a||("value"in I&&(D=I.value)!==void 0&&(D!==t.value||T==="progress"&&!D||T==="option"&&D!==y.value)&&Bs(t,"value",D,y.value,!1),"checked"in I&&(D=I.checked)!==void 0&&D!==t.checked&&Bs(t,"checked",D,y.checked,!1))}return t}function Gu(t,e,r){try{typeof t=="function"?t(e):t.current=e}catch(n){ve.__e(n,r)}}function Ka(t,e,r){var n,i;if(ve.unmount&&ve.unmount(t),(n=t.ref)&&(n.current&&n.current!==t.__e||Gu(n,null,e)),(n=t.__c)!=null){if(n.componentWillUnmount)try{n.componentWillUnmount()}catch(s){ve.__e(s,e)}n.base=n.__P=null,t.__c=void 0}if(n=t.__k)for(i=0;i<n.length;i++)n[i]&&Ka(n[i],e,r||typeof t.type!="function");r||t.__e==null||Ld(t.__e),t.__=t.__e=t.__d=void 0}function X2(t,e,r){return this.constructor(t,r)}function Ud(t,e,r){var n,i,s,o;ve.__&&ve.__(t,e),i=(n=typeof r=="function")?null:r&&r.__k||e.__k,s=[],o=[],qu(e,t=(!n&&r||e).__k=Qa(ns,null,[t]),i||Wn,Wn,e.ownerSVGElement!==void 0,!n&&r?[r]:i?null:e.firstChild?rs.call(e.childNodes):null,s,!n&&r?r:i?i.__e:e.firstChild,n,o),Fd(s,t,o)}function Hd(t,e){Ud(t,e,Hd)}function eE(t,e,r){var n,i,s,o,a=yr({},t.props);for(s in t.type&&t.type.defaultProps&&(o=t.type.defaultProps),e)s=="key"?n=e[s]:s=="ref"?i=e[s]:a[s]=e[s]===void 0&&o!==void 0?o[s]:e[s];return arguments.length>2&&(a.children=arguments.length>3?rs.call(arguments,2):r),Ii(t.type,a,n||t.key,i||t.ref,null)}function tE(t,e){var r={__c:e="__cC"+Nd++,__:t,Consumer:function(n,i){return n.children(i)},Provider:function(n){var i,s;return this.getChildContext||(i=[],(s={})[e]=this,this.getChildContext=function(){return s},this.shouldComponentUpdate=function(o){this.props.value!==o.value&&i.some(function(a){a.__e=!0,Ya(a)})},this.sub=function(o){i.push(o);var a=o.componentWillUnmount;o.componentWillUnmount=function(){i.splice(i.indexOf(o),1),a&&a.call(o)}}),n.children}};return r.Provider.__=r.Consumer.contextType=r}rs=Od.slice,ve={__e:function(t,e,r,n){for(var i,s,o;e=e.__;)if((i=e.__c)&&!i.__)try{if((s=i.constructor)&&s.getDerivedStateFromError!=null&&(i.setState(s.getDerivedStateFromError(t)),o=i.__d),i.componentDidCatch!=null&&(i.componentDidCatch(t,n||{}),o=i.__d),o)return i.__E=i}catch(a){t=a}throw t}},Ad=0,Td=function(t){return t!=null&&t.constructor===void 0},Ri.prototype.setState=function(t,e){var r;r=this.__s!=null&&this.__s!==this.state?this.__s:this.__s=yr({},this.state),typeof t=="function"&&(t=t(yr({},r),this.props)),t&&yr(r,t),t!=null&&this.__v&&(e&&this._sb.push(e),Ya(this))},Ri.prototype.forceUpdate=function(t){this.__v&&(this.__e=!0,t&&this.__h.push(t),Ya(this))},Ri.prototype.render=ns,sn=[],kd=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,Za=function(t,e){return t.__v.__b-e.__v.__b},Ls.__r=0,Nd=0;const rE=Object.freeze(Object.defineProperty({__proto__:null,Component:Ri,Fragment:ns,cloneElement:eE,createContext:tE,createElement:Qa,createRef:Z2,h:Qa,hydrate:Hd,get isValidElement(){return Td},get options(){return ve},render:Ud,toChildArray:jd},Symbol.toStringTag,{value:"Module"})),Lt=si(rE);function Kn(t){return typeof t=="function"}var Jl=!1,Ft={Promise:void 0,set useDeprecatedSynchronousErrorHandling(t){if(t){var e=new Error;""+e.stack}Jl=t},get useDeprecatedSynchronousErrorHandling(){return Jl}};function Dn(t){setTimeout(function(){throw t},0)}var Ps={closed:!0,next:function(t){},error:function(t){if(Ft.useDeprecatedSynchronousErrorHandling)throw t;Dn(t)},complete:function(){}},Ct=function(){return Array.isArray||function(t){return t&&typeof t.length=="number"}}();function Ju(t){return t!==null&&typeof t=="object"}var nE=function(){function t(e){return Error.call(this),this.message=e?e.length+` errors occurred during unsubscription:
12
+ `+e.map(function(r,n){return n+1+") "+r.toString()}).join(`
13
+ `):"",this.name="UnsubscriptionError",this.errors=e,this}return t.prototype=Object.create(Error.prototype),t}(),Ai=nE,nt=function(){function t(e){this.closed=!1,this._parentOrParents=null,this._subscriptions=null,e&&(this._ctorUnsubscribe=!0,this._unsubscribe=e)}return t.prototype.unsubscribe=function(){var e;if(!this.closed){var r=this,n=r._parentOrParents,i=r._ctorUnsubscribe,s=r._unsubscribe,o=r._subscriptions;if(this.closed=!0,this._parentOrParents=null,this._subscriptions=null,n instanceof t)n.remove(this);else if(n!==null)for(var a=0;a<n.length;++a){var c=n[a];c.remove(this)}if(Kn(s)){i&&(this._unsubscribe=void 0);try{s.call(this)}catch(g){e=g instanceof Ai?Zl(g.errors):[g]}}if(Ct(o))for(var a=-1,l=o.length;++a<l;){var p=o[a];if(Ju(p))try{p.unsubscribe()}catch(y){e=e||[],y instanceof Ai?e=e.concat(Zl(y.errors)):e.push(y)}}if(e)throw new Ai(e)}},t.prototype.add=function(e){var r=e;if(!e)return t.EMPTY;switch(typeof e){case"function":r=new t(e);case"object":if(r===this||r.closed||typeof r.unsubscribe!="function")return r;if(this.closed)return r.unsubscribe(),r;if(!(r instanceof t)){var n=r;r=new t,r._subscriptions=[n]}break;default:throw new Error("unrecognized teardown "+e+" added to Subscription.")}var i=r._parentOrParents;if(i===null)r._parentOrParents=this;else if(i instanceof t){if(i===this)return r;r._parentOrParents=[i,this]}else if(i.indexOf(this)===-1)i.push(this);else return r;var s=this._subscriptions;return s===null?this._subscriptions=[r]:s.push(r),r},t.prototype.remove=function(e){var r=this._subscriptions;if(r){var n=r.indexOf(e);n!==-1&&r.splice(n,1)}},t.EMPTY=function(e){return e.closed=!0,e}(new t),t}();function Zl(t){return t.reduce(function(e,r){return e.concat(r instanceof Ai?r.errors:r)},[])}var Ds=function(){return typeof Symbol=="function"?Symbol("rxSubscriber"):"@@rxSubscriber_"+Math.random()}(),ie=function(t){G(e,t);function e(r,n,i){var s=t.call(this)||this;switch(s.syncErrorValue=null,s.syncErrorThrown=!1,s.syncErrorThrowable=!1,s.isStopped=!1,arguments.length){case 0:s.destination=Ps;break;case 1:if(!r){s.destination=Ps;break}if(typeof r=="object"){r instanceof e?(s.syncErrorThrowable=r.syncErrorThrowable,s.destination=r,r.add(s)):(s.syncErrorThrowable=!0,s.destination=new Ql(s,r));break}default:s.syncErrorThrowable=!0,s.destination=new Ql(s,r,n,i);break}return s}return e.prototype[Ds]=function(){return this},e.create=function(r,n,i){var s=new e(r,n,i);return s.syncErrorThrowable=!1,s},e.prototype.next=function(r){this.isStopped||this._next(r)},e.prototype.error=function(r){this.isStopped||(this.isStopped=!0,this._error(r))},e.prototype.complete=function(){this.isStopped||(this.isStopped=!0,this._complete())},e.prototype.unsubscribe=function(){this.closed||(this.isStopped=!0,t.prototype.unsubscribe.call(this))},e.prototype._next=function(r){this.destination.next(r)},e.prototype._error=function(r){this.destination.error(r),this.unsubscribe()},e.prototype._complete=function(){this.destination.complete(),this.unsubscribe()},e.prototype._unsubscribeAndRecycle=function(){var r=this._parentOrParents;return this._parentOrParents=null,this.unsubscribe(),this.closed=!1,this.isStopped=!1,this._parentOrParents=r,this},e}(nt),Ql=function(t){G(e,t);function e(r,n,i,s){var o=t.call(this)||this;o._parentSubscriber=r;var a,c=o;return Kn(n)?a=n:n&&(a=n.next,i=n.error,s=n.complete,n!==Ps&&(c=Object.create(n),Kn(c.unsubscribe)&&o.add(c.unsubscribe.bind(c)),c.unsubscribe=o.unsubscribe.bind(o))),o._context=c,o._next=a,o._error=i,o._complete=s,o}return e.prototype.next=function(r){if(!this.isStopped&&this._next){var n=this._parentSubscriber;!Ft.useDeprecatedSynchronousErrorHandling||!n.syncErrorThrowable?this.__tryOrUnsub(this._next,r):this.__tryOrSetError(n,this._next,r)&&this.unsubscribe()}},e.prototype.error=function(r){if(!this.isStopped){var n=this._parentSubscriber,i=Ft.useDeprecatedSynchronousErrorHandling;if(this._error)!i||!n.syncErrorThrowable?(this.__tryOrUnsub(this._error,r),this.unsubscribe()):(this.__tryOrSetError(n,this._error,r),this.unsubscribe());else if(n.syncErrorThrowable)i?(n.syncErrorValue=r,n.syncErrorThrown=!0):Dn(r),this.unsubscribe();else{if(this.unsubscribe(),i)throw r;Dn(r)}}},e.prototype.complete=function(){var r=this;if(!this.isStopped){var n=this._parentSubscriber;if(this._complete){var i=function(){return r._complete.call(r._context)};!Ft.useDeprecatedSynchronousErrorHandling||!n.syncErrorThrowable?(this.__tryOrUnsub(i),this.unsubscribe()):(this.__tryOrSetError(n,i),this.unsubscribe())}else this.unsubscribe()}},e.prototype.__tryOrUnsub=function(r,n){try{r.call(this._context,n)}catch(i){if(this.unsubscribe(),Ft.useDeprecatedSynchronousErrorHandling)throw i;Dn(i)}},e.prototype.__tryOrSetError=function(r,n,i){if(!Ft.useDeprecatedSynchronousErrorHandling)throw new Error("bad call");try{n.call(this._context,i)}catch(s){return Ft.useDeprecatedSynchronousErrorHandling?(r.syncErrorValue=s,r.syncErrorThrown=!0,!0):(Dn(s),!0)}return!1},e.prototype._unsubscribe=function(){var r=this._parentSubscriber;this._context=null,this._parentSubscriber=null,r.unsubscribe()},e}(ie);function Zu(t){for(;t;){var e=t,r=e.closed,n=e.destination,i=e.isStopped;if(r||i)return!1;n&&n instanceof ie?t=n:t=null}return!0}function iE(t,e,r){if(t){if(t instanceof ie)return t;if(t[Ds])return t[Ds]()}return!t&&!e&&!r?new ie(Ps):new ie(t,e,r)}var pi=function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"}();function Or(t){return t}function Xa(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return Wd(t)}function Wd(t){return t.length===0?Or:t.length===1?t[0]:function(r){return t.reduce(function(n,i){return i(n)},r)}}var _e=function(){function t(e){this._isScalar=!1,e&&(this._subscribe=e)}return t.prototype.lift=function(e){var r=new t;return r.source=this,r.operator=e,r},t.prototype.subscribe=function(e,r,n){var i=this.operator,s=iE(e,r,n);if(i?s.add(i.call(s,this.source)):s.add(this.source||Ft.useDeprecatedSynchronousErrorHandling&&!s.syncErrorThrowable?this._subscribe(s):this._trySubscribe(s)),Ft.useDeprecatedSynchronousErrorHandling&&s.syncErrorThrowable&&(s.syncErrorThrowable=!1,s.syncErrorThrown))throw s.syncErrorValue;return s},t.prototype._trySubscribe=function(e){try{return this._subscribe(e)}catch(r){Ft.useDeprecatedSynchronousErrorHandling&&(e.syncErrorThrown=!0,e.syncErrorValue=r),Zu(e)?e.error(r):console.warn(r)}},t.prototype.forEach=function(e,r){var n=this;return r=Yl(r),new r(function(i,s){var o;o=n.subscribe(function(a){try{e(a)}catch(c){s(c),o&&o.unsubscribe()}},s,i)})},t.prototype._subscribe=function(e){var r=this.source;return r&&r.subscribe(e)},t.prototype[pi]=function(){return this},t.prototype.pipe=function(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];return e.length===0?this:Wd(e)(this)},t.prototype.toPromise=function(e){var r=this;return e=Yl(e),new e(function(n,i){var s;r.subscribe(function(o){return s=o},function(o){return i(o)},function(){return n(s)})})},t.create=function(e){return new t(e)},t}();function Yl(t){if(t||(t=Ft.Promise||Promise),!t)throw new Error("no Promise impl found");return t}var sE=function(){function t(){return Error.call(this),this.message="object unsubscribed",this.name="ObjectUnsubscribedError",this}return t.prototype=Object.create(Error.prototype),t}(),Ar=sE,Vd=function(t){G(e,t);function e(r,n){var i=t.call(this)||this;return i.subject=r,i.subscriber=n,i.closed=!1,i}return e.prototype.unsubscribe=function(){if(!this.closed){this.closed=!0;var r=this.subject,n=r.observers;if(this.subject=null,!(!n||n.length===0||r.isStopped||r.closed)){var i=n.indexOf(this.subscriber);i!==-1&&n.splice(i,1)}}},e}(nt),zd=function(t){G(e,t);function e(r){var n=t.call(this,r)||this;return n.destination=r,n}return e}(ie),vt=function(t){G(e,t);function e(){var r=t.call(this)||this;return r.observers=[],r.closed=!1,r.isStopped=!1,r.hasError=!1,r.thrownError=null,r}return e.prototype[Ds]=function(){return new zd(this)},e.prototype.lift=function(r){var n=new Kl(this,this);return n.operator=r,n},e.prototype.next=function(r){if(this.closed)throw new Ar;if(!this.isStopped)for(var n=this.observers,i=n.length,s=n.slice(),o=0;o<i;o++)s[o].next(r)},e.prototype.error=function(r){if(this.closed)throw new Ar;this.hasError=!0,this.thrownError=r,this.isStopped=!0;for(var n=this.observers,i=n.length,s=n.slice(),o=0;o<i;o++)s[o].error(r);this.observers.length=0},e.prototype.complete=function(){if(this.closed)throw new Ar;this.isStopped=!0;for(var r=this.observers,n=r.length,i=r.slice(),s=0;s<n;s++)i[s].complete();this.observers.length=0},e.prototype.unsubscribe=function(){this.isStopped=!0,this.closed=!0,this.observers=null},e.prototype._trySubscribe=function(r){if(this.closed)throw new Ar;return t.prototype._trySubscribe.call(this,r)},e.prototype._subscribe=function(r){if(this.closed)throw new Ar;return this.hasError?(r.error(this.thrownError),nt.EMPTY):this.isStopped?(r.complete(),nt.EMPTY):(this.observers.push(r),new Vd(this,r))},e.prototype.asObservable=function(){var r=new _e;return r.source=this,r},e.create=function(r,n){return new Kl(r,n)},e}(_e),Kl=function(t){G(e,t);function e(r,n){var i=t.call(this)||this;return i.destination=r,i.source=n,i}return e.prototype.next=function(r){var n=this.destination;n&&n.next&&n.next(r)},e.prototype.error=function(r){var n=this.destination;n&&n.error&&this.destination.error(r)},e.prototype.complete=function(){var r=this.destination;r&&r.complete&&this.destination.complete()},e.prototype._subscribe=function(r){var n=this.source;return n?this.source.subscribe(r):nt.EMPTY},e}(vt);function Qu(){return function(e){return e.lift(new oE(e))}}var oE=function(){function t(e){this.connectable=e}return t.prototype.call=function(e,r){var n=this.connectable;n._refCount++;var i=new aE(e,n),s=r.subscribe(i);return i.closed||(i.connection=n.connect()),s},t}(),aE=function(t){G(e,t);function e(r,n){var i=t.call(this,r)||this;return i.connectable=n,i}return e.prototype._unsubscribe=function(){var r=this.connectable;if(!r){this.connection=null;return}this.connectable=null;var n=r._refCount;if(n<=0){this.connection=null;return}if(r._refCount=n-1,n>1){this.connection=null;return}var i=this.connection,s=r._connection;this.connection=null,s&&(!i||s===i)&&s.unsubscribe()},e}(ie),qd=function(t){G(e,t);function e(r,n){var i=t.call(this)||this;return i.source=r,i.subjectFactory=n,i._refCount=0,i._isComplete=!1,i}return e.prototype._subscribe=function(r){return this.getSubject().subscribe(r)},e.prototype.getSubject=function(){var r=this._subject;return(!r||r.isStopped)&&(this._subject=this.subjectFactory()),this._subject},e.prototype.connect=function(){var r=this._connection;return r||(this._isComplete=!1,r=this._connection=new nt,r.add(this.source.subscribe(new cE(this.getSubject(),this))),r.closed&&(this._connection=null,r=nt.EMPTY)),r},e.prototype.refCount=function(){return Qu()(this)},e}(_e),uE=function(){var t=qd.prototype;return{operator:{value:null},_refCount:{value:0,writable:!0},_subject:{value:null,writable:!0},_connection:{value:null,writable:!0},_subscribe:{value:t._subscribe},_isComplete:{value:t._isComplete,writable:!0},getSubject:{value:t.getSubject},connect:{value:t.connect},refCount:{value:t.refCount}}}(),cE=function(t){G(e,t);function e(r,n){var i=t.call(this,r)||this;return i.connectable=n,i}return e.prototype._error=function(r){this._unsubscribe(),t.prototype._error.call(this,r)},e.prototype._complete=function(){this.connectable._isComplete=!0,this._unsubscribe(),t.prototype._complete.call(this)},e.prototype._unsubscribe=function(){var r=this.connectable;if(r){this.connectable=null;var n=r._connection;r._refCount=0,r._subject=null,r._connection=null,n&&n.unsubscribe()}},e}(zd);function lE(t,e,r,n){return function(i){return i.lift(new hE(t,e,r,n))}}var hE=function(){function t(e,r,n,i){this.keySelector=e,this.elementSelector=r,this.durationSelector=n,this.subjectSelector=i}return t.prototype.call=function(e,r){return r.subscribe(new fE(e,this.keySelector,this.elementSelector,this.durationSelector,this.subjectSelector))},t}(),fE=function(t){G(e,t);function e(r,n,i,s,o){var a=t.call(this,r)||this;return a.keySelector=n,a.elementSelector=i,a.durationSelector=s,a.subjectSelector=o,a.groups=null,a.attemptedToUnsubscribe=!1,a.count=0,a}return e.prototype._next=function(r){var n;try{n=this.keySelector(r)}catch(i){this.error(i);return}this._group(r,n)},e.prototype._group=function(r,n){var i=this.groups;i||(i=this.groups=new Map);var s=i.get(n),o;if(this.elementSelector)try{o=this.elementSelector(r)}catch(l){this.error(l)}else o=r;if(!s){s=this.subjectSelector?this.subjectSelector():new vt,i.set(n,s);var a=new eu(n,s,this);if(this.destination.next(a),this.durationSelector){var c=void 0;try{c=this.durationSelector(new eu(n,s))}catch(l){this.error(l);return}this.add(c.subscribe(new dE(n,s,this)))}}s.closed||s.next(o)},e.prototype._error=function(r){var n=this.groups;n&&(n.forEach(function(i,s){i.error(r)}),n.clear()),this.destination.error(r)},e.prototype._complete=function(){var r=this.groups;r&&(r.forEach(function(n,i){n.complete()}),r.clear()),this.destination.complete()},e.prototype.removeGroup=function(r){this.groups.delete(r)},e.prototype.unsubscribe=function(){this.closed||(this.attemptedToUnsubscribe=!0,this.count===0&&t.prototype.unsubscribe.call(this))},e}(ie),dE=function(t){G(e,t);function e(r,n,i){var s=t.call(this,n)||this;return s.key=r,s.group=n,s.parent=i,s}return e.prototype._next=function(r){this.complete()},e.prototype._unsubscribe=function(){var r=this,n=r.parent,i=r.key;this.key=this.parent=null,n&&n.removeGroup(i)},e}(ie),eu=function(t){G(e,t);function e(r,n,i){var s=t.call(this)||this;return s.key=r,s.groupSubject=n,s.refCountSubscription=i,s}return e.prototype._subscribe=function(r){var n=new nt,i=this,s=i.refCountSubscription,o=i.groupSubject;return s&&!s.closed&&n.add(new pE(s)),n.add(o.subscribe(r)),n},e}(_e),pE=function(t){G(e,t);function e(r){var n=t.call(this)||this;return n.parent=r,r.count++,n}return e.prototype.unsubscribe=function(){var r=this.parent;!r.closed&&!this.closed&&(t.prototype.unsubscribe.call(this),r.count-=1,r.count===0&&r.attemptedToUnsubscribe&&r.unsubscribe())},e}(nt),Gd=function(t){G(e,t);function e(r){var n=t.call(this)||this;return n._value=r,n}return Object.defineProperty(e.prototype,"value",{get:function(){return this.getValue()},enumerable:!0,configurable:!0}),e.prototype._subscribe=function(r){var n=t.prototype._subscribe.call(this,r);return n&&!n.closed&&r.next(this._value),n},e.prototype.getValue=function(){if(this.hasError)throw this.thrownError;if(this.closed)throw new Ar;return this._value},e.prototype.next=function(r){t.prototype.next.call(this,this._value=r)},e}(vt),gE=function(t){G(e,t);function e(r,n){return t.call(this)||this}return e.prototype.schedule=function(r,n){return this},e}(nt),is=function(t){G(e,t);function e(r,n){var i=t.call(this,r,n)||this;return i.scheduler=r,i.work=n,i.pending=!1,i}return e.prototype.schedule=function(r,n){if(n===void 0&&(n=0),this.closed)return this;this.state=r;var i=this.id,s=this.scheduler;return i!=null&&(this.id=this.recycleAsyncId(s,i,n)),this.pending=!0,this.delay=n,this.id=this.id||this.requestAsyncId(s,this.id,n),this},e.prototype.requestAsyncId=function(r,n,i){return i===void 0&&(i=0),setInterval(r.flush.bind(r,this),i)},e.prototype.recycleAsyncId=function(r,n,i){if(i===void 0&&(i=0),i!==null&&this.delay===i&&this.pending===!1)return n;clearInterval(n)},e.prototype.execute=function(r,n){if(this.closed)return new Error("executing a cancelled action");this.pending=!1;var i=this._execute(r,n);if(i)return i;this.pending===!1&&this.id!=null&&(this.id=this.recycleAsyncId(this.scheduler,this.id,null))},e.prototype._execute=function(r,n){var i=!1,s=void 0;try{this.work(r)}catch(o){i=!0,s=!!o&&o||new Error(o)}if(i)return this.unsubscribe(),s},e.prototype._unsubscribe=function(){var r=this.id,n=this.scheduler,i=n.actions,s=i.indexOf(this);this.work=null,this.state=null,this.pending=!1,this.scheduler=null,s!==-1&&i.splice(s,1),r!=null&&(this.id=this.recycleAsyncId(n,r,null)),this.delay=null},e}(gE),bE=function(t){G(e,t);function e(r,n){var i=t.call(this,r,n)||this;return i.scheduler=r,i.work=n,i}return e.prototype.schedule=function(r,n){return n===void 0&&(n=0),n>0?t.prototype.schedule.call(this,r,n):(this.delay=n,this.state=r,this.scheduler.flush(this),this)},e.prototype.execute=function(r,n){return n>0||this.closed?t.prototype.execute.call(this,r,n):this._execute(r,n)},e.prototype.requestAsyncId=function(r,n,i){return i===void 0&&(i=0),i!==null&&i>0||i===null&&this.delay>0?t.prototype.requestAsyncId.call(this,r,n,i):r.flush(this)},e}(is),tu=function(){function t(e,r){r===void 0&&(r=t.now),this.SchedulerAction=e,this.now=r}return t.prototype.schedule=function(e,r,n){return r===void 0&&(r=0),new this.SchedulerAction(this,e).schedule(n,r)},t.now=function(){return Date.now()},t}(),ss=function(t){G(e,t);function e(r,n){n===void 0&&(n=tu.now);var i=t.call(this,r,function(){return e.delegate&&e.delegate!==i?e.delegate.now():n()})||this;return i.actions=[],i.active=!1,i.scheduled=void 0,i}return e.prototype.schedule=function(r,n,i){return n===void 0&&(n=0),e.delegate&&e.delegate!==this?e.delegate.schedule(r,n,i):t.prototype.schedule.call(this,r,n,i)},e.prototype.flush=function(r){var n=this.actions;if(this.active){n.push(r);return}var i;this.active=!0;do if(i=r.execute(r.state,r.delay))break;while(r=n.shift());if(this.active=!1,i){for(;r=n.shift();)r.unsubscribe();throw i}},e}(tu),vE=function(t){G(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e}(ss),Jd=new vE(bE),Zd=Jd,Xn=new _e(function(t){return t.complete()});function gi(t){return t?mE(t):Xn}function mE(t){return new _e(function(e){return t.schedule(function(){return e.complete()})})}function Ot(t){return t&&typeof t.schedule=="function"}var Qd=function(t){return function(e){for(var r=0,n=t.length;r<n&&!e.closed;r++)e.next(t[r]);e.complete()}};function Yu(t,e){return new _e(function(r){var n=new nt,i=0;return n.add(e.schedule(function(){if(i===t.length){r.complete();return}r.next(t[i++]),r.closed||n.add(this.schedule())})),n})}function os(t,e){return e?Yu(t,e):new _e(Qd(t))}function xo(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var r=t[t.length-1];return Ot(r)?(t.pop(),Yu(t,r)):os(t)}function Ku(t,e){return e?new _e(function(r){return e.schedule(yE,0,{error:t,subscriber:r})}):new _e(function(r){return r.error(t)})}function yE(t){var e=t.error,r=t.subscriber;r.error(e)}var ru;ru||(ru={});var _r=function(){function t(e,r,n){this.kind=e,this.value=r,this.error=n,this.hasValue=e==="N"}return t.prototype.observe=function(e){switch(this.kind){case"N":return e.next&&e.next(this.value);case"E":return e.error&&e.error(this.error);case"C":return e.complete&&e.complete()}},t.prototype.do=function(e,r,n){var i=this.kind;switch(i){case"N":return e&&e(this.value);case"E":return r&&r(this.error);case"C":return n&&n()}},t.prototype.accept=function(e,r,n){return e&&typeof e.next=="function"?this.observe(e):this.do(e,r,n)},t.prototype.toObservable=function(){var e=this.kind;switch(e){case"N":return xo(this.value);case"E":return Ku(this.error);case"C":return gi()}throw new Error("unexpected notification kind value")},t.createNext=function(e){return typeof e<"u"?new t("N",e):t.undefinedValueNotification},t.createError=function(e){return new t("E",void 0,e)},t.createComplete=function(){return t.completeNotification},t.completeNotification=new t("C"),t.undefinedValueNotification=new t("N",void 0),t}();function _E(t,e){return e===void 0&&(e=0),function(n){return n.lift(new wE(t,e))}}var wE=function(){function t(e,r){r===void 0&&(r=0),this.scheduler=e,this.delay=r}return t.prototype.call=function(e,r){return r.subscribe(new Yd(e,this.scheduler,this.delay))},t}(),Yd=function(t){G(e,t);function e(r,n,i){i===void 0&&(i=0);var s=t.call(this,r)||this;return s.scheduler=n,s.delay=i,s}return e.dispatch=function(r){var n=r.notification,i=r.destination;n.observe(i),this.unsubscribe()},e.prototype.scheduleMessage=function(r){var n=this.destination;n.add(this.scheduler.schedule(e.dispatch,this.delay,new EE(r,this.destination)))},e.prototype._next=function(r){this.scheduleMessage(_r.createNext(r))},e.prototype._error=function(r){this.scheduleMessage(_r.createError(r)),this.unsubscribe()},e.prototype._complete=function(){this.scheduleMessage(_r.createComplete()),this.unsubscribe()},e}(ie),EE=function(){function t(e,r){this.notification=e,this.destination=r}return t}(),Xu=function(t){G(e,t);function e(r,n,i){r===void 0&&(r=Number.POSITIVE_INFINITY),n===void 0&&(n=Number.POSITIVE_INFINITY);var s=t.call(this)||this;return s.scheduler=i,s._events=[],s._infiniteTimeWindow=!1,s._bufferSize=r<1?1:r,s._windowTime=n<1?1:n,n===Number.POSITIVE_INFINITY?(s._infiniteTimeWindow=!0,s.next=s.nextInfiniteTimeWindow):s.next=s.nextTimeWindow,s}return e.prototype.nextInfiniteTimeWindow=function(r){if(!this.isStopped){var n=this._events;n.push(r),n.length>this._bufferSize&&n.shift()}t.prototype.next.call(this,r)},e.prototype.nextTimeWindow=function(r){this.isStopped||(this._events.push(new SE(this._getNow(),r)),this._trimBufferThenGetEvents()),t.prototype.next.call(this,r)},e.prototype._subscribe=function(r){var n=this._infiniteTimeWindow,i=n?this._events:this._trimBufferThenGetEvents(),s=this.scheduler,o=i.length,a;if(this.closed)throw new Ar;if(this.isStopped||this.hasError?a=nt.EMPTY:(this.observers.push(r),a=new Vd(this,r)),s&&r.add(r=new Yd(r,s)),n)for(var c=0;c<o&&!r.closed;c++)r.next(i[c]);else for(var c=0;c<o&&!r.closed;c++)r.next(i[c].value);return this.hasError?r.error(this.thrownError):this.isStopped&&r.complete(),a},e.prototype._getNow=function(){return(this.scheduler||Zd).now()},e.prototype._trimBufferThenGetEvents=function(){for(var r=this._getNow(),n=this._bufferSize,i=this._windowTime,s=this._events,o=s.length,a=0;a<o&&!(r-s[a].time<i);)a++;return o>n&&(a=Math.max(a,o-n)),a>0&&s.splice(0,a),s},e}(vt),SE=function(){function t(e,r){this.time=e,this.value=r}return t}(),bi=function(t){G(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.value=null,r.hasNext=!1,r.hasCompleted=!1,r}return e.prototype._subscribe=function(r){return this.hasError?(r.error(this.thrownError),nt.EMPTY):this.hasCompleted&&this.hasNext?(r.next(this.value),r.complete(),nt.EMPTY):t.prototype._subscribe.call(this,r)},e.prototype.next=function(r){this.hasCompleted||(this.value=r,this.hasNext=!0)},e.prototype.error=function(r){this.hasCompleted||t.prototype.error.call(this,r)},e.prototype.complete=function(){this.hasCompleted=!0,this.hasNext&&t.prototype.next.call(this,this.value),t.prototype.complete.call(this)},e}(vt),xE=1,ME=function(){return Promise.resolve()}(),nu={};function Xl(t){return t in nu?(delete nu[t],!0):!1}var eh={setImmediate:function(t){var e=xE++;return nu[e]=!0,ME.then(function(){return Xl(e)&&t()}),e},clearImmediate:function(t){Xl(t)}},CE=function(t){G(e,t);function e(r,n){var i=t.call(this,r,n)||this;return i.scheduler=r,i.work=n,i}return e.prototype.requestAsyncId=function(r,n,i){return i===void 0&&(i=0),i!==null&&i>0?t.prototype.requestAsyncId.call(this,r,n,i):(r.actions.push(this),r.scheduled||(r.scheduled=eh.setImmediate(r.flush.bind(r,null))))},e.prototype.recycleAsyncId=function(r,n,i){if(i===void 0&&(i=0),i!==null&&i>0||i===null&&this.delay>0)return t.prototype.recycleAsyncId.call(this,r,n,i);r.actions.length===0&&(eh.clearImmediate(n),r.scheduled=void 0)},e}(is),IE=function(t){G(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.flush=function(r){this.active=!0,this.scheduled=void 0;var n=this.actions,i,s=-1,o=n.length;r=r||n.shift();do if(i=r.execute(r.state,r.delay))break;while(++s<o&&(r=n.shift()));if(this.active=!1,i){for(;++s<o&&(r=n.shift());)r.unsubscribe();throw i}},e}(ss),Kd=new IE(CE),Ms=Kd,Xd=new ss(is),It=Xd,RE=function(t){G(e,t);function e(r,n){var i=t.call(this,r,n)||this;return i.scheduler=r,i.work=n,i}return e.prototype.requestAsyncId=function(r,n,i){return i===void 0&&(i=0),i!==null&&i>0?t.prototype.requestAsyncId.call(this,r,n,i):(r.actions.push(this),r.scheduled||(r.scheduled=requestAnimationFrame(function(){return r.flush(null)})))},e.prototype.recycleAsyncId=function(r,n,i){if(i===void 0&&(i=0),i!==null&&i>0||i===null&&this.delay>0)return t.prototype.recycleAsyncId.call(this,r,n,i);r.actions.length===0&&(cancelAnimationFrame(n),r.scheduled=void 0)},e}(is),AE=function(t){G(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.flush=function(r){this.active=!0,this.scheduled=void 0;var n=this.actions,i,s=-1,o=n.length;r=r||n.shift();do if(i=r.execute(r.state,r.delay))break;while(++s<o&&(r=n.shift()));if(this.active=!1,i){for(;++s<o&&(r=n.shift());)r.unsubscribe();throw i}},e}(ss),e0=new AE(RE),TE=e0,kE=function(t){G(e,t);function e(r,n){r===void 0&&(r=t0),n===void 0&&(n=Number.POSITIVE_INFINITY);var i=t.call(this,r,function(){return i.frame})||this;return i.maxFrames=n,i.frame=0,i.index=-1,i}return e.prototype.flush=function(){for(var r=this,n=r.actions,i=r.maxFrames,s,o;(o=n[0])&&o.delay<=i&&(n.shift(),this.frame=o.delay,!(s=o.execute(o.state,o.delay))););if(s){for(;o=n.shift();)o.unsubscribe();throw s}},e.frameTimeFactor=10,e}(ss),t0=function(t){G(e,t);function e(r,n,i){i===void 0&&(i=r.index+=1);var s=t.call(this,r,n)||this;return s.scheduler=r,s.work=n,s.index=i,s.active=!0,s.index=r.index=i,s}return e.prototype.schedule=function(r,n){if(n===void 0&&(n=0),!this.id)return t.prototype.schedule.call(this,r,n);this.active=!1;var i=new e(this.scheduler,this.work);return this.add(i),i.schedule(r,n)},e.prototype.requestAsyncId=function(r,n,i){i===void 0&&(i=0),this.delay=r.frame+i;var s=r.actions;return s.push(this),s.sort(e.sortActions),!0},e.prototype.recycleAsyncId=function(r,n,i){},e.prototype._execute=function(r,n){if(this.active===!0)return t.prototype._execute.call(this,r,n)},e.sortActions=function(r,n){return r.delay===n.delay?r.index===n.index?0:r.index>n.index?1:-1:r.delay>n.delay?1:-1},e}(is);function ar(){}function NE(t){return!!t&&(t instanceof _e||typeof t.lift=="function"&&typeof t.subscribe=="function")}var OE=function(){function t(){return Error.call(this),this.message="argument out of range",this.name="ArgumentOutOfRangeError",this}return t.prototype=Object.create(Error.prototype),t}(),ei=OE,LE=function(){function t(){return Error.call(this),this.message="no elements in sequence",this.name="EmptyError",this}return t.prototype=Object.create(Error.prototype),t}(),as=LE,BE=function(){function t(){return Error.call(this),this.message="Timeout has occurred",this.name="TimeoutError",this}return t.prototype=Object.create(Error.prototype),t}(),r0=BE;function qt(t,e){return function(n){if(typeof t!="function")throw new TypeError("argument is not a function. Are you looking for `mapTo()`?");return n.lift(new PE(t,e))}}var PE=function(){function t(e,r){this.project=e,this.thisArg=r}return t.prototype.call=function(e,r){return r.subscribe(new DE(e,this.project,this.thisArg))},t}(),DE=function(t){G(e,t);function e(r,n,i){var s=t.call(this,r)||this;return s.project=n,s.count=0,s.thisArg=i||s,s}return e.prototype._next=function(r){var n;try{n=this.project.call(this.thisArg,r,this.count++)}catch(i){this.destination.error(i);return}this.destination.next(n)},e}(ie);function n0(t,e,r){if(e)if(Ot(e))r=e;else return function(){for(var n=[],i=0;i<arguments.length;i++)n[i]=arguments[i];return n0(t,r).apply(void 0,n).pipe(qt(function(s){return Ct(s)?e.apply(void 0,s):e(s)}))};return function(){for(var n=[],i=0;i<arguments.length;i++)n[i]=arguments[i];var s=this,o,a={context:s,subject:o,callbackFunc:t,scheduler:r};return new _e(function(c){if(r){var p={args:n,subscriber:c,params:a};return r.schedule(jE,0,p)}else{if(!o){o=new bi;var l=function(){for(var g=[],y=0;y<arguments.length;y++)g[y]=arguments[y];o.next(g.length<=1?g[0]:g),o.complete()};try{t.apply(s,n.concat([l]))}catch(g){Zu(o)?o.error(g):console.warn(g)}}return o.subscribe(c)}})}}function jE(t){var e=this,r=t.args,n=t.subscriber,i=t.params,s=i.callbackFunc,o=i.context,a=i.scheduler,c=i.subject;if(!c){c=i.subject=new bi;var l=function(){for(var p=[],g=0;g<arguments.length;g++)p[g]=arguments[g];var y=p.length<=1?p[0]:p;e.add(a.schedule($E,0,{value:y,subject:c}))};try{s.apply(o,r.concat([l]))}catch(p){c.error(p)}}this.add(c.subscribe(n))}function $E(t){var e=t.value,r=t.subject;r.next(e),r.complete()}function i0(t,e,r){if(e)if(Ot(e))r=e;else return function(){for(var n=[],i=0;i<arguments.length;i++)n[i]=arguments[i];return i0(t,r).apply(void 0,n).pipe(qt(function(s){return Ct(s)?e.apply(void 0,s):e(s)}))};return function(){for(var n=[],i=0;i<arguments.length;i++)n[i]=arguments[i];var s={subject:void 0,args:n,callbackFunc:t,scheduler:r,context:this};return new _e(function(o){var a=s.context,c=s.subject;if(r)return r.schedule(FE,0,{params:s,subscriber:o,context:a});if(!c){c=s.subject=new bi;var l=function(){for(var p=[],g=0;g<arguments.length;g++)p[g]=arguments[g];var y=p.shift();if(y){c.error(y);return}c.next(p.length<=1?p[0]:p),c.complete()};try{t.apply(a,n.concat([l]))}catch(p){Zu(c)?c.error(p):console.warn(p)}}return c.subscribe(o)})}}function FE(t){var e=this,r=t.params,n=t.subscriber,i=t.context,s=r.callbackFunc,o=r.args,a=r.scheduler,c=r.subject;if(!c){c=r.subject=new bi;var l=function(){for(var p=[],g=0;g<arguments.length;g++)p[g]=arguments[g];var y=p.shift();if(y)e.add(a.schedule(th,0,{err:y,subject:c}));else{var I=p.length<=1?p[0]:p;e.add(a.schedule(UE,0,{value:I,subject:c}))}};try{s.apply(i,o.concat([l]))}catch(p){this.add(a.schedule(th,0,{err:p,subject:c}))}}this.add(c.subscribe(n))}function UE(t){var e=t.value,r=t.subject;r.next(e),r.complete()}function th(t){var e=t.err,r=t.subject;r.error(e)}var _n=function(t){G(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.notifyNext=function(r,n,i,s,o){this.destination.next(n)},e.prototype.notifyError=function(r,n){this.destination.error(r)},e.prototype.notifyComplete=function(r){this.destination.complete()},e}(ie),HE=function(t){G(e,t);function e(r,n,i){var s=t.call(this)||this;return s.parent=r,s.outerValue=n,s.outerIndex=i,s.index=0,s}return e.prototype._next=function(r){this.parent.notifyNext(this.outerValue,r,this.outerIndex,this.index++,this)},e.prototype._error=function(r){this.parent.notifyError(r,this),this.unsubscribe()},e.prototype._complete=function(){this.parent.notifyComplete(this),this.unsubscribe()},e}(ie),WE=function(t){return function(e){return t.then(function(r){e.closed||(e.next(r),e.complete())},function(r){return e.error(r)}).then(null,Dn),e}};function VE(){return typeof Symbol!="function"||!Symbol.iterator?"@@iterator":Symbol.iterator}var Lr=VE(),zE=function(t){return function(e){var r=t[Lr]();do{var n=void 0;try{n=r.next()}catch(i){return e.error(i),e}if(n.done){e.complete();break}if(e.next(n.value),e.closed)break}while(!0);return typeof r.return=="function"&&e.add(function(){r.return&&r.return()}),e}},qE=function(t){return function(e){var r=t[pi]();if(typeof r.subscribe!="function")throw new TypeError("Provided object does not correctly implement Symbol.observable");return r.subscribe(e)}},s0=function(t){return t&&typeof t.length=="number"&&typeof t!="function"};function o0(t){return!!t&&typeof t.subscribe!="function"&&typeof t.then=="function"}var Bi=function(t){if(t&&typeof t[pi]=="function")return qE(t);if(s0(t))return Qd(t);if(o0(t))return WE(t);if(t&&typeof t[Lr]=="function")return zE(t);var e=Ju(t)?"an invalid object":"'"+t+"'",r="You provided "+e+" where a stream was expected. You can provide an Observable, Promise, Array, or Iterable.";throw new TypeError(r)};function Er(t,e,r,n,i){if(i===void 0&&(i=new HE(t,r,n)),!i.closed)return e instanceof _e?e.subscribe(i):Bi(e)(i)}var rh={};function GE(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var r=void 0,n=void 0;return Ot(t[t.length-1])&&(n=t.pop()),typeof t[t.length-1]=="function"&&(r=t.pop()),t.length===1&&Ct(t[0])&&(t=t[0]),os(t,n).lift(new ec(r))}var ec=function(){function t(e){this.resultSelector=e}return t.prototype.call=function(e,r){return r.subscribe(new JE(e,this.resultSelector))},t}(),JE=function(t){G(e,t);function e(r,n){var i=t.call(this,r)||this;return i.resultSelector=n,i.active=0,i.values=[],i.observables=[],i}return e.prototype._next=function(r){this.values.push(rh),this.observables.push(r)},e.prototype._complete=function(){var r=this.observables,n=r.length;if(n===0)this.destination.complete();else{this.active=n,this.toRespond=n;for(var i=0;i<n;i++){var s=r[i];this.add(Er(this,s,void 0,i))}}},e.prototype.notifyComplete=function(r){(this.active-=1)===0&&this.destination.complete()},e.prototype.notifyNext=function(r,n,i){var s=this.values,o=s[i],a=this.toRespond?o===rh?--this.toRespond:this.toRespond:0;s[i]=n,a===0&&(this.resultSelector?this._tryResultSelector(s):this.destination.next(s.slice()))},e.prototype._tryResultSelector=function(r){var n;try{n=this.resultSelector.apply(this,r)}catch(i){this.destination.error(i);return}this.destination.next(n)},e}(_n);function ZE(t,e){return new _e(function(r){var n=new nt;return n.add(e.schedule(function(){var i=t[pi]();n.add(i.subscribe({next:function(s){n.add(e.schedule(function(){return r.next(s)}))},error:function(s){n.add(e.schedule(function(){return r.error(s)}))},complete:function(){n.add(e.schedule(function(){return r.complete()}))}}))})),n})}function QE(t,e){return new _e(function(r){var n=new nt;return n.add(e.schedule(function(){return t.then(function(i){n.add(e.schedule(function(){r.next(i),n.add(e.schedule(function(){return r.complete()}))}))},function(i){n.add(e.schedule(function(){return r.error(i)}))})})),n})}function YE(t,e){if(!t)throw new Error("Iterable cannot be null");return new _e(function(r){var n=new nt,i;return n.add(function(){i&&typeof i.return=="function"&&i.return()}),n.add(e.schedule(function(){i=t[Lr](),n.add(e.schedule(function(){if(!r.closed){var s,o;try{var a=i.next();s=a.value,o=a.done}catch(c){r.error(c);return}o?r.complete():(r.next(s),this.schedule())}}))})),n})}function KE(t){return t&&typeof t[pi]=="function"}function XE(t){return t&&typeof t[Lr]=="function"}function a0(t,e){if(t!=null){if(KE(t))return ZE(t,e);if(o0(t))return QE(t,e);if(s0(t))return Yu(t,e);if(XE(t)||typeof t=="string")return YE(t,e)}throw new TypeError((t!==null&&typeof t||t)+" is not observable")}function xr(t,e){return e?a0(t,e):t instanceof _e?t:new _e(Bi(t))}var it=function(t){G(e,t);function e(r){var n=t.call(this)||this;return n.parent=r,n}return e.prototype._next=function(r){this.parent.notifyNext(r)},e.prototype._error=function(r){this.parent.notifyError(r),this.unsubscribe()},e.prototype._complete=function(){this.parent.notifyComplete(),this.unsubscribe()},e}(ie),st=function(t){G(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.notifyNext=function(r){this.destination.next(r)},e.prototype.notifyError=function(r){this.destination.error(r)},e.prototype.notifyComplete=function(){this.destination.complete()},e}(ie);function ot(t,e){if(!e.closed){if(t instanceof _e)return t.subscribe(e);var r;try{r=Bi(t)(e)}catch(n){e.error(n)}return r}}function fn(t,e,r){return r===void 0&&(r=Number.POSITIVE_INFINITY),typeof e=="function"?function(n){return n.pipe(fn(function(i,s){return xr(t(i,s)).pipe(qt(function(o,a){return e(i,o,s,a)}))},r))}:(typeof e=="number"&&(r=e),function(n){return n.lift(new eS(t,r))})}var eS=function(){function t(e,r){r===void 0&&(r=Number.POSITIVE_INFINITY),this.project=e,this.concurrent=r}return t.prototype.call=function(e,r){return r.subscribe(new tS(e,this.project,this.concurrent))},t}(),tS=function(t){G(e,t);function e(r,n,i){i===void 0&&(i=Number.POSITIVE_INFINITY);var s=t.call(this,r)||this;return s.project=n,s.concurrent=i,s.hasCompleted=!1,s.buffer=[],s.active=0,s.index=0,s}return e.prototype._next=function(r){this.active<this.concurrent?this._tryNext(r):this.buffer.push(r)},e.prototype._tryNext=function(r){var n,i=this.index++;try{n=this.project(r,i)}catch(s){this.destination.error(s);return}this.active++,this._innerSub(n)},e.prototype._innerSub=function(r){var n=new it(this),i=this.destination;i.add(n);var s=ot(r,n);s!==n&&i.add(s)},e.prototype._complete=function(){this.hasCompleted=!0,this.active===0&&this.buffer.length===0&&this.destination.complete(),this.unsubscribe()},e.prototype.notifyNext=function(r){this.destination.next(r)},e.prototype.notifyComplete=function(){var r=this.buffer;this.active--,r.length>0?this._next(r.shift()):this.active===0&&this.hasCompleted&&this.destination.complete()},e}(st),rS=fn;function tc(t){return t===void 0&&(t=Number.POSITIVE_INFINITY),fn(Or,t)}function u0(){return tc(1)}function Pi(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return u0()(xo.apply(void 0,t))}function rc(t){return new _e(function(e){var r;try{r=t()}catch(i){e.error(i);return}var n=r?xr(r):gi();return n.subscribe(e)})}function nS(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];if(t.length===1){var r=t[0];if(Ct(r))return ms(r,null);if(Ju(r)&&Object.getPrototypeOf(r)===Object.prototype){var n=Object.keys(r);return ms(n.map(function(s){return r[s]}),n)}}if(typeof t[t.length-1]=="function"){var i=t.pop();return t=t.length===1&&Ct(t[0])?t[0]:t,ms(t,null).pipe(qt(function(s){return i.apply(void 0,s)}))}return ms(t,null)}function ms(t,e){return new _e(function(r){var n=t.length;if(n===0){r.complete();return}for(var i=new Array(n),s=0,o=0,a=function(l){var p=xr(t[l]),g=!1;r.add(p.subscribe({next:function(y){g||(g=!0,o++),i[l]=y},error:function(y){return r.error(y)},complete:function(){s++,(s===n||!g)&&(o===n&&r.next(e?e.reduce(function(y,I,T){return y[I]=i[T],y},{}):i),r.complete())}}))},c=0;c<n;c++)a(c)})}function c0(t,e,r,n){return Kn(r)&&(n=r,r=void 0),n?c0(t,e,r).pipe(qt(function(i){return Ct(i)?n.apply(void 0,i):n(i)})):new _e(function(i){function s(o){arguments.length>1?i.next(Array.prototype.slice.call(arguments)):i.next(o)}l0(t,e,s,i,r)})}function l0(t,e,r,n,i){var s;if(oS(t)){var o=t;t.addEventListener(e,r,i),s=function(){return o.removeEventListener(e,r,i)}}else if(sS(t)){var a=t;t.on(e,r),s=function(){return a.off(e,r)}}else if(iS(t)){var c=t;t.addListener(e,r),s=function(){return c.removeListener(e,r)}}else if(t&&t.length)for(var l=0,p=t.length;l<p;l++)l0(t[l],e,r,n,i);else throw new TypeError("Invalid event target");n.add(s)}function iS(t){return t&&typeof t.addListener=="function"&&typeof t.removeListener=="function"}function sS(t){return t&&typeof t.on=="function"&&typeof t.off=="function"}function oS(t){return t&&typeof t.addEventListener=="function"&&typeof t.removeEventListener=="function"}function h0(t,e,r){return r?h0(t,e).pipe(qt(function(n){return Ct(n)?r.apply(void 0,n):r(n)})):new _e(function(n){var i=function(){for(var o=[],a=0;a<arguments.length;a++)o[a]=arguments[a];return n.next(o.length===1?o[0]:o)},s;try{s=t(i)}catch(o){n.error(o);return}if(Kn(e))return function(){return e(i,s)}})}function aS(t,e,r,n,i){var s,o;if(arguments.length==1){var a=t;o=a.initialState,e=a.condition,r=a.iterate,s=a.resultSelector||Or,i=a.scheduler}else n===void 0||Ot(n)?(o=t,s=Or,i=n):(o=t,s=n);return new _e(function(c){var l=o;if(i)return i.schedule(uS,0,{subscriber:c,iterate:r,condition:e,resultSelector:s,state:l});do{if(e){var p=void 0;try{p=e(l)}catch(y){c.error(y);return}if(!p){c.complete();break}}var g=void 0;try{g=s(l)}catch(y){c.error(y);return}if(c.next(g),c.closed)break;try{l=r(l)}catch(y){c.error(y);return}}while(!0)})}function uS(t){var e=t.subscriber,r=t.condition;if(!e.closed){if(t.needIterate)try{t.state=t.iterate(t.state)}catch(s){e.error(s);return}else t.needIterate=!0;if(r){var n=void 0;try{n=r(t.state)}catch(s){e.error(s);return}if(!n){e.complete();return}if(e.closed)return}var i;try{i=t.resultSelector(t.state)}catch(s){e.error(s);return}if(!e.closed&&(e.next(i),!e.closed))return this.schedule(t)}}function cS(t,e,r){return e===void 0&&(e=Xn),r===void 0&&(r=Xn),rc(function(){return t()?e:r})}function ti(t){return!Ct(t)&&t-parseFloat(t)+1>=0}function lS(t,e){return t===void 0&&(t=0),e===void 0&&(e=It),(!ti(t)||t<0)&&(t=0),(!e||typeof e.schedule!="function")&&(e=It),new _e(function(r){return r.add(e.schedule(hS,t,{subscriber:r,counter:0,period:t})),r})}function hS(t){var e=t.subscriber,r=t.counter,n=t.period;e.next(r),this.schedule({subscriber:e,counter:r+1,period:n},n)}function f0(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var r=Number.POSITIVE_INFINITY,n=null,i=t[t.length-1];return Ot(i)?(n=t.pop(),t.length>1&&typeof t[t.length-1]=="number"&&(r=t.pop())):typeof i=="number"&&(r=t.pop()),n===null&&t.length===1&&t[0]instanceof _e?t[0]:tc(r)(os(t,n))}var d0=new _e(ar);function fS(){return d0}function iu(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];if(t.length===0)return Xn;var r=t[0],n=t.slice(1);return t.length===1&&Ct(r)?iu.apply(void 0,r):new _e(function(i){var s=function(){return i.add(iu.apply(void 0,n).subscribe(i))};return xr(r).subscribe({next:function(o){i.next(o)},error:s,complete:s})})}function dS(t,e){return e?new _e(function(r){var n=Object.keys(t),i=new nt;return i.add(e.schedule(pS,0,{keys:n,index:0,subscriber:r,subscription:i,obj:t})),i}):new _e(function(r){for(var n=Object.keys(t),i=0;i<n.length&&!r.closed;i++){var s=n[i];t.hasOwnProperty(s)&&r.next([s,t[s]])}r.complete()})}function pS(t){var e=t.keys,r=t.index,n=t.subscriber,i=t.subscription,s=t.obj;if(!n.closed)if(r<e.length){var o=e[r];n.next([o,s[o]]),i.add(this.schedule({keys:e,index:r+1,subscriber:n,subscription:i,obj:s}))}else n.complete()}function p0(t,e){function r(){return!r.pred.apply(r.thisArg,arguments)}return r.pred=t,r.thisArg=e,r}function Br(t,e){return function(n){return n.lift(new gS(t,e))}}var gS=function(){function t(e,r){this.predicate=e,this.thisArg=r}return t.prototype.call=function(e,r){return r.subscribe(new bS(e,this.predicate,this.thisArg))},t}(),bS=function(t){G(e,t);function e(r,n,i){var s=t.call(this,r)||this;return s.predicate=n,s.thisArg=i,s.count=0,s}return e.prototype._next=function(r){var n;try{n=this.predicate.call(this.thisArg,r,this.count++)}catch(i){this.destination.error(i);return}n&&this.destination.next(r)},e}(ie);function vS(t,e,r){return[Br(e,r)(new _e(Bi(t))),Br(p0(e,r))(new _e(Bi(t)))]}function g0(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];if(t.length===1)if(Ct(t[0]))t=t[0];else return t[0];return os(t,void 0).lift(new mS)}var mS=function(){function t(){}return t.prototype.call=function(e,r){return r.subscribe(new yS(e))},t}(),yS=function(t){G(e,t);function e(r){var n=t.call(this,r)||this;return n.hasFirst=!1,n.observables=[],n.subscriptions=[],n}return e.prototype._next=function(r){this.observables.push(r)},e.prototype._complete=function(){var r=this.observables,n=r.length;if(n===0)this.destination.complete();else{for(var i=0;i<n&&!this.hasFirst;i++){var s=r[i],o=Er(this,s,void 0,i);this.subscriptions&&this.subscriptions.push(o),this.add(o)}this.observables=null}},e.prototype.notifyNext=function(r,n,i){if(!this.hasFirst){this.hasFirst=!0;for(var s=0;s<this.subscriptions.length;s++)if(s!==i){var o=this.subscriptions[s];o.unsubscribe(),this.remove(o)}this.subscriptions=null}this.destination.next(n)},e}(_n);function _S(t,e,r){return t===void 0&&(t=0),new _e(function(n){e===void 0&&(e=t,t=0);var i=0,s=t;if(r)return r.schedule(wS,0,{index:i,count:e,start:t,subscriber:n});do{if(i++>=e){n.complete();break}if(n.next(s++),n.closed)break}while(!0)})}function wS(t){var e=t.start,r=t.index,n=t.count,i=t.subscriber;if(r>=n){i.complete();return}i.next(e),!i.closed&&(t.index=r+1,t.start=e+1,this.schedule(t))}function b0(t,e,r){t===void 0&&(t=0);var n=-1;return ti(e)?n=Number(e)<1&&1||Number(e):Ot(e)&&(r=e),Ot(r)||(r=It),new _e(function(i){var s=ti(t)?t:+t-r.now();return r.schedule(ES,s,{index:0,period:n,subscriber:i})})}function ES(t){var e=t.index,r=t.period,n=t.subscriber;if(n.next(e),!n.closed){if(r===-1)return n.complete();t.index=e+1,this.schedule(t,r)}}function SS(t,e){return new _e(function(r){var n;try{n=t()}catch(a){r.error(a);return}var i;try{i=e(n)}catch(a){r.error(a);return}var s=i?xr(i):Xn,o=s.subscribe(r);return function(){o.unsubscribe(),n&&n.unsubscribe()}})}function v0(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var r=t[t.length-1];return typeof r=="function"&&t.pop(),os(t,void 0).lift(new m0(r))}var m0=function(){function t(e){this.resultSelector=e}return t.prototype.call=function(e,r){return r.subscribe(new xS(e,this.resultSelector))},t}(),xS=function(t){G(e,t);function e(r,n,i){var s=t.call(this,r)||this;return s.resultSelector=n,s.iterators=[],s.active=0,s.resultSelector=typeof n=="function"?n:void 0,s}return e.prototype._next=function(r){var n=this.iterators;Ct(r)?n.push(new CS(r)):typeof r[Lr]=="function"?n.push(new MS(r[Lr]())):n.push(new IS(this.destination,this,r))},e.prototype._complete=function(){var r=this.iterators,n=r.length;if(this.unsubscribe(),n===0){this.destination.complete();return}this.active=n;for(var i=0;i<n;i++){var s=r[i];if(s.stillUnsubscribed){var o=this.destination;o.add(s.subscribe())}else this.active--}},e.prototype.notifyInactive=function(){this.active--,this.active===0&&this.destination.complete()},e.prototype.checkIterators=function(){for(var r=this.iterators,n=r.length,i=this.destination,s=0;s<n;s++){var o=r[s];if(typeof o.hasValue=="function"&&!o.hasValue())return}for(var a=!1,c=[],s=0;s<n;s++){var o=r[s],l=o.next();if(o.hasCompleted()&&(a=!0),l.done){i.complete();return}c.push(l.value)}this.resultSelector?this._tryresultSelector(c):i.next(c),a&&i.complete()},e.prototype._tryresultSelector=function(r){var n;try{n=this.resultSelector.apply(this,r)}catch(i){this.destination.error(i);return}this.destination.next(n)},e}(ie),MS=function(){function t(e){this.iterator=e,this.nextResult=e.next()}return t.prototype.hasValue=function(){return!0},t.prototype.next=function(){var e=this.nextResult;return this.nextResult=this.iterator.next(),e},t.prototype.hasCompleted=function(){var e=this.nextResult;return!!(e&&e.done)},t}(),CS=function(){function t(e){this.array=e,this.index=0,this.length=0,this.length=e.length}return t.prototype[Lr]=function(){return this},t.prototype.next=function(e){var r=this.index++,n=this.array;return r<this.length?{value:n[r],done:!1}:{value:null,done:!0}},t.prototype.hasValue=function(){return this.array.length>this.index},t.prototype.hasCompleted=function(){return this.array.length===this.index},t}(),IS=function(t){G(e,t);function e(r,n,i){var s=t.call(this,r)||this;return s.parent=n,s.observable=i,s.stillUnsubscribed=!0,s.buffer=[],s.isComplete=!1,s}return e.prototype[Lr]=function(){return this},e.prototype.next=function(){var r=this.buffer;return r.length===0&&this.isComplete?{value:null,done:!0}:{value:r.shift(),done:!1}},e.prototype.hasValue=function(){return this.buffer.length>0},e.prototype.hasCompleted=function(){return this.buffer.length===0&&this.isComplete},e.prototype.notifyComplete=function(){this.buffer.length>0?(this.isComplete=!0,this.parent.notifyInactive()):this.destination.complete()},e.prototype.notifyNext=function(r){this.buffer.push(r),this.parent.checkIterators()},e.prototype.subscribe=function(){return ot(this.observable,new it(this))},e}(st);const RS=Object.freeze(Object.defineProperty({__proto__:null,ArgumentOutOfRangeError:ei,AsyncSubject:bi,BehaviorSubject:Gd,ConnectableObservable:qd,EMPTY:Xn,EmptyError:as,GroupedObservable:eu,NEVER:d0,Notification:_r,get NotificationKind(){return ru},ObjectUnsubscribedError:Ar,Observable:_e,ReplaySubject:Xu,Scheduler:tu,Subject:vt,Subscriber:ie,Subscription:nt,TimeoutError:r0,UnsubscriptionError:Ai,VirtualAction:t0,VirtualTimeScheduler:kE,animationFrame:TE,animationFrameScheduler:e0,asap:Ms,asapScheduler:Kd,async:It,asyncScheduler:Xd,bindCallback:n0,bindNodeCallback:i0,combineLatest:GE,concat:Pi,config:Ft,defer:rc,empty:gi,forkJoin:nS,from:xr,fromEvent:c0,fromEventPattern:h0,generate:aS,identity:Or,iif:cS,interval:lS,isObservable:NE,merge:f0,never:fS,noop:ar,observable:pi,of:xo,onErrorResumeNext:iu,pairs:dS,partition:vS,pipe:Xa,queue:Zd,queueScheduler:Jd,race:g0,range:_S,scheduled:a0,throwError:Ku,timer:b0,using:SS,zip:v0},Symbol.toStringTag,{value:"Module"})),Mo=si(RS);var Co={},Sr,Be,Aa,nh,ri=0,y0=[],Cs=[],ih=ve.__b,sh=ve.__r,oh=ve.diffed,ah=ve.__c,uh=ve.unmount;function wn(t,e){ve.__h&&ve.__h(Be,t,ri||e),ri=0;var r=Be.__H||(Be.__H={__:[],__h:[]});return t>=r.__.length&&r.__.push({__V:Cs}),r.__[t]}function _0(t){return ri=1,w0(S0,t)}function w0(t,e,r){var n=wn(Sr++,2);if(n.t=t,!n.__c&&(n.__=[r?r(e):S0(void 0,e),function(a){var c=n.__N?n.__N[0]:n.__[0],l=n.t(c,a);c!==l&&(n.__N=[l,n.__[1]],n.__c.setState({}))}],n.__c=Be,!Be.u)){var i=function(a,c,l){if(!n.__c.__H)return!0;var p=n.__c.__H.__.filter(function(y){return y.__c});if(p.every(function(y){return!y.__N}))return!s||s.call(this,a,c,l);var g=!1;return p.forEach(function(y){if(y.__N){var I=y.__[0];y.__=y.__N,y.__N=void 0,I!==y.__[0]&&(g=!0)}}),!(!g&&n.__c.props===a)&&(!s||s.call(this,a,c,l))};Be.u=!0;var s=Be.shouldComponentUpdate,o=Be.componentWillUpdate;Be.componentWillUpdate=function(a,c,l){if(this.__e){var p=s;s=void 0,i(a,c,l),s=p}o&&o.call(this,a,c,l)},Be.shouldComponentUpdate=i}return n.__N||n.__}function AS(t,e){var r=wn(Sr++,3);!ve.__s&&ic(r.__H,e)&&(r.__=t,r.i=e,Be.__H.__h.push(r))}function E0(t,e){var r=wn(Sr++,4);!ve.__s&&ic(r.__H,e)&&(r.__=t,r.i=e,Be.__h.push(r))}function TS(t){return ri=5,nc(function(){return{current:t}},[])}function kS(t,e,r){ri=6,E0(function(){return typeof t=="function"?(t(e()),function(){return t(null)}):t?(t.current=e(),function(){return t.current=null}):void 0},r==null?r:r.concat(t))}function nc(t,e){var r=wn(Sr++,7);return ic(r.__H,e)?(r.__V=t(),r.i=e,r.__h=t,r.__V):r.__}function NS(t,e){return ri=8,nc(function(){return t},e)}function OS(t){var e=Be.context[t.__c],r=wn(Sr++,9);return r.c=t,e?(r.__==null&&(r.__=!0,e.sub(Be)),e.props.value):t.__}function LS(t,e){ve.useDebugValue&&ve.useDebugValue(e?e(t):t)}function BS(t){var e=wn(Sr++,10),r=_0();return e.__=t,Be.componentDidCatch||(Be.componentDidCatch=function(n,i){e.__&&e.__(n,i),r[1](n)}),[r[0],function(){r[1](void 0)}]}function PS(){var t=wn(Sr++,11);if(!t.__){for(var e=Be.__v;e!==null&&!e.__m&&e.__!==null;)e=e.__;var r=e.__m||(e.__m=[0,0]);t.__="P"+r[0]+"-"+r[1]++}return t.__}function DS(){for(var t;t=y0.shift();)if(t.__P&&t.__H)try{t.__H.__h.forEach(Is),t.__H.__h.forEach(su),t.__H.__h=[]}catch(e){t.__H.__h=[],ve.__e(e,t.__v)}}ve.__b=function(t){Be=null,ih&&ih(t)},ve.__r=function(t){sh&&sh(t),Sr=0;var e=(Be=t.__c).__H;e&&(Aa===Be?(e.__h=[],Be.__h=[],e.__.forEach(function(r){r.__N&&(r.__=r.__N),r.__V=Cs,r.__N=r.i=void 0})):(e.__h.forEach(Is),e.__h.forEach(su),e.__h=[],Sr=0)),Aa=Be},ve.diffed=function(t){oh&&oh(t);var e=t.__c;e&&e.__H&&(e.__H.__h.length&&(y0.push(e)!==1&&nh===ve.requestAnimationFrame||((nh=ve.requestAnimationFrame)||jS)(DS)),e.__H.__.forEach(function(r){r.i&&(r.__H=r.i),r.__V!==Cs&&(r.__=r.__V),r.i=void 0,r.__V=Cs})),Aa=Be=null},ve.__c=function(t,e){e.some(function(r){try{r.__h.forEach(Is),r.__h=r.__h.filter(function(n){return!n.__||su(n)})}catch(n){e.some(function(i){i.__h&&(i.__h=[])}),e=[],ve.__e(n,r.__v)}}),ah&&ah(t,e)},ve.unmount=function(t){uh&&uh(t);var e,r=t.__c;r&&r.__H&&(r.__H.__.forEach(function(n){try{Is(n)}catch(i){e=i}}),r.__H=void 0,e&&ve.__e(e,r.__v))};var ch=typeof requestAnimationFrame=="function";function jS(t){var e,r=function(){clearTimeout(n),ch&&cancelAnimationFrame(e),setTimeout(t)},n=setTimeout(r,100);ch&&(e=requestAnimationFrame(r))}function Is(t){var e=Be,r=t.__c;typeof r=="function"&&(t.__c=void 0,r()),Be=e}function su(t){var e=Be;t.__c=t.__(),Be=e}function ic(t,e){return!t||t.length!==e.length||e.some(function(r,n){return r!==t[n]})}function S0(t,e){return typeof e=="function"?e(t):e}const $S=Object.freeze(Object.defineProperty({__proto__:null,useCallback:NS,useContext:OS,useDebugValue:LS,useEffect:AS,useErrorBoundary:BS,useId:PS,useImperativeHandle:kS,useLayoutEffect:E0,useMemo:nc,useReducer:w0,useRef:TS,useState:_0},Symbol.toStringTag,{value:"Module"})),us=si($S);var fr={},Io={};Object.defineProperty(Io,"__esModule",{value:!0});Io.CloseIcon=void 0;const lh=Lt;function FS(t){return(0,lh.h)("svg",Object.assign({width:"40",height:"40",viewBox:"0 0 40 40",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t),(0,lh.h)("path",{d:"M13.7677 13L12.3535 14.4142L18.3535 20.4142L12.3535 26.4142L13.7677 27.8284L19.7677 21.8284L25.7677 27.8284L27.1819 26.4142L21.1819 20.4142L27.1819 14.4142L25.7677 13L19.7677 19L13.7677 13Z"}))}Io.CloseIcon=FS;var sc={};Object.defineProperty(sc,"__esModule",{value:!0});sc.default="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjgiIGhlaWdodD0iMjgiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGNpcmNsZSBjeD0iMTQiIGN5PSIxNCIgcj0iMTQiIGZpbGw9IiMwMDUyRkYiLz48cGF0aCBkPSJNMTQuMDM3IDE4LjkyNmMtMi43NSAwLTQuOTA3LTIuMjA1LTQuOTA3LTQuOTI2IDAtMi43MiAyLjIzLTQuOTI2IDQuOTA3LTQuOTI2YTQuODY2IDQuODY2IDAgMCAxIDQuODMzIDQuMTE4aDQuOTgyYy0uNDQ2LTUuMDczLTQuNjg0LTkuMDQ0LTkuODE1LTkuMDQ0QzguNjEgNC4xNDggNC4xNDkgOC41NiA0LjE0OSAxNHM0LjM4NyA5Ljg1MiA5Ljg5IDkuODUyYzUuMjA0IDAgOS4zNjgtMy45NyA5LjgxNC05LjA0M0gxOC44N2E0Ljg2NiA0Ljg2NiAwIDAgMS00LjgzMyA0LjExN1oiIGZpbGw9IiNmZmYiLz48L3N2Zz4=";var oc={};Object.defineProperty(oc,"__esModule",{value:!0});oc.default="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjgiIGhlaWdodD0iMjgiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGNpcmNsZSBjeD0iMTQiIGN5PSIxNCIgcj0iMTQiIGZpbGw9IiMwMDUyRkYiLz48cGF0aCBkPSJNMjMuODUyIDE0QTkuODM0IDkuODM0IDAgMCAxIDE0IDIzLjg1MiA5LjgzNCA5LjgzNCAwIDAgMSA0LjE0OCAxNCA5LjgzNCA5LjgzNCAwIDAgMSAxNCA0LjE0OCA5LjgzNCA5LjgzNCAwIDAgMSAyMy44NTIgMTRaIiBmaWxsPSIjZmZmIi8+PHBhdGggZD0iTTExLjE4NSAxMi41MDRjMC0uNDU2IDAtLjcxLjA5OC0uODYyLjA5OC0uMTUyLjE5Ni0uMzA0LjM0My0uMzU1LjE5Ni0uMTAyLjM5Mi0uMTAyLjg4MS0uMTAyaDIuOTg2Yy40OSAwIC42ODYgMCAuODgyLjEwMi4xNDYuMTAxLjI5My4yMDMuMzQyLjM1NS4wOTguMjAzLjA5OC40MDYuMDk4Ljg2MnYyLjk5MmMwIC40NTcgMCAuNzEtLjA5OC44NjMtLjA5OC4xNTItLjE5NS4zMDQtLjM0Mi4zNTUtLjE5Ni4xMDEtLjM5Mi4xMDEtLjg4Mi4xMDFoLTIuOTg2Yy0uNDkgMC0uNjg1IDAtLjg4LS4xMDEtLjE0OC0uMTAyLS4yOTUtLjIwMy0uMzQ0LS4zNTUtLjA5OC0uMjAzLS4wOTgtLjQwNi0uMDk4LS44NjN2LTIuOTkyWiIgZmlsbD0iIzAwNTJGRiIvPjwvc3ZnPg==";var Ro={};Object.defineProperty(Ro,"__esModule",{value:!0});Ro.QRCodeIcon=void 0;const ir=Lt;function US(t){return(0,ir.h)("svg",Object.assign({width:"10",height:"10",viewBox:"0 0 10 10",xmlns:"http://www.w3.org/2000/svg"},t),(0,ir.h)("path",{d:"M8.2271 1.77124L7.0271 1.77124V2.97124H8.2271V1.77124Z"}),(0,ir.h)("path",{d:"M5.44922 0.199219L5.44922 4.54922L9.79922 4.54922V0.199219L5.44922 0.199219ZM8.89922 3.64922L6.34922 3.64922L6.34922 1.09922L8.89922 1.09922V3.64922Z"}),(0,ir.h)("path",{d:"M2.97124 1.77124L1.77124 1.77124L1.77124 2.97124H2.97124V1.77124Z"}),(0,ir.h)("path",{d:"M0.199219 4.54922L4.54922 4.54922L4.54922 0.199219L0.199219 0.199219L0.199219 4.54922ZM1.09922 1.09922L3.64922 1.09922L3.64922 3.64922L1.09922 3.64922L1.09922 1.09922Z"}),(0,ir.h)("path",{d:"M2.97124 7.0271H1.77124L1.77124 8.2271H2.97124V7.0271Z"}),(0,ir.h)("path",{d:"M0.199219 9.79922H4.54922L4.54922 5.44922L0.199219 5.44922L0.199219 9.79922ZM1.09922 6.34922L3.64922 6.34922L3.64922 8.89922H1.09922L1.09922 6.34922Z"}),(0,ir.h)("path",{d:"M8.89922 7.39912H7.99922V5.40112H5.44922L5.44922 9.79912H6.34922L6.34922 6.30112H7.09922V8.29912H9.79922V5.40112H8.89922V7.39912Z"}),(0,ir.h)("path",{d:"M7.99912 8.89917H7.09912V9.79917H7.99912V8.89917Z"}),(0,ir.h)("path",{d:"M9.79917 8.89917H8.89917V9.79917H9.79917V8.89917Z"}))}Ro.QRCodeIcon=US;var ac={};Object.defineProperty(ac,"__esModule",{value:!0});const HS=`
14
+ <svg width="100" height="100" viewBox="0 0 100 100" fill="none" xmlns="http://www.w3.org/2000/svg">
15
+ <path d="M50 100C77.6142 100 100 77.6142 100 50C100 22.3858 77.6142 0 50 0C22.3858 0 0 22.3858 0 50C0 77.6142 22.3858 100 50 100Z" fill="white"/>
16
+ <path d="M50.512 94C74.2907 94 93.5673 74.5244 93.5673 50.5C93.5673 26.4756 74.2907 7 50.512 7C26.7332 7 7.45667 26.4756 7.45667 50.5C7.45667 74.5244 26.7332 94 50.512 94Z" fill="#0052FF"/>
17
+ <path d="M50.6248 65.4335C42.3697 65.4335 35.8996 58.7469 35.8996 50.5C35.8996 42.2531 42.5928 35.5664 50.6248 35.5664C57.9873 35.5664 64.0111 40.9157 65.1267 48.0481H80.0749C78.7363 32.6688 66.0191 20.6328 50.6248 20.6328C34.3379 20.6328 20.9514 34.0062 20.9514 50.5C20.9514 66.9936 34.1148 80.3671 50.6248 80.3671C66.2422 80.3671 78.7363 68.331 80.0749 52.9516H65.1267C64.0111 60.0841 57.9873 65.4335 50.6248 65.4335Z" fill="white"/>
18
+ </svg>
19
+ `;ac.default=HS;var uc={};Object.defineProperty(uc,"__esModule",{value:!0});uc.default=`
20
+ <svg width="100" height="100" viewBox="0 0 100 100" fill="none" xmlns="http://www.w3.org/2000/svg">
21
+ <circle cx="50" cy="50" r="50" fill="white"/>
22
+ <circle cx="49.9996" cy="49.9996" r="43.6363" fill="#1B53E4"/>
23
+ <circle cx="49.9996" cy="49.9996" r="43.6363" stroke="white"/>
24
+ <path fill-rule="evenodd" clip-rule="evenodd" d="M19.3379 49.9484C19.3379 66.8508 33.04 80.553 49.9425 80.553C66.8449 80.553 80.5471 66.8508 80.5471 49.9484C80.5471 33.0459 66.8449 19.3438 49.9425 19.3438C33.04 19.3438 19.3379 33.0459 19.3379 49.9484ZM44.0817 40.0799C41.8725 40.0799 40.0817 41.8708 40.0817 44.0799V55.8029C40.0817 58.012 41.8725 59.8029 44.0817 59.8029H55.8046C58.0138 59.8029 59.8046 58.012 59.8046 55.8029V44.0799C59.8046 41.8708 58.0138 40.0799 55.8046 40.0799H44.0817Z" fill="white"/>
25
+ </svg>
26
+ `;var Ao={};Object.defineProperty(Ao,"__esModule",{value:!0});Ao.StatusDotIcon=void 0;const hh=Lt;function WS(t){return(0,hh.h)("svg",Object.assign({width:"10",height:"10",viewBox:"0 0 10 10",xmlns:"http://www.w3.org/2000/svg"},t),(0,hh.h)("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M2.29995 4.99995C2.29995 5.57985 1.82985 6.04995 1.24995 6.04995C0.670052 6.04995 0.199951 5.57985 0.199951 4.99995C0.199951 4.42005 0.670052 3.94995 1.24995 3.94995C1.82985 3.94995 2.29995 4.42005 2.29995 4.99995ZM4.99995 6.04995C5.57985 6.04995 6.04995 5.57985 6.04995 4.99995C6.04995 4.42005 5.57985 3.94995 4.99995 3.94995C4.42005 3.94995 3.94995 4.42005 3.94995 4.99995C3.94995 5.57985 4.42005 6.04995 4.99995 6.04995ZM8.74995 6.04995C9.32985 6.04995 9.79995 5.57985 9.79995 4.99995C9.79995 4.42005 9.32985 3.94995 8.74995 3.94995C8.17005 3.94995 7.69995 4.42005 7.69995 4.99995C7.69995 5.57985 8.17005 6.04995 8.74995 6.04995Z"}))}Ao.StatusDotIcon=WS;var To={};function x0(t){this.mode=kt.MODE_8BIT_BYTE,this.data=t,this.parsedData=[];for(var e=0,r=this.data.length;e<r;e++){var n=[],i=this.data.charCodeAt(e);i>65536?(n[0]=240|(i&1835008)>>>18,n[1]=128|(i&258048)>>>12,n[2]=128|(i&4032)>>>6,n[3]=128|i&63):i>2048?(n[0]=224|(i&61440)>>>12,n[1]=128|(i&4032)>>>6,n[2]=128|i&63):i>128?(n[0]=192|(i&1984)>>>6,n[1]=128|i&63):n[0]=i,this.parsedData.push(n)}this.parsedData=Array.prototype.concat.apply([],this.parsedData),this.parsedData.length!=this.data.length&&(this.parsedData.unshift(191),this.parsedData.unshift(187),this.parsedData.unshift(239))}x0.prototype={getLength:function(t){return this.parsedData.length},write:function(t){for(var e=0,r=this.parsedData.length;e<r;e++)t.put(this.parsedData[e],8)}};function dr(t,e){this.typeNumber=t,this.errorCorrectLevel=e,this.modules=null,this.moduleCount=0,this.dataCache=null,this.dataList=[]}dr.prototype={addData:function(t){var e=new x0(t);this.dataList.push(e),this.dataCache=null},isDark:function(t,e){if(t<0||this.moduleCount<=t||e<0||this.moduleCount<=e)throw new Error(t+","+e);return this.modules[t][e]},getModuleCount:function(){return this.moduleCount},make:function(){this.makeImpl(!1,this.getBestMaskPattern())},makeImpl:function(t,e){this.moduleCount=this.typeNumber*4+17,this.modules=new Array(this.moduleCount);for(var r=0;r<this.moduleCount;r++){this.modules[r]=new Array(this.moduleCount);for(var n=0;n<this.moduleCount;n++)this.modules[r][n]=null}this.setupPositionProbePattern(0,0),this.setupPositionProbePattern(this.moduleCount-7,0),this.setupPositionProbePattern(0,this.moduleCount-7),this.setupPositionAdjustPattern(),this.setupTimingPattern(),this.setupTypeInfo(t,e),this.typeNumber>=7&&this.setupTypeNumber(t),this.dataCache==null&&(this.dataCache=dr.createData(this.typeNumber,this.errorCorrectLevel,this.dataList)),this.mapData(this.dataCache,e)},setupPositionProbePattern:function(t,e){for(var r=-1;r<=7;r++)if(!(t+r<=-1||this.moduleCount<=t+r))for(var n=-1;n<=7;n++)e+n<=-1||this.moduleCount<=e+n||(0<=r&&r<=6&&(n==0||n==6)||0<=n&&n<=6&&(r==0||r==6)||2<=r&&r<=4&&2<=n&&n<=4?this.modules[t+r][e+n]=!0:this.modules[t+r][e+n]=!1)},getBestMaskPattern:function(){for(var t=0,e=0,r=0;r<8;r++){this.makeImpl(!0,r);var n=tt.getLostPoint(this);(r==0||t>n)&&(t=n,e=r)}return e},createMovieClip:function(t,e,r){var n=t.createEmptyMovieClip(e,r),i=1;this.make();for(var s=0;s<this.modules.length;s++)for(var o=s*i,a=0;a<this.modules[s].length;a++){var c=a*i,l=this.modules[s][a];l&&(n.beginFill(0,100),n.moveTo(c,o),n.lineTo(c+i,o),n.lineTo(c+i,o+i),n.lineTo(c,o+i),n.endFill())}return n},setupTimingPattern:function(){for(var t=8;t<this.moduleCount-8;t++)this.modules[t][6]==null&&(this.modules[t][6]=t%2==0);for(var e=8;e<this.moduleCount-8;e++)this.modules[6][e]==null&&(this.modules[6][e]=e%2==0)},setupPositionAdjustPattern:function(){for(var t=tt.getPatternPosition(this.typeNumber),e=0;e<t.length;e++)for(var r=0;r<t.length;r++){var n=t[e],i=t[r];if(this.modules[n][i]==null)for(var s=-2;s<=2;s++)for(var o=-2;o<=2;o++)s==-2||s==2||o==-2||o==2||s==0&&o==0?this.modules[n+s][i+o]=!0:this.modules[n+s][i+o]=!1}},setupTypeNumber:function(t){for(var e=tt.getBCHTypeNumber(this.typeNumber),r=0;r<18;r++){var n=!t&&(e>>r&1)==1;this.modules[Math.floor(r/3)][r%3+this.moduleCount-8-3]=n}for(var r=0;r<18;r++){var n=!t&&(e>>r&1)==1;this.modules[r%3+this.moduleCount-8-3][Math.floor(r/3)]=n}},setupTypeInfo:function(t,e){for(var r=this.errorCorrectLevel<<3|e,n=tt.getBCHTypeInfo(r),i=0;i<15;i++){var s=!t&&(n>>i&1)==1;i<6?this.modules[i][8]=s:i<8?this.modules[i+1][8]=s:this.modules[this.moduleCount-15+i][8]=s}for(var i=0;i<15;i++){var s=!t&&(n>>i&1)==1;i<8?this.modules[8][this.moduleCount-i-1]=s:i<9?this.modules[8][15-i-1+1]=s:this.modules[8][15-i-1]=s}this.modules[this.moduleCount-8][8]=!t},mapData:function(t,e){for(var r=-1,n=this.moduleCount-1,i=7,s=0,o=this.moduleCount-1;o>0;o-=2)for(o==6&&o--;;){for(var a=0;a<2;a++)if(this.modules[n][o-a]==null){var c=!1;s<t.length&&(c=(t[s]>>>i&1)==1);var l=tt.getMask(e,n,o-a);l&&(c=!c),this.modules[n][o-a]=c,i--,i==-1&&(s++,i=7)}if(n+=r,n<0||this.moduleCount<=n){n-=r,r=-r;break}}}};dr.PAD0=236;dr.PAD1=17;dr.createData=function(t,e,r){for(var n=cr.getRSBlocks(t,e),i=new M0,s=0;s<r.length;s++){var o=r[s];i.put(o.mode,4),i.put(o.getLength(),tt.getLengthInBits(o.mode,t)),o.write(i)}for(var a=0,s=0;s<n.length;s++)a+=n[s].dataCount;if(i.getLengthInBits()>a*8)throw new Error("code length overflow. ("+i.getLengthInBits()+">"+a*8+")");for(i.getLengthInBits()+4<=a*8&&i.put(0,4);i.getLengthInBits()%8!=0;)i.putBit(!1);for(;!(i.getLengthInBits()>=a*8||(i.put(dr.PAD0,8),i.getLengthInBits()>=a*8));)i.put(dr.PAD1,8);return dr.createBytes(i,n)};dr.createBytes=function(t,e){for(var r=0,n=0,i=0,s=new Array(e.length),o=new Array(e.length),a=0;a<e.length;a++){var c=e[a].dataCount,l=e[a].totalCount-c;n=Math.max(n,c),i=Math.max(i,l),s[a]=new Array(c);for(var p=0;p<s[a].length;p++)s[a][p]=255&t.buffer[p+r];r+=c;var g=tt.getErrorCorrectPolynomial(l),y=new Vn(s[a],g.getLength()-1),I=y.mod(g);o[a]=new Array(g.getLength()-1);for(var p=0;p<o[a].length;p++){var T=p+I.getLength()-o[a].length;o[a][p]=T>=0?I.get(T):0}}for(var D=0,p=0;p<e.length;p++)D+=e[p].totalCount;for(var U=new Array(D),M=0,p=0;p<n;p++)for(var a=0;a<e.length;a++)p<s[a].length&&(U[M++]=s[a][p]);for(var p=0;p<i;p++)for(var a=0;a<e.length;a++)p<o[a].length&&(U[M++]=o[a][p]);return U};var kt={MODE_NUMBER:1,MODE_ALPHA_NUM:2,MODE_8BIT_BYTE:4,MODE_KANJI:8},Tr={L:1,M:0,Q:3,H:2},Mr={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7},tt={PATTERN_POSITION_TABLE:[[],[6,18],[6,22],[6,26],[6,30],[6,34],[6,22,38],[6,24,42],[6,26,46],[6,28,50],[6,30,54],[6,32,58],[6,34,62],[6,26,46,66],[6,26,48,70],[6,26,50,74],[6,30,54,78],[6,30,56,82],[6,30,58,86],[6,34,62,90],[6,28,50,72,94],[6,26,50,74,98],[6,30,54,78,102],[6,28,54,80,106],[6,32,58,84,110],[6,30,58,86,114],[6,34,62,90,118],[6,26,50,74,98,122],[6,30,54,78,102,126],[6,26,52,78,104,130],[6,30,56,82,108,134],[6,34,60,86,112,138],[6,30,58,86,114,142],[6,34,62,90,118,146],[6,30,54,78,102,126,150],[6,24,50,76,102,128,154],[6,28,54,80,106,132,158],[6,32,58,84,110,136,162],[6,26,54,82,110,138,166],[6,30,58,86,114,142,170]],G15:1335,G18:7973,G15_MASK:21522,getBCHTypeInfo:function(t){for(var e=t<<10;tt.getBCHDigit(e)-tt.getBCHDigit(tt.G15)>=0;)e^=tt.G15<<tt.getBCHDigit(e)-tt.getBCHDigit(tt.G15);return(t<<10|e)^tt.G15_MASK},getBCHTypeNumber:function(t){for(var e=t<<12;tt.getBCHDigit(e)-tt.getBCHDigit(tt.G18)>=0;)e^=tt.G18<<tt.getBCHDigit(e)-tt.getBCHDigit(tt.G18);return t<<12|e},getBCHDigit:function(t){for(var e=0;t!=0;)e++,t>>>=1;return e},getPatternPosition:function(t){return tt.PATTERN_POSITION_TABLE[t-1]},getMask:function(t,e,r){switch(t){case Mr.PATTERN000:return(e+r)%2==0;case Mr.PATTERN001:return e%2==0;case Mr.PATTERN010:return r%3==0;case Mr.PATTERN011:return(e+r)%3==0;case Mr.PATTERN100:return(Math.floor(e/2)+Math.floor(r/3))%2==0;case Mr.PATTERN101:return e*r%2+e*r%3==0;case Mr.PATTERN110:return(e*r%2+e*r%3)%2==0;case Mr.PATTERN111:return(e*r%3+(e+r)%2)%2==0;default:throw new Error("bad maskPattern:"+t)}},getErrorCorrectPolynomial:function(t){for(var e=new Vn([1],0),r=0;r<t;r++)e=e.multiply(new Vn([1,bt.gexp(r)],0));return e},getLengthInBits:function(t,e){if(1<=e&&e<10)switch(t){case kt.MODE_NUMBER:return 10;case kt.MODE_ALPHA_NUM:return 9;case kt.MODE_8BIT_BYTE:return 8;case kt.MODE_KANJI:return 8;default:throw new Error("mode:"+t)}else if(e<27)switch(t){case kt.MODE_NUMBER:return 12;case kt.MODE_ALPHA_NUM:return 11;case kt.MODE_8BIT_BYTE:return 16;case kt.MODE_KANJI:return 10;default:throw new Error("mode:"+t)}else if(e<41)switch(t){case kt.MODE_NUMBER:return 14;case kt.MODE_ALPHA_NUM:return 13;case kt.MODE_8BIT_BYTE:return 16;case kt.MODE_KANJI:return 12;default:throw new Error("mode:"+t)}else throw new Error("type:"+e)},getLostPoint:function(t){for(var e=t.getModuleCount(),r=0,n=0;n<e;n++)for(var i=0;i<e;i++){for(var s=0,o=t.isDark(n,i),a=-1;a<=1;a++)if(!(n+a<0||e<=n+a))for(var c=-1;c<=1;c++)i+c<0||e<=i+c||a==0&&c==0||o==t.isDark(n+a,i+c)&&s++;s>5&&(r+=3+s-5)}for(var n=0;n<e-1;n++)for(var i=0;i<e-1;i++){var l=0;t.isDark(n,i)&&l++,t.isDark(n+1,i)&&l++,t.isDark(n,i+1)&&l++,t.isDark(n+1,i+1)&&l++,(l==0||l==4)&&(r+=3)}for(var n=0;n<e;n++)for(var i=0;i<e-6;i++)t.isDark(n,i)&&!t.isDark(n,i+1)&&t.isDark(n,i+2)&&t.isDark(n,i+3)&&t.isDark(n,i+4)&&!t.isDark(n,i+5)&&t.isDark(n,i+6)&&(r+=40);for(var i=0;i<e;i++)for(var n=0;n<e-6;n++)t.isDark(n,i)&&!t.isDark(n+1,i)&&t.isDark(n+2,i)&&t.isDark(n+3,i)&&t.isDark(n+4,i)&&!t.isDark(n+5,i)&&t.isDark(n+6,i)&&(r+=40);for(var p=0,i=0;i<e;i++)for(var n=0;n<e;n++)t.isDark(n,i)&&p++;var g=Math.abs(100*p/e/e-50)/5;return r+=g*10,r}},bt={glog:function(t){if(t<1)throw new Error("glog("+t+")");return bt.LOG_TABLE[t]},gexp:function(t){for(;t<0;)t+=255;for(;t>=256;)t-=255;return bt.EXP_TABLE[t]},EXP_TABLE:new Array(256),LOG_TABLE:new Array(256)};for(var yt=0;yt<8;yt++)bt.EXP_TABLE[yt]=1<<yt;for(var yt=8;yt<256;yt++)bt.EXP_TABLE[yt]=bt.EXP_TABLE[yt-4]^bt.EXP_TABLE[yt-5]^bt.EXP_TABLE[yt-6]^bt.EXP_TABLE[yt-8];for(var yt=0;yt<255;yt++)bt.LOG_TABLE[bt.EXP_TABLE[yt]]=yt;function Vn(t,e){if(t.length==null)throw new Error(t.length+"/"+e);for(var r=0;r<t.length&&t[r]==0;)r++;this.num=new Array(t.length-r+e);for(var n=0;n<t.length-r;n++)this.num[n]=t[n+r]}Vn.prototype={get:function(t){return this.num[t]},getLength:function(){return this.num.length},multiply:function(t){for(var e=new Array(this.getLength()+t.getLength()-1),r=0;r<this.getLength();r++)for(var n=0;n<t.getLength();n++)e[r+n]^=bt.gexp(bt.glog(this.get(r))+bt.glog(t.get(n)));return new Vn(e,0)},mod:function(t){if(this.getLength()-t.getLength()<0)return this;for(var e=bt.glog(this.get(0))-bt.glog(t.get(0)),r=new Array(this.getLength()),n=0;n<this.getLength();n++)r[n]=this.get(n);for(var n=0;n<t.getLength();n++)r[n]^=bt.gexp(bt.glog(t.get(n))+e);return new Vn(r,0).mod(t)}};function cr(t,e){this.totalCount=t,this.dataCount=e}cr.RS_BLOCK_TABLE=[[1,26,19],[1,26,16],[1,26,13],[1,26,9],[1,44,34],[1,44,28],[1,44,22],[1,44,16],[1,70,55],[1,70,44],[2,35,17],[2,35,13],[1,100,80],[2,50,32],[2,50,24],[4,25,9],[1,134,108],[2,67,43],[2,33,15,2,34,16],[2,33,11,2,34,12],[2,86,68],[4,43,27],[4,43,19],[4,43,15],[2,98,78],[4,49,31],[2,32,14,4,33,15],[4,39,13,1,40,14],[2,121,97],[2,60,38,2,61,39],[4,40,18,2,41,19],[4,40,14,2,41,15],[2,146,116],[3,58,36,2,59,37],[4,36,16,4,37,17],[4,36,12,4,37,13],[2,86,68,2,87,69],[4,69,43,1,70,44],[6,43,19,2,44,20],[6,43,15,2,44,16],[4,101,81],[1,80,50,4,81,51],[4,50,22,4,51,23],[3,36,12,8,37,13],[2,116,92,2,117,93],[6,58,36,2,59,37],[4,46,20,6,47,21],[7,42,14,4,43,15],[4,133,107],[8,59,37,1,60,38],[8,44,20,4,45,21],[12,33,11,4,34,12],[3,145,115,1,146,116],[4,64,40,5,65,41],[11,36,16,5,37,17],[11,36,12,5,37,13],[5,109,87,1,110,88],[5,65,41,5,66,42],[5,54,24,7,55,25],[11,36,12],[5,122,98,1,123,99],[7,73,45,3,74,46],[15,43,19,2,44,20],[3,45,15,13,46,16],[1,135,107,5,136,108],[10,74,46,1,75,47],[1,50,22,15,51,23],[2,42,14,17,43,15],[5,150,120,1,151,121],[9,69,43,4,70,44],[17,50,22,1,51,23],[2,42,14,19,43,15],[3,141,113,4,142,114],[3,70,44,11,71,45],[17,47,21,4,48,22],[9,39,13,16,40,14],[3,135,107,5,136,108],[3,67,41,13,68,42],[15,54,24,5,55,25],[15,43,15,10,44,16],[4,144,116,4,145,117],[17,68,42],[17,50,22,6,51,23],[19,46,16,6,47,17],[2,139,111,7,140,112],[17,74,46],[7,54,24,16,55,25],[34,37,13],[4,151,121,5,152,122],[4,75,47,14,76,48],[11,54,24,14,55,25],[16,45,15,14,46,16],[6,147,117,4,148,118],[6,73,45,14,74,46],[11,54,24,16,55,25],[30,46,16,2,47,17],[8,132,106,4,133,107],[8,75,47,13,76,48],[7,54,24,22,55,25],[22,45,15,13,46,16],[10,142,114,2,143,115],[19,74,46,4,75,47],[28,50,22,6,51,23],[33,46,16,4,47,17],[8,152,122,4,153,123],[22,73,45,3,74,46],[8,53,23,26,54,24],[12,45,15,28,46,16],[3,147,117,10,148,118],[3,73,45,23,74,46],[4,54,24,31,55,25],[11,45,15,31,46,16],[7,146,116,7,147,117],[21,73,45,7,74,46],[1,53,23,37,54,24],[19,45,15,26,46,16],[5,145,115,10,146,116],[19,75,47,10,76,48],[15,54,24,25,55,25],[23,45,15,25,46,16],[13,145,115,3,146,116],[2,74,46,29,75,47],[42,54,24,1,55,25],[23,45,15,28,46,16],[17,145,115],[10,74,46,23,75,47],[10,54,24,35,55,25],[19,45,15,35,46,16],[17,145,115,1,146,116],[14,74,46,21,75,47],[29,54,24,19,55,25],[11,45,15,46,46,16],[13,145,115,6,146,116],[14,74,46,23,75,47],[44,54,24,7,55,25],[59,46,16,1,47,17],[12,151,121,7,152,122],[12,75,47,26,76,48],[39,54,24,14,55,25],[22,45,15,41,46,16],[6,151,121,14,152,122],[6,75,47,34,76,48],[46,54,24,10,55,25],[2,45,15,64,46,16],[17,152,122,4,153,123],[29,74,46,14,75,47],[49,54,24,10,55,25],[24,45,15,46,46,16],[4,152,122,18,153,123],[13,74,46,32,75,47],[48,54,24,14,55,25],[42,45,15,32,46,16],[20,147,117,4,148,118],[40,75,47,7,76,48],[43,54,24,22,55,25],[10,45,15,67,46,16],[19,148,118,6,149,119],[18,75,47,31,76,48],[34,54,24,34,55,25],[20,45,15,61,46,16]];cr.getRSBlocks=function(t,e){var r=cr.getRsBlockTable(t,e);if(r==null)throw new Error("bad rs block @ typeNumber:"+t+"/errorCorrectLevel:"+e);for(var n=r.length/3,i=[],s=0;s<n;s++)for(var o=r[s*3+0],a=r[s*3+1],c=r[s*3+2],l=0;l<o;l++)i.push(new cr(a,c));return i};cr.getRsBlockTable=function(t,e){switch(e){case Tr.L:return cr.RS_BLOCK_TABLE[(t-1)*4+0];case Tr.M:return cr.RS_BLOCK_TABLE[(t-1)*4+1];case Tr.Q:return cr.RS_BLOCK_TABLE[(t-1)*4+2];case Tr.H:return cr.RS_BLOCK_TABLE[(t-1)*4+3];default:return}};function M0(){this.buffer=[],this.length=0}M0.prototype={get:function(t){var e=Math.floor(t/8);return(this.buffer[e]>>>7-t%8&1)==1},put:function(t,e){for(var r=0;r<e;r++)this.putBit((t>>>e-r-1&1)==1)},getLengthInBits:function(){return this.length},putBit:function(t){var e=Math.floor(this.length/8);this.buffer.length<=e&&this.buffer.push(0),t&&(this.buffer[e]|=128>>>this.length%8),this.length++}};var Ta=[[17,14,11,7],[32,26,20,14],[53,42,32,24],[78,62,46,34],[106,84,60,44],[134,106,74,58],[154,122,86,64],[192,152,108,84],[230,180,130,98],[271,213,151,119],[321,251,177,137],[367,287,203,155],[425,331,241,177],[458,362,258,194],[520,412,292,220],[586,450,322,250],[644,504,364,280],[718,560,394,310],[792,624,442,338],[858,666,482,382],[929,711,509,403],[1003,779,565,439],[1091,857,611,461],[1171,911,661,511],[1273,997,715,535],[1367,1059,751,593],[1465,1125,805,625],[1528,1190,868,658],[1628,1264,908,698],[1732,1370,982,742],[1840,1452,1030,790],[1952,1538,1112,842],[2068,1628,1168,898],[2188,1722,1228,958],[2303,1809,1283,983],[2431,1911,1351,1051],[2563,1989,1423,1093],[2699,2099,1499,1139],[2809,2213,1579,1219],[2953,2331,1663,1273]];function C0(t){if(this.options={padding:4,width:256,height:256,typeNumber:4,color:"#000000",background:"#ffffff",ecl:"M",image:{svg:"",width:0,height:0}},typeof t=="string"&&(t={content:t}),t)for(var e in t)this.options[e]=t[e];if(typeof this.options.content!="string")throw new Error("Expected 'content' as string!");if(this.options.content.length===0)throw new Error("Expected 'content' to be non-empty!");if(!(this.options.padding>=0))throw new Error("Expected 'padding' value to be non-negative!");if(!(this.options.width>0)||!(this.options.height>0))throw new Error("Expected 'width' or 'height' value to be higher than zero!");function r(c){switch(c){case"L":return Tr.L;case"M":return Tr.M;case"Q":return Tr.Q;case"H":return Tr.H;default:throw new Error("Unknwon error correction level: "+c)}}function n(c,l){for(var p=i(c),g=1,y=0,I=0,T=Ta.length;I<=T;I++){var D=Ta[I];if(!D)throw new Error("Content too long: expected "+y+" but got "+p);switch(l){case"L":y=D[0];break;case"M":y=D[1];break;case"Q":y=D[2];break;case"H":y=D[3];break;default:throw new Error("Unknwon error correction level: "+l)}if(p<=y)break;g++}if(g>Ta.length)throw new Error("Content too long");return g}function i(c){var l=encodeURI(c).toString().replace(/\%[0-9a-fA-F]{2}/g,"a");return l.length+(l.length!=c?3:0)}var s=this.options.content,o=n(s,this.options.ecl),a=r(this.options.ecl);this.qrcode=new dr(o,a),this.qrcode.addData(s),this.qrcode.make()}C0.prototype.svg=function(t){var e=this.options||{},r=this.qrcode.modules;typeof t>"u"&&(t={container:e.container||"svg"});for(var n=typeof e.pretty<"u"?!!e.pretty:!0,i=n?" ":"",s=n?`\r
27
+ `:"",o=e.width,a=e.height,c=r.length,l=o/(c+2*e.padding),p=a/(c+2*e.padding),g=typeof e.join<"u"?!!e.join:!1,y=typeof e.swap<"u"?!!e.swap:!1,I=typeof e.xmlDeclaration<"u"?!!e.xmlDeclaration:!0,T=typeof e.predefined<"u"?!!e.predefined:!1,D=T?i+'<defs><path id="qrmodule" d="M0 0 h'+p+" v"+l+' H0 z" style="fill:'+e.color+';shape-rendering:crispEdges;" /></defs>'+s:"",U=i+'<rect x="0" y="0" width="'+o+'" height="'+a+'" style="fill:'+e.background+';shape-rendering:crispEdges;"/>'+s,M="",N="",j=0;j<c;j++)for(var H=0;H<c;H++){var F=r[H][j];if(F){var z=H*l+e.padding*l,X=j*p+e.padding*p;if(y){var K=z;z=X,X=K}if(g){var J=l+z,ne=p+X;z=Number.isInteger(z)?Number(z):z.toFixed(2),X=Number.isInteger(X)?Number(X):X.toFixed(2),J=Number.isInteger(J)?Number(J):J.toFixed(2),ne=Number.isInteger(ne)?Number(ne):ne.toFixed(2),N+="M"+z+","+X+" V"+ne+" H"+J+" V"+X+" H"+z+" Z "}else T?M+=i+'<use x="'+z.toString()+'" y="'+X.toString()+'" href="#qrmodule" />'+s:M+=i+'<rect x="'+z.toString()+'" y="'+X.toString()+'" width="'+l+'" height="'+p+'" style="fill:'+e.color+';shape-rendering:crispEdges;"/>'+s}}g&&(M=i+'<path x="0" y="0" style="fill:'+e.color+';shape-rendering:crispEdges;" d="'+N+'" />');let oe="";if(this.options.image!==void 0&&this.options.image.svg){const w=o*this.options.image.width/100,u=a*this.options.image.height/100,b=o/2-w/2,m=a/2-u/2;oe+=`<svg x="${b}" y="${m}" width="${w}" height="${u}" viewBox="0 0 100 100" preserveAspectRatio="xMinYMin meet">`,oe+=this.options.image.svg+s,oe+="</svg>"}var ue="";switch(t.container){case"svg":I&&(ue+='<?xml version="1.0" standalone="yes"?>'+s),ue+='<svg xmlns="http://www.w3.org/2000/svg" version="1.1" width="'+o+'" height="'+a+'">'+s,ue+=D+U+M,ue+=oe,ue+="</svg>";break;case"svg-viewbox":I&&(ue+='<?xml version="1.0" standalone="yes"?>'+s),ue+='<svg xmlns="http://www.w3.org/2000/svg" version="1.1" viewBox="0 0 '+o+" "+a+'">'+s,ue+=D+U+M,ue+=oe,ue+="</svg>";break;case"g":ue+='<g width="'+o+'" height="'+a+'">'+s,ue+=D+U+M,ue+=oe,ue+="</g>";break;default:ue+=(D+U+M+oe).replace(/^\s+/,"");break}return ue};var VS=C0,zS=te&&te.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(To,"__esModule",{value:!0});To.QRCode=void 0;const qS=Lt,fh=us,GS=zS(VS),JS=t=>{const[e,r]=(0,fh.useState)("");return(0,fh.useEffect)(()=>{var n,i;const s=new GS.default({content:t.content,background:t.bgColor||"#ffffff",color:t.fgColor||"#000000",container:"svg",ecl:"M",width:(n=t.width)!==null&&n!==void 0?n:256,height:(i=t.height)!==null&&i!==void 0?i:256,padding:0,image:t.image}),o=ye.from(s.svg(),"utf8").toString("base64");r(`data:image/svg+xml;base64,${o}`)}),e?(0,qS.h)("img",{src:e,alt:"QR Code"}):null};To.QRCode=JS;var ko={},cc={};Object.defineProperty(cc,"__esModule",{value:!0});cc.default=".-cbwsdk-css-reset .-cbwsdk-spinner{display:inline-block}.-cbwsdk-css-reset .-cbwsdk-spinner svg{display:inline-block;animation:2s linear infinite -cbwsdk-spinner-svg}.-cbwsdk-css-reset .-cbwsdk-spinner svg circle{animation:1.9s ease-in-out infinite both -cbwsdk-spinner-circle;display:block;fill:rgba(0,0,0,0);stroke-dasharray:283;stroke-dashoffset:280;stroke-linecap:round;stroke-width:10px;transform-origin:50% 50%}@keyframes -cbwsdk-spinner-svg{0%{transform:rotateZ(0deg)}100%{transform:rotateZ(360deg)}}@keyframes -cbwsdk-spinner-circle{0%,25%{stroke-dashoffset:280;transform:rotate(0)}50%,75%{stroke-dashoffset:75;transform:rotate(45deg)}100%{stroke-dashoffset:280;transform:rotate(360deg)}}";var ZS=te&&te.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(ko,"__esModule",{value:!0});ko.Spinner=void 0;const ys=Lt,QS=ZS(cc),YS=t=>{var e;const r=(e=t.size)!==null&&e!==void 0?e:64,n=t.color||"#000";return(0,ys.h)("div",{class:"-cbwsdk-spinner"},(0,ys.h)("style",null,QS.default),(0,ys.h)("svg",{viewBox:"0 0 100 100",xmlns:"http://www.w3.org/2000/svg",style:{width:r,height:r}},(0,ys.h)("circle",{style:{cx:50,cy:50,r:45,stroke:n}})))};ko.Spinner=YS;var lc={};Object.defineProperty(lc,"__esModule",{value:!0});lc.default=".-cbwsdk-css-reset .-cbwsdk-connect-content{height:430px;width:700px;border-radius:12px;padding:30px}.-cbwsdk-css-reset .-cbwsdk-connect-content.light{background:#fff}.-cbwsdk-css-reset .-cbwsdk-connect-content.dark{background:#0a0b0d}.-cbwsdk-css-reset .-cbwsdk-connect-content-header{display:flex;align-items:center;justify-content:space-between;margin:0 0 30px}.-cbwsdk-css-reset .-cbwsdk-connect-content-heading{font-style:normal;font-weight:500;font-size:28px;line-height:36px;margin:0}.-cbwsdk-css-reset .-cbwsdk-connect-content-heading.light{color:#0a0b0d}.-cbwsdk-css-reset .-cbwsdk-connect-content-heading.dark{color:#fff}.-cbwsdk-css-reset .-cbwsdk-connect-content-layout{display:flex;flex-direction:row}.-cbwsdk-css-reset .-cbwsdk-connect-content-column-left{margin-right:30px;display:flex;flex-direction:column;justify-content:space-between}.-cbwsdk-css-reset .-cbwsdk-connect-content-column-right{flex:25%;margin-right:34px}.-cbwsdk-css-reset .-cbwsdk-connect-content-qr-wrapper{width:220px;height:220px;border-radius:12px;display:flex;justify-content:center;align-items:center;background:#fff}.-cbwsdk-css-reset .-cbwsdk-connect-content-qr-connecting{position:absolute;top:0;bottom:0;left:0;right:0;display:flex;flex-direction:column;align-items:center;justify-content:center}.-cbwsdk-css-reset .-cbwsdk-connect-content-qr-connecting.light{background-color:rgba(255,255,255,.95)}.-cbwsdk-css-reset .-cbwsdk-connect-content-qr-connecting.light>p{color:#0a0b0d}.-cbwsdk-css-reset .-cbwsdk-connect-content-qr-connecting.dark{background-color:rgba(10,11,13,.9)}.-cbwsdk-css-reset .-cbwsdk-connect-content-qr-connecting.dark>p{color:#fff}.-cbwsdk-css-reset .-cbwsdk-connect-content-qr-connecting>p{font-size:12px;font-weight:bold;margin-top:16px}.-cbwsdk-css-reset .-cbwsdk-connect-content-update-app{border-radius:8px;font-size:14px;line-height:20px;padding:12px;width:339px}.-cbwsdk-css-reset .-cbwsdk-connect-content-update-app.light{background:#eef0f3;color:#5b636e}.-cbwsdk-css-reset .-cbwsdk-connect-content-update-app.dark{background:#1e2025;color:#8a919e}.-cbwsdk-css-reset .-cbwsdk-cancel-button{-webkit-appearance:none;border:none;background:none;cursor:pointer;padding:0;margin:0}.-cbwsdk-css-reset .-cbwsdk-cancel-button-x{position:relative;display:block;cursor:pointer}.-cbwsdk-css-reset .-cbwsdk-wallet-steps{padding:0 0 0 16px;margin:0;width:100%;list-style:decimal}.-cbwsdk-css-reset .-cbwsdk-wallet-steps-item{list-style-type:decimal;display:list-item;font-style:normal;font-weight:400;font-size:16px;line-height:24px;margin-top:20px}.-cbwsdk-css-reset .-cbwsdk-wallet-steps-item.light{color:#0a0b0d}.-cbwsdk-css-reset .-cbwsdk-wallet-steps-item.dark{color:#fff}.-cbwsdk-css-reset .-cbwsdk-wallet-steps-item-wrapper{display:flex;align-items:center}.-cbwsdk-css-reset .-cbwsdk-wallet-steps-pad-left{margin-left:6px}.-cbwsdk-css-reset .-cbwsdk-wallet-steps-icon{display:flex;border-radius:50%;height:24px;width:24px}.-cbwsdk-css-reset .-cbwsdk-wallet-steps-icon svg{margin:auto;display:block}.-cbwsdk-css-reset .-cbwsdk-wallet-steps-icon.light{background:#0052ff}.-cbwsdk-css-reset .-cbwsdk-wallet-steps-icon.dark{background:#588af5}.-cbwsdk-css-reset .-cbwsdk-connect-item{align-items:center;display:flex;flex-direction:row;padding:16px 24px;gap:12px;cursor:pointer}.-cbwsdk-css-reset .-cbwsdk-connect-item.light{color:#0a0b0d}.-cbwsdk-css-reset .-cbwsdk-connect-item.light.selected{background:#f5f8ff;color:#0052ff}.-cbwsdk-css-reset .-cbwsdk-connect-item.dark{color:#fff}.-cbwsdk-css-reset .-cbwsdk-connect-item.dark.selected{background:#001033;color:#588af5}.-cbwsdk-css-reset .-cbwsdk-connect-item.selected{border-radius:100px;font-weight:600}.-cbwsdk-css-reset .-cbwsdk-connect-item-copy-wrapper{margin:0 4px 0 8px}.-cbwsdk-css-reset .-cbwsdk-connect-item-title{margin:0 0 0;font-size:16px;line-height:24px;font-weight:500}.-cbwsdk-css-reset .-cbwsdk-connect-item-description{font-weight:400;font-size:14px;line-height:20px;margin:0}";var vi=te&&te.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(fr,"__esModule",{value:!0});fr.CoinbaseAppSteps=fr.CoinbaseWalletSteps=fr.ConnectItem=fr.ConnectContent=void 0;const Ht=vi(Us),le=Lt,dh=us,KS=re,XS=ai,e3=Io,t3=vi(sc),r3=vi(oc),I0=Ro,n3=vi(ac),i3=vi(uc),s3=Ao,o3=To,a3=ko,u3=vi(lc),ph={"coinbase-wallet-app":{title:"Coinbase Wallet app",description:"Connect with your self-custody wallet",icon:r3.default,steps:A0},"coinbase-app":{title:"Coinbase app",description:"Connect with your Coinbase account",icon:t3.default,steps:T0}},c3=t=>{switch(t){case"coinbase-app":return n3.default;case"coinbase-wallet-app":default:return i3.default}},ou=t=>t==="light"?"#FFFFFF":"#0A0B0D";function l3(t){const{theme:e}=t,[r,n]=(0,dh.useState)("coinbase-wallet-app"),i=(0,dh.useCallback)(l=>{n(l)},[]),s=(0,KS.createQrUrl)(t.sessionId,t.sessionSecret,t.linkAPIUrl,t.isParentConnection,t.version,t.chainId),o=ph[r];if(!r)return null;const a=o.steps,c=r==="coinbase-app";return(0,le.h)("div",{"data-testid":"connect-content",class:(0,Ht.default)("-cbwsdk-connect-content",e)},(0,le.h)("style",null,u3.default),(0,le.h)("div",{class:"-cbwsdk-connect-content-header"},(0,le.h)("h2",{class:(0,Ht.default)("-cbwsdk-connect-content-heading",e)},"Scan to connect with one of our mobile apps"),t.onCancel&&(0,le.h)("button",{type:"button",class:"-cbwsdk-cancel-button",onClick:t.onCancel},(0,le.h)(e3.CloseIcon,{fill:e==="light"?"#0A0B0D":"#FFFFFF"}))),(0,le.h)("div",{class:"-cbwsdk-connect-content-layout"},(0,le.h)("div",{class:"-cbwsdk-connect-content-column-left"},(0,le.h)("div",null,Object.entries(ph).map(([l,p])=>(0,le.h)(R0,{key:l,title:p.title,description:p.description,icon:p.icon,selected:r===l,onClick:()=>i(l),theme:e}))),c&&(0,le.h)("div",{class:(0,Ht.default)("-cbwsdk-connect-content-update-app",e)},"Don’t see a ",(0,le.h)("strong",null,"Scan")," option? Update your Coinbase app to the latest version and try again.")),(0,le.h)("div",{class:"-cbwsdk-connect-content-column-right"},(0,le.h)("div",{class:"-cbwsdk-connect-content-qr-wrapper"},(0,le.h)(o3.QRCode,{content:s,width:200,height:200,fgColor:"#000",bgColor:"transparent",image:{svg:c3(r),width:25,height:25}}),(0,le.h)("input",{type:"hidden",name:"cbw-cbwsdk-version",value:XS.LIB_VERSION}),(0,le.h)("input",{type:"hidden",value:s})),(0,le.h)(a,{theme:e}),!t.isConnected&&(0,le.h)("div",{"data-testid":"connecting-spinner",class:(0,Ht.default)("-cbwsdk-connect-content-qr-connecting",e)},(0,le.h)(a3.Spinner,{size:36,color:e==="dark"?"#FFF":"#000"}),(0,le.h)("p",null,"Connecting...")))))}fr.ConnectContent=l3;function R0({title:t,description:e,icon:r,selected:n,theme:i,onClick:s}){return(0,le.h)("div",{onClick:s,class:(0,Ht.default)("-cbwsdk-connect-item",i,{selected:n})},(0,le.h)("div",null,(0,le.h)("img",{src:r,alt:t})),(0,le.h)("div",{class:"-cbwsdk-connect-item-copy-wrapper"},(0,le.h)("h3",{class:"-cbwsdk-connect-item-title"},t),(0,le.h)("p",{class:"-cbwsdk-connect-item-description"},e)))}fr.ConnectItem=R0;function A0({theme:t}){return(0,le.h)("ol",{class:"-cbwsdk-wallet-steps"},(0,le.h)("li",{class:(0,Ht.default)("-cbwsdk-wallet-steps-item",t)},(0,le.h)("div",{class:"-cbwsdk-wallet-steps-item-wrapper"},"Open Coinbase Wallet app")),(0,le.h)("li",{class:(0,Ht.default)("-cbwsdk-wallet-steps-item",t)},(0,le.h)("div",{class:"-cbwsdk-wallet-steps-item-wrapper"},(0,le.h)("span",null,"Tap ",(0,le.h)("strong",null,"Scan")," "),(0,le.h)("span",{class:(0,Ht.default)("-cbwsdk-wallet-steps-pad-left","-cbwsdk-wallet-steps-icon",t)},(0,le.h)(I0.QRCodeIcon,{fill:ou(t)})))))}fr.CoinbaseWalletSteps=A0;function T0({theme:t}){return(0,le.h)("ol",{class:"-cbwsdk-wallet-steps"},(0,le.h)("li",{class:(0,Ht.default)("-cbwsdk-wallet-steps-item",t)},(0,le.h)("div",{class:"-cbwsdk-wallet-steps-item-wrapper"},"Open Coinbase app")),(0,le.h)("li",{class:(0,Ht.default)("-cbwsdk-wallet-steps-item",t)},(0,le.h)("div",{class:"-cbwsdk-wallet-steps-item-wrapper"},(0,le.h)("span",null,"Tap ",(0,le.h)("strong",null,"More")),(0,le.h)("span",{class:(0,Ht.default)("-cbwsdk-wallet-steps-pad-left","-cbwsdk-wallet-steps-icon",t)},(0,le.h)(s3.StatusDotIcon,{fill:ou(t)})),(0,le.h)("span",{class:"-cbwsdk-wallet-steps-pad-left"},"then ",(0,le.h)("strong",null,"Scan")),(0,le.h)("span",{class:(0,Ht.default)("-cbwsdk-wallet-steps-pad-left","-cbwsdk-wallet-steps-icon",t)},(0,le.h)(I0.QRCodeIcon,{fill:ou(t)})))))}fr.CoinbaseAppSteps=T0;var No={},Oo={};Object.defineProperty(Oo,"__esModule",{value:!0});Oo.ArrowLeftIcon=void 0;const gh=Lt;function h3(t){return(0,gh.h)("svg",Object.assign({width:"16",height:"16",viewBox:"0 0 16 16",xmlns:"http://www.w3.org/2000/svg"},t),(0,gh.h)("path",{d:"M8.60675 0.155884L7.37816 1.28209L12.7723 7.16662H0V8.83328H12.6548L6.82149 14.6666L8 15.8451L15.8201 8.02501L8.60675 0.155884Z"}))}Oo.ArrowLeftIcon=h3;var Lo={};Object.defineProperty(Lo,"__esModule",{value:!0});Lo.LaptopIcon=void 0;const ka=Lt;function f3(t){return(0,ka.h)("svg",Object.assign({width:"14",height:"14",viewBox:"0 0 14 14",xmlns:"http://www.w3.org/2000/svg"},t),(0,ka.h)("path",{d:"M1.8001 2.2002H12.2001V9.40019H1.8001V2.2002ZM3.4001 3.8002V7.80019H10.6001V3.8002H3.4001Z"}),(0,ka.h)("path",{d:"M13.4001 10.2002H0.600098C0.600098 11.0838 1.31644 11.8002 2.2001 11.8002H11.8001C12.6838 11.8002 13.4001 11.0838 13.4001 10.2002Z"}))}Lo.LaptopIcon=f3;var Bo={};Object.defineProperty(Bo,"__esModule",{value:!0});Bo.SafeIcon=void 0;const bh=Lt;function d3(t){return(0,bh.h)("svg",Object.assign({width:"14",height:"14",viewBox:"0 0 14 14",xmlns:"http://www.w3.org/2000/svg"},t),(0,bh.h)("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M0.600098 0.600098V11.8001H13.4001V0.600098H0.600098ZM7.0001 9.2001C5.3441 9.2001 4.0001 7.8561 4.0001 6.2001C4.0001 4.5441 5.3441 3.2001 7.0001 3.2001C8.6561 3.2001 10.0001 4.5441 10.0001 6.2001C10.0001 7.8561 8.6561 9.2001 7.0001 9.2001ZM0.600098 12.6001H3.8001V13.4001H0.600098V12.6001ZM10.2001 12.6001H13.4001V13.4001H10.2001V12.6001ZM8.8001 6.2001C8.8001 7.19421 7.99421 8.0001 7.0001 8.0001C6.00598 8.0001 5.2001 7.19421 5.2001 6.2001C5.2001 5.20598 6.00598 4.4001 7.0001 4.4001C7.99421 4.4001 8.8001 5.20598 8.8001 6.2001Z"}))}Bo.SafeIcon=d3;var hc={};Object.defineProperty(hc,"__esModule",{value:!0});hc.default=".-cbwsdk-css-reset .-cbwsdk-try-extension{display:flex;margin-top:12px;height:202px;width:700px;border-radius:12px;padding:30px}.-cbwsdk-css-reset .-cbwsdk-try-extension.light{background:#fff}.-cbwsdk-css-reset .-cbwsdk-try-extension.dark{background:#0a0b0d}.-cbwsdk-css-reset .-cbwsdk-try-extension-column-half{flex:50%}.-cbwsdk-css-reset .-cbwsdk-try-extension-heading{font-style:normal;font-weight:500;font-size:25px;line-height:32px;margin:0;max-width:204px}.-cbwsdk-css-reset .-cbwsdk-try-extension-heading.light{color:#0a0b0d}.-cbwsdk-css-reset .-cbwsdk-try-extension-heading.dark{color:#fff}.-cbwsdk-css-reset .-cbwsdk-try-extension-cta{appearance:none;border:none;background:none;color:#0052ff;cursor:pointer;padding:0;text-decoration:none;display:block;font-weight:600;font-size:16px;line-height:24px}.-cbwsdk-css-reset .-cbwsdk-try-extension-cta.light{color:#0052ff}.-cbwsdk-css-reset .-cbwsdk-try-extension-cta.dark{color:#588af5}.-cbwsdk-css-reset .-cbwsdk-try-extension-cta-wrapper{display:flex;align-items:center;margin-top:12px}.-cbwsdk-css-reset .-cbwsdk-try-extension-cta-icon{display:block;margin-left:4px;height:14px}.-cbwsdk-css-reset .-cbwsdk-try-extension-list{display:flex;flex-direction:column;justify-content:center;align-items:center;margin:0;padding:0;list-style:none;height:100%}.-cbwsdk-css-reset .-cbwsdk-try-extension-list-item{display:flex;align-items:center;flex-flow:nowrap;margin-top:24px}.-cbwsdk-css-reset .-cbwsdk-try-extension-list-item:first-of-type{margin-top:0}.-cbwsdk-css-reset .-cbwsdk-try-extension-list-item-icon-wrapper{display:block}.-cbwsdk-css-reset .-cbwsdk-try-extension-list-item-icon{display:flex;height:32px;width:32px;border-radius:50%}.-cbwsdk-css-reset .-cbwsdk-try-extension-list-item-icon svg{margin:auto;display:block}.-cbwsdk-css-reset .-cbwsdk-try-extension-list-item-icon.light{background:#eef0f3}.-cbwsdk-css-reset .-cbwsdk-try-extension-list-item-icon.dark{background:#1e2025}.-cbwsdk-css-reset .-cbwsdk-try-extension-list-item-copy{display:block;font-weight:400;font-size:14px;line-height:20px;padding-left:12px}.-cbwsdk-css-reset .-cbwsdk-try-extension-list-item-copy.light{color:#5b636e}.-cbwsdk-css-reset .-cbwsdk-try-extension-list-item-copy.dark{color:#8a919e}";var k0=te&&te.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(No,"__esModule",{value:!0});No.TryExtensionContent=void 0;const Yr=k0(Us),ut=Lt,Na=us,p3=Oo,g3=Lo,b3=Bo,v3=k0(hc);function m3({theme:t}){const[e,r]=(0,Na.useState)(!1),n=(0,Na.useCallback)(()=>{window.open("https://api.wallet.coinbase.com/rpc/v2/desktop/chrome","_blank")},[]),i=(0,Na.useCallback)(()=>{e?window.location.reload():(n(),r(!0))},[n,e]);return(0,ut.h)("div",{class:(0,Yr.default)("-cbwsdk-try-extension",t)},(0,ut.h)("style",null,v3.default),(0,ut.h)("div",{class:"-cbwsdk-try-extension-column-half"},(0,ut.h)("h3",{class:(0,Yr.default)("-cbwsdk-try-extension-heading",t)},"Or try the Coinbase Wallet browser extension"),(0,ut.h)("div",{class:"-cbwsdk-try-extension-cta-wrapper"},(0,ut.h)("button",{class:(0,Yr.default)("-cbwsdk-try-extension-cta",t),onClick:i},e?"Refresh":"Install"),(0,ut.h)("div",null,!e&&(0,ut.h)(p3.ArrowLeftIcon,{class:"-cbwsdk-try-extension-cta-icon",fill:t==="light"?"#0052FF":"#588AF5"})))),(0,ut.h)("div",{class:"-cbwsdk-try-extension-column-half"},(0,ut.h)("ul",{class:"-cbwsdk-try-extension-list"},(0,ut.h)("li",{class:"-cbwsdk-try-extension-list-item"},(0,ut.h)("div",{class:"-cbwsdk-try-extension-list-item-icon-wrapper"},(0,ut.h)("span",{class:(0,Yr.default)("-cbwsdk-try-extension-list-item-icon",t)},(0,ut.h)(g3.LaptopIcon,{fill:t==="light"?"#0A0B0D":"#FFFFFF"}))),(0,ut.h)("div",{class:(0,Yr.default)("-cbwsdk-try-extension-list-item-copy",t)},"Connect with dapps with just one click on your desktop browser")),(0,ut.h)("li",{class:"-cbwsdk-try-extension-list-item"},(0,ut.h)("div",{class:"-cbwsdk-try-extension-list-item-icon-wrapper"},(0,ut.h)("span",{class:(0,Yr.default)("-cbwsdk-try-extension-list-item-icon",t)},(0,ut.h)(b3.SafeIcon,{fill:t==="light"?"#0A0B0D":"#FFFFFF"}))),(0,ut.h)("div",{class:(0,Yr.default)("-cbwsdk-try-extension-list-item-copy",t)},"Add an additional layer of security by using a supported Ledger hardware wallet")))))}No.TryExtensionContent=m3;var fc={};Object.defineProperty(fc,"__esModule",{value:!0});fc.default=".-cbwsdk-css-reset .-cbwsdk-connect-dialog{z-index:2147483647;position:fixed;top:0;left:0;right:0;bottom:0;display:flex;align-items:center;justify-content:center}.-cbwsdk-css-reset .-cbwsdk-connect-dialog-backdrop{z-index:2147483647;position:fixed;top:0;left:0;right:0;bottom:0;transition:opacity .25s}.-cbwsdk-css-reset .-cbwsdk-connect-dialog-backdrop.light{background-color:rgba(0,0,0,.5)}.-cbwsdk-css-reset .-cbwsdk-connect-dialog-backdrop.dark{background-color:rgba(50,53,61,.4)}.-cbwsdk-css-reset .-cbwsdk-connect-dialog-backdrop-hidden{opacity:0}.-cbwsdk-css-reset .-cbwsdk-connect-dialog-box{display:flex;position:relative;flex-direction:column;transform:scale(1);transition:opacity .25s,transform .25s}.-cbwsdk-css-reset .-cbwsdk-connect-dialog-box-hidden{opacity:0;transform:scale(0.85)}.-cbwsdk-css-reset .-cbwsdk-connect-dialog-container{display:block}.-cbwsdk-css-reset .-cbwsdk-connect-dialog-container-hidden{display:none}";var N0=te&&te.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Co,"__esModule",{value:!0});Co.ConnectDialog=void 0;const Oa=N0(Us),Kr=Lt,La=us,y3=fr,_3=No,w3=N0(fc),E3=t=>{const{isOpen:e,darkMode:r}=t,[n,i]=(0,La.useState)(!e),[s,o]=(0,La.useState)(!e);(0,La.useEffect)(()=>{const c=[window.setTimeout(()=>{o(!e)},10)];return e?i(!1):c.push(window.setTimeout(()=>{i(!0)},360)),()=>{c.forEach(window.clearTimeout)}},[t.isOpen]);const a=r?"dark":"light";return(0,Kr.h)("div",{class:(0,Oa.default)("-cbwsdk-connect-dialog-container",n&&"-cbwsdk-connect-dialog-container-hidden")},(0,Kr.h)("style",null,w3.default),(0,Kr.h)("div",{class:(0,Oa.default)("-cbwsdk-connect-dialog-backdrop",a,s&&"-cbwsdk-connect-dialog-backdrop-hidden")}),(0,Kr.h)("div",{class:"-cbwsdk-connect-dialog"},(0,Kr.h)("div",{class:(0,Oa.default)("-cbwsdk-connect-dialog-box",s&&"-cbwsdk-connect-dialog-box-hidden")},t.connectDisabled?null:(0,Kr.h)(y3.ConnectContent,{theme:a,version:t.version,sessionId:t.sessionId,sessionSecret:t.sessionSecret,linkAPIUrl:t.linkAPIUrl,isConnected:t.isConnected,isParentConnection:t.isParentConnection,chainId:t.chainId,onCancel:t.onCancel}),(0,Kr.h)(_3.TryExtensionContent,{theme:a}))))};Co.ConnectDialog=E3;Object.defineProperty(Eo,"__esModule",{value:!0});Eo.LinkFlow=void 0;const Ba=Lt,vh=Mo,S3=Co;class x3{constructor(e){this.extensionUI$=new vh.BehaviorSubject({}),this.subscriptions=new vh.Subscription,this.isConnected=!1,this.chainId=1,this.isOpen=!1,this.onCancel=null,this.root=null,this.connectDisabled=!1,this.darkMode=e.darkMode,this.version=e.version,this.sessionId=e.sessionId,this.sessionSecret=e.sessionSecret,this.linkAPIUrl=e.linkAPIUrl,this.isParentConnection=e.isParentConnection,this.connected$=e.connected$,this.chainId$=e.chainId$}attach(e){this.root=document.createElement("div"),this.root.className="-cbwsdk-link-flow-root",e.appendChild(this.root),this.render(),this.subscriptions.add(this.connected$.subscribe(r=>{this.isConnected!==r&&(this.isConnected=r,this.render())})),this.subscriptions.add(this.chainId$.subscribe(r=>{this.chainId!==r&&(this.chainId=r,this.render())}))}detach(){var e;this.root&&(this.subscriptions.unsubscribe(),(0,Ba.render)(null,this.root),(e=this.root.parentElement)===null||e===void 0||e.removeChild(this.root))}setConnectDisabled(e){this.connectDisabled=e}open(e){this.isOpen=!0,this.onCancel=e.onCancel,this.render()}close(){this.isOpen=!1,this.onCancel=null,this.render()}render(){if(!this.root)return;const e=this.extensionUI$.subscribe(()=>{this.root&&(0,Ba.render)((0,Ba.h)(S3.ConnectDialog,{darkMode:this.darkMode,version:this.version,sessionId:this.sessionId,sessionSecret:this.sessionSecret,linkAPIUrl:this.linkAPIUrl,isOpen:this.isOpen,isConnected:this.isConnected,isParentConnection:this.isParentConnection,chainId:this.chainId,onCancel:this.onCancel,connectDisabled:this.connectDisabled}),this.root)});this.subscriptions.add(e)}}Eo.LinkFlow=x3;var O0={},dc={};Object.defineProperty(dc,"__esModule",{value:!0});dc.default=".-cbwsdk-css-reset .-gear-container{margin-left:16px !important;margin-right:9px !important;display:flex;align-items:center;justify-content:center;width:24px;height:24px;transition:opacity .25s}.-cbwsdk-css-reset .-gear-container *{user-select:none}.-cbwsdk-css-reset .-gear-container svg{opacity:0;position:absolute}.-cbwsdk-css-reset .-gear-icon{height:12px;width:12px;z-index:10000}.-cbwsdk-css-reset .-cbwsdk-snackbar{align-items:flex-end;display:flex;flex-direction:column;position:fixed;right:0;top:0;z-index:2147483647}.-cbwsdk-css-reset .-cbwsdk-snackbar *{user-select:none}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance{display:flex;flex-direction:column;margin:8px 16px 0 16px;overflow:visible;text-align:left;transform:translateX(0);transition:opacity .25s,transform .25s}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-header:hover .-gear-container svg{opacity:1}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-header{display:flex;align-items:center;background:#fff;overflow:hidden;border:1px solid #e7ebee;box-sizing:border-box;border-radius:8px;cursor:pointer}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-header-cblogo{margin:8px 8px 8px 8px}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-header *{cursor:pointer}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-header-message{color:#000;font-size:13px;line-height:1.5;user-select:none}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu{background:#fff;transition:opacity .25s ease-in-out,transform .25s linear,visibility 0s;visibility:hidden;border:1px solid #e7ebee;box-sizing:border-box;border-radius:8px;opacity:0;flex-direction:column;padding-left:8px;padding-right:8px}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item:last-child{margin-bottom:8px !important}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item:hover{background:#f5f7f8;border-radius:6px;transition:background .25s}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item:hover span{color:#050f19;transition:color .25s}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item:hover svg path{fill:#000;transition:fill .25s}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item{visibility:inherit;height:35px;margin-top:8px;margin-bottom:0;display:flex;flex-direction:row;align-items:center;padding:8px;cursor:pointer}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item *{visibility:inherit;cursor:pointer}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item-is-red:hover{background:rgba(223,95,103,.2);transition:background .25s}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item-is-red:hover *{cursor:pointer}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item-is-red:hover svg path{fill:#df5f67;transition:fill .25s}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item-is-red:hover span{color:#df5f67;transition:color .25s}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item-info{color:#aaa;font-size:13px;margin:0 8px 0 32px;position:absolute}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-hidden{opacity:0;text-align:left;transform:translateX(25%);transition:opacity .5s linear}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-expanded .-cbwsdk-snackbar-instance-menu{opacity:1;display:flex;transform:translateY(8px);visibility:visible}";(function(t){var e=te&&te.__importDefault||function(g){return g&&g.__esModule?g:{default:g}};Object.defineProperty(t,"__esModule",{value:!0}),t.SnackbarInstance=t.SnackbarContainer=t.Snackbar=void 0;const r=e(Us),n=Lt,i=us,s=e(dc),o="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTIiIGhlaWdodD0iMTIiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTEyIDYuNzV2LTEuNWwtMS43Mi0uNTdjLS4wOC0uMjctLjE5LS41Mi0uMzItLjc3bC44MS0xLjYyLTEuMDYtMS4wNi0xLjYyLjgxYy0uMjQtLjEzLS41LS4yNC0uNzctLjMyTDYuNzUgMGgtMS41bC0uNTcgMS43MmMtLjI3LjA4LS41My4xOS0uNzcuMzJsLTEuNjItLjgxLTEuMDYgMS4wNi44MSAxLjYyYy0uMTMuMjQtLjI0LjUtLjMyLjc3TDAgNS4yNXYxLjVsMS43Mi41N2MuMDguMjcuMTkuNTMuMzIuNzdsLS44MSAxLjYyIDEuMDYgMS4wNiAxLjYyLS44MWMuMjQuMTMuNS4yMy43Ny4zMkw1LjI1IDEyaDEuNWwuNTctMS43MmMuMjctLjA4LjUyLS4xOS43Ny0uMzJsMS42Mi44MSAxLjA2LTEuMDYtLjgxLTEuNjJjLjEzLS4yNC4yMy0uNS4zMi0uNzdMMTIgNi43NXpNNiA4LjVhMi41IDIuNSAwIDAxMC01IDIuNSAyLjUgMCAwMTAgNXoiIGZpbGw9IiMwNTBGMTkiLz48L3N2Zz4=";function a(g){switch(g){case"coinbase-app":return"data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMzAiIGhlaWdodD0iMzAiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTE0LjY3NCAxOC44NThjLTIuMDQ1IDAtMy42NDgtMS43MjItMy42NDgtMy44NDVzMS42NTktMy44NDUgMy42NDgtMy44NDVjMS44MjQgMCAzLjMxNyAxLjM3NyAzLjU5MyAzLjIxNGgzLjcwM2MtLjMzMS0zLjk2LTMuNDgyLTcuMDU5LTcuMjk2LTcuMDU5LTQuMDM0IDAtNy4zNSAzLjQ0My03LjM1IDcuNjkgMCA0LjI0NiAzLjI2IDcuNjkgNy4zNSA3LjY5IDMuODcgMCA2Ljk2NS0zLjEgNy4yOTYtNy4wNTloLTMuNzAzYy0uMjc2IDEuODM2LTEuNzY5IDMuMjE0LTMuNTkzIDMuMjE0WiIgZmlsbD0iI2ZmZiIvPjxwYXRoIGQ9Ik0wIDEwLjY3OGMwLTMuNzExIDAtNS41OTYuNzQyLTcuMDIzQTYuNTMyIDYuNTMyIDAgMCAxIDMuNjU1Ljc0MkM1LjA4MiAwIDYuOTY3IDAgMTAuNjc4IDBoNy45MzhjMy43MTEgMCA1LjU5NiAwIDcuMDIzLjc0MmE2LjUzMSA2LjUzMSAwIDAgMSAyLjkxMyAyLjkxM2MuNzQyIDEuNDI3Ljc0MiAzLjMxMi43NDIgNy4wMjN2Ny45MzhjMCAzLjcxMSAwIDUuNTk2LS43NDIgNy4wMjNhNi41MzEgNi41MzEgMCAwIDEtMi45MTMgMi45MTNjLTEuNDI3Ljc0Mi0zLjMxMi43NDItNy4wMjMuNzQyaC03LjkzOGMtMy43MTEgMC01LjU5NiAwLTcuMDIzLS43NDJhNi41MzEgNi41MzEgMCAwIDEtMi45MTMtMi45MTNDMCAyNC4yMTIgMCAyMi4zODQgMCAxOC42MTZ2LTcuOTM4WiIgZmlsbD0iIzAwNTJGRiIvPjxwYXRoIGQ9Ik0xNC42ODQgMTkuNzczYy0yLjcyNyAwLTQuODY0LTIuMjk1LTQuODY0LTUuMTI2IDAtMi44MzEgMi4yMS01LjEyNyA0Ljg2NC01LjEyNyAyLjQzMiAwIDQuNDIyIDEuODM3IDQuNzkgNC4yODVoNC45MzhjLS40NDItNS4yOC00LjY0My05LjQxMS05LjcyOC05LjQxMS01LjM4IDAtOS44MDIgNC41OS05LjgwMiAxMC4yNTMgMCA1LjY2MiA0LjM0OCAxMC4yNTMgOS44MDIgMTAuMjUzIDUuMTU5IDAgOS4yODYtNC4xMzIgOS43MjgtOS40MTFoLTQuOTM4Yy0uMzY4IDIuNDQ4LTIuMzU4IDQuMjg0LTQuNzkgNC4yODRaIiBmaWxsPSIjZmZmIi8+PC9zdmc+";case"coinbase-wallet-app":default:return"data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMzIiIGhlaWdodD0iMzIiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTEuNDkyIDEwLjQxOWE4LjkzIDguOTMgMCAwMTguOTMtOC45M2gxMS4xNjNhOC45MyA4LjkzIDAgMDE4LjkzIDguOTN2MTEuMTYzYTguOTMgOC45MyAwIDAxLTguOTMgOC45M0gxMC40MjJhOC45MyA4LjkzIDAgMDEtOC45My04LjkzVjEwLjQxOXoiIGZpbGw9IiMxNjUyRjAiLz48cGF0aCBmaWxsLXJ1bGU9ImV2ZW5vZGQiIGNsaXAtcnVsZT0iZXZlbm9kZCIgZD0iTTEwLjQxOSAwSDIxLjU4QzI3LjMzNSAwIDMyIDQuNjY1IDMyIDEwLjQxOVYyMS41OEMzMiAyNy4zMzUgMjcuMzM1IDMyIDIxLjU4MSAzMkgxMC40MkM0LjY2NSAzMiAwIDI3LjMzNSAwIDIxLjU4MVYxMC40MkMwIDQuNjY1IDQuNjY1IDAgMTAuNDE5IDB6bTAgMS40ODhhOC45MyA4LjkzIDAgMDAtOC45MyA4LjkzdjExLjE2M2E4LjkzIDguOTMgMCAwMDguOTMgOC45M0gyMS41OGE4LjkzIDguOTMgMCAwMDguOTMtOC45M1YxMC40MmE4LjkzIDguOTMgMCAwMC04LjkzLTguOTNIMTAuNDJ6IiBmaWxsPSIjZmZmIi8+PHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik0xNS45OTggMjYuMDQ5Yy01LjU0OSAwLTEwLjA0Ny00LjQ5OC0xMC4wNDctMTAuMDQ3IDAtNS41NDggNC40OTgtMTAuMDQ2IDEwLjA0Ny0xMC4wNDYgNS41NDggMCAxMC4wNDYgNC40OTggMTAuMDQ2IDEwLjA0NiAwIDUuNTQ5LTQuNDk4IDEwLjA0Ny0xMC4wNDYgMTAuMDQ3eiIgZmlsbD0iI2ZmZiIvPjxwYXRoIGQ9Ik0xMi43NjIgMTQuMjU0YzAtLjgyMi42NjctMS40ODkgMS40ODktMS40ODloMy40OTdjLjgyMiAwIDEuNDg4LjY2NiAxLjQ4OCAxLjQ4OXYzLjQ5N2MwIC44MjItLjY2NiAxLjQ4OC0xLjQ4OCAxLjQ4OGgtMy40OTdhMS40ODggMS40ODggMCAwMS0xLjQ4OS0xLjQ4OHYtMy40OTh6IiBmaWxsPSIjMTY1MkYwIi8+PC9zdmc+"}}class c{constructor(y){this.items=new Map,this.nextItemKey=0,this.root=null,this.darkMode=y.darkMode}attach(y){this.root=document.createElement("div"),this.root.className="-cbwsdk-snackbar-root",y.appendChild(this.root),this.render()}presentItem(y){const I=this.nextItemKey++;return this.items.set(I,y),this.render(),()=>{this.items.delete(I),this.render()}}clear(){this.items.clear(),this.render()}render(){this.root&&(0,n.render)((0,n.h)("div",null,(0,n.h)(t.SnackbarContainer,{darkMode:this.darkMode},Array.from(this.items.entries()).map(([y,I])=>(0,n.h)(t.SnackbarInstance,Object.assign({},I,{key:y}))))),this.root)}}t.Snackbar=c;const l=g=>(0,n.h)("div",{class:(0,r.default)("-cbwsdk-snackbar-container")},(0,n.h)("style",null,s.default),(0,n.h)("div",{class:"-cbwsdk-snackbar"},g.children));t.SnackbarContainer=l;const p=({autoExpand:g,message:y,menuItems:I,appSrc:T})=>{const[D,U]=(0,i.useState)(!0),[M,N]=(0,i.useState)(g??!1);(0,i.useEffect)(()=>{const H=[window.setTimeout(()=>{U(!1)},1),window.setTimeout(()=>{N(!0)},1e4)];return()=>{H.forEach(window.clearTimeout)}});const j=()=>{N(!M)};return(0,n.h)("div",{class:(0,r.default)("-cbwsdk-snackbar-instance",D&&"-cbwsdk-snackbar-instance-hidden",M&&"-cbwsdk-snackbar-instance-expanded")},(0,n.h)("div",{class:"-cbwsdk-snackbar-instance-header",onClick:j},(0,n.h)("img",{src:a(T),class:"-cbwsdk-snackbar-instance-header-cblogo"}),(0,n.h)("div",{class:"-cbwsdk-snackbar-instance-header-message"},y),(0,n.h)("div",{class:"-gear-container"},!M&&(0,n.h)("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},(0,n.h)("circle",{cx:"12",cy:"12",r:"12",fill:"#F5F7F8"})),(0,n.h)("img",{src:o,class:"-gear-icon",title:"Expand"}))),I&&I.length>0&&(0,n.h)("div",{class:"-cbwsdk-snackbar-instance-menu"},I.map((H,F)=>(0,n.h)("div",{class:(0,r.default)("-cbwsdk-snackbar-instance-menu-item",H.isRed&&"-cbwsdk-snackbar-instance-menu-item-is-red"),onClick:H.onClick,key:F},(0,n.h)("svg",{width:H.svgWidth,height:H.svgHeight,viewBox:"0 0 10 11",fill:"none",xmlns:"http://www.w3.org/2000/svg"},(0,n.h)("path",{"fill-rule":H.defaultFillRule,"clip-rule":H.defaultClipRule,d:H.path,fill:"#AAAAAA"})),(0,n.h)("span",{class:(0,r.default)("-cbwsdk-snackbar-instance-menu-item-info",H.isRed&&"-cbwsdk-snackbar-instance-menu-item-info-is-red")},H.info)))))};t.SnackbarInstance=p})(O0);var Po={},pc={};Object.defineProperty(pc,"__esModule",{value:!0});pc.default='@namespace svg "http://www.w3.org/2000/svg";.-cbwsdk-css-reset,.-cbwsdk-css-reset *{animation:none;animation-delay:0;animation-direction:normal;animation-duration:0;animation-fill-mode:none;animation-iteration-count:1;animation-name:none;animation-play-state:running;animation-timing-function:ease;backface-visibility:visible;background:0;background-attachment:scroll;background-clip:border-box;background-color:rgba(0,0,0,0);background-image:none;background-origin:padding-box;background-position:0 0;background-position-x:0;background-position-y:0;background-repeat:repeat;background-size:auto auto;border:0;border-style:none;border-width:medium;border-color:inherit;border-bottom:0;border-bottom-color:inherit;border-bottom-left-radius:0;border-bottom-right-radius:0;border-bottom-style:none;border-bottom-width:medium;border-collapse:separate;border-image:none;border-left:0;border-left-color:inherit;border-left-style:none;border-left-width:medium;border-radius:0;border-right:0;border-right-color:inherit;border-right-style:none;border-right-width:medium;border-spacing:0;border-top:0;border-top-color:inherit;border-top-left-radius:0;border-top-right-radius:0;border-top-style:none;border-top-width:medium;box-shadow:none;box-sizing:border-box;caption-side:top;clear:none;clip:auto;color:inherit;columns:auto;column-count:auto;column-fill:balance;column-gap:normal;column-rule:medium none currentColor;column-rule-color:currentColor;column-rule-style:none;column-rule-width:none;column-span:1;column-width:auto;counter-increment:none;counter-reset:none;direction:ltr;empty-cells:show;float:none;font:normal;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","Helvetica Neue",Arial,sans-serif;font-size:medium;font-style:normal;font-variant:normal;font-weight:normal;height:auto;hyphens:none;letter-spacing:normal;line-height:normal;list-style:none;list-style-image:none;list-style-position:outside;list-style-type:disc;margin:0;margin-bottom:0;margin-left:0;margin-right:0;margin-top:0;opacity:1;orphans:0;outline:0;outline-color:invert;outline-style:none;outline-width:medium;overflow:visible;overflow-x:visible;overflow-y:visible;padding:0;padding-bottom:0;padding-left:0;padding-right:0;padding-top:0;page-break-after:auto;page-break-before:auto;page-break-inside:auto;perspective:none;perspective-origin:50% 50%;pointer-events:auto;position:static;quotes:"\\201C" "\\201D" "\\2018" "\\2019";tab-size:8;table-layout:auto;text-align:inherit;text-align-last:auto;text-decoration:none;text-decoration-color:inherit;text-decoration-line:none;text-decoration-style:solid;text-indent:0;text-shadow:none;text-transform:none;transform:none;transform-style:flat;transition:none;transition-delay:0s;transition-duration:0s;transition-property:none;transition-timing-function:ease;unicode-bidi:normal;vertical-align:baseline;visibility:visible;white-space:normal;widows:0;word-spacing:normal;z-index:auto}.-cbwsdk-css-reset strong{font-weight:bold}.-cbwsdk-css-reset *{box-sizing:border-box;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","Helvetica Neue",Arial,sans-serif;line-height:1}.-cbwsdk-css-reset [class*=container]{margin:0;padding:0}.-cbwsdk-css-reset style{display:none}';var M3=te&&te.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Po,"__esModule",{value:!0});Po.injectCssReset=void 0;const C3=M3(pc);function I3(){const t=document.createElement("style");t.type="text/css",t.appendChild(document.createTextNode(C3.default)),document.documentElement.appendChild(t)}Po.injectCssReset=I3;Object.defineProperty(wo,"__esModule",{value:!0});wo.WalletSDKUI=void 0;const R3=Eo,A3=O0,T3=Po;class k3{constructor(e){this.standalone=null,this.attached=!1,this.appSrc=null,this.snackbar=new A3.Snackbar({darkMode:e.darkMode}),this.linkFlow=new R3.LinkFlow({darkMode:e.darkMode,version:e.version,sessionId:e.session.id,sessionSecret:e.session.secret,linkAPIUrl:e.linkAPIUrl,connected$:e.connected$,chainId$:e.chainId$,isParentConnection:!1})}attach(){if(this.attached)throw new Error("Coinbase Wallet SDK UI is already attached");const e=document.documentElement,r=document.createElement("div");r.className="-cbwsdk-css-reset",e.appendChild(r),this.linkFlow.attach(r),this.snackbar.attach(r),this.attached=!0,(0,T3.injectCssReset)()}setConnectDisabled(e){this.linkFlow.setConnectDisabled(e)}addEthereumChain(e){}watchAsset(e){}switchEthereumChain(e){}requestEthereumAccounts(e){this.linkFlow.open({onCancel:e.onCancel})}hideRequestEthereumAccounts(){this.linkFlow.close()}signEthereumMessage(e){}signEthereumTransaction(e){}submitEthereumTransaction(e){}ethereumAddressFromSignedMessage(e){}showConnecting(e){let r;return e.isUnlinkedErrorState?r={autoExpand:!0,message:"Connection lost",appSrc:this.appSrc,menuItems:[{isRed:!1,info:"Reset connection",svgWidth:"10",svgHeight:"11",path:"M5.00008 0.96875C6.73133 0.96875 8.23758 1.94375 9.00008 3.375L10.0001 2.375V5.5H9.53133H7.96883H6.87508L7.80633 4.56875C7.41258 3.3875 6.31258 2.53125 5.00008 2.53125C3.76258 2.53125 2.70633 3.2875 2.25633 4.36875L0.812576 3.76875C1.50008 2.125 3.11258 0.96875 5.00008 0.96875ZM2.19375 6.43125C2.5875 7.6125 3.6875 8.46875 5 8.46875C6.2375 8.46875 7.29375 7.7125 7.74375 6.63125L9.1875 7.23125C8.5 8.875 6.8875 10.0312 5 10.0312C3.26875 10.0312 1.7625 9.05625 1 7.625L0 8.625V5.5H0.46875H2.03125H3.125L2.19375 6.43125Z",defaultFillRule:"evenodd",defaultClipRule:"evenodd",onClick:e.onResetConnection}]}:r={message:"Confirm on phone",appSrc:this.appSrc,menuItems:[{isRed:!0,info:"Cancel transaction",svgWidth:"11",svgHeight:"11",path:"M10.3711 1.52346L9.21775 0.370117L5.37109 4.21022L1.52444 0.370117L0.371094 1.52346L4.2112 5.37012L0.371094 9.21677L1.52444 10.3701L5.37109 6.53001L9.21775 10.3701L10.3711 9.21677L6.53099 5.37012L10.3711 1.52346Z",defaultFillRule:"inherit",defaultClipRule:"inherit",onClick:e.onCancel},{isRed:!1,info:"Reset connection",svgWidth:"10",svgHeight:"11",path:"M5.00008 0.96875C6.73133 0.96875 8.23758 1.94375 9.00008 3.375L10.0001 2.375V5.5H9.53133H7.96883H6.87508L7.80633 4.56875C7.41258 3.3875 6.31258 2.53125 5.00008 2.53125C3.76258 2.53125 2.70633 3.2875 2.25633 4.36875L0.812576 3.76875C1.50008 2.125 3.11258 0.96875 5.00008 0.96875ZM2.19375 6.43125C2.5875 7.6125 3.6875 8.46875 5 8.46875C6.2375 8.46875 7.29375 7.7125 7.74375 6.63125L9.1875 7.23125C8.5 8.875 6.8875 10.0312 5 10.0312C3.26875 10.0312 1.7625 9.05625 1 7.625L0 8.625V5.5H0.46875H2.03125H3.125L2.19375 6.43125Z",defaultFillRule:"evenodd",defaultClipRule:"evenodd",onClick:e.onResetConnection}]},this.snackbar.presentItem(r)}setAppSrc(e){this.appSrc=e}reloadUI(){document.location.reload()}inlineAccountsResponse(){return!1}inlineAddEthereumChain(e){return!1}inlineWatchAsset(){return!1}inlineSwitchEthereumChain(){return!1}setStandalone(e){this.standalone=e}isStandalone(){var e;return(e=this.standalone)!==null&&e!==void 0?e:!1}}wo.WalletSDKUI=k3;var Do={},jo={};Object.defineProperty(jo,"__esModule",{value:!0});var jn;(function(t){t.typeOfFunction="function",t.boolTrue=!0})(jn||(jn={}));function L0(t,e,r){if(!r||typeof r.value!==jn.typeOfFunction)throw new TypeError("Only methods can be decorated with @bind. <"+e+"> is not a method!");return{configurable:jn.boolTrue,get:function(){var n=r.value.bind(this);return Object.defineProperty(this,e,{value:n,configurable:jn.boolTrue,writable:jn.boolTrue}),n}}}jo.bind=L0;jo.default=L0;function B0(t){return function(r){return r.lift(new N3(t))}}var N3=function(){function t(e){this.durationSelector=e}return t.prototype.call=function(e,r){return r.subscribe(new O3(e,this.durationSelector))},t}(),O3=function(t){G(e,t);function e(r,n){var i=t.call(this,r)||this;return i.durationSelector=n,i.hasValue=!1,i}return e.prototype._next=function(r){if(this.value=r,this.hasValue=!0,!this.throttled){var n=void 0;try{var i=this.durationSelector;n=i(r)}catch(o){return this.destination.error(o)}var s=ot(n,new it(this));!s||s.closed?this.clearThrottle():this.add(this.throttled=s)}},e.prototype.clearThrottle=function(){var r=this,n=r.value,i=r.hasValue,s=r.throttled;s&&(this.remove(s),this.throttled=void 0,s.unsubscribe()),i&&(this.value=void 0,this.hasValue=!1,this.destination.next(n))},e.prototype.notifyNext=function(){this.clearThrottle()},e.prototype.notifyComplete=function(){this.clearThrottle()},e}(st);function L3(t,e){return e===void 0&&(e=It),B0(function(){return b0(t,e)})}function B3(t){return function(r){return r.lift(new P3(t))}}var P3=function(){function t(e){this.closingNotifier=e}return t.prototype.call=function(e,r){return r.subscribe(new D3(e,this.closingNotifier))},t}(),D3=function(t){G(e,t);function e(r,n){var i=t.call(this,r)||this;return i.buffer=[],i.add(ot(n,new it(i))),i}return e.prototype._next=function(r){this.buffer.push(r)},e.prototype.notifyNext=function(){var r=this.buffer;this.buffer=[],this.destination.next(r)},e}(st);function j3(t,e){return e===void 0&&(e=null),function(n){return n.lift(new $3(t,e))}}var $3=function(){function t(e,r){this.bufferSize=e,this.startBufferEvery=r,!r||e===r?this.subscriberClass=F3:this.subscriberClass=U3}return t.prototype.call=function(e,r){return r.subscribe(new this.subscriberClass(e,this.bufferSize,this.startBufferEvery))},t}(),F3=function(t){G(e,t);function e(r,n){var i=t.call(this,r)||this;return i.bufferSize=n,i.buffer=[],i}return e.prototype._next=function(r){var n=this.buffer;n.push(r),n.length==this.bufferSize&&(this.destination.next(n),this.buffer=[])},e.prototype._complete=function(){var r=this.buffer;r.length>0&&this.destination.next(r),t.prototype._complete.call(this)},e}(ie),U3=function(t){G(e,t);function e(r,n,i){var s=t.call(this,r)||this;return s.bufferSize=n,s.startBufferEvery=i,s.buffers=[],s.count=0,s}return e.prototype._next=function(r){var n=this,i=n.bufferSize,s=n.startBufferEvery,o=n.buffers,a=n.count;this.count++,a%s===0&&o.push([]);for(var c=o.length;c--;){var l=o[c];l.push(r),l.length===i&&(o.splice(c,1),this.destination.next(l))}},e.prototype._complete=function(){for(var r=this,n=r.buffers,i=r.destination;n.length>0;){var s=n.shift();s.length>0&&i.next(s)}t.prototype._complete.call(this)},e}(ie);function H3(t){var e=arguments.length,r=It;Ot(arguments[arguments.length-1])&&(r=arguments[arguments.length-1],e--);var n=null;e>=2&&(n=arguments[1]);var i=Number.POSITIVE_INFINITY;return e>=3&&(i=arguments[2]),function(o){return o.lift(new W3(t,n,i,r))}}var W3=function(){function t(e,r,n,i){this.bufferTimeSpan=e,this.bufferCreationInterval=r,this.maxBufferSize=n,this.scheduler=i}return t.prototype.call=function(e,r){return r.subscribe(new z3(e,this.bufferTimeSpan,this.bufferCreationInterval,this.maxBufferSize,this.scheduler))},t}(),V3=function(){function t(){this.buffer=[]}return t}(),z3=function(t){G(e,t);function e(r,n,i,s,o){var a=t.call(this,r)||this;a.bufferTimeSpan=n,a.bufferCreationInterval=i,a.maxBufferSize=s,a.scheduler=o,a.contexts=[];var c=a.openContext();if(a.timespanOnly=i==null||i<0,a.timespanOnly){var l={subscriber:a,context:c,bufferTimeSpan:n};a.add(c.closeAction=o.schedule(mh,n,l))}else{var p={subscriber:a,context:c},g={bufferTimeSpan:n,bufferCreationInterval:i,subscriber:a,scheduler:o};a.add(c.closeAction=o.schedule(P0,n,p)),a.add(o.schedule(q3,i,g))}return a}return e.prototype._next=function(r){for(var n=this.contexts,i=n.length,s,o=0;o<i;o++){var a=n[o],c=a.buffer;c.push(r),c.length==this.maxBufferSize&&(s=a)}s&&this.onBufferFull(s)},e.prototype._error=function(r){this.contexts.length=0,t.prototype._error.call(this,r)},e.prototype._complete=function(){for(var r=this,n=r.contexts,i=r.destination;n.length>0;){var s=n.shift();i.next(s.buffer)}t.prototype._complete.call(this)},e.prototype._unsubscribe=function(){this.contexts=null},e.prototype.onBufferFull=function(r){this.closeContext(r);var n=r.closeAction;if(n.unsubscribe(),this.remove(n),!this.closed&&this.timespanOnly){r=this.openContext();var i=this.bufferTimeSpan,s={subscriber:this,context:r,bufferTimeSpan:i};this.add(r.closeAction=this.scheduler.schedule(mh,i,s))}},e.prototype.openContext=function(){var r=new V3;return this.contexts.push(r),r},e.prototype.closeContext=function(r){this.destination.next(r.buffer);var n=this.contexts,i=n?n.indexOf(r):-1;i>=0&&n.splice(n.indexOf(r),1)},e}(ie);function mh(t){var e=t.subscriber,r=t.context;r&&e.closeContext(r),e.closed||(t.context=e.openContext(),t.context.closeAction=this.schedule(t,t.bufferTimeSpan))}function q3(t){var e=t.bufferCreationInterval,r=t.bufferTimeSpan,n=t.subscriber,i=t.scheduler,s=n.openContext(),o=this;n.closed||(n.add(s.closeAction=i.schedule(P0,r,{subscriber:n,context:s})),o.schedule(t,e))}function P0(t){var e=t.subscriber,r=t.context;e.closeContext(r)}function G3(t,e){return function(n){return n.lift(new J3(t,e))}}var J3=function(){function t(e,r){this.openings=e,this.closingSelector=r}return t.prototype.call=function(e,r){return r.subscribe(new Z3(e,this.openings,this.closingSelector))},t}(),Z3=function(t){G(e,t);function e(r,n,i){var s=t.call(this,r)||this;return s.closingSelector=i,s.contexts=[],s.add(Er(s,n)),s}return e.prototype._next=function(r){for(var n=this.contexts,i=n.length,s=0;s<i;s++)n[s].buffer.push(r)},e.prototype._error=function(r){for(var n=this.contexts;n.length>0;){var i=n.shift();i.subscription.unsubscribe(),i.buffer=null,i.subscription=null}this.contexts=null,t.prototype._error.call(this,r)},e.prototype._complete=function(){for(var r=this.contexts;r.length>0;){var n=r.shift();this.destination.next(n.buffer),n.subscription.unsubscribe(),n.buffer=null,n.subscription=null}this.contexts=null,t.prototype._complete.call(this)},e.prototype.notifyNext=function(r,n){r?this.closeBuffer(r):this.openBuffer(n)},e.prototype.notifyComplete=function(r){this.closeBuffer(r.context)},e.prototype.openBuffer=function(r){try{var n=this.closingSelector,i=n.call(this,r);i&&this.trySubscribe(i)}catch(s){this._error(s)}},e.prototype.closeBuffer=function(r){var n=this.contexts;if(n&&r){var i=r.buffer,s=r.subscription;this.destination.next(i),n.splice(n.indexOf(r),1),this.remove(s),s.unsubscribe()}},e.prototype.trySubscribe=function(r){var n=this.contexts,i=[],s=new nt,o={buffer:i,subscription:s};n.push(o);var a=Er(this,r,o);!a||a.closed?this.closeBuffer(o):(a.context=o,this.add(a),s.add(a))},e}(_n);function Q3(t){return function(e){return e.lift(new Y3(t))}}var Y3=function(){function t(e){this.closingSelector=e}return t.prototype.call=function(e,r){return r.subscribe(new K3(e,this.closingSelector))},t}(),K3=function(t){G(e,t);function e(r,n){var i=t.call(this,r)||this;return i.closingSelector=n,i.subscribing=!1,i.openBuffer(),i}return e.prototype._next=function(r){this.buffer.push(r)},e.prototype._complete=function(){var r=this.buffer;r&&this.destination.next(r),t.prototype._complete.call(this)},e.prototype._unsubscribe=function(){this.buffer=void 0,this.subscribing=!1},e.prototype.notifyNext=function(){this.openBuffer()},e.prototype.notifyComplete=function(){this.subscribing?this.complete():this.openBuffer()},e.prototype.openBuffer=function(){var r=this.closingSubscription;r&&(this.remove(r),r.unsubscribe());var n=this.buffer;this.buffer&&this.destination.next(n),this.buffer=[];var i;try{var s=this.closingSelector;i=s()}catch(o){return this.error(o)}r=new nt,this.closingSubscription=r,this.add(r),this.subscribing=!0,r.add(ot(i,new it(this))),this.subscribing=!1},e}(st);function X3(t){return function(r){var n=new e4(t),i=r.lift(n);return n.caught=i}}var e4=function(){function t(e){this.selector=e}return t.prototype.call=function(e,r){return r.subscribe(new t4(e,this.selector,this.caught))},t}(),t4=function(t){G(e,t);function e(r,n,i){var s=t.call(this,r)||this;return s.selector=n,s.caught=i,s}return e.prototype.error=function(r){if(!this.isStopped){var n=void 0;try{n=this.selector(r,this.caught)}catch(o){t.prototype.error.call(this,o);return}this._unsubscribeAndRecycle();var i=new it(this);this.add(i);var s=ot(n,i);s!==i&&this.add(s)}},e}(st);function r4(t){return function(e){return e.lift(new ec(t))}}function n4(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var r=null;return typeof t[t.length-1]=="function"&&(r=t.pop()),t.length===1&&Ct(t[0])&&(t=t[0].slice()),function(n){return n.lift.call(xr([n].concat(t)),new ec(r))}}function i4(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return function(r){return r.lift.call(Pi.apply(void 0,[r].concat(t)))}}function D0(t,e){return fn(t,e,1)}function s4(t,e){return D0(function(){return t},e)}function o4(t){return function(e){return e.lift(new a4(t,e))}}var a4=function(){function t(e,r){this.predicate=e,this.source=r}return t.prototype.call=function(e,r){return r.subscribe(new u4(e,this.predicate,this.source))},t}(),u4=function(t){G(e,t);function e(r,n,i){var s=t.call(this,r)||this;return s.predicate=n,s.source=i,s.count=0,s.index=0,s}return e.prototype._next=function(r){this.predicate?this._tryPredicate(r):this.count++},e.prototype._tryPredicate=function(r){var n;try{n=this.predicate(r,this.index++,this.source)}catch(i){this.destination.error(i);return}n&&this.count++},e.prototype._complete=function(){this.destination.next(this.count),this.destination.complete()},e}(ie);function c4(t){return function(e){return e.lift(new l4(t))}}var l4=function(){function t(e){this.durationSelector=e}return t.prototype.call=function(e,r){return r.subscribe(new h4(e,this.durationSelector))},t}(),h4=function(t){G(e,t);function e(r,n){var i=t.call(this,r)||this;return i.durationSelector=n,i.hasValue=!1,i}return e.prototype._next=function(r){try{var n=this.durationSelector.call(this,r);n&&this._tryNext(r,n)}catch(i){this.destination.error(i)}},e.prototype._complete=function(){this.emitValue(),this.destination.complete()},e.prototype._tryNext=function(r,n){var i=this.durationSubscription;this.value=r,this.hasValue=!0,i&&(i.unsubscribe(),this.remove(i)),i=ot(n,new it(this)),i&&!i.closed&&this.add(this.durationSubscription=i)},e.prototype.notifyNext=function(){this.emitValue()},e.prototype.notifyComplete=function(){this.emitValue()},e.prototype.emitValue=function(){if(this.hasValue){var r=this.value,n=this.durationSubscription;n&&(this.durationSubscription=void 0,n.unsubscribe(),this.remove(n)),this.value=void 0,this.hasValue=!1,t.prototype._next.call(this,r)}},e}(st);function f4(t,e){return e===void 0&&(e=It),function(r){return r.lift(new d4(t,e))}}var d4=function(){function t(e,r){this.dueTime=e,this.scheduler=r}return t.prototype.call=function(e,r){return r.subscribe(new p4(e,this.dueTime,this.scheduler))},t}(),p4=function(t){G(e,t);function e(r,n,i){var s=t.call(this,r)||this;return s.dueTime=n,s.scheduler=i,s.debouncedSubscription=null,s.lastValue=null,s.hasValue=!1,s}return e.prototype._next=function(r){this.clearDebounce(),this.lastValue=r,this.hasValue=!0,this.add(this.debouncedSubscription=this.scheduler.schedule(g4,this.dueTime,this))},e.prototype._complete=function(){this.debouncedNext(),this.destination.complete()},e.prototype.debouncedNext=function(){if(this.clearDebounce(),this.hasValue){var r=this.lastValue;this.lastValue=null,this.hasValue=!1,this.destination.next(r)}},e.prototype.clearDebounce=function(){var r=this.debouncedSubscription;r!==null&&(this.remove(r),r.unsubscribe(),this.debouncedSubscription=null)},e}(ie);function g4(t){t.debouncedNext()}function cs(t){return t===void 0&&(t=null),function(e){return e.lift(new b4(t))}}var b4=function(){function t(e){this.defaultValue=e}return t.prototype.call=function(e,r){return r.subscribe(new v4(e,this.defaultValue))},t}(),v4=function(t){G(e,t);function e(r,n){var i=t.call(this,r)||this;return i.defaultValue=n,i.isEmpty=!0,i}return e.prototype._next=function(r){this.isEmpty=!1,this.destination.next(r)},e.prototype._complete=function(){this.isEmpty&&this.destination.next(this.defaultValue),this.destination.complete()},e}(ie);function j0(t){return t instanceof Date&&!isNaN(+t)}function m4(t,e){e===void 0&&(e=It);var r=j0(t),n=r?+t-e.now():Math.abs(t);return function(i){return i.lift(new y4(n,e))}}var y4=function(){function t(e,r){this.delay=e,this.scheduler=r}return t.prototype.call=function(e,r){return r.subscribe(new _4(e,this.delay,this.scheduler))},t}(),_4=function(t){G(e,t);function e(r,n,i){var s=t.call(this,r)||this;return s.delay=n,s.scheduler=i,s.queue=[],s.active=!1,s.errored=!1,s}return e.dispatch=function(r){for(var n=r.source,i=n.queue,s=r.scheduler,o=r.destination;i.length>0&&i[0].time-s.now()<=0;)i.shift().notification.observe(o);if(i.length>0){var a=Math.max(0,i[0].time-s.now());this.schedule(r,a)}else this.unsubscribe(),n.active=!1},e.prototype._schedule=function(r){this.active=!0;var n=this.destination;n.add(r.schedule(e.dispatch,this.delay,{source:this,destination:this.destination,scheduler:r}))},e.prototype.scheduleNotification=function(r){if(this.errored!==!0){var n=this.scheduler,i=new w4(n.now()+this.delay,r);this.queue.push(i),this.active===!1&&this._schedule(n)}},e.prototype._next=function(r){this.scheduleNotification(_r.createNext(r))},e.prototype._error=function(r){this.errored=!0,this.queue=[],this.destination.error(r),this.unsubscribe()},e.prototype._complete=function(){this.scheduleNotification(_r.createComplete()),this.unsubscribe()},e}(ie),w4=function(){function t(e,r){this.time=e,this.notification=r}return t}();function E4(t,e){return e?function(r){return new x4(r,e).lift(new yh(t))}:function(r){return r.lift(new yh(t))}}var yh=function(){function t(e){this.delayDurationSelector=e}return t.prototype.call=function(e,r){return r.subscribe(new S4(e,this.delayDurationSelector))},t}(),S4=function(t){G(e,t);function e(r,n){var i=t.call(this,r)||this;return i.delayDurationSelector=n,i.completed=!1,i.delayNotifierSubscriptions=[],i.index=0,i}return e.prototype.notifyNext=function(r,n,i,s,o){this.destination.next(r),this.removeSubscription(o),this.tryComplete()},e.prototype.notifyError=function(r,n){this._error(r)},e.prototype.notifyComplete=function(r){var n=this.removeSubscription(r);n&&this.destination.next(n),this.tryComplete()},e.prototype._next=function(r){var n=this.index++;try{var i=this.delayDurationSelector(r,n);i&&this.tryDelay(i,r)}catch(s){this.destination.error(s)}},e.prototype._complete=function(){this.completed=!0,this.tryComplete(),this.unsubscribe()},e.prototype.removeSubscription=function(r){r.unsubscribe();var n=this.delayNotifierSubscriptions.indexOf(r);return n!==-1&&this.delayNotifierSubscriptions.splice(n,1),r.outerValue},e.prototype.tryDelay=function(r,n){var i=Er(this,r,n);if(i&&!i.closed){var s=this.destination;s.add(i),this.delayNotifierSubscriptions.push(i)}},e.prototype.tryComplete=function(){this.completed&&this.delayNotifierSubscriptions.length===0&&this.destination.complete()},e}(_n),x4=function(t){G(e,t);function e(r,n){var i=t.call(this)||this;return i.source=r,i.subscriptionDelay=n,i}return e.prototype._subscribe=function(r){this.subscriptionDelay.subscribe(new M4(r,this.source))},e}(_e),M4=function(t){G(e,t);function e(r,n){var i=t.call(this)||this;return i.parent=r,i.source=n,i.sourceSubscribed=!1,i}return e.prototype._next=function(r){this.subscribeToSource()},e.prototype._error=function(r){this.unsubscribe(),this.parent.error(r)},e.prototype._complete=function(){this.unsubscribe(),this.subscribeToSource()},e.prototype.subscribeToSource=function(){this.sourceSubscribed||(this.sourceSubscribed=!0,this.unsubscribe(),this.source.subscribe(this.parent))},e}(ie);function C4(){return function(e){return e.lift(new I4)}}var I4=function(){function t(){}return t.prototype.call=function(e,r){return r.subscribe(new R4(e))},t}(),R4=function(t){G(e,t);function e(r){return t.call(this,r)||this}return e.prototype._next=function(r){r.observe(this.destination)},e}(ie);function A4(t,e){return function(r){return r.lift(new T4(t,e))}}var T4=function(){function t(e,r){this.keySelector=e,this.flushes=r}return t.prototype.call=function(e,r){return r.subscribe(new k4(e,this.keySelector,this.flushes))},t}(),k4=function(t){G(e,t);function e(r,n,i){var s=t.call(this,r)||this;return s.keySelector=n,s.values=new Set,i&&s.add(ot(i,new it(s))),s}return e.prototype.notifyNext=function(){this.values.clear()},e.prototype.notifyError=function(r){this._error(r)},e.prototype._next=function(r){this.keySelector?this._useKeySelector(r):this._finalizeNext(r,r)},e.prototype._useKeySelector=function(r){var n,i=this.destination;try{n=this.keySelector(r)}catch(s){i.error(s);return}this._finalizeNext(n,r)},e.prototype._finalizeNext=function(r,n){var i=this.values;i.has(r)||(i.add(r),this.destination.next(n))},e}(st);function $0(t,e){return function(r){return r.lift(new N4(t,e))}}var N4=function(){function t(e,r){this.compare=e,this.keySelector=r}return t.prototype.call=function(e,r){return r.subscribe(new O4(e,this.compare,this.keySelector))},t}(),O4=function(t){G(e,t);function e(r,n,i){var s=t.call(this,r)||this;return s.keySelector=i,s.hasKey=!1,typeof n=="function"&&(s.compare=n),s}return e.prototype.compare=function(r,n){return r===n},e.prototype._next=function(r){var n;try{var i=this.keySelector;n=i?i(r):r}catch(a){return this.destination.error(a)}var s=!1;if(this.hasKey)try{var o=this.compare;s=o(this.key,n)}catch(a){return this.destination.error(a)}else this.hasKey=!0;s||(this.key=n,this.destination.next(r))},e}(ie);function L4(t,e){return $0(function(r,n){return e?e(r[t],n[t]):r[t]===n[t]})}function $o(t){return t===void 0&&(t=D4),function(e){return e.lift(new B4(t))}}var B4=function(){function t(e){this.errorFactory=e}return t.prototype.call=function(e,r){return r.subscribe(new P4(e,this.errorFactory))},t}(),P4=function(t){G(e,t);function e(r,n){var i=t.call(this,r)||this;return i.errorFactory=n,i.hasValue=!1,i}return e.prototype._next=function(r){this.hasValue=!0,this.destination.next(r)},e.prototype._complete=function(){if(this.hasValue)return this.destination.complete();var r=void 0;try{r=this.errorFactory()}catch(n){r=n}this.destination.error(r)},e}(ie);function D4(){return new as}function gc(t){return function(e){return t===0?gi():e.lift(new j4(t))}}var j4=function(){function t(e){if(this.total=e,this.total<0)throw new ei}return t.prototype.call=function(e,r){return r.subscribe(new $4(e,this.total))},t}(),$4=function(t){G(e,t);function e(r,n){var i=t.call(this,r)||this;return i.total=n,i.count=0,i}return e.prototype._next=function(r){var n=this.total,i=++this.count;i<=n&&(this.destination.next(r),i===n&&(this.destination.complete(),this.unsubscribe()))},e}(ie);function F4(t,e){if(t<0)throw new ei;var r=arguments.length>=2;return function(n){return n.pipe(Br(function(i,s){return s===t}),gc(1),r?cs(e):$o(function(){return new ei}))}}function U4(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return function(r){return Pi(r,xo.apply(void 0,t))}}function H4(t,e){return function(r){return r.lift(new W4(t,e,r))}}var W4=function(){function t(e,r,n){this.predicate=e,this.thisArg=r,this.source=n}return t.prototype.call=function(e,r){return r.subscribe(new V4(e,this.predicate,this.thisArg,this.source))},t}(),V4=function(t){G(e,t);function e(r,n,i,s){var o=t.call(this,r)||this;return o.predicate=n,o.thisArg=i,o.source=s,o.index=0,o.thisArg=i||o,o}return e.prototype.notifyComplete=function(r){this.destination.next(r),this.destination.complete()},e.prototype._next=function(r){var n=!1;try{n=this.predicate.call(this.thisArg,r,this.index++,this.source)}catch(i){this.destination.error(i);return}n||this.notifyComplete(!1)},e.prototype._complete=function(){this.notifyComplete(!0)},e}(ie);function z4(){return function(t){return t.lift(new q4)}}var q4=function(){function t(){}return t.prototype.call=function(e,r){return r.subscribe(new G4(e))},t}(),G4=function(t){G(e,t);function e(r){var n=t.call(this,r)||this;return n.hasCompleted=!1,n.hasSubscription=!1,n}return e.prototype._next=function(r){this.hasSubscription||(this.hasSubscription=!0,this.add(ot(r,new it(this))))},e.prototype._complete=function(){this.hasCompleted=!0,this.hasSubscription||this.destination.complete()},e.prototype.notifyComplete=function(){this.hasSubscription=!1,this.hasCompleted&&this.destination.complete()},e}(st);function F0(t,e){return e?function(r){return r.pipe(F0(function(n,i){return xr(t(n,i)).pipe(qt(function(s,o){return e(n,s,i,o)}))}))}:function(r){return r.lift(new J4(t))}}var J4=function(){function t(e){this.project=e}return t.prototype.call=function(e,r){return r.subscribe(new Z4(e,this.project))},t}(),Z4=function(t){G(e,t);function e(r,n){var i=t.call(this,r)||this;return i.project=n,i.hasSubscription=!1,i.hasCompleted=!1,i.index=0,i}return e.prototype._next=function(r){this.hasSubscription||this.tryNext(r)},e.prototype.tryNext=function(r){var n,i=this.index++;try{n=this.project(r,i)}catch(s){this.destination.error(s);return}this.hasSubscription=!0,this._innerSub(n)},e.prototype._innerSub=function(r){var n=new it(this),i=this.destination;i.add(n);var s=ot(r,n);s!==n&&i.add(s)},e.prototype._complete=function(){this.hasCompleted=!0,this.hasSubscription||this.destination.complete(),this.unsubscribe()},e.prototype.notifyNext=function(r){this.destination.next(r)},e.prototype.notifyError=function(r){this.destination.error(r)},e.prototype.notifyComplete=function(){this.hasSubscription=!1,this.hasCompleted&&this.destination.complete()},e}(st);function Q4(t,e,r){return e===void 0&&(e=Number.POSITIVE_INFINITY),e=(e||0)<1?Number.POSITIVE_INFINITY:e,function(n){return n.lift(new Y4(t,e,r))}}var Y4=function(){function t(e,r,n){this.project=e,this.concurrent=r,this.scheduler=n}return t.prototype.call=function(e,r){return r.subscribe(new K4(e,this.project,this.concurrent,this.scheduler))},t}(),K4=function(t){G(e,t);function e(r,n,i,s){var o=t.call(this,r)||this;return o.project=n,o.concurrent=i,o.scheduler=s,o.index=0,o.active=0,o.hasCompleted=!1,i<Number.POSITIVE_INFINITY&&(o.buffer=[]),o}return e.dispatch=function(r){var n=r.subscriber,i=r.result,s=r.value,o=r.index;n.subscribeToProjection(i,s,o)},e.prototype._next=function(r){var n=this.destination;if(n.closed){this._complete();return}var i=this.index++;if(this.active<this.concurrent){n.next(r);try{var s=this.project,o=s(r,i);if(!this.scheduler)this.subscribeToProjection(o,r,i);else{var a={subscriber:this,result:o,value:r,index:i},c=this.destination;c.add(this.scheduler.schedule(e.dispatch,0,a))}}catch(l){n.error(l)}}else this.buffer.push(r)},e.prototype.subscribeToProjection=function(r,n,i){this.active++;var s=this.destination;s.add(ot(r,new it(this)))},e.prototype._complete=function(){this.hasCompleted=!0,this.hasCompleted&&this.active===0&&this.destination.complete(),this.unsubscribe()},e.prototype.notifyNext=function(r){this._next(r)},e.prototype.notifyComplete=function(){var r=this.buffer;this.active--,r&&r.length>0&&this._next(r.shift()),this.hasCompleted&&this.active===0&&this.destination.complete()},e}(st);function X4(t){return function(e){return e.lift(new ex(t))}}var ex=function(){function t(e){this.callback=e}return t.prototype.call=function(e,r){return r.subscribe(new tx(e,this.callback))},t}(),tx=function(t){G(e,t);function e(r,n){var i=t.call(this,r)||this;return i.add(new nt(n)),i}return e}(ie);function rx(t,e){if(typeof t!="function")throw new TypeError("predicate is not a function");return function(r){return r.lift(new U0(t,r,!1,e))}}var U0=function(){function t(e,r,n,i){this.predicate=e,this.source=r,this.yieldIndex=n,this.thisArg=i}return t.prototype.call=function(e,r){return r.subscribe(new nx(e,this.predicate,this.source,this.yieldIndex,this.thisArg))},t}(),nx=function(t){G(e,t);function e(r,n,i,s,o){var a=t.call(this,r)||this;return a.predicate=n,a.source=i,a.yieldIndex=s,a.thisArg=o,a.index=0,a}return e.prototype.notifyComplete=function(r){var n=this.destination;n.next(r),n.complete(),this.unsubscribe()},e.prototype._next=function(r){var n=this,i=n.predicate,s=n.thisArg,o=this.index++;try{var a=i.call(s||this,r,o,this.source);a&&this.notifyComplete(this.yieldIndex?o:r)}catch(c){this.destination.error(c)}},e.prototype._complete=function(){this.notifyComplete(this.yieldIndex?-1:void 0)},e}(ie);function ix(t,e){return function(r){return r.lift(new U0(t,r,!0,e))}}function sx(t,e){var r=arguments.length>=2;return function(n){return n.pipe(t?Br(function(i,s){return t(i,s,n)}):Or,gc(1),r?cs(e):$o(function(){return new as}))}}function ox(){return function(e){return e.lift(new ax)}}var ax=function(){function t(){}return t.prototype.call=function(e,r){return r.subscribe(new ux(e))},t}(),ux=function(t){G(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype._next=function(r){},e}(ie);function cx(){return function(t){return t.lift(new lx)}}var lx=function(){function t(){}return t.prototype.call=function(e,r){return r.subscribe(new hx(e))},t}(),hx=function(t){G(e,t);function e(r){return t.call(this,r)||this}return e.prototype.notifyComplete=function(r){var n=this.destination;n.next(r),n.complete()},e.prototype._next=function(r){this.notifyComplete(!1)},e.prototype._complete=function(){this.notifyComplete(!0)},e}(ie);function js(t){return function(r){return t===0?gi():r.lift(new fx(t))}}var fx=function(){function t(e){if(this.total=e,this.total<0)throw new ei}return t.prototype.call=function(e,r){return r.subscribe(new dx(e,this.total))},t}(),dx=function(t){G(e,t);function e(r,n){var i=t.call(this,r)||this;return i.total=n,i.ring=new Array,i.count=0,i}return e.prototype._next=function(r){var n=this.ring,i=this.total,s=this.count++;if(n.length<i)n.push(r);else{var o=s%i;n[o]=r}},e.prototype._complete=function(){var r=this.destination,n=this.count;if(n>0)for(var i=this.count>=this.total?this.total:this.count,s=this.ring,o=0;o<i;o++){var a=n++%i;r.next(s[a])}r.complete()},e}(ie);function px(t,e){var r=arguments.length>=2;return function(n){return n.pipe(t?Br(function(i,s){return t(i,s,n)}):Or,js(1),r?cs(e):$o(function(){return new as}))}}function gx(t){return function(e){return e.lift(new bx(t))}}var bx=function(){function t(e){this.value=e}return t.prototype.call=function(e,r){return r.subscribe(new vx(e,this.value))},t}(),vx=function(t){G(e,t);function e(r,n){var i=t.call(this,r)||this;return i.value=n,i}return e.prototype._next=function(r){this.destination.next(this.value)},e}(ie);function mx(){return function(e){return e.lift(new yx)}}var yx=function(){function t(){}return t.prototype.call=function(e,r){return r.subscribe(new _x(e))},t}(),_x=function(t){G(e,t);function e(r){return t.call(this,r)||this}return e.prototype._next=function(r){this.destination.next(_r.createNext(r))},e.prototype._error=function(r){var n=this.destination;n.next(_r.createError(r)),n.complete()},e.prototype._complete=function(){var r=this.destination;r.next(_r.createComplete()),r.complete()},e}(ie);function $s(t,e){var r=!1;return arguments.length>=2&&(r=!0),function(i){return i.lift(new wx(t,e,r))}}var wx=function(){function t(e,r,n){n===void 0&&(n=!1),this.accumulator=e,this.seed=r,this.hasSeed=n}return t.prototype.call=function(e,r){return r.subscribe(new Ex(e,this.accumulator,this.seed,this.hasSeed))},t}(),Ex=function(t){G(e,t);function e(r,n,i,s){var o=t.call(this,r)||this;return o.accumulator=n,o._seed=i,o.hasSeed=s,o.index=0,o}return Object.defineProperty(e.prototype,"seed",{get:function(){return this._seed},set:function(r){this.hasSeed=!0,this._seed=r},enumerable:!0,configurable:!0}),e.prototype._next=function(r){if(!this.hasSeed)this.seed=r,this.destination.next(r);else return this._tryNext(r)},e.prototype._tryNext=function(r){var n=this.index++,i;try{i=this.accumulator(this.seed,r,n)}catch(s){this.destination.error(s)}this.seed=i,this.destination.next(i)},e}(ie);function Fo(t,e){return arguments.length>=2?function(n){return Xa($s(t,e),js(1),cs(e))(n)}:function(n){return Xa($s(function(i,s,o){return t(i,s,o+1)}),js(1))(n)}}function Sx(t){var e=typeof t=="function"?function(r,n){return t(r,n)>0?r:n}:function(r,n){return r>n?r:n};return Fo(e)}function xx(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return function(r){return r.lift.call(f0.apply(void 0,[r].concat(t)))}}function Mx(t,e,r){return r===void 0&&(r=Number.POSITIVE_INFINITY),typeof e=="function"?fn(function(){return t},e,r):(typeof e=="number"&&(r=e),fn(function(){return t},r))}function Cx(t,e,r){return r===void 0&&(r=Number.POSITIVE_INFINITY),function(n){return n.lift(new Ix(t,e,r))}}var Ix=function(){function t(e,r,n){this.accumulator=e,this.seed=r,this.concurrent=n}return t.prototype.call=function(e,r){return r.subscribe(new Rx(e,this.accumulator,this.seed,this.concurrent))},t}(),Rx=function(t){G(e,t);function e(r,n,i,s){var o=t.call(this,r)||this;return o.accumulator=n,o.acc=i,o.concurrent=s,o.hasValue=!1,o.hasCompleted=!1,o.buffer=[],o.active=0,o.index=0,o}return e.prototype._next=function(r){if(this.active<this.concurrent){var n=this.index++,i=this.destination,s=void 0;try{var o=this.accumulator;s=o(this.acc,r,n)}catch(a){return i.error(a)}this.active++,this._innerSub(s)}else this.buffer.push(r)},e.prototype._innerSub=function(r){var n=new it(this),i=this.destination;i.add(n);var s=ot(r,n);s!==n&&i.add(s)},e.prototype._complete=function(){this.hasCompleted=!0,this.active===0&&this.buffer.length===0&&(this.hasValue===!1&&this.destination.next(this.acc),this.destination.complete()),this.unsubscribe()},e.prototype.notifyNext=function(r){var n=this.destination;this.acc=r,this.hasValue=!0,n.next(r)},e.prototype.notifyComplete=function(){var r=this.buffer;this.active--,r.length>0?this._next(r.shift()):this.active===0&&this.hasCompleted&&(this.hasValue===!1&&this.destination.next(this.acc),this.destination.complete())},e}(st);function Ax(t){var e=typeof t=="function"?function(r,n){return t(r,n)<0?r:n}:function(r,n){return r<n?r:n};return Fo(e)}function dn(t,e){return function(n){var i;if(typeof t=="function"?i=t:i=function(){return t},typeof e=="function")return n.lift(new Tx(i,e));var s=Object.create(n,uE);return s.source=n,s.subjectFactory=i,s}}var Tx=function(){function t(e,r){this.subjectFactory=e,this.selector=r}return t.prototype.call=function(e,r){var n=this.selector,i=this.subjectFactory(),s=n(i).subscribe(e);return s.add(r.subscribe(i)),s},t}();function kx(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return t.length===1&&Ct(t[0])&&(t=t[0]),function(r){return r.lift(new Nx(t))}}var Nx=function(){function t(e){this.nextSources=e}return t.prototype.call=function(e,r){return r.subscribe(new Ox(e,this.nextSources))},t}(),Ox=function(t){G(e,t);function e(r,n){var i=t.call(this,r)||this;return i.destination=r,i.nextSources=n,i}return e.prototype.notifyError=function(){this.subscribeToNextSource()},e.prototype.notifyComplete=function(){this.subscribeToNextSource()},e.prototype._error=function(r){this.subscribeToNextSource(),this.unsubscribe()},e.prototype._complete=function(){this.subscribeToNextSource(),this.unsubscribe()},e.prototype.subscribeToNextSource=function(){var r=this.nextSources.shift();if(r){var n=new it(this),i=this.destination;i.add(n);var s=ot(r,n);s!==n&&i.add(s)}else this.destination.complete()},e}(st);function Lx(){return function(t){return t.lift(new Bx)}}var Bx=function(){function t(){}return t.prototype.call=function(e,r){return r.subscribe(new Px(e))},t}(),Px=function(t){G(e,t);function e(r){var n=t.call(this,r)||this;return n.hasPrev=!1,n}return e.prototype._next=function(r){var n;this.hasPrev?n=[this.prev,r]:this.hasPrev=!0,this.prev=r,n&&this.destination.next(n)},e}(ie);function Dx(t,e){return function(r){return[Br(t,e)(r),Br(p0(t,e))(r)]}}function jx(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var r=t.length;if(r===0)throw new Error("list of properties cannot be empty.");return function(n){return qt($x(t,r))(n)}}function $x(t,e){var r=function(n){for(var i=n,s=0;s<e;s++){var o=i!=null?i[t[s]]:void 0;if(o!==void 0)i=o;else return}return i};return r}function Fx(t){return t?dn(function(){return new vt},t):dn(new vt)}function Ux(t){return function(e){return dn(new Gd(t))(e)}}function Hx(){return function(t){return dn(new bi)(t)}}function Wx(t,e,r,n){r&&typeof r!="function"&&(n=r);var i=typeof r=="function"?r:void 0,s=new Xu(t,e,n);return function(o){return dn(function(){return s},i)(o)}}function Vx(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return function(n){return t.length===1&&Ct(t[0])&&(t=t[0]),n.lift.call(g0.apply(void 0,[n].concat(t)))}}function zx(t){return t===void 0&&(t=-1),function(e){return t===0?gi():t<0?e.lift(new _h(-1,e)):e.lift(new _h(t-1,e))}}var _h=function(){function t(e,r){this.count=e,this.source=r}return t.prototype.call=function(e,r){return r.subscribe(new qx(e,this.count,this.source))},t}(),qx=function(t){G(e,t);function e(r,n,i){var s=t.call(this,r)||this;return s.count=n,s.source=i,s}return e.prototype.complete=function(){if(!this.isStopped){var r=this,n=r.source,i=r.count;if(i===0)return t.prototype.complete.call(this);i>-1&&(this.count=i-1),n.subscribe(this._unsubscribeAndRecycle())}},e}(ie);function Gx(t){return function(e){return e.lift(new Jx(t))}}var Jx=function(){function t(e){this.notifier=e}return t.prototype.call=function(e,r){return r.subscribe(new Zx(e,this.notifier,r))},t}(),Zx=function(t){G(e,t);function e(r,n,i){var s=t.call(this,r)||this;return s.notifier=n,s.source=i,s.sourceIsBeingSubscribedTo=!0,s}return e.prototype.notifyNext=function(){this.sourceIsBeingSubscribedTo=!0,this.source.subscribe(this)},e.prototype.notifyComplete=function(){if(this.sourceIsBeingSubscribedTo===!1)return t.prototype.complete.call(this)},e.prototype.complete=function(){if(this.sourceIsBeingSubscribedTo=!1,!this.isStopped){if(this.retries||this.subscribeToRetries(),!this.retriesSubscription||this.retriesSubscription.closed)return t.prototype.complete.call(this);this._unsubscribeAndRecycle(),this.notifications.next(void 0)}},e.prototype._unsubscribe=function(){var r=this,n=r.notifications,i=r.retriesSubscription;n&&(n.unsubscribe(),this.notifications=void 0),i&&(i.unsubscribe(),this.retriesSubscription=void 0),this.retries=void 0},e.prototype._unsubscribeAndRecycle=function(){var r=this._unsubscribe;return this._unsubscribe=null,t.prototype._unsubscribeAndRecycle.call(this),this._unsubscribe=r,this},e.prototype.subscribeToRetries=function(){this.notifications=new vt;var r;try{var n=this.notifier;r=n(this.notifications)}catch{return t.prototype.complete.call(this)}this.retries=r,this.retriesSubscription=ot(r,new it(this))},e}(st);function Qx(t){return t===void 0&&(t=-1),function(e){return e.lift(new Yx(t,e))}}var Yx=function(){function t(e,r){this.count=e,this.source=r}return t.prototype.call=function(e,r){return r.subscribe(new Kx(e,this.count,this.source))},t}(),Kx=function(t){G(e,t);function e(r,n,i){var s=t.call(this,r)||this;return s.count=n,s.source=i,s}return e.prototype.error=function(r){if(!this.isStopped){var n=this,i=n.source,s=n.count;if(s===0)return t.prototype.error.call(this,r);s>-1&&(this.count=s-1),i.subscribe(this._unsubscribeAndRecycle())}},e}(ie);function Xx(t){return function(e){return e.lift(new e5(t,e))}}var e5=function(){function t(e,r){this.notifier=e,this.source=r}return t.prototype.call=function(e,r){return r.subscribe(new t5(e,this.notifier,this.source))},t}(),t5=function(t){G(e,t);function e(r,n,i){var s=t.call(this,r)||this;return s.notifier=n,s.source=i,s}return e.prototype.error=function(r){if(!this.isStopped){var n=this.errors,i=this.retries,s=this.retriesSubscription;if(i)this.errors=void 0,this.retriesSubscription=void 0;else{n=new vt;try{var o=this.notifier;i=o(n)}catch(a){return t.prototype.error.call(this,a)}s=ot(i,new it(this))}this._unsubscribeAndRecycle(),this.errors=n,this.retries=i,this.retriesSubscription=s,n.next(r)}},e.prototype._unsubscribe=function(){var r=this,n=r.errors,i=r.retriesSubscription;n&&(n.unsubscribe(),this.errors=void 0),i&&(i.unsubscribe(),this.retriesSubscription=void 0),this.retries=void 0},e.prototype.notifyNext=function(){var r=this._unsubscribe;this._unsubscribe=null,this._unsubscribeAndRecycle(),this._unsubscribe=r,this.source.subscribe(this)},e}(st);function r5(t){return function(e){return e.lift(new n5(t))}}var n5=function(){function t(e){this.notifier=e}return t.prototype.call=function(e,r){var n=new i5(e),i=r.subscribe(n);return i.add(ot(this.notifier,new it(n))),i},t}(),i5=function(t){G(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.hasValue=!1,r}return e.prototype._next=function(r){this.value=r,this.hasValue=!0},e.prototype.notifyNext=function(){this.emitValue()},e.prototype.notifyComplete=function(){this.emitValue()},e.prototype.emitValue=function(){this.hasValue&&(this.hasValue=!1,this.destination.next(this.value))},e}(st);function s5(t,e){return e===void 0&&(e=It),function(r){return r.lift(new o5(t,e))}}var o5=function(){function t(e,r){this.period=e,this.scheduler=r}return t.prototype.call=function(e,r){return r.subscribe(new a5(e,this.period,this.scheduler))},t}(),a5=function(t){G(e,t);function e(r,n,i){var s=t.call(this,r)||this;return s.period=n,s.scheduler=i,s.hasValue=!1,s.add(i.schedule(u5,n,{subscriber:s,period:n})),s}return e.prototype._next=function(r){this.lastValue=r,this.hasValue=!0},e.prototype.notifyNext=function(){this.hasValue&&(this.hasValue=!1,this.destination.next(this.lastValue))},e}(ie);function u5(t){var e=t.subscriber,r=t.period;e.notifyNext(),this.schedule(t,r)}function c5(t,e){return function(r){return r.lift(new l5(t,e))}}var l5=function(){function t(e,r){this.compareTo=e,this.comparator=r}return t.prototype.call=function(e,r){return r.subscribe(new h5(e,this.compareTo,this.comparator))},t}(),h5=function(t){G(e,t);function e(r,n,i){var s=t.call(this,r)||this;return s.compareTo=n,s.comparator=i,s._a=[],s._b=[],s._oneComplete=!1,s.destination.add(n.subscribe(new f5(r,s))),s}return e.prototype._next=function(r){this._oneComplete&&this._b.length===0?this.emit(!1):(this._a.push(r),this.checkValues())},e.prototype._complete=function(){this._oneComplete?this.emit(this._a.length===0&&this._b.length===0):this._oneComplete=!0,this.unsubscribe()},e.prototype.checkValues=function(){for(var r=this,n=r._a,i=r._b,s=r.comparator;n.length>0&&i.length>0;){var o=n.shift(),a=i.shift(),c=!1;try{c=s?s(o,a):o===a}catch(l){this.destination.error(l)}c||this.emit(!1)}},e.prototype.emit=function(r){var n=this.destination;n.next(r),n.complete()},e.prototype.nextB=function(r){this._oneComplete&&this._a.length===0?this.emit(!1):(this._b.push(r),this.checkValues())},e.prototype.completeB=function(){this._oneComplete?this.emit(this._a.length===0&&this._b.length===0):this._oneComplete=!0},e}(ie),f5=function(t){G(e,t);function e(r,n){var i=t.call(this,r)||this;return i.parent=n,i}return e.prototype._next=function(r){this.parent.nextB(r)},e.prototype._error=function(r){this.parent.error(r),this.unsubscribe()},e.prototype._complete=function(){this.parent.completeB(),this.unsubscribe()},e}(ie);function d5(){return new vt}function p5(){return function(t){return Qu()(dn(d5)(t))}}function g5(t,e,r){var n;return t&&typeof t=="object"?n=t:n={bufferSize:t,windowTime:e,refCount:!1,scheduler:r},function(i){return i.lift(b5(n))}}function b5(t){var e=t.bufferSize,r=e===void 0?Number.POSITIVE_INFINITY:e,n=t.windowTime,i=n===void 0?Number.POSITIVE_INFINITY:n,s=t.refCount,o=t.scheduler,a,c=0,l,p=!1,g=!1;return function(I){c++;var T;!a||p?(p=!1,a=new Xu(r,i,o),T=a.subscribe(this),l=I.subscribe({next:function(D){a.next(D)},error:function(D){p=!0,a.error(D)},complete:function(){g=!0,l=void 0,a.complete()}}),g&&(l=void 0)):T=a.subscribe(this),this.add(function(){c--,T.unsubscribe(),T=void 0,l&&!g&&s&&c===0&&(l.unsubscribe(),l=void 0,a=void 0)})}}function v5(t){return function(e){return e.lift(new m5(t,e))}}var m5=function(){function t(e,r){this.predicate=e,this.source=r}return t.prototype.call=function(e,r){return r.subscribe(new y5(e,this.predicate,this.source))},t}(),y5=function(t){G(e,t);function e(r,n,i){var s=t.call(this,r)||this;return s.predicate=n,s.source=i,s.seenValue=!1,s.index=0,s}return e.prototype.applySingleValue=function(r){this.seenValue?this.destination.error("Sequence contains more than one element"):(this.seenValue=!0,this.singleValue=r)},e.prototype._next=function(r){var n=this.index++;this.predicate?this.tryNext(r,n):this.applySingleValue(r)},e.prototype.tryNext=function(r,n){try{this.predicate(r,n,this.source)&&this.applySingleValue(r)}catch(i){this.destination.error(i)}},e.prototype._complete=function(){var r=this.destination;this.index>0?(r.next(this.seenValue?this.singleValue:void 0),r.complete()):r.error(new as)},e}(ie);function _5(t){return function(e){return e.lift(new w5(t))}}var w5=function(){function t(e){this.total=e}return t.prototype.call=function(e,r){return r.subscribe(new E5(e,this.total))},t}(),E5=function(t){G(e,t);function e(r,n){var i=t.call(this,r)||this;return i.total=n,i.count=0,i}return e.prototype._next=function(r){++this.count>this.total&&this.destination.next(r)},e}(ie);function S5(t){return function(e){return e.lift(new x5(t))}}var x5=function(){function t(e){if(this._skipCount=e,this._skipCount<0)throw new ei}return t.prototype.call=function(e,r){return this._skipCount===0?r.subscribe(new ie(e)):r.subscribe(new M5(e,this._skipCount))},t}(),M5=function(t){G(e,t);function e(r,n){var i=t.call(this,r)||this;return i._skipCount=n,i._count=0,i._ring=new Array(n),i}return e.prototype._next=function(r){var n=this._skipCount,i=this._count++;if(i<n)this._ring[i]=r;else{var s=i%n,o=this._ring,a=o[s];o[s]=r,this.destination.next(a)}},e}(ie);function C5(t){return function(e){return e.lift(new I5(t))}}var I5=function(){function t(e){this.notifier=e}return t.prototype.call=function(e,r){return r.subscribe(new R5(e,this.notifier))},t}(),R5=function(t){G(e,t);function e(r,n){var i=t.call(this,r)||this;i.hasValue=!1;var s=new it(i);i.add(s),i.innerSubscription=s;var o=ot(n,s);return o!==s&&(i.add(o),i.innerSubscription=o),i}return e.prototype._next=function(r){this.hasValue&&t.prototype._next.call(this,r)},e.prototype.notifyNext=function(){this.hasValue=!0,this.innerSubscription&&this.innerSubscription.unsubscribe()},e.prototype.notifyComplete=function(){},e}(st);function A5(t){return function(e){return e.lift(new T5(t))}}var T5=function(){function t(e){this.predicate=e}return t.prototype.call=function(e,r){return r.subscribe(new k5(e,this.predicate))},t}(),k5=function(t){G(e,t);function e(r,n){var i=t.call(this,r)||this;return i.predicate=n,i.skipping=!0,i.index=0,i}return e.prototype._next=function(r){var n=this.destination;this.skipping&&this.tryCallPredicate(r),this.skipping||n.next(r)},e.prototype.tryCallPredicate=function(r){try{var n=this.predicate(r,this.index++);this.skipping=!!n}catch(i){this.destination.error(i)}},e}(ie);function N5(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var r=t[t.length-1];return Ot(r)?(t.pop(),function(n){return Pi(t,n,r)}):function(n){return Pi(t,n)}}var O5=function(t){G(e,t);function e(r,n,i){n===void 0&&(n=0),i===void 0&&(i=Ms);var s=t.call(this)||this;return s.source=r,s.delayTime=n,s.scheduler=i,(!ti(n)||n<0)&&(s.delayTime=0),(!i||typeof i.schedule!="function")&&(s.scheduler=Ms),s}return e.create=function(r,n,i){return n===void 0&&(n=0),i===void 0&&(i=Ms),new e(r,n,i)},e.dispatch=function(r){var n=r.source,i=r.subscriber;return this.add(n.subscribe(i))},e.prototype._subscribe=function(r){var n=this.delayTime,i=this.source,s=this.scheduler;return s.schedule(e.dispatch,n,{source:i,subscriber:r})},e}(_e);function L5(t,e){return e===void 0&&(e=0),function(n){return n.lift(new B5(t,e))}}var B5=function(){function t(e,r){this.scheduler=e,this.delay=r}return t.prototype.call=function(e,r){return new O5(r,this.delay,this.scheduler).subscribe(e)},t}();function Di(t,e){return typeof e=="function"?function(r){return r.pipe(Di(function(n,i){return xr(t(n,i)).pipe(qt(function(s,o){return e(n,s,i,o)}))}))}:function(r){return r.lift(new P5(t))}}var P5=function(){function t(e){this.project=e}return t.prototype.call=function(e,r){return r.subscribe(new D5(e,this.project))},t}(),D5=function(t){G(e,t);function e(r,n){var i=t.call(this,r)||this;return i.project=n,i.index=0,i}return e.prototype._next=function(r){var n,i=this.index++;try{n=this.project(r,i)}catch(s){this.destination.error(s);return}this._innerSub(n)},e.prototype._innerSub=function(r){var n=this.innerSubscription;n&&n.unsubscribe();var i=new it(this),s=this.destination;s.add(i),this.innerSubscription=ot(r,i),this.innerSubscription!==i&&s.add(this.innerSubscription)},e.prototype._complete=function(){var r=this.innerSubscription;(!r||r.closed)&&t.prototype._complete.call(this),this.unsubscribe()},e.prototype._unsubscribe=function(){this.innerSubscription=void 0},e.prototype.notifyComplete=function(){this.innerSubscription=void 0,this.isStopped&&t.prototype._complete.call(this)},e.prototype.notifyNext=function(r){this.destination.next(r)},e}(st);function j5(){return Di(Or)}function $5(t,e){return e?Di(function(){return t},e):Di(function(){return t})}function F5(t){return function(e){return e.lift(new U5(t))}}var U5=function(){function t(e){this.notifier=e}return t.prototype.call=function(e,r){var n=new H5(e),i=ot(this.notifier,new it(n));return i&&!n.seenValue?(n.add(i),r.subscribe(n)):n},t}(),H5=function(t){G(e,t);function e(r){var n=t.call(this,r)||this;return n.seenValue=!1,n}return e.prototype.notifyNext=function(){this.seenValue=!0,this.complete()},e.prototype.notifyComplete=function(){},e}(st);function W5(t,e){return e===void 0&&(e=!1),function(r){return r.lift(new V5(t,e))}}var V5=function(){function t(e,r){this.predicate=e,this.inclusive=r}return t.prototype.call=function(e,r){return r.subscribe(new z5(e,this.predicate,this.inclusive))},t}(),z5=function(t){G(e,t);function e(r,n,i){var s=t.call(this,r)||this;return s.predicate=n,s.inclusive=i,s.index=0,s}return e.prototype._next=function(r){var n=this.destination,i;try{i=this.predicate(r,this.index++)}catch(s){n.error(s);return}this.nextOrComplete(r,i)},e.prototype.nextOrComplete=function(r,n){var i=this.destination;n?i.next(r):(this.inclusive&&i.next(r),i.complete())},e}(ie);function q5(t,e,r){return function(i){return i.lift(new G5(t,e,r))}}var G5=function(){function t(e,r,n){this.nextOrObserver=e,this.error=r,this.complete=n}return t.prototype.call=function(e,r){return r.subscribe(new J5(e,this.nextOrObserver,this.error,this.complete))},t}(),J5=function(t){G(e,t);function e(r,n,i,s){var o=t.call(this,r)||this;return o._tapNext=ar,o._tapError=ar,o._tapComplete=ar,o._tapError=i||ar,o._tapComplete=s||ar,Kn(n)?(o._context=o,o._tapNext=n):n&&(o._context=n,o._tapNext=n.next||ar,o._tapError=n.error||ar,o._tapComplete=n.complete||ar),o}return e.prototype._next=function(r){try{this._tapNext.call(this._context,r)}catch(n){this.destination.error(n);return}this.destination.next(r)},e.prototype._error=function(r){try{this._tapError.call(this._context,r)}catch(n){this.destination.error(n);return}this.destination.error(r)},e.prototype._complete=function(){try{this._tapComplete.call(this._context)}catch(r){this.destination.error(r);return}return this.destination.complete()},e}(ie),H0={leading:!0,trailing:!1};function Z5(t,e){return e===void 0&&(e=H0),function(r){return r.lift(new Q5(t,!!e.leading,!!e.trailing))}}var Q5=function(){function t(e,r,n){this.durationSelector=e,this.leading=r,this.trailing=n}return t.prototype.call=function(e,r){return r.subscribe(new Y5(e,this.durationSelector,this.leading,this.trailing))},t}(),Y5=function(t){G(e,t);function e(r,n,i,s){var o=t.call(this,r)||this;return o.destination=r,o.durationSelector=n,o._leading=i,o._trailing=s,o._hasValue=!1,o}return e.prototype._next=function(r){this._hasValue=!0,this._sendValue=r,this._throttled||(this._leading?this.send():this.throttle(r))},e.prototype.send=function(){var r=this,n=r._hasValue,i=r._sendValue;n&&(this.destination.next(i),this.throttle(i)),this._hasValue=!1,this._sendValue=void 0},e.prototype.throttle=function(r){var n=this.tryDurationSelector(r);n&&this.add(this._throttled=ot(n,new it(this)))},e.prototype.tryDurationSelector=function(r){try{return this.durationSelector(r)}catch(n){return this.destination.error(n),null}},e.prototype.throttlingDone=function(){var r=this,n=r._throttled,i=r._trailing;n&&n.unsubscribe(),this._throttled=void 0,i&&this.send()},e.prototype.notifyNext=function(){this.throttlingDone()},e.prototype.notifyComplete=function(){this.throttlingDone()},e}(st);function K5(t,e,r){return e===void 0&&(e=It),r===void 0&&(r=H0),function(n){return n.lift(new X5(t,e,r.leading,r.trailing))}}var X5=function(){function t(e,r,n,i){this.duration=e,this.scheduler=r,this.leading=n,this.trailing=i}return t.prototype.call=function(e,r){return r.subscribe(new eM(e,this.duration,this.scheduler,this.leading,this.trailing))},t}(),eM=function(t){G(e,t);function e(r,n,i,s,o){var a=t.call(this,r)||this;return a.duration=n,a.scheduler=i,a.leading=s,a.trailing=o,a._hasTrailingValue=!1,a._trailingValue=null,a}return e.prototype._next=function(r){this.throttled?this.trailing&&(this._trailingValue=r,this._hasTrailingValue=!0):(this.add(this.throttled=this.scheduler.schedule(tM,this.duration,{subscriber:this})),this.leading?this.destination.next(r):this.trailing&&(this._trailingValue=r,this._hasTrailingValue=!0))},e.prototype._complete=function(){this._hasTrailingValue?(this.destination.next(this._trailingValue),this.destination.complete()):this.destination.complete()},e.prototype.clearThrottle=function(){var r=this.throttled;r&&(this.trailing&&this._hasTrailingValue&&(this.destination.next(this._trailingValue),this._trailingValue=null,this._hasTrailingValue=!1),r.unsubscribe(),this.remove(r),this.throttled=null)},e}(ie);function tM(t){var e=t.subscriber;e.clearThrottle()}function rM(t){return t===void 0&&(t=It),function(e){return rc(function(){return e.pipe($s(function(r,n){var i=r.current;return{value:n,current:t.now(),last:i}},{current:t.now(),value:void 0,last:void 0}),qt(function(r){var n=r.current,i=r.last,s=r.value;return new nM(s,n-i)}))})}}var nM=function(){function t(e,r){this.value=e,this.interval=r}return t}();function W0(t,e,r){return r===void 0&&(r=It),function(n){var i=j0(t),s=i?+t-r.now():Math.abs(t);return n.lift(new iM(s,i,e,r))}}var iM=function(){function t(e,r,n,i){this.waitFor=e,this.absoluteTimeout=r,this.withObservable=n,this.scheduler=i}return t.prototype.call=function(e,r){return r.subscribe(new sM(e,this.absoluteTimeout,this.waitFor,this.withObservable,this.scheduler))},t}(),sM=function(t){G(e,t);function e(r,n,i,s,o){var a=t.call(this,r)||this;return a.absoluteTimeout=n,a.waitFor=i,a.withObservable=s,a.scheduler=o,a.scheduleTimeout(),a}return e.dispatchTimeout=function(r){var n=r.withObservable;r._unsubscribeAndRecycle(),r.add(ot(n,new it(r)))},e.prototype.scheduleTimeout=function(){var r=this.action;r?this.action=r.schedule(this,this.waitFor):this.add(this.action=this.scheduler.schedule(e.dispatchTimeout,this.waitFor,this))},e.prototype._next=function(r){this.absoluteTimeout||this.scheduleTimeout(),t.prototype._next.call(this,r)},e.prototype._unsubscribe=function(){this.action=void 0,this.scheduler=null,this.withObservable=null},e}(st);function oM(t,e){return e===void 0&&(e=It),W0(t,Ku(new r0),e)}function aM(t){return t===void 0&&(t=It),qt(function(e){return new uM(e,t.now())})}var uM=function(){function t(e,r){this.value=e,this.timestamp=r}return t}();function cM(t,e,r){return r===0?[e]:(t.push(e),t)}function lM(){return Fo(cM,[])}function hM(t){return function(r){return r.lift(new fM(t))}}var fM=function(){function t(e){this.windowBoundaries=e}return t.prototype.call=function(e,r){var n=new dM(e),i=r.subscribe(n);return i.closed||n.add(ot(this.windowBoundaries,new it(n))),i},t}(),dM=function(t){G(e,t);function e(r){var n=t.call(this,r)||this;return n.window=new vt,r.next(n.window),n}return e.prototype.notifyNext=function(){this.openWindow()},e.prototype.notifyError=function(r){this._error(r)},e.prototype.notifyComplete=function(){this._complete()},e.prototype._next=function(r){this.window.next(r)},e.prototype._error=function(r){this.window.error(r),this.destination.error(r)},e.prototype._complete=function(){this.window.complete(),this.destination.complete()},e.prototype._unsubscribe=function(){this.window=null},e.prototype.openWindow=function(){var r=this.window;r&&r.complete();var n=this.destination,i=this.window=new vt;n.next(i)},e}(st);function pM(t,e){return e===void 0&&(e=0),function(n){return n.lift(new gM(t,e))}}var gM=function(){function t(e,r){this.windowSize=e,this.startWindowEvery=r}return t.prototype.call=function(e,r){return r.subscribe(new bM(e,this.windowSize,this.startWindowEvery))},t}(),bM=function(t){G(e,t);function e(r,n,i){var s=t.call(this,r)||this;return s.destination=r,s.windowSize=n,s.startWindowEvery=i,s.windows=[new vt],s.count=0,r.next(s.windows[0]),s}return e.prototype._next=function(r){for(var n=this.startWindowEvery>0?this.startWindowEvery:this.windowSize,i=this.destination,s=this.windowSize,o=this.windows,a=o.length,c=0;c<a&&!this.closed;c++)o[c].next(r);var l=this.count-s+1;if(l>=0&&l%n===0&&!this.closed&&o.shift().complete(),++this.count%n===0&&!this.closed){var p=new vt;o.push(p),i.next(p)}},e.prototype._error=function(r){var n=this.windows;if(n)for(;n.length>0&&!this.closed;)n.shift().error(r);this.destination.error(r)},e.prototype._complete=function(){var r=this.windows;if(r)for(;r.length>0&&!this.closed;)r.shift().complete();this.destination.complete()},e.prototype._unsubscribe=function(){this.count=0,this.windows=null},e}(ie);function vM(t){var e=It,r=null,n=Number.POSITIVE_INFINITY;return Ot(arguments[3])&&(e=arguments[3]),Ot(arguments[2])?e=arguments[2]:ti(arguments[2])&&(n=Number(arguments[2])),Ot(arguments[1])?e=arguments[1]:ti(arguments[1])&&(r=Number(arguments[1])),function(s){return s.lift(new mM(t,r,n,e))}}var mM=function(){function t(e,r,n,i){this.windowTimeSpan=e,this.windowCreationInterval=r,this.maxWindowSize=n,this.scheduler=i}return t.prototype.call=function(e,r){return r.subscribe(new _M(e,this.windowTimeSpan,this.windowCreationInterval,this.maxWindowSize,this.scheduler))},t}(),yM=function(t){G(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r._numberOfNextedValues=0,r}return e.prototype.next=function(r){this._numberOfNextedValues++,t.prototype.next.call(this,r)},Object.defineProperty(e.prototype,"numberOfNextedValues",{get:function(){return this._numberOfNextedValues},enumerable:!0,configurable:!0}),e}(vt),_M=function(t){G(e,t);function e(r,n,i,s,o){var a=t.call(this,r)||this;a.destination=r,a.windowTimeSpan=n,a.windowCreationInterval=i,a.maxWindowSize=s,a.scheduler=o,a.windows=[];var c=a.openWindow();if(i!==null&&i>=0){var l={subscriber:a,window:c,context:null},p={windowTimeSpan:n,windowCreationInterval:i,subscriber:a,scheduler:o};a.add(o.schedule(V0,n,l)),a.add(o.schedule(EM,i,p))}else{var g={subscriber:a,window:c,windowTimeSpan:n};a.add(o.schedule(wM,n,g))}return a}return e.prototype._next=function(r){for(var n=this.windows,i=n.length,s=0;s<i;s++){var o=n[s];o.closed||(o.next(r),o.numberOfNextedValues>=this.maxWindowSize&&this.closeWindow(o))}},e.prototype._error=function(r){for(var n=this.windows;n.length>0;)n.shift().error(r);this.destination.error(r)},e.prototype._complete=function(){for(var r=this.windows;r.length>0;){var n=r.shift();n.closed||n.complete()}this.destination.complete()},e.prototype.openWindow=function(){var r=new yM;this.windows.push(r);var n=this.destination;return n.next(r),r},e.prototype.closeWindow=function(r){r.complete();var n=this.windows;n.splice(n.indexOf(r),1)},e}(ie);function wM(t){var e=t.subscriber,r=t.windowTimeSpan,n=t.window;n&&e.closeWindow(n),t.window=e.openWindow(),this.schedule(t,r)}function EM(t){var e=t.windowTimeSpan,r=t.subscriber,n=t.scheduler,i=t.windowCreationInterval,s=r.openWindow(),o=this,a={action:o,subscription:null},c={subscriber:r,window:s,context:a};a.subscription=n.schedule(V0,e,c),o.add(a.subscription),o.schedule(t,i)}function V0(t){var e=t.subscriber,r=t.window,n=t.context;n&&n.action&&n.subscription&&n.action.remove(n.subscription),e.closeWindow(r)}function SM(t,e){return function(r){return r.lift(new xM(t,e))}}var xM=function(){function t(e,r){this.openings=e,this.closingSelector=r}return t.prototype.call=function(e,r){return r.subscribe(new MM(e,this.openings,this.closingSelector))},t}(),MM=function(t){G(e,t);function e(r,n,i){var s=t.call(this,r)||this;return s.openings=n,s.closingSelector=i,s.contexts=[],s.add(s.openSubscription=Er(s,n,n)),s}return e.prototype._next=function(r){var n=this.contexts;if(n)for(var i=n.length,s=0;s<i;s++)n[s].window.next(r)},e.prototype._error=function(r){var n=this.contexts;if(this.contexts=null,n)for(var i=n.length,s=-1;++s<i;){var o=n[s];o.window.error(r),o.subscription.unsubscribe()}t.prototype._error.call(this,r)},e.prototype._complete=function(){var r=this.contexts;if(this.contexts=null,r)for(var n=r.length,i=-1;++i<n;){var s=r[i];s.window.complete(),s.subscription.unsubscribe()}t.prototype._complete.call(this)},e.prototype._unsubscribe=function(){var r=this.contexts;if(this.contexts=null,r)for(var n=r.length,i=-1;++i<n;){var s=r[i];s.window.unsubscribe(),s.subscription.unsubscribe()}},e.prototype.notifyNext=function(r,n,i,s,o){if(r===this.openings){var a=void 0;try{var c=this.closingSelector;a=c(n)}catch(I){return this.error(I)}var l=new vt,p=new nt,g={window:l,subscription:p};this.contexts.push(g);var y=Er(this,a,g);y.closed?this.closeWindow(this.contexts.length-1):(y.context=g,p.add(y)),this.destination.next(l)}else this.closeWindow(this.contexts.indexOf(r))},e.prototype.notifyError=function(r){this.error(r)},e.prototype.notifyComplete=function(r){r!==this.openSubscription&&this.closeWindow(this.contexts.indexOf(r.context))},e.prototype.closeWindow=function(r){if(r!==-1){var n=this.contexts,i=n[r],s=i.window,o=i.subscription;n.splice(r,1),s.complete(),o.unsubscribe()}},e}(_n);function CM(t){return function(r){return r.lift(new IM(t))}}var IM=function(){function t(e){this.closingSelector=e}return t.prototype.call=function(e,r){return r.subscribe(new RM(e,this.closingSelector))},t}(),RM=function(t){G(e,t);function e(r,n){var i=t.call(this,r)||this;return i.destination=r,i.closingSelector=n,i.openWindow(),i}return e.prototype.notifyNext=function(r,n,i,s,o){this.openWindow(o)},e.prototype.notifyError=function(r){this._error(r)},e.prototype.notifyComplete=function(r){this.openWindow(r)},e.prototype._next=function(r){this.window.next(r)},e.prototype._error=function(r){this.window.error(r),this.destination.error(r),this.unsubscribeClosingNotification()},e.prototype._complete=function(){this.window.complete(),this.destination.complete(),this.unsubscribeClosingNotification()},e.prototype.unsubscribeClosingNotification=function(){this.closingNotification&&this.closingNotification.unsubscribe()},e.prototype.openWindow=function(r){r===void 0&&(r=null),r&&(this.remove(r),r.unsubscribe());var n=this.window;n&&n.complete();var i=this.window=new vt;this.destination.next(i);var s;try{var o=this.closingSelector;s=o()}catch(a){this.destination.error(a),this.window.error(a);return}this.add(this.closingNotification=Er(this,s))},e}(_n);function AM(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return function(r){var n;typeof t[t.length-1]=="function"&&(n=t.pop());var i=t;return r.lift(new TM(i,n))}}var TM=function(){function t(e,r){this.observables=e,this.project=r}return t.prototype.call=function(e,r){return r.subscribe(new kM(e,this.observables,this.project))},t}(),kM=function(t){G(e,t);function e(r,n,i){var s=t.call(this,r)||this;s.observables=n,s.project=i,s.toRespond=[];var o=n.length;s.values=new Array(o);for(var a=0;a<o;a++)s.toRespond.push(a);for(var a=0;a<o;a++){var c=n[a];s.add(Er(s,c,void 0,a))}return s}return e.prototype.notifyNext=function(r,n,i){this.values[i]=n;var s=this.toRespond;if(s.length>0){var o=s.indexOf(i);o!==-1&&s.splice(o,1)}},e.prototype.notifyComplete=function(){},e.prototype._next=function(r){if(this.toRespond.length===0){var n=[r].concat(this.values);this.project?this._tryProject(n):this.destination.next(n)}},e.prototype._tryProject=function(r){var n;try{n=this.project.apply(this,r)}catch(i){this.destination.error(i);return}this.destination.next(n)},e}(_n);function NM(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return function(n){return n.lift.call(v0.apply(void 0,[n].concat(t)))}}function OM(t){return function(e){return e.lift(new m0(t))}}const LM=Object.freeze(Object.defineProperty({__proto__:null,audit:B0,auditTime:L3,buffer:B3,bufferCount:j3,bufferTime:H3,bufferToggle:G3,bufferWhen:Q3,catchError:X3,combineAll:r4,combineLatest:n4,concat:i4,concatAll:u0,concatMap:D0,concatMapTo:s4,count:o4,debounce:c4,debounceTime:f4,defaultIfEmpty:cs,delay:m4,delayWhen:E4,dematerialize:C4,distinct:A4,distinctUntilChanged:$0,distinctUntilKeyChanged:L4,elementAt:F4,endWith:U4,every:H4,exhaust:z4,exhaustMap:F0,expand:Q4,filter:Br,finalize:X4,find:rx,findIndex:ix,first:sx,flatMap:rS,groupBy:lE,ignoreElements:ox,isEmpty:cx,last:px,map:qt,mapTo:gx,materialize:mx,max:Sx,merge:xx,mergeAll:tc,mergeMap:fn,mergeMapTo:Mx,mergeScan:Cx,min:Ax,multicast:dn,observeOn:_E,onErrorResumeNext:kx,pairwise:Lx,partition:Dx,pluck:jx,publish:Fx,publishBehavior:Ux,publishLast:Hx,publishReplay:Wx,race:Vx,reduce:Fo,refCount:Qu,repeat:zx,repeatWhen:Gx,retry:Qx,retryWhen:Xx,sample:r5,sampleTime:s5,scan:$s,sequenceEqual:c5,share:p5,shareReplay:g5,single:v5,skip:_5,skipLast:S5,skipUntil:C5,skipWhile:A5,startWith:N5,subscribeOn:L5,switchAll:j5,switchMap:Di,switchMapTo:$5,take:gc,takeLast:js,takeUntil:F5,takeWhile:W5,tap:q5,throttle:Z5,throttleTime:K5,throwIfEmpty:$o,timeInterval:rM,timeout:oM,timeoutWith:W0,timestamp:aM,toArray:lM,window:hM,windowCount:pM,windowTime:vM,windowToggle:SM,windowWhen:CM,withLatestFrom:AM,zip:NM,zipAll:OM},Symbol.toStringTag,{value:"Module"})),bc=si(LM);var Uo={},Ut={};Object.defineProperty(Ut,"__esModule",{value:!0});Ut.ClientMessagePublishEvent=Ut.ClientMessageSetSessionConfig=Ut.ClientMessageGetSessionConfig=Ut.ClientMessageIsLinked=Ut.ClientMessageHostSession=void 0;function BM(t){return Object.assign({type:"HostSession"},t)}Ut.ClientMessageHostSession=BM;function PM(t){return Object.assign({type:"IsLinked"},t)}Ut.ClientMessageIsLinked=PM;function DM(t){return Object.assign({type:"GetSessionConfig"},t)}Ut.ClientMessageGetSessionConfig=DM;function jM(t){return Object.assign({type:"SetSessionConfig"},t)}Ut.ClientMessageSetSessionConfig=jM;function $M(t){return Object.assign({type:"PublishEvent"},t)}Ut.ClientMessagePublishEvent=$M;var z0={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.RxWebSocket=t.ConnectionState=void 0;const e=Mo,r=bc;var n;(function(s){s[s.DISCONNECTED=0]="DISCONNECTED",s[s.CONNECTING=1]="CONNECTING",s[s.CONNECTED=2]="CONNECTED"})(n=t.ConnectionState||(t.ConnectionState={}));class i{constructor(o,a=WebSocket){this.WebSocketClass=a,this.webSocket=null,this.connectionStateSubject=new e.BehaviorSubject(n.DISCONNECTED),this.incomingDataSubject=new e.Subject,this.url=o.replace(/^http/,"ws")}connect(){return this.webSocket?(0,e.throwError)(new Error("webSocket object is not null")):new e.Observable(o=>{let a;try{this.webSocket=a=new this.WebSocketClass(this.url)}catch(c){o.error(c);return}this.connectionStateSubject.next(n.CONNECTING),a.onclose=c=>{this.clearWebSocket(),o.error(new Error(`websocket error ${c.code}: ${c.reason}`)),this.connectionStateSubject.next(n.DISCONNECTED)},a.onopen=c=>{o.next(),o.complete(),this.connectionStateSubject.next(n.CONNECTED)},a.onmessage=c=>{this.incomingDataSubject.next(c.data)}}).pipe((0,r.take)(1))}disconnect(){const{webSocket:o}=this;if(o){this.clearWebSocket(),this.connectionStateSubject.next(n.DISCONNECTED);try{o.close()}catch{}}}get connectionState$(){return this.connectionStateSubject.asObservable()}get incomingData$(){return this.incomingDataSubject.asObservable()}get incomingJSONData$(){return this.incomingData$.pipe((0,r.flatMap)(o=>{let a;try{a=JSON.parse(o)}catch{return(0,e.empty)()}return(0,e.of)(a)}))}sendData(o){const{webSocket:a}=this;if(!a)throw new Error("websocket is not connected");a.send(o)}clearWebSocket(){const{webSocket:o}=this;o&&(this.webSocket=null,o.onclose=null,o.onerror=null,o.onmessage=null,o.onopen=null)}}t.RxWebSocket=i})(z0);var Ho={};Object.defineProperty(Ho,"__esModule",{value:!0});Ho.isServerMessageFail=void 0;function FM(t){return t&&t.type==="Fail"&&typeof t.id=="number"&&typeof t.sessionId=="string"&&typeof t.error=="string"}Ho.isServerMessageFail=FM;Object.defineProperty(Uo,"__esModule",{value:!0});Uo.WalletSDKConnection=void 0;const Jt=Mo,Ee=bc,wi=ui,Ln=Vi,Ei=Ut,Si=oi,_s=z0,Pa=Ho,wh=1e4,UM=6e4;class HM{constructor(e,r,n,i,s=WebSocket){this.sessionId=e,this.sessionKey=r,this.diagnostic=i,this.subscriptions=new Jt.Subscription,this.destroyed=!1,this.lastHeartbeatResponse=0,this.nextReqId=(0,Ln.IntNumber)(1),this.connectedSubject=new Jt.BehaviorSubject(!1),this.linkedSubject=new Jt.BehaviorSubject(!1),this.sessionConfigSubject=new Jt.ReplaySubject(1);const o=new _s.RxWebSocket(n+"/rpc",s);this.ws=o,this.subscriptions.add(o.connectionState$.pipe((0,Ee.tap)(a=>{var c;return(c=this.diagnostic)===null||c===void 0?void 0:c.log(Si.EVENTS.CONNECTED_STATE_CHANGE,{state:a,sessionIdHash:wi.Session.hash(e)})}),(0,Ee.skip)(1),(0,Ee.filter)(a=>a===_s.ConnectionState.DISCONNECTED&&!this.destroyed),(0,Ee.delay)(5e3),(0,Ee.filter)(a=>!this.destroyed),(0,Ee.flatMap)(a=>o.connect()),(0,Ee.retry)()).subscribe()),this.subscriptions.add(o.connectionState$.pipe((0,Ee.skip)(2),(0,Ee.switchMap)(a=>(0,Jt.iif)(()=>a===_s.ConnectionState.CONNECTED,this.authenticate().pipe((0,Ee.tap)(c=>this.sendIsLinked()),(0,Ee.tap)(c=>this.sendGetSessionConfig()),(0,Ee.map)(c=>!0)),(0,Jt.of)(!1))),(0,Ee.distinctUntilChanged)(),(0,Ee.catchError)(a=>(0,Jt.of)(!1))).subscribe(a=>this.connectedSubject.next(a))),this.subscriptions.add(o.connectionState$.pipe((0,Ee.skip)(1),(0,Ee.switchMap)(a=>(0,Jt.iif)(()=>a===_s.ConnectionState.CONNECTED,(0,Jt.timer)(0,wh)))).subscribe(a=>a===0?this.updateLastHeartbeat():this.heartbeat())),this.subscriptions.add(o.incomingData$.pipe((0,Ee.filter)(a=>a==="h")).subscribe(a=>this.updateLastHeartbeat())),this.subscriptions.add(o.incomingJSONData$.pipe((0,Ee.filter)(a=>["IsLinkedOK","Linked"].includes(a.type))).subscribe(a=>{var c;const l=a;(c=this.diagnostic)===null||c===void 0||c.log(Si.EVENTS.LINKED,{sessionIdHash:wi.Session.hash(e),linked:l.linked,type:a.type,onlineGuests:l.onlineGuests}),this.linkedSubject.next(l.linked||l.onlineGuests>0)})),this.subscriptions.add(o.incomingJSONData$.pipe((0,Ee.filter)(a=>["GetSessionConfigOK","SessionConfigUpdated"].includes(a.type))).subscribe(a=>{var c;const l=a;(c=this.diagnostic)===null||c===void 0||c.log(Si.EVENTS.SESSION_CONFIG_RECEIVED,{sessionIdHash:wi.Session.hash(e),metadata_keys:l&&l.metadata?Object.keys(l.metadata):void 0}),this.sessionConfigSubject.next({webhookId:l.webhookId,webhookUrl:l.webhookUrl,metadata:l.metadata})}))}connect(){var e;if(this.destroyed)throw new Error("instance is destroyed");(e=this.diagnostic)===null||e===void 0||e.log(Si.EVENTS.STARTED_CONNECTING,{sessionIdHash:wi.Session.hash(this.sessionId)}),this.ws.connect().subscribe()}destroy(){var e;this.subscriptions.unsubscribe(),this.ws.disconnect(),(e=this.diagnostic)===null||e===void 0||e.log(Si.EVENTS.DISCONNECTED,{sessionIdHash:wi.Session.hash(this.sessionId)}),this.destroyed=!0}get isDestroyed(){return this.destroyed}get connected$(){return this.connectedSubject.asObservable()}get onceConnected$(){return this.connected$.pipe((0,Ee.filter)(e=>e),(0,Ee.take)(1),(0,Ee.map)(()=>{}))}get linked$(){return this.linkedSubject.asObservable()}get onceLinked$(){return this.linked$.pipe((0,Ee.filter)(e=>e),(0,Ee.take)(1),(0,Ee.map)(()=>{}))}get sessionConfig$(){return this.sessionConfigSubject.asObservable()}get incomingEvent$(){return this.ws.incomingJSONData$.pipe((0,Ee.filter)(e=>{if(e.type!=="Event")return!1;const r=e;return typeof r.sessionId=="string"&&typeof r.eventId=="string"&&typeof r.event=="string"&&typeof r.data=="string"}),(0,Ee.map)(e=>e))}setSessionMetadata(e,r){const n=(0,Ei.ClientMessageSetSessionConfig)({id:(0,Ln.IntNumber)(this.nextReqId++),sessionId:this.sessionId,metadata:{[e]:r}});return this.onceConnected$.pipe((0,Ee.flatMap)(i=>this.makeRequest(n)),(0,Ee.map)(i=>{if((0,Pa.isServerMessageFail)(i))throw new Error(i.error||"failed to set session metadata")}))}publishEvent(e,r,n=!1){const i=(0,Ei.ClientMessagePublishEvent)({id:(0,Ln.IntNumber)(this.nextReqId++),sessionId:this.sessionId,event:e,data:r,callWebhook:n});return this.onceLinked$.pipe((0,Ee.flatMap)(s=>this.makeRequest(i)),(0,Ee.map)(s=>{if((0,Pa.isServerMessageFail)(s))throw new Error(s.error||"failed to publish event");return s.eventId}))}sendData(e){this.ws.sendData(JSON.stringify(e))}updateLastHeartbeat(){this.lastHeartbeatResponse=Date.now()}heartbeat(){if(Date.now()-this.lastHeartbeatResponse>wh*2){this.ws.disconnect();return}try{this.ws.sendData("h")}catch{}}makeRequest(e,r=UM){const n=e.id;try{this.sendData(e)}catch(i){return(0,Jt.throwError)(i)}return this.ws.incomingJSONData$.pipe((0,Ee.timeoutWith)(r,(0,Jt.throwError)(new Error(`request ${n} timed out`))),(0,Ee.filter)(i=>i.id===n),(0,Ee.take)(1))}authenticate(){const e=(0,Ei.ClientMessageHostSession)({id:(0,Ln.IntNumber)(this.nextReqId++),sessionId:this.sessionId,sessionKey:this.sessionKey});return this.makeRequest(e).pipe((0,Ee.map)(r=>{if((0,Pa.isServerMessageFail)(r))throw new Error(r.error||"failed to authentcate")}))}sendIsLinked(){const e=(0,Ei.ClientMessageIsLinked)({id:(0,Ln.IntNumber)(this.nextReqId++),sessionId:this.sessionId});this.sendData(e)}sendGetSessionConfig(){const e=(0,Ei.ClientMessageGetSessionConfig)({id:(0,Ln.IntNumber)(this.nextReqId++),sessionId:this.sessionId});this.sendData(e)}}Uo.WalletSDKConnection=HM;var ni={};Object.defineProperty(ni,"__esModule",{value:!0});ni.decrypt=ni.encrypt=void 0;const Fs=re;async function WM(t,e){if(e.length!==64)throw Error("secret must be 256 bits");const r=crypto.getRandomValues(new Uint8Array(12)),n=await crypto.subtle.importKey("raw",(0,Fs.hexStringToUint8Array)(e),{name:"aes-gcm"},!1,["encrypt","decrypt"]),i=new TextEncoder,s=await window.crypto.subtle.encrypt({name:"AES-GCM",iv:r},n,i.encode(t)),o=16,a=s.slice(s.byteLength-o),c=s.slice(0,s.byteLength-o),l=new Uint8Array(a),p=new Uint8Array(c),g=new Uint8Array([...r,...l,...p]);return(0,Fs.uint8ArrayToHex)(g)}ni.encrypt=WM;function VM(t,e){if(e.length!==64)throw Error("secret must be 256 bits");return new Promise((r,n)=>{(async function(){const i=await crypto.subtle.importKey("raw",(0,Fs.hexStringToUint8Array)(e),{name:"aes-gcm"},!1,["encrypt","decrypt"]),s=(0,Fs.hexStringToUint8Array)(t),o=s.slice(0,12),a=s.slice(12,28),c=s.slice(28),l=new Uint8Array([...c,...a]),p={name:"AES-GCM",iv:new Uint8Array(o)};try{const g=await window.crypto.subtle.decrypt(p,i,l),y=new TextDecoder;r(y.decode(g))}catch(g){n(g)}})()})}ni.decrypt=VM;var Wo={},Vo={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.RelayMessageType=void 0,function(e){e.SESSION_ID_REQUEST="SESSION_ID_REQUEST",e.SESSION_ID_RESPONSE="SESSION_ID_RESPONSE",e.LINKED="LINKED",e.UNLINKED="UNLINKED",e.WEB3_REQUEST="WEB3_REQUEST",e.WEB3_REQUEST_CANCELED="WEB3_REQUEST_CANCELED",e.WEB3_RESPONSE="WEB3_RESPONSE"}(t.RelayMessageType||(t.RelayMessageType={}))})(Vo);Object.defineProperty(Wo,"__esModule",{value:!0});Wo.Web3RequestCanceledMessage=void 0;const zM=Vo;function qM(t){return{type:zM.RelayMessageType.WEB3_REQUEST_CANCELED,id:t}}Wo.Web3RequestCanceledMessage=qM;var zo={};Object.defineProperty(zo,"__esModule",{value:!0});zo.Web3RequestMessage=void 0;const GM=Vo;function JM(t){return Object.assign({type:GM.RelayMessageType.WEB3_REQUEST},t)}zo.Web3RequestMessage=JM;var ii={};Object.defineProperty(ii,"__esModule",{value:!0});ii.isWeb3ResponseMessage=ii.Web3ResponseMessage=void 0;const q0=Vo;function ZM(t){return Object.assign({type:q0.RelayMessageType.WEB3_RESPONSE},t)}ii.Web3ResponseMessage=ZM;function QM(t){return t&&t.type===q0.RelayMessageType.WEB3_RESPONSE}ii.isWeb3ResponseMessage=QM;var YM=te&&te.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r),Object.defineProperty(t,n,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),KM=te&&te.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),G0=te&&te.__decorate||function(t,e,r,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=0;a--)(o=t[a])&&(s=(i<3?o(s):i>3?o(e,r,s):o(e,r))||s);return i>3&&s&&Object.defineProperty(e,r,s),s},XM=te&&te.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)r!=="default"&&Object.prototype.hasOwnProperty.call(t,r)&&YM(e,t,r);return KM(e,t),e},eC=te&&te.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Do,"__esModule",{value:!0});Do.WalletSDKRelay=void 0;const J0=eC(jo),Xr=Mo,lt=bc,Et=oi,tC=Uo,Bn=ji,rC=Vi,et=re,Cr=XM(ni),Ir=ui,ws=Kt,mt=Gs,nC=Wo,iC=zo,jt=Pe,At=ii;class Yt extends ws.WalletSDKRelayAbstract{constructor(e){var r;super(),this.accountsCallback=null,this.chainCallback=null,this.dappDefaultChainSubject=new Xr.BehaviorSubject(1),this.dappDefaultChain=1,this.appName="",this.appLogoUrl=null,this.subscriptions=new Xr.Subscription,this.linkAPIUrl=e.linkAPIUrl,this.storage=e.storage,this.options=e;const{session:n,ui:i,connection:s}=this.subscribe();if(this._session=n,this.connection=s,this.relayEventManager=e.relayEventManager,e.diagnosticLogger&&e.eventListener)throw new Error("Can't have both eventListener and diagnosticLogger options, use only diagnosticLogger");e.eventListener?this.diagnostic={log:e.eventListener.onEvent}:this.diagnostic=e.diagnosticLogger,this._reloadOnDisconnect=(r=e.reloadOnDisconnect)!==null&&r!==void 0?r:!0,this.ui=i}subscribe(){this.subscriptions.add(this.dappDefaultChainSubject.subscribe(i=>{this.dappDefaultChain!==i&&(this.dappDefaultChain=i)}));const e=Ir.Session.load(this.storage)||new Ir.Session(this.storage).save(),r=new tC.WalletSDKConnection(e.id,e.key,this.linkAPIUrl,this.diagnostic);this.subscriptions.add(r.sessionConfig$.subscribe({next:i=>{this.onSessionConfigChanged(i)},error:()=>{var i;(i=this.diagnostic)===null||i===void 0||i.log(Et.EVENTS.GENERAL_ERROR,{message:"error while invoking session config callback"})}})),this.subscriptions.add(r.incomingEvent$.pipe((0,lt.filter)(i=>i.event==="Web3Response")).subscribe({next:this.handleIncomingEvent})),this.subscriptions.add(r.linked$.pipe((0,lt.skip)(1),(0,lt.tap)(i=>{var s;this.isLinked=i;const o=this.storage.getItem(ws.LOCAL_STORAGE_ADDRESSES_KEY);if(i&&(this.session.linked=i),this.isUnlinkedErrorState=!1,o){const a=o.split(" "),c=this.storage.getItem("IsStandaloneSigning")==="true";if(a[0]!==""&&!i&&this.session.linked&&!c){this.isUnlinkedErrorState=!0;const l=this.getSessionIdHash();(s=this.diagnostic)===null||s===void 0||s.log(Et.EVENTS.UNLINKED_ERROR_STATE,{sessionIdHash:l})}}})).subscribe()),this.subscriptions.add(r.sessionConfig$.pipe((0,lt.filter)(i=>!!i.metadata&&i.metadata.__destroyed==="1")).subscribe(()=>{var i;const s=r.isDestroyed;return(i=this.diagnostic)===null||i===void 0||i.log(Et.EVENTS.METADATA_DESTROYED,{alreadyDestroyed:s,sessionIdHash:this.getSessionIdHash()}),this.resetAndReload()})),this.subscriptions.add(r.sessionConfig$.pipe((0,lt.filter)(i=>i.metadata&&i.metadata.WalletUsername!==void 0)).pipe((0,lt.mergeMap)(i=>Cr.decrypt(i.metadata.WalletUsername,e.secret))).subscribe({next:i=>{this.storage.setItem(ws.WALLET_USER_NAME_KEY,i)},error:()=>{var i;(i=this.diagnostic)===null||i===void 0||i.log(Et.EVENTS.GENERAL_ERROR,{message:"Had error decrypting",value:"username"})}})),this.subscriptions.add(r.sessionConfig$.pipe((0,lt.filter)(i=>i.metadata&&i.metadata.AppVersion!==void 0)).pipe((0,lt.mergeMap)(i=>Cr.decrypt(i.metadata.AppVersion,e.secret))).subscribe({next:i=>{this.storage.setItem(ws.APP_VERSION_KEY,i)},error:()=>{var i;(i=this.diagnostic)===null||i===void 0||i.log(Et.EVENTS.GENERAL_ERROR,{message:"Had error decrypting",value:"appversion"})}})),this.subscriptions.add(r.sessionConfig$.pipe((0,lt.filter)(i=>i.metadata&&i.metadata.ChainId!==void 0&&i.metadata.JsonRpcUrl!==void 0)).pipe((0,lt.mergeMap)(i=>(0,Xr.zip)(Cr.decrypt(i.metadata.ChainId,e.secret),Cr.decrypt(i.metadata.JsonRpcUrl,e.secret)))).pipe((0,lt.distinctUntilChanged)()).subscribe({next:([i,s])=>{this.chainCallback&&this.chainCallback(i,s)},error:()=>{var i;(i=this.diagnostic)===null||i===void 0||i.log(Et.EVENTS.GENERAL_ERROR,{message:"Had error decrypting",value:"chainId|jsonRpcUrl"})}})),this.subscriptions.add(r.sessionConfig$.pipe((0,lt.filter)(i=>i.metadata&&i.metadata.EthereumAddress!==void 0)).pipe((0,lt.mergeMap)(i=>Cr.decrypt(i.metadata.EthereumAddress,e.secret))).subscribe({next:i=>{this.accountsCallback&&this.accountsCallback([i]),Yt.accountRequestCallbackIds.size>0&&(Array.from(Yt.accountRequestCallbackIds.values()).forEach(s=>{const o=(0,At.Web3ResponseMessage)({id:s,response:(0,jt.RequestEthereumAccountsResponse)([i])});this.invokeCallback(Object.assign(Object.assign({},o),{id:s}))}),Yt.accountRequestCallbackIds.clear())},error:()=>{var i;(i=this.diagnostic)===null||i===void 0||i.log(Et.EVENTS.GENERAL_ERROR,{message:"Had error decrypting",value:"selectedAddress"})}})),this.subscriptions.add(r.sessionConfig$.pipe((0,lt.filter)(i=>i.metadata&&i.metadata.AppSrc!==void 0)).pipe((0,lt.mergeMap)(i=>Cr.decrypt(i.metadata.AppSrc,e.secret))).subscribe({next:i=>{this.ui.setAppSrc(i)},error:()=>{var i;(i=this.diagnostic)===null||i===void 0||i.log(Et.EVENTS.GENERAL_ERROR,{message:"Had error decrypting",value:"appSrc"})}}));const n=this.options.uiConstructor({linkAPIUrl:this.options.linkAPIUrl,version:this.options.version,darkMode:this.options.darkMode,session:e,connected$:r.connected$,chainId$:this.dappDefaultChainSubject});return r.connect(),{session:e,ui:n,connection:r}}attachUI(){this.ui.attach()}resetAndReload(){this.connection.setSessionMetadata("__destroyed","1").pipe((0,lt.timeout)(1e3),(0,lt.catchError)(e=>(0,Xr.of)(null))).subscribe(e=>{var r,n,i;const s=this.ui.isStandalone();try{this.subscriptions.unsubscribe()}catch{(r=this.diagnostic)===null||r===void 0||r.log(Et.EVENTS.GENERAL_ERROR,{message:"Had error unsubscribing"})}(n=this.diagnostic)===null||n===void 0||n.log(Et.EVENTS.SESSION_STATE_CHANGE,{method:"relay::resetAndReload",sessionMetadataChange:"__destroyed, 1",sessionIdHash:this.getSessionIdHash()}),this.connection.destroy();const o=Ir.Session.load(this.storage);if((o==null?void 0:o.id)===this._session.id?this.storage.clear():o&&((i=this.diagnostic)===null||i===void 0||i.log(Et.EVENTS.SKIPPED_CLEARING_SESSION,{sessionIdHash:this.getSessionIdHash(),storedSessionIdHash:Ir.Session.hash(o.id)})),this._reloadOnDisconnect){this.ui.reloadUI();return}this.accountsCallback&&this.accountsCallback([],!0),this.subscriptions=new Xr.Subscription;const{session:a,ui:c,connection:l}=this.subscribe();this._session=a,this.connection=l,this.ui=c,s&&this.ui.setStandalone&&this.ui.setStandalone(!0),this.attachUI()},e=>{var r;(r=this.diagnostic)===null||r===void 0||r.log(Et.EVENTS.FAILURE,{method:"relay::resetAndReload",message:`failed to reset and reload with ${e}`,sessionIdHash:this.getSessionIdHash()})})}setAppInfo(e,r){this.appName=e,this.appLogoUrl=r}getStorageItem(e){return this.storage.getItem(e)}get session(){return this._session}setStorageItem(e,r){this.storage.setItem(e,r)}signEthereumMessage(e,r,n,i){return this.sendRequest({method:mt.Web3Method.signEthereumMessage,params:{message:(0,et.hexStringFromBuffer)(e,!0),address:r,addPrefix:n,typedDataJson:i||null}})}ethereumAddressFromSignedMessage(e,r,n){return this.sendRequest({method:mt.Web3Method.ethereumAddressFromSignedMessage,params:{message:(0,et.hexStringFromBuffer)(e,!0),signature:(0,et.hexStringFromBuffer)(r,!0),addPrefix:n}})}signEthereumTransaction(e){return this.sendRequest({method:mt.Web3Method.signEthereumTransaction,params:{fromAddress:e.fromAddress,toAddress:e.toAddress,weiValue:(0,et.bigIntStringFromBN)(e.weiValue),data:(0,et.hexStringFromBuffer)(e.data,!0),nonce:e.nonce,gasPriceInWei:e.gasPriceInWei?(0,et.bigIntStringFromBN)(e.gasPriceInWei):null,maxFeePerGas:e.gasPriceInWei?(0,et.bigIntStringFromBN)(e.gasPriceInWei):null,maxPriorityFeePerGas:e.gasPriceInWei?(0,et.bigIntStringFromBN)(e.gasPriceInWei):null,gasLimit:e.gasLimit?(0,et.bigIntStringFromBN)(e.gasLimit):null,chainId:e.chainId,shouldSubmit:!1}})}signAndSubmitEthereumTransaction(e){return this.sendRequest({method:mt.Web3Method.signEthereumTransaction,params:{fromAddress:e.fromAddress,toAddress:e.toAddress,weiValue:(0,et.bigIntStringFromBN)(e.weiValue),data:(0,et.hexStringFromBuffer)(e.data,!0),nonce:e.nonce,gasPriceInWei:e.gasPriceInWei?(0,et.bigIntStringFromBN)(e.gasPriceInWei):null,maxFeePerGas:e.maxFeePerGas?(0,et.bigIntStringFromBN)(e.maxFeePerGas):null,maxPriorityFeePerGas:e.maxPriorityFeePerGas?(0,et.bigIntStringFromBN)(e.maxPriorityFeePerGas):null,gasLimit:e.gasLimit?(0,et.bigIntStringFromBN)(e.gasLimit):null,chainId:e.chainId,shouldSubmit:!0}})}submitEthereumTransaction(e,r){return this.sendRequest({method:mt.Web3Method.submitEthereumTransaction,params:{signedTransaction:(0,et.hexStringFromBuffer)(e,!0),chainId:r}})}scanQRCode(e){return this.sendRequest({method:mt.Web3Method.scanQRCode,params:{regExp:e}})}getQRCodeUrl(){return(0,et.createQrUrl)(this._session.id,this._session.secret,this.linkAPIUrl,!1,this.options.version,this.dappDefaultChain)}genericRequest(e,r){return this.sendRequest({method:mt.Web3Method.generic,params:{action:r,data:e}})}sendGenericMessage(e){return this.sendRequest(e)}sendRequest(e){let r=null;const n=(0,et.randomBytesHex)(8),i=o=>{this.publishWeb3RequestCanceledEvent(n),this.handleErrorResponse(n,e.method,o),r==null||r()};return{promise:new Promise((o,a)=>{this.ui.isStandalone()||(r=this.ui.showConnecting({isUnlinkedErrorState:this.isUnlinkedErrorState,onCancel:i,onResetConnection:this.resetAndReload})),this.relayEventManager.callbacks.set(n,c=>{if(r==null||r(),c.errorMessage)return a(new Error(c.errorMessage));o(c)}),this.ui.isStandalone()?this.sendRequestStandalone(n,e):this.publishWeb3RequestEvent(n,e)}),cancel:i}}setConnectDisabled(e){this.ui.setConnectDisabled(e)}setAccountsCallback(e){this.accountsCallback=e}setChainCallback(e){this.chainCallback=e}setDappDefaultChainCallback(e){this.dappDefaultChainSubject.next(e)}publishWeb3RequestEvent(e,r){var n;const i=(0,iC.Web3RequestMessage)({id:e,request:r}),s=Ir.Session.load(this.storage);(n=this.diagnostic)===null||n===void 0||n.log(Et.EVENTS.WEB3_REQUEST,{eventId:i.id,method:`relay::${i.request.method}`,sessionIdHash:this.getSessionIdHash(),storedSessionIdHash:s?Ir.Session.hash(s.id):"",isSessionMismatched:((s==null?void 0:s.id)!==this._session.id).toString()}),this.subscriptions.add(this.publishEvent("Web3Request",i,!0).subscribe({next:o=>{var a;(a=this.diagnostic)===null||a===void 0||a.log(Et.EVENTS.WEB3_REQUEST_PUBLISHED,{eventId:i.id,method:`relay::${i.request.method}`,sessionIdHash:this.getSessionIdHash(),storedSessionIdHash:s?Ir.Session.hash(s.id):"",isSessionMismatched:((s==null?void 0:s.id)!==this._session.id).toString()})},error:o=>{this.handleWeb3ResponseMessage((0,At.Web3ResponseMessage)({id:i.id,response:{method:i.request.method,errorMessage:o.message}}))}}))}publishWeb3RequestCanceledEvent(e){const r=(0,nC.Web3RequestCanceledMessage)(e);this.subscriptions.add(this.publishEvent("Web3RequestCanceled",r,!1).subscribe())}publishEvent(e,r,n){const i=this.session.secret;return new Xr.Observable(s=>{Cr.encrypt(JSON.stringify(Object.assign(Object.assign({},r),{origin:location.origin})),i).then(o=>{s.next(o),s.complete()})}).pipe((0,lt.mergeMap)(s=>this.connection.publishEvent(e,s,n)))}handleIncomingEvent(e){try{this.subscriptions.add((0,Xr.from)(Cr.decrypt(e.data,this.session.secret)).pipe((0,lt.map)(r=>JSON.parse(r))).subscribe({next:r=>{const n=(0,At.isWeb3ResponseMessage)(r)?r:null;n&&this.handleWeb3ResponseMessage(n)},error:()=>{var r;(r=this.diagnostic)===null||r===void 0||r.log(Et.EVENTS.GENERAL_ERROR,{message:"Had error decrypting",value:"incomingEvent"})}}))}catch{return}}handleWeb3ResponseMessage(e){var r;const{response:n}=e;if((r=this.diagnostic)===null||r===void 0||r.log(Et.EVENTS.WEB3_RESPONSE,{eventId:e.id,method:`relay::${n.method}`,sessionIdHash:this.getSessionIdHash()}),(0,jt.isRequestEthereumAccountsResponse)(n)){Yt.accountRequestCallbackIds.forEach(i=>this.invokeCallback(Object.assign(Object.assign({},e),{id:i}))),Yt.accountRequestCallbackIds.clear();return}this.invokeCallback(e)}handleErrorResponse(e,r,n,i){var s;const o=(s=n==null?void 0:n.message)!==null&&s!==void 0?s:(0,Bn.standardErrorMessage)(i);this.handleWeb3ResponseMessage((0,At.Web3ResponseMessage)({id:e,response:{method:r,errorMessage:o,errorCode:i}}))}invokeCallback(e){const r=this.relayEventManager.callbacks.get(e.id);r&&(r(e.response),this.relayEventManager.callbacks.delete(e.id))}requestEthereumAccounts(){const e={method:mt.Web3Method.requestEthereumAccounts,params:{appName:this.appName,appLogoUrl:this.appLogoUrl||null}},r=(0,et.randomBytesHex)(8),n=s=>{this.publishWeb3RequestCanceledEvent(r),this.handleErrorResponse(r,e.method,s)};return{promise:new Promise((s,o)=>{var a;this.relayEventManager.callbacks.set(r,l=>{if(this.ui.hideRequestEthereumAccounts(),l.errorMessage)return o(new Error(l.errorMessage));s(l)});const c=((a=window==null?void 0:window.navigator)===null||a===void 0?void 0:a.userAgent)||null;if(c&&/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(c)){let l;try{(0,et.isInIFrame)()&&window.top?l=window.top.location:l=window.location}catch{l=window.location}l.href=`https://www.coinbase.com/connect-dapp?uri=${encodeURIComponent(l.href)}`;return}if(this.ui.inlineAccountsResponse()){const l=p=>{this.handleWeb3ResponseMessage((0,At.Web3ResponseMessage)({id:r,response:(0,jt.RequestEthereumAccountsResponse)(p)}))};this.ui.requestEthereumAccounts({onCancel:n,onAccounts:l})}else{const l=Bn.standardErrors.provider.userRejectedRequest("User denied account authorization");this.ui.requestEthereumAccounts({onCancel:()=>n(l)})}Yt.accountRequestCallbackIds.add(r),!this.ui.inlineAccountsResponse()&&!this.ui.isStandalone()&&this.publishWeb3RequestEvent(r,e)}),cancel:n}}selectProvider(e){const r={method:mt.Web3Method.selectProvider,params:{providerOptions:e}},n=(0,et.randomBytesHex)(8),i=o=>{this.publishWeb3RequestCanceledEvent(n),this.handleErrorResponse(n,r.method,o)},s=new Promise((o,a)=>{this.relayEventManager.callbacks.set(n,p=>{if(p.errorMessage)return a(new Error(p.errorMessage));o(p)});const c=p=>{this.handleWeb3ResponseMessage((0,At.Web3ResponseMessage)({id:n,response:(0,jt.SelectProviderResponse)(rC.ProviderType.Unselected)}))},l=p=>{this.handleWeb3ResponseMessage((0,At.Web3ResponseMessage)({id:n,response:(0,jt.SelectProviderResponse)(p)}))};this.ui.selectProvider&&this.ui.selectProvider({onApprove:l,onCancel:c,providerOptions:e})});return{cancel:i,promise:s}}watchAsset(e,r,n,i,s,o){const a={method:mt.Web3Method.watchAsset,params:{type:e,options:{address:r,symbol:n,decimals:i,image:s},chainId:o}};let c=null;const l=(0,et.randomBytesHex)(8),p=y=>{this.publishWeb3RequestCanceledEvent(l),this.handleErrorResponse(l,a.method,y),c==null||c()};this.ui.inlineWatchAsset()||(c=this.ui.showConnecting({isUnlinkedErrorState:this.isUnlinkedErrorState,onCancel:p,onResetConnection:this.resetAndReload}));const g=new Promise((y,I)=>{this.relayEventManager.callbacks.set(l,U=>{if(c==null||c(),U.errorMessage)return I(new Error(U.errorMessage));y(U)});const T=U=>{this.handleWeb3ResponseMessage((0,At.Web3ResponseMessage)({id:l,response:(0,jt.WatchAssetReponse)(!1)}))},D=()=>{this.handleWeb3ResponseMessage((0,At.Web3ResponseMessage)({id:l,response:(0,jt.WatchAssetReponse)(!0)}))};this.ui.inlineWatchAsset()&&this.ui.watchAsset({onApprove:D,onCancel:T,type:e,address:r,symbol:n,decimals:i,image:s,chainId:o}),!this.ui.inlineWatchAsset()&&!this.ui.isStandalone()&&this.publishWeb3RequestEvent(l,a)});return{cancel:p,promise:g}}addEthereumChain(e,r,n,i,s,o){const a={method:mt.Web3Method.addEthereumChain,params:{chainId:e,rpcUrls:r,blockExplorerUrls:i,chainName:s,iconUrls:n,nativeCurrency:o}};let c=null;const l=(0,et.randomBytesHex)(8),p=y=>{this.publishWeb3RequestCanceledEvent(l),this.handleErrorResponse(l,a.method,y),c==null||c()};return this.ui.inlineAddEthereumChain(e)||(c=this.ui.showConnecting({isUnlinkedErrorState:this.isUnlinkedErrorState,onCancel:p,onResetConnection:this.resetAndReload})),{promise:new Promise((y,I)=>{this.relayEventManager.callbacks.set(l,U=>{if(c==null||c(),U.errorMessage)return I(new Error(U.errorMessage));y(U)});const T=U=>{this.handleWeb3ResponseMessage((0,At.Web3ResponseMessage)({id:l,response:(0,jt.AddEthereumChainResponse)({isApproved:!1,rpcUrl:""})}))},D=U=>{this.handleWeb3ResponseMessage((0,At.Web3ResponseMessage)({id:l,response:(0,jt.AddEthereumChainResponse)({isApproved:!0,rpcUrl:U})}))};this.ui.inlineAddEthereumChain(e)&&this.ui.addEthereumChain({onCancel:T,onApprove:D,chainId:a.params.chainId,rpcUrls:a.params.rpcUrls,blockExplorerUrls:a.params.blockExplorerUrls,chainName:a.params.chainName,iconUrls:a.params.iconUrls,nativeCurrency:a.params.nativeCurrency}),!this.ui.inlineAddEthereumChain(e)&&!this.ui.isStandalone()&&this.publishWeb3RequestEvent(l,a)}),cancel:p}}switchEthereumChain(e,r){const n={method:mt.Web3Method.switchEthereumChain,params:Object.assign({chainId:e},{address:r})},i=(0,et.randomBytesHex)(8),s=a=>{this.publishWeb3RequestCanceledEvent(i),this.handleErrorResponse(i,n.method,a)};return{promise:new Promise((a,c)=>{this.relayEventManager.callbacks.set(i,g=>{if((0,jt.isErrorResponse)(g)&&g.errorCode)return c(Bn.standardErrors.provider.custom({code:g.errorCode,message:"Unrecognized chain ID. Try adding the chain using addEthereumChain first."}));if(g.errorMessage)return c(new Error(g.errorMessage));a(g)});const l=g=>{var y;if(g){const I=(y=(0,Bn.getErrorCode)(g))!==null&&y!==void 0?y:Bn.standardErrorCodes.provider.unsupportedChain;this.handleErrorResponse(i,mt.Web3Method.switchEthereumChain,g instanceof Error?g:Bn.standardErrors.provider.unsupportedChain(e),I)}else this.handleWeb3ResponseMessage((0,At.Web3ResponseMessage)({id:i,response:(0,jt.SwitchEthereumChainResponse)({isApproved:!1,rpcUrl:""})}))},p=g=>{this.handleWeb3ResponseMessage((0,At.Web3ResponseMessage)({id:i,response:(0,jt.SwitchEthereumChainResponse)({isApproved:!0,rpcUrl:g})}))};this.ui.switchEthereumChain({onCancel:l,onApprove:p,chainId:n.params.chainId,address:n.params.address}),!this.ui.inlineSwitchEthereumChain()&&!this.ui.isStandalone()&&this.publishWeb3RequestEvent(i,n)}),cancel:s}}inlineAddEthereumChain(e){return this.ui.inlineAddEthereumChain(e)}getSessionIdHash(){return Ir.Session.hash(this._session.id)}sendRequestStandalone(e,r){const n=s=>{this.handleErrorResponse(e,r.method,s)},i=s=>{this.handleWeb3ResponseMessage((0,At.Web3ResponseMessage)({id:e,response:s}))};switch(r.method){case mt.Web3Method.signEthereumMessage:this.ui.signEthereumMessage({request:r,onSuccess:i,onCancel:n});break;case mt.Web3Method.signEthereumTransaction:this.ui.signEthereumTransaction({request:r,onSuccess:i,onCancel:n});break;case mt.Web3Method.submitEthereumTransaction:this.ui.submitEthereumTransaction({request:r,onSuccess:i,onCancel:n});break;case mt.Web3Method.ethereumAddressFromSignedMessage:this.ui.ethereumAddressFromSignedMessage({request:r,onSuccess:i});break;default:n();break}}onSessionConfigChanged(e){}}Yt.accountRequestCallbackIds=new Set;G0([J0.default],Yt.prototype,"resetAndReload",null);G0([J0.default],Yt.prototype,"handleIncomingEvent",null);Do.WalletSDKRelay=Yt;var qo={};Object.defineProperty(qo,"__esModule",{value:!0});qo.WalletSDKRelayEventManager=void 0;const sC=re;class oC{constructor(){this._nextRequestId=0,this.callbacks=new Map}makeRequestId(){this._nextRequestId=(this._nextRequestId+1)%2147483647;const e=this._nextRequestId,r=(0,sC.prepend0x)(e.toString(16));return this.callbacks.get(r)&&this.callbacks.delete(r),e}}qo.WalletSDKRelayEventManager=oC;Object.defineProperty(Ti,"__esModule",{value:!0});Ti.CoinbaseWalletSDK=void 0;const aC=Hs,uC=Ws,cC=Vs,lC=zn,hC=wo,fC=Do,dC=qo,pC=re,Z0=ai;class Go{constructor(e){var r,n,i;this._appName="",this._appLogoUrl=null,this._relay=null,this._relayEventManager=null;const s=e.linkAPIUrl||uC.LINK_API_URL;let o;if(e.uiConstructor?o=e.uiConstructor:o=l=>new hC.WalletSDKUI(l),typeof e.overrideIsMetaMask>"u"?this._overrideIsMetaMask=!1:this._overrideIsMetaMask=e.overrideIsMetaMask,this._overrideIsCoinbaseWallet=(r=e.overrideIsCoinbaseWallet)!==null&&r!==void 0?r:!0,this._overrideIsCoinbaseBrowser=(n=e.overrideIsCoinbaseBrowser)!==null&&n!==void 0?n:!1,e.diagnosticLogger&&e.eventListener)throw new Error("Can't have both eventListener and diagnosticLogger options, use only diagnosticLogger");e.eventListener?this._diagnosticLogger={log:e.eventListener.onEvent}:this._diagnosticLogger=e.diagnosticLogger,this._reloadOnDisconnect=(i=e.reloadOnDisconnect)!==null&&i!==void 0?i:!0;const a=new URL(s),c=`${a.protocol}//${a.host}`;this._storage=new cC.ScopedLocalStorage(`-walletlink:${c}`),this._storage.setItem("version",Go.VERSION),!(this.walletExtension||this.coinbaseBrowser)&&(this._relayEventManager=new dC.WalletSDKRelayEventManager,this._relay=new fC.WalletSDKRelay({linkAPIUrl:s,version:Z0.LIB_VERSION,darkMode:!!e.darkMode,uiConstructor:o,storage:this._storage,relayEventManager:this._relayEventManager,diagnosticLogger:this._diagnosticLogger,reloadOnDisconnect:this._reloadOnDisconnect}),this.setAppInfo(e.appName,e.appLogoUrl),!e.headlessMode&&this._relay.attachUI())}makeWeb3Provider(e="",r=1){const n=this.walletExtension;if(n)return this.isCipherProvider(n)||n.setProviderInfo(e,r),this._reloadOnDisconnect===!1&&typeof n.disableReloadOnDisconnect=="function"&&n.disableReloadOnDisconnect(),n;const i=this.coinbaseBrowser;if(i)return i;const s=this._relay;if(!s||!this._relayEventManager||!this._storage)throw new Error("Relay not initialized, should never happen");return e||s.setConnectDisabled(!0),new lC.CoinbaseWalletProvider({relayProvider:()=>Promise.resolve(s),relayEventManager:this._relayEventManager,storage:this._storage,jsonRpcUrl:e,chainId:r,qrUrl:this.getQrUrl(),diagnosticLogger:this._diagnosticLogger,overrideIsMetaMask:this._overrideIsMetaMask,overrideIsCoinbaseWallet:this._overrideIsCoinbaseWallet,overrideIsCoinbaseBrowser:this._overrideIsCoinbaseBrowser})}setAppInfo(e,r){var n;this._appName=e||"DApp",this._appLogoUrl=r||(0,pC.getFavicon)();const i=this.walletExtension;i?this.isCipherProvider(i)||i.setAppInfo(this._appName,this._appLogoUrl):(n=this._relay)===null||n===void 0||n.setAppInfo(this._appName,this._appLogoUrl)}disconnect(){var e;const r=this.walletExtension;r?r.close():(e=this._relay)===null||e===void 0||e.resetAndReload()}getQrUrl(){var e,r;return(r=(e=this._relay)===null||e===void 0?void 0:e.getQRCodeUrl())!==null&&r!==void 0?r:null}getCoinbaseWalletLogo(e,r=240){return(0,aC.walletLogo)(e,r)}get walletExtension(){var e;return(e=window.coinbaseWalletExtension)!==null&&e!==void 0?e:window.walletLinkExtension}get coinbaseBrowser(){var e,r;try{const n=(e=window.ethereum)!==null&&e!==void 0?e:(r=window.top)===null||r===void 0?void 0:r.ethereum;return n&&"isCoinbaseBrowser"in n&&n.isCoinbaseBrowser?n:void 0}catch{return}}isCipherProvider(e){return typeof e.isCipher=="boolean"&&e.isCipher}}Ti.CoinbaseWalletSDK=Go;Go.VERSION=Z0.LIB_VERSION;(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.CoinbaseWalletProvider=t.CoinbaseWalletSDK=void 0;const e=Ti,r=zn;var n=Ti;Object.defineProperty(t,"CoinbaseWalletSDK",{enumerable:!0,get:function(){return n.CoinbaseWalletSDK}});var i=zn;Object.defineProperty(t,"CoinbaseWalletProvider",{enumerable:!0,get:function(){return i.CoinbaseWalletProvider}}),t.default=e.CoinbaseWalletSDK,typeof window<"u"&&(window.CoinbaseWalletSDK=e.CoinbaseWalletSDK,window.CoinbaseWalletProvider=r.CoinbaseWalletProvider,window.WalletLink=e.CoinbaseWalletSDK,window.WalletLinkProvider=r.CoinbaseWalletProvider)})(cu);const gC=Y0(cu),MC=K0({__proto__:null,default:gC},[cu]);export{MC as i};
28
+ //# sourceMappingURL=index-bbaa3fa3.js.map