-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy path5004.7cde4686be7c9fac7f52.js
1 lines (1 loc) · 125 KB
/
5004.7cde4686be7c9fac7f52.js
1
(self.webpackChunktimeless_frontend=self.webpackChunktimeless_frontend||[]).push([[5004],{24070:(k,g,d)=>{"use strict";Object.defineProperty(g,"__esModule",{value:!0}),g.ComposedStore=void 0;const h=d(36812);g.ComposedStore=class extends h.ObservableStore{constructor(p){super({}),this._children=p||{},Object.keys(this._children).forEach(m=>{this._addChild(m,this._children[m])})}_addChild(p,m){const f=i=>{const b=this.getState();b[p]=i,this.putState(b)};m.subscribe(f),f(m.getState())}}},32053:(k,g,d)=>{"use strict";Object.defineProperty(g,"__esModule",{value:!0}),g.MergedStore=void 0;const h=d(36812);g.MergedStore=class extends h.ObservableStore{constructor(p=[]){super({}),this._children=p,p.forEach(m=>this._addChild(m)),this._updateWholeState()}_addChild(p){p.subscribe(()=>this._updateWholeState())}_updateWholeState(){const p=this._children.map(f=>f.getState()),m=Object.assign({},...p);this.putState(m)}}},36812:function(k,g,d){"use strict";var h=this&&this.__importDefault||function(p){return p&&p.__esModule?p:{default:p}};Object.defineProperty(g,"__esModule",{value:!0}),g.ObservableStore=void 0;const A=h(d(14521));g.ObservableStore=class extends A.default{constructor(m){super(),this._state=m||{}}getState(){return this._getState()}putState(m){this._putState(m),this.emit("update",m)}updateState(m){if(m&&"object"==typeof m){const f=this.getState();this.putState(Object.assign(Object.assign({},f),m))}else this.putState(m)}subscribe(m){this.on("update",m)}unsubscribe(m){this.removeListener("update",m)}_getState(){return this._state}_putState(m){this._state=m}}},91905:(k,g,d)=>{"use strict";Object.defineProperty(g,"__esModule",{value:!0}),g.storeAsStream=void 0;const h=d(36917);class A extends h.Duplex{constructor(m){super({objectMode:!0}),this.resume(),this.handler=f=>this.push(f),this.obsStore=m,this.obsStore.subscribe(this.handler)}pipe(m,f){const i=super.pipe(m,f);return m.write(this.obsStore.getState()),i}_write(m,f,i){this.obsStore.putState(m),i()}_read(m){}_destroy(m,f){this.obsStore.unsubscribe(this.handler),super._destroy(m,f)}}g.storeAsStream=function(p){return new A(p)}},16177:function(k,g,d){"use strict";var h=this&&this.__createBinding||(Object.create?function(w,p,m,f){void 0===f&&(f=m),Object.defineProperty(w,f,{enumerable:!0,get:function(){return p[m]}})}:function(w,p,m,f){void 0===f&&(f=m),w[f]=p[m]}),A=this&&this.__exportStar||function(w,p){for(var m in w)"default"!==m&&!Object.prototype.hasOwnProperty.call(p,m)&&h(p,w,m)};Object.defineProperty(g,"__esModule",{value:!0}),A(d(91905),g),A(d(24070),g),A(d(32053),g),A(d(36812),g),A(d(58503),g)},58503:(k,g,d)=>{"use strict";Object.defineProperty(g,"__esModule",{value:!0}),g.storeTransformStream=void 0;const h=d(73529);g.storeTransformStream=function(w){return h.obj((p,m,f)=>{try{return void f(null,w(p))}catch(i){return void f(i)}})}},9064:(k,g,d)=>{"use strict";Object.defineProperty(g,"__esModule",{value:!0}),g.EthereumProviderError=g.EthereumRpcError=void 0;const h=d(47300);class A extends Error{constructor(i,b,_){if(!Number.isInteger(i))throw new Error('"code" must be an integer.');if(!b||"string"!=typeof b)throw new Error('"message" must be a nonempty string.');super(b),this.code=i,void 0!==_&&(this.data=_)}serialize(){const i={code:this.code,message:this.message};return void 0!==this.data&&(i.data=this.data),this.stack&&(i.stack=this.stack),i}toString(){return h.default(this.serialize(),m,2)}}function m(f,i){if("[Circular]"!==i)return i}g.EthereumRpcError=A,g.EthereumProviderError=class extends A{constructor(i,b,_){if(f=i,!(Number.isInteger(f)&&f>=1e3&&f<=4999))throw new Error('"code" must be an integer such that: 1000 <= code <= 4999');var f;super(i,b,_)}}},6515:(k,g)=>{"use strict";Object.defineProperty(g,"__esModule",{value:!0}),g.errorValues=g.errorCodes=void 0,g.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}},g.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."}}},64232:(k,g,d)=>{"use strict";Object.defineProperty(g,"__esModule",{value:!0}),g.ethErrors=void 0;const h=d(9064),A=d(80282),w=d(6515);function p(i,b){const[_,j]=f(b);return new h.EthereumRpcError(i,_||A.getMessageFromCode(i),j)}function m(i,b){const[_,j]=f(b);return new h.EthereumProviderError(i,_||A.getMessageFromCode(i),j)}function f(i){if(i){if("string"==typeof i)return[i];if("object"==typeof i&&!Array.isArray(i)){const{message:b,data:_}=i;if(b&&"string"!=typeof b)throw new Error("Must specify string message.");return[b||void 0,_]}}return[]}g.ethErrors={rpc:{parse:i=>p(w.errorCodes.rpc.parse,i),invalidRequest:i=>p(w.errorCodes.rpc.invalidRequest,i),invalidParams:i=>p(w.errorCodes.rpc.invalidParams,i),methodNotFound:i=>p(w.errorCodes.rpc.methodNotFound,i),internal:i=>p(w.errorCodes.rpc.internal,i),server:i=>{if(!i||"object"!=typeof i||Array.isArray(i))throw new Error("Ethereum RPC Server errors must provide single object argument.");const{code:b}=i;if(!Number.isInteger(b)||b>-32005||b<-32099)throw new Error('"code" must be an integer such that: -32099 <= code <= -32005');return p(b,i)},invalidInput:i=>p(w.errorCodes.rpc.invalidInput,i),resourceNotFound:i=>p(w.errorCodes.rpc.resourceNotFound,i),resourceUnavailable:i=>p(w.errorCodes.rpc.resourceUnavailable,i),transactionRejected:i=>p(w.errorCodes.rpc.transactionRejected,i),methodNotSupported:i=>p(w.errorCodes.rpc.methodNotSupported,i),limitExceeded:i=>p(w.errorCodes.rpc.limitExceeded,i)},provider:{userRejectedRequest:i=>m(w.errorCodes.provider.userRejectedRequest,i),unauthorized:i=>m(w.errorCodes.provider.unauthorized,i),unsupportedMethod:i=>m(w.errorCodes.provider.unsupportedMethod,i),disconnected:i=>m(w.errorCodes.provider.disconnected,i),chainDisconnected:i=>m(w.errorCodes.provider.chainDisconnected,i),custom:i=>{if(!i||"object"!=typeof i||Array.isArray(i))throw new Error("Ethereum Provider custom errors must provide single object argument.");const{code:b,message:_,data:j}=i;if(!_||"string"!=typeof _)throw new Error('"message" must be a nonempty string');return new h.EthereumProviderError(b,_,j)}}}},45518:(k,g,d)=>{"use strict";g.Xy=void 0;d(9064);const w=d(80282);Object.defineProperty(g,"Xy",{enumerable:!0,get:function(){return w.serializeError}});d(64232),d(6515)},80282:(k,g,d)=>{"use strict";Object.defineProperty(g,"__esModule",{value:!0}),g.serializeError=g.isValidCode=g.getMessageFromCode=g.JSON_RPC_SERVER_ERROR_MESSAGE=void 0;const h=d(6515),A=d(9064),w=h.errorCodes.rpc.internal,m={code:w,message:f(w)};function f(O,R="Unspecified error message. This is a bug, please report it."){if(Number.isInteger(O)){const $=O.toString();if(z(h.errorValues,$))return h.errorValues[$].message;if(_(O))return g.JSON_RPC_SERVER_ERROR_MESSAGE}return R}function i(O){if(!Number.isInteger(O))return!1;const R=O.toString();return!(!h.errorValues[R]&&!_(O))}function _(O){return O>=-32099&&O<=-32e3}function j(O){return O&&"object"==typeof O&&!Array.isArray(O)?Object.assign({},O):O}function z(O,R){return Object.prototype.hasOwnProperty.call(O,R)}g.JSON_RPC_SERVER_ERROR_MESSAGE="Unspecified server error.",g.getMessageFromCode=f,g.isValidCode=i,g.serializeError=function(O,{fallbackError:R=m,shouldIncludeStack:$=!1}={}){var J,U;if(!R||!Number.isInteger(R.code)||"string"!=typeof R.message)throw new Error("Must provide fallback error with integer number code and string message.");if(O instanceof A.EthereumRpcError)return O.serialize();const L={};if(O&&"object"==typeof O&&!Array.isArray(O)&&z(O,"code")&&i(O.code)){const E=O;L.code=E.code,E.message&&"string"==typeof E.message?(L.message=E.message,z(E,"data")&&(L.data=E.data)):(L.message=f(L.code),L.data={originalError:j(O)})}else{L.code=R.code;const E=null===(J=O)||void 0===J?void 0:J.message;L.message=E&&"string"==typeof E?E:R.message,L.data={originalError:j(O)}}const S=null===(U=O)||void 0===U?void 0:U.stack;return $&&O&&S&&"string"==typeof S&&(L.stack=S),L}},25004:(k,g,d)=>{"use strict";d.r(g),d.d(g,{BUTTON_POSITION:()=>je,LOGIN_PROVIDER:()=>xe,PAYMENT_PROVIDER:()=>oe,SUPPORTED_PAYMENT_NETWORK:()=>ue,TORUS_BUILD_ENV:()=>Rt,TorusInpageProvider:()=>Ge,WALLET_OPENLOGIN_VERIFIER_MAP:()=>rt,WALLET_VERIFIERS:()=>Ie,default:()=>sn});var h=d(34553);function p(n){return(p="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(n)}function f(n){var t=function(n,t){if("object"!==p(n)||null===n)return n;var e=n[Symbol.toPrimitive];if(void 0!==e){var r=e.call(n,t);if("object"!==p(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(n)}(n,"string");return"symbol"===p(t)?t:String(t)}function i(n,t,e){return(t=f(t))in n?Object.defineProperty(n,t,{value:e,enumerable:!0,configurable:!0,writable:!0}):n[t]=e,n}var b=d(41413),_=d.n(b),j=d(58330),z=d.n(j);function O(n,t){var e=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(n,a).enumerable})),e.push.apply(e,r)}return e}function R(n){for(var t=1;t<arguments.length;t++){var e=null!=arguments[t]?arguments[t]:{};t%2?O(Object(e),!0).forEach(function(r){i(n,r,e[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(e)):O(Object(e)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(e,r))})}return n}const $=z().getLogger("http-helpers");$.setLevel(j.levels.INFO);let J="torus-default";function ve(n,t){return Ce.apply(this,arguments)}function Ce(){return(Ce=(0,h.Z)(function*(n,t){let e=null;try{e=new URL(n)}catch{}return fetch(n,t)})).apply(this,arguments)}function me(){const n={};return J&&(n["x-api-key"]=J),n}function Oe(n){$.info(`Response: ${n.status} ${n.statusText}`),$.info(`Url: ${n.url}`)}const u=function(){var n=(0,h.Z)(function*(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const a={mode:"cors",headers:{}};r.useAPIKey&&(a.headers=R(R({},a.headers),me()));const l=_()(a,e,{method:"GET"}),y=yield ve(t,l);if(y.ok)return y.json();throw Oe(y),y});return function(e){return n.apply(this,arguments)}}();function re(n,t){if(!(n instanceof t))throw new TypeError("Cannot call a class as a function")}function ce(n,t){for(var e=0;e<t.length;e++){var r=t[e];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(n,f(r.key),r)}}function s(n,t,e){return t&&ce(n.prototype,t),e&&ce(n,e),Object.defineProperty(n,"prototype",{writable:!1}),n}function o(n){if(void 0===n)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return n}function N(n,t){return(N=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,a){return r.__proto__=a,r})(n,t)}function B(n,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");n.prototype=Object.create(t&&t.prototype,{constructor:{value:n,writable:!0,configurable:!0}}),Object.defineProperty(n,"prototype",{writable:!1}),t&&N(n,t)}function q(n,t){if(t&&("object"===p(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return o(n)}function F(n){return(F=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)})(n)}var X=d(18300);function De(n,t,e,r,a,l,y){try{var C=n[l](y),P=C.value}catch(D){return void e(D)}C.done?t(P):Promise.resolve(P).then(r,a)}function Se(n){return function(){var t=this,e=arguments;return new Promise(function(r,a){var l=n.apply(t,e);function y(P){De(l,r,a,y,C,"next",P)}function C(P){De(l,r,a,y,C,"throw",P)}y(void 0)})}}var Je=d(50076),fe=d.n(Je),He=d(16589),ze=d.n(He);function Ne(){if("undefined"==typeof Reflect||!Reflect.construct||Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function _e(n,t,e){return(_e=Ne()?Reflect.construct.bind():function(a,l,y){var C=[null];C.push.apply(C,l);var D=new(Function.bind.apply(a,C));return y&&N(D,y.prototype),D}).apply(null,arguments)}function Re(n){var t="function"==typeof Map?new Map:void 0;return Re=function(r){if(null===r||!function(n){return-1!==Function.toString.call(n).indexOf("[native code]")}(r))return r;if("function"!=typeof r)throw new TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(r))return t.get(r);t.set(r,a)}function a(){return _e(r,arguments,F(this).constructor)}return a.prototype=Object.create(r.prototype,{constructor:{value:a,enumerable:!1,writable:!0,configurable:!0}}),N(a,r)},Re(n)}var Kt=d(37092),Vt=d.n(Kt),Gt=d(58577),$t=d.n(Gt);URL,Vt(),$t();var lt=d(93105),Zt=d(47300),qt=d.n(Zt);function dt(n,t){(null==t||t>n.length)&&(t=n.length);for(var e=0,r=new Array(t);e<t;e++)r[e]=n[e];return r}function et(n,t){return function(n){if(Array.isArray(n))return n}(n)||function(n,t){var e=null==n?null:"undefined"!=typeof Symbol&&n[Symbol.iterator]||n["@@iterator"];if(null!=e){var r,a,l,y,C=[],P=!0,D=!1;try{if(l=(e=e.call(n)).next,0===t){if(Object(e)!==e)return;P=!1}else for(;!(P=(r=l.call(e)).done)&&(C.push(r.value),C.length!==t);P=!0);}catch(T){D=!0,a=T}finally{try{if(!P&&null!=e.return&&(y=e.return(),Object(y)!==y))return}finally{if(D)throw a}}return C}}(n,t)||function(n,t){if(n){if("string"==typeof n)return dt(n,t);var e=Object.prototype.toString.call(n).slice(8,-1);if("Object"===e&&n.constructor&&(e=n.constructor.name),"Map"===e||"Set"===e)return Array.from(n);if("Arguments"===e||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e))return dt(n,t)}}(n,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var ct=d(45518),nr=d(75859),ft=d.n(nr),ir=d(99318),ar=d.n(ir),sr=d(30968),Xe=d.n(sr);function Ze(){}var gt=function(n){B(e,n);var t=function(n){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct||Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}();return function(){var a,r=F(n);if(t){var l=F(this).constructor;a=Reflect.construct(r,arguments,l)}else a=r.apply(this,arguments);return q(this,a)}}(e);function e(r){var a,l=r.name,y=r.target,C=r.targetWindow,P=void 0===C?window:C,D=r.targetOrigin,T=void 0===D?"*":D;if(re(this,e),i(o(a=t.call(this,{objectMode:!0})),"_init",void 0),i(o(a),"_haveSyn",void 0),i(o(a),"_name",void 0),i(o(a),"_target",void 0),i(o(a),"_targetWindow",void 0),i(o(a),"_targetOrigin",void 0),i(o(a),"_onMessage",void 0),i(o(a),"_synIntervalId",void 0),!l||!y)throw new Error("Invalid input.");return a._init=!1,a._haveSyn=!1,a._name=l,a._target=y,a._targetWindow=P,a._targetOrigin=T,a._onMessage=a.onMessage.bind(o(a)),a._synIntervalId=null,window.addEventListener("message",a._onMessage,!1),a._handShake(),a}return s(e,[{key:"_break",value:function(){this.cork(),this._write("BRK",null,Ze),this._haveSyn=!1,this._init=!1}},{key:"_handShake",value:function(){this._write("SYN",null,Ze),this.cork()}},{key:"_onData",value:function(a){if(this._init)if("BRK"===a)this._break();else try{this.push(a)}catch(l){this.emit("error",l)}else"SYN"===a?(this._haveSyn=!0,this._write("ACK",null,Ze)):"ACK"===a&&(this._init=!0,this._haveSyn||this._write("ACK",null,Ze),this.uncork())}},{key:"_postMessage",value:function(a){this._targetWindow.postMessage({target:this._target,data:a},this._targetOrigin)}},{key:"onMessage",value:function(a){var l=a.data;"*"!==this._targetOrigin&&a.origin!==this._targetOrigin||a.source!==this._targetWindow||"object"!==p(l)||l.target!==this._name||!l.data||this._onData(l.data)}},{key:"_read",value:function(){}},{key:"_write",value:function(a,l,y){this._postMessage(a),y()}},{key:"_destroy",value:function(){window.removeEventListener("message",this._onMessage,!1)}}]),e}(X.Duplex);function mt(n,t,e){try{Reflect.apply(n,t,e)}catch(r){setTimeout(function(){throw r})}}function cr(n){for(var t=n.length,e=new Array(t),r=0;r<t;r+=1)e[r]=n[r];return e}var qe=function(n){B(e,n);var t=function(n){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct||Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}();return function(){var a,r=F(n);if(t){var l=F(this).constructor;a=Reflect.construct(r,arguments,l)}else a=r.apply(this,arguments);return q(this,a)}}(e);function e(){return re(this,e),t.apply(this,arguments)}return s(e,[{key:"emit",value:function(a){var l="error"===a,y=this._events;if(void 0!==y)l=l&&void 0===y.error;else if(!l)return!1;for(var C=arguments.length,P=new Array(C>1?C-1:0),D=1;D<C;D++)P[D-1]=arguments[D];if(l){var T;if(P.length>0&&(T=P[0]),T instanceof Error)throw T;var H=new Error("Unhandled error.".concat(T?" (".concat(T.message,")"):""));throw H.context=T,H}var K=y[a];if(void 0===K)return!1;if("function"==typeof K)mt(K,this,P);else for(var Y=K.length,V=cr(K),ne=0;ne<Y;ne+=1)mt(V[ne],this,P);return!0}}]),e}(lt.EventEmitter);var Le=function(n){B(e,n);var t=function(n){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct||Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}();return function(){var a,r=F(n);if(t){var l=F(this).constructor;a=Reflect.construct(r,arguments,l)}else a=r.apply(this,arguments);return q(this,a)}}(e);function e(r){var a,l=r.code,y=r.message,C=r.data;if(re(this,e),!Number.isInteger(l))throw new Error("code must be an integer");if(!y||"string"!=typeof y)throw new Error("message must be string");return i(o(a=t.call(this,y)),"code",void 0),i(o(a),"data",void 0),a.code=l,void 0!==C&&(a.data=C),a}return s(e,[{key:"toString",value:function(){return qt()({code:this.code,message:this.message,data:this.data,stack:this.stack})}}]),e}(Re(Error));function yt(n,t){var e="undefined"!=typeof Symbol&&n[Symbol.iterator]||n["@@iterator"];if(!e){if(Array.isArray(n)||(e=function(n,t){if(n){if("string"==typeof n)return vt(n,t);var e=Object.prototype.toString.call(n).slice(8,-1);if("Object"===e&&n.constructor&&(e=n.constructor.name),"Map"===e||"Set"===e)return Array.from(n);if("Arguments"===e||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e))return vt(n,t)}}(n))||t&&n&&"number"==typeof n.length){e&&(n=e);var r=0,a=function(){};return{s:a,n:function(){return r>=n.length?{done:!0}:{done:!1,value:n[r++]}},e:function(D){throw D},f:a}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var C,l=!0,y=!1;return{s:function(){e=e.call(n)},n:function(){var D=e.next();return l=D.done,D},e:function(D){y=!0,C=D},f:function(){try{!l&&null!=e.return&&e.return()}finally{if(y)throw C}}}}function vt(n,t){(null==t||t>n.length)&&(t=n.length);for(var e=0,r=new Array(t);e<t;e++)r[e]=n[e];return r}function wt(n,t){var e=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(n,a).enumerable})),e.push.apply(e,r)}return e}function yr(n){for(var t=1;t<arguments.length;t++){var e=null!=arguments[t]?arguments[t]:{};t%2?wt(Object(e),!0).forEach(function(r){i(n,r,e[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(e)):wt(Object(e)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(e,r))})}return n}var bt=function(n){B(e,n);var r,t=function(n){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct||Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}();return function(){var a,r=F(n);if(t){var l=F(this).constructor;a=Reflect.construct(r,arguments,l)}else a=r.apply(this,arguments);return q(this,a)}}(e);function e(){var r;return re(this,e),i(o(r=t.call(this)),"_middleware",void 0),r._middleware=[],r}return s(e,[{key:"push",value:function(a){this._middleware.push(a)}},{key:"handle",value:function(a,l){if(l&&"function"!=typeof l)throw new Error('"callback" must be a function if provided.');return Array.isArray(a)?l?this._handleBatch(a,l):this._handleBatch(a):l?this._handle(a,l):this._promiseHandle(a)}},{key:"asMiddleware",value:function(){var a=this;return function(){var l=Se(fe().mark(function y(C,P,D,T){var K,Y,ne;return fe().wrap(function(te){for(;;)switch(te.prev=te.next){case 0:return te.prev=0,te.next=3,e._runAllMiddleware(C,P,a._middleware);case 3:if(K=et(te.sent,3),Y=K[0],ne=K[2],!K[1]){te.next=12;break}return te.next=11,e._runReturnHandlers(ne);case 11:return te.abrupt("return",T(Y));case 12:return te.abrupt("return",D(function(){var se=Se(fe().mark(function Qe(st){return fe().wrap(function(ge){for(;;)switch(ge.prev=ge.next){case 0:return ge.prev=0,ge.next=3,e._runReturnHandlers(ne);case 3:ge.next=8;break;case 5:return ge.prev=5,ge.t0=ge.catch(0),ge.abrupt("return",st(ge.t0));case 8:return ge.abrupt("return",st());case 9:case"end":return ge.stop()}},Qe,null,[[0,5]])}));return function(Qe){return se.apply(this,arguments)}}()));case 15:return te.prev=15,te.t0=te.catch(0),te.abrupt("return",T(te.t0));case 18:case"end":return te.stop()}},y,null,[[0,15]])}));return function(y,C,P,D){return l.apply(this,arguments)}}()}},{key:"_handleBatch",value:(r=Se(fe().mark(function l(y,C){var P;return fe().wrap(function(T){for(;;)switch(T.prev=T.next){case 0:return T.prev=0,T.next=3,Promise.all(y.map(this._promiseHandle.bind(this)));case 3:if(P=T.sent,!C){T.next=6;break}return T.abrupt("return",C(null,P));case 6:return T.abrupt("return",P);case 9:if(T.prev=9,T.t0=T.catch(0),!C){T.next=13;break}return T.abrupt("return",C(T.t0));case 13:throw T.t0;case 14:case"end":return T.stop()}},l,this,[[0,9]])})),function(l,y){return r.apply(this,arguments)})},{key:"_promiseHandle",value:function(a){var l=this;return new Promise(function(y){l._handle(a,function(C,P){y(P)})})}},{key:"_handle",value:function(){var r=Se(fe().mark(function l(y,C){var P,D,T,H,K;return fe().wrap(function(V){for(;;)switch(V.prev=V.next){case 0:if(y&&!Array.isArray(y)&&"object"===p(y)){V.next=3;break}return P=new Le({code:-32603,message:"request must be plain object"}),V.abrupt("return",C(P,{id:void 0,jsonrpc:"2.0",error:P}));case 3:if("string"==typeof y.method){V.next=6;break}return D=new Le({code:-32603,message:"method must be string"}),V.abrupt("return",C(D,{id:y.id,jsonrpc:"2.0",error:D}));case 6:return T=yr({},y),H={id:T.id,jsonrpc:T.jsonrpc},K=null,V.prev=9,V.next=12,this._processRequest(T,H);case 12:V.next=17;break;case 14:V.prev=14,V.t0=V.catch(9),K=V.t0;case 17:return K&&(delete H.result,H.error||(H.error=(0,ct.Xy)(K))),V.abrupt("return",C(K,H));case 19:case"end":return V.stop()}},l,this,[[9,14]])}));return function(l,y){return r.apply(this,arguments)}}()},{key:"_processRequest",value:function(){var r=Se(fe().mark(function l(y,C){var D,T,K;return fe().wrap(function(V){for(;;)switch(V.prev=V.next){case 0:return V.next=2,e._runAllMiddleware(y,C,this._middleware);case 2:return D=et(V.sent,3),T=D[0],K=D[2],e._checkForCompletion(y,C,D[1]),V.next=10,e._runReturnHandlers(K);case 10:if(!T){V.next=12;break}throw T;case 12:case"end":return V.stop()}},l,this)}));return function(l,y){return r.apply(this,arguments)}}()}],[{key:"_runAllMiddleware",value:function(){var r=Se(fe().mark(function l(y,C,P){var D,T,H,K,Y,V,le;return fe().wrap(function(se){for(;;)switch(se.prev=se.next){case 0:D=[],T=null,H=!1,K=yt(P),se.prev=4,K.s();case 6:if((Y=K.n()).done){se.next=18;break}return V=Y.value,se.next=10,e._runMiddleware(y,C,V,D);case 10:if(le=et(se.sent,2),T=le[0],!(H=le[1])){se.next=16;break}return se.abrupt("break",18);case 16:se.next=6;break;case 18:se.next=23;break;case 20:se.prev=20,se.t0=se.catch(4),K.e(se.t0);case 23:return se.prev=23,K.f(),se.finish(23);case 26:return se.abrupt("return",[T,H,D.reverse()]);case 27:case"end":return se.stop()}},l,null,[[4,20,23,26]])}));return function(l,y,C){return r.apply(this,arguments)}}()},{key:"_runMiddleware",value:function(a,l,y,C){return new Promise(function(P){var D=function(K){var Y=K||l.error;Y&&(l.error=(0,ct.Xy)(Y)),P([Y,!0])};try{y(a,l,function(K){l.error?D(l.error):(K&&("function"!=typeof K&&D(new Le({code:-32603,message:"JRPCEngine: 'next' return handlers must be functions"})),C.push(K)),P([null,!1]))},D)}catch(H){D(H)}})}},{key:"_runReturnHandlers",value:function(){var r=Se(fe().mark(function l(y){var C,P,D;return fe().wrap(function(H){for(;;)switch(H.prev=H.next){case 0:C=yt(y),H.prev=1,D=fe().mark(function K(){var Y;return fe().wrap(function(ne){for(;;)switch(ne.prev=ne.next){case 0:return Y=P.value,ne.next=3,new Promise(function(le,te){Y(function(se){return se?te(se):le()})});case 3:case"end":return ne.stop()}},K)}),C.s();case 4:if((P=C.n()).done){H.next=8;break}return H.delegateYield(D(),"t0",6);case 6:H.next=4;break;case 8:H.next=13;break;case 10:H.prev=10,H.t1=H.catch(1),C.e(H.t1);case 13:return H.prev=13,C.f(),H.finish(13);case 16:case"end":return H.stop()}},l,null,[[1,10,13,16]])}));return function(l){return r.apply(this,arguments)}}()},{key:"_checkForCompletion",value:function(a,l,y){if(!("result"in l)&&!("error"in l))throw new Le({code:-32603,message:"Response has no error or result for request"});if(!y)throw new Le({code:-32603,message:"Nothing ended request"})}}]),e}(qe);var _r=function(n){B(e,n);var t=function(n){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct||Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}();return function(){var a,r=F(n);if(t){var l=F(this).constructor;a=Reflect.construct(r,arguments,l)}else a=r.apply(this,arguments);return q(this,a)}}(e);function e(r){var a,l=r.parent,y=r.name;return re(this,e),i(o(a=t.call(this,{objectMode:!0})),"_parent",void 0),i(o(a),"_name",void 0),a._parent=l,a._name=y,a}return s(e,[{key:"_read",value:function(){}},{key:"_write",value:function(a,l,y){this._parent.push({name:this._name,data:a}),y()}}]),e}(X.Duplex);function St(n,t){var e=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(n,a).enumerable})),e.push.apply(e,r)}return e}function _t(n){for(var t=1;t<arguments.length;t++){var e=null!=arguments[t]?arguments[t]:{};t%2?St(Object(e),!0).forEach(function(r){i(n,r,e[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(e)):St(Object(e)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(e,r))})}return n}var Et=Symbol("IGNORE_SUBSTREAM"),Ct=function(n){B(e,n);var t=function(n){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct||Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}();return function(){var a,r=F(n);if(t){var l=F(this).constructor;a=Reflect.construct(r,arguments,l)}else a=r.apply(this,arguments);return q(this,a)}}(e);function e(){var r,a=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return re(this,e),i(o(r=t.call(this,_t(_t({},a),{},{objectMode:!0}))),"_substreams",void 0),i(o(r),"getStream",void 0),r._substreams={},r}return s(e,[{key:"createStream",value:function(a){if(!a)throw new Error("ObjectMultiplex - name must not be empty");if(this._substreams[a])throw new Error('ObjectMultiplex - Substream for name "'.concat(a,'" already exists'));var l=new _r({parent:this,name:a});return this._substreams[a]=l,function(n,t){var e=ar()(function(y){return l.destroy(y||void 0)});ft()(n,{readable:!1},e),ft()(n,{writable:!1},e)}(this),l}},{key:"ignoreStream",value:function(a){if(!a)throw new Error("ObjectMultiplex - name must not be empty");if(this._substreams[a])throw new Error('ObjectMultiplex - Substream for name "'.concat(a,'" already exists'));this._substreams[a]=Et}},{key:"_read",value:function(){}},{key:"_write",value:function(a,l,y){var C=a.name,P=a.data;if(!C)return window.console.warn('ObjectMultiplex - malformed chunk without name "'.concat(a,'"')),y();var D=this._substreams[C];return D?(D!==Et&&D.push(P),y()):(window.console.warn('ObjectMultiplex - orphaned data for stream "'.concat(C,'"')),y())}}]),e}(X.Duplex),Ot=d(16177),Be=d(83943),Ar=d(95439),Tr=d.n(Ar),Mr=d(78936),Ir=d(12506),Dr=d.n(Ir);const xe={GOOGLE:"google",FACEBOOK:"facebook",TWITCH:"twitch",REDDIT:"reddit",DISCORD:"discord"},Ie={GOOGLE:"google",FACEBOOK:"facebook",TWITCH:"twitch",REDDIT:"reddit",DISCORD:"discord",EMAIL_PASSWORDLESS:"torus-auth0-email-passwordless"},rt={[Ie.GOOGLE]:"tkey-google",[Ie.FACEBOOK]:"tkey-facebook",[Ie.TWITCH]:"tkey-twitch",[Ie.REDDIT]:"tkey-reddit",[Ie.DISCORD]:"tkey-discord",[Ie.EMAIL_PASSWORDLESS]:"tkey-auth0-email-passwordless"},oe={MOONPAY:"moonpay",WYRE:"wyre",RAMPNETWORK:"rampnetwork",XANPOOL:"xanpool",MERCURYO:"mercuryo",TRANSAK:"transak",BANXA:"banxa"},ue={MAINNET:"mainnet",MATIC:"matic",BSC_MAINNET:"bsc_mainnet",AVALANCHE_MAINNET:"avalanche_mainnet",XDAI:"xdai"},Rt={PRODUCTION:"production",DEVELOPMENT:"development",BINANCE:"binance",TESTING:"testing",LRC:"lrc",BETA:"beta",BNB:"bnb",POLYGON:"polygon"},je={BOTTOM_LEFT:"bottom-left",TOP_LEFT:"top-left",BOTTOM_RIGHT:"bottom-right",TOP_RIGHT:"top-right"},Lr={[oe.MOONPAY]:["AUD","BGN","BRL","CAD","CHF","CNY","COP","CZK","DKK","DOP","EGP","EUR","GBP","HKD","HRK","IDR","ILS","JPY","JOD","KES","KRW","KWD","LKR","MAD","MXN","MYR","NGN","NOK","NZD","OMR","PEN","PKR","PLN","RON","RUB","SEK","SGD","THB","TRY","TWD","USD","VND","ZAR"],[oe.WYRE]:["USD","EUR","GBP","AUD","CAD","NZD","ARS","BRL","CHF","CLP","COP","CZK","DKK","HKD","ILS","INR","ISK","JPY","KRW","MXN","MYR","NOK","PHP","PLN","SEK","THB","VND","ZAR"],[oe.RAMPNETWORK]:["USD","EUR","GBP"],[oe.XANPOOL]:["SGD","HKD","THB","PHP","INR","IDR","MYR","AUD","NZD","KRW"],[oe.MERCURYO]:["EUR","USD","GBP","TRY","JPY","BRL","NGN","VND","MXN","KRW"],[oe.TRANSAK]:["ARS","AUD","BBD","BGN","BMD","BRL","CAD","CHF","CLP","CRC","CZK","DKK","DOP","EUR","FJD","FKP","GBP","GIP","HRK","HUF","IDR","ILS","ISK","JMD","JPY","KES","KRW","MDL","MXN","MYR","NOK","NZD","PEN","PHP","PLN","PYG","RON","SEK","SGD","THB","TRY","TZS","USD","ZAR"],[oe.BANXA]:["EUR","GBP","USD"]},jr=new Set(["ETH","USDT","USDC","TUSD","EOSDT","USD","DAI","GUSD","DKKT","PAX","ILS","RUB","BYN","EUR","GBP","JPY","KRW","PLN","MXN","AUD","BRL","CAD","CHF","KPW","LAK","LBP","LKR","XOF","CNHT","DOGE","UAH","TRY","HKD","XJP","SGD","USC","NZD","NGN","RUR","COP","GHS","EGP","IDR","BHD","CRC","PEN","AED","DOP","PKR","HUF","VND","XAR","LTC","RON","OMR","MYR","DKK","UGX","ZMW","SAR","SEK","GEL","RWF","IRR","TZS","CNY","VEF","BDT","HRK","CLP","THB","XAF","ARS","UYU","SZL","KZT","NOK","KES","PAB","INR","CZK","MAD","TWD","PHP","ZAR","BOB","CDF","DASH","VES","ISK","MWK","BAM","TTD","XRP","JOD","RSD","HNL","BGN","GTQ","BWP","XMR","MMK","QAR","AOA","KWD","MUR","WUSD","WEUR","WAVES","WTRY","LRD","LSL","LYD","AWG","MDL","BTO","EURS","CHFT","MKD","MNT","MOP","MRO","MVR","VOLLAR","CKUSD","KHR","VUV","BITCNY","QC","BBD","NAD","NPR","PGK","PYG","BIF","BMD","BND","XLM","BNB","SCR","BAT","CRO","HT","KCS","LEO","LINK","MKR","NPXS","OMG","REP","ZB","ZIL","ZRX","BCH","BZD","CUP","CVE","DJF","DZD","ERN","ETB","FJD","FKP","BUSD","ANCT","ALL","AMD","ANG","CNYX","IQD","UZS","TND","GGP","XAU","KGS","GIP","JMD","ZEC","USDP","BSV","EMC2","SNT","GTO","POWR","EUSD","EURT","BCY","BTS","ATM","BLOCKPAY","ARDR","AMP","B2X","BITGOLD","BITEUR","ATB","BITUSD","AGRS","DFXT","HIKEN","BIX","KNC","EOS","COB","COSS","BMH","NANO","BDG","BNT","XVG","LKK1Y","LKK","USDK","EURN","NZDT","JSE","GMD","GNF","GYD","YER","XPF","HTG","SLL","SOS","WST","SVC","SYP","NEO","KMF","JUMP","AYA","BLAST","WGR","BCN","BTG","URALS","INN","USDQ","CNH","HUSD","BKRW","NZDX","EURX","CADX","USDEX","JPYX","AUDX","VNDC","EON","GBPX","CHFX","USDJ","IDRT","USDS","USDN","BIDR","IDK","BSD","BTN","KYD","NIO","SBD","SDG","SHP","TOP","XCD","XCHF","CNYT","GYEN","ZUSD","GOLD","TRX","TRYB","PLATC","STRAX","UST","GLM","VAI","BRZ","DDRST","XAUT","MIM"]);function ke(n){return Lr[n].filter(e=>jr.has(e))}const kr={[oe.MOONPAY]:{line1:"Credit/ Debit Card/ Apple Pay",line2:"4.5% or 5 USD",line3:"2,000\u20ac/day, 10,000\u20ac/mo",supportPage:"https://help.moonpay.io/en/",minOrderValue:24.99,maxOrderValue:5e4,validCurrencies:ke(oe.MOONPAY),validCryptoCurrenciesByChain:{[ue.MAINNET]:[{value:"aave",display:"AAVE"},{value:"bat",display:"BAT"},{value:"dai",display:"DAI"},{value:"eth",display:"ETH"},{value:"mkr",display:"MKR"},{value:"matic",display:"MATIC"},{value:"usdt",display:"USDT"},{value:"usdc",display:"USDC"}],[ue.MATIC]:[{value:"eth_polygon",display:"ETH"},{value:"matic_polygon",display:"MATIC"},{value:"usdc_polygon",display:"USDC"}],[ue.BSC_MAINNET]:[{value:"bnb_bsc",display:"BNB"},{value:"busd_bsc",display:"BUSD"}],[ue.AVALANCHE_MAINNET]:[{value:"avax_cchain",display:"AVAX"}]},includeFees:!0,api:!0,enforceMax:!1},[oe.WYRE]:{line1:"Apple Pay/ Debit/ Credit Card",line2:"4.9% + 30\xa2 or 5 USD",line3:"$250/day",supportPage:"https://support.sendwyre.com/en/",minOrderValue:5,maxOrderValue:500,validCurrencies:ke(oe.WYRE),validCryptoCurrenciesByChain:{[ue.MAINNET]:[{value:"AAVE",display:"AAVE"},{value:"BAT",display:"BAT"},{value:"BUSD",display:"BUSD"},{value:"DAI",display:"DAI"},{value:"ETH",display:"ETH"},{value:"MKR",display:"MKR"},{value:"UNI",display:"UNI"},{value:"USDC",display:"USDC"},{value:"USDT",display:"USDT"}],[ue.MATIC]:[{value:"MUSDC",display:"USDC"}],[ue.AVALANCHE_MAINNET]:[{value:"AVAXC",display:"AVAXC"}]},includeFees:!1,api:!0,enforceMax:!1},[oe.RAMPNETWORK]:{line1:"Debit Card/ <br>Apple Pay/ Bank transfer",line2:"0.49% - 2.9%",line3:"5,000\u20ac/purchase, 20,000\u20ac/mo",supportPage:"https://instant.ramp.network/",minOrderValue:50,maxOrderValue:2e4,validCurrencies:ke(oe.RAMPNETWORK),validCryptoCurrenciesByChain:{[ue.MAINNET]:[{value:"ETH",display:"ETH"},{value:"DAI",display:"DAI"},{value:"USDC",display:"USDC"},{value:"USDT",display:"USDT"}],[ue.MATIC]:[{value:"MATIC_DAI",display:"DAI"},{value:"MATIC_MATIC",display:"MATIC"},{value:"MATIC_USDC",display:"USDC"}],[ue.AVALANCHE_MAINNET]:[{value:"AVAX",display:"AVAX"}]},includeFees:!0,api:!0,receiveHint:"walletTopUp.receiveHintRamp",enforceMax:!1},[oe.XANPOOL]:{line1:"PayNow/ InstaPay/ FPS/ GoJekPay/ UPI/ PromptPay/ <br>ViettelPay/ DuitNow",line2:"2.5% buying, 3% selling",line3:"$2,500 / day",supportPage:"mailto:[email protected]",minOrderValue:100,maxOrderValue:2500,validCurrencies:ke(oe.XANPOOL),validCryptoCurrenciesByChain:{[ue.MAINNET]:[{value:"ETH",display:"ETH"},{value:"USDT",display:"USDT"}]},includeFees:!0,api:!0,sell:!0,enforceMax:!1},[oe.MERCURYO]:{line1:"Credit/ Debit Card/ Apple Pay",line2:"3.95% or 4 USD",line3:"10,000\u20ac/day, 25,000\u20ac/mo",supportPage:"mailto:[email protected]",minOrderValue:30,maxOrderValue:5e3,validCurrencies:ke(oe.MERCURYO),validCryptoCurrenciesByChain:{[ue.MAINNET]:[{value:"ETH",display:"ETH"},{value:"BAT",display:"BAT"},{value:"USDT",display:"USDT"},{value:"DAI",display:"DAI"}],[ue.BSC_MAINNET]:[{value:"BNB",display:"BNB"},{value:"BUSD",display:"BUSD"},{value:"1INCH",display:"1INCH"}]},includeFees:!0,api:!0,enforceMax:!1},[oe.TRANSAK]:{line1:"Apple & Google Pay / Credit/Debit Card<br/>Bangkok Bank Mobile & iPay<br/>Bank Transfer (sepa/gbp) / SCB Mobile & Easy",line2:"0.99% - 5.5% or 5 USD",line3:"$5,000/day, $28,000/mo",supportPage:"https://support.transak.com/hc/en-US",minOrderValue:30,maxOrderValue:500,validCurrencies:ke(oe.TRANSAK),validCryptoCurrenciesByChain:{[ue.MAINNET]:[{value:"AAVE",display:"AAVE"},{value:"DAI",display:"DAI"},{value:"ETH",display:"ETH"},{value:"USDC",display:"USDC"},{value:"USDT",display:"USDT"}],[ue.MATIC]:[{value:"AAVE",display:"AAVE"},{value:"DAI",display:"DAI"},{value:"MATIC",display:"MATIC"},{value:"USDC",display:"USDC"},{value:"USDT",display:"USDT"},{value:"WETH",display:"WETH"}],[ue.BSC_MAINNET]:[{value:"BNB",display:"BNB"},{value:"BUSD",display:"BUSD"}],[ue.AVALANCHE_MAINNET]:[{value:"AVAX",display:"AVAX"}]},includeFees:!0,enforceMax:!0},[oe.BANXA]:{line1:"Debit Card/ <br>Apple Pay/ Bank transfer",line2:"0.49% - 2.9%",line3:"5,000\u20ac/purchase, 20,000\u20ac/mo",supportPage:"https://support.banxa.com",minOrderValue:20,maxOrderValue:15e3,validCurrencies:ke(oe.BANXA),validCryptoCurrenciesByChain:{[ue.MAINNET]:[{value:"ETH",display:"ETH"},{value:"USDT",display:"USDT"},{value:"BUSD",display:"BUSD"},{value:"LINK",display:"LINK"},{value:"USDC",display:"USDC"},{value:"CHZ",display:"CHZ"},{value:"BAT",display:"BAT"},{value:"MANA",display:"MANA"},{value:"AAVE",display:"AAVE"},{value:"COMP",display:"COMP"},{value:"ENJ",display:"ENJ"}],[ue.MATIC]:[{value:"MATIC",display:"MATIC"}]},includeFees:!0,enforceMax:!0}};var Pe={supportedVerifierList:Object.values(Ie),paymentProviders:kr,api:"https://api.tor.us",translations:{en:{embed:{continue:"Continue",actionRequired:"Authorization required",pendingAction:"Click continue to proceed with your request in a popup",cookiesRequired:"Cookies Required",enableCookies:"Please enable cookies in your browser preferences to access Torus",clickHere:"More Info"}},de:{embed:{continue:"Fortsetzen",actionRequired:"Autorisierung erforderlich",pendingAction:"Klicken Sie in einem Popup auf Weiter, um mit Ihrer Anfrage fortzufahren",cookiesRequired:"Cookies ben\xf6tigt",enableCookies:"Bitte aktivieren Sie Cookies in Ihren Browsereinstellungen, um auf Torus zuzugreifen",clickHere:"Mehr Info"}},ja:{embed:{continue:"\u7d99\u7d9a\u3059\u308b",actionRequired:"\u8a8d\u8a3c\u304c\u5fc5\u8981\u3067\u3059",pendingAction:"\u7d9a\u884c\u3092\u30af\u30ea\u30c3\u30af\u3057\u3066\u3001\u30dd\u30c3\u30d7\u30a2\u30c3\u30d7\u3067\u30ea\u30af\u30a8\u30b9\u30c8\u3092\u7d9a\u884c\u3057\u307e\u3059",cookiesRequired:"\u5fc5\u8981\u306a\u30af\u30c3\u30ad\u30fc",enableCookies:"Torus\u306b\u30a2\u30af\u30bb\u30b9\u3059\u308b\u306b\u306f\u3001\u30d6\u30e9\u30a6\u30b6\u306e\u8a2d\u5b9a\u3067Cookie\u3092\u6709\u52b9\u306b\u3057\u3066\u304f\u3060\u3055\u3044\u3002",clickHere:"\u8a73\u3057\u304f\u306f"}},ko:{embed:{continue:"\uacc4\uc18d\ud558\ub2e4",actionRequired:"\uc2b9\uc778 \ud544\uc694",pendingAction:"\ud31d\uc5c5\uc5d0\uc11c \uc694\uccad\uc744 \uc9c4\ud589\ud558\ub824\uba74 \uacc4\uc18d\uc744 \ud074\ub9ad\ud558\uc2ed\uc2dc\uc624.",cookiesRequired:"\ucfe0\ud0a4 \ud544\uc694",enableCookies:"\ube0c\ub77c\uc6b0\uc800 \ud658\uacbd \uc124\uc815\uc5d0\uc11c \ucfe0\ud0a4\ub97c \ud65c\uc131\ud654\ud558\uc5ec Torus\uc5d0 \uc561\uc138\uc2a4\ud558\uc2ed\uc2dc\uc624.",clickHere:"\ub354 \ub9ce\uc740 \uc815\ubcf4"}},zh:{embed:{continue:"\u7ee7\u7eed",actionRequired:"\u9700\u8981\u6388\u6743",pendingAction:"\u5355\u51fb\u7ee7\u7eed\u4ee5\u5728\u5f39\u51fa\u7a97\u53e3\u4e2d\u7ee7\u7eed\u60a8\u7684\u8bf7\u6c42",cookiesRequired:"\u5fc5\u586bCookie",enableCookies:"\u8bf7\u5728\u60a8\u7684\u6d4f\u89c8\u5668\u9996\u9009\u9879\u4e2d\u542f\u7528cookie\u4ee5\u8bbf\u95eeTorus\u3002",clickHere:"\u66f4\u591a\u4fe1\u606f"}}},prodTorusUrl:"",localStorageKeyPrefix:"torus-"};const Pt=n=>new Promise((t,e)=>{null!=window.document.body?Promise.resolve(n()).then(t).catch(e):window.document.addEventListener("DOMContentLoaded",()=>{Promise.resolve(n()).then(t).catch(e)})}),Ve=n=>{const t=window.document.createElement("template"),e=n.trim();return t.innerHTML=e,t.content.firstChild},Br=function(n,t,e){for(var r=arguments.length,a=new Array(r>3?r-3:0),l=3;l<r;l++)a[l-3]=arguments[l];const y=()=>{e(...a),n.removeEventListener(t,y)};n.addEventListener(t,y)},Ae=(n,t,e)=>{const r=a=>{e(a),n.removeListener(t,r)};n.on(t,r)};function nt(){return(nt=(0,h.Z)(function*(){return new Promise(n=>{"loading"!==document.readyState?n():Br(document,"DOMContentLoaded",n)})})).apply(this,arguments)}var ae=z().getLogger("torus-embed"),we={errors:{disconnected:()=>"Torus: Lost connection to Torus.",permanentlyDisconnected:()=>"Torus: Disconnected from iframe. Page reload required.",sendSiteMetadata:()=>"Torus: Failed to send site metadata. This is an internal error, please report this bug.",unsupportedSync:n=>`Torus: The Torus Ethereum provider does not support synchronous methods like ${n} without a callback parameter.`,invalidDuplexStream:()=>"Must provide a Node.js-style duplex stream.",invalidOptions:(n,t)=>`Invalid options. Received: { maxEventListeners: ${n}, shouldSendMetadata: ${t} }`,invalidRequestArgs:()=>"Expected a single, non-array, object argument.",invalidRequestMethod:()=>"'args.method' must be a non-empty string.",invalidRequestParams:()=>"'args.params' must be an object or array if provided.",invalidLoggerObject:()=>"'args.logger' must be an object if provided.",invalidLoggerMethod:n=>`'args.logger' must include required method '${n}'.`},info:{connected:n=>`Torus: Connected to chain with ID "${n}".`},warnings:{enableDeprecation:'Torus: ""ethereum.enable()" is deprecated and may be removed in the future. Please use "ethereum.send("eth_requestAccounts")" instead. For more information, see: https://eips.ethereum.org/EIPS/eip-1102',sendDeprecation:'Torus: "ethereum.send(...)" is deprecated and may be removed in the future. Please use "ethereum.sendAsync(...)" or "ethereum.request(...)" instead.\nFor more information, see: https://eips.ethereum.org/EIPS/eip-1193',events:{close:'Torus: The event "close" is deprecated and may be removed in the future. Please use "disconnect" instead.\nFor more information, see: https://eips.ethereum.org/EIPS/eip-1193',data:'Torus: The event "data" is deprecated and will be removed in the future.Use "message" instead.\nFor more information, see: https://eips.ethereum.org/EIPS/eip-1193#message',networkChanged:'Torus: The event "networkChanged" is deprecated and may be removed in the future. Please use "chainChanged" instead.\nFor more information, see: https://eips.ethereum.org/EIPS/eip-1193',notification:'Torus: The event "notification" is deprecated and may be removed in the future. Please use "message" instead.\nFor more information, see: https://eips.ethereum.org/EIPS/eip-1193'},publicConfigStore:'Torus: The property "publicConfigStore" is deprecated and WILL be removed in the future.'}};const{paymentProviders:At}=Pe;function Tt(n,t,e){let r=`MetaMask: Lost connection to "${n}".`;null!=t&&t.stack&&(r+=`\n${t.stack}`),ae.warn(r),e&&e.listenerCount("error")>0&&e.emit("error",r)}const Ue=()=>Math.random().toString(36).slice(2),Mt=function(){var n=(0,h.Z)(function*(t,e){let r,a;const l="1.38.2";let y=e.version||l;try{if(("binance"===t||"production"===t)&&!e.version){let C;C=Pe.prodTorusUrl?{data:Pe.prodTorusUrl}:yield u(`${Pe.api}/latestversion?name=@toruslabs/torus-embed&version=${l}`,{},{useAPIKey:!0}),y=C.data,Pe.prodTorusUrl=C.data}}catch(C){ae.error(C,"unable to fetch latest version")}switch(ae.info("version used: ",y),t){case"binance":r=`https://binance.tor.us/v${y}`,a="info";break;case"testing":r="https://testing.tor.us",a="debug";break;case"bnb":r="https://bnb.tor.us",a="error";break;case"polygon":r="https://polygon.tor.us",a="error";break;case"lrc":r="https://lrc.tor.us",a="debug";break;case"beta":r="https://beta.tor.us",a="debug";break;case"development":r="http://localhost:4050",a="debug";break;default:r=`https://app.tor.us/v${y}`,a="error"}return{torusUrl:r,logLevel:a}});return function(e,r){return n.apply(this,arguments)}}(),It=()=>{let n=window.navigator.language||"en-US";const t=n.split("-");return n=Object.prototype.hasOwnProperty.call(Pe.translations,t[0])?t[0]:"en",n},Fr=["eth_subscription"],Dt=()=>{},Nt="directories=0,titlebar=0,toolbar=0,status=0,location=0,menubar=0,height=660,width=375",Lt="directories=0,titlebar=0,toolbar=0,status=0,location=0,menubar=0,height=700,width=450";function jt(n,t){var e=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(n,a).enumerable})),e.push.apply(e,r)}return e}qe.defaultMaxListeners=100;const kt=function(n,t){let e=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];return(r,a)=>r||a.error?t(r||a.error):!e||Array.isArray(a)?n(a):n(a.result)};class Ge extends qe{constructor(t){let{maxEventListeners:e=100,shouldSendMetadata:r=!0,jsonRpcStreamName:a="provider"}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(super(),i(this,"chainId",void 0),i(this,"selectedAddress",void 0),i(this,"_rpcEngine",void 0),i(this,"networkVersion",void 0),i(this,"shouldSendMetadata",void 0),i(this,"isTorus",void 0),i(this,"_publicConfigStore",void 0),i(this,"tryPreopenHandle",void 0),i(this,"enable",void 0),i(this,"_state",void 0),i(this,"_jsonRpcConnection",void 0),i(this,"_sentWarnings",{enable:!1,experimentalMethods:!1,send:!1,publicConfigStore:!1,events:{close:!1,data:!1,networkChanged:!1,notification:!1}}),!(0,Mr.duplex)(t))throw new Error(we.errors.invalidDuplexStream());this.isTorus=!0,this.setMaxListeners(e),this._state=function(n){for(var t=1;t<arguments.length;t++){var e=null!=arguments[t]?arguments[t]:{};t%2?jt(Object(e),!0).forEach(function(r){i(n,r,e[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(e)):jt(Object(e)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(e,r))})}return n}({},Ge._defaultState),this.selectedAddress=null,this.networkVersion=null,this.chainId=null,this.shouldSendMetadata=r,this._handleAccountsChanged=this._handleAccountsChanged.bind(this),this._handleChainChanged=this._handleChainChanged.bind(this),this._handleUnlockStateChanged=this._handleUnlockStateChanged.bind(this),this._handleConnect=this._handleConnect.bind(this),this._handleDisconnect=this._handleDisconnect.bind(this),this._handleStreamDisconnect=this._handleStreamDisconnect.bind(this),this._sendSync=this._sendSync.bind(this),this._rpcRequest=this._rpcRequest.bind(this),this._warnOfDeprecation=this._warnOfDeprecation.bind(this),this._initializeState=this._initializeState.bind(this),this.request=this.request.bind(this),this.send=this.send.bind(this),this.sendAsync=this.sendAsync.bind(this);const l=new Ct;Xe()(t,l,t,this._handleStreamDisconnect.bind(this,"MetaMask")),this._publicConfigStore=new Ot.ObservableStore({storageKey:"Metamask-Config"}),Xe()(l.createStream("publicConfig"),(0,Ot.storeAsStream)(this._publicConfigStore),Tt.bind(this,"MetaMask PublicConfigStore")),l.ignoreStream("phishing"),this.on("connect",()=>{this._state.isConnected=!0});const y=function(){var n={},e=new qe,y=new X.Duplex({objectMode:!0,read:function(){return!1},write:function(P,D,T){var H;try{P.id?function(P){var D=n[P.id];if(!D)throw new Error('StreamMiddleware - Unknown response id "'.concat(P.id,'"'));delete n[P.id],Object.assign(D.res,P),setTimeout(D.end)}(P):function(P){e.emit("notification",P)}(P)}catch(Y){H=Y}T(H)}});return{events:e,middleware:function(D,T,H,K){y.push(D),n[D.id]={req:D,res:T,next:H,end:K}},stream:y}}();Xe()(y.stream,l.createStream(a),y.stream,this._handleStreamDisconnect.bind(this,"MetaMask RpcProvider"));const C=new bt;C.push(function(n,t,e,r){var a=n.id,l=ze()(32).toString("hex");n.id=l,t.id=l,e(function(y){n.id=a,t.id=a,y()})}),C.push((n,t,e)=>{("string"!=typeof n.method||!n.method)&&(t.error=Be.Sy.rpc.invalidRequest({message:"The request 'method' must be a non-empty string.",data:n})),e(r=>{const{error:a}=t;return a&&ae.error(`MetaMask - RPC Error: ${a.message}`,a),r()})}),C.push(y.middleware),this._rpcEngine=C,y.events.on("notification",P=>{const{method:D,params:T}=P;"wallet_accountsChanged"===D?this._handleAccountsChanged(T):"wallet_unlockStateChanged"===D?this._handleUnlockStateChanged(T):"wallet_chainChanged"===D?this._handleChainChanged(T):Fr.includes(P.method)&&(this.emit("data",P),this.emit("notification",T.result),this.emit("message",{type:D,data:T}))})}get publicConfigStore(){return this._sentWarnings.publicConfigStore||(ae.warn(we.warnings.publicConfigStore),this._sentWarnings.publicConfigStore=!0),this._publicConfigStore}isConnected(){return this._state.isConnected}request(t){var e=this;return(0,h.Z)(function*(){if(!t||"object"!=typeof t||Array.isArray(t))throw Be.Sy.rpc.invalidRequest({message:we.errors.invalidRequestArgs(),data:t});const{method:r,params:a}=t;if("string"!=typeof r||0===r.length)throw Be.Sy.rpc.invalidRequest({message:we.errors.invalidRequestMethod(),data:t});if(void 0!==a&&!Array.isArray(a)&&("object"!=typeof a||null===a))throw Be.Sy.rpc.invalidRequest({message:we.errors.invalidRequestParams(),data:t});return new Promise((l,y)=>{e._rpcRequest({method:r,params:a},kt(l,y))})})()}sendAsync(t,e){this._rpcRequest(t,e)}addListener(t,e){return this._warnOfDeprecation(t),super.addListener(t,e)}on(t,e){return this._warnOfDeprecation(t),super.on(t,e)}once(t,e){return this._warnOfDeprecation(t),super.once(t,e)}prependListener(t,e){return this._warnOfDeprecation(t),super.prependListener(t,e)}prependOnceListener(t,e){return this._warnOfDeprecation(t),super.prependOnceListener(t,e)}_initializeState(){var t=this;return(0,h.Z)(function*(){try{const{accounts:e,chainId:r,isUnlocked:a,networkVersion:l}=yield t.request({method:"wallet_getProviderState"});t.emit("connect",{chainId:r}),t._handleChainChanged({chainId:r,networkVersion:l}),t._handleUnlockStateChanged({accounts:e,isUnlocked:a}),t._handleAccountsChanged(e)}catch(e){ae.error("MetaMask: Failed to get initial state. Please report this bug.",e)}finally{ae.info("initialized state"),t._state.initialized=!0,t.emit("_initialized")}})()}_rpcRequest(t,e){let r=arguments.length>2&&void 0!==arguments[2]&&arguments[2],a=e;const l=t;if(!Array.isArray(l))if(l.jsonrpc||(l.jsonrpc="2.0"),"eth_accounts"===l.method||"eth_requestAccounts"===l.method)a=(y,C)=>{this._handleAccountsChanged(C.result||[],"eth_accounts"===l.method,r),e(y,C)};else if("wallet_getProviderState"===l.method)return void this._rpcEngine.handle(t,a);this.tryPreopenHandle(l,a)}send(t,e){return this._sentWarnings.send||(ae.warn(we.warnings.sendDeprecation),this._sentWarnings.send=!0),"string"!=typeof t||e&&!Array.isArray(e)?t&&"object"==typeof t&&"function"==typeof e?this._rpcRequest(t,e):this._sendSync(t):new Promise((r,a)=>{try{this._rpcRequest({method:t,params:e},kt(r,a,!1))}catch(l){a(l)}})}_sendSync(t){let e;switch(t.method){case"eth_accounts":e=this.selectedAddress?[this.selectedAddress]:[];break;case"eth_coinbase":e=this.selectedAddress||null;break;case"eth_uninstallFilter":this._rpcRequest(t,Dt),e=!0;break;case"net_version":e=this.networkVersion||null;break;default:throw new Error(we.errors.unsupportedSync(t.method))}return{id:t.id,jsonrpc:t.jsonrpc,result:e}}_handleConnect(t){this._state.isConnected||(this._state.isConnected=!0,this.emit("connect",{chainId:t}),ae.debug(we.info.connected(t)))}_handleDisconnect(t,e){if(this._state.isConnected||!this._state.isPermanentlyDisconnected&&!t){let r;this._state.isConnected=!1,t?(r=new Be.Cg(1013,e||we.errors.disconnected()),ae.debug(r)):(r=new Be.Cg(1011,e||we.errors.permanentlyDisconnected()),ae.error(r),this.chainId=null,this._state.accounts=null,this.selectedAddress=null,this._state.isUnlocked=!1,this._state.isPermanentlyDisconnected=!0),this.emit("disconnect",r)}}_handleStreamDisconnect(t,e){Tt(t,e,this),this._handleDisconnect(!1,e?e.message:void 0)}_handleAccountsChanged(t){let e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=arguments.length>2&&void 0!==arguments[2]&&arguments[2],a=t;Array.isArray(a)||(ae.error("MetaMask: Received non-array accounts parameter. Please report this bug.",a),a=[]);for(const l of t)if("string"!=typeof l){ae.error("MetaMask: Received non-string account. Please report this bug.",t),a=[];break}Tr()(this._state.accounts,a)||(e&&Array.isArray(this._state.accounts)&&this._state.accounts.length>0&&!r&&ae.error('MetaMask: "eth_accounts" unexpectedly updated accounts. Please report this bug.',a),this._state.accounts=a,this.emit("accountsChanged",a)),this.selectedAddress!==a[0]&&(this.selectedAddress=a[0]||null)}_handleChainChanged(){let{chainId:t,networkVersion:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};t&&e?"loading"===e?this._handleDisconnect(!0):(this._handleConnect(t),t!==this.chainId&&(this.chainId=t,this._state.initialized&&this.emit("chainChanged",this.chainId))):ae.error("MetaMask: Received invalid network parameters. Please report this bug.",{chainId:t,networkVersion:e})}_handleUnlockStateChanged(){let{accounts:t,isUnlocked:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};"boolean"==typeof e?e!==this._state.isUnlocked&&(this._state.isUnlocked=e,this._handleAccountsChanged(t||[])):ae.error("MetaMask: Received invalid isUnlocked parameter. Please report this bug.",{isUnlocked:e})}_warnOfDeprecation(t){!1===this._sentWarnings.events[t]&&(ae.warn(we.warnings.events[t]),this._sentWarnings.events[t]=!0)}}i(Ge,"_defaultState",{accounts:null,isConnected:!1,isUnlocked:!1,initialized:!1,isPermanentlyDisconnected:!1,hasEmittedConnection:!1});const Jr=(n,t)=>{const e={};return n.algorithms.forEach(r=>{e[r]=Dr()(r).update(t,"utf8").digest("base64")}),e};class Ut extends lt.EventEmitter{constructor(t){let{url:e,target:r,features:a}=t;super(),i(this,"url",void 0),i(this,"target",void 0),i(this,"features",void 0),i(this,"window",void 0),i(this,"windowTimer",void 0),i(this,"iClosedWindow",void 0),this.url=e,this.target=r||"_blank",this.features=a||function(){const n=void 0!==window.screenLeft?window.screenLeft:window.screenX,t=void 0!==window.screenTop?window.screenTop:window.screenY,a=window.innerWidth?window.innerWidth:document.documentElement.clientWidth?document.documentElement.clientWidth:window.screen.width,l=window.innerHeight?window.innerHeight:document.documentElement.clientHeight?document.documentElement.clientHeight:window.screen.height,C=Math.abs((a-1200)/2/1+n);return`titlebar=0,toolbar=0,status=0,location=0,menubar=0,height=700,width=1200,top=${Math.abs((l-700)/2/1+t)},left=${C}`}(),this.window=void 0,this.windowTimer=void 0,this.iClosedWindow=!1,this._setupTimer()}_setupTimer(){this.windowTimer=Number(setInterval(()=>{this.window&&this.window.closed&&(clearInterval(this.windowTimer),this.iClosedWindow||this.emit("close"),this.iClosedWindow=!1,this.window=void 0),void 0===this.window&&clearInterval(this.windowTimer)},500))}open(){var t;return this.window=window.open(this.url.href,this.target,this.features),null!==(t=this.window)&&void 0!==t&&t.focus&&this.window.focus(),Promise.resolve()}close(){this.iClosedWindow=!0,this.window&&this.window.close()}redirect(t){t?window.location.replace(this.url.href):window.location.href=this.url.href}}function Bt(n){return new Promise((t,e)=>{try{const r=document.createElement("img");r.onload=()=>t(!0),r.onerror=()=>t(!1),r.src=n}catch(r){e(r)}})}const Xr=n=>{const{document:t}=n,e=t.querySelector('head > meta[property="og:site_name"]');if(e)return e.content;const r=t.querySelector('head > meta[name="title"]');return r?r.content:t.title&&t.title.length>0?t.title:n.location.hostname};function Zr(n){return it.apply(this,arguments)}function it(){return(it=(0,h.Z)(function*(n){const{document:t}=n;let e=t.querySelector('head > link[rel="shortcut icon"]');return e&&(yield Bt(e.href))||(e=Array.from(t.querySelectorAll('head > link[rel="icon"]')).find(r=>Boolean(r.href)),e&&(yield Bt(e.href)))?e.href:null})).apply(this,arguments)}const qr=function(){var n=(0,h.Z)(function*(){return{name:Xr(window),icon:yield Zr(window)}});return function(){return n.apply(this,arguments)}}();function at(){return(at=(0,h.Z)(function*(n){try{const t=yield qr();n.handle({jsonrpc:"2.0",id:Ue(),method:"wallet_sendDomainMetadata",params:t},Dt)}catch(t){ae.error({message:we.errors.sendSiteMetadata(),originalError:t})}})).apply(this,arguments)}const en=["host","chainId","networkName"];function xt(n,t){var e=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(n,a).enumerable})),e.push.apply(e,r)}return e}function tn(n){for(var t=1;t<arguments.length;t++){var e=null!=arguments[t]?arguments[t]:{};t%2?xt(Object(e),!0).forEach(function(r){i(n,r,e[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(e)):xt(Object(e)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(e,r))})}return n}const rn={[xe.GOOGLE]:!0,[xe.FACEBOOK]:!0,[xe.REDDIT]:!0,[xe.TWITCH]:!0,[xe.DISCORD]:!0},Wt="sha384-CtXpgmTZsK+NAtIX8tWrMn+8s/fTjkftnUPkLV3Hnhe7kj5CH5E92MqqBD46kp/0",an=["eth_sendTransaction","eth_signTypedData","eth_signTypedData_v3","eth_signTypedData_v4","personal_sign","eth_getEncryptionPublicKey","eth_decrypt"];var n;(n=(0,h.Z)(function*(){try{if("undefined"==typeof document)return;const e=document.createElement("link"),{torusUrl:r}=yield Mt("production",{check:!1,hash:Wt,version:""});e.href=`${r}/popup`,e.crossOrigin="anonymous",e.type="text/html",e.rel="prefetch",e.relList&&e.relList.supports&&e.relList.supports("prefetch")&&document.head.appendChild(e)}catch(e){ae.warn(e)}}),function(){return n.apply(this,arguments)})();class sn{constructor(){let{buttonPosition:t=je.BOTTOM_LEFT,buttonSize:e=56,modalZIndex:r=99999,apiKey:a="torus-default"}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};i(this,"buttonPosition",je.BOTTOM_LEFT),i(this,"buttonSize",void 0),i(this,"torusUrl",void 0),i(this,"torusIframe",void 0),i(this,"styleLink",void 0),i(this,"isLoggedIn",void 0),i(this,"isInitialized",void 0),i(this,"torusWidgetVisibility",void 0),i(this,"torusAlert",void 0),i(this,"apiKey",void 0),i(this,"modalZIndex",void 0),i(this,"alertZIndex",void 0),i(this,"torusAlertContainer",void 0),i(this,"isIframeFullScreen",void 0),i(this,"whiteLabel",void 0),i(this,"requestedVerifier",void 0),i(this,"currentVerifier",void 0),i(this,"embedTranslations",void 0),i(this,"ethereum",void 0),i(this,"provider",void 0),i(this,"communicationMux",void 0),i(this,"isLoginCallback",void 0),i(this,"paymentProviders",Pe.paymentProviders),i(this,"loginHint",""),i(this,"useWalletConnect",void 0),i(this,"isCustomLogin",!1),this.buttonPosition=t,this.buttonSize=e,this.torusUrl="",this.isLoggedIn=!1,this.isInitialized=!1,this.torusWidgetVisibility=!0,this.requestedVerifier="",this.currentVerifier="",this.apiKey=a,function(n){J=n}(a),this.modalZIndex=r,this.alertZIndex=r+1e3,this.isIframeFullScreen=!1}init(){var t=arguments,e=this;return(0,h.Z)(function*(){let{buildEnv:r=Rt.PRODUCTION,enableLogging:a=!1,enabledVerifiers:l=rn,network:y={host:"mainnet",chainId:null,networkName:"",blockExplorer:"",ticker:"",tickerName:""},loginConfig:C={},showTorusButton:P=!0,integrity:D={check:!1,hash:Wt,version:""},whiteLabel:T,skipTKey:H=!1,useWalletConnect:K=!1,mfaLevel:Y="default"}=t.length>0&&void 0!==t[0]?t[0]:{};if(e.isInitialized)throw new Error("Already initialized");const{torusUrl:V,logLevel:ne}=yield Mt(r,D);ae.info(V,"url loaded"),e.torusUrl=V,e.whiteLabel=T,e.useWalletConnect=K,e.isCustomLogin=!!(C&&Object.keys(C).length>0)||!!(T&&Object.keys(T).length>0),ae.setDefaultLevel(ne),a?ae.enableAll():ae.disableAll(),e.torusWidgetVisibility=P;const le=new URL(V);le.pathname.endsWith("/")?le.pathname+="popup":le.pathname+="/popup",le.hash=`#isCustomLogin=${e.isCustomLogin}`,e.torusIframe=Ve(`<iframe\n id="torusIframe"\n allow=${K?"camera":""}\n class="torusIframe"\n src="${le.href}"\n style="display: none; position: fixed; top: 0; right: 0; width: 100%; color-scheme: none;\n height: 100%; border: none; border-radius: 0; z-index: ${e.modalZIndex}"\n ></iframe>`),e.torusAlertContainer=Ve('<div id="torusAlertContainer"></div>'),e.torusAlertContainer.style.display="none",e.torusAlertContainer.style.setProperty("z-index",e.alertZIndex.toString());const te=window.document.createElement("link");te.setAttribute("rel","stylesheet"),te.setAttribute("type","text/css"),te.setAttribute("href",`${V}/css/widget.css`),e.styleLink=te;const{defaultLanguage:se=It(),customTranslations:Qe={}}=e.whiteLabel||{},Ht=_()(Pe.translations,Qe)[se]||Pe.translations[It()];e.embedTranslations=Ht.embed;const ge=function(){var ot=(0,h.Z)(function*(){return yield function(){return nt.apply(this,arguments)}(),new Promise((We,ut)=>{e.torusIframe.onload=(0,h.Z)(function*(){e._setupWeb3();const $e=e.communicationMux.getStream("init_stream");$e.on("data",on=>{const{name:un,data:ln,error:Ft}=on;"init_complete"===un&&ln.success?(e.isInitialized=!0,e._displayIframe(e.isIframeFullScreen),We(void 0)):Ft&&ut(new Error(Ft))}),$e.write({name:"init_stream",data:{enabledVerifiers:l,loginConfig:C,whiteLabel:e.whiteLabel,buttonPosition:e.buttonPosition,buttonSize:e.buttonSize,torusWidgetVisibility:e.torusWidgetVisibility,apiKey:e.apiKey,skipTKey:H,network:y,mfaLevel:Y}})}),window.document.head.appendChild(e.styleLink),window.document.body.appendChild(e.torusIframe),window.document.body.appendChild(e.torusAlertContainer)})});return function(){return ot.apply(this,arguments)}}();if("production"===r&&D.check){const ot=`${V}/popup`,We=yield fetch(ot,{cache:"reload"});if("max-age=3600"!==We.headers.get("Cache-Control"))throw new Error(`Unexpected Cache-Control headers, got ${We.headers.get("Cache-Control")}`);const $e=((n,t)=>{const e=(n=>({algorithms:n.algorithms||["sha256"],delimiter:n.delimiter||" ",full:n.full||!1}))(n),r={hashes:Jr(e,t),integrity:void 0};return r.integrity=((n,t)=>{let e="";return e+=Object.keys(t.hashes).map(r=>`${r}-${t.hashes[r]}`).join(n.delimiter),e})(e,r),e.full?r:r.integrity})({algorithms:["sha384"]},yield We.text());if(ae.info($e,"integrity"),$e!==D.hash)throw e.clearInit(),new Error("Integrity check failed");yield ge()}else yield ge()})()}login(){let{verifier:t="",login_hint:e=""}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(!this.isInitialized)throw new Error("Call init() first");return this.requestedVerifier=t,this.loginHint=e,this.ethereum.enable()}logout(){return new Promise((t,e)=>{if(!this.isLoggedIn)return void e(new Error("User has not logged in yet"));this.communicationMux.getStream("logout").write({name:"logOut"});const a=this.communicationMux.getStream("status");Ae(a,"data",y=>{y.loggedIn?e(new Error("Some Error Occured")):(this.isLoggedIn=!1,this.currentVerifier="",this.requestedVerifier="",t())})})}cleanUp(){var t=this;return(0,h.Z)(function*(){t.isLoggedIn&&(yield t.logout()),t.clearInit()})()}clearInit(){function t(e){return e instanceof Element||e instanceof HTMLDocument}t(this.styleLink)&&window.document.body.contains(this.styleLink)&&(this.styleLink.remove(),this.styleLink=void 0),t(this.torusIframe)&&window.document.body.contains(this.torusIframe)&&(this.torusIframe.remove(),this.torusIframe=void 0),t(this.torusAlertContainer)&&window.document.body.contains(this.torusAlertContainer)&&(this.torusAlert=void 0,this.torusAlertContainer.remove(),this.torusAlertContainer=void 0),this.isInitialized=!1}hideTorusButton(){this.torusWidgetVisibility=!1,this._sendWidgetVisibilityStatus(!1),this._displayIframe()}showTorusButton(){this.torusWidgetVisibility=!0,this._sendWidgetVisibilityStatus(!0),this._displayIframe()}setProvider(t){let{host:e="mainnet",chainId:r=null,networkName:a=""}=t,l=function(n,t){if(null==n)return{};var r,a,e=function(n,t){if(null==n)return{};var a,l,e={},r=Object.keys(n);for(l=0;l<r.length;l++)!(t.indexOf(a=r[l])>=0)&&(e[a]=n[a]);return e}(n,t);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(n);for(a=0;a<l.length;a++)!(t.indexOf(r=l[a])>=0)&&(!Object.prototype.propertyIsEnumerable.call(n,r)||(e[r]=n[r]))}return e}(t,en);return new Promise((y,C)=>{const P=this.communicationMux.getStream("provider_change");Ae(P,"data",H=>{const{err:K,success:Y}=H.data;ae.info(H),K?C(K):Y?y():C(new Error("some error occured"))});const T=Ue();this._handleWindow(T,{target:"_blank",features:Nt}),P.write({name:"show_provider_change",data:{network:tn({host:e,chainId:r,networkName:a},l),preopenInstanceId:T,override:!1}})})}showWallet(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const r=this.communicationMux.getStream("show_wallet"),a=t?`/${t}`:"";r.write({name:"show_wallet",data:{path:a}}),Ae(r,"data",y=>{if("show_wallet_instance"===y.name){const{instanceId:C}=y.data,P=new URL(`${this.torusUrl}/wallet${a}`);P.searchParams.append("integrity","true"),P.searchParams.append("instanceId",C),Object.keys(e).forEach(T=>{P.searchParams.append(T,e[T])}),P.hash=`#isCustomLogin=${this.isCustomLogin}`,new Ut({url:P,features:"directories=0,titlebar=0,toolbar=0,status=0,location=0,menubar=0,height=740,width=1315"}).open()}})}getPublicAddress(t){return(0,h.Z)(function*(){let{verifier:e,verifierId:r,isExtended:a=!1}=t;if(!Pe.supportedVerifierList.includes(e)||!rt[e])throw new Error("Unsupported verifier");const l=e,y=rt[e],C=new URL("https://api.tor.us/lookup/torus");return C.searchParams.append("verifier",y),C.searchParams.append("verifierId",r),C.searchParams.append("walletVerifier",l),C.searchParams.append("network","mainnet"),C.searchParams.append("isExtended",a.toString()),u(C.href,{headers:{"Content-Type":"application/json; charset=utf-8"}},{useAPIKey:!0})})()}getUserInfo(t){return new Promise((e,r)=>{if(this.isLoggedIn){const a=this.communicationMux.getStream("user_info_access");a.write({name:"user_info_access_request"}),Ae(a,"data",y=>{const{name:C,data:{approved:P,payload:D,rejected:T,newRequest:H}}=y;if("user_info_access_response"===C)if(P)e(D);else if(T)r(new Error("User rejected the request"));else if(H){const K=this.communicationMux.getStream("user_info");Ae(K,"data",ne=>{"user_info_response"===ne.name&&(ne.data.approved?e(ne.data.payload):r(new Error("User rejected the request")))});const V=Ue();this._handleWindow(V,{target:"_blank",features:Nt}),K.write({name:"user_info_request",data:{message:t,preopenInstanceId:V}})}})}else r(new Error("User has not logged in yet"))})}initiateTopup(t,e){return new Promise((r,a)=>{if(this.isInitialized){const{errors:l,isValid:y}=((n,t)=>{const e={};if(!n)return{errors:e,isValid:!0};if(n&&!At[n])return e.provider="Invalid Provider",{errors:e,isValid:0===Object.keys(e).length};const r=At[n],a=t||{};if(a.fiatValue){const l=+parseFloat(a.fiatValue.toString())||0;l<r.minOrderValue&&(e.fiatValue="Requested amount is lower than supported"),l>r.maxOrderValue&&r.enforceMax&&(e.fiatValue="Requested amount is higher than supported")}if(a.selectedCurrency&&!r.validCurrencies.includes(a.selectedCurrency)&&(e.selectedCurrency="Unsupported currency"),a.selectedCryptoCurrency){const l=Object.values(r.validCryptoCurrenciesByChain).flat().map(C=>C.value),y=n===oe.MOONPAY?a.selectedCryptoCurrency.toLowerCase():a.selectedCryptoCurrency;l&&!l.includes(y)&&(e.selectedCryptoCurrency="Unsupported cryptoCurrency")}return{errors:e,isValid:0===Object.keys(e).length}})(t,e);if(!y)return void a(new Error(JSON.stringify(l)));const C=this.communicationMux.getStream("topup");Ae(C,"data",T=>{"topup_response"===T.name&&(T.data.success?r(T.data.success):a(new Error(T.data.error)))});const D=Ue();this._handleWindow(D),C.write({name:"topup_request",data:{provider:t,params:e,preopenInstanceId:D}})}else a(new Error("Torus is not initialized yet"))})}loginWithPrivateKey(t){var e=this;return(0,h.Z)(function*(){const{privateKey:r,userInfo:a}=t;return new Promise((l,y)=>{if(e.isInitialized){if(32!==Buffer.from(r,"hex").length)return void y(new Error("Invalid private key, Please provide a 32 byte valid secp25k1 private key"));const C=e.communicationMux.getStream("login_with_private_key");Ae(C,"data",D=>{"login_with_private_key_response"===D.name&&(D.data.success?l(D.data.success):y(new Error(D.data.error)))}),C.write({name:"login_with_private_key_request",data:{privateKey:r,userInfo:a}})}else y(new Error("Torus is not initialized yet"))})})()}showWalletConnectScanner(){var t=this;return(0,h.Z)(function*(){if(!t.useWalletConnect)throw new Error("Set `useWalletConnect` as true in init function options to use wallet connect scanner");return new Promise((e,r)=>{if(t.isLoggedIn){const a=t.communicationMux.getStream("wallet_connect_stream");Ae(a,"data",y=>{"wallet_connect_stream_res"===y.name&&(y.data.success?e(y.data.success):r(new Error(y.data.error)),t._displayIframe())}),a.write({name:"wallet_connect_stream_req"}),t._displayIframe(!0)}else r(new Error("User has not logged in yet"))})})()}_handleWindow(t){let{url:e,target:r,features:a}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(t){const l=this.communicationMux.getStream("window"),y=new URL(e||`${this.torusUrl}/redirect?preopenInstanceId=${t}`);y.hash?y.hash+=`&isCustomLogin=${this.isCustomLogin}`:y.hash=`#isCustomLogin=${this.isCustomLogin}`;const C=new Ut({url:y,target:r,features:a});if(C.open(),!C.window)return void this._createPopupBlockAlert(t,y.href);l.write({name:"opened_window",data:{preopenInstanceId:t}});const P=D=>{let{preopenInstanceId:T,close:H}=D;T===t&&H&&(C.close(),l.removeListener("data",P))};l.on("data",P),C.once("close",()=>{l.write({data:{preopenInstanceId:t,closed:!0}}),l.removeListener("data",P)})}}_setEmbedWhiteLabel(t){const{theme:e}=this.whiteLabel||{};if(e){const{isDark:r=!1,colors:a={}}=e;r&&t.classList.add("torus-dark"),a.torusBrand1&&t.style.setProperty("--torus-brand-1",a.torusBrand1),a.torusGray2&&t.style.setProperty("--torus-gray-2",a.torusGray2)}}_getLogoUrl(){var t,e;let r=`${this.torusUrl}/images/torus_icon-blue.svg`;var a,l;return r=null!==(t=this.whiteLabel)&&void 0!==t&&null!==(e=t.theme)&&void 0!==e&&e.isDark?(null===(a=this.whiteLabel)||void 0===a?void 0:a.logoLight)||r:(null===(l=this.whiteLabel)||void 0===l?void 0:l.logoDark)||r,r}_sendWidgetVisibilityStatus(t){this.communicationMux.getStream("torus-widget-visibility").write({data:t})}_displayIframe(){let t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];const e={},r=this.buttonSize+14;if(t)e.display="block",e.width="100%",e.height="100%",e.top="0px",e.right="0px",e.left="0px",e.bottom="0px";else switch(e.display=this.torusWidgetVisibility?"block":"none",e.height=`${r}px`,e.width=`${r}px`,this.buttonPosition){case je.TOP_LEFT:e.top="0px",e.left="0px",e.right="auto",e.bottom="auto";break;case je.TOP_RIGHT:e.top="0px",e.right="0px",e.left="auto",e.bottom="auto";break;case je.BOTTOM_RIGHT:e.bottom="0px",e.right="0px",e.top="auto",e.left="auto";break;default:e.bottom="0px",e.left="0px",e.top="auto",e.right="auto"}Object.assign(this.torusIframe.style,e),this.isIframeFullScreen=t}_setupWeb3(){ae.info("setupWeb3 running");const t=new gt({name:"embed_metamask",target:"iframe_metamask",targetWindow:this.torusIframe.contentWindow,targetOrigin:new URL(this.torusUrl).origin}),e=new gt({name:"embed_comm",target:"iframe_comm",targetWindow:this.torusIframe.contentWindow,targetOrigin:new URL(this.torusUrl).origin}),r=new Ge(t),a=T=>{const H=r[T];r[T]=function(Y){if(Y&&"eth_requestAccounts"===Y)return r.enable();for(var V=arguments.length,ne=new Array(V>1?V-1:0),le=1;le<V;le++)ne[le-1]=arguments[le];return H.apply(this,[Y,...ne])}};a("send"),a("sendAsync"),r.enable=()=>new Promise((T,H)=>{r.sendAsync({jsonrpc:"2.0",id:Ue(),method:"eth_requestAccounts",params:[]},(K,Y)=>{const{result:V}=Y||{};if(K)setTimeout(()=>{H(K)},50);else if(Array.isArray(V)&&V.length>0){const ne=()=>{if(""!==this.requestedVerifier&&this.currentVerifier!==this.requestedVerifier){const{requestedVerifier:le}=this;this.logout().then(te=>{this.requestedVerifier=le,this._showLoginPopup(!0,T,H)}).catch(te=>H(te))}else T(V)};this.isLoggedIn?ne():this.isLoginCallback=ne}else this._showLoginPopup(!0,T,H)})}),r.tryPreopenHandle=(T,H)=>{const K=T;if(!Array.isArray(K)&&an.includes(K.method)){const Y=Ue();this._handleWindow(Y,{target:"_blank",features:Lt}),K.preopenInstanceId=Y}r._rpcEngine.handle(K,H)};const l=new Proxy(r,{deleteProperty:()=>!0});this.ethereum=l;const y=function(n){var t=new Ct;return t.getStream=function(r){return this._substreams[r]?this._substreams[r]:this.createStream(r)},Xe()(n,t,n,function(e){e&&window.console.error(e)}),t}(e);this.communicationMux=y,y.getStream("window").on("data",T=>{"create_window"===T.name&&this._createPopupBlockAlert(T.data.preopenInstanceId,T.data.url)}),y.getStream("widget").on("data",T=>{const{data:H}=T;this._displayIframe(H)}),y.getStream("status").on("data",T=>{T.loggedIn?(this.isLoggedIn=T.loggedIn,this.currentVerifier=T.verifier):this._displayIframe(),this.isLoginCallback&&(this.isLoginCallback(),delete this.isLoginCallback)}),this.provider=l,this.provider.shouldSendMetadata&&function(n){at.apply(this,arguments)}(this.provider._rpcEngine),r._initializeState(),ae.debug("Torus - injected provider")}_showLoginPopup(t,e,r){const a=y=>{const{err:C,selectedAddress:P}=y;C?(ae.error(C),r&&r(C)):e&&e([P]),this.isIframeFullScreen&&this._displayIframe()},l=this.communicationMux.getStream("oauth");if(this.requestedVerifier){Ae(l,"data",a);const y=Ue();this._handleWindow(y),l.write({name:"oauth",data:{calledFromEmbed:t,verifier:this.requestedVerifier,preopenInstanceId:y,login_hint:this.loginHint}})}else this._displayIframe(!0),Ae(l,"data",a),l.write({name:"oauth_modal",data:{calledFromEmbed:t}})}_createPopupBlockAlert(t,e){const r=this._getLogoUrl(),a=Ve(`<div id="torusAlert" class="torus-alert--v2"><div id="torusAlert__logo"><img src="${r}" /></div><div><h1 id="torusAlert__title">${this.embedTranslations.actionRequired}</h1><p id="torusAlert__desc">${this.embedTranslations.pendingAction}</p></div></div>`),l=Ve(`<div><a id="torusAlert__btn">${this.embedTranslations.continue}</a></div>`),y=Ve('<div id="torusAlert__btn-container"></div>');y.appendChild(l),a.appendChild(y),this._setEmbedWhiteLabel(a),Pt(()=>{this.torusAlertContainer.style.display="block",this.torusAlertContainer.appendChild(a)}),Pt(()=>{l.addEventListener("click",()=>{this._handleWindow(t,{url:e,target:"_blank",features:Lt}),a.remove(),0===this.torusAlertContainer.children.length&&(this.torusAlertContainer.style.display="none")})})}}},8199:(k,g,d)=>{"use strict";Object.defineProperty(g,"__esModule",{value:!0}),g.EthereumProviderError=g.EthereumRpcError=void 0;const h=d(47300);class A extends Error{constructor(i,b,_){if(!Number.isInteger(i))throw new Error('"code" must be an integer.');if(!b||"string"!=typeof b)throw new Error('"message" must be a nonempty string.');super(b),this.code=i,void 0!==_&&(this.data=_)}serialize(){const i={code:this.code,message:this.message};return void 0!==this.data&&(i.data=this.data),this.stack&&(i.stack=this.stack),i}toString(){return h.default(this.serialize(),m,2)}}function m(f,i){if("[Circular]"!==i)return i}g.EthereumRpcError=A,g.EthereumProviderError=class extends A{constructor(i,b,_){if(f=i,!(Number.isInteger(f)&&f>=1e3&&f<=4999))throw new Error('"code" must be an integer such that: 1000 <= code <= 4999');var f;super(i,b,_)}}},78150:(k,g)=>{"use strict";Object.defineProperty(g,"__esModule",{value:!0}),g.errorValues=g.errorCodes=void 0,g.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}},g.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."}}},1587:(k,g,d)=>{"use strict";Object.defineProperty(g,"__esModule",{value:!0}),g.ethErrors=void 0;const h=d(8199),A=d(35633),w=d(78150);function p(i,b){const[_,j]=f(b);return new h.EthereumRpcError(i,_||A.getMessageFromCode(i),j)}function m(i,b){const[_,j]=f(b);return new h.EthereumProviderError(i,_||A.getMessageFromCode(i),j)}function f(i){if(i){if("string"==typeof i)return[i];if("object"==typeof i&&!Array.isArray(i)){const{message:b,data:_}=i;if(b&&"string"!=typeof b)throw new Error("Must specify string message.");return[b||void 0,_]}}return[]}g.ethErrors={rpc:{parse:i=>p(w.errorCodes.rpc.parse,i),invalidRequest:i=>p(w.errorCodes.rpc.invalidRequest,i),invalidParams:i=>p(w.errorCodes.rpc.invalidParams,i),methodNotFound:i=>p(w.errorCodes.rpc.methodNotFound,i),internal:i=>p(w.errorCodes.rpc.internal,i),server:i=>{if(!i||"object"!=typeof i||Array.isArray(i))throw new Error("Ethereum RPC Server errors must provide single object argument.");const{code:b}=i;if(!Number.isInteger(b)||b>-32005||b<-32099)throw new Error('"code" must be an integer such that: -32099 <= code <= -32005');return p(b,i)},invalidInput:i=>p(w.errorCodes.rpc.invalidInput,i),resourceNotFound:i=>p(w.errorCodes.rpc.resourceNotFound,i),resourceUnavailable:i=>p(w.errorCodes.rpc.resourceUnavailable,i),transactionRejected:i=>p(w.errorCodes.rpc.transactionRejected,i),methodNotSupported:i=>p(w.errorCodes.rpc.methodNotSupported,i),limitExceeded:i=>p(w.errorCodes.rpc.limitExceeded,i)},provider:{userRejectedRequest:i=>m(w.errorCodes.provider.userRejectedRequest,i),unauthorized:i=>m(w.errorCodes.provider.unauthorized,i),unsupportedMethod:i=>m(w.errorCodes.provider.unsupportedMethod,i),disconnected:i=>m(w.errorCodes.provider.disconnected,i),chainDisconnected:i=>m(w.errorCodes.provider.chainDisconnected,i),custom:i=>{if(!i||"object"!=typeof i||Array.isArray(i))throw new Error("Ethereum Provider custom errors must provide single object argument.");const{code:b,message:_,data:j}=i;if(!_||"string"!=typeof _)throw new Error('"message" must be a nonempty string');return new h.EthereumProviderError(b,_,j)}}}},83943:(k,g,d)=>{"use strict";g.Cg=g.Sy=void 0;const A=d(8199);Object.defineProperty(g,"Cg",{enumerable:!0,get:function(){return A.EthereumRpcError}});d(35633);const p=d(1587);Object.defineProperty(g,"Sy",{enumerable:!0,get:function(){return p.ethErrors}});d(78150)},35633:(k,g,d)=>{"use strict";Object.defineProperty(g,"__esModule",{value:!0}),g.serializeError=g.isValidCode=g.getMessageFromCode=g.JSON_RPC_SERVER_ERROR_MESSAGE=void 0;const h=d(78150),A=d(8199),w=h.errorCodes.rpc.internal,m={code:w,message:f(w)};function f(O,R="Unspecified error message. This is a bug, please report it."){if(Number.isInteger(O)){const $=O.toString();if(z(h.errorValues,$))return h.errorValues[$].message;if(_(O))return g.JSON_RPC_SERVER_ERROR_MESSAGE}return R}function i(O){if(!Number.isInteger(O))return!1;const R=O.toString();return!(!h.errorValues[R]&&!_(O))}function _(O){return O>=-32099&&O<=-32e3}function j(O){return O&&"object"==typeof O&&!Array.isArray(O)?Object.assign({},O):O}function z(O,R){return Object.prototype.hasOwnProperty.call(O,R)}g.JSON_RPC_SERVER_ERROR_MESSAGE="Unspecified server error.",g.getMessageFromCode=f,g.isValidCode=i,g.serializeError=function(O,{fallbackError:R=m,shouldIncludeStack:$=!1}={}){var J,U;if(!R||!Number.isInteger(R.code)||"string"!=typeof R.message)throw new Error("Must provide fallback error with integer number code and string message.");if(O instanceof A.EthereumRpcError)return O.serialize();const L={};if(O&&"object"==typeof O&&!Array.isArray(O)&&z(O,"code")&&i(O.code)){const E=O;L.code=E.code,E.message&&"string"==typeof E.message?(L.message=E.message,z(E,"data")&&(L.data=E.data)):(L.message=f(L.code),L.data={originalError:j(O)})}else{L.code=R.code;const E=null===(J=O)||void 0===J?void 0:J.message;L.message=E&&"string"==typeof E?E:R.message,L.data={originalError:j(O)}}const S=null===(U=O)||void 0===U?void 0:U.stack;return $&&O&&S&&"string"==typeof S&&(L.stack=S),L}},62195:(k,g,d)=>{"use strict";var A=d(49152);function w(_,j){return void 0===j&&(j="utf8"),Buffer.isBuffer(_)?f(_.toString("base64")):f(Buffer.from(_,j).toString("base64"))}function m(_){return _=_.toString(),A.default(_).replace(/\-/g,"+").replace(/_/g,"/")}function f(_){return _.replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}var b=w;b.encode=w,b.decode=function(_,j){return void 0===j&&(j="utf8"),Buffer.from(m(_),"base64").toString(j)},b.toBase64=m,b.fromBase64=f,b.toBuffer=function(_){return Buffer.from(m(_),"base64")},g.default=b},49152:(k,g)=>{"use strict";Object.defineProperty(g,"__esModule",{value:!0}),g.default=function(h){var w=h.length,p=w%4;if(!p)return h;var m=w,f=4-p,b=Buffer.alloc(w+f);for(b.write(h);f--;)b.write("=",m++);return b.toString()}},37092:(k,g,d)=>{k.exports=d(62195).default,k.exports.default=k.exports},93605:(k,g,d)=>{function J(U){return Object.prototype.toString.call(U)}g.isArray=function(U){return Array.isArray?Array.isArray(U):"[object Array]"===J(U)},g.isBoolean=function(U){return"boolean"==typeof U},g.isNull=function(U){return null===U},g.isNullOrUndefined=function(U){return null==U},g.isNumber=function(U){return"number"==typeof U},g.isString=function(U){return"string"==typeof U},g.isSymbol=function(U){return"symbol"==typeof U},g.isUndefined=function(U){return void 0===U},g.isRegExp=function(U){return"[object RegExp]"===J(U)},g.isObject=function(U){return"object"==typeof U&&null!==U},g.isDate=function(U){return"[object Date]"===J(U)},g.isError=function(U){return"[object Error]"===J(U)||U instanceof Error},g.isFunction=function(U){return"function"==typeof U},g.isPrimitive=function(U){return null===U||"boolean"==typeof U||"number"==typeof U||"string"==typeof U||"symbol"==typeof U||void 0===U},g.isBuffer=d(3875).Buffer.isBuffer},75859:(k,g,d)=>{var h=d(99318),A=function(){},m=function(f,i,b){if("function"==typeof i)return m(f,null,i);i||(i={}),b=h(b||A);var _=f._writableState,j=f._readableState,z=i.readable||!1!==i.readable&&f.readable,O=i.writable||!1!==i.writable&&f.writable,R=!1,$=function(){f.writable||J()},J=function(){O=!1,z||b.call(f)},U=function(){z=!1,O||b.call(f)},L=function(G){b.call(f,G?new Error("exited with error code: "+G):null)},S=function(G){b.call(f,G)},E=function(){process.nextTick(I)},I=function(){if(!R){if(z&&(!j||!j.ended||j.destroyed))return b.call(f,new Error("premature close"));if(O&&(!_||!_.ended||_.destroyed))return b.call(f,new Error("premature close"))}},Q=function(){f.req.on("finish",J)};return function(f){return f.setHeader&&"function"==typeof f.abort}(f)?(f.on("complete",J),f.on("abort",E),f.req?Q():f.on("request",Q)):O&&!_&&(f.on("end",$),f.on("close",$)),function(f){return f.stdio&&Array.isArray(f.stdio)&&3===f.stdio.length}(f)&&f.on("exit",L),f.on("end",U),f.on("finish",J),!1!==i.error&&f.on("error",S),f.on("close",E),function(){R=!0,f.removeListener("complete",J),f.removeListener("abort",E),f.removeListener("request",Q),f.req&&f.req.removeListener("finish",J),f.removeListener("end",$),f.removeListener("close",$),f.removeListener("finish",J),f.removeListener("exit",L),f.removeListener("end",U),f.removeListener("error",S),f.removeListener("close",E)}};k.exports=m},95439:k=>{"use strict";k.exports=function g(d,h){if(d===h)return!0;if(d&&h&&"object"==typeof d&&"object"==typeof h){if(d.constructor!==h.constructor)return!1;var A,w,p;if(Array.isArray(d)){if((A=d.length)!=h.length)return!1;for(w=A;0!=w--;)if(!g(d[w],h[w]))return!1;return!0}if(d.constructor===RegExp)return d.source===h.source&&d.flags===h.flags;if(d.valueOf!==Object.prototype.valueOf)return d.valueOf()===h.valueOf();if(d.toString!==Object.prototype.toString)return d.toString()===h.toString();if((A=(p=Object.keys(d)).length)!==Object.keys(h).length)return!1;for(w=A;0!=w--;)if(!Object.prototype.hasOwnProperty.call(h,p[w]))return!1;for(w=A;0!=w--;){var m=p[w];if(!g(d[m],h[m]))return!1}return!0}return d!=d&&h!=h}},78936:k=>{"use strict";const g=d=>null!==d&&"object"==typeof d&&"function"==typeof d.pipe;g.writable=d=>g(d)&&!1!==d.writable&&"function"==typeof d._write&&"object"==typeof d._writableState,g.readable=d=>g(d)&&!1!==d.readable&&"function"==typeof d._read&&"object"==typeof d._readableState,g.duplex=d=>g.writable(d)&&g.readable(d),g.transform=d=>g.duplex(d)&&"function"==typeof d._transform,k.exports=g},58330:function(k,g,d){var h,A;!function(w,p){"use strict";h=function(){var w=function(){},p="undefined",m=typeof window!==p&&typeof window.navigator!==p&&/Trident\/|MSIE /.test(window.navigator.userAgent),f=["trace","debug","info","warn","error"];function i(L,S){var E=L[S];if("function"==typeof E.bind)return E.bind(L);try{return Function.prototype.bind.call(E,L)}catch{return function(){return Function.prototype.apply.apply(E,[L,arguments])}}}function b(){console.log&&(console.log.apply?console.log.apply(console,arguments):Function.prototype.apply.apply(console.log,[console,arguments])),console.trace&&console.trace()}function _(L){return"debug"===L&&(L="log"),typeof console!==p&&("trace"===L&&m?b:void 0!==console[L]?i(console,L):void 0!==console.log?i(console,"log"):w)}function j(L,S){for(var E=0;E<f.length;E++){var I=f[E];this[I]=E<L?w:this.methodFactory(I,L,S)}this.log=this.debug}function z(L,S,E){return function(){typeof console!==p&&(j.call(this,S,E),this[L].apply(this,arguments))}}function O(L,S,E){return _(L)||z.apply(this,arguments)}function R(L,S,E){var Q,I=this;S=S??"WARN";var G="loglevel";function be(){var Z;if(typeof window!==p&&G){try{Z=window.localStorage[G]}catch{}if(typeof Z===p)try{var de=window.document.cookie,pe=de.indexOf(encodeURIComponent(G)+"=");-1!==pe&&(Z=/^([^;]+)/.exec(de.slice(pe))[1])}catch{}return void 0===I.levels[Z]&&(Z=void 0),Z}}"string"==typeof L?G+=":"+L:"symbol"==typeof L&&(G=void 0),I.name=L,I.levels={TRACE:0,DEBUG:1,INFO:2,WARN:3,ERROR:4,SILENT:5},I.methodFactory=E||O,I.getLevel=function(){return Q},I.setLevel=function(Z,de){if("string"==typeof Z&&void 0!==I.levels[Z.toUpperCase()]&&(Z=I.levels[Z.toUpperCase()]),!("number"==typeof Z&&Z>=0&&Z<=I.levels.SILENT))throw"log.setLevel() called with invalid level: "+Z;if(Q=Z,!1!==de&&function(Z){var de=(f[Z]||"silent").toUpperCase();if(typeof window!==p&&G){try{return void(window.localStorage[G]=de)}catch{}try{window.document.cookie=encodeURIComponent(G)+"="+de+";"}catch{}}}(Z),j.call(I,Z,L),typeof console===p&&Z<I.levels.SILENT)return"No console available for logging"},I.setDefaultLevel=function(Z){S=Z,be()||I.setLevel(Z,!1)},I.resetLevel=function(){I.setLevel(S,!1),function(){if(typeof window!==p&&G){try{return void window.localStorage.removeItem(G)}catch{}try{window.document.cookie=encodeURIComponent(G)+"=; expires=Thu, 01 Jan 1970 00:00:00 UTC"}catch{}}}()},I.enableAll=function(Z){I.setLevel(I.levels.TRACE,Z)},I.disableAll=function(Z){I.setLevel(I.levels.SILENT,Z)};var he=be();null==he&&(he=S),I.setLevel(he,!1)}var $=new R,J={};$.getLogger=function(S){if("symbol"!=typeof S&&"string"!=typeof S||""===S)throw new TypeError("You must supply a name when creating a logger.");var E=J[S];return E||(E=J[S]=new R(S,$.getLevel(),$.methodFactory)),E};var U=typeof window!==p?window.log:void 0;return $.noConflict=function(){return typeof window!==p&&window.log===$&&(window.log=U),$},$.getLoggers=function(){return J},$.default=$,$},void 0!==(A=h.call(g,d,g,k))&&(k.exports=A)}()},99318:(k,g,d)=>{var h=d(99006);function A(p){var m=function(){return m.called?m.value:(m.called=!0,m.value=p.apply(this,arguments))};return m.called=!1,m}function w(p){var m=function(){if(m.called)throw new Error(m.onceError);return m.called=!0,m.value=p.apply(this,arguments)};return m.onceError=(p.name||"Function wrapped with `once`")+" shouldn't be called more than once",m.called=!1,m}k.exports=h(A),k.exports.strict=h(w),A.proto=A(function(){Object.defineProperty(Function.prototype,"once",{value:function(){return A(this)},configurable:!0}),Object.defineProperty(Function.prototype,"onceStrict",{value:function(){return w(this)},configurable:!0})})},16349:k=>{"use strict";k.exports="undefined"==typeof process||!process.version||0===process.version.indexOf("v0.")||0===process.version.indexOf("v1.")&&0!==process.version.indexOf("v1.8.")?{nextTick:function(d,h,A,w){if("function"!=typeof d)throw new TypeError('"callback" argument must be a function');var m,f,p=arguments.length;switch(p){case 0:case 1:return process.nextTick(d);case 2:return process.nextTick(function(){d.call(null,h)});case 3:return process.nextTick(function(){d.call(null,h,A)});case 4:return process.nextTick(function(){d.call(null,h,A,w)});default:for(m=new Array(p-1),f=0;f<m.length;)m[f++]=arguments[f];return process.nextTick(function(){d.apply(null,m)})}}}:process},30968:(k,g,d)=>{var h=d(99318),A=d(75859),w=d(71156),p=function(){},m=/^v?\.0/.test(process.version),f=function(R){return"function"==typeof R},_=function(R,$,J,U){U=h(U);var L=!1;R.on("close",function(){L=!0}),A(R,{readable:$,writable:J},function(E){if(E)return U(E);L=!0,U()});var S=!1;return function(E){if(!L&&!S){if(S=!0,function(R){return!(!m||!w)&&(R instanceof(w.ReadStream||p)||R instanceof(w.WriteStream||p))&&f(R.close)}(R))return R.close(p);if(function(R){return R.setHeader&&f(R.abort)}(R))return R.abort();if(f(R.destroy))return R.destroy();U(E||new Error("stream was destroyed"))}}},j=function(R){R()},z=function(R,$){return R.pipe($)};k.exports=function(){var R=Array.prototype.slice.call(arguments),$=f(R[R.length-1]||p)&&R.pop()||p;if(Array.isArray(R[0])&&(R=R[0]),R.length<2)throw new Error("pump requires two streams per minimum");var J,U=R.map(function(L,S){var E=S<R.length-1;return _(L,E,S>0,function(Q){J||(J=Q),Q&&U.forEach(j),!E&&(U.forEach(j),$(J))})});return R.reduce(z)}},12979:k=>{var g={}.toString;k.exports=Array.isArray||function(d){return"[object Array]"==g.call(d)}},84491:(k,g,d)=>{"use strict";var h=d(16349),A=Object.keys||function(O){var R=[];for(var $ in O)R.push($);return R};k.exports=_;var w=Object.create(d(93605));w.inherits=d(59879);var p=d(97866),m=d(3976);w.inherits(_,p);for(var f=A(m.prototype),i=0;i<f.length;i++){var b=f[i];_.prototype[b]||(_.prototype[b]=m.prototype[b])}function _(O){if(!(this instanceof _))return new _(O);p.call(this,O),m.call(this,O),O&&!1===O.readable&&(this.readable=!1),O&&!1===O.writable&&(this.writable=!1),this.allowHalfOpen=!0,O&&!1===O.allowHalfOpen&&(this.allowHalfOpen=!1),this.once("end",j)}function j(){this.allowHalfOpen||this._writableState.ended||h.nextTick(z,this)}function z(O){O.end()}Object.defineProperty(_.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),Object.defineProperty(_.prototype,"destroyed",{get:function(){return void 0!==this._readableState&&void 0!==this._writableState&&this._readableState.destroyed&&this._writableState.destroyed},set:function(O){void 0===this._readableState||void 0===this._writableState||(this._readableState.destroyed=O,this._writableState.destroyed=O)}}),_.prototype._destroy=function(O,R){this.push(null),this.end(),h.nextTick(R,O)}},44842:(k,g,d)=>{"use strict";k.exports=w;var h=d(71481),A=Object.create(d(93605));function w(p){if(!(this instanceof w))return new w(p);h.call(this,p)}A.inherits=d(59879),A.inherits(w,h),w.prototype._transform=function(p,m,f){f(null,p)}},97866:(k,g,d)=>{"use strict";var h=d(16349);k.exports=I;var w,A=d(12979);I.ReadableState=E,d(93105);var m=function(s,o){return s.listeners(o).length},f=d(78204),i=d(55859).Buffer,b=("undefined"!=typeof global?global:"undefined"!=typeof window?window:"undefined"!=typeof self?self:{}).Uint8Array||function(){},z=Object.create(d(93605));z.inherits=d(59879);var O=d(66882),R=void 0;R=O&&O.debuglog?O.debuglog("stream"):function(){};var U,$=d(52911),J=d(69559);z.inherits(I,f);var L=["error","close","destroy","pause","resume"];function E(s,o){var N=o instanceof(w=w||d(84491));this.objectMode=!!(s=s||{}).objectMode,N&&(this.objectMode=this.objectMode||!!s.readableObjectMode);var B=s.highWaterMark,q=s.readableHighWaterMark;this.highWaterMark=B||0===B?B:N&&(q||0===q)?q:this.objectMode?16:16384,this.highWaterMark=Math.floor(this.highWaterMark),this.buffer=new $,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.destroyed=!1,this.defaultEncoding=s.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,s.encoding&&(U||(U=d(57990).s),this.decoder=new U(s.encoding),this.encoding=s.encoding)}function I(s){if(w=w||d(84491),!(this instanceof I))return new I(s);this._readableState=new E(s,this),this.readable=!0,s&&("function"==typeof s.read&&(this._read=s.read),"function"==typeof s.destroy&&(this._destroy=s.destroy)),f.call(this)}function Q(s,o,N,B,q){var X,F=s._readableState;return null===o?(F.reading=!1,function(s,o){if(!o.ended){if(o.decoder){var N=o.decoder.end();N&&N.length&&(o.buffer.push(N),o.length+=o.objectMode?1:N.length)}o.ended=!0,pe(s)}}(s,F)):(q||(X=function(s,o){var N;return!function(s){return i.isBuffer(s)||s instanceof b}(o)&&"string"!=typeof o&&void 0!==o&&!s.objectMode&&(N=new TypeError("Invalid non-string/buffer chunk")),N}(F,o)),X?s.emit("error",X):F.objectMode||o&&o.length>0?("string"!=typeof o&&!F.objectMode&&Object.getPrototypeOf(o)!==i.prototype&&(o=function(s){return i.from(s)}(o)),B?F.endEmitted?s.emit("error",new Error("stream.unshift() after end event")):G(s,F,o,!0):F.ended?s.emit("error",new Error("stream.push() after EOF")):(F.reading=!1,F.decoder&&!N?(o=F.decoder.write(o),F.objectMode||0!==o.length?G(s,F,o,!1):Ce(s,F)):G(s,F,o,!1))):B||(F.reading=!1)),function(s){return!s.ended&&(s.needReadable||s.length<s.highWaterMark||0===s.length)}(F)}function G(s,o,N,B){o.flowing&&0===o.length&&!o.sync?(s.emit("data",N),s.read(0)):(o.length+=o.objectMode?1:N.length,B?o.buffer.unshift(N):o.buffer.push(N),o.needReadable&&pe(s)),Ce(s,o)}function Z(s,o){return s<=0||0===o.length&&o.ended?0:o.objectMode?1:s!=s?o.flowing&&o.length?o.buffer.head.data.length:o.length:(s>o.highWaterMark&&(o.highWaterMark=function(s){return s>=8388608?s=8388608:(s--,s|=s>>>1,s|=s>>>2,s|=s>>>4,s|=s>>>8,s|=s>>>16,s++),s}(s)),s<=o.length?s:o.ended?o.length:(o.needReadable=!0,0))}function pe(s){var o=s._readableState;o.needReadable=!1,o.emittedReadable||(R("emitReadable",o.flowing),o.emittedReadable=!0,o.sync?h.nextTick(ve,s):ve(s))}function ve(s){R("emit readable"),s.emit("readable"),v(s)}function Ce(s,o){o.readingMore||(o.readingMore=!0,h.nextTick(me,s,o))}function me(s,o){for(var N=o.length;!o.reading&&!o.flowing&&!o.ended&&o.length<o.highWaterMark&&(R("maybeReadMore read 0"),s.read(0),N!==o.length);)N=o.length;o.readingMore=!1}function Te(s){R("readable nexttick read 0"),s.read(0)}function u(s,o){o.reading||(R("resume read 0"),s.read(0)),o.resumeScheduled=!1,o.awaitDrain=0,s.emit("resume"),v(s),o.flowing&&!o.reading&&s.read(0)}function v(s){var o=s._readableState;for(R("flow",o.flowing);o.flowing&&null!==s.read(););}function M(s,o){return 0===o.length?null:(o.objectMode?N=o.buffer.shift():!s||s>=o.length?(N=o.decoder?o.buffer.join(""):1===o.buffer.length?o.buffer.head.data:o.buffer.concat(o.length),o.buffer.clear()):N=function(s,o,N){var B;return s<o.head.data.length?(B=o.head.data.slice(0,s),o.head.data=o.head.data.slice(s)):B=s===o.head.data.length?o.shift():N?function(s,o){var N=o.head,B=1,q=N.data;for(s-=q.length;N=N.next;){var F=N.data,X=s>F.length?F.length:s;if(q+=X===F.length?F:F.slice(0,s),0==(s-=X)){X===F.length?(++B,o.head=N.next?N.next:o.tail=null):(o.head=N,N.data=F.slice(X));break}++B}return o.length-=B,q}(s,o):function(s,o){var N=i.allocUnsafe(s),B=o.head,q=1;for(B.data.copy(N),s-=B.data.length;B=B.next;){var F=B.data,X=s>F.length?F.length:s;if(F.copy(N,N.length-s,0,X),0==(s-=X)){X===F.length?(++q,o.head=B.next?B.next:o.tail=null):(o.head=B,B.data=F.slice(X));break}++q}return o.length-=q,N}(s,o),B}(s,o.buffer,o.decoder),N);var N}function ie(s){var o=s._readableState;if(o.length>0)throw new Error('"endReadable()" called on non-empty stream');o.endEmitted||(o.ended=!0,h.nextTick(re,o,s))}function re(s,o){!s.endEmitted&&0===s.length&&(s.endEmitted=!0,o.readable=!1,o.emit("end"))}function ce(s,o){for(var N=0,B=s.length;N<B;N++)if(s[N]===o)return N;return-1}Object.defineProperty(I.prototype,"destroyed",{get:function(){return void 0!==this._readableState&&this._readableState.destroyed},set:function(s){!this._readableState||(this._readableState.destroyed=s)}}),I.prototype.destroy=J.destroy,I.prototype._undestroy=J.undestroy,I.prototype._destroy=function(s,o){this.push(null),o(s)},I.prototype.push=function(s,o){var B,N=this._readableState;return N.objectMode?B=!0:"string"==typeof s&&((o=o||N.defaultEncoding)!==N.encoding&&(s=i.from(s,o),o=""),B=!0),Q(this,s,o,!1,B)},I.prototype.unshift=function(s){return Q(this,s,null,!0,!1)},I.prototype.isPaused=function(){return!1===this._readableState.flowing},I.prototype.setEncoding=function(s){return U||(U=d(57990).s),this._readableState.decoder=new U(s),this._readableState.encoding=s,this},I.prototype.read=function(s){R("read",s),s=parseInt(s,10);var o=this._readableState,N=s;if(0!==s&&(o.emittedReadable=!1),0===s&&o.needReadable&&(o.length>=o.highWaterMark||o.ended))return R("read: emitReadable",o.length,o.ended),0===o.length&&o.ended?ie(this):pe(this),null;if(0===(s=Z(s,o))&&o.ended)return 0===o.length&&ie(this),null;var q,B=o.needReadable;return R("need readable",B),(0===o.length||o.length-s<o.highWaterMark)&&R("length less than watermark",B=!0),o.ended||o.reading?R("reading or ended",B=!1):B&&(R("do read"),o.reading=!0,o.sync=!0,0===o.length&&(o.needReadable=!0),this._read(o.highWaterMark),o.sync=!1,o.reading||(s=Z(N,o))),null===(q=s>0?M(s,o):null)?(o.needReadable=!0,s=0):o.length-=s,0===o.length&&(o.ended||(o.needReadable=!0),N!==s&&o.ended&&ie(this)),null!==q&&this.emit("data",q),q},I.prototype._read=function(s){this.emit("error",new Error("_read() is not implemented"))},I.prototype.pipe=function(s,o){var N=this,B=this._readableState;switch(B.pipesCount){case 0:B.pipes=s;break;case 1:B.pipes=[B.pipes,s];break;default:B.pipes.push(s)}B.pipesCount+=1,R("pipe count=%d opts=%j",B.pipesCount,o);var F=o&&!1===o.end||s===process.stdout||s===process.stderr?Ne:De;function De(){R("onend"),s.end()}B.endEmitted?h.nextTick(F):N.once("end",F),s.on("unpipe",function X(_e,Re){R("onunpipe"),_e===N&&Re&&!1===Re.hasUnpiped&&(Re.hasUnpiped=!0,R("cleanup"),s.removeListener("close",Me),s.removeListener("finish",Ke),s.removeListener("drain",Se),s.removeListener("error",Fe),s.removeListener("unpipe",X),N.removeListener("end",De),N.removeListener("end",Ne),N.removeListener("data",ze),Je=!0,B.awaitDrain&&(!s._writableState||s._writableState.needDrain)&&Se())});var Se=function(s){return function(){var o=s._readableState;R("pipeOnDrain",o.awaitDrain),o.awaitDrain&&o.awaitDrain--,0===o.awaitDrain&&m(s,"data")&&(o.flowing=!0,v(s))}}(N);s.on("drain",Se);var Je=!1,He=!1;function ze(_e){R("ondata"),He=!1,!1===s.write(_e)&&!He&&((1===B.pipesCount&&B.pipes===s||B.pipesCount>1&&-1!==ce(B.pipes,s))&&!Je&&(R("false write response, pause",B.awaitDrain),B.awaitDrain++,He=!0),N.pause())}function Fe(_e){R("onerror",_e),Ne(),s.removeListener("error",Fe),0===m(s,"error")&&s.emit("error",_e)}function Me(){s.removeListener("finish",Ke),Ne()}function Ke(){R("onfinish"),s.removeListener("close",Me),Ne()}function Ne(){R("unpipe"),N.unpipe(s)}return N.on("data",ze),function(s,o,N){if("function"==typeof s.prependListener)return s.prependListener(o,N);s._events&&s._events[o]?A(s._events[o])?s._events[o].unshift(N):s._events[o]=[N,s._events[o]]:s.on(o,N)}(s,"error",Fe),s.once("close",Me),s.once("finish",Ke),s.emit("pipe",N),B.flowing||(R("pipe resume"),N.resume()),s},I.prototype.unpipe=function(s){var o=this._readableState,N={hasUnpiped:!1};if(0===o.pipesCount)return this;if(1===o.pipesCount)return s&&s!==o.pipes||(s||(s=o.pipes),o.pipes=null,o.pipesCount=0,o.flowing=!1,s&&s.emit("unpipe",this,N)),this;if(!s){var B=o.pipes,q=o.pipesCount;o.pipes=null,o.pipesCount=0,o.flowing=!1;for(var F=0;F<q;F++)B[F].emit("unpipe",this,{hasUnpiped:!1});return this}var X=ce(o.pipes,s);return-1===X||(o.pipes.splice(X,1),o.pipesCount-=1,1===o.pipesCount&&(o.pipes=o.pipes[0]),s.emit("unpipe",this,N)),this},I.prototype.addListener=I.prototype.on=function(s,o){var N=f.prototype.on.call(this,s,o);if("data"===s)!1!==this._readableState.flowing&&this.resume();else if("readable"===s){var B=this._readableState;!B.endEmitted&&!B.readableListening&&(B.readableListening=B.needReadable=!0,B.emittedReadable=!1,B.reading?B.length&&pe(this):h.nextTick(Te,this))}return N},I.prototype.resume=function(){var s=this._readableState;return s.flowing||(R("resume"),s.flowing=!0,function(s,o){o.resumeScheduled||(o.resumeScheduled=!0,h.nextTick(u,s,o))}(this,s)),this},I.prototype.pause=function(){return R("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(R("pause"),this._readableState.flowing=!1,this.emit("pause")),this},I.prototype.wrap=function(s){var o=this,N=this._readableState,B=!1;for(var q in s.on("end",function(){if(R("wrapped end"),N.decoder&&!N.ended){var X=N.decoder.end();X&&X.length&&o.push(X)}o.push(null)}),s.on("data",function(X){R("wrapped data"),N.decoder&&(X=N.decoder.write(X)),N.objectMode&&null==X||!(N.objectMode||X&&X.length)||o.push(X)||(B=!0,s.pause())}),s)void 0===this[q]&&"function"==typeof s[q]&&(this[q]=function(X){return function(){return s[X].apply(s,arguments)}}(q));for(var F=0;F<L.length;F++)s.on(L[F],this.emit.bind(this,L[F]));return this._read=function(X){R("wrapped _read",X),B&&(B=!1,s.resume())},this},Object.defineProperty(I.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}}),I._fromList=M},71481:(k,g,d)=>{"use strict";k.exports=p;var h=d(84491),A=Object.create(d(93605));function w(i,b){var _=this._transformState;_.transforming=!1;var j=_.writecb;if(!j)return this.emit("error",new Error("write callback called multiple times"));_.writechunk=null,_.writecb=null,null!=b&&this.push(b),j(i);var z=this._readableState;z.reading=!1,(z.needReadable||z.length<z.highWaterMark)&&this._read(z.highWaterMark)}function p(i){if(!(this instanceof p))return new p(i);h.call(this,i),this._transformState={afterTransform:w.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null},this._readableState.needReadable=!0,this._readableState.sync=!1,i&&("function"==typeof i.transform&&(this._transform=i.transform),"function"==typeof i.flush&&(this._flush=i.flush)),this.on("prefinish",m)}function m(){var i=this;"function"==typeof this._flush?this._flush(function(b,_){f(i,b,_)}):f(this,null,null)}function f(i,b,_){if(b)return i.emit("error",b);if(null!=_&&i.push(_),i._writableState.length)throw new Error("Calling transform done when ws.length != 0");if(i._transformState.transforming)throw new Error("Calling transform done when still transforming");return i.push(null)}A.inherits=d(59879),A.inherits(p,h),p.prototype.push=function(i,b){return this._transformState.needTransform=!1,h.prototype.push.call(this,i,b)},p.prototype._transform=function(i,b,_){throw new Error("_transform() is not implemented")},p.prototype._write=function(i,b,_){var j=this._transformState;if(j.writecb=_,j.writechunk=i,j.writeencoding=b,!j.transforming){var z=this._readableState;(j.needTransform||z.needReadable||z.length<z.highWaterMark)&&this._read(z.highWaterMark)}},p.prototype._read=function(i){var b=this._transformState;null!==b.writechunk&&b.writecb&&!b.transforming?(b.transforming=!0,this._transform(b.writechunk,b.writeencoding,b.afterTransform)):b.needTransform=!0},p.prototype._destroy=function(i,b){var _=this;h.prototype._destroy.call(this,i,function(j){b(j),_.emit("close")})}},3976:(k,g,d)=>{"use strict";var h=d(16349);function w(c){var u=this;this.next=null,this.entry=null,this.finish=function(){!function(c,u,v){var M=c.entry;for(c.entry=null;M;){var W=M.callback;u.pendingcb--,W(undefined),M=M.next}u.corkedRequestsFree.next=c}(u,c)}}k.exports=L;var m,p=!process.browser&&["v0.10","v0.9."].indexOf(process.version.slice(0,5))>-1?setImmediate:h.nextTick;L.WritableState=J;var f=Object.create(d(93605));f.inherits=d(59879);var U,i={deprecate:d(15822)},b=d(78204),_=d(55859).Buffer,j=("undefined"!=typeof global?global:"undefined"!=typeof window?window:"undefined"!=typeof self?self:{}).Uint8Array||function(){},R=d(69559);function $(){}function J(c,u){m=m||d(84491);var v=u instanceof m;this.objectMode=!!(c=c||{}).objectMode,v&&(this.objectMode=this.objectMode||!!c.writableObjectMode);var M=c.highWaterMark,W=c.writableHighWaterMark;this.highWaterMark=M||0===M?M:v&&(W||0===W)?W:this.objectMode?16:16384,this.highWaterMark=Math.floor(this.highWaterMark),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1,this.decodeStrings=!(!1===c.decodeStrings),this.defaultEncoding=c.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(ie){!function(c,u){var v=c._writableState,M=v.sync,W=v.writecb;if(function(c){c.writing=!1,c.writecb=null,c.length-=c.writelen,c.writelen=0}(v),u)!function(c,u,v,M,W){--u.pendingcb,v?(h.nextTick(W,M),h.nextTick(me,c,u),c._writableState.errorEmitted=!0,c.emit("error",M)):(W(M),c._writableState.errorEmitted=!0,c.emit("error",M),me(c,u))}(c,v,M,u,W);else{var x=pe(v);!x&&!v.corked&&!v.bufferProcessing&&v.bufferedRequest&&de(c,v),M?p(he,c,v,x,W):he(c,v,x,W)}}(u,ie)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.bufferedRequestCount=0,this.corkedRequestsFree=new w(this)}function L(c){if(m=m||d(84491),!(U.call(L,this)||this instanceof m))return new L(c);this._writableState=new J(c,this),this.writable=!0,c&&("function"==typeof c.write&&(this._write=c.write),"function"==typeof c.writev&&(this._writev=c.writev),"function"==typeof c.destroy&&(this._destroy=c.destroy),"function"==typeof c.final&&(this._final=c.final)),b.call(this)}function G(c,u,v,M,W,x,ee){u.writelen=M,u.writecb=ee,u.writing=!0,u.sync=!0,v?c._writev(W,u.onwrite):c._write(W,x,u.onwrite),u.sync=!1}function he(c,u,v,M){v||function(c,u){0===u.length&&u.needDrain&&(u.needDrain=!1,c.emit("drain"))}(c,u),u.pendingcb--,M(),me(c,u)}function de(c,u){u.bufferProcessing=!0;var v=u.bufferedRequest;if(c._writev&&v&&v.next){var W=new Array(u.bufferedRequestCount),x=u.corkedRequestsFree;x.entry=v;for(var ee=0,ie=!0;v;)W[ee]=v,v.isBuf||(ie=!1),v=v.next,ee+=1;W.allBuffers=ie,G(c,u,!0,u.length,W,"",x.finish),u.pendingcb++,u.lastBufferedRequest=null,x.next?(u.corkedRequestsFree=x.next,x.next=null):u.corkedRequestsFree=new w(u),u.bufferedRequestCount=0}else{for(;v;){var re=v.chunk;if(G(c,u,!1,u.objectMode?1:re.length,re,v.encoding,v.callback),v=v.next,u.bufferedRequestCount--,u.writing)break}null===v&&(u.lastBufferedRequest=null)}u.bufferedRequest=v,u.bufferProcessing=!1}function pe(c){return c.ending&&0===c.length&&null===c.bufferedRequest&&!c.finished&&!c.writing}function ve(c,u){c._final(function(v){u.pendingcb--,v&&c.emit("error",v),u.prefinished=!0,c.emit("prefinish"),me(c,u)})}function me(c,u){var v=pe(u);return v&&(function(c,u){!u.prefinished&&!u.finalCalled&&("function"==typeof c._final?(u.pendingcb++,u.finalCalled=!0,h.nextTick(ve,c,u)):(u.prefinished=!0,c.emit("prefinish")))}(c,u),0===u.pendingcb&&(u.finished=!0,c.emit("finish"))),v}f.inherits(L,b),J.prototype.getBuffer=function(){for(var u=this.bufferedRequest,v=[];u;)v.push(u),u=u.next;return v},function(){try{Object.defineProperty(J.prototype,"buffer",{get:i.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch{}}(),"function"==typeof Symbol&&Symbol.hasInstance&&"function"==typeof Function.prototype[Symbol.hasInstance]?(U=Function.prototype[Symbol.hasInstance],Object.defineProperty(L,Symbol.hasInstance,{value:function(c){return!!U.call(this,c)||this===L&&c&&c._writableState instanceof J}})):U=function(c){return c instanceof this},L.prototype.pipe=function(){this.emit("error",new Error("Cannot pipe, not readable"))},L.prototype.write=function(c,u,v){var M=this._writableState,W=!1,x=!M.objectMode&&function(c){return _.isBuffer(c)||c instanceof j}(c);return x&&!_.isBuffer(c)&&(c=function(c){return _.from(c)}(c)),"function"==typeof u&&(v=u,u=null),x?u="buffer":u||(u=M.defaultEncoding),"function"!=typeof v&&(v=$),M.ended?function(c,u){var v=new Error("write after end");c.emit("error",v),h.nextTick(u,v)}(this,v):(x||function(c,u,v,M){var W=!0,x=!1;return null===v?x=new TypeError("May not write null values to stream"):"string"!=typeof v&&void 0!==v&&!u.objectMode&&(x=new TypeError("Invalid non-string/buffer chunk")),x&&(c.emit("error",x),h.nextTick(M,x),W=!1),W}(this,M,c,v))&&(M.pendingcb++,W=function(c,u,v,M,W,x){if(!v){var ee=function(c,u,v){return!c.objectMode&&!1!==c.decodeStrings&&"string"==typeof u&&(u=_.from(u,v)),u}(u,M,W);M!==ee&&(v=!0,W="buffer",M=ee)}var ie=u.objectMode?1:M.length;u.length+=ie;var re=u.length<u.highWaterMark;if(re||(u.needDrain=!0),u.writing||u.corked){var ce=u.lastBufferedRequest;u.lastBufferedRequest={chunk:M,encoding:W,isBuf:v,callback:x,next:null},ce?ce.next=u.lastBufferedRequest:u.bufferedRequest=u.lastBufferedRequest,u.bufferedRequestCount+=1}else G(c,u,!1,ie,M,W,x);return re}(this,M,x,c,u,v)),W},L.prototype.cork=function(){this._writableState.corked++},L.prototype.uncork=function(){var c=this._writableState;c.corked&&(c.corked--,!c.writing&&!c.corked&&!c.bufferProcessing&&c.bufferedRequest&&de(this,c))},L.prototype.setDefaultEncoding=function(u){if("string"==typeof u&&(u=u.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((u+"").toLowerCase())>-1))throw new TypeError("Unknown encoding: "+u);return this._writableState.defaultEncoding=u,this},Object.defineProperty(L.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),L.prototype._write=function(c,u,v){v(new Error("_write() is not implemented"))},L.prototype._writev=null,L.prototype.end=function(c,u,v){var M=this._writableState;"function"==typeof c?(v=c,c=null,u=null):"function"==typeof u&&(v=u,u=null),null!=c&&this.write(c,u),M.corked&&(M.corked=1,this.uncork()),M.ending||function(c,u,v){u.ending=!0,me(c,u),v&&(u.finished?h.nextTick(v):c.once("finish",v)),u.ended=!0,c.writable=!1}(this,M,v)},Object.defineProperty(L.prototype,"destroyed",{get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(c){!this._writableState||(this._writableState.destroyed=c)}}),L.prototype.destroy=R.destroy,L.prototype._undestroy=R.undestroy,L.prototype._destroy=function(c,u){this.end(),u(c)}},52911:(k,g,d)=>{"use strict";var A=d(55859).Buffer,w=d(50522);function p(m,f,i){m.copy(f,i)}k.exports=function(){function m(){(function(m,f){if(!(m instanceof f))throw new TypeError("Cannot call a class as a function")})(this,m),this.head=null,this.tail=null,this.length=0}return m.prototype.push=function(i){var b={data:i,next:null};this.length>0?this.tail.next=b:this.head=b,this.tail=b,++this.length},m.prototype.unshift=function(i){var b={data:i,next:this.head};0===this.length&&(this.tail=b),this.head=b,++this.length},m.prototype.shift=function(){if(0!==this.length){var i=this.head.data;return this.head=1===this.length?this.tail=null:this.head.next,--this.length,i}},m.prototype.clear=function(){this.head=this.tail=null,this.length=0},m.prototype.join=function(i){if(0===this.length)return"";for(var b=this.head,_=""+b.data;b=b.next;)_+=i+b.data;return _},m.prototype.concat=function(i){if(0===this.length)return A.alloc(0);for(var b=A.allocUnsafe(i>>>0),_=this.head,j=0;_;)p(_.data,b,j),j+=_.data.length,_=_.next;return b},m}(),w&&w.inspect&&w.inspect.custom&&(k.exports.prototype[w.inspect.custom]=function(){var m=w.inspect({length:this.length});return this.constructor.name+" "+m})},69559:(k,g,d)=>{"use strict";var h=d(16349);function p(m,f){m.emit("error",f)}k.exports={destroy:function(m,f){var i=this;return this._readableState&&this._readableState.destroyed||this._writableState&&this._writableState.destroyed?(f?f(m):m&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,h.nextTick(p,this,m)):h.nextTick(p,this,m)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(m||null,function(j){!f&&j?i._writableState?i._writableState.errorEmitted||(i._writableState.errorEmitted=!0,h.nextTick(p,i,j)):h.nextTick(p,i,j):f&&f(j)}),this)},undestroy:function(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finalCalled=!1,this._writableState.prefinished=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)}}},78204:(k,g,d)=>{k.exports=d(93105).EventEmitter},14560:(k,g,d)=>{(g=k.exports=d(97866)).Stream=g,g.Readable=g,g.Writable=d(3976),g.Duplex=d(84491),g.Transform=d(71481),g.PassThrough=d(44842)},57990:(k,g,d)=>{"use strict";var h=d(55859).Buffer,A=h.isEncoding||function(S){switch((S=""+S)&&S.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function m(S){var E;switch(this.encoding=function(S){var E=function(S){if(!S)return"utf8";for(var E;;)switch(S){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return S;default:if(E)return;S=(""+S).toLowerCase(),E=!0}}(S);if("string"!=typeof E&&(h.isEncoding===A||!A(S)))throw new Error("Unknown encoding: "+S);return E||S}(S),this.encoding){case"utf16le":this.text=O,this.end=R,E=4;break;case"utf8":this.fillLast=_,E=4;break;case"base64":this.text=$,this.end=J,E=3;break;default:return this.write=U,void(this.end=L)}this.lastNeed=0,this.lastTotal=0,this.lastChar=h.allocUnsafe(E)}function f(S){return S<=127?0:S>>5==6?2:S>>4==14?3:S>>3==30?4:S>>6==2?-1:-2}function _(S){var E=this.lastTotal-this.lastNeed,I=function(S,E,I){if(128!=(192&E[0]))return S.lastNeed=0,"\ufffd";if(S.lastNeed>1&&E.length>1){if(128!=(192&E[1]))return S.lastNeed=1,"\ufffd";if(S.lastNeed>2&&E.length>2&&128!=(192&E[2]))return S.lastNeed=2,"\ufffd"}}(this,S);return void 0!==I?I:this.lastNeed<=S.length?(S.copy(this.lastChar,E,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(S.copy(this.lastChar,E,0,S.length),void(this.lastNeed-=S.length))}function O(S,E){if((S.length-E)%2==0){var I=S.toString("utf16le",E);if(I){var Q=I.charCodeAt(I.length-1);if(Q>=55296&&Q<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=S[S.length-2],this.lastChar[1]=S[S.length-1],I.slice(0,-1)}return I}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=S[S.length-1],S.toString("utf16le",E,S.length-1)}function R(S){var E=S&&S.length?this.write(S):"";return this.lastNeed?E+this.lastChar.toString("utf16le",0,this.lastTotal-this.lastNeed):E}function $(S,E){var I=(S.length-E)%3;return 0===I?S.toString("base64",E):(this.lastNeed=3-I,this.lastTotal=3,1===I?this.lastChar[0]=S[S.length-1]:(this.lastChar[0]=S[S.length-2],this.lastChar[1]=S[S.length-1]),S.toString("base64",E,S.length-I))}function J(S){var E=S&&S.length?this.write(S):"";return this.lastNeed?E+this.lastChar.toString("base64",0,3-this.lastNeed):E}function U(S){return S.toString(this.encoding)}function L(S){return S&&S.length?this.write(S):""}g.s=m,m.prototype.write=function(S){if(0===S.length)return"";var E,I;if(this.lastNeed){if(void 0===(E=this.fillLast(S)))return"";I=this.lastNeed,this.lastNeed=0}else I=0;return I<S.length?E?E+this.text(S,I):this.text(S,I):E||""},m.prototype.end=function(S){var E=S&&S.length?this.write(S):"";return this.lastNeed?E+"\ufffd":E},m.prototype.text=function(S,E){var I=function(S,E,I){var Q=E.length-1;if(Q<I)return 0;var G=f(E[Q]);return G>=0?(G>0&&(S.lastNeed=G-1),G):--Q<I||-2===G?0:(G=f(E[Q]))>=0?(G>0&&(S.lastNeed=G-2),G):--Q<I||-2===G?0:(G=f(E[Q]))>=0?(G>0&&(2===G?G=0:S.lastNeed=G-3),G):0}(this,S,E);if(!this.lastNeed)return S.toString("utf8",E);this.lastTotal=I;var Q=S.length-(I-this.lastNeed);return S.copy(this.lastChar,0,Q),S.toString("utf8",E,Q)},m.prototype.fillLast=function(S){if(this.lastNeed<=S.length)return S.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);S.copy(this.lastChar,this.lastTotal-this.lastNeed,0,S.length),this.lastNeed-=S.length}},73529:(k,g,d)=>{var h=d(14560).Transform,A=d(71732).inherits,w=d(70166);function p(i){h.call(this,i),this._destroyed=!1}function m(i,b,_){_(null,i)}function f(i){return function(b,_,j){return"function"==typeof b&&(j=_,_=b,b={}),"function"!=typeof _&&(_=m),"function"!=typeof j&&(j=null),i(b,_,j)}}A(p,h),p.prototype.destroy=function(i){if(!this._destroyed){this._destroyed=!0;var b=this;process.nextTick(function(){i&&b.emit("error",i),b.emit("close")})}},k.exports=f(function(i,b,_){var j=new p(i);return j._transform=b,_&&(j._flush=_),j}),k.exports.ctor=f(function(i,b,_){function j(z){if(!(this instanceof j))return new j(z);this.options=w(i,z),p.call(this,this.options)}return A(j,p),j.prototype._transform=b,_&&(j.prototype._flush=_),j}),k.exports.obj=f(function(i,b,_){var j=new p(w({objectMode:!0,highWaterMark:16},i));return j._transform=b,_&&(j._flush=_),j})},99006:k=>{k.exports=function g(d,h){if(d&&h)return g(d)(h);if("function"!=typeof d)throw new TypeError("need wrapper function");return Object.keys(d).forEach(function(w){A[w]=d[w]}),A;function A(){for(var w=new Array(arguments.length),p=0;p<w.length;p++)w[p]=arguments[p];var m=d.apply(this,w),f=w[w.length-1];return"function"==typeof m&&m!==f&&Object.keys(f).forEach(function(i){m[i]=f[i]}),m}}},71156:()=>{},50522:()=>{},66882:()=>{},85438:(k,g,d)=>{var h=d(47369).default;function A(){"use strict";k.exports=A=function(){return p},k.exports.__esModule=!0,k.exports.default=k.exports;var w,p={},m=Object.prototype,f=m.hasOwnProperty,i=Object.defineProperty||function(c,u,v){c[u]=v.value},b="function"==typeof Symbol?Symbol:{},_=b.iterator||"@@iterator",j=b.asyncIterator||"@@asyncIterator",z=b.toStringTag||"@@toStringTag";function O(c,u,v){return Object.defineProperty(c,u,{value:v,enumerable:!0,configurable:!0,writable:!0}),c[u]}try{O({},"")}catch{O=function(v,M,W){return v[M]=W}}function R(c,u,v,M){var x=Object.create((u&&u.prototype instanceof I?u:I).prototype),ee=new Oe(M||[]);return i(x,"_invoke",{value:pe(c,v,ee)}),x}function $(c,u,v){try{return{type:"normal",arg:c.call(u,v)}}catch(M){return{type:"throw",arg:M}}}p.wrap=R;var J="suspendedStart",L="executing",S="completed",E={};function I(){}function Q(){}function G(){}var Ee={};O(Ee,_,function(){return this});var be=Object.getPrototypeOf,ye=be&&be(be(Te([])));ye&&ye!==m&&f.call(ye,_)&&(Ee=ye);var he=G.prototype=I.prototype=Object.create(Ee);function Z(c){["next","throw","return"].forEach(function(u){O(c,u,function(v){return this._invoke(u,v)})})}function de(c,u){function v(W,x,ee,ie){var re=$(c[W],c,x);if("throw"!==re.type){var ce=re.arg,s=ce.value;return s&&"object"==h(s)&&f.call(s,"__await")?u.resolve(s.__await).then(function(o){v("next",o,ee,ie)},function(o){v("throw",o,ee,ie)}):u.resolve(s).then(function(o){ce.value=o,ee(ce)},function(o){return v("throw",o,ee,ie)})}ie(re.arg)}var M;i(this,"_invoke",{value:function(x,ee){function ie(){return new u(function(re,ce){v(x,ee,re,ce)})}return M=M?M.then(ie,ie):ie()}})}function pe(c,u,v){var M=J;return function(W,x){if(M===L)throw new Error("Generator is already running");if(M===S){if("throw"===W)throw x;return{value:w,done:!0}}for(v.method=W,v.arg=x;;){var ee=v.delegate;if(ee){var ie=ve(ee,v);if(ie){if(ie===E)continue;return ie}}if("next"===v.method)v.sent=v._sent=v.arg;else if("throw"===v.method){if(M===J)throw M=S,v.arg;v.dispatchException(v.arg)}else"return"===v.method&&v.abrupt("return",v.arg);M=L;var re=$(c,u,v);if("normal"===re.type){if(M=v.done?S:"suspendedYield",re.arg===E)continue;return{value:re.arg,done:v.done}}"throw"===re.type&&(M=S,v.method="throw",v.arg=re.arg)}}}function ve(c,u){var v=u.method,M=c.iterator[v];if(M===w)return u.delegate=null,"throw"===v&&c.iterator.return&&(u.method="return",u.arg=w,ve(c,u),"throw"===u.method)||"return"!==v&&(u.method="throw",u.arg=new TypeError("The iterator does not provide a '"+v+"' method")),E;var W=$(M,c.iterator,u.arg);if("throw"===W.type)return u.method="throw",u.arg=W.arg,u.delegate=null,E;var x=W.arg;return x?x.done?(u[c.resultName]=x.value,u.next=c.nextLoc,"return"!==u.method&&(u.method="next",u.arg=w),u.delegate=null,E):x:(u.method="throw",u.arg=new TypeError("iterator result is not an object"),u.delegate=null,E)}function Ce(c){var u={tryLoc:c[0]};1 in c&&(u.catchLoc=c[1]),2 in c&&(u.finallyLoc=c[2],u.afterLoc=c[3]),this.tryEntries.push(u)}function me(c){var u=c.completion||{};u.type="normal",delete u.arg,c.completion=u}function Oe(c){this.tryEntries=[{tryLoc:"root"}],c.forEach(Ce,this),this.reset(!0)}function Te(c){if(c||""===c){var u=c[_];if(u)return u.call(c);if("function"==typeof c.next)return c;if(!isNaN(c.length)){var v=-1,M=function W(){for(;++v<c.length;)if(f.call(c,v))return W.value=c[v],W.done=!1,W;return W.value=w,W.done=!0,W};return M.next=M}}throw new TypeError(h(c)+" is not iterable")}return Q.prototype=G,i(he,"constructor",{value:G,configurable:!0}),i(G,"constructor",{value:Q,configurable:!0}),Q.displayName=O(G,z,"GeneratorFunction"),p.isGeneratorFunction=function(c){var u="function"==typeof c&&c.constructor;return!!u&&(u===Q||"GeneratorFunction"===(u.displayName||u.name))},p.mark=function(c){return Object.setPrototypeOf?Object.setPrototypeOf(c,G):(c.__proto__=G,O(c,z,"GeneratorFunction")),c.prototype=Object.create(he),c},p.awrap=function(c){return{__await:c}},Z(de.prototype),O(de.prototype,j,function(){return this}),p.AsyncIterator=de,p.async=function(c,u,v,M,W){void 0===W&&(W=Promise);var x=new de(R(c,u,v,M),W);return p.isGeneratorFunction(u)?x:x.next().then(function(ee){return ee.done?ee.value:x.next()})},Z(he),O(he,z,"Generator"),O(he,_,function(){return this}),O(he,"toString",function(){return"[object Generator]"}),p.keys=function(c){var u=Object(c),v=[];for(var M in u)v.push(M);return v.reverse(),function W(){for(;v.length;){var x=v.pop();if(x in u)return W.value=x,W.done=!1,W}return W.done=!0,W}},p.values=Te,Oe.prototype={constructor:Oe,reset:function(u){if(this.prev=0,this.next=0,this.sent=this._sent=w,this.done=!1,this.delegate=null,this.method="next",this.arg=w,this.tryEntries.forEach(me),!u)for(var v in this)"t"===v.charAt(0)&&f.call(this,v)&&!isNaN(+v.slice(1))&&(this[v]=w)},stop:function(){this.done=!0;var u=this.tryEntries[0].completion;if("throw"===u.type)throw u.arg;return this.rval},dispatchException:function(u){if(this.done)throw u;var v=this;function M(ce,s){return ee.type="throw",ee.arg=u,v.next=ce,s&&(v.method="next",v.arg=w),!!s}for(var W=this.tryEntries.length-1;W>=0;--W){var x=this.tryEntries[W],ee=x.completion;if("root"===x.tryLoc)return M("end");if(x.tryLoc<=this.prev){var ie=f.call(x,"catchLoc"),re=f.call(x,"finallyLoc");if(ie&&re){if(this.prev<x.catchLoc)return M(x.catchLoc,!0);if(this.prev<x.finallyLoc)return M(x.finallyLoc)}else if(ie){if(this.prev<x.catchLoc)return M(x.catchLoc,!0)}else{if(!re)throw new Error("try statement without catch or finally");if(this.prev<x.finallyLoc)return M(x.finallyLoc)}}}},abrupt:function(u,v){for(var M=this.tryEntries.length-1;M>=0;--M){var W=this.tryEntries[M];if(W.tryLoc<=this.prev&&f.call(W,"finallyLoc")&&this.prev<W.finallyLoc){var x=W;break}}x&&("break"===u||"continue"===u)&&x.tryLoc<=v&&v<=x.finallyLoc&&(x=null);var ee=x?x.completion:{};return ee.type=u,ee.arg=v,x?(this.method="next",this.next=x.finallyLoc,E):this.complete(ee)},complete:function(u,v){if("throw"===u.type)throw u.arg;return"break"===u.type||"continue"===u.type?this.next=u.arg:"return"===u.type?(this.rval=this.arg=u.arg,this.method="return",this.next="end"):"normal"===u.type&&v&&(this.next=v),E},finish:function(u){for(var v=this.tryEntries.length-1;v>=0;--v){var M=this.tryEntries[v];if(M.finallyLoc===u)return this.complete(M.completion,M.afterLoc),me(M),E}},catch:function(u){for(var v=this.tryEntries.length-1;v>=0;--v){var M=this.tryEntries[v];if(M.tryLoc===u){var W=M.completion;if("throw"===W.type){var x=W.arg;me(M)}return x}}throw new Error("illegal catch attempt")},delegateYield:function(u,v,M){return this.delegate={iterator:Te(u),resultName:v,nextLoc:M},"next"===this.method&&(this.arg=w),E}},p}k.exports=A,k.exports.__esModule=!0,k.exports.default=k.exports},47369:k=>{function g(d){return k.exports=g="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(h){return typeof h}:function(h){return h&&"function"==typeof Symbol&&h.constructor===Symbol&&h!==Symbol.prototype?"symbol":typeof h},k.exports.__esModule=!0,k.exports.default=k.exports,g(d)}k.exports=g,k.exports.__esModule=!0,k.exports.default=k.exports},50076:(k,g,d)=>{var h=d(85438)();k.exports=h;try{regeneratorRuntime=h}catch{"object"==typeof globalThis?globalThis.regeneratorRuntime=h:Function("r","regeneratorRuntime = r")(h)}}}]);