1import{e as lc,ap as Ws,c as J,g as fn,aq as Cp,ar as Rp,h as Ip}from"./index-15cc1b60.js";import{b as Hs}from"./index-cc134824.js";import{p as Ap,h as kp}from"./hooks.module-94a1dba9.js";function Tp(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 fc={},Ti={},Vs={};Object.defineProperty(Vs,"__esModule",{value:!0});Vs.walletLogo=void 0;const Np=(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.3
1V33.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.7
1h-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 `}};Vs.walletLogo=Np;var Us={};Object.defineProperty(Us,"__esModule",{value:!0});Us.ScopedLocalStorage=void 0;class Op{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}`}}Us.ScopedLocalStorage=Op;var qn={},hn={};Object.defineProperty(hn,"__esModule",{value:!0});const Lp=lc;function wu(t,e,r){try{Reflect.apply(t,e,r)}catch(n){setTimeout(()=>{throw n})}}function Pp(t){const e=t.length,r=new Array(e);for(let n=0;n<e;n+=1)r[n]=t[n];return r}let Dp=class extends Lp.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")wu(s,this,r);else{const o=s.length,a=Pp(s);for(let u=0;u<o;u+=1)wu(a[u],this,r)}return!0}};hn.default=Dp;var hc={exports:{}};hc.exports;(function(t){(function(e,r){function n(b,c){if(!b)throw new Error(c||"Assertion failed")}function i(b,c){b.super_=c;var h=function(){};h.prototype=c.prototype,b.prototype=new h,b.prototype.constructor=b}function s(b,c,h){if(s.isBN(b))return b;this.negative=0,this.words=null,this.length=0,this.red=null,b!==null&&((c==="le"||c==="be")&&(h=c,c=10),this._init(b||0,c||10,h||"be"))}
vendor: 42,338 bytes, line 1
1typeof 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=Ws.Buffer}catch{}s.isBN=function(c){return c instanceof s?!0:c!==null&&typeof c=="object"&&c.constructor.wordSize===s.wordSize&&Array.isArray(c.words)},s.max=function(c,h){return c.cmp(h)>0?c:h},s.min=function(c,h){return c.cmp(h)<0?c:h},s.prototype._init=function(c,h,p){if(typeof c=="number")return this._initNumber(c,h,p);if(typeof c=="object")return this._initArray(c,h,p);h==="hex"&&(h=16),n(h===(h|0)&&h>=2&&h<=36),c=c.toString().replace(/\s+/g,"");var v=0;c[0]==="-"&&(v++,this.negative=1),v<c.length&&(h===16?this._parseHex(c,v,p):(this._parseBase(c,h,v),p==="le"&&this._initArray(this.toArray(),h,p)))},s.prototype._initNumber=function(c,h,p){c<0&&(this.negative=1,c=-c),c<67108864?(this.words=[c&67108863],this.length=1):c<4503599627370496?(this.words=[c&67108863,c/67108864&67108863],this.length=2):(n(c<9007199254740992),this.words=[c&67108863,c/67108864&67108863,1],this.length=3),p==="le"&&this._initArray(this.toArray(),h,p)},s.prototype._initArray=function(c,h,p){if(n(typeof c.length=="number"),c.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(c.length/3),this.words=new Array(this.length);for(var v=0;v<this.length;v++)this.words[v]=0;var w,M,k=0;if(p==="be")for(v=c.length-1,w=0;v>=0;v-=3)M=c[v]|c[v-1]<<8|c[v-2]<<16,this.words[w]|=M<<k&67108863,this.words[w+1]=M>>>26-k&67108863,k+=24,k>=26&&(k-=26,w++);else if(p==="le")for(v=0,w=0;v<c.length;v+=3)M=c[v]|c[v+1]<<8|c[v+2]<<16,this.words[w]|=M<<k&67108863,this.words[w+1]=M>>>26-k&67108863,k+=24,k>=26&&(k-=26,w++);return this._strip()};function a(b,c){var h=b.charCodeAt(c);if(h>=48&&h<=57)return h-48;if(h>=65&&h<=70)return h-55;if(h>=97&&h<=102)return h-87;n(!1,"Invalid character in "+b)}function u(b,c,h){var p=a(b,h);return h-1>=c&&(p|=a(b,h-1)<<4),p}s.prototype._parseHex=function(c,h,p){this.length=Math.ceil((c.length-h)/6),this.words=new Array(this.length);for(var v=0;v<this.length;v++)this.words[v]=0;var w=0,M=0,k;if(p==="be")for(v=c.length-1;v>=h;v-=2)k=u(c,h,v)<<w,this.words[M]|=k&67108863,w>=18?(w-=18,M+=1,this.words[M]|=k>>>26):w+=8;else{var m=c.length-h;for(v=m%2===0?h+1:h;v<c.length;v+=2)k=u(c,h,v)<<w,this.words[M]|=k&67108863,w>=18?(w-=18,M+=1,this.words[M]|=k>>>26):w+=8}this._strip()};function l(b,c,h,p){for(var v=0,w=0,M=Math.min(b.length,h),k=c;k<M;k++){var m=b.charCodeAt(k)-48;v*=p,m>=49?w=m-49+10:m>=17?w=m-17+10:w=m,n(m>=0&&w<p,"Invalid character"),v+=w}return v}s.prototype._parseBase=function(c,h,p){this.words=[0],this.length=1;for(var v=0,w=1;w<=67108863;w*=h)v++;v--,w=w/h|0;for(var M=c.length-p,k=M%v,m=Math.min(M,M-k)+p,f=0,E=p;E<m;E+=v)f=l(c,E,E+v,h),this.imuln(w),this.words[0]+f<67108864?this.words[0]+=f:this._iaddn(f);if(k!==0){var U=1;for(f=l(c,E,c.length,h),E=0;E<k;E++)U*=h;this.imuln(U),this.words[0]+f<67108864?this.words[0]+=f:this._iaddn(f)}this._strip()},s.prototype.copy=function(c){c.words=new Array(this.length);for(var h=0;h<this.length;h++)c.words[h]=this.words[h];c.length=this.length,c.negative=this.negative,c.red=this.red};function d(b,c){b.words=c.words,b.length=c.length,b.negative=c.negative,b.red=c.red}if(s.prototype._move=function(c){d(c,this)},s.prototype.clone=function(){var c=new s(null);return this.copy(c),c},s.prototype._expand=function(c){for(;this.length<c;)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"],C=[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],A=[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(c,h){c=c||10,h=h|0||1;var p;if(c===16||c==="hex"){p="";for(var v=0,w=0,M=0;M<this.length;M++){var k=this.words[M],m=((k<<v|w)&16777215).toString(16);w=k>>>24-v&16777215,v+=2,v>=26&&(v-=26,M--),w!==0||M!==this.length-1?p=y[6-m.length]+m+p:p=m+p}for(w!==0&&(p=w.toString(16)+p);p.length%h!==0;)p="0"+p;return this.negative!==0&&(p="-"+p),p}if(c===(c|0)&&c>=2&&c<=36){var f=C[c],E=A[c];p="";var U=this.clone();for(U.negative=0;!U.isZero();){var q=U.modrn(E).toString(c);U=U.idivn(E),U.isZero()?p=q+p:p=y[f-q.length]+q+p}for(this.isZero()&&(p="0"+p);p.length%h!==0;)p="0"+p;return this.negative!==0&&(p="-"+p),p}n(!1,"Base should be between 2 and 36")},s.prototype.toNumber=function(){var c=this.words[0];return this.length===2?c+=this.words[1]*67108864:this.length===3&&this.words[2]===1?c+=4503599627370496+this.words[1]*67108864:this.length>2&&n(!1,"Number can only safely store up to 53 bits"),this.negative!==0?-c:c},s.prototype.toJSON=function(){return this.toString(16,2)},o&&(s.prototype.toBuffer=function(c,h){return this.toArrayLike(o,c,h)}),s.prototype.toArray=function(c,h){return this.toArrayLike(Array,c,h)};var D=function(c,h){return c.allocUnsafe?c.allocUnsafe(h):new c(h)};s.prototype.toArrayLike=function(c,h,p){this._strip();var v=this.byteLength(),w=p||Math.max(1,v);n(v<=w,"byte array longer than desired length"),n(w>0,"Requested array length <= 0");var M=D(c,w),k=h==="le"?"LE":"BE";return this["_toArrayLike"+k](M,v),M},s.prototype._toArrayLikeLE=function(c,h){for(var p=0,v=0,w=0,M=0;w<this.length;w++){var k=this.words[w]<<M|v;c[p++]=k&255,p<c.length&&(c[p++]=k>>8&255),p<c.length&&(c[p++]=k>>16&255),M===6?(p<c.length&&(c[p++]=k>>24&255),v=0,M=0):(v=k>>>24,M+=2)}if(p<c.length)for(c[p++]=v;p<c.length;)c[p++]=0},s.prototype._toArrayLikeBE=function(c,h){for(var p=c.length-1,v=0,w=0,M=0;w<this.length;w++){var k=this.words[w]<<M|v;c[p--]=k&255,p>=0&&(c[p--]=k>>8&255),p>=0&&(c[p--]=k>>16&255),M===6?(p>=0&&(c[p--]=k>>24&255),v=0,M=0):(v=k>>>24,M+=2)}if(p>=0)for(c[p--]=v;p>=0;)c[p--]=0},Math.clz32?s.prototype._countBits=function(c){return 32-Math.clz32(c)}:s.prototype._countBits=function(c){var h=c,p=0;return h>=4096&&(p+=13,h>>>=13),h>=64&&(p+=7,h>>>=7),h>=8&&(p+=4,h>>>=4),h>=2&&(p+=2,h>>>=2),p+h},s.prototype._zeroBits=function(c){if(c===0)return 26;var h=c,p=0;return h&8191||(p+=13,h>>>=13),h&127||(p+=7,h>>>=7),h&15||(p+=4,h>>>=4),h&3||(p+=2,h>>>=2),h&1||p++,p},s.prototype.bitLength=function(){var c=this.words[this.length-1],h=this._countBits(c);return(this.length-1)*26+h};function O(b){for(var c=new Array(b.bitLength()),h=0;h<c.length;h++){var p=h/26|0,v=h%26;c[h]=b.words[p]>>>v&1}return c}s.prototype.zeroBits=function(){if(this.isZero())return 0;for(var c=0,h=0;h<this.length;h++){var p=this._zeroBits(this.words[h]);if(c+=p,p!==26)break}return c},s.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},s.prototype.toTwos=function(c){return this.negative!==0?this.abs().inotn(c).iaddn(1):this.clone()},s.prototype.fromTwos=function(c){return this.testn(c-1)?this.notn(c).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(c){for(;this.length<c.length;)this.words[this.length++]=0;for(var h=0;h<c.length;h++)this.words[h]=this.words[h]|c.words[h];return this._strip()},s.prototype.ior=function(c){return n((this.negative|c.negative)===0),this.iuor(c)},s.prototype.or=function(c){return this.length>c.length?this.clone().ior(c):c.clone().ior(this)},s.prototype.uor=function(c){return this.length>c.length?this.clone().iuor(c):c.clone().iuor(this)},s.prototype.iuand=function(c){var h;this.length>c.length?h=c:h=this;for(var p=0;p<h.length;p++)this.words[p]=this.words[p]&c.words[p];return this.length=h.length,this._strip()},s.prototype.iand=function(c){return n((this.negative|c.negative)===0),this.iuand(c)},s.prototype.and=function(c){return this.length>c.length?this.clone().iand(c):c.clone().iand(this)},s.prototype.uand=function(c){return this.length>c.length?this.clone().iuand(c):c.clone().iuand(this)},s.prototype.iuxor=function(c){var h,p;this.length>c.length?(h=this,p=c):(h=c,p=this);for(var v=0;v<p.length;v++)this.words[v]=h.words[v]^p.words[v];if(this!==h)for(;v<h.length;v++)this.words[v]=h.words[v];return this.length=h.length,this._strip()},s.prototype.ixor=function(c){return n((this.negative|c.negative)===0),this.iuxor(c)},s.prototype.xor=function(c){return this.length>c.length?this.clone().ixor(c):c.clone().ixor(this)},s.prototype.uxor=function(c){return this.length>c.length?this.clone().iuxor(c):c.clone().iuxor(this)},s.prototype.inotn=function(c){n(typeof c=="number"&&c>=0);var h=Math.ceil(c/26)|0,p=c%26;this._expand(h),p>0&&h--;for(var v=0;v<h;v++)this.words[v]=~this.words[v]&67108863;return p>0&&(this.words[v]=~this.words[v]&67108863>>26-p),this._strip()},s.prototype.notn=function(c){return this.clone().inotn(c)},s.prototype.setn=function(c,h){n(typeof c=="number"&&c>=0);var p=c/26|0,v=c%26;return this._expand(p+1),h?this.words[p]=this.words[p]|1<<v:this.words[p]=this.words[p]&~(1<<v),this._strip()},s.prototype.iadd=function(c){var h;if(this.negative!==0&&c.negative===0)return this.negative=0,h=this.isub(c),this.negative^=1,this._normSign();if(this.negative===0&&c.negative!==0)return c.negative=0,h=this.isub(c),c.negative=1,h._normSign();var p,v;this.length>c.length?(p=this,v=c):(p=c,v=this);for(var w=0,M=0;M<v.length;M++)h=(p.words[M]|0)+(v.words[M]|0)+w,this.words[M]=h&67108863,w=h>>>26;for(;w!==0&&M<p.length;M++)h=(p.words[M]|0)+w,this.words[M]=h&67108863,w=h>>>26;if(this.length=p.length,w!==0)this.words[this.length]=w,this.length++;else if(p!==this)for(;M<p.length;M++)this.words[M]=p.words[M];return this},s.prototype.add=function(c){var h;return c.negative!==0&&this.negative===0?(c.negative=0,h=this.sub(c),c.negative^=1,h):c.negative===0&&this.negative!==0?(this.negative=0,h=c.sub(this),this.negative=1,h):this.length>c.length?this.clone().iadd(c):c.clone().iadd(this)},s.prototype.isub=function(c){if(c.negative!==0){c.negative=0;var h=this.iadd(c);return c.negative=1,h._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(c),this.negative=1,this._normSign();var p=this.cmp(c);if(p===0)return this.negative=0,this.length=1,this.words[0]=0,this;var v,w;p>0?(v=this,w=c):(v=c,w=this);for(var M=0,k=0;k<w.length;k++)h=(v.words[k]|0)-(w.words[k]|0)+M,M=h>>26,this.words[k]=h&67108863;for(;M!==0&&k<v.length;k++)h=(v.words[k]|0)+M,M=h>>26,this.words[k]=h&67108863;if(M===0&&k<v.length&&v!==this)for(;k<v.length;k++)this.words[k]=v.words[k];return this.length=Math.max(this.length,k),v!==this&&(this.negative=1),this._strip()},s.prototype.sub=function(c){return this.clone().isub(c)};function x(b,c,h){h.negative=c.negative^b.negative;var p=b.length+c.length|0;h.length=p,p=p-1|0;var v=b.words[0]|0,w=c.words[0]|0,M=v*w,k=M&67108863,m=M/67108864|0;h.words[0]=k;for(var f=1;f<p;f++){for(var E=m>>>26,U=m&67108863,q=Math.min(f,c.length-1),R=Math.max(0,f-b.length+1);R<=q;R++){var T=f-R|0;v=b.words[T]|0,w=c.words[R]|0,M=v*w+U,E+=M/67108864|0,U=M&67108863}h.words[f]=U|0,m=E|0}return m!==0?h.words[f]=m|0:h.length--,h._strip()}var I=function(c,h,p){var v=c.words,w=h.words,M=p.words,k=0,m,f,E,U=v[0]|0,q=U&8191,R=U>>>13,T=v[1]|0,$=T&8191,V=T>>>13,se=v[2]|0,_=se&8191,S=se>>>13,F=v[3]|0,H=F&8191,re=F>>>13,ie=v[4]|0,ee=ie&8191,de=ie>>>13,Jt=v[5]|0,we=Jt&8191,Se=Jt>>>13,vr=v[6]|0,ve=vr&8191,ye=vr>>>13,cr=v[7]|0,be=cr&8191,pe=cr>>>13,xt=v[8]|0,Ee=xt&8191,xe=xt>>>13,mn=v[9]|0,Me=mn&8191,Ce=mn>>>13,wn=w[0]|0,Re=wn&8191,Ie=wn>>>13,_n=w[1]|0,Ae=_n&8191,ke=_n>>>13,Sn=w[2]|0,Te=Sn&8191,Ne=Sn>>>13,En=w[3]|0,Oe=En&8191,Le=En>>>13,xn=w[4]|0,Pe=xn&8191,De=xn>>>13,Mn=w[5]|0,$e=Mn&8191,Be=Mn>>>13,Cn=w[6]|0,je=Cn&8191,Fe=Cn>>>13,Rn=w[7]|0,We=Rn&8191,He=Rn>>>13,In=w[8]|0,Ve=In&8191,Ue=In>>>13,An=w[9]|0,ze=An&8191,qe=An>>>13;p.negative=c.negative^h.negative,p.length=19,m=Math.imul(q,Re),f=Math.imul(q,Ie),f=f+Math.imul(R,Re)|0,E=Math.imul(R,Ie);var Or=(k+m|0)+((f&8191)<<13)|0;k=(E+(f>>>13)|0)+(Or>>>26)|0,Or&=67108863,m=Math.imul($,Re),f=Math.imul($,Ie),f=f+Math.imul(V,Re)|0,E=Math.imul(V,Ie),m=m+Math.imul(q,Ae)|0,f=f+Math.imul(q,ke)|0,f=f+Math.imul(R,Ae)|0,E=E+Math.imul(R,ke)|0;var Lr=(k+m|0)+((f&8191)<<13)|0;k=(E+(f>>>13)|0)+(Lr>>>26)|0,Lr&=67108863,m=Math.imul(_,Re),f=Math.imul(_,Ie),f=f+Math.imul(S,Re)|0,E=Math.imul(S,Ie),m=m+Math.imul($,Ae)|0,f=f+Math.imul($,ke)|0,f=f+Math.imul(V,Ae)|0,E=E+Math.imul(V,ke)|0,m=m+Math.imul(q,Te)|0,f=f+Math.imul(q,Ne)|0,f=f+Math.imul(R,Te)|0,E=E+Math.imul(R,Ne)|0;var Pr=(k+m|0)+((f&8191)<<13)|0;k=(E+(f>>>13)|0)+(Pr>>>26)|0,Pr&=67108863,m=Math.imul(H,Re),f=Math.imul(H,Ie),f=f+Math.imul(re,Re)|0,E=Math.imul(re,Ie),m=m+Math.imul(_,Ae)|0,f=f+Math.imul(_,ke)|0,f=f+Math.imul(S,Ae)|0,E=E+Math.imul(S,ke)|0,m=m+Math.imul($,Te)|0,f=f+Math.imul($,Ne)|0,f=f+Math.imul(V,Te)|0,E=E+Math.imul(V,Ne)|0,m=m+Math.imul(q,Oe)|0,f=f+Math.imul(q,Le)|0,f=f+Math.imul(R,Oe)|0,E=E+Math.imul(R,Le)|0;var Dr=(k+m|0)+((f&8191)<<13)|0;k=(E+(f>>>13)|0)+(Dr>>>26)|0,Dr&=67108863,m=Math.imul(ee,Re),f=Math.imul(ee,Ie),f=f+Math.imul(de,Re)|0,E=Math.imul(de,Ie),m=m+Math.imul(H,Ae)|0,f=f+Math.imul(H,ke)|0,f=f+Math.imul(re,Ae)|0,E=E+Math.imul(re,ke)|0,m=m+Math.imul(_,Te)|0,f=f+Math.imul(_,Ne)|0,f=f+Math.imul(S,Te)|0,E=E+Math.imul(S,Ne)|0,m=m+Math.imul($,Oe)|0,f=f+Math.imul($,Le)|0,f=f+Math.imul(V,Oe)|0,E=E+Math.imul(V,Le)|0,m=m+Math.imul(q,Pe)|0,f=f+Math.imul(q,De)|0,f=f+Math.imul(R,Pe)|0,E=E+Math.imul(R,De)|0;var $r=(k+m|0)+((f&8191)<<13)|0;k=(E+(f>>>13)|0)+($r>>>26)|0,$r&=67108863,m=Math.imul(we,Re),f=Math.imul(we,Ie),f=f+Math.imul(Se,Re)|0,E=Math.imul(Se,Ie),m=m+Math.imul(ee,Ae)|0,f=f+Math.imul(ee,ke)|0,f=f+Math.imul(de,Ae)|0,E=E+Math.imul(de,ke)|0,m=m+Math.imul(H,Te)|0,f=f+Math.imul(H,Ne)|0,f=f+Math.imul(re,Te)|0,E=E+Math.imul(re,Ne)|0,m=m+Math.imul(_,Oe)|0,f=f+Math.imul(_,Le)|0,f=f+Math.imul(S,Oe)|0,E=E+Math.imul(S,Le)|0,m=m+Math.imul($,Pe)|0,f=f+Math.imul($,De)|0,f=f+Math.imul(V,Pe)|0,E=E+Math.imul(V,De)|0,m=m+Math.imul(q,$e)|0,f=f+Math.imul(q,Be)|0,f=f+Math.imul(R,$e)|0,E=E+Math.imul(R,Be)|0;var Br=(k+m|0)+((f&8191)<<13)|0;k=(E+(f>>>13)|0)+(Br>>>26)|0,Br&=67108863,m=Math.imul(ve,Re),f=Math.imul(ve,Ie),f=f+Math.imul(ye,Re)|0,E=Math.imul(ye,Ie),m=m+Math.imul(we,Ae)|0,f=f+Math.imul(we,ke)|0,f=f+Math.imul(Se,Ae)|0,E=E+Math.imul(Se,ke)|0,m=m+Math.imul(ee,Te)|0,f=f+Math.imul(ee,Ne)|0,f=f+Math.imul(de,Te)|0,E=E+Math.imul(de,Ne)|0,m=m+Math.imul(H,Oe)|0,f=f+Math.imul(H,Le)|0,f=f+Math.imul(re,Oe)|0,E=E+Math.imul(re,Le)|0,m=m+Math.imul(_,Pe)|0,f=f+Math.imul(_,De)|0,f=f+Math.imul(S,Pe)|0,E=E+Math.imul(S,De)|0,m=m+Math.imul($,$e)|0,f=f+Math.imul($,Be)|0,f=f+Math.imul(V,$e)|0,E=E+Math.imul(V,Be)|0,m=m+Math.imul(q,je)|0,f=f+Math.imul(q,Fe)|0,f=f+Math.imul(R,je)|0,E=E+Math.imul(R,Fe)|0;var jr=(k+m|0)+((f&8191)<<13)|0;k=(E+(f>>>13)|0)+(jr>>>26)|0,jr&=67108863,m=Math.imul(be,Re),f=Math.imul(be,Ie),f=f+Math.imul(pe,Re)|0,E=Math.imul(pe,Ie),m=m+Math.imul(ve,Ae)|0,f=f+Math.imul(ve,ke)|0,f=f+Math.imul(ye,Ae)|0,E=E+Math.imul(ye,ke)|0,m=m+Math.imul(we,Te)|0,f=f+Math.imul(we,Ne)|0,f=f+Math.imul(Se,Te)|0,E=E+Math.imul(Se,Ne)|0,m=m+Math.imul(ee,Oe)|0,f=f+Math.imul(ee,Le)|0,f=f+Math.imul(de,Oe)|0,E=E+Math.imul(de,Le)|0,m=m+Math.imul(H,Pe)|0,f=f+Math.imul(H,De)|0,f=f+Math.imul(re,Pe)|0,E=E+Math.imul(re,De)|0,m=m+Math.imul(_,$e)|0,f=f+Math.imul(_,Be)|0,f=f+Math.imul(S,$e)|0,E=E+Math.imul(S,Be)|0,m=m+Math.imul($,je)|0,f=f+Math.imul($,Fe)|0,f=f+Math.imul(V,je)|0,E=E+Math.imul(V,Fe)|0,m=m+Math.imul(q,We)|0,f=f+Math.imul(q,He)|0,f=f+Math.imul(R,We)|0,E=E+Math.imul(R,He)|0;var Fr=(k+m|0)+((f&8191)<<13)|0;k=(E+(f>>>13)|0)+(Fr>>>26)|0,Fr&=67108863,m=Math.imul(Ee,Re),f=Math.imul(Ee,Ie),f=f+Math.imul(xe,Re)|0,E=Math.imul(xe,Ie),m=m+Math.imul(be,Ae)|0,f=f+Math.imul(be,ke)|0,f=f+Math.imul(pe,Ae)|0,E=E+Math.imul(pe,ke)|0,m=m+Math.imul(ve,Te)|0,f=f+Math.imul(ve,Ne)|0,f=f+Math.imul(ye,Te)|0,E=E+Math.imul(ye,Ne)|0,m=m+Math.imul(we,Oe)|0,f=f+Math.imul(we,Le)|0,f=f+Math.imul(Se,Oe)|0,E=E+Math.imul(Se,Le)|0,m=m+Math.imul(ee,Pe)|0,f=f+Math.imul(ee,De)|0,f=f+Math.imul(de,Pe)|0,E=E+Math.imul(de,De)|0,m=m+Math.imul(H,$e)|0,f=f+Math.imul(H,Be)|0,f=f+Math.imul(re,$e)|0,E=E+Math.imul(re,Be)|0,m=m+Math.imul(_,je)|0,f=f+Math.imul(_,Fe)|0,f=f+Math.imul(S,je)|0,E=E+Math.imul(S,Fe)|0,m=m+Math.imul($,We)|0,f=f+Math.imul($,He)|0,f=f+Math.imul(V,We)|0,E=E+Math.imul(V,He)|0,m=m+Math.imul(q,Ve)|0,f=f+Math.imul(q,Ue)|0,f=f+Math.imul(R,Ve)|0,E=E+Math.imul(R,Ue)|0;var Wr=(k+m|0)+((f&8191)<<13)|0;k=(E+(f>>>13)|0)+(Wr>>>26)|0,Wr&=67108863,m=Math.imul(Me,Re),f=Math.imul(Me,Ie),f=f+Math.imul(Ce,Re)|0,E=Math.imul(Ce,Ie),m=m+Math.imul(Ee,Ae)|0,f=f+Math.imul(Ee,ke)|0,f=f+Math.imul(xe,Ae)|0,E=E+Math.imul(xe,ke)|0,m=m+Math.imul(be,Te)|0,f=f+Math.imul(be,Ne)|0,f=f+Math.imul(pe,Te)|0,E=E+Math.imul(pe,Ne)|0,m=m+Math.imul(ve,Oe)|0,f=f+Math.imul(ve,Le)|0,f=f+Math.imul(ye,Oe)|0,E=E+Math.imul(ye,Le)|0,m=m+Math.imul(we,Pe)|0,f=f+Math.imul(we,De)|0,f=f+Math.imul(Se,Pe)|0,E=E+Math.imul(Se,De)|0,m=m+Math.imul(ee,$e)|0,f=f+Math.imul(ee,Be)|0,f=f+Math.imul(de,$e)|0,E=E+Math.imul(de,Be)|0,m=m+Math.imul(H,je)|0,f=f+Math.imul(H,Fe)|0,f=f+Math.imul(re,je)|0,E=E+Math.imul(re,Fe)|0,m=m+Math.imul(_,We)|0,f=f+Math.imul(_,He)|0,f=f+Math.imul(S,We)|0,E=E+Math.imul(S,He)|0,m=m+Math.imul($,Ve)|0,f=f+Math.imul($,Ue)|0,f=f+Math.imul(V,Ve)|0,E=E+Math.imul(V,Ue)|0,m=m+Math.imul(q,ze)|0,f=f+Math.imul(q,qe)|0,f=f+Math.imul(R,ze)|0,E=E+Math.imul(R,qe)|0;var Hr=(k+m|0)+((f&8191)<<13)|0;k=(E+(f>>>13)|0)+(Hr>>>26)|0,Hr&=67108863,m=Math.imul(Me,Ae),f=Math.imul(Me,ke),f=f+Math.imul(Ce,Ae)|0,E=Math.imul(Ce,ke),m=m+Math.imul(Ee,Te)|0,f=f+Math.imul(Ee,Ne)|0,f=f+Math.imul(xe,Te)|0,E=E+Math.imul(xe,Ne)|0,m=m+Math.imul(be,Oe)|0,f=f+Math.imul(be,Le)|0,f=f+Math.imul(pe,Oe)|0,E=E+Math.imul(pe,Le)|0,m=m+Math.imul(ve,Pe)|0,f=f+Math.imul(ve,De)|0,f=f+Math.imul(ye,Pe)|0,E=E+Math.imul(ye,De)|0,m=m+Math.imul(we,$e)|0,f=f+Math.imul(we,Be)|0,f=f+Math.imul(Se,$e)|0,E=E+Math.imul(Se,Be)|0,m=m+Math.imul(ee,je)|0,f=f+Math.imul(ee,Fe)|0,f=f+Math.imul(de,je)|0,E=E+Math.imul(de,Fe)|0,m=m+Math.imul(H,We)|0,f=f+Math.imul(H,He)|0,f=f+Math.imul(re,We)|0,E=E+Math.imul(re,He)|0,m=m+Math.imul(_,Ve)|0,f=f+Math.imul(_,Ue)|0,f=f+Math.imul(S,Ve)|0,E=E+Math.imul(S,Ue)|0,m=m+Math.imul($,ze)|0,f=f+Math.imul($,qe)|0,f=f+Math.imul(V,ze)|0,E=E+Math.imul(V,qe)|0;var Vr=(k+m|0)+((f&8191)<<13)|0;k=(E+(f>>>13)|0)+(Vr>>>26)|0,Vr&=67108863,m=Math.imul(Me,Te),f=Math.imul(Me,Ne),f=f+Math.imul(Ce,Te)|0,E=Math.imul(Ce,Ne),m=m+Math.imul(Ee,Oe)|0,f=f+Math.imul(Ee,Le)|0,f=f+Math.imul(xe,Oe)|0,E=E+Math.imul(xe,Le)|0,m=m+Math.imul(be,Pe)|0,f=f+Math.imul(be,De)|0,f=f+Math.imul(pe,Pe)|0,E=E+Math.imul(pe,De)|0,m=m+Math.imul(ve,$e)|0,f=f+Math.imul(ve,Be)|0,f=f+Math.imul(ye,$e)|0,E=E+Math.imul(ye,Be)|0,m=m+Math.imul(we,je)|0,f=f+Math.imul(we,Fe)|0,f=f+Math.imul(Se,je)|0,E=E+Math.imul(Se,Fe)|0,m=m+Math.imul(ee,We)|0,f=f+Math.imul(ee,He)|0,f=f+Math.imul(de,We)|0,E=E+Math.imul(de,He)|0,m=m+Math.imul(H,Ve)|0,f=f+Math.imul(H,Ue)|0,f=f+Math.imul(re,Ve)|0,E=E+Math.imul(re,Ue)|0,m=m+Math.imul(_,ze)|0,f=f+Math.imul(_,qe)|0,f=f+Math.imul(S,ze)|0,E=E+Math.imul(S,qe)|0;var Ur=(k+m|0)+((f&8191)<<13)|0;k=(E+(f>>>13)|0)+(Ur>>>26)|0,Ur&=67108863,m=Math.imul(Me,Oe),f=Math.imul(Me,Le),f=f+Math.imul(Ce,Oe)|0,E=Math.imul(Ce,Le),m=m+Math.imul(Ee,Pe)|0,f=f+Math.imul(Ee,De)|0,f=f+Math.imul(xe,Pe)|0,E=E+Math.imul(xe,De)|0,m=m+Math.imul(be,$e)|0,f=f+Math.imul(be,Be)|0,f=f+Math.imul(pe,$e)|0,E=E+Math.imul(pe,Be)|0,m=m+Math.imul(ve,je)|0,f=f+Math.imul(ve,Fe)|0,f=f+Math.imul(ye,je)|0,E=E+Math.imul(ye,Fe)|0,m=m+Math.imul(we,We)|0,f=f+Math.imul(we,He)|0,f=f+Math.imul(Se,We)|0,E=E+Math.imul(Se,He)|0,m=m+Math.imul(ee,Ve)|0,f=f+Math.imul(ee,Ue)|0,f=f+Math.imul(de,Ve)|0,E=E+Math.imul(de,Ue)|0,m=m+Math.imul(H,ze)|0,f=f+Math.imul(H,qe)|0,f=f+Math.imul(re,ze)|0,E=E+Math.imul(re,qe)|0;var zr=(k+m|0)+((f&8191)<<13)|0;k=(E+(f>>>13)|0)+(zr>>>26)|0,zr&=67108863,m=Math.imul(Me,Pe),f=Math.imul(Me,De),f=f+Math.imul(Ce,Pe)|0,E=Math.imul(Ce,De),m=m+Math.imul(Ee,$e)|0,f=f+Math.imul(Ee,Be)|0,f=f+Math.imul(xe,$e)|0,E=E+Math.imul(xe,Be)|0,m=m+Math.imul(be,je)|0,f=f+Math.imul(be,Fe)|0,f=f+Math.imul(pe,je)|0,E=E+Math.imul(pe,Fe)|0,m=m+Math.imul(ve,We)|0,f=f+Math.imul(ve,He)|0,f=f+Math.imul(ye,We)|0,E=E+Math.imul(ye,He)|0,m=m+Math.imul(we,Ve)|0,f=f+Math.imul(we,Ue)|0,f=f+Math.imul(Se,Ve)|0,E=E+Math.imul(Se,Ue)|0,m=m+Math.imul(ee,ze)|0,f=f+Math.imul(ee,qe)|0,f=f+Math.imul(de,ze)|0,E=E+Math.imul(de,qe)|0;var qr=(k+m|0)+((f&8191)<<13)|0;k=(E+(f>>>13)|0)+(qr>>>26)|0,qr&=67108863,m=Math.imul(Me,$e),f=Math.imul(Me,Be),f=f+Math.imul(Ce,$e)|0,E=Math.imul(Ce,Be),m=m+Math.imul(Ee,je)|0,f=f+Math.imul(Ee,Fe)|0,f=f+Math.imul(xe,je)|0,E=E+Math.imul(xe,Fe)|0,m=m+Math.imul(be,We)|0,f=f+Math.imul(be,He)|0,f=f+Math.imul(pe,We)|0,E=E+Math.imul(pe,He)|0,m=m+Math.imul(ve,Ve)|0,f=f+Math.imul(ve,Ue)|0,f=f+Math.imul(ye,Ve)|0,E=E+Math.imul(ye,Ue)|0,m=m+Math.imul(we,ze)|0,f=f+Math.imul(we,qe)|0,f=f+Math.imul(Se,ze)|0,E=E+Math.imul(Se,qe)|0;var qo=(k+m|0)+((f&8191)<<13)|0;k=(E+(f>>>13)|0)+(qo>>>26)|0,qo&=67108863,m=Math.imul(Me,je),f=Math.imul(Me,Fe),f=f+Math.imul(Ce,je)|0,E=Math.imul(Ce,Fe),m=m+Math.imul(Ee,We)|0,f=f+Math.imul(Ee,He)|0,f=f+Math.imul(xe,We)|0,E=E+Math.imul(xe,He)|0,m=m+Math.imul(be,Ve)|0,f=f+Math.imul(be,Ue)|0,f=f+Math.imul(pe,Ve)|0,E=E+Math.imul(pe,Ue)|0,m=m+Math.imul(ve,ze)|0,f=f+Math.imul(ve,qe)|0,f=f+Math.imul(ye,ze)|0,E=E+Math.imul(ye,qe)|0;var Go=(k+m|0)+((f&8191)<<13)|0;k=(E+(f>>>13)|0)+(Go>>>26)|0,Go&=67108863,m=Math.imul(Me,We),f=Math.imul(Me,He),f=f+Math.imul(Ce,We)|0,E=Math.imul(Ce,He),m=m+Math.imul(Ee,Ve)|0,f=f+Math.imul(Ee,Ue)|0,f=f+Math.imul(xe,Ve)|0,E=E+Math.imul(xe,Ue)|0,m=m+Math.imul(be,ze)|0,f=f+Math.imul(be,qe)|0,f=f+Math.imul(pe,ze)|0,E=E+Math.imul(pe,qe)|0;var Jo=(k+m|0)+((f&8191)<<13)|0;k=(E+(f>>>13)|0)+(Jo>>>26)|0,Jo&=67108863,m=Math.imul(Me,Ve),f=Math.imul(Me,Ue),f=f+Math.imul(Ce,Ve)|0,E=Math.imul(Ce,Ue),m=m+Math.imul(Ee,ze)|0,f=f+Math.imul(Ee,qe)|0,f=f+Math.imul(xe,ze)|0,E=E+Math.imul(xe,qe)|0;var Zo=(k+m|0)+((f&8191)<<13)|0;k=(E+(f>>>13)|0)+(Zo>>>26)|0,Zo&=67108863,m=Math.imul(Me,ze),f=Math.imul(Me,qe),f=f+Math.imul(Ce,ze)|0,E=Math.imul(Ce,qe);var Qo=(k+m|0)+((f&8191)<<13)|0;return k=(E+(f>>>13)|0)+(Qo>>>26)|0,Qo&=67108863,M[0]=Or,M[1]=Lr,M[2]=Pr,M[3]=Dr,M[4]=$r,M[5]=Br,M[6]=jr,M[7]=Fr,M[8]=Wr,M[9]=Hr,M[10]=Vr,M[11]=Ur,M[12]=zr,M[13]=qr,M[14]=qo,M[15]=Go,M[16]=Jo,M[17]=Zo,M[18]=Qo,k!==0&&(M[19]=k,p.length++),p};Math.imul||(I=x);function N(b,c,h){h.negative=c.negative^b.negative,h.length=b.length+c.length;for(var p=0,v=0,w=0;w<h.length-1;w++){var M=v;v=0;for(var k=p&67108863,m=Math.min(w,c.length-1),f=Math.max(0,w-b.length+1);f<=m;f++){var E=w-f,U=b.words[E]|0,q=c.words[f]|0,R=U*q,T=R&67108863;M=M+(R/67108864|0)|0,T=T+k|0,k=T&67108863,M=M+(T>>>26)|0,v+=M>>>26,M&=67108863}h.words[w]=k,p=M,M=v}return p!==0?h.words[w]=p:h.length--,h._strip()}function P(b,c,h){return N(b,c,h)}s.prototype.mulTo=function(c,h){var p,v=this.length+c.length;return this.length===10&&c.length===10?p=I(this,c,h):v<63?p=x(this,c,h):v<1024?p=N(this,c,h):p=P(this,c,h),p},s.prototype.mul=function(c){var h=new s(null);return h.words=new Array(this.length+c.length),this.mulTo(c,h)},s.prototype.mulf=function(c){var h=new s(null);return h.words=new Array(this.length+c.length),P(this,c,h)},s.prototype.imul=function(c){return this.clone().mulTo(c,this)},s.prototype.imuln=function(c){var h=c<0;h&&(c=-c),n(typeof c=="number"),n(c<67108864);for(var p=0,v=0;v<this.length;v++){var w=(this.words[v]|0)*c,M=(w&67108863)+(p&67108863);p>>=26,p+=w/67108864|0,p+=M>>>26,this.words[v]=M&67108863}return p!==0&&(this.words[v]=p,this.length++),h?this.ineg():this},s.prototype.muln=function(c){return this.clone().imuln(c)},s.prototype.sqr=function(){return this.mul(this)},s.prototype.isqr=function(){return this.imul(this.clone())},s.prototype.pow=function(c){var h=O(c);if(h.length===0)return new s(1);for(var p=this,v=0;v<h.length&&h[v]===0;v++,p=p.sqr());if(++v<h.length)for(var w=p.sqr();v<h.length;v++,w=w.sqr())h[v]!==0&&(p=p.mul(w));return p},s.prototype.iushln=function(c){n(typeof c=="number"&&c>=0);var h=c%26,p=(c-h)/26,v=67108863>>>26-h<<26-h,w;if(h!==0){var M=0;for(w=0;w<this.length;w++){var k=this.words[w]&v,m=(this.words[w]|0)-k<<h;this.words[w]=m|M,M=k>>>26-h}M&&(this.words[w]=M,this.length++)}if(p!==0){for(w=this.length-1;w>=0;w--)this.words[w+p]=this.words[w];for(w=0;w<p;w++)this.words[w]=0;this.length+=p}return this._strip()},s.prototype.ishln=function(c){return n(this.negative===0),this.iushln(c)},s.prototype.iushrn=function(c,h,p){n(typeof c=="number"&&c>=0);var v;h?v=(h-h%26)/26:v=0;var w=c%26,M=Math.min((c-w)/26,this.length),k=67108863^67108863>>>w<<w,m=p;if(v-=M,v=Math.max(0,v),m){for(var f=0;f<M;f++)m.words[f]=this.words[f];m.length=M}if(M!==0)if(this.length>M)for(this.length-=M,f=0;f<this.length;f++)this.words[f]=this.words[f+M];else this.words[0]=0,this.length=1;var E=0;for(f=this.length-1;f>=0&&(E!==0||f>=v);f--){var U=this.words[f]|0;this.words[f]=E<<26-w|U>>>w,E=U&k}return m&&E!==0&&(m.words[m.length++]=E),this.length===0&&(this.words[0]=0,this.length=1),this._strip()},s.prototype.ishrn=function(c,h,p){return n(this.negative===0),this.iushrn(c,h,p)},s.prototype.shln=function(c){return this.clone().ishln(c)},s.prototype.ushln=function(c){return this.clone().iushln(c)},s.prototype.shrn=function(c){return this.clone().ishrn(c)},s.prototype.ushrn=function(c){return this.clone().iushrn(c)},s.prototype.testn=function(c){n(typeof c=="number"&&c>=0);var h=c%26,p=(c-h)/26,v=1<<h;if(this.length<=p)return!1;var w=this.words[p];return!!(w&v)},s.prototype.imaskn=function(c){n(typeof c=="number"&&c>=0);var h=c%26,p=(c-h)/26;if(n(this.negative===0,"imaskn works only with positive numbers"),this.length<=p)return this;if(h!==0&&p++,this.length=Math.min(p,this.length),h!==0){var v=67108863^67108863>>>h<<h;this.words[this.length-1]&=v}return this._strip()},s.prototype.maskn=function(c){return this.clone().imaskn(c)},s.prototype.iaddn=function(c){return n(typeof c=="number"),n(c<67108864),c<0?this.isubn(-c):this.negative!==0?this.length===1&&(this.words[0]|0)<=c?(this.words[0]=c-(this.words[0]|0),this.negative=0,this):(this.negative=0,this.isubn(c),this.negative=1,this):this._iaddn(c)},s.prototype._iaddn=function(c){this.words[0]+=c;for(var h=0;h<this.length&&this.words[h]>=67108864;h++)this.words[h]-=67108864,h===this.length-1?this.words[h+1]=1:this.words[h+1]++;return this.length=Math.max(this.length,h+1),this},s.prototype.isubn=function(c){if(n(typeof c=="number"),n(c<67108864),c<0)return this.iaddn(-c);if(this.negative!==0)return this.negative=0,this.iaddn(c),this.negative=1,this;if(this.words[0]-=c,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var h=0;h<this.length&&this.words[h]<0;h++)this.words[h]+=67108864,this.words[h+1]-=1;return this._strip()},s.prototype.addn=function(c){return this.clone().iaddn(c)},s.prototype.subn=function(c){return this.clone().isubn(c)},s.prototype.iabs=function(){return this.negative=0,this},s.prototype.abs=function(){return this.clone().iabs()},s.prototype._ishlnsubmul=function(c,h,p){var v=c.length+p,w;this._expand(v);var M,k=0;for(w=0;w<c.length;w++){M=(this.words[w+p]|0)+k;var m=(c.words[w]|0)*h;M-=m&67108863,k=(M>>26)-(m/67108864|0),this.words[w+p]=M&67108863}for(;w<this.length-p;w++)M=(this.words[w+p]|0)+k,k=M>>26,this.words[w+p]=M&67108863;if(k===0)return this._strip();for(n(k===-1),k=0,w=0;w<this.length;w++)M=-(this.words[w]|0)+k,k=M>>26,this.words[w]=M&67108863;return this.negative=1,this._strip()},s.prototype._wordDiv=function(c,h){var p=this.length-c.length,v=this.clone(),w=c,M=w.words[w.length-1]|0,k=this._countBits(M);p=26-k,p!==0&&(w=w.ushln(p),v.iushln(p),M=w.words[w.length-1]|0);var m=v.length-w.length,f;if(h!=="mod"){f=new s(null),f.length=m+1,f.words=new Array(f.length);for(var E=0;E<f.length;E++)f.words[E]=0}var U=v.clone()._ishlnsubmul(w,1,m);U.negative===0&&(v=U,f&&(f.words[m]=1));for(var q=m-1;q>=0;q--){var R=(v.words[w.length+q]|0)*67108864+(v.words[w.length+q-1]|0);for(R=Math.min(R/M|0,67108863),v._ishlnsubmul(w,R,q);v.negative!==0;)R--,v.negative=0,v._ishlnsubmul(w,1,q),v.isZero()||(v.negative^=1);f&&(f.words[q]=R)}return f&&f._strip(),v._strip(),h!=="div"&&p!==0&&v.iushrn(p),{div:f||null,mod:v}},s.prototype.divmod=function(c,h,p){if(n(!c.isZero()),this.isZero())return{div:new s(0),mod:new s(0)};var v,w,M;return this.negative!==0&&c.negative===0?(M=this.neg().divmod(c,h),h!=="mod"&&(v=M.div.neg()),h!=="div"&&(w=M.mod.neg(),p&&w.negative!==0&&w.iadd(c)),{div:v,mod:w}):this.negative===0&&c.negative!==0?(M=this.divmod(c.neg(),h),h!=="mod"&&(v=M.div.neg()),{div:v,mod:M.mod}):this.negative&c.negative?(M=this.neg().divmod(c.neg(),h),h!=="div"&&(w=M.mod.neg(),p&&w.negative!==0&&w.isub(c)),{div:M.div,mod:w}):c.length>this.length||this.cmp(c)<0?{div:new s(0),mod:this}:c.length===1?h==="div"?{div:this.divn(c.words[0]),mod:null}:h==="mod"?{div:null,mod:new s(this.modrn(c.words[0]))}:{div:this.divn(c.words[0]),mod:new s(this.modrn(c.words[0]))}:this._wordDiv(c,h)},s.prototype.div=function(c){return this.divmod(c,"div",!1).div},s.prototype.mod=function(c){return this.divmod(c,"mod",!1).mod},s.prototype.umod=function(c){return this.divmod(c,"mod",!0).mod},s.prototype.divRound=function(c){var h=this.divmod(c);if(h.mod.isZero())return h.div;var p=h.div.negative!==0?h.mod.isub(c):h.mod,v=c.ushrn(1),w=c.andln(1),M=p.cmp(v);return M<0||w===1&&M===0?h.div:h.div.negative!==0?h.div.isubn(1):h.div.iaddn(1)},s.prototype.modrn=function(c){var h=c<0;h&&(c=-c),n(c<=67108863);for(var p=(1<<26)%c,v=0,w=this.length-1;w>=0;w--)v=(p*v+(this.words[w]|0))%c;return h?-v:v},s.prototype.modn=function(c){return this.modrn(c)},s.prototype.idivn=function(c){var h=c<0;h&&(c=-c),n(c<=67108863);for(var p=0,v=this.length-1;v>=0;v--){var w=(this.words[v]|0)+p*67108864;this.words[v]=w/c|0,p=w%c}return this._strip(),h?this.ineg():this},s.prototype.divn=function(c){return this.clone().idivn(c)},s.prototype.egcd=function(c){n(c.negative===0),n(!c.isZero());var h=this,p=c.clone();h.negative!==0?h=h.umod(c):h=h.clone();for(var v=new s(1),w=new s(0),M=new s(0),k=new s(1),m=0;h.isEven()&&p.isEven();)h.iushrn(1),p.iushrn(1),++m;for(var f=p.clone(),E=h.clone();!h.isZero();){for(var U=0,q=1;!(h.words[0]&q)&&U<26;++U,q<<=1);if(U>0)for(h.iushrn(U);U-- >0;)(v.isOdd()||w.isOdd())&&(v.iadd(f),w.isub(E)),v.iushrn(1),w.iushrn(1);for(var R=0,T=1;!(p.words[0]&T)&&R<26;++R,T<<=1);if(R>0)for(p.iushrn(R);R-- >0;)(M.isOdd()||k.isOdd())&&(M.iadd(f),k.isub(E)),M.iushrn(1),k.iushrn(1);h.cmp(p)>=0?(h.isub(p),v.isub(M),w.isub(k)):(p.isub(h),M.isub(v),k.isub(w))}return{a:M,b:k,gcd:p.iushln(m)}},s.prototype._invmp=function(c){n(c.negative===0),n(!c.isZero());var h=this,p=c.clone();h.negative!==0?h=h.umod(c):h=h.clone();for(var v=new s(1),w=new s(0),M=p.clone();h.cmpn(1)>0&&p.cmpn(1)>0;){for(var k=0,m=1;!(h.words[0]&m)&&k<26;++k,m<<=1);if(k>0)for(h.iushrn(k);k-- >0;)v.isOdd()&&v.iadd(M),v.iushrn(1);for(var f=0,E=1;!(p.words[0]&E)&&f<26;++f,E<<=1);if(f>0)for(p.iushrn(f);f-- >0;)w.isOdd()&&w.iadd(M),w.iushrn(1);h.cmp(p)>=0?(h.isub(p),v.isub(w)):(p.isub(h),w.isub(v))}var U;return h.cmpn(1)===0?U=v:U=w,U.cmpn(0)<0&&U.iadd(c),U},s.prototype.gcd=function(c){if(this.isZero())return c.abs();if(c.isZero())return this.abs();var h=this.clone(),p=c.clone();h.negative=0,p.negative=0;for(var v=0;h.isEven()&&p.isEven();v++)h.iushrn(1),p.iushrn(1);do{for(;h.isEven();)h.iushrn(1);for(;p.isEven();)p.iushrn(1);var w=h.cmp(p);if(w<0){var M=h;h=p,p=M}else if(w===0||p.cmpn(1)===0)break;h.isub(p)}while(!0);return p.iushln(v)},s.prototype.invm=function(c){return this.egcd(c).a.umod(c)},s.prototype.isEven=function(){return(this.words[0]&1)===0},s.prototype.isOdd=function(){return(this.words[0]&1)===1},s.prototype.andln=function(c){return this.words[0]&c},s.prototype.bincn=function(c){n(typeof c=="number");var h=c%26,p=(c-h)/26,v=1<<h;if(this.length<=p)return this._expand(p+1),this.words[p]|=v,this;for(var w=v,M=p;w!==0&&M<this.length;M++){var k=this.words[M]|0;k+=w,w=k>>>26,k&=67108863,this.words[M]=k}return w!==0&&(this.words[M]=w,this.length++),this},s.prototype.isZero=function(){return this.length===1&&this.words[0]===0},s.prototype.cmpn=function(c){var h=c<0;if(this.negative!==0&&!h)return-1;if(this.negative===0&&h)return 1;this._strip();var p;if(this.length>1)p=1;else{h&&(c=-c),n(c<=67108863,"Number is too big");var v=this.words[0]|0;p=v===c?0:v<c?-1:1}return this.negative!==0?-p|0:p},s.prototype.cmp=function(c){if(this.negative!==0&&c.negative===0)return-1;if(this.negative===0&&c.negative!==0)return 1;var h=this.ucmp(c);return this.negative!==0?-h|0:h},s.prototype.ucmp=function(c){if(this.length>c.length)return 1;if(this.length<c.length)return-1;for(var h=0,p=this.length-1;p>=0;p--){var v=this.words[p]|0,w=c.words[p]|0;if(v!==w){v<w?h=-1:v>w&&(h=1);break}}return h},s.prototype.gtn=function(c){return this.cmpn(c)===1},s.prototype.gt=function(c){return this.cmp(c)===1},s.prototype.gten=function(c){return this.cmpn(c)>=0},s.prototype.gte=function(c){return this.cmp(c)>=0},s.prototype.ltn=function(c){return this.cmpn(c)===-1},s.prototype.lt=function(c){return this.cmp(c)===-1},s.prototype.lten=function(c){return this.cmpn(c)<=0},s.prototype.lte=function(c){return this.cmp(c)<=0},s.prototype.eqn=function(c){return this.cmpn(c)===0},s.prototype.eq=function(c){return this.cmp(c)===0},s.red=function(c){return new Y(c)},s.prototype.toRed=function(c){return n(!this.red,"Already a number in reduction context"),n(this.negative===0,"red works only with positives"),c.convertTo(this)._forceRed(c)},s.prototype.fromRed=function(){return n(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},s.prototype._forceRed=function(c){return this.red=c,this},s.prototype.forceRed=function(c){return n(!this.red,"Already a number in reduction context"),this._forceRed(c)},s.prototype.redAdd=function(c){return n(this.red,"redAdd works only with red numbers"),this.red.add(this,c)},s.prototype.redIAdd=function(c){return n(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,c)},s.prototype.redSub=function(c){return n(this.red,"redSub works only with red numbers"),this.red.sub(this,c)},s.prototype.redISub=function(c){return n(this.red,"redISub works only with red numbers"),this.red.isub(this,c)},s.prototype.redShl=function(c){return n(this.red,"redShl works only with red numbers"),this.red.shl(this,c)},s.prototype.redMul=function(c){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,c),this.red.mul(this,c)},s.prototype.redIMul=function(c){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,c),this.red.imul(this,c)},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(c){return n(this.red&&!c.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,c)};var L={k256:null,p224:null,p192:null,p25519:null};function B(b,c){this.name=b,this.p=new s(c,16),this.n=this.p.bitLength(),this.k=new s(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}B.prototype._tmp=function(){var c=new s(null);return c.words=new Array(Math.ceil(this.n/13)),c},B.prototype.ireduce=function(c){var h=c,p;do this.split(h,this.tmp),h=this.imulK(h),h=h.iadd(this.tmp),p=h.bitLength();while(p>this.n);var v=p<this.n?-1:h.ucmp(this.p);return v===0?(h.words[0]=0,h.length=1):v>0?h.isub(this.p):h.strip!==void 0?h.strip():h._strip(),h},B.prototype.split=function(c,h){c.iushrn(this.n,0,h)},B.prototype.imulK=function(c){return c.imul(this.k)};function G(){B.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}i(G,B),G.prototype.split=function(c,h){for(var p=4194303,v=Math.min(c.length,9),w=0;w<v;w++)h.words[w]=c.words[w];if(h.length=v,c.length<=9){c.words[0]=0,c.length=1;return}var M=c.words[9];for(h.words[h.length++]=M&p,w=10;w<c.length;w++){var k=c.words[w]|0;c.words[w-10]=(k&p)<<4|M>>>22,M=k}M>>>=22,c.words[w-10]=M,M===0&&c.length>10?c.length-=10:c.length-=9},G.prototype.imulK=function(c){c.words[c.length]=0,c.words[c.length+1]=0,c.length+=2;for(var h=0,p=0;p<c.length;p++){var v=c.words[p]|0;h+=v*977,c.words[p]=h&67108863,h=v*64+(h/67108864|0)}return c.words[c.length-1]===0&&(c.length--,c.words[c.length-1]===0&&c.length--),c};function z(){B.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}i(z,B);function W(){B.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}i(W,B);function K(){B.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}i(K,B),K.prototype.imulK=function(c){for(var h=0,p=0;p<c.length;p++){var v=(c.words[p]|0)*19+h,w=v&67108863;v>>>=26,c.words[p]=w,h=v}return h!==0&&(c.words[c.length++]=h),c},s._prime=function(c){if(L[c])return L[c];var h;if(c==="k256")h=new G;else if(c==="p224")h=new z;else if(c==="p192")h=new W;else if(c==="p25519")h=new K;else throw new Error("Unknown prime "+c);return L[c]=h,h};function Y(b){if(typeof b=="string"){var c=s._prime(b);this.m=c.p,this.prime=c}else n(b.gtn(1),"modulus must be greater than 1"),this.m=b,this.prime=null}Y.prototype._verify1=function(c){n(c.negative===0,"red works only with positives"),n(c.red,"red works only with red numbers")},Y.prototype._verify2=function(c,h){n((c.negative|h.negative)===0,"red works only with positives"),n(c.red&&c.red===h.red,"red works only with red numbers")},Y.prototype.imod=function(c){return this.prime?this.prime.ireduce(c)._forceRed(this):(d(c,c.umod(this.m)._forceRed(this)),c)},Y.prototype.neg=function(c){return c.isZero()?c.clone():this.m.sub(c)._forceRed(this)},Y.prototype.add=function(c,h){this._verify2(c,h);var p=c.add(h);return p.cmp(this.m)>=0&&p.isub(this.m),p._forceRed(this)},Y.prototype.iadd=function(c,h){this._verify2(c,h);var p=c.iadd(h);return p.cmp(this.m)>=0&&p.isub(this.m),p},Y.prototype.sub=function(c,h){this._verify2(c,h);var p=c.sub(h);return p.cmpn(0)<0&&p.iadd(this.m),p._forceRed(this)},Y.prototype.isub=function(c,h){this._verify2(c,h);var p=c.isub(h);return p.cmpn(0)<0&&p.iadd(this.m),p},Y.prototype.shl=function(c,h){return this._verify1(c),this.imod(c.ushln(h))},Y.prototype.imul=function(c,h){return this._verify2(c,h),this.imod(c.imul(h))},Y.prototype.mul=function(c,h){return this._verify2(c,h),this.imod(c.mul(h))},Y.prototype.isqr=function(c){return this.imul(c,c.clone())},Y.prototype.sqr=function(c){return this.mul(c,c)},Y.prototype.sqrt=function(c){if(c.isZero())return c.clone();var h=this.m.andln(3);if(n(h%2===1),h===3){var p=this.m.add(new s(1)).iushrn(2);return this.pow(c,p)}for(var v=this.m.subn(1),w=0;!v.isZero()&&v.andln(1)===0;)w++,v.iushrn(1);n(!v.isZero());var M=new s(1).toRed(this),k=M.redNeg(),m=this.m.subn(1).iushrn(1),f=this.m.bitLength();for(f=new s(2*f*f).toRed(this);this.pow(f,m).cmp(k)!==0;)f.redIAdd(k);for(var E=this.pow(f,v),U=this.pow(c,v.addn(1).iushrn(1)),q=this.pow(c,v),R=w;q.cmp(M)!==0;){for(var T=q,$=0;T.cmp(M)!==0;$++)T=T.redSqr();n($<R);var V=this.pow(E,new s(1).iushln(R-$-1));U=U.redMul(V),E=V.redSqr(),q=q.redMul(E),R=$}return U},Y.prototype.invm=function(c){var h=c._invmp(this.m);return h.negative!==0?(h.negative=0,this.imod(h).redNeg()):this.imod(h)},Y.prototype.pow=function(c,h){if(h.isZero())return new s(1).toRed(this);if(h.cmpn(1)===0)return c.clone();var p=4,v=new Array(1<<p);v[0]=new s(1).toRed(this),v[1]=c;for(var w=2;w<v.length;w++)v[w]=this.mul(v[w-1],c);var M=v[0],k=0,m=0,f=h.bitLength()%26;for(f===0&&(f=26),w=h.length-1;w>=0;w--){for(var E=h.words[w],U=f-1;U>=0;U--){var q=E>>U&1;if(M!==v[0]&&(M=this.sqr(M)),q===0&&k===0){m=0;continue}k<<=1,k|=q,m++,!(m!==p&&(w!==0||U!==0))&&(M=this.mul(M,v[k]),m=0,k=0)}f=26}return M},Y.prototype.convertTo=function(c){var h=c.umod(this.m);return h===c?h.clone():h},Y.prototype.convertFrom=function(c){var h=c.clone();return h.red=null,h},s.mont=function(c){return new X(c)};function X(b){Y.call(this,b),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(X,Y),X.prototype.convertTo=function(c){return this.imod(c.ushln(this.shift))},X.prototype.convertFrom=function(c){var h=this.imod(c.mul(this.rinv));return h.red=null,h},X.prototype.imul=function(c,h){if(c.isZero()||h.isZero())return c.words[0]=0,c.length=1,c;var p=c.imul(h),v=p.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),w=p.isub(v).iushrn(this.shift),M=w;return w.cmp(this.m)>=0?M=w.isub(this.m):w.cmpn(0)<0&&(M=w.iadd(this.m)),M._forceRed(this)},X.prototype.mul=function(c,h){if(c.isZero()||h.isZero())return new s(0)._forceRed(this);var p=c.mul(h),v=p.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),w=p.isub(v).iushrn(this.shift),M=w;return w.cmp(this.m)>=0?M=w.isub(this.m):w.cmpn(0)<0&&(M=w.iadd(this.m)),M._forceRed(this)},X.prototype.invm=function(c){var h=this.imod(c._invmp(this.m).mul(this.r2));return h._forceRed(this)}})(t,J)}
1)(hc);var zs=hc.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 Bi={},dc={},Cr={},$p=Ni;Ni.default=Ni;Ni.stable=Of;Ni.stableStringify=Of;var Is="[...]",Tf="[Circular]",on=[],en=[];function Nf(){return{depthLimit:Number.MAX_SAFE_INTEGER,edgesLimit:Number.MAX_SAFE_INTEGER}}function Ni(t,e,r,n){typeof n>"u"&&(n=Nf()),Fa(t,"",0,[],void 0,0,n);var i;try{en.length===0?i=JSON.stringify(t,e,r):i=JSON.stringify(t,Lf(e),r)}catch{return JSON.stringify("[unable to serialize, circular reference is too complex to analyze]")}finally{for(;on.length!==0;){var s=on.pop();s.length===4?Object.defineProperty(s[0],s[1],s[3]):s[0][s[1]]=s[2]}}return i}function Fn(t,e,r,n){var i=Object.getOwnPropertyDescriptor(n,r);i.get!==void 0?i.configurable?(Object.defineProperty(n,r,{value:t}),on.push([n,r,e,i])):en.push([e,r,t]):(n[r]=t,on.push([n,r,e]))}function Fa(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){Fn(Tf,t,e,i);return}if(typeof o.depthLimit<"u"&&s>o.depthLimit){Fn(Is,t,e,i);return}if(typeof o.edgesLimit<"u"&&r+1>o.edgesLimit){Fn(Is,t,e,i);return}if(n.push(t),Array.isArray(t))for(a=0;a<t.length;a++)Fa(t[a],a,a,n,t,s,o);else{var u=Object.keys(t);for(a=0;a<u.length;a++){var l=u[a];Fa(t[l],l,a,n,t,s,o)}}n.pop()}}function Bp(t,e){return t<e?-1:t>e?1:0}function Of(t,e,r,n){typeof n>"u"&&(n=Nf());var i=Wa(t,"",0,[],void 0,0,n)||t,s;try{en.length===0?s=JSON.stringify(i,e,r):s=JSON.stringify(i,Lf(e),r)}catch{return JSON.stringify("[unable to serialize, circular reference is too complex to analyze]")}finally{for(;on.length!==0;){var o=on.pop();o.length===4?Object.defineProperty(o[0],o[1],o[3]):o[0][o[1]]=o[2]}}return s}function Wa(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){Fn(Tf,t,e,i);return}try{if(typeof t.toJSON=="function")return}catch{return}if(typeof o.depthLimit<"u"&&s>o.depthLimit){Fn(Is,t,e,i);return}if(typeof o.edgesLimit<"u"&&r+1>o.edgesLimit){Fn(Is,t,e,i);return}if(n.push(t),Array.isArray(t))for(a=0;a<t.length;a++)Wa(t[a],a,a,n,t,s,o);else{var u={},l=Object.keys(t).sort(Bp);for(a=0;a<l.length;a++){var d=l[a];Wa(t[d],d,a,n,t,s,o),u[d]=t[d]}if(typeof i<"u")on.push([i,e,t]),i[e]=u;else return u}n.pop()}}function Lf(t){return t=typeof t<"u"?t:function(e,r){return r},function(e,r){if(en.length>0)for(var n=0;n<en.length;n++){var i=en[n];if(i[1]===e&&i[0]===r){r=i[2],en.splice(n,1);break}}return t.call(this,e,r)}}Object.defineProperty(Cr,"__esModule",{value:!0});Cr.EthereumProviderError=Cr.EthereumRpcError=void 0;const jp=$p;class Pf 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 jp.default(this.serialize(),Hp,2)}}Cr.EthereumRpcError=Pf;class Fp extends Pf{constructor(e,r,n){if(!Wp(e))throw new Error('"code" must be an integer such that: 1000 <= code <= 4999');super(e,r,n)}}Cr.EthereumProviderError=Fp;function Wp(t){return Number.isInteger(t)&&t>=1e3&&t<=4999}function Hp(t,e){if(e!=="[Circular]")return e}var pc={},Rr={};
1Object.defineProperty(Rr,"__esModule",{value:!0});Rr.errorValues=Rr.errorCodes=void 0;Rr.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}};Rr.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=Rr,r=Cr,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,C=i){if(Number.isInteger(y)){const A=y.toString();if(g(e.errorValues,A))return e.errorValues[A].message;if(l(y))return t.JSON_RPC_SERVER_ERROR_MESSAGE}return C}t.getMessageFromCode=o;function a(y){if(!Number.isInteger(y))return!1;const C=y.toString();return!!(e.errorValues[C]||l(y))}t.isValidCode=a;function u(y,{fallbackError:C=s,shouldIncludeStack:A=!1}={}){var D,O;
1if(!C||!Number.isInteger(C.code)||typeof C.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 x={};if(y&&typeof y=="object"&&!Array.isArray(y)&&g(y,"code")&&a(y.code)){const N=y;x.code=N.code,N.message&&typeof N.message=="string"?(x.message=N.message,g(N,"data")&&(x.data=N.data)):(x.message=o(x.code),x.data={originalError:d(y)})}else{x.code=C.code;const N=(D=y)===null||D===void 0?void 0:D.message;x.message=N&&typeof N=="string"?N:C.message,x.data={originalError:d(y)}}const I=(O=y)===null||O===void 0?void 0:O.stack;return A&&y&&I&&typeof I=="string"&&(x.stack=I),x}t.serializeError=u;function l(y){return y>=-32099&&y<=-32e3}function d(y){return y&&typeof y=="object"&&!Array.isArray(y)?Object.assign({},y):y}function g(y,C){return Object.prototype.hasOwnProperty.call(y,C)}})(pc);var qs={};Object.defineProperty(qs,"__esModule",{value:!0});qs.ethErrors=void 0;const gc=Cr,Df=pc,dt=Rr;qs.ethErrors={rpc:{parse:t=>At(dt.errorCodes.rpc.parse,t),invalidRequest:t=>At(dt.errorCodes.rpc.invalidRequest,t),invalidParams:t=>At(dt.errorCodes.rpc.invalidParams,t),methodNotFound:t=>At(dt.errorCodes.rpc.methodNotFound,t),internal:t=>At(dt.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
1<= -32005');return At(e,t)},invalidInput:t=>At(dt.errorCodes.rpc.invalidInput,t),resourceNotFound:t=>At(dt.errorCodes.rpc.resourceNotFound,t),resourceUnavailable:t=>At(dt.errorCodes.rpc.resourceUnavailable,t),transactionRejected:t=>At(dt.errorCodes.rpc.transactionRejected,t),methodNotSupported:t=>At(dt.errorCodes.rpc.methodNotSupported,t),limitExceeded:t=>At(dt.errorCodes.rpc.limitExceeded,t)},provider:{userRejectedRequest:t=>yi(dt.errorCodes.provider.userRejectedRequest,t),unauthorized:t=>yi(dt.errorCodes.provider.unauthorized,t),unsupportedMethod:t=>yi(dt.errorCodes.provider.unsupportedMethod,t),disconnected:t=>yi(dt.errorCodes.provider.disconnected,t),chainDisconnected:t=>yi(dt.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 gc.EthereumProviderError(e,r,n)}}};function At(t,e){const[r,n]=$f(e);return new gc.EthereumRpcError(t,r||Df.getMessageFromCode(t),n)}function yi(t,e){const[r,n]=$f(e);return new gc.EthereumProviderError(t,r||Df.getMessageFromCode(t),n)}function $f(t){if(t){if(typeof t=="string")return[t];if(typeof t=="object"&&!Array.isArray(t)){const{message:e,data:r}=t;
1if(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=Cr;Object.defineProperty(t,"EthereumRpcError",{enumerable:!0,get:function(){return e.EthereumRpcError}}),Object.defineProperty(t,"EthereumProviderError",{enumerable:!0,get:function(){return e.EthereumProviderError}});const r=pc;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=Rr;Object.defineProperty(t,"errorCodes",{enumerable:!0,get:function(){return i.errorCodes}})})(dc);var _e={},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);
1Object.defineProperty(_e,"__esModule",{value:!0});_e.EthereumAddressFromSignedMessageResponse=_e.SubmitEthereumTransactionResponse=_e.SignEthereumTransactionResponse=_e.SignEthereumMessageResponse=_e.isRequestEthereumAccountsResponse=_e.SelectProviderResponse=_e.WatchAssetReponse=_e.RequestEthereumAccountsResponse=_e.SwitchEthereumChainResponse=_e.AddEthereumChainResponse=_e.isErrorResponse=void 0;const ar=Gs;function Vp(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}_e.isErrorResponse=Vp;function Up(t){return{method:ar.Web3Method.addEthereumChain,result:t}}_e.AddEthereumChainResponse=Up;function zp(t){return{method:ar.Web3Method.switchEthereumChain,result:t}}_e.SwitchEthereumChainResponse=zp;function qp(t){return{method:ar.Web3Method.requestEthereumAccounts,result:t}}_e.RequestEthereumAccountsResponse=qp;function Gp(t){return{method:ar.Web3Method.watchAsset,result:t}}_e.WatchAssetReponse=Gp;function Jp(t){return{method:ar.Web3Method.selectProvider,result:t}}_e.SelectProviderResponse=Jp;function Zp(t){return t&&t.method===ar.Web3Method.requestEthereumAccounts}_e.isRequestEthereumAccountsResponse=Zp;function Qp(t){return{method:ar.Web3Method.signEthereumMessage,result:t}}_e.SignEthereumMessageResponse=Qp;function Yp(t){return{method:ar.Web3Method.signEthereumTransaction,result:t}}_e.SignEthereumTransactionResponse=Yp;function Kp(t){return{method:ar.Web3Method.submitEthereumTransaction,result:t}}_e.SubmitEthereumTransactionResponse=Kp;function Xp(t){return{method:ar.Web3Method.ethereumAddressFromSignedMessage,result:t}}_e.EthereumAddressFromSignedMessageResponse=Xp;var ji={};Object.defineProperty(ji,"__esModule",{value:!0});ji.LIB_VERSION=void 0;ji.LIB_VERSION="3.7.1";(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.getErrorCode=t.serializeError=t.standardErrors=t.standardErrorMessage=t.standardErrorCodes=void 0;const e=dc,r=_e,n=ji;t.standardErrorCodes=Object.freeze(Object.assign(Object.assign({},e.errorCodes),{provider:Object.freeze(Object.assign(Object.assign({},e.errorCodes.provider),{unsupportedChain:4902}))}));function i(d){return d!==void 0?(0,e.getMessageFromCode)(d):"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:(d="")=>e.ethErrors.provider.custom({code:t.standardErrorCodes.provider.unsupportedChain,message:`Unrecognized chain ID ${d}. Try adding the chain using wallet_addEthereumChain first.`})}))}));function s(d,g){const y=(0,e.serializeError)(o(d),{shouldIncludeStack:!0}),C=new URL("https://docs.cloud.coinbase.com/wallet-sdk/docs/errors");C.searchParams.set("version",n.LIB_VERSION),C.searchParams.set("code",y.code.toString());const A=a(y.data,g);return A&&C.searchParams.set("method",A),C.searchParams.set("message",y.message),Object.assign(Object.assign({},y),{docUrl:C.href})}t.serializeError=s;function o(d){return typeof d=="string"?{message:d,code:t.standardErrorCodes.rpc.internal}:(0,r.isErrorResponse)(d)?Object.assign(Object.assign({},d),{message:d.errorMessage,code:d.errorCode,data:{method:d.method,result:d.result}}):d}function a(d,g){var y;const C=(y=d)===null||y===void 0?void 0:y.method;if(C)return C;if(g!==void 0)return typeof g=="string"?g:Array.isArray(g)?g.length>0?g[0].method:void 0:g.method}function u(d){var g;if(typeof d=="number")return d;
1if(l(d))return(g=d.code)!==null&&g!==void 0?g:d.errorCode}t.getErrorCode=u;function l(d){return typeof d=="object"&&d!==null&&(typeof d.code=="number"||typeof d.errorCode=="number")}})(Bi);var ai={},Bf={exports:{}},Ha={exports:{}};typeof Object.create=="function"?Ha.exports=function(e,r){r&&(e.super_=r,e.prototype=Object.create(r.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:Ha.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 zt=Ha.exports,Va={exports:{}};/*! safe-buffer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */(function(t,e){var r=Hs,n=r.Buffer;function i(o,a){for(var u in o)a[u]=o[u]}n.from&&n.alloc&&n.allocUnsafe&&n.allocUnsafeSlow?t.exports=r:(i(r,e),e.Buffer=s);function s(o,a,u){return n(o,a,u)}s.prototype=Object.create(n.prototype),i(n,s),s.from=function(o,a,u){if(typeof o=="number")throw new TypeError("Argument must not be a number");return n(o,a,u)},s.alloc=function(o,a,u){if(typeof o!="number")throw new TypeError("Argument must be a number");var l=n(o);return a!==void 0?typeof u=="string"?l.fill(a,u):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)}})(Va,Va.exports);var Tr=Va.exports,jf=Tr.Buffer;function Js(t,e){this._block=jf.alloc(t),this._finalSize=e,this._blockSize=t,this._len=0}Js.prototype.update=function(t,e){typeof t=="string"&&(e=e||"utf8",t=jf.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,u=Math.min(i-o,n-a),l=0;l<u;l++)r[a+l]=t[o+l];s+=u,o+=u,s%n===0&&this._update(r)}return this._len+=i,this};Js.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};Js.prototype._update=function(){throw new Error("_update must be implemented by subclass")};var ci=Js,e0=zt,Ff=ci,t0=Tr.Buffer,r0=[1518500249,1859775393,-1894007588,-899497514],n0=new Array(80);function Fi(){this.init(),this._w=n0,Ff.call(this,64,56)}e0(Fi,Ff);Fi.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this};function i0(t){return t<<5|t>>>27}function s0(t){return t<<30|t>>>2}function o0(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 u=0;u<80;++u){var l=~~(u/20),d=i0(r)+o0(l,n,i,s)+o+e[u]+r0[l]|0;o=s,s=i,i=s0(n),n=r,r=d}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};
1Fi.prototype._hash=function(){var t=t0.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 a0=Fi,c0=zt,Wf=ci,u0=Tr.Buffer,l0=[1518500249,1859775393,-1894007588,-899497514],f0=new Array(80);function Wi(){this.init(),this._w=f0,Wf.call(this,64,56)}c0(Wi,Wf);Wi.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this};function h0(t){return t<<1|t>>>31}function d0(t){return t<<5|t>>>27}function p0(t){return t<<30|t>>>2}function g0(t,e,r,n){return t===0?e&r|~e&n:t===2?e&r|e&n|r&n:e^r^n}Wi.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]=h0(e[a-3]^e[a-8]^e[a-14]^e[a-16]);for(var u=0;u<80;++u){var l=~~(u/20),d=d0(r)+g0(l,n,i,s)+o+e[u]+l0[l]|0;o=s,s=i,i=p0(n),n=r,r=d}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};Wi.prototype._hash=function(){var t=u0.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 b0=Wi,v0=zt,Hf=ci,y0=Tr.Buffer,m0=[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],w0=new Array(64);function Hi(){this.init(),this._w=w0,Hf.call(this,64,56)}v0(Hi,Hf);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 _0(t,e,r){return r^t&(e^r)}function S0(t,e,r){return t&e|r&(t|e)}function E0(t){return(t>>>2|t<<30)^(t>>>13|t<<19)^(t>>>22|t<<10)}function x0(t){return(t>>>6|t<<26)^(t>>>11|t<<21)^(t>>>25|t<<7)}function M0(t){return(t>>>7|t<<25)^(t>>>18|t<<14)^t>>>3}function C0(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,u=this._g|0,l=this._h|0,d=0;d<16;++d)e[d]=t.readInt32BE(d*4);for(;d<64;++d)e[d]=C0(e[d-2])+e[d-7]+M0(e[d-15])+e[d-16]|0;for(var g=0;g<64;++g){var y=l+x0(o)+_0(o,a,u)+m0[g]+e[g]|0,C=E0(r)+S0(r,n,i)|0;l=u,u=a,a=o,o=s+y|0,s=i,i=n,n=r,r=y+C|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=u+this._g|0,this._h=l+this._h|0};Hi.prototype._hash=function(){var t=y0.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 Vf=Hi,R0=zt,I0=Vf,A0=ci,k0=Tr.Buffer,T0=new Array(64);function Zs(){this.init(),this._w=T0,A0.call(this,64,56)}R0(Zs,I0);Zs.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};Zs.prototype._hash=function(){var t=k0.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 N0=Zs,O0=zt,Uf=ci,L0=Tr.Buffer,_u=[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,
11322822218,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],P0=new Array(160);function Vi(){this.init(),this._w=P0,Uf.call(this,128,112)}O0(Vi,Uf);Vi.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 Su(t,e,r){return r^t&(e^r)}function Eu(t,e,r){return t&e|r&(t|e)}function xu(t,e){return(t>>>28|e<<4)^(e>>>2|t<<30)^(e>>>7|t<<25)}function Mu(t,e){return(t>>>14|e<<18)^(t>>>18|e<<14)^(e>>>9|t<<23)}function D0(t,e){return(t>>>1|e<<31)^(t>>>8|e<<24)^t>>>7}function $0(t,e){return(t>>>1|e<<31)^(t>>>8|e<<24)^(t>>>7|e<<25)}function B0(t,e){return(t>>>19|e<<13)^(e>>>29|t<<3)^t>>>6}function j0(t,e){return(t>>>19|e<<13)^(e>>>29|t<<3)^(t>>>6|e<<26)}function it(t,e){return t>>>0<e>>>0?1:0}Vi.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,u=this._gh|0,l=this._hh|0,d=this._al|0,g=this._bl|0,y=this._cl|0,C=this._dl|0,A=this._el|0,D=this._fl|0,O=this._gl|0,x=this._hl|0,I=0;I<32;I+=2)e[I]=t.readInt32BE(I*4),e[I+1]=t.readInt32BE(I*4+4);for(;I<160;I+=2){var N=e[I-30],P=e[I-15*2+1],L=D0(N,P),B=$0(P,N);N=e[I-2*2],P=e[I-2*2+1];var G=B0(N,P),z=j0(P,N),W=e[I-7*2],K=e[I-7*2+1],Y=e[I-16*2],X=e[I-16*2+1],b=B+K|0,c=L+W+it(b,B)|0;b=b+z|0,c=c+G+it(b,z)|0,b=b+X|0,c=c+Y+it(b,X)|0,e[I]=c,e[I+1]=b}for(var h=0;h<160;h+=2){c=e[h],b=e[h+1];var p=Eu(r,n,i),v=Eu(d,g,y),w=xu(r,d),M=xu(d,r),k=Mu(o,A),m=Mu(A,o),f=_u[h],E=_u[h+1],U=Su(o,a,u),q=Su(A,D,O),R=x+m|0,T=l+k+it(R,x)|0;R=R+q|0,T=T+U+it(R,q)|0,R=R+E|0,T=T+f+it(R,E)|0,R=R+b|0,T=T+c+it(R,b)|0;var $=M+v|0,V=w+p+it($,M)|0;l=u,x=O,u=a,O=D,a=o,D=A,A=C+R|0,o=s+T+it(A,C)|0,s=i,C=y,i=n,y=g,n=r,g=d,d=R+$|0,r=T+V+it(d,R)|0}this._al=this._al+d|0,this._bl=this._bl+g|0,this._cl=this._cl+y|0,this._dl=this._dl+C|0,this._el=this._el+A|0,this._fl=this._fl+D|0,this._gl=this._gl+O|0,this._hl=this._hl+x|0,this._ah=this._ah+r+it(this._al,d)|0,this._bh=this._bh+n+it(this._bl,g)|0,this._ch=this._ch+i+it(this._cl,y)|0,this._dh=this._dh+s+it(this._dl,C)|0,this._eh=this._eh+o+it(this._el,A)|0,this._fh=this._fh+a+it(this._fl,D)|0,this._gh=this._gh+u+it(this._gl,O)|0,this._hh=this._hh+l+it(this._hl,x)|0};Vi.prototype._hash=function(){var t=L0.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 zf=Vi,F0=zt,W0=zf,H0=ci,V0=Tr.Buffer,U0=new Array(160);function Qs(){this.init(),this._w=U0,H0.call(this,128,112)}F0(Qs,W0);Qs.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};Qs.prototype._hash=function(){var t=V0.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 z0=Qs,dn=Bf.exports=function(e){e=e.toLowerCase();var r=dn[e];if(!r)throw new Error(e+" is not supported (we accept pull requests)");return new r};dn.sha=a0;dn.sha1=b0;dn.sha224=N0;dn.sha256=Vf;dn.sha384=z0;dn.sha512=zf;var q0=Bf.exports,Z={},G0=function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var e={},r=Symbol("test"),n=Object(r);if(typeof r=="string"||Object.prototype.toString.call(r)!=="[object Symbol]"||Object.prototype.toString.call(n)!=="[object Symbol]")return!1;var i=42;e[r]=i;for(r in e)return!1;if(typeof Object.keys=="function"&&Object.keys(e).length!==0||typeof Object.getOwnPropertyNames=="function"&&Object.getOwnPropertyNames(e).length!==0)return!1;var s=Object.getOwnPropertySymbols(e);if(s.length!==1||s[0]!==r||!Object.prototype.propertyIsEnumerable.call(e,r))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var o=Object.getOwnPropertyDescriptor(e,r);if(o.value!==i||o.enumerable!==!0)return!1}return!0},Cu=typeof Symbol<"u"&&Symbol,J0=G0,Z0=function(){return typeof Cu!="function"||typeof Symbol!="function"||typeof Cu("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:J0()},Ru={foo:{}},Q0=Object,Y0=function(){return{__proto__:Ru}.foo===Ru.foo&&!({__proto__:null}instanceof Q0)},K0="Function.prototype.bind called on incompatible ",Yo=Array.prototype.slice,X0=Object.prototype.toString,eg="[object Function]",tg=function(e){var r=this;if(typeof r!="function"||X0.call(r)!==eg)throw new TypeError(K0+r);
1for(var n=Yo.call(arguments,1),i,s=function(){if(this instanceof i){var d=r.apply(this,n.concat(Yo.call(arguments)));return Object(d)===d?d:this}else return r.apply(e,n.concat(Yo.call(arguments)))},o=Math.max(0,r.length-n.length),a=[],u=0;u<o;u++)a.push("$"+u);if(i=Function("binder","return function ("+a.join(",")+"){ return binder.apply(this,arguments); }")(s),r.prototype){var l=function(){};l.prototype=r.prototype,i.prototype=new l,l.prototype=null}return i},rg=tg,bc=Function.prototype.bind||rg,ng=bc,ig=ng.call(Function.call,Object.prototype.hasOwnProperty),ue,Gn=SyntaxError,qf=Function,Wn=TypeError,Ko=function(t){try{return qf('"use strict"; return ('+t+").constructor;")()}catch{}},nn=Object.getOwnPropertyDescriptor;if(nn)try{nn({},"")}catch{nn=null}var Xo=function(){throw new Wn},sg=nn?function(){try{return arguments.callee,Xo}catch{try{return nn(arguments,"callee").get}catch{return Xo}}}():Xo,kn=Z0(),og=Y0(),at=Object.getPrototypeOf||(og?function(t){return t.__proto__}:null),Dn={},ag=typeof Uint8Array>"u"||!at?ue:at(Uint8Array),sn={"%AggregateError%":typeof AggregateError>"u"?ue:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?ue:ArrayBuffer,"%ArrayIteratorPrototype%":kn&&at?at([][Symbol.iterator]()):ue,"%AsyncFromSyncIteratorPrototype%":ue,"%AsyncFunction%":Dn,"%AsyncGenerator%":Dn,"%AsyncGeneratorFunction%":Dn,"%AsyncIteratorPrototype%":Dn,"%Atomics%":typeof Atomics>"u"?ue:Atomics,"%BigInt%":typeof BigInt>"u"?ue:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?ue:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?ue:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?ue:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":Error,"%eval%":eval,"%EvalError%":EvalError,"%Float32Array%":typeof Float32Array>"u"?ue:Float32Array,"%Float64Array%":typeof Float64Array>"u"?ue:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?ue:FinalizationRegistry,"%Function%":qf,"%GeneratorFunction%":Dn,"%Int8Array%":typeof Int8Array>"u"?ue:Int8Array,"%Int16Array%":typeof Int16Array>"u"?ue:Int16Array,"%Int32Array%":typeof Int32Array>
vendor: 4,741 bytes, line 1
1"u"?ue:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":kn&&at?at(at([][Symbol.iterator]())):ue,"%JSON%":typeof JSON=="object"?JSON:ue,"%Map%":typeof Map>"u"?ue:Map,"%MapIteratorPrototype%":typeof Map>"u"||!kn||!at?ue:at(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?ue:Promise,"%Proxy%":typeof Proxy>"u"?ue:Proxy,"%RangeError%":RangeError,"%ReferenceError%":ReferenceError,"%Reflect%":typeof Reflect>"u"?ue:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?ue:Set,"%SetIteratorPrototype%":typeof Set>"u"||!kn||!at?ue:at(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?ue:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":kn&&at?at(""[Symbol.iterator]()):ue,"%Symbol%":kn?Symbol:ue,"%SyntaxError%":Gn,"%ThrowTypeError%":sg,"%TypedArray%":ag,"%TypeError%":Wn,"%Uint8Array%":typeof Uint8Array>"u"?ue:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?ue:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?ue:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?ue:Uint32Array,"%URIError%":URIError,"%WeakMap%":typeof WeakMap>"u"?ue:WeakMap,"%WeakRef%":typeof WeakRef>"u"?ue:WeakRef,"%WeakSet%":typeof WeakSet>"u"?ue:WeakSet};if(at)try{null.error}catch(t){var cg=at(at(t));sn["%Error.prototype%"]=cg}var ug=function t(e){var r;if(e==="%AsyncFunction%")r=Ko("async function () {}");else if(e==="%GeneratorFunction%")r=Ko("function* () {}");else if(e==="%AsyncGeneratorFunction%")r=Ko("async function* () {}");else if(e==="%AsyncGenerator%"){var n=t("%AsyncGeneratorFunction%");n&&(r=n.prototype)}else if(e==="%AsyncIteratorPrototype%"){var i=t("%AsyncGenerator%");i&&at&&(r=at(i.prototype))}return sn[e]=r,r},Iu={"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},Ui=bc,As=ig,lg=Ui.call(Function.call,Array.prototype.concat),fg=Ui.call(Function.apply,Array.prototype.splice),Au=Ui.call(Function.call,String.prototype.replace),ks=Ui.call(Function.call,String.prototype.slice),hg=Ui.call(Function.call,RegExp.prototype.exec),dg=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,pg=/\\(\\)?/g,gg=function(e){var r=ks(e,0,1),n=ks(e,-1);
1if(r==="%"&&n!=="%")throw new Gn("invalid intrinsic syntax, expected closing `%`");if(n==="%"&&r!=="%")throw new Gn("invalid intrinsic syntax, expected opening `%`");var i=[];return Au(e,dg,function(s,o,a,u){i[i.length]=a?Au(u,pg,"$1"):o||s}),i},bg=function(e,r){var n=e,i;if(As(Iu,n)&&(i=Iu[n],n="%"+i[0]+"%"),As(sn,n)){var s=sn[n];if(s===Dn&&(s=ug(n)),typeof s>"u"&&!r)throw new Wn("intrinsic "+e+" exists, but is not available. Please file an issue!");return{alias:i,name:n,value:s}}throw new Gn("intrinsic "+e+" does not exist!")},vc=function(e,r){if(typeof e!="string"||e.length===0)throw new Wn("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof r!="boolean")throw new Wn('"allowMissing" argument must be a boolean');if(hg(/^%?[^%]*%?$/,e)===null)throw new Gn("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var n=gg(e),i=n.length>0?n[0]:"",s=bg("%"+i+"%",r),o=s.name,a=s.value,u=!1,l=s.alias;l&&(i=l[0],fg(n,lg([0,1],l)));for(var d=1,g=!0;d<n.length;d+=1){var y=n[d],C=ks(y,0,1),A=ks(y,-1);if((C==='"'||C==="'"||C==="`"||A==='"'||A==="'"||A==="`")&&C!==A)throw new Gn("property names with quotes must have matching quotes");if((y==="constructor"||!g)&&(u=!0),i+="."+y,o="%"+i+"%",As(sn,o))a=sn[o];else if(a!=null){if(!(y in a)){if(!r)throw new Wn("base intrinsic for "+e+" exists, but the property is not available.");return}if(nn&&d+1>=n.length){var D=nn(a,y);g=!!D,g&&"get"in D&&!("originalValue"in D.get)?a=D.get:a=a[y]}else g=As(a,y),a=a[y];g&&!u&&(sn[o]=a)}}return a},Gf={exports:{}};(function(t){var e=bc,r=vc,n=r("%Function.prototype.apply%"),i=r("%Function.prototype.call%"),s=r("%Reflect.apply%",!0)||e.call(i,n),o=r("%Object.getOwnPropertyDescriptor%",!0),a=r("%Object.defineProperty%",!0),u=r("%Math.max%");if(a)try{a({},"a",{value:1})}catch{a=null}t.exports=function(g){var y=s(e,i,arguments);if(o&&a){var C=o(y,"length");C.configurable&&a(y,"length",{value:1+u(0,g.length-(arguments.length-1))})}return y};var l=function(){return s(e,n,arguments)};a?a(t.exports,"apply",{value:l}):t.exports.apply=l})(Gf);var vg=Gf.exports,Jf=vc,Zf=vg,yg=Zf(Jf("String.prototype.indexOf")),mg=function(e,r){var n=Jf(e,!!r);return typeof n=="function"&&yg(e,".prototype.")>-1?Zf(n):n},yc=typeof Map=="function"&&Map.prototype,ea=Object.getOwnPropertyDescriptor&&yc?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,Ts=yc&&ea&&typeof ea.get=="function"?ea.get:null,ku=yc&&Map.prototype.forEach,mc=typeof Set=="function"&&Set.prototype,ta=Object.getOwnPropertyDescriptor&&mc?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,Ns=mc&&ta&&typeof ta.get=="function"?ta.get:null,Tu=mc&&Set.prototype.forEach,wg=typeof WeakMap=="function"&&WeakMap.prototype,Mi=wg?WeakMap.prototype.has:null,_g=typeof WeakSet=="function"&&WeakSet.prototype,Ci=_g?WeakSet.prototype.has:null,Sg=typeof WeakRef=="function"&&WeakRef.prototype,Nu=Sg?WeakRef.prototype.deref:null,Eg=Boolean.prototype.valueOf,xg=Object.prototype.toString,Mg=Function.prototype.toString,Cg=String.prototype.match,wc=String.prototype.slice,xr=String.prototype.replace,Rg=String.prototype.toUpperCase,Ou=String.prototype.toLowerCase,Qf=RegExp.prototype.test,Lu=Array.prototype.concat,tr=Array.prototype.join,Ig=Array.prototype.slice,Pu=Math.floor,Ua=typeof BigInt=="function"?BigInt.prototype.valueOf:null,ra=Object.getOwnPropertySymbols,za=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Symbol.prototype.toString:null,Jn=typeof Symbol=="function"&&typeof Symbol.iterator=="object",bt=typeof Symbol=="function"&&Symbol.toStringTag&&(typeof Symbol.toStringTag===Jn||"symbol")?Symbol.toStringTag:null,Yf=Object.prototype.propertyIsEnumerable,Du=(typeof Reflect=="function"?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(t){return t.__proto__}:null);function $u(t,e){if(t===1/0||t===-1/0||t!==t||t&&t>-1e3&&t<1e3||Qf.call(/e/,e))return e;var r=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if(typeof t=="number"){var n=t<0?-Pu(-t):Pu(t);if(n!==t){var i=String(n),s=wc.call(e,i.length+1);return xr.call(i,r,"$&_")+"."+xr.call(xr.call(s,/([0-9]{3})/g,"$&_"),/_$/,"")}}return xr.call(e,r,"$&_")}var qa=Ws,Bu=qa.custom,ju=Xf(Bu)?Bu:null,Ag=function t(e,r,n,i){var s=r||{};if(_r(s,"quoteStyle")&&s.quoteStyle!=="single"&&s.quoteStyle!=="double")throw new TypeError('option "quoteStyle" must be "single" or "double"');if(_r(s,"maxStringLength")&&(typeof s.maxStringLength=="number"?s.maxStringLength<0&&s.maxStringLength!==1/0:s.maxStringLength!==null))throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var o=_r(s,"customInspect")?s.customInspect:!0;if(typeof o!="boolean"&&o!=="symbol")throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");
vendor: 6,596 bytes, lines 1-4
1if(_r(s,"indent")&&s.indent!==null&&s.indent!==" "&&!(parseInt(s.indent,10)===s.indent&&s.indent>0))throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');if(_r(s,"numericSeparator")&&typeof s.numericSeparator!="boolean")throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');var a=s.numericSeparator;if(typeof e>"u")return"undefined";if(e===null)return"null";if(typeof e=="boolean")return e?"true":"false";if(typeof e=="string")return th(e,s);if(typeof e=="number"){if(e===0)return 1/0/e>0?"0":"-0";var u=String(e);return a?$u(e,u):u}if(typeof e=="bigint"){var l=String(e)+"n";return a?$u(e,l):l}var d=typeof s.depth>"u"?5:s.depth;if(typeof n>"u"&&(n=0),n>=d&&d>0&&typeof e=="object")return Ga(e)?"[Array]":"[Object]";var g=Gg(s,n);if(typeof i>"u")i=[];else if(eh(i,e)>=0)return"[Circular]";function y(b,c,h){if(c&&(i=Ig.call(i),i.push(c)),h){var p={depth:s.depth};return _r(s,"quoteStyle")&&(p.quoteStyle=s.quoteStyle),t(b,p,n+1,i)}return t(b,s,n+1,i)}if(typeof e=="function"&&!Fu(e)){var C=Bg(e),A=us(e,y);return"[Function"+(C?": "+C:" (anonymous)")+"]"+(A.length>0?" { "+tr.call(A,", ")+" }":"")}if(Xf(e)){var D=Jn?xr.call(String(e),/^(Symbol\(.*\))_[^)]*$/,"$1"):za.call(e);return typeof e=="object"&&!Jn?mi(D):D}if(Ug(e)){for(var O="<"+Ou.call(String(e.nodeName)),x=e.attributes||[],I=0;I<x.length;I++)O+=" "+x[I].name+"="+Kf(kg(x[I].value),"double",s);return O+=">",e.childNodes&&e.childNodes.length&&(O+="..."),O+="</"+Ou.call(String(e.nodeName))+">",O}if(Ga(e)){if(e.length===0)return"[]";var N=us(e,y);return g&&!qg(N)?"["+Ja(N,g)+"]":"[ "+tr.call(N,", ")+" ]"}if(Ng(e)){var P=us(e,y);return!("cause"in Error.prototype)&&"cause"in e&&!Yf.call(e,"cause")?"{ ["+String(e)+"] "+tr.call(Lu.call("[cause]: "+y(e.cause),P),", ")+" }":P.length===0?"["+String(e)+"]":"{ ["+String(e)+"] "+tr.call(P,", ")+" }"}if(typeof e=="object"&&o){if(ju&&typeof e[ju]=="function"&&qa)return qa(e,{depth:d-n});if(o!=="symbol"&&typeof e.inspect=="function")return e.inspect()}if(jg(e)){var L=[];return ku&&ku.call(e,function(b,c){L.push(y(c,e,!0)+" => "+y(b,e))}),Wu("Map",Ts.call(e),L,g)}if(Hg(e)){var B=[];return Tu&&Tu.call(e,function(b){B.push(y(b,e))}),Wu("Set",Ns.call(e),B,g)}if(Fg(e))return na("WeakMap");if(Vg(e))return na("WeakSet");if(Wg(e))return na("WeakRef");if(Lg(e))return mi(y(Number(e)));if(Dg(e))return mi(y(Ua.call(e)));if(Pg(e))return mi(Eg.call(e));if(Og(e))return mi(y(String(e)));if(!Tg(e)&&!Fu(e)){var G=us(e,y),z=Du?Du(e)===Object.prototype:e instanceof Object||e.constructor===Object,W=e instanceof Object?"":"null prototype",K=!z&&bt&&Object(e)===e&&bt in e?wc.call(Nr(e),8,-1):W?"Object":"",Y=z||typeof e.constructor!="function"?"":e.constructor.name?e.constructor.name+" ":"",X=Y+(K||W?"["+tr.call(Lu.call([],K||[],W||[]),": ")+"] ":"");return G.length===0?X+"{}":g?X+"{"+Ja(G,g)+"}":X+"{ "+tr.call(G,", ")+" }"}return String(e)};function Kf(t,e,r){var n=(r.quoteStyle||e)==="double"?'"':"'";return n+t+n}function kg(t){return xr.call(String(t),/"/g,""")}function Ga(t){return Nr(t)==="[object Array]"&&(!bt||!(typeof t=="object"&&bt in t))}function Tg(t){return Nr(t)==="[object Date]"&&(!bt||!(typeof t=="object"&&bt in t))}function Fu(t){return Nr(t)==="[object RegExp]"&&(!bt||!(typeof t=="object"&&bt in t))}function Ng(t){return Nr(t)==="[object Error]"&&(!bt||!(typeof t=="object"&&bt in t))}function Og(t){return Nr(t)==="[object String]"&&(!bt||!(typeof t=="object"&&bt in t))}function Lg(t){return Nr(t)==="[object Number]"&&(!bt||!(typeof t=="object"&&bt in t))}function Pg(t){return Nr(t)==="[object Boolean]"&&(!bt||!(typeof t=="object"&&bt in t))}function Xf(t){if(Jn)return t&&typeof t=="object"&&t instanceof Symbol;if(typeof t=="symbol")return!0;if(!t||typeof t!="object"||!za)return!1;try{return za.call(t),!0}catch{}return!1}function Dg(t){if(!t||typeof t!="object"||!Ua)return!1;try{return Ua.call(t),!0}catch{}return!1}var $g=Object.prototype.hasOwnProperty||function(t){return t in this};function _r(t,e){return $g.call(t,e)}function Nr(t){return xg.call(t)}function Bg(t){if(t.name)return t.name;var e=Cg.call(Mg.call(t),/^function\s*([\w$]+)/);return e?e[1]:null}function eh(t,e){if(t.indexOf)return t.indexOf(e);for(var r=0,n=t.length;r<n;r++)if(t[r]===e)return r;return-1}function jg(t){if(!Ts||!t||typeof t!="object")return!1;try{Ts.call(t);try{Ns.call(t)}catch{return!0}return t instanceof Map}catch{}return!1}function Fg(t){if(!Mi||!t||typeof t!="object")return!1;try{Mi.call(t,Mi);try{Ci.call(t,Ci)}catch{return!0}return t instanceof WeakMap}catch{}return!1}function Wg(t){if(!Nu||!t||typeof t!="object")return!1;try{return Nu.call(t),!0}catch{}return!1}function Hg(t){if(!Ns||!t||typeof t!="object")return!1;try{Ns.call(t);try{Ts.call(t)}catch{return!0}return t instanceof Set}catch{}return!1}function Vg(t){if(!Ci||!t||typeof t!="object")return!1;try{Ci.call(t,Ci);try{Mi.call(t,Mi)}catch{return!0}return t instanceof WeakSet}catch{}return!1}function Ug(t){return!t||typeof t!="object"?!1:typeof HTMLElement<"u"&&t instanceof HTMLElement?!0:typeof t.nodeName=="string"&&typeof t.getAttribute=="function"}function th(t,e){if(t.length>e.maxStringLength){var r=t.length-e.maxStringLength,n="... "+r+" more character"+(r>1?"s":"");return th(wc.call(t,0,e.maxStringLength),e)+n}var i=xr.call(xr.call(t,/(['\\])/g,"\\$1"),/[\x00-\x1f]/g,zg);return Kf(i,"single",e)}function zg(t){var e=t.charCodeAt(0),r={8:"b",9:"t",10:"n",12:"f",13:"r"}[e];return r?"\\"+r:"\\x"+(e<16?"0":"")+Rg.call(e.toString(16))}function mi(t){return"Object("+t+")"}function na(t){return t+" { ? }"}function Wu(t,e,r,n){var i=n?Ja(r,n):tr.call(r,", ");return t+" ("+e+") {"+i+"}"}function qg(t){for(var e=0;e<t.length;e++)if(eh(t[e],` 2`)>=0)return!1;return!0}function Gg(t,e){var r;if(t.indent===" ")r=" ";else if(typeof t.indent=="number"&&t.indent>0)r=tr.call(Array(t.indent+1)," ");else return null;return{base:r,prev:tr.call(Array(e+1),r)}}function Ja(t,e){if(t.length===0)return"";var r=` 3`+e.prev+e.base;return r+tr.call(t,","+r)+` 4`+e.prev}function us(t,e){var r=Ga(t),n=[];if(r){n.length=t.length;for(var i=0;i<t.length;i++)n[i]=_r(t,i)?e(t[i],t):""}var s=typeof ra=="function"?ra(t):[],o;if(Jn){o={};for(var a=0;a<s.length;a++)o["$"+s[a]]=s[a]}for(var u in t)_r(t,u)&&(r&&String(Number(u))===u&&u<t.length||Jn&&o["$"+u]instanceof Symbol||(Qf.call(/[^\w$]/,u)?n.push(e(u,t)+": "+e(t[u],t)):n.push(u+": "+e(t[u],t))));if(typeof ra=="function")for(var l=0;l<s.length;l++)Yf.call(t,s[l])&&n.push("["+e(s[l])+"]: "+e(t[s[l]],t));return n}var _c=vc,ui=mg,Jg=Ag,Zg=_c("%TypeError%"),ls=_c("%WeakMap%",!0),fs=_c("%M
4ap%",!0),Qg=ui("WeakMap.prototype.get",!0),Yg=ui("WeakMap.prototype.set",!0),Kg=ui("WeakMap.prototype.has",!0),Xg=ui("Map.prototype.get",!0),eb=ui("Map.prototype.set",!0),tb=ui("Map.prototype.has",!0),Sc=function(t,e){for(var r=t,n;(n=r.next)!==null;r=n)if(n.key===e)return r.next=n.next,n.next=t.next,t.next=n,n},rb=function(t,e){var r=Sc(t,e);return r&&r.value},nb=function(t,e,r){var n=Sc(t,e);n?n.value=r:t.next={key:e,next:t.next,value:r}},ib=function(t,e){return!!Sc(t,e)},sb=function(){var e,r,n,i={assert:function(s){if(!i.has(s))throw new Zg("Side channel does not contain "+Jg(s))},get:function(s){if(ls&&s&&(typeof s=="object"||typeof s=="function")){if(e)return Qg(e,s)}else if(fs){if(r)return Xg(r,s)}else if(n)return rb(n,s)},has:function(s){if(ls&&s&&(typeof s=="object"||typeof s=="function")){if(e)return Kg(e,s)}else if(fs){if(r)return tb(r,s)}else if(n)return ib(n,s);return!1},set:function(s,o){ls&&s&&(typeof s=="object"||typeof s=="function")?(e||(e=new ls),Yg(e,s,o)):fs?(r||(r=new fs),eb(r,s,o)):(n||(n={key:{},next:null}),nb(n,s,o))}};return i},ob=String.prototype.replace,ab=/%20/g,ia={RFC1738:"RFC1738",RFC3986:"RFC3986"},Ec={default:ia.RFC3986,formatters:{RFC1738:function(t){return ob.call(t,ab,"+")},RFC3986:function(t){return String(t)}},RFC1738:ia.RFC1738,RFC3986:ia.RFC3986},cb=Ec,sa=Object.prototype.hasOwnProperty,Qr=Array.isArray,Zt=function(){for(var t=[],e=0;e<256;++e)t.push("%"+((e<16?"0":"")+e.toString(16)).toUpperCase());return t}(),ub=function(e){for(;e.length>1;){var r=e.pop(),n=r.obj[r.prop];if(Qr(n)){for(var i=[],s=0;s<n.length;++s)typeof n[s]<"u"&&i.push(n[s]);r.obj[r.prop]=i}}},rh=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},lb=function t(e,r,n){if(!r)return e;if(typeof r!="object"){if(Qr(e))e.push(r);else if(e&&typeof e=="object")(n&&(n.plainObjects||n.allowPrototypes)||!sa.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 Qr(e)&&!Qr(r)&&(i=rh(e,n)),Qr(e)&&Qr(r)?(r.forEach(function(s,o){if(sa.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 sa.call(s,o)?s[o]=t(s[o],a,n):s[o]=a,s},i)},fb=function(e,r){return Object.keys(r).reduce(function(n,i){return n[i]=r[i],n},e)},hb=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}},db=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(d){return"%26%23"+parseInt(d.slice(2),16)+"%3B"});for(var a="",u=0;u<o.length;++u){var l=o.charCodeAt(u);if(l===45||l===46||l===95||l===126||l>=48&&l<=57||l>=65&&l<=90||l>=97&&l<=122||s===cb.RFC1738&&(l===40||l===41)){a+=o.charAt(u);continue}if(l<128){a=a+Zt[l];continue}if(l<2048){a=a+(Zt[192|l>>6]+Zt[128|l&63]);continue}if(l<55296||l>=57344){a=a+(Zt[224|l>>12]+Zt[128|l>>6&63]+Zt[128|l&63]);continue}u+=1,l=65536+((l&1023)<<10|o.charCodeAt(u)&1023),a+=Zt[240|l>>18]+Zt[128|l>>12&63]+Zt[128|l>>6&63]+Zt[128|l&63]}return a},pb=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),u=0;u<a.length;++u){var l=a[u],d=o[l];typeof d=="object"&&d!==null&&n.indexOf(d)===-1&&(r.push({obj:o,prop:l}),n.push(d))}return ub(r),e},gb=function(e){return Object.prototype.toString.call(e)==="[object RegExp]"},bb=function(e){return!e||typeof e!="object"?!1:!!(e.constructor&&e.constructor.isBuffer&&e.constructor.isBuffer(e))},vb=function(e,r){return[].concat(e,r)},yb=function(e,r){if(Qr(e)){for(var n=[],i=0;i<e.length;i+=1)n.push(r(e[i]));return n}return r(e)},nh={arrayToObject:rh,assign:fb,combine:vb,compact:pb,decode:hb,encode:db,isBuffer:bb,isRegExp:gb,maybeMap:yb,merge:lb},ih=sb,xs=nh,Ri=Ec,mb=Object.prototype.hasOwnProperty,Hu={brackets:function(e){return e+"[]"},comma:"comma",indices:function(e,r){return e+"["+r+"]"},repeat:function(e){return e}},fr=Array.isArray,wb=Array.prototype.push,sh=function(t,e){wb.apply(t,fr(e)?e:[e])},_b=Date.prototype.toISOString,Vu=Ri.default,gt={addQueryPrefix:!1,allowDots:!1,charset:"utf-8",charsetSentinel:!1,delimiter:"&",encode:!0,encoder:xs.encode,encodeValuesOnly:!1,format:Vu,formatter:
4Ri.formatters[Vu],indices:!1,serializeDate:function(e){return _b.call(e)},skipNulls:!1,strictNullHandling:!1},Sb=function(e){return typeof e=="string"||typeof e=="number"||typeof e=="boolean"||typeof e=="symbol"||typeof e=="bigint"},oa={},Eb=function t(e,r,n,i,s,o,a,u,l,d,g,y,C,A,D,O){for(var x=e,I=O,N=0,P=!1;(I=I.get(oa))!==void 0&&!P;){var L=I.get(e);if(N+=1,typeof L<"u"){if(L===N)throw new RangeError("Cyclic object value");P=!0}typeof I.get(oa)>"u"&&(N=0)}if(typeof u=="function"?x=u(r,x):x instanceof Date?x=g(x):n==="comma"&&fr(x)&&(x=xs.maybeMap(x,function(p){return p instanceof Date?g(p):p})),x===null){if(s)return a&&!A?a(r,gt.encoder,D,"key",y):r;x=""}if(Sb(x)||xs.isBuffer(x)){if(a){var B=A?r:a(r,gt.encoder,D,"key",y);return[C(B)+"="+C(a(x,gt.encoder,D,"value",y))]}return[C(r)+"="+C(String(x))]}var G=[];if(typeof x>"u")return G;var z;if(n==="comma"&&fr(x))A&&a&&(x=xs.maybeMap(x,a)),z=[{value:x.length>0?x.join(",")||null:void 0}];else if(fr(u))z=u;else{var W=Object.keys(x);z=l?W.sort(l):W}for(var K=i&&fr(x)&&x.length===1?r+"[]":r,Y=0;Y<z.length;++Y){var X=z[Y],b=typeof X=="object"&&typeof X.value<"u"?X.value:x[X];if(!(o&&b===null)){var c=fr(x)?typeof n=="function"?n(K,X):K:K+(d?"."+X:"["+X+"]");O.set(e,N);var h=ih();h.set(oa,O),sh(G,t(b,c,n,i,s,o,n==="comma"&&A&&fr(x)?null:a,u,l,d,g,y,C,A,D,h))}}return G},xb=function(e){if(!e)return gt;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||gt.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=Ri.default;if(typeof e.format<"u"){if(!mb.call(Ri.formatters,e.format))throw new TypeError("Unknown format option provided.");n=e.format}var i=Ri.formatters[n],s=gt.filter;return(typeof e.filter=="function"||fr(e.filter))&&(s=e.filter),{addQueryPrefix:typeof e.addQueryPrefix=="boolean"?e.addQueryPrefix:gt.addQueryPrefix,allowDots:typeof e.allowDots>"u"?gt.allowDots:!!e.allowDots,charset:r,charsetSentinel:typeof e.charsetSentinel=="boolean"?e.charsetSentinel:gt.charsetSentinel,delimiter:typeof e.delimiter>"u"?gt.delimiter:e.delimiter,encode:typeof e.encode=="boolean"?e.encode:gt.encode,encoder:typeof e.encoder=="function"?e.encoder:gt.encoder,encodeValuesOnly:typeof e.encodeValuesOnly=="boolean"?e.encodeValuesOnly:gt.encodeValuesOnly,filter:s,format:n,formatter:i,serializeDate:typeof e.serializeDate=="function"?e.serializeDate:gt.serializeDate,skipNulls:typeof e.skipNulls=="boolean"?e.skipNulls:gt.skipNulls,sort:typeof e.sort=="function"?e.sort:null,strictNullHandling:typeof e.strictNullHandling=="boolean"?e.strictNullHandling:gt.strictNullHandling}},Mb=function(t,e){var r=t,n=xb(e),i,s;typeof n.filter=="function"?(s=n.filter,r=s("",r)):fr(n.filter)&&(s=n.filter,i=s);var o=[];if(typeof r!="object"||r===null)return"";var a;e&&e.arrayFormat in Hu?a=e.arrayFormat:e&&"indices"in e?a=e.indices?"indices":"repeat":a="indices";var u=Hu[a];if(e&&"commaRoundTrip"in e&&typeof e.commaRoundTrip!="boolean")throw new TypeError("`commaRoundTrip` must be a boolean, or absent");var l=u==="comma"&&e&&e.commaRoundTrip;i||(i=Object.keys(r)),n.sort&&i.sort(n.sort);for(var d=ih(),g=0;g<i.length;++g){var y=i[g];n.skipNulls&&r[y]===null||sh(o,Eb(r[y],y,u,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,d))}var C=o.join(n.delimiter),A=n.addQueryPrefix===!0?"?":"";return n.charsetSentinel&&(n.charset==="iso-8859-1"?A+="utf8=%26%2310003%3B&":A+="utf8=%E2%9C%93&"),C.length>0?A+C:""},Zn=nh,Za=Object.prototype.hasOwnProperty,Cb=Array.isArray,st={allowDots:!1,allowPrototypes:!1,allowSparse:!1,arrayLimit:20,charset:"utf-8",charsetSentinel:!1,comma:!1,decoder:Zn.decode,delimiter:"&",depth:5,ignoreQueryPrefix:!1,interpretNumericEntities:!1,parameterLimit:1e3,parseArrays:!0,plainObjects:!1,strictNullHandling:!1},Rb=function(t){return t.replace(/&#(\d+);/g,function(e,r){return String.fromCharCode(parseInt(r,10))})},oh=function(t,e){return t&&typeof t=="string"&&e.comma&&t.indexOf(",")>-1?t.split(","):t},Ib="utf8=%26%2310003%3B",Ab="utf8=%E2%9C%93",kb=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,u,l=r.charset;if(r.charsetSentinel)for(u=0;
4u<o.length;++u)o[u].indexOf("utf8=")===0&&(o[u]===Ab?l="utf-8":o[u]===Ib&&(l="iso-8859-1"),a=u,u=o.length);for(u=0;u<o.length;++u)if(u!==a){var d=o[u],g=d.indexOf("]="),y=g===-1?d.indexOf("="):g+1,C,A;y===-1?(C=r.decoder(d,st.decoder,l,"key"),A=r.strictNullHandling?null:""):(C=r.decoder(d.slice(0,y),st.decoder,l,"key"),A=Zn.maybeMap(oh(d.slice(y+1),r),function(D){return r.decoder(D,st.decoder,l,"value")})),A&&r.interpretNumericEntities&&l==="iso-8859-1"&&(A=Rb(A)),d.indexOf("[]=")>-1&&(A=Cb(A)?[A]:A),Za.call(n,C)?n[C]=Zn.combine(n[C],A):n[C]=A}return n},Tb=function(t,e,r,n){for(var i=n?e:oh(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 u=a.charAt(0)==="["&&a.charAt(a.length-1)==="]"?a.slice(1,-1):a,l=parseInt(u,10);!r.parseArrays&&u===""?o={0:i}:!isNaN(l)&&a!==u&&String(l)===u&&l>=0&&r.parseArrays&&l<=r.arrayLimit?(o=[],o[l]=i):u!=="__proto__"&&(o[u]=i)}i=o}return i},Nb=function(e,r,n,i){if(e){var s=n.allowDots?e.replace(/\.([^.[]+)/g,"[$1]"):e,o=/(\[[^[\]]*])/,a=/(\[[^[\]]*])/g,u=n.depth>0&&o.exec(s),l=u?s.slice(0,u.index):s,d=[];if(l){if(!n.plainObjects&&Za.call(Object.prototype,l)&&!n.allowPrototypes)return;d.push(l)}for(var g=0;n.depth>0&&(u=a.exec(s))!==null&&g<n.depth;){if(g+=1,!n.plainObjects&&Za.call(Object.prototype,u[1].slice(1,-1))&&!n.allowPrototypes)return;d.push(u[1])}return u&&d.push("["+s.slice(u.index)+"]"),Tb(d,r,n,i)}},Ob=function(e){if(!e)return st;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"?st.charset:e.charset;return{allowDots:typeof e.allowDots>"u"?st.allowDots:!!e.allowDots,allowPrototypes:typeof e.allowPrototypes=="boolean"?e.allowPrototypes:st.allowPrototypes,allowSparse:typeof e.allowSparse=="boolean"?e.allowSparse:st.allowSparse,arrayLimit:typeof e.arrayLimit=="number"?e.arrayLimit:st.arrayLimit,charset:r,charsetSentinel:typeof e.charsetSentinel=="boolean"?e.charsetSentinel:st.charsetSentinel,comma:typeof e.comma=="boolean"?e.comma:st.comma,decoder:typeof e.decoder=="function"?e.decoder:st.decoder,delimiter:typeof e.delimiter=="string"||Zn.isRegExp(e.delimiter)?e.delimiter:st.delimiter,depth:typeof e.depth=="number"||e.depth===!1?+e.depth:st.depth,ignoreQueryPrefix:e.ignoreQueryPrefix===!0,interpretNumericEntities:typeof e.interpretNumericEntities=="boolean"?e.interpretNumericEntities:st.interpretNumericEntities,parameterLimit:typeof e.parameterLimit=="number"?e.parameterLimit:st.parameterLimit,parseArrays:e.parseArrays!==!1,plainObjects:typeof e.plainObjects=="boolean"?e.plainObjects:st.plainObjects,strictNullHandling:typeof e.strictNullHandling=="boolean"?e.strictNullHandling:st.strictNullHandling}},Lb=function(t,e){var r=Ob(e);if(t===""||t===null||typeof t>"u")return r.plainObjects?Object.create(null):{};for(var n=typeof t=="string"?kb(t,r):t,i=r.plainObjects?Object.create(null):{},s=Object.keys(n),o=0;o<s.length;++o){var a=s[o],u=Nb(a,n[a],r,typeof t=="string");i=Zn.merge(i,u,r)}return r.allowSparse===!0?i:Zn.compact(i)},Pb=Mb,Db=Lb,$b=Ec,Bb={formats:$b,parse:Db,stringify:Pb},zi={};(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={}))})(zi);var jb=J&&J.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Z,"__esModule",{value:!0});Z.isInIFrame=Z.createQrUrl=Z.getFavicon=Z.range=Z.isBigNumber=Z.ensureParsedJSONObject=Z.ensureBN=Z.ensureRegExpString=Z.ensureIntNumber=Z.ensureBuffer=Z.ensureAddressString=Z.ensureEvenLengthHexString=Z.ensureHexString=Z.isHexString=Z.prepend0x=Z.strip0x=Z.has0xPrefix=Z.hexStringFromIntNumber=Z.intNumberFromHexString=Z.bigIntStringFromBN=Z.hexStringFromBuffer=Z.hexStringToUint8Array=Z.uint8ArrayToHex=Z.randomBytesHex=void 0;const Sr=jb(zs),Fb=Bb,pn=Bi,Pt=zi,ah=/^[0-9]*$/,ch=/^[a-f0-9]*$/;function Wb(t){return uh(crypto.getRandomValues(new Uint8Array(t)))}Z.randomBytesHex=Wb;function uh(t){return[...t].map(e=>e.toString(16).padStart(2,"0")).join("")}Z.uint8ArrayToHex=uh;function Hb(t){return new Uint8Array(t.match(/.{1,2}/g).map(e=>parseInt(e,16)))}Z.hexStringToUint8Array=Hb;function Vb(t,e=!1){const r=t.toString("hex");return(0,Pt.HexString)(e?"0x"+r:r)}Z.hexStringFromBuffer=Vb;function Ub(t){return(0,Pt.BigIntString)(t.toString(10))}Z.bigIntStringFromBN=Ub;function zb(t){return(0,Pt.IntNumber)(new Sr.default(Gi(t,!1),16).toNumber())}Z.intNumberFromHexString=zb;function qb(t){return(0,Pt.HexString)("0x"+new Sr.default(t).toString(16))}Z.hexStringFromIntNumber=qb;function xc(t){return t.startsWith("0x")||t.startsWith("0X")}Z.has0xPrefix=xc;function Ys(t){return xc(t)?t.slice(2):t}Z.strip0x=Ys;function lh(t){return xc(t)?"0x"+t.slice(2):"0x"+t}Z.prepend0x=lh;function qi(t){if(typeof t!="string")return!1;const e=Ys(t).toLowerCase();return ch.test(e)}Z.isHexString=qi;function fh(t,e=!1){if(typeof t=="string"){const r=Ys(t).toLowerCase();if(ch.test(r))return(0,Pt.HexString)(e?"0x"+r:r)}throw pn.standardErrors.rpc.invalidParams(`"${String(t)}" is not a hexadecimal string`)}Z.ensureHexString=fh;function Gi(t,e=!1){let r=fh(t,!1);return r.length%2===1&&(r=(0,Pt.HexString)("0"+r)),e?(0,Pt.HexString)("0x"+r):r}Z.ensureEvenLengthHexString=Gi;function Gb(t){if(typeof t=="string"){const e=Ys(t).toLowerCase();if(qi(e)&&e.length===40)return(0,Pt.AddressString)(lh(e))}throw pn.standardErrors.rpc.invalidParams(`Invalid Ethereum address: ${String(t)}`)}Z.ensureAddressString=Gb;function Jb(t){if(Buffer.isBuffer(t))return t;if(typeof t=="string")if(qi(t)){const e=Gi(t,!1);return Buffer.from(e,"hex")}else return Buffer.from(t,"utf8");throw pn.standardErrors.rpc.invalidParams(`Not binary data: ${String(t)}`)}Z.ensureBuffer=Jb;function hh(t){if(typeof t=="number"&&Number.isInteger(t))return(0,Pt.IntNumber)(t);if(typeof t=="string"){if(ah.test(t))return(0,Pt.IntNumber)(Number(t));if(qi(t))return(0,Pt.IntNumber)(new Sr.default(Gi(t,!1),16).toNumber())}throw pn.standardErrors.rpc.invalidParams(`Not an integer: ${String(t)}`)}Z.ensureIntNumber=hh;function Zb(t){if(t instanceof RegExp)return(0,Pt.RegExpString)(t.toString());throw pn.standardErrors.rpc.invalidParams(`Not a RegExp: ${String(t)}`)}Z.ensureRegExpString=Zb;function Qb(t){if(t!==null&&(Sr.default.isBN(t)||dh(t)))return new Sr.default(t.toString(10),10);if(typeof t=="number")return new Sr.default(hh(t));if(typeof t=="string"){if(ah.test(t))return new Sr.default(t,10);if(qi(t))return new Sr.default(Gi(t,!1),16)}throw pn.standardErrors.rpc.invalidParams(`Not an integer: ${String(t)}`)}Z.ensureBN=Qb;function Yb(t){if(typeof t=="string")return JSON.parse(t);if(typeof t=="object")return t;throw pn.standardErrors.rpc.invalidParams(`Not a JSON string or an object: ${String(t)}`)}Z.ensureParsedJSONObject=Yb;function dh(t){if(t==null||typeof t.constructor!="function")return!1;const{constructor:e}=t;return typeof e.config=="function"&&typeof e.EUCLID=="number"}Z.isBigNumber=dh;function Kb(t,e){return Array.from({length:e-t},(r,n)=>t+n)}Z.range=Kb;function Xb(){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}`}Z.getFavicon=Xb;function ev(t,e,r,n,i,s){const o=n?"parent-id":"id",a=(0,Fb.stringify)({[o]:t,secret:e,server:r,v:i,chainId:s});return`${r}/#/link?${a}`}Z.createQrUrl=ev;function tv(){try{return window.frameElement!==null}catch{return!1}}Z.isInIFrame=tv;Object.defineProperty(ai,"__esModule",{value:!0});ai.Session=void 0;const Uu=q0,zu=Z,qu="session:id",Gu="session:secret",Ju="session:linked";class Mc{constructor(e,r,n,i){this._storage=e,this._id=r||(0,zu.randomBytesHex)(16),this._secret=n||(0,zu.randomBytesHex)(32),this._key=new Uu.sha256().update(`${this._id}, ${this._secret} WalletLink`).digest("hex"),this._linked=!!i}static load(e){const r=e.getItem(qu),n=e.getItem(Ju),i=e.getItem(Gu);return r&&i?new Mc(e,r,i,n==="1"):null}static hash(e){return new Uu.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(qu,this._id),this._storage.setItem(Gu,this._secret),this.persistLinked(),this}persistLinked(){this._storage.setItem(Ju,this._linked?"1":"0")}}ai.Session=Mc;var Ut={};
4Object.defineProperty(Ut,"__esModule",{value:!0});Ut.WalletSDKRelayAbstract=Ut.APP_VERSION_KEY=Ut.LOCAL_STORAGE_ADDRESSES_KEY=Ut.WALLET_USER_NAME_KEY=void 0;const Zu=Bi;Ut.WALLET_USER_NAME_KEY="walletUsername";Ut.LOCAL_STORAGE_ADDRESSES_KEY="Addresses";Ut.APP_VERSION_KEY="AppVersion";class rv{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 Zu.standardErrors.rpc.parse({});const i=n,{error:s}=i;if(s)throw(0,Zu.serializeError)(s,e.method);return i})}}Ut.WalletSDKRelayAbstract=rv;var Qa={exports:{}},ph=lc.EventEmitter,aa,Qu;function nv(){if(Qu)return aa;Qu=1;function t(A,D){var O=Object.keys(A);if(Object.getOwnPropertySymbols){var x=Object.getOwnPropertySymbols(A);D&&(x=x.filter(function(I){return Object.getOwnPropertyDescriptor(A,I).enumerable})),O.push.apply(O,x)}return O}function e(A){for(var D=1;D<arguments.length;D++){var O=arguments[D]!=null?arguments[D]:{};D%2?t(Object(O),!0).forEach(function(x){r(A,x,O[x])}):Object.getOwnPropertyDescriptors?Object.defineProperties(A,Object.getOwnPropertyDescriptors(O)):t(Object(O)).forEach(function(x){Object.defineProperty(A,x,Object.getOwnPropertyDescriptor(O,x))})}return A}function r(A,D,O){return D=o(D),D in A?Object.defineProperty(A,D,{value:O,enumerable:!0,configurable:!0,writable:!0}):A[D]=O,A}function n(A,D){if(!(A instanceof D))throw new TypeError("Cannot call a class as a function")}function i(A,D){for(var O=0;O<D.length;O++){var x=D[O];x.enumerable=x.enumerable||!1,x.configurable=!0,"value"in x&&(x.writable=!0),Object.defineProperty(A,o(x.key),x)}}function s(A,D,O){return D&&i(A.prototype,D),O&&i(A,O),Object.defineProperty(A,"prototype",{writable:!1}),A}function o(A){var D=a(A,"string");return typeof D=="symbol"?D:String(D)}function a(A,D){if(typeof A!="object"||A===null)return A;var O=A[Symbol.toPrimitive];if(O!==void 0){var x=O.call(A,D||"default");if(typeof x!="object")return x;throw new TypeError("@@toPrimitive must return a primitive value.")}return(D==="string"?String:Number)(A)}var u=Hs,l=u.Buffer,d=Ws,g=d.inspect,y=g&&g.custom||"inspect";function C(A,D,O){l.prototype.copy.call(A,D,O)}return aa=function(){function A(){n(this,A),this.head=null,this.tail=null,this.length=0}return s(A,[{key:"push",value:function(O){var x={data:O,next:null};this.length>0?this.tail.next=x:this.head=x,this.tail=x,++this.length}},{key:"unshift",value:function(O){var x={data:O,next:this.head};this.length===0&&(this.tail=x),this.head=x,++this.length}},{key:"shift",value:function(){if(this.length!==0){var O=this.head.data;return this.length===1?this.head=this.tail=null:this.head=this.head.next,--this.length,O}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(O){if(this.length===0)return"";for(var x=this.head,I=""+x.data;x=x.next;)I+=O+x.data;return I}},{key:"concat",value:function(O){if(this.length===0)return l.alloc(0);for(var x=l.allocUnsafe(O>>>0),I=this.head,N=0;I;)C(I.data,x,N),N+=I.data.length,I=I.next;return x}},{key:"consume",value:function(O,x){var I;return O<this.head.data.length?(I=this.head.data.slice(0,O),this.head.data=this.head.data.slice(O)):O===this.head.data.length?I=this.shift():I=x?this._getString(O):this._getBuffer(O),I}},{key:"first",value:function(){return this.head.data}},{key:"_getString",value:function(O){var x=this.head,I=1,N=x.data;for(O-=N.length;x=x.next;){var P=x.data,L=O>P.length?P.length:O;if(L===P.length?N+=P:N+=P.slice(0,O),O-=L,O===0){L===P.length?(++I,x.next?this.head=x.next:this.head=this.tail=null):(this.head=x,x.data=P.slice(L));break}++I}return this.length-=I,N}},{key:"_getBuffer",value:function(O){var x=l.allocUnsafe(O),I=this.head,N=1;for(I.data.copy(x),O-=I.data.length;I=I.next;){var P=I.data,L=O>P.length?P.length:O;if(P.copy(x,x.length-O,0,L),O-=L,O===0){L===P.length?(++N,I.next?this.head=I.next:this.head=this.tail=null):(this.head=I,I.data=P.slice(L));break}++N}return this.length-=N,x}},{key:y,value:function(O,x){return g(this,e(e({},x),{},{depth:0,customInspect:!1}))}}]),A}(),aa}function iv(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,process.nextTick(Ya,this,t)):process.nextTick(Ya,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?process.nextTick(Ms,r):(r._writableState.errorEmitted=!0,process.nextTick(Yu,r,s)):process.nextTick(Yu,r,s):e?(process.nextTick(Ms,r),e(s)):process.nextTick(Ms,r)}),this)}function Yu(t,e){Ya(t,e),Ms(t)}function Ms(t){t._writableState&&!t._writableState.emitClose||t._readableState&&!t._readableState.emitClose||t.emit("close")}function sv(){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 Ya(t,e){t.emit("error",e)}function ov(t,e){var r=t._readableState,n=t._writableState;r&&r.autoDestroy||n&&n.autoDestroy?t.destroy(e):t.emit("error",e)}var gh={destroy:iv,undestroy:sv,errorOrDestroy:ov},gn={};function av(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,t.__proto__=e}var bh={};function $t(t,e,r){r||(r=Error);function n(s,o,a){return typeof e=="string"?e:e(s,o,a)}var i=function(s){av(o,s);function o(a,u,l){return s.call(this,n(a,u,l))||this}return o}(r);i.prototype.name=r.name,i.prototype.code=t,bh[t]=i}function Ku(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 cv(t,e,r){return t.substr(!r||r<0?0:+r,e.length)===e}function uv(t,e,r){return(r===void 0||r>t.length)&&(r=t.length),t.substring(r-e.length,r)===e}function lv(t,e,r){return typeof r!="number"&&(r=0),r+e.length>t.length?!1:t.indexOf(e,r)!==-1}$t("ERR_INVALID_OPT_VALUE",function(t,e){return'The value "'+e+'" is invali
4d for option "'+t+'"'},TypeError);$t("ERR_INVALID_ARG_TYPE",function(t,e,r){var n;typeof e=="string"&&cv(e,"not ")?(n="must not be",e=e.replace(/^not /,"")):n="must be";var i;if(uv(t," argument"))i="The ".concat(t," ").concat(n," ").concat(Ku(e,"type"));else{var s=lv(t,".")?"property":"argument";i='The "'.concat(t,'" ').concat(s," ").concat(n," ").concat(Ku(e,"type"))}return i+=". Received type ".concat(typeof r),i},TypeError);$t("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF");$t("ERR_METHOD_NOT_IMPLEMENTED",function(t){return"The "+t+" method is not implemented"});$t("ERR_STREAM_PREMATURE_CLOSE","Premature close");$t("ERR_STREAM_DESTROYED",function(t){return"Cannot call "+t+" after a stream was destroyed"});$t("ERR_MULTIPLE_CALLBACK","Callback called multiple times");$t("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable");$t("ERR_STREAM_WRITE_AFTER_END","write after end");$t("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError);$t("ERR_UNKNOWN_ENCODING",function(t){return"Unknown encoding: "+t},TypeError);$t("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event");gn.codes=bh;var fv=gn.codes.ERR_INVALID_OPT_VALUE;function hv(t,e,r){return t.highWaterMark!=null?t.highWaterMark:e?t[r]:null}function dv(t,e,r,n){var i=hv(e,n,r);if(i!=null){if(!(isFinite(i)&&Math.floor(i)===i)||i<0){var s=n?r:"highWaterMark";throw new fv(s,i)}return Math.floor(i)}return t.objectMode?16:16*1024}var vh={getHighWaterMark:dv},pv=gv;function gv(t,e){if(ca("noDeprecation"))return t;var r=!1;function n(){if(!r){if(ca("throwDeprecation"))throw new Error(e);ca("traceDeprecation")?console.trace(e):console.warn(e),r=!0}return t.apply(this,arguments)}return n}function ca(t){try{if(!J.localStorage)return!1}catch{return!1}var e=J.localStorage[t];return e==null?!1:String(e).toLowerCase()==="true"}var ua,Xu;function yh(){if(Xu)return ua;Xu=1,ua=z;function t(R){var T=this;this.next=null,this.entry=null,this.finish=function(){q(T,R)}}var e;z.WritableState=B;var r={deprecate:pv},n=ph,i=Hs.Buffer,s=(typeof J<"u"?J:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function o(R){return i.from(R)}function a(R){return i.isBuffer(R)||R instanceof s}var u=gh,l=vh,d=l.getHighWaterMark,g=gn.codes,y=g.ERR_INVALID_ARG_TYPE,C=g.ERR_METHOD_NOT_IMPLEMENTED,A=g.ERR_MULTIPLE_CALLBACK,D=g.ERR_STREAM_CANNOT_PIPE,O=g.ERR_STREAM_DESTROYED,x=g.ERR_STREAM_NULL_VALUES,I=g.ERR_STREAM_WRITE_AFTER_END,N=g.ERR_UNKNOWN_ENCODING,P=u.errorOrDestroy;zt(z,n);function L(){}function B(R,T,$){e=e||Qn(),R=R||{},typeof $!="boolean"&&($=T instanceof e),this.objectMode=!!R.objectMode,$&&(this.objectMode=this.objectMode||!!R.writableObjectMode),this.highWaterMark=d(this,R,"writableHighWaterMark",$),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var V=R.decodeStrings===!1;this.decodeStrings=!V,this.defaultEncoding=R.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(se){p(T,se)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=R.emitClose!==!1,this.autoDestroy=!!R.autoDestroy,this.bufferedRequestCount=0,this.corkedRequestsFree=new t(this)}B.prototype.getBuffer=function(){for(var T=this.bufferedRequest,$=[];T;)$.push(T),T=T.next;return $},function(){try{Object.defineProperty(B.prototype,"buffer",{get:r.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch{}}();var G;typeof Symbol=="function"&&Symbol.hasInstance&&typeof Function.prototype[Symbol.hasInstance]=="function"?(G=Function.prototype[Symbol.hasInstance],Object.defineProperty(z,Symbol.hasInstance,{value:function(T){return G.call(this,T)?!0:this!==z?!1:T&&T._writableState instanceof B}})):G=function(T){return T instanceof this};function z(R){e=e||Qn();var T=this instanceof e;if(!T&&!G.call(z,this))return new z(R);this._writableState=new B(R,this,T),this.writable=!0,R&&(typeof R.write=="function"&&(this._write=R.write),typeof R.writev=="function"&&(this._writev=R.writev),typeof R.destroy=="function"&&(this._destroy=R.destroy),typeof R.final=="function"&&(this._final=R.final)),n.call(this)}z.prototype.pipe=function(){P(this,new D)};function W(R,T){var $=new I;P(R,$),process.nextTick(T,$)}function K(R,T,$,V){var se;return $===null?se=new x:typeof $!="string"&&!T.objectMode&&(se=new y("chunk",["string","Buffer"],$)),se?(P(R,se),process.nextTick(V,se),!1):!0}z.prototype.write=function(R,T,$){var V=this._writableState,se=!1,_=!V.objectMode&&a(R);return _&&!i.isBuffer(R)&&(R=o(R)),typeof T=="function"&&($=T,T=null),_?T="buffer":T||(T=V.defaultEncoding),typeof $!="function"&&($=L),V.ending?W(this,$):(_||K(this,V,R,$))&&(V.pendingcb++,se=X(this,V,_,R,T,$)),se},z.prototype.cork=function(){this._writableState.corked++},z.prototype.uncork=function(){var R=this._writableState;R.corked&&(R.corked--,!R.writing&&!R.corked&&!R.bufferProcessing&&R.bufferedRequest&&M(this,R))},z.prototype.setDefaultEncoding=function(T){if(typeof T=="string"&&(T=T.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((T+"").toLowerCase())>-1))throw new N(T);return this._writableState.defaultEncoding=T,this},Object.defineProperty(z.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}});function Y(R,T,$){return!R.objectMode&&R.decodeStrings!==!1&&typeof T=="string"&&(T=i.from(T,$)),T}Object.defineProperty(z.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}});function X(R,T,$,V,se,_){if(!$){var S=Y(T,V,se);V!==S&&($=!0,se="buffer",V=S)}var F=T.objectMode?1:V.length;T.length+=F;var H=T.length<T.highWaterMark;if(H||(T.needDrain=!0),T.writing||T.corked){var re=T.lastBufferedRequest;T.lastBufferedRequest={chunk:V,encoding:se,isBuf:$,callback:_,next:null},re?re.next=T.lastBufferedRequest:T.bufferedRequest=T.lastBufferedRequest,T.bufferedRequestCount+=1}else b(R,T,!1,F,V,se,_);return H}function b(R,T,$,V,se,_,S){T.writelen=V,T.writecb=S,T.writing=!0,T.sync=!0,T.destroyed?T.onwrite(new O("write")):$?R._writev(se,T.onwrite):R._write(se,_,T.onwrite),T.sync=!1}function c(R,T,$,V,se){--T.pendingcb,$?(process.nextTick(se,V),process.nextTick(E,R,T),R._writableState.errorEmitted=!0,P(R,V)):(se(V),R._writableState.errorEmitted=!0,P(R,V),E(R,T))}function h(R){R.writing=!1,R.writecb=null,R.length-=R.writelen,R.writelen=0}function p(R,T){var $=R._writableState,V=$.sync,se=$.writecb;if(typeof se!="function")throw new A;if(h($),T)c(R,$,V,T,se);else{var _=k($)||R.destroyed;!_&&!$.corked&&!$.bufferProcessing&&$.bufferedRequest&&M(R,$),V?process.nextTick(v,R,$,_,se):v(R,$,_,se)}}function v(R,T,$,V){$||w(R,T),T.pendingcb--,V(),E(R,T)}function w(R,T){T.length===0&&T.needDrain&&(T.needDrain=!1,R.emit("drain"))}function M(R,T){T.bufferProcessing=!0;var $=T.bufferedRequest;if(R._writev&&$&&$.next){var V=T.bufferedRequestCount,se=new Array(V),_=T.corkedRequestsFree;_.entry=$;
vendor: 8,323 bytes, line 4
4for(var S=0,F=!0;$;)se[S]=$,$.isBuf||(F=!1),$=$.next,S+=1;se.allBuffers=F,b(R,T,!0,T.length,se,"",_.finish),T.pendingcb++,T.lastBufferedRequest=null,_.next?(T.corkedRequestsFree=_.next,_.next=null):T.corkedRequestsFree=new t(T),T.bufferedRequestCount=0}else{for(;$;){var H=$.chunk,re=$.encoding,ie=$.callback,ee=T.objectMode?1:H.length;if(b(R,T,!1,ee,H,re,ie),$=$.next,T.bufferedRequestCount--,T.writing)break}$===null&&(T.lastBufferedRequest=null)}T.bufferedRequest=$,T.bufferProcessing=!1}z.prototype._write=function(R,T,$){$(new C("_write()"))},z.prototype._writev=null,z.prototype.end=function(R,T,$){var V=this._writableState;return typeof R=="function"?($=R,R=null,T=null):typeof T=="function"&&($=T,T=null),R!=null&&this.write(R,T),V.corked&&(V.corked=1,this.uncork()),V.ending||U(this,V,$),this},Object.defineProperty(z.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}});function k(R){return R.ending&&R.length===0&&R.bufferedRequest===null&&!R.finished&&!R.writing}function m(R,T){R._final(function($){T.pendingcb--,$&&P(R,$),T.prefinished=!0,R.emit("prefinish"),E(R,T)})}function f(R,T){!T.prefinished&&!T.finalCalled&&(typeof R._final=="function"&&!T.destroyed?(T.pendingcb++,T.finalCalled=!0,process.nextTick(m,R,T)):(T.prefinished=!0,R.emit("prefinish")))}function E(R,T){var $=k(T);if($&&(f(R,T),T.pendingcb===0&&(T.finished=!0,R.emit("finish"),T.autoDestroy))){var V=R._readableState;(!V||V.autoDestroy&&V.endEmitted)&&R.destroy()}return $}function U(R,T,$){T.ending=!0,E(R,T),$&&(T.finished?process.nextTick($):R.once("finish",$)),T.ended=!0,R.writable=!1}function q(R,T,$){var V=R.entry;for(R.entry=null;V;){var se=V.callback;T.pendingcb--,se($),V=V.next}T.corkedRequestsFree.next=R}return Object.defineProperty(z.prototype,"destroyed",{enumerable:!1,get:function(){return this._writableState===void 0?!1:this._writableState.destroyed},set:function(T){this._writableState&&(this._writableState.destroyed=T)}}),z.prototype.destroy=u.destroy,z.prototype._undestroy=u.undestroy,z.prototype._destroy=function(R,T){T(R)},ua}var la,el;function Qn(){if(el)return la;el=1;var t=Object.keys||function(l){var d=[];for(var g in l)d.push(g);return d};la=o;var e=wh(),r=yh();zt(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||process.nextTick(u,this)}function u(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(d){this._readableState===void 0||this._writableState===void 0||(this._readableState.destroyed=d,this._writableState.destroyed=d)}}),la}var fa={},tl;function rl(){if(tl)return fa;tl=1;var t=Tr.Buffer,e=t.isEncoding||function(x){switch(x=""+x,x&&x.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(x){if(!x)return"utf8";for(var I;;)switch(x){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 x;default:if(I)return;x=(""+x).toLowerCase(),I=!0}}function n(x){var I=r(x);if(typeof I!="string"&&(t.isEncoding===e||!e(x)))throw new Error("Unknown encoding: "+x);return I||x}fa.StringDecoder=i;function i(x){this.encoding=n(x);var I;switch(this.encoding){case"utf16le":this.text=g,this.end=y,I=4;break;case"utf8":this.fillLast=u,I=4;break;case"base64":this.text=C,this.end=A,I=3;break;default:this.write=D,this.end=O;return}this.lastNeed=0,this.lastTotal=0,this.lastChar=t.allocUnsafe(I)}i.prototype.write=function(x){if(x.length===0)return"";var I,N;if(this.lastNeed){if(I=this.fillLast(x),I===void 0)return"";N=this.lastNeed,this.lastNeed=0}else N=0;return N<x.length?I?I+this.text(x,N):this.text(x,N):I||""},i.prototype.end=d,i.prototype.text=l,i.prototype.fillLast=function(x){if(this.lastNeed<=x.length)return x.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);x.copy(this.lastChar,this.lastTotal-this.lastNeed,0,x.length),this.lastNeed-=x.length};function s(x){return x<=127?0:x>>5===6?2:x>>4===14?3:x>>3===30?4:x>>6===2?-1:-2}function o(x,I,N){var P=I.length-1;if(P<N)return 0;var L=s(I[P]);return L>=0?(L>0&&(x.lastNeed=L-1),L):--P<N||L===-2?0:(L=s(I[P]),L>=0?(L>0&&(x.lastNeed=L-2),L):--P<N||L===-2?0:(L=s(I[P]),L>=0?(L>0&&(L===2?L=0:x.lastNeed=L-3),L):0))}function a(x,I,N){if((I[0]&192)!==128)return x.lastNeed=0,"�";if(x.lastNeed>1&&I.length>1){if((I[1]&192)!==128)return x.lastNeed=1,"�";if(x.lastNeed>2&&I.length>2&&(I[2]&192)!==128)return x.lastNeed=2,"�"}}function u(x){var I=this.lastTotal-this.lastNeed,N=a(this,x);if(N!==void 0)return N;if(this.lastNeed<=x.length)return x.copy(this.lastChar,I,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);x.copy(this.lastChar,I,0,x.length),this.lastNeed-=x.length}function l(x,I){var N=o(this,x,I);if(!this.lastNeed)return x.toString("utf8",I);this.lastTotal=N;var P=x.length-(N-this.lastNeed);return x.copy(this.lastChar,0,P),x.toString("utf8",I,P)}function d(x){var I=x&&x.length?this.write(x):"";return this.lastNeed?I+"�":I}function g(x,I){if((x.length-I)%2===0){var N=x.toString("utf16le",I);if(N){var P=N.charCodeAt(N.length-1);if(P>=55296&&P<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=x[x.length-2],this.lastChar[1]=x[x.length-1],N.slice(0,-1)}return N}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=x[x.length-1],x.toString("utf16le",I,x.length-1)}function y(x){var I=x&&x.length?this.write(x):"";if(this.lastNeed){var N=this.lastTotal-this.lastNeed;return I+this.lastChar.toString("utf16le",0,N)}return I}function C(x,I){var N=(x.length-I)%3;return N===0?x.toString("base64",I):(this.lastNeed=3-N,this.lastTotal=3,N===1?this.lastChar[0]=x[x.length-1]:(this.lastChar[0]=x[x.length-2],this.lastChar[1]=x[x.length-1]),x.toString("base64",I,x.length-N))}function A(x){var I=x&&x.length?this.write(x):"";return this.lastNeed?I+this.lastChar.toString("base64",0,3-this.lastNeed):I}function D(x){return x.toString(this.encoding)}function O(x){return x&&x.length?this.write(x):""}return fa}var nl=gn.codes.ERR_STREAM_PREMATURE_CLOSE;function bv(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 vv(){}function yv(t){return t.setHeader&&typeof t.abort=="function"}function mh(t,e,r){if(typeof e=="function")return mh(t,null,e);e||(e={}),r=bv(r||vv);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)},u=t._readableState&&t._readableState.endEmitted,l=function(){n=!1,u=!0,i||r.call(t)},d=function(A){r.call(t,A)},g=function(){var A;if(n&&!u)return(!t._readableState||!t._readableState.ended)&&(A=new nl),r.call(t,A);if(i&&!o)return(!t._writableState||!t._writableState.ended)&&(A=new nl),r.call(t,A)},y=function(){t.req.on("finish",a)};return yv(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",d),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
4),t.removeListener("finish",a),t.removeListener("end",l),t.removeListener("error",d),t.removeListener("close",g)}}var Cc=mh,ha,il;function mv(){if(il)return ha;il=1;var t;function e(N,P,L){return P=r(P),P in N?Object.defineProperty(N,P,{value:L,enumerable:!0,configurable:!0,writable:!0}):N[P]=L,N}function r(N){var P=n(N,"string");return typeof P=="symbol"?P:String(P)}function n(N,P){if(typeof N!="object"||N===null)return N;var L=N[Symbol.toPrimitive];if(L!==void 0){var B=L.call(N,P||"default");if(typeof B!="object")return B;throw new TypeError("@@toPrimitive must return a primitive value.")}return(P==="string"?String:Number)(N)}var i=Cc,s=Symbol("lastResolve"),o=Symbol("lastReject"),a=Symbol("error"),u=Symbol("ended"),l=Symbol("lastPromise"),d=Symbol("handlePromise"),g=Symbol("stream");function y(N,P){return{value:N,done:P}}function C(N){var P=N[s];if(P!==null){var L=N[g].read();L!==null&&(N[l]=null,N[s]=null,N[o]=null,P(y(L,!1)))}}function A(N){process.nextTick(C,N)}function D(N,P){return function(L,B){N.then(function(){if(P[u]){L(y(void 0,!0));return}P[d](L,B)},B)}}var O=Object.getPrototypeOf(function(){}),x=Object.setPrototypeOf((t={get stream(){return this[g]},next:function(){var P=this,L=this[a];if(L!==null)return Promise.reject(L);if(this[u])return Promise.resolve(y(void 0,!0));if(this[g].destroyed)return new Promise(function(W,K){process.nextTick(function(){P[a]?K(P[a]):W(y(void 0,!0))})});var B=this[l],G;if(B)G=new Promise(D(B,this));else{var z=this[g].read();if(z!==null)return Promise.resolve(y(z,!1));G=new Promise(this[d])}return this[l]=G,G}},e(t,Symbol.asyncIterator,function(){return this}),e(t,"return",function(){var P=this;return new Promise(function(L,B){P[g].destroy(null,function(G){if(G){B(G);return}L(y(void 0,!0))})})}),t),O),I=function(P){var L,B=Object.create(x,(L={},e(L,g,{value:P,writable:!0}),e(L,s,{value:null,writable:!0}),e(L,o,{value:null,writable:!0}),e(L,a,{value:null,writable:!0}),e(L,u,{value:P._readableState.endEmitted,writable:!0}),e(L,d,{value:function(z,W){var K=B[g].read();K?(B[l]=null,B[s]=null,B[o]=null,z(y(K,!1))):(B[s]=z,B[o]=W)},writable:!0}),L));return B[l]=null,i(P,function(G){if(G&&G.code!=="ERR_STREAM_PREMATURE_CLOSE"){var z=B[o];z!==null&&(B[l]=null,B[s]=null,B[o]=null,z(G)),B[a]=G;return}var W=B[s];W!==null&&(B[l]=null,B[s]=null,B[o]=null,W(y(void 0,!0))),B[u]=!0}),P.on("readable",A.bind(null,B)),B};return ha=I,ha}var da,sl;function wv(){return sl||(sl=1,da=function(){throw new Error("Readable.from is not available in the browser")}),da}var pa,ol;function wh(){if(ol)return pa;ol=1,pa=W;var t;W.ReadableState=z,lc.EventEmitter;var e=function(S,F){return S.listeners(F).length},r=ph,n=Hs.Buffer,i=(typeof J<"u"?J:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function s(_){return n.from(_)}function o(_){return n.isBuffer(_)||_ instanceof i}var a=Ws,u;a&&a.debuglog?u=a.debuglog("stream"):u=function(){};var l=nv(),d=gh,g=vh,y=g.getHighWaterMark,C=gn.codes,A=C.ERR_INVALID_ARG_TYPE,D=C.ERR_STREAM_PUSH_AFTER_EOF,O=C.ERR_METHOD_NOT_IMPLEMENTED,x=C.ERR_STREAM_UNSHIFT_AFTER_END_EVENT,I,N,P;zt(W,r);var L=d.errorOrDestroy,B=["error","close","destroy","pause","resume"];function G(_,S,F){if(typeof _.prependListener=="function")return _.prependListener(S,F);!_._events||!_._events[S]?_.on(S,F):Array.isArray(_._events[S])?_._events[S].unshift(F):_._events[S]=[F,_._events[S]]}function z(_,S,F){t=t||Qn(),_=_||{},typeof F!="boolean"&&(F=S instanceof t),this.objectMode=!!_.objectMode,F&&(this.objectMode=this.objectMode||!!_.readableObjectMode),this.highWaterMark=y(this,_,"readableHighWaterMark",F),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=_.emitClose!==!1,this.autoDestroy=!!_.autoDestroy,this.destroyed=!1,this.defaultEncoding=_.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,_.encoding&&(I||(I=rl().StringDecoder),this.decoder=new I(_.encoding),this.encoding=_.encoding)}function W(_){if(t=t||Qn(),!(this instanceof W))return new W(_);var S=this instanceof t;this._readableState=new z(_,this,S),this.readable=!0,_&&(typeof _.read=="function"&&(this._read=_.read),typeof _.destroy=="function"&&(this._destroy=_.destroy)),r.call(this)}Object.defineProperty(W.prototype,"destroyed",{enumerable:!1,get:function(){return this._readableState===void 0?!1:this._readableState.destroyed},set:function(S){this._readableState&&(this._readableState.destroyed=S)}}),W.prototype.destroy=d.destroy,W.prototype._undestroy=d.undestroy,W.prototype._destroy=function(_,S){S(_)},W.prototype.push=function(_,S){var F=this._readableState,H;return F.objectMode?H=!0:typeof _=="string"&&(S=S||F.defaultEncoding,S!==F.encoding&&(_=n.from(_,S),S=""),H=!0),K(this,_,S,!1,H)},W.prototype.unshift=function(_){return K(this,_,null,!0,!1)};
vendor: 5,326 bytes, line 4
4function K(_,S,F,H,re){u("readableAddChunk",S);var ie=_._readableState;if(S===null)ie.reading=!1,p(_,ie);else{var ee;if(re||(ee=X(ie,S)),ee)L(_,ee);else if(ie.objectMode||S&&S.length>0)if(typeof S!="string"&&!ie.objectMode&&Object.getPrototypeOf(S)!==n.prototype&&(S=s(S)),H)ie.endEmitted?L(_,new x):Y(_,ie,S,!0);else if(ie.ended)L(_,new D);else{if(ie.destroyed)return!1;ie.reading=!1,ie.decoder&&!F?(S=ie.decoder.write(S),ie.objectMode||S.length!==0?Y(_,ie,S,!1):M(_,ie)):Y(_,ie,S,!1)}else H||(ie.reading=!1,M(_,ie))}return!ie.ended&&(ie.length<ie.highWaterMark||ie.length===0)}function Y(_,S,F,H){S.flowing&&S.length===0&&!S.sync?(S.awaitDrain=0,_.emit("data",F)):(S.length+=S.objectMode?1:F.length,H?S.buffer.unshift(F):S.buffer.push(F),S.needReadable&&v(_)),M(_,S)}function X(_,S){var F;return!o(S)&&typeof S!="string"&&S!==void 0&&!_.objectMode&&(F=new A("chunk",["string","Buffer","Uint8Array"],S)),F}W.prototype.isPaused=function(){return this._readableState.flowing===!1},W.prototype.setEncoding=function(_){I||(I=rl().StringDecoder);var S=new I(_);this._readableState.decoder=S,this._readableState.encoding=this._readableState.decoder.encoding;for(var F=this._readableState.buffer.head,H="";F!==null;)H+=S.write(F.data),F=F.next;return this._readableState.buffer.clear(),H!==""&&this._readableState.buffer.push(H),this._readableState.length=H.length,this};var b=1073741824;function c(_){return _>=b?_=b:(_--,_|=_>>>1,_|=_>>>2,_|=_>>>4,_|=_>>>8,_|=_>>>16,_++),_}function h(_,S){return _<=0||S.length===0&&S.ended?0:S.objectMode?1:_!==_?S.flowing&&S.length?S.buffer.head.data.length:S.length:(_>S.highWaterMark&&(S.highWaterMark=c(_)),_<=S.length?_:S.ended?S.length:(S.needReadable=!0,0))}W.prototype.read=function(_){u("read",_),_=parseInt(_,10);var S=this._readableState,F=_;if(_!==0&&(S.emittedReadable=!1),_===0&&S.needReadable&&((S.highWaterMark!==0?S.length>=S.highWaterMark:S.length>0)||S.ended))return u("read: emitReadable",S.length,S.ended),S.length===0&&S.ended?$(this):v(this),null;if(_=h(_,S),_===0&&S.ended)return S.length===0&&$(this),null;var H=S.needReadable;u("need readable",H),(S.length===0||S.length-_<S.highWaterMark)&&(H=!0,u("length less than watermark",H)),S.ended||S.reading?(H=!1,u("reading or ended",H)):H&&(u("do read"),S.reading=!0,S.sync=!0,S.length===0&&(S.needReadable=!0),this._read(S.highWaterMark),S.sync=!1,S.reading||(_=h(F,S)));var re;return _>0?re=T(_,S):re=null,re===null?(S.needReadable=S.length<=S.highWaterMark,_=0):(S.length-=_,S.awaitDrain=0),S.length===0&&(S.ended||(S.needReadable=!0),F!==_&&S.ended&&$(this)),re!==null&&this.emit("data",re),re};function p(_,S){if(u("onEofChunk"),!S.ended){if(S.decoder){var F=S.decoder.end();F&&F.length&&(S.buffer.push(F),S.length+=S.objectMode?1:F.length)}S.ended=!0,S.sync?v(_):(S.needReadable=!1,S.emittedReadable||(S.emittedReadable=!0,w(_)))}}function v(_){var S=_._readableState;u("emitReadable",S.needReadable,S.emittedReadable),S.needReadable=!1,S.emittedReadable||(u("emitReadable",S.flowing),S.emittedReadable=!0,process.nextTick(w,_))}function w(_){var S=_._readableState;u("emitReadable_",S.destroyed,S.length,S.ended),!S.destroyed&&(S.length||S.ended)&&(_.emit("readable"),S.emittedReadable=!1),S.needReadable=!S.flowing&&!S.ended&&S.length<=S.highWaterMark,R(_)}function M(_,S){S.readingMore||(S.readingMore=!0,process.nextTick(k,_,S))}function k(_,S){for(;!S.reading&&!S.ended&&(S.length<S.highWaterMark||S.flowing&&S.length===0);){var F=S.length;if(u("maybeReadMore read 0"),_.read(0),F===S.length)break}S.readingMore=!1}W.prototype._read=function(_){L(this,new O("_read()"))},W.prototype.pipe=function(_,S){var F=this,H=this._readableState;switch(H.pipesCount){case 0:H.pipes=_;break;case 1:H.pipes=[H.pipes,_];break;default:H.pipes.push(_);break}H.pipesCount+=1,u("pipe count=%d opts=%j",H.pipesCount,S);var re=(!S||S.end!==!1)&&_!==process.stdout&&_!==process.stderr,ie=re?de:be;H.endEmitted?process.nextTick(ie):F.once("end",ie),_.on("unpipe",ee);function ee(pe,xt){u("onunpipe"),pe===F&&xt&&xt.hasUnpiped===!1&&(xt.hasUnpiped=!0,Se())}function de(){u("onend"),_.end()}var Jt=m(F);_.on("drain",Jt);var we=!1;function Se(){u("cleanup"),_.removeListener("close",ye),_.removeListener("finish",cr),_.removeListener("drain",Jt),_.removeListener("error",ve),_.removeListener("unpipe",ee),F.removeListener("end",de),F.removeListener("end",be),F.removeListener("data",vr),we=!0,H.awaitDrain&&(!_._writableState||_._writableState.needDrain)&&Jt()}F.on("data",vr);function vr(pe){u("ondata");var xt=_.write(pe);u("dest.write",xt),xt===!1&&((H.pipesCount===1&&H.pipes===_||H.pipesCount>1&&se(H.pipes,_)!==-1)&&!we&&(u("false write response, pause",H.awaitDrain),H.awaitDrain++),F.pause())}function ve(pe){u("onerror",pe),be(),_.removeListener("error",ve),e(_,"error")===0&&L(_,pe)}G(_,"error",ve);function ye(){_.removeListener("finish",cr),be()}_.once("close",ye);function cr(){u("onfinish"),_.removeListener("close",ye),be()}_.once("finish",cr);function be(){u("unpipe"),F.unpipe(_)}return _.emit("pipe",F),H.flowing||(u("pipe resume"),F.resume()),_};function m(_){return function(){var F=_._readableState;u("pipeOnDrain",F.awaitDrain),F.awaitDrain&&F.awaitDrain--,F.awaitDrain===0&&e(_,"data")&&(F.flowing=!0,R(_))}}W.prototype.unpipe=function(_){var S=this._readableState,F={hasUnpiped:!1};if(S.pipesCount===0)return this;
vendor: 4,241 bytes, line 4
4if(S.pipesCount===1)return _&&_!==S.pipes?this:(_||(_=S.pipes),S.pipes=null,S.pipesCount=0,S.flowing=!1,_&&_.emit("unpipe",this,F),this);if(!_){var H=S.pipes,re=S.pipesCount;S.pipes=null,S.pipesCount=0,S.flowing=!1;for(var ie=0;ie<re;ie++)H[ie].emit("unpipe",this,{hasUnpiped:!1});return this}var ee=se(S.pipes,_);return ee===-1?this:(S.pipes.splice(ee,1),S.pipesCount-=1,S.pipesCount===1&&(S.pipes=S.pipes[0]),_.emit("unpipe",this,F),this)},W.prototype.on=function(_,S){var F=r.prototype.on.call(this,_,S),H=this._readableState;return _==="data"?(H.readableListening=this.listenerCount("readable")>0,H.flowing!==!1&&this.resume()):_==="readable"&&!H.endEmitted&&!H.readableListening&&(H.readableListening=H.needReadable=!0,H.flowing=!1,H.emittedReadable=!1,u("on readable",H.length,H.reading),H.length?v(this):H.reading||process.nextTick(E,this)),F},W.prototype.addListener=W.prototype.on,W.prototype.removeListener=function(_,S){var F=r.prototype.removeListener.call(this,_,S);return _==="readable"&&process.nextTick(f,this),F},W.prototype.removeAllListeners=function(_){var S=r.prototype.removeAllListeners.apply(this,arguments);return(_==="readable"||_===void 0)&&process.nextTick(f,this),S};function f(_){var S=_._readableState;S.readableListening=_.listenerCount("readable")>0,S.resumeScheduled&&!S.paused?S.flowing=!0:_.listenerCount("data")>0&&_.resume()}function E(_){u("readable nexttick read 0"),_.read(0)}W.prototype.resume=function(){var _=this._readableState;return _.flowing||(u("resume"),_.flowing=!_.readableListening,U(this,_)),_.paused=!1,this};function U(_,S){S.resumeScheduled||(S.resumeScheduled=!0,process.nextTick(q,_,S))}function q(_,S){u("resume",S.reading),S.reading||_.read(0),S.resumeScheduled=!1,_.emit("resume"),R(_),S.flowing&&!S.reading&&_.read(0)}W.prototype.pause=function(){return u("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1&&(u("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this};function R(_){var S=_._readableState;for(u("flow",S.flowing);S.flowing&&_.read()!==null;);}W.prototype.wrap=function(_){var S=this,F=this._readableState,H=!1;_.on("end",function(){if(u("wrapped end"),F.decoder&&!F.ended){var ee=F.decoder.end();ee&&ee.length&&S.push(ee)}S.push(null)}),_.on("data",function(ee){if(u("wrapped data"),F.decoder&&(ee=F.decoder.write(ee)),!(F.objectMode&&ee==null)&&!(!F.objectMode&&(!ee||!ee.length))){var de=S.push(ee);de||(H=!0,_.pause())}});for(var re in _)this[re]===void 0&&typeof _[re]=="function"&&(this[re]=function(de){return function(){return _[de].apply(_,arguments)}}(re));for(var ie=0;ie<B.length;ie++)_.on(B[ie],this.emit.bind(this,B[ie]));return this._read=function(ee){u("wrapped _read",ee),H&&(H=!1,_.resume())},this},typeof Symbol=="function"&&(W.prototype[Symbol.asyncIterator]=function(){return N===void 0&&(N=mv()),N(this)}),Object.defineProperty(W.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}}),Object.defineProperty(W.prototype,"readableBuffer",{enumerable:!1,get:function(){return this._readableState&&this._readableState.buffer}}),Object.defineProperty(W.prototype,"readableFlowing",{enumerable:!1,get:function(){return this._readableState.flowing},set:function(S){this._readableState&&(this._readableState.flowing=S)}}),W._fromList=T,Object.defineProperty(W.prototype,"readableLength",{enumerable:!1,get:function(){return this._readableState.length}});function T(_,S){if(S.length===0)return null;var F;return S.objectMode?F=S.buffer.shift():!_||_>=S.length?(S.decoder?F=S.buffer.join(""):S.buffer.length===1?F=S.buffer.first():F=S.buffer.concat(S.length),S.buffer.clear()):F=S.buffer.consume(_,S.decoder),F}function $(_){var S=_._readableState;u("endReadable",S.endEmitted),S.endEmitted||(S.ended=!0,process.nextTick(V,S,_))}function V(_,S){if(u("endReadableNT",_.endEmitted,_.length),!_.endEmitted&&_.length===0&&(_.endEmitted=!0,S.readable=!1,S.emit("end"),_.autoDestroy)){var F=S._writableState;(!F||F.autoDestroy&&F.finished)&&S.destroy()}}typeof Symbol=="function"&&(W.from=function(_,S){return P===void 0&&(P=wv()),P(W,_,S)});function se(_,S){for(var F=0,H=_.length;F<H;F++)if(_[F]===S)return F;return-1}return pa}
4var _h=pr,Ks=gn.codes,_v=Ks.ERR_METHOD_NOT_IMPLEMENTED,Sv=Ks.ERR_MULTIPLE_CALLBACK,Ev=Ks.ERR_TRANSFORM_ALREADY_TRANSFORMING,xv=Ks.ERR_TRANSFORM_WITH_LENGTH_0,Xs=Qn();zt(pr,Xs);function Mv(t,e){var r=this._transformState;r.transforming=!1;var n=r.writecb;if(n===null)return this.emit("error",new Sv);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 pr(t){if(!(this instanceof pr))return new pr(t);Xs.call(this,t),this._transformState={afterTransform:Mv.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",Cv)}function Cv(){var t=this;typeof this._flush=="function"&&!this._readableState.destroyed?this._flush(function(e,r){al(t,e,r)}):al(this,null,null)}pr.prototype.push=function(t,e){return this._transformState.needTransform=!1,Xs.prototype.push.call(this,t,e)};pr.prototype._transform=function(t,e,r){r(new _v("_transform()"))};pr.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)}};pr.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};pr.prototype._destroy=function(t,e){Xs.prototype._destroy.call(this,t,function(r){e(r)})};function al(t,e,r){if(e)return t.emit("error",e);if(r!=null&&t.push(r),t._writableState.length)throw new xv;if(t._transformState.transforming)throw new Ev;return t.push(null)}var Rv=Oi,Sh=_h;zt(Oi,Sh);function Oi(t){if(!(this instanceof Oi))return new Oi(t);Sh.call(this,t)}Oi.prototype._transform=function(t,e,r){r(null,t)};var ga;function Iv(t){var e=!1;return function(){e||(e=!0,t.apply(void 0,arguments))}}var Eh=gn.codes,Av=Eh.ERR_MISSING_ARGS,kv=Eh.ERR_STREAM_DESTROYED;function cl(t){if(t)throw t}function Tv(t){return t.setHeader&&typeof t.abort=="function"}function Nv(t,e,r,n){n=Iv(n);var i=!1;t.on("close",function(){i=!0}),ga===void 0&&(ga=Cc),ga(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,Tv(t))return t.abort();if(typeof t.destroy=="function")return t.destroy();n(o||new kv("pipe"))}}}function ul(t){t()}function Ov(t,e){return t.pipe(e)}function Lv(t){return!t.length||typeof t[t.length-1]!="function"?cl:t.pop()}function Pv(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];var n=Lv(e);if(Array.isArray(e[0])&&(e=e[0]),e.length<2)throw new Av("streams");var i,s=e.map(function(o,a){var u=a<e.length-1,l=a>0;return Nv(o,u,l,function(d){i||(i=d),d&&s.forEach(ul),!u&&(s.forEach(ul),n(i))})});return e.reduce(Ov)}var Dv=Pv;(function(t,e){e=t.exports=wh(),e.Stream=e,e.Readable=e,e.Writable=yh(),e.Duplex=Qn(),e.Transform=_h,e.PassThrough=Rv,e.finished=Cc,e.pipeline=Dv})(Qa,Qa.exports);var xh=Qa.exports;const{Transform:$v}=xh;var Bv=t=>class Mh extends $v{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(!Buffer.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 Buffer.isBuffer(r)||(r=Buffer.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 Mh(this._rate,this._capacity,this._delimitedSuffix,this._hashBitLength,this._options);return this._state.copy(r._state),r._finalized=this._finalized,r}};const{Transform:jv}=xh;var Fv=t=>class Ch extends jv{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(!Buffer.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 Buffer.isBuffer(r)||(r=Buffer.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 Ch(this._rate,this._capacity,this._delimitedSuffix,this._options);return this._state.copy(r._state),r._finalized=this._finalized,r}};const Wv=Bv,Hv=Fv;var Vv=function(t){const e=Wv(t),r=Hv(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)}}},Rh={};const ll=[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];Rh.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],u=t[6]^t[16]^t[26]^t[3
46]^t[46],l=t[7]^t[17]^t[27]^t[37]^t[47],d=t[8]^t[18]^t[28]^t[38]^t[48],g=t[9]^t[19]^t[29]^t[39]^t[49];let y=d^(i<<1|s>>>31),C=g^(s<<1|i>>>31);const A=t[0]^y,D=t[1]^C,O=t[10]^y,x=t[11]^C,I=t[20]^y,N=t[21]^C,P=t[30]^y,L=t[31]^C,B=t[40]^y,G=t[41]^C;y=r^(o<<1|a>>>31),C=n^(a<<1|o>>>31);const z=t[2]^y,W=t[3]^C,K=t[12]^y,Y=t[13]^C,X=t[22]^y,b=t[23]^C,c=t[32]^y,h=t[33]^C,p=t[42]^y,v=t[43]^C;y=i^(u<<1|l>>>31),C=s^(l<<1|u>>>31);const w=t[4]^y,M=t[5]^C,k=t[14]^y,m=t[15]^C,f=t[24]^y,E=t[25]^C,U=t[34]^y,q=t[35]^C,R=t[44]^y,T=t[45]^C;y=o^(d<<1|g>>>31),C=a^(g<<1|d>>>31);const $=t[6]^y,V=t[7]^C,se=t[16]^y,_=t[17]^C,S=t[26]^y,F=t[27]^C,H=t[36]^y,re=t[37]^C,ie=t[46]^y,ee=t[47]^C;y=u^(r<<1|n>>>31),C=l^(n<<1|r>>>31);const de=t[8]^y,Jt=t[9]^C,we=t[18]^y,Se=t[19]^C,vr=t[28]^y,ve=t[29]^C,ye=t[38]^y,cr=t[39]^C,be=t[48]^y,pe=t[49]^C,xt=A,Ee=D,xe=x<<4|O>>>28,mn=O<<4|x>>>28,Me=I<<3|N>>>29,Ce=N<<3|I>>>29,wn=L<<9|P>>>23,Re=P<<9|L>>>23,Ie=B<<18|G>>>14,_n=G<<18|B>>>14,Ae=z<<1|W>>>31,ke=W<<1|z>>>31,Sn=Y<<12|K>>>20,Te=K<<12|Y>>>20,Ne=X<<10|b>>>22,En=b<<10|X>>>22,Oe=h<<13|c>>>19,Le=c<<13|h>>>19,xn=p<<2|v>>>30,Pe=v<<2|p>>>30,De=M<<30|w>>>2,Mn=w<<30|M>>>2,$e=k<<6|m>>>26,Be=m<<6|k>>>26,Cn=E<<11|f>>>21,je=f<<11|E>>>21,Fe=U<<15|q>>>17,Rn=q<<15|U>>>17,We=T<<29|R>>>3,He=R<<29|T>>>3,In=$<<28|V>>>4,Ve=V<<28|$>>>4,Ue=_<<23|se>>>9,An=se<<23|_>>>9,ze=S<<25|F>>>7,qe=F<<25|S>>>7,Or=H<<21|re>>>11,Lr=re<<21|H>>>11,Pr=ee<<24|ie>>>8,Dr=ie<<24|ee>>>8,$r=de<<27|Jt>>>5,Br=Jt<<27|de>>>5,jr=we<<20|Se>>>12,Fr=Se<<20|we>>>12,Wr=ve<<7|vr>>>25,Hr=vr<<7|ve>>>25,Vr=ye<<8|cr>>>24,Ur=cr<<8|ye>>>24,zr=be<<14|pe>>>18,qr=pe<<14|be>>>18;t[0]=xt^~Sn&Cn,t[1]=Ee^~Te&je,t[10]=In^~jr&Me,t[11]=Ve^~Fr&Ce,t[20]=Ae^~$e&ze,t[21]=ke^~Be&qe,t[30]=$r^~xe&Ne,t[31]=Br^~mn&En,t[40]=De^~Ue&Wr,t[41]=Mn^~An&Hr,t[2]=Sn^~Cn&Or,t[3]=Te^~je&Lr,t[12]=jr^~Me&Oe,t[13]=Fr^~Ce&Le,t[22]=$e^~ze&Vr,t[23]=Be^~qe&Ur,t[32]=xe^~Ne&Fe,t[33]=mn^~En&Rn,t[42]=Ue^~Wr&wn,t[43]=An^~Hr&Re,t[4]=Cn^~Or&zr,t[5]=je^~Lr&qr,t[14]=Me^~Oe&We,t[15]=Ce^~Le&He,t[24]=ze^~Vr&Ie,t[25]=qe^~Ur&_n,t[34]=Ne^~Fe&Pr,t[35]=En^~Rn&Dr,t[44]=Wr^~wn&xn,t[45]=Hr^~Re&Pe,t[6]=Or^~zr&xt,t[7]=Lr^~qr&Ee,t[16]=Oe^~We&In,t[17]=Le^~He&Ve,t[26]=Vr^~Ie&Ae,t[27]=Ur^~_n&ke,t[36]=Fe^~Pr&$r,t[37]=Rn^~Dr&Br,t[46]=wn^~xn&De,t[47]=Re^~Pe&Mn,t[8]=zr^~xt&Sn,t[9]=qr^~Ee&Te,t[18]=We^~In&jr,t[19]=He^~Ve&Fr,t[28]=Ie^~Ae&$e,t[29]=_n^~ke&Be,t[38]=Pr^~$r&xe,t[39]=Dr^~Br&mn,t[48]=xn^~De&Ue,t[49]=Pe^~Mn&An,t[0]^=ll[e*2],t[1]^=ll[e*2+1]}};const Os=Rh;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&&(Os.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&&Os.p1600(this.state),this.state[~~((this.blockSize-1)/4)]^=128<<8*((this.blockSize-1)%4),Os.p1600(this.state),this.count=0,this.squeezing=!0};li.prototype.squeeze=function(t){this.squeezing||this.absorbLastFewBits(1);const e=Buffer.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&&(Os.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 Uv=li,zv=Vv(Uv);const qv=zv,Gv=zs;function Ih(t){return Buffer.allocUnsafe(t).fill(0)}function Ah(t,e,r){const n=Ih(e);return t=eo(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 Jv(t,e){return Ah(t,e,!0)}function eo(t){if(!Buffer.isBuffer(t))if(Array.isArray(t))t=Buffer.from(t);else if(typeof t=="string")kh(t)?t=Buffer.from(Yv(Th(t)),"hex"):t=Buffer.from(t);else if(typeof t=="number")t=intToBuffer(t);else if(t==null)t=Buffer.allocUnsafe(0);else if(Gv.isBN(t))t=t.toArrayLike(Buffer);else if(t.toArray)t=Buffer.from(t.toArray());else throw new Error("invalid type");return t}function Zv(t){return t=eo(t),"0x"+t.toString("hex")}function Qv(t,e){return t=eo(t),e||(e=256),qv("keccak"+e).update(t).digest()}function Yv(t){return t.length%2?"0"+t:t}function kh(t){return typeof t=="string"&&t.match(/^0x[0-9A-Fa-f]*$/)}function Th(t){return typeof t=="string"&&t.startsWith("0x")?t.slice(2):t}
4var Nh={zeros:Ih,setLength:Ah,setLengthRight:Jv,isHexString:kh,stripHexPrefix:Th,toBuffer:eo,bufferToHex:Zv,keccak:Qv};const an=Nh,tn=zs;function Oh(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 Hn(t){return parseInt(/^\D+(\d+)$/.exec(t)[1],10)}function fl(t){var e=/^\D+(\d+)x(\d+)$/.exec(t);return[parseInt(e[1],10),parseInt(e[2],10)]}function Lh(t){var e=t.match(/(.*)\[(.*?)\]$/);return e?e[2]===""?"dynamic":parseInt(e[2],10):null}function Yr(t){var e=typeof t;if(e==="string")return an.isHexString(t)?new tn(an.stripHexPrefix(t),16):new tn(t,10);if(e==="number")return new tn(t);if(t.toArray)return t;throw new Error("Argument is not a number")}function Xt(t,e){var r,n,i,s;if(t==="address")return Xt("uint160",Yr(e));if(t==="bool")return Xt("uint8",e?1:0);if(t==="string")return Xt("bytes",new Buffer(e,"utf8"));if(Xv(t)){if(typeof e.length>"u")throw new Error("Not an array?");if(r=Lh(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(Xt(t,e[s]));if(r==="dynamic"){var o=Xt("uint256",e.length);i.unshift(o)}return Buffer.concat(i)}else{if(t==="bytes")return e=new Buffer(e),i=Buffer.concat([Xt("uint256",e.length),e]),e.length%32!==0&&(i=Buffer.concat([i,an.zeros(32-e.length%32)])),i;if(t.startsWith("bytes")){if(r=Hn(t),r<1||r>32)throw new Error("Invalid bytes<N> width: "+r);return an.setLengthRight(e,32)}else if(t.startsWith("uint")){if(r=Hn(t),r%8||r<8||r>256)throw new Error("Invalid uint<N> width: "+r);if(n=Yr(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(Buffer,"be",32)}else if(t.startsWith("int")){if(r=Hn(t),r%8||r<8||r>256)throw new Error("Invalid int<N> width: "+r);if(n=Yr(e),n.bitLength()>r)throw new Error("Supplied int exceeds width: "+r+" vs "+n.bitLength());return n.toTwos(256).toArrayLike(Buffer,"be",32)}else if(t.startsWith("ufixed")){if(r=fl(t),n=Yr(e),n<0)throw new Error("Supplied ufixed is negative");return Xt("uint256",n.mul(new tn(2).pow(new tn(r[1]))))}else if(t.startsWith("fixed"))return r=fl(t),Xt("int256",Yr(e).mul(new tn(2).pow(new tn(r[1]))))}throw new Error("Unsupported or invalid type: "+t)}function Kv(t){return t==="string"||t==="bytes"||Lh(t)==="dynamic"}function Xv(t){return t.lastIndexOf("]")===t.length-1}function ey(t,e){var r=[],n=[],i=32*t.length;for(var s in t){var o=Oh(t[s]),a=e[s],u=Xt(o,a);Kv(o)?(r.push(Xt("uint256",i)),n.push(u),i+=u.length):r.push(u)}return Buffer.concat(r.concat(n))}function Ph(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=Oh(t[s]),a=e[s];if(o==="bytes")i.push(a);else if(o==="string")i.push(new Buffer(a,"utf8"));else if(o==="bool")i.push(new Buffer(a?"01":"00","hex"));else if(o==="address")i.push(an.setLength(a,20));else if(o.startsWith("bytes")){if(r=Hn(o),r<1||r>32)throw new Error("Invalid bytes<N> width: "+r);i.push(an.setLengthRight(a,r))}else if(o.startsWith("uint")){if(r=Hn(o),r%8||r<8||r>256)throw new Error("Invalid uint<N> width: "+r);if(n=Yr(a),n.bitLength()>r)throw new Error("Supplied uint exceeds width: "+r+" vs "+n.bitLength());i.push(n.toArrayLike(Buffer,"be",r/8))}else if(o.startsWith("int")){if(r=Hn(o),r%8||r<8||r>256)throw new Error("Invalid int<N> width: "+r);if(n=Yr(a),n.bitLength()>r)throw new Error("Supplied int exceeds width: "+r+" vs "+n.bitLength());i.push(n.toTwos(r).toArrayLike(Buffer,"be",r/8))}else throw new Error("Unsupported or invalid type: "+o)}return Buffer.concat(i)}function ty(t,e){return an.keccak(Ph(t,e))}var ry={rawEncode:ey,solidityPack:Ph,soliditySHA3:ty};const Wt=Nh,Ii=ry,Dh={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"]},ba={encodeData(t,e,r,n=!0){const i=["bytes32"],s=[this.hashType(t,r)];if(n){const o=(a,u,l)=>{if(r[u]!==void 0)return["bytes32",l==null?"0x0000000000000000000000000000000000000000000000000000000000000000":Wt.keccak(this.encodeData(u,l,r,n))];if(l===void 0)throw new Error(`missing value for field ${a} of type ${u}`);if(u==="bytes")return["bytes32",Wt.keccak(l)];if(u==="string")return typeof l=="string"&&(l=Buffer.from(l,"utf8")),["bytes32",Wt.keccak(l)];if(u.lastIndexOf("]")===u.length-1){const d=u.slice(0,u.lastIndexOf("[")),g=l.map(y=>o(a,d,y));return["bytes32",Wt.keccak(Ii.rawEncode(g.map(([y])=>y),g.map(([,y])=>y)))]}return[u,l]};
4for(const a of r[t]){const[u,l]=o(a.name,a.type,e[a.name]);i.push(u),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=Wt.keccak(a),s.push(a);else if(o.type==="string")i.push("bytes32"),typeof a=="string"&&(a=Buffer.from(a,"utf8")),a=Wt.keccak(a),s.push(a);else if(r[o.type]!==void 0)i.push("bytes32"),a=Wt.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 Ii.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 Wt.keccak(this.encodeData(t,e,r,n))},hashType(t,e){return Wt.keccak(this.encodeType(t,e))},sanitizeData(t){const e={};for(const r in Dh.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=[Buffer.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)),Wt.keccak(Buffer.concat(n))}};var ny={TYPED_MESSAGE_SCHEMA:Dh,TypedDataUtils:ba,hashForSignTypedDataLegacy:function(t){return iy(t.data)},hashForSignTypedData_v3:function(t){return ba.hash(t.data,!1)},hashForSignTypedData_v4:function(t){return ba.hash(t.data)}};function iy(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"?Wt.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 Ii.soliditySHA3(["bytes32","bytes32"],[Ii.soliditySHA3(new Array(t.length).fill("string"),i),Ii.soliditySHA3(n,r)])}var Yn={};Object.defineProperty(Yn,"__esModule",{value:!0});Yn.filterFromParam=Yn.FilterPolyfill=void 0;const $n=zi,vt=Z,sy=5*60*1e3,Kr={jsonrpc:"2.0",id:0};class oy{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,$n.IntNumber)(1),this.provider=e}async newFilter(e){const r=$h(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,vt.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,vt.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,vt.hexStringFromIntNumber)(e)}uninstallFilter(e){const r=(0,vt.intNumberFromHexString)(e);return console.log(`Uninstalling filter (${r})`),this.deleteFilter(r),!0}getFilterChanges(e){const r=(0,vt.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(hs())}async getFilterLogs(e){const r=(0,vt.intNumberFromHexString)(e),n=this.logFilters.get(r);return n?this.sendAsyncPromise(Object.assign(Object.assign({},Kr),{method:"eth_getLogs",params:[hl(n)]})):hs()}makeFilterId(){return(0,$n.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 hs();const i=await this.getCurrentBlockHeight(),s=r.toBlock==="latest"?i:r.toBlock;if(n>i||n>r.toBlock)return ds();console.log(`Fetching logs from ${n} to ${s} for filter ${e}`);const o=await this.sendAsyncPromise(Object.assign(Object.assign({},Kr),{method:"eth_getLogs",params:[hl(Object.assign(Object.assign({},r),{fromBlock:n,toBlock:s}))]}));if(Array.isArray(o.result)){const a=o.result.map(l=>(0,vt.intNumberFromHexString)(l.blockNumber||"0x0")),u=Math.max(...a);if(u&&u>n){const l=(0,$n.IntNumber)(u+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 hs();const n=await this.getCurrentBlockHeight();if(r>n)return ds();console.log(`Fetching blocks from ${r} to ${n} for filter (${e})`);const i=(await Promise.all((0,vt.range)(r,n+1).map(o=>this.getBlockHashByNumber((0,$n.IntNumber)(o))))).filter(o=>!!o),s=(0,$n.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({},Kr),{result:i})}async getPendingTransactionFilterChanges(e){return Promise.resolve(ds())}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)},sy);this.timeouts.set(e,n)}async getCurrentBlockHeight(){const{result:e}=await this.sendAsyncPromise(Object.assign(Object.assign({},Kr),{method:"eth_blockNumber",params:[]}));return(0,vt.intNumberFromHexString)((0,vt.ensureHexString)(e))}async getBlockHashByNumber(e){const r=await this.sendAsyncPromise(Object.assign(Object.assign({},Kr),{method:"eth_getBlockByNumber",params:[(0,vt.hexStringFromIntNumber)(e),!1]}));return r.result&&typeof r.result.hash=="string"?(0,vt.ensureHexString)(r.result.hash):null}}Yn.FilterPolyfill=oy;function $h(t){return{fromBlock:dl(t.fromBlock),toBlock:dl(t.toBlock),addresses:t.address===void 0?null:Array.isArray(t.address)?t.address:[t.address],topics:t.topics||[]}}Yn.filterFromParam=$h;function hl(t){const e={fromBlock:pl(t.fromBlock),toBlock:pl(t.toBlock),topics:t.topics};return t.addresses!==null&&(e.address=t.addresses),e}function dl(t){if(t===void 0||t==="latest"||t==="pending")return"latest";if(t==="earliest")return(0,$n.IntNumber)(0);if((0,vt.isHexString)(t))return(0,vt.intNumberFromHexString)(t);throw new Error(`Invalid block option: ${String(t)}`)}function pl(t){return t==="latest"?t:(0,vt.hexStringFromIntNumber)(t)}function hs(){return Object.assign(Object.assign({},Kr),{error:{code:-32e3,message:"filter not found"}})}function ds(){return Object.assign(Object.assign({},Kr),{result:[]})}var Bh={};
4(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={}))})(Bh);var to={},jh={},ro={},Rc=ay;function ay(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 gl=(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 u=new Array(arguments.length-1);for(let l=1;l<arguments.length;l++)u[l-1]=arguments[l];o?(u.unshift(o),s(u)):i(u)}else o?s(o):i(a)}):n.push(function(o){if(e.multiArgs){const a=new Array(arguments.length-1);for(let u=0;u<arguments.length;u++)a[u]=arguments[u];i(a)}else i(o)}),t.apply(this,n)})};var cy=(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):gl(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)?gl(s,e):s}return n},Ji={},uy=J&&J.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Ji,"__esModule",{value:!0});Ji.BaseBlockTracker=void 0;const ly=uy(hn),fy=1e3,hy=(t,e)=>t+e,bl=["sync","latest"];class dy extends ly.default{constructor(e){super(),this._blockResetDuration=e.blockResetDuration||20*fy,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){bl.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"))}
4_getBlockTrackerEventCount(){return bl.map(e=>this.listenerCount(e)).reduce(hy)}_newPotentialLatest(e){const r=this._currentBlock;r&&vl(e)<=vl(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}}Ji.BaseBlockTracker=dy;function vl(t){return Number.parseInt(t,16)}var Fh={},Wh={},ht={};class Hh extends TypeError{constructor(e,r){let n;const{message:i,explanation:s,...o}=e,{path:a}=e,u=a.length===0?i:`At path: ${a.join(".")} -- ${i}`;super(s??u),s!=null&&(this.cause=u),Object.assign(this,o),this.name=this.constructor.name,this.failures=()=>n??(n=[e,...r()])}}function py(t){return Dt(t)&&typeof t[Symbol.iterator]=="function"}function Dt(t){return typeof t=="object"&&t!=null}function yl(t){if(Object.prototype.toString.call(t)!=="[object Object]")return!1;const e=Object.getPrototypeOf(t);return e===null||e===Object.prototype}function nt(t){return typeof t=="symbol"?t.toString():typeof t=="string"?JSON.stringify(t):`${t}`}function gy(t){const{done:e,value:r}=t.next();return e?void 0:r}function by(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:u=`Expected a value of type \`${o}\`${a?` with refinement \`${a}\``:""}, but received: \`${nt(n)}\``}=t;return{value:n,type:o,refinement:a,key:i[i.length-1],path:i,branch:s,...t,message:u}}function*Ka(t,e,r,n){py(t)||(t=[t]);for(const i of t){const s=by(i,e,r,n);s&&(yield s)}}function*Ic(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"&&Dt(e.schema)&&Dt(t)&&!Array.isArray(t)))for(const l in t)e.schema[l]===void 0&&delete t[l];let u="valid";for(const l of e.validator(t,a))l.explanation=r.message,u="not_valid",yield[l,void 0];for(let[l,d,g]of e.entries(t,a)){const y=Ic(d,g,{path:l===void 0?n:[...n,l],branch:l===void 0?i:[...i,d],c
4oerce:s,mask:o,message:r.message});for(const C of y)C[0]?(u=C[0].refinement!=null?"not_refined":"not_valid",yield[C[0],void 0]):s&&(d=C[1],l===void 0?t=d:t instanceof Map?t.set(l,d):t instanceof Set?t.add(d):Dt(t)&&(d!==void 0||l in t)&&(t[l]=d))}if(u!=="not_valid")for(const l of e.refiner(t,a))l.explanation=r.message,u="not_refined",yield[l,void 0];u==="valid"&&(yield[void 0,t])}class et{constructor(e){const{type:r,schema:n,validator:i,refiner:s,coercer:o=u=>u,entries:a=function*(){}}=e;this.type=r,this.schema=n,this.entries=a,this.coercer=o,i?this.validator=(u,l)=>{const d=i(u,l);return Ka(d,l,this,u)}:this.validator=()=>[],s?this.refiner=(u,l)=>{const d=s(u,l);return Ka(d,l,this,u)}:this.refiner=()=>[]}assert(e,r){return Vh(e,this,r)}create(e,r){return Uh(e,this,r)}is(e){return Ac(e,this)}mask(e,r){return zh(e,this,r)}validate(e,r={}){return fi(e,this,r)}}function Vh(t,e,r){const n=fi(t,e,{message:r});if(n[0])throw n[0]}function Uh(t,e,r){const n=fi(t,e,{coerce:!0,message:r});if(n[0])throw n[0];return n[1]}function zh(t,e,r){const n=fi(t,e,{coerce:!0,mask:!0,message:r});if(n[0])throw n[0];return n[1]}function Ac(t,e){return!fi(t,e)[0]}function fi(t,e,r={}){const n=Ic(t,e,r),i=gy(n);return i[0]?[new Hh(i[0],function*(){for(const o of n)o[0]&&(yield o[0])}),void 0]:[void 0,i[1]]}function vy(...t){const e=t[0].type==="type",r=t.map(i=>i.schema),n=Object.assign({},...r);return e?Tc(n):Zi(n)}function Et(t,e){return new et({type:t,schema:null,validator:e})}function yy(t,e){return new et({...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 my(t){return new et({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 wy(t){let e;return new et({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 _y(t,e){const{schema:r}=t,n={...r};for(const i of e)delete n[i];switch(t.type){case"type":return Tc(n);default:return Zi(n)}}function Sy(t){const e=t instanceof et?{...t.schema}:{...t};for(const r in e)e[r]=qh(e[r]);return Zi(e)}function Ey(t,e){const{schema:r}=t,n={};for(const i of e)n[i]=r[i];return Zi(n)}function xy(t,e){return console.warn("[email protected] - The `struct` helper has been renamed to `define`."),Et(t,e)}function My(){return Et("any",()=>!0)}function Cy(t){return new et({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: ${nt(e)}`}})}function Ry(){return Et("bigint",t=>typeof t=="bigint")}function Iy(){return Et("boolean",t=>typeof t=="boolean")}function Ay(){return Et("date",t=>t instanceof Date&&!isNaN(t.getTime())||`Expected a valid \`Date\` object, but received: ${nt(t)}`)}function ky(t){const e={},r=t.map(n=>nt(n)).join();for(const n of t)e[n]=n;return new et({type:"enums",schema:e,validator(n){return t.includes(n)||`Expected one of \`${r}\`, but received: ${nt(n)}`}})}function Ty(){return Et("func",t=>typeof t=="function"||`Expected a function, but received: ${nt(t)}`)}function Ny(t){return Et("instance",e=>e instanceof t||`Expected a \`${t.name}\` instance, but received: ${nt(e)}`)}function Oy(){return Et("integer",t=>typeof t=="number"&&!isNaN(t)&&Number.isInteger(t)||`Expected an integer, but received: ${nt(t)}`)}function Ly(t){return new et({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 Py(t){const e=nt(t),r=typeof t;return new et({type:"literal",schema:r==="string"||r==="number"||r==="boolean"?t:null,validator(n){return n===t||`Expected the literal \`${e}\`, but received: ${nt(n)}`}})}function Dy(t,e){return new et({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: ${nt
4(r)}`}})}function kc(){return Et("never",()=>!1)}function $y(t){return new et({...t,validator:(e,r)=>e===null||t.validator(e,r),refiner:(e,r)=>e===null||t.refiner(e,r)})}function By(){return Et("number",t=>typeof t=="number"&&!isNaN(t)||`Expected a number, but received: ${nt(t)}`)}function Zi(t){const e=t?Object.keys(t):[],r=kc();return new et({type:"object",schema:t||null,*entries(n){if(t&&Dt(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 Dt(n)||`Expected an object, but received: ${nt(n)}`},coercer(n){return Dt(n)?{...n}:n}})}function qh(t){return new et({...t,validator:(e,r)=>e===void 0||t.validator(e,r),refiner:(e,r)=>e===void 0||t.refiner(e,r)})}function jy(t,e){return new et({type:"record",schema:null,*entries(r){if(Dt(r))for(const n in r){const i=r[n];yield[n,n,t],yield[n,i,e]}},validator(r){return Dt(r)||`Expected an object, but received: ${nt(r)}`}})}function Fy(){return Et("regexp",t=>t instanceof RegExp)}function Wy(t){return new et({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: ${nt(e)}`}})}function Gh(){return Et("string",t=>typeof t=="string"||`Expected a string, but received: ${nt(t)}`)}function Hy(t){const e=kc();return new et({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: ${nt(r)}`}})}function Tc(t){const e=Object.keys(t);return new et({type:"type",schema:t,*entries(r){if(Dt(r))for(const n of e)yield[n,r[n],t[n]]},validator(r){return Dt(r)||`Expected an object, but received: ${nt(r)}`},coercer(r){return Dt(r)?{...r}:r}})}function Vy(t){const e=t.map(r=>r.type).join(" | ");return new et({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]=Ic(r,s,n),[a]=o;if(a[0])for(const[u]of o)u&&i.push(u);else return[]}return[`Expected the value to satisfy a union of \`${e}\`, but received: ${nt(r)}`,...i]}})}function Jh(){return Et("unknown",()=>!0)}function Nc(t,e,r){return new et({...t,coercer:(n,i)=>Ac(n,e)?t.coercer(r(n,i),i):t.coercer(n,i)})}function Uy(t,e,r={}){return Nc(t,Jh(),n=>{const i=typeof e=="function"?e():e;if(n===void 0)return i;if(!r.strict&&yl(n)&&yl(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 zy(t){return Nc(t,Gh(),e=>e.trim())}function qy(t){return bn(t,"empty",e=>{const r=Zh(e);return r===0||`Expected an empty ${t.type} but received one with a size of \`${r}\``})}function Zh(t){return t instanceof Map||t instanceof Set?t.size:t.length}function Gy(t,e,r={}){const{exclusive:n}=r;return bn(t,"max",i=>n?i<e:i<=e||`Expected a ${t.type} less than ${n?"":"or equal to "}${e} but received \`${i}\``)}function Jy(t,e,r={}){const{exclusive:n}=r;return bn(t,"min",i=>n?i>e:i>=e||`Expected a ${t.type} greater than ${n?"":"or equal to "}${e} but received \`${i}\``)}function Zy(t){return bn(t,"nonempty",e=>Zh(e)>0||`Expected a nonempty ${t.type} but received an empty one`)}function Qy(t,e){return bn(t,"pattern",r=>e.test(r)||`Expected a ${t.type} matching \`/${e.source}/\` but received "${r}"`)}function Yy(t,e,r=e){const n=`Expected a ${t.type}`,i=e===r?`of \`${e}\``:`between \`${e}\` and \`${r}\``;return bn(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 bn(t,e,r){return new et({...t,*refiner(n,i){yield*t.refiner(n,i);const s=r(n,i),o=Ka(s,i,t,n);for(const a of o)yield{...a,refinement:e}}})}const Ky=Object.freeze(Object.defineProperty({__proto__:null,Struct:et,StructError:Hh,any:My,array:Cy,assert:Vh,assign:vy,bigint:Ry,boolean:Iy,coerce:Nc,create:Uh,date:Ay,defaulted:Uy,define:Et,deprecated:yy,dynamic:my,empty:qy,enums:ky,func:Ty,instance:Ny,integer:Oy,intersection:Ly,is:Ac,lazy:wy,literal:Py,map:Dy,mask:zh,max:Gy,min:Jy,never:kc,nonempty:Zy,nullable:$y,number:By,object:Zi,omit:_y,optional:qh,partial:Sy,pattern:Qy,pick:Ey,record:jy,refine:bn,regexp:Fy,set:Wy,size:Yy,string:Gh,struct:xy,trimmed:zy,tuple:Hy,type:Tc,union:Vy,unknown:Jh,validate:fi},Symbol.toStringTag,{value:"Module"})),vn=fn(Ky);
4Object.defineProperty(ht,"__esModule",{value:!0});ht.assertExhaustive=ht.assertStruct=ht.assert=ht.AssertionError=void 0;const Xy=vn;function em(t){return typeof t=="object"&&t!==null&&"message"in t}function tm(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 rm(t){const e=em(t)?t.message:String(t);return e.endsWith(".")?e.slice(0,-1):e}function Qh(t,e){return tm(t)?new t({message:e}):t({message:e})}class Oc extends Error{constructor(e){super(e.message),this.code="ERR_ASSERTION"}}ht.AssertionError=Oc;function nm(t,e="Assertion failed.",r=Oc){if(!t)throw e instanceof Error?e:Qh(r,e)}ht.assert=nm;function im(t,e,r="Assertion failed",n=Oc){try{(0,Xy.assert)(t,e)}catch(i){throw Qh(n,`${r}: ${rm(i)}.`)}}ht.assertStruct=im;function sm(t){throw new Error("Invalid branch reached. Should be detected during compilation.")}ht.assertExhaustive=sm;var Qi={};Object.defineProperty(Qi,"__esModule",{value:!0});Qi.base64=void 0;const om=vn,am=ht,cm=(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,am.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,om.pattern)(t,a)};Qi.base64=cm;var fe={},Yi={};(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=vn,r=ht;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 u(l){return l.startsWith("0x")||l.startsWith("0X")?l.substring(2):l}t.remove0x=u})(Yi);Object.defineProperty(fe,"__esModule",{value:!0});fe.createDataView=fe.concatBytes=fe.valueToBytes=fe.stringToBytes=fe.numberToBytes=fe.signedBigIntToBytes=fe.bigIntToBytes=fe.hexToBytes=fe.bytesToString=fe.bytesToNumber=fe.bytesToSignedBigInt=fe.bytesToBigInt=fe.bytesToHex=fe.assertIsBytes=fe.isBytes=void 0;const Ct=ht,Xa=Yi,ml=48,wl=58,_l=87;function um(){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 lm=um();function Lc(t){return t instanceof Uint8Array}fe.isBytes=Lc;function hi(t){(0,Ct.assert)(Lc(t),"Value must be a Uint8Array.")}fe.assertIsBytes=hi;function Yh(t){if(hi(t),t.length===0)return"0x";const e=lm(),r=new Array(t.length);for(let n=0;n<t.length;n++)r[n]=e[t[n]];return(0,Xa.add0x)(r.join(""))}fe.bytesToHex=Yh;function Kh(t){hi(t);const e=Yh(t);return BigInt(e)}fe.bytesToBigInt=Kh;function fm(t){hi(t);let e=BigInt(0);for(const r of t)e=(e<<BigInt(8))+BigInt(r);return BigInt.asIntN(t.length*8,e)}fe.bytesToSignedBigInt=fm;function hm(t){hi(t);const e=Kh(t);return(0,Ct.assert)(e<=BigInt(Number.MAX_SAFE_INTEGER),"Number is not a safe integer. Use `bytesToBigInt` instead."),Number(e)}fe.bytesToNumber=hm;function dm(t){return hi(t),new TextDecoder().decode(t)}fe.bytesToString=dm;function no(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,Xa.assertIsHexString)(t);const r=(0,Xa.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),u=o-(o<wl?ml:_l),l=a-(a<wl?ml:_l);i[s]=u*16+l}return i}fe.hexToBytes=no;function Xh(t){(0,Ct.assert)(typeof t=="bigint","Value must be a bigint."),(0,Ct.assert)(t>=BigInt(0),"Value must be a non-negative bigint.");const e=t.toString(16);return no(e)}fe.bigIntToBytes=Xh;function pm(t,e){(0,Ct.assert)(e>0);const r=t>>BigInt(31);return!((~t&r)+(t&~r)>>BigInt(e*8+-1))}function gm(t,e){(0,Ct.assert)(typeof t=="bigint","Value must be a bigint."),(0,Ct.assert)(typeof e=="number","Byte length must be a number."),(0,Ct.assert)(e>0,"Byte length must be greater than 0."),(0,Ct.assert)(pm(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()}fe.signedBigIntToBytes=gm;function ed(t){(0,Ct.assert)(typeof t=="number","Value must be a number."),(0,Ct.assert)(t>=0,"Value must be a non-negative number."),(0,Ct.assert)(Number.isSafeInteger(t),"Value is not a safe integer. Use `bigIntToBytes` instead.");const e=t.toString(16);return no(e)}fe.numberToBytes=ed;function td(t){return(0,Ct.assert)(typeof t=="string","Value must be a string."),new TextEncoder().encode(t)}fe.stringToBytes=td;function rd(t){if(typeof t=="bigint")return Xh(t);if(typeof t=="number")return ed(t);
4if(typeof t=="string")return t.startsWith("0x")?no(t):td(t);if(Lc(t))return t;throw new TypeError(`Unsupported value type: "${typeof t}".`)}fe.valueToBytes=rd;function bm(t){const e=new Array(t.length);let r=0;for(let i=0;i<t.length;i++){const s=rd(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}fe.concatBytes=bm;function vm(t){if(typeof Buffer<"u"&&t instanceof Buffer){const e=t.buffer.slice(t.byteOffset,t.byteOffset+t.byteLength);return new DataView(e)}return new DataView(t.buffer,t.byteOffset,t.byteLength)}fe.createDataView=vm;var io={};Object.defineProperty(io,"__esModule",{value:!0});io.ChecksumStruct=void 0;const Sl=vn,ym=Qi;io.ChecksumStruct=(0,Sl.size)((0,ym.base64)((0,Sl.string)(),{paddingRequired:!0}),44,44);var nr={};Object.defineProperty(nr,"__esModule",{value:!0});nr.createHex=nr.createBytes=nr.createBigInt=nr.createNumber=void 0;const Ze=vn,mm=ht,nd=fe,so=Yi,id=(0,Ze.union)([(0,Ze.number)(),(0,Ze.bigint)(),(0,Ze.string)(),so.StrictHexStruct]),wm=(0,Ze.coerce)((0,Ze.number)(),id,Number),_m=(0,Ze.coerce)((0,Ze.bigint)(),id,BigInt);(0,Ze.union)([so.StrictHexStruct,(0,Ze.instance)(Uint8Array)]);const Sm=(0,Ze.coerce)((0,Ze.instance)(Uint8Array),(0,Ze.union)([so.StrictHexStruct]),nd.hexToBytes),Em=(0,Ze.coerce)(so.StrictHexStruct,(0,Ze.instance)(Uint8Array),nd.bytesToHex);function xm(t){try{const e=(0,Ze.create)(t,wm);return(0,mm.assert)(Number.isFinite(e),`Expected a number-like value, got "${t}".`),e}catch(e){throw e instanceof Ze.StructError?new Error(`Expected a number-like value, got "${t}".`):e}}nr.createNumber=xm;function Mm(t){try{return(0,Ze.create)(t,_m)}catch(e){throw e instanceof Ze.StructError?new Error(`Expected a number-like value, got "${String(e.value)}".`):e}}nr.createBigInt=Mm;function Cm(t){if(typeof t=="string"&&t.toLowerCase()==="0x")return new Uint8Array;try{return(0,Ze.create)(t,Sm)}catch(e){throw e instanceof Ze.StructError?new Error(`Expected a bytes-like value, got "${String(e.value)}".`):e}}nr.createBytes=Cm;function Rm(t){if(t instanceof Uint8Array&&t.length===0||typeof t=="string"&&t.toLowerCase()==="0x")return"0x";try{return(0,Ze.create)(t,Em)}catch(e){throw e instanceof Ze.StructError?new Error(`Expected a bytes-like value, got "${String(e.value)}".`):e}}nr.createHex=Rm;var Kn={},sd=J&&J.__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},yt=J&&J.__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)},jt,Qt;Object.defineProperty(Kn,"__esModule",{value:!0});Kn.FrozenSet=Kn.FrozenMap=void 0;class Pc{constructor(e){jt.set(this,void 0),sd(this,jt,new Map(e),"f"),Object.freeze(this)}get size(){return yt(this,jt,"f").size}[(jt=new WeakMap,Symbol.iterator)](){return yt(this,jt,"f")[Symbol.iterator]()}entries(){return yt(this,jt,"f").entries()}forEach(e,r){return yt(this,jt,"f").forEach((n,i,s)=>e.call(r,n,i,this))}get(e){return yt(this,jt,"f").get(e)}has(e){return yt(this,jt,"f").has(e)}keys(){return yt(this,jt,"f").keys()}values(){return yt(this,jt,"f").values()}toString(){return`FrozenMap(${this.size}) {${this.size>0?` ${[...this.entries()].map(([e,r])=>`${String(e)} => ${String(r)}`).join(", ")} `:""}}`}}Kn.FrozenMap=Pc;class Dc{constructor(e){Qt.set(this,void 0),sd(this,Qt,new Set(e),"f"),Object.freeze(this)}get size(){return yt(this,Qt,"f").size}[(Qt=new WeakMap,Symbol.iterator)](){return yt(this,Qt,"f")[Symbol.iterator]()}entries(){return yt(this,Qt,"f").entries()}forEach(e,r){return yt(this,Qt,"f").forEach((n,i,s)=>e.call(r,n,i,this))}has(e){return yt(this,Qt,"f").has(e)}keys(){return yt(this,Qt,"f").keys()}values(){return yt(this,Qt,"f").values()}toString(){return`FrozenSet(${this.size}) {${this.size>0?` ${[...this.values()].map(e=>String(e)).join(", ")} `:""}}`}}
4Kn.FrozenSet=Dc;Object.freeze(Pc);Object.freeze(Pc.prototype);Object.freeze(Dc);Object.freeze(Dc.prototype);var od={},$c={};(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,d)=>Object.hasOwnProperty.call(l,d);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 d=l;for(;Object.getPrototypeOf(d)!==null;)d=Object.getPrototypeOf(d);return Object.getPrototypeOf(l)===d}catch{return!1}}t.isPlainObject=s;function o(l){return l.charCodeAt(0)<=127}t.isASCII=o;function a(l){var d;return l.split("").reduce((y,C)=>o(C)?y+1:y+2,0)+((d=l.match(t.ESCAPE_CHARACTERS_REGEXP))!==null&&d!==void 0?d:[]).length}t.calculateStringSize=a;function u(l){return l.toString().length}t.calculateNumberSize=u})($c);(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=vn,r=ht,n=$c;t.JsonStruct=(0,e.define)("Json",L=>{const[B]=P(L,!0);return B?!0:"Expected a valid JSON-serializable value"});function i(L){return(0,e.is)(L,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(L){return(0,e.is)(L,t.JsonRpcNotificationStruct)}t.isJsonRpcNotification=s;function o(L,B){(0,r.assertStruct)(L,t.JsonRpcNotificationStruct,"Invalid JSON-RPC notification",B)}t.assertIsJsonRpcNotification=o;function a(L){return(0,e.is)(L,t.JsonRpcRequestStruct)}t.isJsonRpcRequest=a;function u(L,B){(0,r.assertStruct)(L,t.JsonRpcRequestStruct,"Invalid JSON-RPC request",B)}t.assertIsJsonRpcRequest=u,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(L){return(0,e.is)(L,t.PendingJsonRpcResponseStruct)}t.isPendingJsonRpcResponse=l;function d(L,B){(0,r.assertStruct)(L,t.PendingJsonRpcResponseStruct,"Invalid pending JSON-RPC response",B)}t.assertIsPendingJsonRpcResponse=d;function g(L){return(0,e.is)(L,t.JsonRpcResponseStruct)}t.isJsonRpcResponse=g;function y(L,B){(0,r.assertStruct)(L,t.JsonRpcResponseStruct,"Invalid JSON-RPC response",B)}t.assertIsJsonRpcResponse=y;function C(L){return(0,e.is)(L,t.JsonRpcSuccessStruct)}t.isJsonRpcSuccess=C;function A(L,B){(0,r.assertStruct)(L,t.JsonRpcSuccessStruct,"Invalid JSON-RPC success response",B)}t.assertIsJsonRpcSuccess=A;function D(L){return(0,e.is)(L,t.JsonRpcFailureStruct)}t.isJsonRpcFailure=D;function O(L,B){(0,r.assertStruct)(L,t.JsonRpcFailureStruct,"Invalid JSON-RPC failure response",B)}t.assertIsJsonRpcFailure=O;function x(L){return(0,e.is)(L,t.JsonRpcErrorStruct)}t.isJsonRpcError=x;function I(L,B){(0,r.assertStruct)(L,t.JsonRpcErrorStruct,"Invalid JSON-RPC error",B)}t.assertIsJsonRpcError=I;function N(L){const{permitEmptyString:B,permitFractions:G,permitNull:z}=Object.assign({permitEmptyString:!0,permitFractions:!1,permitNull:!0},L);return K=>!!(typeof K=="number"&&(G||Number.isInteger(K))||typeof K=="string"&&(B||K.length>0)||z&&K===null)}t.getJsonRpcIdValidator=N;function P(L,B=!1){const G=new Set;function z(W,K){if(W===void 0)return[!1,0];if(W===null)return[!0,K?0:n.JsonSize.Null];const Y=typeof W;try{if(Y==="function")return[!1,0];if(Y==="string"||W instanceof String)return[!0,K?0:(0,n.calculateStringSize)(W)+n.JsonSize.Quote*2];if(Y==="boolean"||W instanceof Boolean)return K?[!0,0]:[!0,W==!0?n.JsonSize.True:n.JsonSize.False];if(Y==="number"||W instanceof Number)return K?[!0,0]:[!0,(0,n.calculateNumberSize)(W)];if(W instanceof Date)return K?[!0,0]:[!0,isNaN(W.getDate())?n.JsonSize.Null:n.JsonSize.Date+n.JsonSize.Quote*2]}catch{return[!1,0]}if(!(0,n.isPlainObject)(W)&&!Array.isArray(W))return[!1,0];if(G.has(W))return[!1,0];G.add(W);try{return[!0,Object.entries(W).reduce((X,[b,c],h,p)=>{let[v,w]=z(c,K);
4if(!v)throw new Error("JSON validation did not pass. Validation process stopped.");if(G.delete(W),K)return 0;const M=Array.isArray(W)?0:b.length+n.JsonSize.Comma+n.JsonSize.Colon*2,k=h<p.length-1?n.JsonSize.Comma:0;return X+M+w+k},K?0:n.JsonSize.Wrapper*2)]}catch{return[!1,0]}}return z(L,B)}t.validateJsonAndGetSize=P})(od);var Xn={},ec={exports:{}},va,El;function Im(){if(El)return va;El=1;var t=1e3,e=t*60,r=e*60,n=r*24,i=n*7,s=n*365.25;va=function(d,g){g=g||{};var y=typeof d;if(y==="string"&&d.length>0)return o(d);if(y==="number"&&isFinite(d))return g.long?u(d):a(d);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(d))};function o(d){if(d=String(d),!(d.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(d);if(g){var y=parseFloat(g[1]),C=(g[2]||"ms").toLowerCase();switch(C){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(d){var g=Math.abs(d);return g>=n?Math.round(d/n)+"d":g>=r?Math.round(d/r)+"h":g>=e?Math.round(d/e)+"m":g>=t?Math.round(d/t)+"s":d+"ms"}function u(d){var g=Math.abs(d);return g>=n?l(d,g,n,"day"):g>=r?l(d,g,r,"hour"):g>=e?l(d,g,e,"minute"):g>=t?l(d,g,t,"second"):d+" ms"}function l(d,g,y,C){var A=g>=y*1.5;return Math.round(d/y)+" "+C+(A?"s":"")}return va}function Am(t){r.debug=r,r.default=r,r.coerce=u,r.disable=s,r.enable=i,r.enabled=o,r.humanize=Im(),r.destroy=l,Object.keys(t).forEach(d=>{r[d]=t[d]}),r.names=[],r.skips=[],r.formatters={};function e(d){let g=0;for(let y=0;y<d.length;y++)g=(g<<5)-g+d.charCodeAt(y),g|=0;return r.colors[Math.abs(g)%r.colors.length]}r.selectColor=e;function r(d){let g,y=null,C,A;function D(...O){if(!D.enabled)return;const x=D,I=Number(new Date),N=I-(g||I);x.diff=N,x.prev=g,x.curr=I,g=I,O[0]=r.coerce(O[0]),typeof O[0]!="string"&&O.unshift("%O");let P=0;
vendor: 4,443 bytes, line 4
4O[0]=O[0].replace(/%([a-zA-Z%])/g,(B,G)=>{if(B==="%%")return"%";P++;const z=r.formatters[G];if(typeof z=="function"){const W=O[P];B=z.call(x,W),O.splice(P,1),P--}return B}),r.formatArgs.call(x,O),(x.log||r.log).apply(x,O)}return D.namespace=d,D.useColors=r.useColors(),D.color=r.selectColor(d),D.extend=n,D.destroy=r.destroy,Object.defineProperty(D,"enabled",{enumerable:!0,configurable:!1,get:()=>y!==null?y:(C!==r.namespaces&&(C=r.namespaces,A=r.enabled(d)),A),set:O=>{y=O}}),typeof r.init=="function"&&r.init(D),D}function n(d,g){const y=r(this.namespace+(typeof g>"u"?":":g)+d);return y.log=this.log,y}function i(d){r.save(d),r.namespaces=d,r.names=[],r.skips=[];let g;const y=(typeof d=="string"?d:"").split(/[\s,]+/),C=y.length;for(g=0;g<C;g++)y[g]&&(d=y[g].replace(/\*/g,".*?"),d[0]==="-"?r.skips.push(new RegExp("^"+d.slice(1)+"$")):r.names.push(new RegExp("^"+d+"$")))}function s(){const d=[...r.names.map(a),...r.skips.map(a).map(g=>"-"+g)].join(",");return r.enable(""),d}function o(d){if(d[d.length-1]==="*")return!0;let g,y;for(g=0,y=r.skips.length;g<y;g++)if(r.skips[g].test(d))return!1;for(g=0,y=r.names.length;g<y;g++)if(r.names[g].test(d))return!0;return!1}function a(d){return d.toString().substring(2,d.toString().length-2).replace(/\.\*\?$/,"*")}function u(d){return d instanceof Error?d.stack||d.message:d}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 km=Am;(function(t,e){e.formatArgs=n,e.save=i,e.load=s,e.useColors=r,e.storage=o(),e.destroy=(()=>{let u=!1;return()=>{u||(u=!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(u){if(u[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+u[0]+(this.useColors?"%c ":" ")+"+"+t.exports.humanize(this.diff),!this.useColors)return;const l="color: "+this.color;u.splice(1,0,l,"color: inherit");let d=0,g=0;u[0].replace(/%[a-zA-Z%]/g,y=>{y!=="%%"&&(d++,y==="%c"&&(g=d))}),u.splice(g,0,l)}e.log=console.debug||console.log||(()=>{});function i(u){try{u?e.storage.setItem("debug",u):e.storage.removeItem("debug")}catch{}}function s(){let u;try{u=e.storage.getItem("debug")}catch{}return!u&&typeof process<"u"&&"env"in process&&(u={}.DEBUG),u}function o(){try{return localStorage}catch{}}t.exports=km(e);const{formatters:a}=t.exports;a.j=function(u){try{return JSON.stringify(u)}catch(l){return"[UnexpectedJSONParseError]: "+l.message}}})(ec,ec.exports);var Tm=ec.exports,Nm=J&&J.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Xn,"__esModule",{value:!0});Xn.createModuleLogger=Xn.createProjectLogger=void 0;const Om=Nm(Tm),Lm=(0,Om.default)("metamask");function Pm(t){return Lm.extend(t)}Xn.createProjectLogger=Pm;function Dm(t,e){return t.extend(e)}Xn.createModuleLogger=Dm;var ir={};
4Object.defineProperty(ir,"__esModule",{value:!0});ir.hexToBigInt=ir.hexToNumber=ir.bigIntToHex=ir.numberToHex=void 0;const Vn=ht,Li=Yi,$m=t=>((0,Vn.assert)(typeof t=="number","Value must be a number."),(0,Vn.assert)(t>=0,"Value must be a non-negative number."),(0,Vn.assert)(Number.isSafeInteger(t),"Value is not a safe integer. Use `bigIntToHex` instead."),(0,Li.add0x)(t.toString(16)));ir.numberToHex=$m;const Bm=t=>((0,Vn.assert)(typeof t=="bigint","Value must be a bigint."),(0,Vn.assert)(t>=0,"Value must be a non-negative bigint."),(0,Li.add0x)(t.toString(16)));ir.bigIntToHex=Bm;const jm=t=>{(0,Li.assertIsHexString)(t);const e=parseInt(t,16);return(0,Vn.assert)(Number.isSafeInteger(e),"Value is not a safe integer. Use `hexToBigInt` instead."),e};ir.hexToNumber=jm;const Fm=t=>((0,Li.assertIsHexString)(t),BigInt((0,Li.add0x)(t)));ir.hexToBigInt=Fm;var ad={};Object.defineProperty(ad,"__esModule",{value:!0});var cd={};(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)=>
vendor: 13,453 bytes, line 4
4{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})(cd);var ud={},tc={exports:{}};const Wm="2.0.0",ld=256,Hm=Number.MAX_SAFE_INTEGER||9007199254740991,Vm=16,Um=ld-6,zm=["major","premajor","minor","preminor","patch","prepatch","prerelease"];var oo={MAX_LENGTH:ld,MAX_SAFE_COMPONENT_LENGTH:Vm,MAX_SAFE_BUILD_LENGTH:Um,MAX_SAFE_INTEGER:Hm,RELEASE_TYPES:zm,SEMVER_SPEC_VERSION:Wm,FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2};const qm=typeof process=="object"&&process.env&&{}.NODE_DEBUG&&/\bsemver\b/i.test({}.NODE_DEBUG)?(...t)=>console.error("SEMVER",...t):()=>{};var ao=qm;(function(t,e){const{MAX_SAFE_COMPONENT_LENGTH:r,MAX_SAFE_BUILD_LENGTH:n,MAX_LENGTH:i}=oo,s=ao;e=t.exports={};const o=e.re=[],a=e.safeRe=[],u=e.src=[],l=e.t={};let d=0;const g="[a-zA-Z0-9-]",y=[["\\s",1],["\\d",i],[g,n]],C=D=>{for(const[O,x]of y)D=D.split(`${O}*`).join(`${O}{0,${x}}`).split(`${O}+`).join(`${O}{1,${x}}`);return D},A=(D,O,x)=>{const I=C(O),N=d++;s(D,N,O),l[D]=N,u[N]=O,o[N]=new RegExp(O,x?"g":void 0),a[N]=new RegExp(I,x?"g":void 0)};A("NUMERICIDENTIFIER","0|[1-9]\\d*"),A("NUMERICIDENTIFIERLOOSE","\\d+"),A("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${g}*`),A("MAINVERSION",`(${u[l.NUMERICIDENTIFIER]})\\.(${u[l.NUMERICIDENTIFIER]})\\.(${u[l.NUMERICIDENTIFIER]})`),A("MAINVERSIONLOOSE",`(${u[l.NUMERICIDENTIFIERLOOSE]})\\.(${u[l.NUMERICIDENTIFIERLOOSE]})\\.(${u[l.NUMERICIDENTIFIERLOOSE]})`),A("PRERELEASEIDENTIFIER",`(?:${u[l.NUMERICIDENTIFIER]}|${u[l.NONNUMERICIDENTIFIER]})`),A("PRERELEASEIDENTIFIERLOOSE",`(?:${u[l.NUMERICIDENTIFIERLOOSE]}|${u[l.NONNUMERICIDENTIFIER]})`),A("PRERELEASE",`(?:-(${u[l.PRERELEASEIDENTIFIER]}(?:\\.${u[l.PRERELEASEIDENTIFIER]})*))`),A("PRERELEASELOOSE",`(?:-?(${u[l.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${u[l.PRERELEASEIDENTIFIERLOOSE]})*))`),A("BUILDIDENTIFIER",`${g}+`),A("BUILD",`(?:\\+(${u[l.BUILDIDENTIFIER]}(?:\\.${u[l.BUILDIDENTIFIER]})*))`),A("FULLPLAIN",`v?${u[l.MAINVERSION]}${u[l.PRERELEASE]}?${u[l.BUILD]}?`),A("FULL",`^${u[l.FULLPLAIN]}$`),A("LOOSEPLAIN",`[v=\\s]*${u[l.MAINVERSIONLOOSE]}${u[l.PRERELEASELOOSE]}?${u[l.BUILD]}?`),A("LOOSE",`^${u[l.LOOSEPLAIN]}$`),A("GTLT","((?:<|>)?=?)"),A("XRANGEIDENTIFIERLOOSE",`${u[l.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`),A("XRANGEIDENTIFIER",`${u[l.NUMERICIDENTIFIER]}|x|X|\\*`),A("XRANGEPLAIN",`[v=\\s]*(${u[l.XRANGEIDENTIFIER]})(?:\\.(${u[l.XRANGEIDENTIFIER]})(?:\\.(${u[l.XRANGEIDENTIFIER]})(?:${u[l.PRERELEASE]})?${u[l.BUILD]}?)?)?`),A("XRANGEPLAINLOOSE",`[v=\\s]*(${u[l.XRANGEIDENTIFIERLOOSE]})(?:\\.(${u[l.XRANGEIDENTIFIERLOOSE]})(?:\\.(${u[l.XRANGEIDENTIFIERLOOSE]})(?:${u[l.PRERELEASELOOSE]})?${u[l.BUILD]}?)?)?`),A("XRANGE",`^${u[l.GTLT]}\\s*${u[l.XRANGEPLAIN]}$`),A("XRANGELOOSE",`^${u[l.GTLT]}\\s*${u[l.XRANGEPLAINLOOSE]}$`),A("COERCE",`(^|[^\\d])(\\d{1,${r}})(?:\\.(\\d{1,${r}}))?(?:\\.(\\d{1,${r}}))?(?:$|[^\\d])`),A("COERCERTL",u[l.COERCE],!0),A("LONETILDE","(?:~>?)"),A("TILDETRIM",`(\\s*)${u[l.LONETILDE]}\\s+`,!0),e.tildeTrimReplace="$1~",A("TILDE",`^${u[l.LONETILDE]}${u[l.XRANGEPLAIN]}$`),A("TILDELOOSE",`^${u[l.LONETILDE]}${u[l.XRANGEPLAINLOOSE]}$`),A("LONECARET","(?:\\^)"),A("CARETTRIM",`(\\s*)${u[l.LONECARET]}\\s+`,!0),e.caretTrimReplace="$1^",A("CARET",`^${u[l.LONECARET]}${u[l.XRANGEPLAIN]}$`),A("CARETLOOSE",`^${u[l.LONECARET]}${u[l.XRANGEPLAINLOOSE]}$`),A("COMPARATORLOOSE",`^${u[l.GTLT]}\\s*(${u[l.LOOSEPLAIN]})$|^$`),A("COMPARATOR",`^${u[l.GTLT]}\\s*(${u[l.FULLPLAIN]})$|^$`),A("COMPARATORTRIM",`(\\s*)${u[l.GTLT]}\\s*(${u[l.LOOSEPLAIN]}|${u[l.XRANGEPLAIN]})`,!0),e.comparatorTrimReplace="$1$2$3",A("HYPHENRANGE",`^\\s*(${u[l.XRANGEPLAIN]})\\s+-\\s+(${u[l.XRANGEPLAIN]})\\s*$`),A("HYPHENRANGELOOSE",`^\\s*(${u[l.XRANGEPLAINLOOSE]})\\s+-\\s+(${u[l.XRANGEPLAINLOOSE]})\\s*$`),A("STAR","(<|>)?=?\\s*\\*"),A("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$"),A("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")})(tc,tc.exports);var Ki=tc.exports;const Gm=Object.freeze({loose:!0}),Jm=Object.freeze({}),Zm=t=>t?typeof t!="object"?Gm:t:Jm;var Bc=Zm;const xl=/^[0-9]+$/,fd=(t,e)=>{const r=xl.test(t),n=xl.test(e);return r&&n&&(t=+t,e=+e),t===e?0:r&&!n?-1:n&&!r?1:t<e?-1:1},Qm=(t,e)=>fd(e,t);var hd={compareIdentifiers:fd,rcompareIdentifiers:Qm};const ps=ao,{MAX_LENGTH:Ml,MAX_SAFE_INTEGER:gs}=oo,{safeRe:Cl,t:Rl}=Ki,Ym=Bc,{compareIdentifiers:Tn}=hd;let Km=class Kt{constructor(e,r){if(r=Ym(r),e instanceof Kt){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>Ml)throw new TypeError(`version is longer than ${Ml} characters`);ps("SemVer",e,r),this.options=r,this.loose=!!r.loose,this.includePrerelease=!!r.includePrerelease;const n=e.trim().match(r.loose?Cl[Rl.LOOSE]:Cl[Rl.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>gs||this.major<0)throw new TypeError("Invalid major version");if(this.minor>gs||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>gs||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<gs)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(ps("SemVer.compare",this.version,this.options,e),!(e instanceof Kt)){if(typeof e=="string"&&e===this.version)return 0;e=new Kt(e,this.options)}return e.version===this.version?0:this.compareMain(e)||this.comparePre(e)}compareMain(e){return e instanceof Kt||(e=new Kt(e,this.options)),Tn(this.major,e.major)||Tn(this.minor,e.minor)||Tn(this.patch,e.patch)}comparePre(e){if(e instanceof Kt||(e=new Kt(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(ps("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 Tn(n,i)}while(++r)}compareBuild(e){e instanceof Kt||(e=new Kt(e,this.options));let r=0;do{const n=this.build[r],i=e.build[r];if(ps("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 Tn(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]),Tn(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 _t=Km;const Il=_t,Xm=(t,e,r=!1)=>{if(t instanceof Il)return t;try{return new Il(t,e)}catch(n){if(!r)return null;throw n}};var di=Xm;const e1=di,t1=(t,e)=>{const r=e1(t,e);return r?r.version:null};var r1=t1;const n1=di,i1=(t,e)=>{const r=n1(t.trim().replace(/^[=v]+/,""),e);return r?r.version:null};var s1=i1;const Al=_t,o1=(t,e,r,n,i)=>{typeof r=="string"&&(i=n,n=r,r=void 0);try{return new Al(t instanceof Al?t.version:t,r).inc(e,n,i).version}catch{return null}};var a1=o1;const kl=di,c1=(t,e)=>{const r=kl(t,null,!0),n=kl(e,null,!0),i=r.compare(n);if(i===0)return null;const s=i>0,o=s?r:n,a=s?n:r,u=!!o.prerelease.length;if(!!a.prerelease.length&&!u)return!a.patch&&!a.minor?"major":o.patch?"patch":o.minor?"minor":"major";const d=u?"pre":"";return r.major!==n.major?d+"major":r.minor!==n.minor?d+"minor":r.patch!==n.patch?d+"patch":"prerelease"};var u1=c1;const l1=_t,f1=(t,e)=>new l1(t,e).major;var h1=f1;const d1=_t,p1=(t,e)=>new d1(t,e).minor;var g1=p1;const b1=_t,v1=(t,e)=>new b1(t,e).patch;var y1=v1;const m1=di,w1=(t,e)=>{const r=m1(t,e);return r&&r.prerelease.length?r.prerelease:null};var _1=w1;const Tl=_t,S1=(t,e,r)=>new Tl(t,r).compare(new Tl(e,r));var qt=S1;const E1=qt,x1=(t,e,r)=>E1(e,t,r);var M1=x1;const C1=qt,R1=(t,e)=>C1(t,e,!0);var I1=R1;const Nl=_t,A1=(t,e,r)=>{const n=new Nl(t,r),i=new Nl(e,r);return n.compare(i)||n.compareBuild(i)};var jc=A1;const k1=jc,T1=(t,e)=>t.sort((r,n)=>k1(r,n,e));var N1=T1;const O1=jc,L1=(t,e)=>t.sort((r,n)=>O1(n,r,e));var P1=L1;const D1=qt,$1=(t,e,r)=>D1(t,e,r)>0;var co=$1;const B1=qt,j1=(t,e,r)=>B1(t,e,r)<0;var Fc=j1;const F1=qt,W1=(t,e,r)=>F1(t,e,r)===0;var dd=W1;const H1=qt,V1=(t,e,r)=>H1(t,e,r)!==0;var pd=V1;const U1=qt,z1=(t,e,r)=>U1(t,e,r)>=0;var Wc=z1;const q1=qt,G1=(t,e,r)=>q1(t,e,r)<=0;var Hc=G1;const J1=dd,Z1=pd,Q1=co,Y1=Wc,K1=Fc,X1=Hc,ew=(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 J1(t,r,n);case"!=":return Z1(t,r,n);case">":return Q1(t,r,n);case">=":return Y1(t,r,n);case"<":return K1(t,r,n);case"<=":return X1(t,r,n);default:throw new TypeError(`Invalid operator: ${e}`)}};var gd=ew;const tw=_t,rw=di,{safeRe:bs,t:vs}=Ki,nw=(t,e)=>{if(t instanceof tw)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(bs[vs.COERCE]);else{let n;for(;(n=bs[vs.COERCERTL].exec(t))&&(!r||r.index+r[0].length!==t.length);)(!r||n.index+n[0].length!==r.index+r[0].length)&&(r=n),bs[vs.COERCERTL].lastIndex=n.index+n[1].length+n[2].length;bs[vs.COERCERTL].lastIndex=-1}return r===null?null:rw(`${r[2]}.${r[3]||"0"}.${r[4]||"0"}`,e)};var iw=nw,ya,Ol;function sw(){return Ol||(Ol=1,ya=function(t){t.prototype[Symbol.iterator]=function*(){for(let e=this.head;e;e=e.next)yield e.value}}),ya}var ow=he;he.Node=cn;he.create=he;function he(t){var e=this;if(e instanceof he||(e=new he),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}he.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};he.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++}};he.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++}};he.prototype.push=function(){for(var t=0,e=arguments.length;t<e;t++)cw(this,arguments[t]);return this.length};he.prototype.unshift=function(){for(var t=0,e=arguments.length;t<e;t++)uw(this,arguments[t]);return this.length};he.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}};he.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}};he.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};he.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};he.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};he.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};he.prototype.map=function(t,e){e=e||this;for(var r=new he,n=this.head;n!==null;)r.push(t.call(e,n.value,this)),n=n.next;return r};he.prototype.mapReverse=function(t,e){e=e||this;for(var r=new he,n=this.tail;n!==null;)r.push(t.call(e,n.value,this)),n=n.prev;return r};he.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;
vendor: 10,991 bytes, line 4
4i++)r=t(r,n.value,i),n=n.next;return r};he.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};he.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};he.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};he.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 he;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};he.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 he;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};he.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=aw(this,i,r[n]);return s};he.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 aw(t,e,r){var n=e===t.head?new cn(r,null,e,t):new cn(r,e,e.next,t);return n.next===null&&(t.tail=n),n.prev===null&&(t.head=n),t.length++,n}function cw(t,e){t.tail=new cn(e,t.tail,null,t),t.head||(t.head=t.tail),t.length++}function uw(t,e){t.head=new cn(e,null,t.head,t),t.tail||(t.tail=t.head),t.length++}function cn(t,e,r,n){if(!(this instanceof cn))return new cn(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{sw()(he)}catch{}const lw=ow,Xr=Symbol("max"),hr=Symbol("length"),Nn=Symbol("lengthCalculator"),Ai=Symbol("allowStale"),rn=Symbol("maxAge"),ur=Symbol("dispose"),Ll=Symbol("noDisposeOnSet"),ot=Symbol("lruList"),Ht=Symbol("cache"),bd=Symbol("updateAgeOnGet"),ma=()=>1;class fw{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[Xr]=e.max||1/0;const r=e.length||ma;if(this[Nn]=typeof r!="function"?ma:r,this[Ai]=e.stale||!1,e.maxAge&&typeof e.maxAge!="number")throw new TypeError("maxAge must be a number");this[rn]=e.maxAge||0,this[ur]=e.dispose,this[Ll]=e.noDisposeOnSet||!1,this[bd]=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[Xr]=e||1/0,wi(this)}get max(){return this[Xr]}set allowStale(e){this[Ai]=!!e}get allowStale(){return this[Ai]}set maxAge(e){if(typeof e!="number")throw new TypeError("maxAge must be a non-negative number");this[rn]=e,wi(this)}get maxAge(){return this[rn]}set lengthCalculator(e){typeof e!="function"&&(e=ma),e!==this[Nn]&&(this[Nn]=e,this[hr]=0,this[ot].forEach(r=>{r.length=this[Nn](r.value,r.key),this[hr]+=r.length})),wi(this)}get lengthCalculator(){return this[Nn]}get length(){return this[hr]}get itemCount(){return this[ot].length}rforEach(e,r){r=r||this;for(let n=this[ot].tail;n!==null;){const i=n.prev;Pl(this,e,n,r),n=i}}forEach(e,r){r=r||this;for(let n=this[ot].head;n!==null;){const i=n.next;Pl(this,e,n,r),n=i}}keys(){return this[ot].toArray().map(e=>e.key)}values(){return this[ot].toArray().map(e=>e.value)}reset(){this[ur]&&this[ot]&&this[ot].length&&this[ot].forEach(e=>this[ur](e.key,e.value)),this[Ht]=new Map,this[ot]=new lw,this[hr]=0}dump(){return this[ot].map(e=>Ls(this,e)?!1:{k:e.key,v:e.value,e:e.now+(e.maxAge||0)}).toArray().filter(e=>e)}dumpLru(){return this[ot]}set(e,r,n){if(n=n||this[rn],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[Ht].has(e)){if(s>this[Xr])return Un(this,this[Ht].get(e)),!1;const u=this[Ht].get(e).value;return this[ur]&&(this[Ll]||this[ur](e,u.value)),u.now=i,u.maxAge=n,u.value=r,this[hr]+=s-u.length,u.length=s,this.get(e),wi(this),!0}const o=new hw(e,r,s,i,n);return o.length>this[Xr]?(this[ur]&&this[ur](e,r),!1):(this[hr]+=o.length,this[ot].unshift(o),this[Ht].set(e,this[ot].head),wi(this),!0)}has(e){if(!this[Ht].has(e))return!1;const r=this[Ht].get(e).value;return!Ls(this,r)}get(e){return wa(this,e,!0)}peek(e){return wa(this,e,!1)}pop(){const e=this[ot].tail;return e?(Un(this,e),e.value):null}del(e){Un(this,this[Ht].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[Ht].forEach((e,r)=>wa(this,r,!1))}}const wa=(t,e,r)=>{const n=t[Ht].get(e);if(n){const i=n.value;if(Ls(t,i)){if(Un(t,n),!t[Ai])return}else r&&(t[bd]&&(n.value.now=Date.now()),t[ot].unshiftNode(n));return i.value}},Ls=(t,e)=>{if(!e||!e.maxAge&&!t[rn])return!1;const r=Date.now()-e.now;return e.maxAge?r>e.maxAge:t[rn]&&r>t[rn]},wi=t=>{if(t[hr]>t[Xr])for(let e=t[ot].tail;t[hr]>t[Xr]&&e!==null;){const r=e.prev;Un(t,e),e=r}},Un=(t,e)=>{if(e){const r=e.value;t[ur]&&t[ur](r.key,r.value),t[hr]-=r.length,t[Ht].delete(r.key),t[ot].removeNode(e)}};class hw{constructor(e,r,n,i,s){this.key=e,this.value=r,this.length=n,this.now=i,this.maxAge=s||0}}const Pl=(t,e,r,n)=>{let i=r.value;Ls(t,i)&&(Un(t,r),t[Ai]||(i=void 0)),i&&e.call(n,i.value,i.key,t)};var dw=fw,_a,Dl;function Gt(){if(Dl)return _a;Dl=1;class t{constructor(c,h){if(h=n(h),c instanceof t)return c.loose===!!h.loose&&c.includePrerelease===!!h.includePrerelease?c:new t(c.raw,h);if(c instanceof i)return this.raw=c.value,this.set=[[c]],this.format(),this;if(this.options=h,this.loose=!!h.loose,this.includePrerelease=!!h.includePrerelease,this.raw=c.trim().split(/\s+/).join(" "),this.set=this.raw.split("||").map(p=>this.parseRange(p.trim())).filter(p=>p.length),!this.set.length)throw new TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){const p=this.set[0];if(this.set=this.set.filter(v=>!A(v[0])),this.set.length===0)this.set=[p];else if(this.set.length>1){for(const v of this.set)if(v.length===1&&D(v[0])){this.set=[v];break}}}this.format()}format(){return this.range=this.set.map(c=>c.join(" ").trim()).join("||").trim(),this.range}toString(){return this.range}parseRange(c){const p=((this.options.includePrerelease&&y)|(this.options.loose&&C))+":"+c,v=r.get(p);if(v)return v;const w=this.options.loose,M=w?a[u.HYPHENRANGELOOSE]:a[u.HYPHENRANGE];c=c.replace(M,Y(this.options.includePrerelease)),s("hyphen replace",c),c=c.replace(a[u.COMPARATORTRIM],l),s("comparator trim",c),c=c.replace(a[u.TILDETRIM],d),s("tilde trim",c),c=c.replace(a[u.CARETTRIM],g),s("caret trim",c);let k=c.split(" ").map(U=>x(U,this.options)).join(" ").split(/\s+/).map(U=>K(U,this.options));w&&(k=k.filter(U=>(s("loose invalid filter",U,this.options),!!U.match(a[u.COMPARATORLOOSE])))),s("range list",k);const m=new Map,f=k.map(U=>new i(U,this.options));for(const U of f){if(A(U))return[U];m.set(U.value,U)}m.size>1&&m.has("")&&m.delete("");const E=[...m.values()];return r.set(p,E),E}intersects(c,h){if(!(c instanceof t))throw new TypeError("a Range is required");return this.set.some(p=>O(p,h)&&c.set.some(v=>O(v,h)&&p.every(w=>v.every(M=>w.intersects(M,h)))))}test(c){if(!c)return!1;if(typeof c=="string")try{c=new o(c,this.options)}catch{return!1}for(let h=0;h<this.set.length;h++)if(X(this.set[h],c,this.options))return!0;return!1}}_a=t;const e=dw,r=new e({max:1e3}),n=Bc,i=uo(),s=ao,o=_t,{safeRe:a,t:u,comparatorTrimReplace:l,tildeTrimReplace:d,caretTrimReplace:g}=Ki,{FLAG_INCLUDE_PRERELEASE:y,FLAG_LOOSE:C}=oo,A=b=>b.value==="<0.0.0-0",D=b=>b.value==="",O=(b,c)=>{let h=!0;const p=b.slice();let v=p.pop();for(;h&&p.length;)h=p.every(w=>v.intersects(w,c)),v=p.pop();return h},x=(b,c)=>(s("comp",b,c),b=L(b,c),s("caret",b),b=N(b,c),s("tildes",b),b=G(b,c),s("xrange",b),b=W(b,c),s("stars",b),b),I=b=>!b||b.toLowerCase()==="x"||b==="*",N=(b,c)=>b.trim().split(/\s+/).map(h=>P(h,c)).join(" "),P=(b,c)=>{const h=c.loose?a[u.TILDELOOSE]:a[u.TILDE];return b.replace(h,(p,v,w,M,k)=>{s("tilde",b,p,v,w,M,k);let m;return I(v)?m="":I(w)?m=`>=${v}.0.0 <${+v+1}.0.0-0`:I(M)?m=`>=${v}.${w}.0 <${v}.${+w+1}.0-0`:k?(s("replaceTilde pr",k),m=`>=${v}.${w}.${M}-${k} <${v}.${+w+1}.0-0`):m=`>=${v}.${w}.${M} <${v}.${+w+1}.0-0`,s("tilde return",m),m})},L=(b,c)=>b.trim().split(/\s+/).map(h=>B(h,c)).join(" "),B=(b,c)=>{s("caret",b,c);const h=c.loose?a[u.CARETLOOSE]:a[u.CARET],p=c.includePrerelease?"-0":"";return b.replace(h,(v,w,M,k,m)=>{s("caret",b,v,w,M,k,m);let f;return I(w)?f="":I(M)?f=`>=${w}.0.0${p} <${+w+1}.0.0-0`:I(k)?w==="0"?f=`>=${w}.${M}.0${p} <${w}.${+M+1}.0-0`:f=`>=${w}.${M}.0${p} <${+w+1}.0.0-0`:m?(s("replaceCaret pr",m),w==="0"?M==="0"?f=`>=${w}.${M}.${k}-${m} <${w}.${M}.${+k+1}-0`:f=`>=${w}.${M}.${k}-${m} <${w}.${+M+1}.0-0`:f=`>=${w}.${M}.${k}-${m} <${+w+1}.0.0-0`):(s("no pr"),w==="0"?M==="0"?f=`>=${w}.${M}.${k}${p} <${w}.${M}.${+k+1}-0`:f=`>=${w}.${M}.${k}${p} <${w}.${+M+1}.0-0`:f=`>=${w}.${M}.${k} <${+w+1}.0.0-0`),s("caret return",f),f})},G=(b,c)=>(s("replaceXRanges",b,c),b.split(/\s+/).map(h=>z(h,c)).join(" ")),z=(b,c)=>{b=b.trim();const h=c.loose?a[u.XRANGELOOSE]:a[u.XRANGE];return b.replace(h,(p,v,w,M,k,m)=>{s("xRange",b,p,v,w,M,k,m);const f=I(w),E=f||I(M),U=E||I(k),q=U;return v==="="&&q&&(v=""),m=c.includePrerelease?"-0":"",f?v===">"||v==="<"?p="<0.0.0-0":p="*":v&&q?(E&&(M=0),k=0,v===">"?(v=">=",E?(w=+w+1,M=0,k=0):(M=+M+1,k=0)):v==="<="&&(v="<",E?w=+w+1:M=+M+1),v==="<"&&(m="-0"),p=`${v+w}.${M}.${k}${m}`):E?p=`>=${w}.0.0${m} <${+w+1}.0.0-0`:U&&(p=`>=${w}.${M}.0${m} <${w}.${+M+1}.0-0`),s("xRange return",p),p})},W=(b,c)=>(s("replaceStars",b,c),b.trim().replace(a[u.STAR],"")),K=(b,c)=>(s("replaceGTE0",b,c),b.trim().replace(a[c.includePrerelease?u.GTE0PRE:u.GTE0],"")),Y=b=>(c,h,p,v,w,M,k,m,f,E,U,q,R)=>(I(p)?h="":I(v)?h=`>=${p}.0.0${b?"-0":""}`:I(w)?h=`>=${p}.${v}.0${b?"-0":""}`:M?h=`>=${h}`:h=`>=${h}${b?"-0":""}`,I(f)?m="":I(E)?m=`<${+f+1}.0.0-0`:I(U)?m=`<${f}.${+E+1}.0-0`:q?m=`<=${f}.${E}.${U}-${q}`:b?m=`<${f}.${E}.${+U+1}-0`:m=`<=${m}`,`${h} ${m}`.trim()),X=(b,c,h)=>{for(let p=0;p<b.length;p++)if(!b[p].test(c))return!1;if(c.prerelease.length&&!h.includePrerelease){for(let p=0;p<b.length;p++)if(s(b[p].semver),b[p].semver!==i.ANY&&b[p].semver.prerelease.length>0){const v=b[p].semver;if(v.major===c.major&&v.minor===c.minor&&v.patch===c.patch)return!0}return!1}return!0};return _a}var Sa,$l;function uo(){if($l)return Sa;$l=1;const t=Symbol("SemVer ANY");class e{static get ANY(){return t}constructor(d,g){if(g=r(g),d instanceof e){if(d.loose===!!g.loose)return d;d=d.value}
vendor: 4,323 bytes, line 4
4d=d.trim().split(/\s+/).join(" "),o("comparator",d,g),this.options=g,this.loose=!!g.loose,this.parse(d),this.semver===t?this.value="":this.value=this.operator+this.semver.version,o("comp",this)}parse(d){const g=this.options.loose?n[i.COMPARATORLOOSE]:n[i.COMPARATOR],y=d.match(g);if(!y)throw new TypeError(`Invalid comparator: ${d}`);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(d){if(o("Comparator.test",d,this.options.loose),this.semver===t||d===t)return!0;if(typeof d=="string")try{d=new a(d,this.options)}catch{return!1}return s(d,this.operator,this.semver,this.options)}intersects(d,g){if(!(d instanceof e))throw new TypeError("a Comparator is required");return this.operator===""?this.value===""?!0:new u(d.value,g).test(this.value):d.operator===""?d.value===""?!0:new u(this.value,g).test(d.semver):(g=r(g),g.includePrerelease&&(this.value==="<0.0.0-0"||d.value==="<0.0.0-0")||!g.includePrerelease&&(this.value.startsWith("<0.0.0")||d.value.startsWith("<0.0.0"))?!1:!!(this.operator.startsWith(">")&&d.operator.startsWith(">")||this.operator.startsWith("<")&&d.operator.startsWith("<")||this.semver.version===d.semver.version&&this.operator.includes("=")&&d.operator.includes("=")||s(this.semver,"<",d.semver,g)&&this.operator.startsWith(">")&&d.operator.startsWith("<")||s(this.semver,">",d.semver,g)&&this.operator.startsWith("<")&&d.operator.startsWith(">")))}}Sa=e;const r=Bc,{safeRe:n,t:i}=Ki,s=gd,o=ao,a=_t,u=Gt();return Sa}const pw=Gt(),gw=(t,e,r)=>{try{e=new pw(e,r)}catch{return!1}return e.test(t)};var lo=gw;const bw=Gt(),vw=(t,e)=>new bw(t,e).set.map(r=>r.map(n=>n.value).join(" ").trim().split(" "));var yw=vw;const mw=_t,ww=Gt(),_w=(t,e,r)=>{let n=null,i=null,s=null;try{s=new ww(e,r)}catch{return null}return t.forEach(o=>{s.test(o)&&(!n||i.compare(o)===-1)&&(n=o,i=new mw(n,r))}),n};var Sw=_w;const Ew=_t,xw=Gt(),Mw=(t,e,r)=>{let n=null,i=null,s=null;try{s=new xw(e,r)}catch{return null}return t.forEach(o=>{s.test(o)&&(!n||i.compare(o)===1)&&(n=o,i=new Ew(n,r))}),n};var Cw=Mw;const Ea=_t,Rw=Gt(),Bl=co,Iw=(t,e)=>{t=new Rw(t,e);let r=new Ea("0.0.0");if(t.test(r)||(r=new Ea("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 Ea(o.semver.version);switch(o.operator){case">":a.prerelease.length===0?a.patch++:a.prerelease.push(0),a.raw=a.format();case"":case">=":(!s||Bl(a,s))&&(s=a);break;case"<":case"<=":break;default:throw new Error(`Unexpected operation: ${o.operator}`)}}),s&&(!r||Bl(r,s))&&(r=s)}return r&&t.test(r)?r:null};var Aw=Iw;const kw=Gt(),Tw=(t,e)=>{try{return new kw(t,e).range||"*"}catch{return null}};var Nw=Tw;const Ow=_t,vd=uo(),{ANY:Lw}=vd,Pw=Gt(),Dw=lo,jl=co,Fl=Fc,$w=Hc,Bw=Wc,jw=(t,e,r,n)=>{t=new Ow(t,n),e=new Pw(e,n);let i,s,o,a,u;switch(r){case">":i=jl,s=$w,o=Fl,a=">",u=">=";break;case"<":i=Fl,s=Bw,o=jl,a="<",u="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(Dw(t,e,n))return!1;for(let l=0;l<e.set.length;++l){const d=e.set[l];let g=null,y=null;if(d.forEach(C=>{C.semver===Lw&&(C=new vd(">=0.0.0")),g=g||C,y=y||C,i(C.semver,g.semver,n)?g=C:o(C.semver,y.semver,n)&&(y=C)}),g.operator===a||g.operator===u||(!y.operator||y.operator===a)&&s(t,y.semver))return!1;if(y.operator===u&&o(t,y.semver))return!1}return!0};var Vc=jw;const Fw=Vc,Ww=(t,e,r)=>Fw(t,e,">",r);var Hw=Ww;const Vw=Vc,Uw=(t,e,r)=>Vw(t,e,"<",r);var zw=Uw;const Wl=Gt(),qw=(t,e,r)=>(t=new Wl(t,r),e=new Wl(e,r),t.intersects(e,r));var Gw=qw;const Jw=lo,Zw=qt;var Qw=(t,e,r)=>{const n=[];let i=null,s=null;const o=t.sort((d,g)=>Zw(d,g,r));for(const d of o)Jw(d,e,r)?(s=d,i||(i=d)):(s&&n.push([i,s]),s=null,i=null);i&&n.push([i,null]);const a=[];for(const[d,g]of n)d===g?a.push(d):!g&&d===o[0]?a.push("*"):g?d===o[0]?a.push(`<=${g}`):a.push(`${d} - ${g}`):a.push(`>=${d}`);const u=a.join(" || "),l=typeof e.raw=="string"?e.raw:String(e);return u.length<l.length?u:e};const Hl=Gt(),Uc=uo(),{ANY:xa}=Uc,_i=lo,zc=qt,Yw=(t,e,r={})=>{if(t===e)return!0;t=new Hl(t,r),e=new Hl(e,r);let n=!1;e:for(const i of t.set){for(const s of e.set){const o=Xw(i,s,r);if(n=n||o!==null,o)continue e}if(n)return!1}return!0},Kw=[new Uc(">=0.0.0-0")],Vl=[new Uc(">=0.0.0")],Xw=(t,e,r)=>{if(t===e)return!0;
4if(t.length===1&&t[0].semver===xa){if(e.length===1&&e[0].semver===xa)return!0;r.includePrerelease?t=Kw:t=Vl}if(e.length===1&&e[0].semver===xa){if(r.includePrerelease)return!0;e=Vl}const n=new Set;let i,s;for(const C of t)C.operator===">"||C.operator===">="?i=Ul(i,C,r):C.operator==="<"||C.operator==="<="?s=zl(s,C,r):n.add(C.semver);if(n.size>1)return null;let o;if(i&&s){if(o=zc(i.semver,s.semver,r),o>0)return null;if(o===0&&(i.operator!==">="||s.operator!=="<="))return null}for(const C of n){if(i&&!_i(C,String(i),r)||s&&!_i(C,String(s),r))return null;for(const A of e)if(!_i(C,String(A),r))return!1;return!0}let a,u,l,d,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 C of e){if(d=d||C.operator===">"||C.operator===">=",l=l||C.operator==="<"||C.operator==="<=",i){if(y&&C.semver.prerelease&&C.semver.prerelease.length&&C.semver.major===y.major&&C.semver.minor===y.minor&&C.semver.patch===y.patch&&(y=!1),C.operator===">"||C.operator===">="){if(a=Ul(i,C,r),a===C&&a!==i)return!1}else if(i.operator===">="&&!_i(i.semver,String(C),r))return!1}if(s){if(g&&C.semver.prerelease&&C.semver.prerelease.length&&C.semver.major===g.major&&C.semver.minor===g.minor&&C.semver.patch===g.patch&&(g=!1),C.operator==="<"||C.operator==="<="){if(u=zl(s,C,r),u===C&&u!==s)return!1}else if(s.operator==="<="&&!_i(s.semver,String(C),r))return!1}if(!C.operator&&(s||i)&&o!==0)return!1}return!(i&&l&&!s&&o!==0||s&&d&&!i&&o!==0||y||g)},Ul=(t,e,r)=>{if(!t)return e;const n=zc(t.semver,e.semver,r);return n>0?t:n<0||e.operator===">"&&t.operator===">="?e:t},zl=(t,e,r)=>{if(!t)return e;const n=zc(t.semver,e.semver,r);return n<0?t:n>0||e.operator==="<"&&t.operator==="<="?e:t};var e_=Yw;const Ma=Ki,ql=oo,t_=_t,Gl=hd,r_=di,n_=r1,i_=s1,s_=a1,o_=u1,a_=h1,c_=g1,u_=y1,l_=_1,f_=qt,h_=M1,d_=I1,p_=jc,g_=N1,b_=P1,v_=co,y_=Fc,m_=dd,w_=pd,__=Wc,S_=Hc,E_=gd,x_=iw,M_=uo(),C_=Gt(),R_=lo,I_=yw,A_=Sw,k_=Cw,T_=Aw,N_=Nw,O_=Vc,L_=Hw,P_=zw,D_=Gw,$_=Qw,B_=e_;var j_={parse:r_,valid:n_,clean:i_,inc:s_,diff:o_,major:a_,minor:c_,patch:u_,prerelease:l_,compare:f_,rcompare:h_,compareLoose:d_,compareBuild:p_,sort:g_,rsort:b_,gt:v_,lt:y_,eq:m_,neq:w_,gte:__,lte:S_,cmp:E_,coerce:x_,Comparator:M_,Range:C_,satisfies:R_,toComparators:I_,maxSatisfying:A_,minSatisfying:k_,minVersion:T_,validRange:N_,outside:O_,gtr:L_,ltr:P_,intersects:D_,simplifyRange:$_,subset:B_,SemVer:t_,re:Ma.re,src:Ma.src,tokens:Ma.t,SEMVER_SPEC_VERSION:ql.SEMVER_SPEC_VERSION,RELEASE_TYPES:ql.RELEASE_TYPES,compareIdentifiers:Gl.compareIdentifiers,rcompareIdentifiers:Gl.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=j_,r=vn,n=ht;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 u(g,y){return(0,e.gt)(g,y)}t.gtVersion=u;function l(g,y){return(0,e.gtr)(g,y)}t.gtRange=l;function d(g,y){return(0,e.satisfies)(g,y,{includePrerelease:!0})}t.satisfiesVersionRange=d})(ud);(function(t){var e=J&&J.__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=J&&J.__exportStar||function(n,i){for(var s in n)s!=="default"&&!Object.prototype.hasOwnProperty.call(i,s)&&e(i,n,s)};
4Object.defineProperty(t,"__esModule",{value:!0}),r(ht,t),r(Qi,t),r(fe,t),r(io,t),r(nr,t),r(Kn,t),r(Yi,t),r(od,t),r(Xn,t),r($c,t),r(ir,t),r(ad,t),r(cd,t),r(ud,t)})(Wh);(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.createModuleLogger=t.projectLogger=void 0;const e=Wh;Object.defineProperty(t,"createModuleLogger",{enumerable:!0,get:function(){return e.createModuleLogger}}),t.projectLogger=(0,e.createProjectLogger)("eth-block-tracker")})(Fh);var yd=J&&J.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(ro,"__esModule",{value:!0});ro.PollingBlockTracker=void 0;const F_=yd(Rc),W_=yd(cy),H_=Ji,Jl=Fh,Zl=(0,Jl.createModuleLogger)(Jl.projectLogger,"polling-block-tracker"),V_=(0,F_.default)(),U_=1e3;class z_ extends H_.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*U_,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=Ql(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: 5${(e=r.stack)!==null&&e!==void 0?e:r}`);try{this.emit("error",n)}catch{console.error(n)}const i=Ql(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:V_(),method:"eth_blockNumber",params:[]};this._setSkipCacheFlag&&(e.skipCache=!0),Zl("Making request",e);const r=await(0,W_.default)(n=>this._provider.sendAsync(e,n))();if(Zl("Got response",r),r.error)throw new Error(`PollingBlockTracker - encountered error fetching block: 6${r.error.message}`);return r.result}}ro.PollingBlockTracker=z_;function Ql(t,e){return new Promise(r=>{const n=setTimeout(r,t);n.unref&&e&&n.unref()})}var fo={},q_=J&&J.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(fo,"__esModule",{value:!0});fo.SubscribeBlockTracker=void 0;const G_=q_(Rc),J_=Ji,Z_=(0,G_.default)();class Q_ extends J_.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()}
6async _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:Z_(),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=Q_;var md={};Object.defineProperty(md,"__esModule",{value:!0});(function(t){var e=J&&J.__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=J&&J.__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(ro,t),r(fo,t),r(md,t)})(jh);var qc={},ho={},Xi={};Object.defineProperty(Xi,"__esModule",{value:!0});Xi.getUniqueId=void 0;const wd=4294967295;let Ca=Math.floor(Math.random()*wd);function Y_(){return Ca=(Ca+1)%wd,Ca}Xi.getUniqueId=Y_;Object.defineProperty(ho,"__esModule",{value:!0});ho.createIdRemapMiddleware=void 0;const K_=Xi;function X_(){return(t,e,r,n)=>{const i=t.id,s=K_.getUniqueId();t.id=s,e.id=s,r(o=>{t.id=i,e.id=i,o()})}}ho.createIdRemapMiddleware=X_;var po={};Object.defineProperty(po,"__esModule",{value:!0});po.createAsyncMiddleware=void 0;function e2(t){return async(e,r,n,i)=>{let s;const o=new Promise(d=>{s=d});let a=null,u=!1;const l=async()=>{u=!0,n(d=>{a=d,s()}),await o};try{await t(e,r,l),u?(await o,a(null)):i(null)}catch(d){a?a(d):i(d)}}}po.createAsyncMiddleware=e2;var go={};Object.defineProperty(go,"__esModule",{value:!0});go.createScaffoldMiddleware=void 0;function t2(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())}}go.createScaffoldMiddleware=t2;var es={},r2=J&&J.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(es,"__esModule",{value:!0});es.JsonRpcEngine=void 0;const n2=r2(hn),kt=dc;class lr extends n2.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 lr._runAllMiddleware(e,r,this._middleware);return o?(await lr._runReturnHandlers(a),i(s)):n(async u=>{try{await lr._runReturnHandlers(a)}catch(l){return u(l)}return u()})}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 kt.EthereumRpcError(kt.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 kt.EthereumRpcError(kt.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=kt.serializeError(s))),r(s,i)}async _processRequest(e,r){const[n,i,s]=await lr._runAllMiddleware(e,r,this._middleware);if(lr._checkForCompletion(e,r,i),await lr._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 lr._runMiddleware(e,r,a,i),o)break;return[s,o,i.reverse()]}static _runMiddleware(e,r,n,i){return new Promise(s=>{const o=u=>{const l=u||r.error;l&&(r.error=kt.serializeError(l)),s([l,!0])},a=u=>{r.error?o(r.error):(u&&(typeof u!="function"&&o(new kt.EthereumRpcError(kt.errorCodes.rpc.internal,`JsonRpcEngine: "next" return handlers must be functions. Received "${typeof u}" for request: 7${Ra(e)}`,{request:e})),i.push(u)),s([null,!1]))};try{n(e,r,a,o)}catch(u){o(u)}})}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 kt.EthereumRpcError(kt.errorCodes.rpc.internal,`JsonRpcEngine: Response has no error or result for request: 8${Ra(e)}`,{request:e});if(!n)throw new kt.EthereumRpcError(kt.errorCodes.rpc.internal,`JsonRpcEngine: Nothing ended request: 9${Ra(e)}`,{request:e})}}es.JsonRpcEngine=lr;function Ra(t){return JSON.stringify(t,null,2)}var bo={};Object.defineProperty(bo,"__esModule",{value:!0});bo.mergeMiddleware=void 0;const i2=es;function s2(t){const e=new i2.JsonRpcEngine;return t.forEach(r=>e.push(r)),e.asMiddleware()}bo.mergeMiddleware=s2;(function(t){var e=J&&J.__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]}
9),r=J&&J.__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(ho,t),r(po,t),r(go,t),r(Xi,t),r(es,t),r(bo,t)})(qc);var _d={},Gc={};const Jc=fn(Cp);var vo={};Object.defineProperty(vo,"__esModule",{value:!0});var Yl=Jc,o2=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 Yl.__awaiter(this,void 0,void 0,function(){var r,n,i;return Yl.__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}();vo.default=o2;Object.defineProperty(Gc,"__esModule",{value:!0});var Kl=Jc,a2=vo,c2=function(){function t(){this._semaphore=new a2.default(1)}return t.prototype.acquire=function(){return Kl.__awaiter(this,void 0,void 0,function(){var e,r;return Kl.__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}();Gc.default=c2;var yo={};Object.defineProperty(yo,"__esModule",{value:!0});yo.withTimeout=void 0;var ys=Jc;function u2(t,e,r){var n=this;return r===void 0&&(r=new Error("timeout")),{acquire:function(){return new Promise(function(i,s){return ys.__awaiter(n,void 0,void 0,function(){var o,a,u;return ys.__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?(u=Array.isArray(a)?a[1]:a,u()):i(a),[2]}})})})},runExclusive:function(i){return ys.__awaiter(this,void 0,void 0,function(){var s,o;return ys.__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()}}}yo.withTimeout=u2;(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.withTimeout=t.Semaphore=t.Mutex=void 0;var e=Gc;Object.defineProperty(t,"Mutex",{enumerable:!0,get:function(){return e.default}});var r=vo;Object.defineProperty(t,"Semaphore",{enumerable:!0,get:function(){return r.default}});var n=yo;Object.defineProperty(t,"withTimeout",{enumerable:!0,get:function(){return n.withTimeout}})})(_d);var l2=h2,f2=Object.prototype.hasOwnProperty;function h2(){for(var t={},e=0;e<arguments.length;e++){var r=arguments[e];for(var n in r)f2.call(r,n)&&(t[n]=r[n])}return t}const d2=l2,p2=Rc();var g2=ne;function ne(t){const e=this;e.currentProvider=t}ne.prototype.getBalance=ts(2,"eth_getBalance");ne.prototype.getCode=ts(2,"eth_getCode");ne.prototype.getTransactionCount=ts(2,"eth_getTransactionCount");ne.prototype.getStorageAt=ts(3,"eth_getStorageAt");ne.prototype.call=ts(2,"eth_call");ne.prototype.protocolVersion=ce("eth_protocolVersion");ne.prototype.syncing=ce("eth_syncing");ne.prototype.coinbase=ce("eth_coinbase");ne.prototype.mining=ce("eth_mining");ne.prototype.hashrate=ce("eth_hashrate");ne.prototype.gasPrice=ce("eth_gasPrice");ne.prototype.accounts=ce("eth_accounts");ne.prototype.blockNumber=ce("eth_blockNumber");ne.prototype.getBlockTransactionCountByHash=ce("eth_getBlockTransactionCountByHash");ne.prototype.getBlockTransactionCountByNumber=ce("eth_getBlockTransactionCountByNumber");ne.prototype.getUncleCountByBlockHash=ce("eth_getUncleCountByBlockHash");ne.prototype.getUncleCountByBlockNumber=ce("eth_getUncleCountByBlockNumber");ne.prototype.sign=ce("eth_sign");ne.prototype.sendTransaction=ce("eth_sendTransaction");ne.prototype.sendRawTransaction=ce("eth_sendRawTransaction");ne.prototype.estimateGas=ce("eth_estimateGas");ne.prototype.getBlockByHash=ce("eth_getBlockByHash");ne.prototype.getBlockByNumber=ce("eth_getBlockByNumber");ne.prototype.getTransactionByHash=ce("eth_getTransactionByHash");ne.prototype.getTransactionByBlockHashAndIndex=ce("eth_getTransactionByBlockHashAndIndex");ne.prototype.getTransactionByBlockNumberAndIndex=ce("eth_getTransactionByBlockNumberAndIndex");ne.prototype.getTransactionReceipt=ce("eth_getTransactionReceipt");ne.prototype.getUncleByBlockHashAndIndex=ce("eth_getUncleByBlockHashAndIndex");ne.prototype.getUncleByBlockNumberAndIndex=ce("eth_getUncleByBlockNumberAndIndex");ne.prototype.getCompilers=ce("eth_getCompilers");ne.prototype.compileLLL=ce("eth_compileLLL");ne.prototype.compileSolidity=ce("eth_compileSolidity");ne.prototype.compileSerpent=ce("eth_compileSerpent");ne.prototype.newFilter=ce("eth_newFilter");ne.prototype.newBlockFilter=ce("eth_newBlockFilter");ne.prototype.newPendingTransactionFilter=ce("eth_newPendingTransactionFilter");ne.prototype.uninstallFilter=ce("eth_uninstallFilter");ne.prototype.getFilterChanges=ce("eth_getFilterChanges");ne.prototype.getFilterLogs=ce("eth_getFilterLogs");ne.prototype.getLogs=ce("eth_getLogs");ne.prototype.getWork=ce("eth_getWork");ne.prototype.submitWork=ce("eth_submitWork");ne.prototype.submitHashrate=ce("eth_submitHashrate");ne.prototype.sendAsync=function(t,e){this.currentProvider.sendAsync(b2(t),function(n,i){if
9(!n&&i.error&&(n=new Error("EthQuery - RPC Error - "+i.error.message)),n)return e(n);e(null,i.result)})};function ce(t){return function(){const e=this;var r=[].slice.call(arguments),n=r.pop();e.sendAsync({method:t,params:r},n)}}function ts(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 b2(t){return d2({id:p2(),jsonrpc:"2.0",params:[]},t)}const Xl=(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,d)=>{l?a(l):o(d)}):i.push(o),Reflect.apply(t,this===r?n:this,i)})},ef=new WeakMap;var v2=(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 u=ef.get(o);if(u||(u={},ef.set(o,u)),a in u)return u[a];const l=A=>typeof A=="string"||typeof a=="symbol"?a===A:A.test(a),d=Reflect.getOwnPropertyDescriptor(o,a),g=d===void 0||d.writable||d.configurable,C=(e.include?e.include.some(l):!e.exclude.some(l))&&g;return u[a]=C,C},i=new WeakMap,s=new Proxy(t,{apply(o,a,u){const l=i.get(o);if(l)return Reflect.apply(l,a,u);const d=e.excludeMain?o:Xl(o,e,s,o);return i.set(o,d),Reflect.apply(d,a,u)},get(o,a){const u=o[a];if(!n(o,a)||u===Function.prototype[a])return u;const l=i.get(u);if(l)return l;if(typeof u=="function"){const d=Xl(u,e,s,o);return i.set(u,d),d}return u}});return s};const y2=hn.default;let m2=class extends y2{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 Zc=m2;const w2=Zc;let _2=class extends w2{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 S2=_2,rs={minBlockRef:E2,maxBlockRef:x2,sortBlockRefs:Qc,bnToHex:M2,blockRefIsNumber:C2,hexToInt:Ps,incrementHexInt:R2,intToHex:Sd,unsafeRandomBytes:I2};function E2(...t){return Qc(t)[0]}function x2(...t){const e=Qc(t);return e[e.length-1]}function Qc(t){return t.sort((e,r)=>e==="latest"||r==="earliest"?1:r==="latest"||e==="earliest"?-1:Ps(e)-Ps(r))}function M2(t){return"0x"+t.toString(16)}function C2(t){return t&&!["earliest","latest","pending"].includes(t)}function Ps(t){return t==null?t:Number.parseInt(t,16)}function R2(t){if(t==null)return t;const e=Ps(t);return Sd(e+1)}function Sd(t){if(t==null)return t;let e=t.toString(16);return e.length%2&&(e="0"+e),"0x"+e}function I2(t){let e="0x";for(let r=0;r<t;r++)e+=tf(),e+=tf();return e}function tf(){return Math.floor(Math.random()*16).toString(16)}const A2=g2,k2=v2,T2=S2,{bnToHex:qC,hexToInt:ms,incrementHexInt:N2,minBlockRef:O2,blockRefIsNumber:L2}=rs;let P2=class extends T2{constructor({provider:e,params:r}){super(),this.type="log",this.ethQuery=new A2(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=O2(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=N2(e):i=r;const s=Object.assign({},this.params,{fromBlock:i,toBlock:n}),a=(await this._fetchLogs(s)).filter(u=>this.matchLog(u));this.addResults(a)}async _fetchLogs(e){return await k2(n=>this.ethQuery.getLogs(e,n))()}matchLog(e){if(ms(this.params.fromBlock)>=ms(e.blockNumber)||L2(this.params.toBlock)&&ms(this.params.toBlock)<=ms(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(d=>d.toLowerCase()),a.includes(o))})}};var D2=P2,Yc=$2;async function $2({provider:t,fromBlock:e,toBlock:r}){e||(e=r);const n=rf(e),s=rf(r)-n+1,o=Array(s).fill().map((u,l)=>n+l).map(B2);return await Promise.all(o.map(u=>F2(t,"eth_getBlockByNumber",[u,!1])))}function rf(t){return t==null?t:Number.parseInt(t,16)}function B2(t){return t==null?t:"0x"+t.toString(16)}function j2(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 F2(t,e,r){for(let n=0;n<3;n++)try{return await j2(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 W2=Zc,H2=Yc,{incrementHexInt:V2}=rs;let U2=class extends W2{constructor({provider:e,params:r}){super(),this.type="block",this.provider=e}async update({oldBlock:e,newBlock:r}){const n=r,i=V2(e),o=(await H2({provider:this.provider,fromBlock:i,toBlock:n})).map(a=>a.hash);this.addResults(o)}};var z2=U2;const q2=Zc,G2=Yc,{incrementHexInt:J2}=rs;
9let Z2=class extends q2{constructor({provider:e}){super(),this.type="tx",this.provider=e}async update({oldBlock:e}){const r=e,n=J2(e),i=await G2({provider:this.provider,fromBlock:n,toBlock:r}),s=[];for(const o of i)s.push(...o.transactions);this.addResults(s)}};var Q2=Z2;const Y2=_d.Mutex,{createAsyncMiddleware:K2,createScaffoldMiddleware:X2}=qc,eS=D2,tS=z2,rS=Q2,{intToHex:Ed,hexToInt:Ia}=rs;var nS=iS;function iS({blockTracker:t,provider:e}){let r=0,n={};const i=new Y2,s=sS({mutex:i}),o=X2({eth_newFilter:s(Aa(u)),eth_newBlockFilter:s(Aa(l)),eth_newPendingTransactionFilter:s(Aa(d)),eth_uninstallFilter:s(Cs(C)),eth_getFilterChanges:s(Cs(g)),eth_getFilterLogs:s(Cs(y))}),a=async({oldBlock:I,newBlock:N})=>{if(n.length===0)return;const P=await i.acquire();try{await Promise.all(On(n).map(async L=>{try{await L.update({oldBlock:I,newBlock:N})}catch(B){console.error(B)}}))}catch(L){console.error(L)}P()};return o.newLogFilter=u,o.newBlockFilter=l,o.newPendingTransactionFilter=d,o.uninstallFilter=C,o.getFilterChanges=g,o.getFilterLogs=y,o.destroy=()=>{O()},o;async function u(I){const N=new eS({provider:e,params:I});return await A(N),N}async function l(){const I=new tS({provider:e});return await A(I),I}async function d(){const I=new rS({provider:e});return await A(I),I}async function g(I){const N=Ia(I),P=n[N];if(!P)throw new Error(`No filter for index "${N}"`);return P.getChangesAndClear()}async function y(I){const N=Ia(I),P=n[N];if(!P)throw new Error(`No filter for index "${N}"`);let L=[];return P.type==="log"&&(L=P.getAllResults()),L}async function C(I){const N=Ia(I),L=!!n[N];return L&&await D(N),L}async function A(I){const N=On(n).length,P=await t.getLatestBlock();await I.initialize({currentBlock:P}),r++,n[r]=I,I.id=r,I.idHex=Ed(r);const L=On(n).length;return x({prevFilterCount:N,newFilterCount:L}),r}async function D(I){const N=On(n).length;delete n[I];const P=On(n).length;x({prevFilterCount:N,newFilterCount:P})}async function O(){const I=On(n).length;n={},x({prevFilterCount:I,newFilterCount:0})}function x({prevFilterCount:I,newFilterCount:N}){if(I===0&&N>0){t.on("sync",a);return}if(I>0&&N===0){t.removeListener("sync",a);return}}}function Aa(t){return Cs(async(...e)=>{const r=await t(...e);return Ed(r.id)})}function Cs(t){return K2(async(e,r)=>{const n=await t.apply(null,e.params);r.result=n})}function sS({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 oS=hn.default,{createAsyncMiddleware:nf,createScaffoldMiddleware:aS}=qc,cS=nS,{unsafeRandomBytes:uS,incrementHexInt:lS}=rs,fS=Yc;var hS=dS;function dS({blockTracker:t,provider:e}){const r={},n=cS({blockTracker:t,provider:e});let i=!1;const s=new oS,o=aS({eth_subscribe:nf(a),eth_unsubscribe:nf(u)});return o.destroy=d,{events:s,middleware:o};async function a(g,y){if(i)throw new Error("SubscriptionManager - attempting to use after destroying");const C=g.params[0],A=uS(16);let D;switch(C){case"newHeads":D=O({subId:A});break;case"logs":const I=g.params[1],N=await n.newLogFilter(I);D=x({subId:A,filter:N});break;default:throw new Error(`SubscriptionManager - unsupported subscription type "${C}"`)}r[A]=D,y.result=A;return;function O({subId:I}){const N={type:C,destroy:async()=>{t.removeListener("sync",N.update)},update:async({oldBlock:P,newBlock:L})=>{const B=L,G=lS(P);(await fS({provider:e,fromBlock:G,toBlock:B})).map(pS).filter(K=>K!==null).forEach(K=>{l(I,K)})}};return t.on("sync",N.update),N}function x({subId:I,filter:N}){return N.on("update",L=>l(I,L)),{type:C,destroy:async()=>await n.uninstallFilter(N.idHex)}}}async function u(g,y){if(i)throw new Error("SubscriptionManager - attempting to use after destroying");const C=g.params[0],A=r[C];if(!A){y.result=!1;return}delete r[C],await A.destroy(),y.result=!0}function l(g,y){s.emit("notification",{jsonrpc:"2.0",method:"eth_subscription",params:{subscription:g,result:y}})}function d(){s.removeAllListeners();for(const g in r)r[g].destroy(),delete r[g];i=!0}}function pS(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,gasLim
9it:t.gasLimit,gasUsed:t.gasUsed,nonce:t.nonce,mixHash:t.mixHash,timestamp:t.timestamp,extraData:t.extraData}}Object.defineProperty(to,"__esModule",{value:!0});to.SubscriptionManager=void 0;const gS=jh,bS=hS,sf=()=>{};class vS{constructor(e){const r=new gS.PollingBlockTracker({provider:e,pollingInterval:15e3,setSkipCacheFlag:!0}),{events:n,middleware:i}=bS({blockTracker:r,provider:e});this.events=n,this.subscriptionMiddleware=i}async handleRequest(e){const r={};return await this.subscriptionMiddleware(e,r,sf,sf),r}destroy(){this.subscriptionMiddleware.destroy()}}to.SubscriptionManager=vS;var Kc=J&&J.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(qn,"__esModule",{value:!0});qn.CoinbaseWalletProvider=void 0;const yS=Kc(hn),mS=Kc(zs),ka=oi,me=Bi,of=ai,af=Ut,Ta=Gs,wS=_e,oe=Z,Na=Kc(ny),_S=Yn,ge=Bh,SS=to,cf="DefaultChainId",uf="DefaultJsonRpcUrl";class ES extends yS.default{constructor(e){var r,n;super(),this._filterPolyfill=new _S.FilterPolyfill(this),this._subscriptionManager=new SS.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,this.supportsAddressSwitching=e.supportsAddressSwitching,this.isLedger=e.isLedger;const i=this.getChainId(),s=(0,oe.prepend0x)(i.toString(16));this.emit("connect",{chainIdStr:s});const o=this._storage.getItem(af.LOCAL_STORAGE_ADDRESSES_KEY);if(o){const a=o.split(" ");a[0]!==""&&(this._addresses=a.map(u=>(0,oe.ensureAddressString)(u)),this.emit("accountsChanged",a))}this._subscriptionManager.events.on("notification",a=>{this.emit("message",{type:a.method,data:a.params})}),this._addresses.length>0&&this.initializeRelay(),window.addEventListener("message",a=>{var u;if(!(a.origin!==location.origin||a.source!==window)&&a.data.type==="walletLinkMessage"){if(a.data.data.action==="defaultChainChanged"||a.data.data.action==="dappChainSwitched"){const l=a.data.data.chainId,d=(u=a.data.data.jsonRpcUrl)!==null&&u!==void 0?u:this.jsonRpcUrl;this.updateProviderInfo(d,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,oe.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(uf))!==null&&e!==void 0?e:this._jsonRpcUrlFromOpts}set jsonRpcUrl(e){this._storage.setItem(uf,e)}disableReloadOnDisconnect(){this.reloadOnDisconnect=!1}setProviderInfo(e,r){this.isLedger||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(cf,r.toString(10)),((0,oe.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,u;if((0,oe.ensureIntNumber)(e)===this.getChainId())return!1;const l=await this.initializeRelay(),d=l.inlineAddEthereumChain(e.toString());!this._isAuthorized()&&!d&&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),((u=g.result)===null||u===void 0?void 0:u.isApproved)===!0}async switchEthereumChain(e){const n=await(await this.initializeRelay()).switchEthereumChain(e.toString(10),this.selectedAddress||void 0).promise;if((0,wS.isErrorResponse)(n)&&n.errorCode)throw n.errorCode===me.standardErrorCodes.provider.unsupportedChain?me.standardErrors.provider.unsupportedChain(e):me.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(ka.EVENTS.ETH_ACCOUNTS_STATE,{method:"provider::enable",addresses_length:this._addresses.length,sessionIdHash:this._relay?of.Session.hash(this._relay.session.id):void 0}),this._addresses.length>0?[...this._addresses]:await this.send(ge.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,me.serializeError)(i,e)})}catch(n){throw(0,me.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,me.serializeError)(n,e)})}catch(n){return Promise.reject((0,me.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=>
9i(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,me.serializeError)(r,e.method)})}catch(r){return Promise.reject((0,me.serializeError)(r,e.method))}}async _request(e){if(!e||typeof e!="object"||Array.isArray(e))throw me.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 me.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 me.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,oe.ensureRegExpString)(e)).promise;if(typeof i.result!="string")throw(0,me.serializeError)((r=i.errorMessage)!==null&&r!==void 0?r:"result was not a string",Ta.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,me.serializeError)((n=s.errorMessage)!==null&&n!==void 0?n:"result was not a string",Ta.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,me.serializeError)((r=i.errorMessage)!==null&&r!==void 0?r:"result was not a string",Ta.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,oe.ensureAddressString)(i));JSON.stringify(n)!==JSON.stringify(this._addresses)&&(this._addresses.length>0&&this.supportsAddressSwitching===!1&&!r||(this._addresses=n,this.emit("accountsChanged",this._addresses),this._storage.setItem(af.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 ge.JSONRPCMethod.eth_accounts:return this._eth_accounts();case ge.JSONRPCMethod.eth_coinbase:return this._eth_coinbase();case ge.JSONRPCMethod.eth_uninstallFilter:return this._eth_uninstallFilter(n);case ge.JSONRPCMethod.net_version:return this._net_version();case ge.JSONRPCMethod.eth_chainId:return this._eth_chainId();default:return}}async _handleAsynchronousMethods(e){const{method:r}=e,n=e.params||[];switch(r){case ge.JSONRPCMethod.eth_requestAccounts:return this._eth_requestAccounts();case ge.JSONRPCMethod.eth_sign:return this._eth_sign(n);case ge.JSONRPCMethod.eth_ecRecover:return this._eth_ecRecover(n);case ge.JSONRPCMethod.personal_sign:return this._personal_sign(n);case ge.JSONRPCMethod.personal_ecRecover:return this._personal_ecRecover(n);case ge.JSONRPCMethod.eth_signTransaction:return this._eth_signTransaction(n);case ge.JSONRPCMethod.eth_sendRawTransaction:return this._eth_sendRawTransaction(n);case ge.JSONRPCMethod.eth_sendTransaction:return this._eth_sendTransaction(n);case ge.JSONRPCMethod.eth_signTypedData_v1:return this._eth_signTypedData_v1(n);case ge.JSONRPCMethod.eth_signTypedData_v2:return this._throwUnsupportedMethodError();case ge.JSONRPCMethod.eth_signTypedData_v3:return this._eth_signTypedData_v3(n);case ge.JSONRPCMethod.eth_signTypedData_v4:case ge.JSONRPCMethod.eth_signTypedData:return this._eth_signTypedData_v4(n);case ge.JSONRPCMethod.cbWallet_arbitrary:return this._cbwallet_arbitrary(n);case ge.JSONRPCMethod.wallet_addEthereumChain:return this._wallet_addEthereumChain(n);case ge.JSONRPCMethod.wallet_switchEthereumChain:return this._wallet_switchEthereumChain(n);case ge.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 ge.JSONRPCMethod.eth_newFilter:return this._eth_newFilter(n);case ge.JSONRPCMethod.eth_newBlockFilter:return this._eth_newBlockFilter();case ge.JSONRPCMethod.eth_newPendingTransactionFilter:return this._eth_newPendingTransactionFilter();case ge.JSONRPCMethod.eth_getFilterChanges:return this._eth_getFilterChanges(n);case ge.JSONRPCMethod.eth_getFilterLogs:return this._eth_getFilterLogs(n)}}_handleSubscriptionMethods(e){switch(e.method){case ge.JSONRPCMethod.eth_subscribe:case ge.JSONRPCMethod.eth_unsubscribe:return this._subscriptionManager.handleRequest(e)}}_isKnownAddress(e){try{const r=(0,oe.ensureAddressString)(e);return this._addresses.map(i=>(0,oe.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(ka.EVENTS.UNKNOWN_ADDRESS_ENCOUNTERED),new Error("Unknown Ethereum address")}_prepareTransactionParams(e){const r=e.from?(0,oe.ensureAddressString)(e.from):this.selectedAddress;if(!r)throw new Error("Ethereum address is unavailable");this._ensureKnownAddress(r);const n=e.to?(0,oe.ensureAddressString)(e.to):null,i=e.value!=null?(0,oe.ensureBN)(e.value):new mS.default(0),s=e.data?(0,oe.ensureBuffer)(e.data):Buffer.alloc(0),o=e.nonce!=null?(0,oe.ensureIntNumber)(e.nonce):null,a=e.gasPrice!=null?(0,oe.ensureBN)(e.gasPrice):null,u=e.maxFeePerGas!=null?(0,oe.ensureBN)(e.maxFeePerGas):null,l=e.maxPriorityFeePerGas!=null?(0,oe.ensureBN)(e.maxPriorityFeePerGas):null,d=e.gas!=null?(0,oe.ensureBN)(e.gas):null,g=this.getChainId();return{fromAddress:r,toAddress:n,weiValue:i,data:s,nonce:o,gasPriceInWei:a,maxFeePerGas:u,maxPriorityFeePerGas:l,gasLim
9it:d,chainId:g}}_isAuthorized(){return this._addresses.length>0}_requireAuthorization(){if(!this._isAuthorized())throw me.standardErrors.provider.unauthorized({})}_throwUnsupportedMethodError(){throw me.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)?me.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,oe.hexStringFromIntNumber)(this.getChainId())}getChainId(){const e=this._storage.getItem(cf);if(!e)return(0,oe.ensureIntNumber)(this._chainIdFromOpts);const r=parseInt(e,10);return(0,oe.ensureIntNumber)(r)}async _eth_requestAccounts(){var e;if((e=this.diagnostic)===null||e===void 0||e.log(ka.EVENTS.ETH_ACCOUNTS_STATE,{method:"provider::_eth_requestAccounts",addresses_length:this._addresses.length,sessionIdHash:this._relay?of.Session.hash(this._relay.session.id):void 0}),this._addresses.length>0)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)?me.standardErrors.provider.userRejectedRequest("User denied account authorization"):n}if(!r.result)throw new Error("accounts received is empty");return this._setAddresses(r.result),this.isLedger||this.isCoinbaseBrowser||await this.switchEthereumChain(this.getChainId()),{jsonrpc:"2.0",id:0,result:this._addresses}}_eth_sign(e){this._requireAuthorization();const r=(0,oe.ensureAddressString)(e[0]),n=(0,oe.ensureBuffer)(e[1]);return this._signEthereumMessage(n,r,!1)}_eth_ecRecover(e){const r=(0,oe.ensureBuffer)(e[0]),n=(0,oe.ensureBuffer)(e[1]);return this._ethereumAddressFromSignedMessage(r,n,!1)}_personal_sign(e){this._requireAuthorization();const r=(0,oe.ensureBuffer)(e[0]),n=(0,oe.ensureAddressString)(e[1]);return this._signEthereumMessage(r,n,!0)}_personal_ecRecover(e){const r=(0,oe.ensureBuffer)(e[0]),n=(0,oe.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)?me.standardErrors.provider.userRejectedRequest("User denied transaction signature"):n}}async _eth_sendRawTransaction(e){const r=(0,oe.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)?me.standardErrors.provider.userRejectedRequest("User denied transaction signature"):n}}async _eth_signTypedData_v1(e){this._requireAuthorization();const r=(0,oe.ensureParsedJSONObject)(e[0]),n=(0,oe.ensureAddressString)(e[1]);this._ensureKnownAddress(n);const i=Na.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,oe.ensureAddressString)(e[0]),n=(0,oe.ensureParsedJSONObject)(e[1]);this._ensureKnownAddress(r);const i=Na.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,oe.ensureAddressString)(e[0]),n=(0,oe.ensureParsedJSONObject)(e[1]);this._ensureKnownAddress(r);const i=Na.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];
9if(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 me.standardErrors.rpc.invalidParams("chainName is a required field");if(!o.nativeCurrency)throw me.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 me.standardErrors.rpc.invalidParams("Type is required");if((r==null?void 0:r.type)!=="ERC20")throw me.standardErrors.rpc.invalidParams(`Asset of type '${r.type}' is not supported`);if(!(r!=null&&r.options))throw me.standardErrors.rpc.invalidParams("Options are required");if(!(r!=null&&r.options.address))throw me.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,oe.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,oe.ensureHexString)(e[0]);return this._filterPolyfill.getFilterChanges(r)}_eth_getFilterLogs(e){const r=(0,oe.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))}}qn.CoinbaseWalletProvider=ES;var mo={},wo={};const It=fn(Ap);/*! ***************************************************************************** 10Copyright (c) Microsoft Corporation. 11 12Permission to use, copy, modify, and/or distribute this software for any 13purpose with or without fee is hereby granted. 14 15THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH 16REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY 17AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, 18INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM 19LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR 20OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR 21PERFORMANCE OF THIS SOFTWARE. 22***************************************************************************** */var rc=function(t,e){return rc=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,n){r.__proto__=n}||function(r,n){for(var i in n)n.hasOwnProperty(i)&&(r[i]=n[i])},rc(t,e)};function j(t,e){rc(t,e);function r(){this.constructor=t}t.prototype=e===null?Object.create(e):(r.prototype=e.prototype,new r)}function ei(t){return typeof t=="function"}var lf=!1,Nt={Promise:void 0,set useDeprecatedSynchronousErrorHandling(t){if(t){var e=new Error;""+e.stack}lf=t},get useDeprecatedSynchronousErrorHandling(){return lf}};function Bn(t){setTimeout(function(){throw t},0)}var Ds={closed:!0,next:function(t){},error:function(t){if(Nt.useDeprecatedSynchronousErrorHandling)throw t;Bn(t)},complete:function(){}},mt=function(){return Array.isArray||function(t){return t&&typeof t.length=="number"}}();function Xc(t){return t!==null&&typeof t=="object"}var xS=function(){function t(e){return Error.call(this),this.message=e?e.length+` errors occurred during unsubscription: 23`+e.map(function(r,n){return n+1+") "+r.toString()}).join(` 24 `):"",this.name="UnsubscriptionError",this.errors=e,this}return t.prototype=Object.create(Error.prototype),t}(),ki=xS,Qe=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 u=n[a];u.remove(this)}if(ei(s)){i&&(this._unsubscribe=void 0);try{s.call(this)}catch(g){e=g instanceof ki?ff(g.errors):[g]}}if(mt(o))for(var a=-1,l=o.length;++a<l;){var d=o[a];if(Xc(d))try{d.unsubscribe()}catch(y){e=e||[],y instanceof ki?e=e.concat(ff(y.errors)):e.push(y)}}if(e)throw new ki(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 ff(t){return t.reduce(function(e,r){return e.concat(r instanceof ki?r.errors:r)},[])}var $s=function(){return typeof Symbol=="function"?Symbol("rxSubscriber"):"@@rxSubscriber_"+Math.random()}(),Q=function(t){j(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=Ds;break;case 1:if(!r){s.destination=Ds;break}if(typeof r=="object"){r instanceof e?(s.syncErrorThrowable=r.syncErrorThrowable,s.destination=r,r.add(s)):(s.syncErrorThrowable=!0,s.destination=new hf(s,r));break}default:s.syncErrorThrowable=!0,s.destination=new hf(s,r,n,i);break}return s}return e.prototype[$s]=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}(Qe),hf=function(t){j(e,t);function e(r,n,i,s){var o=t.call(this)||this;o._parentSubscriber=r;var a,u=o;
24return ei(n)?a=n:n&&(a=n.next,i=n.error,s=n.complete,n!==Ds&&(u=Object.create(n),ei(u.unsubscribe)&&o.add(u.unsubscribe.bind(u)),u.unsubscribe=o.unsubscribe.bind(o))),o._context=u,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;!Nt.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=Nt.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):Bn(r),this.unsubscribe();else{if(this.unsubscribe(),i)throw r;Bn(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)};!Nt.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(),Nt.useDeprecatedSynchronousErrorHandling)throw i;Bn(i)}},e.prototype.__tryOrSetError=function(r,n,i){if(!Nt.useDeprecatedSynchronousErrorHandling)throw new Error("bad call");try{n.call(this._context,i)}catch(s){return Nt.useDeprecatedSynchronousErrorHandling?(r.syncErrorValue=s,r.syncErrorThrown=!0,!0):(Bn(s),!0)}return!1},e.prototype._unsubscribe=function(){var r=this._parentSubscriber;this._context=null,this._parentSubscriber=null,r.unsubscribe()},e}(Q);function eu(t){for(;t;){var e=t,r=e.closed,n=e.destination,i=e.isStopped;if(r||i)return!1;n&&n instanceof Q?t=n:t=null}return!0}function MS(t,e,r){if(t){if(t instanceof Q)return t;if(t[$s])return t[$s]()}return!t&&!e&&!r?new Q(Ds):new Q(t,e,r)}var pi=function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"}();function Ir(t){return t}function nc(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return xd(t)}function xd(t){return t.length===0?Ir:t.length===1?t[0]:function(r){return t.reduce(function(n,i){return i(n)},r)}}var ae=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=MS(e,r,n);if(i?s.add(i.call(s,this.source)):s.add(this.source||Nt.useDeprecatedSynchronousErrorHandling&&!s.syncErrorThrowable?this._subscribe(s):this._trySubscribe(s)),Nt.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){Nt.useDeprecatedSynchronousErrorHandling&&(e.syncErrorThrown=!0,e.syncErrorValue=r),eu(e)?e.error(r):console.warn(r)}},t.prototype.forEach=function(e,r){var n=this;return r=df(r),new r(function(i,s){var o;o=n.subscribe(function(a){try{e(a)}catch(u){s(u),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:xd(e)(this)},t.prototype.toPromise=function(e){var r=this;return e=df(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 df(t){if(t||(t=Nt.Promise||Promise),!t)throw new Error("no Promise impl found");return t}var CS=function(){function t(){return Error.call(this),this.message="object unsubscribed",this.name="ObjectUnsubscribedError",this}return t.prototype=Object.create(Error.prototype),t}(),Er=CS,Md=function(t){j(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}(Qe),Cd=function(t){j(e,t);function e(r){var n=t.call(this,r)||this;return n.destination=r,n}return e}(Q),ut=function(t){j(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[$s]=function(){return new Cd(this)},e.prototype.lift=function(r){var n=new pf(this,this);return n.operator=r,n},e.prototype.next=function(r){if(this.closed)throw new Er;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 Er;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 Er;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 Er;return t.prototype._trySubscribe.call(this,r)},e.prototype._subscribe=function(r){if(this.closed)throw new Er;return this.hasError?(r.error(this.thrownError),Qe.EMPTY):this.isStopped?(r.complete(),Qe.EMPTY):(this.observers.push(r),new Md(this,r))},e.prototype.asObservable=function(){var r=new ae;return r.source=this,r},e.create=function(r,n){return new pf(r,n)},e}(ae),pf=function(t){j(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):Qe.EMPTY},e}(ut);function tu(){return function(e){return e.lift(new RS(e))}}var RS=function(){function t(e){this.connectable=e}return t.prototype.call=function(e,r){var n=this.connectable;n._refCount++;var i=new IS(e,n),s=r.subscribe(i);return i.closed||(i.connection=n.connect()),s},t}(),IS=function(t){j(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}(Q),Rd=function(t){j(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}
24return 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 Qe,r.add(this.source.subscribe(new kS(this.getSubject(),this))),r.closed&&(this._connection=null,r=Qe.EMPTY)),r},e.prototype.refCount=function(){return tu()(this)},e}(ae),AS=function(){var t=Rd.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}}}(),kS=function(t){j(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}(Cd);function TS(t,e,r,n){return function(i){return i.lift(new NS(t,e,r,n))}}var NS=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 OS(e,this.keySelector,this.elementSelector,this.durationSelector,this.subjectSelector))},t}(),OS=function(t){j(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 ut,i.set(n,s);var a=new ic(n,s,this);if(this.destination.next(a),this.durationSelector){var u=void 0;try{u=this.durationSelector(new ic(n,s))}catch(l){this.error(l);return}this.add(u.subscribe(new LS(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}(Q),LS=function(t){j(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}(Q),ic=function(t){j(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 Qe,i=this,s=i.refCountSubscription,o=i.groupSubject;return s&&!s.closed&&n.add(new PS(s)),n.add(o.subscribe(r)),n},e}(ae),PS=function(t){j(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}(Qe),Id=function(t){j(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 Er;return this._value},e.prototype.next=function(r){t.prototype.next.call(this,this._value=r)},e}(ut),DS=function(t){j(e,t);function e(r,n){return t.call(this)||this}return e.prototype.schedule=function(r,n){return this},e}(Qe),ns=function(t){j(e,t);function e(r,n){var i=t.call(this,r,n)||this;
24return 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}(DS),$S=function(t){j(e,t);function e(r,n){var i=t.call(this,r,n)||this;
24return 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}(ns),sc=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}(),is=function(t){j(e,t);function e(r,n){n===void 0&&(n=sc.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}(sc),BS=function(t){j(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e}(is),Ad=new BS($S),kd=Ad,ti=new ae(function(t){return t.complete()});function gi(t){return t?jS(t):ti}function jS(t){return new ae(function(e){return t.schedule(function(){return e.complete()})})}function Rt(t){return t&&typeof t.schedule=="function"}var Td=function(t){return function(e){for(var r=0,n=t.length;r<n&&!e.closed;r++)e.next(t[r]);e.complete()}};function ru(t,e){return new ae(function(r){var n=new Qe,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 ss(t,e){return e?ru(t,e):new ae(Td(t))}function _o(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var r=t[t.length-1];return Rt(r)?(t.pop(),ru(t,r)):ss(t)}function nu(t,e){return e?new ae(function(r){return e.schedule(FS,0,{error:t,subscriber:r})}):new ae(function(r){return r.error(t)})}function FS(t){var e=t.error,r=t.subscriber;r.error(e)}var oc;oc||(oc={});var dr=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 _o(this.value);case"E":return nu(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 WS(t,e){return e===void 0&&(e=0),function(n){return n.lift(new HS(t,e))}}var HS=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 Nd(e,this.scheduler,this.delay))},t}(),Nd=function(t){j(e,t);function e(r,n,i){i===void 0&&(i=0);var s=t.call(this,r)||this;
24return 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 VS(r,this.destination)))},e.prototype._next=function(r){this.scheduleMessage(dr.createNext(r))},e.prototype._error=function(r){this.scheduleMessage(dr.createError(r)),this.unsubscribe()},e.prototype._complete=function(){this.scheduleMessage(dr.createComplete()),this.unsubscribe()},e}(Q),VS=function(){function t(e,r){this.notification=e,this.destination=r}return t}(),iu=function(t){j(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 US(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 Er;if(this.isStopped||this.hasError?a=Qe.EMPTY:(this.observers.push(r),a=new Md(this,r)),s&&r.add(r=new Nd(r,s)),n)for(var u=0;u<o&&!r.closed;u++)r.next(i[u]);else for(var u=0;u<o&&!r.closed;u++)r.next(i[u].value);return this.hasError?r.error(this.thrownError):this.isStopped&&r.complete(),a},e.prototype._getNow=function(){return(this.scheduler||kd).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}(ut),US=function(){function t(e,r){this.time=e,this.value=r}return t}(),bi=function(t){j(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),Qe.EMPTY):this.hasCompleted&&this.hasNext?(r.next(this.value),r.complete(),Qe.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}(ut),zS=1,qS=function(){return Promise.resolve()}(),ac={};function gf(t){return t in ac?(delete ac[t],!0):!1}var bf={setImmediate:function(t){var e=zS++;return ac[e]=!0,qS.then(function(){return gf(e)&&t()}),e},clearImmediate:function(t){gf(t)}},GS=function(t){j(e,t);function e(r,n){var i=t.call(this,r,n)||this;
24return 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=bf.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&&(bf.clearImmediate(n),r.scheduled=void 0)},e}(ns),JS=function(t){j(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}(is),Od=new JS(GS),Rs=Od,Ld=new is(ns),wt=Ld,ZS=function(t){j(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}(ns),QS=function(t){j(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}(is),Pd=new QS(ZS),YS=Pd,KS=function(t){j(e,t);function e(r,n){r===void 0&&(r=Dd),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}(is),Dd=function(t){j(e,t);function e(r,n,i){i===void 0&&(i=r.index+=1);var s=t.call(this,r,n)||this;
24return 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}(ns);function er(){}function XS(t){return!!t&&(t instanceof ae||typeof t.lift=="function"&&typeof t.subscribe=="function")}var eE=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}(),ri=eE,tE=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}(),os=tE,rE=function(){function t(){return Error.call(this),this.message="Timeout has occurred",this.name="TimeoutError",this}return t.prototype=Object.create(Error.prototype),t}(),$d=rE;function Bt(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 nE(t,e))}}var nE=function(){function t(e,r){this.project=e,this.thisArg=r}return t.prototype.call=function(e,r){return r.subscribe(new iE(e,this.project,this.thisArg))},t}(),iE=function(t){j(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}(Q);function Bd(t,e,r){if(e)if(Rt(e))r=e;else return function(){for(var n=[],i=0;i<arguments.length;i++)n[i]=arguments[i];return Bd(t,r).apply(void 0,n).pipe(Bt(function(s){return mt(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 ae(function(u){if(r){var d={args:n,subscriber:u,params:a};return r.schedule(sE,0,d)}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){eu(o)?o.error(g):console.warn(g)}}return o.subscribe(u)}})}}function sE(t){var e=this,r=t.args,n=t.subscriber,i=t.params,s=i.callbackFunc,o=i.context,a=i.scheduler,u=i.subject;if(!u){u=i.subject=new bi;var l=function(){for(var d=[],g=0;g<arguments.length;g++)d[g]=arguments[g];var y=d.length<=1?d[0]:d;e.add(a.schedule(oE,0,{value:y,subject:u}))};try{s.apply(o,r.concat([l]))}catch(d){u.error(d)}}this.add(u.subscribe(n))}function oE(t){var e=t.value,r=t.subject;r.next(e),r.complete()}function jd(t,e,r){if(e)if(Rt(e))r=e;else return function(){for(var n=[],i=0;i<arguments.length;i++)n[i]=arguments[i];return jd(t,r).apply(void 0,n).pipe(Bt(function(s){return mt(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 ae(function(o){var a=s.context,u=s.subject;if(r)return r.schedule(aE,0,{params:s,subscriber:o,context:a});if(!u){u=s.subject=new bi;var l=function(){for(var d=[],g=0;g<arguments.length;g++)d[g]=arguments[g];var y=d.shift();if(y){u.error(y);return}u.next(d.length<=1?d[0]:d),u.complete()};try{t.apply(a,n.concat([l]))}catch(d){eu(u)?u.error(d):console.warn(d)}}return u.subscribe(o)})}}function aE(t){var e=this,r=t.params,n=t.subscriber,i=t.context,s=r.callbackFunc,o=r.args,a=r.scheduler,u=r.subject;if(!u){u=r.subject=new bi;var l=function(){for(var d=[],g=0;g<arguments.length;g++)d[g]=arguments[g];var y=d.shift();if(y)e.add(a.schedule(vf,0,{err:y,subject:u}));else{var C=d.length<=1?d[0]:d;e.add(a.schedule(cE,0,{value:C,subject:u}))}};try{s.apply(i,o.concat([l]))}catch(d){this.add(a.schedule(vf,0,{err:d,subject:u}))}}this.add(u.subscribe(n))}function cE(t){var e=t.value,r=t.subject;r.next(e),r.complete()}function vf(t){var e=t.err,r=t.subject;r.error(e)}var yn=function(t){j(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}(Q),uE=function(t){j(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}(Q),lE=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,Bn),e}};function fE(){return typeof Symbol!="function"||!Symbol.iterator?"@@iterator":Symbol.iterator}var Ar=fE(),hE=function(t){return function(e){var r=t[Ar]();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}},dE=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)}},Fd=function(t){return t&&typeof t.length=="number"&&typeof t!="function"};function Wd(t){return!!t&&typeof t.subscribe!="function"&&typeof t.then=="function"}var Pi=function(t){if(t&&typeof t[pi]=="function")return dE(t);if(Fd(t))return Td(t);if(Wd(t))return lE(t);if(t&&typeof t[Ar]=="function")return hE(t);
24var e=Xc(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 gr(t,e,r,n,i){if(i===void 0&&(i=new uE(t,r,n)),!i.closed)return e instanceof ae?e.subscribe(i):Pi(e)(i)}var yf={};function pE(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var r=void 0,n=void 0;return Rt(t[t.length-1])&&(n=t.pop()),typeof t[t.length-1]=="function"&&(r=t.pop()),t.length===1&&mt(t[0])&&(t=t[0]),ss(t,n).lift(new su(r))}var su=function(){function t(e){this.resultSelector=e}return t.prototype.call=function(e,r){return r.subscribe(new gE(e,this.resultSelector))},t}(),gE=function(t){j(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(yf),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(gr(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===yf?--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}(yn);function bE(t,e){return new ae(function(r){var n=new Qe;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 vE(t,e){return new ae(function(r){var n=new Qe;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 ae(function(r){var n=new Qe,i;return n.add(function(){i&&typeof i.return=="function"&&i.return()}),n.add(e.schedule(function(){i=t[Ar](),n.add(e.schedule(function(){if(!r.closed){var s,o;try{var a=i.next();s=a.value,o=a.done}catch(u){r.error(u);return}o?r.complete():(r.next(s),this.schedule())}}))})),n})}function mE(t){return t&&typeof t[pi]=="function"}function wE(t){return t&&typeof t[Ar]=="function"}function Hd(t,e){if(t!=null){if(mE(t))return bE(t,e);if(Wd(t))return vE(t,e);if(Fd(t))return ru(t,e);if(wE(t)||typeof t=="string")return yE(t,e)}throw new TypeError((t!==null&&typeof t||t)+" is not observable")}function br(t,e){return e?Hd(t,e):t instanceof ae?t:new ae(Pi(t))}var Ye=function(t){j(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}(Q),Ke=function(t){j(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}(Q);function Xe(t,e){if(!e.closed){if(t instanceof ae)return t.subscribe(e);var r;try{r=Pi(t)(e)}catch(n){e.error(n)}return r}}function un(t,e,r){return r===void 0&&(r=Number.POSITIVE_INFINITY),typeof e=="function"?function(n){return n.pipe(un(function(i,s){return br(t(i,s)).pipe(Bt(function(o,a){return e(i,o,s,a)}))},r))}:(typeof e=="number"&&(r=e),function(n){return n.lift(new _E(t,r))})}var _E=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 SE(e,this.project,this.concurrent))},t}(),SE=function(t){j(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 Ye(this),i=this.destination;i.add(n);var s=Xe(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}(Ke),EE=un;function ou(t){return t===void 0&&(t=Number.POSITIVE_INFINITY),un(Ir,t)}function Vd(){return ou(1)}function Di(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return Vd()(_o.apply(void 0,t))}function au(t){return new ae(function(e){var r;try{r=t()}catch(i){e.error(i);return}var n=r?br(r):gi();return n.subscribe(e)})}function xE(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];if(t.length===1){var r=t[0];if(mt(r))return ws(r,null);if(Xc(r)&&Object.getPrototypeOf(r)===Object.prototype){var n=Object.keys(r);return ws(n.map(function(s){return r[s]}),n)}}if(typeof t[t.length-1]=="function"){var i=t.pop();return t=t.length===1&&mt(t[0])?t[0]:t,ws(t,null).pipe(Bt(function(s){return i.apply(void 0,s)}))}return ws(t,null)}function ws(t,e){return new ae(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 d=br(t[l]),g=!1;r.add(d.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,C,A){return y[C]=i[A],y},{}):i),r.complete())}}))},u=0;u<n;u++)a(u)})}function Ud(t,e,r,n){return ei(r)&&(n=r,r=void 0),n?Ud(t,e,r).pipe(Bt(function(i){return mt(i)?n.apply(void 0,i):n(i)})):new ae(function(i){function s(o){arguments.length>1?i.next(Array.prototype.slice.call(arguments)):i.next(o)}zd(t,e,s,i,r)})}function zd(t,e,r,n,i){var s;if(RE(t)){var o=t;t.addEventListener(e,r,i),s=function(){return o.removeEventListener(e,r,i)}}else if(CE(t)){var a=t;t.on(e,r),s=function(){return a.off(e,r)}}else if(ME(t)){var u=t;t.addListener(e,r),s=function(){return u.removeListener(e,r)}}else if(t&&t.length)for(var l=0,d=t.length;l<d;l++)zd(t[l],e,r,n,i);else throw new TypeError("Invalid event target");n.add(s)}function ME(t){return t&&typeof t.addListener=="function"&&typeof t.removeListener=="function"}function CE(t){return t&&typeof t.on=="function"&&typeof t.off=="function"}function RE(t){return t&&typeof t.addEventListener=="function"&&typeof t.removeEventListener=="function"}function qd(t,e,r){return r?qd(t,e).pipe(Bt(function(n){return mt(n)?r.apply(void 0,n):r(n)})):new ae(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(ei(e))return function(){return e(i,s)}})}function IE(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||Ir,i=a.scheduler}else n===void 0||Rt(n)?(o=t,s=Ir,i=n):(o=t,s=n);return new ae(function(u){var l=o;if(i)return i.schedule(AE,0,{subscriber:u,iterate:r,condition:e,resultSelector:s,state:l});do{if(e){var d=void 0;try{d=e(l)}catch(y){u.error(y);return}if(!d){u.complete();break}}var g=void 0;try{g=s(l)}catch(y){u.error(y);return}if(u.next(g),u.closed)break;try{l=r(l)}catch(y){u.error(y);return}}while(!0)})}function AE(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 kE(t,e,r){return e===void 0&&(e=ti),r===void 0&&(r=ti),au(function(){return t()?e:r})}function ni(t){return!mt(t)&&t-parseFloat(t)+1>=0}function TE(t,e){return t===void 0&&(t=0),e===void 0&&(e=wt),(!ni(t)||t<0)&&(t=0),(!e||typeof e.schedule!="function")&&(e=wt),new ae(function(r){return r.add(e.schedule(NE,t,{subscriber:r,counter:0,peri
24od:t})),r})}function NE(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 Gd(){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 Rt(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 ae?t[0]:ou(r)(ss(t,n))}var Jd=new ae(er);function OE(){return Jd}function cc(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];if(t.length===0)return ti;var r=t[0],n=t.slice(1);return t.length===1&&mt(r)?cc.apply(void 0,r):new ae(function(i){var s=function(){return i.add(cc.apply(void 0,n).subscribe(i))};return br(r).subscribe({next:function(o){i.next(o)},error:s,complete:s})})}function LE(t,e){return e?new ae(function(r){var n=Object.keys(t),i=new Qe;return i.add(e.schedule(PE,0,{keys:n,index:0,subscriber:r,subscription:i,obj:t})),i}):new ae(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 PE(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 Zd(t,e){function r(){return!r.pred.apply(r.thisArg,arguments)}return r.pred=t,r.thisArg=e,r}function kr(t,e){return function(n){return n.lift(new DE(t,e))}}var DE=function(){function t(e,r){this.predicate=e,this.thisArg=r}return t.prototype.call=function(e,r){return r.subscribe(new $E(e,this.predicate,this.thisArg))},t}(),$E=function(t){j(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}(Q);function BE(t,e,r){return[kr(e,r)(new ae(Pi(t))),kr(Zd(e,r))(new ae(Pi(t)))]}function Qd(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];if(t.length===1)if(mt(t[0]))t=t[0];else return t[0];return ss(t,void 0).lift(new jE)}var jE=function(){function t(){}return t.prototype.call=function(e,r){return r.subscribe(new FE(e))},t}(),FE=function(t){j(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=gr(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}(yn);function WE(t,e,r){return t===void 0&&(t=0),new ae(function(n){e===void 0&&(e=t,t=0);var i=0,s=t;if(r)return r.schedule(HE,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 HE(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 Yd(t,e,r){t===void 0&&(t=0);var n=-1;return ni(e)?n=Number(e)<1&&1||Number(e):Rt(e)&&(r=e),Rt(r)||(r=wt),new ae(function(i){var s=ni(t)?t:+t-r.now();return r.schedule(VE,s,{index:0,period:n,subscriber:i})})}function VE(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 UE(t,e){return new ae(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?br(i):ti,o=s.subscribe(r);return function(){o.unsubscribe(),n&&n.unsubscribe()}})}function Kd(){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(),ss(t,void 0).lift(new Xd(r))}var Xd=function(){function t(e){this.resultSelector=e}return t.prototype.call=function(e,r){return r.subscribe(new zE(e,this.resultSelector))},t}(),zE=function(t){j(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;mt(r)?n.push(new GE(r)):typeof r[Ar]=="function"?n.push(new qE(r[Ar]())):n.push(new JE(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,u=[],s=0;s<n;s++){var o=r[s],l=o.next();if(o.hasCompleted()&&(a=!0),l.done){i.complete();return}u.push(l.value)}this.resultSelector?this._tryresultSelector(u):i.next(u),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}(Q),qE=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}(),GE=function(){function t(e){this.array=e,this.index=0,this.length=0,this.length=e.length}return t.prototype[Ar]=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}(),JE=function(t){j(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[Ar]=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 Xe(this.observable,new Ye(this))},e}(Ke);const ZE=Object.freeze(Object.defineProperty({__proto__:null,ArgumentOutOfRangeError:ri,AsyncSubject:bi,BehaviorSubject:Id,ConnectableObservable:Rd,EMPTY:ti,EmptyError:os,GroupedObservable:ic,NEVER:Jd,Notification:dr,get NotificationKind(){return oc},ObjectUnsubscribedError:Er,Observable:ae,ReplaySubject:iu,Scheduler:sc,Subject:ut,Subscriber:Q,Subscription:Qe,TimeoutError:$d,UnsubscriptionError:ki,VirtualAction:Dd,VirtualTimeScheduler:KS,animationFrame:YS,animationFrameScheduler:Pd,asap:Rs,asapScheduler:Od,async:wt,asyncScheduler:Ld,bindCallback:Bd,bindNodeCallback:jd,combineLatest:pE,concat:Di,config:Nt,defer:au,empty:gi,forkJoin:xE,from:br,fromEvent:Ud,fromEventPattern:qd,generate:IE,identity:Ir,iif:kE,interval:TE,isObservable:XS,merge:Gd,never:OE,noop:er,observable:pi,of:_o,onErrorResumeNext:cc,pairs:LE,partition:BE,pipe:nc,queue:kd,queueScheduler:Ad,race:Qd,range:WE,scheduled:Hd,throwError:nu,timer:Yd,using:UE,zip:Kd},Symbol.toStringTag,{value:"Module"})),So=fn(ZE);var Eo={};const xo=fn(Rp),as=fn(kp);var sr={},Mo={};Object.defineProperty(Mo,"__esModule",{value:!0});Mo.CloseIcon=void 0;const mf=It;function QE(t){return(0,mf.h)("svg",Object.assign({width:"40",height:"40",viewBox:"0 0 40 40",fill:"none",xmlns:"http://www.w3.org/2000/svg"}
24,t),(0,mf.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"}))}Mo.CloseIcon=QE;var cu={};Object.defineProperty(cu,"__esModule",{value:!0});cu.default="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjgiIGhlaWdodD0iMjgiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGNpcmNsZSBjeD0iMTQiIGN5PSIxNCIgcj0iMTQiIGZpbGw9IiMwMDUyRkYiLz48cGF0aCBkPSJNMTQuMDM3IDE4LjkyNmMtMi43NSAwLTQuOTA3LTIuMjA1LTQuOTA3LTQuOTI2IDAtMi43MiAyLjIzLTQuOTI2IDQuOTA3LTQuOTI2YTQuODY2IDQuODY2IDAgMCAxIDQuODMzIDQuMTE4aDQuOTgyYy0uNDQ2LTUuMDczLTQuNjg0LTkuMDQ0LTkuODE1LTkuMDQ0QzguNjEgNC4xNDggNC4xNDkgOC41NiA0LjE0OSAxNHM0LjM4NyA5Ljg1MiA5Ljg5IDkuODUyYzUuMjA0IDAgOS4zNjgtMy45NyA5LjgxNC05LjA0M0gxOC44N2E0Ljg2NiA0Ljg2NiAwIDAgMS00LjgzMyA0LjExN1oiIGZpbGw9IiNmZmYiLz48L3N2Zz4=";var uu={};Object.defineProperty(uu,"__esModule",{value:!0});uu.default="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjgiIGhlaWdodD0iMjgiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGNpcmNsZSBjeD0iMTQiIGN5PSIxNCIgcj0iMTQiIGZpbGw9IiMwMDUyRkYiLz48cGF0aCBkPSJNMjMuODUyIDE0QTkuODM0IDkuODM0IDAgMCAxIDE0IDIzLjg1MiA5LjgzNCA5LjgzNCAwIDAgMSA0LjE0OCAxNCA5LjgzNCA5LjgzNCAwIDAgMSAxNCA0LjE0OCA5LjgzNCA5LjgzNCAwIDAgMSAyMy44NTIgMTRaIiBmaWxsPSIjZmZmIi8+PHBhdGggZD0iTTExLjE4NSAxMi41MDRjMC0uNDU2IDAtLjcxLjA5OC0uODYyLjA5OC0uMTUyLjE5Ni0uMzA0LjM0My0uMzU1LjE5Ni0uMTAyLjM5Mi0uMTAyLjg4MS0uMTAyaDIuOTg2Yy40OSAwIC42ODYgMCAuODgyLjEwMi4xNDYuMTAxLjI5My4yMDMuMzQyLjM1NS4wOTguMjAzLjA5OC40MDYuMDk4Ljg2MnYyLjk5MmMwIC40NTcgMCAuNzEtLjA5OC44NjMtLjA5OC4xNTItLjE5NS4zMDQtLjM0Mi4zNTUtLjE5Ni4xMDEtLjM5Mi4xMDEtLjg4Mi4xMDFoLTIuOTg2Yy0uNDkgMC0uNjg1IDAtLjg4LS4xMDEtLjE0OC0uMTAyLS4yOTUtLjIwMy0uMzQ0LS4zNTUtLjA5OC0uMjAzLS4wOTgtLjQwNi0uMDk4LS44NjN2LTIuOTkyWiIgZmlsbD0iIzAwNTJGRiIvPjwvc3ZnPg==";var Co={};Object.defineProperty(Co,"__esModule",{value:!0});Co.QRCodeIcon=void 0;const Yt=It;function YE(t){return(0,Yt.h)("svg",Object.assign({width:"10",height:"10",viewBox:"0 0 10 10",xmlns:"http://www.w3.org/2000/svg"},t),(0,Yt.h)("path",{d:"M8.2271 1.77124L7.0271 1.77124V2.97124H8.2271V1.77124Z"}),(0,Yt.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,Yt.h)("path",{d:"M2.97124 1.77124L1.77124 1.77124L1.77124 2.97124H2.97124V1.77124Z"}),(0,Yt.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,Yt.h)("path",{d:"M2.97124 7.0271H1.77124L1.77124 8.2271H2.97124V7.0271Z"}),(0,Yt.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,Yt.h)("path",{d:"M8.89922 7.39912H7.99922V5.40112H5.44922L5.44922 9.79912H6.34922L6.34922 6.30112H7.09922V8.29912H9.79922V5.40112H8.89922V7.39912Z"}),(0,Yt.h)("path",{d:"M7.99912 8.89917H7.09912V9.79917H7.99912V8.89917Z"}),(0,Yt.h)("path",{d:"M9.79917 8.89917H8.89917V9.79917H9.79917V8.89917Z"}))}Co.QRCodeIcon=YE;var lu={};Object.defineProperty(lu,"__esModule",{value:!0});const KE=` 25 <svg width="100" height="100" viewBox="0 0 100 100" fill="none" xmlns="http://www.w3.org/2000/svg"> 26 <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"/> 27 <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"/> 28 <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"/> 29 </svg> 30`;lu.default=KE;var fu={};
30Object.defineProperty(fu,"__esModule",{value:!0});fu.default=` 31 <svg width="100" height="100" viewBox="0 0 100 100" fill="none" xmlns="http://www.w3.org/2000/svg"> 32 <circle cx="50" cy="50" r="50" fill="white"/> 33 <circle cx="49.9996" cy="49.9996" r="43.6363" fill="#1B53E4"/> 34 <circle cx="49.9996" cy="49.9996" r="43.6363" stroke="white"/> 35 <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"/> 36 </svg> 37`;var Ro={};Object.defineProperty(Ro,"__esModule",{value:!0});Ro.StatusDotIcon=void 0;const wf=It;function XE(t){return(0,wf.h)("svg",Object.assign({width:"10",height:"10",viewBox:"0 0 10 10",xmlns:"http://www.w3.org/2000/svg"},t),(0,wf.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"}))}Ro.StatusDotIcon=XE;var Io={};function ep(t){this.mode=Mt.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))}ep.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 or(t,e){this.typeNumber=t,this.errorCorrectLevel=e,this.modules=null,this.moduleCount=0,this.dataCache=null,this.dataList=[]}or.prototype={addData:function(t){var e=new ep(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=or.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=Je.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 u=a*i,l=this.modules[s][a];l&&(n.beginFill(0,100),n.moveTo(u,o),n.lineTo(u+i,o),n.lineTo(u+i,o+i),n.lineTo(u,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=Je.getPatternPosition(this.typeNumber),e=0;e<t.length;e++)for(var r=0;r<t.length;r++){var n=t[e],i=t[r];
vendor: 10,913 bytes, line 37
37if(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=Je.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=Je.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 u=!1;s<t.length&&(u=(t[s]>>>i&1)==1);var l=Je.getMask(e,n,o-a);l&&(u=!u),this.modules[n][o-a]=u,i--,i==-1&&(s++,i=7)}if(n+=r,n<0||this.moduleCount<=n){n-=r,r=-r;break}}}};or.PAD0=236;or.PAD1=17;or.createData=function(t,e,r){for(var n=rr.getRSBlocks(t,e),i=new tp,s=0;s<r.length;s++){var o=r[s];i.put(o.mode,4),i.put(o.getLength(),Je.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(or.PAD0,8),i.getLengthInBits()>=a*8));)i.put(or.PAD1,8);return or.createBytes(i,n)};or.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 u=e[a].dataCount,l=e[a].totalCount-u;n=Math.max(n,u),i=Math.max(i,l),s[a]=new Array(u);for(var d=0;d<s[a].length;d++)s[a][d]=255&t.buffer[d+r];r+=u;var g=Je.getErrorCorrectPolynomial(l),y=new zn(s[a],g.getLength()-1),C=y.mod(g);o[a]=new Array(g.getLength()-1);for(var d=0;d<o[a].length;d++){var A=d+C.getLength()-o[a].length;o[a][d]=A>=0?C.get(A):0}}for(var D=0,d=0;d<e.length;d++)D+=e[d].totalCount;for(var O=new Array(D),x=0,d=0;d<n;d++)for(var a=0;a<e.length;a++)d<s[a].length&&(O[x++]=s[a][d]);for(var d=0;d<i;d++)for(var a=0;a<e.length;a++)d<o[a].length&&(O[x++]=o[a][d]);return O};var Mt={MODE_NUMBER:1,MODE_ALPHA_NUM:2,MODE_8BIT_BYTE:4,MODE_KANJI:8},Mr={L:1,M:0,Q:3,H:2},yr={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7},Je={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;Je.getBCHDigit(e)-Je.getBCHDigit(Je.G15)>=0;)e^=Je.G15<<Je.getBCHDigit(e)-Je.getBCHDigit(Je.G15);return(t<<10|e)^Je.G15_MASK},getBCHTypeNumber:function(t){for(var e=t<<12;Je.getBCHDigit(e)-Je.getBCHDigit(Je.G18)>=0;)e^=Je.G18<<Je.getBCHDigit(e)-Je.getBCHDigit(Je.G18);return t<<12|e},getBCHDigit:function(t){for(var e=0;t!=0;)e++,t>>>=1;return e},getPatternPosition:function(t){return Je.PATTERN_POSITION_TABLE[t-1]},getMask:function(t,e,r){switch(t){case yr.PATTERN000:return(e+r)%2==0;case yr.PATTERN001:return e%2==0;case yr.PATTERN010:return r%3==0;case yr.PATTERN011:return(e+r)%3==0;case yr.PATTERN100:return(Math.floor(e/2)+Math.floor(r/3))%2==0;case yr.PATTERN101:return e*r%2+e*r%3==0;case yr.PATTERN110:return(e*r%2+e*r%3)%2==0;case yr.PATTERN111:return(e*r%3+(e+r)%2)%2==0;default:throw new Error("bad maskPattern:"+t)}},getErrorCorrectPolynomial:function(t){for(var e=new zn([1],0),r=0;r<t;r++)e=e.multiply(new zn([1,ct.gexp(r)],0));return e},getLengthInBits:function(t,e){if(1<=e&&e<10)switch(t){case Mt.MODE_NUMBER:return 10;case Mt.MODE_ALPHA_NUM:return 9;case Mt.MODE_8BIT_BYTE:return 8;case Mt.MODE_KANJI:return 8;default:throw new Error("mode:"+t)}else if(e<27)switch(t){case Mt.MODE_NUMBER:return 12;case Mt.MODE_ALPHA_NUM:return 11;case Mt.MODE_8BIT_BYTE:return 16;case Mt.MODE_KANJI:return 10;default:throw new Error("mode:"+t)}else if(e<41)switch(t){case Mt.MODE_NUMBER:return 14;case Mt.MODE_ALPHA_NUM:return 13;case Mt.MODE_8BIT_BYTE:return 16;case Mt.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 u=-1;u<=1;u++)i+u<0||e<=i+u||a==0&&u==0||o==t.isDark(n+a,i+u)&&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 d=0,i=0;i<e;i++)for(var n=0;n<e;n++)t.isDark(n,i)&&d++;var g=Math.abs(100*d/e/e-50)/5;return r+=g*10,r}},ct={glog:function(t){if(t<1)throw new Error("glog("+t+")");return ct.LOG_TABLE[t]},gexp:function(t){for(;t<0;)t+=255;for(;t>=256;)t-=255;return ct.EXP_TABLE[t]},EXP_TABLE:new Array(256),LOG_TABLE:new Array(256)};for(var ft=0;ft<8;ft++)ct.EXP_TABLE[ft]=1<<ft;for(var ft=8;ft<256;ft++)ct.EXP_TABLE[ft]=ct.EXP_TABLE[ft-4]^ct.EXP_TABLE[ft-5]^ct.EXP_TABLE[ft-6]^ct.EXP_TABLE[ft-8];for(var ft=0;ft<255;ft++)ct.LOG_TABLE[ct.EXP_TABLE[ft]]=ft;function zn(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]}zn.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]^=ct.gexp(ct.glog(this.get(r))+ct.glog(t.get(n)));return new zn(e,0)},mod:function(t){if(this.getLength()-t.getLength()<0)return this;for(var e=ct.glog(this.get(0))-ct.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]^=ct.gexp(ct.glog(t.get(n))+e);return new zn(r,0).mod(t)}};function rr(t,e){this.totalCount=t,this.dataCount=e}rr.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]];rr.getRSBlocks=function(t,e){var r=rr.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],u=r[s*3+2],l=0;l<o;l++)i.push(new rr(a,u));return i};rr.getRsBlockTable=function(t,e){switch(e){case Mr.L:return rr.RS_BLOCK_TABLE[(t-1)*4+0];case Mr.M:return rr.RS_BLOCK_TABLE[(t-1)*4+1];case Mr.Q:return rr.RS_BLOCK_TABLE[(t-1)*4+2];case Mr.H:return rr.RS_BLOCK_TABLE[(t-1)*4+3];default:return}};function tp(){this.buffer=[],this.length=0}tp.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 Oa=[[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,8
376,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 rp(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(u){switch(u){case"L":return Mr.L;case"M":return Mr.M;case"Q":return Mr.Q;case"H":return Mr.H;default:throw new Error("Unknwon error correction level: "+u)}}function n(u,l){for(var d=i(u),g=1,y=0,C=0,A=Oa.length;C<=A;C++){var D=Oa[C];if(!D)throw new Error("Content too long: expected "+y+" but got "+d);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(d<=y)break;g++}if(g>Oa.length)throw new Error("Content too long");return g}function i(u){var l=encodeURI(u).toString().replace(/\%[0-9a-fA-F]{2}/g,"a");return l.length+(l.length!=u?3:0)}var s=this.options.content,o=n(s,this.options.ecl),a=r(this.options.ecl);this.qrcode=new or(o,a),this.qrcode.addData(s),this.qrcode.make()}rp.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 38`:"",o=e.width,a=e.height,u=r.length,l=o/(u+2*e.padding),d=a/(u+2*e.padding),g=typeof e.join<"u"?!!e.join:!1,y=typeof e.swap<"u"?!!e.swap:!1,C=typeof e.xmlDeclaration<"u"?!!e.xmlDeclaration:!0,A=typeof e.predefined<"u"?!!e.predefined:!1,D=A?i+'<defs><path id="qrmodule" d="M0 0 h'+d+" v"+l+' H0 z" style="fill:'+e.color+';shape-rendering:crispEdges;" /></defs>'+s:"",O=i+'<rect x="0" y="0" width="'+o+'" height="'+a+'" style="fill:'+e.background+';shape-rendering:crispEdges;"/>'+s,x="",I="",N=0;N<u;N++)for(var P=0;P<u;P++){var L=r[P][N];if(L){var B=P*l+e.padding*l,G=N*d+e.padding*d;if(y){var z=B;B=G,G=z}if(g){var W=l+B,K=d+G;B=Number.isInteger(B)?Number(B):B.toFixed(2),G=Number.isInteger(G)?Number(G):G.toFixed(2),W=Number.isInteger(W)?Number(W):W.toFixed(2),K=Number.isInteger(K)?Number(K):K.toFixed(2),I+="M"+B+","+G+" V"+K+" H"+W+" V"+G+" H"+B+" Z "}else A?x+=i+'<use x="'+B.toString()+'" y="'+G.toString()+'" href="#qrmodule" />'+s:x+=i+'<rect x="'+B.toString()+'" y="'+G.toString()+'" width="'+l+'" height="'+d+'" style="fill:'+e.color+';shape-rendering:crispEdges;"/>'+s}}g&&(x=i+'<path x="0" y="0" style="fill:'+e.color+';shape-rendering:crispEdges;" d="'+I+'" />');let Y="";if(this.options.image!==void 0&&this.options.image.svg){const b=o*this.options.image.width/100,c=a*this.options.image.height/100,h=o/2-b/2,p=a/2-c/2;Y+=`<svg x="${h}" y="${p}" width="${b}" height="${c}" viewBox="0 0 100 100" preserveAspectRatio="xMinYMin meet">`,Y+=this.options.image.svg+s,Y+="</svg>"}var X="";switch(t.container){case"svg":C&&(X+='<?xml version="1.0" standalone="yes"?>'+s),X+='<svg xmlns="http://www.w3.org/2000/svg" version="1.1" width="'+o+'" height="'+a+'">'+s,X+=D+O+x,X+=Y,X+="</svg>";break;case"svg-viewbox":C&&(X+='<?xml version="1.0" standalone="yes"?>'+s),X+='<svg xmlns="http://www.w3.org/2000/svg" version="1.1" viewBox="0 0 '+o+" "+a+'">'+s,X+=D+O+x,X+=Y,X+="</svg>";break;case"g":X+='<g width="'+o+'" height="'+a+'">'+s,X+=D+O+x,X+=Y,X+="</g>";break;default:X+=(D+O+x+Y).replace(/^\s+/,"");break}return X};var e3=rp,t3=J&&J.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Io,"__esModule",{value:!0});Io.QRCode=void 0;const r3=It,_f=as,n3=t3(e3),i3=t=>{const[e,r]=(0,_f.useState)("");return(0,_f.useEffect)(()=>{var n,i;const s=new n3.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=Buffer.from(s.svg(),"utf8").toString("base64");r(`data:image/svg+xml;base64,${o}`)}),e?(0,r3.h)("img",{src:e,alt:"QR Code"}):null};Io.QRCode=i3;var Ao={},hu={};
38Object.defineProperty(hu,"__esModule",{value:!0});hu.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 s3=J&&J.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Ao,"__esModule",{value:!0});Ao.Spinner=void 0;const _s=It,o3=s3(hu),a3=t=>{var e;const r=(e=t.size)!==null&&e!==void 0?e:64,n=t.color||"#000";return(0,_s.h)("div",{class:"-cbwsdk-spinner"},(0,_s.h)("style",null,o3.default),(0,_s.h)("svg",{viewBox:"0 0 100 100",xmlns:"http://www.w3.org/2000/svg",style:{width:r,height:r}},(0,_s.h)("circle",{style:{cx:50,cy:50,r:45,stroke:n}})))};Ao.Spinner=a3;var du={};Object.defineProperty(du,"__esModule",{value:!0});du.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;
38color:#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=J&&J.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(sr,"__esModule",{value:!0});sr.CoinbaseAppSteps=sr.CoinbaseWalletSteps=sr.ConnectItem=sr.ConnectContent=void 0;const Lt=vi(xo),te=It,Sf=as,c3=Z,u3=ji,l3=Mo,f3=vi(cu),h3=vi(uu),np=Co,d3=vi(lu),p3=vi(fu),g3=Ro,b3=Io,v3=Ao,y3=vi(du),Ef={"coinbase-wallet-app":{title:"Coinbase Wallet app",description:"Connect with your self-custody wallet",icon:h3.default,steps:sp},"coinbase-app":{title:"Coinbase app",description:"Connect with your Coinbase account",icon:f3.default,steps:op}},m3=t=>{switch(t){case"coinbase-app":return d3.default;case"coinbase-wallet-app":default:return p3.default}},uc=t=>t==="light"?"#FFFFFF":"#0A0B0D";function w3(t){const{theme:e}=t,[r,n]=(0,Sf.useState)("coinbase-wallet-app"),i=(0,Sf.useCallback)(l=>{n(l)},[]),s=(0,c3.createQrUrl)(t.sessionId,t.sessionSecret,t.linkAPIUrl,t.isParentConnection,t.version,t.chainId),o=Ef[r];if(!r)return null;const a=o.steps,u=r==="coinbase-app";return(0,te.h)("div",{"data-testid":"connect-content",class:(0,Lt.default)("-cbwsdk-connect-content",e)},(0,te.h)("style",null,y3.default),(0,te.h)("div",{class:"-cbwsdk-connect-content-header"},(0,te.h)("h2",{class:(0,Lt.default)("-cbwsdk-connect-content-heading",e)},"Scan to connect with one of our mobile apps"),t.onCancel&&(0,te.h)("button",{type:"button",class:"-cbwsdk-cancel-button",onClick:t.onCancel},(0,te.h)(l3.CloseIcon,{fill:e==="light"?"#0A0B0D":"#FFFFFF"}))),(0,te.h)("div",{class:"-cbwsdk-connect-content-layout"},(0,te.h)("div",{class:"-cbwsdk-connect-content-column-left"},(0,te.h)("div",null,Object.entries(Ef).map(([l,d])=>(0,te.h)(ip,{key:l,title:d.title,description:d.description,icon:d.icon,selected:r===l,onClick:()=>i(l),theme:e}))),u&&(0,te.h)("div",{class:(0,Lt.default)("-cbwsdk-connect-content-update-app",e)},"Don’t see a ",(0,te.h)("strong",null,"Scan")," option? Update your Coinbase app to the latest version and try again.")),(0,te.h)("div",{class:"-cbwsdk-connect-content-column-right"},(0,te.h)("div",{class:"-cbwsdk-connect-content-qr-wrapper"},(0,te.h)(b3.QRCode,{content:s,width:200,height:200,fgColor:"#000",bgColor:"transparent",image:{svg:m3(r),width:25,height:25}}),(0,te.h)("input",{type:"hidden",name:"cbw-cbwsdk-version",value:u3.LIB_VERSION}),(0,te.h)("input",{type:"hidden",value:s})),(0,te.h)(a,{theme:e}),!t.isConnected&&(0,te.h)("div",{"data-testid":"connecting-spinner",class:(0,Lt.default)("-cbwsdk-connect-content-qr-connecting",e)},(0,te.h)(v3.Spinner,{size:36,color:e==="dark"?"#FFF":"#000"}),(0,te.h)("p",null,"Connecting...")))))}sr.ConnectContent=w3;function ip({title:t,description:e,icon:r,selected:n,theme:i,onClick:s}){return(0,te.h)("div",{onClick:s,class:(0,Lt.default)("-cbwsdk-connect-item",i,{selected:n})},(0,te.h)("div",null,(0,te.h)("img",{src:r,alt:t})),(0,te.h)("div",{class:"-cbwsdk-connect-item-copy-wrapper"},(0,te.h)("h3",{class:"-cbwsdk-connect-item-title"},t),(0,te.h)("p",{class:"-cbwsdk-connect-item-description"},e)))}sr.ConnectItem=ip;function sp({theme:t}){return(0,te.h)("ol",{class:"-cbwsdk-wallet-steps"},(0,te.h)("li",{class:(0,Lt.default)("-cbwsdk-wallet-steps-item",t)},(0,te.h)("div",{class:"-cbwsdk-wallet-steps-item-wrapper"},"Open Coinbase Wallet app")),(0,te.h)("li",{class:(0,Lt.default)("-cbwsdk-wallet-steps-item",t)},(0,te.h)("div",{class:"-cbwsdk-wallet-steps-item-wrapper"},(0,te.h)("span",null,"Tap ",(0,te.h)("strong",null,"Scan")," "),(0,te.h)("span",{class:(0,Lt.default)("-cbwsdk-wallet-steps-pad-left","-cbwsdk-wallet-steps-icon",t)},(0,te.h)(np.QRCodeIcon,{fill:uc(t)})))))}sr.CoinbaseWalletSteps=sp;function op({theme:t}){return(0,te.h)("ol",{class:"-cbwsdk-wallet-steps"},(0,te.h)("li",{class:(0,Lt.default)("-cbwsdk-wallet-steps-item",t)},(0,te.h)("div",{class:"-cbwsdk-wallet-steps-item-wrapper"},"Open Coinbase app")),(0,te.h)("li",{class:(0,Lt.default)("-cbwsdk-wallet-steps-item",t)},(0,te.h)("div",{class:"-cbwsdk-wallet-steps-item-wrapper"},(0,te.h)("span",null,"Tap ",(0,te.h)("strong",null,"More")),(0,te.h)("span",{class:(0,Lt.default)("-cbwsdk-wallet-steps-pad-left","-cbwsdk-wallet-steps-icon",t)},(0,te.h)(g3.StatusDotIcon,{fill:uc(t)})),(0,te.h)("span",{class:"-cbwsdk-wallet-steps-pad-left"},"then ",(0,te.h)("strong",null,"Scan")),(0,te.h)("span",{class:(0,Lt.default)("-cbwsdk-wallet-steps-pad-left","-cbwsdk-wallet-steps-icon",t)},(0,te.h)(np.QRCodeIcon,{fill:uc(t)})))))}sr.CoinbaseAppSteps=op;var ko={},To={};Object.defineProperty(To,"__esModule",{value:!0});To.ArrowLeftIcon=void 0;const xf=It;function _3(t){return(0,xf.h)("svg",Object.assign({width:"16",height:"16",viewBox:"0 0 16 16",xmlns:"http://www.w3.org/2000/svg"}
38,t),(0,xf.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"}))}To.ArrowLeftIcon=_3;var No={};Object.defineProperty(No,"__esModule",{value:!0});No.LaptopIcon=void 0;const La=It;function S3(t){return(0,La.h)("svg",Object.assign({width:"14",height:"14",viewBox:"0 0 14 14",xmlns:"http://www.w3.org/2000/svg"},t),(0,La.h)("path",{d:"M1.8001 2.2002H12.2001V9.40019H1.8001V2.2002ZM3.4001 3.8002V7.80019H10.6001V3.8002H3.4001Z"}),(0,La.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"}))}No.LaptopIcon=S3;var Oo={};Object.defineProperty(Oo,"__esModule",{value:!0});Oo.SafeIcon=void 0;const Mf=It;function E3(t){return(0,Mf.h)("svg",Object.assign({width:"14",height:"14",viewBox:"0 0 14 14",xmlns:"http://www.w3.org/2000/svg"},t),(0,Mf.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"}))}Oo.SafeIcon=E3;var pu={};Object.defineProperty(pu,"__esModule",{value:!0});pu.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 ap=J&&J.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(ko,"__esModule",{value:!0});ko.TryExtensionContent=void 0;const Gr=ap(xo),tt=It,Pa=as,x3=To,M3=No,C3=Oo,R3=ap(pu);function I3({theme:t}){const[e,r]=(0,Pa.useState)(!1),n=(0,Pa.useCallback)(()=>{window.open("https://api.wallet.coinbase.com/rpc/v2/desktop/chrome","_blank")},[]),i=(0,Pa.useCallback)(()=>{e?window.location.reload():(n(),r(!0))},[n,e]);return(0,tt.h)("div",{class:(0,Gr.default)("-cbwsdk-try-extension",t)},(0,tt.h)("style",null,R3.default),(0,tt.h)("div",{class:"-cbwsdk-try-extension-column-half"},(0,tt.h)("h3",{class:(0,Gr.default)("-cbwsdk-try-extension-heading",t)}
vendor: 1,962 bytes, line 38
38,"Or try the Coinbase Wallet browser extension"),(0,tt.h)("div",{class:"-cbwsdk-try-extension-cta-wrapper"},(0,tt.h)("button",{class:(0,Gr.default)("-cbwsdk-try-extension-cta",t),onClick:i},e?"Refresh":"Install"),(0,tt.h)("div",null,!e&&(0,tt.h)(x3.ArrowLeftIcon,{class:"-cbwsdk-try-extension-cta-icon",fill:t==="light"?"#0052FF":"#588AF5"})))),(0,tt.h)("div",{class:"-cbwsdk-try-extension-column-half"},(0,tt.h)("ul",{class:"-cbwsdk-try-extension-list"},(0,tt.h)("li",{class:"-cbwsdk-try-extension-list-item"},(0,tt.h)("div",{class:"-cbwsdk-try-extension-list-item-icon-wrapper"},(0,tt.h)("span",{class:(0,Gr.default)("-cbwsdk-try-extension-list-item-icon",t)},(0,tt.h)(M3.LaptopIcon,{fill:t==="light"?"#0A0B0D":"#FFFFFF"}))),(0,tt.h)("div",{class:(0,Gr.default)("-cbwsdk-try-extension-list-item-copy",t)},"Connect with dapps with just one click on your desktop browser")),(0,tt.h)("li",{class:"-cbwsdk-try-extension-list-item"},(0,tt.h)("div",{class:"-cbwsdk-try-extension-list-item-icon-wrapper"},(0,tt.h)("span",{class:(0,Gr.default)("-cbwsdk-try-extension-list-item-icon",t)},(0,tt.h)(C3.SafeIcon,{fill:t==="light"?"#0A0B0D":"#FFFFFF"}))),(0,tt.h)("div",{class:(0,Gr.default)("-cbwsdk-try-extension-list-item-copy",t)},"Add an additional layer of security by using a supported Ledger hardware wallet")))))}ko.TryExtensionContent=I3;var gu={};Object.defineProperty(gu,"__esModule",{value:!0});gu.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}
38.-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 cp=J&&J.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Eo,"__esModule",{value:!0});Eo.ConnectDialog=void 0;const Da=cp(xo),Jr=It,$a=as,A3=sr,k3=ko,T3=cp(gu),N3=t=>{const{isOpen:e,darkMode:r}=t,[n,i]=(0,$a.useState)(!e),[s,o]=(0,$a.useState)(!e);(0,$a.useEffect)(()=>{const u=[window.setTimeout(()=>{o(!e)},10)];return e?i(!1):u.push(window.setTimeout(()=>{i(!0)},360)),()=>{u.forEach(window.clearTimeout)}},[t.isOpen]);const a=r?"dark":"light";return(0,Jr.h)("div",{class:(0,Da.default)("-cbwsdk-connect-dialog-container",n&&"-cbwsdk-connect-dialog-container-hidden")},(0,Jr.h)("style",null,T3.default),(0,Jr.h)("div",{class:(0,Da.default)("-cbwsdk-connect-dialog-backdrop",a,s&&"-cbwsdk-connect-dialog-backdrop-hidden")}),(0,Jr.h)("div",{class:"-cbwsdk-connect-dialog"},(0,Jr.h)("div",{class:(0,Da.default)("-cbwsdk-connect-dialog-box",s&&"-cbwsdk-connect-dialog-box-hidden")},t.connectDisabled?null:(0,Jr.h)(A3.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,Jr.h)(k3.TryExtensionContent,{theme:a}))))};Eo.ConnectDialog=N3;Object.defineProperty(wo,"__esModule",{value:!0});wo.LinkFlow=void 0;const Ba=It,Cf=So,O3=Eo;class L3{constructor(e){this.extensionUI$=new Cf.BehaviorSubject({}),this.subscriptions=new Cf.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)(O3.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)}}wo.LinkFlow=L3;var up={},bu={};Object.defineProperty(bu,"__esModule",{value:!0});bu.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;
38cursor: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=J&&J.__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(xo),n=It,i=as,s=e(bu),o="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTIiIGhlaWdodD0iMTIiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTEyIDYuNzV2LTEuNWwtMS43Mi0uNTdjLS4wOC0uMjctLjE5LS41Mi0uMzItLjc3bC44MS0xLjYyLTEuMDYtMS4wNi0xLjYyLjgxYy0uMjQtLjEzLS41LS4yNC0uNzctLjMyTDYuNzUgMGgtMS41bC0uNTcgMS43MmMtLjI3LjA4LS41My4xOS0uNzcuMzJsLTEuNjItLjgxLTEuMDYgMS4wNi44MSAxLjYyYy0uMTMuMjQtLjI0LjUtLjMyLjc3TDAgNS4yNXYxLjVsMS43Mi41N2MuMDguMjcuMTkuNTMuMzIuNzdsLS44MSAxLjYyIDEuMDYgMS4wNiAxLjYyLS44MWMuMjQuMTMuNS4yMy43Ny4zMkw1LjI1IDEyaDEuNWwuNTctMS43MmMuMjctLjA4LjUyLS4xOS43Ny0uMzJsMS42Mi44MSAxLjA2LTEuMDYtLjgxLTEuNjJjLjEzLS4yNC4yMy0uNS4zMi0uNzdMMTIgNi43NXpNNiA4LjVhMi41IDIuNSAwIDAxMC01IDIuNSAyLjUgMCAwMTAgNXoiIGZpbGw9IiMwNTBGMTkiLz48L3N2Zz4=";function a(g){switch(g){case"coinbase-app":return"data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMzAiIGhlaWdodD0iMzAiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTE0LjY3NCAxOC44NThjLTIuMDQ1IDAtMy42NDgtMS43MjItMy42NDgtMy44NDVzMS42NTktMy44NDUgMy42NDgtMy44NDVjMS44MjQgMCAzLjMxNyAxLjM3NyAzLjU5MyAzLjIxNGgzLjcwM2MtLjMzMS0zLjk2LTMuNDgyLTcuMDU5LTcuMjk2LTcuMDU5LTQuMDM0IDAtNy4zNSAzLjQ0My03LjM1IDcuNjkgMCA0LjI0NiAzLjI2IDcuNjkgNy4zNSA3LjY5IDMuODcgMCA2Ljk2NS0zLjEgNy4yOTYtNy4wNTloLTMuNzAzYy0uMjc2IDEuODM2LTEuNzY5IDMuMjE0LTMuNTkzIDMuMjE0WiIgZmlsbD0iI2ZmZiIvPjxwYXRoIGQ9Ik0wIDEwLjY3OGMwLTMuNzExIDAtNS41OTYuNzQyLTcuMDIzQTYuNTMyIDYuNTMyIDAgMCAxIDMuNjU1Ljc0MkM1LjA4MiAwIDYuOTY3IDAgMTAuNjc4IDBoNy45MzhjMy43MTEgMCA1LjU5NiAwIDcuMDIzLjc0MmE2LjUzMSA2LjUzMSAwIDAgMSAyLjkxMyAyLjkxM2MuNzQyIDEuNDI3Ljc0MiAzLjMxMi43NDIgNy4wMjN2Ny45MzhjMCAzLjcxMSAwIDUuNTk2LS43NDIgNy4wMjNhNi41MzEgNi41MzEgMCAwIDEtMi45MTMgMi45MTNjLTEuNDI3Ljc0Mi0zLjMxMi43NDItNy4wMjMuNzQyaC03LjkzOGMtMy43MTEgMC01LjU5NiAwLTcuMDIzLS43NDJhNi41MzEgNi41MzEgMCAwIDEtMi45MTMtMi45MTNDMCAyNC4yMTIgMCAyMi4zODQgMCAxOC42MTZ2LTcuOTM4WiIgZmlsbD0iIzAwNTJGRiIvPjxwYXRoIGQ9Ik0xNC42ODQgMTkuNzczYy0yLjcyNyA
38wLTQuODY0LTIuMjk1LTQuODY0LTUuMTI2IDAtMi44MzEgMi4yMS01LjEyNyA0Ljg2NC01LjEyNyAyLjQzMiAwIDQuNDIyIDEuODM3IDQuNzkgNC4yODVoNC45MzhjLS40NDItNS4yOC00LjY0My05LjQxMS05LjcyOC05LjQxMS01LjM4IDAtOS44MDIgNC41OS05LjgwMiAxMC4yNTMgMCA1LjY2MiA0LjM0OCAxMC4yNTMgOS44MDIgMTAuMjUzIDUuMTU5IDAgOS4yODYtNC4xMzIgOS43MjgtOS40MTFoLTQuOTM4Yy0uMzY4IDIuNDQ4LTIuMzU4IDQuMjg0LTQuNzkgNC4yODRaIiBmaWxsPSIjZmZmIi8+PC9zdmc+";case"coinbase-wallet-app":default:return"data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMzIiIGhlaWdodD0iMzIiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTEuNDkyIDEwLjQxOWE4LjkzIDguOTMgMCAwMTguOTMtOC45M2gxMS4xNjNhOC45MyA4LjkzIDAgMDE4LjkzIDguOTN2MTEuMTYzYTguOTMgOC45MyAwIDAxLTguOTMgOC45M0gxMC40MjJhOC45MyA4LjkzIDAgMDEtOC45My04LjkzVjEwLjQxOXoiIGZpbGw9IiMxNjUyRjAiLz48cGF0aCBmaWxsLXJ1bGU9ImV2ZW5vZGQiIGNsaXAtcnVsZT0iZXZlbm9kZCIgZD0iTTEwLjQxOSAwSDIxLjU4QzI3LjMzNSAwIDMyIDQuNjY1IDMyIDEwLjQxOVYyMS41OEMzMiAyNy4zMzUgMjcuMzM1IDMyIDIxLjU4MSAzMkgxMC40MkM0LjY2NSAzMiAwIDI3LjMzNSAwIDIxLjU4MVYxMC40MkMwIDQuNjY1IDQuNjY1IDAgMTAuNDE5IDB6bTAgMS40ODhhOC45MyA4LjkzIDAgMDAtOC45MyA4LjkzdjExLjE2M2E4LjkzIDguOTMgMCAwMDguOTMgOC45M0gyMS41OGE4LjkzIDguOTMgMCAwMDguOTMtOC45M1YxMC40MmE4LjkzIDguOTMgMCAwMC04LjkzLTguOTNIMTAuNDJ6IiBmaWxsPSIjZmZmIi8+PHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik0xNS45OTggMjYuMDQ5Yy01LjU0OSAwLTEwLjA0Ny00LjQ5OC0xMC4wNDctMTAuMDQ3IDAtNS41NDggNC40OTgtMTAuMDQ2IDEwLjA0Ny0xMC4wNDYgNS41NDggMCAxMC4wNDYgNC40OTggMTAuMDQ2IDEwLjA0NiAwIDUuNTQ5LTQuNDk4IDEwLjA0Ny0xMC4wNDYgMTAuMDQ3eiIgZmlsbD0iI2ZmZiIvPjxwYXRoIGQ9Ik0xMi43NjIgMTQuMjU0YzAtLjgyMi42NjctMS40ODkgMS40ODktMS40ODloMy40OTdjLjgyMiAwIDEuNDg4LjY2NiAxLjQ4OCAxLjQ4OXYzLjQ5N2MwIC44MjItLjY2NiAxLjQ4OC0xLjQ4OCAxLjQ4OGgtMy40OTdhMS40ODggMS40ODggMCAwMS0xLjQ4OS0xLjQ4OHYtMy40OTh6IiBmaWxsPSIjMTY1MkYwIi8+PC9zdmc+"}}class u{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 C=this.nextItemKey++;return this.items.set(C,y),this.render(),()=>{this.items.delete(C),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,C])=>(0,n.h)(t.SnackbarInstance,Object.assign({},C,{key:y}))))),this.root)}}t.Snackbar=u;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 d=({autoExpand:g,message:y,menuItems:C,appSrc:A})=>{const[D,O]=(0,i.useState)(!0),[x,I]=(0,i.useState)(g??!1);(0,i.useEffect)(()=>{const P=[window.setTimeout(()=>{O(!1)},1),window.setTimeout(()=>{I(!0)},1e4)];return()=>{P.forEach(window.clearTimeout)}});const N=()=>{I(!x)};return(0,n.h)("div",{class:(0,r.default)("-cbwsdk-snackbar-instance",D&&"-cbwsdk-snackbar-instance-hidden",x&&"-cbwsdk-snackbar-instance-expanded")},(0,n.h)("div",{class:"-cbwsdk-snackbar-instance-header",onClick:N},(0,n.h)("img",{src:a(A),class:"-cbwsdk-snackbar-instance-header-cblogo"}),(0,n.h)("div",{class:"-cbwsdk-snackbar-instance-header-message"},y),(0,n.h)("div",{class:"-gear-container"},!x&&(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"}))),C&&C.length>0&&(0,n.h)("div",{class:"-cbwsdk-snackbar-instance-menu"},C.map((P,L)=>(0,n.h)("div",{class:(0,r.default)("-cbwsdk-snackbar-instance-menu-item",P.isRed&&"-cbwsdk-snackbar-instance-menu-item-is-red"),onClick:P.onClick,key:L},(0,n.h)("svg",{width:P.svgWidth,height:P.svgHeight,viewBox:"0 0 10 11",fill:"none",xmlns:"http://www.w3.org/2000/svg"},(0,n.h)("path",{"fill-rule":P.defaultFillRule,"clip-rule":P.defaultClipRule,d:P.path,fill:"#AAAAAA"})),(0,n.h)("span",{class:(0,r.default)("-cbwsdk-snackbar-instance-menu-item-info",P.isRed&&"-cbwsdk-snackbar-instance-menu-item-info-is-red")},P.info)))))};t.SnackbarInstance=d})(up);var Lo={},vu={};
38Object.defineProperty(vu,"__esModule",{value:!0});vu.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 P3=J&&J.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Lo,"__esModule",{value:!0});Lo.injectCssReset=void 0;const D3=P3(vu);function $3(){const t=document.createElement("style");t.type="text/css",t.appendChild(document.createTextNode(D3.default)),document.documentElement.appendChild(t)}Lo.injectCssReset=$3;Object.defineProperty(mo,"__esModule",{value:!0});mo.WalletSDKUI=void 0;const B3=wo,j3=up,F3=Lo;class W3{constructor(e){this.standalone=null,this.attached=!1,this.appSrc=null,this.snackbar=new j3.Snackbar({darkMode:e.darkMode}),this.linkFlow=new B3.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,F3.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.9687
385C6.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}}mo.WalletSDKUI=W3;var Po={},Do={};Object.defineProperty(Do,"__esModule",{value:!0});var jn;(function(t){t.typeOfFunction="function",t.boolTrue=!0})(jn||(jn={}));function lp(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}}}Do.bind=lp;Do.default=lp;function fp(t){return function(r){return r.lift(new H3(t))}}var H3=function(){function t(e){this.durationSelector=e}return t.prototype.call=function(e,r){return r.subscribe(new V3(e,this.durationSelector))},t}(),V3=function(t){j(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=Xe(n,new Ye(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}(Ke);function U3(t,e){return e===void 0&&(e=wt),fp(function(){return Yd(t,e)})}function z3(t){return function(r){return r.lift(new q3(t))}}var q3=function(){function t(e){this.closingNotifier=e}return t.prototype.call=function(e,r){return r.subscribe(new G3(e,this.closingNotifier))},t}(),G3=function(t){j(e,t);function e(r,n){var i=t.call(this,r)||this;return i.buffer=[],i.add(Xe(n,new Ye(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}(Ke);function J3(t,e){return e===void 0&&(e=null),function(n){return n.lift(new Z3(t,e))}}var Z3=function(){function t(e,r){this.bufferSize=e,this.startBufferEvery=r,!r||e===r?this.subscriberClass=Q3:this.subscriberClass=Y3}return t.prototype.call=function(e,r){return r.subscribe(new this.subscriberClass(e,this.bufferSize,this.startBufferEvery))},t}(),Q3=function(t){j(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}(Q),Y3=function(t){j(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 u=o.length;u--;){var l=o[u];l.push(r),l.length===i&&(o.splice(u,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}(Q);function K3(t){var e=arguments.length,r=wt;Rt(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 X3(t,n,i,r))}}var X3=function(){function t(e,r,n,i){this.bufferTimeSpan=e,this.bufferCreationInterval=r,this.maxBufferSize=n,this.scheduler
38=i}return t.prototype.call=function(e,r){return r.subscribe(new t4(e,this.bufferTimeSpan,this.bufferCreationInterval,this.maxBufferSize,this.scheduler))},t}(),e4=function(){function t(){this.buffer=[]}return t}(),t4=function(t){j(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 u=a.openContext();if(a.timespanOnly=i==null||i<0,a.timespanOnly){var l={subscriber:a,context:u,bufferTimeSpan:n};a.add(u.closeAction=o.schedule(Rf,n,l))}else{var d={subscriber:a,context:u},g={bufferTimeSpan:n,bufferCreationInterval:i,subscriber:a,scheduler:o};a.add(u.closeAction=o.schedule(hp,n,d)),a.add(o.schedule(r4,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],u=a.buffer;u.push(r),u.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(Rf,i,s))}},e.prototype.openContext=function(){var r=new e4;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}(Q);function Rf(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 r4(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(hp,r,{subscriber:n,context:s})),o.schedule(t,e))}function hp(t){var e=t.subscriber,r=t.context;e.closeContext(r)}function n4(t,e){return function(n){return n.lift(new i4(t,e))}}var i4=function(){function t(e,r){this.openings=e,this.closingSelector=r}return t.prototype.call=function(e,r){return r.subscribe(new s4(e,this.openings,this.closingSelector))},t}(),s4=function(t){j(e,t);function e(r,n,i){var s=t.call(this,r)||this;return s.closingSelector=i,s.contexts=[],s.add(gr(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 Qe,o={buffer:i,subscription:s};n.push(o);var a=gr(this,r,o);!a||a.closed?this.closeBuffer(o):(a.context=o,this.add(a),s.add(a))},e}(yn);function o4(t){return function(e){return e.lift(new a4(t))}}var a4=function(){function t(e){this.closingSelector=e}return t.prototype.call=function(e,r){return r.subscribe(new c4(e,this.closingSelector))},t}(),c4=function(t){j(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 Qe,this.closingSubscription=r,this.add(r),this.subscribing=!0,r.add(Xe(i,new Ye(this))),this.subscribing=!1},e}(Ke);function u4(t){return function(r){var n=new l4(t),i=r.lift(n);return n.caught=i}}var l4=function(){function t(e){this.selector=e}return t.prototype.call=function(e,r){return r.subscribe(new f4(e,this.selector,this.caught))},t}(),f4=function(t){j(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 Ye(this);this.add(i);var s=Xe(n,i);s!==i&&this.add(s)}},e}(Ke);function h4(t){return function(e){return e.lift(new su(t))}}function d4(){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&&mt(t[0])&&(t=t[0].slice()),function(n){return n.lift.call(br([n].concat(t)),new su(r))}}function p4(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return function(r){return r.lift.call(Di.apply(void 0,[r].concat(t)))}}function dp(t,e){return un(t,e,1)}function g4(t,e){return dp(function(){return t},e)}function b4(t){return function(e){return e.lift(new v4(t,e))}}var v4=function(){function t(e,r){this.predicate=e,this.source=r}return t.prototype.call=function(e,r){return r.subscribe(new y4(e,this.predicate,this.source))},t}(),y4=function(t){j(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}(Q);function m4(t){return function(e){return e.lift(new w4(t))}}var w4=function(){function t(e){this.durationSelector=e}return t.prototype.call=function(e,r){return r.subscribe(new _4(e,this.durationSelector))},t}(),_4=function(t){j(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);
38n&&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=Xe(n,new Ye(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}(Ke);function S4(t,e){return e===void 0&&(e=wt),function(r){return r.lift(new E4(t,e))}}var E4=function(){function t(e,r){this.dueTime=e,this.scheduler=r}return t.prototype.call=function(e,r){return r.subscribe(new x4(e,this.dueTime,this.scheduler))},t}(),x4=function(t){j(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(M4,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}(Q);function M4(t){t.debouncedNext()}function cs(t){return t===void 0&&(t=null),function(e){return e.lift(new C4(t))}}var C4=function(){function t(e){this.defaultValue=e}return t.prototype.call=function(e,r){return r.subscribe(new R4(e,this.defaultValue))},t}(),R4=function(t){j(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}(Q);function pp(t){return t instanceof Date&&!isNaN(+t)}function I4(t,e){e===void 0&&(e=wt);var r=pp(t),n=r?+t-e.now():Math.abs(t);return function(i){return i.lift(new A4(n,e))}}var A4=function(){function t(e,r){this.delay=e,this.scheduler=r}return t.prototype.call=function(e,r){return r.subscribe(new k4(e,this.delay,this.scheduler))},t}(),k4=function(t){j(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 T4(n.now()+this.delay,r);this.queue.push(i),this.active===!1&&this._schedule(n)}},e.prototype._next=function(r){this.scheduleNotification(dr.createNext(r))},e.prototype._error=function(r){this.errored=!0,this.queue=[],this.destination.error(r),this.unsubscribe()},e.prototype._complete=function(){this.scheduleNotification(dr.createComplete()),this.unsubscribe()},e}(Q),T4=function(){function t(e,r){this.time=e,this.notification=r}return t}();function N4(t,e){return e?function(r){return new L4(r,e).lift(new If(t))}:function(r){return r.lift(new If(t))}}var If=function(){function t(e){this.delayDurationSelector=e}return t.prototype.call=function(e,r){return r.subscribe(new O4(e,this.delayDurationSelector))},t}(),O4=function(t){j(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=gr(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}(yn),L4=function(t){j(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 P4(r,this.source))},e}(ae),P4=function(t){j(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}(Q);function D4(){return function(e){return e.lift(new $4)}}var $4=function(){function t(){}return t.prototype.call=function(e,r){return r.subscribe(new B4(e))},t}(),B4=function(t){j(e,t);function e(r){return t.call(this,r)||this}return e.prototype._next=function(r){r.observe(this.destination)},e}(Q);function j4(t,e){return function(r){return r.lift(new F4(t,e))}}var F4=function(){function t(e,r){this.keySelector=e,this.flushes=r}return t.prototype.call=function(e,r){return r.subscribe(new W4(e,this.keySelector,this.flushes))},t}(),W4=function(t){j(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(Xe(i,new Ye(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}(Ke);function gp(t,e){return function(r){return r.lift(new H4(t,e))}}var H4=function(){function t(e,r){this.compare=e,this.keySelector=r}return t.prototype.call=function(e,r){return r.subscribe(new V4(e,this.compare,this.keySelector))},t}(),V4=function(t){j(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}(Q);function U4(t,e){return gp(function(r,n){return e?e(r[t],n[t]):r[t]===n[t]})}function $o(t){return t===void 0&&(t=G4),function(e){return e.lift(new z4(t))}}var z4=function(){function t(e){this.errorFactory=e}return t.prototype.call=function(e,r){return r.subscribe(new q4(e,this.errorFactory)
38)},t}(),q4=function(t){j(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}(Q);function G4(){return new os}function yu(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 ri}return t.prototype.call=function(e,r){return r.subscribe(new Z4(e,this.total))},t}(),Z4=function(t){j(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}(Q);function Q4(t,e){if(t<0)throw new ri;var r=arguments.length>=2;return function(n){return n.pipe(kr(function(i,s){return s===t}),yu(1),r?cs(e):$o(function(){return new ri}))}}function Y4(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return function(r){return Di(r,_o.apply(void 0,t))}}function K4(t,e){return function(r){return r.lift(new X4(t,e,r))}}var X4=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 e5(e,this.predicate,this.thisArg,this.source))},t}(),e5=function(t){j(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}(Q);function t5(){return function(t){return t.lift(new r5)}}var r5=function(){function t(){}return t.prototype.call=function(e,r){return r.subscribe(new n5(e))},t}(),n5=function(t){j(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(Xe(r,new Ye(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}(Ke);function bp(t,e){return e?function(r){return r.pipe(bp(function(n,i){return br(t(n,i)).pipe(Bt(function(s,o){return e(n,s,i,o)}))}))}:function(r){return r.lift(new i5(t))}}var i5=function(){function t(e){this.project=e}return t.prototype.call=function(e,r){return r.subscribe(new s5(e,this.project))},t}(),s5=function(t){j(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 Ye(this),i=this.destination;i.add(n);var s=Xe(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}(Ke);function o5(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 a5(t,e,r))}}var a5=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 c5(e,this.project,this.concurrent,this.scheduler))},t}(),c5=function(t){j(e,t);function e(r,n,i,s){var o=t.call(this,r)||this;
38return 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},u=this.destination;u.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(Xe(r,new Ye(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}(Ke);function u5(t){return function(e){return e.lift(new l5(t))}}var l5=function(){function t(e){this.callback=e}return t.prototype.call=function(e,r){return r.subscribe(new f5(e,this.callback))},t}(),f5=function(t){j(e,t);function e(r,n){var i=t.call(this,r)||this;return i.add(new Qe(n)),i}return e}(Q);function h5(t,e){if(typeof t!="function")throw new TypeError("predicate is not a function");return function(r){return r.lift(new vp(t,r,!1,e))}}var vp=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 d5(e,this.predicate,this.source,this.yieldIndex,this.thisArg))},t}(),d5=function(t){j(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(u){this.destination.error(u)}},e.prototype._complete=function(){this.notifyComplete(this.yieldIndex?-1:void 0)},e}(Q);function p5(t,e){return function(r){return r.lift(new vp(t,r,!0,e))}}function g5(t,e){var r=arguments.length>=2;return function(n){return n.pipe(t?kr(function(i,s){return t(i,s,n)}):Ir,yu(1),r?cs(e):$o(function(){return new os}))}}function b5(){return function(e){return e.lift(new v5)}}var v5=function(){function t(){}return t.prototype.call=function(e,r){return r.subscribe(new y5(e))},t}(),y5=function(t){j(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype._next=function(r){},e}(Q);function m5(){return function(t){return t.lift(new w5)}}var w5=function(){function t(){}return t.prototype.call=function(e,r){return r.subscribe(new _5(e))},t}(),_5=function(t){j(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}(Q);function Bs(t){return function(r){return t===0?gi():r.lift(new S5(t))}}var S5=function(){function t(e){if(this.total=e,this.total<0)throw new ri}return t.prototype.call=function(e,r){return r.subscribe(new E5(e,this.total))},t}(),E5=function(t){j(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}(Q);function x5(t,e){var r=arguments.length>=2;return function(n){return n.pipe(t?kr(function(i,s){return t(i,s,n)}):Ir,Bs(1),r?cs(e):$o(function(){return new os}))}}function M5(t){return function(e){return e.lift(new C5(t))}}var C5=function(){function t(e){this.value=e}return t.prototype.call=function(e,r){return r.subscribe(new R5(e,this.value))},t}(),R5=function(t){j(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}(Q);function I5(){return function(e){return e.lift(new A5)}}var A5=function(){function t(){}return t.prototype.call=function(e,r){return r.subscribe(new k5(e))},t}(),k5=function(t){j(e,t);function e(r){return t.call(this,r)||this}return e.prototype._next=function(r){this.destination.next(dr.createNext(r))},e.prototype._error=function(r){var n=this.destination;n.next(dr.createError(r)),n.complete()},e.prototype._complete=function(){var r=this.destination;r.next(dr.createComplete()),r.complete()},e}(Q);function js(t,e){var r=!1;return arguments.length>=2&&(r=!0),function(i){return i.lift(new T5(t,e,r))}}var T5=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 N5(e,this.accumulator,this.seed,this.hasSeed))},t}(),N5=function(t){j(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}(Q);function Bo(t,e){return arguments.length>=2?function(n){return nc(js(t,e),Bs(1),cs(e))(n)}:function(n){return nc(js(function(i,s,o){return t(i,s,o+1)}),Bs(1))(n)}}function O5(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 Bo(e)}function L5(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return function(r){return r.lift.call(Gd.apply(void 0,[r].concat(t)))}}function P5(t,e,r){return r===void 0&&(r=Number.POSITIVE_INFINITY),typeof e=="function"?un(function(){return t},e,r):(typeof e=="number"&&(r=e),un(function(){return t},r))}function D5(t,e,r){return r===void 0&&(r=Number.POSITIVE_INFINITY),function(n){return n.lift(new $5(t,e,r))}}var $5=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 B5(e,this.accumulator,this.seed,this.concurrent))},t}(),B5=function(t){j(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 Ye(this),i=this.destination;i.add(n);var s=Xe(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}(Ke);function j5(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 Bo(e)}function ln(t,e){return function(n){var i;if(typeof t=="function"?i=t:i=function(){return t},typeof e=="function")return n.lift(new F5(i,e));var s=Object.create(n,AS);return s.source=n,s.subjectFactory=i,s}}var F5=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 W5(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return t.length===1&&mt(t[0])&&(t=t[0]),function(r){return r.lift(new H5(t))}}var H5=function(){function t(e){this.nextSources=e}return t.prototype.call=function(e,r){return r.subscribe(new V5(e,this.nextSources))},t}(),V5=function(t){j(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 Ye(this),i=this.destination;i.add(n);var s=Xe(r,n);s!==n&&i.add(s)}else this.destination.complete()},e}(Ke);function U5(){return function(t){return t.lift(new z5)}}var z5=function(){function t(){}return t.prototype.call=function(e,r){return r.subscribe(new q5(e))},t}(),q5=function(t){j(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}(Q);function G5(t,e){return function(r){return[kr(t,e)(r),kr(Zd(t,e))(r)]}}function J5(){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 Bt(Z5(t,r))(n)}}function Z5(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 Q5(t){return t?ln(function(){return new ut},t):ln(new ut)}function Y5(t){return function(e){return ln(new Id(t))(e)}}function K5(){return function(t){return ln(new bi)(t)}}function X5(t,e,r,n){r&&typeof r!="function"&&(n=r);var i=typeof r=="function"?r:void 0,s=new iu(t,e,n);return function(o){return ln(function(){return s},i)(o)}}function ex(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return function(n){return t.length===1&&mt(t[0])&&(t=t[0]),n.lift.call(Qd.apply(void 0,[n].concat(t)))}}function tx(t){return t===void 0&&(t=-1),function(e){return t===0?gi():t<0?e.lift(new Af(-1,e)):e.lift(new Af(t-1,e))}}var Af=function(){function t(e,r){this.count=e,this.source=r}return t.prototype.call=function(e,r){return r.subscribe(new rx(e,this.count,this.source))},t}(),rx=function(t){j(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}(Q);function nx(t){return function(e){return e.lift(new ix(t))}}var ix=function(){function t(e){this.notifier=e}return t.prototype.call=function(e,r){return r.subscribe(new sx(e,this.notifier,r))},t}(),sx=function(t){j(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 ut;var r;try{var n=this.notifier;r=n(this.notifications)}catch{return t.prototype.complete.call(this)}this.retries=r,this.retriesSubscription=Xe(r,new Ye(this))},e}(Ke);function ox(t){return t===void 0&&(t=-1),function(e){return e.lift(new ax(t,e))}}var ax=function(){function t(e,r){this.count=e,this.source=r}return t.prototype.call=function(e,r){return r.subscribe(new cx(e,this.count,this.source))},t}(),cx=function(t){j(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}(Q);function ux(t){return function(e){return e.lift(new lx(t,e))}}var lx=function(){function t(e,r){this.notifier=e,this.source=r}return t.prototype.call=function(e,r){return r.subscribe(new fx(e,this.notifier,this.source))},t}(),fx=function(t){j(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 ut;try{var o=this.notifier;i=o(n)}catch(a){return t.prototype.error.call(this,a)}s=Xe(i,new Ye(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}(Ke);function hx(t){return function(e){return e.lift(new dx(t))}}var dx=function(){function t(e){this.notifier=e}return t.prototype.call=function(e,r){var n=new px(e),i=r.subscribe(n);return i.add(Xe(this.notifier,new Ye(n))),i},t}(),px=function(t){j(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}(Ke);function gx(t,e){return e===void 0&&(e=wt),function(r){return r.lift(new bx(t,e))}}
38var bx=function(){function t(e,r){this.period=e,this.scheduler=r}return t.prototype.call=function(e,r){return r.subscribe(new vx(e,this.period,this.scheduler))},t}(),vx=function(t){j(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(yx,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}(Q);function yx(t){var e=t.subscriber,r=t.period;e.notifyNext(),this.schedule(t,r)}function mx(t,e){return function(r){return r.lift(new wx(t,e))}}var wx=function(){function t(e,r){this.compareTo=e,this.comparator=r}return t.prototype.call=function(e,r){return r.subscribe(new _x(e,this.compareTo,this.comparator))},t}(),_x=function(t){j(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 Sx(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(),u=!1;try{u=s?s(o,a):o===a}catch(l){this.destination.error(l)}u||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}(Q),Sx=function(t){j(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}(Q);function Ex(){return new ut}function xx(){return function(t){return tu()(ln(Ex)(t))}}function Mx(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(Cx(n))}}function Cx(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,u=0,l,d=!1,g=!1;return function(C){u++;var A;!a||d?(d=!1,a=new iu(r,i,o),A=a.subscribe(this),l=C.subscribe({next:function(D){a.next(D)},error:function(D){d=!0,a.error(D)},complete:function(){g=!0,l=void 0,a.complete()}}),g&&(l=void 0)):A=a.subscribe(this),this.add(function(){u--,A.unsubscribe(),A=void 0,l&&!g&&s&&u===0&&(l.unsubscribe(),l=void 0,a=void 0)})}}function Rx(t){return function(e){return e.lift(new Ix(t,e))}}var Ix=function(){function t(e,r){this.predicate=e,this.source=r}return t.prototype.call=function(e,r){return r.subscribe(new Ax(e,this.predicate,this.source))},t}(),Ax=function(t){j(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 os)},e}(Q);function kx(t){return function(e){return e.lift(new Tx(t))}}var Tx=function(){function t(e){this.total=e}return t.prototype.call=function(e,r){return r.subscribe(new Nx(e,this.total))},t}(),Nx=function(t){j(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}(Q);function Ox(t){return function(e){return e.lift(new Lx(t))}}var Lx=function(){function t(e){if(this._skipCount=e,this._skipCount<0)throw new ri}return t.prototype.call=function(e,r){return this._skipCount===0?r.subscribe(new Q(e)):r.subscribe(new Px(e,this._skipCount))},t}(),Px=function(t){j(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++;
38if(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}(Q);function Dx(t){return function(e){return e.lift(new $x(t))}}var $x=function(){function t(e){this.notifier=e}return t.prototype.call=function(e,r){return r.subscribe(new Bx(e,this.notifier))},t}(),Bx=function(t){j(e,t);function e(r,n){var i=t.call(this,r)||this;i.hasValue=!1;var s=new Ye(i);i.add(s),i.innerSubscription=s;var o=Xe(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}(Ke);function jx(t){return function(e){return e.lift(new Fx(t))}}var Fx=function(){function t(e){this.predicate=e}return t.prototype.call=function(e,r){return r.subscribe(new Wx(e,this.predicate))},t}(),Wx=function(t){j(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}(Q);function Hx(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var r=t[t.length-1];return Rt(r)?(t.pop(),function(n){return Di(t,n,r)}):function(n){return Di(t,n)}}var Vx=function(t){j(e,t);function e(r,n,i){n===void 0&&(n=0),i===void 0&&(i=Rs);var s=t.call(this)||this;return s.source=r,s.delayTime=n,s.scheduler=i,(!ni(n)||n<0)&&(s.delayTime=0),(!i||typeof i.schedule!="function")&&(s.scheduler=Rs),s}return e.create=function(r,n,i){return n===void 0&&(n=0),i===void 0&&(i=Rs),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}(ae);function Ux(t,e){return e===void 0&&(e=0),function(n){return n.lift(new zx(t,e))}}var zx=function(){function t(e,r){this.scheduler=e,this.delay=r}return t.prototype.call=function(e,r){return new Vx(r,this.delay,this.scheduler).subscribe(e)},t}();function $i(t,e){return typeof e=="function"?function(r){return r.pipe($i(function(n,i){return br(t(n,i)).pipe(Bt(function(s,o){return e(n,s,i,o)}))}))}:function(r){return r.lift(new qx(t))}}var qx=function(){function t(e){this.project=e}return t.prototype.call=function(e,r){return r.subscribe(new Gx(e,this.project))},t}(),Gx=function(t){j(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 Ye(this),s=this.destination;s.add(i),this.innerSubscription=Xe(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}(Ke);function Jx(){return $i(Ir)}function Zx(t,e){return e?$i(function(){return t},e):$i(function(){return t})}function Qx(t){return function(e){return e.lift(new Yx(t))}}var Yx=function(){function t(e){this.notifier=e}return t.prototype.call=function(e,r){var n=new Kx(e),i=Xe(this.notifier,new Ye(n));return i&&!n.seenValue?(n.add(i),r.subscribe(n)):n},t}(),Kx=function(t){j(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}(Ke);function Xx(t,e){return e===void 0&&(e=!1),function(r){return r.lift(new eM(t,e))}}var eM=function(){function t(e,r){this.predicate=e,this.inclusive=r}return t.prototype.call=function(e,r){return r.subscribe(new tM(e,this.predicate,this.inclusive))},t}(),tM=function(t){j(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}(Q);function rM(t,e,r){return function(i){return i.lift(new nM(t,e,r))}}var nM=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 iM(e,this.nextOrObserver,this.error,this.complete))},t}(),iM=function(t){j(e,t);function e(r,n,i,s){var o=t.call(this,r)||this;return o._tapNext=er,o._tapError=er,o._tapComplete=er,o._tapError=i||er,o._tapComplete=s||er,ei(n)?(o._context=o,o._tapNext=n):n&&(o._context=n,o._tapNext=n.next||er,o._tapError=n.error||er,o._tapComplete=n.complete||er),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}(Q),yp={leading:!0,trailing:!1};function sM(t,e){return e===void 0&&(e=yp),function(r){return r.lift(new oM(t,!!e.leading,!!e.trailing))}}var oM=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 aM(e,this.durationSelector,this.leading,this.trailing))},t}(),aM=function(t){j(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=Xe(n,new Ye(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}(Ke);function cM(t,e,r){return e===void 0&&(e=wt),r===void 0&&(r=yp),function(n){return n.lift(new uM(t,e,r.leading,r.trailing))}}var uM=function(){function t(e,r,n,i){this.duration=e,this.scheduler
38=r,this.leading=n,this.trailing=i}return t.prototype.call=function(e,r){return r.subscribe(new lM(e,this.duration,this.scheduler,this.leading,this.trailing))},t}(),lM=function(t){j(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(fM,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}(Q);function fM(t){var e=t.subscriber;e.clearThrottle()}function hM(t){return t===void 0&&(t=wt),function(e){return au(function(){return e.pipe(js(function(r,n){var i=r.current;return{value:n,current:t.now(),last:i}},{current:t.now(),value:void 0,last:void 0}),Bt(function(r){var n=r.current,i=r.last,s=r.value;return new dM(s,n-i)}))})}}var dM=function(){function t(e,r){this.value=e,this.interval=r}return t}();function mp(t,e,r){return r===void 0&&(r=wt),function(n){var i=pp(t),s=i?+t-r.now():Math.abs(t);return n.lift(new pM(s,i,e,r))}}var pM=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 gM(e,this.absoluteTimeout,this.waitFor,this.withObservable,this.scheduler))},t}(),gM=function(t){j(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(Xe(n,new Ye(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}(Ke);function bM(t,e){return e===void 0&&(e=wt),mp(t,nu(new $d),e)}function vM(t){return t===void 0&&(t=wt),Bt(function(e){return new yM(e,t.now())})}var yM=function(){function t(e,r){this.value=e,this.timestamp=r}return t}();function mM(t,e,r){return r===0?[e]:(t.push(e),t)}function wM(){return Bo(mM,[])}function _M(t){return function(r){return r.lift(new SM(t))}}var SM=function(){function t(e){this.windowBoundaries=e}return t.prototype.call=function(e,r){var n=new EM(e),i=r.subscribe(n);return i.closed||n.add(Xe(this.windowBoundaries,new Ye(n))),i},t}(),EM=function(t){j(e,t);function e(r){var n=t.call(this,r)||this;return n.window=new ut,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 ut;n.next(i)},e}(Ke);function xM(t,e){return e===void 0&&(e=0),function(n){return n.lift(new MM(t,e))}}var MM=function(){function t(e,r){this.windowSize=e,this.startWindowEvery=r}return t.prototype.call=function(e,r){return r.subscribe(new CM(e,this.windowSize,this.startWindowEvery))},t}(),CM=function(t){j(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 ut],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,u=0;u<a&&!this.closed;u++)o[u].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 d=new ut;o.push(d),i.next(d)}},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}(Q);function RM(t){var e=wt,r=null,n=Number.POSITIVE_INFINITY;return Rt(arguments[3])&&(e=arguments[3]),Rt(arguments[2])?e=arguments[2]:ni(arguments[2])&&(n=Number(arguments[2])),Rt(arguments[1])?e=arguments[1]:ni(arguments[1])&&(r=Number(arguments[1])),function(s){return s.lift(new IM(t,r,n,e))}}var IM=function(){function t(e,r,n,i){this.windowTimeSpan=e,this.windowCreationInterval=r,this.maxWindowSize=n,this.scheduler
38=i}return t.prototype.call=function(e,r){return r.subscribe(new kM(e,this.windowTimeSpan,this.windowCreationInterval,this.maxWindowSize,this.scheduler))},t}(),AM=function(t){j(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}(ut),kM=function(t){j(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 u=a.openWindow();if(i!==null&&i>=0){var l={subscriber:a,window:u,context:null},d={windowTimeSpan:n,windowCreationInterval:i,subscriber:a,scheduler:o};a.add(o.schedule(wp,n,l)),a.add(o.schedule(NM,i,d))}else{var g={subscriber:a,window:u,windowTimeSpan:n};a.add(o.schedule(TM,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 AM;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}(Q);function TM(t){var e=t.subscriber,r=t.windowTimeSpan,n=t.window;n&&e.closeWindow(n),t.window=e.openWindow(),this.schedule(t,r)}function NM(t){var e=t.windowTimeSpan,r=t.subscriber,n=t.scheduler,i=t.windowCreationInterval,s=r.openWindow(),o=this,a={action:o,subscription:null},u={subscriber:r,window:s,context:a};a.subscription=n.schedule(wp,e,u),o.add(a.subscription),o.schedule(t,i)}function wp(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 OM(t,e){return function(r){return r.lift(new LM(t,e))}}var LM=function(){function t(e,r){this.openings=e,this.closingSelector=r}return t.prototype.call=function(e,r){return r.subscribe(new PM(e,this.openings,this.closingSelector))},t}(),PM=function(t){j(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=gr(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 u=this.closingSelector;a=u(n)}catch(C){return this.error(C)}var l=new ut,d=new Qe,g={window:l,subscription:d};this.contexts.push(g);var y=gr(this,a,g);y.closed?this.closeWindow(this.contexts.length-1):(y.context=g,d.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}(yn);function DM(t){return function(r){return r.lift(new $M(t))}}var $M=function(){function t(e){this.closingSelector=e}return t.prototype.call=function(e,r){return r.subscribe(new BM(e,this.closingSelector))},t}(),BM=function(t){j(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 ut;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=gr(this,s))},e}(yn);function jM(){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 FM(i,n))}}var FM=function(){function t(e,r){this.observables=e,this.project=r}return t.prototype.call=function(e,r){return r.subscribe(new WM(e,this.observables,this.project))},t}(),WM=function(t){j(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 u=n[a];s.add(gr(s,u,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}(yn);function HM(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return function(n){return n.lift.call(Kd.apply(void 0,[n].concat(t)))}}
38function VM(t){return function(e){return e.lift(new Xd(t))}}const UM=Object.freeze(Object.defineProperty({__proto__:null,audit:fp,auditTime:U3,buffer:z3,bufferCount:J3,bufferTime:K3,bufferToggle:n4,bufferWhen:o4,catchError:u4,combineAll:h4,combineLatest:d4,concat:p4,concatAll:Vd,concatMap:dp,concatMapTo:g4,count:b4,debounce:m4,debounceTime:S4,defaultIfEmpty:cs,delay:I4,delayWhen:N4,dematerialize:D4,distinct:j4,distinctUntilChanged:gp,distinctUntilKeyChanged:U4,elementAt:Q4,endWith:Y4,every:K4,exhaust:t5,exhaustMap:bp,expand:o5,filter:kr,finalize:u5,find:h5,findIndex:p5,first:g5,flatMap:EE,groupBy:TS,ignoreElements:b5,isEmpty:m5,last:x5,map:Bt,mapTo:M5,materialize:I5,max:O5,merge:L5,mergeAll:ou,mergeMap:un,mergeMapTo:P5,mergeScan:D5,min:j5,multicast:ln,observeOn:WS,onErrorResumeNext:W5,pairwise:U5,partition:G5,pluck:J5,publish:Q5,publishBehavior:Y5,publishLast:K5,publishReplay:X5,race:ex,reduce:Bo,refCount:tu,repeat:tx,repeatWhen:nx,retry:ox,retryWhen:ux,sample:hx,sampleTime:gx,scan:js,sequenceEqual:mx,share:xx,shareReplay:Mx,single:Rx,skip:kx,skipLast:Ox,skipUntil:Dx,skipWhile:jx,startWith:Hx,subscribeOn:Ux,switchAll:Jx,switchMap:$i,switchMapTo:Zx,take:yu,takeLast:Bs,takeUntil:Qx,takeWhile:Xx,tap:rM,throttle:sM,throttleTime:cM,throwIfEmpty:$o,timeInterval:hM,timeout:bM,timeoutWith:mp,timestamp:vM,toArray:wM,window:_M,windowCount:xM,windowTime:RM,windowToggle:OM,windowWhen:DM,withLatestFrom:jM,zip:HM,zipAll:VM},Symbol.toStringTag,{value:"Module"})),mu=fn(UM);var jo={},Ot={};Object.defineProperty(Ot,"__esModule",{value:!0});Ot.ClientMessagePublishEvent=Ot.ClientMessageSetSessionConfig=Ot.ClientMessageGetSessionConfig=Ot.ClientMessageIsLinked=Ot.ClientMessageHostSession=void 0;function zM(t){return Object.assign({type:"HostSession"},t)}Ot.ClientMessageHostSession=zM;function qM(t){return Object.assign({type:"IsLinked"},t)}Ot.ClientMessageIsLinked=qM;function GM(t){return Object.assign({type:"GetSessionConfig"},t)}Ot.ClientMessageGetSessionConfig=GM;function JM(t){return Object.assign({type:"SetSessionConfig"},t)}Ot.ClientMessageSetSessionConfig=JM;function ZM(t){return Object.assign({type:"PublishEvent"},t)}Ot.ClientMessagePublishEvent=ZM;var _p={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.RxWebSocket=t.ConnectionState=void 0;const e=So,r=mu;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=ne
38w 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(u){o.error(u);return}this.connectionStateSubject.next(n.CONNECTING),a.onclose=u=>{this.clearWebSocket(),o.error(new Error(`websocket error ${u.code}: ${u.reason}`)),this.connectionStateSubject.next(n.DISCONNECTED)},a.onopen=u=>{o.next(),o.complete(),this.connectionStateSubject.next(n.CONNECTED)},a.onmessage=u=>{this.incomingDataSubject.next(u.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})(_p);var Fo={};Object.defineProperty(Fo,"__esModule",{value:!0});Fo.isServerMessageFail=void 0;function QM(t){return t&&t.type==="Fail"&&typeof t.id=="number"&&typeof t.sessionId=="string"&&typeof t.error=="string"}Fo.isServerMessageFail=QM;Object.defineProperty(jo,"__esModule",{value:!0});jo.WalletSDKConnection=void 0;const Ft=So,le=mu,Si=ai,Ln=zi,Ei=Ot,xi=oi,Ss=_p,ja=Fo,kf=1e4,YM=6e4;class KM{constructor(e,r,n,i,s=WebSocket){this.sessionId=e,this.sessionKey=r,this.diagnostic=i,this.subscriptions=new Ft.Subscription,this.destroyed=!1,this.lastHeartbeatResponse=0,this.nextReqId=(0,Ln.IntNumber)(1),this.connectedSubject=ne
38w Ft.BehaviorSubject(!1),this.linkedSubject=new Ft.BehaviorSubject(!1),this.sessionConfigSubject=new Ft.ReplaySubject(1);const o=new Ss.RxWebSocket(n+"/rpc",s);this.ws=o,this.subscriptions.add(o.connectionState$.pipe((0,le.tap)(a=>{var u;return(u=this.diagnostic)===null||u===void 0?void 0:u.log(xi.EVENTS.CONNECTED_STATE_CHANGE,{state:a,sessionIdHash:Si.Session.hash(e)})}),(0,le.skip)(1),(0,le.filter)(a=>a===Ss.ConnectionState.DISCONNECTED&&!this.destroyed),(0,le.delay)(5e3),(0,le.filter)(a=>!this.destroyed),(0,le.flatMap)(a=>o.connect()),(0,le.retry)()).subscribe()),this.subscriptions.add(o.connectionState$.pipe((0,le.skip)(2),(0,le.switchMap)(a=>(0,Ft.iif)(()=>a===Ss.ConnectionState.CONNECTED,this.authenticate().pipe((0,le.tap)(u=>this.sendIsLinked()),(0,le.tap)(u=>this.sendGetSessionConfig()),(0,le.map)(u=>!0)),(0,Ft.of)(!1))),(0,le.distinctUntilChanged)(),(0,le.catchError)(a=>(0,Ft.of)(!1))).subscribe(a=>this.connectedSubject.next(a))),this.subscriptions.add(o.connectionState$.pipe((0,le.skip)(1),(0,le.switchMap)(a=>(0,Ft.iif)(()=>a===Ss.ConnectionState.CONNECTED,(0,Ft.timer)(0,kf)))).subscribe(a=>a===0?this.updateLastHeartbeat():this.heartbeat())),this.subscriptions.add(o.incomingData$.pipe((0,le.filter)(a=>a==="h")).subscribe(a=>this.updateLastHeartbeat())),this.subscriptions.add(o.incomingJSONData$.pipe((0,le.filter)(a=>["IsLinkedOK","Linked"].includes(a.type))).subscribe(a=>{var u;const l=a;(u=this.diagnostic)===null||u===void 0||u.log(xi.EVENTS.LINKED,{sessionIdHash:Si.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,le.filter)(a=>["GetSessionConfigOK","SessionConfigUpdated"].includes(a.type))).subscribe(a=>{var u;const l=a;(u=this.diagnostic)===null||u===void 0||u.log(xi.EVENTS.SESSION_CONFIG_RECEIVED,{sessionIdHash:Si.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(xi.EVENTS.STARTED_CONNECTING,{sessionIdHash:Si.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(xi.EVENTS.DISCONNECTED,{sessionIdHash:Si.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,le.filter)(e=>e),(0,le.take)(1),(0,le.map)(()=>{}))}get linked$(){return this.linkedSubject.asObservable()}get onceLinked$(){return this.linked$.pipe((0,le.filter)(e=>e),(0,le.take)(1),(0,le.map)(()=>{}))}get sessionConfig$(){return this.sessionConfigSubject.asObservable()}get incomingEvent$(){return this.ws.incomingJSONData$.pipe((0,le.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,le.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,le.flatMap)(i=>this.makeRequest(n)),(0,le.map)(i=>{if((0,ja.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,le.flatMap)(s=>this.makeRequest(i)),(0,le.map)(s=>{if((0,ja.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>kf*2){this.ws.disconnect();return}try{this.ws.sendData("h")}catch{}}
38makeRequest(e,r=YM){const n=e.id;try{this.sendData(e)}catch(i){return(0,Ft.throwError)(i)}return this.ws.incomingJSONData$.pipe((0,le.timeoutWith)(r,(0,Ft.throwError)(new Error(`request ${n} timed out`))),(0,le.filter)(i=>i.id===n),(0,le.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,le.map)(r=>{if((0,ja.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)}}jo.WalletSDKConnection=KM;var ii={};Object.defineProperty(ii,"__esModule",{value:!0});ii.decrypt=ii.encrypt=void 0;const Fs=Z;async function XM(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),u=s.slice(0,s.byteLength-o),l=new Uint8Array(a),d=new Uint8Array(u),g=new Uint8Array([...r,...l,...d]);return(0,Fs.uint8ArrayToHex)(g)}ii.encrypt=XM;function eC(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),u=s.slice(28),l=new Uint8Array([...u,...a]),d={name:"AES-GCM",iv:new Uint8Array(o)};try{const g=await window.crypto.subtle.decrypt(d,i,l),y=new TextDecoder;r(y.decode(g))}catch(g){n(g)}})()})}ii.decrypt=eC;var Wo={},Ho={};(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={}))})(Ho);Object.defineProperty(Wo,"__esModule",{value:!0});Wo.Web3RequestCanceledMessage=void 0;const tC=Ho;function rC(t){return{type:tC.RelayMessageType.WEB3_REQUEST_CANCELED,id:t}}Wo.Web3RequestCanceledMessage=rC;var Vo={};Object.defineProperty(Vo,"__esModule",{value:!0});Vo.Web3RequestMessage=void 0;const nC=Ho;function iC(t){return Object.assign({type:nC.RelayMessageType.WEB3_REQUEST},t)}Vo.Web3RequestMessage=iC;var si={};Object.defineProperty(si,"__esModule",{value:!0});si.isWeb3ResponseMessage=si.Web3ResponseMessage=void 0;const Sp=Ho;function sC(t){return Object.assign({type:Sp.RelayMessageType.WEB3_RESPONSE},t)}si.Web3ResponseMessage=sC;function oC(t){return t&&t.type===Sp.RelayMessageType.WEB3_RESPONSE}si.isWeb3ResponseMessage=oC;var aC=J&&J.__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]}),cC=J&&J.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),Ep=J&&J.__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},uC=J&&J.__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)&&aC(e,t,r);return cC(e,t),e},lC=J&&J.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Po,"__esModule",{value:!0});Po.WalletSDKRelay=void 0;const xp=lC(Do),Zr=So,rt=mu,pt=oi,fC=jo,Pn=Bi,hC=zi,Ge=Z,mr=uC(ii),wr=ai,Es=Ut,lt=Gs,dC=Wo,pC=Vo,Tt=_e,St=si;
38class Vt extends Es.WalletSDKRelayAbstract{constructor(e){var r;super(),this.accountsCallback=null,this.chainCallback=null,this.dappDefaultChainSubject=new Zr.BehaviorSubject(1),this.dappDefaultChain=1,this.appName="",this.appLogoUrl=null,this.subscriptions=new Zr.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=wr.Session.load(this.storage)||new wr.Session(this.storage).save(),r=new fC.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(pt.EVENTS.GENERAL_ERROR,{message:"error while invoking session config callback"})}})),this.subscriptions.add(r.incomingEvent$.pipe((0,rt.filter)(i=>i.event==="Web3Response")).subscribe({next:this.handleIncomingEvent})),this.subscriptions.add(r.linked$.pipe((0,rt.skip)(1),(0,rt.tap)(i=>{var s;this.isLinked=i;const o=this.storage.getItem(Es.LOCAL_STORAGE_ADDRESSES_KEY);if(i&&(this.session.linked=i),this.isUnlinkedErrorState=!1,o){const a=o.split(" "),u=this.storage.getItem("IsStandaloneSigning")==="true";if(a[0]!==""&&!i&&this.session.linked&&!u){this.isUnlinkedErrorState=!0;const l=this.getSessionIdHash();(s=this.diagnostic)===null||s===void 0||s.log(pt.EVENTS.UNLINKED_ERROR_STATE,{sessionIdHash:l})}}})).subscribe()),this.subscriptions.add(r.sessionConfig$.pipe((0,rt.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(pt.EVENTS.METADATA_DESTROYED,{alreadyDestroyed:s,sessionIdHash:this.getSessionIdHash()}),this.resetAndReload()})),this.subscriptions.add(r.sessionConfig$.pipe((0,rt.filter)(i=>i.metadata&&i.metadata.WalletUsername!==void 0)).pipe((0,rt.mergeMap)(i=>mr.decrypt(i.metadata.WalletUsername,e.secret))).subscribe({next:i=>{this.storage.setItem(Es.WALLET_USER_NAME_KEY,i)},error:()=>{var i;(i=this.diagnostic)===null||i===void 0||i.log(pt.EVENTS.GENERAL_ERROR,{message:"Had error decrypting",value:"username"})}})),this.subscriptions.add(r.sessionConfig$.pipe((0,rt.filter)(i=>i.metadata&&i.metadata.AppVersion!==void 0)).pipe((0,rt.mergeMap)(i=>mr.decrypt(i.metadata.AppVersion,e.secret))).subscribe({next:i=>{this.storage.setItem(Es.APP_VERSION_KEY,i)},error:()=>{var i;(i=this.diagnostic)===null||i===void 0||i.log(pt.EVENTS.GENERAL_ERROR,{message:"Had error decrypting",value:"appversion"})}})),this.subscriptions.add(r.sessionConfig$.pipe((0,rt.filter)(i=>i.metadata&&i.metadata.ChainId!==void 0&&i.metadata.JsonRpcUrl!==void 0)).pipe((0,rt.mergeMap)(i=>(0,Zr.zip)(mr.decrypt(i.metadata.ChainId,e.secret),mr.decrypt(i.metadata.JsonRpcUrl,e.secret)))).pipe((0,rt.distinctUntilChanged)()).subscribe({next:([i,s])=>{this.chainCallback&&this.chainCallback(i,s)},error:()=>{var i;(i=this.diagnostic)===null||i===void 0||i.log(pt.EVENTS.GENERAL_ERROR,{message:"Had error decrypting",value:"chainId|jsonRpcUrl"})}})),this.subscriptions.add(r.sessionConfig$.pipe((0,rt.filter)(i=>i.metadata&&i.metadata.EthereumAddress!==void 0)).pipe((0,rt.mergeMap)(i=>mr.decrypt(i.metadata.EthereumAddress,e.secret))).subscribe({next:i=>{this.accountsCallback&&this.accountsCallback([i]),Vt.accountRequestCallbackIds.size>0&&(Array.from(Vt.accountRequestCallbackIds.values()).forEach(s=>{const o=(0,St.Web3ResponseMessage)({id:s,response:(0,Tt.RequestEthereumAccountsResponse)([i])});this.invokeCallback(Object.assign(Object.assign({},o),{id:s}))}),Vt.accountRequestCallbackIds.clear())},error:()=>{var i;(i=this.diagnostic)===null||i===void 0||i.log(pt.EVENTS.GENERAL_ER
38ROR,{message:"Had error decrypting",value:"selectedAddress"})}})),this.subscriptions.add(r.sessionConfig$.pipe((0,rt.filter)(i=>i.metadata&&i.metadata.AppSrc!==void 0)).pipe((0,rt.mergeMap)(i=>mr.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(pt.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,rt.timeout)(1e3),(0,rt.catchError)(e=>(0,Zr.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(pt.EVENTS.GENERAL_ERROR,{message:"Had error unsubscribing"})}(n=this.diagnostic)===null||n===void 0||n.log(pt.EVENTS.SESSION_STATE_CHANGE,{method:"relay::resetAndReload",sessionMetadataChange:"__destroyed, 1",sessionIdHash:this.getSessionIdHash()}),this.connection.destroy();const o=wr.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(pt.EVENTS.SKIPPED_CLEARING_SESSION,{sessionIdHash:this.getSessionIdHash(),storedSessionIdHash:wr.Session.hash(o.id)})),this._reloadOnDisconnect){this.ui.reloadUI();return}this.accountsCallback&&this.accountsCallback([],!0),this.subscriptions=new Zr.Subscription;const{session:a,ui:u,connection:l}=this.subscribe();this._session=a,this.connection=l,this.ui=u,s&&this.ui.setStandalone&&this.ui.setStandalone(!0),this.attachUI()},e=>{var r;(r=this.diagnostic)===null||r===void 0||r.log(pt.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:lt.Web3Method.signEthereumMessage,params:{message:(0,Ge.hexStringFromBuffer)(e,!0),address:r,addPrefix:n,typedDataJson:i||null}})}ethereumAddressFromSignedMessage(e,r,n){return this.sendRequest({method:lt.Web3Method.ethereumAddressFromSignedMessage,params:{message:(0,Ge.hexStringFromBuffer)(e,!0),signature:(0,Ge.hexStringFromBuffer)(r,!0),addPrefix:n}})}signEthereumTransaction(e){return this.sendRequest({method:lt.Web3Method.signEthereumTransaction,params:{fromAddress:e.fromAddress,toAddress:e.toAddress,weiValue:(0,Ge.bigIntStringFromBN)(e.weiValue),data:(0,Ge.hexStringFromBuffer)(e.data,!0),nonce:e.nonce,gasPriceInWei:e.gasPriceInWei?(0,Ge.bigIntStringFromBN)(e.gasPriceInWei):null,maxFeePerGas:e.gasPriceInWei?(0,Ge.bigIntStringFromBN)(e.gasPriceInWei):null,maxPriorityFeePerGas:e.gasPriceInWei?(0,Ge.bigIntStringFromBN)(e.gasPriceInWei):null,gasLimit:e.gasLimit?(0,Ge.bigIntStringFromBN)(e.gasLimit):null,chainId:e.chainId,shouldSubmit:!1}})}signAndSubmitEthereumTransaction(e){return this.sendRequest({method:lt.Web3Method.signEthereumTransaction,params:{fromAddress:e.fromAddress,toAddress:e.toAddress,weiValue:(0,Ge.bigIntStringFromBN)(e.weiValue),data:(0,Ge.hexStringFromBuffer)(e.data,!0),nonce:e.nonce,gasPriceInWei:e.gasPriceInWei?(0,Ge.bigIntStringFromBN)(e.gasPriceInWei):null,maxFeePerGas:e.maxFeePerGas?(0,Ge.bigIntStringFromBN)(e.maxFeePerGas):null,maxPriorityFeePerGas:e.maxPriorityFeePerGas?(0,Ge.bigIntStringFromBN)(e.maxPriorityFeePerGas):null,gasLimit:e.gasLimit?(0,Ge.bigIntStringFromBN)(e.gasLimit):null,chainId:e.chainId,shouldSubmit:!0}})}submitEthereumTransaction(e,r){return this.sendRequest({method:lt.Web3Method.submitEthereumTransaction,params:{signedTransaction:(0,Ge.hexStringFromBuffer)(e,!0),chainId:r}})}scanQRCode(e){return this.sendRequest({method:lt.Web3Method.scanQRCode,params:{regExp:e}})}getQRCodeUrl(){return(0,Ge.createQrUrl)(this._session.id,this._session.secret,this.linkAPIUrl,!1,this.options.version,this.dappDefaultChain)}genericRequest(e,r){return this.sendRequest({method:lt.Web3Method.generic,params:{action:r,data:e}})}sendGenericMessage(e){return this.sendRequest(e)}sendRequest(e){let r=null;const n=(0,Ge.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,u=>{if(r==null||r(),u.errorMessage)return a(new Error(u.errorMessage));o(u)}),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,pC.Web3RequestMessage)({id:e,request:r}),s=wr.Session.load(this.storage);(n=this.diagnostic)===null||n===void 0||n.log(pt.EVENTS.WEB3_REQUEST,{eventId:i.id,method:`relay::${i.request.method}`,sessionIdHash:this.getSessionIdHash(),storedSessionIdHash:s?wr.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(pt.EVENTS.WEB3_REQUEST_PUBLISHED,{eventId:i.id,method:`relay::${i.request.method}`,sessionIdHash:this.getSessionIdHash(),storedSessionIdHash:s?wr.Session.hash(s.id):"",isSessionMismatched:((s==null?void 0:s.id)!==this._session.id).toString()})},error:o=>{this.handleWeb3ResponseMessage((0,St.Web3ResponseMessage)({id:i.id,response:{method:i.request.method,errorMessage:o.message}}))}}))}publishWeb3RequestCanceledEvent(e){const r=(0,dC.Web3RequestCanceledMessage)(e);this.subscriptions.add(this.publishEvent("Web3RequestCanceled",r,!1).subscribe())}publishEvent(e,r,n){const i=this.session.secret;return new Zr.Observable(s=>{mr.encrypt(JSON.stringify(Object.assign(Object.assign({},r),{origin:location.origin})),i).then(o=>{s.next(o),s.complete()})}).pipe((0,rt.mergeMap)(s=>this.connection.publishEvent(e,s,n)))}handleIncomingEvent(e){try{this.subscriptions.add((0,Zr.from)(mr.decrypt(e.data,this.session.secret)).pipe((0,rt.map)(r=>JSON.parse(r))).subscribe({next:r=>{const n=(0,St.isWeb3ResponseMessage)(r)?r:null;n&&this.handleWeb3ResponseMessage(n)},error:()=>{var r;(r=this.diagnostic)===null||r===void 0||r.log(pt.EVENTS.GENERAL_ER
38ROR,{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(pt.EVENTS.WEB3_RESPONSE,{eventId:e.id,method:`relay::${n.method}`,sessionIdHash:this.getSessionIdHash()}),(0,Tt.isRequestEthereumAccountsResponse)(n)){Vt.accountRequestCallbackIds.forEach(i=>this.invokeCallback(Object.assign(Object.assign({},e),{id:i}))),Vt.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,Pn.standardErrorMessage)(i);this.handleWeb3ResponseMessage((0,St.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:lt.Web3Method.requestEthereumAccounts,params:{appName:this.appName,appLogoUrl:this.appLogoUrl||null}},r=(0,Ge.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 u=((a=window==null?void 0:window.navigator)===null||a===void 0?void 0:a.userAgent)||null;if(u&&/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(u)){let l;try{(0,Ge.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=d=>{this.handleWeb3ResponseMessage((0,St.Web3ResponseMessage)({id:r,response:(0,Tt.RequestEthereumAccountsResponse)(d)}))};this.ui.requestEthereumAccounts({onCancel:n,onAccounts:l})}else{const l=Pn.standardErrors.provider.userRejectedRequest("User denied account authorization");this.ui.requestEthereumAccounts({onCancel:()=>n(l)})}Vt.accountRequestCallbackIds.add(r),!this.ui.inlineAccountsResponse()&&!this.ui.isStandalone()&&this.publishWeb3RequestEvent(r,e)}),cancel:n}}selectProvider(e){const r={method:lt.Web3Method.selectProvider,params:{providerOptions:e}},n=(0,Ge.randomBytesHex)(8),i=o=>{this.publishWeb3RequestCanceledEvent(n),this.handleErrorResponse(n,r.method,o)},s=new Promise((o,a)=>{this.relayEventManager.callbacks.set(n,d=>{if(d.errorMessage)return a(new Error(d.errorMessage));o(d)});const u=d=>{this.handleWeb3ResponseMessage((0,St.Web3ResponseMessage)({id:n,response:(0,Tt.SelectProviderResponse)(hC.ProviderType.Unselected)}))},l=d=>{this.handleWeb3ResponseMessage((0,St.Web3ResponseMessage)({id:n,response:(0,Tt.SelectProviderResponse)(d)}))};this.ui.selectProvider&&this.ui.selectProvider({onApprove:l,onCancel:u,providerOptions:e})});return{cancel:i,promise:s}}watchAsset(e,r,n,i,s,o){const a={method:lt.Web3Method.watchAsset,params:{type:e,options:{address:r,symbol:n,decimals:i,image:s},chainId:o}};let u=null;const l=(0,Ge.randomBytesHex)(8),d=y=>{this.publishWeb3RequestCanceledEvent(l),this.handleErrorResponse(l,a.method,y),u==null||u()};this.ui.inlineWatchAsset()||(u=this.ui.showConnecting({isUnlinkedErrorState:this.isUnlinkedErrorState,onCancel:d,onResetConnection:this.resetAndReload}));const g=new Promise((y,C)=>{this.relayEventManager.callbacks.set(l,O=>{if(u==null||u(),O.errorMessage)return C(new Error(O.errorMessage));y(O)});const A=O=>{this.handleWeb3ResponseMessage((0,St.Web3ResponseMessage)({id:l,response:(0,Tt.WatchAssetReponse)(!1)}))},D=()=>{this.handleWeb3ResponseMessage((0,St.Web3ResponseMessage)({id:l,response:(0,Tt.WatchAssetReponse)(!0)}))};this.ui.inlineWatchAsset()&&this.ui.watchAsset({onApprove:D,onCancel:A,type:e,address:r,symbol:n,decimals:i,image:s,chainId:o}),!this.ui.inlineWatchAsset()&&!this.ui.isStandalone()&&this.publishWeb3RequestEvent(l,a)});return{cancel:d,promise:g}}addEthereumChain(e,r,n,i,s,o){const a={method:lt.Web3Method.addEthereumChain,params:{chainId:e,rpcUrls:r,blockExplorerUrls:i,chainName:s,iconUrls:n,nativeCurrency:o}};let u=null;const l=(0,Ge.randomBytesHex)(8),d=y=>{this.publishWeb3RequestCanceledEvent(l),this.handleErrorResponse(l,a.method,y),u==null||u()};return this.ui.inlineAddEthereumChain(e)||(u=this.ui.showConnecting({isUnlinkedErrorState:this.isUnlinkedErrorState,onCancel:d,onResetConnection:this.resetAndReload})),{promise:new Promise((y,C)=>{this.relayEventManager.callbacks.set(l,O=>{if(u==null||u(),O.errorMessage)return C(new Error(O.errorMessage));y(O)});const A=O=>{this.handleWeb3ResponseMessage((0,St.Web3ResponseMessage)({id:l,response:(0,Tt.AddEthereumChainResponse)({isApproved:!1,rpcUrl:""})}))},D=O=>{this.handleWeb3ResponseMessage((0,St.Web3ResponseMessage)({id:l,response:(0,Tt.AddEthereumChainResponse)({isApproved:!0,rpcUrl:O})}))};this.ui.inlineAddEthereumChain(e)&&this.ui.addEthereumChain({onCancel:A,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:d}}switchEthereumChain(e,r){const n={method:lt.Web3Method.switchEthereumChain,params:Object.assign({chainId:e},{address:r})},i=(0,Ge.randomBytesHex)(8),s=a=>{this.publishWeb3RequestCanceledEvent(i),this.handleErrorResponse(i,n.method,a)};return{promise:new Promise((a,u)=>{this.relayEventManager.callbacks.set(i,g=>{if((0,Tt.isErrorResponse)(g)&&g.errorCode)return u(Pn.standardErrors.provider.custom({code:g.errorCode,message:"Unrecognized chain ID. Try adding the chain using addEthereumChain first."}));if(g.errorMessage)return u(new Error(g.errorMessage));a(g)});const l=g=>{var y;if(g){const C=(y=(0,Pn.getErrorCode)(g))!==null&&y!==void 0?y:Pn.standardErrorCodes.provider.unsupportedChain;this.handleErrorResponse(i,lt.Web3Method.switchEthereumChain,g instanceof Error?g:Pn.standardErrors.provider.unsupportedChain(e),C)}else this.handleWeb3ResponseMessage((0,St.Web3ResponseMessage)({id:i,response:(0,Tt.SwitchEthereumChainResponse)({isApproved:!1,rpcUrl:""})}))},d=g=>{this.handleWeb3ResponseMessage((0,St.Web3ResponseMessage)({id:i,response:(0,Tt.SwitchEthereumChainResponse)({isApproved:!0,rpcUrl:g})}))};this.ui.switchEthereumChain({onCancel:l,onApprove:d,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 wr.Session.hash(this._session.id)}sendRequestStandalone(e,r){const n=s=>{this.handleErrorResponse(e,r.method,s)},i=s=>{this.handleWeb3ResponseMessage((0,St.Web3ResponseMessage)({id:e,response:s}))};switch(r.method){case lt.Web3Method.signEthereumMessage:this.ui.signEthereumMessage({request:r,onSuccess:i,onCancel:n});break;case lt.Web3Method.signEthereumTransaction:this.ui.signEthereumTransaction({request:r,onSuccess:i,onCancel:n});break;case lt.Web3Method.submitEthereumTransaction:this.ui.submitEthereumTransaction({request:r,onSuccess:i,onCancel:n});break;case lt.Web3Method.ethereumAddressFromSignedMessage:this.ui.ethereumAddressFromSignedMessage({request:r,onSuccess:i});break;default:n();break}}onSessionConfigChanged(e){}}Vt.accountRequestCallbackIds=new Set;Ep([xp.default],Vt.prototype,"resetAndReload",null);Ep([xp.default],Vt.prototype,"handleIncomingEvent",null);Po.WalletSDKRelay=Vt;var Uo={};Object.defineProperty(Uo,"__esModule",{value:!0});Uo.WalletSDKRelayEventManager=void 0;const gC=Z;class bC{constructor(){this._nextRequestId=0,this.callbacks=new Map}makeRequestId(){this._nextRequestId=(this._nextRequestId+1)%2147483647;const e=this._nextRequestId,r=(0,gC.prepend0x)(e.toString(16));return this.callbacks.get(r)&&this.callbacks.delete(r),e}}Uo.WalletSDKRelayEventManager=bC;const vC="@coinbase/wallet-sdk",yC="3.7.1",mC="Coinbase Wallet JavaScript SDK",wC=["cipher","cipherbrowser","coinbase","coinbasewallet","eth","ether","ethereum","etherium","injection","toshi","wallet","walletlink","web3"],_C="dist/index.js",SC="dist/index.d.ts",EC="https://github.com/coinbase/coinbase-wallet-sdk.git",xC="Coinbase, Inc.",MC="Apache-2.0",CC={"pretest:unit":"node compile-assets.js","test:unit":"jest","test:unit:coverage":"yarn test:unit && open coverage/lcov-report/index.html","test:karma":"yarn build-npm && karma start",prebuild:`rm -rf ./build && node -p "'export const LIB_VERSION = ' + JSON.stringify(require('./package.json').version) + ';'" > src/version.ts`,build:"node compile-assets.js && webpack --config webpack.config.js","build-npm":"tsc -p ./tsconfig.build.json","build:dev":"export LINK_API_URL='http://localhost:3000'; yarn build","build:dev:watch":"nodemon -e 'ts,tsx,js,json,css,scss,svg' --ignore 'src/**/*-css.ts' --ignore 'src/**/*-svg.ts' --watch src/ --exec 'yarn build:dev'","build:prod":`yarn prebuild && yarn build && yarn build-npm && cp ./package.json ../../README.md ./LICENSE build/npm && cp -a src/vendor-js build/npm/dist && sed -i.bak 's| "private": true,||g' build/npm/package.json && rm -f build/npm/package.json.bak`,"lint:types":"tsc --noEmit","lint:prettier":'prettier --check "{src,__tests__}/**/*.(js|ts|tsx)"',"lint:eslint":"eslint ./src --ext .ts,.tsx",lint:"yarn lint:eslint && yarn lint:types && yarn lint:prettier","fix:eslint":"yarn lint:eslint --fix","fix:prettier":"prettier . --write",release:"./scripts/release.sh"},RC={"@metamask/safe-event-emitter":"2.0.0","@solana/web3.js":"^1.70.1","bind-decorator":"^1.0.11","bn.js":"^5.1.1",buffer:"^6.0.3",clsx:"^1.1.0","eth-block-tracker":"6.1.0","eth-json-rpc-filters":"5.1.0","eth-rpc-errors":"4.0.2","json-rpc-engine":"6.1.0",keccak:"^3.0.1",preact:"^10.5.9",qs:"^6.10.3",rxjs:"^6.6.3","sha.js":"^2.4.11","stream-browserify":"^3.0.0",util:"^0.12.4"},IC={"@babel/core":"^7.17.9","@babel/plugin-proposal-decorators":"^7.17.9","@babel/plugin-transform-react-jsx":"^7.17.3","@babel/preset-env":"^7.16.11","@babel/preset-typescript":"^7.16.7","@peculiar/webcrypto":"^1.3.3","@testing-library/jest-dom":"^5.16.4","@testing-library/preact":"^2.0.1","@types/bn.js":"^4.11.6","@types/jest":"^27.4.1","@types/node":"^14.14.20","@types/qs":"^6.9.7","@types/sha.js":"^2.4.0","@typescript-eslint/eslint-plugin":"^5.7.0","@typescript-eslint/eslint-plugin-tslint":"^5.7.0","@typescript-eslint/parser":"^5.7.0","babel-jest":"^27.5.1",browserify:"17.0.0","copy-webpack-plugin":"^6.4.1","core-js":"^3.8.2",eslint:"^8.4.1","eslint-config-prettier":"^8.3.0","eslint-plugin-import":"^2.25.3","eslint-plugin-
38preact":"^0.1.0","eslint-plugin-prettier":"^4.0.0","eslint-plugin-simple-import-sort":"^7.0.0",jasmine:"3.8.0",jest:"^27.5.1","jest-chrome":"^0.7.2","jest-websocket-mock":"^2.3.0",karma:"^6.4.0","karma-browserify":"8.1.0","karma-chrome-launcher":"^3.1.0","karma-jasmine":"^4.0.1",nodemon:"^2.0.6",prettier:"^2.5.1","raw-loader":"^4.0.2","regenerator-runtime":"^0.13.7",sass:"^1.50.0",svgo:"^2.8.0","ts-jest":"^27.1.4","ts-loader":"^8.0.13","ts-node":"^10.7.0",tslib:"^2.0.3",typescript:"^4.1.3",watchify:"4.0.0",webpack:"^5.76.0","webpack-cli":"^4.9.2","whatwg-fetch":"^3.5.0"},AC={node:">= 10.0.0"},kC={name:vC,version:yC,description:mC,keywords:wC,main:_C,types:SC,repository:EC,author:xC,license:MC,scripts:CC,dependencies:RC,devDependencies:IC,engines:AC};Object.defineProperty(Ti,"__esModule",{value:!0});Ti.CoinbaseWalletSDK=void 0;const TC=Vs,NC=Us,OC=qn,LC=mo,PC=Po,DC=Uo,$C=Z,BC={}.LINK_API_URL||"https://www.walletlink.org",Mp={}.SDK_VERSION||kC.version||"unknown";class zo{constructor(e){var r,n,i;this._appName="",this._appLogoUrl=null,this._relay=null,this._relayEventManager=null;const s=e.linkAPIUrl||BC;let o;if(e.uiConstructor?o=e.uiConstructor:o=l=>new LC.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),u=`${a.protocol}//${a.host}`;this._storage=new NC.ScopedLocalStorage(`-walletlink:${u}`),this._storage.setItem("version",zo.VERSION),!(this.walletExtension||this.coinbaseBrowser)&&(this._relayEventManager=new DC.WalletSDKRelayEventManager,this._relay=new PC.WalletSDKRelay({linkAPIUrl:s,version:Mp,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 OC.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,$C.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,TC.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=zo;zo.VERSION=Mp;
38(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.CoinbaseWalletProvider=t.CoinbaseWalletSDK=void 0;const e=Ti,r=qn;var n=Ti;Object.defineProperty(t,"CoinbaseWalletSDK",{enumerable:!0,get:function(){return n.CoinbaseWalletSDK}});var i=qn;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)})(fc);const jC=Ip(fc),QC=Tp({__proto__:null,default:jC},[fc]);export{QC as i};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.