@dcl/auth-site 0.1.3-7452511526.commit-6149fe3 → 0.1.3-7453122590.commit-211e684

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,4 @@
1
- import{e as au,r as uu,c as te,s as Q0,B as ye,b as Te,g as si,_ as G,a as Us,d as Y0}from"./index-fdbaae53.js";function K0(t,e){for(var r=0;r<e.length;r++){const n=e[r];if(typeof n!="string"&&!Array.isArray(n)){for(const i in n)if(i!=="default"&&!(i in t)){const s=Object.getOwnPropertyDescriptor(n,i);s&&Object.defineProperty(t,i,s.get?s:{enumerable:!0,get:()=>n[i]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}var cu={},Ti={},Hs={};Object.defineProperty(Hs,"__esModule",{value:!0});Hs.walletLogo=void 0;const X0=(t,e)=>{let r;switch(t){case"standard":return r=e,`data:image/svg+xml,%3Csvg width='${e}' height='${r}' viewBox='0 0 1024 1024' fill='none' xmlns='http://www.w3.org/2000/svg'%3E %3Crect width='1024' height='1024' fill='%230052FF'/%3E %3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M152 512C152 710.823 313.177 872 512 872C710.823 872 872 710.823 872 512C872 313.177 710.823 152 512 152C313.177 152 152 313.177 152 512ZM420 396C406.745 396 396 406.745 396 420V604C396 617.255 406.745 628 420 628H604C617.255 628 628 617.255 628 604V420C628 406.745 617.255 396 604 396H420Z' fill='white'/%3E %3C/svg%3E `;case"circle":return r=e,`data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='${e}' height='${r}' viewBox='0 0 999.81 999.81'%3E%3Cdefs%3E%3Cstyle%3E.cls-1%7Bfill:%230052fe;%7D.cls-2%7Bfill:%23fefefe;%7D.cls-3%7Bfill:%230152fe;%7D%3C/style%3E%3C/defs%3E%3Cpath class='cls-1' d='M655-115.9h56c.83,1.59,2.36.88,3.56,1a478,478,0,0,1,75.06,10.42C891.4-81.76,978.33-32.58,1049.19,44q116.7,126,131.94,297.61c.38,4.14-.34,8.53,1.78,12.45v59c-1.58.84-.91,2.35-1,3.56a482.05,482.05,0,0,1-10.38,74.05c-24,106.72-76.64,196.76-158.83,268.93s-178.18,112.82-287.2,122.6c-4.83.43-9.86-.25-14.51,1.77H654c-1-1.68-2.69-.91-4.06-1a496.89,496.89,0,0,1-105.9-18.59c-93.54-27.42-172.78-77.59-236.91-150.94Q199.34,590.1,184.87,426.58c-.47-5.19.25-10.56-1.77-15.59V355c1.68-1,.91-2.7,1-4.06a498.12,498.12,0,0,1,18.58-105.9c26-88.75,72.64-164.9,140.6-227.57q126-116.27,297.21-131.61C645.32-114.57,650.35-113.88,655-115.9Zm377.92,500c0-192.44-156.31-349.49-347.56-350.15-194.13-.68-350.94,155.13-352.29,347.42-1.37,194.55,155.51,352.1,348.56,352.47C876.15,734.23,1032.93,577.84,1032.93,384.11Z' transform='translate(-183.1 115.9)'/%3E%3Cpath class='cls-2' d='M1032.93,384.11c0,193.73-156.78,350.12-351.29,349.74-193-.37-349.93-157.92-348.56-352.47C334.43,189.09,491.24,33.28,685.37,34,876.62,34.62,1032.94,191.67,1032.93,384.11ZM683,496.81q43.74,0,87.48,0c15.55,0,25.32-9.72,25.33-25.21q0-87.48,0-175c0-15.83-9.68-25.46-25.59-25.46H595.77c-15.88,0-25.57,9.64-25.58,25.46q0,87.23,0,174.45c0,16.18,9.59,25.7,25.84,25.71Z' transform='translate(-183.1 115.9)'/%3E%3Cpath class='cls-3' d='M683,496.81H596c-16.25,0-25.84-9.53-25.84-25.71q0-87.23,0-174.45c0-15.82,9.7-25.46,25.58-25.46H770.22c15.91,0,25.59,9.63,25.59,25.46q0,87.47,0,175c0,15.49-9.78,25.2-25.33,25.21Q726.74,496.84,683,496.81Z' transform='translate(-183.1 115.9)'/%3E%3C/svg%3E`;case"text":return r=(.1*e).toFixed(2),`data:image/svg+xml,%3Csvg width='${e}' height='${r}' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 528.15 53.64'%3E%3Cdefs%3E%3Cstyle%3E.cls-1%7Bfill:%230052ff;%7D%3C/style%3E%3C/defs%3E%3Ctitle%3ECoinbase_Wordmark_SubBrands_ALL%3C/title%3E%3Cpath class='cls-1' d='M164.45,15a15,15,0,0,0-11.74,5.4V0h-8.64V52.92h8.5V48a15,15,0,0,0,11.88,5.62c10.37,0,18.21-8.21,18.21-19.3S174.67,15,164.45,15Zm-1.3,30.67c-6.19,0-10.73-4.83-10.73-11.31S157,23,163.22,23s10.66,4.82,10.66,11.37S169.34,45.65,163.15,45.65Zm83.31-14.91-6.34-.93c-3-.43-5.18-1.44-5.18-3.82,0-2.59,2.8-3.89,6.62-3.89,4.18,0,6.84,1.8,7.42,4.76h8.35c-.94-7.49-6.7-11.88-15.55-11.88-9.15,0-15.2,4.68-15.2,11.3,0,6.34,4,10,12,11.16l6.33.94c3.1.43,4.83,1.65,4.83,4,0,2.95-3,4.17-7.2,4.17-5.12,0-8-2.09-8.43-5.25h-8.49c.79,7.27,6.48,12.38,16.84,12.38,9.44,0,15.7-4.32,15.7-11.74C258.12,35.28,253.58,31.82,246.46,30.74Zm-27.65-2.3c0-8.06-4.9-13.46-15.27-13.46-9.79,0-15.26,5-16.34,12.6h8.57c.43-3,2.73-5.4,7.63-5.4,4.39,0,6.55,1.94,6.55,4.32,0,3.09-4,3.88-8.85,4.39-6.63.72-14.84,3-14.84,11.66,0,6.7,5,11,12.89,11,6.19,0,10.08-2.59,12-6.7.28,3.67,3,6.05,6.84,6.05h5v-7.7h-4.25Zm-8.5,9.36c0,5-4.32,8.64-9.57,8.64-3.24,0-6-1.37-6-4.25,0-3.67,4.39-4.68,8.42-5.11s6-1.22,7.13-2.88ZM281.09,15c-11.09,0-19.23,8.35-19.23,19.36,0,11.6,8.72,19.3,19.37,19.3,9,0,16.06-5.33,17.86-12.89h-9c-1.3,3.31-4.47,5.19-8.71,5.19-5.55,0-9.72-3.46-10.66-9.51H299.3V33.12C299.3,22.46,291.53,15,281.09,15Zm-9.87,15.26c1.37-5.18,5.26-7.7,9.72-7.7,4.9,0,8.64,2.8,9.51,7.7ZM19.3,23a9.84,9.84,0,0,1,9.5,7h9.14c-1.65-8.93-9-15-18.57-15A19,19,0,0,0,0,34.34c0,11.09,8.28,19.3,19.37,19.3,9.36,0,16.85-6,18.5-15H28.8a9.75,9.75,0,0,1-9.43,7.06c-6.27,0-10.66-4.83-10.66-11.31S13,23,19.3,23Zm41.11-8A19,19,0,0,0,41,34.34c0,11.09,8.28,19.3,19.37,19.3A19,19,0,0,0,79.92,34.27C79.92,23.33,71.64,15,60.41,15Zm.07,30.67c-6.19,0-10.73-4.83-10.73-11.31S54.22,23,60.41,23s10.8,4.89,10.8,11.37S66.67,45.65,60.48,45.65ZM123.41,15c-5.62,0-9.29,2.3-11.45,5.54V15.7h-8.57V52.92H112V32.69C112,27,115.63,23,121,23c5,0,8.06,3.53,8.06,8.64V52.92h8.64V31C137.66,21.6,132.84,15,123.41,15ZM92,.36a5.36,5.36,0,0,0-5.55,5.47,5.55,5.55,0,0,0,11.09,0A5.35,5.35,0,0,0,92,.36Zm-9.72,23h5.4V52.92h8.64V15.7h-14Zm298.17-7.7L366.2,52.92H372L375.29,44H392l3.33,8.88h6L386.87,15.7ZM377,39.23l6.45-17.56h.1l6.56,17.56ZM362.66,15.7l-7.88,29h-.11l-8.14-29H341l-8,28.93h-.1l-8-28.87H319L329.82,53h5.45l8.19-29.24h.11L352,53h5.66L368.1,15.7Zm135.25,0v4.86h12.32V52.92h5.6V20.56h12.32V15.7ZM467.82,52.92h25.54V48.06H473.43v-12h18.35V31.35H473.43V20.56h19.93V15.7H467.82ZM443,15.7h-5.6V52.92h24.32V48.06H443Zm-30.45,0h-5.61V52.92h24.32V48.06H412.52Z'/%3E%3C/svg%3E`;case"textWithLogo":return r=(.25*e).toFixed(2),`data:image/svg+xml,%3Csvg width='${e}' height='${r}' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 308.44 77.61'%3E%3Cdefs%3E%3Cstyle%3E.cls-1%7Bfill:%230052ff;%7D%3C/style%3E%3C/defs%3E%3Cpath class='cls-1' d='M142.94,20.2l-7.88,29H135l-8.15-29h-5.55l-8,28.93h-.11l-8-28.87H99.27l10.84,37.27h5.44l8.2-29.24h.1l8.41,29.24h5.66L148.39,20.2Zm17.82,0L146.48,57.42h5.82l3.28-8.88h16.65l3.34,8.88h6L167.16,20.2Zm-3.44,23.52,6.45-17.55h.11l6.56,17.55ZM278.2,20.2v4.86h12.32V57.42h5.6V25.06h12.32V20.2ZM248.11,57.42h25.54V52.55H253.71V40.61h18.35V35.85H253.71V25.06h19.94V20.2H248.11ZM223.26,20.2h-5.61V57.42H242V52.55H223.26Zm-30.46,0h-5.6V57.42h24.32V52.55H192.8Zm-154,38A19.41,19.41,0,1,1,57.92,35.57H77.47a38.81,38.81,0,1,0,0,6.47H57.92A19.39,19.39,0,0,1,38.81,58.21Z'/%3E%3C/svg%3E`;case"textLight":return r=(.1*e).toFixed(2),`data:image/svg+xml,%3Csvg width='${e}' height='${r}' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 528.15 53.64'%3E%3Cdefs%3E%3Cstyle%3E.cls-1%7Bfill:%23fefefe;%7D%3C/style%3E%3C/defs%3E%3Ctitle%3ECoinbase_Wordmark_SubBrands_ALL%3C/title%3E%3Cpath class='cls-1' d='M164.45,15a15,15,0,0,0-11.74,5.4V0h-8.64V52.92h8.5V48a15,15,0,0,0,11.88,5.62c10.37,0,18.21-8.21,18.21-19.3S174.67,15,164.45,15Zm-1.3,30.67c-6.19,0-10.73-4.83-10.73-11.31S157,23,163.22,23s10.66,4.82,10.66,11.37S169.34,45.65,163.15,45.65Zm83.31-14.91-6.34-.93c-3-.43-5.18-1.44-5.18-3.82,0-2.59,2.8-3.89,6.62-3.89,4.18,0,6.84,1.8,7.42,4.76h8.35c-.94-7.49-6.7-11.88-15.55-11.88-9.15,0-15.2,4.68-15.2,11.3,0,6.34,4,10,12,11.16l6.33.94c3.1.43,4.83,1.65,4.83,4,0,2.95-3,4.17-7.2,4.17-5.12,0-8-2.09-8.43-5.25h-8.49c.79,7.27,6.48,12.38,16.84,12.38,9.44,0,15.7-4.32,15.7-11.74C258.12,35.28,253.58,31.82,246.46,30.74Zm-27.65-2.3c0-8.06-4.9-13.46-15.27-13.46-9.79,0-15.26,5-16.34,12.6h8.57c.43-3,2.73-5.4,7.63-5.4,4.39,0,6.55,1.94,6.55,4.32,0,3.09-4,3.88-8.85,4.39-6.63.72-14.84,3-14.84,11.66,0,6.7,5,11,12.89,11,6.19,0,10.08-2.59,12-6.7.28,3.67,3,6.05,6.84,6.05h5v-7.7h-4.25Zm-8.5,9.36c0,5-4.32,8.64-9.57,8.64-3.24,0-6-1.37-6-4.25,0-3.67,4.39-4.68,8.42-5.11s6-1.22,7.13-2.88ZM281.09,15c-11.09,0-19.23,8.35-19.23,19.36,0,11.6,8.72,19.3,19.37,19.3,9,0,16.06-5.33,17.86-12.89h-9c-1.3,3.31-4.47,5.19-8.71,5.19-5.55,0-9.72-3.46-10.66-9.51H299.3V33.12C299.3,22.46,291.53,15,281.09,15Zm-9.87,15.26c1.37-5.18,5.26-7.7,9.72-7.7,4.9,0,8.64,2.8,9.51,7.7ZM19.3,23a9.84,9.84,0,0,1,9.5,7h9.14c-1.65-8.93-9-15-18.57-15A19,19,0,0,0,0,34.34c0,11.09,8.28,19.3,19.37,19.3,9.36,0,16.85-6,18.5-15H28.8a9.75,9.75,0,0,1-9.43,7.06c-6.27,0-10.66-4.83-10.66-11.31S13,23,19.3,23Zm41.11-8A19,19,0,0,0,41,34.34c0,11.09,8.28,19.3,19.37,19.3A19,19,0,0,0,79.92,34.27C79.92,23.33,71.64,15,60.41,15Zm.07,30.67c-6.19,0-10.73-4.83-10.73-11.31S54.22,23,60.41,23s10.8,4.89,10.8,11.37S66.67,45.65,60.48,45.65ZM123.41,15c-5.62,0-9.29,2.3-11.45,5.54V15.7h-8.57V52.92H112V32.69C112,27,115.63,23,121,23c5,0,8.06,3.53,8.06,8.64V52.92h8.64V31C137.66,21.6,132.84,15,123.41,15ZM92,.36a5.36,5.36,0,0,0-5.55,5.47,5.55,5.55,0,0,0,11.09,0A5.35,5.35,0,0,0,92,.36Zm-9.72,23h5.4V52.92h8.64V15.7h-14Zm298.17-7.7L366.2,52.92H372L375.29,44H392l3.33,8.88h6L386.87,15.7ZM377,39.23l6.45-17.56h.1l6.56,17.56ZM362.66,15.7l-7.88,29h-.11l-8.14-29H341l-8,28.93h-.1l-8-28.87H319L329.82,53h5.45l8.19-29.24h.11L352,53h5.66L368.1,15.7Zm135.25,0v4.86h12.32V52.92h5.6V20.56h12.32V15.7ZM467.82,52.92h25.54V48.06H473.43v-12h18.35V31.35H473.43V20.56h19.93V15.7H467.82ZM443,15.7h-5.6V52.92h24.32V48.06H443Zm-30.45,0h-5.61V52.92h24.32V48.06H412.52Z'/%3E%3C/svg%3E`;case"textWithLogoLight":return r=(.25*e).toFixed(2),`data:image/svg+xml,%3Csvg width='${e}' height='${r}' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 308.44 77.61'%3E%3Cdefs%3E%3Cstyle%3E.cls-1%7Bfill:%23fefefe;%7D%3C/style%3E%3C/defs%3E%3Cpath class='cls-1' d='M142.94,20.2l-7.88,29H135l-8.15-29h-5.55l-8,28.93h-.11l-8-28.87H99.27l10.84,37.27h5.44l8.2-29.24h.1l8.41,29.24h5.66L148.39,20.2Zm17.82,0L146.48,57.42h5.82l3.28-8.88h16.65l3.34,8.88h6L167.16,20.2Zm-3.44,23.52,6.45-17.55h.11l6.56,17.55ZM278.2,20.2v4.86h12.32V57.42h5.6V25.06h12.32V20.2ZM248.11,57.42h25.54V52.55H253.71V40.61h18.35V35.85H253.71V25.06h19.94V20.2H248.11ZM223.26,20.2h-5.61V57.42H242V52.55H223.26Zm-30.46,0h-5.6V57.42h24.32V52.55H192.8Zm-154,38A19.41,19.41,0,1,1,57.92,35.57H77.47a38.81,38.81,0,1,0,0,6.47H57.92A19.39,19.39,0,0,1,38.81,58.21Z'/%3E%3C/svg%3E`;default:return r=e,`data:image/svg+xml,%3Csvg width='${e}' height='${r}' viewBox='0 0 1024 1024' fill='none' xmlns='http://www.w3.org/2000/svg'%3E %3Crect width='1024' height='1024' fill='%230052FF'/%3E %3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M152 512C152 710.823 313.177 872 512 872C710.823 872 872 710.823 872 512C872 313.177 710.823 152 512 152C313.177 152 152 313.177 152 512ZM420 396C406.745 396 396 406.745 396 420V604C396 617.255 406.745 628 420 628H604C617.255 628 628 617.255 628 604V420C628 406.745 617.255 396 604 396H420Z' fill='white'/%3E %3C/svg%3E `}};Hs.walletLogo=X0;var Ws={};Object.defineProperty(Ws,"__esModule",{value:!0});Ws.LINK_API_URL=void 0;Ws.LINK_API_URL="https://www.walletlink.org";var Vs={};Object.defineProperty(Vs,"__esModule",{value:!0});Vs.ScopedLocalStorage=void 0;class ep{constructor(e){this.scope=e}setItem(e,r){localStorage.setItem(this.scopedKey(e),r)}getItem(e){return localStorage.getItem(this.scopedKey(e))}removeItem(e){localStorage.removeItem(this.scopedKey(e))}clear(){const e=this.scopedKey(""),r=[];for(let n=0;n<localStorage.length;n++){const i=localStorage.key(n);typeof i=="string"&&i.startsWith(e)&&r.push(i)}r.forEach(n=>localStorage.removeItem(n))}scopedKey(e){return`${this.scope}:${e}`}}Vs.ScopedLocalStorage=ep;var zn={},pn={};Object.defineProperty(pn,"__esModule",{value:!0});const tp=au;function vc(t,e,r){try{Reflect.apply(t,e,r)}catch(n){setTimeout(()=>{throw n})}}function rp(t){const e=t.length,r=new Array(e);for(let n=0;n<e;n+=1)r[n]=t[n];return r}let np=class extends tp.EventEmitter{emit(e,...r){let n=e==="error";const i=this._events;if(i!==void 0)n=n&&i.error===void 0;else if(!n)return!1;if(n){let o;if(r.length>0&&([o]=r),o instanceof Error)throw o;const a=new Error(`Unhandled error.${o?` (${o.message})`:""}`);throw a.context=o,a}const s=i[e];if(s===void 0)return!1;if(typeof s=="function")vc(s,this,r);else{const o=s.length,a=rp(s);for(let c=0;c<o;c+=1)vc(a[c],this,r)}return!0}};pn.default=np;var lu={exports:{}};lu.exports;(function(t){(function(e,r){function n(w,u){if(!w)throw new Error(u||"Assertion failed")}function i(w,u){w.super_=u;var b=function(){};b.prototype=u.prototype,w.prototype=new b,w.prototype.constructor=w}function s(w,u,b){if(s.isBN(w))return w;this.negative=0,this.words=null,this.length=0,this.red=null,w!==null&&((u==="le"||u==="be")&&(b=u,u=10),this._init(w||0,u||10,b||"be"))}typeof e=="object"?e.exports=s:r.BN=s,s.BN=s,s.wordSize=26;var o;try{typeof window<"u"&&typeof window.Buffer<"u"?o=window.Buffer:o=uu.Buffer}catch{}s.isBN=function(u){return u instanceof s?!0:u!==null&&typeof u=="object"&&u.constructor.wordSize===s.wordSize&&Array.isArray(u.words)},s.max=function(u,b){return u.cmp(b)>0?u:b},s.min=function(u,b){return u.cmp(b)<0?u:b},s.prototype._init=function(u,b,m){if(typeof u=="number")return this._initNumber(u,b,m);if(typeof u=="object")return this._initArray(u,b,m);b==="hex"&&(b=16),n(b===(b|0)&&b>=2&&b<=36),u=u.toString().replace(/\s+/g,"");var E=0;u[0]==="-"&&(E++,this.negative=1),E<u.length&&(b===16?this._parseHex(u,E,m):(this._parseBase(u,b,E),m==="le"&&this._initArray(this.toArray(),b,m)))},s.prototype._initNumber=function(u,b,m){u<0&&(this.negative=1,u=-u),u<67108864?(this.words=[u&67108863],this.length=1):u<4503599627370496?(this.words=[u&67108863,u/67108864&67108863],this.length=2):(n(u<9007199254740992),this.words=[u&67108863,u/67108864&67108863,1],this.length=3),m==="le"&&this._initArray(this.toArray(),b,m)},s.prototype._initArray=function(u,b,m){if(n(typeof u.length=="number"),u.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(u.length/3),this.words=new Array(this.length);for(var E=0;E<this.length;E++)this.words[E]=0;var S,k,L=0;if(m==="be")for(E=u.length-1,S=0;E>=0;E-=3)k=u[E]|u[E-1]<<8|u[E-2]<<16,this.words[S]|=k<<L&67108863,this.words[S+1]=k>>>26-L&67108863,L+=24,L>=26&&(L-=26,S++);else if(m==="le")for(E=0,S=0;E<u.length;E+=3)k=u[E]|u[E+1]<<8|u[E+2]<<16,this.words[S]|=k<<L&67108863,this.words[S+1]=k>>>26-L&67108863,L+=24,L>=26&&(L-=26,S++);return this._strip()};function a(w,u){var b=w.charCodeAt(u);if(b>=48&&b<=57)return b-48;if(b>=65&&b<=70)return b-55;if(b>=97&&b<=102)return b-87;n(!1,"Invalid character in "+w)}function c(w,u,b){var m=a(w,b);return b-1>=u&&(m|=a(w,b-1)<<4),m}s.prototype._parseHex=function(u,b,m){this.length=Math.ceil((u.length-b)/6),this.words=new Array(this.length);for(var E=0;E<this.length;E++)this.words[E]=0;var S=0,k=0,L;if(m==="be")for(E=u.length-1;E>=b;E-=2)L=c(u,b,E)<<S,this.words[k]|=L&67108863,S>=18?(S-=18,k+=1,this.words[k]|=L>>>26):S+=8;else{var _=u.length-b;for(E=_%2===0?b+1:b;E<u.length;E+=2)L=c(u,b,E)<<S,this.words[k]|=L&67108863,S>=18?(S-=18,k+=1,this.words[k]|=L>>>26):S+=8}this._strip()};function l(w,u,b,m){for(var E=0,S=0,k=Math.min(w.length,b),L=u;L<k;L++){var _=w.charCodeAt(L)-48;E*=m,_>=49?S=_-49+10:_>=17?S=_-17+10:S=_,n(_>=0&&S<m,"Invalid character"),E+=S}return E}s.prototype._parseBase=function(u,b,m){this.words=[0],this.length=1;for(var E=0,S=1;S<=67108863;S*=b)E++;E--,S=S/b|0;for(var k=u.length-m,L=k%E,_=Math.min(k,k-L)+m,d=0,A=m;A<_;A+=E)d=l(u,A,A+E,b),this.imuln(S),this.words[0]+d<67108864?this.words[0]+=d:this._iaddn(d);if(L!==0){var Y=1;for(d=l(u,A,u.length,b),A=0;A<L;A++)Y*=b;this.imuln(Y),this.words[0]+d<67108864?this.words[0]+=d:this._iaddn(d)}this._strip()},s.prototype.copy=function(u){u.words=new Array(this.length);for(var b=0;b<this.length;b++)u.words[b]=this.words[b];u.length=this.length,u.negative=this.negative,u.red=this.red};function p(w,u){w.words=u.words,w.length=u.length,w.negative=u.negative,w.red=u.red}if(s.prototype._move=function(u){p(u,this)},s.prototype.clone=function(){var u=new s(null);return this.copy(u),u},s.prototype._expand=function(u){for(;this.length<u;)this.words[this.length++]=0;return this},s.prototype._strip=function(){for(;this.length>1&&this.words[this.length-1]===0;)this.length--;return this._normSign()},s.prototype._normSign=function(){return this.length===1&&this.words[0]===0&&(this.negative=0),this},typeof Symbol<"u"&&typeof Symbol.for=="function")try{s.prototype[Symbol.for("nodejs.util.inspect.custom")]=g}catch{s.prototype.inspect=g}else s.prototype.inspect=g;function g(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"}var y=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],I=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],T=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];s.prototype.toString=function(u,b){u=u||10,b=b|0||1;var m;if(u===16||u==="hex"){m="";for(var E=0,S=0,k=0;k<this.length;k++){var L=this.words[k],_=((L<<E|S)&16777215).toString(16);S=L>>>24-E&16777215,E+=2,E>=26&&(E-=26,k--),S!==0||k!==this.length-1?m=y[6-_.length]+_+m:m=_+m}for(S!==0&&(m=S.toString(16)+m);m.length%b!==0;)m="0"+m;return this.negative!==0&&(m="-"+m),m}if(u===(u|0)&&u>=2&&u<=36){var d=I[u],A=T[u];m="";var Y=this.clone();for(Y.negative=0;!Y.isZero();){var ee=Y.modrn(A).toString(u);Y=Y.idivn(A),Y.isZero()?m=ee+m:m=y[d-ee.length]+ee+m}for(this.isZero()&&(m="0"+m);m.length%b!==0;)m="0"+m;return this.negative!==0&&(m="-"+m),m}n(!1,"Base should be between 2 and 36")},s.prototype.toNumber=function(){var u=this.words[0];return this.length===2?u+=this.words[1]*67108864:this.length===3&&this.words[2]===1?u+=4503599627370496+this.words[1]*67108864:this.length>2&&n(!1,"Number can only safely store up to 53 bits"),this.negative!==0?-u:u},s.prototype.toJSON=function(){return this.toString(16,2)},o&&(s.prototype.toBuffer=function(u,b){return this.toArrayLike(o,u,b)}),s.prototype.toArray=function(u,b){return this.toArrayLike(Array,u,b)};var D=function(u,b){return u.allocUnsafe?u.allocUnsafe(b):new u(b)};s.prototype.toArrayLike=function(u,b,m){this._strip();var E=this.byteLength(),S=m||Math.max(1,E);n(E<=S,"byte array longer than desired length"),n(S>0,"Requested array length <= 0");var k=D(u,S),L=b==="le"?"LE":"BE";return this["_toArrayLike"+L](k,E),k},s.prototype._toArrayLikeLE=function(u,b){for(var m=0,E=0,S=0,k=0;S<this.length;S++){var L=this.words[S]<<k|E;u[m++]=L&255,m<u.length&&(u[m++]=L>>8&255),m<u.length&&(u[m++]=L>>16&255),k===6?(m<u.length&&(u[m++]=L>>24&255),E=0,k=0):(E=L>>>24,k+=2)}if(m<u.length)for(u[m++]=E;m<u.length;)u[m++]=0},s.prototype._toArrayLikeBE=function(u,b){for(var m=u.length-1,E=0,S=0,k=0;S<this.length;S++){var L=this.words[S]<<k|E;u[m--]=L&255,m>=0&&(u[m--]=L>>8&255),m>=0&&(u[m--]=L>>16&255),k===6?(m>=0&&(u[m--]=L>>24&255),E=0,k=0):(E=L>>>24,k+=2)}if(m>=0)for(u[m--]=E;m>=0;)u[m--]=0},Math.clz32?s.prototype._countBits=function(u){return 32-Math.clz32(u)}:s.prototype._countBits=function(u){var b=u,m=0;return b>=4096&&(m+=13,b>>>=13),b>=64&&(m+=7,b>>>=7),b>=8&&(m+=4,b>>>=4),b>=2&&(m+=2,b>>>=2),m+b},s.prototype._zeroBits=function(u){if(u===0)return 26;var b=u,m=0;return b&8191||(m+=13,b>>>=13),b&127||(m+=7,b>>>=7),b&15||(m+=4,b>>>=4),b&3||(m+=2,b>>>=2),b&1||m++,m},s.prototype.bitLength=function(){var u=this.words[this.length-1],b=this._countBits(u);return(this.length-1)*26+b};function U(w){for(var u=new Array(w.bitLength()),b=0;b<u.length;b++){var m=b/26|0,E=b%26;u[b]=w.words[m]>>>E&1}return u}s.prototype.zeroBits=function(){if(this.isZero())return 0;for(var u=0,b=0;b<this.length;b++){var m=this._zeroBits(this.words[b]);if(u+=m,m!==26)break}return u},s.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},s.prototype.toTwos=function(u){return this.negative!==0?this.abs().inotn(u).iaddn(1):this.clone()},s.prototype.fromTwos=function(u){return this.testn(u-1)?this.notn(u).iaddn(1).ineg():this.clone()},s.prototype.isNeg=function(){return this.negative!==0},s.prototype.neg=function(){return this.clone().ineg()},s.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},s.prototype.iuor=function(u){for(;this.length<u.length;)this.words[this.length++]=0;for(var b=0;b<u.length;b++)this.words[b]=this.words[b]|u.words[b];return this._strip()},s.prototype.ior=function(u){return n((this.negative|u.negative)===0),this.iuor(u)},s.prototype.or=function(u){return this.length>u.length?this.clone().ior(u):u.clone().ior(this)},s.prototype.uor=function(u){return this.length>u.length?this.clone().iuor(u):u.clone().iuor(this)},s.prototype.iuand=function(u){var b;this.length>u.length?b=u:b=this;for(var m=0;m<b.length;m++)this.words[m]=this.words[m]&u.words[m];return this.length=b.length,this._strip()},s.prototype.iand=function(u){return n((this.negative|u.negative)===0),this.iuand(u)},s.prototype.and=function(u){return this.length>u.length?this.clone().iand(u):u.clone().iand(this)},s.prototype.uand=function(u){return this.length>u.length?this.clone().iuand(u):u.clone().iuand(this)},s.prototype.iuxor=function(u){var b,m;this.length>u.length?(b=this,m=u):(b=u,m=this);for(var E=0;E<m.length;E++)this.words[E]=b.words[E]^m.words[E];if(this!==b)for(;E<b.length;E++)this.words[E]=b.words[E];return this.length=b.length,this._strip()},s.prototype.ixor=function(u){return n((this.negative|u.negative)===0),this.iuxor(u)},s.prototype.xor=function(u){return this.length>u.length?this.clone().ixor(u):u.clone().ixor(this)},s.prototype.uxor=function(u){return this.length>u.length?this.clone().iuxor(u):u.clone().iuxor(this)},s.prototype.inotn=function(u){n(typeof u=="number"&&u>=0);var b=Math.ceil(u/26)|0,m=u%26;this._expand(b),m>0&&b--;for(var E=0;E<b;E++)this.words[E]=~this.words[E]&67108863;return m>0&&(this.words[E]=~this.words[E]&67108863>>26-m),this._strip()},s.prototype.notn=function(u){return this.clone().inotn(u)},s.prototype.setn=function(u,b){n(typeof u=="number"&&u>=0);var m=u/26|0,E=u%26;return this._expand(m+1),b?this.words[m]=this.words[m]|1<<E:this.words[m]=this.words[m]&~(1<<E),this._strip()},s.prototype.iadd=function(u){var b;if(this.negative!==0&&u.negative===0)return this.negative=0,b=this.isub(u),this.negative^=1,this._normSign();if(this.negative===0&&u.negative!==0)return u.negative=0,b=this.isub(u),u.negative=1,b._normSign();var m,E;this.length>u.length?(m=this,E=u):(m=u,E=this);for(var S=0,k=0;k<E.length;k++)b=(m.words[k]|0)+(E.words[k]|0)+S,this.words[k]=b&67108863,S=b>>>26;for(;S!==0&&k<m.length;k++)b=(m.words[k]|0)+S,this.words[k]=b&67108863,S=b>>>26;if(this.length=m.length,S!==0)this.words[this.length]=S,this.length++;else if(m!==this)for(;k<m.length;k++)this.words[k]=m.words[k];return this},s.prototype.add=function(u){var b;return u.negative!==0&&this.negative===0?(u.negative=0,b=this.sub(u),u.negative^=1,b):u.negative===0&&this.negative!==0?(this.negative=0,b=u.sub(this),this.negative=1,b):this.length>u.length?this.clone().iadd(u):u.clone().iadd(this)},s.prototype.isub=function(u){if(u.negative!==0){u.negative=0;var b=this.iadd(u);return u.negative=1,b._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(u),this.negative=1,this._normSign();var m=this.cmp(u);if(m===0)return this.negative=0,this.length=1,this.words[0]=0,this;var E,S;m>0?(E=this,S=u):(E=u,S=this);for(var k=0,L=0;L<S.length;L++)b=(E.words[L]|0)-(S.words[L]|0)+k,k=b>>26,this.words[L]=b&67108863;for(;k!==0&&L<E.length;L++)b=(E.words[L]|0)+k,k=b>>26,this.words[L]=b&67108863;if(k===0&&L<E.length&&E!==this)for(;L<E.length;L++)this.words[L]=E.words[L];return this.length=Math.max(this.length,L),E!==this&&(this.negative=1),this._strip()},s.prototype.sub=function(u){return this.clone().isub(u)};function M(w,u,b){b.negative=u.negative^w.negative;var m=w.length+u.length|0;b.length=m,m=m-1|0;var E=w.words[0]|0,S=u.words[0]|0,k=E*S,L=k&67108863,_=k/67108864|0;b.words[0]=L;for(var d=1;d<m;d++){for(var A=_>>>26,Y=_&67108863,ee=Math.min(d,u.length-1),O=Math.max(0,d-w.length+1);O<=ee;O++){var P=d-O|0;E=w.words[P]|0,S=u.words[O]|0,k=E*S+Y,A+=k/67108864|0,Y=k&67108863}b.words[d]=Y|0,_=A|0}return _!==0?b.words[d]=_|0:b.length--,b._strip()}var N=function(u,b,m){var E=u.words,S=b.words,k=m.words,L=0,_,d,A,Y=E[0]|0,ee=Y&8191,O=Y>>>13,P=E[1]|0,V=P&8191,Q=P>>>13,ge=E[2]|0,C=ge&8191,R=ge>>>13,q=E[3]|0,Z=q&8191,he=q>>>13,be=E[4]|0,se=be&8191,xe=be>>>13,Bt=E[5]|0,ke=Bt&8191,Re=Bt>>>13,ct=E[6]|0,Ce=ct&8191,Ne=ct>>>13,ft=E[7]|0,Ie=ft&8191,v=ft>>>13,h=E[8]|0,f=h&8191,x=h>>>13,B=E[9]|0,$=B&8191,W=B>>>13,de=S[0]|0,fe=de&8191,ce=de>>>13,Oe=S[1]|0,ae=Oe&8191,De=Oe>>>13,En=S[2]|0,je=En&8191,$e=En>>>13,Sn=S[3]|0,Fe=Sn&8191,Ue=Sn>>>13,xn=S[4]|0,He=xn&8191,We=xn>>>13,Mn=S[5]|0,Ve=Mn&8191,ze=Mn>>>13,Cn=S[6]|0,qe=Cn&8191,Ge=Cn>>>13,In=S[7]|0,Je=In&8191,Ze=In>>>13,Rn=S[8]|0,Qe=Rn&8191,Ye=Rn>>>13,An=S[9]|0,Ke=An&8191,Xe=An>>>13;m.negative=u.negative^b.negative,m.length=19,_=Math.imul(ee,fe),d=Math.imul(ee,ce),d=d+Math.imul(O,fe)|0,A=Math.imul(O,ce);var Dr=(L+_|0)+((d&8191)<<13)|0;L=(A+(d>>>13)|0)+(Dr>>>26)|0,Dr&=67108863,_=Math.imul(V,fe),d=Math.imul(V,ce),d=d+Math.imul(Q,fe)|0,A=Math.imul(Q,ce),_=_+Math.imul(ee,ae)|0,d=d+Math.imul(ee,De)|0,d=d+Math.imul(O,ae)|0,A=A+Math.imul(O,De)|0;var jr=(L+_|0)+((d&8191)<<13)|0;L=(A+(d>>>13)|0)+(jr>>>26)|0,jr&=67108863,_=Math.imul(C,fe),d=Math.imul(C,ce),d=d+Math.imul(R,fe)|0,A=Math.imul(R,ce),_=_+Math.imul(V,ae)|0,d=d+Math.imul(V,De)|0,d=d+Math.imul(Q,ae)|0,A=A+Math.imul(Q,De)|0,_=_+Math.imul(ee,je)|0,d=d+Math.imul(ee,$e)|0,d=d+Math.imul(O,je)|0,A=A+Math.imul(O,$e)|0;var $r=(L+_|0)+((d&8191)<<13)|0;L=(A+(d>>>13)|0)+($r>>>26)|0,$r&=67108863,_=Math.imul(Z,fe),d=Math.imul(Z,ce),d=d+Math.imul(he,fe)|0,A=Math.imul(he,ce),_=_+Math.imul(C,ae)|0,d=d+Math.imul(C,De)|0,d=d+Math.imul(R,ae)|0,A=A+Math.imul(R,De)|0,_=_+Math.imul(V,je)|0,d=d+Math.imul(V,$e)|0,d=d+Math.imul(Q,je)|0,A=A+Math.imul(Q,$e)|0,_=_+Math.imul(ee,Fe)|0,d=d+Math.imul(ee,Ue)|0,d=d+Math.imul(O,Fe)|0,A=A+Math.imul(O,Ue)|0;var Fr=(L+_|0)+((d&8191)<<13)|0;L=(A+(d>>>13)|0)+(Fr>>>26)|0,Fr&=67108863,_=Math.imul(se,fe),d=Math.imul(se,ce),d=d+Math.imul(xe,fe)|0,A=Math.imul(xe,ce),_=_+Math.imul(Z,ae)|0,d=d+Math.imul(Z,De)|0,d=d+Math.imul(he,ae)|0,A=A+Math.imul(he,De)|0,_=_+Math.imul(C,je)|0,d=d+Math.imul(C,$e)|0,d=d+Math.imul(R,je)|0,A=A+Math.imul(R,$e)|0,_=_+Math.imul(V,Fe)|0,d=d+Math.imul(V,Ue)|0,d=d+Math.imul(Q,Fe)|0,A=A+Math.imul(Q,Ue)|0,_=_+Math.imul(ee,He)|0,d=d+Math.imul(ee,We)|0,d=d+Math.imul(O,He)|0,A=A+Math.imul(O,We)|0;var Ur=(L+_|0)+((d&8191)<<13)|0;L=(A+(d>>>13)|0)+(Ur>>>26)|0,Ur&=67108863,_=Math.imul(ke,fe),d=Math.imul(ke,ce),d=d+Math.imul(Re,fe)|0,A=Math.imul(Re,ce),_=_+Math.imul(se,ae)|0,d=d+Math.imul(se,De)|0,d=d+Math.imul(xe,ae)|0,A=A+Math.imul(xe,De)|0,_=_+Math.imul(Z,je)|0,d=d+Math.imul(Z,$e)|0,d=d+Math.imul(he,je)|0,A=A+Math.imul(he,$e)|0,_=_+Math.imul(C,Fe)|0,d=d+Math.imul(C,Ue)|0,d=d+Math.imul(R,Fe)|0,A=A+Math.imul(R,Ue)|0,_=_+Math.imul(V,He)|0,d=d+Math.imul(V,We)|0,d=d+Math.imul(Q,He)|0,A=A+Math.imul(Q,We)|0,_=_+Math.imul(ee,Ve)|0,d=d+Math.imul(ee,ze)|0,d=d+Math.imul(O,Ve)|0,A=A+Math.imul(O,ze)|0;var Hr=(L+_|0)+((d&8191)<<13)|0;L=(A+(d>>>13)|0)+(Hr>>>26)|0,Hr&=67108863,_=Math.imul(Ce,fe),d=Math.imul(Ce,ce),d=d+Math.imul(Ne,fe)|0,A=Math.imul(Ne,ce),_=_+Math.imul(ke,ae)|0,d=d+Math.imul(ke,De)|0,d=d+Math.imul(Re,ae)|0,A=A+Math.imul(Re,De)|0,_=_+Math.imul(se,je)|0,d=d+Math.imul(se,$e)|0,d=d+Math.imul(xe,je)|0,A=A+Math.imul(xe,$e)|0,_=_+Math.imul(Z,Fe)|0,d=d+Math.imul(Z,Ue)|0,d=d+Math.imul(he,Fe)|0,A=A+Math.imul(he,Ue)|0,_=_+Math.imul(C,He)|0,d=d+Math.imul(C,We)|0,d=d+Math.imul(R,He)|0,A=A+Math.imul(R,We)|0,_=_+Math.imul(V,Ve)|0,d=d+Math.imul(V,ze)|0,d=d+Math.imul(Q,Ve)|0,A=A+Math.imul(Q,ze)|0,_=_+Math.imul(ee,qe)|0,d=d+Math.imul(ee,Ge)|0,d=d+Math.imul(O,qe)|0,A=A+Math.imul(O,Ge)|0;var Wr=(L+_|0)+((d&8191)<<13)|0;L=(A+(d>>>13)|0)+(Wr>>>26)|0,Wr&=67108863,_=Math.imul(Ie,fe),d=Math.imul(Ie,ce),d=d+Math.imul(v,fe)|0,A=Math.imul(v,ce),_=_+Math.imul(Ce,ae)|0,d=d+Math.imul(Ce,De)|0,d=d+Math.imul(Ne,ae)|0,A=A+Math.imul(Ne,De)|0,_=_+Math.imul(ke,je)|0,d=d+Math.imul(ke,$e)|0,d=d+Math.imul(Re,je)|0,A=A+Math.imul(Re,$e)|0,_=_+Math.imul(se,Fe)|0,d=d+Math.imul(se,Ue)|0,d=d+Math.imul(xe,Fe)|0,A=A+Math.imul(xe,Ue)|0,_=_+Math.imul(Z,He)|0,d=d+Math.imul(Z,We)|0,d=d+Math.imul(he,He)|0,A=A+Math.imul(he,We)|0,_=_+Math.imul(C,Ve)|0,d=d+Math.imul(C,ze)|0,d=d+Math.imul(R,Ve)|0,A=A+Math.imul(R,ze)|0,_=_+Math.imul(V,qe)|0,d=d+Math.imul(V,Ge)|0,d=d+Math.imul(Q,qe)|0,A=A+Math.imul(Q,Ge)|0,_=_+Math.imul(ee,Je)|0,d=d+Math.imul(ee,Ze)|0,d=d+Math.imul(O,Je)|0,A=A+Math.imul(O,Ze)|0;var Vr=(L+_|0)+((d&8191)<<13)|0;L=(A+(d>>>13)|0)+(Vr>>>26)|0,Vr&=67108863,_=Math.imul(f,fe),d=Math.imul(f,ce),d=d+Math.imul(x,fe)|0,A=Math.imul(x,ce),_=_+Math.imul(Ie,ae)|0,d=d+Math.imul(Ie,De)|0,d=d+Math.imul(v,ae)|0,A=A+Math.imul(v,De)|0,_=_+Math.imul(Ce,je)|0,d=d+Math.imul(Ce,$e)|0,d=d+Math.imul(Ne,je)|0,A=A+Math.imul(Ne,$e)|0,_=_+Math.imul(ke,Fe)|0,d=d+Math.imul(ke,Ue)|0,d=d+Math.imul(Re,Fe)|0,A=A+Math.imul(Re,Ue)|0,_=_+Math.imul(se,He)|0,d=d+Math.imul(se,We)|0,d=d+Math.imul(xe,He)|0,A=A+Math.imul(xe,We)|0,_=_+Math.imul(Z,Ve)|0,d=d+Math.imul(Z,ze)|0,d=d+Math.imul(he,Ve)|0,A=A+Math.imul(he,ze)|0,_=_+Math.imul(C,qe)|0,d=d+Math.imul(C,Ge)|0,d=d+Math.imul(R,qe)|0,A=A+Math.imul(R,Ge)|0,_=_+Math.imul(V,Je)|0,d=d+Math.imul(V,Ze)|0,d=d+Math.imul(Q,Je)|0,A=A+Math.imul(Q,Ze)|0,_=_+Math.imul(ee,Qe)|0,d=d+Math.imul(ee,Ye)|0,d=d+Math.imul(O,Qe)|0,A=A+Math.imul(O,Ye)|0;var zr=(L+_|0)+((d&8191)<<13)|0;L=(A+(d>>>13)|0)+(zr>>>26)|0,zr&=67108863,_=Math.imul($,fe),d=Math.imul($,ce),d=d+Math.imul(W,fe)|0,A=Math.imul(W,ce),_=_+Math.imul(f,ae)|0,d=d+Math.imul(f,De)|0,d=d+Math.imul(x,ae)|0,A=A+Math.imul(x,De)|0,_=_+Math.imul(Ie,je)|0,d=d+Math.imul(Ie,$e)|0,d=d+Math.imul(v,je)|0,A=A+Math.imul(v,$e)|0,_=_+Math.imul(Ce,Fe)|0,d=d+Math.imul(Ce,Ue)|0,d=d+Math.imul(Ne,Fe)|0,A=A+Math.imul(Ne,Ue)|0,_=_+Math.imul(ke,He)|0,d=d+Math.imul(ke,We)|0,d=d+Math.imul(Re,He)|0,A=A+Math.imul(Re,We)|0,_=_+Math.imul(se,Ve)|0,d=d+Math.imul(se,ze)|0,d=d+Math.imul(xe,Ve)|0,A=A+Math.imul(xe,ze)|0,_=_+Math.imul(Z,qe)|0,d=d+Math.imul(Z,Ge)|0,d=d+Math.imul(he,qe)|0,A=A+Math.imul(he,Ge)|0,_=_+Math.imul(C,Je)|0,d=d+Math.imul(C,Ze)|0,d=d+Math.imul(R,Je)|0,A=A+Math.imul(R,Ze)|0,_=_+Math.imul(V,Qe)|0,d=d+Math.imul(V,Ye)|0,d=d+Math.imul(Q,Qe)|0,A=A+Math.imul(Q,Ye)|0,_=_+Math.imul(ee,Ke)|0,d=d+Math.imul(ee,Xe)|0,d=d+Math.imul(O,Ke)|0,A=A+Math.imul(O,Xe)|0;var qr=(L+_|0)+((d&8191)<<13)|0;L=(A+(d>>>13)|0)+(qr>>>26)|0,qr&=67108863,_=Math.imul($,ae),d=Math.imul($,De),d=d+Math.imul(W,ae)|0,A=Math.imul(W,De),_=_+Math.imul(f,je)|0,d=d+Math.imul(f,$e)|0,d=d+Math.imul(x,je)|0,A=A+Math.imul(x,$e)|0,_=_+Math.imul(Ie,Fe)|0,d=d+Math.imul(Ie,Ue)|0,d=d+Math.imul(v,Fe)|0,A=A+Math.imul(v,Ue)|0,_=_+Math.imul(Ce,He)|0,d=d+Math.imul(Ce,We)|0,d=d+Math.imul(Ne,He)|0,A=A+Math.imul(Ne,We)|0,_=_+Math.imul(ke,Ve)|0,d=d+Math.imul(ke,ze)|0,d=d+Math.imul(Re,Ve)|0,A=A+Math.imul(Re,ze)|0,_=_+Math.imul(se,qe)|0,d=d+Math.imul(se,Ge)|0,d=d+Math.imul(xe,qe)|0,A=A+Math.imul(xe,Ge)|0,_=_+Math.imul(Z,Je)|0,d=d+Math.imul(Z,Ze)|0,d=d+Math.imul(he,Je)|0,A=A+Math.imul(he,Ze)|0,_=_+Math.imul(C,Qe)|0,d=d+Math.imul(C,Ye)|0,d=d+Math.imul(R,Qe)|0,A=A+Math.imul(R,Ye)|0,_=_+Math.imul(V,Ke)|0,d=d+Math.imul(V,Xe)|0,d=d+Math.imul(Q,Ke)|0,A=A+Math.imul(Q,Xe)|0;var Gr=(L+_|0)+((d&8191)<<13)|0;L=(A+(d>>>13)|0)+(Gr>>>26)|0,Gr&=67108863,_=Math.imul($,je),d=Math.imul($,$e),d=d+Math.imul(W,je)|0,A=Math.imul(W,$e),_=_+Math.imul(f,Fe)|0,d=d+Math.imul(f,Ue)|0,d=d+Math.imul(x,Fe)|0,A=A+Math.imul(x,Ue)|0,_=_+Math.imul(Ie,He)|0,d=d+Math.imul(Ie,We)|0,d=d+Math.imul(v,He)|0,A=A+Math.imul(v,We)|0,_=_+Math.imul(Ce,Ve)|0,d=d+Math.imul(Ce,ze)|0,d=d+Math.imul(Ne,Ve)|0,A=A+Math.imul(Ne,ze)|0,_=_+Math.imul(ke,qe)|0,d=d+Math.imul(ke,Ge)|0,d=d+Math.imul(Re,qe)|0,A=A+Math.imul(Re,Ge)|0,_=_+Math.imul(se,Je)|0,d=d+Math.imul(se,Ze)|0,d=d+Math.imul(xe,Je)|0,A=A+Math.imul(xe,Ze)|0,_=_+Math.imul(Z,Qe)|0,d=d+Math.imul(Z,Ye)|0,d=d+Math.imul(he,Qe)|0,A=A+Math.imul(he,Ye)|0,_=_+Math.imul(C,Ke)|0,d=d+Math.imul(C,Xe)|0,d=d+Math.imul(R,Ke)|0,A=A+Math.imul(R,Xe)|0;var Jr=(L+_|0)+((d&8191)<<13)|0;L=(A+(d>>>13)|0)+(Jr>>>26)|0,Jr&=67108863,_=Math.imul($,Fe),d=Math.imul($,Ue),d=d+Math.imul(W,Fe)|0,A=Math.imul(W,Ue),_=_+Math.imul(f,He)|0,d=d+Math.imul(f,We)|0,d=d+Math.imul(x,He)|0,A=A+Math.imul(x,We)|0,_=_+Math.imul(Ie,Ve)|0,d=d+Math.imul(Ie,ze)|0,d=d+Math.imul(v,Ve)|0,A=A+Math.imul(v,ze)|0,_=_+Math.imul(Ce,qe)|0,d=d+Math.imul(Ce,Ge)|0,d=d+Math.imul(Ne,qe)|0,A=A+Math.imul(Ne,Ge)|0,_=_+Math.imul(ke,Je)|0,d=d+Math.imul(ke,Ze)|0,d=d+Math.imul(Re,Je)|0,A=A+Math.imul(Re,Ze)|0,_=_+Math.imul(se,Qe)|0,d=d+Math.imul(se,Ye)|0,d=d+Math.imul(xe,Qe)|0,A=A+Math.imul(xe,Ye)|0,_=_+Math.imul(Z,Ke)|0,d=d+Math.imul(Z,Xe)|0,d=d+Math.imul(he,Ke)|0,A=A+Math.imul(he,Xe)|0;var Zr=(L+_|0)+((d&8191)<<13)|0;L=(A+(d>>>13)|0)+(Zr>>>26)|0,Zr&=67108863,_=Math.imul($,He),d=Math.imul($,We),d=d+Math.imul(W,He)|0,A=Math.imul(W,We),_=_+Math.imul(f,Ve)|0,d=d+Math.imul(f,ze)|0,d=d+Math.imul(x,Ve)|0,A=A+Math.imul(x,ze)|0,_=_+Math.imul(Ie,qe)|0,d=d+Math.imul(Ie,Ge)|0,d=d+Math.imul(v,qe)|0,A=A+Math.imul(v,Ge)|0,_=_+Math.imul(Ce,Je)|0,d=d+Math.imul(Ce,Ze)|0,d=d+Math.imul(Ne,Je)|0,A=A+Math.imul(Ne,Ze)|0,_=_+Math.imul(ke,Qe)|0,d=d+Math.imul(ke,Ye)|0,d=d+Math.imul(Re,Qe)|0,A=A+Math.imul(Re,Ye)|0,_=_+Math.imul(se,Ke)|0,d=d+Math.imul(se,Xe)|0,d=d+Math.imul(xe,Ke)|0,A=A+Math.imul(xe,Xe)|0;var Qr=(L+_|0)+((d&8191)<<13)|0;L=(A+(d>>>13)|0)+(Qr>>>26)|0,Qr&=67108863,_=Math.imul($,Ve),d=Math.imul($,ze),d=d+Math.imul(W,Ve)|0,A=Math.imul(W,ze),_=_+Math.imul(f,qe)|0,d=d+Math.imul(f,Ge)|0,d=d+Math.imul(x,qe)|0,A=A+Math.imul(x,Ge)|0,_=_+Math.imul(Ie,Je)|0,d=d+Math.imul(Ie,Ze)|0,d=d+Math.imul(v,Je)|0,A=A+Math.imul(v,Ze)|0,_=_+Math.imul(Ce,Qe)|0,d=d+Math.imul(Ce,Ye)|0,d=d+Math.imul(Ne,Qe)|0,A=A+Math.imul(Ne,Ye)|0,_=_+Math.imul(ke,Ke)|0,d=d+Math.imul(ke,Xe)|0,d=d+Math.imul(Re,Ke)|0,A=A+Math.imul(Re,Xe)|0;var Jo=(L+_|0)+((d&8191)<<13)|0;L=(A+(d>>>13)|0)+(Jo>>>26)|0,Jo&=67108863,_=Math.imul($,qe),d=Math.imul($,Ge),d=d+Math.imul(W,qe)|0,A=Math.imul(W,Ge),_=_+Math.imul(f,Je)|0,d=d+Math.imul(f,Ze)|0,d=d+Math.imul(x,Je)|0,A=A+Math.imul(x,Ze)|0,_=_+Math.imul(Ie,Qe)|0,d=d+Math.imul(Ie,Ye)|0,d=d+Math.imul(v,Qe)|0,A=A+Math.imul(v,Ye)|0,_=_+Math.imul(Ce,Ke)|0,d=d+Math.imul(Ce,Xe)|0,d=d+Math.imul(Ne,Ke)|0,A=A+Math.imul(Ne,Xe)|0;var Zo=(L+_|0)+((d&8191)<<13)|0;L=(A+(d>>>13)|0)+(Zo>>>26)|0,Zo&=67108863,_=Math.imul($,Je),d=Math.imul($,Ze),d=d+Math.imul(W,Je)|0,A=Math.imul(W,Ze),_=_+Math.imul(f,Qe)|0,d=d+Math.imul(f,Ye)|0,d=d+Math.imul(x,Qe)|0,A=A+Math.imul(x,Ye)|0,_=_+Math.imul(Ie,Ke)|0,d=d+Math.imul(Ie,Xe)|0,d=d+Math.imul(v,Ke)|0,A=A+Math.imul(v,Xe)|0;var Qo=(L+_|0)+((d&8191)<<13)|0;L=(A+(d>>>13)|0)+(Qo>>>26)|0,Qo&=67108863,_=Math.imul($,Qe),d=Math.imul($,Ye),d=d+Math.imul(W,Qe)|0,A=Math.imul(W,Ye),_=_+Math.imul(f,Ke)|0,d=d+Math.imul(f,Xe)|0,d=d+Math.imul(x,Ke)|0,A=A+Math.imul(x,Xe)|0;var Yo=(L+_|0)+((d&8191)<<13)|0;L=(A+(d>>>13)|0)+(Yo>>>26)|0,Yo&=67108863,_=Math.imul($,Ke),d=Math.imul($,Xe),d=d+Math.imul(W,Ke)|0,A=Math.imul(W,Xe);var Ko=(L+_|0)+((d&8191)<<13)|0;return L=(A+(d>>>13)|0)+(Ko>>>26)|0,Ko&=67108863,k[0]=Dr,k[1]=jr,k[2]=$r,k[3]=Fr,k[4]=Ur,k[5]=Hr,k[6]=Wr,k[7]=Vr,k[8]=zr,k[9]=qr,k[10]=Gr,k[11]=Jr,k[12]=Zr,k[13]=Qr,k[14]=Jo,k[15]=Zo,k[16]=Qo,k[17]=Yo,k[18]=Ko,L!==0&&(k[19]=L,m.length++),m};Math.imul||(N=M);function j(w,u,b){b.negative=u.negative^w.negative,b.length=w.length+u.length;for(var m=0,E=0,S=0;S<b.length-1;S++){var k=E;E=0;for(var L=m&67108863,_=Math.min(S,u.length-1),d=Math.max(0,S-w.length+1);d<=_;d++){var A=S-d,Y=w.words[A]|0,ee=u.words[d]|0,O=Y*ee,P=O&67108863;k=k+(O/67108864|0)|0,P=P+L|0,L=P&67108863,k=k+(P>>>26)|0,E+=k>>>26,k&=67108863}b.words[S]=L,m=k,k=E}return m!==0?b.words[S]=m:b.length--,b._strip()}function H(w,u,b){return j(w,u,b)}s.prototype.mulTo=function(u,b){var m,E=this.length+u.length;return this.length===10&&u.length===10?m=N(this,u,b):E<63?m=M(this,u,b):E<1024?m=j(this,u,b):m=H(this,u,b),m},s.prototype.mul=function(u){var b=new s(null);return b.words=new Array(this.length+u.length),this.mulTo(u,b)},s.prototype.mulf=function(u){var b=new s(null);return b.words=new Array(this.length+u.length),H(this,u,b)},s.prototype.imul=function(u){return this.clone().mulTo(u,this)},s.prototype.imuln=function(u){var b=u<0;b&&(u=-u),n(typeof u=="number"),n(u<67108864);for(var m=0,E=0;E<this.length;E++){var S=(this.words[E]|0)*u,k=(S&67108863)+(m&67108863);m>>=26,m+=S/67108864|0,m+=k>>>26,this.words[E]=k&67108863}return m!==0&&(this.words[E]=m,this.length++),b?this.ineg():this},s.prototype.muln=function(u){return this.clone().imuln(u)},s.prototype.sqr=function(){return this.mul(this)},s.prototype.isqr=function(){return this.imul(this.clone())},s.prototype.pow=function(u){var b=U(u);if(b.length===0)return new s(1);for(var m=this,E=0;E<b.length&&b[E]===0;E++,m=m.sqr());if(++E<b.length)for(var S=m.sqr();E<b.length;E++,S=S.sqr())b[E]!==0&&(m=m.mul(S));return m},s.prototype.iushln=function(u){n(typeof u=="number"&&u>=0);var b=u%26,m=(u-b)/26,E=67108863>>>26-b<<26-b,S;if(b!==0){var k=0;for(S=0;S<this.length;S++){var L=this.words[S]&E,_=(this.words[S]|0)-L<<b;this.words[S]=_|k,k=L>>>26-b}k&&(this.words[S]=k,this.length++)}if(m!==0){for(S=this.length-1;S>=0;S--)this.words[S+m]=this.words[S];for(S=0;S<m;S++)this.words[S]=0;this.length+=m}return this._strip()},s.prototype.ishln=function(u){return n(this.negative===0),this.iushln(u)},s.prototype.iushrn=function(u,b,m){n(typeof u=="number"&&u>=0);var E;b?E=(b-b%26)/26:E=0;var S=u%26,k=Math.min((u-S)/26,this.length),L=67108863^67108863>>>S<<S,_=m;if(E-=k,E=Math.max(0,E),_){for(var d=0;d<k;d++)_.words[d]=this.words[d];_.length=k}if(k!==0)if(this.length>k)for(this.length-=k,d=0;d<this.length;d++)this.words[d]=this.words[d+k];else this.words[0]=0,this.length=1;var A=0;for(d=this.length-1;d>=0&&(A!==0||d>=E);d--){var Y=this.words[d]|0;this.words[d]=A<<26-S|Y>>>S,A=Y&L}return _&&A!==0&&(_.words[_.length++]=A),this.length===0&&(this.words[0]=0,this.length=1),this._strip()},s.prototype.ishrn=function(u,b,m){return n(this.negative===0),this.iushrn(u,b,m)},s.prototype.shln=function(u){return this.clone().ishln(u)},s.prototype.ushln=function(u){return this.clone().iushln(u)},s.prototype.shrn=function(u){return this.clone().ishrn(u)},s.prototype.ushrn=function(u){return this.clone().iushrn(u)},s.prototype.testn=function(u){n(typeof u=="number"&&u>=0);var b=u%26,m=(u-b)/26,E=1<<b;if(this.length<=m)return!1;var S=this.words[m];return!!(S&E)},s.prototype.imaskn=function(u){n(typeof u=="number"&&u>=0);var b=u%26,m=(u-b)/26;if(n(this.negative===0,"imaskn works only with positive numbers"),this.length<=m)return this;if(b!==0&&m++,this.length=Math.min(m,this.length),b!==0){var E=67108863^67108863>>>b<<b;this.words[this.length-1]&=E}return this._strip()},s.prototype.maskn=function(u){return this.clone().imaskn(u)},s.prototype.iaddn=function(u){return n(typeof u=="number"),n(u<67108864),u<0?this.isubn(-u):this.negative!==0?this.length===1&&(this.words[0]|0)<=u?(this.words[0]=u-(this.words[0]|0),this.negative=0,this):(this.negative=0,this.isubn(u),this.negative=1,this):this._iaddn(u)},s.prototype._iaddn=function(u){this.words[0]+=u;for(var b=0;b<this.length&&this.words[b]>=67108864;b++)this.words[b]-=67108864,b===this.length-1?this.words[b+1]=1:this.words[b+1]++;return this.length=Math.max(this.length,b+1),this},s.prototype.isubn=function(u){if(n(typeof u=="number"),n(u<67108864),u<0)return this.iaddn(-u);if(this.negative!==0)return this.negative=0,this.iaddn(u),this.negative=1,this;if(this.words[0]-=u,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var b=0;b<this.length&&this.words[b]<0;b++)this.words[b]+=67108864,this.words[b+1]-=1;return this._strip()},s.prototype.addn=function(u){return this.clone().iaddn(u)},s.prototype.subn=function(u){return this.clone().isubn(u)},s.prototype.iabs=function(){return this.negative=0,this},s.prototype.abs=function(){return this.clone().iabs()},s.prototype._ishlnsubmul=function(u,b,m){var E=u.length+m,S;this._expand(E);var k,L=0;for(S=0;S<u.length;S++){k=(this.words[S+m]|0)+L;var _=(u.words[S]|0)*b;k-=_&67108863,L=(k>>26)-(_/67108864|0),this.words[S+m]=k&67108863}for(;S<this.length-m;S++)k=(this.words[S+m]|0)+L,L=k>>26,this.words[S+m]=k&67108863;if(L===0)return this._strip();for(n(L===-1),L=0,S=0;S<this.length;S++)k=-(this.words[S]|0)+L,L=k>>26,this.words[S]=k&67108863;return this.negative=1,this._strip()},s.prototype._wordDiv=function(u,b){var m=this.length-u.length,E=this.clone(),S=u,k=S.words[S.length-1]|0,L=this._countBits(k);m=26-L,m!==0&&(S=S.ushln(m),E.iushln(m),k=S.words[S.length-1]|0);var _=E.length-S.length,d;if(b!=="mod"){d=new s(null),d.length=_+1,d.words=new Array(d.length);for(var A=0;A<d.length;A++)d.words[A]=0}var Y=E.clone()._ishlnsubmul(S,1,_);Y.negative===0&&(E=Y,d&&(d.words[_]=1));for(var ee=_-1;ee>=0;ee--){var O=(E.words[S.length+ee]|0)*67108864+(E.words[S.length+ee-1]|0);for(O=Math.min(O/k|0,67108863),E._ishlnsubmul(S,O,ee);E.negative!==0;)O--,E.negative=0,E._ishlnsubmul(S,1,ee),E.isZero()||(E.negative^=1);d&&(d.words[ee]=O)}return d&&d._strip(),E._strip(),b!=="div"&&m!==0&&E.iushrn(m),{div:d||null,mod:E}},s.prototype.divmod=function(u,b,m){if(n(!u.isZero()),this.isZero())return{div:new s(0),mod:new s(0)};var E,S,k;return this.negative!==0&&u.negative===0?(k=this.neg().divmod(u,b),b!=="mod"&&(E=k.div.neg()),b!=="div"&&(S=k.mod.neg(),m&&S.negative!==0&&S.iadd(u)),{div:E,mod:S}):this.negative===0&&u.negative!==0?(k=this.divmod(u.neg(),b),b!=="mod"&&(E=k.div.neg()),{div:E,mod:k.mod}):this.negative&u.negative?(k=this.neg().divmod(u.neg(),b),b!=="div"&&(S=k.mod.neg(),m&&S.negative!==0&&S.isub(u)),{div:k.div,mod:S}):u.length>this.length||this.cmp(u)<0?{div:new s(0),mod:this}:u.length===1?b==="div"?{div:this.divn(u.words[0]),mod:null}:b==="mod"?{div:null,mod:new s(this.modrn(u.words[0]))}:{div:this.divn(u.words[0]),mod:new s(this.modrn(u.words[0]))}:this._wordDiv(u,b)},s.prototype.div=function(u){return this.divmod(u,"div",!1).div},s.prototype.mod=function(u){return this.divmod(u,"mod",!1).mod},s.prototype.umod=function(u){return this.divmod(u,"mod",!0).mod},s.prototype.divRound=function(u){var b=this.divmod(u);if(b.mod.isZero())return b.div;var m=b.div.negative!==0?b.mod.isub(u):b.mod,E=u.ushrn(1),S=u.andln(1),k=m.cmp(E);return k<0||S===1&&k===0?b.div:b.div.negative!==0?b.div.isubn(1):b.div.iaddn(1)},s.prototype.modrn=function(u){var b=u<0;b&&(u=-u),n(u<=67108863);for(var m=(1<<26)%u,E=0,S=this.length-1;S>=0;S--)E=(m*E+(this.words[S]|0))%u;return b?-E:E},s.prototype.modn=function(u){return this.modrn(u)},s.prototype.idivn=function(u){var b=u<0;b&&(u=-u),n(u<=67108863);for(var m=0,E=this.length-1;E>=0;E--){var S=(this.words[E]|0)+m*67108864;this.words[E]=S/u|0,m=S%u}return this._strip(),b?this.ineg():this},s.prototype.divn=function(u){return this.clone().idivn(u)},s.prototype.egcd=function(u){n(u.negative===0),n(!u.isZero());var b=this,m=u.clone();b.negative!==0?b=b.umod(u):b=b.clone();for(var E=new s(1),S=new s(0),k=new s(0),L=new s(1),_=0;b.isEven()&&m.isEven();)b.iushrn(1),m.iushrn(1),++_;for(var d=m.clone(),A=b.clone();!b.isZero();){for(var Y=0,ee=1;!(b.words[0]&ee)&&Y<26;++Y,ee<<=1);if(Y>0)for(b.iushrn(Y);Y-- >0;)(E.isOdd()||S.isOdd())&&(E.iadd(d),S.isub(A)),E.iushrn(1),S.iushrn(1);for(var O=0,P=1;!(m.words[0]&P)&&O<26;++O,P<<=1);if(O>0)for(m.iushrn(O);O-- >0;)(k.isOdd()||L.isOdd())&&(k.iadd(d),L.isub(A)),k.iushrn(1),L.iushrn(1);b.cmp(m)>=0?(b.isub(m),E.isub(k),S.isub(L)):(m.isub(b),k.isub(E),L.isub(S))}return{a:k,b:L,gcd:m.iushln(_)}},s.prototype._invmp=function(u){n(u.negative===0),n(!u.isZero());var b=this,m=u.clone();b.negative!==0?b=b.umod(u):b=b.clone();for(var E=new s(1),S=new s(0),k=m.clone();b.cmpn(1)>0&&m.cmpn(1)>0;){for(var L=0,_=1;!(b.words[0]&_)&&L<26;++L,_<<=1);if(L>0)for(b.iushrn(L);L-- >0;)E.isOdd()&&E.iadd(k),E.iushrn(1);for(var d=0,A=1;!(m.words[0]&A)&&d<26;++d,A<<=1);if(d>0)for(m.iushrn(d);d-- >0;)S.isOdd()&&S.iadd(k),S.iushrn(1);b.cmp(m)>=0?(b.isub(m),E.isub(S)):(m.isub(b),S.isub(E))}var Y;return b.cmpn(1)===0?Y=E:Y=S,Y.cmpn(0)<0&&Y.iadd(u),Y},s.prototype.gcd=function(u){if(this.isZero())return u.abs();if(u.isZero())return this.abs();var b=this.clone(),m=u.clone();b.negative=0,m.negative=0;for(var E=0;b.isEven()&&m.isEven();E++)b.iushrn(1),m.iushrn(1);do{for(;b.isEven();)b.iushrn(1);for(;m.isEven();)m.iushrn(1);var S=b.cmp(m);if(S<0){var k=b;b=m,m=k}else if(S===0||m.cmpn(1)===0)break;b.isub(m)}while(!0);return m.iushln(E)},s.prototype.invm=function(u){return this.egcd(u).a.umod(u)},s.prototype.isEven=function(){return(this.words[0]&1)===0},s.prototype.isOdd=function(){return(this.words[0]&1)===1},s.prototype.andln=function(u){return this.words[0]&u},s.prototype.bincn=function(u){n(typeof u=="number");var b=u%26,m=(u-b)/26,E=1<<b;if(this.length<=m)return this._expand(m+1),this.words[m]|=E,this;for(var S=E,k=m;S!==0&&k<this.length;k++){var L=this.words[k]|0;L+=S,S=L>>>26,L&=67108863,this.words[k]=L}return S!==0&&(this.words[k]=S,this.length++),this},s.prototype.isZero=function(){return this.length===1&&this.words[0]===0},s.prototype.cmpn=function(u){var b=u<0;if(this.negative!==0&&!b)return-1;if(this.negative===0&&b)return 1;this._strip();var m;if(this.length>1)m=1;else{b&&(u=-u),n(u<=67108863,"Number is too big");var E=this.words[0]|0;m=E===u?0:E<u?-1:1}return this.negative!==0?-m|0:m},s.prototype.cmp=function(u){if(this.negative!==0&&u.negative===0)return-1;if(this.negative===0&&u.negative!==0)return 1;var b=this.ucmp(u);return this.negative!==0?-b|0:b},s.prototype.ucmp=function(u){if(this.length>u.length)return 1;if(this.length<u.length)return-1;for(var b=0,m=this.length-1;m>=0;m--){var E=this.words[m]|0,S=u.words[m]|0;if(E!==S){E<S?b=-1:E>S&&(b=1);break}}return b},s.prototype.gtn=function(u){return this.cmpn(u)===1},s.prototype.gt=function(u){return this.cmp(u)===1},s.prototype.gten=function(u){return this.cmpn(u)>=0},s.prototype.gte=function(u){return this.cmp(u)>=0},s.prototype.ltn=function(u){return this.cmpn(u)===-1},s.prototype.lt=function(u){return this.cmp(u)===-1},s.prototype.lten=function(u){return this.cmpn(u)<=0},s.prototype.lte=function(u){return this.cmp(u)<=0},s.prototype.eqn=function(u){return this.cmpn(u)===0},s.prototype.eq=function(u){return this.cmp(u)===0},s.red=function(u){return new oe(u)},s.prototype.toRed=function(u){return n(!this.red,"Already a number in reduction context"),n(this.negative===0,"red works only with positives"),u.convertTo(this)._forceRed(u)},s.prototype.fromRed=function(){return n(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},s.prototype._forceRed=function(u){return this.red=u,this},s.prototype.forceRed=function(u){return n(!this.red,"Already a number in reduction context"),this._forceRed(u)},s.prototype.redAdd=function(u){return n(this.red,"redAdd works only with red numbers"),this.red.add(this,u)},s.prototype.redIAdd=function(u){return n(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,u)},s.prototype.redSub=function(u){return n(this.red,"redSub works only with red numbers"),this.red.sub(this,u)},s.prototype.redISub=function(u){return n(this.red,"redISub works only with red numbers"),this.red.isub(this,u)},s.prototype.redShl=function(u){return n(this.red,"redShl works only with red numbers"),this.red.shl(this,u)},s.prototype.redMul=function(u){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,u),this.red.mul(this,u)},s.prototype.redIMul=function(u){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,u),this.red.imul(this,u)},s.prototype.redSqr=function(){return n(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},s.prototype.redISqr=function(){return n(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},s.prototype.redSqrt=function(){return n(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},s.prototype.redInvm=function(){return n(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},s.prototype.redNeg=function(){return n(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},s.prototype.redPow=function(u){return n(this.red&&!u.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,u)};var F={k256:null,p224:null,p192:null,p25519:null};function z(w,u){this.name=w,this.p=new s(u,16),this.n=this.p.bitLength(),this.k=new s(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}z.prototype._tmp=function(){var u=new s(null);return u.words=new Array(Math.ceil(this.n/13)),u},z.prototype.ireduce=function(u){var b=u,m;do this.split(b,this.tmp),b=this.imulK(b),b=b.iadd(this.tmp),m=b.bitLength();while(m>this.n);var E=m<this.n?-1:b.ucmp(this.p);return E===0?(b.words[0]=0,b.length=1):E>0?b.isub(this.p):b.strip!==void 0?b.strip():b._strip(),b},z.prototype.split=function(u,b){u.iushrn(this.n,0,b)},z.prototype.imulK=function(u){return u.imul(this.k)};function X(){z.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}i(X,z),X.prototype.split=function(u,b){for(var m=4194303,E=Math.min(u.length,9),S=0;S<E;S++)b.words[S]=u.words[S];if(b.length=E,u.length<=9){u.words[0]=0,u.length=1;return}var k=u.words[9];for(b.words[b.length++]=k&m,S=10;S<u.length;S++){var L=u.words[S]|0;u.words[S-10]=(L&m)<<4|k>>>22,k=L}k>>>=22,u.words[S-10]=k,k===0&&u.length>10?u.length-=10:u.length-=9},X.prototype.imulK=function(u){u.words[u.length]=0,u.words[u.length+1]=0,u.length+=2;for(var b=0,m=0;m<u.length;m++){var E=u.words[m]|0;b+=E*977,u.words[m]=b&67108863,b=E*64+(b/67108864|0)}return u.words[u.length-1]===0&&(u.length--,u.words[u.length-1]===0&&u.length--),u};function K(){z.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}i(K,z);function J(){z.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}i(J,z);function ne(){z.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}i(ne,z),ne.prototype.imulK=function(u){for(var b=0,m=0;m<u.length;m++){var E=(u.words[m]|0)*19+b,S=E&67108863;E>>>=26,u.words[m]=S,b=E}return b!==0&&(u.words[u.length++]=b),u},s._prime=function(u){if(F[u])return F[u];var b;if(u==="k256")b=new X;else if(u==="p224")b=new K;else if(u==="p192")b=new J;else if(u==="p25519")b=new ne;else throw new Error("Unknown prime "+u);return F[u]=b,b};function oe(w){if(typeof w=="string"){var u=s._prime(w);this.m=u.p,this.prime=u}else n(w.gtn(1),"modulus must be greater than 1"),this.m=w,this.prime=null}oe.prototype._verify1=function(u){n(u.negative===0,"red works only with positives"),n(u.red,"red works only with red numbers")},oe.prototype._verify2=function(u,b){n((u.negative|b.negative)===0,"red works only with positives"),n(u.red&&u.red===b.red,"red works only with red numbers")},oe.prototype.imod=function(u){return this.prime?this.prime.ireduce(u)._forceRed(this):(p(u,u.umod(this.m)._forceRed(this)),u)},oe.prototype.neg=function(u){return u.isZero()?u.clone():this.m.sub(u)._forceRed(this)},oe.prototype.add=function(u,b){this._verify2(u,b);var m=u.add(b);return m.cmp(this.m)>=0&&m.isub(this.m),m._forceRed(this)},oe.prototype.iadd=function(u,b){this._verify2(u,b);var m=u.iadd(b);return m.cmp(this.m)>=0&&m.isub(this.m),m},oe.prototype.sub=function(u,b){this._verify2(u,b);var m=u.sub(b);return m.cmpn(0)<0&&m.iadd(this.m),m._forceRed(this)},oe.prototype.isub=function(u,b){this._verify2(u,b);var m=u.isub(b);return m.cmpn(0)<0&&m.iadd(this.m),m},oe.prototype.shl=function(u,b){return this._verify1(u),this.imod(u.ushln(b))},oe.prototype.imul=function(u,b){return this._verify2(u,b),this.imod(u.imul(b))},oe.prototype.mul=function(u,b){return this._verify2(u,b),this.imod(u.mul(b))},oe.prototype.isqr=function(u){return this.imul(u,u.clone())},oe.prototype.sqr=function(u){return this.mul(u,u)},oe.prototype.sqrt=function(u){if(u.isZero())return u.clone();var b=this.m.andln(3);if(n(b%2===1),b===3){var m=this.m.add(new s(1)).iushrn(2);return this.pow(u,m)}for(var E=this.m.subn(1),S=0;!E.isZero()&&E.andln(1)===0;)S++,E.iushrn(1);n(!E.isZero());var k=new s(1).toRed(this),L=k.redNeg(),_=this.m.subn(1).iushrn(1),d=this.m.bitLength();for(d=new s(2*d*d).toRed(this);this.pow(d,_).cmp(L)!==0;)d.redIAdd(L);for(var A=this.pow(d,E),Y=this.pow(u,E.addn(1).iushrn(1)),ee=this.pow(u,E),O=S;ee.cmp(k)!==0;){for(var P=ee,V=0;P.cmp(k)!==0;V++)P=P.redSqr();n(V<O);var Q=this.pow(A,new s(1).iushln(O-V-1));Y=Y.redMul(Q),A=Q.redSqr(),ee=ee.redMul(A),O=V}return Y},oe.prototype.invm=function(u){var b=u._invmp(this.m);return b.negative!==0?(b.negative=0,this.imod(b).redNeg()):this.imod(b)},oe.prototype.pow=function(u,b){if(b.isZero())return new s(1).toRed(this);if(b.cmpn(1)===0)return u.clone();var m=4,E=new Array(1<<m);E[0]=new s(1).toRed(this),E[1]=u;for(var S=2;S<E.length;S++)E[S]=this.mul(E[S-1],u);var k=E[0],L=0,_=0,d=b.bitLength()%26;for(d===0&&(d=26),S=b.length-1;S>=0;S--){for(var A=b.words[S],Y=d-1;Y>=0;Y--){var ee=A>>Y&1;if(k!==E[0]&&(k=this.sqr(k)),ee===0&&L===0){_=0;continue}L<<=1,L|=ee,_++,!(_!==m&&(S!==0||Y!==0))&&(k=this.mul(k,E[L]),_=0,L=0)}d=26}return k},oe.prototype.convertTo=function(u){var b=u.umod(this.m);return b===u?b.clone():b},oe.prototype.convertFrom=function(u){var b=u.clone();return b.red=null,b},s.mont=function(u){return new ue(u)};function ue(w){oe.call(this,w),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new s(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}i(ue,oe),ue.prototype.convertTo=function(u){return this.imod(u.ushln(this.shift))},ue.prototype.convertFrom=function(u){var b=this.imod(u.mul(this.rinv));return b.red=null,b},ue.prototype.imul=function(u,b){if(u.isZero()||b.isZero())return u.words[0]=0,u.length=1,u;var m=u.imul(b),E=m.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),S=m.isub(E).iushrn(this.shift),k=S;return S.cmp(this.m)>=0?k=S.isub(this.m):S.cmpn(0)<0&&(k=S.iadd(this.m)),k._forceRed(this)},ue.prototype.mul=function(u,b){if(u.isZero()||b.isZero())return new s(0)._forceRed(this);var m=u.mul(b),E=m.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),S=m.isub(E).iushrn(this.shift),k=S;return S.cmp(this.m)>=0?k=S.isub(this.m):S.cmpn(0)<0&&(k=S.iadd(this.m)),k._forceRed(this)},ue.prototype.invm=function(u){var b=this.imod(u._invmp(this.m).mul(this.r2));return b._forceRed(this)}})(t,te)})(lu);var zs=lu.exports,oi={};Object.defineProperty(oi,"__esModule",{value:!0});oi.EVENTS=void 0;oi.EVENTS={STARTED_CONNECTING:"walletlink_sdk.started.connecting",CONNECTED_STATE_CHANGE:"walletlink_sdk.connected",DISCONNECTED:"walletlink_sdk.disconnected",METADATA_DESTROYED:"walletlink_sdk_metadata_destroyed",LINKED:"walletlink_sdk.linked",FAILURE:"walletlink_sdk.generic_failure",SESSION_CONFIG_RECEIVED:"walletlink_sdk.session_config_event_received",ETH_ACCOUNTS_STATE:"walletlink_sdk.eth_accounts_state",SESSION_STATE_CHANGE:"walletlink_sdk.session_state_change",UNLINKED_ERROR_STATE:"walletlink_sdk.unlinked_error_state",SKIPPED_CLEARING_SESSION:"walletlink_sdk.skipped_clearing_session",GENERAL_ERROR:"walletlink_sdk.general_error",WEB3_REQUEST:"walletlink_sdk.web3.request",WEB3_REQUEST_PUBLISHED:"walletlink_sdk.web3.request_published",WEB3_RESPONSE:"walletlink_sdk.web3.response",UNKNOWN_ADDRESS_ENCOUNTERED:"walletlink_sdk.unknown_address_encountered"};var ji={},hu={},kr={},ip=ki;ki.default=ki;ki.stable=xh;ki.stableStringify=xh;var Rs="[...]",Eh="[Circular]",cn=[],on=[];function Sh(){return{depthLimit:Number.MAX_SAFE_INTEGER,edgesLimit:Number.MAX_SAFE_INTEGER}}function ki(t,e,r,n){typeof n>"u"&&(n=Sh()),Da(t,"",0,[],void 0,0,n);var i;try{on.length===0?i=JSON.stringify(t,e,r):i=JSON.stringify(t,Mh(e),r)}catch{return JSON.stringify("[unable to serialize, circular reference is too complex to analyze]")}finally{for(;cn.length!==0;){var s=cn.pop();s.length===4?Object.defineProperty(s[0],s[1],s[3]):s[0][s[1]]=s[2]}}return i}function $n(t,e,r,n){var i=Object.getOwnPropertyDescriptor(n,r);i.get!==void 0?i.configurable?(Object.defineProperty(n,r,{value:t}),cn.push([n,r,e,i])):on.push([e,r,t]):(n[r]=t,cn.push([n,r,e]))}function Da(t,e,r,n,i,s,o){s+=1;var a;if(typeof t=="object"&&t!==null){for(a=0;a<n.length;a++)if(n[a]===t){$n(Eh,t,e,i);return}if(typeof o.depthLimit<"u"&&s>o.depthLimit){$n(Rs,t,e,i);return}if(typeof o.edgesLimit<"u"&&r+1>o.edgesLimit){$n(Rs,t,e,i);return}if(n.push(t),Array.isArray(t))for(a=0;a<t.length;a++)Da(t[a],a,a,n,t,s,o);else{var c=Object.keys(t);for(a=0;a<c.length;a++){var l=c[a];Da(t[l],l,a,n,t,s,o)}}n.pop()}}function sp(t,e){return t<e?-1:t>e?1:0}function xh(t,e,r,n){typeof n>"u"&&(n=Sh());var i=ja(t,"",0,[],void 0,0,n)||t,s;try{on.length===0?s=JSON.stringify(i,e,r):s=JSON.stringify(i,Mh(e),r)}catch{return JSON.stringify("[unable to serialize, circular reference is too complex to analyze]")}finally{for(;cn.length!==0;){var o=cn.pop();o.length===4?Object.defineProperty(o[0],o[1],o[3]):o[0][o[1]]=o[2]}}return s}function ja(t,e,r,n,i,s,o){s+=1;var a;if(typeof t=="object"&&t!==null){for(a=0;a<n.length;a++)if(n[a]===t){$n(Eh,t,e,i);return}try{if(typeof t.toJSON=="function")return}catch{return}if(typeof o.depthLimit<"u"&&s>o.depthLimit){$n(Rs,t,e,i);return}if(typeof o.edgesLimit<"u"&&r+1>o.edgesLimit){$n(Rs,t,e,i);return}if(n.push(t),Array.isArray(t))for(a=0;a<t.length;a++)ja(t[a],a,a,n,t,s,o);else{var c={},l=Object.keys(t).sort(sp);for(a=0;a<l.length;a++){var p=l[a];ja(t[p],p,a,n,t,s,o),c[p]=t[p]}if(typeof i<"u")cn.push([i,e,t]),i[e]=c;else return c}n.pop()}}function Mh(t){return t=typeof t<"u"?t:function(e,r){return r},function(e,r){if(on.length>0)for(var n=0;n<on.length;n++){var i=on[n];if(i[1]===e&&i[0]===r){r=i[2],on.splice(n,1);break}}return t.call(this,e,r)}}Object.defineProperty(kr,"__esModule",{value:!0});kr.EthereumProviderError=kr.EthereumRpcError=void 0;const op=ip;class Ch extends Error{constructor(e,r,n){if(!Number.isInteger(e))throw new Error('"code" must be an integer.');if(!r||typeof r!="string")throw new Error('"message" must be a nonempty string.');super(r),this.code=e,n!==void 0&&(this.data=n)}serialize(){const e={code:this.code,message:this.message};return this.data!==void 0&&(e.data=this.data),this.stack&&(e.stack=this.stack),e}toString(){return op.default(this.serialize(),cp,2)}}kr.EthereumRpcError=Ch;class ap extends Ch{constructor(e,r,n){if(!up(e))throw new Error('"code" must be an integer such that: 1000 <= code <= 4999');super(e,r,n)}}kr.EthereumProviderError=ap;function up(t){return Number.isInteger(t)&&t>=1e3&&t<=4999}function cp(t,e){if(e!=="[Circular]")return e}var fu={},Nr={};Object.defineProperty(Nr,"__esModule",{value:!0});Nr.errorValues=Nr.errorCodes=void 0;Nr.errorCodes={rpc:{invalidInput:-32e3,resourceNotFound:-32001,resourceUnavailable:-32002,transactionRejected:-32003,methodNotSupported:-32004,limitExceeded:-32005,parse:-32700,invalidRequest:-32600,methodNotFound:-32601,invalidParams:-32602,internal:-32603},provider:{userRejectedRequest:4001,unauthorized:4100,unsupportedMethod:4200,disconnected:4900,chainDisconnected:4901}};Nr.errorValues={"-32700":{standard:"JSON RPC 2.0",message:"Invalid JSON was received by the server. An error occurred on the server while parsing the JSON text."},"-32600":{standard:"JSON RPC 2.0",message:"The JSON sent is not a valid Request object."},"-32601":{standard:"JSON RPC 2.0",message:"The method does not exist / is not available."},"-32602":{standard:"JSON RPC 2.0",message:"Invalid method parameter(s)."},"-32603":{standard:"JSON RPC 2.0",message:"Internal JSON-RPC error."},"-32000":{standard:"EIP-1474",message:"Invalid input."},"-32001":{standard:"EIP-1474",message:"Resource not found."},"-32002":{standard:"EIP-1474",message:"Resource unavailable."},"-32003":{standard:"EIP-1474",message:"Transaction rejected."},"-32004":{standard:"EIP-1474",message:"Method not supported."},"-32005":{standard:"EIP-1474",message:"Request limit exceeded."},4001:{standard:"EIP-1193",message:"User rejected the request."},4100:{standard:"EIP-1193",message:"The requested account and/or method has not been authorized by the user."},4200:{standard:"EIP-1193",message:"The requested method is not supported by this Ethereum provider."},4900:{standard:"EIP-1193",message:"The provider is disconnected from all chains."},4901:{standard:"EIP-1193",message:"The provider is disconnected from the specified chain."}};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.serializeError=t.isValidCode=t.getMessageFromCode=t.JSON_RPC_SERVER_ERROR_MESSAGE=void 0;const e=Nr,r=kr,n=e.errorCodes.rpc.internal,i="Unspecified error message. This is a bug, please report it.",s={code:n,message:o(n)};t.JSON_RPC_SERVER_ERROR_MESSAGE="Unspecified server error.";function o(y,I=i){if(Number.isInteger(y)){const T=y.toString();if(g(e.errorValues,T))return e.errorValues[T].message;if(l(y))return t.JSON_RPC_SERVER_ERROR_MESSAGE}return I}t.getMessageFromCode=o;function a(y){if(!Number.isInteger(y))return!1;const I=y.toString();return!!(e.errorValues[I]||l(y))}t.isValidCode=a;function c(y,{fallbackError:I=s,shouldIncludeStack:T=!1}={}){var D,U;if(!I||!Number.isInteger(I.code)||typeof I.message!="string")throw new Error("Must provide fallback error with integer number code and string message.");if(y instanceof r.EthereumRpcError)return y.serialize();const M={};if(y&&typeof y=="object"&&!Array.isArray(y)&&g(y,"code")&&a(y.code)){const j=y;M.code=j.code,j.message&&typeof j.message=="string"?(M.message=j.message,g(j,"data")&&(M.data=j.data)):(M.message=o(M.code),M.data={originalError:p(y)})}else{M.code=I.code;const j=(D=y)===null||D===void 0?void 0:D.message;M.message=j&&typeof j=="string"?j:I.message,M.data={originalError:p(y)}}const N=(U=y)===null||U===void 0?void 0:U.stack;return T&&y&&N&&typeof N=="string"&&(M.stack=N),M}t.serializeError=c;function l(y){return y>=-32099&&y<=-32e3}function p(y){return y&&typeof y=="object"&&!Array.isArray(y)?Object.assign({},y):y}function g(y,I){return Object.prototype.hasOwnProperty.call(y,I)}})(fu);var qs={};Object.defineProperty(qs,"__esModule",{value:!0});qs.ethErrors=void 0;const du=kr,Ih=fu,wt=Nr;qs.ethErrors={rpc:{parse:t=>Pt(wt.errorCodes.rpc.parse,t),invalidRequest:t=>Pt(wt.errorCodes.rpc.invalidRequest,t),invalidParams:t=>Pt(wt.errorCodes.rpc.invalidParams,t),methodNotFound:t=>Pt(wt.errorCodes.rpc.methodNotFound,t),internal:t=>Pt(wt.errorCodes.rpc.internal,t),server:t=>{if(!t||typeof t!="object"||Array.isArray(t))throw new Error("Ethereum RPC Server errors must provide single object argument.");const{code:e}=t;if(!Number.isInteger(e)||e>-32005||e<-32099)throw new Error('"code" must be an integer such that: -32099 <= code <= -32005');return Pt(e,t)},invalidInput:t=>Pt(wt.errorCodes.rpc.invalidInput,t),resourceNotFound:t=>Pt(wt.errorCodes.rpc.resourceNotFound,t),resourceUnavailable:t=>Pt(wt.errorCodes.rpc.resourceUnavailable,t),transactionRejected:t=>Pt(wt.errorCodes.rpc.transactionRejected,t),methodNotSupported:t=>Pt(wt.errorCodes.rpc.methodNotSupported,t),limitExceeded:t=>Pt(wt.errorCodes.rpc.limitExceeded,t)},provider:{userRejectedRequest:t=>mi(wt.errorCodes.provider.userRejectedRequest,t),unauthorized:t=>mi(wt.errorCodes.provider.unauthorized,t),unsupportedMethod:t=>mi(wt.errorCodes.provider.unsupportedMethod,t),disconnected:t=>mi(wt.errorCodes.provider.disconnected,t),chainDisconnected:t=>mi(wt.errorCodes.provider.chainDisconnected,t),custom:t=>{if(!t||typeof t!="object"||Array.isArray(t))throw new Error("Ethereum Provider custom errors must provide single object argument.");const{code:e,message:r,data:n}=t;if(!r||typeof r!="string")throw new Error('"message" must be a nonempty string');return new du.EthereumProviderError(e,r,n)}}};function Pt(t,e){const[r,n]=Rh(e);return new du.EthereumRpcError(t,r||Ih.getMessageFromCode(t),n)}function mi(t,e){const[r,n]=Rh(e);return new du.EthereumProviderError(t,r||Ih.getMessageFromCode(t),n)}function Rh(t){if(t){if(typeof t=="string")return[t];if(typeof t=="object"&&!Array.isArray(t)){const{message:e,data:r}=t;if(e&&typeof e!="string")throw new Error("Must specify string message.");return[e||void 0,r]}}return[]}(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.getMessageFromCode=t.serializeError=t.EthereumProviderError=t.EthereumRpcError=t.ethErrors=t.errorCodes=void 0;const e=kr;Object.defineProperty(t,"EthereumRpcError",{enumerable:!0,get:function(){return e.EthereumRpcError}}),Object.defineProperty(t,"EthereumProviderError",{enumerable:!0,get:function(){return e.EthereumProviderError}});const r=fu;Object.defineProperty(t,"serializeError",{enumerable:!0,get:function(){return r.serializeError}}),Object.defineProperty(t,"getMessageFromCode",{enumerable:!0,get:function(){return r.getMessageFromCode}});const n=qs;Object.defineProperty(t,"ethErrors",{enumerable:!0,get:function(){return n.ethErrors}});const i=Nr;Object.defineProperty(t,"errorCodes",{enumerable:!0,get:function(){return i.errorCodes}})})(hu);var Pe={},Gs={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.Web3Method=void 0,function(e){e.requestEthereumAccounts="requestEthereumAccounts",e.signEthereumMessage="signEthereumMessage",e.signEthereumTransaction="signEthereumTransaction",e.submitEthereumTransaction="submitEthereumTransaction",e.ethereumAddressFromSignedMessage="ethereumAddressFromSignedMessage",e.scanQRCode="scanQRCode",e.generic="generic",e.childRequestEthereumAccounts="childRequestEthereumAccounts",e.addEthereumChain="addEthereumChain",e.switchEthereumChain="switchEthereumChain",e.makeEthereumJSONRPCRequest="makeEthereumJSONRPCRequest",e.watchAsset="watchAsset",e.selectProvider="selectProvider"}(t.Web3Method||(t.Web3Method={}))})(Gs);Object.defineProperty(Pe,"__esModule",{value:!0});Pe.EthereumAddressFromSignedMessageResponse=Pe.SubmitEthereumTransactionResponse=Pe.SignEthereumTransactionResponse=Pe.SignEthereumMessageResponse=Pe.isRequestEthereumAccountsResponse=Pe.SelectProviderResponse=Pe.WatchAssetReponse=Pe.RequestEthereumAccountsResponse=Pe.SwitchEthereumChainResponse=Pe.AddEthereumChainResponse=Pe.isErrorResponse=void 0;const pr=Gs;function lp(t){var e,r;return((e=t)===null||e===void 0?void 0:e.method)!==void 0&&((r=t)===null||r===void 0?void 0:r.errorMessage)!==void 0}Pe.isErrorResponse=lp;function hp(t){return{method:pr.Web3Method.addEthereumChain,result:t}}Pe.AddEthereumChainResponse=hp;function fp(t){return{method:pr.Web3Method.switchEthereumChain,result:t}}Pe.SwitchEthereumChainResponse=fp;function dp(t){return{method:pr.Web3Method.requestEthereumAccounts,result:t}}Pe.RequestEthereumAccountsResponse=dp;function pp(t){return{method:pr.Web3Method.watchAsset,result:t}}Pe.WatchAssetReponse=pp;function gp(t){return{method:pr.Web3Method.selectProvider,result:t}}Pe.SelectProviderResponse=gp;function bp(t){return t&&t.method===pr.Web3Method.requestEthereumAccounts}Pe.isRequestEthereumAccountsResponse=bp;function vp(t){return{method:pr.Web3Method.signEthereumMessage,result:t}}Pe.SignEthereumMessageResponse=vp;function mp(t){return{method:pr.Web3Method.signEthereumTransaction,result:t}}Pe.SignEthereumTransactionResponse=mp;function yp(t){return{method:pr.Web3Method.submitEthereumTransaction,result:t}}Pe.SubmitEthereumTransactionResponse=yp;function _p(t){return{method:pr.Web3Method.ethereumAddressFromSignedMessage,result:t}}Pe.EthereumAddressFromSignedMessageResponse=_p;var ai={};Object.defineProperty(ai,"__esModule",{value:!0});ai.LIB_VERSION=void 0;ai.LIB_VERSION="3.7.2";(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.getErrorCode=t.serializeError=t.standardErrors=t.standardErrorMessage=t.standardErrorCodes=void 0;const e=hu,r=Pe,n=ai;t.standardErrorCodes=Object.freeze(Object.assign(Object.assign({},e.errorCodes),{provider:Object.freeze(Object.assign(Object.assign({},e.errorCodes.provider),{unsupportedChain:4902}))}));function i(p){return p!==void 0?(0,e.getMessageFromCode)(p):"Unknown error"}t.standardErrorMessage=i,t.standardErrors=Object.freeze(Object.assign(Object.assign({},e.ethErrors),{provider:Object.freeze(Object.assign(Object.assign({},e.ethErrors.provider),{unsupportedChain:(p="")=>e.ethErrors.provider.custom({code:t.standardErrorCodes.provider.unsupportedChain,message:`Unrecognized chain ID ${p}. Try adding the chain using wallet_addEthereumChain first.`})}))}));function s(p,g){const y=(0,e.serializeError)(o(p),{shouldIncludeStack:!0}),I=new URL("https://docs.cloud.coinbase.com/wallet-sdk/docs/errors");I.searchParams.set("version",n.LIB_VERSION),I.searchParams.set("code",y.code.toString());const T=a(y.data,g);return T&&I.searchParams.set("method",T),I.searchParams.set("message",y.message),Object.assign(Object.assign({},y),{docUrl:I.href})}t.serializeError=s;function o(p){return typeof p=="string"?{message:p,code:t.standardErrorCodes.rpc.internal}:(0,r.isErrorResponse)(p)?Object.assign(Object.assign({},p),{message:p.errorMessage,code:p.errorCode,data:{method:p.method,result:p.result}}):p}function a(p,g){var y;const I=(y=p)===null||y===void 0?void 0:y.method;if(I)return I;if(g!==void 0)return typeof g=="string"?g:Array.isArray(g)?g.length>0?g[0].method:void 0:g.method}function c(p){var g;if(typeof p=="number")return p;if(l(p))return(g=p.code)!==null&&g!==void 0?g:p.errorCode}t.getErrorCode=c;function l(p){return typeof p=="object"&&p!==null&&(typeof p.code=="number"||typeof p.errorCode=="number")}})(ji);var ui={},Ah={exports:{}},$a={exports:{}};typeof Object.create=="function"?$a.exports=function(e,r){r&&(e.super_=r,e.prototype=Object.create(r.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:$a.exports=function(e,r){if(r){e.super_=r;var n=function(){};n.prototype=r.prototype,e.prototype=new n,e.prototype.constructor=e}};var Xt=$a.exports,Fa={exports:{}},$i={},Js={};Js.byteLength=Sp;Js.toByteArray=Mp;Js.fromByteArray=Rp;var ur=[],$t=[],wp=typeof Uint8Array<"u"?Uint8Array:Array,Xo="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(var Tn=0,Ep=Xo.length;Tn<Ep;++Tn)ur[Tn]=Xo[Tn],$t[Xo.charCodeAt(Tn)]=Tn;$t["-".charCodeAt(0)]=62;$t["_".charCodeAt(0)]=63;function Th(t){var e=t.length;if(e%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=t.indexOf("=");r===-1&&(r=e);var n=r===e?0:4-r%4;return[r,n]}function Sp(t){var e=Th(t),r=e[0],n=e[1];return(r+n)*3/4-n}function xp(t,e,r){return(e+r)*3/4-r}function Mp(t){var e,r=Th(t),n=r[0],i=r[1],s=new wp(xp(t,n,i)),o=0,a=i>0?n-4:n,c;for(c=0;c<a;c+=4)e=$t[t.charCodeAt(c)]<<18|$t[t.charCodeAt(c+1)]<<12|$t[t.charCodeAt(c+2)]<<6|$t[t.charCodeAt(c+3)],s[o++]=e>>16&255,s[o++]=e>>8&255,s[o++]=e&255;return i===2&&(e=$t[t.charCodeAt(c)]<<2|$t[t.charCodeAt(c+1)]>>4,s[o++]=e&255),i===1&&(e=$t[t.charCodeAt(c)]<<10|$t[t.charCodeAt(c+1)]<<4|$t[t.charCodeAt(c+2)]>>2,s[o++]=e>>8&255,s[o++]=e&255),s}function Cp(t){return ur[t>>18&63]+ur[t>>12&63]+ur[t>>6&63]+ur[t&63]}function Ip(t,e,r){for(var n,i=[],s=e;s<r;s+=3)n=(t[s]<<16&16711680)+(t[s+1]<<8&65280)+(t[s+2]&255),i.push(Cp(n));return i.join("")}function Rp(t){for(var e,r=t.length,n=r%3,i=[],s=16383,o=0,a=r-n;o<a;o+=s)i.push(Ip(t,o,o+s>a?a:o+s));return n===1?(e=t[r-1],i.push(ur[e>>2]+ur[e<<4&63]+"==")):n===2&&(e=(t[r-2]<<8)+t[r-1],i.push(ur[e>>10]+ur[e>>4&63]+ur[e<<2&63]+"=")),i.join("")}var pu={};/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */pu.read=function(t,e,r,n,i){var s,o,a=i*8-n-1,c=(1<<a)-1,l=c>>1,p=-7,g=r?i-1:0,y=r?-1:1,I=t[e+g];for(g+=y,s=I&(1<<-p)-1,I>>=-p,p+=a;p>0;s=s*256+t[e+g],g+=y,p-=8);for(o=s&(1<<-p)-1,s>>=-p,p+=n;p>0;o=o*256+t[e+g],g+=y,p-=8);if(s===0)s=1-l;else{if(s===c)return o?NaN:(I?-1:1)*(1/0);o=o+Math.pow(2,n),s=s-l}return(I?-1:1)*o*Math.pow(2,s-n)};pu.write=function(t,e,r,n,i,s){var o,a,c,l=s*8-i-1,p=(1<<l)-1,g=p>>1,y=i===23?Math.pow(2,-24)-Math.pow(2,-77):0,I=n?0:s-1,T=n?1:-1,D=e<0||e===0&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(a=isNaN(e)?1:0,o=p):(o=Math.floor(Math.log(e)/Math.LN2),e*(c=Math.pow(2,-o))<1&&(o--,c*=2),o+g>=1?e+=y/c:e+=y*Math.pow(2,1-g),e*c>=2&&(o++,c/=2),o+g>=p?(a=0,o=p):o+g>=1?(a=(e*c-1)*Math.pow(2,i),o=o+g):(a=e*Math.pow(2,g-1)*Math.pow(2,i),o=0));i>=8;t[r+I]=a&255,I+=T,a/=256,i-=8);for(o=o<<i|a,l+=i;l>0;t[r+I]=o&255,I+=T,o/=256,l-=8);t[r+I-T]|=D*128};/*!
1
+ import{e as au,r as uu,c as te,s as Q0,B as ye,b as Te,g as si,_ as G,a as Us,d as Y0}from"./index-53e9e841.js";function K0(t,e){for(var r=0;r<e.length;r++){const n=e[r];if(typeof n!="string"&&!Array.isArray(n)){for(const i in n)if(i!=="default"&&!(i in t)){const s=Object.getOwnPropertyDescriptor(n,i);s&&Object.defineProperty(t,i,s.get?s:{enumerable:!0,get:()=>n[i]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}var cu={},Ti={},Hs={};Object.defineProperty(Hs,"__esModule",{value:!0});Hs.walletLogo=void 0;const X0=(t,e)=>{let r;switch(t){case"standard":return r=e,`data:image/svg+xml,%3Csvg width='${e}' height='${r}' viewBox='0 0 1024 1024' fill='none' xmlns='http://www.w3.org/2000/svg'%3E %3Crect width='1024' height='1024' fill='%230052FF'/%3E %3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M152 512C152 710.823 313.177 872 512 872C710.823 872 872 710.823 872 512C872 313.177 710.823 152 512 152C313.177 152 152 313.177 152 512ZM420 396C406.745 396 396 406.745 396 420V604C396 617.255 406.745 628 420 628H604C617.255 628 628 617.255 628 604V420C628 406.745 617.255 396 604 396H420Z' fill='white'/%3E %3C/svg%3E `;case"circle":return r=e,`data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='${e}' height='${r}' viewBox='0 0 999.81 999.81'%3E%3Cdefs%3E%3Cstyle%3E.cls-1%7Bfill:%230052fe;%7D.cls-2%7Bfill:%23fefefe;%7D.cls-3%7Bfill:%230152fe;%7D%3C/style%3E%3C/defs%3E%3Cpath class='cls-1' d='M655-115.9h56c.83,1.59,2.36.88,3.56,1a478,478,0,0,1,75.06,10.42C891.4-81.76,978.33-32.58,1049.19,44q116.7,126,131.94,297.61c.38,4.14-.34,8.53,1.78,12.45v59c-1.58.84-.91,2.35-1,3.56a482.05,482.05,0,0,1-10.38,74.05c-24,106.72-76.64,196.76-158.83,268.93s-178.18,112.82-287.2,122.6c-4.83.43-9.86-.25-14.51,1.77H654c-1-1.68-2.69-.91-4.06-1a496.89,496.89,0,0,1-105.9-18.59c-93.54-27.42-172.78-77.59-236.91-150.94Q199.34,590.1,184.87,426.58c-.47-5.19.25-10.56-1.77-15.59V355c1.68-1,.91-2.7,1-4.06a498.12,498.12,0,0,1,18.58-105.9c26-88.75,72.64-164.9,140.6-227.57q126-116.27,297.21-131.61C645.32-114.57,650.35-113.88,655-115.9Zm377.92,500c0-192.44-156.31-349.49-347.56-350.15-194.13-.68-350.94,155.13-352.29,347.42-1.37,194.55,155.51,352.1,348.56,352.47C876.15,734.23,1032.93,577.84,1032.93,384.11Z' transform='translate(-183.1 115.9)'/%3E%3Cpath class='cls-2' d='M1032.93,384.11c0,193.73-156.78,350.12-351.29,349.74-193-.37-349.93-157.92-348.56-352.47C334.43,189.09,491.24,33.28,685.37,34,876.62,34.62,1032.94,191.67,1032.93,384.11ZM683,496.81q43.74,0,87.48,0c15.55,0,25.32-9.72,25.33-25.21q0-87.48,0-175c0-15.83-9.68-25.46-25.59-25.46H595.77c-15.88,0-25.57,9.64-25.58,25.46q0,87.23,0,174.45c0,16.18,9.59,25.7,25.84,25.71Z' transform='translate(-183.1 115.9)'/%3E%3Cpath class='cls-3' d='M683,496.81H596c-16.25,0-25.84-9.53-25.84-25.71q0-87.23,0-174.45c0-15.82,9.7-25.46,25.58-25.46H770.22c15.91,0,25.59,9.63,25.59,25.46q0,87.47,0,175c0,15.49-9.78,25.2-25.33,25.21Q726.74,496.84,683,496.81Z' transform='translate(-183.1 115.9)'/%3E%3C/svg%3E`;case"text":return r=(.1*e).toFixed(2),`data:image/svg+xml,%3Csvg width='${e}' height='${r}' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 528.15 53.64'%3E%3Cdefs%3E%3Cstyle%3E.cls-1%7Bfill:%230052ff;%7D%3C/style%3E%3C/defs%3E%3Ctitle%3ECoinbase_Wordmark_SubBrands_ALL%3C/title%3E%3Cpath class='cls-1' d='M164.45,15a15,15,0,0,0-11.74,5.4V0h-8.64V52.92h8.5V48a15,15,0,0,0,11.88,5.62c10.37,0,18.21-8.21,18.21-19.3S174.67,15,164.45,15Zm-1.3,30.67c-6.19,0-10.73-4.83-10.73-11.31S157,23,163.22,23s10.66,4.82,10.66,11.37S169.34,45.65,163.15,45.65Zm83.31-14.91-6.34-.93c-3-.43-5.18-1.44-5.18-3.82,0-2.59,2.8-3.89,6.62-3.89,4.18,0,6.84,1.8,7.42,4.76h8.35c-.94-7.49-6.7-11.88-15.55-11.88-9.15,0-15.2,4.68-15.2,11.3,0,6.34,4,10,12,11.16l6.33.94c3.1.43,4.83,1.65,4.83,4,0,2.95-3,4.17-7.2,4.17-5.12,0-8-2.09-8.43-5.25h-8.49c.79,7.27,6.48,12.38,16.84,12.38,9.44,0,15.7-4.32,15.7-11.74C258.12,35.28,253.58,31.82,246.46,30.74Zm-27.65-2.3c0-8.06-4.9-13.46-15.27-13.46-9.79,0-15.26,5-16.34,12.6h8.57c.43-3,2.73-5.4,7.63-5.4,4.39,0,6.55,1.94,6.55,4.32,0,3.09-4,3.88-8.85,4.39-6.63.72-14.84,3-14.84,11.66,0,6.7,5,11,12.89,11,6.19,0,10.08-2.59,12-6.7.28,3.67,3,6.05,6.84,6.05h5v-7.7h-4.25Zm-8.5,9.36c0,5-4.32,8.64-9.57,8.64-3.24,0-6-1.37-6-4.25,0-3.67,4.39-4.68,8.42-5.11s6-1.22,7.13-2.88ZM281.09,15c-11.09,0-19.23,8.35-19.23,19.36,0,11.6,8.72,19.3,19.37,19.3,9,0,16.06-5.33,17.86-12.89h-9c-1.3,3.31-4.47,5.19-8.71,5.19-5.55,0-9.72-3.46-10.66-9.51H299.3V33.12C299.3,22.46,291.53,15,281.09,15Zm-9.87,15.26c1.37-5.18,5.26-7.7,9.72-7.7,4.9,0,8.64,2.8,9.51,7.7ZM19.3,23a9.84,9.84,0,0,1,9.5,7h9.14c-1.65-8.93-9-15-18.57-15A19,19,0,0,0,0,34.34c0,11.09,8.28,19.3,19.37,19.3,9.36,0,16.85-6,18.5-15H28.8a9.75,9.75,0,0,1-9.43,7.06c-6.27,0-10.66-4.83-10.66-11.31S13,23,19.3,23Zm41.11-8A19,19,0,0,0,41,34.34c0,11.09,8.28,19.3,19.37,19.3A19,19,0,0,0,79.92,34.27C79.92,23.33,71.64,15,60.41,15Zm.07,30.67c-6.19,0-10.73-4.83-10.73-11.31S54.22,23,60.41,23s10.8,4.89,10.8,11.37S66.67,45.65,60.48,45.65ZM123.41,15c-5.62,0-9.29,2.3-11.45,5.54V15.7h-8.57V52.92H112V32.69C112,27,115.63,23,121,23c5,0,8.06,3.53,8.06,8.64V52.92h8.64V31C137.66,21.6,132.84,15,123.41,15ZM92,.36a5.36,5.36,0,0,0-5.55,5.47,5.55,5.55,0,0,0,11.09,0A5.35,5.35,0,0,0,92,.36Zm-9.72,23h5.4V52.92h8.64V15.7h-14Zm298.17-7.7L366.2,52.92H372L375.29,44H392l3.33,8.88h6L386.87,15.7ZM377,39.23l6.45-17.56h.1l6.56,17.56ZM362.66,15.7l-7.88,29h-.11l-8.14-29H341l-8,28.93h-.1l-8-28.87H319L329.82,53h5.45l8.19-29.24h.11L352,53h5.66L368.1,15.7Zm135.25,0v4.86h12.32V52.92h5.6V20.56h12.32V15.7ZM467.82,52.92h25.54V48.06H473.43v-12h18.35V31.35H473.43V20.56h19.93V15.7H467.82ZM443,15.7h-5.6V52.92h24.32V48.06H443Zm-30.45,0h-5.61V52.92h24.32V48.06H412.52Z'/%3E%3C/svg%3E`;case"textWithLogo":return r=(.25*e).toFixed(2),`data:image/svg+xml,%3Csvg width='${e}' height='${r}' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 308.44 77.61'%3E%3Cdefs%3E%3Cstyle%3E.cls-1%7Bfill:%230052ff;%7D%3C/style%3E%3C/defs%3E%3Cpath class='cls-1' d='M142.94,20.2l-7.88,29H135l-8.15-29h-5.55l-8,28.93h-.11l-8-28.87H99.27l10.84,37.27h5.44l8.2-29.24h.1l8.41,29.24h5.66L148.39,20.2Zm17.82,0L146.48,57.42h5.82l3.28-8.88h16.65l3.34,8.88h6L167.16,20.2Zm-3.44,23.52,6.45-17.55h.11l6.56,17.55ZM278.2,20.2v4.86h12.32V57.42h5.6V25.06h12.32V20.2ZM248.11,57.42h25.54V52.55H253.71V40.61h18.35V35.85H253.71V25.06h19.94V20.2H248.11ZM223.26,20.2h-5.61V57.42H242V52.55H223.26Zm-30.46,0h-5.6V57.42h24.32V52.55H192.8Zm-154,38A19.41,19.41,0,1,1,57.92,35.57H77.47a38.81,38.81,0,1,0,0,6.47H57.92A19.39,19.39,0,0,1,38.81,58.21Z'/%3E%3C/svg%3E`;case"textLight":return r=(.1*e).toFixed(2),`data:image/svg+xml,%3Csvg width='${e}' height='${r}' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 528.15 53.64'%3E%3Cdefs%3E%3Cstyle%3E.cls-1%7Bfill:%23fefefe;%7D%3C/style%3E%3C/defs%3E%3Ctitle%3ECoinbase_Wordmark_SubBrands_ALL%3C/title%3E%3Cpath class='cls-1' d='M164.45,15a15,15,0,0,0-11.74,5.4V0h-8.64V52.92h8.5V48a15,15,0,0,0,11.88,5.62c10.37,0,18.21-8.21,18.21-19.3S174.67,15,164.45,15Zm-1.3,30.67c-6.19,0-10.73-4.83-10.73-11.31S157,23,163.22,23s10.66,4.82,10.66,11.37S169.34,45.65,163.15,45.65Zm83.31-14.91-6.34-.93c-3-.43-5.18-1.44-5.18-3.82,0-2.59,2.8-3.89,6.62-3.89,4.18,0,6.84,1.8,7.42,4.76h8.35c-.94-7.49-6.7-11.88-15.55-11.88-9.15,0-15.2,4.68-15.2,11.3,0,6.34,4,10,12,11.16l6.33.94c3.1.43,4.83,1.65,4.83,4,0,2.95-3,4.17-7.2,4.17-5.12,0-8-2.09-8.43-5.25h-8.49c.79,7.27,6.48,12.38,16.84,12.38,9.44,0,15.7-4.32,15.7-11.74C258.12,35.28,253.58,31.82,246.46,30.74Zm-27.65-2.3c0-8.06-4.9-13.46-15.27-13.46-9.79,0-15.26,5-16.34,12.6h8.57c.43-3,2.73-5.4,7.63-5.4,4.39,0,6.55,1.94,6.55,4.32,0,3.09-4,3.88-8.85,4.39-6.63.72-14.84,3-14.84,11.66,0,6.7,5,11,12.89,11,6.19,0,10.08-2.59,12-6.7.28,3.67,3,6.05,6.84,6.05h5v-7.7h-4.25Zm-8.5,9.36c0,5-4.32,8.64-9.57,8.64-3.24,0-6-1.37-6-4.25,0-3.67,4.39-4.68,8.42-5.11s6-1.22,7.13-2.88ZM281.09,15c-11.09,0-19.23,8.35-19.23,19.36,0,11.6,8.72,19.3,19.37,19.3,9,0,16.06-5.33,17.86-12.89h-9c-1.3,3.31-4.47,5.19-8.71,5.19-5.55,0-9.72-3.46-10.66-9.51H299.3V33.12C299.3,22.46,291.53,15,281.09,15Zm-9.87,15.26c1.37-5.18,5.26-7.7,9.72-7.7,4.9,0,8.64,2.8,9.51,7.7ZM19.3,23a9.84,9.84,0,0,1,9.5,7h9.14c-1.65-8.93-9-15-18.57-15A19,19,0,0,0,0,34.34c0,11.09,8.28,19.3,19.37,19.3,9.36,0,16.85-6,18.5-15H28.8a9.75,9.75,0,0,1-9.43,7.06c-6.27,0-10.66-4.83-10.66-11.31S13,23,19.3,23Zm41.11-8A19,19,0,0,0,41,34.34c0,11.09,8.28,19.3,19.37,19.3A19,19,0,0,0,79.92,34.27C79.92,23.33,71.64,15,60.41,15Zm.07,30.67c-6.19,0-10.73-4.83-10.73-11.31S54.22,23,60.41,23s10.8,4.89,10.8,11.37S66.67,45.65,60.48,45.65ZM123.41,15c-5.62,0-9.29,2.3-11.45,5.54V15.7h-8.57V52.92H112V32.69C112,27,115.63,23,121,23c5,0,8.06,3.53,8.06,8.64V52.92h8.64V31C137.66,21.6,132.84,15,123.41,15ZM92,.36a5.36,5.36,0,0,0-5.55,5.47,5.55,5.55,0,0,0,11.09,0A5.35,5.35,0,0,0,92,.36Zm-9.72,23h5.4V52.92h8.64V15.7h-14Zm298.17-7.7L366.2,52.92H372L375.29,44H392l3.33,8.88h6L386.87,15.7ZM377,39.23l6.45-17.56h.1l6.56,17.56ZM362.66,15.7l-7.88,29h-.11l-8.14-29H341l-8,28.93h-.1l-8-28.87H319L329.82,53h5.45l8.19-29.24h.11L352,53h5.66L368.1,15.7Zm135.25,0v4.86h12.32V52.92h5.6V20.56h12.32V15.7ZM467.82,52.92h25.54V48.06H473.43v-12h18.35V31.35H473.43V20.56h19.93V15.7H467.82ZM443,15.7h-5.6V52.92h24.32V48.06H443Zm-30.45,0h-5.61V52.92h24.32V48.06H412.52Z'/%3E%3C/svg%3E`;case"textWithLogoLight":return r=(.25*e).toFixed(2),`data:image/svg+xml,%3Csvg width='${e}' height='${r}' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 308.44 77.61'%3E%3Cdefs%3E%3Cstyle%3E.cls-1%7Bfill:%23fefefe;%7D%3C/style%3E%3C/defs%3E%3Cpath class='cls-1' d='M142.94,20.2l-7.88,29H135l-8.15-29h-5.55l-8,28.93h-.11l-8-28.87H99.27l10.84,37.27h5.44l8.2-29.24h.1l8.41,29.24h5.66L148.39,20.2Zm17.82,0L146.48,57.42h5.82l3.28-8.88h16.65l3.34,8.88h6L167.16,20.2Zm-3.44,23.52,6.45-17.55h.11l6.56,17.55ZM278.2,20.2v4.86h12.32V57.42h5.6V25.06h12.32V20.2ZM248.11,57.42h25.54V52.55H253.71V40.61h18.35V35.85H253.71V25.06h19.94V20.2H248.11ZM223.26,20.2h-5.61V57.42H242V52.55H223.26Zm-30.46,0h-5.6V57.42h24.32V52.55H192.8Zm-154,38A19.41,19.41,0,1,1,57.92,35.57H77.47a38.81,38.81,0,1,0,0,6.47H57.92A19.39,19.39,0,0,1,38.81,58.21Z'/%3E%3C/svg%3E`;default:return r=e,`data:image/svg+xml,%3Csvg width='${e}' height='${r}' viewBox='0 0 1024 1024' fill='none' xmlns='http://www.w3.org/2000/svg'%3E %3Crect width='1024' height='1024' fill='%230052FF'/%3E %3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M152 512C152 710.823 313.177 872 512 872C710.823 872 872 710.823 872 512C872 313.177 710.823 152 512 152C313.177 152 152 313.177 152 512ZM420 396C406.745 396 396 406.745 396 420V604C396 617.255 406.745 628 420 628H604C617.255 628 628 617.255 628 604V420C628 406.745 617.255 396 604 396H420Z' fill='white'/%3E %3C/svg%3E `}};Hs.walletLogo=X0;var Ws={};Object.defineProperty(Ws,"__esModule",{value:!0});Ws.LINK_API_URL=void 0;Ws.LINK_API_URL="https://www.walletlink.org";var Vs={};Object.defineProperty(Vs,"__esModule",{value:!0});Vs.ScopedLocalStorage=void 0;class ep{constructor(e){this.scope=e}setItem(e,r){localStorage.setItem(this.scopedKey(e),r)}getItem(e){return localStorage.getItem(this.scopedKey(e))}removeItem(e){localStorage.removeItem(this.scopedKey(e))}clear(){const e=this.scopedKey(""),r=[];for(let n=0;n<localStorage.length;n++){const i=localStorage.key(n);typeof i=="string"&&i.startsWith(e)&&r.push(i)}r.forEach(n=>localStorage.removeItem(n))}scopedKey(e){return`${this.scope}:${e}`}}Vs.ScopedLocalStorage=ep;var zn={},pn={};Object.defineProperty(pn,"__esModule",{value:!0});const tp=au;function vc(t,e,r){try{Reflect.apply(t,e,r)}catch(n){setTimeout(()=>{throw n})}}function rp(t){const e=t.length,r=new Array(e);for(let n=0;n<e;n+=1)r[n]=t[n];return r}let np=class extends tp.EventEmitter{emit(e,...r){let n=e==="error";const i=this._events;if(i!==void 0)n=n&&i.error===void 0;else if(!n)return!1;if(n){let o;if(r.length>0&&([o]=r),o instanceof Error)throw o;const a=new Error(`Unhandled error.${o?` (${o.message})`:""}`);throw a.context=o,a}const s=i[e];if(s===void 0)return!1;if(typeof s=="function")vc(s,this,r);else{const o=s.length,a=rp(s);for(let c=0;c<o;c+=1)vc(a[c],this,r)}return!0}};pn.default=np;var lu={exports:{}};lu.exports;(function(t){(function(e,r){function n(w,u){if(!w)throw new Error(u||"Assertion failed")}function i(w,u){w.super_=u;var b=function(){};b.prototype=u.prototype,w.prototype=new b,w.prototype.constructor=w}function s(w,u,b){if(s.isBN(w))return w;this.negative=0,this.words=null,this.length=0,this.red=null,w!==null&&((u==="le"||u==="be")&&(b=u,u=10),this._init(w||0,u||10,b||"be"))}typeof e=="object"?e.exports=s:r.BN=s,s.BN=s,s.wordSize=26;var o;try{typeof window<"u"&&typeof window.Buffer<"u"?o=window.Buffer:o=uu.Buffer}catch{}s.isBN=function(u){return u instanceof s?!0:u!==null&&typeof u=="object"&&u.constructor.wordSize===s.wordSize&&Array.isArray(u.words)},s.max=function(u,b){return u.cmp(b)>0?u:b},s.min=function(u,b){return u.cmp(b)<0?u:b},s.prototype._init=function(u,b,m){if(typeof u=="number")return this._initNumber(u,b,m);if(typeof u=="object")return this._initArray(u,b,m);b==="hex"&&(b=16),n(b===(b|0)&&b>=2&&b<=36),u=u.toString().replace(/\s+/g,"");var E=0;u[0]==="-"&&(E++,this.negative=1),E<u.length&&(b===16?this._parseHex(u,E,m):(this._parseBase(u,b,E),m==="le"&&this._initArray(this.toArray(),b,m)))},s.prototype._initNumber=function(u,b,m){u<0&&(this.negative=1,u=-u),u<67108864?(this.words=[u&67108863],this.length=1):u<4503599627370496?(this.words=[u&67108863,u/67108864&67108863],this.length=2):(n(u<9007199254740992),this.words=[u&67108863,u/67108864&67108863,1],this.length=3),m==="le"&&this._initArray(this.toArray(),b,m)},s.prototype._initArray=function(u,b,m){if(n(typeof u.length=="number"),u.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(u.length/3),this.words=new Array(this.length);for(var E=0;E<this.length;E++)this.words[E]=0;var S,k,L=0;if(m==="be")for(E=u.length-1,S=0;E>=0;E-=3)k=u[E]|u[E-1]<<8|u[E-2]<<16,this.words[S]|=k<<L&67108863,this.words[S+1]=k>>>26-L&67108863,L+=24,L>=26&&(L-=26,S++);else if(m==="le")for(E=0,S=0;E<u.length;E+=3)k=u[E]|u[E+1]<<8|u[E+2]<<16,this.words[S]|=k<<L&67108863,this.words[S+1]=k>>>26-L&67108863,L+=24,L>=26&&(L-=26,S++);return this._strip()};function a(w,u){var b=w.charCodeAt(u);if(b>=48&&b<=57)return b-48;if(b>=65&&b<=70)return b-55;if(b>=97&&b<=102)return b-87;n(!1,"Invalid character in "+w)}function c(w,u,b){var m=a(w,b);return b-1>=u&&(m|=a(w,b-1)<<4),m}s.prototype._parseHex=function(u,b,m){this.length=Math.ceil((u.length-b)/6),this.words=new Array(this.length);for(var E=0;E<this.length;E++)this.words[E]=0;var S=0,k=0,L;if(m==="be")for(E=u.length-1;E>=b;E-=2)L=c(u,b,E)<<S,this.words[k]|=L&67108863,S>=18?(S-=18,k+=1,this.words[k]|=L>>>26):S+=8;else{var _=u.length-b;for(E=_%2===0?b+1:b;E<u.length;E+=2)L=c(u,b,E)<<S,this.words[k]|=L&67108863,S>=18?(S-=18,k+=1,this.words[k]|=L>>>26):S+=8}this._strip()};function l(w,u,b,m){for(var E=0,S=0,k=Math.min(w.length,b),L=u;L<k;L++){var _=w.charCodeAt(L)-48;E*=m,_>=49?S=_-49+10:_>=17?S=_-17+10:S=_,n(_>=0&&S<m,"Invalid character"),E+=S}return E}s.prototype._parseBase=function(u,b,m){this.words=[0],this.length=1;for(var E=0,S=1;S<=67108863;S*=b)E++;E--,S=S/b|0;for(var k=u.length-m,L=k%E,_=Math.min(k,k-L)+m,d=0,A=m;A<_;A+=E)d=l(u,A,A+E,b),this.imuln(S),this.words[0]+d<67108864?this.words[0]+=d:this._iaddn(d);if(L!==0){var Y=1;for(d=l(u,A,u.length,b),A=0;A<L;A++)Y*=b;this.imuln(Y),this.words[0]+d<67108864?this.words[0]+=d:this._iaddn(d)}this._strip()},s.prototype.copy=function(u){u.words=new Array(this.length);for(var b=0;b<this.length;b++)u.words[b]=this.words[b];u.length=this.length,u.negative=this.negative,u.red=this.red};function p(w,u){w.words=u.words,w.length=u.length,w.negative=u.negative,w.red=u.red}if(s.prototype._move=function(u){p(u,this)},s.prototype.clone=function(){var u=new s(null);return this.copy(u),u},s.prototype._expand=function(u){for(;this.length<u;)this.words[this.length++]=0;return this},s.prototype._strip=function(){for(;this.length>1&&this.words[this.length-1]===0;)this.length--;return this._normSign()},s.prototype._normSign=function(){return this.length===1&&this.words[0]===0&&(this.negative=0),this},typeof Symbol<"u"&&typeof Symbol.for=="function")try{s.prototype[Symbol.for("nodejs.util.inspect.custom")]=g}catch{s.prototype.inspect=g}else s.prototype.inspect=g;function g(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"}var y=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],I=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],T=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];s.prototype.toString=function(u,b){u=u||10,b=b|0||1;var m;if(u===16||u==="hex"){m="";for(var E=0,S=0,k=0;k<this.length;k++){var L=this.words[k],_=((L<<E|S)&16777215).toString(16);S=L>>>24-E&16777215,E+=2,E>=26&&(E-=26,k--),S!==0||k!==this.length-1?m=y[6-_.length]+_+m:m=_+m}for(S!==0&&(m=S.toString(16)+m);m.length%b!==0;)m="0"+m;return this.negative!==0&&(m="-"+m),m}if(u===(u|0)&&u>=2&&u<=36){var d=I[u],A=T[u];m="";var Y=this.clone();for(Y.negative=0;!Y.isZero();){var ee=Y.modrn(A).toString(u);Y=Y.idivn(A),Y.isZero()?m=ee+m:m=y[d-ee.length]+ee+m}for(this.isZero()&&(m="0"+m);m.length%b!==0;)m="0"+m;return this.negative!==0&&(m="-"+m),m}n(!1,"Base should be between 2 and 36")},s.prototype.toNumber=function(){var u=this.words[0];return this.length===2?u+=this.words[1]*67108864:this.length===3&&this.words[2]===1?u+=4503599627370496+this.words[1]*67108864:this.length>2&&n(!1,"Number can only safely store up to 53 bits"),this.negative!==0?-u:u},s.prototype.toJSON=function(){return this.toString(16,2)},o&&(s.prototype.toBuffer=function(u,b){return this.toArrayLike(o,u,b)}),s.prototype.toArray=function(u,b){return this.toArrayLike(Array,u,b)};var D=function(u,b){return u.allocUnsafe?u.allocUnsafe(b):new u(b)};s.prototype.toArrayLike=function(u,b,m){this._strip();var E=this.byteLength(),S=m||Math.max(1,E);n(E<=S,"byte array longer than desired length"),n(S>0,"Requested array length <= 0");var k=D(u,S),L=b==="le"?"LE":"BE";return this["_toArrayLike"+L](k,E),k},s.prototype._toArrayLikeLE=function(u,b){for(var m=0,E=0,S=0,k=0;S<this.length;S++){var L=this.words[S]<<k|E;u[m++]=L&255,m<u.length&&(u[m++]=L>>8&255),m<u.length&&(u[m++]=L>>16&255),k===6?(m<u.length&&(u[m++]=L>>24&255),E=0,k=0):(E=L>>>24,k+=2)}if(m<u.length)for(u[m++]=E;m<u.length;)u[m++]=0},s.prototype._toArrayLikeBE=function(u,b){for(var m=u.length-1,E=0,S=0,k=0;S<this.length;S++){var L=this.words[S]<<k|E;u[m--]=L&255,m>=0&&(u[m--]=L>>8&255),m>=0&&(u[m--]=L>>16&255),k===6?(m>=0&&(u[m--]=L>>24&255),E=0,k=0):(E=L>>>24,k+=2)}if(m>=0)for(u[m--]=E;m>=0;)u[m--]=0},Math.clz32?s.prototype._countBits=function(u){return 32-Math.clz32(u)}:s.prototype._countBits=function(u){var b=u,m=0;return b>=4096&&(m+=13,b>>>=13),b>=64&&(m+=7,b>>>=7),b>=8&&(m+=4,b>>>=4),b>=2&&(m+=2,b>>>=2),m+b},s.prototype._zeroBits=function(u){if(u===0)return 26;var b=u,m=0;return b&8191||(m+=13,b>>>=13),b&127||(m+=7,b>>>=7),b&15||(m+=4,b>>>=4),b&3||(m+=2,b>>>=2),b&1||m++,m},s.prototype.bitLength=function(){var u=this.words[this.length-1],b=this._countBits(u);return(this.length-1)*26+b};function U(w){for(var u=new Array(w.bitLength()),b=0;b<u.length;b++){var m=b/26|0,E=b%26;u[b]=w.words[m]>>>E&1}return u}s.prototype.zeroBits=function(){if(this.isZero())return 0;for(var u=0,b=0;b<this.length;b++){var m=this._zeroBits(this.words[b]);if(u+=m,m!==26)break}return u},s.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},s.prototype.toTwos=function(u){return this.negative!==0?this.abs().inotn(u).iaddn(1):this.clone()},s.prototype.fromTwos=function(u){return this.testn(u-1)?this.notn(u).iaddn(1).ineg():this.clone()},s.prototype.isNeg=function(){return this.negative!==0},s.prototype.neg=function(){return this.clone().ineg()},s.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},s.prototype.iuor=function(u){for(;this.length<u.length;)this.words[this.length++]=0;for(var b=0;b<u.length;b++)this.words[b]=this.words[b]|u.words[b];return this._strip()},s.prototype.ior=function(u){return n((this.negative|u.negative)===0),this.iuor(u)},s.prototype.or=function(u){return this.length>u.length?this.clone().ior(u):u.clone().ior(this)},s.prototype.uor=function(u){return this.length>u.length?this.clone().iuor(u):u.clone().iuor(this)},s.prototype.iuand=function(u){var b;this.length>u.length?b=u:b=this;for(var m=0;m<b.length;m++)this.words[m]=this.words[m]&u.words[m];return this.length=b.length,this._strip()},s.prototype.iand=function(u){return n((this.negative|u.negative)===0),this.iuand(u)},s.prototype.and=function(u){return this.length>u.length?this.clone().iand(u):u.clone().iand(this)},s.prototype.uand=function(u){return this.length>u.length?this.clone().iuand(u):u.clone().iuand(this)},s.prototype.iuxor=function(u){var b,m;this.length>u.length?(b=this,m=u):(b=u,m=this);for(var E=0;E<m.length;E++)this.words[E]=b.words[E]^m.words[E];if(this!==b)for(;E<b.length;E++)this.words[E]=b.words[E];return this.length=b.length,this._strip()},s.prototype.ixor=function(u){return n((this.negative|u.negative)===0),this.iuxor(u)},s.prototype.xor=function(u){return this.length>u.length?this.clone().ixor(u):u.clone().ixor(this)},s.prototype.uxor=function(u){return this.length>u.length?this.clone().iuxor(u):u.clone().iuxor(this)},s.prototype.inotn=function(u){n(typeof u=="number"&&u>=0);var b=Math.ceil(u/26)|0,m=u%26;this._expand(b),m>0&&b--;for(var E=0;E<b;E++)this.words[E]=~this.words[E]&67108863;return m>0&&(this.words[E]=~this.words[E]&67108863>>26-m),this._strip()},s.prototype.notn=function(u){return this.clone().inotn(u)},s.prototype.setn=function(u,b){n(typeof u=="number"&&u>=0);var m=u/26|0,E=u%26;return this._expand(m+1),b?this.words[m]=this.words[m]|1<<E:this.words[m]=this.words[m]&~(1<<E),this._strip()},s.prototype.iadd=function(u){var b;if(this.negative!==0&&u.negative===0)return this.negative=0,b=this.isub(u),this.negative^=1,this._normSign();if(this.negative===0&&u.negative!==0)return u.negative=0,b=this.isub(u),u.negative=1,b._normSign();var m,E;this.length>u.length?(m=this,E=u):(m=u,E=this);for(var S=0,k=0;k<E.length;k++)b=(m.words[k]|0)+(E.words[k]|0)+S,this.words[k]=b&67108863,S=b>>>26;for(;S!==0&&k<m.length;k++)b=(m.words[k]|0)+S,this.words[k]=b&67108863,S=b>>>26;if(this.length=m.length,S!==0)this.words[this.length]=S,this.length++;else if(m!==this)for(;k<m.length;k++)this.words[k]=m.words[k];return this},s.prototype.add=function(u){var b;return u.negative!==0&&this.negative===0?(u.negative=0,b=this.sub(u),u.negative^=1,b):u.negative===0&&this.negative!==0?(this.negative=0,b=u.sub(this),this.negative=1,b):this.length>u.length?this.clone().iadd(u):u.clone().iadd(this)},s.prototype.isub=function(u){if(u.negative!==0){u.negative=0;var b=this.iadd(u);return u.negative=1,b._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(u),this.negative=1,this._normSign();var m=this.cmp(u);if(m===0)return this.negative=0,this.length=1,this.words[0]=0,this;var E,S;m>0?(E=this,S=u):(E=u,S=this);for(var k=0,L=0;L<S.length;L++)b=(E.words[L]|0)-(S.words[L]|0)+k,k=b>>26,this.words[L]=b&67108863;for(;k!==0&&L<E.length;L++)b=(E.words[L]|0)+k,k=b>>26,this.words[L]=b&67108863;if(k===0&&L<E.length&&E!==this)for(;L<E.length;L++)this.words[L]=E.words[L];return this.length=Math.max(this.length,L),E!==this&&(this.negative=1),this._strip()},s.prototype.sub=function(u){return this.clone().isub(u)};function M(w,u,b){b.negative=u.negative^w.negative;var m=w.length+u.length|0;b.length=m,m=m-1|0;var E=w.words[0]|0,S=u.words[0]|0,k=E*S,L=k&67108863,_=k/67108864|0;b.words[0]=L;for(var d=1;d<m;d++){for(var A=_>>>26,Y=_&67108863,ee=Math.min(d,u.length-1),O=Math.max(0,d-w.length+1);O<=ee;O++){var P=d-O|0;E=w.words[P]|0,S=u.words[O]|0,k=E*S+Y,A+=k/67108864|0,Y=k&67108863}b.words[d]=Y|0,_=A|0}return _!==0?b.words[d]=_|0:b.length--,b._strip()}var N=function(u,b,m){var E=u.words,S=b.words,k=m.words,L=0,_,d,A,Y=E[0]|0,ee=Y&8191,O=Y>>>13,P=E[1]|0,V=P&8191,Q=P>>>13,ge=E[2]|0,C=ge&8191,R=ge>>>13,q=E[3]|0,Z=q&8191,he=q>>>13,be=E[4]|0,se=be&8191,xe=be>>>13,Bt=E[5]|0,ke=Bt&8191,Re=Bt>>>13,ct=E[6]|0,Ce=ct&8191,Ne=ct>>>13,ft=E[7]|0,Ie=ft&8191,v=ft>>>13,h=E[8]|0,f=h&8191,x=h>>>13,B=E[9]|0,$=B&8191,W=B>>>13,de=S[0]|0,fe=de&8191,ce=de>>>13,Oe=S[1]|0,ae=Oe&8191,De=Oe>>>13,En=S[2]|0,je=En&8191,$e=En>>>13,Sn=S[3]|0,Fe=Sn&8191,Ue=Sn>>>13,xn=S[4]|0,He=xn&8191,We=xn>>>13,Mn=S[5]|0,Ve=Mn&8191,ze=Mn>>>13,Cn=S[6]|0,qe=Cn&8191,Ge=Cn>>>13,In=S[7]|0,Je=In&8191,Ze=In>>>13,Rn=S[8]|0,Qe=Rn&8191,Ye=Rn>>>13,An=S[9]|0,Ke=An&8191,Xe=An>>>13;m.negative=u.negative^b.negative,m.length=19,_=Math.imul(ee,fe),d=Math.imul(ee,ce),d=d+Math.imul(O,fe)|0,A=Math.imul(O,ce);var Dr=(L+_|0)+((d&8191)<<13)|0;L=(A+(d>>>13)|0)+(Dr>>>26)|0,Dr&=67108863,_=Math.imul(V,fe),d=Math.imul(V,ce),d=d+Math.imul(Q,fe)|0,A=Math.imul(Q,ce),_=_+Math.imul(ee,ae)|0,d=d+Math.imul(ee,De)|0,d=d+Math.imul(O,ae)|0,A=A+Math.imul(O,De)|0;var jr=(L+_|0)+((d&8191)<<13)|0;L=(A+(d>>>13)|0)+(jr>>>26)|0,jr&=67108863,_=Math.imul(C,fe),d=Math.imul(C,ce),d=d+Math.imul(R,fe)|0,A=Math.imul(R,ce),_=_+Math.imul(V,ae)|0,d=d+Math.imul(V,De)|0,d=d+Math.imul(Q,ae)|0,A=A+Math.imul(Q,De)|0,_=_+Math.imul(ee,je)|0,d=d+Math.imul(ee,$e)|0,d=d+Math.imul(O,je)|0,A=A+Math.imul(O,$e)|0;var $r=(L+_|0)+((d&8191)<<13)|0;L=(A+(d>>>13)|0)+($r>>>26)|0,$r&=67108863,_=Math.imul(Z,fe),d=Math.imul(Z,ce),d=d+Math.imul(he,fe)|0,A=Math.imul(he,ce),_=_+Math.imul(C,ae)|0,d=d+Math.imul(C,De)|0,d=d+Math.imul(R,ae)|0,A=A+Math.imul(R,De)|0,_=_+Math.imul(V,je)|0,d=d+Math.imul(V,$e)|0,d=d+Math.imul(Q,je)|0,A=A+Math.imul(Q,$e)|0,_=_+Math.imul(ee,Fe)|0,d=d+Math.imul(ee,Ue)|0,d=d+Math.imul(O,Fe)|0,A=A+Math.imul(O,Ue)|0;var Fr=(L+_|0)+((d&8191)<<13)|0;L=(A+(d>>>13)|0)+(Fr>>>26)|0,Fr&=67108863,_=Math.imul(se,fe),d=Math.imul(se,ce),d=d+Math.imul(xe,fe)|0,A=Math.imul(xe,ce),_=_+Math.imul(Z,ae)|0,d=d+Math.imul(Z,De)|0,d=d+Math.imul(he,ae)|0,A=A+Math.imul(he,De)|0,_=_+Math.imul(C,je)|0,d=d+Math.imul(C,$e)|0,d=d+Math.imul(R,je)|0,A=A+Math.imul(R,$e)|0,_=_+Math.imul(V,Fe)|0,d=d+Math.imul(V,Ue)|0,d=d+Math.imul(Q,Fe)|0,A=A+Math.imul(Q,Ue)|0,_=_+Math.imul(ee,He)|0,d=d+Math.imul(ee,We)|0,d=d+Math.imul(O,He)|0,A=A+Math.imul(O,We)|0;var Ur=(L+_|0)+((d&8191)<<13)|0;L=(A+(d>>>13)|0)+(Ur>>>26)|0,Ur&=67108863,_=Math.imul(ke,fe),d=Math.imul(ke,ce),d=d+Math.imul(Re,fe)|0,A=Math.imul(Re,ce),_=_+Math.imul(se,ae)|0,d=d+Math.imul(se,De)|0,d=d+Math.imul(xe,ae)|0,A=A+Math.imul(xe,De)|0,_=_+Math.imul(Z,je)|0,d=d+Math.imul(Z,$e)|0,d=d+Math.imul(he,je)|0,A=A+Math.imul(he,$e)|0,_=_+Math.imul(C,Fe)|0,d=d+Math.imul(C,Ue)|0,d=d+Math.imul(R,Fe)|0,A=A+Math.imul(R,Ue)|0,_=_+Math.imul(V,He)|0,d=d+Math.imul(V,We)|0,d=d+Math.imul(Q,He)|0,A=A+Math.imul(Q,We)|0,_=_+Math.imul(ee,Ve)|0,d=d+Math.imul(ee,ze)|0,d=d+Math.imul(O,Ve)|0,A=A+Math.imul(O,ze)|0;var Hr=(L+_|0)+((d&8191)<<13)|0;L=(A+(d>>>13)|0)+(Hr>>>26)|0,Hr&=67108863,_=Math.imul(Ce,fe),d=Math.imul(Ce,ce),d=d+Math.imul(Ne,fe)|0,A=Math.imul(Ne,ce),_=_+Math.imul(ke,ae)|0,d=d+Math.imul(ke,De)|0,d=d+Math.imul(Re,ae)|0,A=A+Math.imul(Re,De)|0,_=_+Math.imul(se,je)|0,d=d+Math.imul(se,$e)|0,d=d+Math.imul(xe,je)|0,A=A+Math.imul(xe,$e)|0,_=_+Math.imul(Z,Fe)|0,d=d+Math.imul(Z,Ue)|0,d=d+Math.imul(he,Fe)|0,A=A+Math.imul(he,Ue)|0,_=_+Math.imul(C,He)|0,d=d+Math.imul(C,We)|0,d=d+Math.imul(R,He)|0,A=A+Math.imul(R,We)|0,_=_+Math.imul(V,Ve)|0,d=d+Math.imul(V,ze)|0,d=d+Math.imul(Q,Ve)|0,A=A+Math.imul(Q,ze)|0,_=_+Math.imul(ee,qe)|0,d=d+Math.imul(ee,Ge)|0,d=d+Math.imul(O,qe)|0,A=A+Math.imul(O,Ge)|0;var Wr=(L+_|0)+((d&8191)<<13)|0;L=(A+(d>>>13)|0)+(Wr>>>26)|0,Wr&=67108863,_=Math.imul(Ie,fe),d=Math.imul(Ie,ce),d=d+Math.imul(v,fe)|0,A=Math.imul(v,ce),_=_+Math.imul(Ce,ae)|0,d=d+Math.imul(Ce,De)|0,d=d+Math.imul(Ne,ae)|0,A=A+Math.imul(Ne,De)|0,_=_+Math.imul(ke,je)|0,d=d+Math.imul(ke,$e)|0,d=d+Math.imul(Re,je)|0,A=A+Math.imul(Re,$e)|0,_=_+Math.imul(se,Fe)|0,d=d+Math.imul(se,Ue)|0,d=d+Math.imul(xe,Fe)|0,A=A+Math.imul(xe,Ue)|0,_=_+Math.imul(Z,He)|0,d=d+Math.imul(Z,We)|0,d=d+Math.imul(he,He)|0,A=A+Math.imul(he,We)|0,_=_+Math.imul(C,Ve)|0,d=d+Math.imul(C,ze)|0,d=d+Math.imul(R,Ve)|0,A=A+Math.imul(R,ze)|0,_=_+Math.imul(V,qe)|0,d=d+Math.imul(V,Ge)|0,d=d+Math.imul(Q,qe)|0,A=A+Math.imul(Q,Ge)|0,_=_+Math.imul(ee,Je)|0,d=d+Math.imul(ee,Ze)|0,d=d+Math.imul(O,Je)|0,A=A+Math.imul(O,Ze)|0;var Vr=(L+_|0)+((d&8191)<<13)|0;L=(A+(d>>>13)|0)+(Vr>>>26)|0,Vr&=67108863,_=Math.imul(f,fe),d=Math.imul(f,ce),d=d+Math.imul(x,fe)|0,A=Math.imul(x,ce),_=_+Math.imul(Ie,ae)|0,d=d+Math.imul(Ie,De)|0,d=d+Math.imul(v,ae)|0,A=A+Math.imul(v,De)|0,_=_+Math.imul(Ce,je)|0,d=d+Math.imul(Ce,$e)|0,d=d+Math.imul(Ne,je)|0,A=A+Math.imul(Ne,$e)|0,_=_+Math.imul(ke,Fe)|0,d=d+Math.imul(ke,Ue)|0,d=d+Math.imul(Re,Fe)|0,A=A+Math.imul(Re,Ue)|0,_=_+Math.imul(se,He)|0,d=d+Math.imul(se,We)|0,d=d+Math.imul(xe,He)|0,A=A+Math.imul(xe,We)|0,_=_+Math.imul(Z,Ve)|0,d=d+Math.imul(Z,ze)|0,d=d+Math.imul(he,Ve)|0,A=A+Math.imul(he,ze)|0,_=_+Math.imul(C,qe)|0,d=d+Math.imul(C,Ge)|0,d=d+Math.imul(R,qe)|0,A=A+Math.imul(R,Ge)|0,_=_+Math.imul(V,Je)|0,d=d+Math.imul(V,Ze)|0,d=d+Math.imul(Q,Je)|0,A=A+Math.imul(Q,Ze)|0,_=_+Math.imul(ee,Qe)|0,d=d+Math.imul(ee,Ye)|0,d=d+Math.imul(O,Qe)|0,A=A+Math.imul(O,Ye)|0;var zr=(L+_|0)+((d&8191)<<13)|0;L=(A+(d>>>13)|0)+(zr>>>26)|0,zr&=67108863,_=Math.imul($,fe),d=Math.imul($,ce),d=d+Math.imul(W,fe)|0,A=Math.imul(W,ce),_=_+Math.imul(f,ae)|0,d=d+Math.imul(f,De)|0,d=d+Math.imul(x,ae)|0,A=A+Math.imul(x,De)|0,_=_+Math.imul(Ie,je)|0,d=d+Math.imul(Ie,$e)|0,d=d+Math.imul(v,je)|0,A=A+Math.imul(v,$e)|0,_=_+Math.imul(Ce,Fe)|0,d=d+Math.imul(Ce,Ue)|0,d=d+Math.imul(Ne,Fe)|0,A=A+Math.imul(Ne,Ue)|0,_=_+Math.imul(ke,He)|0,d=d+Math.imul(ke,We)|0,d=d+Math.imul(Re,He)|0,A=A+Math.imul(Re,We)|0,_=_+Math.imul(se,Ve)|0,d=d+Math.imul(se,ze)|0,d=d+Math.imul(xe,Ve)|0,A=A+Math.imul(xe,ze)|0,_=_+Math.imul(Z,qe)|0,d=d+Math.imul(Z,Ge)|0,d=d+Math.imul(he,qe)|0,A=A+Math.imul(he,Ge)|0,_=_+Math.imul(C,Je)|0,d=d+Math.imul(C,Ze)|0,d=d+Math.imul(R,Je)|0,A=A+Math.imul(R,Ze)|0,_=_+Math.imul(V,Qe)|0,d=d+Math.imul(V,Ye)|0,d=d+Math.imul(Q,Qe)|0,A=A+Math.imul(Q,Ye)|0,_=_+Math.imul(ee,Ke)|0,d=d+Math.imul(ee,Xe)|0,d=d+Math.imul(O,Ke)|0,A=A+Math.imul(O,Xe)|0;var qr=(L+_|0)+((d&8191)<<13)|0;L=(A+(d>>>13)|0)+(qr>>>26)|0,qr&=67108863,_=Math.imul($,ae),d=Math.imul($,De),d=d+Math.imul(W,ae)|0,A=Math.imul(W,De),_=_+Math.imul(f,je)|0,d=d+Math.imul(f,$e)|0,d=d+Math.imul(x,je)|0,A=A+Math.imul(x,$e)|0,_=_+Math.imul(Ie,Fe)|0,d=d+Math.imul(Ie,Ue)|0,d=d+Math.imul(v,Fe)|0,A=A+Math.imul(v,Ue)|0,_=_+Math.imul(Ce,He)|0,d=d+Math.imul(Ce,We)|0,d=d+Math.imul(Ne,He)|0,A=A+Math.imul(Ne,We)|0,_=_+Math.imul(ke,Ve)|0,d=d+Math.imul(ke,ze)|0,d=d+Math.imul(Re,Ve)|0,A=A+Math.imul(Re,ze)|0,_=_+Math.imul(se,qe)|0,d=d+Math.imul(se,Ge)|0,d=d+Math.imul(xe,qe)|0,A=A+Math.imul(xe,Ge)|0,_=_+Math.imul(Z,Je)|0,d=d+Math.imul(Z,Ze)|0,d=d+Math.imul(he,Je)|0,A=A+Math.imul(he,Ze)|0,_=_+Math.imul(C,Qe)|0,d=d+Math.imul(C,Ye)|0,d=d+Math.imul(R,Qe)|0,A=A+Math.imul(R,Ye)|0,_=_+Math.imul(V,Ke)|0,d=d+Math.imul(V,Xe)|0,d=d+Math.imul(Q,Ke)|0,A=A+Math.imul(Q,Xe)|0;var Gr=(L+_|0)+((d&8191)<<13)|0;L=(A+(d>>>13)|0)+(Gr>>>26)|0,Gr&=67108863,_=Math.imul($,je),d=Math.imul($,$e),d=d+Math.imul(W,je)|0,A=Math.imul(W,$e),_=_+Math.imul(f,Fe)|0,d=d+Math.imul(f,Ue)|0,d=d+Math.imul(x,Fe)|0,A=A+Math.imul(x,Ue)|0,_=_+Math.imul(Ie,He)|0,d=d+Math.imul(Ie,We)|0,d=d+Math.imul(v,He)|0,A=A+Math.imul(v,We)|0,_=_+Math.imul(Ce,Ve)|0,d=d+Math.imul(Ce,ze)|0,d=d+Math.imul(Ne,Ve)|0,A=A+Math.imul(Ne,ze)|0,_=_+Math.imul(ke,qe)|0,d=d+Math.imul(ke,Ge)|0,d=d+Math.imul(Re,qe)|0,A=A+Math.imul(Re,Ge)|0,_=_+Math.imul(se,Je)|0,d=d+Math.imul(se,Ze)|0,d=d+Math.imul(xe,Je)|0,A=A+Math.imul(xe,Ze)|0,_=_+Math.imul(Z,Qe)|0,d=d+Math.imul(Z,Ye)|0,d=d+Math.imul(he,Qe)|0,A=A+Math.imul(he,Ye)|0,_=_+Math.imul(C,Ke)|0,d=d+Math.imul(C,Xe)|0,d=d+Math.imul(R,Ke)|0,A=A+Math.imul(R,Xe)|0;var Jr=(L+_|0)+((d&8191)<<13)|0;L=(A+(d>>>13)|0)+(Jr>>>26)|0,Jr&=67108863,_=Math.imul($,Fe),d=Math.imul($,Ue),d=d+Math.imul(W,Fe)|0,A=Math.imul(W,Ue),_=_+Math.imul(f,He)|0,d=d+Math.imul(f,We)|0,d=d+Math.imul(x,He)|0,A=A+Math.imul(x,We)|0,_=_+Math.imul(Ie,Ve)|0,d=d+Math.imul(Ie,ze)|0,d=d+Math.imul(v,Ve)|0,A=A+Math.imul(v,ze)|0,_=_+Math.imul(Ce,qe)|0,d=d+Math.imul(Ce,Ge)|0,d=d+Math.imul(Ne,qe)|0,A=A+Math.imul(Ne,Ge)|0,_=_+Math.imul(ke,Je)|0,d=d+Math.imul(ke,Ze)|0,d=d+Math.imul(Re,Je)|0,A=A+Math.imul(Re,Ze)|0,_=_+Math.imul(se,Qe)|0,d=d+Math.imul(se,Ye)|0,d=d+Math.imul(xe,Qe)|0,A=A+Math.imul(xe,Ye)|0,_=_+Math.imul(Z,Ke)|0,d=d+Math.imul(Z,Xe)|0,d=d+Math.imul(he,Ke)|0,A=A+Math.imul(he,Xe)|0;var Zr=(L+_|0)+((d&8191)<<13)|0;L=(A+(d>>>13)|0)+(Zr>>>26)|0,Zr&=67108863,_=Math.imul($,He),d=Math.imul($,We),d=d+Math.imul(W,He)|0,A=Math.imul(W,We),_=_+Math.imul(f,Ve)|0,d=d+Math.imul(f,ze)|0,d=d+Math.imul(x,Ve)|0,A=A+Math.imul(x,ze)|0,_=_+Math.imul(Ie,qe)|0,d=d+Math.imul(Ie,Ge)|0,d=d+Math.imul(v,qe)|0,A=A+Math.imul(v,Ge)|0,_=_+Math.imul(Ce,Je)|0,d=d+Math.imul(Ce,Ze)|0,d=d+Math.imul(Ne,Je)|0,A=A+Math.imul(Ne,Ze)|0,_=_+Math.imul(ke,Qe)|0,d=d+Math.imul(ke,Ye)|0,d=d+Math.imul(Re,Qe)|0,A=A+Math.imul(Re,Ye)|0,_=_+Math.imul(se,Ke)|0,d=d+Math.imul(se,Xe)|0,d=d+Math.imul(xe,Ke)|0,A=A+Math.imul(xe,Xe)|0;var Qr=(L+_|0)+((d&8191)<<13)|0;L=(A+(d>>>13)|0)+(Qr>>>26)|0,Qr&=67108863,_=Math.imul($,Ve),d=Math.imul($,ze),d=d+Math.imul(W,Ve)|0,A=Math.imul(W,ze),_=_+Math.imul(f,qe)|0,d=d+Math.imul(f,Ge)|0,d=d+Math.imul(x,qe)|0,A=A+Math.imul(x,Ge)|0,_=_+Math.imul(Ie,Je)|0,d=d+Math.imul(Ie,Ze)|0,d=d+Math.imul(v,Je)|0,A=A+Math.imul(v,Ze)|0,_=_+Math.imul(Ce,Qe)|0,d=d+Math.imul(Ce,Ye)|0,d=d+Math.imul(Ne,Qe)|0,A=A+Math.imul(Ne,Ye)|0,_=_+Math.imul(ke,Ke)|0,d=d+Math.imul(ke,Xe)|0,d=d+Math.imul(Re,Ke)|0,A=A+Math.imul(Re,Xe)|0;var Jo=(L+_|0)+((d&8191)<<13)|0;L=(A+(d>>>13)|0)+(Jo>>>26)|0,Jo&=67108863,_=Math.imul($,qe),d=Math.imul($,Ge),d=d+Math.imul(W,qe)|0,A=Math.imul(W,Ge),_=_+Math.imul(f,Je)|0,d=d+Math.imul(f,Ze)|0,d=d+Math.imul(x,Je)|0,A=A+Math.imul(x,Ze)|0,_=_+Math.imul(Ie,Qe)|0,d=d+Math.imul(Ie,Ye)|0,d=d+Math.imul(v,Qe)|0,A=A+Math.imul(v,Ye)|0,_=_+Math.imul(Ce,Ke)|0,d=d+Math.imul(Ce,Xe)|0,d=d+Math.imul(Ne,Ke)|0,A=A+Math.imul(Ne,Xe)|0;var Zo=(L+_|0)+((d&8191)<<13)|0;L=(A+(d>>>13)|0)+(Zo>>>26)|0,Zo&=67108863,_=Math.imul($,Je),d=Math.imul($,Ze),d=d+Math.imul(W,Je)|0,A=Math.imul(W,Ze),_=_+Math.imul(f,Qe)|0,d=d+Math.imul(f,Ye)|0,d=d+Math.imul(x,Qe)|0,A=A+Math.imul(x,Ye)|0,_=_+Math.imul(Ie,Ke)|0,d=d+Math.imul(Ie,Xe)|0,d=d+Math.imul(v,Ke)|0,A=A+Math.imul(v,Xe)|0;var Qo=(L+_|0)+((d&8191)<<13)|0;L=(A+(d>>>13)|0)+(Qo>>>26)|0,Qo&=67108863,_=Math.imul($,Qe),d=Math.imul($,Ye),d=d+Math.imul(W,Qe)|0,A=Math.imul(W,Ye),_=_+Math.imul(f,Ke)|0,d=d+Math.imul(f,Xe)|0,d=d+Math.imul(x,Ke)|0,A=A+Math.imul(x,Xe)|0;var Yo=(L+_|0)+((d&8191)<<13)|0;L=(A+(d>>>13)|0)+(Yo>>>26)|0,Yo&=67108863,_=Math.imul($,Ke),d=Math.imul($,Xe),d=d+Math.imul(W,Ke)|0,A=Math.imul(W,Xe);var Ko=(L+_|0)+((d&8191)<<13)|0;return L=(A+(d>>>13)|0)+(Ko>>>26)|0,Ko&=67108863,k[0]=Dr,k[1]=jr,k[2]=$r,k[3]=Fr,k[4]=Ur,k[5]=Hr,k[6]=Wr,k[7]=Vr,k[8]=zr,k[9]=qr,k[10]=Gr,k[11]=Jr,k[12]=Zr,k[13]=Qr,k[14]=Jo,k[15]=Zo,k[16]=Qo,k[17]=Yo,k[18]=Ko,L!==0&&(k[19]=L,m.length++),m};Math.imul||(N=M);function j(w,u,b){b.negative=u.negative^w.negative,b.length=w.length+u.length;for(var m=0,E=0,S=0;S<b.length-1;S++){var k=E;E=0;for(var L=m&67108863,_=Math.min(S,u.length-1),d=Math.max(0,S-w.length+1);d<=_;d++){var A=S-d,Y=w.words[A]|0,ee=u.words[d]|0,O=Y*ee,P=O&67108863;k=k+(O/67108864|0)|0,P=P+L|0,L=P&67108863,k=k+(P>>>26)|0,E+=k>>>26,k&=67108863}b.words[S]=L,m=k,k=E}return m!==0?b.words[S]=m:b.length--,b._strip()}function H(w,u,b){return j(w,u,b)}s.prototype.mulTo=function(u,b){var m,E=this.length+u.length;return this.length===10&&u.length===10?m=N(this,u,b):E<63?m=M(this,u,b):E<1024?m=j(this,u,b):m=H(this,u,b),m},s.prototype.mul=function(u){var b=new s(null);return b.words=new Array(this.length+u.length),this.mulTo(u,b)},s.prototype.mulf=function(u){var b=new s(null);return b.words=new Array(this.length+u.length),H(this,u,b)},s.prototype.imul=function(u){return this.clone().mulTo(u,this)},s.prototype.imuln=function(u){var b=u<0;b&&(u=-u),n(typeof u=="number"),n(u<67108864);for(var m=0,E=0;E<this.length;E++){var S=(this.words[E]|0)*u,k=(S&67108863)+(m&67108863);m>>=26,m+=S/67108864|0,m+=k>>>26,this.words[E]=k&67108863}return m!==0&&(this.words[E]=m,this.length++),b?this.ineg():this},s.prototype.muln=function(u){return this.clone().imuln(u)},s.prototype.sqr=function(){return this.mul(this)},s.prototype.isqr=function(){return this.imul(this.clone())},s.prototype.pow=function(u){var b=U(u);if(b.length===0)return new s(1);for(var m=this,E=0;E<b.length&&b[E]===0;E++,m=m.sqr());if(++E<b.length)for(var S=m.sqr();E<b.length;E++,S=S.sqr())b[E]!==0&&(m=m.mul(S));return m},s.prototype.iushln=function(u){n(typeof u=="number"&&u>=0);var b=u%26,m=(u-b)/26,E=67108863>>>26-b<<26-b,S;if(b!==0){var k=0;for(S=0;S<this.length;S++){var L=this.words[S]&E,_=(this.words[S]|0)-L<<b;this.words[S]=_|k,k=L>>>26-b}k&&(this.words[S]=k,this.length++)}if(m!==0){for(S=this.length-1;S>=0;S--)this.words[S+m]=this.words[S];for(S=0;S<m;S++)this.words[S]=0;this.length+=m}return this._strip()},s.prototype.ishln=function(u){return n(this.negative===0),this.iushln(u)},s.prototype.iushrn=function(u,b,m){n(typeof u=="number"&&u>=0);var E;b?E=(b-b%26)/26:E=0;var S=u%26,k=Math.min((u-S)/26,this.length),L=67108863^67108863>>>S<<S,_=m;if(E-=k,E=Math.max(0,E),_){for(var d=0;d<k;d++)_.words[d]=this.words[d];_.length=k}if(k!==0)if(this.length>k)for(this.length-=k,d=0;d<this.length;d++)this.words[d]=this.words[d+k];else this.words[0]=0,this.length=1;var A=0;for(d=this.length-1;d>=0&&(A!==0||d>=E);d--){var Y=this.words[d]|0;this.words[d]=A<<26-S|Y>>>S,A=Y&L}return _&&A!==0&&(_.words[_.length++]=A),this.length===0&&(this.words[0]=0,this.length=1),this._strip()},s.prototype.ishrn=function(u,b,m){return n(this.negative===0),this.iushrn(u,b,m)},s.prototype.shln=function(u){return this.clone().ishln(u)},s.prototype.ushln=function(u){return this.clone().iushln(u)},s.prototype.shrn=function(u){return this.clone().ishrn(u)},s.prototype.ushrn=function(u){return this.clone().iushrn(u)},s.prototype.testn=function(u){n(typeof u=="number"&&u>=0);var b=u%26,m=(u-b)/26,E=1<<b;if(this.length<=m)return!1;var S=this.words[m];return!!(S&E)},s.prototype.imaskn=function(u){n(typeof u=="number"&&u>=0);var b=u%26,m=(u-b)/26;if(n(this.negative===0,"imaskn works only with positive numbers"),this.length<=m)return this;if(b!==0&&m++,this.length=Math.min(m,this.length),b!==0){var E=67108863^67108863>>>b<<b;this.words[this.length-1]&=E}return this._strip()},s.prototype.maskn=function(u){return this.clone().imaskn(u)},s.prototype.iaddn=function(u){return n(typeof u=="number"),n(u<67108864),u<0?this.isubn(-u):this.negative!==0?this.length===1&&(this.words[0]|0)<=u?(this.words[0]=u-(this.words[0]|0),this.negative=0,this):(this.negative=0,this.isubn(u),this.negative=1,this):this._iaddn(u)},s.prototype._iaddn=function(u){this.words[0]+=u;for(var b=0;b<this.length&&this.words[b]>=67108864;b++)this.words[b]-=67108864,b===this.length-1?this.words[b+1]=1:this.words[b+1]++;return this.length=Math.max(this.length,b+1),this},s.prototype.isubn=function(u){if(n(typeof u=="number"),n(u<67108864),u<0)return this.iaddn(-u);if(this.negative!==0)return this.negative=0,this.iaddn(u),this.negative=1,this;if(this.words[0]-=u,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var b=0;b<this.length&&this.words[b]<0;b++)this.words[b]+=67108864,this.words[b+1]-=1;return this._strip()},s.prototype.addn=function(u){return this.clone().iaddn(u)},s.prototype.subn=function(u){return this.clone().isubn(u)},s.prototype.iabs=function(){return this.negative=0,this},s.prototype.abs=function(){return this.clone().iabs()},s.prototype._ishlnsubmul=function(u,b,m){var E=u.length+m,S;this._expand(E);var k,L=0;for(S=0;S<u.length;S++){k=(this.words[S+m]|0)+L;var _=(u.words[S]|0)*b;k-=_&67108863,L=(k>>26)-(_/67108864|0),this.words[S+m]=k&67108863}for(;S<this.length-m;S++)k=(this.words[S+m]|0)+L,L=k>>26,this.words[S+m]=k&67108863;if(L===0)return this._strip();for(n(L===-1),L=0,S=0;S<this.length;S++)k=-(this.words[S]|0)+L,L=k>>26,this.words[S]=k&67108863;return this.negative=1,this._strip()},s.prototype._wordDiv=function(u,b){var m=this.length-u.length,E=this.clone(),S=u,k=S.words[S.length-1]|0,L=this._countBits(k);m=26-L,m!==0&&(S=S.ushln(m),E.iushln(m),k=S.words[S.length-1]|0);var _=E.length-S.length,d;if(b!=="mod"){d=new s(null),d.length=_+1,d.words=new Array(d.length);for(var A=0;A<d.length;A++)d.words[A]=0}var Y=E.clone()._ishlnsubmul(S,1,_);Y.negative===0&&(E=Y,d&&(d.words[_]=1));for(var ee=_-1;ee>=0;ee--){var O=(E.words[S.length+ee]|0)*67108864+(E.words[S.length+ee-1]|0);for(O=Math.min(O/k|0,67108863),E._ishlnsubmul(S,O,ee);E.negative!==0;)O--,E.negative=0,E._ishlnsubmul(S,1,ee),E.isZero()||(E.negative^=1);d&&(d.words[ee]=O)}return d&&d._strip(),E._strip(),b!=="div"&&m!==0&&E.iushrn(m),{div:d||null,mod:E}},s.prototype.divmod=function(u,b,m){if(n(!u.isZero()),this.isZero())return{div:new s(0),mod:new s(0)};var E,S,k;return this.negative!==0&&u.negative===0?(k=this.neg().divmod(u,b),b!=="mod"&&(E=k.div.neg()),b!=="div"&&(S=k.mod.neg(),m&&S.negative!==0&&S.iadd(u)),{div:E,mod:S}):this.negative===0&&u.negative!==0?(k=this.divmod(u.neg(),b),b!=="mod"&&(E=k.div.neg()),{div:E,mod:k.mod}):this.negative&u.negative?(k=this.neg().divmod(u.neg(),b),b!=="div"&&(S=k.mod.neg(),m&&S.negative!==0&&S.isub(u)),{div:k.div,mod:S}):u.length>this.length||this.cmp(u)<0?{div:new s(0),mod:this}:u.length===1?b==="div"?{div:this.divn(u.words[0]),mod:null}:b==="mod"?{div:null,mod:new s(this.modrn(u.words[0]))}:{div:this.divn(u.words[0]),mod:new s(this.modrn(u.words[0]))}:this._wordDiv(u,b)},s.prototype.div=function(u){return this.divmod(u,"div",!1).div},s.prototype.mod=function(u){return this.divmod(u,"mod",!1).mod},s.prototype.umod=function(u){return this.divmod(u,"mod",!0).mod},s.prototype.divRound=function(u){var b=this.divmod(u);if(b.mod.isZero())return b.div;var m=b.div.negative!==0?b.mod.isub(u):b.mod,E=u.ushrn(1),S=u.andln(1),k=m.cmp(E);return k<0||S===1&&k===0?b.div:b.div.negative!==0?b.div.isubn(1):b.div.iaddn(1)},s.prototype.modrn=function(u){var b=u<0;b&&(u=-u),n(u<=67108863);for(var m=(1<<26)%u,E=0,S=this.length-1;S>=0;S--)E=(m*E+(this.words[S]|0))%u;return b?-E:E},s.prototype.modn=function(u){return this.modrn(u)},s.prototype.idivn=function(u){var b=u<0;b&&(u=-u),n(u<=67108863);for(var m=0,E=this.length-1;E>=0;E--){var S=(this.words[E]|0)+m*67108864;this.words[E]=S/u|0,m=S%u}return this._strip(),b?this.ineg():this},s.prototype.divn=function(u){return this.clone().idivn(u)},s.prototype.egcd=function(u){n(u.negative===0),n(!u.isZero());var b=this,m=u.clone();b.negative!==0?b=b.umod(u):b=b.clone();for(var E=new s(1),S=new s(0),k=new s(0),L=new s(1),_=0;b.isEven()&&m.isEven();)b.iushrn(1),m.iushrn(1),++_;for(var d=m.clone(),A=b.clone();!b.isZero();){for(var Y=0,ee=1;!(b.words[0]&ee)&&Y<26;++Y,ee<<=1);if(Y>0)for(b.iushrn(Y);Y-- >0;)(E.isOdd()||S.isOdd())&&(E.iadd(d),S.isub(A)),E.iushrn(1),S.iushrn(1);for(var O=0,P=1;!(m.words[0]&P)&&O<26;++O,P<<=1);if(O>0)for(m.iushrn(O);O-- >0;)(k.isOdd()||L.isOdd())&&(k.iadd(d),L.isub(A)),k.iushrn(1),L.iushrn(1);b.cmp(m)>=0?(b.isub(m),E.isub(k),S.isub(L)):(m.isub(b),k.isub(E),L.isub(S))}return{a:k,b:L,gcd:m.iushln(_)}},s.prototype._invmp=function(u){n(u.negative===0),n(!u.isZero());var b=this,m=u.clone();b.negative!==0?b=b.umod(u):b=b.clone();for(var E=new s(1),S=new s(0),k=m.clone();b.cmpn(1)>0&&m.cmpn(1)>0;){for(var L=0,_=1;!(b.words[0]&_)&&L<26;++L,_<<=1);if(L>0)for(b.iushrn(L);L-- >0;)E.isOdd()&&E.iadd(k),E.iushrn(1);for(var d=0,A=1;!(m.words[0]&A)&&d<26;++d,A<<=1);if(d>0)for(m.iushrn(d);d-- >0;)S.isOdd()&&S.iadd(k),S.iushrn(1);b.cmp(m)>=0?(b.isub(m),E.isub(S)):(m.isub(b),S.isub(E))}var Y;return b.cmpn(1)===0?Y=E:Y=S,Y.cmpn(0)<0&&Y.iadd(u),Y},s.prototype.gcd=function(u){if(this.isZero())return u.abs();if(u.isZero())return this.abs();var b=this.clone(),m=u.clone();b.negative=0,m.negative=0;for(var E=0;b.isEven()&&m.isEven();E++)b.iushrn(1),m.iushrn(1);do{for(;b.isEven();)b.iushrn(1);for(;m.isEven();)m.iushrn(1);var S=b.cmp(m);if(S<0){var k=b;b=m,m=k}else if(S===0||m.cmpn(1)===0)break;b.isub(m)}while(!0);return m.iushln(E)},s.prototype.invm=function(u){return this.egcd(u).a.umod(u)},s.prototype.isEven=function(){return(this.words[0]&1)===0},s.prototype.isOdd=function(){return(this.words[0]&1)===1},s.prototype.andln=function(u){return this.words[0]&u},s.prototype.bincn=function(u){n(typeof u=="number");var b=u%26,m=(u-b)/26,E=1<<b;if(this.length<=m)return this._expand(m+1),this.words[m]|=E,this;for(var S=E,k=m;S!==0&&k<this.length;k++){var L=this.words[k]|0;L+=S,S=L>>>26,L&=67108863,this.words[k]=L}return S!==0&&(this.words[k]=S,this.length++),this},s.prototype.isZero=function(){return this.length===1&&this.words[0]===0},s.prototype.cmpn=function(u){var b=u<0;if(this.negative!==0&&!b)return-1;if(this.negative===0&&b)return 1;this._strip();var m;if(this.length>1)m=1;else{b&&(u=-u),n(u<=67108863,"Number is too big");var E=this.words[0]|0;m=E===u?0:E<u?-1:1}return this.negative!==0?-m|0:m},s.prototype.cmp=function(u){if(this.negative!==0&&u.negative===0)return-1;if(this.negative===0&&u.negative!==0)return 1;var b=this.ucmp(u);return this.negative!==0?-b|0:b},s.prototype.ucmp=function(u){if(this.length>u.length)return 1;if(this.length<u.length)return-1;for(var b=0,m=this.length-1;m>=0;m--){var E=this.words[m]|0,S=u.words[m]|0;if(E!==S){E<S?b=-1:E>S&&(b=1);break}}return b},s.prototype.gtn=function(u){return this.cmpn(u)===1},s.prototype.gt=function(u){return this.cmp(u)===1},s.prototype.gten=function(u){return this.cmpn(u)>=0},s.prototype.gte=function(u){return this.cmp(u)>=0},s.prototype.ltn=function(u){return this.cmpn(u)===-1},s.prototype.lt=function(u){return this.cmp(u)===-1},s.prototype.lten=function(u){return this.cmpn(u)<=0},s.prototype.lte=function(u){return this.cmp(u)<=0},s.prototype.eqn=function(u){return this.cmpn(u)===0},s.prototype.eq=function(u){return this.cmp(u)===0},s.red=function(u){return new oe(u)},s.prototype.toRed=function(u){return n(!this.red,"Already a number in reduction context"),n(this.negative===0,"red works only with positives"),u.convertTo(this)._forceRed(u)},s.prototype.fromRed=function(){return n(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},s.prototype._forceRed=function(u){return this.red=u,this},s.prototype.forceRed=function(u){return n(!this.red,"Already a number in reduction context"),this._forceRed(u)},s.prototype.redAdd=function(u){return n(this.red,"redAdd works only with red numbers"),this.red.add(this,u)},s.prototype.redIAdd=function(u){return n(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,u)},s.prototype.redSub=function(u){return n(this.red,"redSub works only with red numbers"),this.red.sub(this,u)},s.prototype.redISub=function(u){return n(this.red,"redISub works only with red numbers"),this.red.isub(this,u)},s.prototype.redShl=function(u){return n(this.red,"redShl works only with red numbers"),this.red.shl(this,u)},s.prototype.redMul=function(u){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,u),this.red.mul(this,u)},s.prototype.redIMul=function(u){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,u),this.red.imul(this,u)},s.prototype.redSqr=function(){return n(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},s.prototype.redISqr=function(){return n(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},s.prototype.redSqrt=function(){return n(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},s.prototype.redInvm=function(){return n(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},s.prototype.redNeg=function(){return n(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},s.prototype.redPow=function(u){return n(this.red&&!u.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,u)};var F={k256:null,p224:null,p192:null,p25519:null};function z(w,u){this.name=w,this.p=new s(u,16),this.n=this.p.bitLength(),this.k=new s(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}z.prototype._tmp=function(){var u=new s(null);return u.words=new Array(Math.ceil(this.n/13)),u},z.prototype.ireduce=function(u){var b=u,m;do this.split(b,this.tmp),b=this.imulK(b),b=b.iadd(this.tmp),m=b.bitLength();while(m>this.n);var E=m<this.n?-1:b.ucmp(this.p);return E===0?(b.words[0]=0,b.length=1):E>0?b.isub(this.p):b.strip!==void 0?b.strip():b._strip(),b},z.prototype.split=function(u,b){u.iushrn(this.n,0,b)},z.prototype.imulK=function(u){return u.imul(this.k)};function X(){z.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}i(X,z),X.prototype.split=function(u,b){for(var m=4194303,E=Math.min(u.length,9),S=0;S<E;S++)b.words[S]=u.words[S];if(b.length=E,u.length<=9){u.words[0]=0,u.length=1;return}var k=u.words[9];for(b.words[b.length++]=k&m,S=10;S<u.length;S++){var L=u.words[S]|0;u.words[S-10]=(L&m)<<4|k>>>22,k=L}k>>>=22,u.words[S-10]=k,k===0&&u.length>10?u.length-=10:u.length-=9},X.prototype.imulK=function(u){u.words[u.length]=0,u.words[u.length+1]=0,u.length+=2;for(var b=0,m=0;m<u.length;m++){var E=u.words[m]|0;b+=E*977,u.words[m]=b&67108863,b=E*64+(b/67108864|0)}return u.words[u.length-1]===0&&(u.length--,u.words[u.length-1]===0&&u.length--),u};function K(){z.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}i(K,z);function J(){z.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}i(J,z);function ne(){z.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}i(ne,z),ne.prototype.imulK=function(u){for(var b=0,m=0;m<u.length;m++){var E=(u.words[m]|0)*19+b,S=E&67108863;E>>>=26,u.words[m]=S,b=E}return b!==0&&(u.words[u.length++]=b),u},s._prime=function(u){if(F[u])return F[u];var b;if(u==="k256")b=new X;else if(u==="p224")b=new K;else if(u==="p192")b=new J;else if(u==="p25519")b=new ne;else throw new Error("Unknown prime "+u);return F[u]=b,b};function oe(w){if(typeof w=="string"){var u=s._prime(w);this.m=u.p,this.prime=u}else n(w.gtn(1),"modulus must be greater than 1"),this.m=w,this.prime=null}oe.prototype._verify1=function(u){n(u.negative===0,"red works only with positives"),n(u.red,"red works only with red numbers")},oe.prototype._verify2=function(u,b){n((u.negative|b.negative)===0,"red works only with positives"),n(u.red&&u.red===b.red,"red works only with red numbers")},oe.prototype.imod=function(u){return this.prime?this.prime.ireduce(u)._forceRed(this):(p(u,u.umod(this.m)._forceRed(this)),u)},oe.prototype.neg=function(u){return u.isZero()?u.clone():this.m.sub(u)._forceRed(this)},oe.prototype.add=function(u,b){this._verify2(u,b);var m=u.add(b);return m.cmp(this.m)>=0&&m.isub(this.m),m._forceRed(this)},oe.prototype.iadd=function(u,b){this._verify2(u,b);var m=u.iadd(b);return m.cmp(this.m)>=0&&m.isub(this.m),m},oe.prototype.sub=function(u,b){this._verify2(u,b);var m=u.sub(b);return m.cmpn(0)<0&&m.iadd(this.m),m._forceRed(this)},oe.prototype.isub=function(u,b){this._verify2(u,b);var m=u.isub(b);return m.cmpn(0)<0&&m.iadd(this.m),m},oe.prototype.shl=function(u,b){return this._verify1(u),this.imod(u.ushln(b))},oe.prototype.imul=function(u,b){return this._verify2(u,b),this.imod(u.imul(b))},oe.prototype.mul=function(u,b){return this._verify2(u,b),this.imod(u.mul(b))},oe.prototype.isqr=function(u){return this.imul(u,u.clone())},oe.prototype.sqr=function(u){return this.mul(u,u)},oe.prototype.sqrt=function(u){if(u.isZero())return u.clone();var b=this.m.andln(3);if(n(b%2===1),b===3){var m=this.m.add(new s(1)).iushrn(2);return this.pow(u,m)}for(var E=this.m.subn(1),S=0;!E.isZero()&&E.andln(1)===0;)S++,E.iushrn(1);n(!E.isZero());var k=new s(1).toRed(this),L=k.redNeg(),_=this.m.subn(1).iushrn(1),d=this.m.bitLength();for(d=new s(2*d*d).toRed(this);this.pow(d,_).cmp(L)!==0;)d.redIAdd(L);for(var A=this.pow(d,E),Y=this.pow(u,E.addn(1).iushrn(1)),ee=this.pow(u,E),O=S;ee.cmp(k)!==0;){for(var P=ee,V=0;P.cmp(k)!==0;V++)P=P.redSqr();n(V<O);var Q=this.pow(A,new s(1).iushln(O-V-1));Y=Y.redMul(Q),A=Q.redSqr(),ee=ee.redMul(A),O=V}return Y},oe.prototype.invm=function(u){var b=u._invmp(this.m);return b.negative!==0?(b.negative=0,this.imod(b).redNeg()):this.imod(b)},oe.prototype.pow=function(u,b){if(b.isZero())return new s(1).toRed(this);if(b.cmpn(1)===0)return u.clone();var m=4,E=new Array(1<<m);E[0]=new s(1).toRed(this),E[1]=u;for(var S=2;S<E.length;S++)E[S]=this.mul(E[S-1],u);var k=E[0],L=0,_=0,d=b.bitLength()%26;for(d===0&&(d=26),S=b.length-1;S>=0;S--){for(var A=b.words[S],Y=d-1;Y>=0;Y--){var ee=A>>Y&1;if(k!==E[0]&&(k=this.sqr(k)),ee===0&&L===0){_=0;continue}L<<=1,L|=ee,_++,!(_!==m&&(S!==0||Y!==0))&&(k=this.mul(k,E[L]),_=0,L=0)}d=26}return k},oe.prototype.convertTo=function(u){var b=u.umod(this.m);return b===u?b.clone():b},oe.prototype.convertFrom=function(u){var b=u.clone();return b.red=null,b},s.mont=function(u){return new ue(u)};function ue(w){oe.call(this,w),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new s(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}i(ue,oe),ue.prototype.convertTo=function(u){return this.imod(u.ushln(this.shift))},ue.prototype.convertFrom=function(u){var b=this.imod(u.mul(this.rinv));return b.red=null,b},ue.prototype.imul=function(u,b){if(u.isZero()||b.isZero())return u.words[0]=0,u.length=1,u;var m=u.imul(b),E=m.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),S=m.isub(E).iushrn(this.shift),k=S;return S.cmp(this.m)>=0?k=S.isub(this.m):S.cmpn(0)<0&&(k=S.iadd(this.m)),k._forceRed(this)},ue.prototype.mul=function(u,b){if(u.isZero()||b.isZero())return new s(0)._forceRed(this);var m=u.mul(b),E=m.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),S=m.isub(E).iushrn(this.shift),k=S;return S.cmp(this.m)>=0?k=S.isub(this.m):S.cmpn(0)<0&&(k=S.iadd(this.m)),k._forceRed(this)},ue.prototype.invm=function(u){var b=this.imod(u._invmp(this.m).mul(this.r2));return b._forceRed(this)}})(t,te)})(lu);var zs=lu.exports,oi={};Object.defineProperty(oi,"__esModule",{value:!0});oi.EVENTS=void 0;oi.EVENTS={STARTED_CONNECTING:"walletlink_sdk.started.connecting",CONNECTED_STATE_CHANGE:"walletlink_sdk.connected",DISCONNECTED:"walletlink_sdk.disconnected",METADATA_DESTROYED:"walletlink_sdk_metadata_destroyed",LINKED:"walletlink_sdk.linked",FAILURE:"walletlink_sdk.generic_failure",SESSION_CONFIG_RECEIVED:"walletlink_sdk.session_config_event_received",ETH_ACCOUNTS_STATE:"walletlink_sdk.eth_accounts_state",SESSION_STATE_CHANGE:"walletlink_sdk.session_state_change",UNLINKED_ERROR_STATE:"walletlink_sdk.unlinked_error_state",SKIPPED_CLEARING_SESSION:"walletlink_sdk.skipped_clearing_session",GENERAL_ERROR:"walletlink_sdk.general_error",WEB3_REQUEST:"walletlink_sdk.web3.request",WEB3_REQUEST_PUBLISHED:"walletlink_sdk.web3.request_published",WEB3_RESPONSE:"walletlink_sdk.web3.response",UNKNOWN_ADDRESS_ENCOUNTERED:"walletlink_sdk.unknown_address_encountered"};var ji={},hu={},kr={},ip=ki;ki.default=ki;ki.stable=xh;ki.stableStringify=xh;var Rs="[...]",Eh="[Circular]",cn=[],on=[];function Sh(){return{depthLimit:Number.MAX_SAFE_INTEGER,edgesLimit:Number.MAX_SAFE_INTEGER}}function ki(t,e,r,n){typeof n>"u"&&(n=Sh()),Da(t,"",0,[],void 0,0,n);var i;try{on.length===0?i=JSON.stringify(t,e,r):i=JSON.stringify(t,Mh(e),r)}catch{return JSON.stringify("[unable to serialize, circular reference is too complex to analyze]")}finally{for(;cn.length!==0;){var s=cn.pop();s.length===4?Object.defineProperty(s[0],s[1],s[3]):s[0][s[1]]=s[2]}}return i}function $n(t,e,r,n){var i=Object.getOwnPropertyDescriptor(n,r);i.get!==void 0?i.configurable?(Object.defineProperty(n,r,{value:t}),cn.push([n,r,e,i])):on.push([e,r,t]):(n[r]=t,cn.push([n,r,e]))}function Da(t,e,r,n,i,s,o){s+=1;var a;if(typeof t=="object"&&t!==null){for(a=0;a<n.length;a++)if(n[a]===t){$n(Eh,t,e,i);return}if(typeof o.depthLimit<"u"&&s>o.depthLimit){$n(Rs,t,e,i);return}if(typeof o.edgesLimit<"u"&&r+1>o.edgesLimit){$n(Rs,t,e,i);return}if(n.push(t),Array.isArray(t))for(a=0;a<t.length;a++)Da(t[a],a,a,n,t,s,o);else{var c=Object.keys(t);for(a=0;a<c.length;a++){var l=c[a];Da(t[l],l,a,n,t,s,o)}}n.pop()}}function sp(t,e){return t<e?-1:t>e?1:0}function xh(t,e,r,n){typeof n>"u"&&(n=Sh());var i=ja(t,"",0,[],void 0,0,n)||t,s;try{on.length===0?s=JSON.stringify(i,e,r):s=JSON.stringify(i,Mh(e),r)}catch{return JSON.stringify("[unable to serialize, circular reference is too complex to analyze]")}finally{for(;cn.length!==0;){var o=cn.pop();o.length===4?Object.defineProperty(o[0],o[1],o[3]):o[0][o[1]]=o[2]}}return s}function ja(t,e,r,n,i,s,o){s+=1;var a;if(typeof t=="object"&&t!==null){for(a=0;a<n.length;a++)if(n[a]===t){$n(Eh,t,e,i);return}try{if(typeof t.toJSON=="function")return}catch{return}if(typeof o.depthLimit<"u"&&s>o.depthLimit){$n(Rs,t,e,i);return}if(typeof o.edgesLimit<"u"&&r+1>o.edgesLimit){$n(Rs,t,e,i);return}if(n.push(t),Array.isArray(t))for(a=0;a<t.length;a++)ja(t[a],a,a,n,t,s,o);else{var c={},l=Object.keys(t).sort(sp);for(a=0;a<l.length;a++){var p=l[a];ja(t[p],p,a,n,t,s,o),c[p]=t[p]}if(typeof i<"u")cn.push([i,e,t]),i[e]=c;else return c}n.pop()}}function Mh(t){return t=typeof t<"u"?t:function(e,r){return r},function(e,r){if(on.length>0)for(var n=0;n<on.length;n++){var i=on[n];if(i[1]===e&&i[0]===r){r=i[2],on.splice(n,1);break}}return t.call(this,e,r)}}Object.defineProperty(kr,"__esModule",{value:!0});kr.EthereumProviderError=kr.EthereumRpcError=void 0;const op=ip;class Ch extends Error{constructor(e,r,n){if(!Number.isInteger(e))throw new Error('"code" must be an integer.');if(!r||typeof r!="string")throw new Error('"message" must be a nonempty string.');super(r),this.code=e,n!==void 0&&(this.data=n)}serialize(){const e={code:this.code,message:this.message};return this.data!==void 0&&(e.data=this.data),this.stack&&(e.stack=this.stack),e}toString(){return op.default(this.serialize(),cp,2)}}kr.EthereumRpcError=Ch;class ap extends Ch{constructor(e,r,n){if(!up(e))throw new Error('"code" must be an integer such that: 1000 <= code <= 4999');super(e,r,n)}}kr.EthereumProviderError=ap;function up(t){return Number.isInteger(t)&&t>=1e3&&t<=4999}function cp(t,e){if(e!=="[Circular]")return e}var fu={},Nr={};Object.defineProperty(Nr,"__esModule",{value:!0});Nr.errorValues=Nr.errorCodes=void 0;Nr.errorCodes={rpc:{invalidInput:-32e3,resourceNotFound:-32001,resourceUnavailable:-32002,transactionRejected:-32003,methodNotSupported:-32004,limitExceeded:-32005,parse:-32700,invalidRequest:-32600,methodNotFound:-32601,invalidParams:-32602,internal:-32603},provider:{userRejectedRequest:4001,unauthorized:4100,unsupportedMethod:4200,disconnected:4900,chainDisconnected:4901}};Nr.errorValues={"-32700":{standard:"JSON RPC 2.0",message:"Invalid JSON was received by the server. An error occurred on the server while parsing the JSON text."},"-32600":{standard:"JSON RPC 2.0",message:"The JSON sent is not a valid Request object."},"-32601":{standard:"JSON RPC 2.0",message:"The method does not exist / is not available."},"-32602":{standard:"JSON RPC 2.0",message:"Invalid method parameter(s)."},"-32603":{standard:"JSON RPC 2.0",message:"Internal JSON-RPC error."},"-32000":{standard:"EIP-1474",message:"Invalid input."},"-32001":{standard:"EIP-1474",message:"Resource not found."},"-32002":{standard:"EIP-1474",message:"Resource unavailable."},"-32003":{standard:"EIP-1474",message:"Transaction rejected."},"-32004":{standard:"EIP-1474",message:"Method not supported."},"-32005":{standard:"EIP-1474",message:"Request limit exceeded."},4001:{standard:"EIP-1193",message:"User rejected the request."},4100:{standard:"EIP-1193",message:"The requested account and/or method has not been authorized by the user."},4200:{standard:"EIP-1193",message:"The requested method is not supported by this Ethereum provider."},4900:{standard:"EIP-1193",message:"The provider is disconnected from all chains."},4901:{standard:"EIP-1193",message:"The provider is disconnected from the specified chain."}};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.serializeError=t.isValidCode=t.getMessageFromCode=t.JSON_RPC_SERVER_ERROR_MESSAGE=void 0;const e=Nr,r=kr,n=e.errorCodes.rpc.internal,i="Unspecified error message. This is a bug, please report it.",s={code:n,message:o(n)};t.JSON_RPC_SERVER_ERROR_MESSAGE="Unspecified server error.";function o(y,I=i){if(Number.isInteger(y)){const T=y.toString();if(g(e.errorValues,T))return e.errorValues[T].message;if(l(y))return t.JSON_RPC_SERVER_ERROR_MESSAGE}return I}t.getMessageFromCode=o;function a(y){if(!Number.isInteger(y))return!1;const I=y.toString();return!!(e.errorValues[I]||l(y))}t.isValidCode=a;function c(y,{fallbackError:I=s,shouldIncludeStack:T=!1}={}){var D,U;if(!I||!Number.isInteger(I.code)||typeof I.message!="string")throw new Error("Must provide fallback error with integer number code and string message.");if(y instanceof r.EthereumRpcError)return y.serialize();const M={};if(y&&typeof y=="object"&&!Array.isArray(y)&&g(y,"code")&&a(y.code)){const j=y;M.code=j.code,j.message&&typeof j.message=="string"?(M.message=j.message,g(j,"data")&&(M.data=j.data)):(M.message=o(M.code),M.data={originalError:p(y)})}else{M.code=I.code;const j=(D=y)===null||D===void 0?void 0:D.message;M.message=j&&typeof j=="string"?j:I.message,M.data={originalError:p(y)}}const N=(U=y)===null||U===void 0?void 0:U.stack;return T&&y&&N&&typeof N=="string"&&(M.stack=N),M}t.serializeError=c;function l(y){return y>=-32099&&y<=-32e3}function p(y){return y&&typeof y=="object"&&!Array.isArray(y)?Object.assign({},y):y}function g(y,I){return Object.prototype.hasOwnProperty.call(y,I)}})(fu);var qs={};Object.defineProperty(qs,"__esModule",{value:!0});qs.ethErrors=void 0;const du=kr,Ih=fu,wt=Nr;qs.ethErrors={rpc:{parse:t=>Pt(wt.errorCodes.rpc.parse,t),invalidRequest:t=>Pt(wt.errorCodes.rpc.invalidRequest,t),invalidParams:t=>Pt(wt.errorCodes.rpc.invalidParams,t),methodNotFound:t=>Pt(wt.errorCodes.rpc.methodNotFound,t),internal:t=>Pt(wt.errorCodes.rpc.internal,t),server:t=>{if(!t||typeof t!="object"||Array.isArray(t))throw new Error("Ethereum RPC Server errors must provide single object argument.");const{code:e}=t;if(!Number.isInteger(e)||e>-32005||e<-32099)throw new Error('"code" must be an integer such that: -32099 <= code <= -32005');return Pt(e,t)},invalidInput:t=>Pt(wt.errorCodes.rpc.invalidInput,t),resourceNotFound:t=>Pt(wt.errorCodes.rpc.resourceNotFound,t),resourceUnavailable:t=>Pt(wt.errorCodes.rpc.resourceUnavailable,t),transactionRejected:t=>Pt(wt.errorCodes.rpc.transactionRejected,t),methodNotSupported:t=>Pt(wt.errorCodes.rpc.methodNotSupported,t),limitExceeded:t=>Pt(wt.errorCodes.rpc.limitExceeded,t)},provider:{userRejectedRequest:t=>mi(wt.errorCodes.provider.userRejectedRequest,t),unauthorized:t=>mi(wt.errorCodes.provider.unauthorized,t),unsupportedMethod:t=>mi(wt.errorCodes.provider.unsupportedMethod,t),disconnected:t=>mi(wt.errorCodes.provider.disconnected,t),chainDisconnected:t=>mi(wt.errorCodes.provider.chainDisconnected,t),custom:t=>{if(!t||typeof t!="object"||Array.isArray(t))throw new Error("Ethereum Provider custom errors must provide single object argument.");const{code:e,message:r,data:n}=t;if(!r||typeof r!="string")throw new Error('"message" must be a nonempty string');return new du.EthereumProviderError(e,r,n)}}};function Pt(t,e){const[r,n]=Rh(e);return new du.EthereumRpcError(t,r||Ih.getMessageFromCode(t),n)}function mi(t,e){const[r,n]=Rh(e);return new du.EthereumProviderError(t,r||Ih.getMessageFromCode(t),n)}function Rh(t){if(t){if(typeof t=="string")return[t];if(typeof t=="object"&&!Array.isArray(t)){const{message:e,data:r}=t;if(e&&typeof e!="string")throw new Error("Must specify string message.");return[e||void 0,r]}}return[]}(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.getMessageFromCode=t.serializeError=t.EthereumProviderError=t.EthereumRpcError=t.ethErrors=t.errorCodes=void 0;const e=kr;Object.defineProperty(t,"EthereumRpcError",{enumerable:!0,get:function(){return e.EthereumRpcError}}),Object.defineProperty(t,"EthereumProviderError",{enumerable:!0,get:function(){return e.EthereumProviderError}});const r=fu;Object.defineProperty(t,"serializeError",{enumerable:!0,get:function(){return r.serializeError}}),Object.defineProperty(t,"getMessageFromCode",{enumerable:!0,get:function(){return r.getMessageFromCode}});const n=qs;Object.defineProperty(t,"ethErrors",{enumerable:!0,get:function(){return n.ethErrors}});const i=Nr;Object.defineProperty(t,"errorCodes",{enumerable:!0,get:function(){return i.errorCodes}})})(hu);var Pe={},Gs={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.Web3Method=void 0,function(e){e.requestEthereumAccounts="requestEthereumAccounts",e.signEthereumMessage="signEthereumMessage",e.signEthereumTransaction="signEthereumTransaction",e.submitEthereumTransaction="submitEthereumTransaction",e.ethereumAddressFromSignedMessage="ethereumAddressFromSignedMessage",e.scanQRCode="scanQRCode",e.generic="generic",e.childRequestEthereumAccounts="childRequestEthereumAccounts",e.addEthereumChain="addEthereumChain",e.switchEthereumChain="switchEthereumChain",e.makeEthereumJSONRPCRequest="makeEthereumJSONRPCRequest",e.watchAsset="watchAsset",e.selectProvider="selectProvider"}(t.Web3Method||(t.Web3Method={}))})(Gs);Object.defineProperty(Pe,"__esModule",{value:!0});Pe.EthereumAddressFromSignedMessageResponse=Pe.SubmitEthereumTransactionResponse=Pe.SignEthereumTransactionResponse=Pe.SignEthereumMessageResponse=Pe.isRequestEthereumAccountsResponse=Pe.SelectProviderResponse=Pe.WatchAssetReponse=Pe.RequestEthereumAccountsResponse=Pe.SwitchEthereumChainResponse=Pe.AddEthereumChainResponse=Pe.isErrorResponse=void 0;const pr=Gs;function lp(t){var e,r;return((e=t)===null||e===void 0?void 0:e.method)!==void 0&&((r=t)===null||r===void 0?void 0:r.errorMessage)!==void 0}Pe.isErrorResponse=lp;function hp(t){return{method:pr.Web3Method.addEthereumChain,result:t}}Pe.AddEthereumChainResponse=hp;function fp(t){return{method:pr.Web3Method.switchEthereumChain,result:t}}Pe.SwitchEthereumChainResponse=fp;function dp(t){return{method:pr.Web3Method.requestEthereumAccounts,result:t}}Pe.RequestEthereumAccountsResponse=dp;function pp(t){return{method:pr.Web3Method.watchAsset,result:t}}Pe.WatchAssetReponse=pp;function gp(t){return{method:pr.Web3Method.selectProvider,result:t}}Pe.SelectProviderResponse=gp;function bp(t){return t&&t.method===pr.Web3Method.requestEthereumAccounts}Pe.isRequestEthereumAccountsResponse=bp;function vp(t){return{method:pr.Web3Method.signEthereumMessage,result:t}}Pe.SignEthereumMessageResponse=vp;function mp(t){return{method:pr.Web3Method.signEthereumTransaction,result:t}}Pe.SignEthereumTransactionResponse=mp;function yp(t){return{method:pr.Web3Method.submitEthereumTransaction,result:t}}Pe.SubmitEthereumTransactionResponse=yp;function _p(t){return{method:pr.Web3Method.ethereumAddressFromSignedMessage,result:t}}Pe.EthereumAddressFromSignedMessageResponse=_p;var ai={};Object.defineProperty(ai,"__esModule",{value:!0});ai.LIB_VERSION=void 0;ai.LIB_VERSION="3.7.2";(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.getErrorCode=t.serializeError=t.standardErrors=t.standardErrorMessage=t.standardErrorCodes=void 0;const e=hu,r=Pe,n=ai;t.standardErrorCodes=Object.freeze(Object.assign(Object.assign({},e.errorCodes),{provider:Object.freeze(Object.assign(Object.assign({},e.errorCodes.provider),{unsupportedChain:4902}))}));function i(p){return p!==void 0?(0,e.getMessageFromCode)(p):"Unknown error"}t.standardErrorMessage=i,t.standardErrors=Object.freeze(Object.assign(Object.assign({},e.ethErrors),{provider:Object.freeze(Object.assign(Object.assign({},e.ethErrors.provider),{unsupportedChain:(p="")=>e.ethErrors.provider.custom({code:t.standardErrorCodes.provider.unsupportedChain,message:`Unrecognized chain ID ${p}. Try adding the chain using wallet_addEthereumChain first.`})}))}));function s(p,g){const y=(0,e.serializeError)(o(p),{shouldIncludeStack:!0}),I=new URL("https://docs.cloud.coinbase.com/wallet-sdk/docs/errors");I.searchParams.set("version",n.LIB_VERSION),I.searchParams.set("code",y.code.toString());const T=a(y.data,g);return T&&I.searchParams.set("method",T),I.searchParams.set("message",y.message),Object.assign(Object.assign({},y),{docUrl:I.href})}t.serializeError=s;function o(p){return typeof p=="string"?{message:p,code:t.standardErrorCodes.rpc.internal}:(0,r.isErrorResponse)(p)?Object.assign(Object.assign({},p),{message:p.errorMessage,code:p.errorCode,data:{method:p.method,result:p.result}}):p}function a(p,g){var y;const I=(y=p)===null||y===void 0?void 0:y.method;if(I)return I;if(g!==void 0)return typeof g=="string"?g:Array.isArray(g)?g.length>0?g[0].method:void 0:g.method}function c(p){var g;if(typeof p=="number")return p;if(l(p))return(g=p.code)!==null&&g!==void 0?g:p.errorCode}t.getErrorCode=c;function l(p){return typeof p=="object"&&p!==null&&(typeof p.code=="number"||typeof p.errorCode=="number")}})(ji);var ui={},Ah={exports:{}},$a={exports:{}};typeof Object.create=="function"?$a.exports=function(e,r){r&&(e.super_=r,e.prototype=Object.create(r.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:$a.exports=function(e,r){if(r){e.super_=r;var n=function(){};n.prototype=r.prototype,e.prototype=new n,e.prototype.constructor=e}};var Xt=$a.exports,Fa={exports:{}},$i={},Js={};Js.byteLength=Sp;Js.toByteArray=Mp;Js.fromByteArray=Rp;var ur=[],$t=[],wp=typeof Uint8Array<"u"?Uint8Array:Array,Xo="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(var Tn=0,Ep=Xo.length;Tn<Ep;++Tn)ur[Tn]=Xo[Tn],$t[Xo.charCodeAt(Tn)]=Tn;$t["-".charCodeAt(0)]=62;$t["_".charCodeAt(0)]=63;function Th(t){var e=t.length;if(e%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=t.indexOf("=");r===-1&&(r=e);var n=r===e?0:4-r%4;return[r,n]}function Sp(t){var e=Th(t),r=e[0],n=e[1];return(r+n)*3/4-n}function xp(t,e,r){return(e+r)*3/4-r}function Mp(t){var e,r=Th(t),n=r[0],i=r[1],s=new wp(xp(t,n,i)),o=0,a=i>0?n-4:n,c;for(c=0;c<a;c+=4)e=$t[t.charCodeAt(c)]<<18|$t[t.charCodeAt(c+1)]<<12|$t[t.charCodeAt(c+2)]<<6|$t[t.charCodeAt(c+3)],s[o++]=e>>16&255,s[o++]=e>>8&255,s[o++]=e&255;return i===2&&(e=$t[t.charCodeAt(c)]<<2|$t[t.charCodeAt(c+1)]>>4,s[o++]=e&255),i===1&&(e=$t[t.charCodeAt(c)]<<10|$t[t.charCodeAt(c+1)]<<4|$t[t.charCodeAt(c+2)]>>2,s[o++]=e>>8&255,s[o++]=e&255),s}function Cp(t){return ur[t>>18&63]+ur[t>>12&63]+ur[t>>6&63]+ur[t&63]}function Ip(t,e,r){for(var n,i=[],s=e;s<r;s+=3)n=(t[s]<<16&16711680)+(t[s+1]<<8&65280)+(t[s+2]&255),i.push(Cp(n));return i.join("")}function Rp(t){for(var e,r=t.length,n=r%3,i=[],s=16383,o=0,a=r-n;o<a;o+=s)i.push(Ip(t,o,o+s>a?a:o+s));return n===1?(e=t[r-1],i.push(ur[e>>2]+ur[e<<4&63]+"==")):n===2&&(e=(t[r-2]<<8)+t[r-1],i.push(ur[e>>10]+ur[e>>4&63]+ur[e<<2&63]+"=")),i.join("")}var pu={};/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */pu.read=function(t,e,r,n,i){var s,o,a=i*8-n-1,c=(1<<a)-1,l=c>>1,p=-7,g=r?i-1:0,y=r?-1:1,I=t[e+g];for(g+=y,s=I&(1<<-p)-1,I>>=-p,p+=a;p>0;s=s*256+t[e+g],g+=y,p-=8);for(o=s&(1<<-p)-1,s>>=-p,p+=n;p>0;o=o*256+t[e+g],g+=y,p-=8);if(s===0)s=1-l;else{if(s===c)return o?NaN:(I?-1:1)*(1/0);o=o+Math.pow(2,n),s=s-l}return(I?-1:1)*o*Math.pow(2,s-n)};pu.write=function(t,e,r,n,i,s){var o,a,c,l=s*8-i-1,p=(1<<l)-1,g=p>>1,y=i===23?Math.pow(2,-24)-Math.pow(2,-77):0,I=n?0:s-1,T=n?1:-1,D=e<0||e===0&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(a=isNaN(e)?1:0,o=p):(o=Math.floor(Math.log(e)/Math.LN2),e*(c=Math.pow(2,-o))<1&&(o--,c*=2),o+g>=1?e+=y/c:e+=y*Math.pow(2,1-g),e*c>=2&&(o++,c/=2),o+g>=p?(a=0,o=p):o+g>=1?(a=(e*c-1)*Math.pow(2,i),o=o+g):(a=e*Math.pow(2,g-1)*Math.pow(2,i),o=0));i>=8;t[r+I]=a&255,I+=T,a/=256,i-=8);for(o=o<<i|a,l+=i;l>0;t[r+I]=o&255,I+=T,o/=256,l-=8);t[r+I-T]|=D*128};/*!
2
2
  * The buffer module from node.js, for the browser.
3
3
  *
4
4
  * @author Feross Aboukhadijeh <https://feross.org>
@@ -25,4 +25,4 @@ ${Sa(e)}`,{request:e})}}Xi.JsonRpcEngine=br;function Sa(t){return JSON.stringify
25
25
  </svg>
26
26
  `;var Ao={};Object.defineProperty(Ao,"__esModule",{value:!0});Ao.StatusDotIcon=void 0;const hh=Lt;function WS(t){return(0,hh.h)("svg",Object.assign({width:"10",height:"10",viewBox:"0 0 10 10",xmlns:"http://www.w3.org/2000/svg"},t),(0,hh.h)("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M2.29995 4.99995C2.29995 5.57985 1.82985 6.04995 1.24995 6.04995C0.670052 6.04995 0.199951 5.57985 0.199951 4.99995C0.199951 4.42005 0.670052 3.94995 1.24995 3.94995C1.82985 3.94995 2.29995 4.42005 2.29995 4.99995ZM4.99995 6.04995C5.57985 6.04995 6.04995 5.57985 6.04995 4.99995C6.04995 4.42005 5.57985 3.94995 4.99995 3.94995C4.42005 3.94995 3.94995 4.42005 3.94995 4.99995C3.94995 5.57985 4.42005 6.04995 4.99995 6.04995ZM8.74995 6.04995C9.32985 6.04995 9.79995 5.57985 9.79995 4.99995C9.79995 4.42005 9.32985 3.94995 8.74995 3.94995C8.17005 3.94995 7.69995 4.42005 7.69995 4.99995C7.69995 5.57985 8.17005 6.04995 8.74995 6.04995Z"}))}Ao.StatusDotIcon=WS;var To={};function x0(t){this.mode=kt.MODE_8BIT_BYTE,this.data=t,this.parsedData=[];for(var e=0,r=this.data.length;e<r;e++){var n=[],i=this.data.charCodeAt(e);i>65536?(n[0]=240|(i&1835008)>>>18,n[1]=128|(i&258048)>>>12,n[2]=128|(i&4032)>>>6,n[3]=128|i&63):i>2048?(n[0]=224|(i&61440)>>>12,n[1]=128|(i&4032)>>>6,n[2]=128|i&63):i>128?(n[0]=192|(i&1984)>>>6,n[1]=128|i&63):n[0]=i,this.parsedData.push(n)}this.parsedData=Array.prototype.concat.apply([],this.parsedData),this.parsedData.length!=this.data.length&&(this.parsedData.unshift(191),this.parsedData.unshift(187),this.parsedData.unshift(239))}x0.prototype={getLength:function(t){return this.parsedData.length},write:function(t){for(var e=0,r=this.parsedData.length;e<r;e++)t.put(this.parsedData[e],8)}};function dr(t,e){this.typeNumber=t,this.errorCorrectLevel=e,this.modules=null,this.moduleCount=0,this.dataCache=null,this.dataList=[]}dr.prototype={addData:function(t){var e=new x0(t);this.dataList.push(e),this.dataCache=null},isDark:function(t,e){if(t<0||this.moduleCount<=t||e<0||this.moduleCount<=e)throw new Error(t+","+e);return this.modules[t][e]},getModuleCount:function(){return this.moduleCount},make:function(){this.makeImpl(!1,this.getBestMaskPattern())},makeImpl:function(t,e){this.moduleCount=this.typeNumber*4+17,this.modules=new Array(this.moduleCount);for(var r=0;r<this.moduleCount;r++){this.modules[r]=new Array(this.moduleCount);for(var n=0;n<this.moduleCount;n++)this.modules[r][n]=null}this.setupPositionProbePattern(0,0),this.setupPositionProbePattern(this.moduleCount-7,0),this.setupPositionProbePattern(0,this.moduleCount-7),this.setupPositionAdjustPattern(),this.setupTimingPattern(),this.setupTypeInfo(t,e),this.typeNumber>=7&&this.setupTypeNumber(t),this.dataCache==null&&(this.dataCache=dr.createData(this.typeNumber,this.errorCorrectLevel,this.dataList)),this.mapData(this.dataCache,e)},setupPositionProbePattern:function(t,e){for(var r=-1;r<=7;r++)if(!(t+r<=-1||this.moduleCount<=t+r))for(var n=-1;n<=7;n++)e+n<=-1||this.moduleCount<=e+n||(0<=r&&r<=6&&(n==0||n==6)||0<=n&&n<=6&&(r==0||r==6)||2<=r&&r<=4&&2<=n&&n<=4?this.modules[t+r][e+n]=!0:this.modules[t+r][e+n]=!1)},getBestMaskPattern:function(){for(var t=0,e=0,r=0;r<8;r++){this.makeImpl(!0,r);var n=tt.getLostPoint(this);(r==0||t>n)&&(t=n,e=r)}return e},createMovieClip:function(t,e,r){var n=t.createEmptyMovieClip(e,r),i=1;this.make();for(var s=0;s<this.modules.length;s++)for(var o=s*i,a=0;a<this.modules[s].length;a++){var c=a*i,l=this.modules[s][a];l&&(n.beginFill(0,100),n.moveTo(c,o),n.lineTo(c+i,o),n.lineTo(c+i,o+i),n.lineTo(c,o+i),n.endFill())}return n},setupTimingPattern:function(){for(var t=8;t<this.moduleCount-8;t++)this.modules[t][6]==null&&(this.modules[t][6]=t%2==0);for(var e=8;e<this.moduleCount-8;e++)this.modules[6][e]==null&&(this.modules[6][e]=e%2==0)},setupPositionAdjustPattern:function(){for(var t=tt.getPatternPosition(this.typeNumber),e=0;e<t.length;e++)for(var r=0;r<t.length;r++){var n=t[e],i=t[r];if(this.modules[n][i]==null)for(var s=-2;s<=2;s++)for(var o=-2;o<=2;o++)s==-2||s==2||o==-2||o==2||s==0&&o==0?this.modules[n+s][i+o]=!0:this.modules[n+s][i+o]=!1}},setupTypeNumber:function(t){for(var e=tt.getBCHTypeNumber(this.typeNumber),r=0;r<18;r++){var n=!t&&(e>>r&1)==1;this.modules[Math.floor(r/3)][r%3+this.moduleCount-8-3]=n}for(var r=0;r<18;r++){var n=!t&&(e>>r&1)==1;this.modules[r%3+this.moduleCount-8-3][Math.floor(r/3)]=n}},setupTypeInfo:function(t,e){for(var r=this.errorCorrectLevel<<3|e,n=tt.getBCHTypeInfo(r),i=0;i<15;i++){var s=!t&&(n>>i&1)==1;i<6?this.modules[i][8]=s:i<8?this.modules[i+1][8]=s:this.modules[this.moduleCount-15+i][8]=s}for(var i=0;i<15;i++){var s=!t&&(n>>i&1)==1;i<8?this.modules[8][this.moduleCount-i-1]=s:i<9?this.modules[8][15-i-1+1]=s:this.modules[8][15-i-1]=s}this.modules[this.moduleCount-8][8]=!t},mapData:function(t,e){for(var r=-1,n=this.moduleCount-1,i=7,s=0,o=this.moduleCount-1;o>0;o-=2)for(o==6&&o--;;){for(var a=0;a<2;a++)if(this.modules[n][o-a]==null){var c=!1;s<t.length&&(c=(t[s]>>>i&1)==1);var l=tt.getMask(e,n,o-a);l&&(c=!c),this.modules[n][o-a]=c,i--,i==-1&&(s++,i=7)}if(n+=r,n<0||this.moduleCount<=n){n-=r,r=-r;break}}}};dr.PAD0=236;dr.PAD1=17;dr.createData=function(t,e,r){for(var n=cr.getRSBlocks(t,e),i=new M0,s=0;s<r.length;s++){var o=r[s];i.put(o.mode,4),i.put(o.getLength(),tt.getLengthInBits(o.mode,t)),o.write(i)}for(var a=0,s=0;s<n.length;s++)a+=n[s].dataCount;if(i.getLengthInBits()>a*8)throw new Error("code length overflow. ("+i.getLengthInBits()+">"+a*8+")");for(i.getLengthInBits()+4<=a*8&&i.put(0,4);i.getLengthInBits()%8!=0;)i.putBit(!1);for(;!(i.getLengthInBits()>=a*8||(i.put(dr.PAD0,8),i.getLengthInBits()>=a*8));)i.put(dr.PAD1,8);return dr.createBytes(i,n)};dr.createBytes=function(t,e){for(var r=0,n=0,i=0,s=new Array(e.length),o=new Array(e.length),a=0;a<e.length;a++){var c=e[a].dataCount,l=e[a].totalCount-c;n=Math.max(n,c),i=Math.max(i,l),s[a]=new Array(c);for(var p=0;p<s[a].length;p++)s[a][p]=255&t.buffer[p+r];r+=c;var g=tt.getErrorCorrectPolynomial(l),y=new Vn(s[a],g.getLength()-1),I=y.mod(g);o[a]=new Array(g.getLength()-1);for(var p=0;p<o[a].length;p++){var T=p+I.getLength()-o[a].length;o[a][p]=T>=0?I.get(T):0}}for(var D=0,p=0;p<e.length;p++)D+=e[p].totalCount;for(var U=new Array(D),M=0,p=0;p<n;p++)for(var a=0;a<e.length;a++)p<s[a].length&&(U[M++]=s[a][p]);for(var p=0;p<i;p++)for(var a=0;a<e.length;a++)p<o[a].length&&(U[M++]=o[a][p]);return U};var kt={MODE_NUMBER:1,MODE_ALPHA_NUM:2,MODE_8BIT_BYTE:4,MODE_KANJI:8},Tr={L:1,M:0,Q:3,H:2},Mr={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7},tt={PATTERN_POSITION_TABLE:[[],[6,18],[6,22],[6,26],[6,30],[6,34],[6,22,38],[6,24,42],[6,26,46],[6,28,50],[6,30,54],[6,32,58],[6,34,62],[6,26,46,66],[6,26,48,70],[6,26,50,74],[6,30,54,78],[6,30,56,82],[6,30,58,86],[6,34,62,90],[6,28,50,72,94],[6,26,50,74,98],[6,30,54,78,102],[6,28,54,80,106],[6,32,58,84,110],[6,30,58,86,114],[6,34,62,90,118],[6,26,50,74,98,122],[6,30,54,78,102,126],[6,26,52,78,104,130],[6,30,56,82,108,134],[6,34,60,86,112,138],[6,30,58,86,114,142],[6,34,62,90,118,146],[6,30,54,78,102,126,150],[6,24,50,76,102,128,154],[6,28,54,80,106,132,158],[6,32,58,84,110,136,162],[6,26,54,82,110,138,166],[6,30,58,86,114,142,170]],G15:1335,G18:7973,G15_MASK:21522,getBCHTypeInfo:function(t){for(var e=t<<10;tt.getBCHDigit(e)-tt.getBCHDigit(tt.G15)>=0;)e^=tt.G15<<tt.getBCHDigit(e)-tt.getBCHDigit(tt.G15);return(t<<10|e)^tt.G15_MASK},getBCHTypeNumber:function(t){for(var e=t<<12;tt.getBCHDigit(e)-tt.getBCHDigit(tt.G18)>=0;)e^=tt.G18<<tt.getBCHDigit(e)-tt.getBCHDigit(tt.G18);return t<<12|e},getBCHDigit:function(t){for(var e=0;t!=0;)e++,t>>>=1;return e},getPatternPosition:function(t){return tt.PATTERN_POSITION_TABLE[t-1]},getMask:function(t,e,r){switch(t){case Mr.PATTERN000:return(e+r)%2==0;case Mr.PATTERN001:return e%2==0;case Mr.PATTERN010:return r%3==0;case Mr.PATTERN011:return(e+r)%3==0;case Mr.PATTERN100:return(Math.floor(e/2)+Math.floor(r/3))%2==0;case Mr.PATTERN101:return e*r%2+e*r%3==0;case Mr.PATTERN110:return(e*r%2+e*r%3)%2==0;case Mr.PATTERN111:return(e*r%3+(e+r)%2)%2==0;default:throw new Error("bad maskPattern:"+t)}},getErrorCorrectPolynomial:function(t){for(var e=new Vn([1],0),r=0;r<t;r++)e=e.multiply(new Vn([1,bt.gexp(r)],0));return e},getLengthInBits:function(t,e){if(1<=e&&e<10)switch(t){case kt.MODE_NUMBER:return 10;case kt.MODE_ALPHA_NUM:return 9;case kt.MODE_8BIT_BYTE:return 8;case kt.MODE_KANJI:return 8;default:throw new Error("mode:"+t)}else if(e<27)switch(t){case kt.MODE_NUMBER:return 12;case kt.MODE_ALPHA_NUM:return 11;case kt.MODE_8BIT_BYTE:return 16;case kt.MODE_KANJI:return 10;default:throw new Error("mode:"+t)}else if(e<41)switch(t){case kt.MODE_NUMBER:return 14;case kt.MODE_ALPHA_NUM:return 13;case kt.MODE_8BIT_BYTE:return 16;case kt.MODE_KANJI:return 12;default:throw new Error("mode:"+t)}else throw new Error("type:"+e)},getLostPoint:function(t){for(var e=t.getModuleCount(),r=0,n=0;n<e;n++)for(var i=0;i<e;i++){for(var s=0,o=t.isDark(n,i),a=-1;a<=1;a++)if(!(n+a<0||e<=n+a))for(var c=-1;c<=1;c++)i+c<0||e<=i+c||a==0&&c==0||o==t.isDark(n+a,i+c)&&s++;s>5&&(r+=3+s-5)}for(var n=0;n<e-1;n++)for(var i=0;i<e-1;i++){var l=0;t.isDark(n,i)&&l++,t.isDark(n+1,i)&&l++,t.isDark(n,i+1)&&l++,t.isDark(n+1,i+1)&&l++,(l==0||l==4)&&(r+=3)}for(var n=0;n<e;n++)for(var i=0;i<e-6;i++)t.isDark(n,i)&&!t.isDark(n,i+1)&&t.isDark(n,i+2)&&t.isDark(n,i+3)&&t.isDark(n,i+4)&&!t.isDark(n,i+5)&&t.isDark(n,i+6)&&(r+=40);for(var i=0;i<e;i++)for(var n=0;n<e-6;n++)t.isDark(n,i)&&!t.isDark(n+1,i)&&t.isDark(n+2,i)&&t.isDark(n+3,i)&&t.isDark(n+4,i)&&!t.isDark(n+5,i)&&t.isDark(n+6,i)&&(r+=40);for(var p=0,i=0;i<e;i++)for(var n=0;n<e;n++)t.isDark(n,i)&&p++;var g=Math.abs(100*p/e/e-50)/5;return r+=g*10,r}},bt={glog:function(t){if(t<1)throw new Error("glog("+t+")");return bt.LOG_TABLE[t]},gexp:function(t){for(;t<0;)t+=255;for(;t>=256;)t-=255;return bt.EXP_TABLE[t]},EXP_TABLE:new Array(256),LOG_TABLE:new Array(256)};for(var yt=0;yt<8;yt++)bt.EXP_TABLE[yt]=1<<yt;for(var yt=8;yt<256;yt++)bt.EXP_TABLE[yt]=bt.EXP_TABLE[yt-4]^bt.EXP_TABLE[yt-5]^bt.EXP_TABLE[yt-6]^bt.EXP_TABLE[yt-8];for(var yt=0;yt<255;yt++)bt.LOG_TABLE[bt.EXP_TABLE[yt]]=yt;function Vn(t,e){if(t.length==null)throw new Error(t.length+"/"+e);for(var r=0;r<t.length&&t[r]==0;)r++;this.num=new Array(t.length-r+e);for(var n=0;n<t.length-r;n++)this.num[n]=t[n+r]}Vn.prototype={get:function(t){return this.num[t]},getLength:function(){return this.num.length},multiply:function(t){for(var e=new Array(this.getLength()+t.getLength()-1),r=0;r<this.getLength();r++)for(var n=0;n<t.getLength();n++)e[r+n]^=bt.gexp(bt.glog(this.get(r))+bt.glog(t.get(n)));return new Vn(e,0)},mod:function(t){if(this.getLength()-t.getLength()<0)return this;for(var e=bt.glog(this.get(0))-bt.glog(t.get(0)),r=new Array(this.getLength()),n=0;n<this.getLength();n++)r[n]=this.get(n);for(var n=0;n<t.getLength();n++)r[n]^=bt.gexp(bt.glog(t.get(n))+e);return new Vn(r,0).mod(t)}};function cr(t,e){this.totalCount=t,this.dataCount=e}cr.RS_BLOCK_TABLE=[[1,26,19],[1,26,16],[1,26,13],[1,26,9],[1,44,34],[1,44,28],[1,44,22],[1,44,16],[1,70,55],[1,70,44],[2,35,17],[2,35,13],[1,100,80],[2,50,32],[2,50,24],[4,25,9],[1,134,108],[2,67,43],[2,33,15,2,34,16],[2,33,11,2,34,12],[2,86,68],[4,43,27],[4,43,19],[4,43,15],[2,98,78],[4,49,31],[2,32,14,4,33,15],[4,39,13,1,40,14],[2,121,97],[2,60,38,2,61,39],[4,40,18,2,41,19],[4,40,14,2,41,15],[2,146,116],[3,58,36,2,59,37],[4,36,16,4,37,17],[4,36,12,4,37,13],[2,86,68,2,87,69],[4,69,43,1,70,44],[6,43,19,2,44,20],[6,43,15,2,44,16],[4,101,81],[1,80,50,4,81,51],[4,50,22,4,51,23],[3,36,12,8,37,13],[2,116,92,2,117,93],[6,58,36,2,59,37],[4,46,20,6,47,21],[7,42,14,4,43,15],[4,133,107],[8,59,37,1,60,38],[8,44,20,4,45,21],[12,33,11,4,34,12],[3,145,115,1,146,116],[4,64,40,5,65,41],[11,36,16,5,37,17],[11,36,12,5,37,13],[5,109,87,1,110,88],[5,65,41,5,66,42],[5,54,24,7,55,25],[11,36,12],[5,122,98,1,123,99],[7,73,45,3,74,46],[15,43,19,2,44,20],[3,45,15,13,46,16],[1,135,107,5,136,108],[10,74,46,1,75,47],[1,50,22,15,51,23],[2,42,14,17,43,15],[5,150,120,1,151,121],[9,69,43,4,70,44],[17,50,22,1,51,23],[2,42,14,19,43,15],[3,141,113,4,142,114],[3,70,44,11,71,45],[17,47,21,4,48,22],[9,39,13,16,40,14],[3,135,107,5,136,108],[3,67,41,13,68,42],[15,54,24,5,55,25],[15,43,15,10,44,16],[4,144,116,4,145,117],[17,68,42],[17,50,22,6,51,23],[19,46,16,6,47,17],[2,139,111,7,140,112],[17,74,46],[7,54,24,16,55,25],[34,37,13],[4,151,121,5,152,122],[4,75,47,14,76,48],[11,54,24,14,55,25],[16,45,15,14,46,16],[6,147,117,4,148,118],[6,73,45,14,74,46],[11,54,24,16,55,25],[30,46,16,2,47,17],[8,132,106,4,133,107],[8,75,47,13,76,48],[7,54,24,22,55,25],[22,45,15,13,46,16],[10,142,114,2,143,115],[19,74,46,4,75,47],[28,50,22,6,51,23],[33,46,16,4,47,17],[8,152,122,4,153,123],[22,73,45,3,74,46],[8,53,23,26,54,24],[12,45,15,28,46,16],[3,147,117,10,148,118],[3,73,45,23,74,46],[4,54,24,31,55,25],[11,45,15,31,46,16],[7,146,116,7,147,117],[21,73,45,7,74,46],[1,53,23,37,54,24],[19,45,15,26,46,16],[5,145,115,10,146,116],[19,75,47,10,76,48],[15,54,24,25,55,25],[23,45,15,25,46,16],[13,145,115,3,146,116],[2,74,46,29,75,47],[42,54,24,1,55,25],[23,45,15,28,46,16],[17,145,115],[10,74,46,23,75,47],[10,54,24,35,55,25],[19,45,15,35,46,16],[17,145,115,1,146,116],[14,74,46,21,75,47],[29,54,24,19,55,25],[11,45,15,46,46,16],[13,145,115,6,146,116],[14,74,46,23,75,47],[44,54,24,7,55,25],[59,46,16,1,47,17],[12,151,121,7,152,122],[12,75,47,26,76,48],[39,54,24,14,55,25],[22,45,15,41,46,16],[6,151,121,14,152,122],[6,75,47,34,76,48],[46,54,24,10,55,25],[2,45,15,64,46,16],[17,152,122,4,153,123],[29,74,46,14,75,47],[49,54,24,10,55,25],[24,45,15,46,46,16],[4,152,122,18,153,123],[13,74,46,32,75,47],[48,54,24,14,55,25],[42,45,15,32,46,16],[20,147,117,4,148,118],[40,75,47,7,76,48],[43,54,24,22,55,25],[10,45,15,67,46,16],[19,148,118,6,149,119],[18,75,47,31,76,48],[34,54,24,34,55,25],[20,45,15,61,46,16]];cr.getRSBlocks=function(t,e){var r=cr.getRsBlockTable(t,e);if(r==null)throw new Error("bad rs block @ typeNumber:"+t+"/errorCorrectLevel:"+e);for(var n=r.length/3,i=[],s=0;s<n;s++)for(var o=r[s*3+0],a=r[s*3+1],c=r[s*3+2],l=0;l<o;l++)i.push(new cr(a,c));return i};cr.getRsBlockTable=function(t,e){switch(e){case Tr.L:return cr.RS_BLOCK_TABLE[(t-1)*4+0];case Tr.M:return cr.RS_BLOCK_TABLE[(t-1)*4+1];case Tr.Q:return cr.RS_BLOCK_TABLE[(t-1)*4+2];case Tr.H:return cr.RS_BLOCK_TABLE[(t-1)*4+3];default:return}};function M0(){this.buffer=[],this.length=0}M0.prototype={get:function(t){var e=Math.floor(t/8);return(this.buffer[e]>>>7-t%8&1)==1},put:function(t,e){for(var r=0;r<e;r++)this.putBit((t>>>e-r-1&1)==1)},getLengthInBits:function(){return this.length},putBit:function(t){var e=Math.floor(this.length/8);this.buffer.length<=e&&this.buffer.push(0),t&&(this.buffer[e]|=128>>>this.length%8),this.length++}};var Ta=[[17,14,11,7],[32,26,20,14],[53,42,32,24],[78,62,46,34],[106,84,60,44],[134,106,74,58],[154,122,86,64],[192,152,108,84],[230,180,130,98],[271,213,151,119],[321,251,177,137],[367,287,203,155],[425,331,241,177],[458,362,258,194],[520,412,292,220],[586,450,322,250],[644,504,364,280],[718,560,394,310],[792,624,442,338],[858,666,482,382],[929,711,509,403],[1003,779,565,439],[1091,857,611,461],[1171,911,661,511],[1273,997,715,535],[1367,1059,751,593],[1465,1125,805,625],[1528,1190,868,658],[1628,1264,908,698],[1732,1370,982,742],[1840,1452,1030,790],[1952,1538,1112,842],[2068,1628,1168,898],[2188,1722,1228,958],[2303,1809,1283,983],[2431,1911,1351,1051],[2563,1989,1423,1093],[2699,2099,1499,1139],[2809,2213,1579,1219],[2953,2331,1663,1273]];function C0(t){if(this.options={padding:4,width:256,height:256,typeNumber:4,color:"#000000",background:"#ffffff",ecl:"M",image:{svg:"",width:0,height:0}},typeof t=="string"&&(t={content:t}),t)for(var e in t)this.options[e]=t[e];if(typeof this.options.content!="string")throw new Error("Expected 'content' as string!");if(this.options.content.length===0)throw new Error("Expected 'content' to be non-empty!");if(!(this.options.padding>=0))throw new Error("Expected 'padding' value to be non-negative!");if(!(this.options.width>0)||!(this.options.height>0))throw new Error("Expected 'width' or 'height' value to be higher than zero!");function r(c){switch(c){case"L":return Tr.L;case"M":return Tr.M;case"Q":return Tr.Q;case"H":return Tr.H;default:throw new Error("Unknwon error correction level: "+c)}}function n(c,l){for(var p=i(c),g=1,y=0,I=0,T=Ta.length;I<=T;I++){var D=Ta[I];if(!D)throw new Error("Content too long: expected "+y+" but got "+p);switch(l){case"L":y=D[0];break;case"M":y=D[1];break;case"Q":y=D[2];break;case"H":y=D[3];break;default:throw new Error("Unknwon error correction level: "+l)}if(p<=y)break;g++}if(g>Ta.length)throw new Error("Content too long");return g}function i(c){var l=encodeURI(c).toString().replace(/\%[0-9a-fA-F]{2}/g,"a");return l.length+(l.length!=c?3:0)}var s=this.options.content,o=n(s,this.options.ecl),a=r(this.options.ecl);this.qrcode=new dr(o,a),this.qrcode.addData(s),this.qrcode.make()}C0.prototype.svg=function(t){var e=this.options||{},r=this.qrcode.modules;typeof t>"u"&&(t={container:e.container||"svg"});for(var n=typeof e.pretty<"u"?!!e.pretty:!0,i=n?" ":"",s=n?`\r
27
27
  `:"",o=e.width,a=e.height,c=r.length,l=o/(c+2*e.padding),p=a/(c+2*e.padding),g=typeof e.join<"u"?!!e.join:!1,y=typeof e.swap<"u"?!!e.swap:!1,I=typeof e.xmlDeclaration<"u"?!!e.xmlDeclaration:!0,T=typeof e.predefined<"u"?!!e.predefined:!1,D=T?i+'<defs><path id="qrmodule" d="M0 0 h'+p+" v"+l+' H0 z" style="fill:'+e.color+';shape-rendering:crispEdges;" /></defs>'+s:"",U=i+'<rect x="0" y="0" width="'+o+'" height="'+a+'" style="fill:'+e.background+';shape-rendering:crispEdges;"/>'+s,M="",N="",j=0;j<c;j++)for(var H=0;H<c;H++){var F=r[H][j];if(F){var z=H*l+e.padding*l,X=j*p+e.padding*p;if(y){var K=z;z=X,X=K}if(g){var J=l+z,ne=p+X;z=Number.isInteger(z)?Number(z):z.toFixed(2),X=Number.isInteger(X)?Number(X):X.toFixed(2),J=Number.isInteger(J)?Number(J):J.toFixed(2),ne=Number.isInteger(ne)?Number(ne):ne.toFixed(2),N+="M"+z+","+X+" V"+ne+" H"+J+" V"+X+" H"+z+" Z "}else T?M+=i+'<use x="'+z.toString()+'" y="'+X.toString()+'" href="#qrmodule" />'+s:M+=i+'<rect x="'+z.toString()+'" y="'+X.toString()+'" width="'+l+'" height="'+p+'" style="fill:'+e.color+';shape-rendering:crispEdges;"/>'+s}}g&&(M=i+'<path x="0" y="0" style="fill:'+e.color+';shape-rendering:crispEdges;" d="'+N+'" />');let oe="";if(this.options.image!==void 0&&this.options.image.svg){const w=o*this.options.image.width/100,u=a*this.options.image.height/100,b=o/2-w/2,m=a/2-u/2;oe+=`<svg x="${b}" y="${m}" width="${w}" height="${u}" viewBox="0 0 100 100" preserveAspectRatio="xMinYMin meet">`,oe+=this.options.image.svg+s,oe+="</svg>"}var ue="";switch(t.container){case"svg":I&&(ue+='<?xml version="1.0" standalone="yes"?>'+s),ue+='<svg xmlns="http://www.w3.org/2000/svg" version="1.1" width="'+o+'" height="'+a+'">'+s,ue+=D+U+M,ue+=oe,ue+="</svg>";break;case"svg-viewbox":I&&(ue+='<?xml version="1.0" standalone="yes"?>'+s),ue+='<svg xmlns="http://www.w3.org/2000/svg" version="1.1" viewBox="0 0 '+o+" "+a+'">'+s,ue+=D+U+M,ue+=oe,ue+="</svg>";break;case"g":ue+='<g width="'+o+'" height="'+a+'">'+s,ue+=D+U+M,ue+=oe,ue+="</g>";break;default:ue+=(D+U+M+oe).replace(/^\s+/,"");break}return ue};var VS=C0,zS=te&&te.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(To,"__esModule",{value:!0});To.QRCode=void 0;const qS=Lt,fh=us,GS=zS(VS),JS=t=>{const[e,r]=(0,fh.useState)("");return(0,fh.useEffect)(()=>{var n,i;const s=new GS.default({content:t.content,background:t.bgColor||"#ffffff",color:t.fgColor||"#000000",container:"svg",ecl:"M",width:(n=t.width)!==null&&n!==void 0?n:256,height:(i=t.height)!==null&&i!==void 0?i:256,padding:0,image:t.image}),o=ye.from(s.svg(),"utf8").toString("base64");r(`data:image/svg+xml;base64,${o}`)}),e?(0,qS.h)("img",{src:e,alt:"QR Code"}):null};To.QRCode=JS;var ko={},cc={};Object.defineProperty(cc,"__esModule",{value:!0});cc.default=".-cbwsdk-css-reset .-cbwsdk-spinner{display:inline-block}.-cbwsdk-css-reset .-cbwsdk-spinner svg{display:inline-block;animation:2s linear infinite -cbwsdk-spinner-svg}.-cbwsdk-css-reset .-cbwsdk-spinner svg circle{animation:1.9s ease-in-out infinite both -cbwsdk-spinner-circle;display:block;fill:rgba(0,0,0,0);stroke-dasharray:283;stroke-dashoffset:280;stroke-linecap:round;stroke-width:10px;transform-origin:50% 50%}@keyframes -cbwsdk-spinner-svg{0%{transform:rotateZ(0deg)}100%{transform:rotateZ(360deg)}}@keyframes -cbwsdk-spinner-circle{0%,25%{stroke-dashoffset:280;transform:rotate(0)}50%,75%{stroke-dashoffset:75;transform:rotate(45deg)}100%{stroke-dashoffset:280;transform:rotate(360deg)}}";var ZS=te&&te.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(ko,"__esModule",{value:!0});ko.Spinner=void 0;const ys=Lt,QS=ZS(cc),YS=t=>{var e;const r=(e=t.size)!==null&&e!==void 0?e:64,n=t.color||"#000";return(0,ys.h)("div",{class:"-cbwsdk-spinner"},(0,ys.h)("style",null,QS.default),(0,ys.h)("svg",{viewBox:"0 0 100 100",xmlns:"http://www.w3.org/2000/svg",style:{width:r,height:r}},(0,ys.h)("circle",{style:{cx:50,cy:50,r:45,stroke:n}})))};ko.Spinner=YS;var lc={};Object.defineProperty(lc,"__esModule",{value:!0});lc.default=".-cbwsdk-css-reset .-cbwsdk-connect-content{height:430px;width:700px;border-radius:12px;padding:30px}.-cbwsdk-css-reset .-cbwsdk-connect-content.light{background:#fff}.-cbwsdk-css-reset .-cbwsdk-connect-content.dark{background:#0a0b0d}.-cbwsdk-css-reset .-cbwsdk-connect-content-header{display:flex;align-items:center;justify-content:space-between;margin:0 0 30px}.-cbwsdk-css-reset .-cbwsdk-connect-content-heading{font-style:normal;font-weight:500;font-size:28px;line-height:36px;margin:0}.-cbwsdk-css-reset .-cbwsdk-connect-content-heading.light{color:#0a0b0d}.-cbwsdk-css-reset .-cbwsdk-connect-content-heading.dark{color:#fff}.-cbwsdk-css-reset .-cbwsdk-connect-content-layout{display:flex;flex-direction:row}.-cbwsdk-css-reset .-cbwsdk-connect-content-column-left{margin-right:30px;display:flex;flex-direction:column;justify-content:space-between}.-cbwsdk-css-reset .-cbwsdk-connect-content-column-right{flex:25%;margin-right:34px}.-cbwsdk-css-reset .-cbwsdk-connect-content-qr-wrapper{width:220px;height:220px;border-radius:12px;display:flex;justify-content:center;align-items:center;background:#fff}.-cbwsdk-css-reset .-cbwsdk-connect-content-qr-connecting{position:absolute;top:0;bottom:0;left:0;right:0;display:flex;flex-direction:column;align-items:center;justify-content:center}.-cbwsdk-css-reset .-cbwsdk-connect-content-qr-connecting.light{background-color:rgba(255,255,255,.95)}.-cbwsdk-css-reset .-cbwsdk-connect-content-qr-connecting.light>p{color:#0a0b0d}.-cbwsdk-css-reset .-cbwsdk-connect-content-qr-connecting.dark{background-color:rgba(10,11,13,.9)}.-cbwsdk-css-reset .-cbwsdk-connect-content-qr-connecting.dark>p{color:#fff}.-cbwsdk-css-reset .-cbwsdk-connect-content-qr-connecting>p{font-size:12px;font-weight:bold;margin-top:16px}.-cbwsdk-css-reset .-cbwsdk-connect-content-update-app{border-radius:8px;font-size:14px;line-height:20px;padding:12px;width:339px}.-cbwsdk-css-reset .-cbwsdk-connect-content-update-app.light{background:#eef0f3;color:#5b636e}.-cbwsdk-css-reset .-cbwsdk-connect-content-update-app.dark{background:#1e2025;color:#8a919e}.-cbwsdk-css-reset .-cbwsdk-cancel-button{-webkit-appearance:none;border:none;background:none;cursor:pointer;padding:0;margin:0}.-cbwsdk-css-reset .-cbwsdk-cancel-button-x{position:relative;display:block;cursor:pointer}.-cbwsdk-css-reset .-cbwsdk-wallet-steps{padding:0 0 0 16px;margin:0;width:100%;list-style:decimal}.-cbwsdk-css-reset .-cbwsdk-wallet-steps-item{list-style-type:decimal;display:list-item;font-style:normal;font-weight:400;font-size:16px;line-height:24px;margin-top:20px}.-cbwsdk-css-reset .-cbwsdk-wallet-steps-item.light{color:#0a0b0d}.-cbwsdk-css-reset .-cbwsdk-wallet-steps-item.dark{color:#fff}.-cbwsdk-css-reset .-cbwsdk-wallet-steps-item-wrapper{display:flex;align-items:center}.-cbwsdk-css-reset .-cbwsdk-wallet-steps-pad-left{margin-left:6px}.-cbwsdk-css-reset .-cbwsdk-wallet-steps-icon{display:flex;border-radius:50%;height:24px;width:24px}.-cbwsdk-css-reset .-cbwsdk-wallet-steps-icon svg{margin:auto;display:block}.-cbwsdk-css-reset .-cbwsdk-wallet-steps-icon.light{background:#0052ff}.-cbwsdk-css-reset .-cbwsdk-wallet-steps-icon.dark{background:#588af5}.-cbwsdk-css-reset .-cbwsdk-connect-item{align-items:center;display:flex;flex-direction:row;padding:16px 24px;gap:12px;cursor:pointer}.-cbwsdk-css-reset .-cbwsdk-connect-item.light{color:#0a0b0d}.-cbwsdk-css-reset .-cbwsdk-connect-item.light.selected{background:#f5f8ff;color:#0052ff}.-cbwsdk-css-reset .-cbwsdk-connect-item.dark{color:#fff}.-cbwsdk-css-reset .-cbwsdk-connect-item.dark.selected{background:#001033;color:#588af5}.-cbwsdk-css-reset .-cbwsdk-connect-item.selected{border-radius:100px;font-weight:600}.-cbwsdk-css-reset .-cbwsdk-connect-item-copy-wrapper{margin:0 4px 0 8px}.-cbwsdk-css-reset .-cbwsdk-connect-item-title{margin:0 0 0;font-size:16px;line-height:24px;font-weight:500}.-cbwsdk-css-reset .-cbwsdk-connect-item-description{font-weight:400;font-size:14px;line-height:20px;margin:0}";var vi=te&&te.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(fr,"__esModule",{value:!0});fr.CoinbaseAppSteps=fr.CoinbaseWalletSteps=fr.ConnectItem=fr.ConnectContent=void 0;const Ht=vi(Us),le=Lt,dh=us,KS=re,XS=ai,e3=Io,t3=vi(sc),r3=vi(oc),I0=Ro,n3=vi(ac),i3=vi(uc),s3=Ao,o3=To,a3=ko,u3=vi(lc),ph={"coinbase-wallet-app":{title:"Coinbase Wallet app",description:"Connect with your self-custody wallet",icon:r3.default,steps:A0},"coinbase-app":{title:"Coinbase app",description:"Connect with your Coinbase account",icon:t3.default,steps:T0}},c3=t=>{switch(t){case"coinbase-app":return n3.default;case"coinbase-wallet-app":default:return i3.default}},ou=t=>t==="light"?"#FFFFFF":"#0A0B0D";function l3(t){const{theme:e}=t,[r,n]=(0,dh.useState)("coinbase-wallet-app"),i=(0,dh.useCallback)(l=>{n(l)},[]),s=(0,KS.createQrUrl)(t.sessionId,t.sessionSecret,t.linkAPIUrl,t.isParentConnection,t.version,t.chainId),o=ph[r];if(!r)return null;const a=o.steps,c=r==="coinbase-app";return(0,le.h)("div",{"data-testid":"connect-content",class:(0,Ht.default)("-cbwsdk-connect-content",e)},(0,le.h)("style",null,u3.default),(0,le.h)("div",{class:"-cbwsdk-connect-content-header"},(0,le.h)("h2",{class:(0,Ht.default)("-cbwsdk-connect-content-heading",e)},"Scan to connect with one of our mobile apps"),t.onCancel&&(0,le.h)("button",{type:"button",class:"-cbwsdk-cancel-button",onClick:t.onCancel},(0,le.h)(e3.CloseIcon,{fill:e==="light"?"#0A0B0D":"#FFFFFF"}))),(0,le.h)("div",{class:"-cbwsdk-connect-content-layout"},(0,le.h)("div",{class:"-cbwsdk-connect-content-column-left"},(0,le.h)("div",null,Object.entries(ph).map(([l,p])=>(0,le.h)(R0,{key:l,title:p.title,description:p.description,icon:p.icon,selected:r===l,onClick:()=>i(l),theme:e}))),c&&(0,le.h)("div",{class:(0,Ht.default)("-cbwsdk-connect-content-update-app",e)},"Don’t see a ",(0,le.h)("strong",null,"Scan")," option? Update your Coinbase app to the latest version and try again.")),(0,le.h)("div",{class:"-cbwsdk-connect-content-column-right"},(0,le.h)("div",{class:"-cbwsdk-connect-content-qr-wrapper"},(0,le.h)(o3.QRCode,{content:s,width:200,height:200,fgColor:"#000",bgColor:"transparent",image:{svg:c3(r),width:25,height:25}}),(0,le.h)("input",{type:"hidden",name:"cbw-cbwsdk-version",value:XS.LIB_VERSION}),(0,le.h)("input",{type:"hidden",value:s})),(0,le.h)(a,{theme:e}),!t.isConnected&&(0,le.h)("div",{"data-testid":"connecting-spinner",class:(0,Ht.default)("-cbwsdk-connect-content-qr-connecting",e)},(0,le.h)(a3.Spinner,{size:36,color:e==="dark"?"#FFF":"#000"}),(0,le.h)("p",null,"Connecting...")))))}fr.ConnectContent=l3;function R0({title:t,description:e,icon:r,selected:n,theme:i,onClick:s}){return(0,le.h)("div",{onClick:s,class:(0,Ht.default)("-cbwsdk-connect-item",i,{selected:n})},(0,le.h)("div",null,(0,le.h)("img",{src:r,alt:t})),(0,le.h)("div",{class:"-cbwsdk-connect-item-copy-wrapper"},(0,le.h)("h3",{class:"-cbwsdk-connect-item-title"},t),(0,le.h)("p",{class:"-cbwsdk-connect-item-description"},e)))}fr.ConnectItem=R0;function A0({theme:t}){return(0,le.h)("ol",{class:"-cbwsdk-wallet-steps"},(0,le.h)("li",{class:(0,Ht.default)("-cbwsdk-wallet-steps-item",t)},(0,le.h)("div",{class:"-cbwsdk-wallet-steps-item-wrapper"},"Open Coinbase Wallet app")),(0,le.h)("li",{class:(0,Ht.default)("-cbwsdk-wallet-steps-item",t)},(0,le.h)("div",{class:"-cbwsdk-wallet-steps-item-wrapper"},(0,le.h)("span",null,"Tap ",(0,le.h)("strong",null,"Scan")," "),(0,le.h)("span",{class:(0,Ht.default)("-cbwsdk-wallet-steps-pad-left","-cbwsdk-wallet-steps-icon",t)},(0,le.h)(I0.QRCodeIcon,{fill:ou(t)})))))}fr.CoinbaseWalletSteps=A0;function T0({theme:t}){return(0,le.h)("ol",{class:"-cbwsdk-wallet-steps"},(0,le.h)("li",{class:(0,Ht.default)("-cbwsdk-wallet-steps-item",t)},(0,le.h)("div",{class:"-cbwsdk-wallet-steps-item-wrapper"},"Open Coinbase app")),(0,le.h)("li",{class:(0,Ht.default)("-cbwsdk-wallet-steps-item",t)},(0,le.h)("div",{class:"-cbwsdk-wallet-steps-item-wrapper"},(0,le.h)("span",null,"Tap ",(0,le.h)("strong",null,"More")),(0,le.h)("span",{class:(0,Ht.default)("-cbwsdk-wallet-steps-pad-left","-cbwsdk-wallet-steps-icon",t)},(0,le.h)(s3.StatusDotIcon,{fill:ou(t)})),(0,le.h)("span",{class:"-cbwsdk-wallet-steps-pad-left"},"then ",(0,le.h)("strong",null,"Scan")),(0,le.h)("span",{class:(0,Ht.default)("-cbwsdk-wallet-steps-pad-left","-cbwsdk-wallet-steps-icon",t)},(0,le.h)(I0.QRCodeIcon,{fill:ou(t)})))))}fr.CoinbaseAppSteps=T0;var No={},Oo={};Object.defineProperty(Oo,"__esModule",{value:!0});Oo.ArrowLeftIcon=void 0;const gh=Lt;function h3(t){return(0,gh.h)("svg",Object.assign({width:"16",height:"16",viewBox:"0 0 16 16",xmlns:"http://www.w3.org/2000/svg"},t),(0,gh.h)("path",{d:"M8.60675 0.155884L7.37816 1.28209L12.7723 7.16662H0V8.83328H12.6548L6.82149 14.6666L8 15.8451L15.8201 8.02501L8.60675 0.155884Z"}))}Oo.ArrowLeftIcon=h3;var Lo={};Object.defineProperty(Lo,"__esModule",{value:!0});Lo.LaptopIcon=void 0;const ka=Lt;function f3(t){return(0,ka.h)("svg",Object.assign({width:"14",height:"14",viewBox:"0 0 14 14",xmlns:"http://www.w3.org/2000/svg"},t),(0,ka.h)("path",{d:"M1.8001 2.2002H12.2001V9.40019H1.8001V2.2002ZM3.4001 3.8002V7.80019H10.6001V3.8002H3.4001Z"}),(0,ka.h)("path",{d:"M13.4001 10.2002H0.600098C0.600098 11.0838 1.31644 11.8002 2.2001 11.8002H11.8001C12.6838 11.8002 13.4001 11.0838 13.4001 10.2002Z"}))}Lo.LaptopIcon=f3;var Bo={};Object.defineProperty(Bo,"__esModule",{value:!0});Bo.SafeIcon=void 0;const bh=Lt;function d3(t){return(0,bh.h)("svg",Object.assign({width:"14",height:"14",viewBox:"0 0 14 14",xmlns:"http://www.w3.org/2000/svg"},t),(0,bh.h)("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M0.600098 0.600098V11.8001H13.4001V0.600098H0.600098ZM7.0001 9.2001C5.3441 9.2001 4.0001 7.8561 4.0001 6.2001C4.0001 4.5441 5.3441 3.2001 7.0001 3.2001C8.6561 3.2001 10.0001 4.5441 10.0001 6.2001C10.0001 7.8561 8.6561 9.2001 7.0001 9.2001ZM0.600098 12.6001H3.8001V13.4001H0.600098V12.6001ZM10.2001 12.6001H13.4001V13.4001H10.2001V12.6001ZM8.8001 6.2001C8.8001 7.19421 7.99421 8.0001 7.0001 8.0001C6.00598 8.0001 5.2001 7.19421 5.2001 6.2001C5.2001 5.20598 6.00598 4.4001 7.0001 4.4001C7.99421 4.4001 8.8001 5.20598 8.8001 6.2001Z"}))}Bo.SafeIcon=d3;var hc={};Object.defineProperty(hc,"__esModule",{value:!0});hc.default=".-cbwsdk-css-reset .-cbwsdk-try-extension{display:flex;margin-top:12px;height:202px;width:700px;border-radius:12px;padding:30px}.-cbwsdk-css-reset .-cbwsdk-try-extension.light{background:#fff}.-cbwsdk-css-reset .-cbwsdk-try-extension.dark{background:#0a0b0d}.-cbwsdk-css-reset .-cbwsdk-try-extension-column-half{flex:50%}.-cbwsdk-css-reset .-cbwsdk-try-extension-heading{font-style:normal;font-weight:500;font-size:25px;line-height:32px;margin:0;max-width:204px}.-cbwsdk-css-reset .-cbwsdk-try-extension-heading.light{color:#0a0b0d}.-cbwsdk-css-reset .-cbwsdk-try-extension-heading.dark{color:#fff}.-cbwsdk-css-reset .-cbwsdk-try-extension-cta{appearance:none;border:none;background:none;color:#0052ff;cursor:pointer;padding:0;text-decoration:none;display:block;font-weight:600;font-size:16px;line-height:24px}.-cbwsdk-css-reset .-cbwsdk-try-extension-cta.light{color:#0052ff}.-cbwsdk-css-reset .-cbwsdk-try-extension-cta.dark{color:#588af5}.-cbwsdk-css-reset .-cbwsdk-try-extension-cta-wrapper{display:flex;align-items:center;margin-top:12px}.-cbwsdk-css-reset .-cbwsdk-try-extension-cta-icon{display:block;margin-left:4px;height:14px}.-cbwsdk-css-reset .-cbwsdk-try-extension-list{display:flex;flex-direction:column;justify-content:center;align-items:center;margin:0;padding:0;list-style:none;height:100%}.-cbwsdk-css-reset .-cbwsdk-try-extension-list-item{display:flex;align-items:center;flex-flow:nowrap;margin-top:24px}.-cbwsdk-css-reset .-cbwsdk-try-extension-list-item:first-of-type{margin-top:0}.-cbwsdk-css-reset .-cbwsdk-try-extension-list-item-icon-wrapper{display:block}.-cbwsdk-css-reset .-cbwsdk-try-extension-list-item-icon{display:flex;height:32px;width:32px;border-radius:50%}.-cbwsdk-css-reset .-cbwsdk-try-extension-list-item-icon svg{margin:auto;display:block}.-cbwsdk-css-reset .-cbwsdk-try-extension-list-item-icon.light{background:#eef0f3}.-cbwsdk-css-reset .-cbwsdk-try-extension-list-item-icon.dark{background:#1e2025}.-cbwsdk-css-reset .-cbwsdk-try-extension-list-item-copy{display:block;font-weight:400;font-size:14px;line-height:20px;padding-left:12px}.-cbwsdk-css-reset .-cbwsdk-try-extension-list-item-copy.light{color:#5b636e}.-cbwsdk-css-reset .-cbwsdk-try-extension-list-item-copy.dark{color:#8a919e}";var k0=te&&te.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(No,"__esModule",{value:!0});No.TryExtensionContent=void 0;const Yr=k0(Us),ut=Lt,Na=us,p3=Oo,g3=Lo,b3=Bo,v3=k0(hc);function m3({theme:t}){const[e,r]=(0,Na.useState)(!1),n=(0,Na.useCallback)(()=>{window.open("https://api.wallet.coinbase.com/rpc/v2/desktop/chrome","_blank")},[]),i=(0,Na.useCallback)(()=>{e?window.location.reload():(n(),r(!0))},[n,e]);return(0,ut.h)("div",{class:(0,Yr.default)("-cbwsdk-try-extension",t)},(0,ut.h)("style",null,v3.default),(0,ut.h)("div",{class:"-cbwsdk-try-extension-column-half"},(0,ut.h)("h3",{class:(0,Yr.default)("-cbwsdk-try-extension-heading",t)},"Or try the Coinbase Wallet browser extension"),(0,ut.h)("div",{class:"-cbwsdk-try-extension-cta-wrapper"},(0,ut.h)("button",{class:(0,Yr.default)("-cbwsdk-try-extension-cta",t),onClick:i},e?"Refresh":"Install"),(0,ut.h)("div",null,!e&&(0,ut.h)(p3.ArrowLeftIcon,{class:"-cbwsdk-try-extension-cta-icon",fill:t==="light"?"#0052FF":"#588AF5"})))),(0,ut.h)("div",{class:"-cbwsdk-try-extension-column-half"},(0,ut.h)("ul",{class:"-cbwsdk-try-extension-list"},(0,ut.h)("li",{class:"-cbwsdk-try-extension-list-item"},(0,ut.h)("div",{class:"-cbwsdk-try-extension-list-item-icon-wrapper"},(0,ut.h)("span",{class:(0,Yr.default)("-cbwsdk-try-extension-list-item-icon",t)},(0,ut.h)(g3.LaptopIcon,{fill:t==="light"?"#0A0B0D":"#FFFFFF"}))),(0,ut.h)("div",{class:(0,Yr.default)("-cbwsdk-try-extension-list-item-copy",t)},"Connect with dapps with just one click on your desktop browser")),(0,ut.h)("li",{class:"-cbwsdk-try-extension-list-item"},(0,ut.h)("div",{class:"-cbwsdk-try-extension-list-item-icon-wrapper"},(0,ut.h)("span",{class:(0,Yr.default)("-cbwsdk-try-extension-list-item-icon",t)},(0,ut.h)(b3.SafeIcon,{fill:t==="light"?"#0A0B0D":"#FFFFFF"}))),(0,ut.h)("div",{class:(0,Yr.default)("-cbwsdk-try-extension-list-item-copy",t)},"Add an additional layer of security by using a supported Ledger hardware wallet")))))}No.TryExtensionContent=m3;var fc={};Object.defineProperty(fc,"__esModule",{value:!0});fc.default=".-cbwsdk-css-reset .-cbwsdk-connect-dialog{z-index:2147483647;position:fixed;top:0;left:0;right:0;bottom:0;display:flex;align-items:center;justify-content:center}.-cbwsdk-css-reset .-cbwsdk-connect-dialog-backdrop{z-index:2147483647;position:fixed;top:0;left:0;right:0;bottom:0;transition:opacity .25s}.-cbwsdk-css-reset .-cbwsdk-connect-dialog-backdrop.light{background-color:rgba(0,0,0,.5)}.-cbwsdk-css-reset .-cbwsdk-connect-dialog-backdrop.dark{background-color:rgba(50,53,61,.4)}.-cbwsdk-css-reset .-cbwsdk-connect-dialog-backdrop-hidden{opacity:0}.-cbwsdk-css-reset .-cbwsdk-connect-dialog-box{display:flex;position:relative;flex-direction:column;transform:scale(1);transition:opacity .25s,transform .25s}.-cbwsdk-css-reset .-cbwsdk-connect-dialog-box-hidden{opacity:0;transform:scale(0.85)}.-cbwsdk-css-reset .-cbwsdk-connect-dialog-container{display:block}.-cbwsdk-css-reset .-cbwsdk-connect-dialog-container-hidden{display:none}";var N0=te&&te.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Co,"__esModule",{value:!0});Co.ConnectDialog=void 0;const Oa=N0(Us),Kr=Lt,La=us,y3=fr,_3=No,w3=N0(fc),E3=t=>{const{isOpen:e,darkMode:r}=t,[n,i]=(0,La.useState)(!e),[s,o]=(0,La.useState)(!e);(0,La.useEffect)(()=>{const c=[window.setTimeout(()=>{o(!e)},10)];return e?i(!1):c.push(window.setTimeout(()=>{i(!0)},360)),()=>{c.forEach(window.clearTimeout)}},[t.isOpen]);const a=r?"dark":"light";return(0,Kr.h)("div",{class:(0,Oa.default)("-cbwsdk-connect-dialog-container",n&&"-cbwsdk-connect-dialog-container-hidden")},(0,Kr.h)("style",null,w3.default),(0,Kr.h)("div",{class:(0,Oa.default)("-cbwsdk-connect-dialog-backdrop",a,s&&"-cbwsdk-connect-dialog-backdrop-hidden")}),(0,Kr.h)("div",{class:"-cbwsdk-connect-dialog"},(0,Kr.h)("div",{class:(0,Oa.default)("-cbwsdk-connect-dialog-box",s&&"-cbwsdk-connect-dialog-box-hidden")},t.connectDisabled?null:(0,Kr.h)(y3.ConnectContent,{theme:a,version:t.version,sessionId:t.sessionId,sessionSecret:t.sessionSecret,linkAPIUrl:t.linkAPIUrl,isConnected:t.isConnected,isParentConnection:t.isParentConnection,chainId:t.chainId,onCancel:t.onCancel}),(0,Kr.h)(_3.TryExtensionContent,{theme:a}))))};Co.ConnectDialog=E3;Object.defineProperty(Eo,"__esModule",{value:!0});Eo.LinkFlow=void 0;const Ba=Lt,vh=Mo,S3=Co;class x3{constructor(e){this.extensionUI$=new vh.BehaviorSubject({}),this.subscriptions=new vh.Subscription,this.isConnected=!1,this.chainId=1,this.isOpen=!1,this.onCancel=null,this.root=null,this.connectDisabled=!1,this.darkMode=e.darkMode,this.version=e.version,this.sessionId=e.sessionId,this.sessionSecret=e.sessionSecret,this.linkAPIUrl=e.linkAPIUrl,this.isParentConnection=e.isParentConnection,this.connected$=e.connected$,this.chainId$=e.chainId$}attach(e){this.root=document.createElement("div"),this.root.className="-cbwsdk-link-flow-root",e.appendChild(this.root),this.render(),this.subscriptions.add(this.connected$.subscribe(r=>{this.isConnected!==r&&(this.isConnected=r,this.render())})),this.subscriptions.add(this.chainId$.subscribe(r=>{this.chainId!==r&&(this.chainId=r,this.render())}))}detach(){var e;this.root&&(this.subscriptions.unsubscribe(),(0,Ba.render)(null,this.root),(e=this.root.parentElement)===null||e===void 0||e.removeChild(this.root))}setConnectDisabled(e){this.connectDisabled=e}open(e){this.isOpen=!0,this.onCancel=e.onCancel,this.render()}close(){this.isOpen=!1,this.onCancel=null,this.render()}render(){if(!this.root)return;const e=this.extensionUI$.subscribe(()=>{this.root&&(0,Ba.render)((0,Ba.h)(S3.ConnectDialog,{darkMode:this.darkMode,version:this.version,sessionId:this.sessionId,sessionSecret:this.sessionSecret,linkAPIUrl:this.linkAPIUrl,isOpen:this.isOpen,isConnected:this.isConnected,isParentConnection:this.isParentConnection,chainId:this.chainId,onCancel:this.onCancel,connectDisabled:this.connectDisabled}),this.root)});this.subscriptions.add(e)}}Eo.LinkFlow=x3;var O0={},dc={};Object.defineProperty(dc,"__esModule",{value:!0});dc.default=".-cbwsdk-css-reset .-gear-container{margin-left:16px !important;margin-right:9px !important;display:flex;align-items:center;justify-content:center;width:24px;height:24px;transition:opacity .25s}.-cbwsdk-css-reset .-gear-container *{user-select:none}.-cbwsdk-css-reset .-gear-container svg{opacity:0;position:absolute}.-cbwsdk-css-reset .-gear-icon{height:12px;width:12px;z-index:10000}.-cbwsdk-css-reset .-cbwsdk-snackbar{align-items:flex-end;display:flex;flex-direction:column;position:fixed;right:0;top:0;z-index:2147483647}.-cbwsdk-css-reset .-cbwsdk-snackbar *{user-select:none}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance{display:flex;flex-direction:column;margin:8px 16px 0 16px;overflow:visible;text-align:left;transform:translateX(0);transition:opacity .25s,transform .25s}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-header:hover .-gear-container svg{opacity:1}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-header{display:flex;align-items:center;background:#fff;overflow:hidden;border:1px solid #e7ebee;box-sizing:border-box;border-radius:8px;cursor:pointer}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-header-cblogo{margin:8px 8px 8px 8px}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-header *{cursor:pointer}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-header-message{color:#000;font-size:13px;line-height:1.5;user-select:none}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu{background:#fff;transition:opacity .25s ease-in-out,transform .25s linear,visibility 0s;visibility:hidden;border:1px solid #e7ebee;box-sizing:border-box;border-radius:8px;opacity:0;flex-direction:column;padding-left:8px;padding-right:8px}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item:last-child{margin-bottom:8px !important}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item:hover{background:#f5f7f8;border-radius:6px;transition:background .25s}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item:hover span{color:#050f19;transition:color .25s}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item:hover svg path{fill:#000;transition:fill .25s}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item{visibility:inherit;height:35px;margin-top:8px;margin-bottom:0;display:flex;flex-direction:row;align-items:center;padding:8px;cursor:pointer}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item *{visibility:inherit;cursor:pointer}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item-is-red:hover{background:rgba(223,95,103,.2);transition:background .25s}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item-is-red:hover *{cursor:pointer}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item-is-red:hover svg path{fill:#df5f67;transition:fill .25s}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item-is-red:hover span{color:#df5f67;transition:color .25s}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item-info{color:#aaa;font-size:13px;margin:0 8px 0 32px;position:absolute}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-hidden{opacity:0;text-align:left;transform:translateX(25%);transition:opacity .5s linear}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-expanded .-cbwsdk-snackbar-instance-menu{opacity:1;display:flex;transform:translateY(8px);visibility:visible}";(function(t){var e=te&&te.__importDefault||function(g){return g&&g.__esModule?g:{default:g}};Object.defineProperty(t,"__esModule",{value:!0}),t.SnackbarInstance=t.SnackbarContainer=t.Snackbar=void 0;const r=e(Us),n=Lt,i=us,s=e(dc),o="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTIiIGhlaWdodD0iMTIiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTEyIDYuNzV2LTEuNWwtMS43Mi0uNTdjLS4wOC0uMjctLjE5LS41Mi0uMzItLjc3bC44MS0xLjYyLTEuMDYtMS4wNi0xLjYyLjgxYy0uMjQtLjEzLS41LS4yNC0uNzctLjMyTDYuNzUgMGgtMS41bC0uNTcgMS43MmMtLjI3LjA4LS41My4xOS0uNzcuMzJsLTEuNjItLjgxLTEuMDYgMS4wNi44MSAxLjYyYy0uMTMuMjQtLjI0LjUtLjMyLjc3TDAgNS4yNXYxLjVsMS43Mi41N2MuMDguMjcuMTkuNTMuMzIuNzdsLS44MSAxLjYyIDEuMDYgMS4wNiAxLjYyLS44MWMuMjQuMTMuNS4yMy43Ny4zMkw1LjI1IDEyaDEuNWwuNTctMS43MmMuMjctLjA4LjUyLS4xOS43Ny0uMzJsMS42Mi44MSAxLjA2LTEuMDYtLjgxLTEuNjJjLjEzLS4yNC4yMy0uNS4zMi0uNzdMMTIgNi43NXpNNiA4LjVhMi41IDIuNSAwIDAxMC01IDIuNSAyLjUgMCAwMTAgNXoiIGZpbGw9IiMwNTBGMTkiLz48L3N2Zz4=";function a(g){switch(g){case"coinbase-app":return"data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMzAiIGhlaWdodD0iMzAiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTE0LjY3NCAxOC44NThjLTIuMDQ1IDAtMy42NDgtMS43MjItMy42NDgtMy44NDVzMS42NTktMy44NDUgMy42NDgtMy44NDVjMS44MjQgMCAzLjMxNyAxLjM3NyAzLjU5MyAzLjIxNGgzLjcwM2MtLjMzMS0zLjk2LTMuNDgyLTcuMDU5LTcuMjk2LTcuMDU5LTQuMDM0IDAtNy4zNSAzLjQ0My03LjM1IDcuNjkgMCA0LjI0NiAzLjI2IDcuNjkgNy4zNSA3LjY5IDMuODcgMCA2Ljk2NS0zLjEgNy4yOTYtNy4wNTloLTMuNzAzYy0uMjc2IDEuODM2LTEuNzY5IDMuMjE0LTMuNTkzIDMuMjE0WiIgZmlsbD0iI2ZmZiIvPjxwYXRoIGQ9Ik0wIDEwLjY3OGMwLTMuNzExIDAtNS41OTYuNzQyLTcuMDIzQTYuNTMyIDYuNTMyIDAgMCAxIDMuNjU1Ljc0MkM1LjA4MiAwIDYuOTY3IDAgMTAuNjc4IDBoNy45MzhjMy43MTEgMCA1LjU5NiAwIDcuMDIzLjc0MmE2LjUzMSA2LjUzMSAwIDAgMSAyLjkxMyAyLjkxM2MuNzQyIDEuNDI3Ljc0MiAzLjMxMi43NDIgNy4wMjN2Ny45MzhjMCAzLjcxMSAwIDUuNTk2LS43NDIgNy4wMjNhNi41MzEgNi41MzEgMCAwIDEtMi45MTMgMi45MTNjLTEuNDI3Ljc0Mi0zLjMxMi43NDItNy4wMjMuNzQyaC03LjkzOGMtMy43MTEgMC01LjU5NiAwLTcuMDIzLS43NDJhNi41MzEgNi41MzEgMCAwIDEtMi45MTMtMi45MTNDMCAyNC4yMTIgMCAyMi4zODQgMCAxOC42MTZ2LTcuOTM4WiIgZmlsbD0iIzAwNTJGRiIvPjxwYXRoIGQ9Ik0xNC42ODQgMTkuNzczYy0yLjcyNyAwLTQuODY0LTIuMjk1LTQuODY0LTUuMTI2IDAtMi44MzEgMi4yMS01LjEyNyA0Ljg2NC01LjEyNyAyLjQzMiAwIDQuNDIyIDEuODM3IDQuNzkgNC4yODVoNC45MzhjLS40NDItNS4yOC00LjY0My05LjQxMS05LjcyOC05LjQxMS01LjM4IDAtOS44MDIgNC41OS05LjgwMiAxMC4yNTMgMCA1LjY2MiA0LjM0OCAxMC4yNTMgOS44MDIgMTAuMjUzIDUuMTU5IDAgOS4yODYtNC4xMzIgOS43MjgtOS40MTFoLTQuOTM4Yy0uMzY4IDIuNDQ4LTIuMzU4IDQuMjg0LTQuNzkgNC4yODRaIiBmaWxsPSIjZmZmIi8+PC9zdmc+";case"coinbase-wallet-app":default:return"data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMzIiIGhlaWdodD0iMzIiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTEuNDkyIDEwLjQxOWE4LjkzIDguOTMgMCAwMTguOTMtOC45M2gxMS4xNjNhOC45MyA4LjkzIDAgMDE4LjkzIDguOTN2MTEuMTYzYTguOTMgOC45MyAwIDAxLTguOTMgOC45M0gxMC40MjJhOC45MyA4LjkzIDAgMDEtOC45My04LjkzVjEwLjQxOXoiIGZpbGw9IiMxNjUyRjAiLz48cGF0aCBmaWxsLXJ1bGU9ImV2ZW5vZGQiIGNsaXAtcnVsZT0iZXZlbm9kZCIgZD0iTTEwLjQxOSAwSDIxLjU4QzI3LjMzNSAwIDMyIDQuNjY1IDMyIDEwLjQxOVYyMS41OEMzMiAyNy4zMzUgMjcuMzM1IDMyIDIxLjU4MSAzMkgxMC40MkM0LjY2NSAzMiAwIDI3LjMzNSAwIDIxLjU4MVYxMC40MkMwIDQuNjY1IDQuNjY1IDAgMTAuNDE5IDB6bTAgMS40ODhhOC45MyA4LjkzIDAgMDAtOC45MyA4LjkzdjExLjE2M2E4LjkzIDguOTMgMCAwMDguOTMgOC45M0gyMS41OGE4LjkzIDguOTMgMCAwMDguOTMtOC45M1YxMC40MmE4LjkzIDguOTMgMCAwMC04LjkzLTguOTNIMTAuNDJ6IiBmaWxsPSIjZmZmIi8+PHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik0xNS45OTggMjYuMDQ5Yy01LjU0OSAwLTEwLjA0Ny00LjQ5OC0xMC4wNDctMTAuMDQ3IDAtNS41NDggNC40OTgtMTAuMDQ2IDEwLjA0Ny0xMC4wNDYgNS41NDggMCAxMC4wNDYgNC40OTggMTAuMDQ2IDEwLjA0NiAwIDUuNTQ5LTQuNDk4IDEwLjA0Ny0xMC4wNDYgMTAuMDQ3eiIgZmlsbD0iI2ZmZiIvPjxwYXRoIGQ9Ik0xMi43NjIgMTQuMjU0YzAtLjgyMi42NjctMS40ODkgMS40ODktMS40ODloMy40OTdjLjgyMiAwIDEuNDg4LjY2NiAxLjQ4OCAxLjQ4OXYzLjQ5N2MwIC44MjItLjY2NiAxLjQ4OC0xLjQ4OCAxLjQ4OGgtMy40OTdhMS40ODggMS40ODggMCAwMS0xLjQ4OS0xLjQ4OHYtMy40OTh6IiBmaWxsPSIjMTY1MkYwIi8+PC9zdmc+"}}class c{constructor(y){this.items=new Map,this.nextItemKey=0,this.root=null,this.darkMode=y.darkMode}attach(y){this.root=document.createElement("div"),this.root.className="-cbwsdk-snackbar-root",y.appendChild(this.root),this.render()}presentItem(y){const I=this.nextItemKey++;return this.items.set(I,y),this.render(),()=>{this.items.delete(I),this.render()}}clear(){this.items.clear(),this.render()}render(){this.root&&(0,n.render)((0,n.h)("div",null,(0,n.h)(t.SnackbarContainer,{darkMode:this.darkMode},Array.from(this.items.entries()).map(([y,I])=>(0,n.h)(t.SnackbarInstance,Object.assign({},I,{key:y}))))),this.root)}}t.Snackbar=c;const l=g=>(0,n.h)("div",{class:(0,r.default)("-cbwsdk-snackbar-container")},(0,n.h)("style",null,s.default),(0,n.h)("div",{class:"-cbwsdk-snackbar"},g.children));t.SnackbarContainer=l;const p=({autoExpand:g,message:y,menuItems:I,appSrc:T})=>{const[D,U]=(0,i.useState)(!0),[M,N]=(0,i.useState)(g??!1);(0,i.useEffect)(()=>{const H=[window.setTimeout(()=>{U(!1)},1),window.setTimeout(()=>{N(!0)},1e4)];return()=>{H.forEach(window.clearTimeout)}});const j=()=>{N(!M)};return(0,n.h)("div",{class:(0,r.default)("-cbwsdk-snackbar-instance",D&&"-cbwsdk-snackbar-instance-hidden",M&&"-cbwsdk-snackbar-instance-expanded")},(0,n.h)("div",{class:"-cbwsdk-snackbar-instance-header",onClick:j},(0,n.h)("img",{src:a(T),class:"-cbwsdk-snackbar-instance-header-cblogo"}),(0,n.h)("div",{class:"-cbwsdk-snackbar-instance-header-message"},y),(0,n.h)("div",{class:"-gear-container"},!M&&(0,n.h)("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},(0,n.h)("circle",{cx:"12",cy:"12",r:"12",fill:"#F5F7F8"})),(0,n.h)("img",{src:o,class:"-gear-icon",title:"Expand"}))),I&&I.length>0&&(0,n.h)("div",{class:"-cbwsdk-snackbar-instance-menu"},I.map((H,F)=>(0,n.h)("div",{class:(0,r.default)("-cbwsdk-snackbar-instance-menu-item",H.isRed&&"-cbwsdk-snackbar-instance-menu-item-is-red"),onClick:H.onClick,key:F},(0,n.h)("svg",{width:H.svgWidth,height:H.svgHeight,viewBox:"0 0 10 11",fill:"none",xmlns:"http://www.w3.org/2000/svg"},(0,n.h)("path",{"fill-rule":H.defaultFillRule,"clip-rule":H.defaultClipRule,d:H.path,fill:"#AAAAAA"})),(0,n.h)("span",{class:(0,r.default)("-cbwsdk-snackbar-instance-menu-item-info",H.isRed&&"-cbwsdk-snackbar-instance-menu-item-info-is-red")},H.info)))))};t.SnackbarInstance=p})(O0);var Po={},pc={};Object.defineProperty(pc,"__esModule",{value:!0});pc.default='@namespace svg "http://www.w3.org/2000/svg";.-cbwsdk-css-reset,.-cbwsdk-css-reset *{animation:none;animation-delay:0;animation-direction:normal;animation-duration:0;animation-fill-mode:none;animation-iteration-count:1;animation-name:none;animation-play-state:running;animation-timing-function:ease;backface-visibility:visible;background:0;background-attachment:scroll;background-clip:border-box;background-color:rgba(0,0,0,0);background-image:none;background-origin:padding-box;background-position:0 0;background-position-x:0;background-position-y:0;background-repeat:repeat;background-size:auto auto;border:0;border-style:none;border-width:medium;border-color:inherit;border-bottom:0;border-bottom-color:inherit;border-bottom-left-radius:0;border-bottom-right-radius:0;border-bottom-style:none;border-bottom-width:medium;border-collapse:separate;border-image:none;border-left:0;border-left-color:inherit;border-left-style:none;border-left-width:medium;border-radius:0;border-right:0;border-right-color:inherit;border-right-style:none;border-right-width:medium;border-spacing:0;border-top:0;border-top-color:inherit;border-top-left-radius:0;border-top-right-radius:0;border-top-style:none;border-top-width:medium;box-shadow:none;box-sizing:border-box;caption-side:top;clear:none;clip:auto;color:inherit;columns:auto;column-count:auto;column-fill:balance;column-gap:normal;column-rule:medium none currentColor;column-rule-color:currentColor;column-rule-style:none;column-rule-width:none;column-span:1;column-width:auto;counter-increment:none;counter-reset:none;direction:ltr;empty-cells:show;float:none;font:normal;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","Helvetica Neue",Arial,sans-serif;font-size:medium;font-style:normal;font-variant:normal;font-weight:normal;height:auto;hyphens:none;letter-spacing:normal;line-height:normal;list-style:none;list-style-image:none;list-style-position:outside;list-style-type:disc;margin:0;margin-bottom:0;margin-left:0;margin-right:0;margin-top:0;opacity:1;orphans:0;outline:0;outline-color:invert;outline-style:none;outline-width:medium;overflow:visible;overflow-x:visible;overflow-y:visible;padding:0;padding-bottom:0;padding-left:0;padding-right:0;padding-top:0;page-break-after:auto;page-break-before:auto;page-break-inside:auto;perspective:none;perspective-origin:50% 50%;pointer-events:auto;position:static;quotes:"\\201C" "\\201D" "\\2018" "\\2019";tab-size:8;table-layout:auto;text-align:inherit;text-align-last:auto;text-decoration:none;text-decoration-color:inherit;text-decoration-line:none;text-decoration-style:solid;text-indent:0;text-shadow:none;text-transform:none;transform:none;transform-style:flat;transition:none;transition-delay:0s;transition-duration:0s;transition-property:none;transition-timing-function:ease;unicode-bidi:normal;vertical-align:baseline;visibility:visible;white-space:normal;widows:0;word-spacing:normal;z-index:auto}.-cbwsdk-css-reset strong{font-weight:bold}.-cbwsdk-css-reset *{box-sizing:border-box;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","Helvetica Neue",Arial,sans-serif;line-height:1}.-cbwsdk-css-reset [class*=container]{margin:0;padding:0}.-cbwsdk-css-reset style{display:none}';var M3=te&&te.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Po,"__esModule",{value:!0});Po.injectCssReset=void 0;const C3=M3(pc);function I3(){const t=document.createElement("style");t.type="text/css",t.appendChild(document.createTextNode(C3.default)),document.documentElement.appendChild(t)}Po.injectCssReset=I3;Object.defineProperty(wo,"__esModule",{value:!0});wo.WalletSDKUI=void 0;const R3=Eo,A3=O0,T3=Po;class k3{constructor(e){this.standalone=null,this.attached=!1,this.appSrc=null,this.snackbar=new A3.Snackbar({darkMode:e.darkMode}),this.linkFlow=new R3.LinkFlow({darkMode:e.darkMode,version:e.version,sessionId:e.session.id,sessionSecret:e.session.secret,linkAPIUrl:e.linkAPIUrl,connected$:e.connected$,chainId$:e.chainId$,isParentConnection:!1})}attach(){if(this.attached)throw new Error("Coinbase Wallet SDK UI is already attached");const e=document.documentElement,r=document.createElement("div");r.className="-cbwsdk-css-reset",e.appendChild(r),this.linkFlow.attach(r),this.snackbar.attach(r),this.attached=!0,(0,T3.injectCssReset)()}setConnectDisabled(e){this.linkFlow.setConnectDisabled(e)}addEthereumChain(e){}watchAsset(e){}switchEthereumChain(e){}requestEthereumAccounts(e){this.linkFlow.open({onCancel:e.onCancel})}hideRequestEthereumAccounts(){this.linkFlow.close()}signEthereumMessage(e){}signEthereumTransaction(e){}submitEthereumTransaction(e){}ethereumAddressFromSignedMessage(e){}showConnecting(e){let r;return e.isUnlinkedErrorState?r={autoExpand:!0,message:"Connection lost",appSrc:this.appSrc,menuItems:[{isRed:!1,info:"Reset connection",svgWidth:"10",svgHeight:"11",path:"M5.00008 0.96875C6.73133 0.96875 8.23758 1.94375 9.00008 3.375L10.0001 2.375V5.5H9.53133H7.96883H6.87508L7.80633 4.56875C7.41258 3.3875 6.31258 2.53125 5.00008 2.53125C3.76258 2.53125 2.70633 3.2875 2.25633 4.36875L0.812576 3.76875C1.50008 2.125 3.11258 0.96875 5.00008 0.96875ZM2.19375 6.43125C2.5875 7.6125 3.6875 8.46875 5 8.46875C6.2375 8.46875 7.29375 7.7125 7.74375 6.63125L9.1875 7.23125C8.5 8.875 6.8875 10.0312 5 10.0312C3.26875 10.0312 1.7625 9.05625 1 7.625L0 8.625V5.5H0.46875H2.03125H3.125L2.19375 6.43125Z",defaultFillRule:"evenodd",defaultClipRule:"evenodd",onClick:e.onResetConnection}]}:r={message:"Confirm on phone",appSrc:this.appSrc,menuItems:[{isRed:!0,info:"Cancel transaction",svgWidth:"11",svgHeight:"11",path:"M10.3711 1.52346L9.21775 0.370117L5.37109 4.21022L1.52444 0.370117L0.371094 1.52346L4.2112 5.37012L0.371094 9.21677L1.52444 10.3701L5.37109 6.53001L9.21775 10.3701L10.3711 9.21677L6.53099 5.37012L10.3711 1.52346Z",defaultFillRule:"inherit",defaultClipRule:"inherit",onClick:e.onCancel},{isRed:!1,info:"Reset connection",svgWidth:"10",svgHeight:"11",path:"M5.00008 0.96875C6.73133 0.96875 8.23758 1.94375 9.00008 3.375L10.0001 2.375V5.5H9.53133H7.96883H6.87508L7.80633 4.56875C7.41258 3.3875 6.31258 2.53125 5.00008 2.53125C3.76258 2.53125 2.70633 3.2875 2.25633 4.36875L0.812576 3.76875C1.50008 2.125 3.11258 0.96875 5.00008 0.96875ZM2.19375 6.43125C2.5875 7.6125 3.6875 8.46875 5 8.46875C6.2375 8.46875 7.29375 7.7125 7.74375 6.63125L9.1875 7.23125C8.5 8.875 6.8875 10.0312 5 10.0312C3.26875 10.0312 1.7625 9.05625 1 7.625L0 8.625V5.5H0.46875H2.03125H3.125L2.19375 6.43125Z",defaultFillRule:"evenodd",defaultClipRule:"evenodd",onClick:e.onResetConnection}]},this.snackbar.presentItem(r)}setAppSrc(e){this.appSrc=e}reloadUI(){document.location.reload()}inlineAccountsResponse(){return!1}inlineAddEthereumChain(e){return!1}inlineWatchAsset(){return!1}inlineSwitchEthereumChain(){return!1}setStandalone(e){this.standalone=e}isStandalone(){var e;return(e=this.standalone)!==null&&e!==void 0?e:!1}}wo.WalletSDKUI=k3;var Do={},jo={};Object.defineProperty(jo,"__esModule",{value:!0});var jn;(function(t){t.typeOfFunction="function",t.boolTrue=!0})(jn||(jn={}));function L0(t,e,r){if(!r||typeof r.value!==jn.typeOfFunction)throw new TypeError("Only methods can be decorated with @bind. <"+e+"> is not a method!");return{configurable:jn.boolTrue,get:function(){var n=r.value.bind(this);return Object.defineProperty(this,e,{value:n,configurable:jn.boolTrue,writable:jn.boolTrue}),n}}}jo.bind=L0;jo.default=L0;function B0(t){return function(r){return r.lift(new N3(t))}}var N3=function(){function t(e){this.durationSelector=e}return t.prototype.call=function(e,r){return r.subscribe(new O3(e,this.durationSelector))},t}(),O3=function(t){G(e,t);function e(r,n){var i=t.call(this,r)||this;return i.durationSelector=n,i.hasValue=!1,i}return e.prototype._next=function(r){if(this.value=r,this.hasValue=!0,!this.throttled){var n=void 0;try{var i=this.durationSelector;n=i(r)}catch(o){return this.destination.error(o)}var s=ot(n,new it(this));!s||s.closed?this.clearThrottle():this.add(this.throttled=s)}},e.prototype.clearThrottle=function(){var r=this,n=r.value,i=r.hasValue,s=r.throttled;s&&(this.remove(s),this.throttled=void 0,s.unsubscribe()),i&&(this.value=void 0,this.hasValue=!1,this.destination.next(n))},e.prototype.notifyNext=function(){this.clearThrottle()},e.prototype.notifyComplete=function(){this.clearThrottle()},e}(st);function L3(t,e){return e===void 0&&(e=It),B0(function(){return b0(t,e)})}function B3(t){return function(r){return r.lift(new P3(t))}}var P3=function(){function t(e){this.closingNotifier=e}return t.prototype.call=function(e,r){return r.subscribe(new D3(e,this.closingNotifier))},t}(),D3=function(t){G(e,t);function e(r,n){var i=t.call(this,r)||this;return i.buffer=[],i.add(ot(n,new it(i))),i}return e.prototype._next=function(r){this.buffer.push(r)},e.prototype.notifyNext=function(){var r=this.buffer;this.buffer=[],this.destination.next(r)},e}(st);function j3(t,e){return e===void 0&&(e=null),function(n){return n.lift(new $3(t,e))}}var $3=function(){function t(e,r){this.bufferSize=e,this.startBufferEvery=r,!r||e===r?this.subscriberClass=F3:this.subscriberClass=U3}return t.prototype.call=function(e,r){return r.subscribe(new this.subscriberClass(e,this.bufferSize,this.startBufferEvery))},t}(),F3=function(t){G(e,t);function e(r,n){var i=t.call(this,r)||this;return i.bufferSize=n,i.buffer=[],i}return e.prototype._next=function(r){var n=this.buffer;n.push(r),n.length==this.bufferSize&&(this.destination.next(n),this.buffer=[])},e.prototype._complete=function(){var r=this.buffer;r.length>0&&this.destination.next(r),t.prototype._complete.call(this)},e}(ie),U3=function(t){G(e,t);function e(r,n,i){var s=t.call(this,r)||this;return s.bufferSize=n,s.startBufferEvery=i,s.buffers=[],s.count=0,s}return e.prototype._next=function(r){var n=this,i=n.bufferSize,s=n.startBufferEvery,o=n.buffers,a=n.count;this.count++,a%s===0&&o.push([]);for(var c=o.length;c--;){var l=o[c];l.push(r),l.length===i&&(o.splice(c,1),this.destination.next(l))}},e.prototype._complete=function(){for(var r=this,n=r.buffers,i=r.destination;n.length>0;){var s=n.shift();s.length>0&&i.next(s)}t.prototype._complete.call(this)},e}(ie);function H3(t){var e=arguments.length,r=It;Ot(arguments[arguments.length-1])&&(r=arguments[arguments.length-1],e--);var n=null;e>=2&&(n=arguments[1]);var i=Number.POSITIVE_INFINITY;return e>=3&&(i=arguments[2]),function(o){return o.lift(new W3(t,n,i,r))}}var W3=function(){function t(e,r,n,i){this.bufferTimeSpan=e,this.bufferCreationInterval=r,this.maxBufferSize=n,this.scheduler=i}return t.prototype.call=function(e,r){return r.subscribe(new z3(e,this.bufferTimeSpan,this.bufferCreationInterval,this.maxBufferSize,this.scheduler))},t}(),V3=function(){function t(){this.buffer=[]}return t}(),z3=function(t){G(e,t);function e(r,n,i,s,o){var a=t.call(this,r)||this;a.bufferTimeSpan=n,a.bufferCreationInterval=i,a.maxBufferSize=s,a.scheduler=o,a.contexts=[];var c=a.openContext();if(a.timespanOnly=i==null||i<0,a.timespanOnly){var l={subscriber:a,context:c,bufferTimeSpan:n};a.add(c.closeAction=o.schedule(mh,n,l))}else{var p={subscriber:a,context:c},g={bufferTimeSpan:n,bufferCreationInterval:i,subscriber:a,scheduler:o};a.add(c.closeAction=o.schedule(P0,n,p)),a.add(o.schedule(q3,i,g))}return a}return e.prototype._next=function(r){for(var n=this.contexts,i=n.length,s,o=0;o<i;o++){var a=n[o],c=a.buffer;c.push(r),c.length==this.maxBufferSize&&(s=a)}s&&this.onBufferFull(s)},e.prototype._error=function(r){this.contexts.length=0,t.prototype._error.call(this,r)},e.prototype._complete=function(){for(var r=this,n=r.contexts,i=r.destination;n.length>0;){var s=n.shift();i.next(s.buffer)}t.prototype._complete.call(this)},e.prototype._unsubscribe=function(){this.contexts=null},e.prototype.onBufferFull=function(r){this.closeContext(r);var n=r.closeAction;if(n.unsubscribe(),this.remove(n),!this.closed&&this.timespanOnly){r=this.openContext();var i=this.bufferTimeSpan,s={subscriber:this,context:r,bufferTimeSpan:i};this.add(r.closeAction=this.scheduler.schedule(mh,i,s))}},e.prototype.openContext=function(){var r=new V3;return this.contexts.push(r),r},e.prototype.closeContext=function(r){this.destination.next(r.buffer);var n=this.contexts,i=n?n.indexOf(r):-1;i>=0&&n.splice(n.indexOf(r),1)},e}(ie);function mh(t){var e=t.subscriber,r=t.context;r&&e.closeContext(r),e.closed||(t.context=e.openContext(),t.context.closeAction=this.schedule(t,t.bufferTimeSpan))}function q3(t){var e=t.bufferCreationInterval,r=t.bufferTimeSpan,n=t.subscriber,i=t.scheduler,s=n.openContext(),o=this;n.closed||(n.add(s.closeAction=i.schedule(P0,r,{subscriber:n,context:s})),o.schedule(t,e))}function P0(t){var e=t.subscriber,r=t.context;e.closeContext(r)}function G3(t,e){return function(n){return n.lift(new J3(t,e))}}var J3=function(){function t(e,r){this.openings=e,this.closingSelector=r}return t.prototype.call=function(e,r){return r.subscribe(new Z3(e,this.openings,this.closingSelector))},t}(),Z3=function(t){G(e,t);function e(r,n,i){var s=t.call(this,r)||this;return s.closingSelector=i,s.contexts=[],s.add(Er(s,n)),s}return e.prototype._next=function(r){for(var n=this.contexts,i=n.length,s=0;s<i;s++)n[s].buffer.push(r)},e.prototype._error=function(r){for(var n=this.contexts;n.length>0;){var i=n.shift();i.subscription.unsubscribe(),i.buffer=null,i.subscription=null}this.contexts=null,t.prototype._error.call(this,r)},e.prototype._complete=function(){for(var r=this.contexts;r.length>0;){var n=r.shift();this.destination.next(n.buffer),n.subscription.unsubscribe(),n.buffer=null,n.subscription=null}this.contexts=null,t.prototype._complete.call(this)},e.prototype.notifyNext=function(r,n){r?this.closeBuffer(r):this.openBuffer(n)},e.prototype.notifyComplete=function(r){this.closeBuffer(r.context)},e.prototype.openBuffer=function(r){try{var n=this.closingSelector,i=n.call(this,r);i&&this.trySubscribe(i)}catch(s){this._error(s)}},e.prototype.closeBuffer=function(r){var n=this.contexts;if(n&&r){var i=r.buffer,s=r.subscription;this.destination.next(i),n.splice(n.indexOf(r),1),this.remove(s),s.unsubscribe()}},e.prototype.trySubscribe=function(r){var n=this.contexts,i=[],s=new nt,o={buffer:i,subscription:s};n.push(o);var a=Er(this,r,o);!a||a.closed?this.closeBuffer(o):(a.context=o,this.add(a),s.add(a))},e}(_n);function Q3(t){return function(e){return e.lift(new Y3(t))}}var Y3=function(){function t(e){this.closingSelector=e}return t.prototype.call=function(e,r){return r.subscribe(new K3(e,this.closingSelector))},t}(),K3=function(t){G(e,t);function e(r,n){var i=t.call(this,r)||this;return i.closingSelector=n,i.subscribing=!1,i.openBuffer(),i}return e.prototype._next=function(r){this.buffer.push(r)},e.prototype._complete=function(){var r=this.buffer;r&&this.destination.next(r),t.prototype._complete.call(this)},e.prototype._unsubscribe=function(){this.buffer=void 0,this.subscribing=!1},e.prototype.notifyNext=function(){this.openBuffer()},e.prototype.notifyComplete=function(){this.subscribing?this.complete():this.openBuffer()},e.prototype.openBuffer=function(){var r=this.closingSubscription;r&&(this.remove(r),r.unsubscribe());var n=this.buffer;this.buffer&&this.destination.next(n),this.buffer=[];var i;try{var s=this.closingSelector;i=s()}catch(o){return this.error(o)}r=new nt,this.closingSubscription=r,this.add(r),this.subscribing=!0,r.add(ot(i,new it(this))),this.subscribing=!1},e}(st);function X3(t){return function(r){var n=new e4(t),i=r.lift(n);return n.caught=i}}var e4=function(){function t(e){this.selector=e}return t.prototype.call=function(e,r){return r.subscribe(new t4(e,this.selector,this.caught))},t}(),t4=function(t){G(e,t);function e(r,n,i){var s=t.call(this,r)||this;return s.selector=n,s.caught=i,s}return e.prototype.error=function(r){if(!this.isStopped){var n=void 0;try{n=this.selector(r,this.caught)}catch(o){t.prototype.error.call(this,o);return}this._unsubscribeAndRecycle();var i=new it(this);this.add(i);var s=ot(n,i);s!==i&&this.add(s)}},e}(st);function r4(t){return function(e){return e.lift(new ec(t))}}function n4(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var r=null;return typeof t[t.length-1]=="function"&&(r=t.pop()),t.length===1&&Ct(t[0])&&(t=t[0].slice()),function(n){return n.lift.call(xr([n].concat(t)),new ec(r))}}function i4(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return function(r){return r.lift.call(Pi.apply(void 0,[r].concat(t)))}}function D0(t,e){return fn(t,e,1)}function s4(t,e){return D0(function(){return t},e)}function o4(t){return function(e){return e.lift(new a4(t,e))}}var a4=function(){function t(e,r){this.predicate=e,this.source=r}return t.prototype.call=function(e,r){return r.subscribe(new u4(e,this.predicate,this.source))},t}(),u4=function(t){G(e,t);function e(r,n,i){var s=t.call(this,r)||this;return s.predicate=n,s.source=i,s.count=0,s.index=0,s}return e.prototype._next=function(r){this.predicate?this._tryPredicate(r):this.count++},e.prototype._tryPredicate=function(r){var n;try{n=this.predicate(r,this.index++,this.source)}catch(i){this.destination.error(i);return}n&&this.count++},e.prototype._complete=function(){this.destination.next(this.count),this.destination.complete()},e}(ie);function c4(t){return function(e){return e.lift(new l4(t))}}var l4=function(){function t(e){this.durationSelector=e}return t.prototype.call=function(e,r){return r.subscribe(new h4(e,this.durationSelector))},t}(),h4=function(t){G(e,t);function e(r,n){var i=t.call(this,r)||this;return i.durationSelector=n,i.hasValue=!1,i}return e.prototype._next=function(r){try{var n=this.durationSelector.call(this,r);n&&this._tryNext(r,n)}catch(i){this.destination.error(i)}},e.prototype._complete=function(){this.emitValue(),this.destination.complete()},e.prototype._tryNext=function(r,n){var i=this.durationSubscription;this.value=r,this.hasValue=!0,i&&(i.unsubscribe(),this.remove(i)),i=ot(n,new it(this)),i&&!i.closed&&this.add(this.durationSubscription=i)},e.prototype.notifyNext=function(){this.emitValue()},e.prototype.notifyComplete=function(){this.emitValue()},e.prototype.emitValue=function(){if(this.hasValue){var r=this.value,n=this.durationSubscription;n&&(this.durationSubscription=void 0,n.unsubscribe(),this.remove(n)),this.value=void 0,this.hasValue=!1,t.prototype._next.call(this,r)}},e}(st);function f4(t,e){return e===void 0&&(e=It),function(r){return r.lift(new d4(t,e))}}var d4=function(){function t(e,r){this.dueTime=e,this.scheduler=r}return t.prototype.call=function(e,r){return r.subscribe(new p4(e,this.dueTime,this.scheduler))},t}(),p4=function(t){G(e,t);function e(r,n,i){var s=t.call(this,r)||this;return s.dueTime=n,s.scheduler=i,s.debouncedSubscription=null,s.lastValue=null,s.hasValue=!1,s}return e.prototype._next=function(r){this.clearDebounce(),this.lastValue=r,this.hasValue=!0,this.add(this.debouncedSubscription=this.scheduler.schedule(g4,this.dueTime,this))},e.prototype._complete=function(){this.debouncedNext(),this.destination.complete()},e.prototype.debouncedNext=function(){if(this.clearDebounce(),this.hasValue){var r=this.lastValue;this.lastValue=null,this.hasValue=!1,this.destination.next(r)}},e.prototype.clearDebounce=function(){var r=this.debouncedSubscription;r!==null&&(this.remove(r),r.unsubscribe(),this.debouncedSubscription=null)},e}(ie);function g4(t){t.debouncedNext()}function cs(t){return t===void 0&&(t=null),function(e){return e.lift(new b4(t))}}var b4=function(){function t(e){this.defaultValue=e}return t.prototype.call=function(e,r){return r.subscribe(new v4(e,this.defaultValue))},t}(),v4=function(t){G(e,t);function e(r,n){var i=t.call(this,r)||this;return i.defaultValue=n,i.isEmpty=!0,i}return e.prototype._next=function(r){this.isEmpty=!1,this.destination.next(r)},e.prototype._complete=function(){this.isEmpty&&this.destination.next(this.defaultValue),this.destination.complete()},e}(ie);function j0(t){return t instanceof Date&&!isNaN(+t)}function m4(t,e){e===void 0&&(e=It);var r=j0(t),n=r?+t-e.now():Math.abs(t);return function(i){return i.lift(new y4(n,e))}}var y4=function(){function t(e,r){this.delay=e,this.scheduler=r}return t.prototype.call=function(e,r){return r.subscribe(new _4(e,this.delay,this.scheduler))},t}(),_4=function(t){G(e,t);function e(r,n,i){var s=t.call(this,r)||this;return s.delay=n,s.scheduler=i,s.queue=[],s.active=!1,s.errored=!1,s}return e.dispatch=function(r){for(var n=r.source,i=n.queue,s=r.scheduler,o=r.destination;i.length>0&&i[0].time-s.now()<=0;)i.shift().notification.observe(o);if(i.length>0){var a=Math.max(0,i[0].time-s.now());this.schedule(r,a)}else this.unsubscribe(),n.active=!1},e.prototype._schedule=function(r){this.active=!0;var n=this.destination;n.add(r.schedule(e.dispatch,this.delay,{source:this,destination:this.destination,scheduler:r}))},e.prototype.scheduleNotification=function(r){if(this.errored!==!0){var n=this.scheduler,i=new w4(n.now()+this.delay,r);this.queue.push(i),this.active===!1&&this._schedule(n)}},e.prototype._next=function(r){this.scheduleNotification(_r.createNext(r))},e.prototype._error=function(r){this.errored=!0,this.queue=[],this.destination.error(r),this.unsubscribe()},e.prototype._complete=function(){this.scheduleNotification(_r.createComplete()),this.unsubscribe()},e}(ie),w4=function(){function t(e,r){this.time=e,this.notification=r}return t}();function E4(t,e){return e?function(r){return new x4(r,e).lift(new yh(t))}:function(r){return r.lift(new yh(t))}}var yh=function(){function t(e){this.delayDurationSelector=e}return t.prototype.call=function(e,r){return r.subscribe(new S4(e,this.delayDurationSelector))},t}(),S4=function(t){G(e,t);function e(r,n){var i=t.call(this,r)||this;return i.delayDurationSelector=n,i.completed=!1,i.delayNotifierSubscriptions=[],i.index=0,i}return e.prototype.notifyNext=function(r,n,i,s,o){this.destination.next(r),this.removeSubscription(o),this.tryComplete()},e.prototype.notifyError=function(r,n){this._error(r)},e.prototype.notifyComplete=function(r){var n=this.removeSubscription(r);n&&this.destination.next(n),this.tryComplete()},e.prototype._next=function(r){var n=this.index++;try{var i=this.delayDurationSelector(r,n);i&&this.tryDelay(i,r)}catch(s){this.destination.error(s)}},e.prototype._complete=function(){this.completed=!0,this.tryComplete(),this.unsubscribe()},e.prototype.removeSubscription=function(r){r.unsubscribe();var n=this.delayNotifierSubscriptions.indexOf(r);return n!==-1&&this.delayNotifierSubscriptions.splice(n,1),r.outerValue},e.prototype.tryDelay=function(r,n){var i=Er(this,r,n);if(i&&!i.closed){var s=this.destination;s.add(i),this.delayNotifierSubscriptions.push(i)}},e.prototype.tryComplete=function(){this.completed&&this.delayNotifierSubscriptions.length===0&&this.destination.complete()},e}(_n),x4=function(t){G(e,t);function e(r,n){var i=t.call(this)||this;return i.source=r,i.subscriptionDelay=n,i}return e.prototype._subscribe=function(r){this.subscriptionDelay.subscribe(new M4(r,this.source))},e}(_e),M4=function(t){G(e,t);function e(r,n){var i=t.call(this)||this;return i.parent=r,i.source=n,i.sourceSubscribed=!1,i}return e.prototype._next=function(r){this.subscribeToSource()},e.prototype._error=function(r){this.unsubscribe(),this.parent.error(r)},e.prototype._complete=function(){this.unsubscribe(),this.subscribeToSource()},e.prototype.subscribeToSource=function(){this.sourceSubscribed||(this.sourceSubscribed=!0,this.unsubscribe(),this.source.subscribe(this.parent))},e}(ie);function C4(){return function(e){return e.lift(new I4)}}var I4=function(){function t(){}return t.prototype.call=function(e,r){return r.subscribe(new R4(e))},t}(),R4=function(t){G(e,t);function e(r){return t.call(this,r)||this}return e.prototype._next=function(r){r.observe(this.destination)},e}(ie);function A4(t,e){return function(r){return r.lift(new T4(t,e))}}var T4=function(){function t(e,r){this.keySelector=e,this.flushes=r}return t.prototype.call=function(e,r){return r.subscribe(new k4(e,this.keySelector,this.flushes))},t}(),k4=function(t){G(e,t);function e(r,n,i){var s=t.call(this,r)||this;return s.keySelector=n,s.values=new Set,i&&s.add(ot(i,new it(s))),s}return e.prototype.notifyNext=function(){this.values.clear()},e.prototype.notifyError=function(r){this._error(r)},e.prototype._next=function(r){this.keySelector?this._useKeySelector(r):this._finalizeNext(r,r)},e.prototype._useKeySelector=function(r){var n,i=this.destination;try{n=this.keySelector(r)}catch(s){i.error(s);return}this._finalizeNext(n,r)},e.prototype._finalizeNext=function(r,n){var i=this.values;i.has(r)||(i.add(r),this.destination.next(n))},e}(st);function $0(t,e){return function(r){return r.lift(new N4(t,e))}}var N4=function(){function t(e,r){this.compare=e,this.keySelector=r}return t.prototype.call=function(e,r){return r.subscribe(new O4(e,this.compare,this.keySelector))},t}(),O4=function(t){G(e,t);function e(r,n,i){var s=t.call(this,r)||this;return s.keySelector=i,s.hasKey=!1,typeof n=="function"&&(s.compare=n),s}return e.prototype.compare=function(r,n){return r===n},e.prototype._next=function(r){var n;try{var i=this.keySelector;n=i?i(r):r}catch(a){return this.destination.error(a)}var s=!1;if(this.hasKey)try{var o=this.compare;s=o(this.key,n)}catch(a){return this.destination.error(a)}else this.hasKey=!0;s||(this.key=n,this.destination.next(r))},e}(ie);function L4(t,e){return $0(function(r,n){return e?e(r[t],n[t]):r[t]===n[t]})}function $o(t){return t===void 0&&(t=D4),function(e){return e.lift(new B4(t))}}var B4=function(){function t(e){this.errorFactory=e}return t.prototype.call=function(e,r){return r.subscribe(new P4(e,this.errorFactory))},t}(),P4=function(t){G(e,t);function e(r,n){var i=t.call(this,r)||this;return i.errorFactory=n,i.hasValue=!1,i}return e.prototype._next=function(r){this.hasValue=!0,this.destination.next(r)},e.prototype._complete=function(){if(this.hasValue)return this.destination.complete();var r=void 0;try{r=this.errorFactory()}catch(n){r=n}this.destination.error(r)},e}(ie);function D4(){return new as}function gc(t){return function(e){return t===0?gi():e.lift(new j4(t))}}var j4=function(){function t(e){if(this.total=e,this.total<0)throw new ei}return t.prototype.call=function(e,r){return r.subscribe(new $4(e,this.total))},t}(),$4=function(t){G(e,t);function e(r,n){var i=t.call(this,r)||this;return i.total=n,i.count=0,i}return e.prototype._next=function(r){var n=this.total,i=++this.count;i<=n&&(this.destination.next(r),i===n&&(this.destination.complete(),this.unsubscribe()))},e}(ie);function F4(t,e){if(t<0)throw new ei;var r=arguments.length>=2;return function(n){return n.pipe(Br(function(i,s){return s===t}),gc(1),r?cs(e):$o(function(){return new ei}))}}function U4(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return function(r){return Pi(r,xo.apply(void 0,t))}}function H4(t,e){return function(r){return r.lift(new W4(t,e,r))}}var W4=function(){function t(e,r,n){this.predicate=e,this.thisArg=r,this.source=n}return t.prototype.call=function(e,r){return r.subscribe(new V4(e,this.predicate,this.thisArg,this.source))},t}(),V4=function(t){G(e,t);function e(r,n,i,s){var o=t.call(this,r)||this;return o.predicate=n,o.thisArg=i,o.source=s,o.index=0,o.thisArg=i||o,o}return e.prototype.notifyComplete=function(r){this.destination.next(r),this.destination.complete()},e.prototype._next=function(r){var n=!1;try{n=this.predicate.call(this.thisArg,r,this.index++,this.source)}catch(i){this.destination.error(i);return}n||this.notifyComplete(!1)},e.prototype._complete=function(){this.notifyComplete(!0)},e}(ie);function z4(){return function(t){return t.lift(new q4)}}var q4=function(){function t(){}return t.prototype.call=function(e,r){return r.subscribe(new G4(e))},t}(),G4=function(t){G(e,t);function e(r){var n=t.call(this,r)||this;return n.hasCompleted=!1,n.hasSubscription=!1,n}return e.prototype._next=function(r){this.hasSubscription||(this.hasSubscription=!0,this.add(ot(r,new it(this))))},e.prototype._complete=function(){this.hasCompleted=!0,this.hasSubscription||this.destination.complete()},e.prototype.notifyComplete=function(){this.hasSubscription=!1,this.hasCompleted&&this.destination.complete()},e}(st);function F0(t,e){return e?function(r){return r.pipe(F0(function(n,i){return xr(t(n,i)).pipe(qt(function(s,o){return e(n,s,i,o)}))}))}:function(r){return r.lift(new J4(t))}}var J4=function(){function t(e){this.project=e}return t.prototype.call=function(e,r){return r.subscribe(new Z4(e,this.project))},t}(),Z4=function(t){G(e,t);function e(r,n){var i=t.call(this,r)||this;return i.project=n,i.hasSubscription=!1,i.hasCompleted=!1,i.index=0,i}return e.prototype._next=function(r){this.hasSubscription||this.tryNext(r)},e.prototype.tryNext=function(r){var n,i=this.index++;try{n=this.project(r,i)}catch(s){this.destination.error(s);return}this.hasSubscription=!0,this._innerSub(n)},e.prototype._innerSub=function(r){var n=new it(this),i=this.destination;i.add(n);var s=ot(r,n);s!==n&&i.add(s)},e.prototype._complete=function(){this.hasCompleted=!0,this.hasSubscription||this.destination.complete(),this.unsubscribe()},e.prototype.notifyNext=function(r){this.destination.next(r)},e.prototype.notifyError=function(r){this.destination.error(r)},e.prototype.notifyComplete=function(){this.hasSubscription=!1,this.hasCompleted&&this.destination.complete()},e}(st);function Q4(t,e,r){return e===void 0&&(e=Number.POSITIVE_INFINITY),e=(e||0)<1?Number.POSITIVE_INFINITY:e,function(n){return n.lift(new Y4(t,e,r))}}var Y4=function(){function t(e,r,n){this.project=e,this.concurrent=r,this.scheduler=n}return t.prototype.call=function(e,r){return r.subscribe(new K4(e,this.project,this.concurrent,this.scheduler))},t}(),K4=function(t){G(e,t);function e(r,n,i,s){var o=t.call(this,r)||this;return o.project=n,o.concurrent=i,o.scheduler=s,o.index=0,o.active=0,o.hasCompleted=!1,i<Number.POSITIVE_INFINITY&&(o.buffer=[]),o}return e.dispatch=function(r){var n=r.subscriber,i=r.result,s=r.value,o=r.index;n.subscribeToProjection(i,s,o)},e.prototype._next=function(r){var n=this.destination;if(n.closed){this._complete();return}var i=this.index++;if(this.active<this.concurrent){n.next(r);try{var s=this.project,o=s(r,i);if(!this.scheduler)this.subscribeToProjection(o,r,i);else{var a={subscriber:this,result:o,value:r,index:i},c=this.destination;c.add(this.scheduler.schedule(e.dispatch,0,a))}}catch(l){n.error(l)}}else this.buffer.push(r)},e.prototype.subscribeToProjection=function(r,n,i){this.active++;var s=this.destination;s.add(ot(r,new it(this)))},e.prototype._complete=function(){this.hasCompleted=!0,this.hasCompleted&&this.active===0&&this.destination.complete(),this.unsubscribe()},e.prototype.notifyNext=function(r){this._next(r)},e.prototype.notifyComplete=function(){var r=this.buffer;this.active--,r&&r.length>0&&this._next(r.shift()),this.hasCompleted&&this.active===0&&this.destination.complete()},e}(st);function X4(t){return function(e){return e.lift(new ex(t))}}var ex=function(){function t(e){this.callback=e}return t.prototype.call=function(e,r){return r.subscribe(new tx(e,this.callback))},t}(),tx=function(t){G(e,t);function e(r,n){var i=t.call(this,r)||this;return i.add(new nt(n)),i}return e}(ie);function rx(t,e){if(typeof t!="function")throw new TypeError("predicate is not a function");return function(r){return r.lift(new U0(t,r,!1,e))}}var U0=function(){function t(e,r,n,i){this.predicate=e,this.source=r,this.yieldIndex=n,this.thisArg=i}return t.prototype.call=function(e,r){return r.subscribe(new nx(e,this.predicate,this.source,this.yieldIndex,this.thisArg))},t}(),nx=function(t){G(e,t);function e(r,n,i,s,o){var a=t.call(this,r)||this;return a.predicate=n,a.source=i,a.yieldIndex=s,a.thisArg=o,a.index=0,a}return e.prototype.notifyComplete=function(r){var n=this.destination;n.next(r),n.complete(),this.unsubscribe()},e.prototype._next=function(r){var n=this,i=n.predicate,s=n.thisArg,o=this.index++;try{var a=i.call(s||this,r,o,this.source);a&&this.notifyComplete(this.yieldIndex?o:r)}catch(c){this.destination.error(c)}},e.prototype._complete=function(){this.notifyComplete(this.yieldIndex?-1:void 0)},e}(ie);function ix(t,e){return function(r){return r.lift(new U0(t,r,!0,e))}}function sx(t,e){var r=arguments.length>=2;return function(n){return n.pipe(t?Br(function(i,s){return t(i,s,n)}):Or,gc(1),r?cs(e):$o(function(){return new as}))}}function ox(){return function(e){return e.lift(new ax)}}var ax=function(){function t(){}return t.prototype.call=function(e,r){return r.subscribe(new ux(e))},t}(),ux=function(t){G(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype._next=function(r){},e}(ie);function cx(){return function(t){return t.lift(new lx)}}var lx=function(){function t(){}return t.prototype.call=function(e,r){return r.subscribe(new hx(e))},t}(),hx=function(t){G(e,t);function e(r){return t.call(this,r)||this}return e.prototype.notifyComplete=function(r){var n=this.destination;n.next(r),n.complete()},e.prototype._next=function(r){this.notifyComplete(!1)},e.prototype._complete=function(){this.notifyComplete(!0)},e}(ie);function js(t){return function(r){return t===0?gi():r.lift(new fx(t))}}var fx=function(){function t(e){if(this.total=e,this.total<0)throw new ei}return t.prototype.call=function(e,r){return r.subscribe(new dx(e,this.total))},t}(),dx=function(t){G(e,t);function e(r,n){var i=t.call(this,r)||this;return i.total=n,i.ring=new Array,i.count=0,i}return e.prototype._next=function(r){var n=this.ring,i=this.total,s=this.count++;if(n.length<i)n.push(r);else{var o=s%i;n[o]=r}},e.prototype._complete=function(){var r=this.destination,n=this.count;if(n>0)for(var i=this.count>=this.total?this.total:this.count,s=this.ring,o=0;o<i;o++){var a=n++%i;r.next(s[a])}r.complete()},e}(ie);function px(t,e){var r=arguments.length>=2;return function(n){return n.pipe(t?Br(function(i,s){return t(i,s,n)}):Or,js(1),r?cs(e):$o(function(){return new as}))}}function gx(t){return function(e){return e.lift(new bx(t))}}var bx=function(){function t(e){this.value=e}return t.prototype.call=function(e,r){return r.subscribe(new vx(e,this.value))},t}(),vx=function(t){G(e,t);function e(r,n){var i=t.call(this,r)||this;return i.value=n,i}return e.prototype._next=function(r){this.destination.next(this.value)},e}(ie);function mx(){return function(e){return e.lift(new yx)}}var yx=function(){function t(){}return t.prototype.call=function(e,r){return r.subscribe(new _x(e))},t}(),_x=function(t){G(e,t);function e(r){return t.call(this,r)||this}return e.prototype._next=function(r){this.destination.next(_r.createNext(r))},e.prototype._error=function(r){var n=this.destination;n.next(_r.createError(r)),n.complete()},e.prototype._complete=function(){var r=this.destination;r.next(_r.createComplete()),r.complete()},e}(ie);function $s(t,e){var r=!1;return arguments.length>=2&&(r=!0),function(i){return i.lift(new wx(t,e,r))}}var wx=function(){function t(e,r,n){n===void 0&&(n=!1),this.accumulator=e,this.seed=r,this.hasSeed=n}return t.prototype.call=function(e,r){return r.subscribe(new Ex(e,this.accumulator,this.seed,this.hasSeed))},t}(),Ex=function(t){G(e,t);function e(r,n,i,s){var o=t.call(this,r)||this;return o.accumulator=n,o._seed=i,o.hasSeed=s,o.index=0,o}return Object.defineProperty(e.prototype,"seed",{get:function(){return this._seed},set:function(r){this.hasSeed=!0,this._seed=r},enumerable:!0,configurable:!0}),e.prototype._next=function(r){if(!this.hasSeed)this.seed=r,this.destination.next(r);else return this._tryNext(r)},e.prototype._tryNext=function(r){var n=this.index++,i;try{i=this.accumulator(this.seed,r,n)}catch(s){this.destination.error(s)}this.seed=i,this.destination.next(i)},e}(ie);function Fo(t,e){return arguments.length>=2?function(n){return Xa($s(t,e),js(1),cs(e))(n)}:function(n){return Xa($s(function(i,s,o){return t(i,s,o+1)}),js(1))(n)}}function Sx(t){var e=typeof t=="function"?function(r,n){return t(r,n)>0?r:n}:function(r,n){return r>n?r:n};return Fo(e)}function xx(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return function(r){return r.lift.call(f0.apply(void 0,[r].concat(t)))}}function Mx(t,e,r){return r===void 0&&(r=Number.POSITIVE_INFINITY),typeof e=="function"?fn(function(){return t},e,r):(typeof e=="number"&&(r=e),fn(function(){return t},r))}function Cx(t,e,r){return r===void 0&&(r=Number.POSITIVE_INFINITY),function(n){return n.lift(new Ix(t,e,r))}}var Ix=function(){function t(e,r,n){this.accumulator=e,this.seed=r,this.concurrent=n}return t.prototype.call=function(e,r){return r.subscribe(new Rx(e,this.accumulator,this.seed,this.concurrent))},t}(),Rx=function(t){G(e,t);function e(r,n,i,s){var o=t.call(this,r)||this;return o.accumulator=n,o.acc=i,o.concurrent=s,o.hasValue=!1,o.hasCompleted=!1,o.buffer=[],o.active=0,o.index=0,o}return e.prototype._next=function(r){if(this.active<this.concurrent){var n=this.index++,i=this.destination,s=void 0;try{var o=this.accumulator;s=o(this.acc,r,n)}catch(a){return i.error(a)}this.active++,this._innerSub(s)}else this.buffer.push(r)},e.prototype._innerSub=function(r){var n=new it(this),i=this.destination;i.add(n);var s=ot(r,n);s!==n&&i.add(s)},e.prototype._complete=function(){this.hasCompleted=!0,this.active===0&&this.buffer.length===0&&(this.hasValue===!1&&this.destination.next(this.acc),this.destination.complete()),this.unsubscribe()},e.prototype.notifyNext=function(r){var n=this.destination;this.acc=r,this.hasValue=!0,n.next(r)},e.prototype.notifyComplete=function(){var r=this.buffer;this.active--,r.length>0?this._next(r.shift()):this.active===0&&this.hasCompleted&&(this.hasValue===!1&&this.destination.next(this.acc),this.destination.complete())},e}(st);function Ax(t){var e=typeof t=="function"?function(r,n){return t(r,n)<0?r:n}:function(r,n){return r<n?r:n};return Fo(e)}function dn(t,e){return function(n){var i;if(typeof t=="function"?i=t:i=function(){return t},typeof e=="function")return n.lift(new Tx(i,e));var s=Object.create(n,uE);return s.source=n,s.subjectFactory=i,s}}var Tx=function(){function t(e,r){this.subjectFactory=e,this.selector=r}return t.prototype.call=function(e,r){var n=this.selector,i=this.subjectFactory(),s=n(i).subscribe(e);return s.add(r.subscribe(i)),s},t}();function kx(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return t.length===1&&Ct(t[0])&&(t=t[0]),function(r){return r.lift(new Nx(t))}}var Nx=function(){function t(e){this.nextSources=e}return t.prototype.call=function(e,r){return r.subscribe(new Ox(e,this.nextSources))},t}(),Ox=function(t){G(e,t);function e(r,n){var i=t.call(this,r)||this;return i.destination=r,i.nextSources=n,i}return e.prototype.notifyError=function(){this.subscribeToNextSource()},e.prototype.notifyComplete=function(){this.subscribeToNextSource()},e.prototype._error=function(r){this.subscribeToNextSource(),this.unsubscribe()},e.prototype._complete=function(){this.subscribeToNextSource(),this.unsubscribe()},e.prototype.subscribeToNextSource=function(){var r=this.nextSources.shift();if(r){var n=new it(this),i=this.destination;i.add(n);var s=ot(r,n);s!==n&&i.add(s)}else this.destination.complete()},e}(st);function Lx(){return function(t){return t.lift(new Bx)}}var Bx=function(){function t(){}return t.prototype.call=function(e,r){return r.subscribe(new Px(e))},t}(),Px=function(t){G(e,t);function e(r){var n=t.call(this,r)||this;return n.hasPrev=!1,n}return e.prototype._next=function(r){var n;this.hasPrev?n=[this.prev,r]:this.hasPrev=!0,this.prev=r,n&&this.destination.next(n)},e}(ie);function Dx(t,e){return function(r){return[Br(t,e)(r),Br(p0(t,e))(r)]}}function jx(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var r=t.length;if(r===0)throw new Error("list of properties cannot be empty.");return function(n){return qt($x(t,r))(n)}}function $x(t,e){var r=function(n){for(var i=n,s=0;s<e;s++){var o=i!=null?i[t[s]]:void 0;if(o!==void 0)i=o;else return}return i};return r}function Fx(t){return t?dn(function(){return new vt},t):dn(new vt)}function Ux(t){return function(e){return dn(new Gd(t))(e)}}function Hx(){return function(t){return dn(new bi)(t)}}function Wx(t,e,r,n){r&&typeof r!="function"&&(n=r);var i=typeof r=="function"?r:void 0,s=new Xu(t,e,n);return function(o){return dn(function(){return s},i)(o)}}function Vx(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return function(n){return t.length===1&&Ct(t[0])&&(t=t[0]),n.lift.call(g0.apply(void 0,[n].concat(t)))}}function zx(t){return t===void 0&&(t=-1),function(e){return t===0?gi():t<0?e.lift(new _h(-1,e)):e.lift(new _h(t-1,e))}}var _h=function(){function t(e,r){this.count=e,this.source=r}return t.prototype.call=function(e,r){return r.subscribe(new qx(e,this.count,this.source))},t}(),qx=function(t){G(e,t);function e(r,n,i){var s=t.call(this,r)||this;return s.count=n,s.source=i,s}return e.prototype.complete=function(){if(!this.isStopped){var r=this,n=r.source,i=r.count;if(i===0)return t.prototype.complete.call(this);i>-1&&(this.count=i-1),n.subscribe(this._unsubscribeAndRecycle())}},e}(ie);function Gx(t){return function(e){return e.lift(new Jx(t))}}var Jx=function(){function t(e){this.notifier=e}return t.prototype.call=function(e,r){return r.subscribe(new Zx(e,this.notifier,r))},t}(),Zx=function(t){G(e,t);function e(r,n,i){var s=t.call(this,r)||this;return s.notifier=n,s.source=i,s.sourceIsBeingSubscribedTo=!0,s}return e.prototype.notifyNext=function(){this.sourceIsBeingSubscribedTo=!0,this.source.subscribe(this)},e.prototype.notifyComplete=function(){if(this.sourceIsBeingSubscribedTo===!1)return t.prototype.complete.call(this)},e.prototype.complete=function(){if(this.sourceIsBeingSubscribedTo=!1,!this.isStopped){if(this.retries||this.subscribeToRetries(),!this.retriesSubscription||this.retriesSubscription.closed)return t.prototype.complete.call(this);this._unsubscribeAndRecycle(),this.notifications.next(void 0)}},e.prototype._unsubscribe=function(){var r=this,n=r.notifications,i=r.retriesSubscription;n&&(n.unsubscribe(),this.notifications=void 0),i&&(i.unsubscribe(),this.retriesSubscription=void 0),this.retries=void 0},e.prototype._unsubscribeAndRecycle=function(){var r=this._unsubscribe;return this._unsubscribe=null,t.prototype._unsubscribeAndRecycle.call(this),this._unsubscribe=r,this},e.prototype.subscribeToRetries=function(){this.notifications=new vt;var r;try{var n=this.notifier;r=n(this.notifications)}catch{return t.prototype.complete.call(this)}this.retries=r,this.retriesSubscription=ot(r,new it(this))},e}(st);function Qx(t){return t===void 0&&(t=-1),function(e){return e.lift(new Yx(t,e))}}var Yx=function(){function t(e,r){this.count=e,this.source=r}return t.prototype.call=function(e,r){return r.subscribe(new Kx(e,this.count,this.source))},t}(),Kx=function(t){G(e,t);function e(r,n,i){var s=t.call(this,r)||this;return s.count=n,s.source=i,s}return e.prototype.error=function(r){if(!this.isStopped){var n=this,i=n.source,s=n.count;if(s===0)return t.prototype.error.call(this,r);s>-1&&(this.count=s-1),i.subscribe(this._unsubscribeAndRecycle())}},e}(ie);function Xx(t){return function(e){return e.lift(new e5(t,e))}}var e5=function(){function t(e,r){this.notifier=e,this.source=r}return t.prototype.call=function(e,r){return r.subscribe(new t5(e,this.notifier,this.source))},t}(),t5=function(t){G(e,t);function e(r,n,i){var s=t.call(this,r)||this;return s.notifier=n,s.source=i,s}return e.prototype.error=function(r){if(!this.isStopped){var n=this.errors,i=this.retries,s=this.retriesSubscription;if(i)this.errors=void 0,this.retriesSubscription=void 0;else{n=new vt;try{var o=this.notifier;i=o(n)}catch(a){return t.prototype.error.call(this,a)}s=ot(i,new it(this))}this._unsubscribeAndRecycle(),this.errors=n,this.retries=i,this.retriesSubscription=s,n.next(r)}},e.prototype._unsubscribe=function(){var r=this,n=r.errors,i=r.retriesSubscription;n&&(n.unsubscribe(),this.errors=void 0),i&&(i.unsubscribe(),this.retriesSubscription=void 0),this.retries=void 0},e.prototype.notifyNext=function(){var r=this._unsubscribe;this._unsubscribe=null,this._unsubscribeAndRecycle(),this._unsubscribe=r,this.source.subscribe(this)},e}(st);function r5(t){return function(e){return e.lift(new n5(t))}}var n5=function(){function t(e){this.notifier=e}return t.prototype.call=function(e,r){var n=new i5(e),i=r.subscribe(n);return i.add(ot(this.notifier,new it(n))),i},t}(),i5=function(t){G(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.hasValue=!1,r}return e.prototype._next=function(r){this.value=r,this.hasValue=!0},e.prototype.notifyNext=function(){this.emitValue()},e.prototype.notifyComplete=function(){this.emitValue()},e.prototype.emitValue=function(){this.hasValue&&(this.hasValue=!1,this.destination.next(this.value))},e}(st);function s5(t,e){return e===void 0&&(e=It),function(r){return r.lift(new o5(t,e))}}var o5=function(){function t(e,r){this.period=e,this.scheduler=r}return t.prototype.call=function(e,r){return r.subscribe(new a5(e,this.period,this.scheduler))},t}(),a5=function(t){G(e,t);function e(r,n,i){var s=t.call(this,r)||this;return s.period=n,s.scheduler=i,s.hasValue=!1,s.add(i.schedule(u5,n,{subscriber:s,period:n})),s}return e.prototype._next=function(r){this.lastValue=r,this.hasValue=!0},e.prototype.notifyNext=function(){this.hasValue&&(this.hasValue=!1,this.destination.next(this.lastValue))},e}(ie);function u5(t){var e=t.subscriber,r=t.period;e.notifyNext(),this.schedule(t,r)}function c5(t,e){return function(r){return r.lift(new l5(t,e))}}var l5=function(){function t(e,r){this.compareTo=e,this.comparator=r}return t.prototype.call=function(e,r){return r.subscribe(new h5(e,this.compareTo,this.comparator))},t}(),h5=function(t){G(e,t);function e(r,n,i){var s=t.call(this,r)||this;return s.compareTo=n,s.comparator=i,s._a=[],s._b=[],s._oneComplete=!1,s.destination.add(n.subscribe(new f5(r,s))),s}return e.prototype._next=function(r){this._oneComplete&&this._b.length===0?this.emit(!1):(this._a.push(r),this.checkValues())},e.prototype._complete=function(){this._oneComplete?this.emit(this._a.length===0&&this._b.length===0):this._oneComplete=!0,this.unsubscribe()},e.prototype.checkValues=function(){for(var r=this,n=r._a,i=r._b,s=r.comparator;n.length>0&&i.length>0;){var o=n.shift(),a=i.shift(),c=!1;try{c=s?s(o,a):o===a}catch(l){this.destination.error(l)}c||this.emit(!1)}},e.prototype.emit=function(r){var n=this.destination;n.next(r),n.complete()},e.prototype.nextB=function(r){this._oneComplete&&this._a.length===0?this.emit(!1):(this._b.push(r),this.checkValues())},e.prototype.completeB=function(){this._oneComplete?this.emit(this._a.length===0&&this._b.length===0):this._oneComplete=!0},e}(ie),f5=function(t){G(e,t);function e(r,n){var i=t.call(this,r)||this;return i.parent=n,i}return e.prototype._next=function(r){this.parent.nextB(r)},e.prototype._error=function(r){this.parent.error(r),this.unsubscribe()},e.prototype._complete=function(){this.parent.completeB(),this.unsubscribe()},e}(ie);function d5(){return new vt}function p5(){return function(t){return Qu()(dn(d5)(t))}}function g5(t,e,r){var n;return t&&typeof t=="object"?n=t:n={bufferSize:t,windowTime:e,refCount:!1,scheduler:r},function(i){return i.lift(b5(n))}}function b5(t){var e=t.bufferSize,r=e===void 0?Number.POSITIVE_INFINITY:e,n=t.windowTime,i=n===void 0?Number.POSITIVE_INFINITY:n,s=t.refCount,o=t.scheduler,a,c=0,l,p=!1,g=!1;return function(I){c++;var T;!a||p?(p=!1,a=new Xu(r,i,o),T=a.subscribe(this),l=I.subscribe({next:function(D){a.next(D)},error:function(D){p=!0,a.error(D)},complete:function(){g=!0,l=void 0,a.complete()}}),g&&(l=void 0)):T=a.subscribe(this),this.add(function(){c--,T.unsubscribe(),T=void 0,l&&!g&&s&&c===0&&(l.unsubscribe(),l=void 0,a=void 0)})}}function v5(t){return function(e){return e.lift(new m5(t,e))}}var m5=function(){function t(e,r){this.predicate=e,this.source=r}return t.prototype.call=function(e,r){return r.subscribe(new y5(e,this.predicate,this.source))},t}(),y5=function(t){G(e,t);function e(r,n,i){var s=t.call(this,r)||this;return s.predicate=n,s.source=i,s.seenValue=!1,s.index=0,s}return e.prototype.applySingleValue=function(r){this.seenValue?this.destination.error("Sequence contains more than one element"):(this.seenValue=!0,this.singleValue=r)},e.prototype._next=function(r){var n=this.index++;this.predicate?this.tryNext(r,n):this.applySingleValue(r)},e.prototype.tryNext=function(r,n){try{this.predicate(r,n,this.source)&&this.applySingleValue(r)}catch(i){this.destination.error(i)}},e.prototype._complete=function(){var r=this.destination;this.index>0?(r.next(this.seenValue?this.singleValue:void 0),r.complete()):r.error(new as)},e}(ie);function _5(t){return function(e){return e.lift(new w5(t))}}var w5=function(){function t(e){this.total=e}return t.prototype.call=function(e,r){return r.subscribe(new E5(e,this.total))},t}(),E5=function(t){G(e,t);function e(r,n){var i=t.call(this,r)||this;return i.total=n,i.count=0,i}return e.prototype._next=function(r){++this.count>this.total&&this.destination.next(r)},e}(ie);function S5(t){return function(e){return e.lift(new x5(t))}}var x5=function(){function t(e){if(this._skipCount=e,this._skipCount<0)throw new ei}return t.prototype.call=function(e,r){return this._skipCount===0?r.subscribe(new ie(e)):r.subscribe(new M5(e,this._skipCount))},t}(),M5=function(t){G(e,t);function e(r,n){var i=t.call(this,r)||this;return i._skipCount=n,i._count=0,i._ring=new Array(n),i}return e.prototype._next=function(r){var n=this._skipCount,i=this._count++;if(i<n)this._ring[i]=r;else{var s=i%n,o=this._ring,a=o[s];o[s]=r,this.destination.next(a)}},e}(ie);function C5(t){return function(e){return e.lift(new I5(t))}}var I5=function(){function t(e){this.notifier=e}return t.prototype.call=function(e,r){return r.subscribe(new R5(e,this.notifier))},t}(),R5=function(t){G(e,t);function e(r,n){var i=t.call(this,r)||this;i.hasValue=!1;var s=new it(i);i.add(s),i.innerSubscription=s;var o=ot(n,s);return o!==s&&(i.add(o),i.innerSubscription=o),i}return e.prototype._next=function(r){this.hasValue&&t.prototype._next.call(this,r)},e.prototype.notifyNext=function(){this.hasValue=!0,this.innerSubscription&&this.innerSubscription.unsubscribe()},e.prototype.notifyComplete=function(){},e}(st);function A5(t){return function(e){return e.lift(new T5(t))}}var T5=function(){function t(e){this.predicate=e}return t.prototype.call=function(e,r){return r.subscribe(new k5(e,this.predicate))},t}(),k5=function(t){G(e,t);function e(r,n){var i=t.call(this,r)||this;return i.predicate=n,i.skipping=!0,i.index=0,i}return e.prototype._next=function(r){var n=this.destination;this.skipping&&this.tryCallPredicate(r),this.skipping||n.next(r)},e.prototype.tryCallPredicate=function(r){try{var n=this.predicate(r,this.index++);this.skipping=!!n}catch(i){this.destination.error(i)}},e}(ie);function N5(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var r=t[t.length-1];return Ot(r)?(t.pop(),function(n){return Pi(t,n,r)}):function(n){return Pi(t,n)}}var O5=function(t){G(e,t);function e(r,n,i){n===void 0&&(n=0),i===void 0&&(i=Ms);var s=t.call(this)||this;return s.source=r,s.delayTime=n,s.scheduler=i,(!ti(n)||n<0)&&(s.delayTime=0),(!i||typeof i.schedule!="function")&&(s.scheduler=Ms),s}return e.create=function(r,n,i){return n===void 0&&(n=0),i===void 0&&(i=Ms),new e(r,n,i)},e.dispatch=function(r){var n=r.source,i=r.subscriber;return this.add(n.subscribe(i))},e.prototype._subscribe=function(r){var n=this.delayTime,i=this.source,s=this.scheduler;return s.schedule(e.dispatch,n,{source:i,subscriber:r})},e}(_e);function L5(t,e){return e===void 0&&(e=0),function(n){return n.lift(new B5(t,e))}}var B5=function(){function t(e,r){this.scheduler=e,this.delay=r}return t.prototype.call=function(e,r){return new O5(r,this.delay,this.scheduler).subscribe(e)},t}();function Di(t,e){return typeof e=="function"?function(r){return r.pipe(Di(function(n,i){return xr(t(n,i)).pipe(qt(function(s,o){return e(n,s,i,o)}))}))}:function(r){return r.lift(new P5(t))}}var P5=function(){function t(e){this.project=e}return t.prototype.call=function(e,r){return r.subscribe(new D5(e,this.project))},t}(),D5=function(t){G(e,t);function e(r,n){var i=t.call(this,r)||this;return i.project=n,i.index=0,i}return e.prototype._next=function(r){var n,i=this.index++;try{n=this.project(r,i)}catch(s){this.destination.error(s);return}this._innerSub(n)},e.prototype._innerSub=function(r){var n=this.innerSubscription;n&&n.unsubscribe();var i=new it(this),s=this.destination;s.add(i),this.innerSubscription=ot(r,i),this.innerSubscription!==i&&s.add(this.innerSubscription)},e.prototype._complete=function(){var r=this.innerSubscription;(!r||r.closed)&&t.prototype._complete.call(this),this.unsubscribe()},e.prototype._unsubscribe=function(){this.innerSubscription=void 0},e.prototype.notifyComplete=function(){this.innerSubscription=void 0,this.isStopped&&t.prototype._complete.call(this)},e.prototype.notifyNext=function(r){this.destination.next(r)},e}(st);function j5(){return Di(Or)}function $5(t,e){return e?Di(function(){return t},e):Di(function(){return t})}function F5(t){return function(e){return e.lift(new U5(t))}}var U5=function(){function t(e){this.notifier=e}return t.prototype.call=function(e,r){var n=new H5(e),i=ot(this.notifier,new it(n));return i&&!n.seenValue?(n.add(i),r.subscribe(n)):n},t}(),H5=function(t){G(e,t);function e(r){var n=t.call(this,r)||this;return n.seenValue=!1,n}return e.prototype.notifyNext=function(){this.seenValue=!0,this.complete()},e.prototype.notifyComplete=function(){},e}(st);function W5(t,e){return e===void 0&&(e=!1),function(r){return r.lift(new V5(t,e))}}var V5=function(){function t(e,r){this.predicate=e,this.inclusive=r}return t.prototype.call=function(e,r){return r.subscribe(new z5(e,this.predicate,this.inclusive))},t}(),z5=function(t){G(e,t);function e(r,n,i){var s=t.call(this,r)||this;return s.predicate=n,s.inclusive=i,s.index=0,s}return e.prototype._next=function(r){var n=this.destination,i;try{i=this.predicate(r,this.index++)}catch(s){n.error(s);return}this.nextOrComplete(r,i)},e.prototype.nextOrComplete=function(r,n){var i=this.destination;n?i.next(r):(this.inclusive&&i.next(r),i.complete())},e}(ie);function q5(t,e,r){return function(i){return i.lift(new G5(t,e,r))}}var G5=function(){function t(e,r,n){this.nextOrObserver=e,this.error=r,this.complete=n}return t.prototype.call=function(e,r){return r.subscribe(new J5(e,this.nextOrObserver,this.error,this.complete))},t}(),J5=function(t){G(e,t);function e(r,n,i,s){var o=t.call(this,r)||this;return o._tapNext=ar,o._tapError=ar,o._tapComplete=ar,o._tapError=i||ar,o._tapComplete=s||ar,Kn(n)?(o._context=o,o._tapNext=n):n&&(o._context=n,o._tapNext=n.next||ar,o._tapError=n.error||ar,o._tapComplete=n.complete||ar),o}return e.prototype._next=function(r){try{this._tapNext.call(this._context,r)}catch(n){this.destination.error(n);return}this.destination.next(r)},e.prototype._error=function(r){try{this._tapError.call(this._context,r)}catch(n){this.destination.error(n);return}this.destination.error(r)},e.prototype._complete=function(){try{this._tapComplete.call(this._context)}catch(r){this.destination.error(r);return}return this.destination.complete()},e}(ie),H0={leading:!0,trailing:!1};function Z5(t,e){return e===void 0&&(e=H0),function(r){return r.lift(new Q5(t,!!e.leading,!!e.trailing))}}var Q5=function(){function t(e,r,n){this.durationSelector=e,this.leading=r,this.trailing=n}return t.prototype.call=function(e,r){return r.subscribe(new Y5(e,this.durationSelector,this.leading,this.trailing))},t}(),Y5=function(t){G(e,t);function e(r,n,i,s){var o=t.call(this,r)||this;return o.destination=r,o.durationSelector=n,o._leading=i,o._trailing=s,o._hasValue=!1,o}return e.prototype._next=function(r){this._hasValue=!0,this._sendValue=r,this._throttled||(this._leading?this.send():this.throttle(r))},e.prototype.send=function(){var r=this,n=r._hasValue,i=r._sendValue;n&&(this.destination.next(i),this.throttle(i)),this._hasValue=!1,this._sendValue=void 0},e.prototype.throttle=function(r){var n=this.tryDurationSelector(r);n&&this.add(this._throttled=ot(n,new it(this)))},e.prototype.tryDurationSelector=function(r){try{return this.durationSelector(r)}catch(n){return this.destination.error(n),null}},e.prototype.throttlingDone=function(){var r=this,n=r._throttled,i=r._trailing;n&&n.unsubscribe(),this._throttled=void 0,i&&this.send()},e.prototype.notifyNext=function(){this.throttlingDone()},e.prototype.notifyComplete=function(){this.throttlingDone()},e}(st);function K5(t,e,r){return e===void 0&&(e=It),r===void 0&&(r=H0),function(n){return n.lift(new X5(t,e,r.leading,r.trailing))}}var X5=function(){function t(e,r,n,i){this.duration=e,this.scheduler=r,this.leading=n,this.trailing=i}return t.prototype.call=function(e,r){return r.subscribe(new eM(e,this.duration,this.scheduler,this.leading,this.trailing))},t}(),eM=function(t){G(e,t);function e(r,n,i,s,o){var a=t.call(this,r)||this;return a.duration=n,a.scheduler=i,a.leading=s,a.trailing=o,a._hasTrailingValue=!1,a._trailingValue=null,a}return e.prototype._next=function(r){this.throttled?this.trailing&&(this._trailingValue=r,this._hasTrailingValue=!0):(this.add(this.throttled=this.scheduler.schedule(tM,this.duration,{subscriber:this})),this.leading?this.destination.next(r):this.trailing&&(this._trailingValue=r,this._hasTrailingValue=!0))},e.prototype._complete=function(){this._hasTrailingValue?(this.destination.next(this._trailingValue),this.destination.complete()):this.destination.complete()},e.prototype.clearThrottle=function(){var r=this.throttled;r&&(this.trailing&&this._hasTrailingValue&&(this.destination.next(this._trailingValue),this._trailingValue=null,this._hasTrailingValue=!1),r.unsubscribe(),this.remove(r),this.throttled=null)},e}(ie);function tM(t){var e=t.subscriber;e.clearThrottle()}function rM(t){return t===void 0&&(t=It),function(e){return rc(function(){return e.pipe($s(function(r,n){var i=r.current;return{value:n,current:t.now(),last:i}},{current:t.now(),value:void 0,last:void 0}),qt(function(r){var n=r.current,i=r.last,s=r.value;return new nM(s,n-i)}))})}}var nM=function(){function t(e,r){this.value=e,this.interval=r}return t}();function W0(t,e,r){return r===void 0&&(r=It),function(n){var i=j0(t),s=i?+t-r.now():Math.abs(t);return n.lift(new iM(s,i,e,r))}}var iM=function(){function t(e,r,n,i){this.waitFor=e,this.absoluteTimeout=r,this.withObservable=n,this.scheduler=i}return t.prototype.call=function(e,r){return r.subscribe(new sM(e,this.absoluteTimeout,this.waitFor,this.withObservable,this.scheduler))},t}(),sM=function(t){G(e,t);function e(r,n,i,s,o){var a=t.call(this,r)||this;return a.absoluteTimeout=n,a.waitFor=i,a.withObservable=s,a.scheduler=o,a.scheduleTimeout(),a}return e.dispatchTimeout=function(r){var n=r.withObservable;r._unsubscribeAndRecycle(),r.add(ot(n,new it(r)))},e.prototype.scheduleTimeout=function(){var r=this.action;r?this.action=r.schedule(this,this.waitFor):this.add(this.action=this.scheduler.schedule(e.dispatchTimeout,this.waitFor,this))},e.prototype._next=function(r){this.absoluteTimeout||this.scheduleTimeout(),t.prototype._next.call(this,r)},e.prototype._unsubscribe=function(){this.action=void 0,this.scheduler=null,this.withObservable=null},e}(st);function oM(t,e){return e===void 0&&(e=It),W0(t,Ku(new r0),e)}function aM(t){return t===void 0&&(t=It),qt(function(e){return new uM(e,t.now())})}var uM=function(){function t(e,r){this.value=e,this.timestamp=r}return t}();function cM(t,e,r){return r===0?[e]:(t.push(e),t)}function lM(){return Fo(cM,[])}function hM(t){return function(r){return r.lift(new fM(t))}}var fM=function(){function t(e){this.windowBoundaries=e}return t.prototype.call=function(e,r){var n=new dM(e),i=r.subscribe(n);return i.closed||n.add(ot(this.windowBoundaries,new it(n))),i},t}(),dM=function(t){G(e,t);function e(r){var n=t.call(this,r)||this;return n.window=new vt,r.next(n.window),n}return e.prototype.notifyNext=function(){this.openWindow()},e.prototype.notifyError=function(r){this._error(r)},e.prototype.notifyComplete=function(){this._complete()},e.prototype._next=function(r){this.window.next(r)},e.prototype._error=function(r){this.window.error(r),this.destination.error(r)},e.prototype._complete=function(){this.window.complete(),this.destination.complete()},e.prototype._unsubscribe=function(){this.window=null},e.prototype.openWindow=function(){var r=this.window;r&&r.complete();var n=this.destination,i=this.window=new vt;n.next(i)},e}(st);function pM(t,e){return e===void 0&&(e=0),function(n){return n.lift(new gM(t,e))}}var gM=function(){function t(e,r){this.windowSize=e,this.startWindowEvery=r}return t.prototype.call=function(e,r){return r.subscribe(new bM(e,this.windowSize,this.startWindowEvery))},t}(),bM=function(t){G(e,t);function e(r,n,i){var s=t.call(this,r)||this;return s.destination=r,s.windowSize=n,s.startWindowEvery=i,s.windows=[new vt],s.count=0,r.next(s.windows[0]),s}return e.prototype._next=function(r){for(var n=this.startWindowEvery>0?this.startWindowEvery:this.windowSize,i=this.destination,s=this.windowSize,o=this.windows,a=o.length,c=0;c<a&&!this.closed;c++)o[c].next(r);var l=this.count-s+1;if(l>=0&&l%n===0&&!this.closed&&o.shift().complete(),++this.count%n===0&&!this.closed){var p=new vt;o.push(p),i.next(p)}},e.prototype._error=function(r){var n=this.windows;if(n)for(;n.length>0&&!this.closed;)n.shift().error(r);this.destination.error(r)},e.prototype._complete=function(){var r=this.windows;if(r)for(;r.length>0&&!this.closed;)r.shift().complete();this.destination.complete()},e.prototype._unsubscribe=function(){this.count=0,this.windows=null},e}(ie);function vM(t){var e=It,r=null,n=Number.POSITIVE_INFINITY;return Ot(arguments[3])&&(e=arguments[3]),Ot(arguments[2])?e=arguments[2]:ti(arguments[2])&&(n=Number(arguments[2])),Ot(arguments[1])?e=arguments[1]:ti(arguments[1])&&(r=Number(arguments[1])),function(s){return s.lift(new mM(t,r,n,e))}}var mM=function(){function t(e,r,n,i){this.windowTimeSpan=e,this.windowCreationInterval=r,this.maxWindowSize=n,this.scheduler=i}return t.prototype.call=function(e,r){return r.subscribe(new _M(e,this.windowTimeSpan,this.windowCreationInterval,this.maxWindowSize,this.scheduler))},t}(),yM=function(t){G(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r._numberOfNextedValues=0,r}return e.prototype.next=function(r){this._numberOfNextedValues++,t.prototype.next.call(this,r)},Object.defineProperty(e.prototype,"numberOfNextedValues",{get:function(){return this._numberOfNextedValues},enumerable:!0,configurable:!0}),e}(vt),_M=function(t){G(e,t);function e(r,n,i,s,o){var a=t.call(this,r)||this;a.destination=r,a.windowTimeSpan=n,a.windowCreationInterval=i,a.maxWindowSize=s,a.scheduler=o,a.windows=[];var c=a.openWindow();if(i!==null&&i>=0){var l={subscriber:a,window:c,context:null},p={windowTimeSpan:n,windowCreationInterval:i,subscriber:a,scheduler:o};a.add(o.schedule(V0,n,l)),a.add(o.schedule(EM,i,p))}else{var g={subscriber:a,window:c,windowTimeSpan:n};a.add(o.schedule(wM,n,g))}return a}return e.prototype._next=function(r){for(var n=this.windows,i=n.length,s=0;s<i;s++){var o=n[s];o.closed||(o.next(r),o.numberOfNextedValues>=this.maxWindowSize&&this.closeWindow(o))}},e.prototype._error=function(r){for(var n=this.windows;n.length>0;)n.shift().error(r);this.destination.error(r)},e.prototype._complete=function(){for(var r=this.windows;r.length>0;){var n=r.shift();n.closed||n.complete()}this.destination.complete()},e.prototype.openWindow=function(){var r=new yM;this.windows.push(r);var n=this.destination;return n.next(r),r},e.prototype.closeWindow=function(r){r.complete();var n=this.windows;n.splice(n.indexOf(r),1)},e}(ie);function wM(t){var e=t.subscriber,r=t.windowTimeSpan,n=t.window;n&&e.closeWindow(n),t.window=e.openWindow(),this.schedule(t,r)}function EM(t){var e=t.windowTimeSpan,r=t.subscriber,n=t.scheduler,i=t.windowCreationInterval,s=r.openWindow(),o=this,a={action:o,subscription:null},c={subscriber:r,window:s,context:a};a.subscription=n.schedule(V0,e,c),o.add(a.subscription),o.schedule(t,i)}function V0(t){var e=t.subscriber,r=t.window,n=t.context;n&&n.action&&n.subscription&&n.action.remove(n.subscription),e.closeWindow(r)}function SM(t,e){return function(r){return r.lift(new xM(t,e))}}var xM=function(){function t(e,r){this.openings=e,this.closingSelector=r}return t.prototype.call=function(e,r){return r.subscribe(new MM(e,this.openings,this.closingSelector))},t}(),MM=function(t){G(e,t);function e(r,n,i){var s=t.call(this,r)||this;return s.openings=n,s.closingSelector=i,s.contexts=[],s.add(s.openSubscription=Er(s,n,n)),s}return e.prototype._next=function(r){var n=this.contexts;if(n)for(var i=n.length,s=0;s<i;s++)n[s].window.next(r)},e.prototype._error=function(r){var n=this.contexts;if(this.contexts=null,n)for(var i=n.length,s=-1;++s<i;){var o=n[s];o.window.error(r),o.subscription.unsubscribe()}t.prototype._error.call(this,r)},e.prototype._complete=function(){var r=this.contexts;if(this.contexts=null,r)for(var n=r.length,i=-1;++i<n;){var s=r[i];s.window.complete(),s.subscription.unsubscribe()}t.prototype._complete.call(this)},e.prototype._unsubscribe=function(){var r=this.contexts;if(this.contexts=null,r)for(var n=r.length,i=-1;++i<n;){var s=r[i];s.window.unsubscribe(),s.subscription.unsubscribe()}},e.prototype.notifyNext=function(r,n,i,s,o){if(r===this.openings){var a=void 0;try{var c=this.closingSelector;a=c(n)}catch(I){return this.error(I)}var l=new vt,p=new nt,g={window:l,subscription:p};this.contexts.push(g);var y=Er(this,a,g);y.closed?this.closeWindow(this.contexts.length-1):(y.context=g,p.add(y)),this.destination.next(l)}else this.closeWindow(this.contexts.indexOf(r))},e.prototype.notifyError=function(r){this.error(r)},e.prototype.notifyComplete=function(r){r!==this.openSubscription&&this.closeWindow(this.contexts.indexOf(r.context))},e.prototype.closeWindow=function(r){if(r!==-1){var n=this.contexts,i=n[r],s=i.window,o=i.subscription;n.splice(r,1),s.complete(),o.unsubscribe()}},e}(_n);function CM(t){return function(r){return r.lift(new IM(t))}}var IM=function(){function t(e){this.closingSelector=e}return t.prototype.call=function(e,r){return r.subscribe(new RM(e,this.closingSelector))},t}(),RM=function(t){G(e,t);function e(r,n){var i=t.call(this,r)||this;return i.destination=r,i.closingSelector=n,i.openWindow(),i}return e.prototype.notifyNext=function(r,n,i,s,o){this.openWindow(o)},e.prototype.notifyError=function(r){this._error(r)},e.prototype.notifyComplete=function(r){this.openWindow(r)},e.prototype._next=function(r){this.window.next(r)},e.prototype._error=function(r){this.window.error(r),this.destination.error(r),this.unsubscribeClosingNotification()},e.prototype._complete=function(){this.window.complete(),this.destination.complete(),this.unsubscribeClosingNotification()},e.prototype.unsubscribeClosingNotification=function(){this.closingNotification&&this.closingNotification.unsubscribe()},e.prototype.openWindow=function(r){r===void 0&&(r=null),r&&(this.remove(r),r.unsubscribe());var n=this.window;n&&n.complete();var i=this.window=new vt;this.destination.next(i);var s;try{var o=this.closingSelector;s=o()}catch(a){this.destination.error(a),this.window.error(a);return}this.add(this.closingNotification=Er(this,s))},e}(_n);function AM(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return function(r){var n;typeof t[t.length-1]=="function"&&(n=t.pop());var i=t;return r.lift(new TM(i,n))}}var TM=function(){function t(e,r){this.observables=e,this.project=r}return t.prototype.call=function(e,r){return r.subscribe(new kM(e,this.observables,this.project))},t}(),kM=function(t){G(e,t);function e(r,n,i){var s=t.call(this,r)||this;s.observables=n,s.project=i,s.toRespond=[];var o=n.length;s.values=new Array(o);for(var a=0;a<o;a++)s.toRespond.push(a);for(var a=0;a<o;a++){var c=n[a];s.add(Er(s,c,void 0,a))}return s}return e.prototype.notifyNext=function(r,n,i){this.values[i]=n;var s=this.toRespond;if(s.length>0){var o=s.indexOf(i);o!==-1&&s.splice(o,1)}},e.prototype.notifyComplete=function(){},e.prototype._next=function(r){if(this.toRespond.length===0){var n=[r].concat(this.values);this.project?this._tryProject(n):this.destination.next(n)}},e.prototype._tryProject=function(r){var n;try{n=this.project.apply(this,r)}catch(i){this.destination.error(i);return}this.destination.next(n)},e}(_n);function NM(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return function(n){return n.lift.call(v0.apply(void 0,[n].concat(t)))}}function OM(t){return function(e){return e.lift(new m0(t))}}const LM=Object.freeze(Object.defineProperty({__proto__:null,audit:B0,auditTime:L3,buffer:B3,bufferCount:j3,bufferTime:H3,bufferToggle:G3,bufferWhen:Q3,catchError:X3,combineAll:r4,combineLatest:n4,concat:i4,concatAll:u0,concatMap:D0,concatMapTo:s4,count:o4,debounce:c4,debounceTime:f4,defaultIfEmpty:cs,delay:m4,delayWhen:E4,dematerialize:C4,distinct:A4,distinctUntilChanged:$0,distinctUntilKeyChanged:L4,elementAt:F4,endWith:U4,every:H4,exhaust:z4,exhaustMap:F0,expand:Q4,filter:Br,finalize:X4,find:rx,findIndex:ix,first:sx,flatMap:rS,groupBy:lE,ignoreElements:ox,isEmpty:cx,last:px,map:qt,mapTo:gx,materialize:mx,max:Sx,merge:xx,mergeAll:tc,mergeMap:fn,mergeMapTo:Mx,mergeScan:Cx,min:Ax,multicast:dn,observeOn:_E,onErrorResumeNext:kx,pairwise:Lx,partition:Dx,pluck:jx,publish:Fx,publishBehavior:Ux,publishLast:Hx,publishReplay:Wx,race:Vx,reduce:Fo,refCount:Qu,repeat:zx,repeatWhen:Gx,retry:Qx,retryWhen:Xx,sample:r5,sampleTime:s5,scan:$s,sequenceEqual:c5,share:p5,shareReplay:g5,single:v5,skip:_5,skipLast:S5,skipUntil:C5,skipWhile:A5,startWith:N5,subscribeOn:L5,switchAll:j5,switchMap:Di,switchMapTo:$5,take:gc,takeLast:js,takeUntil:F5,takeWhile:W5,tap:q5,throttle:Z5,throttleTime:K5,throwIfEmpty:$o,timeInterval:rM,timeout:oM,timeoutWith:W0,timestamp:aM,toArray:lM,window:hM,windowCount:pM,windowTime:vM,windowToggle:SM,windowWhen:CM,withLatestFrom:AM,zip:NM,zipAll:OM},Symbol.toStringTag,{value:"Module"})),bc=si(LM);var Uo={},Ut={};Object.defineProperty(Ut,"__esModule",{value:!0});Ut.ClientMessagePublishEvent=Ut.ClientMessageSetSessionConfig=Ut.ClientMessageGetSessionConfig=Ut.ClientMessageIsLinked=Ut.ClientMessageHostSession=void 0;function BM(t){return Object.assign({type:"HostSession"},t)}Ut.ClientMessageHostSession=BM;function PM(t){return Object.assign({type:"IsLinked"},t)}Ut.ClientMessageIsLinked=PM;function DM(t){return Object.assign({type:"GetSessionConfig"},t)}Ut.ClientMessageGetSessionConfig=DM;function jM(t){return Object.assign({type:"SetSessionConfig"},t)}Ut.ClientMessageSetSessionConfig=jM;function $M(t){return Object.assign({type:"PublishEvent"},t)}Ut.ClientMessagePublishEvent=$M;var z0={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.RxWebSocket=t.ConnectionState=void 0;const e=Mo,r=bc;var n;(function(s){s[s.DISCONNECTED=0]="DISCONNECTED",s[s.CONNECTING=1]="CONNECTING",s[s.CONNECTED=2]="CONNECTED"})(n=t.ConnectionState||(t.ConnectionState={}));class i{constructor(o,a=WebSocket){this.WebSocketClass=a,this.webSocket=null,this.connectionStateSubject=new e.BehaviorSubject(n.DISCONNECTED),this.incomingDataSubject=new e.Subject,this.url=o.replace(/^http/,"ws")}connect(){return this.webSocket?(0,e.throwError)(new Error("webSocket object is not null")):new e.Observable(o=>{let a;try{this.webSocket=a=new this.WebSocketClass(this.url)}catch(c){o.error(c);return}this.connectionStateSubject.next(n.CONNECTING),a.onclose=c=>{this.clearWebSocket(),o.error(new Error(`websocket error ${c.code}: ${c.reason}`)),this.connectionStateSubject.next(n.DISCONNECTED)},a.onopen=c=>{o.next(),o.complete(),this.connectionStateSubject.next(n.CONNECTED)},a.onmessage=c=>{this.incomingDataSubject.next(c.data)}}).pipe((0,r.take)(1))}disconnect(){const{webSocket:o}=this;if(o){this.clearWebSocket(),this.connectionStateSubject.next(n.DISCONNECTED);try{o.close()}catch{}}}get connectionState$(){return this.connectionStateSubject.asObservable()}get incomingData$(){return this.incomingDataSubject.asObservable()}get incomingJSONData$(){return this.incomingData$.pipe((0,r.flatMap)(o=>{let a;try{a=JSON.parse(o)}catch{return(0,e.empty)()}return(0,e.of)(a)}))}sendData(o){const{webSocket:a}=this;if(!a)throw new Error("websocket is not connected");a.send(o)}clearWebSocket(){const{webSocket:o}=this;o&&(this.webSocket=null,o.onclose=null,o.onerror=null,o.onmessage=null,o.onopen=null)}}t.RxWebSocket=i})(z0);var Ho={};Object.defineProperty(Ho,"__esModule",{value:!0});Ho.isServerMessageFail=void 0;function FM(t){return t&&t.type==="Fail"&&typeof t.id=="number"&&typeof t.sessionId=="string"&&typeof t.error=="string"}Ho.isServerMessageFail=FM;Object.defineProperty(Uo,"__esModule",{value:!0});Uo.WalletSDKConnection=void 0;const Jt=Mo,Ee=bc,wi=ui,Ln=Vi,Ei=Ut,Si=oi,_s=z0,Pa=Ho,wh=1e4,UM=6e4;class HM{constructor(e,r,n,i,s=WebSocket){this.sessionId=e,this.sessionKey=r,this.diagnostic=i,this.subscriptions=new Jt.Subscription,this.destroyed=!1,this.lastHeartbeatResponse=0,this.nextReqId=(0,Ln.IntNumber)(1),this.connectedSubject=new Jt.BehaviorSubject(!1),this.linkedSubject=new Jt.BehaviorSubject(!1),this.sessionConfigSubject=new Jt.ReplaySubject(1);const o=new _s.RxWebSocket(n+"/rpc",s);this.ws=o,this.subscriptions.add(o.connectionState$.pipe((0,Ee.tap)(a=>{var c;return(c=this.diagnostic)===null||c===void 0?void 0:c.log(Si.EVENTS.CONNECTED_STATE_CHANGE,{state:a,sessionIdHash:wi.Session.hash(e)})}),(0,Ee.skip)(1),(0,Ee.filter)(a=>a===_s.ConnectionState.DISCONNECTED&&!this.destroyed),(0,Ee.delay)(5e3),(0,Ee.filter)(a=>!this.destroyed),(0,Ee.flatMap)(a=>o.connect()),(0,Ee.retry)()).subscribe()),this.subscriptions.add(o.connectionState$.pipe((0,Ee.skip)(2),(0,Ee.switchMap)(a=>(0,Jt.iif)(()=>a===_s.ConnectionState.CONNECTED,this.authenticate().pipe((0,Ee.tap)(c=>this.sendIsLinked()),(0,Ee.tap)(c=>this.sendGetSessionConfig()),(0,Ee.map)(c=>!0)),(0,Jt.of)(!1))),(0,Ee.distinctUntilChanged)(),(0,Ee.catchError)(a=>(0,Jt.of)(!1))).subscribe(a=>this.connectedSubject.next(a))),this.subscriptions.add(o.connectionState$.pipe((0,Ee.skip)(1),(0,Ee.switchMap)(a=>(0,Jt.iif)(()=>a===_s.ConnectionState.CONNECTED,(0,Jt.timer)(0,wh)))).subscribe(a=>a===0?this.updateLastHeartbeat():this.heartbeat())),this.subscriptions.add(o.incomingData$.pipe((0,Ee.filter)(a=>a==="h")).subscribe(a=>this.updateLastHeartbeat())),this.subscriptions.add(o.incomingJSONData$.pipe((0,Ee.filter)(a=>["IsLinkedOK","Linked"].includes(a.type))).subscribe(a=>{var c;const l=a;(c=this.diagnostic)===null||c===void 0||c.log(Si.EVENTS.LINKED,{sessionIdHash:wi.Session.hash(e),linked:l.linked,type:a.type,onlineGuests:l.onlineGuests}),this.linkedSubject.next(l.linked||l.onlineGuests>0)})),this.subscriptions.add(o.incomingJSONData$.pipe((0,Ee.filter)(a=>["GetSessionConfigOK","SessionConfigUpdated"].includes(a.type))).subscribe(a=>{var c;const l=a;(c=this.diagnostic)===null||c===void 0||c.log(Si.EVENTS.SESSION_CONFIG_RECEIVED,{sessionIdHash:wi.Session.hash(e),metadata_keys:l&&l.metadata?Object.keys(l.metadata):void 0}),this.sessionConfigSubject.next({webhookId:l.webhookId,webhookUrl:l.webhookUrl,metadata:l.metadata})}))}connect(){var e;if(this.destroyed)throw new Error("instance is destroyed");(e=this.diagnostic)===null||e===void 0||e.log(Si.EVENTS.STARTED_CONNECTING,{sessionIdHash:wi.Session.hash(this.sessionId)}),this.ws.connect().subscribe()}destroy(){var e;this.subscriptions.unsubscribe(),this.ws.disconnect(),(e=this.diagnostic)===null||e===void 0||e.log(Si.EVENTS.DISCONNECTED,{sessionIdHash:wi.Session.hash(this.sessionId)}),this.destroyed=!0}get isDestroyed(){return this.destroyed}get connected$(){return this.connectedSubject.asObservable()}get onceConnected$(){return this.connected$.pipe((0,Ee.filter)(e=>e),(0,Ee.take)(1),(0,Ee.map)(()=>{}))}get linked$(){return this.linkedSubject.asObservable()}get onceLinked$(){return this.linked$.pipe((0,Ee.filter)(e=>e),(0,Ee.take)(1),(0,Ee.map)(()=>{}))}get sessionConfig$(){return this.sessionConfigSubject.asObservable()}get incomingEvent$(){return this.ws.incomingJSONData$.pipe((0,Ee.filter)(e=>{if(e.type!=="Event")return!1;const r=e;return typeof r.sessionId=="string"&&typeof r.eventId=="string"&&typeof r.event=="string"&&typeof r.data=="string"}),(0,Ee.map)(e=>e))}setSessionMetadata(e,r){const n=(0,Ei.ClientMessageSetSessionConfig)({id:(0,Ln.IntNumber)(this.nextReqId++),sessionId:this.sessionId,metadata:{[e]:r}});return this.onceConnected$.pipe((0,Ee.flatMap)(i=>this.makeRequest(n)),(0,Ee.map)(i=>{if((0,Pa.isServerMessageFail)(i))throw new Error(i.error||"failed to set session metadata")}))}publishEvent(e,r,n=!1){const i=(0,Ei.ClientMessagePublishEvent)({id:(0,Ln.IntNumber)(this.nextReqId++),sessionId:this.sessionId,event:e,data:r,callWebhook:n});return this.onceLinked$.pipe((0,Ee.flatMap)(s=>this.makeRequest(i)),(0,Ee.map)(s=>{if((0,Pa.isServerMessageFail)(s))throw new Error(s.error||"failed to publish event");return s.eventId}))}sendData(e){this.ws.sendData(JSON.stringify(e))}updateLastHeartbeat(){this.lastHeartbeatResponse=Date.now()}heartbeat(){if(Date.now()-this.lastHeartbeatResponse>wh*2){this.ws.disconnect();return}try{this.ws.sendData("h")}catch{}}makeRequest(e,r=UM){const n=e.id;try{this.sendData(e)}catch(i){return(0,Jt.throwError)(i)}return this.ws.incomingJSONData$.pipe((0,Ee.timeoutWith)(r,(0,Jt.throwError)(new Error(`request ${n} timed out`))),(0,Ee.filter)(i=>i.id===n),(0,Ee.take)(1))}authenticate(){const e=(0,Ei.ClientMessageHostSession)({id:(0,Ln.IntNumber)(this.nextReqId++),sessionId:this.sessionId,sessionKey:this.sessionKey});return this.makeRequest(e).pipe((0,Ee.map)(r=>{if((0,Pa.isServerMessageFail)(r))throw new Error(r.error||"failed to authentcate")}))}sendIsLinked(){const e=(0,Ei.ClientMessageIsLinked)({id:(0,Ln.IntNumber)(this.nextReqId++),sessionId:this.sessionId});this.sendData(e)}sendGetSessionConfig(){const e=(0,Ei.ClientMessageGetSessionConfig)({id:(0,Ln.IntNumber)(this.nextReqId++),sessionId:this.sessionId});this.sendData(e)}}Uo.WalletSDKConnection=HM;var ni={};Object.defineProperty(ni,"__esModule",{value:!0});ni.decrypt=ni.encrypt=void 0;const Fs=re;async function WM(t,e){if(e.length!==64)throw Error("secret must be 256 bits");const r=crypto.getRandomValues(new Uint8Array(12)),n=await crypto.subtle.importKey("raw",(0,Fs.hexStringToUint8Array)(e),{name:"aes-gcm"},!1,["encrypt","decrypt"]),i=new TextEncoder,s=await window.crypto.subtle.encrypt({name:"AES-GCM",iv:r},n,i.encode(t)),o=16,a=s.slice(s.byteLength-o),c=s.slice(0,s.byteLength-o),l=new Uint8Array(a),p=new Uint8Array(c),g=new Uint8Array([...r,...l,...p]);return(0,Fs.uint8ArrayToHex)(g)}ni.encrypt=WM;function VM(t,e){if(e.length!==64)throw Error("secret must be 256 bits");return new Promise((r,n)=>{(async function(){const i=await crypto.subtle.importKey("raw",(0,Fs.hexStringToUint8Array)(e),{name:"aes-gcm"},!1,["encrypt","decrypt"]),s=(0,Fs.hexStringToUint8Array)(t),o=s.slice(0,12),a=s.slice(12,28),c=s.slice(28),l=new Uint8Array([...c,...a]),p={name:"AES-GCM",iv:new Uint8Array(o)};try{const g=await window.crypto.subtle.decrypt(p,i,l),y=new TextDecoder;r(y.decode(g))}catch(g){n(g)}})()})}ni.decrypt=VM;var Wo={},Vo={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.RelayMessageType=void 0,function(e){e.SESSION_ID_REQUEST="SESSION_ID_REQUEST",e.SESSION_ID_RESPONSE="SESSION_ID_RESPONSE",e.LINKED="LINKED",e.UNLINKED="UNLINKED",e.WEB3_REQUEST="WEB3_REQUEST",e.WEB3_REQUEST_CANCELED="WEB3_REQUEST_CANCELED",e.WEB3_RESPONSE="WEB3_RESPONSE"}(t.RelayMessageType||(t.RelayMessageType={}))})(Vo);Object.defineProperty(Wo,"__esModule",{value:!0});Wo.Web3RequestCanceledMessage=void 0;const zM=Vo;function qM(t){return{type:zM.RelayMessageType.WEB3_REQUEST_CANCELED,id:t}}Wo.Web3RequestCanceledMessage=qM;var zo={};Object.defineProperty(zo,"__esModule",{value:!0});zo.Web3RequestMessage=void 0;const GM=Vo;function JM(t){return Object.assign({type:GM.RelayMessageType.WEB3_REQUEST},t)}zo.Web3RequestMessage=JM;var ii={};Object.defineProperty(ii,"__esModule",{value:!0});ii.isWeb3ResponseMessage=ii.Web3ResponseMessage=void 0;const q0=Vo;function ZM(t){return Object.assign({type:q0.RelayMessageType.WEB3_RESPONSE},t)}ii.Web3ResponseMessage=ZM;function QM(t){return t&&t.type===q0.RelayMessageType.WEB3_RESPONSE}ii.isWeb3ResponseMessage=QM;var YM=te&&te.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r),Object.defineProperty(t,n,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),KM=te&&te.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),G0=te&&te.__decorate||function(t,e,r,n){var i=arguments.length,s=i<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,n);else for(var a=t.length-1;a>=0;a--)(o=t[a])&&(s=(i<3?o(s):i>3?o(e,r,s):o(e,r))||s);return i>3&&s&&Object.defineProperty(e,r,s),s},XM=te&&te.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)r!=="default"&&Object.prototype.hasOwnProperty.call(t,r)&&YM(e,t,r);return KM(e,t),e},eC=te&&te.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Do,"__esModule",{value:!0});Do.WalletSDKRelay=void 0;const J0=eC(jo),Xr=Mo,lt=bc,Et=oi,tC=Uo,Bn=ji,rC=Vi,et=re,Cr=XM(ni),Ir=ui,ws=Kt,mt=Gs,nC=Wo,iC=zo,jt=Pe,At=ii;class Yt extends ws.WalletSDKRelayAbstract{constructor(e){var r;super(),this.accountsCallback=null,this.chainCallback=null,this.dappDefaultChainSubject=new Xr.BehaviorSubject(1),this.dappDefaultChain=1,this.appName="",this.appLogoUrl=null,this.subscriptions=new Xr.Subscription,this.linkAPIUrl=e.linkAPIUrl,this.storage=e.storage,this.options=e;const{session:n,ui:i,connection:s}=this.subscribe();if(this._session=n,this.connection=s,this.relayEventManager=e.relayEventManager,e.diagnosticLogger&&e.eventListener)throw new Error("Can't have both eventListener and diagnosticLogger options, use only diagnosticLogger");e.eventListener?this.diagnostic={log:e.eventListener.onEvent}:this.diagnostic=e.diagnosticLogger,this._reloadOnDisconnect=(r=e.reloadOnDisconnect)!==null&&r!==void 0?r:!0,this.ui=i}subscribe(){this.subscriptions.add(this.dappDefaultChainSubject.subscribe(i=>{this.dappDefaultChain!==i&&(this.dappDefaultChain=i)}));const e=Ir.Session.load(this.storage)||new Ir.Session(this.storage).save(),r=new tC.WalletSDKConnection(e.id,e.key,this.linkAPIUrl,this.diagnostic);this.subscriptions.add(r.sessionConfig$.subscribe({next:i=>{this.onSessionConfigChanged(i)},error:()=>{var i;(i=this.diagnostic)===null||i===void 0||i.log(Et.EVENTS.GENERAL_ERROR,{message:"error while invoking session config callback"})}})),this.subscriptions.add(r.incomingEvent$.pipe((0,lt.filter)(i=>i.event==="Web3Response")).subscribe({next:this.handleIncomingEvent})),this.subscriptions.add(r.linked$.pipe((0,lt.skip)(1),(0,lt.tap)(i=>{var s;this.isLinked=i;const o=this.storage.getItem(ws.LOCAL_STORAGE_ADDRESSES_KEY);if(i&&(this.session.linked=i),this.isUnlinkedErrorState=!1,o){const a=o.split(" "),c=this.storage.getItem("IsStandaloneSigning")==="true";if(a[0]!==""&&!i&&this.session.linked&&!c){this.isUnlinkedErrorState=!0;const l=this.getSessionIdHash();(s=this.diagnostic)===null||s===void 0||s.log(Et.EVENTS.UNLINKED_ERROR_STATE,{sessionIdHash:l})}}})).subscribe()),this.subscriptions.add(r.sessionConfig$.pipe((0,lt.filter)(i=>!!i.metadata&&i.metadata.__destroyed==="1")).subscribe(()=>{var i;const s=r.isDestroyed;return(i=this.diagnostic)===null||i===void 0||i.log(Et.EVENTS.METADATA_DESTROYED,{alreadyDestroyed:s,sessionIdHash:this.getSessionIdHash()}),this.resetAndReload()})),this.subscriptions.add(r.sessionConfig$.pipe((0,lt.filter)(i=>i.metadata&&i.metadata.WalletUsername!==void 0)).pipe((0,lt.mergeMap)(i=>Cr.decrypt(i.metadata.WalletUsername,e.secret))).subscribe({next:i=>{this.storage.setItem(ws.WALLET_USER_NAME_KEY,i)},error:()=>{var i;(i=this.diagnostic)===null||i===void 0||i.log(Et.EVENTS.GENERAL_ERROR,{message:"Had error decrypting",value:"username"})}})),this.subscriptions.add(r.sessionConfig$.pipe((0,lt.filter)(i=>i.metadata&&i.metadata.AppVersion!==void 0)).pipe((0,lt.mergeMap)(i=>Cr.decrypt(i.metadata.AppVersion,e.secret))).subscribe({next:i=>{this.storage.setItem(ws.APP_VERSION_KEY,i)},error:()=>{var i;(i=this.diagnostic)===null||i===void 0||i.log(Et.EVENTS.GENERAL_ERROR,{message:"Had error decrypting",value:"appversion"})}})),this.subscriptions.add(r.sessionConfig$.pipe((0,lt.filter)(i=>i.metadata&&i.metadata.ChainId!==void 0&&i.metadata.JsonRpcUrl!==void 0)).pipe((0,lt.mergeMap)(i=>(0,Xr.zip)(Cr.decrypt(i.metadata.ChainId,e.secret),Cr.decrypt(i.metadata.JsonRpcUrl,e.secret)))).pipe((0,lt.distinctUntilChanged)()).subscribe({next:([i,s])=>{this.chainCallback&&this.chainCallback(i,s)},error:()=>{var i;(i=this.diagnostic)===null||i===void 0||i.log(Et.EVENTS.GENERAL_ERROR,{message:"Had error decrypting",value:"chainId|jsonRpcUrl"})}})),this.subscriptions.add(r.sessionConfig$.pipe((0,lt.filter)(i=>i.metadata&&i.metadata.EthereumAddress!==void 0)).pipe((0,lt.mergeMap)(i=>Cr.decrypt(i.metadata.EthereumAddress,e.secret))).subscribe({next:i=>{this.accountsCallback&&this.accountsCallback([i]),Yt.accountRequestCallbackIds.size>0&&(Array.from(Yt.accountRequestCallbackIds.values()).forEach(s=>{const o=(0,At.Web3ResponseMessage)({id:s,response:(0,jt.RequestEthereumAccountsResponse)([i])});this.invokeCallback(Object.assign(Object.assign({},o),{id:s}))}),Yt.accountRequestCallbackIds.clear())},error:()=>{var i;(i=this.diagnostic)===null||i===void 0||i.log(Et.EVENTS.GENERAL_ERROR,{message:"Had error decrypting",value:"selectedAddress"})}})),this.subscriptions.add(r.sessionConfig$.pipe((0,lt.filter)(i=>i.metadata&&i.metadata.AppSrc!==void 0)).pipe((0,lt.mergeMap)(i=>Cr.decrypt(i.metadata.AppSrc,e.secret))).subscribe({next:i=>{this.ui.setAppSrc(i)},error:()=>{var i;(i=this.diagnostic)===null||i===void 0||i.log(Et.EVENTS.GENERAL_ERROR,{message:"Had error decrypting",value:"appSrc"})}}));const n=this.options.uiConstructor({linkAPIUrl:this.options.linkAPIUrl,version:this.options.version,darkMode:this.options.darkMode,session:e,connected$:r.connected$,chainId$:this.dappDefaultChainSubject});return r.connect(),{session:e,ui:n,connection:r}}attachUI(){this.ui.attach()}resetAndReload(){this.connection.setSessionMetadata("__destroyed","1").pipe((0,lt.timeout)(1e3),(0,lt.catchError)(e=>(0,Xr.of)(null))).subscribe(e=>{var r,n,i;const s=this.ui.isStandalone();try{this.subscriptions.unsubscribe()}catch{(r=this.diagnostic)===null||r===void 0||r.log(Et.EVENTS.GENERAL_ERROR,{message:"Had error unsubscribing"})}(n=this.diagnostic)===null||n===void 0||n.log(Et.EVENTS.SESSION_STATE_CHANGE,{method:"relay::resetAndReload",sessionMetadataChange:"__destroyed, 1",sessionIdHash:this.getSessionIdHash()}),this.connection.destroy();const o=Ir.Session.load(this.storage);if((o==null?void 0:o.id)===this._session.id?this.storage.clear():o&&((i=this.diagnostic)===null||i===void 0||i.log(Et.EVENTS.SKIPPED_CLEARING_SESSION,{sessionIdHash:this.getSessionIdHash(),storedSessionIdHash:Ir.Session.hash(o.id)})),this._reloadOnDisconnect){this.ui.reloadUI();return}this.accountsCallback&&this.accountsCallback([],!0),this.subscriptions=new Xr.Subscription;const{session:a,ui:c,connection:l}=this.subscribe();this._session=a,this.connection=l,this.ui=c,s&&this.ui.setStandalone&&this.ui.setStandalone(!0),this.attachUI()},e=>{var r;(r=this.diagnostic)===null||r===void 0||r.log(Et.EVENTS.FAILURE,{method:"relay::resetAndReload",message:`failed to reset and reload with ${e}`,sessionIdHash:this.getSessionIdHash()})})}setAppInfo(e,r){this.appName=e,this.appLogoUrl=r}getStorageItem(e){return this.storage.getItem(e)}get session(){return this._session}setStorageItem(e,r){this.storage.setItem(e,r)}signEthereumMessage(e,r,n,i){return this.sendRequest({method:mt.Web3Method.signEthereumMessage,params:{message:(0,et.hexStringFromBuffer)(e,!0),address:r,addPrefix:n,typedDataJson:i||null}})}ethereumAddressFromSignedMessage(e,r,n){return this.sendRequest({method:mt.Web3Method.ethereumAddressFromSignedMessage,params:{message:(0,et.hexStringFromBuffer)(e,!0),signature:(0,et.hexStringFromBuffer)(r,!0),addPrefix:n}})}signEthereumTransaction(e){return this.sendRequest({method:mt.Web3Method.signEthereumTransaction,params:{fromAddress:e.fromAddress,toAddress:e.toAddress,weiValue:(0,et.bigIntStringFromBN)(e.weiValue),data:(0,et.hexStringFromBuffer)(e.data,!0),nonce:e.nonce,gasPriceInWei:e.gasPriceInWei?(0,et.bigIntStringFromBN)(e.gasPriceInWei):null,maxFeePerGas:e.gasPriceInWei?(0,et.bigIntStringFromBN)(e.gasPriceInWei):null,maxPriorityFeePerGas:e.gasPriceInWei?(0,et.bigIntStringFromBN)(e.gasPriceInWei):null,gasLimit:e.gasLimit?(0,et.bigIntStringFromBN)(e.gasLimit):null,chainId:e.chainId,shouldSubmit:!1}})}signAndSubmitEthereumTransaction(e){return this.sendRequest({method:mt.Web3Method.signEthereumTransaction,params:{fromAddress:e.fromAddress,toAddress:e.toAddress,weiValue:(0,et.bigIntStringFromBN)(e.weiValue),data:(0,et.hexStringFromBuffer)(e.data,!0),nonce:e.nonce,gasPriceInWei:e.gasPriceInWei?(0,et.bigIntStringFromBN)(e.gasPriceInWei):null,maxFeePerGas:e.maxFeePerGas?(0,et.bigIntStringFromBN)(e.maxFeePerGas):null,maxPriorityFeePerGas:e.maxPriorityFeePerGas?(0,et.bigIntStringFromBN)(e.maxPriorityFeePerGas):null,gasLimit:e.gasLimit?(0,et.bigIntStringFromBN)(e.gasLimit):null,chainId:e.chainId,shouldSubmit:!0}})}submitEthereumTransaction(e,r){return this.sendRequest({method:mt.Web3Method.submitEthereumTransaction,params:{signedTransaction:(0,et.hexStringFromBuffer)(e,!0),chainId:r}})}scanQRCode(e){return this.sendRequest({method:mt.Web3Method.scanQRCode,params:{regExp:e}})}getQRCodeUrl(){return(0,et.createQrUrl)(this._session.id,this._session.secret,this.linkAPIUrl,!1,this.options.version,this.dappDefaultChain)}genericRequest(e,r){return this.sendRequest({method:mt.Web3Method.generic,params:{action:r,data:e}})}sendGenericMessage(e){return this.sendRequest(e)}sendRequest(e){let r=null;const n=(0,et.randomBytesHex)(8),i=o=>{this.publishWeb3RequestCanceledEvent(n),this.handleErrorResponse(n,e.method,o),r==null||r()};return{promise:new Promise((o,a)=>{this.ui.isStandalone()||(r=this.ui.showConnecting({isUnlinkedErrorState:this.isUnlinkedErrorState,onCancel:i,onResetConnection:this.resetAndReload})),this.relayEventManager.callbacks.set(n,c=>{if(r==null||r(),c.errorMessage)return a(new Error(c.errorMessage));o(c)}),this.ui.isStandalone()?this.sendRequestStandalone(n,e):this.publishWeb3RequestEvent(n,e)}),cancel:i}}setConnectDisabled(e){this.ui.setConnectDisabled(e)}setAccountsCallback(e){this.accountsCallback=e}setChainCallback(e){this.chainCallback=e}setDappDefaultChainCallback(e){this.dappDefaultChainSubject.next(e)}publishWeb3RequestEvent(e,r){var n;const i=(0,iC.Web3RequestMessage)({id:e,request:r}),s=Ir.Session.load(this.storage);(n=this.diagnostic)===null||n===void 0||n.log(Et.EVENTS.WEB3_REQUEST,{eventId:i.id,method:`relay::${i.request.method}`,sessionIdHash:this.getSessionIdHash(),storedSessionIdHash:s?Ir.Session.hash(s.id):"",isSessionMismatched:((s==null?void 0:s.id)!==this._session.id).toString()}),this.subscriptions.add(this.publishEvent("Web3Request",i,!0).subscribe({next:o=>{var a;(a=this.diagnostic)===null||a===void 0||a.log(Et.EVENTS.WEB3_REQUEST_PUBLISHED,{eventId:i.id,method:`relay::${i.request.method}`,sessionIdHash:this.getSessionIdHash(),storedSessionIdHash:s?Ir.Session.hash(s.id):"",isSessionMismatched:((s==null?void 0:s.id)!==this._session.id).toString()})},error:o=>{this.handleWeb3ResponseMessage((0,At.Web3ResponseMessage)({id:i.id,response:{method:i.request.method,errorMessage:o.message}}))}}))}publishWeb3RequestCanceledEvent(e){const r=(0,nC.Web3RequestCanceledMessage)(e);this.subscriptions.add(this.publishEvent("Web3RequestCanceled",r,!1).subscribe())}publishEvent(e,r,n){const i=this.session.secret;return new Xr.Observable(s=>{Cr.encrypt(JSON.stringify(Object.assign(Object.assign({},r),{origin:location.origin})),i).then(o=>{s.next(o),s.complete()})}).pipe((0,lt.mergeMap)(s=>this.connection.publishEvent(e,s,n)))}handleIncomingEvent(e){try{this.subscriptions.add((0,Xr.from)(Cr.decrypt(e.data,this.session.secret)).pipe((0,lt.map)(r=>JSON.parse(r))).subscribe({next:r=>{const n=(0,At.isWeb3ResponseMessage)(r)?r:null;n&&this.handleWeb3ResponseMessage(n)},error:()=>{var r;(r=this.diagnostic)===null||r===void 0||r.log(Et.EVENTS.GENERAL_ERROR,{message:"Had error decrypting",value:"incomingEvent"})}}))}catch{return}}handleWeb3ResponseMessage(e){var r;const{response:n}=e;if((r=this.diagnostic)===null||r===void 0||r.log(Et.EVENTS.WEB3_RESPONSE,{eventId:e.id,method:`relay::${n.method}`,sessionIdHash:this.getSessionIdHash()}),(0,jt.isRequestEthereumAccountsResponse)(n)){Yt.accountRequestCallbackIds.forEach(i=>this.invokeCallback(Object.assign(Object.assign({},e),{id:i}))),Yt.accountRequestCallbackIds.clear();return}this.invokeCallback(e)}handleErrorResponse(e,r,n,i){var s;const o=(s=n==null?void 0:n.message)!==null&&s!==void 0?s:(0,Bn.standardErrorMessage)(i);this.handleWeb3ResponseMessage((0,At.Web3ResponseMessage)({id:e,response:{method:r,errorMessage:o,errorCode:i}}))}invokeCallback(e){const r=this.relayEventManager.callbacks.get(e.id);r&&(r(e.response),this.relayEventManager.callbacks.delete(e.id))}requestEthereumAccounts(){const e={method:mt.Web3Method.requestEthereumAccounts,params:{appName:this.appName,appLogoUrl:this.appLogoUrl||null}},r=(0,et.randomBytesHex)(8),n=s=>{this.publishWeb3RequestCanceledEvent(r),this.handleErrorResponse(r,e.method,s)};return{promise:new Promise((s,o)=>{var a;this.relayEventManager.callbacks.set(r,l=>{if(this.ui.hideRequestEthereumAccounts(),l.errorMessage)return o(new Error(l.errorMessage));s(l)});const c=((a=window==null?void 0:window.navigator)===null||a===void 0?void 0:a.userAgent)||null;if(c&&/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(c)){let l;try{(0,et.isInIFrame)()&&window.top?l=window.top.location:l=window.location}catch{l=window.location}l.href=`https://www.coinbase.com/connect-dapp?uri=${encodeURIComponent(l.href)}`;return}if(this.ui.inlineAccountsResponse()){const l=p=>{this.handleWeb3ResponseMessage((0,At.Web3ResponseMessage)({id:r,response:(0,jt.RequestEthereumAccountsResponse)(p)}))};this.ui.requestEthereumAccounts({onCancel:n,onAccounts:l})}else{const l=Bn.standardErrors.provider.userRejectedRequest("User denied account authorization");this.ui.requestEthereumAccounts({onCancel:()=>n(l)})}Yt.accountRequestCallbackIds.add(r),!this.ui.inlineAccountsResponse()&&!this.ui.isStandalone()&&this.publishWeb3RequestEvent(r,e)}),cancel:n}}selectProvider(e){const r={method:mt.Web3Method.selectProvider,params:{providerOptions:e}},n=(0,et.randomBytesHex)(8),i=o=>{this.publishWeb3RequestCanceledEvent(n),this.handleErrorResponse(n,r.method,o)},s=new Promise((o,a)=>{this.relayEventManager.callbacks.set(n,p=>{if(p.errorMessage)return a(new Error(p.errorMessage));o(p)});const c=p=>{this.handleWeb3ResponseMessage((0,At.Web3ResponseMessage)({id:n,response:(0,jt.SelectProviderResponse)(rC.ProviderType.Unselected)}))},l=p=>{this.handleWeb3ResponseMessage((0,At.Web3ResponseMessage)({id:n,response:(0,jt.SelectProviderResponse)(p)}))};this.ui.selectProvider&&this.ui.selectProvider({onApprove:l,onCancel:c,providerOptions:e})});return{cancel:i,promise:s}}watchAsset(e,r,n,i,s,o){const a={method:mt.Web3Method.watchAsset,params:{type:e,options:{address:r,symbol:n,decimals:i,image:s},chainId:o}};let c=null;const l=(0,et.randomBytesHex)(8),p=y=>{this.publishWeb3RequestCanceledEvent(l),this.handleErrorResponse(l,a.method,y),c==null||c()};this.ui.inlineWatchAsset()||(c=this.ui.showConnecting({isUnlinkedErrorState:this.isUnlinkedErrorState,onCancel:p,onResetConnection:this.resetAndReload}));const g=new Promise((y,I)=>{this.relayEventManager.callbacks.set(l,U=>{if(c==null||c(),U.errorMessage)return I(new Error(U.errorMessage));y(U)});const T=U=>{this.handleWeb3ResponseMessage((0,At.Web3ResponseMessage)({id:l,response:(0,jt.WatchAssetReponse)(!1)}))},D=()=>{this.handleWeb3ResponseMessage((0,At.Web3ResponseMessage)({id:l,response:(0,jt.WatchAssetReponse)(!0)}))};this.ui.inlineWatchAsset()&&this.ui.watchAsset({onApprove:D,onCancel:T,type:e,address:r,symbol:n,decimals:i,image:s,chainId:o}),!this.ui.inlineWatchAsset()&&!this.ui.isStandalone()&&this.publishWeb3RequestEvent(l,a)});return{cancel:p,promise:g}}addEthereumChain(e,r,n,i,s,o){const a={method:mt.Web3Method.addEthereumChain,params:{chainId:e,rpcUrls:r,blockExplorerUrls:i,chainName:s,iconUrls:n,nativeCurrency:o}};let c=null;const l=(0,et.randomBytesHex)(8),p=y=>{this.publishWeb3RequestCanceledEvent(l),this.handleErrorResponse(l,a.method,y),c==null||c()};return this.ui.inlineAddEthereumChain(e)||(c=this.ui.showConnecting({isUnlinkedErrorState:this.isUnlinkedErrorState,onCancel:p,onResetConnection:this.resetAndReload})),{promise:new Promise((y,I)=>{this.relayEventManager.callbacks.set(l,U=>{if(c==null||c(),U.errorMessage)return I(new Error(U.errorMessage));y(U)});const T=U=>{this.handleWeb3ResponseMessage((0,At.Web3ResponseMessage)({id:l,response:(0,jt.AddEthereumChainResponse)({isApproved:!1,rpcUrl:""})}))},D=U=>{this.handleWeb3ResponseMessage((0,At.Web3ResponseMessage)({id:l,response:(0,jt.AddEthereumChainResponse)({isApproved:!0,rpcUrl:U})}))};this.ui.inlineAddEthereumChain(e)&&this.ui.addEthereumChain({onCancel:T,onApprove:D,chainId:a.params.chainId,rpcUrls:a.params.rpcUrls,blockExplorerUrls:a.params.blockExplorerUrls,chainName:a.params.chainName,iconUrls:a.params.iconUrls,nativeCurrency:a.params.nativeCurrency}),!this.ui.inlineAddEthereumChain(e)&&!this.ui.isStandalone()&&this.publishWeb3RequestEvent(l,a)}),cancel:p}}switchEthereumChain(e,r){const n={method:mt.Web3Method.switchEthereumChain,params:Object.assign({chainId:e},{address:r})},i=(0,et.randomBytesHex)(8),s=a=>{this.publishWeb3RequestCanceledEvent(i),this.handleErrorResponse(i,n.method,a)};return{promise:new Promise((a,c)=>{this.relayEventManager.callbacks.set(i,g=>{if((0,jt.isErrorResponse)(g)&&g.errorCode)return c(Bn.standardErrors.provider.custom({code:g.errorCode,message:"Unrecognized chain ID. Try adding the chain using addEthereumChain first."}));if(g.errorMessage)return c(new Error(g.errorMessage));a(g)});const l=g=>{var y;if(g){const I=(y=(0,Bn.getErrorCode)(g))!==null&&y!==void 0?y:Bn.standardErrorCodes.provider.unsupportedChain;this.handleErrorResponse(i,mt.Web3Method.switchEthereumChain,g instanceof Error?g:Bn.standardErrors.provider.unsupportedChain(e),I)}else this.handleWeb3ResponseMessage((0,At.Web3ResponseMessage)({id:i,response:(0,jt.SwitchEthereumChainResponse)({isApproved:!1,rpcUrl:""})}))},p=g=>{this.handleWeb3ResponseMessage((0,At.Web3ResponseMessage)({id:i,response:(0,jt.SwitchEthereumChainResponse)({isApproved:!0,rpcUrl:g})}))};this.ui.switchEthereumChain({onCancel:l,onApprove:p,chainId:n.params.chainId,address:n.params.address}),!this.ui.inlineSwitchEthereumChain()&&!this.ui.isStandalone()&&this.publishWeb3RequestEvent(i,n)}),cancel:s}}inlineAddEthereumChain(e){return this.ui.inlineAddEthereumChain(e)}getSessionIdHash(){return Ir.Session.hash(this._session.id)}sendRequestStandalone(e,r){const n=s=>{this.handleErrorResponse(e,r.method,s)},i=s=>{this.handleWeb3ResponseMessage((0,At.Web3ResponseMessage)({id:e,response:s}))};switch(r.method){case mt.Web3Method.signEthereumMessage:this.ui.signEthereumMessage({request:r,onSuccess:i,onCancel:n});break;case mt.Web3Method.signEthereumTransaction:this.ui.signEthereumTransaction({request:r,onSuccess:i,onCancel:n});break;case mt.Web3Method.submitEthereumTransaction:this.ui.submitEthereumTransaction({request:r,onSuccess:i,onCancel:n});break;case mt.Web3Method.ethereumAddressFromSignedMessage:this.ui.ethereumAddressFromSignedMessage({request:r,onSuccess:i});break;default:n();break}}onSessionConfigChanged(e){}}Yt.accountRequestCallbackIds=new Set;G0([J0.default],Yt.prototype,"resetAndReload",null);G0([J0.default],Yt.prototype,"handleIncomingEvent",null);Do.WalletSDKRelay=Yt;var qo={};Object.defineProperty(qo,"__esModule",{value:!0});qo.WalletSDKRelayEventManager=void 0;const sC=re;class oC{constructor(){this._nextRequestId=0,this.callbacks=new Map}makeRequestId(){this._nextRequestId=(this._nextRequestId+1)%2147483647;const e=this._nextRequestId,r=(0,sC.prepend0x)(e.toString(16));return this.callbacks.get(r)&&this.callbacks.delete(r),e}}qo.WalletSDKRelayEventManager=oC;Object.defineProperty(Ti,"__esModule",{value:!0});Ti.CoinbaseWalletSDK=void 0;const aC=Hs,uC=Ws,cC=Vs,lC=zn,hC=wo,fC=Do,dC=qo,pC=re,Z0=ai;class Go{constructor(e){var r,n,i;this._appName="",this._appLogoUrl=null,this._relay=null,this._relayEventManager=null;const s=e.linkAPIUrl||uC.LINK_API_URL;let o;if(e.uiConstructor?o=e.uiConstructor:o=l=>new hC.WalletSDKUI(l),typeof e.overrideIsMetaMask>"u"?this._overrideIsMetaMask=!1:this._overrideIsMetaMask=e.overrideIsMetaMask,this._overrideIsCoinbaseWallet=(r=e.overrideIsCoinbaseWallet)!==null&&r!==void 0?r:!0,this._overrideIsCoinbaseBrowser=(n=e.overrideIsCoinbaseBrowser)!==null&&n!==void 0?n:!1,e.diagnosticLogger&&e.eventListener)throw new Error("Can't have both eventListener and diagnosticLogger options, use only diagnosticLogger");e.eventListener?this._diagnosticLogger={log:e.eventListener.onEvent}:this._diagnosticLogger=e.diagnosticLogger,this._reloadOnDisconnect=(i=e.reloadOnDisconnect)!==null&&i!==void 0?i:!0;const a=new URL(s),c=`${a.protocol}//${a.host}`;this._storage=new cC.ScopedLocalStorage(`-walletlink:${c}`),this._storage.setItem("version",Go.VERSION),!(this.walletExtension||this.coinbaseBrowser)&&(this._relayEventManager=new dC.WalletSDKRelayEventManager,this._relay=new fC.WalletSDKRelay({linkAPIUrl:s,version:Z0.LIB_VERSION,darkMode:!!e.darkMode,uiConstructor:o,storage:this._storage,relayEventManager:this._relayEventManager,diagnosticLogger:this._diagnosticLogger,reloadOnDisconnect:this._reloadOnDisconnect}),this.setAppInfo(e.appName,e.appLogoUrl),!e.headlessMode&&this._relay.attachUI())}makeWeb3Provider(e="",r=1){const n=this.walletExtension;if(n)return this.isCipherProvider(n)||n.setProviderInfo(e,r),this._reloadOnDisconnect===!1&&typeof n.disableReloadOnDisconnect=="function"&&n.disableReloadOnDisconnect(),n;const i=this.coinbaseBrowser;if(i)return i;const s=this._relay;if(!s||!this._relayEventManager||!this._storage)throw new Error("Relay not initialized, should never happen");return e||s.setConnectDisabled(!0),new lC.CoinbaseWalletProvider({relayProvider:()=>Promise.resolve(s),relayEventManager:this._relayEventManager,storage:this._storage,jsonRpcUrl:e,chainId:r,qrUrl:this.getQrUrl(),diagnosticLogger:this._diagnosticLogger,overrideIsMetaMask:this._overrideIsMetaMask,overrideIsCoinbaseWallet:this._overrideIsCoinbaseWallet,overrideIsCoinbaseBrowser:this._overrideIsCoinbaseBrowser})}setAppInfo(e,r){var n;this._appName=e||"DApp",this._appLogoUrl=r||(0,pC.getFavicon)();const i=this.walletExtension;i?this.isCipherProvider(i)||i.setAppInfo(this._appName,this._appLogoUrl):(n=this._relay)===null||n===void 0||n.setAppInfo(this._appName,this._appLogoUrl)}disconnect(){var e;const r=this.walletExtension;r?r.close():(e=this._relay)===null||e===void 0||e.resetAndReload()}getQrUrl(){var e,r;return(r=(e=this._relay)===null||e===void 0?void 0:e.getQRCodeUrl())!==null&&r!==void 0?r:null}getCoinbaseWalletLogo(e,r=240){return(0,aC.walletLogo)(e,r)}get walletExtension(){var e;return(e=window.coinbaseWalletExtension)!==null&&e!==void 0?e:window.walletLinkExtension}get coinbaseBrowser(){var e,r;try{const n=(e=window.ethereum)!==null&&e!==void 0?e:(r=window.top)===null||r===void 0?void 0:r.ethereum;return n&&"isCoinbaseBrowser"in n&&n.isCoinbaseBrowser?n:void 0}catch{return}}isCipherProvider(e){return typeof e.isCipher=="boolean"&&e.isCipher}}Ti.CoinbaseWalletSDK=Go;Go.VERSION=Z0.LIB_VERSION;(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.CoinbaseWalletProvider=t.CoinbaseWalletSDK=void 0;const e=Ti,r=zn;var n=Ti;Object.defineProperty(t,"CoinbaseWalletSDK",{enumerable:!0,get:function(){return n.CoinbaseWalletSDK}});var i=zn;Object.defineProperty(t,"CoinbaseWalletProvider",{enumerable:!0,get:function(){return i.CoinbaseWalletProvider}}),t.default=e.CoinbaseWalletSDK,typeof window<"u"&&(window.CoinbaseWalletSDK=e.CoinbaseWalletSDK,window.CoinbaseWalletProvider=r.CoinbaseWalletProvider,window.WalletLink=e.CoinbaseWalletSDK,window.WalletLinkProvider=r.CoinbaseWalletProvider)})(cu);const gC=Y0(cu),MC=K0({__proto__:null,default:gC},[cu]);export{MC as i};
28
- //# sourceMappingURL=index-6db25257.js.map
28
+ //# sourceMappingURL=index-bc995c63.js.map